@mappedin/maplibre-overlay 6.0.1-beta.58 → 6.5.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{a as Bl}from"./chunk-ZPHHCS52.js";import{$ as Yt,B as Vm,C as v1,Fa as T1,Ha as I1,Ia as C1,Ja as M1,N as Lr,Oa as A1,U as jm,V as Ze,W as Gm,Y as In,Z as Zm,_ as ht,a as m,b,ba as Cn,e as y1,ea as Kr,f as g1,fa as P1,g as b1,i as $o,ib as Fl,qa as w1,r as x1,t as _1,wa as S1}from"./chunk-PS4IVNPZ.js";import{a as C,b as j,c as s,g as Mt,h as kr,i as J,j as S,k as At,l as hr,m as dr}from"./chunk-LUJQR5EH.js";var te=Mt((H5,O1)=>{"use strict";m();O1.exports=Pi;function Pi(t,e){this.x=t,this.y=e}s(Pi,"Point");Pi.prototype={clone:s(function(){return new Pi(this.x,this.y)},"clone"),add:s(function(t){return this.clone()._add(t)},"add"),sub:s(function(t){return this.clone()._sub(t)},"sub"),multByPoint:s(function(t){return this.clone()._multByPoint(t)},"multByPoint"),divByPoint:s(function(t){return this.clone()._divByPoint(t)},"divByPoint"),mult:s(function(t){return this.clone()._mult(t)},"mult"),div:s(function(t){return this.clone()._div(t)},"div"),rotate:s(function(t){return this.clone()._rotate(t)},"rotate"),rotateAround:s(function(t,e){return this.clone()._rotateAround(t,e)},"rotateAround"),matMult:s(function(t){return this.clone()._matMult(t)},"matMult"),unit:s(function(){return this.clone()._unit()},"unit"),perp:s(function(){return this.clone()._perp()},"perp"),round:s(function(){return this.clone()._round()},"round"),mag:s(function(){return Math.sqrt(this.x*this.x+this.y*this.y)},"mag"),equals:s(function(t){return this.x===t.x&&this.y===t.y},"equals"),dist:s(function(t){return Math.sqrt(this.distSqr(t))},"dist"),distSqr:s(function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},"distSqr"),angle:s(function(){return Math.atan2(this.y,this.x)},"angle"),angleTo:s(function(t){return Math.atan2(this.y-t.y,this.x-t.x)},"angleTo"),angleWith:s(function(t){return this.angleWithSep(t.x,t.y)},"angleWith"),angleWithSep:s(function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},"angleWithSep"),_matMult:s(function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},"_matMult"),_add:s(function(t){return this.x+=t.x,this.y+=t.y,this},"_add"),_sub:s(function(t){return this.x-=t.x,this.y-=t.y,this},"_sub"),_mult:s(function(t){return this.x*=t,this.y*=t,this},"_mult"),_div:s(function(t){return this.x/=t,this.y/=t,this},"_div"),_multByPoint:s(function(t){return this.x*=t.x,this.y*=t.y,this},"_multByPoint"),_divByPoint:s(function(t){return this.x/=t.x,this.y/=t.y,this},"_divByPoint"),_unit:s(function(){return this._div(this.mag()),this},"_unit"),_perp:s(function(){var t=this.y;return this.y=this.x,this.x=-t,this},"_perp"),_rotate:s(function(t){var e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},"_rotate"),_rotateAround:s(function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),o=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=o,this},"_rotateAround"),_round:s(function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},"_round")};Pi.convert=function(t){return t instanceof Pi?t:Array.isArray(t)?new Pi(t[0],t[1]):t}});var B1=Mt((Y5,F1)=>{"use strict";m();F1.exports=R1;function R1(t,e,r,i){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=i}s(R1,"UnitBezier");R1.prototype={sampleCurveX:s(function(t){return((this.ax*t+this.bx)*t+this.cx)*t},"sampleCurveX"),sampleCurveY:s(function(t){return((this.ay*t+this.by)*t+this.cy)*t},"sampleCurveY"),sampleCurveDerivativeX:s(function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},"sampleCurveDerivativeX"),solveCurveX:s(function(t,e){if(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,i=0;i<8;i++){var n=this.sampleCurveX(r)-t;if(Math.abs(n)<e)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r=r-n/o}var a=0,l=1;for(r=t,i=0;i<20&&(n=this.sampleCurveX(r),!(Math.abs(n-t)<e));i++)t>n?a=r:l=r,r=(l-a)*.5+a;return r},"solveCurveX"),solve:s(function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))},"solve")}});var Ew=Mt((j8,Ad)=>{m();function CD(t,e){var r,i,n,o,a,l,c,u,p,f;for(r=t.length&3,i=t.length-r,n=e,a=3432918353,c=461845907,f=0;f<i;)p=t.charCodeAt(f)&255|(t.charCodeAt(++f)&255)<<8|(t.charCodeAt(++f)&255)<<16|(t.charCodeAt(++f)&255)<<24,++f,p=(p&65535)*a+(((p>>>16)*a&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*c+(((p>>>16)*c&65535)<<16)&4294967295,n^=p,n=n<<13|n>>>19,o=(n&65535)*5+(((n>>>16)*5&65535)<<16)&4294967295,n=(o&65535)+27492+(((o>>>16)+58964&65535)<<16);switch(p=0,r){case 3:p^=(t.charCodeAt(f+2)&255)<<16;case 2:p^=(t.charCodeAt(f+1)&255)<<8;case 1:p^=t.charCodeAt(f)&255,p=(p&65535)*a+(((p>>>16)*a&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*c+(((p>>>16)*c&65535)<<16)&4294967295,n^=p}return n^=t.length,n^=n>>>16,n=(n&65535)*2246822507+(((n>>>16)*2246822507&65535)<<16)&4294967295,n^=n>>>13,n=(n&65535)*3266489909+(((n>>>16)*3266489909&65535)<<16)&4294967295,n^=n>>>16,n>>>0}s(CD,"murmurhash3_32_gc");typeof Ad<"u"&&(Ad.exports=CD)});var kw=Mt((X8,Ed)=>{m();function MD(t,e){for(var r=t.length,i=e^r,n=0,o;r>=4;)o=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),o^=o>>>24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),i=(i&65535)*1540483477+(((i>>>16)*1540483477&65535)<<16)^o,r-=4,++n;switch(r){case 3:i^=(t.charCodeAt(n+2)&255)<<16;case 2:i^=(t.charCodeAt(n+1)&255)<<8;case 1:i^=t.charCodeAt(n)&255,i=(i&65535)*1540483477+(((i>>>16)*1540483477&65535)<<16)}return i^=i>>>13,i=(i&65535)*1540483477+(((i>>>16)*1540483477&65535)<<16),i^=i>>>15,i>>>0}s(MD,"murmurhash2_32_gc");typeof Ed!==void 0&&(Ed.exports=MD)});var kd=Mt((W8,xc)=>{m();var Lw=Ew(),AD=kw();xc.exports=Lw;xc.exports.murmur3=Lw;xc.exports.murmur2=AD});var ly=Mt((HW,Ww)=>{"use strict";m();var fz=te();Ww.exports=ro;function ro(t,e,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n,t.readFields(hz,this,e)}s(ro,"VectorTileFeature");function hz(t,e,r){t==1?e.id=r.readVarint():t==2?dz(r,e):t==3?e.type=r.readVarint():t==4&&(e._geometry=r.pos)}s(hz,"readFeature");function dz(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}s(dz,"readTag");ro.types=["Unknown","Point","LineString","Polygon"];ro.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,o=0,a=[],l;t.pos<e;){if(i<=0){var c=t.readVarint();r=c&7,i=c>>3}if(i--,r===1||r===2)n+=t.readSVarint(),o+=t.readSVarint(),r===1&&(l&&a.push(l),l=[]),l.push(new fz(n,o));else if(r===7)l&&l.push(l[0].clone());else throw new Error("unknown command "+r)}return l&&a.push(l),a};ro.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,o=0,a=1/0,l=-1/0,c=1/0,u=-1/0;t.pos<e;){if(i<=0){var p=t.readVarint();r=p&7,i=p>>3}if(i--,r===1||r===2)n+=t.readSVarint(),o+=t.readSVarint(),n<a&&(a=n),n>l&&(l=n),o<c&&(c=o),o>u&&(u=o);else if(r!==7)throw new Error("unknown command "+r)}return[a,c,l,u]};ro.prototype.toGeoJSON=function(t,e,r){var i=this.extent*Math.pow(2,r),n=this.extent*t,o=this.extent*e,a=this.loadGeometry(),l=ro.types[this.type],c,u;function p(y){for(var g=0;g<y.length;g++){var x=y[g],_=180-(x.y+o)*360/i;y[g]=[(x.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp(_*Math.PI/180))-90]}}switch(s(p,"project"),this.type){case 1:var f=[];for(c=0;c<a.length;c++)f[c]=a[c][0];a=f,p(a);break;case 2:for(c=0;c<a.length;c++)p(a[c]);break;case 3:for(a=yz(a),c=0;c<a.length;c++)for(u=0;u<a[c].length;u++)p(a[c][u]);break}a.length===1?a=a[0]:l="Multi"+l;var h={type:"Feature",geometry:{type:l,coordinates:a},properties:this.properties};return"id"in this&&(h.id=this.id),h};function yz(t){var e=t.length;if(e<=1)return[t];for(var r=[],i,n,o=0;o<e;o++){var a=gz(t[o]);a!==0&&(n===void 0&&(n=a<0),n===a<0?(i&&r.push(i),i=[t[o]]):i.push(t[o]))}return i&&r.push(i),r}s(yz,"classifyRings");function gz(t){for(var e=0,r=0,i=t.length,n=i-1,o,a;r<i;n=r++)o=t[r],a=t[n],e+=(a.x-o.x)*(o.y+a.y);return e}s(gz,"signedArea")});var uy=Mt((YW,Jw)=>{"use strict";m();var bz=ly();Jw.exports=Yw;function Yw(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(xz,this,e),this.length=this._features.length}s(Yw,"VectorTileLayer");function xz(t,e,r){t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(_z(r))}s(xz,"readLayer");function _z(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}s(_z,"readValueMessage");Yw.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 bz(this._pbf,e,this.extent,this._keys,this._values)}});var Qw=Mt((QW,Kw)=>{"use strict";m();var vz=uy();Kw.exports=Pz;function Pz(t,e){this.layers=t.readFields(wz,{},e)}s(Pz,"VectorTile");function wz(t,e,r){if(t===3){var i=new vz(r,r.readVarint()+r.pos);i.length&&(e[i.name]=i)}}s(wz,"readTile")});var rs=Mt((rY,kc)=>{m();kc.exports.VectorTile=Qw();kc.exports.VectorTileFeature=ly();kc.exports.VectorTileLayer=uy()});var hS=Mt(hy=>{m();hy.read=function(t,e,r,i,n){var o,a,l=n*8-i-1,c=(1<<l)-1,u=c>>1,p=-7,f=r?n-1:0,h=r?-1:1,y=t[e+f];for(f+=h,o=y&(1<<-p)-1,y>>=-p,p+=l;p>0;o=o*256+t[e+f],f+=h,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=i;p>0;a=a*256+t[e+f],f+=h,p-=8);if(o===0)o=1-u;else{if(o===c)return a?NaN:(y?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-u}return(y?-1:1)*a*Math.pow(2,o-i)};hy.write=function(t,e,r,i,n,o){var a,l,c,u=o*8-n-1,p=(1<<u)-1,f=p>>1,h=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=i?0:o-1,g=i?1:-1,x=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+f>=1?e+=h/c:e+=h*Math.pow(2,1-f),e*c>=2&&(a++,c/=2),a+f>=p?(l=0,a=p):a+f>=1?(l=(e*c-1)*Math.pow(2,n),a=a+f):(l=e*Math.pow(2,f-1)*Math.pow(2,n),a=0));n>=8;t[r+y]=l&255,y+=g,l/=256,n-=8);for(a=a<<n|l,u+=n;u>0;t[r+y]=a&255,y+=g,a/=256,u-=8);t[r+y-g]|=x*128}});var yy=Mt((n7,xS)=>{"use strict";m();xS.exports=be;var zc=hS();function be(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}s(be,"Pbf");be.Varint=0;be.Fixed64=1;be.Bytes=2;be.Fixed32=5;var dy=65536*65536,dS=1/dy,Uz=12,bS=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");be.prototype={destroy:s(function(){this.buf=null},"destroy"),readFields:s(function(t,e,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,o=this.pos;this.type=i&7,t(n,e,this),this.pos===o&&this.skip(i)}return e},"readFields"),readMessage:s(function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},"readMessage"),readFixed32:s(function(){var t=Oc(this.buf,this.pos);return this.pos+=4,t},"readFixed32"),readSFixed32:s(function(){var t=gS(this.buf,this.pos);return this.pos+=4,t},"readSFixed32"),readFixed64:s(function(){var t=Oc(this.buf,this.pos)+Oc(this.buf,this.pos+4)*dy;return this.pos+=8,t},"readFixed64"),readSFixed64:s(function(){var t=Oc(this.buf,this.pos)+gS(this.buf,this.pos+4)*dy;return this.pos+=8,t},"readSFixed64"),readFloat:s(function(){var t=zc.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},"readFloat"),readDouble:s(function(){var t=zc.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},"readDouble"),readVarint:s(function(t){var e=this.buf,r,i;return i=e[this.pos++],r=i&127,i<128||(i=e[this.pos++],r|=(i&127)<<7,i<128)||(i=e[this.pos++],r|=(i&127)<<14,i<128)||(i=e[this.pos++],r|=(i&127)<<21,i<128)?r:(i=e[this.pos],r|=(i&15)<<28,Nz(r,t,this))},"readVarint"),readVarint64:s(function(){return this.readVarint(!0)},"readVarint64"),readSVarint:s(function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},"readSVarint"),readBoolean:s(function(){return!!this.readVarint()},"readBoolean"),readString:s(function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=Uz&&bS?eO(this.buf,e,t):Qz(this.buf,e,t)},"readString"),readBytes:s(function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},"readBytes"),readPackedVarint:s(function(t,e){if(this.type!==be.Bytes)return t.push(this.readVarint(e));var r=Vr(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},"readPackedVarint"),readPackedSVarint:s(function(t){if(this.type!==be.Bytes)return t.push(this.readSVarint());var e=Vr(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},"readPackedSVarint"),readPackedBoolean:s(function(t){if(this.type!==be.Bytes)return t.push(this.readBoolean());var e=Vr(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},"readPackedBoolean"),readPackedFloat:s(function(t){if(this.type!==be.Bytes)return t.push(this.readFloat());var e=Vr(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},"readPackedFloat"),readPackedDouble:s(function(t){if(this.type!==be.Bytes)return t.push(this.readDouble());var e=Vr(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},"readPackedDouble"),readPackedFixed32:s(function(t){if(this.type!==be.Bytes)return t.push(this.readFixed32());var e=Vr(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},"readPackedFixed32"),readPackedSFixed32:s(function(t){if(this.type!==be.Bytes)return t.push(this.readSFixed32());var e=Vr(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},"readPackedSFixed32"),readPackedFixed64:s(function(t){if(this.type!==be.Bytes)return t.push(this.readFixed64());var e=Vr(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},"readPackedFixed64"),readPackedSFixed64:s(function(t){if(this.type!==be.Bytes)return t.push(this.readSFixed64());var e=Vr(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},"readPackedSFixed64"),skip:s(function(t){var e=t&7;if(e===be.Varint)for(;this.buf[this.pos++]>127;);else if(e===be.Bytes)this.pos=this.readVarint()+this.pos;else if(e===be.Fixed32)this.pos+=4;else if(e===be.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},"skip"),writeTag:s(function(t,e){this.writeVarint(t<<3|e)},"writeTag"),realloc:s(function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},"realloc"),finish:s(function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},"finish"),writeFixed32:s(function(t){this.realloc(4),io(this.buf,t,this.pos),this.pos+=4},"writeFixed32"),writeSFixed32:s(function(t){this.realloc(4),io(this.buf,t,this.pos),this.pos+=4},"writeSFixed32"),writeFixed64:s(function(t){this.realloc(8),io(this.buf,t&-1,this.pos),io(this.buf,Math.floor(t*dS),this.pos+4),this.pos+=8},"writeFixed64"),writeSFixed64:s(function(t){this.realloc(8),io(this.buf,t&-1,this.pos),io(this.buf,Math.floor(t*dS),this.pos+4),this.pos+=8},"writeSFixed64"),writeVarint:s(function(t){if(t=+t||0,t>268435455||t<0){$z(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},"writeVarint"),writeSVarint:s(function(t){this.writeVarint(t<0?-t*2-1:t*2)},"writeSVarint"),writeBoolean:s(function(t){this.writeVarint(!!t)},"writeBoolean"),writeString:s(function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=tO(this.buf,t,this.pos);var r=this.pos-e;r>=128&&yS(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},"writeString"),writeFloat:s(function(t){this.realloc(4),zc.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},"writeFloat"),writeDouble:s(function(t){this.realloc(8),zc.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},"writeDouble"),writeBytes:s(function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},"writeBytes"),writeRawMessage:s(function(t,e){this.pos++;var r=this.pos;t(e,this);var i=this.pos-r;i>=128&&yS(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},"writeRawMessage"),writeMessage:s(function(t,e,r){this.writeTag(t,be.Bytes),this.writeRawMessage(e,r)},"writeMessage"),writePackedVarint:s(function(t,e){e.length&&this.writeMessage(t,Gz,e)},"writePackedVarint"),writePackedSVarint:s(function(t,e){e.length&&this.writeMessage(t,Zz,e)},"writePackedSVarint"),writePackedBoolean:s(function(t,e){e.length&&this.writeMessage(t,qz,e)},"writePackedBoolean"),writePackedFloat:s(function(t,e){e.length&&this.writeMessage(t,Xz,e)},"writePackedFloat"),writePackedDouble:s(function(t,e){e.length&&this.writeMessage(t,Hz,e)},"writePackedDouble"),writePackedFixed32:s(function(t,e){e.length&&this.writeMessage(t,Wz,e)},"writePackedFixed32"),writePackedSFixed32:s(function(t,e){e.length&&this.writeMessage(t,Yz,e)},"writePackedSFixed32"),writePackedFixed64:s(function(t,e){e.length&&this.writeMessage(t,Jz,e)},"writePackedFixed64"),writePackedSFixed64:s(function(t,e){e.length&&this.writeMessage(t,Kz,e)},"writePackedSFixed64"),writeBytesField:s(function(t,e){this.writeTag(t,be.Bytes),this.writeBytes(e)},"writeBytesField"),writeFixed32Field:s(function(t,e){this.writeTag(t,be.Fixed32),this.writeFixed32(e)},"writeFixed32Field"),writeSFixed32Field:s(function(t,e){this.writeTag(t,be.Fixed32),this.writeSFixed32(e)},"writeSFixed32Field"),writeFixed64Field:s(function(t,e){this.writeTag(t,be.Fixed64),this.writeFixed64(e)},"writeFixed64Field"),writeSFixed64Field:s(function(t,e){this.writeTag(t,be.Fixed64),this.writeSFixed64(e)},"writeSFixed64Field"),writeVarintField:s(function(t,e){this.writeTag(t,be.Varint),this.writeVarint(e)},"writeVarintField"),writeSVarintField:s(function(t,e){this.writeTag(t,be.Varint),this.writeSVarint(e)},"writeSVarintField"),writeStringField:s(function(t,e){this.writeTag(t,be.Bytes),this.writeString(e)},"writeStringField"),writeFloatField:s(function(t,e){this.writeTag(t,be.Fixed32),this.writeFloat(e)},"writeFloatField"),writeDoubleField:s(function(t,e){this.writeTag(t,be.Fixed64),this.writeDouble(e)},"writeDoubleField"),writeBooleanField:s(function(t,e){this.writeVarintField(t,!!e)},"writeBooleanField")};function Nz(t,e,r){var i=r.buf,n,o;if(o=i[r.pos++],n=(o&112)>>4,o<128||(o=i[r.pos++],n|=(o&127)<<3,o<128)||(o=i[r.pos++],n|=(o&127)<<10,o<128)||(o=i[r.pos++],n|=(o&127)<<17,o<128)||(o=i[r.pos++],n|=(o&127)<<24,o<128)||(o=i[r.pos++],n|=(o&1)<<31,o<128))return no(t,n,e);throw new Error("Expected varint not more than 10 bytes")}s(Nz,"readVarintRemainder");function Vr(t){return t.type===be.Bytes?t.readVarint()+t.pos:t.pos+1}s(Vr,"readPackedEnd");function no(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}s(no,"toNum");function $z(t,e){var r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(r=~(-t%4294967296),i=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),Vz(r,i,e),jz(i,e)}s($z,"writeBigVarint");function Vz(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}s(Vz,"writeBigVarintLow");function jz(t,e){var r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}s(jz,"writeBigVarintHigh");function yS(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}s(yS,"makeRoomForExtraLength");function Gz(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}s(Gz,"writePackedVarint");function Zz(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}s(Zz,"writePackedSVarint");function Xz(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}s(Xz,"writePackedFloat");function Hz(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}s(Hz,"writePackedDouble");function qz(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}s(qz,"writePackedBoolean");function Wz(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}s(Wz,"writePackedFixed32");function Yz(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}s(Yz,"writePackedSFixed32");function Jz(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}s(Jz,"writePackedFixed64");function Kz(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}s(Kz,"writePackedSFixed64");function Oc(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}s(Oc,"readUInt32");function io(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}s(io,"writeInt32");function gS(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}s(gS,"readInt32");function Qz(t,e,r){for(var i="",n=e;n<r;){var o=t[n],a=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l>r)break;var c,u,p;l===1?o<128&&(a=o):l===2?(c=t[n+1],(c&192)===128&&(a=(o&31)<<6|c&63,a<=127&&(a=null))):l===3?(c=t[n+1],u=t[n+2],(c&192)===128&&(u&192)===128&&(a=(o&15)<<12|(c&63)<<6|u&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):l===4&&(c=t[n+1],u=t[n+2],p=t[n+3],(c&192)===128&&(u&192)===128&&(p&192)===128&&(a=(o&15)<<18|(c&63)<<12|(u&63)<<6|p&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,l=1):a>65535&&(a-=65536,i+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),i+=String.fromCharCode(a),n+=l}return i}s(Qz,"readUtf8");function eO(t,e,r){return bS.decode(t.subarray(e,r))}s(eO,"readUtf8TextDecoder");function tO(t,e,r){for(var i=0,n,o;i<e.length;i++){if(n=e.charCodeAt(i),n>55295&&n<57344)if(o)if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=n;continue}else n=o-55296<<10|n-56320|65536,o=null;else{n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=n;continue}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=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++]=n&63|128)}return r}s(tO,"writeUtf8")});var XM=Mt((bl,ko)=>{m();var eN=200,CM="__lodash_hash_undefined__",tN=800,rN=16,MM=9007199254740991,AM="[object Arguments]",nN="[object Array]",iN="[object AsyncFunction]",oN="[object Boolean]",aN="[object Date]",sN="[object Error]",EM="[object Function]",lN="[object GeneratorFunction]",uN="[object Map]",cN="[object Number]",pN="[object Null]",kM="[object Object]",mN="[object Proxy]",fN="[object RegExp]",hN="[object Set]",dN="[object String]",yN="[object Undefined]",gN="[object WeakMap]",bN="[object ArrayBuffer]",xN="[object DataView]",_N="[object Float32Array]",vN="[object Float64Array]",PN="[object Int8Array]",wN="[object Int16Array]",SN="[object Int32Array]",TN="[object Uint8Array]",IN="[object Uint8ClampedArray]",CN="[object Uint16Array]",MN="[object Uint32Array]",AN=/[\\^$.*+?()[\]{}|]/g,EN=/^\[object .+?Constructor\]$/,kN=/^(?:0|[1-9]\d*)$/,Le={};Le[_N]=Le[vN]=Le[PN]=Le[wN]=Le[SN]=Le[TN]=Le[IN]=Le[CN]=Le[MN]=!0;Le[AM]=Le[nN]=Le[bN]=Le[oN]=Le[xN]=Le[aN]=Le[sN]=Le[EM]=Le[uN]=Le[cN]=Le[kM]=Le[fN]=Le[hN]=Le[dN]=Le[gN]=!1;var LM=typeof global=="object"&&global&&global.Object===Object&&global,LN=typeof self=="object"&&self&&self.Object===Object&&self,vl=LM||LN||Function("return this")(),DM=typeof bl=="object"&&bl&&!bl.nodeType&&bl,xl=DM&&typeof ko=="object"&&ko&&!ko.nodeType&&ko,zM=xl&&xl.exports===DM,m0=zM&&LM.process,bM=function(){try{var t=xl&&xl.require&&xl.require("util").types;return t||m0&&m0.binding&&m0.binding("util")}catch(e){}}(),xM=bM&&bM.isTypedArray;function DN(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}s(DN,"apply");function zN(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}s(zN,"baseTimes");function ON(t){return function(e){return t(e)}}s(ON,"baseUnary");function RN(t,e){return t==null?void 0:t[e]}s(RN,"getValue");function FN(t,e){return function(r){return t(e(r))}}s(FN,"overArg");var BN=Array.prototype,UN=Function.prototype,ym=Object.prototype,f0=vl["__core-js_shared__"],gm=UN.toString,qr=ym.hasOwnProperty,_M=function(){var t=/[^.]+$/.exec(f0&&f0.keys&&f0.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),OM=ym.toString,NN=gm.call(Object),$N=RegExp("^"+gm.call(qr).replace(AN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hm=zM?vl.Buffer:void 0,vM=vl.Symbol,PM=vl.Uint8Array,wM=hm?hm.allocUnsafe:void 0,RM=FN(Object.getPrototypeOf,Object),SM=Object.create,VN=ym.propertyIsEnumerable,jN=BN.splice,ci=vM?vM.toStringTag:void 0,dm=function(){try{var t=x0(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),GN=hm?hm.isBuffer:void 0,TM=Math.max,ZN=Date.now,FM=x0(vl,"Map"),_l=x0(Object,"create"),XN=function(){function t(){}return s(t,"object"),function(e){if(!mi(e))return{};if(SM)return SM(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function pi(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}s(pi,"Hash");function HN(){this.__data__=_l?_l(null):{},this.size=0}s(HN,"hashClear");function qN(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}s(qN,"hashDelete");function WN(t){var e=this.__data__;if(_l){var r=e[t];return r===CM?void 0:r}return qr.call(e,t)?e[t]:void 0}s(WN,"hashGet");function YN(t){var e=this.__data__;return _l?e[t]!==void 0:qr.call(e,t)}s(YN,"hashHas");function JN(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=_l&&e===void 0?CM:e,this}s(JN,"hashSet");pi.prototype.clear=HN;pi.prototype.delete=qN;pi.prototype.get=WN;pi.prototype.has=YN;pi.prototype.set=JN;function Wr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}s(Wr,"ListCache");function KN(){this.__data__=[],this.size=0}s(KN,"listCacheClear");function QN(t){var e=this.__data__,r=bm(e,t);if(r<0)return!1;var i=e.length-1;return r==i?e.pop():jN.call(e,r,1),--this.size,!0}s(QN,"listCacheDelete");function e$(t){var e=this.__data__,r=bm(e,t);return r<0?void 0:e[r][1]}s(e$,"listCacheGet");function t$(t){return bm(this.__data__,t)>-1}s(t$,"listCacheHas");function r$(t,e){var r=this.__data__,i=bm(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}s(r$,"listCacheSet");Wr.prototype.clear=KN;Wr.prototype.delete=QN;Wr.prototype.get=e$;Wr.prototype.has=t$;Wr.prototype.set=r$;function Lo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}s(Lo,"MapCache");function n$(){this.size=0,this.__data__={hash:new pi,map:new(FM||Wr),string:new pi}}s(n$,"mapCacheClear");function i$(t){var e=_m(this,t).delete(t);return this.size-=e?1:0,e}s(i$,"mapCacheDelete");function o$(t){return _m(this,t).get(t)}s(o$,"mapCacheGet");function a$(t){return _m(this,t).has(t)}s(a$,"mapCacheHas");function s$(t,e){var r=_m(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}s(s$,"mapCacheSet");Lo.prototype.clear=n$;Lo.prototype.delete=i$;Lo.prototype.get=o$;Lo.prototype.has=a$;Lo.prototype.set=s$;function Do(t){var e=this.__data__=new Wr(t);this.size=e.size}s(Do,"Stack");function l$(){this.__data__=new Wr,this.size=0}s(l$,"stackClear");function u$(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}s(u$,"stackDelete");function c$(t){return this.__data__.get(t)}s(c$,"stackGet");function p$(t){return this.__data__.has(t)}s(p$,"stackHas");function m$(t,e){var r=this.__data__;if(r instanceof Wr){var i=r.__data__;if(!FM||i.length<eN-1)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new Lo(i)}return r.set(t,e),this.size=r.size,this}s(m$,"stackSet");Do.prototype.clear=l$;Do.prototype.delete=u$;Do.prototype.get=c$;Do.prototype.has=p$;Do.prototype.set=m$;function f$(t,e){var r=g0(t),i=!r&&y0(t),n=!r&&!i&&$M(t),o=!r&&!i&&!n&&jM(t),a=r||i||n||o,l=a?zN(t.length,String):[],c=l.length;for(var u in t)(e||qr.call(t,u))&&!(a&&(u=="length"||n&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||UM(u,c)))&&l.push(u);return l}s(f$,"arrayLikeKeys");function h0(t,e,r){(r!==void 0&&!vm(t[e],r)||r===void 0&&!(e in t))&&b0(t,e,r)}s(h0,"assignMergeValue");function h$(t,e,r){var i=t[e];(!(qr.call(t,e)&&vm(i,r))||r===void 0&&!(e in t))&&b0(t,e,r)}s(h$,"assignValue");function bm(t,e){for(var r=t.length;r--;)if(vm(t[r][0],e))return r;return-1}s(bm,"assocIndexOf");function b0(t,e,r){e=="__proto__"&&dm?dm(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}s(b0,"baseAssignValue");var d$=M$();function xm(t){return t==null?t===void 0?yN:pN:ci&&ci in Object(t)?A$(t):O$(t)}s(xm,"baseGetTag");function IM(t){return Pl(t)&&xm(t)==AM}s(IM,"baseIsArguments");function y$(t){if(!mi(t)||D$(t))return!1;var e=v0(t)?$N:EN;return e.test(U$(t))}s(y$,"baseIsNative");function g$(t){return Pl(t)&&VM(t.length)&&!!Le[xm(t)]}s(g$,"baseIsTypedArray");function b$(t){if(!mi(t))return z$(t);var e=NM(t),r=[];for(var i in t)i=="constructor"&&(e||!qr.call(t,i))||r.push(i);return r}s(b$,"baseKeysIn");function BM(t,e,r,i,n){t!==e&&d$(e,function(o,a){if(n||(n=new Do),mi(o))x$(t,e,a,r,BM,i,n);else{var l=i?i(d0(t,a),o,a+"",t,e,n):void 0;l===void 0&&(l=o),h0(t,a,l)}},GM)}s(BM,"baseMerge");function x$(t,e,r,i,n,o,a){var l=d0(t,r),c=d0(e,r),u=a.get(c);if(u){h0(t,r,u);return}var p=o?o(l,c,r+"",t,e,a):void 0,f=p===void 0;if(f){var h=g0(c),y=!h&&$M(c),g=!h&&!y&&jM(c);p=c,h||y||g?g0(l)?p=l:N$(l)?p=T$(l):y?(f=!1,p=P$(c,!0)):g?(f=!1,p=S$(c,!0)):p=[]:$$(c)||y0(c)?(p=l,y0(l)?p=V$(l):(!mi(l)||v0(l))&&(p=E$(c))):f=!1}f&&(a.set(c,p),n(p,c,i,o,a),a.delete(c)),h0(t,r,p)}s(x$,"baseMergeDeep");function _$(t,e){return F$(R$(t,e,ZM),t+"")}s(_$,"baseRest");var v$=dm?function(t,e){return dm(t,"toString",{configurable:!0,enumerable:!1,value:G$(e),writable:!0})}:ZM;function P$(t,e){if(e)return t.slice();var r=t.length,i=wM?wM(r):new t.constructor(r);return t.copy(i),i}s(P$,"cloneBuffer");function w$(t){var e=new t.constructor(t.byteLength);return new PM(e).set(new PM(t)),e}s(w$,"cloneArrayBuffer");function S$(t,e){var r=e?w$(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}s(S$,"cloneTypedArray");function T$(t,e){var r=-1,i=t.length;for(e||(e=Array(i));++r<i;)e[r]=t[r];return e}s(T$,"copyArray");function I$(t,e,r,i){var n=!r;r||(r={});for(var o=-1,a=e.length;++o<a;){var l=e[o],c=i?i(r[l],t[l],l,r,t):void 0;c===void 0&&(c=t[l]),n?b0(r,l,c):h$(r,l,c)}return r}s(I$,"copyObject");function C$(t){return _$(function(e,r){var i=-1,n=r.length,o=n>1?r[n-1]:void 0,a=n>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(n--,o):void 0,a&&k$(r[0],r[1],a)&&(o=n<3?void 0:o,n=1),e=Object(e);++i<n;){var l=r[i];l&&t(e,l,i,o)}return e})}s(C$,"createAssigner");function M$(t){return function(e,r,i){for(var n=-1,o=Object(e),a=i(e),l=a.length;l--;){var c=a[t?l:++n];if(r(o[c],c,o)===!1)break}return e}}s(M$,"createBaseFor");function _m(t,e){var r=t.__data__;return L$(e)?r[typeof e=="string"?"string":"hash"]:r.map}s(_m,"getMapData");function x0(t,e){var r=RN(t,e);return y$(r)?r:void 0}s(x0,"getNative");function A$(t){var e=qr.call(t,ci),r=t[ci];try{t[ci]=void 0;var i=!0}catch(o){}var n=OM.call(t);return i&&(e?t[ci]=r:delete t[ci]),n}s(A$,"getRawTag");function E$(t){return typeof t.constructor=="function"&&!NM(t)?XN(RM(t)):{}}s(E$,"initCloneObject");function UM(t,e){var r=typeof t;return e=e==null?MM:e,!!e&&(r=="number"||r!="symbol"&&kN.test(t))&&t>-1&&t%1==0&&t<e}s(UM,"isIndex");function k$(t,e,r){if(!mi(r))return!1;var i=typeof e;return(i=="number"?_0(r)&&UM(e,r.length):i=="string"&&e in r)?vm(r[e],t):!1}s(k$,"isIterateeCall");function L$(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}s(L$,"isKeyable");function D$(t){return!!_M&&_M in t}s(D$,"isMasked");function NM(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ym;return t===r}s(NM,"isPrototype");function z$(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}s(z$,"nativeKeysIn");function O$(t){return OM.call(t)}s(O$,"objectToString");function R$(t,e,r){return e=TM(e===void 0?t.length-1:e,0),function(){for(var i=arguments,n=-1,o=TM(i.length-e,0),a=Array(o);++n<o;)a[n]=i[e+n];n=-1;for(var l=Array(e+1);++n<e;)l[n]=i[n];return l[e]=r(a),DN(t,this,l)}}s(R$,"overRest");function d0(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}s(d0,"safeGet");var F$=B$(v$);function B$(t){var e=0,r=0;return function(){var i=ZN(),n=rN-(i-r);if(r=i,n>0){if(++e>=tN)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}s(B$,"shortOut");function U$(t){if(t!=null){try{return gm.call(t)}catch(e){}try{return t+""}catch(e){}}return""}s(U$,"toSource");function vm(t,e){return t===e||t!==t&&e!==e}s(vm,"eq");var y0=IM(function(){return arguments}())?IM:function(t){return Pl(t)&&qr.call(t,"callee")&&!VN.call(t,"callee")},g0=Array.isArray;function _0(t){return t!=null&&VM(t.length)&&!v0(t)}s(_0,"isArrayLike");function N$(t){return Pl(t)&&_0(t)}s(N$,"isArrayLikeObject");var $M=GN||Z$;function v0(t){if(!mi(t))return!1;var e=xm(t);return e==EM||e==lN||e==iN||e==mN}s(v0,"isFunction");function VM(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=MM}s(VM,"isLength");function mi(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}s(mi,"isObject");function Pl(t){return t!=null&&typeof t=="object"}s(Pl,"isObjectLike");function $$(t){if(!Pl(t)||xm(t)!=kM)return!1;var e=RM(t);if(e===null)return!0;var r=qr.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&gm.call(r)==NN}s($$,"isPlainObject");var jM=xM?ON(xM):g$;function V$(t){return I$(t,GM(t))}s(V$,"toPlainObject");function GM(t){return _0(t)?f$(t,!0):b$(t)}s(GM,"keysIn");var j$=C$(function(t,e,r){BM(t,e,r)});function G$(t){return function(){return t}}s(G$,"constant");function ZM(t){return t}s(ZM,"identity");function Z$(){return!1}s(Z$,"stubFalse");ko.exports=j$});var vA=Mt((l3e,El)=>{"use strict";m();var p6=!1,di=!1,hA=!0,dA=!1,d={},yA=!1;typeof El<"u"&&El.exports?(El.exports=d,yA=!0):typeof document<"u"?window.ClipperLib=d:self.ClipperLib=d;var km;yA?(rt="chrome",km="Netscape"):(rt=navigator.userAgent.toString().toLowerCase(),km=navigator.appName);var rt,pe={};rt.indexOf("chrome")!=-1&&rt.indexOf("chromium")==-1?pe.chrome=1:pe.chrome=0;rt.indexOf("chromium")!=-1?pe.chromium=1:pe.chromium=0;rt.indexOf("safari")!=-1&&rt.indexOf("chrome")==-1&&rt.indexOf("chromium")==-1?pe.safari=1:pe.safari=0;rt.indexOf("firefox")!=-1?pe.firefox=1:pe.firefox=0;rt.indexOf("firefox/17")!=-1?pe.firefox17=1:pe.firefox17=0;rt.indexOf("firefox/15")!=-1?pe.firefox15=1:pe.firefox15=0;rt.indexOf("firefox/3")!=-1?pe.firefox3=1:pe.firefox3=0;rt.indexOf("opera")!=-1?pe.opera=1:pe.opera=0;rt.indexOf("msie 10")!=-1?pe.msie10=1:pe.msie10=0;rt.indexOf("msie 9")!=-1?pe.msie9=1:pe.msie9=0;rt.indexOf("msie 8")!=-1?pe.msie8=1:pe.msie8=0;rt.indexOf("msie 7")!=-1?pe.msie7=1:pe.msie7=0;rt.indexOf("msie ")!=-1?pe.msie=1:pe.msie=0;d.biginteger_used=null;var wn,m6=0xdeadbeefcafe,mA=(m6&16777215)==15715070;function O(t,e,r){d.biginteger_used=1,t!=null&&(typeof t=="number"&&typeof e>"u"?this.fromInt(t):typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}s(O,"BigInteger");function de(){return new O(null)}s(de,"nbi");function f6(t,e,r,i,n,o){for(;--o>=0;){var a=e*this[t++]+r[i]+n;n=Math.floor(a/67108864),r[i++]=a&67108863}return n}s(f6,"am1");function h6(t,e,r,i,n,o){for(var a=e&32767,l=e>>15;--o>=0;){var c=this[t]&32767,u=this[t++]>>15,p=l*c+u*a;c=a*c+((p&32767)<<15)+r[i]+(n&1073741823),n=(c>>>30)+(p>>>15)+l*u+(n>>>30),r[i++]=c&1073741823}return n}s(h6,"am2");function d6(t,e,r,i,n,o){for(var a=e&16383,l=e>>14;--o>=0;){var c=this[t]&16383,u=this[t++]>>14,p=l*c+u*a;c=a*c+((p&16383)<<14)+r[i]+n,n=(c>>28)+(p>>14)+l*u,r[i++]=c&268435455}return n}s(d6,"am3");mA&&km=="Microsoft Internet Explorer"?(O.prototype.am=h6,wn=30):mA&&km!="Netscape"?(O.prototype.am=f6,wn=26):(O.prototype.am=d6,wn=28);O.prototype.DB=wn;O.prototype.DM=(1<<wn)-1;O.prototype.DV=1<<wn;var Z0=52;O.prototype.FV=Math.pow(2,Z0);O.prototype.F1=Z0-wn;O.prototype.F2=2*wn-Z0;var y6="0123456789abcdefghijklmnopqrstuvwxyz",Dm=new Array,Ro,Wt;Ro=48;for(Wt=0;Wt<=9;++Wt)Dm[Ro++]=Wt;Ro=97;for(Wt=10;Wt<36;++Wt)Dm[Ro++]=Wt;Ro=65;for(Wt=10;Wt<36;++Wt)Dm[Ro++]=Wt;function fA(t){return y6.charAt(t)}s(fA,"int2char");function gA(t,e){var r=Dm[t.charCodeAt(e)];return r==null?-1:r}s(gA,"intAt");function g6(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}s(g6,"bnpCopyTo");function b6(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}s(b6,"bnpFromInt");function Pn(t){var e=de();return e.fromInt(t),e}s(Pn,"nbv");function x6(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var i=t.length,n=!1,o=0;--i>=0;){var a=r==8?t[i]&255:gA(t,i);if(a<0){t.charAt(i)=="-"&&(n=!0);continue}n=!1,o==0?this[this.t++]=a:o+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=r,o>=this.DB&&(o-=this.DB)}r==8&&(t[0]&128)!=0&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&O.ZERO.subTo(this,this)}s(x6,"bnpFromString");function _6(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}s(_6,"bnpClamp");function v6(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<<e)-1,i,n=!1,o="",a=this.t,l=this.DB-a*this.DB%e;if(a-- >0)for(l<this.DB&&(i=this[a]>>l)>0&&(n=!0,o=fA(i));a>=0;)l<e?(i=(this[a]&(1<<l)-1)<<e-l,i|=this[--a]>>(l+=this.DB-e)):(i=this[a]>>(l-=e)&r,l<=0&&(l+=this.DB,--a)),i>0&&(n=!0),n&&(o+=fA(i));return n?o:"0"}s(v6,"bnToString");function P6(){var t=de();return O.ZERO.subTo(this,t),t}s(P6,"bnNegate");function w6(){return this.s<0?this.negate():this}s(w6,"bnAbs");function S6(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this[r]-t[r])!=0)return e;return 0}s(S6,"bnCompareTo");function zm(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}s(zm,"nbits");function T6(){return this.t<=0?0:this.DB*(this.t-1)+zm(this[this.t-1]^this.s&this.DM)}s(T6,"bnBitLength");function I6(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s}s(I6,"bnpDLShiftTo");function C6(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s}s(C6,"bnpDRShiftTo");function M6(t,e){var r=t%this.DB,i=this.DB-r,n=(1<<i)-1,o=Math.floor(t/this.DB),a=this.s<<r&this.DM,l;for(l=this.t-1;l>=0;--l)e[l+o+1]=this[l]>>i|a,a=(this[l]&n)<<r;for(l=o-1;l>=0;--l)e[l]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()}s(M6,"bnpLShiftTo");function A6(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var i=t%this.DB,n=this.DB-i,o=(1<<i)-1;e[0]=this[r]>>i;for(var a=r+1;a<this.t;++a)e[a-r-1]|=(this[a]&o)<<n,e[a-r]=this[a]>>i;i>0&&(e[this.t-r-1]|=(this.s&o)<<n),e.t=this.t-r,e.clamp()}s(A6,"bnpRShiftTo");function E6(t,e){for(var r=0,i=0,n=Math.min(t.t,this.t);r<n;)i+=this[r]-t[r],e[r++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i-=t.s;r<this.t;)i+=this[r],e[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;r<t.t;)i-=t[r],e[r++]=i&this.DM,i>>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[r++]=this.DV+i:i>0&&(e[r++]=i),e.t=r,e.clamp()}s(E6,"bnpSubTo");function k6(t,e){var r=this.abs(),i=t.abs(),n=r.t;for(e.t=n+i.t;--n>=0;)e[n]=0;for(n=0;n<i.t;++n)e[n+r.t]=r.am(0,i[n],e,n,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&O.ZERO.subTo(e,e)}s(k6,"bnpMultiplyTo");function L6(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var i=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,i,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()}s(L6,"bnpSquareTo");function D6(t,e,r){var i=t.abs();if(!(i.t<=0)){var n=this.abs();if(n.t<i.t){e!=null&&e.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=de());var o=de(),a=this.s,l=t.s,c=this.DB-zm(i[i.t-1]);c>0?(i.lShiftTo(c,o),n.lShiftTo(c,r)):(i.copyTo(o),n.copyTo(r));var u=o.t,p=o[u-1];if(p!=0){var f=p*(1<<this.F1)+(u>1?o[u-2]>>this.F2:0),h=this.FV/f,y=(1<<this.F1)/f,g=1<<this.F2,x=r.t,_=x-u,P=e==null?de():e;for(o.dlShiftTo(_,P),r.compareTo(P)>=0&&(r[r.t++]=1,r.subTo(P,r)),O.ONE.dlShiftTo(u,P),P.subTo(o,o);o.t<u;)o[o.t++]=0;for(;--_>=0;){var I=r[--x]==p?this.DM:Math.floor(r[x]*h+(r[x-1]+g)*y);if((r[x]+=o.am(0,I,r,_,0,u))<I)for(o.dlShiftTo(_,P),r.subTo(P,r);r[x]<--I;)r.subTo(P,r)}e!=null&&(r.drShiftTo(u,e),a!=l&&O.ZERO.subTo(e,e)),r.t=u,r.clamp(),c>0&&r.rShiftTo(c,r),a<0&&O.ZERO.subTo(r,r)}}}s(D6,"bnpDivRemTo");function z6(t){var e=de();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(O.ZERO)>0&&t.subTo(e,e),e}s(z6,"bnMod");function yi(t){this.m=t}s(yi,"Classic");function O6(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}s(O6,"cConvert");function R6(t){return t}s(R6,"cRevert");function F6(t){t.divRemTo(this.m,null,t)}s(F6,"cReduce");function B6(t,e,r){t.multiplyTo(e,r),this.reduce(r)}s(B6,"cMulTo");function U6(t,e){t.squareTo(e),this.reduce(e)}s(U6,"cSqrTo");yi.prototype.convert=O6;yi.prototype.revert=R6;yi.prototype.reduce=F6;yi.prototype.mulTo=B6;yi.prototype.sqrTo=U6;function N6(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}s(N6,"bnpInvDigit");function gi(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}s(gi,"Montgomery");function $6(t){var e=de();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(O.ZERO)>0&&this.m.subTo(e,e),e}s($6,"montConvert");function V6(t){var e=de();return t.copyTo(e),this.reduce(e),e}s(V6,"montRevert");function j6(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=t[e]&32767,i=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t[r]+=this.m.am(0,i,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}s(j6,"montReduce");function G6(t,e){t.squareTo(e),this.reduce(e)}s(G6,"montSqrTo");function Z6(t,e,r){t.multiplyTo(e,r),this.reduce(r)}s(Z6,"montMulTo");gi.prototype.convert=$6;gi.prototype.revert=V6;gi.prototype.reduce=j6;gi.prototype.mulTo=Z6;gi.prototype.sqrTo=G6;function X6(){return(this.t>0?this[0]&1:this.s)==0}s(X6,"bnpIsEven");function H6(t,e){if(t>4294967295||t<1)return O.ONE;var r=de(),i=de(),n=e.convert(this),o=zm(t)-1;for(n.copyTo(r);--o>=0;)if(e.sqrTo(r,i),(t&1<<o)>0)e.mulTo(i,n,r);else{var a=r;r=i,i=a}return e.revert(r)}s(H6,"bnpExp");function q6(t,e){var r;return t<256||e.isEven()?r=new yi(e):r=new gi(e),this.exp(t,r)}s(q6,"bnModPowInt");O.prototype.copyTo=g6;O.prototype.fromInt=b6;O.prototype.fromString=x6;O.prototype.clamp=_6;O.prototype.dlShiftTo=I6;O.prototype.drShiftTo=C6;O.prototype.lShiftTo=M6;O.prototype.rShiftTo=A6;O.prototype.subTo=E6;O.prototype.multiplyTo=k6;O.prototype.squareTo=L6;O.prototype.divRemTo=D6;O.prototype.invDigit=N6;O.prototype.isEven=X6;O.prototype.exp=H6;O.prototype.toString=v6;O.prototype.negate=P6;O.prototype.abs=w6;O.prototype.compareTo=S6;O.prototype.bitLength=T6;O.prototype.mod=z6;O.prototype.modPowInt=q6;O.ZERO=Pn(0);O.ONE=Pn(1);function W6(){var t=de();return this.copyTo(t),t}s(W6,"bnClone");function Y6(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}s(Y6,"bnIntValue");function J6(){return this.t==0?this.s:this[0]<<24>>24}s(J6,"bnByteValue");function K6(){return this.t==0?this.s:this[0]<<16>>16}s(K6,"bnShortValue");function Q6(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}s(Q6,"bnpChunkSize");function eV(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}s(eV,"bnSigNum");function tV(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=Pn(r),n=de(),o=de(),a="";for(this.divRemTo(i,n,o);n.signum()>0;)a=(r+o.intValue()).toString(t).substr(1)+a,n.divRemTo(i,n,o);return o.intValue().toString(t)+a}s(tV,"bnpToRadix");function rV(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),i=Math.pow(e,r),n=!1,o=0,a=0,l=0;l<t.length;++l){var c=gA(t,l);if(c<0){t.charAt(l)=="-"&&this.signum()==0&&(n=!0);continue}a=e*a+c,++o>=r&&(this.dMultiply(i),this.dAddOffset(a,0),o=0,a=0)}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(a,0)),n&&O.ZERO.subTo(this,this)}s(rV,"bnpFromRadix");function nV(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(O.ONE.shiftLeft(t-1),X0,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(O.ONE.shiftLeft(t-1),this);else{var i=new Array,n=t&7;i.length=(t>>3)+1,e.nextBytes(i),n>0?i[0]&=(1<<n)-1:i[0]=0,this.fromString(i,256)}}s(nV,"bnpFromNumber");function iV(){var t=this.t,e=new Array;e[0]=this.s;var r=this.DB-t*this.DB%8,i,n=0;if(t-- >0)for(r<this.DB&&(i=this[t]>>r)!=(this.s&this.DM)>>r&&(e[n++]=i|this.s<<this.DB-r);t>=0;)r<8?(i=(this[t]&(1<<r)-1)<<8-r,i|=this[--t]>>(r+=this.DB-8)):(i=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),(i&128)!=0&&(i|=-256),n==0&&(this.s&128)!=(i&128)&&++n,(n>0||i!=this.s)&&(e[n++]=i);return e}s(iV,"bnToByteArray");function oV(t){return this.compareTo(t)==0}s(oV,"bnEquals");function aV(t){return this.compareTo(t)<0?this:t}s(aV,"bnMin");function sV(t){return this.compareTo(t)>0?this:t}s(sV,"bnMax");function lV(t,e,r){var i,n,o=Math.min(t.t,this.t);for(i=0;i<o;++i)r[i]=e(this[i],t[i]);if(t.t<this.t){for(n=t.s&this.DM,i=o;i<this.t;++i)r[i]=e(this[i],n);r.t=this.t}else{for(n=this.s&this.DM,i=o;i<t.t;++i)r[i]=e(n,t[i]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()}s(lV,"bnpBitwiseTo");function uV(t,e){return t&e}s(uV,"op_and");function cV(t){var e=de();return this.bitwiseTo(t,uV,e),e}s(cV,"bnAnd");function X0(t,e){return t|e}s(X0,"op_or");function pV(t){var e=de();return this.bitwiseTo(t,X0,e),e}s(pV,"bnOr");function bA(t,e){return t^e}s(bA,"op_xor");function mV(t){var e=de();return this.bitwiseTo(t,bA,e),e}s(mV,"bnXor");function xA(t,e){return t&~e}s(xA,"op_andnot");function fV(t){var e=de();return this.bitwiseTo(t,xA,e),e}s(fV,"bnAndNot");function hV(){for(var t=de(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}s(hV,"bnNot");function dV(t){var e=de();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}s(dV,"bnShiftLeft");function yV(t){var e=de();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}s(yV,"bnShiftRight");function gV(t){if(t==0)return-1;var e=0;return(t&65535)==0&&(t>>=16,e+=16),(t&255)==0&&(t>>=8,e+=8),(t&15)==0&&(t>>=4,e+=4),(t&3)==0&&(t>>=2,e+=2),(t&1)==0&&++e,e}s(gV,"lbit");function bV(){for(var t=0;t<this.t;++t)if(this[t]!=0)return t*this.DB+gV(this[t]);return this.s<0?this.t*this.DB:-1}s(bV,"bnGetLowestSetBit");function xV(t){for(var e=0;t!=0;)t&=t-1,++e;return e}s(xV,"cbit");function _V(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=xV(this[r]^e);return t}s(_V,"bnBitCount");function vV(t){var e=Math.floor(t/this.DB);return e>=this.t?this.s!=0:(this[e]&1<<t%this.DB)!=0}s(vV,"bnTestBit");function PV(t,e){var r=O.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r}s(PV,"bnpChangeBit");function wV(t){return this.changeBit(t,X0)}s(wV,"bnSetBit");function SV(t){return this.changeBit(t,xA)}s(SV,"bnClearBit");function TV(t){return this.changeBit(t,bA)}s(TV,"bnFlipBit");function IV(t,e){for(var r=0,i=0,n=Math.min(t.t,this.t);r<n;)i+=this[r]+t[r],e[r++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i+=t.s;r<this.t;)i+=this[r],e[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;r<t.t;)i+=t[r],e[r++]=i&this.DM,i>>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e[r++]=i:i<-1&&(e[r++]=this.DV+i),e.t=r,e.clamp()}s(IV,"bnpAddTo");function CV(t){var e=de();return this.addTo(t,e),e}s(CV,"bnAdd");function MV(t){var e=de();return this.subTo(t,e),e}s(MV,"bnSubtract");function AV(t){var e=de();return this.multiplyTo(t,e),e}s(AV,"bnMultiply");function EV(){var t=de();return this.squareTo(t),t}s(EV,"bnSquare");function kV(t){var e=de();return this.divRemTo(t,e,null),e}s(kV,"bnDivide");function LV(t){var e=de();return this.divRemTo(t,null,e),e}s(LV,"bnRemainder");function DV(t){var e=de(),r=de();return this.divRemTo(t,e,r),new Array(e,r)}s(DV,"bnDivideAndRemainder");function zV(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}s(zV,"bnpDMultiply");function OV(t,e){if(t!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}s(OV,"bnpDAddOffset");function kl(){}s(kl,"NullExp");function _A(t){return t}s(_A,"nNop");function RV(t,e,r){t.multiplyTo(e,r)}s(RV,"nMulTo");function FV(t,e){t.squareTo(e)}s(FV,"nSqrTo");kl.prototype.convert=_A;kl.prototype.revert=_A;kl.prototype.mulTo=RV;kl.prototype.sqrTo=FV;function BV(t){return this.exp(t,new kl)}s(BV,"bnPow");function UV(t,e,r){var i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;var n;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp()}s(UV,"bnpMultiplyLowerTo");function NV(t,e,r){--e;var i=r.t=this.t+t.t-e;for(r.s=0;--i>=0;)r[i]=0;for(i=Math.max(e-this.t,0);i<t.t;++i)r[this.t+i-e]=this.am(e-i,t[i],r,0,0,this.t+i-e);r.clamp(),r.drShiftTo(1,r)}s(NV,"bnpMultiplyUpperTo");function Fo(t){this.r2=de(),this.q3=de(),O.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}s(Fo,"Barrett");function $V(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=de();return t.copyTo(e),this.reduce(e),e}s($V,"barrettConvert");function VV(t){return t}s(VV,"barrettRevert");function jV(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}s(jV,"barrettReduce");function GV(t,e){t.squareTo(e),this.reduce(e)}s(GV,"barrettSqrTo");function ZV(t,e,r){t.multiplyTo(e,r),this.reduce(r)}s(ZV,"barrettMulTo");Fo.prototype.convert=$V;Fo.prototype.revert=VV;Fo.prototype.reduce=jV;Fo.prototype.mulTo=ZV;Fo.prototype.sqrTo=GV;function XV(t,e){var r=t.bitLength(),i,n=Pn(1),o;if(r<=0)return n;r<18?i=1:r<48?i=3:r<144?i=4:r<768?i=5:i=6,r<8?o=new yi(e):e.isEven()?o=new Fo(e):o=new gi(e);var a=new Array,l=3,c=i-1,u=(1<<i)-1;if(a[1]=o.convert(this),i>1){var p=de();for(o.sqrTo(a[1],p);l<=u;)a[l]=de(),o.mulTo(p,a[l-2],a[l]),l+=2}var f=t.t-1,h,y=!0,g=de(),x;for(r=zm(t[f])-1;f>=0;){for(r>=c?h=t[f]>>r-c&u:(h=(t[f]&(1<<r+1)-1)<<c-r,f>0&&(h|=t[f-1]>>this.DB+r-c)),l=i;(h&1)==0;)h>>=1,--l;if((r-=l)<0&&(r+=this.DB,--f),y)a[h].copyTo(n),y=!1;else{for(;l>1;)o.sqrTo(n,g),o.sqrTo(g,n),l-=2;l>0?o.sqrTo(n,g):(x=n,n=g,g=x),o.mulTo(g,a[h],n)}for(;f>=0&&(t[f]&1<<r)==0;)o.sqrTo(n,g),x=n,n=g,g=x,--r<0&&(r=this.DB-1,--f)}return o.revert(n)}s(XV,"bnModPow");function HV(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var i=e;e=r,r=i}var n=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(n<o&&(o=n),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r}s(HV,"bnGCD");function qV(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this[i])%t;return r}s(qV,"bnpModInt");function WV(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return O.ZERO;for(var r=t.clone(),i=this.clone(),n=Pn(1),o=Pn(0),a=Pn(0),l=Pn(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!n.isEven()||!o.isEven())&&(n.addTo(this,n),o.subTo(t,o)),n.rShiftTo(1,n)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),e?((!a.isEven()||!l.isEven())&&(a.addTo(this,a),l.subTo(t,l)),a.rShiftTo(1,a)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);r.compareTo(i)>=0?(r.subTo(i,r),e&&n.subTo(a,n),o.subTo(l,o)):(i.subTo(r,i),e&&a.subTo(n,a),l.subTo(o,l))}if(i.compareTo(O.ONE)!=0)return O.ZERO;if(l.compareTo(t)>=0)return l.subtract(t);if(l.signum()<0)l.addTo(t,l);else return l;return l.signum()<0?l.add(t):l}s(WV,"bnModInverse");var mt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],YV=(1<<26)/mt[mt.length-1];function JV(t){var e,r=this.abs();if(r.t==1&&r[0]<=mt[mt.length-1]){for(e=0;e<mt.length;++e)if(r[0]==mt[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<mt.length;){for(var i=mt[e],n=e+1;n<mt.length&&i<YV;)i*=mt[n++];for(i=r.modInt(i);e<n;)if(i%mt[e++]==0)return!1}return r.millerRabin(t)}s(JV,"bnIsProbablePrime");function KV(t){var e=this.subtract(O.ONE),r=e.getLowestSetBit();if(r<=0)return!1;var i=e.shiftRight(r);t=t+1>>1,t>mt.length&&(t=mt.length);for(var n=de(),o=0;o<t;++o){n.fromInt(mt[Math.floor(Math.random()*mt.length)]);var a=n.modPow(i,this);if(a.compareTo(O.ONE)!=0&&a.compareTo(e)!=0){for(var l=1;l++<r&&a.compareTo(e)!=0;)if(a=a.modPowInt(2,this),a.compareTo(O.ONE)==0)return!1;if(a.compareTo(e)!=0)return!1}}return!0}s(KV,"bnpMillerRabin");O.prototype.chunkSize=Q6;O.prototype.toRadix=tV;O.prototype.fromRadix=rV;O.prototype.fromNumber=nV;O.prototype.bitwiseTo=lV;O.prototype.changeBit=PV;O.prototype.addTo=IV;O.prototype.dMultiply=zV;O.prototype.dAddOffset=OV;O.prototype.multiplyLowerTo=UV;O.prototype.multiplyUpperTo=NV;O.prototype.modInt=qV;O.prototype.millerRabin=KV;O.prototype.clone=W6;O.prototype.intValue=Y6;O.prototype.byteValue=J6;O.prototype.shortValue=K6;O.prototype.signum=eV;O.prototype.toByteArray=iV;O.prototype.equals=oV;O.prototype.min=aV;O.prototype.max=sV;O.prototype.and=cV;O.prototype.or=pV;O.prototype.xor=mV;O.prototype.andNot=fV;O.prototype.not=hV;O.prototype.shiftLeft=dV;O.prototype.shiftRight=yV;O.prototype.getLowestSetBit=bV;O.prototype.bitCount=_V;O.prototype.testBit=vV;O.prototype.setBit=wV;O.prototype.clearBit=SV;O.prototype.flipBit=TV;O.prototype.add=CV;O.prototype.subtract=MV;O.prototype.multiply=AV;O.prototype.divide=kV;O.prototype.remainder=LV;O.prototype.divideAndRemainder=DV;O.prototype.modPow=XV;O.prototype.modInverse=WV;O.prototype.pow=BV;O.prototype.gcd=HV;O.prototype.isProbablePrime=JV;O.prototype.square=EV;var ue=O;ue.prototype.IsNegative=function(){return this.compareTo(ue.ZERO)==-1};ue.op_Equality=function(t,e){return t.compareTo(e)==0};ue.op_Inequality=function(t,e){return t.compareTo(e)!=0};ue.op_GreaterThan=function(t,e){return t.compareTo(e)>0};ue.op_LessThan=function(t,e){return t.compareTo(e)<0};ue.op_Addition=function(t,e){return new ue(t).add(new ue(e))};ue.op_Subtraction=function(t,e){return new ue(t).subtract(new ue(e))};ue.Int128Mul=function(t,e){return new ue(t).multiply(new ue(e))};ue.op_Division=function(t,e){return t.divide(e)};ue.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof Lm>"u"&&(Lm=s(function(t,e){var r;if(typeof Object.getOwnPropertyNames>"u"){for(r in e.prototype)(typeof t.prototype[r]>"u"||t.prototype[r]==Object.prototype[r])&&(t.prototype[r]=e.prototype[r]);for(r in e)typeof t[r]>"u"&&(t[r]=e[r]);t.$baseCtor=e}else{for(var i=Object.getOwnPropertyNames(e.prototype),n=0;n<i.length;n++)typeof Object.getOwnPropertyDescriptor(t.prototype,i[n])>"u"&&Object.defineProperty(t.prototype,i[n],Object.getOwnPropertyDescriptor(e.prototype,i[n]));for(r in e)typeof t[r]>"u"&&(t[r]=e[r]);t.$baseCtor=e}},"Inherit"));var Lm;d.Path=function(){return[]};d.Paths=function(){return[]};d.DoublePoint=function(){var t=arguments;this.X=0,this.Y=0,t.length==1?(this.X=t[0].X,this.Y=t[0].Y):t.length==2&&(this.X=t[0],this.Y=t[1])};d.DoublePoint0=function(){this.X=0,this.Y=0};d.DoublePoint1=function(t){this.X=t.X,this.Y=t.Y};d.DoublePoint2=function(t,e){this.X=t,this.Y=e};d.PolyNode=function(){this.m_Parent=null,this.m_polygon=new d.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};d.PolyNode.prototype.IsHoleNode=function(){for(var t=!0,e=this.m_Parent;e!==null;)t=!t,e=e.m_Parent;return t};d.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};d.PolyNode.prototype.Contour=function(){return this.m_polygon};d.PolyNode.prototype.AddChild=function(t){var e=this.m_Childs.length;this.m_Childs.push(t),t.m_Parent=this,t.m_Index=e};d.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};d.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};d.PolyNode.prototype.Childs=function(){return this.m_Childs};d.PolyNode.prototype.Parent=function(){return this.m_Parent};d.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};d.PolyTree=function(){this.m_AllPolys=[],d.PolyNode.call(this)};d.PolyTree.prototype.Clear=function(){for(var t=0,e=this.m_AllPolys.length;t<e;t++)this.m_AllPolys[t]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};d.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};d.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};Lm(d.PolyTree,d.PolyNode);d.Math_Abs_Int64=d.Math_Abs_Int32=d.Math_Abs_Double=function(t){return Math.abs(t)};d.Math_Max_Int32_Int32=function(t,e){return Math.max(t,e)};pe.msie||pe.opera||pe.safari?d.Cast_Int32=function(t){return t|0}:d.Cast_Int32=function(t){return~~t};pe.chrome?d.Cast_Int64=function(t){return t<-2147483648||t>2147483647?t<0?Math.ceil(t):Math.floor(t):~~t}:pe.firefox&&typeof Number.toInteger=="function"?d.Cast_Int64=function(t){return Number.toInteger(t)}:pe.msie7||pe.msie8?d.Cast_Int64=function(t){return parseInt(t,10)}:pe.msie?d.Cast_Int64=function(t){return t<-2147483648||t>2147483647?t<0?Math.ceil(t):Math.floor(t):t|0}:d.Cast_Int64=function(t){return t<0?Math.ceil(t):Math.floor(t)};d.Clear=function(t){t.length=0};d.PI=3.141592653589793;d.PI2=2*3.141592653589793;d.IntPoint=function(){var t=arguments,e=t.length;if(this.X=0,this.Y=0,di)if(this.Z=0,e==3)this.X=t[0],this.Y=t[1],this.Z=t[2];else if(e==2)this.X=t[0],this.Y=t[1],this.Z=0;else if(e==1)if(t[0]instanceof d.DoublePoint){var r=t[0];this.X=d.Clipper.Round(r.X),this.Y=d.Clipper.Round(r.Y),this.Z=0}else{var i=t[0];typeof i.Z>"u"&&(i.Z=0),this.X=i.X,this.Y=i.Y,this.Z=i.Z}else this.X=0,this.Y=0,this.Z=0;else if(e==2)this.X=t[0],this.Y=t[1];else if(e==1)if(t[0]instanceof d.DoublePoint){var r=t[0];this.X=d.Clipper.Round(r.X),this.Y=d.Clipper.Round(r.Y)}else{var i=t[0];this.X=i.X,this.Y=i.Y}else this.X=0,this.Y=0};d.IntPoint.op_Equality=function(t,e){return t.X==e.X&&t.Y==e.Y};d.IntPoint.op_Inequality=function(t,e){return t.X!=e.X||t.Y!=e.Y};di?(d.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},d.IntPoint1=function(t){this.X=t.X,this.Y=t.Y,this.Z=t.Z},d.IntPoint1dp=function(t){this.X=d.Clipper.Round(t.X),this.Y=d.Clipper.Round(t.Y),this.Z=0},d.IntPoint2=function(t,e){this.X=t,this.Y=e,this.Z=0},d.IntPoint3=function(t,e,r){this.X=t,this.Y=e,this.Z=r}):(d.IntPoint0=function(){this.X=0,this.Y=0},d.IntPoint1=function(t){this.X=t.X,this.Y=t.Y},d.IntPoint1dp=function(t){this.X=d.Clipper.Round(t.X),this.Y=d.Clipper.Round(t.Y)},d.IntPoint2=function(t,e){this.X=t,this.Y=e});d.IntRect=function(){var t=arguments,e=t.length;e==4?(this.left=t[0],this.top=t[1],this.right=t[2],this.bottom=t[3]):e==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};d.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};d.IntRect1=function(t){this.left=t.left,this.top=t.top,this.right=t.right,this.bottom=t.bottom};d.IntRect4=function(t,e,r,i){this.left=t,this.top=e,this.right=r,this.bottom=i};d.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};d.PolyType={ptSubject:0,ptClip:1};d.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};d.JoinType={jtSquare:0,jtRound:1,jtMiter:2};d.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};dA&&(d.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});d.EdgeSide={esLeft:0,esRight:1};d.Direction={dRightToLeft:0,dLeftToRight:1};d.TEdge=function(){this.Bot=new d.IntPoint,this.Curr=new d.IntPoint,this.Top=new d.IntPoint,this.Delta=new d.IntPoint,this.Dx=0,this.PolyTyp=d.PolyType.ptSubject,this.Side=d.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};d.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new d.IntPoint};d.MyIntersectNodeSort=function(){};d.MyIntersectNodeSort.Compare=function(t,e){return e.Pt.Y-t.Pt.Y};d.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};d.Scanbeam=function(){this.Y=0,this.Next=null};d.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};d.OutPt=function(){this.Idx=0,this.Pt=new d.IntPoint,this.Next=null,this.Prev=null};d.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new d.IntPoint};d.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};d.ClipperBase.horizontal=-9007199254740992;d.ClipperBase.Skip=-2;d.ClipperBase.Unassigned=-1;d.ClipperBase.tolerance=1e-20;p6?(d.ClipperBase.loRange=46340,d.ClipperBase.hiRange=46340):(d.ClipperBase.loRange=47453132,d.ClipperBase.hiRange=0xfffffffffffff);d.ClipperBase.near_zero=function(t){return t>-d.ClipperBase.tolerance&&t<d.ClipperBase.tolerance};d.ClipperBase.IsHorizontal=function(t){return t.Delta.Y===0};d.ClipperBase.prototype.PointIsVertex=function(t,e){var r=e;do{if(d.IntPoint.op_Equality(r.Pt,t))return!0;r=r.Next}while(r!=e);return!1};d.ClipperBase.prototype.PointOnLineSegment=function(t,e,r,i){return i?t.X==e.X&&t.Y==e.Y||t.X==r.X&&t.Y==r.Y||t.X>e.X==t.X<r.X&&t.Y>e.Y==t.Y<r.Y&&ue.op_Equality(ue.Int128Mul(t.X-e.X,r.Y-e.Y),ue.Int128Mul(r.X-e.X,t.Y-e.Y)):t.X==e.X&&t.Y==e.Y||t.X==r.X&&t.Y==r.Y||t.X>e.X==t.X<r.X&&t.Y>e.Y==t.Y<r.Y&&(t.X-e.X)*(r.Y-e.Y)==(r.X-e.X)*(t.Y-e.Y)};d.ClipperBase.prototype.PointOnPolygon=function(t,e,r){for(var i=e;;){if(this.PointOnLineSegment(t,i.Pt,i.Next.Pt,r))return!0;if(i=i.Next,i==e)break}return!1};d.ClipperBase.prototype.SlopesEqual=d.ClipperBase.SlopesEqual=function(){var t=arguments,e=t.length,r,i,n,o,a,l,c;return e==3?(r=t[0],i=t[1],c=t[2],c?ue.op_Equality(ue.Int128Mul(r.Delta.Y,i.Delta.X),ue.Int128Mul(r.Delta.X,i.Delta.Y)):d.Cast_Int64(r.Delta.Y*i.Delta.X)==d.Cast_Int64(r.Delta.X*i.Delta.Y)):e==4?(n=t[0],o=t[1],a=t[2],c=t[3],c?ue.op_Equality(ue.Int128Mul(n.Y-o.Y,o.X-a.X),ue.Int128Mul(n.X-o.X,o.Y-a.Y)):d.Cast_Int64((n.Y-o.Y)*(o.X-a.X))-d.Cast_Int64((n.X-o.X)*(o.Y-a.Y))===0):(n=t[0],o=t[1],a=t[2],l=t[3],c=t[4],c?ue.op_Equality(ue.Int128Mul(n.Y-o.Y,a.X-l.X),ue.Int128Mul(n.X-o.X,a.Y-l.Y)):d.Cast_Int64((n.Y-o.Y)*(a.X-l.X))-d.Cast_Int64((n.X-o.X)*(a.Y-l.Y))===0)};d.ClipperBase.SlopesEqual3=function(t,e,r){return r?ue.op_Equality(ue.Int128Mul(t.Delta.Y,e.Delta.X),ue.Int128Mul(t.Delta.X,e.Delta.Y)):d.Cast_Int64(t.Delta.Y*e.Delta.X)==d.Cast_Int64(t.Delta.X*e.Delta.Y)};d.ClipperBase.SlopesEqual4=function(t,e,r,i){return i?ue.op_Equality(ue.Int128Mul(t.Y-e.Y,e.X-r.X),ue.Int128Mul(t.X-e.X,e.Y-r.Y)):d.Cast_Int64((t.Y-e.Y)*(e.X-r.X))-d.Cast_Int64((t.X-e.X)*(e.Y-r.Y))===0};d.ClipperBase.SlopesEqual5=function(t,e,r,i,n){return n?ue.op_Equality(ue.Int128Mul(t.Y-e.Y,r.X-i.X),ue.Int128Mul(t.X-e.X,r.Y-i.Y)):d.Cast_Int64((t.Y-e.Y)*(r.X-i.X))-d.Cast_Int64((t.X-e.X)*(r.Y-i.Y))===0};d.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var t=0,e=this.m_edges.length;t<e;++t){for(var r=0,i=this.m_edges[t].length;r<i;++r)this.m_edges[t][r]=null;d.Clear(this.m_edges[t])}d.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};d.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var t=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=t}this.m_CurrentLM=null};d.ClipperBase.prototype.RangeTest=function(t,e){e.Value?(t.X>d.ClipperBase.hiRange||t.Y>d.ClipperBase.hiRange||-t.X>d.ClipperBase.hiRange||-t.Y>d.ClipperBase.hiRange)&&d.Error("Coordinate outside allowed range in RangeTest()."):(t.X>d.ClipperBase.loRange||t.Y>d.ClipperBase.loRange||-t.X>d.ClipperBase.loRange||-t.Y>d.ClipperBase.loRange)&&(e.Value=!0,this.RangeTest(t,e))};d.ClipperBase.prototype.InitEdge=function(t,e,r,i){t.Next=e,t.Prev=r,t.Curr.X=i.X,t.Curr.Y=i.Y,t.OutIdx=-1};d.ClipperBase.prototype.InitEdge2=function(t,e){t.Curr.Y>=t.Next.Curr.Y?(t.Bot.X=t.Curr.X,t.Bot.Y=t.Curr.Y,t.Top.X=t.Next.Curr.X,t.Top.Y=t.Next.Curr.Y):(t.Top.X=t.Curr.X,t.Top.Y=t.Curr.Y,t.Bot.X=t.Next.Curr.X,t.Bot.Y=t.Next.Curr.Y),this.SetDx(t),t.PolyTyp=e};d.ClipperBase.prototype.FindNextLocMin=function(t){for(var e;;){for(;d.IntPoint.op_Inequality(t.Bot,t.Prev.Bot)||d.IntPoint.op_Equality(t.Curr,t.Top);)t=t.Next;if(t.Dx!=d.ClipperBase.horizontal&&t.Prev.Dx!=d.ClipperBase.horizontal)break;for(;t.Prev.Dx==d.ClipperBase.horizontal;)t=t.Prev;for(e=t;t.Dx==d.ClipperBase.horizontal;)t=t.Next;if(t.Top.Y!=t.Prev.Bot.Y){e.Prev.Bot.X<t.Bot.X&&(t=e);break}}return t};d.ClipperBase.prototype.ProcessBound=function(t,e){var r=t,i=t,n,o;if(t.Dx==d.ClipperBase.horizontal&&(e?o=t.Prev.Bot.X:o=t.Next.Bot.X,t.Bot.X!=o&&this.ReverseHorizontal(t)),i.OutIdx!=d.ClipperBase.Skip)if(e){for(;i.Top.Y==i.Next.Bot.Y&&i.Next.OutIdx!=d.ClipperBase.Skip;)i=i.Next;if(i.Dx==d.ClipperBase.horizontal&&i.Next.OutIdx!=d.ClipperBase.Skip){for(n=i;n.Prev.Dx==d.ClipperBase.horizontal;)n=n.Prev;n.Prev.Top.X==i.Next.Top.X?e||(i=n.Prev):n.Prev.Top.X>i.Next.Top.X&&(i=n.Prev)}for(;t!=i;)t.NextInLML=t.Next,t.Dx==d.ClipperBase.horizontal&&t!=r&&t.Bot.X!=t.Prev.Top.X&&this.ReverseHorizontal(t),t=t.Next;t.Dx==d.ClipperBase.horizontal&&t!=r&&t.Bot.X!=t.Prev.Top.X&&this.ReverseHorizontal(t),i=i.Next}else{for(;i.Top.Y==i.Prev.Bot.Y&&i.Prev.OutIdx!=d.ClipperBase.Skip;)i=i.Prev;if(i.Dx==d.ClipperBase.horizontal&&i.Prev.OutIdx!=d.ClipperBase.Skip){for(n=i;n.Next.Dx==d.ClipperBase.horizontal;)n=n.Next;n.Next.Top.X==i.Prev.Top.X?e||(i=n.Next):n.Next.Top.X>i.Prev.Top.X&&(i=n.Next)}for(;t!=i;)t.NextInLML=t.Prev,t.Dx==d.ClipperBase.horizontal&&t!=r&&t.Bot.X!=t.Next.Top.X&&this.ReverseHorizontal(t),t=t.Prev;t.Dx==d.ClipperBase.horizontal&&t!=r&&t.Bot.X!=t.Next.Top.X&&this.ReverseHorizontal(t),i=i.Prev}if(i.OutIdx==d.ClipperBase.Skip){if(t=i,e){for(;t.Top.Y==t.Next.Bot.Y;)t=t.Next;for(;t!=i&&t.Dx==d.ClipperBase.horizontal;)t=t.Prev}else{for(;t.Top.Y==t.Prev.Bot.Y;)t=t.Prev;for(;t!=i&&t.Dx==d.ClipperBase.horizontal;)t=t.Next}if(t==i)e?i=t.Next:i=t.Prev;else{e?t=i.Next:t=i.Prev;var a=new d.LocalMinima;a.Next=null,a.Y=t.Bot.Y,a.LeftBound=null,a.RightBound=t,a.RightBound.WindDelta=0,i=this.ProcessBound(a.RightBound,e),this.InsertLocalMinima(a)}}return i};d.ClipperBase.prototype.AddPath=function(t,e,r){hA?!r&&e==d.PolyType.ptClip&&d.Error("AddPath: Open paths must be subject."):r||d.Error("AddPath: Open paths have been disabled.");var i=t.length-1;if(r)for(;i>0&&d.IntPoint.op_Equality(t[i],t[0]);)--i;for(;i>0&&d.IntPoint.op_Equality(t[i],t[i-1]);)--i;if(r&&i<2||!r&&i<1)return!1;for(var n=new Array,o=0;o<=i;o++)n.push(new d.TEdge);var a=!0;n[1].Curr.X=t[1].X,n[1].Curr.Y=t[1].Y;var l={Value:this.m_UseFullRange};this.RangeTest(t[0],l),this.m_UseFullRange=l.Value,l.Value=this.m_UseFullRange,this.RangeTest(t[i],l),this.m_UseFullRange=l.Value,this.InitEdge(n[0],n[1],n[i],t[0]),this.InitEdge(n[i],n[0],n[i-1],t[i]);for(var o=i-1;o>=1;--o)l.Value=this.m_UseFullRange,this.RangeTest(t[o],l),this.m_UseFullRange=l.Value,this.InitEdge(n[o],n[o+1],n[o-1],t[o]);for(var c=n[0],u=c,p=c;;){if(d.IntPoint.op_Equality(u.Curr,u.Next.Curr)){if(u==u.Next)break;u==c&&(c=u.Next),u=this.RemoveEdge(u),p=u;continue}if(u.Prev==u.Next)break;if(r&&d.ClipperBase.SlopesEqual(u.Prev.Curr,u.Curr,u.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(u.Prev.Curr,u.Curr,u.Next.Curr))){u==c&&(c=u.Next),u=this.RemoveEdge(u),u=u.Prev,p=u;continue}if(u=u.Next,u==p)break}if(!r&&u==u.Next||r&&u.Prev==u.Next)return!1;r||(this.m_HasOpenPaths=!0,c.Prev.OutIdx=d.ClipperBase.Skip);var f=c;u=c;do this.InitEdge2(u,e),u=u.Next,a&&u.Curr.Y!=c.Curr.Y&&(a=!1);while(u!=c);if(a){if(r)return!1;u.Prev.OutIdx=d.ClipperBase.Skip,u.Prev.Bot.X<u.Prev.Top.X&&this.ReverseHorizontal(u.Prev);var h=new d.LocalMinima;for(h.Next=null,h.Y=u.Bot.Y,h.LeftBound=null,h.RightBound=u,h.RightBound.Side=d.EdgeSide.esRight,h.RightBound.WindDelta=0;u.Next.OutIdx!=d.ClipperBase.Skip;)u.NextInLML=u.Next,u.Bot.X!=u.Prev.Top.X&&this.ReverseHorizontal(u),u=u.Next;return this.InsertLocalMinima(h),this.m_edges.push(n),!0}this.m_edges.push(n);for(var y,g=null;u=this.FindNextLocMin(u),u!=g;){g==null&&(g=u);var h=new d.LocalMinima;h.Next=null,h.Y=u.Bot.Y,u.Dx<u.Prev.Dx?(h.LeftBound=u.Prev,h.RightBound=u,y=!1):(h.LeftBound=u,h.RightBound=u.Prev,y=!0),h.LeftBound.Side=d.EdgeSide.esLeft,h.RightBound.Side=d.EdgeSide.esRight,r?h.LeftBound.Next==h.RightBound?h.LeftBound.WindDelta=-1:h.LeftBound.WindDelta=1:h.LeftBound.WindDelta=0,h.RightBound.WindDelta=-h.LeftBound.WindDelta,u=this.ProcessBound(h.LeftBound,y);var x=this.ProcessBound(h.RightBound,!y);h.LeftBound.OutIdx==d.ClipperBase.Skip?h.LeftBound=null:h.RightBound.OutIdx==d.ClipperBase.Skip&&(h.RightBound=null),this.InsertLocalMinima(h),y||(u=x)}return!0};d.ClipperBase.prototype.AddPaths=function(t,e,r){for(var i=!1,n=0,o=t.length;n<o;++n)this.AddPath(t[n],e,r)&&(i=!0);return i};d.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(t,e,r){return d.IntPoint.op_Equality(t,r)||d.IntPoint.op_Equality(t,e)||d.IntPoint.op_Equality(r,e)?!1:t.X!=r.X?e.X>t.X==e.X<r.X:e.Y>t.Y==e.Y<r.Y};d.ClipperBase.prototype.RemoveEdge=function(t){t.Prev.Next=t.Next,t.Next.Prev=t.Prev;var e=t.Next;return t.Prev=null,e};d.ClipperBase.prototype.SetDx=function(t){t.Delta.X=t.Top.X-t.Bot.X,t.Delta.Y=t.Top.Y-t.Bot.Y,t.Delta.Y===0?t.Dx=d.ClipperBase.horizontal:t.Dx=t.Delta.X/t.Delta.Y};d.ClipperBase.prototype.InsertLocalMinima=function(t){if(this.m_MinimaList===null)this.m_MinimaList=t;else if(t.Y>=this.m_MinimaList.Y)t.Next=this.m_MinimaList,this.m_MinimaList=t;else{for(var e=this.m_MinimaList;e.Next!==null&&t.Y<e.Next.Y;)e=e.Next;t.Next=e.Next,e.Next=t}};d.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};d.ClipperBase.prototype.ReverseHorizontal=function(t){var e=t.Top.X;t.Top.X=t.Bot.X,t.Bot.X=e,di&&(e=t.Top.Z,t.Top.Z=t.Bot.Z,t.Bot.Z=e)};d.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var t=this.m_MinimaList;t!=null;){var e=t.LeftBound;e!=null&&(e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.Side=d.EdgeSide.esLeft,e.OutIdx=d.ClipperBase.Unassigned),e=t.RightBound,e!=null&&(e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.Side=d.EdgeSide.esRight,e.OutIdx=d.ClipperBase.Unassigned),t=t.Next}};d.Clipper=function(t){typeof t>"u"&&(t=0),this.m_PolyOuts=null,this.m_ClipType=d.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=d.PolyFillType.pftEvenOdd,this.m_SubjFillType=d.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,d.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=d.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&t)!==0,this.StrictlySimple=(2&t)!==0,this.PreserveCollinear=(4&t)!==0,di&&(this.ZFillFunction=null)};d.Clipper.ioReverseSolution=1;d.Clipper.ioStrictlySimple=2;d.Clipper.ioPreserveCollinear=4;d.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),d.ClipperBase.prototype.Clear.call(this))};d.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var t=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=t}};d.Clipper.prototype.Reset=function(){d.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var t=this.m_MinimaList;t!==null;)this.InsertScanbeam(t.Y),t=t.Next};d.Clipper.prototype.InsertScanbeam=function(t){if(this.m_Scanbeam===null)this.m_Scanbeam=new d.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=t;else if(t>this.m_Scanbeam.Y){var e=new d.Scanbeam;e.Y=t,e.Next=this.m_Scanbeam,this.m_Scanbeam=e}else{for(var r=this.m_Scanbeam;r.Next!==null&&t<=r.Next.Y;)r=r.Next;if(t==r.Y)return;var e=new d.Scanbeam;e.Y=t,e.Next=r.Next,r.Next=e}};d.Clipper.prototype.Execute=function(){var t=arguments,e=t.length,r=t[1]instanceof d.PolyTree;if(e==4&&!r){var i=t[0],n=t[1],o=t[2],a=t[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&d.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,d.Clear(n),this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!1;try{var l=this.ExecuteInternal();l&&this.BuildResult(n)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return l}else if(e==4&&r){var i=t[0],c=t[1],o=t[2],a=t[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!0;try{var l=this.ExecuteInternal();l&&this.BuildResult2(c)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return l}else if(e==2&&!r){var i=t[0],n=t[1];return this.Execute(i,n,d.PolyFillType.pftEvenOdd,d.PolyFillType.pftEvenOdd)}else if(e==2&&r){var i=t[0],c=t[1];return this.Execute(i,c,d.PolyFillType.pftEvenOdd,d.PolyFillType.pftEvenOdd)}};d.Clipper.prototype.FixHoleLinkage=function(t){if(!(t.FirstLeft===null||t.IsHole!=t.FirstLeft.IsHole&&t.FirstLeft.Pts!==null)){for(var e=t.FirstLeft;e!==null&&(e.IsHole==t.IsHole||e.Pts===null);)e=e.FirstLeft;t.FirstLeft=e}};d.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var t=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(t),d.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var e=this.PopScanbeam();if(!this.ProcessIntersections(t,e))return!1;this.ProcessEdgesAtTopOfScanbeam(e),t=e}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var r=0,i=this.m_PolyOuts.length;r<i;r++){var n=this.m_PolyOuts[r];n.Pts===null||n.IsOpen||(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)}this.JoinCommonEdges();for(var r=0,i=this.m_PolyOuts.length;r<i;r++){var n=this.m_PolyOuts[r];n.Pts!==null&&!n.IsOpen&&this.FixupOutPolygon(n)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{d.Clear(this.m_Joins),d.Clear(this.m_GhostJoins)}};d.Clipper.prototype.PopScanbeam=function(){var t=this.m_Scanbeam.Y,e=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,e=null,t};d.Clipper.prototype.DisposeAllPolyPts=function(){for(var t=0,e=this.m_PolyOuts.length;t<e;++t)this.DisposeOutRec(t);d.Clear(this.m_PolyOuts)};d.Clipper.prototype.DisposeOutRec=function(t){var e=this.m_PolyOuts[t];e.Pts!==null&&this.DisposeOutPts(e.Pts),e=null,this.m_PolyOuts[t]=null};d.Clipper.prototype.DisposeOutPts=function(t){if(t!==null){var e=null;for(t.Prev.Next=null;t!==null;)e=t,t=t.Next,e=null}};d.Clipper.prototype.AddJoin=function(t,e,r){var i=new d.Join;i.OutPt1=t,i.OutPt2=e,i.OffPt.X=r.X,i.OffPt.Y=r.Y,this.m_Joins.push(i)};d.Clipper.prototype.AddGhostJoin=function(t,e){var r=new d.Join;r.OutPt1=t,r.OffPt.X=e.X,r.OffPt.Y=e.Y,this.m_GhostJoins.push(r)};di&&(d.Clipper.prototype.SetZ=function(t,e){t.Z=0,this.ZFillFunction!==null&&(e.OutIdx<0?this.ZFillFunction(e.Bot,e.Top,t):this.ZFillFunction(e.Top,e.Bot,t))});d.Clipper.prototype.InsertLocalMinimaIntoAEL=function(t){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==t;){var e=this.m_CurrentLM.LeftBound,r=this.m_CurrentLM.RightBound;this.PopLocalMinima();var i=null;if(e===null?(this.InsertEdgeIntoAEL(r,null),this.SetWindingCount(r),this.IsContributing(r)&&(i=this.AddOutPt(r,r.Bot))):r==null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(i=this.AddOutPt(e,e.Bot)),this.InsertScanbeam(e.Top.Y)):(this.InsertEdgeIntoAEL(e,null),this.InsertEdgeIntoAEL(r,e),this.SetWindingCount(e),r.WindCnt=e.WindCnt,r.WindCnt2=e.WindCnt2,this.IsContributing(e)&&(i=this.AddLocalMinPoly(e,r,e.Bot)),this.InsertScanbeam(e.Top.Y)),r!=null&&(d.ClipperBase.IsHorizontal(r)?this.AddEdgeToSEL(r):this.InsertScanbeam(r.Top.Y)),!(e==null||r==null)){if(i!==null&&d.ClipperBase.IsHorizontal(r)&&this.m_GhostJoins.length>0&&r.WindDelta!==0)for(var n=0,o=this.m_GhostJoins.length;n<o;n++){var a=this.m_GhostJoins[n];this.HorzSegmentsOverlap(a.OutPt1.Pt,a.OffPt,r.Bot,r.Top)&&this.AddJoin(a.OutPt1,i,a.OffPt)}if(e.OutIdx>=0&&e.PrevInAEL!==null&&e.PrevInAEL.Curr.X==e.Bot.X&&e.PrevInAEL.OutIdx>=0&&d.ClipperBase.SlopesEqual(e.PrevInAEL,e,this.m_UseFullRange)&&e.WindDelta!==0&&e.PrevInAEL.WindDelta!==0){var l=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(i,l,e.Top)}if(e.NextInAEL!=r){if(r.OutIdx>=0&&r.PrevInAEL.OutIdx>=0&&d.ClipperBase.SlopesEqual(r.PrevInAEL,r,this.m_UseFullRange)&&r.WindDelta!==0&&r.PrevInAEL.WindDelta!==0){var l=this.AddOutPt(r.PrevInAEL,r.Bot);this.AddJoin(i,l,r.Top)}var c=e.NextInAEL;if(c!==null)for(;c!=r;)this.IntersectEdges(r,c,e.Curr,!1),c=c.NextInAEL}}}};d.Clipper.prototype.InsertEdgeIntoAEL=function(t,e){if(this.m_ActiveEdges===null)t.PrevInAEL=null,t.NextInAEL=null,this.m_ActiveEdges=t;else if(e===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,t))t.PrevInAEL=null,t.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=t,this.m_ActiveEdges=t;else{for(e===null&&(e=this.m_ActiveEdges);e.NextInAEL!==null&&!this.E2InsertsBeforeE1(e.NextInAEL,t);)e=e.NextInAEL;t.NextInAEL=e.NextInAEL,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=t),t.PrevInAEL=e,e.NextInAEL=t}};d.Clipper.prototype.E2InsertsBeforeE1=function(t,e){return e.Curr.X==t.Curr.X?e.Top.Y>t.Top.Y?e.Top.X<d.Clipper.TopX(t,e.Top.Y):t.Top.X>d.Clipper.TopX(e,t.Top.Y):e.Curr.X<t.Curr.X};d.Clipper.prototype.IsEvenOddFillType=function(t){return t.PolyTyp==d.PolyType.ptSubject?this.m_SubjFillType==d.PolyFillType.pftEvenOdd:this.m_ClipFillType==d.PolyFillType.pftEvenOdd};d.Clipper.prototype.IsEvenOddAltFillType=function(t){return t.PolyTyp==d.PolyType.ptSubject?this.m_ClipFillType==d.PolyFillType.pftEvenOdd:this.m_SubjFillType==d.PolyFillType.pftEvenOdd};d.Clipper.prototype.IsContributing=function(t){var e,r;switch(t.PolyTyp==d.PolyType.ptSubject?(e=this.m_SubjFillType,r=this.m_ClipFillType):(e=this.m_ClipFillType,r=this.m_SubjFillType),e){case d.PolyFillType.pftEvenOdd:if(t.WindDelta===0&&t.WindCnt!=1)return!1;break;case d.PolyFillType.pftNonZero:if(Math.abs(t.WindCnt)!=1)return!1;break;case d.PolyFillType.pftPositive:if(t.WindCnt!=1)return!1;break;default:if(t.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case d.ClipType.ctIntersection:switch(r){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return t.WindCnt2!==0;case d.PolyFillType.pftPositive:return t.WindCnt2>0;default:return t.WindCnt2<0}case d.ClipType.ctUnion:switch(r){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return t.WindCnt2===0;case d.PolyFillType.pftPositive:return t.WindCnt2<=0;default:return t.WindCnt2>=0}case d.ClipType.ctDifference:if(t.PolyTyp==d.PolyType.ptSubject)switch(r){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return t.WindCnt2===0;case d.PolyFillType.pftPositive:return t.WindCnt2<=0;default:return t.WindCnt2>=0}else switch(r){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return t.WindCnt2!==0;case d.PolyFillType.pftPositive:return t.WindCnt2>0;default:return t.WindCnt2<0}case d.ClipType.ctXor:if(t.WindDelta===0)switch(r){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return t.WindCnt2===0;case d.PolyFillType.pftPositive:return t.WindCnt2<=0;default:return t.WindCnt2>=0}else return!0}return!0};d.Clipper.prototype.SetWindingCount=function(t){for(var e=t.PrevInAEL;e!==null&&(e.PolyTyp!=t.PolyTyp||e.WindDelta===0);)e=e.PrevInAEL;if(e===null)t.WindCnt=t.WindDelta===0?1:t.WindDelta,t.WindCnt2=0,e=this.m_ActiveEdges;else if(t.WindDelta===0&&this.m_ClipType!=d.ClipType.ctUnion)t.WindCnt=1,t.WindCnt2=e.WindCnt2,e=e.NextInAEL;else if(this.IsEvenOddFillType(t)){if(t.WindDelta===0){for(var r=!0,i=e.PrevInAEL;i!==null;)i.PolyTyp==e.PolyTyp&&i.WindDelta!==0&&(r=!r),i=i.PrevInAEL;t.WindCnt=r?0:1}else t.WindCnt=t.WindDelta;t.WindCnt2=e.WindCnt2,e=e.NextInAEL}else e.WindCnt*e.WindDelta<0?Math.abs(e.WindCnt)>1?e.WindDelta*t.WindDelta<0?t.WindCnt=e.WindCnt:t.WindCnt=e.WindCnt+t.WindDelta:t.WindCnt=t.WindDelta===0?1:t.WindDelta:t.WindDelta===0?t.WindCnt=e.WindCnt<0?e.WindCnt-1:e.WindCnt+1:e.WindDelta*t.WindDelta<0?t.WindCnt=e.WindCnt:t.WindCnt=e.WindCnt+t.WindDelta,t.WindCnt2=e.WindCnt2,e=e.NextInAEL;if(this.IsEvenOddAltFillType(t))for(;e!=t;)e.WindDelta!==0&&(t.WindCnt2=t.WindCnt2===0?1:0),e=e.NextInAEL;else for(;e!=t;)t.WindCnt2+=e.WindDelta,e=e.NextInAEL};d.Clipper.prototype.AddEdgeToSEL=function(t){this.m_SortedEdges===null?(this.m_SortedEdges=t,t.PrevInSEL=null,t.NextInSEL=null):(t.NextInSEL=this.m_SortedEdges,t.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=t,this.m_SortedEdges=t)};d.Clipper.prototype.CopyAELToSEL=function(){var t=this.m_ActiveEdges;for(this.m_SortedEdges=t;t!==null;)t.PrevInSEL=t.PrevInAEL,t.NextInSEL=t.NextInAEL,t=t.NextInAEL};d.Clipper.prototype.SwapPositionsInAEL=function(t,e){if(!(t.NextInAEL==t.PrevInAEL||e.NextInAEL==e.PrevInAEL)){if(t.NextInAEL==e){var r=e.NextInAEL;r!==null&&(r.PrevInAEL=t);var i=t.PrevInAEL;i!==null&&(i.NextInAEL=e),e.PrevInAEL=i,e.NextInAEL=t,t.PrevInAEL=e,t.NextInAEL=r}else if(e.NextInAEL==t){var r=t.NextInAEL;r!==null&&(r.PrevInAEL=e);var i=e.PrevInAEL;i!==null&&(i.NextInAEL=t),t.PrevInAEL=i,t.NextInAEL=e,e.PrevInAEL=t,e.NextInAEL=r}else{var r=t.NextInAEL,i=t.PrevInAEL;t.NextInAEL=e.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=e.PrevInAEL,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t),e.NextInAEL=r,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=i,e.PrevInAEL!==null&&(e.PrevInAEL.NextInAEL=e)}t.PrevInAEL===null?this.m_ActiveEdges=t:e.PrevInAEL===null&&(this.m_ActiveEdges=e)}};d.Clipper.prototype.SwapPositionsInSEL=function(t,e){if(!(t.NextInSEL===null&&t.PrevInSEL===null)&&!(e.NextInSEL===null&&e.PrevInSEL===null)){if(t.NextInSEL==e){var r=e.NextInSEL;r!==null&&(r.PrevInSEL=t);var i=t.PrevInSEL;i!==null&&(i.NextInSEL=e),e.PrevInSEL=i,e.NextInSEL=t,t.PrevInSEL=e,t.NextInSEL=r}else if(e.NextInSEL==t){var r=t.NextInSEL;r!==null&&(r.PrevInSEL=e);var i=e.PrevInSEL;i!==null&&(i.NextInSEL=t),t.PrevInSEL=i,t.NextInSEL=e,e.PrevInSEL=t,e.NextInSEL=r}else{var r=t.NextInSEL,i=t.PrevInSEL;t.NextInSEL=e.NextInSEL,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=e.PrevInSEL,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t),e.NextInSEL=r,e.NextInSEL!==null&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=i,e.PrevInSEL!==null&&(e.PrevInSEL.NextInSEL=e)}t.PrevInSEL===null?this.m_SortedEdges=t:e.PrevInSEL===null&&(this.m_SortedEdges=e)}};d.Clipper.prototype.AddLocalMaxPoly=function(t,e,r){this.AddOutPt(t,r),e.WindDelta==0&&this.AddOutPt(e,r),t.OutIdx==e.OutIdx?(t.OutIdx=-1,e.OutIdx=-1):t.OutIdx<e.OutIdx?this.AppendPolygon(t,e):this.AppendPolygon(e,t)};d.Clipper.prototype.AddLocalMinPoly=function(t,e,r){var i,n,o;if(d.ClipperBase.IsHorizontal(e)||t.Dx>e.Dx?(i=this.AddOutPt(t,r),e.OutIdx=t.OutIdx,t.Side=d.EdgeSide.esLeft,e.Side=d.EdgeSide.esRight,n=t,n.PrevInAEL==e?o=e.PrevInAEL:o=n.PrevInAEL):(i=this.AddOutPt(e,r),t.OutIdx=e.OutIdx,t.Side=d.EdgeSide.esRight,e.Side=d.EdgeSide.esLeft,n=e,n.PrevInAEL==t?o=t.PrevInAEL:o=n.PrevInAEL),o!==null&&o.OutIdx>=0&&d.Clipper.TopX(o,r.Y)==d.Clipper.TopX(n,r.Y)&&d.ClipperBase.SlopesEqual(n,o,this.m_UseFullRange)&&n.WindDelta!==0&&o.WindDelta!==0){var a=this.AddOutPt(o,r);this.AddJoin(i,a,n.Top)}return i};d.Clipper.prototype.CreateOutRec=function(){var t=new d.OutRec;return t.Idx=-1,t.IsHole=!1,t.IsOpen=!1,t.FirstLeft=null,t.Pts=null,t.BottomPt=null,t.PolyNode=null,this.m_PolyOuts.push(t),t.Idx=this.m_PolyOuts.length-1,t};d.Clipper.prototype.AddOutPt=function(t,e){var r=t.Side==d.EdgeSide.esLeft;if(t.OutIdx<0){var i=this.CreateOutRec();i.IsOpen=t.WindDelta===0;var n=new d.OutPt;return i.Pts=n,n.Idx=i.Idx,n.Pt.X=e.X,n.Pt.Y=e.Y,n.Next=n,n.Prev=n,i.IsOpen||this.SetHoleState(t,i),di&&(d.IntPoint.op_Equality(e,t.Bot)?(n.Pt.X=t.Bot.X,n.Pt.Y=t.Bot.Y,n.Pt.Z=t.Bot.Z):d.IntPoint.op_Equality(e,t.Top)?(n.Pt.X=t.Top.X,n.Pt.Y=t.Top.Y,n.Pt.Z=t.Top.Z):this.SetZ(n.Pt,t)),t.OutIdx=i.Idx,n}else{var i=this.m_PolyOuts[t.OutIdx],o=i.Pts;if(r&&d.IntPoint.op_Equality(e,o.Pt))return o;if(!r&&d.IntPoint.op_Equality(e,o.Prev.Pt))return o.Prev;var n=new d.OutPt;return n.Idx=i.Idx,n.Pt.X=e.X,n.Pt.Y=e.Y,n.Next=o,n.Prev=o.Prev,n.Prev.Next=n,o.Prev=n,r&&(i.Pts=n),di&&(d.IntPoint.op_Equality(e,t.Bot)?(n.Pt.X=t.Bot.X,n.Pt.Y=t.Bot.Y,n.Pt.Z=t.Bot.Z):d.IntPoint.op_Equality(e,t.Top)?(n.Pt.X=t.Top.X,n.Pt.Y=t.Top.Y,n.Pt.Z=t.Top.Z):this.SetZ(n.Pt,t)),n}};d.Clipper.prototype.SwapPoints=function(t,e){var r=new d.IntPoint(t.Value);t.Value.X=e.Value.X,t.Value.Y=e.Value.Y,e.Value.X=r.X,e.Value.Y=r.Y};d.Clipper.prototype.HorzSegmentsOverlap=function(t,e,r,i){return t.X>r.X==t.X<i.X||e.X>r.X==e.X<i.X||r.X>t.X==r.X<e.X||i.X>t.X==i.X<e.X||t.X==r.X&&e.X==i.X?!0:t.X==i.X&&e.X==r.X};d.Clipper.prototype.InsertPolyPtBetween=function(t,e,r){var i=new d.OutPt;return i.Pt.X=r.X,i.Pt.Y=r.Y,e==t.Next?(t.Next=i,e.Prev=i,i.Next=e,i.Prev=t):(e.Next=i,t.Prev=i,i.Next=t,i.Prev=e),i};d.Clipper.prototype.SetHoleState=function(t,e){for(var r=!1,i=t.PrevInAEL;i!==null;)i.OutIdx>=0&&i.WindDelta!=0&&(r=!r,e.FirstLeft===null&&(e.FirstLeft=this.m_PolyOuts[i.OutIdx])),i=i.PrevInAEL;r&&(e.IsHole=!0)};d.Clipper.prototype.GetDx=function(t,e){return t.Y==e.Y?d.ClipperBase.horizontal:(e.X-t.X)/(e.Y-t.Y)};d.Clipper.prototype.FirstIsBottomPt=function(t,e){for(var r=t.Prev;d.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Prev;var i=Math.abs(this.GetDx(t.Pt,r.Pt));for(r=t.Next;d.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Next;var n=Math.abs(this.GetDx(t.Pt,r.Pt));for(r=e.Prev;d.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Prev;var o=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=e.Next;d.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Next;var a=Math.abs(this.GetDx(e.Pt,r.Pt));return i>=o&&i>=a||n>=o&&n>=a};d.Clipper.prototype.GetBottomPt=function(t){for(var e=null,r=t.Next;r!=t;)r.Pt.Y>t.Pt.Y?(t=r,e=null):r.Pt.Y==t.Pt.Y&&r.Pt.X<=t.Pt.X&&(r.Pt.X<t.Pt.X?(e=null,t=r):r.Next!=t&&r.Prev!=t&&(e=r)),r=r.Next;if(e!==null)for(;e!=r;)for(this.FirstIsBottomPt(r,e)||(t=e),e=e.Next;d.IntPoint.op_Inequality(e.Pt,t.Pt);)e=e.Next;return t};d.Clipper.prototype.GetLowermostRec=function(t,e){t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts)),e.BottomPt===null&&(e.BottomPt=this.GetBottomPt(e.Pts));var r=t.BottomPt,i=e.BottomPt;return r.Pt.Y>i.Pt.Y?t:r.Pt.Y<i.Pt.Y?e:r.Pt.X<i.Pt.X?t:r.Pt.X>i.Pt.X||r.Next==r?e:i.Next==i||this.FirstIsBottomPt(r,i)?t:e};d.Clipper.prototype.Param1RightOfParam2=function(t,e){do if(t=t.FirstLeft,t==e)return!0;while(t!==null);return!1};d.Clipper.prototype.GetOutRec=function(t){for(var e=this.m_PolyOuts[t];e!=this.m_PolyOuts[e.Idx];)e=this.m_PolyOuts[e.Idx];return e};d.Clipper.prototype.AppendPolygon=function(t,e){var r=this.m_PolyOuts[t.OutIdx],i=this.m_PolyOuts[e.OutIdx],n;this.Param1RightOfParam2(r,i)?n=i:this.Param1RightOfParam2(i,r)?n=r:n=this.GetLowermostRec(r,i);var o=r.Pts,a=o.Prev,l=i.Pts,c=l.Prev,u;t.Side==d.EdgeSide.esLeft?(e.Side==d.EdgeSide.esLeft?(this.ReversePolyPtLinks(l),l.Next=o,o.Prev=l,a.Next=c,c.Prev=a,r.Pts=c):(c.Next=o,o.Prev=c,l.Prev=a,a.Next=l,r.Pts=l),u=d.EdgeSide.esLeft):(e.Side==d.EdgeSide.esRight?(this.ReversePolyPtLinks(l),a.Next=c,c.Prev=a,l.Next=o,o.Prev=l):(a.Next=l,l.Prev=a,o.Prev=c,c.Next=o),u=d.EdgeSide.esRight),r.BottomPt=null,n==i&&(i.FirstLeft!=r&&(r.FirstLeft=i.FirstLeft),r.IsHole=i.IsHole),i.Pts=null,i.BottomPt=null,i.FirstLeft=r;var p=t.OutIdx,f=e.OutIdx;t.OutIdx=-1,e.OutIdx=-1;for(var h=this.m_ActiveEdges;h!==null;){if(h.OutIdx==f){h.OutIdx=p,h.Side=u;break}h=h.NextInAEL}i.Idx=r.Idx};d.Clipper.prototype.ReversePolyPtLinks=function(t){if(t!==null){var e,r;e=t;do r=e.Next,e.Next=e.Prev,e.Prev=r,e=r;while(e!=t)}};d.Clipper.SwapSides=function(t,e){var r=t.Side;t.Side=e.Side,e.Side=r};d.Clipper.SwapPolyIndexes=function(t,e){var r=t.OutIdx;t.OutIdx=e.OutIdx,e.OutIdx=r};d.Clipper.prototype.IntersectEdges=function(t,e,r,i){var n=!i&&t.NextInLML===null&&t.Top.X==r.X&&t.Top.Y==r.Y,o=!i&&e.NextInLML===null&&e.Top.X==r.X&&e.Top.Y==r.Y,a=t.OutIdx>=0,l=e.OutIdx>=0;if(hA&&(t.WindDelta===0||e.WindDelta===0)){t.WindDelta===0&&e.WindDelta===0?(n||o)&&a&&l&&this.AddLocalMaxPoly(t,e,r):t.PolyTyp==e.PolyTyp&&t.WindDelta!=e.WindDelta&&this.m_ClipType==d.ClipType.ctUnion?t.WindDelta===0?l&&(this.AddOutPt(t,r),a&&(t.OutIdx=-1)):a&&(this.AddOutPt(e,r),l&&(e.OutIdx=-1)):t.PolyTyp!=e.PolyTyp&&(t.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=d.ClipType.ctUnion||e.WindCnt2===0)?(this.AddOutPt(t,r),a&&(t.OutIdx=-1)):e.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=d.ClipType.ctUnion||t.WindCnt2===0)&&(this.AddOutPt(e,r),l&&(e.OutIdx=-1))),n&&(t.OutIdx<0?this.DeleteFromAEL(t):d.Error("Error intersecting polylines")),o&&(e.OutIdx<0?this.DeleteFromAEL(e):d.Error("Error intersecting polylines"));return}if(t.PolyTyp==e.PolyTyp)if(this.IsEvenOddFillType(t)){var c=t.WindCnt;t.WindCnt=e.WindCnt,e.WindCnt=c}else t.WindCnt+e.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt+=e.WindDelta,e.WindCnt-t.WindDelta===0?e.WindCnt=-e.WindCnt:e.WindCnt-=t.WindDelta;else this.IsEvenOddFillType(e)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2+=e.WindDelta,this.IsEvenOddFillType(t)?e.WindCnt2=e.WindCnt2===0?1:0:e.WindCnt2-=t.WindDelta;var u,p,f,h;t.PolyTyp==d.PolyType.ptSubject?(u=this.m_SubjFillType,f=this.m_ClipFillType):(u=this.m_ClipFillType,f=this.m_SubjFillType),e.PolyTyp==d.PolyType.ptSubject?(p=this.m_SubjFillType,h=this.m_ClipFillType):(p=this.m_ClipFillType,h=this.m_SubjFillType);var y,g;switch(u){case d.PolyFillType.pftPositive:y=t.WindCnt;break;case d.PolyFillType.pftNegative:y=-t.WindCnt;break;default:y=Math.abs(t.WindCnt);break}switch(p){case d.PolyFillType.pftPositive:g=e.WindCnt;break;case d.PolyFillType.pftNegative:g=-e.WindCnt;break;default:g=Math.abs(e.WindCnt);break}if(a&&l)n||o||y!==0&&y!=1||g!==0&&g!=1||t.PolyTyp!=e.PolyTyp&&this.m_ClipType!=d.ClipType.ctXor?this.AddLocalMaxPoly(t,e,r):(this.AddOutPt(t,r),this.AddOutPt(e,r),d.Clipper.SwapSides(t,e),d.Clipper.SwapPolyIndexes(t,e));else if(a)(g===0||g==1)&&(this.AddOutPt(t,r),d.Clipper.SwapSides(t,e),d.Clipper.SwapPolyIndexes(t,e));else if(l)(y===0||y==1)&&(this.AddOutPt(e,r),d.Clipper.SwapSides(t,e),d.Clipper.SwapPolyIndexes(t,e));else if((y===0||y==1)&&(g===0||g==1)&&!n&&!o){var x,_;switch(f){case d.PolyFillType.pftPositive:x=t.WindCnt2;break;case d.PolyFillType.pftNegative:x=-t.WindCnt2;break;default:x=Math.abs(t.WindCnt2);break}switch(h){case d.PolyFillType.pftPositive:_=e.WindCnt2;break;case d.PolyFillType.pftNegative:_=-e.WindCnt2;break;default:_=Math.abs(e.WindCnt2);break}if(t.PolyTyp!=e.PolyTyp)this.AddLocalMinPoly(t,e,r);else if(y==1&&g==1)switch(this.m_ClipType){case d.ClipType.ctIntersection:x>0&&_>0&&this.AddLocalMinPoly(t,e,r);break;case d.ClipType.ctUnion:x<=0&&_<=0&&this.AddLocalMinPoly(t,e,r);break;case d.ClipType.ctDifference:(t.PolyTyp==d.PolyType.ptClip&&x>0&&_>0||t.PolyTyp==d.PolyType.ptSubject&&x<=0&&_<=0)&&this.AddLocalMinPoly(t,e,r);break;case d.ClipType.ctXor:this.AddLocalMinPoly(t,e,r);break}else d.Clipper.SwapSides(t,e)}n!=o&&(n&&t.OutIdx>=0||o&&e.OutIdx>=0)&&(d.Clipper.SwapSides(t,e),d.Clipper.SwapPolyIndexes(t,e)),n&&this.DeleteFromAEL(t),o&&this.DeleteFromAEL(e)};d.Clipper.prototype.DeleteFromAEL=function(t){var e=t.PrevInAEL,r=t.NextInAEL;e===null&&r===null&&t!=this.m_ActiveEdges||(e!==null?e.NextInAEL=r:this.m_ActiveEdges=r,r!==null&&(r.PrevInAEL=e),t.NextInAEL=null,t.PrevInAEL=null)};d.Clipper.prototype.DeleteFromSEL=function(t){var e=t.PrevInSEL,r=t.NextInSEL;e===null&&r===null&&t!=this.m_SortedEdges||(e!==null?e.NextInSEL=r:this.m_SortedEdges=r,r!==null&&(r.PrevInSEL=e),t.NextInSEL=null,t.PrevInSEL=null)};d.Clipper.prototype.UpdateEdgeIntoAEL=function(t){t.NextInLML===null&&d.Error("UpdateEdgeIntoAEL: invalid call");var e=t.PrevInAEL,r=t.NextInAEL;return t.NextInLML.OutIdx=t.OutIdx,e!==null?e.NextInAEL=t.NextInLML:this.m_ActiveEdges=t.NextInLML,r!==null&&(r.PrevInAEL=t.NextInLML),t.NextInLML.Side=t.Side,t.NextInLML.WindDelta=t.WindDelta,t.NextInLML.WindCnt=t.WindCnt,t.NextInLML.WindCnt2=t.WindCnt2,t=t.NextInLML,t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.PrevInAEL=e,t.NextInAEL=r,d.ClipperBase.IsHorizontal(t)||this.InsertScanbeam(t.Top.Y),t};d.Clipper.prototype.ProcessHorizontals=function(t){for(var e=this.m_SortedEdges;e!==null;)this.DeleteFromSEL(e),this.ProcessHorizontal(e,t),e=this.m_SortedEdges};d.Clipper.prototype.GetHorzDirection=function(t,e){t.Bot.X<t.Top.X?(e.Left=t.Bot.X,e.Right=t.Top.X,e.Dir=d.Direction.dLeftToRight):(e.Left=t.Top.X,e.Right=t.Bot.X,e.Dir=d.Direction.dRightToLeft)};d.Clipper.prototype.PrepareHorzJoins=function(t,e){var r=this.m_PolyOuts[t.OutIdx].Pts;t.Side!=d.EdgeSide.esLeft&&(r=r.Prev),e&&(d.IntPoint.op_Equality(r.Pt,t.Top)?this.AddGhostJoin(r,t.Bot):this.AddGhostJoin(r,t.Top))};d.Clipper.prototype.ProcessHorizontal=function(t,e){var r={Dir:null,Left:null,Right:null};this.GetHorzDirection(t,r);for(var i=r.Dir,n=r.Left,o=r.Right,a=t,l=null;a.NextInLML!==null&&d.ClipperBase.IsHorizontal(a.NextInLML);)a=a.NextInLML;for(a.NextInLML===null&&(l=this.GetMaximaPair(a));;){for(var c=t==a,u=this.GetNextInAEL(t,i);u!==null&&!(u.Curr.X==t.Top.X&&t.NextInLML!==null&&u.Dx<t.NextInLML.Dx);){var p=this.GetNextInAEL(u,i);if(i==d.Direction.dLeftToRight&&u.Curr.X<=o||i==d.Direction.dRightToLeft&&u.Curr.X>=n){if(t.OutIdx>=0&&t.WindDelta!=0&&this.PrepareHorzJoins(t,e),u==l&&c){i==d.Direction.dLeftToRight?this.IntersectEdges(t,u,u.Top,!1):this.IntersectEdges(u,t,u.Top,!1),l.OutIdx>=0&&d.Error("ProcessHorizontal error");return}else if(i==d.Direction.dLeftToRight){var f=new d.IntPoint(u.Curr.X,t.Curr.Y);this.IntersectEdges(t,u,f,!0)}else{var f=new d.IntPoint(u.Curr.X,t.Curr.Y);this.IntersectEdges(u,t,f,!0)}this.SwapPositionsInAEL(t,u)}else if(i==d.Direction.dLeftToRight&&u.Curr.X>=o||i==d.Direction.dRightToLeft&&u.Curr.X<=n)break;u=p}if(t.OutIdx>=0&&t.WindDelta!==0&&this.PrepareHorzJoins(t,e),t.NextInLML!==null&&d.ClipperBase.IsHorizontal(t.NextInLML)){t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot);var r={Dir:i,Left:n,Right:o};this.GetHorzDirection(t,r),i=r.Dir,n=r.Left,o=r.Right}else break}if(t.NextInLML!==null)if(t.OutIdx>=0){var h=this.AddOutPt(t,t.Top);if(t=this.UpdateEdgeIntoAEL(t),t.WindDelta===0)return;var y=t.PrevInAEL,p=t.NextInAEL;if(y!==null&&y.Curr.X==t.Bot.X&&y.Curr.Y==t.Bot.Y&&y.WindDelta!==0&&y.OutIdx>=0&&y.Curr.Y>y.Top.Y&&d.ClipperBase.SlopesEqual(t,y,this.m_UseFullRange)){var g=this.AddOutPt(y,t.Bot);this.AddJoin(h,g,t.Top)}else if(p!==null&&p.Curr.X==t.Bot.X&&p.Curr.Y==t.Bot.Y&&p.WindDelta!==0&&p.OutIdx>=0&&p.Curr.Y>p.Top.Y&&d.ClipperBase.SlopesEqual(t,p,this.m_UseFullRange)){var g=this.AddOutPt(p,t.Bot);this.AddJoin(h,g,t.Top)}}else t=this.UpdateEdgeIntoAEL(t);else l!==null?l.OutIdx>=0?(i==d.Direction.dLeftToRight?this.IntersectEdges(t,l,t.Top,!1):this.IntersectEdges(l,t,t.Top,!1),l.OutIdx>=0&&d.Error("ProcessHorizontal error")):(this.DeleteFromAEL(t),this.DeleteFromAEL(l)):(t.OutIdx>=0&&this.AddOutPt(t,t.Top),this.DeleteFromAEL(t))};d.Clipper.prototype.GetNextInAEL=function(t,e){return e==d.Direction.dLeftToRight?t.NextInAEL:t.PrevInAEL};d.Clipper.prototype.IsMinima=function(t){return t!==null&&t.Prev.NextInLML!=t&&t.Next.NextInLML!=t};d.Clipper.prototype.IsMaxima=function(t,e){return t!==null&&t.Top.Y==e&&t.NextInLML===null};d.Clipper.prototype.IsIntermediate=function(t,e){return t.Top.Y==e&&t.NextInLML!==null};d.Clipper.prototype.GetMaximaPair=function(t){var e=null;return d.IntPoint.op_Equality(t.Next.Top,t.Top)&&t.Next.NextInLML===null?e=t.Next:d.IntPoint.op_Equality(t.Prev.Top,t.Top)&&t.Prev.NextInLML===null&&(e=t.Prev),e!==null&&(e.OutIdx==-2||e.NextInAEL==e.PrevInAEL&&!d.ClipperBase.IsHorizontal(e))?null:e};d.Clipper.prototype.ProcessIntersections=function(t,e){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(t,e),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch(r){this.m_SortedEdges=null,this.m_IntersectList.length=0,d.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};d.Clipper.prototype.BuildIntersectList=function(t,e){if(this.m_ActiveEdges!==null){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r.Curr.X=d.Clipper.TopX(r,e),r=r.NextInAEL;for(var i=!0;i&&this.m_SortedEdges!==null;){for(i=!1,r=this.m_SortedEdges;r.NextInSEL!==null;){var n=r.NextInSEL,o=new d.IntPoint;if(r.Curr.X>n.Curr.X){!this.IntersectPoint(r,n,o)&&r.Curr.X>n.Curr.X+1&&d.Error("Intersection error"),o.Y>t&&(o.Y=t,Math.abs(r.Dx)>Math.abs(n.Dx)?o.X=d.Clipper.TopX(n,t):o.X=d.Clipper.TopX(r,t));var a=new d.IntersectNode;a.Edge1=r,a.Edge2=n,a.Pt.X=o.X,a.Pt.Y=o.Y,this.m_IntersectList.push(a),this.SwapPositionsInSEL(r,n),i=!0}else r=n}if(r.PrevInSEL!==null)r.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};d.Clipper.prototype.EdgesAdjacent=function(t){return t.Edge1.NextInSEL==t.Edge2||t.Edge1.PrevInSEL==t.Edge2};d.Clipper.IntersectNodeSort=function(t,e){return e.Pt.Y-t.Pt.Y};d.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var t=this.m_IntersectList.length,e=0;e<t;e++){if(!this.EdgesAdjacent(this.m_IntersectList[e])){for(var r=e+1;r<t&&!this.EdgesAdjacent(this.m_IntersectList[r]);)r++;if(r==t)return!1;var i=this.m_IntersectList[e];this.m_IntersectList[e]=this.m_IntersectList[r],this.m_IntersectList[r]=i}this.SwapPositionsInSEL(this.m_IntersectList[e].Edge1,this.m_IntersectList[e].Edge2)}return!0};d.Clipper.prototype.ProcessIntersectList=function(){for(var t=0,e=this.m_IntersectList.length;t<e;t++){var r=this.m_IntersectList[t];this.IntersectEdges(r.Edge1,r.Edge2,r.Pt,!0),this.SwapPositionsInAEL(r.Edge1,r.Edge2)}this.m_IntersectList.length=0};var QV=s(function(t){return t<0?Math.ceil(t-.5):Math.round(t)},"R1"),ej=s(function(t){return t<0?Math.ceil(t-.5):Math.floor(t+.5)},"R2"),tj=s(function(t){return t<0?-Math.round(Math.abs(t)):Math.round(t)},"R3"),rj=s(function(t){return t<0?(t-=.5,t<-2147483648?Math.ceil(t):t|0):(t+=.5,t>2147483647?Math.floor(t):t|0)},"R4");pe.msie?d.Clipper.Round=QV:pe.chromium?d.Clipper.Round=tj:pe.safari?d.Clipper.Round=rj:d.Clipper.Round=ej;d.Clipper.TopX=function(t,e){return e==t.Top.Y?t.Top.X:t.Bot.X+d.Clipper.Round(t.Dx*(e-t.Bot.Y))};d.Clipper.prototype.IntersectPoint=function(t,e,r){r.X=0,r.Y=0;var i,n;if(d.ClipperBase.SlopesEqual(t,e,this.m_UseFullRange)||t.Dx==e.Dx)return e.Bot.Y>t.Bot.Y?(r.X=e.Bot.X,r.Y=e.Bot.Y):(r.X=t.Bot.X,r.Y=t.Bot.Y),!1;if(t.Delta.X===0)r.X=t.Bot.X,d.ClipperBase.IsHorizontal(e)?r.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,r.Y=d.Clipper.Round(r.X/e.Dx+n));else if(e.Delta.X===0)r.X=e.Bot.X,d.ClipperBase.IsHorizontal(t)?r.Y=t.Bot.Y:(i=t.Bot.Y-t.Bot.X/t.Dx,r.Y=d.Clipper.Round(r.X/t.Dx+i));else{i=t.Bot.X-t.Bot.Y*t.Dx,n=e.Bot.X-e.Bot.Y*e.Dx;var o=(n-i)/(t.Dx-e.Dx);r.Y=d.Clipper.Round(o),Math.abs(t.Dx)<Math.abs(e.Dx)?r.X=d.Clipper.Round(t.Dx*o+i):r.X=d.Clipper.Round(e.Dx*o+n)}if(r.Y<t.Top.Y||r.Y<e.Top.Y){if(t.Top.Y>e.Top.Y)return r.Y=t.Top.Y,r.X=d.Clipper.TopX(e,t.Top.Y),r.X<t.Top.X;r.Y=e.Top.Y,Math.abs(t.Dx)<Math.abs(e.Dx)?r.X=d.Clipper.TopX(t,r.Y):r.X=d.Clipper.TopX(e,r.Y)}return!0};d.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(t){for(var e=this.m_ActiveEdges;e!==null;){var r=this.IsMaxima(e,t);if(r){var i=this.GetMaximaPair(e);r=i===null||!d.ClipperBase.IsHorizontal(i)}if(r){var n=e.PrevInAEL;this.DoMaxima(e),n===null?e=this.m_ActiveEdges:e=n.NextInAEL}else{if(this.IsIntermediate(e,t)&&d.ClipperBase.IsHorizontal(e.NextInLML)?(e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot),this.AddEdgeToSEL(e)):(e.Curr.X=d.Clipper.TopX(e,t),e.Curr.Y=t),this.StrictlySimple){var n=e.PrevInAEL;if(e.OutIdx>=0&&e.WindDelta!==0&&n!==null&&n.OutIdx>=0&&n.Curr.X==e.Curr.X&&n.WindDelta!==0){var o=this.AddOutPt(n,e.Curr),a=this.AddOutPt(e,e.Curr);this.AddJoin(o,a,e.Curr)}}e=e.NextInAEL}}for(this.ProcessHorizontals(!0),e=this.m_ActiveEdges;e!==null;){if(this.IsIntermediate(e,t)){var o=null;e.OutIdx>=0&&(o=this.AddOutPt(e,e.Top)),e=this.UpdateEdgeIntoAEL(e);var n=e.PrevInAEL,l=e.NextInAEL;if(n!==null&&n.Curr.X==e.Bot.X&&n.Curr.Y==e.Bot.Y&&o!==null&&n.OutIdx>=0&&n.Curr.Y>n.Top.Y&&d.ClipperBase.SlopesEqual(e,n,this.m_UseFullRange)&&e.WindDelta!==0&&n.WindDelta!==0){var a=this.AddOutPt(n,e.Bot);this.AddJoin(o,a,e.Top)}else if(l!==null&&l.Curr.X==e.Bot.X&&l.Curr.Y==e.Bot.Y&&o!==null&&l.OutIdx>=0&&l.Curr.Y>l.Top.Y&&d.ClipperBase.SlopesEqual(e,l,this.m_UseFullRange)&&e.WindDelta!==0&&l.WindDelta!==0){var a=this.AddOutPt(l,e.Bot);this.AddJoin(o,a,e.Top)}}e=e.NextInAEL}};d.Clipper.prototype.DoMaxima=function(t){var e=this.GetMaximaPair(t);if(e===null){t.OutIdx>=0&&this.AddOutPt(t,t.Top),this.DeleteFromAEL(t);return}for(var r=t.NextInAEL,i=!0;r!==null&&r!=e;)this.IntersectEdges(t,r,t.Top,!0),this.SwapPositionsInAEL(t,r),r=t.NextInAEL;t.OutIdx==-1&&e.OutIdx==-1?(this.DeleteFromAEL(t),this.DeleteFromAEL(e)):t.OutIdx>=0&&e.OutIdx>=0?this.IntersectEdges(t,e,t.Top,!1):i&&t.WindDelta===0?(t.OutIdx>=0&&(this.AddOutPt(t,t.Top),t.OutIdx=-1),this.DeleteFromAEL(t),e.OutIdx>=0&&(this.AddOutPt(e,t.Top),e.OutIdx=-1),this.DeleteFromAEL(e)):d.Error("DoMaxima error")};d.Clipper.ReversePaths=function(t){for(var e=0,r=t.length;e<r;e++)t[e].reverse()};d.Clipper.Orientation=function(t){return d.Clipper.Area(t)>=0};d.Clipper.prototype.PointCount=function(t){if(t===null)return 0;var e=0,r=t;do e++,r=r.Next;while(r!=t);return e};d.Clipper.prototype.BuildResult=function(t){d.Clear(t);for(var e=0,r=this.m_PolyOuts.length;e<r;e++){var i=this.m_PolyOuts[e];if(i.Pts!==null){var n=i.Pts.Prev,o=this.PointCount(n);if(!(o<2)){for(var a=new Array(o),l=0;l<o;l++)a[l]=n.Pt,n=n.Prev;t.push(a)}}}};d.Clipper.prototype.BuildResult2=function(t){t.Clear();for(var e=0,r=this.m_PolyOuts.length;e<r;e++){var i=this.m_PolyOuts[e],n=this.PointCount(i.Pts);if(!(i.IsOpen&&n<2||!i.IsOpen&&n<3)){this.FixHoleLinkage(i);var o=new d.PolyNode;t.m_AllPolys.push(o),i.PolyNode=o,o.m_polygon.length=n;for(var a=i.Pts.Prev,l=0;l<n;l++)o.m_polygon[l]=a.Pt,a=a.Prev}}for(var e=0,r=this.m_PolyOuts.length;e<r;e++){var i=this.m_PolyOuts[e];i.PolyNode!==null&&(i.IsOpen?(i.PolyNode.IsOpen=!0,t.AddChild(i.PolyNode)):i.FirstLeft!==null&&i.FirstLeft.PolyNode!=null?i.FirstLeft.PolyNode.AddChild(i.PolyNode):t.AddChild(i.PolyNode))}};d.Clipper.prototype.FixupOutPolygon=function(t){var e=null;t.BottomPt=null;for(var r=t.Pts;;){if(r.Prev==r||r.Prev==r.Next){this.DisposeOutPts(r),t.Pts=null;return}if(d.IntPoint.op_Equality(r.Pt,r.Next.Pt)||d.IntPoint.op_Equality(r.Pt,r.Prev.Pt)||d.ClipperBase.SlopesEqual(r.Prev.Pt,r.Pt,r.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(r.Prev.Pt,r.Pt,r.Next.Pt))){e=null;var i=r;r.Prev.Next=r.Next,r.Next.Prev=r.Prev,r=r.Prev,i=null}else{if(r==e)break;e===null&&(e=r),r=r.Next}}t.Pts=r};d.Clipper.prototype.DupOutPt=function(t,e){var r=new d.OutPt;return r.Pt.X=t.Pt.X,r.Pt.Y=t.Pt.Y,r.Idx=t.Idx,e?(r.Next=t.Next,r.Prev=t,t.Next.Prev=r,t.Next=r):(r.Prev=t.Prev,r.Next=t,t.Prev.Next=r,t.Prev=r),r};d.Clipper.prototype.GetOverlap=function(t,e,r,i,n){return t<e?r<i?(n.Left=Math.max(t,r),n.Right=Math.min(e,i)):(n.Left=Math.max(t,i),n.Right=Math.min(e,r)):r<i?(n.Left=Math.max(e,r),n.Right=Math.min(t,i)):(n.Left=Math.max(e,i),n.Right=Math.min(t,r)),n.Left<n.Right};d.Clipper.prototype.JoinHorz=function(t,e,r,i,n,o){var a=t.Pt.X>e.Pt.X?d.Direction.dRightToLeft:d.Direction.dLeftToRight,l=r.Pt.X>i.Pt.X?d.Direction.dRightToLeft:d.Direction.dLeftToRight;if(a==l)return!1;if(a==d.Direction.dLeftToRight){for(;t.Next.Pt.X<=n.X&&t.Next.Pt.X>=t.Pt.X&&t.Next.Pt.Y==n.Y;)t=t.Next;o&&t.Pt.X!=n.X&&(t=t.Next),e=this.DupOutPt(t,!o),d.IntPoint.op_Inequality(e.Pt,n)&&(t=e,t.Pt.X=n.X,t.Pt.Y=n.Y,e=this.DupOutPt(t,!o))}else{for(;t.Next.Pt.X>=n.X&&t.Next.Pt.X<=t.Pt.X&&t.Next.Pt.Y==n.Y;)t=t.Next;!o&&t.Pt.X!=n.X&&(t=t.Next),e=this.DupOutPt(t,o),d.IntPoint.op_Inequality(e.Pt,n)&&(t=e,t.Pt.X=n.X,t.Pt.Y=n.Y,e=this.DupOutPt(t,o))}if(l==d.Direction.dLeftToRight){for(;r.Next.Pt.X<=n.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;o&&r.Pt.X!=n.X&&(r=r.Next),i=this.DupOutPt(r,!o),d.IntPoint.op_Inequality(i.Pt,n)&&(r=i,r.Pt.X=n.X,r.Pt.Y=n.Y,i=this.DupOutPt(r,!o))}else{for(;r.Next.Pt.X>=n.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;!o&&r.Pt.X!=n.X&&(r=r.Next),i=this.DupOutPt(r,o),d.IntPoint.op_Inequality(i.Pt,n)&&(r=i,r.Pt.X=n.X,r.Pt.Y=n.Y,i=this.DupOutPt(r,o))}return a==d.Direction.dLeftToRight==o?(t.Prev=r,r.Next=t,e.Next=i,i.Prev=e):(t.Next=r,r.Prev=t,e.Prev=i,i.Next=e),!0};d.Clipper.prototype.JoinPoints=function(t,e,r){var i=t.OutPt1,n=new d.OutPt,o=t.OutPt2,a=new d.OutPt,l=t.OutPt1.Pt.Y==t.OffPt.Y;if(l&&d.IntPoint.op_Equality(t.OffPt,t.OutPt1.Pt)&&d.IntPoint.op_Equality(t.OffPt,t.OutPt2.Pt)){for(n=t.OutPt1.Next;n!=i&&d.IntPoint.op_Equality(n.Pt,t.OffPt);)n=n.Next;var c=n.Pt.Y>t.OffPt.Y;for(a=t.OutPt2.Next;a!=o&&d.IntPoint.op_Equality(a.Pt,t.OffPt);)a=a.Next;var u=a.Pt.Y>t.OffPt.Y;return c==u?!1:c?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,t.OutPt1=i,t.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,t.OutPt1=i,t.OutPt2=n,!0)}else if(l){for(n=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=n&&i.Prev!=o;)i=i.Prev;for(;n.Next.Pt.Y==n.Pt.Y&&n.Next!=i&&n.Next!=o;)n=n.Next;if(n.Next==i||n.Next==o)return!1;for(a=o;o.Prev.Pt.Y==o.Pt.Y&&o.Prev!=a&&o.Prev!=n;)o=o.Prev;for(;a.Next.Pt.Y==a.Pt.Y&&a.Next!=o&&a.Next!=i;)a=a.Next;if(a.Next==o||a.Next==i)return!1;var p={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,n.Pt.X,o.Pt.X,a.Pt.X,p))return!1;var f=p.Left,h=p.Right,y=new d.IntPoint,g;return i.Pt.X>=f&&i.Pt.X<=h?(y.X=i.Pt.X,y.Y=i.Pt.Y,g=i.Pt.X>n.Pt.X):o.Pt.X>=f&&o.Pt.X<=h?(y.X=o.Pt.X,y.Y=o.Pt.Y,g=o.Pt.X>a.Pt.X):n.Pt.X>=f&&n.Pt.X<=h?(y.X=n.Pt.X,y.Y=n.Pt.Y,g=n.Pt.X>i.Pt.X):(y.X=a.Pt.X,y.Y=a.Pt.Y,g=a.Pt.X>o.Pt.X),t.OutPt1=i,t.OutPt2=o,this.JoinHorz(i,n,o,a,y,g)}else{for(n=i.Next;d.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Next;var x=n.Pt.Y>i.Pt.Y||!d.ClipperBase.SlopesEqual(i.Pt,n.Pt,t.OffPt,this.m_UseFullRange);if(x){for(n=i.Prev;d.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Prev;if(n.Pt.Y>i.Pt.Y||!d.ClipperBase.SlopesEqual(i.Pt,n.Pt,t.OffPt,this.m_UseFullRange))return!1}for(a=o.Next;d.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Next;var _=a.Pt.Y>o.Pt.Y||!d.ClipperBase.SlopesEqual(o.Pt,a.Pt,t.OffPt,this.m_UseFullRange);if(_){for(a=o.Prev;d.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Prev;if(a.Pt.Y>o.Pt.Y||!d.ClipperBase.SlopesEqual(o.Pt,a.Pt,t.OffPt,this.m_UseFullRange))return!1}return n==i||a==o||n==a||e==r&&x==_?!1:x?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,t.OutPt1=i,t.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,t.OutPt1=i,t.OutPt2=n,!0)}};d.Clipper.GetBounds=function(t){for(var e=0,r=t.length;e<r&&t[e].length==0;)e++;if(e==r)return new d.IntRect(0,0,0,0);var i=new d.IntRect;for(i.left=t[e][0].X,i.right=i.left,i.top=t[e][0].Y,i.bottom=i.top;e<r;e++)for(var n=0,o=t[e].length;n<o;n++)t[e][n].X<i.left?i.left=t[e][n].X:t[e][n].X>i.right&&(i.right=t[e][n].X),t[e][n].Y<i.top?i.top=t[e][n].Y:t[e][n].Y>i.bottom&&(i.bottom=t[e][n].Y);return i};d.Clipper.prototype.GetBounds2=function(t){var e=t,r=new d.IntRect;for(r.left=t.Pt.X,r.right=t.Pt.X,r.top=t.Pt.Y,r.bottom=t.Pt.Y,t=t.Next;t!=e;)t.Pt.X<r.left&&(r.left=t.Pt.X),t.Pt.X>r.right&&(r.right=t.Pt.X),t.Pt.Y<r.top&&(r.top=t.Pt.Y),t.Pt.Y>r.bottom&&(r.bottom=t.Pt.Y),t=t.Next;return r};d.Clipper.PointInPolygon=function(t,e){var r=0,i=e.length;if(i<3)return 0;for(var n=e[0],o=1;o<=i;++o){var a=o==i?e[0]:e[o];if(a.Y==t.Y&&(a.X==t.X||n.Y==t.Y&&a.X>t.X==n.X<t.X))return-1;if(n.Y<t.Y!=a.Y<t.Y){if(n.X>=t.X)if(a.X>t.X)r=1-r;else{var l=(n.X-t.X)*(a.Y-t.Y)-(a.X-t.X)*(n.Y-t.Y);if(l==0)return-1;l>0==a.Y>n.Y&&(r=1-r)}else if(a.X>t.X){var l=(n.X-t.X)*(a.Y-t.Y)-(a.X-t.X)*(n.Y-t.Y);if(l==0)return-1;l>0==a.Y>n.Y&&(r=1-r)}}n=a}return r};d.Clipper.prototype.PointInPolygon=function(t,e){for(var r=0,i=e;;){var n=e.Pt.X,o=e.Pt.Y,a=e.Next.Pt.X,l=e.Next.Pt.Y;if(l==t.Y&&(a==t.X||o==t.Y&&a>t.X==n<t.X))return-1;if(o<t.Y!=l<t.Y){if(n>=t.X)if(a>t.X)r=1-r;else{var c=(n-t.X)*(l-t.Y)-(a-t.X)*(o-t.Y);if(c==0)return-1;c>0==l>o&&(r=1-r)}else if(a>t.X){var c=(n-t.X)*(l-t.Y)-(a-t.X)*(o-t.Y);if(c==0)return-1;c>0==l>o&&(r=1-r)}}if(e=e.Next,i==e)break}return r};d.Clipper.prototype.Poly2ContainsPoly1=function(t,e){var r=t;do{var i=this.PointInPolygon(r.Pt,e);if(i>=0)return i!=0;r=r.Next}while(r!=t);return!0};d.Clipper.prototype.FixupFirstLefts1=function(t,e){for(var r=0,i=this.m_PolyOuts.length;r<i;r++){var n=this.m_PolyOuts[r];n.Pts!==null&&n.FirstLeft==t&&this.Poly2ContainsPoly1(n.Pts,e.Pts)&&(n.FirstLeft=e)}};d.Clipper.prototype.FixupFirstLefts2=function(t,e){for(var r=0,i=this.m_PolyOuts,n=i.length,o=i[r];r<n;r++,o=i[r])o.FirstLeft==t&&(o.FirstLeft=e)};d.Clipper.ParseFirstLeft=function(t){for(;t!=null&&t.Pts==null;)t=t.FirstLeft;return t};d.Clipper.prototype.JoinCommonEdges=function(){for(var t=0,e=this.m_Joins.length;t<e;t++){var r=this.m_Joins[t],i=this.GetOutRec(r.OutPt1.Idx),n=this.GetOutRec(r.OutPt2.Idx);if(!(i.Pts==null||n.Pts==null)){var o;if(i==n?o=i:this.Param1RightOfParam2(i,n)?o=n:this.Param1RightOfParam2(n,i)?o=i:o=this.GetLowermostRec(i,n),!!this.JoinPoints(r,i,n))if(i==n){if(i.Pts=r.OutPt1,i.BottomPt=null,n=this.CreateOutRec(),n.Pts=r.OutPt2,this.UpdateOutPtIdxs(n),this.m_UsingPolyTree)for(var a=0,l=this.m_PolyOuts.length;a<l-1;a++){var c=this.m_PolyOuts[a];c.Pts==null||d.Clipper.ParseFirstLeft(c.FirstLeft)!=i||c.IsHole==i.IsHole||this.Poly2ContainsPoly1(c.Pts,r.OutPt2)&&(c.FirstLeft=n)}this.Poly2ContainsPoly1(n.Pts,i.Pts)?(n.IsHole=!i.IsHole,n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):this.Poly2ContainsPoly1(i.Pts,n.Pts)?(n.IsHole=i.IsHole,i.IsHole=!n.IsHole,n.FirstLeft=i.FirstLeft,i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):(n.IsHole=i.IsHole,n.FirstLeft=i.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(i,n))}else n.Pts=null,n.BottomPt=null,n.Idx=i.Idx,i.IsHole=o.IsHole,o==n&&(i.FirstLeft=n.FirstLeft),n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i)}}};d.Clipper.prototype.UpdateOutPtIdxs=function(t){var e=t.Pts;do e.Idx=t.Idx,e=e.Prev;while(e!=t.Pts)};d.Clipper.prototype.DoSimplePolygons=function(){for(var t=0;t<this.m_PolyOuts.length;){var e=this.m_PolyOuts[t++],r=e.Pts;if(r!==null)do{for(var i=r.Next;i!=e.Pts;){if(d.IntPoint.op_Equality(r.Pt,i.Pt)&&i.Next!=r&&i.Prev!=r){var n=r.Prev,o=i.Prev;r.Prev=o,o.Next=r,i.Prev=n,n.Next=i,e.Pts=r;var a=this.CreateOutRec();a.Pts=i,this.UpdateOutPtIdxs(a),this.Poly2ContainsPoly1(a.Pts,e.Pts)?(a.IsHole=!e.IsHole,a.FirstLeft=e):this.Poly2ContainsPoly1(e.Pts,a.Pts)?(a.IsHole=e.IsHole,e.IsHole=!a.IsHole,a.FirstLeft=e.FirstLeft,e.FirstLeft=a):(a.IsHole=e.IsHole,a.FirstLeft=e.FirstLeft),i=r}i=i.Next}r=r.Next}while(r!=e.Pts)}};d.Clipper.Area=function(t){var e=t.length;if(e<3)return 0;for(var r=0,i=0,n=e-1;i<e;++i)r+=(t[n].X+t[i].X)*(t[n].Y-t[i].Y),n=i;return-r*.5};d.Clipper.prototype.Area=function(t){var e=t.Pts;if(e==null)return 0;var r=0;do r=r+(e.Prev.Pt.X+e.Pt.X)*(e.Prev.Pt.Y-e.Pt.Y),e=e.Next;while(e!=t.Pts);return r*.5};dA&&(d.Clipper.OffsetPaths=function(t,e,r,i,n){var o=new d.Paths,a=new d.ClipperOffset(n,n);return a.AddPaths(t,r,i),a.Execute(o,e),o});d.Clipper.SimplifyPolygon=function(t,e){var r=new Array,i=new d.Clipper(0);return i.StrictlySimple=!0,i.AddPath(t,d.PolyType.ptSubject,!0),i.Execute(d.ClipType.ctUnion,r,e,e),r};d.Clipper.SimplifyPolygons=function(t,e){typeof e>"u"&&(e=d.PolyFillType.pftEvenOdd);var r=new Array,i=new d.Clipper(0);return i.StrictlySimple=!0,i.AddPaths(t,d.PolyType.ptSubject,!0),i.Execute(d.ClipType.ctUnion,r,e,e),r};d.Clipper.DistanceSqrd=function(t,e){var r=t.X-e.X,i=t.Y-e.Y;return r*r+i*i};d.Clipper.DistanceFromLineSqrd=function(t,e,r){var i=e.Y-r.Y,n=r.X-e.X,o=i*e.X+n*e.Y;return o=i*t.X+n*t.Y-o,o*o/(i*i+n*n)};d.Clipper.SlopesNearCollinear=function(t,e,r,i){return d.Clipper.DistanceFromLineSqrd(e,t,r)<i};d.Clipper.PointsAreClose=function(t,e,r){var i=t.X-e.X,n=t.Y-e.Y;return i*i+n*n<=r};d.Clipper.ExcludeOp=function(t){var e=t.Prev;return e.Next=t.Next,t.Next.Prev=e,e.Idx=0,e};d.Clipper.CleanPolygon=function(t,e){typeof e>"u"&&(e=1.415);var r=t.length;if(r==0)return new Array;for(var i=new Array(r),n=0;n<r;++n)i[n]=new d.OutPt;for(var n=0;n<r;++n)i[n].Pt=t[n],i[n].Next=i[(n+1)%r],i[n].Next.Prev=i[n],i[n].Idx=0;for(var o=e*e,a=i[0];a.Idx==0&&a.Next!=a.Prev;)d.Clipper.PointsAreClose(a.Pt,a.Prev.Pt,o)?(a=d.Clipper.ExcludeOp(a),r--):d.Clipper.PointsAreClose(a.Prev.Pt,a.Next.Pt,o)?(d.Clipper.ExcludeOp(a.Next),a=d.Clipper.ExcludeOp(a),r-=2):d.Clipper.SlopesNearCollinear(a.Prev.Pt,a.Pt,a.Next.Pt,o)?(a=d.Clipper.ExcludeOp(a),r--):(a.Idx=1,a=a.Next);r<3&&(r=0);for(var l=new Array(r),n=0;n<r;++n)l[n]=new d.IntPoint(a.Pt),a=a.Next;return i=null,l};d.Clipper.CleanPolygons=function(t,e){for(var r=new Array(t.length),i=0,n=t.length;i<n;i++)r[i]=d.Clipper.CleanPolygon(t[i],e);return r};d.Clipper.Minkowski=function(t,e,r,i){var n=i?1:0,o=t.length,a=e.length,l=new Array;if(r)for(var c=0;c<a;c++){for(var u=new Array(o),p=0,f=t.length,h=t[p];p<f;p++,h=t[p])u[p]=new d.IntPoint(e[c].X+h.X,e[c].Y+h.Y);l.push(u)}else for(var c=0;c<a;c++){for(var u=new Array(o),p=0,f=t.length,h=t[p];p<f;p++,h=t[p])u[p]=new d.IntPoint(e[c].X-h.X,e[c].Y-h.Y);l.push(u)}for(var y=new Array,c=0;c<a-1+n;c++)for(var p=0;p<o;p++){var g=new Array;g.push(l[c%a][p%o]),g.push(l[(c+1)%a][p%o]),g.push(l[(c+1)%a][(p+1)%o]),g.push(l[c%a][(p+1)%o]),d.Clipper.Orientation(g)||g.reverse(),y.push(g)}var x=new d.Clipper(0);return x.AddPaths(y,d.PolyType.ptSubject,!0),x.Execute(d.ClipType.ctUnion,l,d.PolyFillType.pftNonZero,d.PolyFillType.pftNonZero),l};d.Clipper.MinkowskiSum=function(){var t=arguments,e=t.length;if(e==3){var r=t[0],i=t[1],n=t[2];return d.Clipper.Minkowski(r,i,!0,n)}else if(e==4){for(var r=t[0],o=t[1],a=t[2],n=t[3],l=new d.Clipper,c,u=0,p=o.length;u<p;++u){var c=d.Clipper.Minkowski(r,o[u],!0,n);l.AddPaths(c,d.PolyType.ptSubject,!0)}n&&l.AddPaths(o,d.PolyType.ptClip,!0);var f=new d.Paths;return l.Execute(d.ClipType.ctUnion,f,a,a),f}};d.Clipper.MinkowskiDiff=function(t,e,r){return d.Clipper.Minkowski(t,e,!1,r)};d.Clipper.PolyTreeToPaths=function(t){var e=new Array;return d.Clipper.AddPolyNodeToPaths(t,d.Clipper.NodeType.ntAny,e),e};d.Clipper.AddPolyNodeToPaths=function(t,e,r){var i=!0;switch(e){case d.Clipper.NodeType.ntOpen:return;case d.Clipper.NodeType.ntClosed:i=!t.IsOpen;break;default:break}t.m_polygon.length>0&&i&&r.push(t.m_polygon);for(var n=0,o=t.Childs(),a=o.length,l=o[n];n<a;n++,l=o[n])d.Clipper.AddPolyNodeToPaths(l,e,r)};d.Clipper.OpenPathsFromPolyTree=function(t){for(var e=new d.Paths,r=0,i=t.ChildCount();r<i;r++)t.Childs()[r].IsOpen&&e.push(t.Childs()[r].m_polygon);return e};d.Clipper.ClosedPathsFromPolyTree=function(t){var e=new d.Paths;return d.Clipper.AddPolyNodeToPaths(t,d.Clipper.NodeType.ntClosed,e),e};Lm(d.Clipper,d.ClipperBase);d.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};d.ClipperOffset=function(t,e){typeof t>"u"&&(t=2),typeof e>"u"&&(e=d.ClipperOffset.def_arc_tolerance),this.m_destPolys=new d.Paths,this.m_srcPoly=new d.Path,this.m_destPoly=new d.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new d.IntPoint,this.m_polyNodes=new d.PolyNode,this.MiterLimit=t,this.ArcTolerance=e,this.m_lowest.X=-1};d.ClipperOffset.two_pi=6.28318530717959;d.ClipperOffset.def_arc_tolerance=.25;d.ClipperOffset.prototype.Clear=function(){d.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};d.ClipperOffset.Round=d.Clipper.Round;d.ClipperOffset.prototype.AddPath=function(t,e,r){var i=t.length-1;if(!(i<0)){var n=new d.PolyNode;if(n.m_jointype=e,n.m_endtype=r,r==d.EndType.etClosedLine||r==d.EndType.etClosedPolygon)for(;i>0&&d.IntPoint.op_Equality(t[0],t[i]);)i--;n.m_polygon.push(t[0]);for(var o=0,a=0,l=1;l<=i;l++)d.IntPoint.op_Inequality(n.m_polygon[o],t[l])&&(o++,n.m_polygon.push(t[l]),(t[l].Y>n.m_polygon[a].Y||t[l].Y==n.m_polygon[a].Y&&t[l].X<n.m_polygon[a].X)&&(a=o));if(!(r==d.EndType.etClosedPolygon&&o<2||r!=d.EndType.etClosedPolygon&&o<0)&&(this.m_polyNodes.AddChild(n),r==d.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new d.IntPoint(0,a);else{var c=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(n.m_polygon[a].Y>c.Y||n.m_polygon[a].Y==c.Y&&n.m_polygon[a].X<c.X)&&(this.m_lowest=new d.IntPoint(this.m_polyNodes.ChildCount()-1,a))}}};d.ClipperOffset.prototype.AddPaths=function(t,e,r){for(var i=0,n=t.length;i<n;i++)this.AddPath(t[i],e,r)};d.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!d.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];(e.m_endtype==d.EndType.etClosedPolygon||e.m_endtype==d.EndType.etClosedLine&&d.Clipper.Orientation(e.m_polygon))&&e.m_polygon.reverse()}else for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];e.m_endtype==d.EndType.etClosedLine&&!d.Clipper.Orientation(e.m_polygon)&&e.m_polygon.reverse()}};d.ClipperOffset.GetUnitNormal=function(t,e){var r=e.X-t.X,i=e.Y-t.Y;if(r==0&&i==0)return new d.DoublePoint(0,0);var n=1/Math.sqrt(r*r+i*i);return r*=n,i*=n,new d.DoublePoint(i,-r)};d.ClipperOffset.prototype.DoOffset=function(t){if(this.m_destPolys=new Array,this.m_delta=t,d.ClipperBase.near_zero(t)){for(var e=0;e<this.m_polyNodes.ChildCount();e++){var r=this.m_polyNodes.Childs()[e];r.m_endtype==d.EndType.etClosedPolygon&&this.m_destPolys.push(r.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var i;this.ArcTolerance<=0?i=d.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(t)*d.ClipperOffset.def_arc_tolerance?i=Math.abs(t)*d.ClipperOffset.def_arc_tolerance:i=this.ArcTolerance;var n=3.14159265358979/Math.acos(1-i/Math.abs(t));this.m_sin=Math.sin(d.ClipperOffset.two_pi/n),this.m_cos=Math.cos(d.ClipperOffset.two_pi/n),this.m_StepsPerRad=n/d.ClipperOffset.two_pi,t<0&&(this.m_sin=-this.m_sin);for(var e=0;e<this.m_polyNodes.ChildCount();e++){var r=this.m_polyNodes.Childs()[e];this.m_srcPoly=r.m_polygon;var o=this.m_srcPoly.length;if(!(o==0||t<=0&&(o<3||r.m_endtype!=d.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,o==1){if(r.m_jointype==d.JoinType.jtRound)for(var a=1,l=0,c=1;c<=n;c++){this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X+a*t),d.ClipperOffset.Round(this.m_srcPoly[0].Y+l*t)));var u=a;a=a*this.m_cos-this.m_sin*l,l=u*this.m_sin+l*this.m_cos}else for(var a=-1,l=-1,c=0;c<4;++c)this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X+a*t),d.ClipperOffset.Round(this.m_srcPoly[0].Y+l*t))),a<0?a=1:l<0?l=1:a=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var c=0;c<o-1;c++)this.m_normals.push(d.ClipperOffset.GetUnitNormal(this.m_srcPoly[c],this.m_srcPoly[c+1]));if(r.m_endtype==d.EndType.etClosedLine||r.m_endtype==d.EndType.etClosedPolygon?this.m_normals.push(d.ClipperOffset.GetUnitNormal(this.m_srcPoly[o-1],this.m_srcPoly[0])):this.m_normals.push(new d.DoublePoint(this.m_normals[o-2])),r.m_endtype==d.EndType.etClosedPolygon){for(var p=o-1,c=0;c<o;c++)p=this.OffsetPoint(c,p,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==d.EndType.etClosedLine){for(var p=o-1,c=0;c<o;c++)p=this.OffsetPoint(c,p,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var f=this.m_normals[o-1],c=o-1;c>0;c--)this.m_normals[c]=new d.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new d.DoublePoint(-f.X,-f.Y),p=0;for(var c=o-1;c>=0;c--)p=this.OffsetPoint(c,p,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var p=0,c=1;c<o-1;++c)p=this.OffsetPoint(c,p,r.m_jointype);var h;if(r.m_endtype==d.EndType.etOpenButt){var c=o-1;h=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[c].X+this.m_normals[c].X*t),d.ClipperOffset.Round(this.m_srcPoly[c].Y+this.m_normals[c].Y*t)),this.m_destPoly.push(h),h=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[c].X-this.m_normals[c].X*t),d.ClipperOffset.Round(this.m_srcPoly[c].Y-this.m_normals[c].Y*t)),this.m_destPoly.push(h)}else{var c=o-1;p=o-2,this.m_sinA=0,this.m_normals[c]=new d.DoublePoint(-this.m_normals[c].X,-this.m_normals[c].Y),r.m_endtype==d.EndType.etOpenSquare?this.DoSquare(c,p):this.DoRound(c,p)}for(var c=o-1;c>0;c--)this.m_normals[c]=new d.DoublePoint(-this.m_normals[c-1].X,-this.m_normals[c-1].Y);this.m_normals[0]=new d.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),p=o-1;for(var c=p-1;c>0;--c)p=this.OffsetPoint(c,p,r.m_jointype);r.m_endtype==d.EndType.etOpenButt?(h=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*t),d.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*t)),this.m_destPoly.push(h),h=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*t),d.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*t)),this.m_destPoly.push(h)):(p=1,this.m_sinA=0,r.m_endtype==d.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};d.ClipperOffset.prototype.Execute=function(){var t=arguments,e=t[0]instanceof d.PolyTree;if(e){var r=t[0],i=t[1];r.Clear(),this.FixOrientations(),this.DoOffset(i);var n=new d.Clipper(0);if(n.AddPaths(this.m_destPolys,d.PolyType.ptSubject,!0),i>0)n.Execute(d.ClipType.ctUnion,r,d.PolyFillType.pftPositive,d.PolyFillType.pftPositive);else{var o=d.Clipper.GetBounds(this.m_destPolys),a=new d.Path;if(a.push(new d.IntPoint(o.left-10,o.bottom+10)),a.push(new d.IntPoint(o.right+10,o.bottom+10)),a.push(new d.IntPoint(o.right+10,o.top-10)),a.push(new d.IntPoint(o.left-10,o.top-10)),n.AddPath(a,d.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(d.ClipType.ctUnion,r,d.PolyFillType.pftNegative,d.PolyFillType.pftNegative),r.ChildCount()==1&&r.Childs()[0].ChildCount()>0){var l=r.Childs()[0];r.Childs()[0]=l.Childs()[0];for(var c=1;c<l.ChildCount();c++)r.AddChild(l.Childs()[c])}else r.Clear()}}else{var r=t[0],i=t[1];d.Clear(r),this.FixOrientations(),this.DoOffset(i);var n=new d.Clipper(0);if(n.AddPaths(this.m_destPolys,d.PolyType.ptSubject,!0),i>0)n.Execute(d.ClipType.ctUnion,r,d.PolyFillType.pftPositive,d.PolyFillType.pftPositive);else{var o=d.Clipper.GetBounds(this.m_destPolys),a=new d.Path;a.push(new d.IntPoint(o.left-10,o.bottom+10)),a.push(new d.IntPoint(o.right+10,o.bottom+10)),a.push(new d.IntPoint(o.right+10,o.top-10)),a.push(new d.IntPoint(o.left-10,o.top-10)),n.AddPath(a,d.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(d.ClipType.ctUnion,r,d.PolyFillType.pftNegative,d.PolyFillType.pftNegative),r.length>0&&r.splice(0,1)}}};d.ClipperOffset.prototype.OffsetPoint=function(t,e,r){if(this.m_sinA=this.m_normals[e].X*this.m_normals[t].Y-this.m_normals[t].X*this.m_normals[e].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return e;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_normals[e].X*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_normals[e].Y*this.m_delta))),this.m_destPoly.push(new d.IntPoint(this.m_srcPoly[t])),this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_normals[t].X*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_normals[t].Y*this.m_delta)));else switch(r){case d.JoinType.jtMiter:{var i=1+(this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y);i>=this.m_miterLim?this.DoMiter(t,e,i):this.DoSquare(t,e);break}case d.JoinType.jtSquare:this.DoSquare(t,e);break;case d.JoinType.jtRound:this.DoRound(t,e);break}return e=t,e};d.ClipperOffset.prototype.DoSquare=function(t,e){var r=Math.tan(Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y)/4);this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_delta*(this.m_normals[e].X-this.m_normals[e].Y*r)),d.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_delta*(this.m_normals[e].Y+this.m_normals[e].X*r)))),this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_delta*(this.m_normals[t].X+this.m_normals[t].Y*r)),d.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_delta*(this.m_normals[t].Y-this.m_normals[t].X*r))))};d.ClipperOffset.prototype.DoMiter=function(t,e,r){var i=this.m_delta/r;this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[t].X+(this.m_normals[e].X+this.m_normals[t].X)*i),d.ClipperOffset.Round(this.m_srcPoly[t].Y+(this.m_normals[e].Y+this.m_normals[t].Y)*i)))};d.ClipperOffset.prototype.DoRound=function(t,e){for(var r=Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y),i=d.Cast_Int32(d.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(r))),n=this.m_normals[e].X,o=this.m_normals[e].Y,a,l=0;l<i;++l)this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[t].X+n*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[t].Y+o*this.m_delta))),a=n,n=n*this.m_cos-this.m_sin*o,o=a*this.m_sin+o*this.m_cos;this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_normals[t].X*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_normals[t].Y*this.m_delta)))};d.Error=function(t){try{throw new Error(t)}catch(e){alert(e.message)}};d.JS={};d.JS.AreaOfPolygon=function(t,e){return e||(e=1),d.Clipper.Area(t)/(e*e)};d.JS.AreaOfPolygons=function(t,e){e||(e=1);for(var r=0,i=0;i<t.length;i++)r+=d.Clipper.Area(t[i]);return r/(e*e)};d.JS.BoundsOfPath=function(t,e){return d.JS.BoundsOfPaths([t],e)};d.JS.BoundsOfPaths=function(t,e){e||(e=1);var r=d.Clipper.GetBounds(t);return r.left/=e,r.bottom/=e,r.right/=e,r.top/=e,r};d.JS.Clean=function(i,e){if(!(i instanceof Array))return[];var r=i[0]instanceof Array,i=d.JS.Clone(i);if(typeof e!="number"||e===null)return d.Error("Delta is not a number in Clean()."),i;if(i.length===0||i.length==1&&i[0].length===0||e<0)return i;r||(i=[i]);for(var n=i.length,o,a,l,c,u,p,f,h=[],y=0;y<n;y++)if(a=i[y],o=a.length,o!==0){if(o<3){l=a,h.push(l);continue}for(l=a,c=e*e,u=a[0],p=1,f=1;f<o;f++)(a[f].X-u.X)*(a[f].X-u.X)+(a[f].Y-u.Y)*(a[f].Y-u.Y)<=c||(l[p]=a[f],u=a[f],p++);u=a[p-1],(a[0].X-u.X)*(a[0].X-u.X)+(a[0].Y-u.Y)*(a[0].Y-u.Y)<=c&&p--,p<o&&l.splice(p,o-p),l.length&&h.push(l)}return!r&&h.length?h=h[0]:!r&&h.length===0?h=[]:r&&h.length===0&&(h=[[]]),h};d.JS.Clone=function(t){if(!(t instanceof Array))return[];if(t.length===0)return[];if(t.length==1&&t[0].length===0)return[[]];var e=t[0]instanceof Array;e||(t=[t]);var r=t.length,i,n,o,a,l=new Array(r);for(n=0;n<r;n++){for(i=t[n].length,a=new Array(i),o=0;o<i;o++)a[o]={X:t[n][o].X,Y:t[n][o].Y};l[n]=a}return e||(l=l[0]),l};d.JS.Lighten=function(t,e){if(!(t instanceof Array))return[];if(typeof e!="number"||e===null)return d.Error("Tolerance is not a number in Lighten()."),d.JS.Clone(t);if(t.length===0||t.length==1&&t[0].length===0||e<0)return d.JS.Clone(t);t[0]instanceof Array||(t=[t]);var r,i,n,o,a,l,c,u,p,f,h,y,g,x,_,P,I,v=t.length,w=e*e,T=[];for(r=0;r<v;r++)if(n=t[r],l=n.length,l!=0){for(o=0;o<1e6;o++){for(a=[],l=n.length,n[l-1].X!=n[0].X||n[l-1].Y!=n[0].Y?(y=1,n.push({X:n[0].X,Y:n[0].Y}),l=n.length):y=0,h=[],i=0;i<l-2;i++)c=n[i],p=n[i+1],u=n[i+2],P=c.X,I=c.Y,g=u.X-P,x=u.Y-I,(g!==0||x!==0)&&(_=((p.X-P)*g+(p.Y-I)*x)/(g*g+x*x),_>1?(P=u.X,I=u.Y):_>0&&(P+=g*_,I+=x*_)),g=p.X-P,x=p.Y-I,f=g*g+x*x,f<=w&&(h[i+1]=1,i++);for(a.push({X:n[0].X,Y:n[0].Y}),i=1;i<l-1;i++)h[i]||a.push({X:n[i].X,Y:n[i].Y});if(a.push({X:n[l-1].X,Y:n[l-1].Y}),y&&n.pop(),h.length)n=a;else break}l=a.length,a[l-1].X==a[0].X&&a[l-1].Y==a[0].Y&&a.pop(),a.length>2&&T.push(a)}return!t[0]instanceof Array&&(T=T[0]),typeof T>"u"&&(T=[[]]),T};d.JS.PerimeterOfPath=function(t,e,r){if(typeof t>"u")return 0;var i=Math.sqrt,n=0,o,a,l=0,c=0,u=0,p=0,f=t.length;if(f<2)return 0;for(e&&(t[f]=t[0],f++);--f;)o=t[f],l=o.X,c=o.Y,a=t[f-1],u=a.X,p=a.Y,n+=i((l-u)*(l-u)+(c-p)*(c-p));return e&&t.pop(),n/r};d.JS.PerimeterOfPaths=function(t,e,r){r||(r=1);for(var i=0,n=0;n<t.length;n++)i+=d.JS.PerimeterOfPath(t[n],e,r);return i};d.JS.ScaleDownPath=function(t,e){var r,i;for(e||(e=1),r=t.length;r--;)i=t[r],i.X=i.X/e,i.Y=i.Y/e};d.JS.ScaleDownPaths=function(t,e){var r,i,n,o=Math.round;for(e||(e=1),r=t.length;r--;)for(i=t[r].length;i--;)n=t[r][i],n.X=n.X/e,n.Y=n.Y/e};d.JS.ScaleUpPath=function(t,e){var r,i,n=Math.round;for(e||(e=1),r=t.length;r--;)i=t[r],i.X=n(i.X*e),i.Y=n(i.Y*e)};d.JS.ScaleUpPaths=function(t,e){var r,i,n,o=Math.round;for(e||(e=1),r=t.length;r--;)for(i=t[r].length;i--;)n=t[r][i],n.X=o(n.X*e),n.Y=o(n.Y*e)};d.ExPolygons=function(){return[]};d.ExPolygon=function(){this.outer=null,this.holes=null};d.JS.AddOuterPolyNodeToExPolygons=function(t,e){var r=new d.ExPolygon;r.outer=t.Contour();var i=t.Childs(),n=i.length;r.holes=new Array(n);var o,a,l,c,u,p;for(l=0;l<n;l++)for(o=i[l],r.holes[l]=o.Contour(),c=0,u=o.Childs(),p=u.length;c<p;c++)a=u[c],d.JS.AddOuterPolyNodeToExPolygons(a,e);e.push(r)};d.JS.ExPolygonsToPaths=function(t){var e,r,i,n,o=new d.Paths;for(e=0,i=t.length;e<i;e++)for(o.push(t[e].outer),r=0,n=t[e].holes.length;r<n;r++)o.push(t[e].holes[r]);return o};d.JS.PolyTreeToExPolygons=function(t){var e=new d.ExPolygons,r,i,n,o;for(i=0,n=t.Childs(),o=n.length;i<o;i++)r=n[i],d.JS.AddOuterPolyNodeToExPolygons(r,e);return e};El.exports=d});m();var Xm=class Xm{constructor(){S(this,"_subscribers",{});S(this,"_destroyed",!1)}publish(e,r){!this._subscribers||!this._subscribers[e]||this._destroyed||this._subscribers[e].forEach(function(i){typeof i=="function"&&i(r)})}on(e,r){(!this._subscribers||this._destroyed)&&(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(r)}off(e,r){if(!this._subscribers||this._subscribers[e]==null||this._destroyed)return;let i=this._subscribers[e].indexOf(r);i!==-1&&this._subscribers[e].splice(i,1)}destroy(){this._destroyed=!0,this._subscribers={}}};s(Xm,"PubSub");var Vo=Xm;m();m();var Hm="[MappedinJS]";function VA(t="",{prefix:e=Hm}={}){let r="".concat(e).concat(t?"-".concat(t):""),i=s((n,o)=>{if(typeof window<"u"&&window.rnDebug){let a=o.map(l=>l instanceof Error&&l.stack?"".concat(l.message,"\n").concat(l.stack):l);window.rnDebug("".concat(t," ").concat(n,": ").concat(a.join(" ")))}},"rnDebug");return{logState:b.env.NODE_ENV==="test"?3:0,log(...n){this.logState<=0&&(console.log(r,...n),i("log",n))},warn(...n){this.logState<=1&&(console.warn(r,...n),i("warn",n))},error(...n){this.logState<=2&&(console.error(r,...n),i("error",n))},assert(...n){console.assert(...n)},time(n){console.time(n)},timeEnd(n){console.timeEnd(n)},setLevel(n){0<=n&&n<=3&&(this.logState=n)}}}s(VA,"createLogger");var jA=VA();var nt=jA;m();function GA(t,e){return"".concat(e," ").concat(t)}s(GA,"formatMessage");var qm=class qm extends Error{constructor(e,r=Hm){super(GA(e,r)),this.name="MappedinError"}};s(qm,"MappedinError");var Ul=qm;m();m();var Ym=class Ym extends Error{};s(Ym,"InvalidTokenError");var Wm=Ym;Wm.prototype.name="InvalidTokenError";m();var vi=63710088e-1;m();function ZA(t,e,r,i){return(t<e||t>r)&&nt.warn(i),Math.min(r,Math.max(e,t))}s(ZA,"clampWithWarning");m();function XA(t,e){if(t==null||e==null)return t===e;if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}s(XA,"arraysEqual");function Wj(t){return t*(Math.PI/180)}s(Wj,"toRadians");function Yj(t,e){let r=Math.pow(10,e);return Math.sign(t)*Math.round(Math.abs(t)*r)/r}s(Yj,"round");function E1(t,e){return(t%e+e)%e}s(E1,"euclideanModulo");function Jj(t,e){let r=E1(t,Math.PI*2),i=E1(e,Math.PI*2),n=i-r,o=i+(n>Math.PI?-Math.PI*2:n<-Math.PI?Math.PI*2:0);return{start:r,end:o}}s(Jj,"shortestTweenRotation");function HA(t){return t instanceof Fl?Number.isFinite(t.min.x)&&Number.isFinite(t.min.y)&&Number.isFinite(t.max.x)&&Number.isFinite(t.max.y):Number.isFinite(t.min.x)&&Number.isFinite(t.min.y)&&Number.isFinite(t.max.x)&&Number.isFinite(t.max.y)&&Number.isFinite(t.min.z)&&Number.isFinite(t.max.z)}s(HA,"isFiniteBox");m();function qA(t,e,r=!1){let i=null,n=0;return function(...o){n++,n===1&&r===!0&&t(...o);let a=s(()=>{(!r||n>1)&&t(...o),i=null,n=0},"later");clearTimeout(i),i=setTimeout(a,e)}}s(qA,"debounce");function n5(t,e,r){let i=null,n=null,o,a=null,l=0;r||(r={});let c=s(function(){l=r.leading===!1?0:Date.now(),a=null,n&&(o=t.apply(i,n)),a||(i=n=null)},"later");return function(...u){let p=Date.now();!l&&r.leading===!1&&(l=p);let f=e-(p-l);return f<=0||f>e?(a&&(clearTimeout(a),a=null),l=p,o=t.apply(this,u),a||(i=n=null)):!a&&r.trailing!==!1&&(i=this,n=u,a=setTimeout(c,f)),o}}s(n5,"throttle");m();var Nl=class Nl extends Error{constructor(r){super(r);S(this,"name","AssertionError");Error.captureStackTrace&&Error.captureStackTrace(this,Nl)}};s(Nl,"AssertionError");var Jm=Nl;function k1(t,e){if(t==null){let r;if(e!=null&&e.customMessage)r=e.customMessage;else{let o=e!=null&&e.valueName?"'".concat(e.valueName,"'"):"value";r="Expected ".concat(o," to be defined, but received ").concat(t)}let i=(e==null?void 0:e.errorClass)||Jm,n=new i(r);throw(e==null?void 0:e.captureStackTrace)!==!1&&Error.captureStackTrace&&Error.captureStackTrace(n,k1),n}}s(k1,"assertExists");function s5(t,e,r){if(k1(t),(t==null?void 0:t.type)!==e){let i="Expected type ".concat(e," but got ").concat(t==null?void 0:t.type);throw new Error(r!=null?r:i)}}s(s5,"assertType");m();var Km=[0,4,6,8,10],Dr=s(()=>{let t=new Array(16).fill(0),e=Math.random()*4294967296;for(let i=0;i<t.length;i++)i>0&&(i&3)===0&&(e=Math.random()*4294967296),t[i]=e>>>((i&3)<<3)&255;let r=t.map(i=>i.toString(16).padStart(2,"0"));return r[6]="4"+r[6][1],r[8]=["8","9","a","b"].includes(r[7][0])?r[7]:"a"+r[7][1],Km.map((i,n)=>r.slice(i,n===Km.length-1?void 0:Km[n+1]).join("")).join("-")},"randomId");m();m();var WA=new Set(Object.keys(Yt.NAMES));var YA=s(t=>WA.has(t.toLowerCase()),"isX11Color"),JA=s(t=>{if(!t.startsWith("#"))return!1;let e=t.slice(1);if(e.length!==3&&e.length!==6)return!1;for(let r=0;r<e.length;r++)if(!(e[r]>="0"&&e[r]<="9"||e[r]>="A"&&e[r]<="F"||e[r]>="a"&&e[r]<="f"))return!1;return!0},"isHexColor"),KA=s(t=>{if(!t.startsWith("rgb(")&&!t.startsWith("rgba("))return!1;let e=t.indexOf("("),r=t.lastIndexOf(")");if(e===-1||r===-1||r<=e||r!==t.length-1)return!1;let i=t.slice(e+1,r).split(",");if(i.length!==3&&i.length!==4)return!1;for(let n=0;n<i.length;n++){let o=i[n].trim();if(n<3)if(o.endsWith("%")){let a=parseFloat(o.slice(0,-1));if(isNaN(a)||a<0||a>100)return!1}else{let a=parseInt(o,10);if(isNaN(a)||a<0||a>255)return!1}else{let a=parseFloat(o);if(isNaN(a)||a<0||a>1)return!1}}return!0},"isRgbColor"),QA=s(t=>{if(!t.startsWith("hsl(")&&!t.startsWith("hsla("))return!1;let e=t.indexOf("("),r=t.lastIndexOf(")");if(e===-1||r===-1||r<=e||r!==t.length-1)return!1;let i=t.slice(e+1,r).split(",");if(i.length!==3&&i.length!==4)return!1;for(let n=0;n<i.length;n++){let o=i[n].trim();if(n===0){let a=parseFloat(o);if(isNaN(a))return!1}else if(n<3){if(!o.endsWith("%"))return!1;let a=parseFloat(o.slice(0,-1));if(isNaN(a)||a<0||a>100)return!1}else{let a=parseFloat(o);if(isNaN(a)||a<0||a>1)return!1}}return!0},"isHslColor"),$l=s(t=>t==null||typeof t!="string"?!1:!!(JA(t)||KA(t)||QA(t)||YA(t)),"isColor");m();var L1=["ease-in","ease-out","ease-in-out","linear"];var D1=s(t=>t,"linearEase"),eE=s(t=>t*t,"quadEaseIn"),tE=s(t=>1-Math.cos(t*Math.PI/2),"easeIn"),rE=s(t=>1-(1-t)*(1-t),"quadEaseOut"),z1={linear:D1,"ease-in":eE,"ease-out":rE,"ease-in-out":tE};function w5(t,e,r,i,n,o=D1){if(e===r)return n;t=Math.max(e,Math.min(t,r));let a=(t-Math.min(e,r))/Math.abs(r-e),l=typeof o=="function"?o(a):z1[o](a);return i+l*(n-i)}s(w5,"interpolate");function nE(t,e){let r=0;if(e.length<2)return r;let n=e[0]<e[1]?(o,a)=>o>a:(o,a)=>o<a;for(;r<e.length-1&&n(t,e[r+1]);)r++;return r>e.length-2?Math.max(0,e.length-2):r}s(nE,"getInterpolationBreakpoint");function S5(t,e,r,i="ease-in"){if(e.length!==r.length)throw new Ul("Input and output ranges must have the same number of values.");t=Math.max(e[0],Math.min(t,e[e.length-1]));let n=nE(t,e),o=(t-e[n])/(e[n+1]-e[n]),a=typeof i=="function"?i(o):z1[i](o);return r[n]+a*(r[n+1]-r[n])}s(S5,"interpolateMulti");m();function Vl(t){return(t%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}s(Vl,"normalizeAngle");m();m();var jl={name:"@packages/internal",private:!0,version:"6.0.1-beta.51",dependencies:{"@turf/boolean-point-in-polygon":"catalog:","@turf/destination":"catalog:","@turf/distance":"catalog:"},files:["./common/","./outdoor-context-4/","./geojson-navigator/","./quad-tree/","./shave-text","./clipper-lib"]};m();m();var L2=J(te(),1),iP=J(B1(),1);m();m();var Qm;function Gl(){return Qm==null&&(Qm=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Qm}s(Gl,"offscreenCanvasSupported");var Zl;function ef(){if(Zl==null&&(Zl=!1,Gl())){let r=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(r){for(let n=0;n<5*5;n++){let o=n*4;r.fillStyle="rgb(".concat(o,",").concat(o+1,",").concat(o+2,")"),r.fillRect(n%5,Math.floor(n/5),1,1)}let i=r.getImageData(0,0,5,5).data;for(let n=0;n<5*5*4;n++)if(n%4!==3&&i[n]!==n){Zl=!0;break}}}return Zl||!1}s(ef,"isOffscreenCanvasDistorted");m();m();var Ae=1e-6,jt=typeof Float32Array<"u"?Float32Array:Array,U1=Math.random;var aG=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Xl={};kr(Xl,{add:()=>VE,adjoint:()=>mE,clone:()=>aE,copy:()=>sE,create:()=>oE,determinant:()=>fE,equals:()=>XE,exactEquals:()=>ZE,frob:()=>$E,fromQuat:()=>kE,fromQuat2:()=>IE,fromRotation:()=>PE,fromRotationTranslation:()=>j1,fromRotationTranslationScale:()=>AE,fromRotationTranslationScaleOrigin:()=>EE,fromScaling:()=>vE,fromTranslation:()=>_E,fromValues:()=>lE,fromXRotation:()=>wE,fromYRotation:()=>SE,fromZRotation:()=>TE,frustum:()=>LE,getRotation:()=>ME,getScaling:()=>G1,getTranslation:()=>CE,identity:()=>$1,invert:()=>pE,lookAt:()=>BE,mul:()=>HE,multiply:()=>V1,multiplyScalar:()=>jE,multiplyScalarAndAdd:()=>GE,ortho:()=>RE,orthoNO:()=>X1,orthoZO:()=>FE,perspective:()=>DE,perspectiveFromFieldOfView:()=>OE,perspectiveNO:()=>Z1,perspectiveZO:()=>zE,rotate:()=>yE,rotateX:()=>gE,rotateY:()=>bE,rotateZ:()=>xE,scale:()=>dE,set:()=>uE,str:()=>NE,sub:()=>qE,subtract:()=>H1,targetTo:()=>UE,translate:()=>hE,transpose:()=>cE});m();function oE(){var t=new jt(16);return jt!=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}s(oE,"create");function aE(t){var e=new jt(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}s(aE,"clone");function sE(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}s(sE,"copy");function lE(t,e,r,i,n,o,a,l,c,u,p,f,h,y,g,x){var _=new jt(16);return _[0]=t,_[1]=e,_[2]=r,_[3]=i,_[4]=n,_[5]=o,_[6]=a,_[7]=l,_[8]=c,_[9]=u,_[10]=p,_[11]=f,_[12]=h,_[13]=y,_[14]=g,_[15]=x,_}s(lE,"fromValues");function uE(t,e,r,i,n,o,a,l,c,u,p,f,h,y,g,x,_){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=o,t[5]=a,t[6]=l,t[7]=c,t[8]=u,t[9]=p,t[10]=f,t[11]=h,t[12]=y,t[13]=g,t[14]=x,t[15]=_,t}s(uE,"set");function $1(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}s($1,"identity");function cE(t,e){if(t===e){var r=e[1],i=e[2],n=e[3],o=e[6],a=e[7],l=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[11]=e[14],t[12]=n,t[13]=a,t[14]=l}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}s(cE,"transpose");function pE(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],p=e[8],f=e[9],h=e[10],y=e[11],g=e[12],x=e[13],_=e[14],P=e[15],I=r*l-i*a,v=r*c-n*a,w=r*u-o*a,T=i*c-n*l,A=i*u-o*l,k=n*u-o*c,L=p*x-f*g,R=p*_-h*g,Z=p*P-y*g,q=f*_-h*x,X=f*P-y*x,G=h*P-y*_,F=I*G-v*X+w*q+T*Z-A*R+k*L;return F?(F=1/F,t[0]=(l*G-c*X+u*q)*F,t[1]=(n*X-i*G-o*q)*F,t[2]=(x*k-_*A+P*T)*F,t[3]=(h*A-f*k-y*T)*F,t[4]=(c*Z-a*G-u*R)*F,t[5]=(r*G-n*Z+o*R)*F,t[6]=(_*w-g*k-P*v)*F,t[7]=(p*k-h*w+y*v)*F,t[8]=(a*X-l*Z+u*L)*F,t[9]=(i*Z-r*X-o*L)*F,t[10]=(g*A-x*w+P*I)*F,t[11]=(f*w-p*A-y*I)*F,t[12]=(l*R-a*q-c*L)*F,t[13]=(r*q-i*R+n*L)*F,t[14]=(x*v-g*T-_*I)*F,t[15]=(p*T-f*v+h*I)*F,t):null}s(pE,"invert");function mE(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],l=e[5],c=e[6],u=e[7],p=e[8],f=e[9],h=e[10],y=e[11],g=e[12],x=e[13],_=e[14],P=e[15];return t[0]=l*(h*P-y*_)-f*(c*P-u*_)+x*(c*y-u*h),t[1]=-(i*(h*P-y*_)-f*(n*P-o*_)+x*(n*y-o*h)),t[2]=i*(c*P-u*_)-l*(n*P-o*_)+x*(n*u-o*c),t[3]=-(i*(c*y-u*h)-l*(n*y-o*h)+f*(n*u-o*c)),t[4]=-(a*(h*P-y*_)-p*(c*P-u*_)+g*(c*y-u*h)),t[5]=r*(h*P-y*_)-p*(n*P-o*_)+g*(n*y-o*h),t[6]=-(r*(c*P-u*_)-a*(n*P-o*_)+g*(n*u-o*c)),t[7]=r*(c*y-u*h)-a*(n*y-o*h)+p*(n*u-o*c),t[8]=a*(f*P-y*x)-p*(l*P-u*x)+g*(l*y-u*f),t[9]=-(r*(f*P-y*x)-p*(i*P-o*x)+g*(i*y-o*f)),t[10]=r*(l*P-u*x)-a*(i*P-o*x)+g*(i*u-o*l),t[11]=-(r*(l*y-u*f)-a*(i*y-o*f)+p*(i*u-o*l)),t[12]=-(a*(f*_-h*x)-p*(l*_-c*x)+g*(l*h-c*f)),t[13]=r*(f*_-h*x)-p*(i*_-n*x)+g*(i*h-n*f),t[14]=-(r*(l*_-c*x)-a*(i*_-n*x)+g*(i*c-n*l)),t[15]=r*(l*h-c*f)-a*(i*h-n*f)+p*(i*c-n*l),t}s(mE,"adjoint");function fE(t){var e=t[0],r=t[1],i=t[2],n=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],p=t[9],f=t[10],h=t[11],y=t[12],g=t[13],x=t[14],_=t[15],P=e*a-r*o,I=e*l-i*o,v=e*c-n*o,w=r*l-i*a,T=r*c-n*a,A=i*c-n*l,k=u*g-p*y,L=u*x-f*y,R=u*_-h*y,Z=p*x-f*g,q=p*_-h*g,X=f*_-h*x;return P*X-I*q+v*Z+w*R-T*L+A*k}s(fE,"determinant");function V1(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],l=e[4],c=e[5],u=e[6],p=e[7],f=e[8],h=e[9],y=e[10],g=e[11],x=e[12],_=e[13],P=e[14],I=e[15],v=r[0],w=r[1],T=r[2],A=r[3];return t[0]=v*i+w*l+T*f+A*x,t[1]=v*n+w*c+T*h+A*_,t[2]=v*o+w*u+T*y+A*P,t[3]=v*a+w*p+T*g+A*I,v=r[4],w=r[5],T=r[6],A=r[7],t[4]=v*i+w*l+T*f+A*x,t[5]=v*n+w*c+T*h+A*_,t[6]=v*o+w*u+T*y+A*P,t[7]=v*a+w*p+T*g+A*I,v=r[8],w=r[9],T=r[10],A=r[11],t[8]=v*i+w*l+T*f+A*x,t[9]=v*n+w*c+T*h+A*_,t[10]=v*o+w*u+T*y+A*P,t[11]=v*a+w*p+T*g+A*I,v=r[12],w=r[13],T=r[14],A=r[15],t[12]=v*i+w*l+T*f+A*x,t[13]=v*n+w*c+T*h+A*_,t[14]=v*o+w*u+T*y+A*P,t[15]=v*a+w*p+T*g+A*I,t}s(V1,"multiply");function hE(t,e,r){var i=r[0],n=r[1],o=r[2],a,l,c,u,p,f,h,y,g,x,_,P;return e===t?(t[12]=e[0]*i+e[4]*n+e[8]*o+e[12],t[13]=e[1]*i+e[5]*n+e[9]*o+e[13],t[14]=e[2]*i+e[6]*n+e[10]*o+e[14],t[15]=e[3]*i+e[7]*n+e[11]*o+e[15]):(a=e[0],l=e[1],c=e[2],u=e[3],p=e[4],f=e[5],h=e[6],y=e[7],g=e[8],x=e[9],_=e[10],P=e[11],t[0]=a,t[1]=l,t[2]=c,t[3]=u,t[4]=p,t[5]=f,t[6]=h,t[7]=y,t[8]=g,t[9]=x,t[10]=_,t[11]=P,t[12]=a*i+p*n+g*o+e[12],t[13]=l*i+f*n+x*o+e[13],t[14]=c*i+h*n+_*o+e[14],t[15]=u*i+y*n+P*o+e[15]),t}s(hE,"translate");function dE(t,e,r){var i=r[0],n=r[1],o=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}s(dE,"scale");function yE(t,e,r,i){var n=i[0],o=i[1],a=i[2],l=Math.hypot(n,o,a),c,u,p,f,h,y,g,x,_,P,I,v,w,T,A,k,L,R,Z,q,X,G,F,K;return l<Ae?null:(l=1/l,n*=l,o*=l,a*=l,c=Math.sin(r),u=Math.cos(r),p=1-u,f=e[0],h=e[1],y=e[2],g=e[3],x=e[4],_=e[5],P=e[6],I=e[7],v=e[8],w=e[9],T=e[10],A=e[11],k=n*n*p+u,L=o*n*p+a*c,R=a*n*p-o*c,Z=n*o*p-a*c,q=o*o*p+u,X=a*o*p+n*c,G=n*a*p+o*c,F=o*a*p-n*c,K=a*a*p+u,t[0]=f*k+x*L+v*R,t[1]=h*k+_*L+w*R,t[2]=y*k+P*L+T*R,t[3]=g*k+I*L+A*R,t[4]=f*Z+x*q+v*X,t[5]=h*Z+_*q+w*X,t[6]=y*Z+P*q+T*X,t[7]=g*Z+I*q+A*X,t[8]=f*G+x*F+v*K,t[9]=h*G+_*F+w*K,t[10]=y*G+P*F+T*K,t[11]=g*G+I*F+A*K,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}s(yE,"rotate");function gE(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],p=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*n+u*i,t[5]=a*n+p*i,t[6]=l*n+f*i,t[7]=c*n+h*i,t[8]=u*n-o*i,t[9]=p*n-a*i,t[10]=f*n-l*i,t[11]=h*n-c*i,t}s(gE,"rotateX");function bE(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[0],a=e[1],l=e[2],c=e[3],u=e[8],p=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*n-u*i,t[1]=a*n-p*i,t[2]=l*n-f*i,t[3]=c*n-h*i,t[8]=o*i+u*n,t[9]=a*i+p*n,t[10]=l*i+f*n,t[11]=c*i+h*n,t}s(bE,"rotateY");function xE(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[0],a=e[1],l=e[2],c=e[3],u=e[4],p=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*n+u*i,t[1]=a*n+p*i,t[2]=l*n+f*i,t[3]=c*n+h*i,t[4]=u*n-o*i,t[5]=p*n-a*i,t[6]=f*n-l*i,t[7]=h*n-c*i,t}s(xE,"rotateZ");function _E(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}s(_E,"fromTranslation");function vE(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}s(vE,"fromScaling");function PE(t,e,r){var i=r[0],n=r[1],o=r[2],a=Math.hypot(i,n,o),l,c,u;return a<Ae?null:(a=1/a,i*=a,n*=a,o*=a,l=Math.sin(e),c=Math.cos(e),u=1-c,t[0]=i*i*u+c,t[1]=n*i*u+o*l,t[2]=o*i*u-n*l,t[3]=0,t[4]=i*n*u-o*l,t[5]=n*n*u+c,t[6]=o*n*u+i*l,t[7]=0,t[8]=i*o*u+n*l,t[9]=n*o*u-i*l,t[10]=o*o*u+c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}s(PE,"fromRotation");function wE(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}s(wE,"fromXRotation");function SE(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}s(SE,"fromYRotation");function TE(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=i,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}s(TE,"fromZRotation");function j1(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],l=i+i,c=n+n,u=o+o,p=i*l,f=i*c,h=i*u,y=n*c,g=n*u,x=o*u,_=a*l,P=a*c,I=a*u;return t[0]=1-(y+x),t[1]=f+I,t[2]=h-P,t[3]=0,t[4]=f-I,t[5]=1-(p+x),t[6]=g+_,t[7]=0,t[8]=h+P,t[9]=g-_,t[10]=1-(p+y),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}s(j1,"fromRotationTranslation");function IE(t,e){var r=new jt(3),i=-e[0],n=-e[1],o=-e[2],a=e[3],l=e[4],c=e[5],u=e[6],p=e[7],f=i*i+n*n+o*o+a*a;return f>0?(r[0]=(l*a+p*i+c*o-u*n)*2/f,r[1]=(c*a+p*n+u*i-l*o)*2/f,r[2]=(u*a+p*o+l*n-c*i)*2/f):(r[0]=(l*a+p*i+c*o-u*n)*2,r[1]=(c*a+p*n+u*i-l*o)*2,r[2]=(u*a+p*o+l*n-c*i)*2),j1(t,e,r),t}s(IE,"fromQuat2");function CE(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}s(CE,"getTranslation");function G1(t,e){var r=e[0],i=e[1],n=e[2],o=e[4],a=e[5],l=e[6],c=e[8],u=e[9],p=e[10];return t[0]=Math.hypot(r,i,n),t[1]=Math.hypot(o,a,l),t[2]=Math.hypot(c,u,p),t}s(G1,"getScaling");function ME(t,e){var r=new jt(3);G1(r,e);var i=1/r[0],n=1/r[1],o=1/r[2],a=e[0]*i,l=e[1]*n,c=e[2]*o,u=e[4]*i,p=e[5]*n,f=e[6]*o,h=e[8]*i,y=e[9]*n,g=e[10]*o,x=a+p+g,_=0;return x>0?(_=Math.sqrt(x+1)*2,t[3]=.25*_,t[0]=(f-y)/_,t[1]=(h-c)/_,t[2]=(l-u)/_):a>p&&a>g?(_=Math.sqrt(1+a-p-g)*2,t[3]=(f-y)/_,t[0]=.25*_,t[1]=(l+u)/_,t[2]=(h+c)/_):p>g?(_=Math.sqrt(1+p-a-g)*2,t[3]=(h-c)/_,t[0]=(l+u)/_,t[1]=.25*_,t[2]=(f+y)/_):(_=Math.sqrt(1+g-a-p)*2,t[3]=(l-u)/_,t[0]=(h+c)/_,t[1]=(f+y)/_,t[2]=.25*_),t}s(ME,"getRotation");function AE(t,e,r,i){var n=e[0],o=e[1],a=e[2],l=e[3],c=n+n,u=o+o,p=a+a,f=n*c,h=n*u,y=n*p,g=o*u,x=o*p,_=a*p,P=l*c,I=l*u,v=l*p,w=i[0],T=i[1],A=i[2];return t[0]=(1-(g+_))*w,t[1]=(h+v)*w,t[2]=(y-I)*w,t[3]=0,t[4]=(h-v)*T,t[5]=(1-(f+_))*T,t[6]=(x+P)*T,t[7]=0,t[8]=(y+I)*A,t[9]=(x-P)*A,t[10]=(1-(f+g))*A,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}s(AE,"fromRotationTranslationScale");function EE(t,e,r,i,n){var o=e[0],a=e[1],l=e[2],c=e[3],u=o+o,p=a+a,f=l+l,h=o*u,y=o*p,g=o*f,x=a*p,_=a*f,P=l*f,I=c*u,v=c*p,w=c*f,T=i[0],A=i[1],k=i[2],L=n[0],R=n[1],Z=n[2],q=(1-(x+P))*T,X=(y+w)*T,G=(g-v)*T,F=(y-w)*A,K=(1-(h+P))*A,fe=(_+I)*A,ve=(g+v)*k,Te=(_-I)*k,Ct=(1-(h+x))*k;return t[0]=q,t[1]=X,t[2]=G,t[3]=0,t[4]=F,t[5]=K,t[6]=fe,t[7]=0,t[8]=ve,t[9]=Te,t[10]=Ct,t[11]=0,t[12]=r[0]+L-(q*L+F*R+ve*Z),t[13]=r[1]+R-(X*L+K*R+Te*Z),t[14]=r[2]+Z-(G*L+fe*R+Ct*Z),t[15]=1,t}s(EE,"fromRotationTranslationScaleOrigin");function kE(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],a=r+r,l=i+i,c=n+n,u=r*a,p=i*a,f=i*l,h=n*a,y=n*l,g=n*c,x=o*a,_=o*l,P=o*c;return t[0]=1-f-g,t[1]=p+P,t[2]=h-_,t[3]=0,t[4]=p-P,t[5]=1-u-g,t[6]=y+x,t[7]=0,t[8]=h+_,t[9]=y-x,t[10]=1-u-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}s(kE,"fromQuat");function LE(t,e,r,i,n,o,a){var l=1/(r-e),c=1/(n-i),u=1/(o-a);return t[0]=o*2*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*c,t[6]=0,t[7]=0,t[8]=(r+e)*l,t[9]=(n+i)*c,t[10]=(a+o)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*u,t[15]=0,t}s(LE,"frustum");function Z1(t,e,r,i,n){var o=1/Math.tan(e/2),a;return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,n!=null&&n!==1/0?(a=1/(i-n),t[10]=(n+i)*a,t[14]=2*n*i*a):(t[10]=-1,t[14]=-2*i),t}s(Z1,"perspectiveNO");var DE=Z1;function zE(t,e,r,i,n){var o=1/Math.tan(e/2),a;return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,n!=null&&n!==1/0?(a=1/(i-n),t[10]=n*a,t[14]=n*i*a):(t[10]=-1,t[14]=-i),t}s(zE,"perspectiveZO");function OE(t,e,r,i){var n=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),l=Math.tan(e.rightDegrees*Math.PI/180),c=2/(a+l),u=2/(n+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-((a-l)*c*.5),t[9]=(n-o)*u*.5,t[10]=i/(r-i),t[11]=-1,t[12]=0,t[13]=0,t[14]=i*r/(r-i),t[15]=0,t}s(OE,"perspectiveFromFieldOfView");function X1(t,e,r,i,n,o,a){var l=1/(e-r),c=1/(i-n),u=1/(o-a);return t[0]=-2*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*l,t[13]=(n+i)*c,t[14]=(a+o)*u,t[15]=1,t}s(X1,"orthoNO");var RE=X1;function FE(t,e,r,i,n,o,a){var l=1/(e-r),c=1/(i-n),u=1/(o-a);return t[0]=-2*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=u,t[11]=0,t[12]=(e+r)*l,t[13]=(n+i)*c,t[14]=o*u,t[15]=1,t}s(FE,"orthoZO");function BE(t,e,r,i){var n,o,a,l,c,u,p,f,h,y,g=e[0],x=e[1],_=e[2],P=i[0],I=i[1],v=i[2],w=r[0],T=r[1],A=r[2];return Math.abs(g-w)<Ae&&Math.abs(x-T)<Ae&&Math.abs(_-A)<Ae?$1(t):(p=g-w,f=x-T,h=_-A,y=1/Math.hypot(p,f,h),p*=y,f*=y,h*=y,n=I*h-v*f,o=v*p-P*h,a=P*f-I*p,y=Math.hypot(n,o,a),y?(y=1/y,n*=y,o*=y,a*=y):(n=0,o=0,a=0),l=f*a-h*o,c=h*n-p*a,u=p*o-f*n,y=Math.hypot(l,c,u),y?(y=1/y,l*=y,c*=y,u*=y):(l=0,c=0,u=0),t[0]=n,t[1]=l,t[2]=p,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=u,t[10]=h,t[11]=0,t[12]=-(n*g+o*x+a*_),t[13]=-(l*g+c*x+u*_),t[14]=-(p*g+f*x+h*_),t[15]=1,t)}s(BE,"lookAt");function UE(t,e,r,i){var n=e[0],o=e[1],a=e[2],l=i[0],c=i[1],u=i[2],p=n-r[0],f=o-r[1],h=a-r[2],y=p*p+f*f+h*h;y>0&&(y=1/Math.sqrt(y),p*=y,f*=y,h*=y);var g=c*h-u*f,x=u*p-l*h,_=l*f-c*p;return y=g*g+x*x+_*_,y>0&&(y=1/Math.sqrt(y),g*=y,x*=y,_*=y),t[0]=g,t[1]=x,t[2]=_,t[3]=0,t[4]=f*_-h*x,t[5]=h*g-p*_,t[6]=p*x-f*g,t[7]=0,t[8]=p,t[9]=f,t[10]=h,t[11]=0,t[12]=n,t[13]=o,t[14]=a,t[15]=1,t}s(UE,"targetTo");function NE(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}s(NE,"str");function $E(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}s($E,"frob");function VE(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}s(VE,"add");function H1(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}s(H1,"subtract");function jE(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}s(jE,"multiplyScalar");function GE(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t[3]=e[3]+r[3]*i,t[4]=e[4]+r[4]*i,t[5]=e[5]+r[5]*i,t[6]=e[6]+r[6]*i,t[7]=e[7]+r[7]*i,t[8]=e[8]+r[8]*i,t[9]=e[9]+r[9]*i,t[10]=e[10]+r[10]*i,t[11]=e[11]+r[11]*i,t[12]=e[12]+r[12]*i,t[13]=e[13]+r[13]*i,t[14]=e[14]+r[14]*i,t[15]=e[15]+r[15]*i,t}s(GE,"multiplyScalarAndAdd");function ZE(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}s(ZE,"exactEquals");function XE(t,e){var r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],l=t[5],c=t[6],u=t[7],p=t[8],f=t[9],h=t[10],y=t[11],g=t[12],x=t[13],_=t[14],P=t[15],I=e[0],v=e[1],w=e[2],T=e[3],A=e[4],k=e[5],L=e[6],R=e[7],Z=e[8],q=e[9],X=e[10],G=e[11],F=e[12],K=e[13],fe=e[14],ve=e[15];return Math.abs(r-I)<=Ae*Math.max(1,Math.abs(r),Math.abs(I))&&Math.abs(i-v)<=Ae*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(n-w)<=Ae*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(o-T)<=Ae*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(a-A)<=Ae*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(l-k)<=Ae*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(c-L)<=Ae*Math.max(1,Math.abs(c),Math.abs(L))&&Math.abs(u-R)<=Ae*Math.max(1,Math.abs(u),Math.abs(R))&&Math.abs(p-Z)<=Ae*Math.max(1,Math.abs(p),Math.abs(Z))&&Math.abs(f-q)<=Ae*Math.max(1,Math.abs(f),Math.abs(q))&&Math.abs(h-X)<=Ae*Math.max(1,Math.abs(h),Math.abs(X))&&Math.abs(y-G)<=Ae*Math.max(1,Math.abs(y),Math.abs(G))&&Math.abs(g-F)<=Ae*Math.max(1,Math.abs(g),Math.abs(F))&&Math.abs(x-K)<=Ae*Math.max(1,Math.abs(x),Math.abs(K))&&Math.abs(_-fe)<=Ae*Math.max(1,Math.abs(_),Math.abs(fe))&&Math.abs(P-ve)<=Ae*Math.max(1,Math.abs(P),Math.abs(ve))}s(XE,"equals");var HE=V1,qE=H1;var Hl={};kr(Hl,{add:()=>QE,angle:()=>x2,ceil:()=>e2,clone:()=>WE,copy:()=>JE,create:()=>q1,cross:()=>p2,dist:()=>M2,distance:()=>K1,div:()=>C2,divide:()=>J1,dot:()=>c2,equals:()=>w2,exactEquals:()=>P2,floor:()=>t2,forEach:()=>k2,fromValues:()=>YE,inverse:()=>l2,len:()=>S2,length:()=>eP,lerp:()=>m2,max:()=>n2,min:()=>r2,mul:()=>I2,multiply:()=>Y1,negate:()=>s2,normalize:()=>u2,random:()=>f2,rotate:()=>b2,round:()=>i2,scale:()=>o2,scaleAndAdd:()=>a2,set:()=>KE,sqrDist:()=>A2,sqrLen:()=>E2,squaredDistance:()=>Q1,squaredLength:()=>tP,str:()=>v2,sub:()=>T2,subtract:()=>W1,transformMat2:()=>h2,transformMat2d:()=>d2,transformMat3:()=>y2,transformMat4:()=>g2,zero:()=>_2});m();function q1(){var t=new jt(2);return jt!=Float32Array&&(t[0]=0,t[1]=0),t}s(q1,"create");function WE(t){var e=new jt(2);return e[0]=t[0],e[1]=t[1],e}s(WE,"clone");function YE(t,e){var r=new jt(2);return r[0]=t,r[1]=e,r}s(YE,"fromValues");function JE(t,e){return t[0]=e[0],t[1]=e[1],t}s(JE,"copy");function KE(t,e,r){return t[0]=e,t[1]=r,t}s(KE,"set");function QE(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}s(QE,"add");function W1(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}s(W1,"subtract");function Y1(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}s(Y1,"multiply");function J1(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}s(J1,"divide");function e2(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}s(e2,"ceil");function t2(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}s(t2,"floor");function r2(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}s(r2,"min");function n2(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}s(n2,"max");function i2(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}s(i2,"round");function o2(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}s(o2,"scale");function a2(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t}s(a2,"scaleAndAdd");function K1(t,e){var r=e[0]-t[0],i=e[1]-t[1];return Math.hypot(r,i)}s(K1,"distance");function Q1(t,e){var r=e[0]-t[0],i=e[1]-t[1];return r*r+i*i}s(Q1,"squaredDistance");function eP(t){var e=t[0],r=t[1];return Math.hypot(e,r)}s(eP,"length");function tP(t){var e=t[0],r=t[1];return e*e+r*r}s(tP,"squaredLength");function s2(t,e){return t[0]=-e[0],t[1]=-e[1],t}s(s2,"negate");function l2(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}s(l2,"inverse");function u2(t,e){var r=e[0],i=e[1],n=r*r+i*i;return n>0&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t}s(u2,"normalize");function c2(t,e){return t[0]*e[0]+t[1]*e[1]}s(c2,"dot");function p2(t,e,r){var i=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=i,t}s(p2,"cross");function m2(t,e,r,i){var n=e[0],o=e[1];return t[0]=n+i*(r[0]-n),t[1]=o+i*(r[1]-o),t}s(m2,"lerp");function f2(t,e){e=e||1;var r=U1()*2*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}s(f2,"random");function h2(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n,t[1]=r[1]*i+r[3]*n,t}s(h2,"transformMat2");function d2(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n+r[4],t[1]=r[1]*i+r[3]*n+r[5],t}s(d2,"transformMat2d");function y2(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[3]*n+r[6],t[1]=r[1]*i+r[4]*n+r[7],t}s(y2,"transformMat3");function g2(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13],t}s(g2,"transformMat4");function b2(t,e,r,i){var n=e[0]-r[0],o=e[1]-r[1],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l-o*a+r[0],t[1]=n*a+o*l+r[1],t}s(b2,"rotate");function x2(t,e){var r=t[0],i=t[1],n=e[0],o=e[1],a=Math.sqrt(r*r+i*i)*Math.sqrt(n*n+o*o),l=a&&(r*n+i*o)/a;return Math.acos(Math.min(Math.max(l,-1),1))}s(x2,"angle");function _2(t){return t[0]=0,t[1]=0,t}s(_2,"zero");function v2(t){return"vec2("+t[0]+", "+t[1]+")"}s(v2,"str");function P2(t,e){return t[0]===e[0]&&t[1]===e[1]}s(P2,"exactEquals");function w2(t,e){var r=t[0],i=t[1],n=e[0],o=e[1];return Math.abs(r-n)<=Ae*Math.max(1,Math.abs(r),Math.abs(n))&&Math.abs(i-o)<=Ae*Math.max(1,Math.abs(i),Math.abs(o))}s(w2,"equals");var S2=eP,T2=W1,I2=Y1,C2=J1,M2=K1,A2=Q1,E2=tP,k2=function(){var t=q1();return function(e,r,i,n,o,a){var l,c;for(r||(r=2),i||(i=0),n?c=Math.min(n*r+i,e.length):c=e.length,l=i;l<c;l+=r)t[0]=e[l],t[1]=e[l+1],o(t,t,a),e[l]=t[0],e[l+1]=t[1];return e}}();m();m();function rf(t){if(t<=0)return 0;if(t>=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}s(rf,"easeCubicInOut");function ql(t,e,r,i){let n=new iP.default(t,e,r,i);return o=>n.solve(o)}s(ql,"bezier");var oP=ql(.25,.1,.25,1);function Ne(t,e,r){return Math.min(r,Math.max(e,t))}s(Ne,"clamp");function Si(t,e,r){let i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}s(Si,"wrap");function aP(t,e){let r=[];for(let i in t)i in e||r.push(i);return r}s(aP,"keysDifference");function W(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}s(W,"extend");function Qr(t,e){let r={};for(let i=0;i<e.length;i++){let n=e[i];n in t&&(r[n]=t[n])}return r}s(Qr,"pick");var D2=1;function nf(){return D2++}s(nf,"uniqueId");function st(t){return Math.log(t)/Math.LN2}s(st,"scaleZoom");function of(t,e,r){let i={};for(let n in t)i[n]=e.call(r||this,t[n],n,t);return i}s(of,"mapObject");var rP={};function De(t){rP[t]||(typeof console<"u"&&console.warn(t),rP[t]=!0)}s(De,"warnOnce");function jo(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}s(jo,"isCounterClockwise");function zr(t){return typeof WorkerGlobalScope<"u"&&typeof t<"u"&&t instanceof WorkerGlobalScope}s(zr,"isWorker");function sP(t){let e=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(t.replace(e,(i,n,o,a)=>{let l=o||a;return r[n]=l?l.toLowerCase():!0,""}),r["max-age"]){let i=parseInt(r["max-age"],10);isNaN(i)?delete r["max-age"]:r["max-age"]=i}return r}s(sP,"parseCacheControl");var tf=null;function lP(t){if(tf==null){let e=t.navigator?t.navigator.userAgent:null;tf=!!t.safari||!!(e&&(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return tf}s(lP,"isSafari");function Jt(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}s(Jt,"isImageBitmap");var uP=s(async t=>{if(t.byteLength===0)return createImageBitmap(new ImageData(1,1));let e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(r){throw new Error("Could not load image because of ".concat(r.message,". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}},"arrayBufferToImageBitmap"),nP="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",cP=s(t=>new Promise((e,r)=>{let i=new Image;i.onload=()=>{e(i),URL.revokeObjectURL(i.src),i.onload=null,window.requestAnimationFrame(()=>{i.src=nP})},i.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let n=new Blob([new Uint8Array(t)],{type:"image/png"});i.src=t.byteLength?URL.createObjectURL(n):nP}),"arrayBufferToImage");function z2(t,e,r,i,n){let o=Math.max(-e,0)*4,c=(Math.max(0,r)-r)*i*4+o,u=i*4,p=Math.max(0,e),f=Math.max(0,r),h=Math.min(t.width,e+i),y=Math.min(t.height,r+n);return{rect:{x:p,y:f,width:h-p,height:y-f},layout:[{offset:c,stride:u}]}}s(z2,"computeVideoFrameParameters");async function pP(t,e,r,i,n){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let o=new VideoFrame(t,{timestamp:0});try{let a=o==null?void 0:o.format;if(!a||!(a.startsWith("BGR")||a.startsWith("RGB")))throw new Error("Unrecognized format ".concat(a));let l=a.startsWith("BGR"),c=new Uint8ClampedArray(i*n*4);if(await o.copyTo(c,z2(t,e,r,i,n)),l)for(let u=0;u<c.length;u+=4){let p=c[u];c[u]=c[u+2],c[u+2]=p}return c}finally{o.close()}}s(pP,"readImageUsingVideoFrame");function Go(t,e,r,i){return t.addEventListener(e,r,i),{unsubscribe:s(()=>{t.removeEventListener(e,r,i)},"unsubscribe")}}s(Go,"subscribe");function Et(t){return t*Math.PI/180}s(Et,"degreesToRadians");var Ti=25,Wl=0;m();m();var O2="AbortError";function Mn(){return new Error(O2)}s(Mn,"createAbortError");var R2=typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),Yl,af,xe={now:R2,frame(t,e,r){let i=requestAnimationFrame(o=>{n(),e(o)}),{unsubscribe:n}=Go(t.signal,"abort",()=>{n(),cancelAnimationFrame(i),r(Mn())},!1)},frameAsync(t){return new Promise((e,r)=>{this.frame(t,e,r)})},getImageData(t,e=0){return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){let e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r},resolveURL(t){return Yl||(Yl=document.createElement("a")),Yl.href=t,Yl.href},hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return matchMedia?(af==null&&(af=matchMedia("(prefers-reduced-motion: reduce)")),af.matches):!1}};m();var mP=J(te(),1);var ye=class ye{static testProp(e){if(!ye.docStyle)return e[0];for(let r=0;r<e.length;r++)if(e[r]in ye.docStyle)return e[r];return e[0]}static create(e,r,i){let n=window.document.createElement(e);return r!==void 0&&(n.className=r),i&&i.appendChild(n),n}static createNS(e,r){return window.document.createElementNS(e,r)}static disableDrag(){ye.docStyle&&ye.selectProp&&(ye.userSelect=ye.docStyle[ye.selectProp],ye.docStyle[ye.selectProp]="none")}static enableDrag(){ye.docStyle&&ye.selectProp&&(ye.docStyle[ye.selectProp]=ye.userSelect)}static setTransform(e,r){e.style[ye.transformProp]=r}static addEventListener(e,r,i,n={}){"passive"in n?e.addEventListener(r,i,n):e.addEventListener(r,i,n.capture)}static removeEventListener(e,r,i,n={}){"passive"in n?e.removeEventListener(r,i,n):e.removeEventListener(r,i,n.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",ye.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",ye.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",ye.suppressClickInternal,!0)},0)}static getScale(e){let r=e.getBoundingClientRect();return{x:r.width/e.offsetWidth||1,y:r.height/e.offsetHeight||1,boundingClientRect:r}}static getPoint(e,r,i){let n=r.boundingClientRect;return new mP.default((i.clientX-n.left)/r.x-e.clientLeft,(i.clientY-n.top)/r.y-e.clientTop)}static mousePos(e,r){let i=ye.getScale(e);return ye.getPoint(e,i,r)}static touchPos(e,r){let i=[],n=ye.getScale(e);for(let o=0;o<r.length;o++)i.push(ye.getPoint(e,n,r[o]));return i}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}static sanitize(e){let n=new DOMParser().parseFromString(e,"text/html").body||document.createElement("body"),o=n.querySelectorAll("script");for(let a of o)a.remove();return ye.clean(n),n.innerHTML}static isPossiblyDangerous(e,r){let i=r.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(e)&&(i.includes("javascript:")||i.includes("data:"))||e.startsWith("on"))return!0}static clean(e){let r=e.children;for(let i of r)ye.removeAttributes(i),ye.clean(i)}static removeAttributes(e){for(let{name:r,value:i}of e.attributes)ye.isPossiblyDangerous(r,i)&&e.removeAttribute(r)}};s(ye,"DOM"),ye.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,ye.selectProp=ye.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),ye.transformProp=ye.testProp(["transform","WebkitTransform"]);var $e=ye;m();m();m();var kt={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Jl(t){return kt.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}s(Jl,"getProtocol");m();var Kl="global-dispatcher",uf=class uf extends Error{constructor(e,r,i,n){super("AJAXError: ".concat(r," (").concat(e,"): ").concat(i)),this.status=e,this.statusText=r,this.url=i,this.body=n}};s(uf,"AJAXError");var en=uf,sf=s(()=>zr(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,"getReferrer"),F2=s(t=>/^file:/.test(t)||/^file:/.test(sf())&&!/^\w+:/.test(t),"isFileURL");async function B2(t,e){let r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:sf(),signal:e.signal});t.type==="json"&&!r.headers.has("Accept")&&r.headers.set("Accept","application/json");let i;try{i=await fetch(r)}catch(a){throw new en(0,a.message,t.url,new Blob)}if(!i.ok){let a=await i.blob();throw new en(i.status,i.statusText,t.url,a)}let n;t.type==="arrayBuffer"||t.type==="image"?n=i.arrayBuffer():t.type==="json"?n=i.json():n=i.text();let o=await n;if(e.signal.aborted)throw Mn();return{data:o,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires")}}s(B2,"makeFetchRequest");function U2(t,e){return new Promise((r,i)=>{var o;let n=new XMLHttpRequest;n.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(n.responseType="arraybuffer");for(let a in t.headers)n.setRequestHeader(a,t.headers[a]);t.type==="json"&&(n.responseType="text",(o=t.headers)!=null&&o.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials=t.credentials==="include",n.onerror=()=>{i(new Error(n.statusText))},n.onload=()=>{if(!e.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let a=n.response;if(t.type==="json")try{a=JSON.parse(n.response)}catch(l){i(l);return}r({data:a,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires")})}else{let a=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});i(new en(n.status,n.statusText,t.url,a))}},e.signal.addEventListener("abort",()=>{n.abort(),i(Mn())}),n.send(t.body)})}s(U2,"makeXMLHttpRequest");var Ii=s(function(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let r=Jl(t.url);if(r)return r(t,e);if(zr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:Kl},e)}if(!F2(t.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return B2(t,e);if(zr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:Kl},e)}return U2(t,e)},"makeRequest"),Zo=s((t,e)=>Ii(W(t,{type:"json"}),e),"getJSON"),fP=s((t,e)=>Ii(W(t,{type:"arrayBuffer"}),e),"getArrayBuffer");function lf(t){if(!t||t.indexOf("://")<=0||t.indexOf("data:image/")===0||t.indexOf("blob:")===0)return!0;let e=new URL(t),r=window.location;return e.protocol===r.protocol&&e.host===r.host}s(lf,"sameOrigin");var hP=s(t=>{let e=window.document.createElement("video");return e.muted=!0,new Promise(r=>{e.onloadstart=()=>{r(e)};for(let i of t){let n=window.document.createElement("source");lf(i)||(e.crossOrigin="Anonymous"),n.src=i,e.appendChild(n)}})},"getVideo");m();m();var Ql={supported:!1,testSupport:N2},Xo,cf=!1,Ci,dP=!1;typeof document<"u"&&(Ci=document.createElement("img"),Ci.onload=()=>{Xo&&yP(Xo),Xo=null,dP=!0},Ci.onerror=()=>{cf=!0,Xo=null},Ci.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function N2(t){cf||!Ci||(dP?yP(t):Xo=t)}s(N2,"testSupport");function yP(t){let e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,Ci),t.isContextLost())return;Ql.supported=!0}catch(r){}t.deleteTexture(e),cf=!0}s(yP,"testWebpTextureUpload");var Kt;(y=>{let t,e,r,i;y.resetRequestQueue=s(()=>{t=[],e=0,r=0,i={}},"resetRequestQueue"),y.addThrottleControl=s(g=>{let x=r++;return i[x]=g,x},"addThrottleControl"),y.removeThrottleControl=s(g=>{delete i[g],f()},"removeThrottleControl");let l=s(()=>{for(let g of Object.keys(i))if(i[g]())return!0;return!1},"isThrottled");y.getImage=s((g,x,_=!0)=>new Promise((P,I)=>{Ql.supported&&(g.headers||(g.headers={}),g.headers.accept="image/webp,*/*"),W(g,{type:"image"});let v={abortController:x,requestParameters:g,supportImageRefresh:_,state:"queued",onError:s(w=>{I(w)},"onError"),onSuccess:s(w=>{P(w)},"onSuccess")};t.push(v),f()}),"getImage");let u=s(g=>typeof createImageBitmap=="function"?uP(g):cP(g),"arrayBufferToCanvasImageSource"),p=s(async g=>{g.state="running";let{requestParameters:x,supportImageRefresh:_,onError:P,onSuccess:I,abortController:v}=g,w=_===!1&&!zr(self)&&!Jl(x.url)&&(!x.headers||Object.keys(x.headers).reduce((A,k)=>A&&k==="accept",!0));e++;let T=w?h(x,v):Ii(x,v);try{let A=await T;if(delete g.abortController,g.state="completed",A.data instanceof HTMLImageElement||Jt(A.data))I(A);else if(A.data){let k=await u(A.data);I({data:k,cacheControl:A.cacheControl,expires:A.expires})}}catch(A){delete g.abortController,P(A)}finally{e--,f()}},"doImageRequest"),f=s(()=>{let g=l()?kt.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:kt.MAX_PARALLEL_IMAGE_REQUESTS;for(let x=e;x<g&&t.length>0;x++){let _=t.shift();if(_.abortController.signal.aborted){x--;continue}p(_)}},"processQueue"),h=s((g,x)=>new Promise((_,P)=>{let I=new Image,v=g.url,w=g.credentials;w&&w==="include"?I.crossOrigin="use-credentials":(w&&w==="same-origin"||!lf(v))&&(I.crossOrigin="anonymous"),x.signal.addEventListener("abort",()=>{I.src="",P(Mn())}),I.fetchPriority="high",I.onload=()=>{I.onerror=I.onload=null,_({data:I})},I.onerror=()=>{I.onerror=I.onload=null,!x.signal.aborted&&P(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},I.src=v}),"getImageUsingHtmlImage")})(Kt||(Kt={}));Kt.resetRequestQueue();m();m();m();function gP(t,e,r){r[t]&&r[t].indexOf(e)!==-1||(r[t]=r[t]||[],r[t].push(e))}s(gP,"_addEventListener");function pf(t,e,r){if(r&&r[t]){let i=r[t].indexOf(e);i!==-1&&r[t].splice(i,1)}}s(pf,"_removeEventListener");var mf=class mf{constructor(e,r={}){W(this,r),this.type=e}};s(mf,"Event");var Q=mf,ff=class ff extends Q{constructor(e,r={}){super("error",W({error:e},r))}};s(ff,"ErrorEvent");var Pe=ff,hf=class hf{on(e,r){return this._listeners=this._listeners||{},gP(e,r,this._listeners),{unsubscribe:s(()=>{this.off(e,r)},"unsubscribe")}}off(e,r){return pf(e,r,this._listeners),pf(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},gP(e,r,this._oneTimeListeners),this):new Promise(i=>this.once(e,i))}fire(e,r){typeof e=="string"&&(e=new Q(e,r||{}));let i=e.type;if(this.listens(i)){e.target=this;let n=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];for(let l of n)l.call(this,e);let o=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];for(let l of o)pf(i,l,this._oneTimeListeners),l.call(this,e);let a=this._eventedParent;a&&(W(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),a.fire(e))}else e instanceof Pe&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}};s(hf,"Evented");var we=hf;m();m();m();m();var $2=8,V2={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},j2={"*":{type:"source"}},G2=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Z2={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},X2={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},H2={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},q2={type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},W2={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Y2={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},J2={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},K2=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],Q2={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ek={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},tk={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},rk={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},nk={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ik={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ok={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ak={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},sk={type:"array",value:"*"},lk={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},uk={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},ck={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},pk={type:"array",value:"*",minimum:1},mk={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},fk={"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},hk={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},dk={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},yk=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],gk={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},bk={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},xk={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},_k={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},vk={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},Pk={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},wk={"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},Sk={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Tk={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Ik={"*":{type:"string"}},lt={$version:$2,$root:V2,sources:j2,source:G2,source_vector:Z2,source_raster:X2,source_raster_dem:H2,source_geojson:q2,source_video:W2,source_image:Y2,layer:J2,layout:K2,layout_background:Q2,layout_fill:ek,layout_circle:tk,layout_heatmap:rk,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:nk,layout_symbol:ik,layout_raster:ok,layout_hillshade:ak,"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:sk,filter_operator:lk,geometry_type:uk,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:ck,expression:pk,light:mk,sky:fk,terrain:hk,projection:dk,paint:yk,paint_fill:gk,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:bk,paint_circle:xk,paint_heatmap:_k,paint_symbol:vk,paint_raster:Pk,paint_hillshade:wk,"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:Sk,transition:Tk,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:Ik};var Qf=class Qf{constructor(e,r,i,n){this.message=(e?"".concat(e,": "):"")+i,n&&(this.identifier=n),r!=null&&r.__line__&&(this.line=r.__line__)}};s(Qf,"ValidationError");var z=Qf;function Oi(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}s(Oi,"extendBy");var eh=class eh extends Error{constructor(e,r){super(r),this.message=r,this.key=e}};s(eh,"ExpressionParsingError");var Gt=eh,xu=class xu{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[i,n]of r)this.bindings[i]=n}concat(e){return new xu(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error("".concat(e," not found in scope."))}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}};s(xu,"Scope");var Sf=xu,Vi={kind:"null"},V={kind:"number"},ae={kind:"string"},oe={kind:"boolean"},yr={kind:"color"},Uu={kind:"projectionDefinition"},Rn={kind:"object"},ie={kind:"value"},Ck={kind:"error"},Nu={kind:"collator"},$u={kind:"formatted"},Vu={kind:"padding"},ea={kind:"colorArray"},ju={kind:"numberArray"},ha={kind:"resolvedImage"},Gu={kind:"variableAnchorOffsetCollection"};function Lt(t,e){return{kind:"array",itemType:t,N:e}}s(Lt,"array");function ze(t){if(t.kind==="array"){let e=ze(t.itemType);return typeof t.N=="number"?"array<".concat(e,", ").concat(t.N,">"):t.itemType.kind==="value"?"array":"array<".concat(e,">")}else return t.kind}s(ze,"typeToString");var Mk=[Vi,V,ae,oe,yr,Uu,$u,Rn,Lt(ie),Vu,ju,ea,ha,Gu];function ta(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!ta(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of Mk)if(!ta(r,e))return null}}return"Expected ".concat(ze(t)," but found ").concat(ze(e)," instead.")}s(ta,"checkSubtype");function Vf(t,e){return e.some(r=>r.kind===t.kind)}s(Vf,"isValidType");function Fn(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}s(Fn,"isValidNativeType");function tn(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}s(tn,"verifyType");var BP=.96422,UP=1,NP=.82521,$P=4/29,zi=6/29,VP=3*zi*zi,Ak=zi*zi*zi,Ek=Math.PI/180,kk=180/Math.PI;function jP(t){return t=t%360,t<0&&(t+=360),t}s(jP,"constrainAngle");function GP([t,e,r,i]){t=df(t),e=df(e),r=df(r);let n,o,a=yf((.2225045*t+.7168786*e+.0606169*r)/UP);t===e&&e===r?n=o=a:(n=yf((.4360747*t+.3850649*e+.1430804*r)/BP),o=yf((.0139322*t+.0971045*e+.7141733*r)/NP));let l=116*a-16;return[l<0?0:l,500*(n-a),200*(a-o),i]}s(GP,"rgbToLab");function df(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}s(df,"rgb2xyz");function yf(t){return t>Ak?Math.pow(t,1/3):t/VP+$P}s(yf,"xyz2lab");function ZP([t,e,r,i]){let n=(t+16)/116,o=isNaN(e)?n:n+e/500,a=isNaN(r)?n:n-r/200;return n=UP*bf(n),o=BP*bf(o),a=NP*bf(a),[gf(3.1338561*o-1.6168667*n-.4906146*a),gf(-.9787684*o+1.9161415*n+.033454*a),gf(.0719453*o-.2289914*n+1.4052427*a),i]}s(ZP,"labToRgb");function gf(t){return t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055,t<0?0:t>1?1:t}s(gf,"xyz2rgb");function bf(t){return t>zi?t*t*t:VP*(t-$P)}s(bf,"lab2xyz");function Lk(t){let[e,r,i,n]=GP(t),o=Math.sqrt(r*r+i*i);return[Math.round(o*1e4)?jP(Math.atan2(i,r)*kk):NaN,o,e,n]}s(Lk,"rgbToHcl");function Dk([t,e,r,i]){return t=isNaN(t)?0:t*Ek,ZP([r,Math.cos(t)*e,Math.sin(t)*e,i])}s(Dk,"hclToRgb");function zk([t,e,r,i]){t=jP(t),e/=100,r/=100;function n(o){let a=(o+t/30)%12,l=e*Math.min(r,1-r);return r-l*Math.max(-1,Math.min(a-3,9-a,1))}return s(n,"f"),[n(0),n(8),n(4),i]}s(zk,"hslToRgb");var Ok=Object.hasOwn||s(function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},"hasOwnProperty");function qo(t,e){return Ok(t,e)?t[e]:void 0}s(qo,"getOwn");function Rk(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=qo(Fk,t);if(e){let[n,o,a]=e;return[n/255,o/255,a/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let o=t.length<6?1:2,a=1;return[eu(t.slice(a,a+=o)),eu(t.slice(a,a+=o)),eu(t.slice(a,a+=o)),eu(t.slice(a,a+o)||"ff")]}if(t.startsWith("rgb")){let n=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,o=t.match(n);if(o){let[a,l,c,u,p,f,h,y,g,x,_,P]=o,I=[u||" ",h||" ",x].join("");if(I===" "||I===" /"||I===",,"||I===",,,"){let v=[c,f,g].join(""),w=v==="%%%"?100:v===""?255:0;if(w){let T=[Mi(+l/w,0,1),Mi(+p/w,0,1),Mi(+y/w,0,1),_?bP(+_,P):1];if(xP(T))return T}}return}}let r=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,i=t.match(r);if(i){let[n,o,a,l,c,u,p,f,h]=i,y=[a||" ",c||" ",p].join("");if(y===" "||y===" /"||y===",,"||y===",,,"){let g=[+o,Mi(+l,0,100),Mi(+u,0,100),f?bP(+f,h):1];if(xP(g))return zk(g)}}}s(Rk,"parseCssColor");function eu(t){return parseInt(t.padEnd(2,t),16)/255}s(eu,"parseHex");function bP(t,e){return Mi(e?t/100:t,0,1)}s(bP,"parseAlpha");function Mi(t,e,r){return Math.min(Math.max(e,t),r)}s(Mi,"clamp");function xP(t){return!t.some(Number.isNaN)}s(xP,"validateNumbers");var Fk={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function an(t,e,r){return t+r*(e-t)}s(an,"interpolateNumber");function Ri(t,e,r){return t.map((i,n)=>an(i,e[n],r))}s(Ri,"interpolateArray");function Bk(t){return t==="rgb"||t==="hcl"||t==="lab"}s(Bk,"isSupportedInterpolationColorSpace");var rn=class rn{constructor(e,r,i,n=1,o=!0){this.r=e,this.g=r,this.b=i,this.a=n,o||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,r,i,n]))}static parse(e){if(e instanceof rn)return e;if(typeof e!="string")return;let r=Rk(e);if(r)return new rn(...r,!1)}get rgb(){let{r:e,g:r,b:i,a:n}=this,o=n||1/0;return this.overwriteGetter("rgb",[e/o,r/o,i/o,n])}get hcl(){return this.overwriteGetter("hcl",Lk(this.rgb))}get lab(){return this.overwriteGetter("lab",GP(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,i,n]=this.rgb;return"rgba(".concat([e,r,i].map(o=>Math.round(o*255)).join(","),",").concat(n,")")}static interpolate(e,r,i,n="rgb"){switch(n){case"rgb":{let[o,a,l,c]=Ri(e.rgb,r.rgb,i);return new rn(o,a,l,c,!1)}case"hcl":{let[o,a,l,c]=e.hcl,[u,p,f,h]=r.hcl,y,g;if(!isNaN(o)&&!isNaN(u)){let v=u-o;u>o&&v>180?v-=360:u<o&&o-u>180&&(v+=360),y=o+i*v}else isNaN(o)?isNaN(u)?y=NaN:(y=u,(l===1||l===0)&&(g=p)):(y=o,(f===1||f===0)&&(g=a));let[x,_,P,I]=Dk([y,g!=null?g:an(a,p,i),an(l,f,i),an(c,h,i)]);return new rn(x,_,P,I,!1)}case"lab":{let[o,a,l,c]=ZP(Ri(e.lab,r.lab,i));return new rn(o,a,l,c,!1)}}}};s(rn,"Color");var re=rn;re.black=new re(0,0,0,1);re.white=new re(1,1,1,1);re.transparent=new re(0,0,0,0);re.red=new re(1,0,0,1);var th=class th{constructor(e,r,i){e?this.sensitivity=r?"variant":"case":this.sensitivity=r?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};s(th,"Collator");var ra=th,Uk=["bottom","center","top"],rh=class rh{constructor(e,r,i,n,o,a){this.text=e,this.image=r,this.scale=i,this.fontStack=n,this.textColor=o,this.verticalAlign=a}};s(rh,"FormattedSection");var na=rh,Ei=class Ei{constructor(e){this.sections=e}static fromString(e){return new Ei([new na(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Ei?e:Ei.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}};s(Ei,"Formatted");var tr=Ei,kn=class kn{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof kn)return e;if(typeof e=="number")return new kn([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]];break}return new kn(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new kn(Ri(e.values,r.values,i))}};s(kn,"Padding");var Xt=kn,Ln=class Ln{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ln)return e;if(typeof e=="number")return new Ln([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!="number")return;return new Ln(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Ln(Ri(e.values,r.values,i))}};s(Ln,"NumberArray");var Ht=Ln,Dn=class Dn{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Dn)return e;if(typeof e=="string"){let i=re.parse(e);return i?new Dn([i]):void 0}if(!Array.isArray(e))return;let r=[];for(let i of e){if(typeof i!="string")return;let n=re.parse(i);if(!n)return;r.push(n)}return new Dn(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n="rgb"){let o=[];if(e.values.length!=r.values.length)throw new Error("colorArray: Arrays have mismatched length (".concat(e.values.length," vs. ").concat(r.values.length,"), cannot interpolate."));for(let a=0;a<e.values.length;a++)o.push(re.interpolate(e.values[a],r.values[a],i,n));return new Dn(o)}};s(Dn,"ColorArray");var dt=Dn,nh=class nh extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}};s(nh,"RuntimeError");var Ee=nh,Nk=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),ki=class ki{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ki)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let r=0;r<e.length;r+=2){let i=e[r],n=e[r+1];if(typeof i!="string"||!Nk.has(i)||!Array.isArray(n)||n.length!==2||typeof n[0]!="number"||typeof n[1]!="number")return}return new ki(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){let n=e.values,o=r.values;if(n.length!==o.length)throw new Ee("Cannot interpolate values of different length. from: ".concat(e.toString(),", to: ").concat(r.toString()));let a=[];for(let l=0;l<n.length;l+=2){if(n[l]!==o[l])throw new Ee("Cannot interpolate values containing mismatched anchors. from[".concat(l,"]: ").concat(n[l],", to[").concat(l,"]: ").concat(o[l]));a.push(n[l]);let[c,u]=n[l+1],[p,f]=o[l+1];a.push([an(c,p,i),an(u,f,i)])}return new ki(a)}};s(ki,"VariableAnchorOffsetCollection");var br=ki,_u=class _u{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new _u({name:e,available:!1}):null}};s(_u,"ResolvedImage");var yt=_u,nn=class nn{constructor(e,r,i){this.from=e,this.to=r,this.transition=i}static interpolate(e,r,i){return new nn(e,r,i)}static parse(e){if(e instanceof nn)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new nn(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new nn(e.from,e.to,e.transition);if(typeof e=="string")return new nn(e,e,1)}};s(nn,"ProjectionDefinition");var Or=nn;function XP(t,e,r,i){if(!(typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255)){let n=typeof i=="number"?[t,e,r,i]:[t,e,r];return"Invalid rgba value [".concat(n.join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}return typeof i>"u"||typeof i=="number"&&i>=0&&i<=1?null:"Invalid rgba value [".concat([t,e,r,i].join(", "),"]: 'a' must be between 0 and 1.")}s(XP,"validateRGBA");function ia(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Or||t instanceof re||t instanceof ra||t instanceof tr||t instanceof Xt||t instanceof Ht||t instanceof dt||t instanceof br||t instanceof yt)return!0;if(Array.isArray(t)){for(let e of t)if(!ia(e))return!1;return!0}else if(typeof t=="object"){for(let e in t)if(!ia(t[e]))return!1;return!0}else return!1}s(ia,"isValue");function We(t){if(t===null)return Vi;if(typeof t=="string")return ae;if(typeof t=="boolean")return oe;if(typeof t=="number")return V;if(t instanceof re)return yr;if(t instanceof Or)return Uu;if(t instanceof ra)return Nu;if(t instanceof tr)return $u;if(t instanceof Xt)return Vu;if(t instanceof Ht)return ju;if(t instanceof dt)return ea;if(t instanceof br)return Gu;if(t instanceof yt)return ha;if(Array.isArray(t)){let e=t.length,r;for(let i of t){let n=We(i);if(!r)r=n;else{if(r===n)continue;r=ie;break}}return Lt(r||ie,e)}else return Rn}s(We,"typeOf");function Wo(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof re||t instanceof Or||t instanceof tr||t instanceof Xt||t instanceof Ht||t instanceof dt||t instanceof br||t instanceof yt?t.toString():JSON.stringify(t)}s(Wo,"valueToString");var vu=class vu{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error("'literal' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(!ia(e[1]))return r.error("invalid value");let i=e[1],n=We(i),o=r.expectedType;return n.kind==="array"&&n.N===0&&o&&o.kind==="array"&&(typeof o.N!="number"||o.N===0)&&(n=o),new vu(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};s(vu,"Literal");var Fi=vu,tu={string:ae,number:V,boolean:oe,object:Rn},Pu=class Pu{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=1,n,o=e[0];if(o==="array"){let l;if(e.length>2){let u=e[1];if(typeof u!="string"||!(u in tu)||u==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);l=tu[u],i++}else l=ie;let c;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);c=e[2],i++}n=Lt(l,c)}else{if(!tu[o])throw new Error("Types doesn't contain name = ".concat(o));n=tu[o]}let a=[];for(;i<e.length;i++){let l=r.parse(e[i],i,ie);if(!l)return null;a.push(l)}return new Pu(n,a)}evaluate(e){for(let r=0;r<this.args.length;r++){let i=this.args[r].evaluate(e);if(ta(this.type,We(i))){if(r===this.args.length-1)throw new Ee("Expected value to be of type ".concat(ze(this.type),", but found ").concat(ze(We(i))," instead."))}else return i}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};s(Pu,"Assertion");var Qt=Pu,_P={"to-boolean":oe,"to-color":yr,"to-number":V,"to-string":ae},wu=class wu{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[0];if(!_P[i])throw new Error("Can't parse ".concat(i," as it is not part of the known types"));if((i==="to-boolean"||i==="to-string")&&e.length!==2)return r.error("Expected one argument.");let n=_P[i],o=[];for(let a=1;a<e.length;a++){let l=r.parse(e[a],a,ie);if(!l)return null;o.push(l)}return new wu(n,o)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,i;for(let n of this.args){if(r=n.evaluate(e),i=null,r instanceof re)return r;if(typeof r=="string"){let o=e.parseColor(r);if(o)return o}else if(Array.isArray(r)&&(r.length<3||r.length>4?i="Invalid rgba value ".concat(JSON.stringify(r),": expected an array containing either three or four numeric values."):i=XP(r[0],r[1],r[2],r[3]),!i))return new re(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Ee(i||"Could not parse color from value '".concat(typeof r=="string"?r:JSON.stringify(r),"'"))}case"padding":{let r;for(let i of this.args){r=i.evaluate(e);let n=Xt.parse(r);if(n)return n}throw new Ee("Could not parse padding from value '".concat(typeof r=="string"?r:JSON.stringify(r),"'"))}case"numberArray":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ht.parse(r);if(n)return n}throw new Ee("Could not parse numberArray from value '".concat(typeof r=="string"?r:JSON.stringify(r),"'"))}case"colorArray":{let r;for(let i of this.args){r=i.evaluate(e);let n=dt.parse(r);if(n)return n}throw new Ee("Could not parse colorArray from value '".concat(typeof r=="string"?r:JSON.stringify(r),"'"))}case"variableAnchorOffsetCollection":{let r;for(let i of this.args){r=i.evaluate(e);let n=br.parse(r);if(n)return n}throw new Ee("Could not parse variableAnchorOffsetCollection from value '".concat(typeof r=="string"?r:JSON.stringify(r),"'"))}case"number":{let r=null;for(let i of this.args){if(r=i.evaluate(e),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new Ee("Could not convert ".concat(JSON.stringify(r)," to number."))}case"formatted":return tr.fromString(Wo(this.args[0].evaluate(e)));case"resolvedImage":return yt.fromString(Wo(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return Wo(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};s(wu,"Coercion");var on=wu,$k=["Unknown","Point","LineString","Polygon"],ih=class ih{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?$k[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache.get(e);return r||(r=re.parse(e),this._parseColorCache.set(e,r)),r}};s(ih,"EvaluationContext");var ou=ih,Su=class Su{constructor(e,r,i=[],n,o=new Sf,a=[]){this.registry=e,this.path=i,this.key=i.map(l=>"[".concat(l,"]")).join(""),this.scope=o,this.errors=a,this.expectedType=n,this._isConstant=r}parse(e,r,i,n,o={}){return r?this.concat(r,i,n)._parse(e,o):this._parse(e,o)}_parse(e,r){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function i(n,o,a){return a==="assert"?new Qt(o,[n]):a==="coerce"?new on(o,[n]):n}if(s(i,"annotate"),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let n=e[0];if(typeof n!="string")return this.error("Expression name must be a string, but found ".concat(typeof n,' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;let o=this.registry[n];if(o){let a=o.parse(e,this);if(!a)return null;if(this.expectedType){let l=this.expectedType,c=a.type;if((l.kind==="string"||l.kind==="number"||l.kind==="boolean"||l.kind==="object"||l.kind==="array")&&c.kind==="value")a=i(a,l,r.typeAnnotation||"assert");else if(l.kind==="projectionDefinition"&&["string","array"].includes(c.kind)||["color","formatted","resolvedImage"].includes(l.kind)&&["value","string"].includes(c.kind)||["padding","numberArray"].includes(l.kind)&&["value","number","array"].includes(c.kind)||l.kind==="colorArray"&&["value","string","array"].includes(c.kind)||l.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(c.kind))a=i(a,l,r.typeAnnotation||"coerce");else if(this.checkSubtype(l,c))return null}if(!(a instanceof Fi)&&a.type.kind!=="resolvedImage"&&this._isConstant(a)){let l=new ou;try{a=new Fi(a.type,a.evaluate(l))}catch(c){return this.error(c.message),null}}return a}return this.error('Unknown expression "'.concat(n,'". If you wanted a literal array, use ["literal", [...]].'),0)}else return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(typeof e," instead."))}concat(e,r,i){let n=typeof e=="number"?this.path.concat(e):this.path,o=i?this.scope.concat(i):this.scope;return new Su(this.registry,this._isConstant,n,r||null,o,this.errors)}error(e,...r){let i="".concat(this.key).concat(r.map(n=>"[".concat(n,"]")).join(""));this.errors.push(new Gt(i,e))}checkSubtype(e,r){let i=ta(e,r);return i&&this.error(i),i}};s(Su,"ParsingContext");var au=Su,Tu=class Tu{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error("Expected at least 3 arguments, but found ".concat(e.length-1," instead."));let i=[];for(let o=1;o<e.length-1;o+=2){let a=e[o];if(typeof a!="string")return r.error("Expected string, but found ".concat(typeof a," instead."),o);if(/[^a-zA-Z0-9_]/.test(a))return r.error("Variable names must contain only alphanumeric characters or '_'.",o);let l=r.parse(e[o+1],o+1);if(!l)return null;i.push([a,l])}let n=r.parse(e[e.length-1],e.length-1,r.expectedType,i);return n?new Tu(i,n):null}outputDefined(){return this.result.outputDefined()}};s(Tu,"Let");var su=Tu,Iu=class Iu{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");let i=e[1];return r.scope.has(i)?new Iu(i,r.scope.get(i)):r.error('Unknown variable "'.concat(i,'". Make sure "').concat(i,'" has been bound in an enclosing "let" expression before using it.'),1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}};s(Iu,"Var");var lu=Iu,Cu=class Cu{constructor(e,r,i){this.type=e,this.index=r,this.input=i}static parse(e,r){if(e.length!==3)return r.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));let i=r.parse(e[1],1,V),n=r.parse(e[2],2,Lt(r.expectedType||ie));if(!i||!n)return null;let o=n.type;return new Cu(o.itemType,i,n)}evaluate(e){let r=this.index.evaluate(e),i=this.input.evaluate(e);if(r<0)throw new Ee("Array index out of bounds: ".concat(r," < 0."));if(r>=i.length)throw new Ee("Array index out of bounds: ".concat(r," > ").concat(i.length-1,"."));if(r!==Math.floor(r))throw new Ee("Array index must be an integer, but found ".concat(r," instead."));return i[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}};s(Cu,"At");var Tf=Cu,Mu=class Mu{constructor(e,r){this.type=oe,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));let i=r.parse(e[1],1,ie),n=r.parse(e[2],2,ie);return!i||!n?null:Vf(i.type,[oe,ae,V,Vi,ie])?new Mu(i,n):r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(ze(i.type)," instead"))}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!Fn(r,["boolean","string","number","null"]))throw new Ee("Expected first argument to be of type boolean, string, number or null, but found ".concat(ze(We(r))," instead."));if(!Fn(i,["string","array"]))throw new Ee("Expected second argument to be of type array or string, but found ".concat(ze(We(i))," instead."));return i.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}};s(Mu,"In");var If=Mu,Yo=class Yo{constructor(e,r,i){this.type=V,this.needle=e,this.haystack=r,this.fromIndex=i}static parse(e,r){if(e.length<=2||e.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(e.length-1," instead."));let i=r.parse(e[1],1,ie),n=r.parse(e[2],2,ie);if(!i||!n)return null;if(!Vf(i.type,[oe,ae,V,Vi,ie]))return r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(ze(i.type)," instead"));if(e.length===4){let o=r.parse(e[3],3,V);return o?new Yo(i,n,o):null}else return new Yo(i,n)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!Fn(r,["boolean","string","number","null"]))throw new Ee("Expected first argument to be of type boolean, string, number or null, but found ".concat(ze(We(r))," instead."));let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),Fn(i,["string"])){let o=i.indexOf(r,n);return o===-1?-1:[...i.slice(0,o)].length}else{if(Fn(i,["array"]))return i.indexOf(r,n);throw new Ee("Expected second argument to be of type array or string, but found ".concat(ze(We(i))," instead."))}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}};s(Yo,"IndexOf");var Cf=Yo,Au=class Au{constructor(e,r,i,n,o,a){this.inputType=e,this.type=r,this.input=i,this.cases=n,this.outputs=o,this.otherwise=a}static parse(e,r){if(e.length<5)return r.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!==1)return r.error("Expected an even number of arguments.");let i,n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let o={},a=[];for(let u=2;u<e.length-1;u+=2){let p=e[u],f=e[u+1];Array.isArray(p)||(p=[p]);let h=r.concat(u);if(p.length===0)return h.error("Expected at least one branch label.");for(let g of p){if(typeof g!="number"&&typeof g!="string")return h.error("Branch labels must be numbers or strings.");if(typeof g=="number"&&Math.abs(g)>Number.MAX_SAFE_INTEGER)return h.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if(typeof g=="number"&&Math.floor(g)!==g)return h.error("Numeric branch labels must be integer values.");if(!i)i=We(g);else if(h.checkSubtype(i,We(g)))return null;if(typeof o[String(g)]<"u")return h.error("Branch labels must be unique.");o[String(g)]=a.length}let y=r.parse(f,u,n);if(!y)return null;n=n||y.type,a.push(y)}let l=r.parse(e[1],1,ie);if(!l)return null;let c=r.parse(e[e.length-1],e.length-1,n);return!c||l.type.kind!=="value"&&r.concat(1).checkSubtype(i,l.type)?null:new Au(i,n,l,o,a,c)}evaluate(e){let r=this.input.evaluate(e);return(We(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}};s(Au,"Match");var Mf=Au,Eu=class Eu{constructor(e,r,i){this.type=e,this.branches=r,this.otherwise=i}static parse(e,r){if(e.length<4)return r.error("Expected at least 3 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!==0)return r.error("Expected an odd number of arguments.");let i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let n=[];for(let a=1;a<e.length-1;a+=2){let l=r.parse(e[a],a,oe);if(!l)return null;let c=r.parse(e[a+1],a+1,i);if(!c)return null;n.push([l,c]),i=i||c.type}let o=r.parse(e[e.length-1],e.length-1,i);if(!o)return null;if(!i)throw new Error("Can't infer output type");return new Eu(i,n,o)}evaluate(e){for(let[r,i]of this.branches)if(r.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[r,i]of this.branches)e(r),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}};s(Eu,"Case");var Af=Eu,Jo=class Jo{constructor(e,r,i,n){this.type=e,this.input=r,this.beginIndex=i,this.endIndex=n}static parse(e,r){if(e.length<=2||e.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(e.length-1," instead."));let i=r.parse(e[1],1,ie),n=r.parse(e[2],2,V);if(!i||!n)return null;if(!Vf(i.type,[Lt(ie),ae,ie]))return r.error("Expected first argument to be of type array or string, but found ".concat(ze(i.type)," instead"));if(e.length===4){let o=r.parse(e[3],3,V);return o?new Jo(i.type,i,n,o):null}else return new Jo(i.type,i,n)}evaluate(e){let r=this.input.evaluate(e),i=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),Fn(r,["string"]))return[...r].slice(i,n).join("");if(Fn(r,["array"]))return r.slice(i,n);throw new Ee("Expected first argument to be of type array or string, but found ".concat(ze(We(r))," instead."))}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};s(Jo,"Slice");var Ef=Jo;function Zu(t,e){let r=t.length-1,i=0,n=r,o=0,a,l;for(;i<=n;)if(o=Math.floor((i+n)/2),a=t[o],l=t[o+1],a<=e){if(o===r||e<l)return o;i=o+1}else if(a>e)n=o-1;else throw new Ee("Input is not a number.");return 0}s(Zu,"findStopLessThanOrEqualTo");var ku=class ku{constructor(e,r,i){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(let[n,o]of i)this.labels.push(n),this.outputs.push(o)}static parse(e,r){if(e.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!==0)return r.error("Expected an even number of arguments.");let i=r.parse(e[1],1,V);if(!i)return null;let n=[],o=null;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);for(let a=1;a<e.length;a+=2){let l=a===1?-1/0:e[a],c=e[a+1],u=a,p=a+1;if(typeof l!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(n.length&&n[n.length-1][0]>=l)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);let f=r.parse(c,p,o);if(!f)return null;o=o||f.type,n.push([l,f])}return new ku(o,i,n)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let o=r.length;if(n>=r[o-1])return i[o-1].evaluate(e);let a=Zu(r,n);return i[a].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};s(ku,"Step");var uu=ku;function Vk(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}s(Vk,"getDefaultExportFromCjs");var xf,vP;function jk(){if(vP)return xf;vP=1,xf=t;function t(e,r,i,n){this.cx=3*e,this.bx=3*(i-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(n-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=i,this.p2y=n}return s(t,"UnitBezier"),t.prototype={sampleCurveX:s(function(e){return((this.ax*e+this.bx)*e+this.cx)*e},"sampleCurveX"),sampleCurveY:s(function(e){return((this.ay*e+this.by)*e+this.cy)*e},"sampleCurveY"),sampleCurveDerivativeX:s(function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},"sampleCurveDerivativeX"),solveCurveX:s(function(e,r){if(r===void 0&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var i=e,n=0;n<8;n++){var o=this.sampleCurveX(i)-e;if(Math.abs(o)<r)return i;var a=this.sampleCurveDerivativeX(i);if(Math.abs(a)<1e-6)break;i=i-o/a}var l=0,c=1;for(i=e,n=0;n<20&&(o=this.sampleCurveX(i),!(Math.abs(o-e)<r));n++)e>o?l=i:c=i,i=(c-l)*.5+l;return i},"solveCurveX"),solve:s(function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))},"solve")},xf}s(jk,"requireUnitbezier");var Gk=jk(),Zk=Vk(Gk),Ko=class Ko{constructor(e,r,i,n,o){this.type=e,this.operator=r,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(let[a,l]of o)this.labels.push(a),this.outputs.push(l)}static interpolationFactor(e,r,i,n){let o=0;if(e.name==="exponential")o=_f(r,e.base,i,n);else if(e.name==="linear")o=_f(r,1,i,n);else if(e.name==="cubic-bezier"){let a=e.controlPoints;o=new Zk(a[0],a[1],a[2],a[3]).solve(_f(r,1,i,n))}return o}static parse(e,r){let[i,n,o,...a]=e;if(!Array.isArray(n)||n.length===0)return r.error("Expected an interpolation type expression.",1);if(n[0]==="linear")n={name:"linear"};else if(n[0]==="exponential"){let u=n[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:u}}else if(n[0]==="cubic-bezier"){let u=n.slice(1);if(u.length!==4||u.some(p=>typeof p!="number"||p<0||p>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:u}}else return r.error("Unknown interpolation type ".concat(String(n[0])),1,0);if(e.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!==0)return r.error("Expected an even number of arguments.");if(o=r.parse(o,2,V),!o)return null;let l=[],c=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&r.expectedType!=ea?c=yr:r.expectedType&&r.expectedType.kind!=="value"&&(c=r.expectedType);for(let u=0;u<a.length;u+=2){let p=a[u],f=a[u+1],h=u+3,y=u+4;if(typeof p!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',h);if(l.length&&l[l.length-1][0]>=p)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);let g=r.parse(f,y,c);if(!g)return null;c=c||g.type,l.push([p,g])}return!tn(c,V)&&!tn(c,Uu)&&!tn(c,yr)&&!tn(c,Vu)&&!tn(c,ju)&&!tn(c,ea)&&!tn(c,Gu)&&!tn(c,Lt(V))?r.error("Type ".concat(ze(c)," is not interpolatable.")):new Ko(c,i,n,o,l)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let o=r.length;if(n>=r[o-1])return i[o-1].evaluate(e);let a=Zu(r,n),l=r[a],c=r[a+1],u=Ko.interpolationFactor(this.interpolation,n,l,c),p=i[a].evaluate(e),f=i[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return an(p,f,u);case"color":return re.interpolate(p,f,u);case"padding":return Xt.interpolate(p,f,u);case"colorArray":return dt.interpolate(p,f,u);case"numberArray":return Ht.interpolate(p,f,u);case"variableAnchorOffsetCollection":return br.interpolate(p,f,u);case"array":return Ri(p,f,u);case"projectionDefinition":return Or.interpolate(p,f,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return re.interpolate(p,f,u,"hcl");case"colorArray":return dt.interpolate(p,f,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return re.interpolate(p,f,u,"lab");case"colorArray":return dt.interpolate(p,f,u,"lab")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};s(Ko,"Interpolate");var er=Ko;function _f(t,e,r,i){let n=i-r,o=t-r;return n===0?0:e===1?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}s(_f,"exponentialInterpolation");var Xu={color:re.interpolate,number:an,padding:Xt.interpolate,numberArray:Ht.interpolate,colorArray:dt.interpolate,variableAnchorOffsetCollection:br.interpolate,array:Ri},Qo=class Qo{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=null,n=r.expectedType;n&&n.kind!=="value"&&(i=n);let o=[];for(let l of e.slice(1)){let c=r.parse(l,1+o.length,i,void 0,{typeAnnotation:"omit"});if(!c)return null;i=i||c.type,o.push(c)}if(!i)throw new Error("No output type");return n&&o.some(l=>ta(n,l.type))?new Qo(ie,o):new Qo(i,o)}evaluate(e){let r=null,i=0,n;for(let o of this.args)if(i++,r=o.evaluate(e),r&&r instanceof yt&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};s(Qo,"Coalesce");var cu=Qo;function PP(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}s(PP,"isComparableType");function Xk(t,e,r){return e===r}s(Xk,"eq");function Hk(t,e,r){return e!==r}s(Hk,"neq");function qk(t,e,r){return e<r}s(qk,"lt");function Wk(t,e,r){return e>r}s(Wk,"gt");function Yk(t,e,r){return e<=r}s(Yk,"lteq");function Jk(t,e,r){return e>=r}s(Jk,"gteq");function HP(t,e,r,i){return i.compare(e,r)===0}s(HP,"eqCollate");function Kk(t,e,r,i){return!HP(t,e,r,i)}s(Kk,"neqCollate");function Qk(t,e,r,i){return i.compare(e,r)<0}s(Qk,"ltCollate");function eL(t,e,r,i){return i.compare(e,r)>0}s(eL,"gtCollate");function tL(t,e,r,i){return i.compare(e,r)<=0}s(tL,"lteqCollate");function rL(t,e,r,i){return i.compare(e,r)>=0}s(rL,"gteqCollate");function ji(t,e,r){var n;let i=t!=="=="&&t!=="!=";return n=class{constructor(a,l,c){this.type=oe,this.lhs=a,this.rhs=l,this.collator=c,this.hasUntypedArgument=a.type.kind==="value"||l.type.kind==="value"}static parse(a,l){if(a.length!==3&&a.length!==4)return l.error("Expected two or three arguments.");let c=a[0],u=l.parse(a[1],1,ie);if(!u)return null;if(!PP(c,u.type))return l.concat(1).error('"'.concat(c,"\" comparisons are not supported for type '").concat(ze(u.type),"'."));let p=l.parse(a[2],2,ie);if(!p)return null;if(!PP(c,p.type))return l.concat(2).error('"'.concat(c,"\" comparisons are not supported for type '").concat(ze(p.type),"'."));if(u.type.kind!==p.type.kind&&u.type.kind!=="value"&&p.type.kind!=="value")return l.error("Cannot compare types '".concat(ze(u.type),"' and '").concat(ze(p.type),"'."));i&&(u.type.kind==="value"&&p.type.kind!=="value"?u=new Qt(p.type,[u]):u.type.kind!=="value"&&p.type.kind==="value"&&(p=new Qt(u.type,[p])));let f=null;if(a.length===4){if(u.type.kind!=="string"&&p.type.kind!=="string"&&u.type.kind!=="value"&&p.type.kind!=="value")return l.error("Cannot use collator to compare non-string types.");if(f=l.parse(a[3],3,Nu),!f)return null}return new n(u,p,f)}evaluate(a){let l=this.lhs.evaluate(a),c=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let u=We(l),p=We(c);if(u.kind!==p.kind||!(u.kind==="string"||u.kind==="number"))throw new Ee('Expected arguments for "'.concat(t,'" to be (string, string) or (number, number), but found (').concat(u.kind,", ").concat(p.kind,") instead."))}if(this.collator&&!i&&this.hasUntypedArgument){let u=We(l),p=We(c);if(u.kind!=="string"||p.kind!=="string")return e(a,l,c)}return this.collator?r(a,l,c,this.collator.evaluate(a)):e(a,l,c)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}},s(n,"Comparison"),n}s(ji,"makeComparison");var nL=ji("==",Xk,HP),iL=ji("!=",Hk,Kk),oL=ji("<",qk,Qk),aL=ji(">",Wk,eL),sL=ji("<=",Yk,tL),lL=ji(">=",Jk,rL),Lu=class Lu{constructor(e,r,i){this.type=Nu,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let i=e[1];if(typeof i!="object"||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(i["case-sensitive"]===void 0?!1:i["case-sensitive"],1,oe);if(!n)return null;let o=r.parse(i["diacritic-sensitive"]===void 0?!1:i["diacritic-sensitive"],1,oe);if(!o)return null;let a=null;return i.locale&&(a=r.parse(i.locale,1,ae),!a)?null:new Lu(n,o,a)}evaluate(e){return new ra(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}};s(Lu,"CollatorExpression");var pu=Lu,Du=class Du{constructor(e,r,i,n,o){this.type=ae,this.number=e,this.locale=r,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=o}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let i=r.parse(e[1],1,V);if(!i)return null;let n=e[2];if(typeof n!="object"||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let o=null;if(n.locale&&(o=r.parse(n.locale,1,ae),!o))return null;let a=null;if(n.currency&&(a=r.parse(n.currency,1,ae),!a))return null;let l=null;if(n["min-fraction-digits"]&&(l=r.parse(n["min-fraction-digits"],1,V),!l))return null;let c=null;return n["max-fraction-digits"]&&(c=r.parse(n["max-fraction-digits"],1,V),!c)?null:new Du(i,o,a,l,c)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}};s(Du,"NumberFormat");var kf=Du,zu=class zu{constructor(e){this.type=$u,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[1];if(!Array.isArray(i)&&typeof i=="object")return r.error("First argument must be an image or text section.");let n=[],o=!1;for(let a=1;a<=e.length-1;++a){let l=e[a];if(o&&typeof l=="object"&&!Array.isArray(l)){o=!1;let c=null;if(l["font-scale"]&&(c=r.parse(l["font-scale"],1,V),!c))return null;let u=null;if(l["text-font"]&&(u=r.parse(l["text-font"],1,Lt(ae)),!u))return null;let p=null;if(l["text-color"]&&(p=r.parse(l["text-color"],1,yr),!p))return null;let f=null;if(l["vertical-align"]){if(typeof l["vertical-align"]=="string"&&!Uk.includes(l["vertical-align"]))return r.error("'vertical-align' must be one of: 'bottom', 'center', 'top' but found '".concat(l["vertical-align"],"' instead."));if(f=r.parse(l["vertical-align"],1,ae),!f)return null}let h=n[n.length-1];h.scale=c,h.font=u,h.textColor=p,h.verticalAlign=f}else{let c=r.parse(e[a],1,ie);if(!c)return null;let u=c.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,n.push({content:c,scale:null,font:null,textColor:null,verticalAlign:null})}}return new zu(n)}evaluate(e){let r=s(i=>{let n=i.content.evaluate(e);return We(n)===ha?new na("",n,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new na(Wo(n),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null,i.verticalAlign?i.verticalAlign.evaluate(e):null)},"evaluateSection");return new tr(this.sections.map(r))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}};s(zu,"FormatExpression");var Lf=zu,Ou=class Ou{constructor(e){this.type=ha,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let i=r.parse(e[1],1,ae);return i?new Ou(i):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),i=yt.fromString(r);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(r)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}};s(Ou,"ImageExpression");var Df=Ou,Ru=class Ru{constructor(e){this.type=V,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected 1 argument, but found ".concat(e.length-1," instead."));let i=r.parse(e[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?r.error("Expected argument of type string or array, but found ".concat(ze(i.type)," instead.")):new Ru(i):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new Ee("Expected value to be of type string or array, but found ".concat(ze(We(r))," instead."))}eachChild(e){e(this.input)}outputDefined(){return!1}};s(Ru,"Length");var zf=Ru,gr=8192;function uL(t,e){let r=cL(t[0]),i=mL(t[1]),n=Math.pow(2,e.z);return[Math.round(r*n*gr),Math.round(i*n*gr)]}s(uL,"getTileCoordinates");function jf(t,e){let r=Math.pow(2,e.z),i=(t[0]/gr+e.x)/r,n=(t[1]/gr+e.y)/r;return[pL(i),fL(n)]}s(jf,"getLngLatFromTileCoord");function cL(t){return(180+t)/360}s(cL,"mercatorXfromLng");function pL(t){return t*360-180}s(pL,"lngFromMercatorXfromLng");function mL(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}s(mL,"mercatorYfromLat");function fL(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}s(fL,"latFromMercatorY");function da(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}s(da,"updateBBox");function oa(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}s(oa,"boxWithinBox");function hL(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]}s(hL,"rayIntersect");function dL(t,e,r){let i=t[0]-e[0],n=t[1]-e[1],o=t[0]-r[0],a=t[1]-r[1];return i*a-o*n===0&&i*o<=0&&n*a<=0}s(dL,"pointOnBoundary");function Hu(t,e,r,i){let n=[e[0]-t[0],e[1]-t[1]],o=[i[0]-r[0],i[1]-r[1]];return xL(o,n)===0?!1:!!(wP(t,e,r,i)&&wP(r,i,t,e))}s(Hu,"segmentIntersectSegment");function yL(t,e,r){for(let i of r)for(let n=0;n<i.length-1;++n)if(Hu(t,e,i[n],i[n+1]))return!0;return!1}s(yL,"lineIntersectPolygon");function Gi(t,e,r=!1){let i=!1;for(let n of e)for(let o=0;o<n.length-1;o++){if(dL(t,n[o],n[o+1]))return r;hL(t,n[o],n[o+1])&&(i=!i)}return i}s(Gi,"pointWithinPolygon");function gL(t,e){for(let r of e)if(Gi(t,r))return!0;return!1}s(gL,"pointWithinPolygons");function qP(t,e){for(let r of t)if(!Gi(r,e))return!1;for(let r=0;r<t.length-1;++r)if(yL(t[r],t[r+1],e))return!1;return!0}s(qP,"lineStringWithinPolygon");function bL(t,e){for(let r of e)if(qP(t,r))return!0;return!1}s(bL,"lineStringWithinPolygons");function xL(t,e){return t[0]*e[1]-t[1]*e[0]}s(xL,"perp");function wP(t,e,r,i){let n=t[0]-r[0],o=t[1]-r[1],a=e[0]-r[0],l=e[1]-r[1],c=i[0]-r[0],u=i[1]-r[1],p=n*u-c*o,f=a*u-c*l;return p>0&&f<0||p<0&&f>0}s(wP,"twoSided");function Gf(t,e,r){let i=[];for(let n=0;n<t.length;n++){let o=[];for(let a=0;a<t[n].length;a++){let l=uL(t[n][a],r);da(e,l),o.push(l)}i.push(o)}return i}s(Gf,"getTilePolygon");function WP(t,e,r){let i=[];for(let n=0;n<t.length;n++){let o=Gf(t[n],e,r);i.push(o)}return i}s(WP,"getTilePolygons");function YP(t,e,r,i){if(t[0]<r[0]||t[0]>r[2]){let n=i*.5,o=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;o===0&&(o=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=o}da(e,t)}s(YP,"updatePoint");function _L(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}s(_L,"resetBBox");function SP(t,e,r,i){let n=Math.pow(2,i.z)*gr,o=[i.x*gr,i.y*gr],a=[];for(let l of t)for(let c of l){let u=[c.x+o[0],c.y+o[1]];YP(u,e,r,n),a.push(u)}return a}s(SP,"getTilePoints");function TP(t,e,r,i){let n=Math.pow(2,i.z)*gr,o=[i.x*gr,i.y*gr],a=[];for(let l of t){let c=[];for(let u of l){let p=[u.x+o[0],u.y+o[1]];da(e,p),c.push(p)}a.push(c)}if(e[2]-e[0]<=n/2){_L(e);for(let l of a)for(let c of l)YP(c,e,r,n)}return a}s(TP,"getTileLines");function vL(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type==="Polygon"){let o=Gf(e.coordinates,i,n),a=SP(t.geometry(),r,i,n);if(!oa(r,i))return!1;for(let l of a)if(!Gi(l,o))return!1}if(e.type==="MultiPolygon"){let o=WP(e.coordinates,i,n),a=SP(t.geometry(),r,i,n);if(!oa(r,i))return!1;for(let l of a)if(!gL(l,o))return!1}return!0}s(vL,"pointsWithinPolygons");function PL(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type==="Polygon"){let o=Gf(e.coordinates,i,n),a=TP(t.geometry(),r,i,n);if(!oa(r,i))return!1;for(let l of a)if(!qP(l,o))return!1}if(e.type==="MultiPolygon"){let o=WP(e.coordinates,i,n),a=TP(t.geometry(),r,i,n);if(!oa(r,i))return!1;for(let l of a)if(!bL(l,o))return!1}return!0}s(PL,"linesWithinPolygons");var Li=class Li{constructor(e,r){this.type=oe,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error("'within' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(ia(e[1])){let i=e[1];if(i.type==="FeatureCollection"){let n=[];for(let o of i.features){let{type:a,coordinates:l}=o.geometry;a==="Polygon"&&n.push(l),a==="MultiPolygon"&&n.push(...l)}if(n.length){let o={type:"MultiPolygon",coordinates:n};return new Li(i,o)}}else if(i.type==="Feature"){let n=i.geometry.type;if(n==="Polygon"||n==="MultiPolygon")return new Li(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new Li(i,i)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return vL(e,this.geometries);if(e.geometryType()==="LineString")return PL(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}};s(Li,"Within");var aa=Li,oh=class oh{constructor(e=[],r=(i,n)=>i<n?-1:i>n?1:0){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:i}=this,n=r[e];for(;e>0;){let o=e-1>>1,a=r[o];if(i(n,a)>=0)break;r[e]=a,e=o}r[e]=n}_down(e){let{data:r,compare:i}=this,n=this.length>>1,o=r[e];for(;e<n;){let a=(e<<1)+1,l=a+1;if(l<this.length&&i(r[l],r[a])<0&&(a=l),i(r[a],o)>=0)break;r[e]=r[a],e=a}r[e]=o}};s(oh,"TinyQueue");var mu=oh;function JP(t,e,r=0,i=t.length-1,n=wL){for(;i>r;){if(i-r>600){let c=i-r+1,u=e-r+1,p=Math.log(c),f=.5*Math.exp(2*p/3),h=.5*Math.sqrt(p*f*(c-f)/c)*(u-c/2<0?-1:1),y=Math.max(r,Math.floor(e-u*f/c+h)),g=Math.min(i,Math.floor(e+(c-u)*f/c+h));JP(t,e,y,g,n)}let o=t[e],a=r,l=i;for(Ho(t,r,e),n(t[i],o)>0&&Ho(t,r,i);a<l;){for(Ho(t,a,l),a++,l--;n(t[a],o)<0;)a++;for(;n(t[l],o)>0;)l--}n(t[r],o)===0?Ho(t,r,l):(l++,Ho(t,l,i)),l<=e&&(r=l+1),e<=l&&(i=l-1)}}s(JP,"quickselect");function Ho(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}s(Ho,"swap");function wL(t,e){return t<e?-1:t>e?1:0}s(wL,"defaultCompare");function ya(t,e){if(t.length<=1)return[t];let i=[],n,o;for(let a of t){let l=TL(a);l!==0&&(a.area=Math.abs(l),o===void 0&&(o=l<0),o===l<0?(n&&i.push(n),n=[a]):n.push(a))}if(n&&i.push(n),e>1)for(let a=0;a<i.length;a++)i[a].length<=e||(JP(i[a],e,1,i[a].length-1,SL),i[a]=i[a].slice(0,e));return i}s(ya,"classifyRings");function SL(t,e){return e.area-t.area}s(SL,"compareAreas");function TL(t){let e=0;for(let r=0,i=t.length,n=i-1,o,a;r<i;n=r++)o=t[r],a=t[n],e+=(a.x-o.x)*(o.y+a.y);return e}s(TL,"calculateSignedArea");var IL=6378.137,IP=1/298.257223563,CP=IP*(2-IP),MP=Math.PI/180,ah=class ah{constructor(e){let r=MP*IL*1e3,i=Math.cos(e*MP),n=1/(1-CP*(1-i*i)),o=Math.sqrt(n);this.kx=r*o*i,this.ky=r*o*n*(1-CP)}distance(e,r){let i=this.wrap(e[0]-r[0])*this.kx,n=(e[1]-r[1])*this.ky;return Math.sqrt(i*i+n*n)}pointOnLine(e,r){let i=1/0,n,o,a,l;for(let c=0;c<e.length-1;c++){let u=e[c][0],p=e[c][1],f=this.wrap(e[c+1][0]-u)*this.kx,h=(e[c+1][1]-p)*this.ky,y=0;(f!==0||h!==0)&&(y=(this.wrap(r[0]-u)*this.kx*f+(r[1]-p)*this.ky*h)/(f*f+h*h),y>1?(u=e[c+1][0],p=e[c+1][1]):y>0&&(u+=f/this.kx*y,p+=h/this.ky*y)),f=this.wrap(r[0]-u)*this.kx,h=(r[1]-p)*this.ky;let g=f*f+h*h;g<i&&(i=g,n=u,o=p,a=c,l=y)}return{point:[n,o],index:a,t:Math.max(0,Math.min(1,l))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};s(ah,"CheapRuler");var sa=ah,Of=100,Rf=50;function KP(t,e){return e[0]-t[0]}s(KP,"compareDistPair");function fu(t){return t[1]-t[0]+1}s(fu,"getRangeSize");function Rr(t,e){return t[1]>=t[0]&&t[1]<e}s(Rr,"isRangeSafe");function Ff(t,e){if(t[0]>t[1])return[null,null];let r=fu(t);if(e){if(r===2)return[t,null];let n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(r===1)return[t,null];let i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}s(Ff,"splitRange");function Bf(t,e){if(!Rr(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)da(r,t[i]);return r}s(Bf,"getBBox");function Uf(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let i of r)da(e,i);return e}s(Uf,"getPolygonBBox");function AP(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}s(AP,"isValidBBox");function Zf(t,e,r){if(!AP(t)||!AP(e))return NaN;let i=0,n=0;return t[2]<e[0]&&(i=e[0]-t[2]),t[0]>e[2]&&(i=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]<e[1]&&(n=e[1]-t[3]),r.distance([0,0],[i,n])}s(Zf,"bboxToBBoxDistance");function On(t,e,r){let i=r.pointOnLine(e,t);return r.distance(t,i.point)}s(On,"pointToLineDistance");function Xf(t,e,r,i,n){let o=Math.min(On(t,[r,i],n),On(e,[r,i],n)),a=Math.min(On(r,[t,e],n),On(i,[t,e],n));return Math.min(o,a)}s(Xf,"segmentToSegmentDistance");function CL(t,e,r,i,n){if(!(Rr(e,t.length)&&Rr(i,r.length)))return 1/0;let a=1/0;for(let l=e[0];l<e[1];++l){let c=t[l],u=t[l+1];for(let p=i[0];p<i[1];++p){let f=r[p],h=r[p+1];if(Hu(c,u,f,h))return 0;a=Math.min(a,Xf(c,u,f,h,n))}}return a}s(CL,"lineToLineDistance");function ML(t,e,r,i,n){if(!(Rr(e,t.length)&&Rr(i,r.length)))return NaN;let a=1/0;for(let l=e[0];l<=e[1];++l)for(let c=i[0];c<=i[1];++c)if(a=Math.min(a,n.distance(t[l],r[c])),a===0)return a;return a}s(ML,"pointsToPointsDistance");function AL(t,e,r){if(Gi(t,e,!0))return 0;let i=1/0;for(let n of e){let o=n[0],a=n[n.length-1];if(o!==a&&(i=Math.min(i,On(t,[a,o],r)),i===0))return i;let l=r.pointOnLine(n,t);if(i=Math.min(i,r.distance(t,l.point)),i===0)return i}return i}s(AL,"pointToPolygonDistance");function EL(t,e,r,i){if(!Rr(e,t.length))return NaN;for(let o=e[0];o<=e[1];++o)if(Gi(t[o],r,!0))return 0;let n=1/0;for(let o=e[0];o<e[1];++o){let a=t[o],l=t[o+1];for(let c of r)for(let u=0,p=c.length,f=p-1;u<p;f=u++){let h=c[f],y=c[u];if(Hu(a,l,h,y))return 0;n=Math.min(n,Xf(a,l,h,y,i))}}return n}s(EL,"lineToPolygonDistance");function EP(t,e){for(let r of t)for(let i of r)if(Gi(i,e,!0))return!0;return!1}s(EP,"polygonIntersect");function kL(t,e,r,i=1/0){let n=Uf(t),o=Uf(e);if(i!==1/0&&Zf(n,o,r)>=i)return i;if(oa(n,o)){if(EP(t,e))return 0}else if(EP(e,t))return 0;let a=1/0;for(let l of t)for(let c=0,u=l.length,p=u-1;c<u;p=c++){let f=l[p],h=l[c];for(let y of e)for(let g=0,x=y.length,_=x-1;g<x;_=g++){let P=y[_],I=y[g];if(Hu(f,h,P,I))return 0;a=Math.min(a,Xf(f,h,P,I,r))}}return a}s(kL,"polygonToPolygonDistance");function kP(t,e,r,i,n,o){if(!o)return;let a=Zf(Bf(i,o),n,r);a<e&&t.push([a,o,[0,0]])}s(kP,"updateQueue");function ru(t,e,r,i,n,o,a){if(!o||!a)return;let l=Zf(Bf(i,o),Bf(n,a),r);l<e&&t.push([l,o,a])}s(ru,"updateQueueTwoSets");function hu(t,e,r,i,n=1/0){let o=Math.min(i.distance(t[0],r[0][0]),n);if(o===0)return o;let a=new mu([[0,[0,t.length-1],[0,0]]],KP),l=Uf(r);for(;a.length>0;){let c=a.pop();if(c[0]>=o)continue;let u=c[1],p=e?Rf:Of;if(fu(u)<=p){if(!Rr(u,t.length))return NaN;if(e){let f=EL(t,u,r,i);if(isNaN(f)||f===0)return f;o=Math.min(o,f)}else for(let f=u[0];f<=u[1];++f){let h=AL(t[f],r,i);if(o=Math.min(o,h),o===0)return 0}}else{let f=Ff(u,e);kP(a,o,i,t,l,f[0]),kP(a,o,i,t,l,f[1])}}return o}s(hu,"pointsToPolygonDistance");function du(t,e,r,i,n,o=1/0){let a=Math.min(o,n.distance(t[0],r[0]));if(a===0)return a;let l=new mu([[0,[0,t.length-1],[0,r.length-1]]],KP);for(;l.length>0;){let c=l.pop();if(c[0]>=a)continue;let u=c[1],p=c[2],f=e?Rf:Of,h=i?Rf:Of;if(fu(u)<=f&&fu(p)<=h){if(!Rr(u,t.length)&&Rr(p,r.length))return NaN;let y;if(e&&i)y=CL(t,u,r,p,n),a=Math.min(a,y);else if(e&&!i){let g=t.slice(u[0],u[1]+1);for(let x=p[0];x<=p[1];++x)if(y=On(r[x],g,n),a=Math.min(a,y),a===0)return a}else if(!e&&i){let g=r.slice(p[0],p[1]+1);for(let x=u[0];x<=u[1];++x)if(y=On(t[x],g,n),a=Math.min(a,y),a===0)return a}else y=ML(t,u,r,p,n),a=Math.min(a,y)}else{let y=Ff(u,e),g=Ff(p,i);ru(l,a,n,t,r,y[0],g[0]),ru(l,a,n,t,r,y[0],g[1]),ru(l,a,n,t,r,y[1],g[0]),ru(l,a,n,t,r,y[1],g[1])}}return a}s(du,"pointSetToPointSetDistance");function LL(t,e){let r=t.geometry(),i=r.flat().map(a=>jf([a.x,a.y],t.canonical));if(r.length===0)return NaN;let n=new sa(i[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,du(i,!1,[a.coordinates],!1,n,o));break;case"LineString":o=Math.min(o,du(i,!1,a.coordinates,!0,n,o));break;case"Polygon":o=Math.min(o,hu(i,!1,a.coordinates,n,o));break}if(o===0)return o}return o}s(LL,"pointToGeometryDistance");function DL(t,e){let r=t.geometry(),i=r.flat().map(a=>jf([a.x,a.y],t.canonical));if(r.length===0)return NaN;let n=new sa(i[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,du(i,!0,[a.coordinates],!1,n,o));break;case"LineString":o=Math.min(o,du(i,!0,a.coordinates,!0,n,o));break;case"Polygon":o=Math.min(o,hu(i,!0,a.coordinates,n,o));break}if(o===0)return o}return o}s(DL,"lineStringToGeometryDistance");function zL(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let i=ya(r,0).map(a=>a.map(l=>l.map(c=>jf([c.x,c.y],t.canonical)))),n=new sa(i[0][0][0][1]),o=1/0;for(let a of e)for(let l of i){switch(a.type){case"Point":o=Math.min(o,hu([a.coordinates],!1,l,n,o));break;case"LineString":o=Math.min(o,hu(a.coordinates,!0,l,n,o));break;case"Polygon":o=Math.min(o,kL(l,a.coordinates,n,o));break}if(o===0)return o}return o}s(zL,"polygonToGeometryDistance");function vf(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}s(vf,"toSimpleGeometry");var Di=class Di{constructor(e,r){this.type=V,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error("'distance' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(ia(e[1])){let i=e[1];if(i.type==="FeatureCollection")return new Di(i,i.features.map(n=>vf(n.geometry)).flat());if(i.type==="Feature")return new Di(i,vf(i.geometry));if("type"in i&&"coordinates"in i)return new Di(i,vf(i))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return LL(e,this.geometries);if(e.geometryType()==="LineString")return DL(e,this.geometries);if(e.geometryType()==="Polygon")return zL(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}};s(Di,"Distance");var la=Di,Fu=class Fu{constructor(e){this.type=ie,this.key=e}static parse(e,r){if(e.length!==2)return r.error("Expected 1 argument, but found ".concat(e.length-1," instead."));let i=e[1];return i==null?r.error("Global state property must be defined."):typeof i!="string"?r.error("Global state property must be string, but found ".concat(typeof e[1]," instead.")):new Fu(i)}evaluate(e){var r;let i=(r=e.globals)===null||r===void 0?void 0:r.globalState;return!i||Object.keys(i).length===0?null:qo(i,this.key)}eachChild(){}outputDefined(){return!1}};s(Fu,"GlobalState");var ua=Fu,Nn={"==":nL,"!=":iL,">":aL,"<":oL,">=":lL,"<=":sL,array:Qt,at:Tf,boolean:Qt,case:Af,coalesce:cu,collator:pu,format:Lf,image:Df,in:If,"index-of":Cf,interpolate:er,"interpolate-hcl":er,"interpolate-lab":er,length:zf,let:su,literal:Fi,match:Mf,number:Qt,"number-format":kf,object:Qt,slice:Ef,step:uu,string:Qt,"to-boolean":on,"to-color":on,"to-number":on,"to-string":on,var:lu,within:aa,distance:la,"global-state":ua},zn=class zn{constructor(e,r,i,n){this.name=e,this.type=r,this._evaluate=i,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let i=e[0],n=zn.definitions[i];if(!n)return r.error('Unknown expression "'.concat(i,'". If you wanted a literal array, use ["literal", [...]].'),0);let o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,l=a.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),c=null;for(let[u,p]of l){c=new au(r.registry,yu,r.path,null,r.scope);let f=[],h=!1;for(let y=1;y<e.length;y++){let g=e[y],x=Array.isArray(u)?u[y-1]:u.type,_=c.parse(g,1+f.length,x);if(!_){h=!0;break}f.push(_)}if(!h){if(Array.isArray(u)&&u.length!==f.length){c.error("Expected ".concat(u.length," arguments, but found ").concat(f.length," instead."));continue}for(let y=0;y<f.length;y++){let g=Array.isArray(u)?u[y]:u.type,x=f[y];c.concat(y+1).checkSubtype(g,x.type)}if(c.errors.length===0)return new zn(i,o,p,f)}}if(l.length===1)r.errors.push(...c.errors);else{let p=(l.length?l:a).map(([h])=>RL(h)).join(" | "),f=[];for(let h=1;h<e.length;h++){let y=r.parse(e[h],1+f.length);if(!y)return null;f.push(ze(y.type))}r.error("Expected arguments of type ".concat(p,", but found (").concat(f.join(", "),") instead."))}return null}static register(e,r){zn.definitions=r;for(let i in r)e[i]=zn}};s(zn,"CompoundExpression");var xr=zn;function LP(t,[e,r,i,n]){e=e.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);let o=n?n.evaluate(t):1,a=XP(e,r,i,o);if(a)throw new Ee(a);return new re(e/255,r/255,i/255,o,!1)}s(LP,"rgba");function DP(t,e){return t in e}s(DP,"has");function Pf(t,e){let r=e[t];return typeof r>"u"?null:r}s(Pf,"get");function OL(t,e,r,i){for(;r<=i;){let n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}s(OL,"binarySearch");function En(t){return{type:t}}s(En,"varargs");xr.register(Nn,{error:[Ck,[ae],(t,[e])=>{throw new Ee(e.evaluate(t))}],typeof:[ae,[ie],(t,[e])=>ze(We(e.evaluate(t)))],"to-rgba":[Lt(V,4),[yr],(t,[e])=>{let[r,i,n,o]=e.evaluate(t).rgb;return[r*255,i*255,n*255,o]}],rgb:[yr,[V,V,V],LP],rgba:[yr,[V,V,V,V],LP],has:{type:oe,overloads:[[[ae],(t,[e])=>DP(e.evaluate(t),t.properties())],[[ae,Rn],(t,[e,r])=>DP(e.evaluate(t),r.evaluate(t))]]},get:{type:ie,overloads:[[[ae],(t,[e])=>Pf(e.evaluate(t),t.properties())],[[ae,Rn],(t,[e,r])=>Pf(e.evaluate(t),r.evaluate(t))]]},"feature-state":[ie,[ae],(t,[e])=>Pf(e.evaluate(t),t.featureState||{})],properties:[Rn,[],t=>t.properties()],"geometry-type":[ae,[],t=>t.geometryType()],id:[ie,[],t=>t.id()],zoom:[V,[],t=>t.globals.zoom],"heatmap-density":[V,[],t=>t.globals.heatmapDensity||0],elevation:[V,[],t=>t.globals.elevation||0],"line-progress":[V,[],t=>t.globals.lineProgress||0],accumulated:[ie,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[V,En(V),(t,e)=>{let r=0;for(let i of e)r+=i.evaluate(t);return r}],"*":[V,En(V),(t,e)=>{let r=1;for(let i of e)r*=i.evaluate(t);return r}],"-":{type:V,overloads:[[[V,V],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[V],(t,[e])=>-e.evaluate(t)]]},"/":[V,[V,V],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[V,[V,V],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[V,[],()=>Math.LN2],pi:[V,[],()=>Math.PI],e:[V,[],()=>Math.E],"^":[V,[V,V],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[V,[V],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[V,[V],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[V,[V],(t,[e])=>Math.log(e.evaluate(t))],log2:[V,[V],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[V,[V],(t,[e])=>Math.sin(e.evaluate(t))],cos:[V,[V],(t,[e])=>Math.cos(e.evaluate(t))],tan:[V,[V],(t,[e])=>Math.tan(e.evaluate(t))],asin:[V,[V],(t,[e])=>Math.asin(e.evaluate(t))],acos:[V,[V],(t,[e])=>Math.acos(e.evaluate(t))],atan:[V,[V],(t,[e])=>Math.atan(e.evaluate(t))],min:[V,En(V),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[V,En(V),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[V,[V],(t,[e])=>Math.abs(e.evaluate(t))],round:[V,[V],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[V,[V],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[V,[V],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[oe,[ae,ie],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[oe,[ie],(t,[e])=>t.id()===e.value],"filter-type-==":[oe,[ae],(t,[e])=>t.geometryType()===e.value],"filter-<":[oe,[ae,ie],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[oe,[ie],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<i}],"filter->":[oe,[ae,ie],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[oe,[ie],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],"filter-<=":[oe,[ae,ie],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[oe,[ie],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],"filter->=":[oe,[ae,ie],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[oe,[ie],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],"filter-has":[oe,[ie],(t,[e])=>e.value in t.properties()],"filter-has-id":[oe,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[oe,[Lt(ae)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[oe,[Lt(ie)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[oe,[ae,Lt(ie)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[oe,[ae,Lt(ie)],(t,[e,r])=>OL(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:oe,overloads:[[[oe,oe],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[En(oe),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:oe,overloads:[[[oe,oe],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[En(oe),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[oe,[oe],(t,[e])=>!e.evaluate(t)],"is-supported-script":[oe,[ae],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return r?r(e.evaluate(t)):!0}],upcase:[ae,[ae],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[ae,[ae],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[ae,En(ie),(t,e)=>e.map(r=>Wo(r.evaluate(t))).join("")],"resolved-locale":[ae,[Nu],(t,[e])=>e.evaluate(t).resolvedLocale()]});function RL(t){return Array.isArray(t)?"(".concat(t.map(ze).join(", "),")"):"(".concat(ze(t.type),"...)")}s(RL,"stringifySignature");function yu(t){if(t instanceof lu)return yu(t.boundExpression);if(t instanceof xr&&t.name==="error")return!1;if(t instanceof pu)return!1;if(t instanceof aa)return!1;if(t instanceof la)return!1;if(t instanceof ua)return!1;let e=t instanceof on||t instanceof Qt,r=!0;return t.eachChild(i=>{e?r=r&&yu(i):r=r&&i instanceof Fi}),r?qu(t)&&Wu(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}s(yu,"isExpressionConstant");function qu(t){if(t instanceof xr){if(t.name==="get"&&t.args.length===1)return!1;if(t.name==="feature-state")return!1;if(t.name==="has"&&t.args.length===1)return!1;if(t.name==="properties"||t.name==="geometry-type"||t.name==="id")return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof aa||t instanceof la)return!1;let e=!0;return t.eachChild(r=>{e&&!qu(r)&&(e=!1)}),e}s(qu,"isFeatureConstant");function ca(t){if(t instanceof xr&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!ca(r)&&(e=!1)}),e}s(ca,"isStateConstant");function Wu(t,e){if(t instanceof xr&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(i=>{r&&!Wu(i,e)&&(r=!1)}),r}s(Wu,"isGlobalPropertyConstant");function Nf(t){return{result:"success",value:t}}s(Nf,"success");function Ai(t){return{result:"error",value:t}}s(Ai,"error");function Bi(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}s(Bi,"supportsPropertyExpression");function QP(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}s(QP,"supportsZoomExpression");function Hf(t){return!!t.expression&&t.expression.interpolated}s(Hf,"supportsInterpolation");function se(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}s(se,"getType");function Yu(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&We(t)===Rn}s(Yu,"isFunction$1");function FL(t){return t}s(FL,"identityFunction");function BL(t){switch(t.type){case"color":return re.parse;case"padding":return Xt.parse;case"numberArray":return Ht.parse;case"colorArray":return dt.parse;default:return null}}s(BL,"getParseFunction");function UL(t){switch(t){case"exponential":return tw;case"interval":return $L;case"categorical":return NL;case"identity":return VL;default:throw new Error('Unknown function type "'.concat(t,'"'))}}s(UL,"getInnerFunction");function ew(t,e){let r=t.stops&&typeof t.stops[0][0]=="object",i=r||t.property!==void 0,n=r||!i,o=t.type||(Hf(e)?"exponential":"interval"),a=BL(e);if(a&&(t=Oi({},t),t.stops&&(t.stops=t.stops.map(p=>[p[0],a(p[1])])),t.default?t.default=a(t.default):t.default=a(e.default)),t.colorSpace&&!Bk(t.colorSpace))throw new Error('Unknown color space: "'.concat(t.colorSpace,'"'));let l=UL(o),c,u;if(o==="categorical"){c=Object.create(null);for(let p of t.stops)c[p[0]]=p[1];u=typeof t.stops[0][0]}if(r){let p={},f=[];for(let g=0;g<t.stops.length;g++){let x=t.stops[g],_=x[0].zoom;p[_]===void 0&&(p[_]={zoom:_,type:t.type,property:t.property,default:t.default,stops:[]},f.push(_)),p[_].stops.push([x[0].value,x[1]])}let h=[];for(let g of f)h.push([p[g].zoom,ew(p[g],e)]);let y={name:"linear"};return{kind:"composite",interpolationType:y,interpolationFactor:er.interpolationFactor.bind(void 0,y),zoomStops:h.map(g=>g[0]),evaluate({zoom:g},x){return tw({stops:h,base:t.base},e,g).evaluate(g,x)}}}else if(n){let p=o==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:p,interpolationFactor:er.interpolationFactor.bind(void 0,p),zoomStops:t.stops.map(f=>f[0]),evaluate:s(({zoom:f})=>l(t,e,f,c,u),"evaluate")}}else return{kind:"source",evaluate(p,f){let h=f&&f.properties?f.properties[t.property]:void 0;return h===void 0?ga(t.default,e.default):l(t,e,h,c,u)}}}s(ew,"createFunction");function ga(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}s(ga,"coalesce$1");function NL(t,e,r,i,n){let o=typeof r===n?i[r]:void 0;return ga(o,t.default,e.default)}s(NL,"evaluateCategoricalFunction");function $L(t,e,r){if(se(r)!=="number")return ga(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let n=Zu(t.stops.map(o=>o[0]),r);return t.stops[n][1]}s($L,"evaluateIntervalFunction");function tw(t,e,r){let i=t.base!==void 0?t.base:1;if(se(r)!=="number")return ga(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let o=Zu(t.stops.map(p=>p[0]),r),a=jL(r,i,t.stops[o][0],t.stops[o+1][0]),l=t.stops[o][1],c=t.stops[o+1][1],u=Xu[e.type]||FL;return typeof l.evaluate=="function"?{evaluate(...p){let f=l.evaluate.apply(void 0,p),h=c.evaluate.apply(void 0,p);if(!(f===void 0||h===void 0))return u(f,h,a,t.colorSpace)}}:u(l,c,a,t.colorSpace)}s(tw,"evaluateExponentialFunction");function VL(t,e,r){switch(e.type){case"color":r=re.parse(r);break;case"formatted":r=tr.fromString(r.toString());break;case"resolvedImage":r=yt.fromString(r.toString());break;case"padding":r=Xt.parse(r);break;case"colorArray":r=dt.parse(r);break;case"numberArray":r=Ht.parse(r);break;default:se(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return ga(r,t.default,e.default)}s(VL,"evaluateIdentityFunction");function jL(t,e,r,i){let n=i-r,o=t-r;return n===0?0:e===1?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}s(jL,"interpolationFactor");var sh=class sh{constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new ou,this._defaultValue=r?ZL(r):null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,i,n,o,a){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=i,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,r,i,n,o,a){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{let l=this.expression.evaluate(this._evaluator);if(l==null||typeof l=="number"&&l!==l)return this._defaultValue;if(this._enumValues&&!(l in this._enumValues))throw new Ee("Expected value to be one of ".concat(Object.keys(this._enumValues).map(c=>JSON.stringify(c)).join(", "),", but found ").concat(JSON.stringify(l)," instead."));return l}catch(l){return this._warningHistory[l.message]||(this._warningHistory[l.message]=!0,typeof console<"u"&&console.warn(l.message)),this._defaultValue}}};s(sh,"StyleExpression");var pa=sh;function qf(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Nn}s(qf,"isExpression");function Wf(t,e){let r=new au(Nn,yu,[],e?GL(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return i?Nf(new pa(i,e)):Ai(r.errors)}s(Wf,"createExpression");var lh=class lh{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!ca(r.expression),this.globalStateRefs=Ju(r.expression)}evaluateWithoutErrorHandling(e,r,i,n,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,r,i,n,o,a)}evaluate(e,r,i,n,o,a){return this._styleExpression.evaluate(e,r,i,n,o,a)}};s(lh,"ZoomConstantExpression");var Ui=lh,uh=class uh{constructor(e,r,i,n){this.kind=e,this.zoomStops=i,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!ca(r.expression),this.globalStateRefs=Ju(r.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,r,i,n,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,r,i,n,o,a)}evaluate(e,r,i,n,o,a){return this._styleExpression.evaluate(e,r,i,n,o,a)}interpolationFactor(e,r,i){return this.interpolationType?er.interpolationFactor(this.interpolationType,e,r,i):0}};s(uh,"ZoomDependentExpression");var Ni=uh;function rw(t,e){let r=Wf(t,e);if(r.result==="error")return r;let i=r.value.expression,n=qu(i);if(!n&&!Bi(e))return Ai([new Gt("","data expressions not supported")]);let o=Wu(i,["zoom"]);if(!o&&!QP(e))return Ai([new Gt("","zoom expressions not supported")]);let a=iu(i);if(!a&&!o)return Ai([new Gt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Gt)return Ai([a]);if(a instanceof er&&!Hf(e))return Ai([new Gt("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Nf(n?new Ui("constant",r.value):new Ui("source",r.value));let l=a instanceof er?a.interpolation:void 0;return Nf(n?new Ni("camera",r.value,a.labels,l):new Ni("composite",r.value,a.labels,l))}s(rw,"createPropertyExpression");var Bu=class Bu{constructor(e,r){this._parameters=e,this._specification=r,Oi(this,ew(this._parameters,this._specification))}static deserialize(e){return new Bu(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}};s(Bu,"StylePropertyFunction");var ma=Bu;function nw(t,e){if(Yu(t))return new ma(t,e);if(qf(t)){let r=rw(t,e);if(r.result==="error")throw new Error(r.value.map(i=>"".concat(i.key,": ").concat(i.message)).join(", "));return r.value}else{let r=t;return e.type==="color"&&typeof t=="string"?r=re.parse(t):e.type==="padding"&&(typeof t=="number"||Array.isArray(t))?r=Xt.parse(t):e.type==="numberArray"&&(typeof t=="number"||Array.isArray(t))?r=Ht.parse(t):e.type==="colorArray"&&(typeof t=="string"||Array.isArray(t))?r=dt.parse(t):e.type==="variableAnchorOffsetCollection"&&Array.isArray(t)?r=br.parse(t):e.type==="projectionDefinition"&&typeof t=="string"&&(r=Or.parse(t)),{globalStateRefs:new Set,kind:"constant",evaluate:s(()=>r,"evaluate")}}}s(nw,"normalizePropertyExpression");function iu(t){let e=null;if(t instanceof su)e=iu(t.result);else if(t instanceof cu){for(let r of t.args)if(e=iu(r),e)break}else(t instanceof uu||t instanceof er)&&t.input instanceof xr&&t.input.name==="zoom"&&(e=t);return e instanceof Gt||t.eachChild(r=>{let i=iu(r);i instanceof Gt?e=i:!e&&i?e=new Gt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Gt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}s(iu,"findZoomCurve");function Ju(t,e=new Set){return t instanceof ua&&e.add(t.key),t.eachChild(r=>{Ju(r,e)}),e}s(Ju,"findGlobalStateRefs");function GL(t){let e={color:yr,string:ae,number:V,enum:ae,boolean:oe,formatted:$u,padding:Vu,numberArray:ju,colorArray:ea,projectionDefinition:Uu,resolvedImage:ha,variableAnchorOffsetCollection:Gu};return t.type==="array"?Lt(e[t.value]||ie,t.length):e[t.type]}s(GL,"getExpectedType");function ZL(t){if(t.type==="color"&&Yu(t.default))return new re(0,0,0,0);switch(t.type){case"color":return re.parse(t.default)||null;case"padding":return Xt.parse(t.default)||null;case"numberArray":return Ht.parse(t.default)||null;case"colorArray":return dt.parse(t.default)||null;case"variableAnchorOffsetCollection":return br.parse(t.default)||null;case"projectionDefinition":return Or.parse(t.default)||null;default:return t.default===void 0?null:t.default}}s(ZL,"getDefaultValue");function Yf(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let e of t.slice(1))if(!Yf(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}s(Yf,"isExpressionFilter");var XL={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ba(t){if(t==null)return{filter:s(()=>!0,"filter"),needGeometry:!1,getGlobalStateRefs:s(()=>new Set,"getGlobalStateRefs")};Yf(t)||(t=gu(t));let e=Wf(t,XL);if(e.result==="error")throw new Error(e.value.map(r=>"".concat(r.key,": ").concat(r.message)).join(", "));{let r=iw(t);return{filter:s((i,n,o)=>e.value.evaluate(i,n,{},o),"filter"),needGeometry:r,getGlobalStateRefs:s(()=>Ju(e.value.expression),"getGlobalStateRefs")}}}s(ba,"featureFilter");function HL(t,e){return t<e?-1:t>e?1:0}s(HL,"compare");function iw(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e<t.length;e++)if(iw(t[e]))return!0;return!1}s(iw,"geometryNeeded");function gu(t){if(!t)return!0;let e=t[0];return t.length<=1?e!=="any":e==="=="?wf(t[1],t[2],"=="):e==="!="?nu(wf(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?wf(t[1],t[2],e):e==="any"?qL(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(gu)):e==="none"?["all"].concat(t.slice(1).map(gu).map(nu)):e==="in"?zP(t[1],t.slice(2)):e==="!in"?nu(zP(t[1],t.slice(2))):e==="has"?OP(t[1]):e==="!has"?nu(OP(t[1])):!0}s(gu,"convertFilter$1");function wf(t,e,r){switch(t){case"$type":return["filter-type-".concat(r),e];case"$id":return["filter-id-".concat(r),e];default:return["filter-".concat(r),t,e]}}s(wf,"convertComparisonOp$1");function qL(t){return["any"].concat(t.map(gu))}s(qL,"convertDisjunctionOp");function zP(t,e){if(e.length===0)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(r=>typeof r!=typeof e[0])?["filter-in-large",t,["literal",e.sort(HL)]]:["filter-in-small",t,["literal",e]]}}s(zP,"convertInOp$1");function OP(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}s(OP,"convertHasOp$1");function nu(t){return["!",t]}s(nu,"convertNegation");function ow(){let t={},e=lt.$version;for(let r in lt.$root){let i=lt.$root[r];if(i.required){let n=null;r==="version"?n=e:i.type==="array"?n=[]:n={},n!=null&&(t[r]=n)}}return t}s(ow,"emptyStyle");function aw(t){let e=t.key,r=t.value;return r?[new z(e,r,"constants have been deprecated as of v8")]:[]}s(aw,"validateConstants");function Ve(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}s(Ve,"unbundle");function Bn(t){if(Array.isArray(t))return t.map(Bn);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=Bn(t[r]);return e}return Ve(t)}s(Bn,"deepUnbundle");function Zt(t){let e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},o=t.style,a=t.styleSpec,l=t.validateSpec,c=[],u=se(r);if(u!=="object")return[new z(e,r,"object expected, ".concat(u," found"))];for(let p in r){let f=p.split(".")[0],h=qo(i,f)||i["*"],y;if(qo(n,f))y=n[f];else if(qo(i,f))y=l;else if(n["*"])y=n["*"];else if(i["*"])y=l;else{c.push(new z(e,r[p],'unknown property "'.concat(p,'"')));continue}c=c.concat(y({key:(e&&"".concat(e,"."))+p,value:r[p],valueSpec:h,style:o,styleSpec:a,object:r,objectKey:p,validateSpec:l},r))}for(let p in i)n[p]||i[p].required&&i[p].default===void 0&&r[p]===void 0&&c.push(new z(e,r,'missing required property "'.concat(p,'"')));return c}s(Zt,"validateObject");function Jf(t){let e=t.value,r=t.valueSpec,i=t.validateSpec,n=t.style,o=t.styleSpec,a=t.key,l=t.arrayElementValidator||i;if(se(e)!=="array")return[new z(a,e,"array expected, ".concat(se(e)," found"))];if(r.length&&e.length!==r.length)return[new z(a,e,"array length ".concat(r.length," expected, length ").concat(e.length," found"))];if(r["min-length"]&&e.length<r["min-length"])return[new z(a,e,"array length at least ".concat(r["min-length"]," expected, length ").concat(e.length," found"))];let c={type:r.value,values:r.values};o.$version<7&&(c.function=r.function),se(r.value)==="object"&&(c=r.value);let u=[];for(let p=0;p<e.length;p++)u=u.concat(l({array:e,arrayIndex:p,value:e[p],valueSpec:c,validateSpec:t.validateSpec,style:n,styleSpec:o,key:"".concat(a,"[").concat(p,"]")}));return u}s(Jf,"validateArray");function Ku(t){let e=t.key,r=t.value,i=t.valueSpec,n=se(r);return n==="number"&&r!==r&&(n="NaN"),n!=="number"?[new z(e,r,"number expected, ".concat(n," found"))]:"minimum"in i&&r<i.minimum?[new z(e,r,"".concat(r," is less than the minimum value ").concat(i.minimum))]:"maximum"in i&&r>i.maximum?[new z(e,r,"".concat(r," is greater than the maximum value ").concat(i.maximum))]:[]}s(Ku,"validateNumber");function sw(t){let e=t.valueSpec,r=Ve(t.value.type),i,n={},o,a,l=r!=="categorical"&&t.value.property===void 0,c=!l,u=se(t.value.stops)==="array"&&se(t.value.stops[0])==="array"&&se(t.value.stops[0][0])==="object",p=Zt({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:f,default:g}});return r==="identity"&&l&&p.push(new z(t.key,t.value,'missing required property "property"')),r!=="identity"&&!t.value.stops&&p.push(new z(t.key,t.value,'missing required property "stops"')),r==="exponential"&&t.valueSpec.expression&&!Hf(t.valueSpec)&&p.push(new z(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(c&&!Bi(t.valueSpec)?p.push(new z(t.key,t.value,"property functions not supported")):l&&!QP(t.valueSpec)&&p.push(new z(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||u)&&t.value.property===void 0&&p.push(new z(t.key,t.value,'"property" property is required')),p;function f(x){if(r==="identity")return[new z(x.key,x.value,'identity function may not have a "stops" property')];let _=[],P=x.value;return _=_.concat(Jf({key:x.key,value:P,valueSpec:x.valueSpec,validateSpec:x.validateSpec,style:x.style,styleSpec:x.styleSpec,arrayElementValidator:h})),se(P)==="array"&&P.length===0&&_.push(new z(x.key,P,"array must have at least one stop")),_}s(f,"validateFunctionStops");function h(x){let _=[],P=x.value,I=x.key;if(se(P)!=="array")return[new z(I,P,"array expected, ".concat(se(P)," found"))];if(P.length!==2)return[new z(I,P,"array length 2 expected, length ".concat(P.length," found"))];if(u){if(se(P[0])!=="object")return[new z(I,P,"object expected, ".concat(se(P[0])," found"))];if(P[0].zoom===void 0)return[new z(I,P,"object stop key must have zoom")];if(P[0].value===void 0)return[new z(I,P,"object stop key must have value")];if(a&&a>Ve(P[0].zoom))return[new z(I,P[0].zoom,"stop zoom values must appear in ascending order")];Ve(P[0].zoom)!==a&&(a=Ve(P[0].zoom),o=void 0,n={}),_=_.concat(Zt({key:"".concat(I,"[0]"),value:P[0],valueSpec:{zoom:{}},validateSpec:x.validateSpec,style:x.style,styleSpec:x.styleSpec,objectElementValidators:{zoom:Ku,value:y}}))}else _=_.concat(y({key:"".concat(I,"[0]"),value:P[0],validateSpec:x.validateSpec,style:x.style,styleSpec:x.styleSpec},P));return qf(Bn(P[1]))?_.concat([new z("".concat(I,"[1]"),P[1],"expressions are not allowed in function stops.")]):_.concat(x.validateSpec({key:"".concat(I,"[1]"),value:P[1],valueSpec:e,validateSpec:x.validateSpec,style:x.style,styleSpec:x.styleSpec}))}s(h,"validateFunctionStop");function y(x,_){let P=se(x.value),I=Ve(x.value),v=x.value!==null?x.value:_;if(!i)i=P;else if(P!==i)return[new z(x.key,v,"".concat(P," stop domain type must match previous stop domain type ").concat(i))];if(P!=="number"&&P!=="string"&&P!=="boolean")return[new z(x.key,v,"stop domain value must be a number, string, or boolean")];if(P!=="number"&&r!=="categorical"){let w="number expected, ".concat(P," found");return Bi(e)&&r===void 0&&(w+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new z(x.key,v,w)]}return r==="categorical"&&P==="number"&&(!isFinite(I)||Math.floor(I)!==I)?[new z(x.key,v,"integer expected, found ".concat(I))]:r!=="categorical"&&P==="number"&&o!==void 0&&I<o?[new z(x.key,v,"stop domain values must appear in ascending order")]:(o=I,r==="categorical"&&I in n?[new z(x.key,v,"stop domain values must be unique")]:(n[I]=!0,[]))}s(y,"validateStopDomainValue");function g(x){return x.validateSpec({key:x.key,value:x.value,valueSpec:e,validateSpec:x.validateSpec,style:x.style,styleSpec:x.styleSpec})}s(g,"validateFunctionDefault")}s(sw,"validateFunction");function $i(t){let e=(t.expressionContext==="property"?rw:Wf)(Bn(t.value),t.valueSpec);if(e.result==="error")return e.value.map(i=>new z("".concat(t.key).concat(i.key),t.value,i.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new z(t.key,t.value,'Invalid data expression for "'.concat(t.propertyKey,'". Output values must be contained as literals within the expression.'))];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!ca(r))return[new z(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter"&&!ca(r))return[new z(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!Wu(r,["zoom","feature-state"]))return[new z(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!qu(r))return[new z(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}s($i,"validateExpression");function WL(t){let e=t.value,r=t.key,i=se(e);return i!=="boolean"?[new z(r,e,"boolean expected, ".concat(i," found"))]:[]}s(WL,"validateBoolean");function $f(t){let e=t.key,r=t.value,i=se(r);return i!=="string"?[new z(e,r,"color expected, ".concat(i," found"))]:re.parse(String(r))?[]:[new z(e,r,'color expected, "'.concat(r,'" found'))]}s($f,"validateColor");function fa(t){let e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(Ve(r))===-1&&n.push(new z(e,r,"expected one of [".concat(i.values.join(", "),"], ").concat(JSON.stringify(r)," found"))):Object.keys(i.values).indexOf(Ve(r))===-1&&n.push(new z(e,r,"expected one of [".concat(Object.keys(i.values).join(", "),"], ").concat(JSON.stringify(r)," found"))),n}s(fa,"validateEnum");function Kf(t){return Yf(Bn(t.value))?$i(Oi({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):lw(t)}s(Kf,"validateFilter");function lw(t){let e=t.value,r=t.key;if(se(e)!=="array")return[new z(r,e,"array expected, ".concat(se(e)," found"))];let i=t.styleSpec,n,o=[];if(e.length<1)return[new z(r,e,"filter array must have at least 1 element")];switch(o=o.concat(fa({key:"".concat(r,"[0]"),value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Ve(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Ve(e[1])==="$type"&&o.push(new z(r,e,'"$type" cannot be use with operator "'.concat(e[0],'"')));case"==":case"!=":e.length!==3&&o.push(new z(r,e,'filter array for operator "'.concat(e[0],'" must have 3 elements')));case"in":case"!in":e.length>=2&&(n=se(e[1]),n!=="string"&&o.push(new z("".concat(r,"[1]"),e[1],"string expected, ".concat(n," found"))));for(let a=2;a<e.length;a++)n=se(e[a]),Ve(e[1])==="$type"?o=o.concat(fa({key:"".concat(r,"[").concat(a,"]"),value:e[a],valueSpec:i.geometry_type,style:t.style,styleSpec:t.styleSpec})):n!=="string"&&n!=="number"&&n!=="boolean"&&o.push(new z("".concat(r,"[").concat(a,"]"),e[a],"string, number, or boolean expected, ".concat(n," found")));break;case"any":case"all":case"none":for(let a=1;a<e.length;a++)o=o.concat(lw({key:"".concat(r,"[").concat(a,"]"),value:e[a],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=se(e[1]),e.length!==2?o.push(new z(r,e,'filter array for "'.concat(e[0],'" operator must have 2 elements'))):n!=="string"&&o.push(new z("".concat(r,"[1]"),e[1],"string expected, ".concat(n," found")));break}return o}s(lw,"validateNonExpressionFilter");function uw(t,e){let r=t.key,i=t.validateSpec,n=t.style,o=t.styleSpec,a=t.value,l=t.objectKey,c=o["".concat(e,"_").concat(t.layerType)];if(!c)return[];let u=l.match(/^(.*)-transition$/);if(e==="paint"&&u&&c[u[1]]&&c[u[1]].transition)return i({key:r,value:a,valueSpec:o.transition,style:n,styleSpec:o});let p=t.valueSpec||c[l];if(!p)return[new z(r,a,'unknown property "'.concat(l,'"'))];let f;if(se(a)==="string"&&Bi(p)&&!p.tokens&&(f=/^{([^}]+)}$/.exec(a)))return[new z(r,a,'"'.concat(l,'" does not support interpolation syntax\n')+'Use an identity property function instead: `{ "type": "identity", "property": '.concat(JSON.stringify(f[1])," }`."))];let h=[];return t.layerType==="symbol"&&(l==="text-field"&&n&&!n.glyphs&&h.push(new z(r,a,'use of "text-field" requires a style "glyphs" property')),l==="text-font"&&Yu(Bn(a))&&Ve(a.type)==="identity"&&h.push(new z(r,a,'"text-font" does not support identity functions'))),h.concat(i({key:t.key,value:a,valueSpec:p,style:n,styleSpec:o,expressionContext:"property",propertyType:e,propertyKey:l}))}s(uw,"validateProperty");function cw(t){return uw(t,"paint")}s(cw,"validatePaintProperty");function pw(t){return uw(t,"layout")}s(pw,"validateLayoutProperty");function mw(t){let e=[],r=t.value,i=t.key,n=t.style,o=t.styleSpec;if(se(r)!=="object")return[new z(i,r,"object expected, ".concat(se(r)," found"))];!r.type&&!r.ref&&e.push(new z(i,r,'either "type" or "ref" is required'));let a=Ve(r.type),l=Ve(r.ref);if(r.id){let c=Ve(r.id);for(let u=0;u<t.arrayIndex;u++){let p=n.layers[u];Ve(p.id)===c&&e.push(new z(i,r.id,'duplicate layer id "'.concat(r.id,'", previously used at line ').concat(p.id.__line__)))}}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(u=>{u in r&&e.push(new z(i,r[u],'"'.concat(u,'" is prohibited for ref layers')))});let c;n.layers.forEach(u=>{Ve(u.id)===l&&(c=u)}),c?c.ref?e.push(new z(i,r.ref,"ref cannot reference another ref layer")):a=Ve(c.type):e.push(new z(i,r.ref,'ref layer "'.concat(l,'" not found')))}else if(a!=="background")if(!r.source)e.push(new z(i,r,'missing required property "source"'));else{let c=n.sources&&n.sources[r.source],u=c&&Ve(c.type);c?u==="vector"&&a==="raster"?e.push(new z(i,r.source,'layer "'.concat(r.id,'" requires a raster source'))):u!=="raster-dem"&&a==="hillshade"?e.push(new z(i,r.source,'layer "'.concat(r.id,'" requires a raster-dem source'))):u!=="raster-dem"&&a==="color-relief"?e.push(new z(i,r.source,'layer "'.concat(r.id,'" requires a raster-dem source'))):u==="raster"&&a!=="raster"?e.push(new z(i,r.source,'layer "'.concat(r.id,'" requires a vector source'))):u==="vector"&&!r["source-layer"]?e.push(new z(i,r,'layer "'.concat(r.id,'" must specify a "source-layer"'))):u==="raster-dem"&&a!=="hillshade"&&a!=="color-relief"?e.push(new z(i,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):a==="line"&&r.paint&&r.paint["line-gradient"]&&(u!=="geojson"||!c.lineMetrics)&&e.push(new z(i,r,'layer "'.concat(r.id,'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.'))):e.push(new z(i,r.source,'source "'.concat(r.source,'" not found')))}return e=e.concat(Zt({key:i,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:"".concat(i,".type"),value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter:Kf,layout(c){return Zt({layer:r,key:c.key,value:c.value,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,objectElementValidators:{"*"(u){return pw(Oi({layerType:a},u))}}})},paint(c){return Zt({layer:r,key:c.key,value:c.value,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,objectElementValidators:{"*"(u){return cw(Oi({layerType:a},u))}}})}}})),e}s(mw,"validateLayer");function Un(t){let e=t.value,r=t.key,i=se(e);return i!=="string"?[new z(r,e,"string expected, ".concat(i," found"))]:[]}s(Un,"validateString");function YL(t){var e;let r=(e=t.sourceName)!==null&&e!==void 0?e:"",i=t.value,n=t.styleSpec,o=n.source_raster_dem,a=t.style,l=[],c=se(i);if(i===void 0)return l;if(c!=="object")return l.push(new z("source_raster_dem",i,"object expected, ".concat(c," found"))),l;let p=Ve(i.encoding)==="custom",f=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?'"'.concat(t.value.encoding,'"'):"Default";for(let y in i)!p&&f.includes(y)?l.push(new z(y,i[y],'In "'.concat(r,'": "').concat(y,'" is only valid when "encoding" is set to "custom". ').concat(h," encoding found"))):o[y]?l=l.concat(t.validateSpec({key:y,value:i[y],valueSpec:o[y],validateSpec:t.validateSpec,style:a,styleSpec:n})):l.push(new z(y,i[y],'unknown property "'.concat(y,'"')));return l}s(YL,"validateRasterDEMSource");var RP={promoteId:JL};function fw(t){let e=t.value,r=t.key,i=t.styleSpec,n=t.style,o=t.validateSpec;if(!e.type)return[new z(r,e,'"type" is required')];let a=Ve(e.type),l;switch(a){case"vector":case"raster":return l=Zt({key:r,value:e,valueSpec:i["source_".concat(a.replace("-","_"))],style:t.style,styleSpec:i,objectElementValidators:RP,validateSpec:o}),l;case"raster-dem":return l=YL({sourceName:r,value:e,style:t.style,styleSpec:i,validateSpec:o}),l;case"geojson":if(l=Zt({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:o,objectElementValidators:RP}),e.cluster)for(let c in e.clusterProperties){let[u,p]=e.clusterProperties[c],f=typeof u=="string"?[u,["accumulated"],["get",c]]:u;l.push(...$i({key:"".concat(r,".").concat(c,".map"),value:p,expressionContext:"cluster-map"})),l.push(...$i({key:"".concat(r,".").concat(c,".reduce"),value:f,expressionContext:"cluster-reduce"}))}return l;case"video":return Zt({key:r,value:e,valueSpec:i.source_video,style:n,validateSpec:o,styleSpec:i});case"image":return Zt({key:r,value:e,valueSpec:i.source_image,style:n,validateSpec:o,styleSpec:i});case"canvas":return[new z(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return fa({key:"".concat(r,".type"),value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}s(fw,"validateSource");function JL({key:t,value:e}){if(se(e)==="string")return Un({key:t,value:e});{let r=[];for(let i in e)r.push(...Un({key:"".concat(t,".").concat(i),value:e[i]}));return r}}s(JL,"validatePromoteId");function hw(t){let e=t.value,r=t.styleSpec,i=r.light,n=t.style,o=[],a=se(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new z("light",e,"object expected, ".concat(a," found"))]),o;for(let l in e){let c=l.match(/^(.*)-transition$/);c&&i[c[1]]&&i[c[1]].transition?o=o.concat(t.validateSpec({key:l,value:e[l],valueSpec:r.transition,validateSpec:t.validateSpec,style:n,styleSpec:r})):i[l]?o=o.concat(t.validateSpec({key:l,value:e[l],valueSpec:i[l],validateSpec:t.validateSpec,style:n,styleSpec:r})):o=o.concat([new z(l,e[l],'unknown property "'.concat(l,'"'))])}return o}s(hw,"validateLight");function dw(t){let e=t.value,r=t.styleSpec,i=r.sky,n=t.style,o=se(e);if(e===void 0)return[];if(o!=="object")return[new z("sky",e,"object expected, ".concat(o," found"))];let a=[];for(let l in e)i[l]?a=a.concat(t.validateSpec({key:l,value:e[l],valueSpec:i[l],style:n,styleSpec:r})):a=a.concat([new z(l,e[l],'unknown property "'.concat(l,'"'))]);return a}s(dw,"validateSky");function yw(t){let e=t.value,r=t.styleSpec,i=r.terrain,n=t.style,o=[],a=se(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new z("terrain",e,"object expected, ".concat(a," found"))]),o;for(let l in e)i[l]?o=o.concat(t.validateSpec({key:l,value:e[l],valueSpec:i[l],validateSpec:t.validateSpec,style:n,styleSpec:r})):o=o.concat([new z(l,e[l],'unknown property "'.concat(l,'"'))]);return o}s(yw,"validateTerrain");function KL(t){return Un(t).length===0?[]:$i(t)}s(KL,"validateFormatted");function QL(t){return Un(t).length===0?[]:$i(t)}s(QL,"validateImage");function eD(t){let e=t.key,r=t.value;if(se(r)==="array"){if(r.length<1||r.length>4)return[new z(e,r,"padding requires 1 to 4 values; ".concat(r.length," values found"))];let n={type:"number"},o=[];for(let a=0;a<r.length;a++)o=o.concat(t.validateSpec({key:"".concat(e,"[").concat(a,"]"),value:r[a],validateSpec:t.validateSpec,valueSpec:n}));return o}else return Ku({key:e,value:r,valueSpec:{}})}s(eD,"validatePadding");function tD(t){let e=t.key,r=t.value;if(se(r)==="array"){let n={type:"number"};if(r.length<1)return[new z(e,r,"array length at least 1 expected, length 0 found")];let o=[];for(let a=0;a<r.length;a++)o=o.concat(t.validateSpec({key:"".concat(e,"[").concat(a,"]"),value:r[a],validateSpec:t.validateSpec,valueSpec:n}));return o}else return Ku({key:e,value:r,valueSpec:{}})}s(tD,"validateNumberArray");function rD(t){let e=t.key,r=t.value;if(se(r)==="array"){if(r.length<1)return[new z(e,r,"array length at least 1 expected, length 0 found")];let n=[];for(let o=0;o<r.length;o++)n=n.concat($f({key:"".concat(e,"[").concat(o,"]"),value:r[o]}));return n}else return $f({key:e,value:r})}s(rD,"validateColorArray");function nD(t){let e=t.key,r=t.value,i=se(r),n=t.styleSpec;if(i!=="array"||r.length<1||r.length%2!==0)return[new z(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let o=[];for(let a=0;a<r.length;a+=2)o=o.concat(fa({key:"".concat(e,"[").concat(a,"]"),value:r[a],valueSpec:n.layout_symbol["text-anchor"]})),o=o.concat(Jf({key:"".concat(e,"[").concat(a+1,"]"),value:r[a+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:n}));return o}s(nD,"validateVariableAnchorOffsetCollection");function gw(t){let e=[],r=t.value,i=t.key;if(Array.isArray(r)){let n=[],o=[];for(let a in r){r[a].id&&n.includes(r[a].id)&&e.push(new z(i,r,"all the sprites' ids must be unique, but ".concat(r[a].id," is duplicated"))),n.push(r[a].id),r[a].url&&o.includes(r[a].url)&&e.push(new z(i,r,"all the sprites' URLs must be unique, but ".concat(r[a].url," is duplicated"))),o.push(r[a].url);let l={id:{type:"string",required:!0},url:{type:"string",required:!0}};e=e.concat(Zt({key:"".concat(i,"[").concat(a,"]"),value:r[a],valueSpec:l,validateSpec:t.validateSpec}))}return e}else return Un({key:i,value:r})}s(gw,"validateSprite");function iD(t){let e=t.value,r=t.styleSpec,i=r.projection,n=t.style,o=se(e);if(e===void 0)return[];if(o!=="object")return[new z("projection",e,"object expected, ".concat(o," found"))];let a=[];for(let l in e)i[l]?a=a.concat(t.validateSpec({key:l,value:e[l],valueSpec:i[l],style:n,styleSpec:r})):a=a.concat([new z(l,e[l],'unknown property "'.concat(l,'"'))]);return a}s(iD,"validateProjection");function oD(t){let e=t.key,r=t.value;r=r instanceof String?r.valueOf():r;let i=se(r);return i==="array"&&!sD(r)&&!aD(r)?[new z(e,r,"projection expected, invalid array ".concat(JSON.stringify(r)," found"))]:["array","string"].includes(i)?[]:[new z(e,r,'projection expected, invalid type "'.concat(i,'" found'))]}s(oD,"validateProjectionDefinition");function aD(t){return!!["interpolate","step","literal"].includes(t[0])}s(aD,"isPropertyValueSpecification");function sD(t){return Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"}s(sD,"isProjectionDefinitionValue");function lD(t){return!!t&&t.constructor===Object}s(lD,"isObjectLiteral");function bw(t){return lD(t.value)?[]:[new z(t.key,t.value,"object expected, ".concat(se(t.value)," found"))]}s(bw,"validateState");var FP={"*"(){return[]},array:Jf,boolean:WL,number:Ku,color:$f,constants:aw,enum:fa,filter:Kf,function:sw,layer:mw,object:Zt,source:fw,light:hw,sky:dw,terrain:yw,projection:iD,projectionDefinition:oD,string:Un,formatted:KL,resolvedImage:QL,padding:eD,numberArray:tD,colorArray:rD,variableAnchorOffsetCollection:nD,sprite:gw,state:bw};function bu(t){let e=t.value,r=t.valueSpec,i=t.styleSpec;return t.validateSpec=bu,r.expression&&Yu(Ve(e))?sw(t):r.expression&&qf(Bn(e))?$i(t):r.type&&FP[r.type]?FP[r.type](t):Zt(Oi({},t,{valueSpec:r.type?i[r.type]:r}))}s(bu,"validate");function xw(t){let e=t.value,r=t.key,i=Un(t);return i.length||(e.indexOf("{fontstack}")===-1&&i.push(new z(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&i.push(new z(r,e,'"glyphs" url must include a "{range}" token'))),i}s(xw,"validateGlyphsUrl");function Dt(t,e=lt){let r=[];return r=r.concat(bu({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:bu,objectElementValidators:{glyphs:xw,"*"(){return[]}}})),t.constants&&(r=r.concat(aw({key:"constants",value:t.constants}))),_w(r)}s(Dt,"validateStyleMin");Dt.source=nr(rr(fw));Dt.sprite=nr(rr(gw));Dt.glyphs=nr(rr(xw));Dt.light=nr(rr(hw));Dt.sky=nr(rr(dw));Dt.terrain=nr(rr(yw));Dt.state=nr(rr(bw));Dt.layer=nr(rr(mw));Dt.filter=nr(rr(Kf));Dt.paintProperty=nr(rr(cw));Dt.layoutProperty=nr(rr(pw));function rr(t){return function(e){return t(j(C({},e),{validateSpec:bu}))}}s(rr,"injectValidateSpec");function _w(t){return[].concat(t).sort((e,r)=>e.line-r.line)}s(_w,"sortErrors");function nr(t){return function(...e){return _w(t.apply(this,e))}}s(nr,"wrapCleanErrors");m();var or=Dt,vZ=or.source,uD=or.light,cD=or.sky,PZ=or.terrain,wZ=or.filter,pD=or.paintProperty,mD=or.layoutProperty;m();m();m();var Qu=class Qu{constructor(e,r,i){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let a=new Int32Array(this.arrayBuffer);e=a[0],r=a[1],i=a[2],this.d=r+2*i;for(let u=0;u<this.d*this.d;u++){let p=a[3+u],f=a[3+u+1];n.push(p===f?null:a.subarray(p,f))}let l=a[3+n.length],c=a[3+n.length+1];this.keys=a.subarray(l,c),this.bboxes=a.subarray(c),this.insert=this._insertReadonly}else{this.d=r+2*i;for(let a=0;a<this.d*this.d;a++)n.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=i,this.scale=r/e,this.uid=0;let o=i/r*e;this.min=-o,this.max=e+o}insert(e,r,i,n,o){this._forEachCell(r,i,n,o,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(o)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,r,i,n,o,a){this.cells[o].push(a)}query(e,r,i,n,o){let a=this.min,l=this.max;if(e<=a&&r<=a&&l<=i&&l<=n&&!o)return Array.prototype.slice.call(this.keys);{let c=[],u={};return this._forEachCell(e,r,i,n,this._queryCell,c,u,o),c}}_queryCell(e,r,i,n,o,a,l,c){let u=this.cells[o];if(u!==null){let p=this.keys,f=this.bboxes;for(let h=0;h<u.length;h++){let y=u[h];if(l[y]===void 0){let g=y*4;(c?c(f[g+0],f[g+1],f[g+2],f[g+3]):e<=f[g+2]&&r<=f[g+3]&&i>=f[g+0]&&n>=f[g+1])?(l[y]=!0,a.push(p[y])):l[y]=!1}}}}_forEachCell(e,r,i,n,o,a,l,c){let u=this._convertToCellCoord(e),p=this._convertToCellCoord(r),f=this._convertToCellCoord(i),h=this._convertToCellCoord(n);for(let y=u;y<=f;y++)for(let g=p;g<=h;g++){let x=this.d*g+y;if(!(c&&!c(this._convertFromCellCoord(y),this._convertFromCellCoord(g),this._convertFromCellCoord(y+1),this._convertFromCellCoord(g+1)))&&o.call(this,e,r,i,n,x,a,l,c))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,r=3+this.cells.length+1+1,i=0;for(let a=0;a<this.cells.length;a++)i+=this.cells[a].length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let o=r;for(let a=0;a<e.length;a++){let l=e[a];n[3+a]=o,n.set(l,o),o+=l.length}return n[3+e.length]=o,n.set(this.keys,o),o+=this.keys.length,n[3+e.length+1]=o,n.set(this.bboxes,o),o+=this.bboxes.length,n.buffer}static serialize(e,r){let i=e.toArrayBuffer();return r&&r.push(i),{buffer:i}}static deserialize(e){return new Qu(e.buffer)}};s(Qu,"TransferableGridIndex");var $n=Qu;var Fr={};function B(t,e,r={}){if(Fr[t])throw new Error("".concat(t," is already registered."));Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Fr[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}s(B,"register");B("Object",Object);B("Set",Set);B("TransferableGridIndex",$n);B("Color",re);B("Error",Error);B("AJAXError",en);B("ResolvedImage",yt);B("StylePropertyFunction",ma);B("StyleExpression",pa,{omit:["_evaluator"]});B("ZoomDependentExpression",Ni);B("ZoomConstantExpression",Ui);B("CompoundExpression",xr,{omit:["_evaluate"]});for(let t in Nn)Nn[t]._classRegistryKey||B("Expression_".concat(t),Nn[t]);function vw(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}s(vw,"isArrayBuffer");function ch(t){let e=t.constructor;return t.$name||e._classRegistryKey}s(ch,"getClassRegistryKey");function fD(t){if(t===null||typeof t!="object")return!1;let e=ch(t);return!!(e&&e!=="Object")}s(fD,"isRegistered");function Pw(t){return!fD(t)&&(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||vw(t)||Jt(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}s(Pw,"isSerializeHandledByBuiltin");function Zi(t,e){if(Pw(t)){if((vw(t)||Jt(t))&&e&&e.push(t),ArrayBuffer.isView(t)){let o=t;e&&e.push(o.buffer)}return t instanceof ImageData&&e&&e.push(t.data.buffer),t}if(Array.isArray(t)){let o=[];for(let a of t)o.push(Zi(a,e));return o}if(typeof t!="object")throw new Error("can't serialize object of type ".concat(typeof t));let r=ch(t);if(!r)throw new Error("can't serialize object of unregistered class ".concat(t.constructor.name));if(!Fr[r])throw new Error("".concat(r," is not registered."));let{klass:i}=Fr[r],n=i.serialize?i.serialize(t,e):{};if(i.serialize){if(e&&n===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let o in t){if(!t.hasOwnProperty(o)||Fr[r].omit.indexOf(o)>=0)continue;let a=t[o];n[o]=Fr[r].shallow.indexOf(o)>=0?a:Zi(a,e)}t instanceof Error&&(n.message=t.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(n.$name=r),n}s(Zi,"serialize");function Xi(t){if(Pw(t))return t;if(Array.isArray(t))return t.map(Xi);if(typeof t!="object")throw new Error("can't deserialize object of type ".concat(typeof t));let e=ch(t)||"Object";if(!Fr[e])throw new Error("can't deserialize unregistered class ".concat(e));let{klass:r}=Fr[e];if(!r)throw new Error("can't deserialize unregistered class ".concat(e));if(r.deserialize)return r.deserialize(t);let i=Object.create(r.prototype);for(let n of Object.keys(t)){if(n==="$name")continue;let o=t[n];i[n]=Fr[e].shallow.indexOf(n)>=0?o:Xi(o)}return i}s(Xi,"deserialize");m();m();var ph=class ph{constructor(){this.first=!0}update(e,r){let i=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=r),e!==this.lastZoom?(this.lastZoom=e,this.lastFloorZoom=i,!0):!1)}};s(ph,"ZoomHistory");var Hi=ph;m();m();var Xe={"Latin-1 Supplement":s(t=>t>=128&&t<=255,"Latin-1 Supplement"),"Hangul Jamo":s(t=>t>=4352&&t<=4607,"Hangul Jamo"),Khmer:s(t=>t>=6016&&t<=6143,"Khmer"),"General Punctuation":s(t=>t>=8192&&t<=8303,"General Punctuation"),"Letterlike Symbols":s(t=>t>=8448&&t<=8527,"Letterlike Symbols"),"Number Forms":s(t=>t>=8528&&t<=8591,"Number Forms"),"Miscellaneous Technical":s(t=>t>=8960&&t<=9215,"Miscellaneous Technical"),"Control Pictures":s(t=>t>=9216&&t<=9279,"Control Pictures"),"Optical Character Recognition":s(t=>t>=9280&&t<=9311,"Optical Character Recognition"),"Enclosed Alphanumerics":s(t=>t>=9312&&t<=9471,"Enclosed Alphanumerics"),"Geometric Shapes":s(t=>t>=9632&&t<=9727,"Geometric Shapes"),"Miscellaneous Symbols":s(t=>t>=9728&&t<=9983,"Miscellaneous Symbols"),"Miscellaneous Symbols and Arrows":s(t=>t>=11008&&t<=11263,"Miscellaneous Symbols and Arrows"),"Ideographic Description Characters":s(t=>t>=12272&&t<=12287,"Ideographic Description Characters"),"CJK Symbols and Punctuation":s(t=>t>=12288&&t<=12351,"CJK Symbols and Punctuation"),Hiragana:s(t=>t>=12352&&t<=12447,"Hiragana"),Katakana:s(t=>t>=12448&&t<=12543,"Katakana"),Kanbun:s(t=>t>=12688&&t<=12703,"Kanbun"),"CJK Strokes":s(t=>t>=12736&&t<=12783,"CJK Strokes"),"Enclosed CJK Letters and Months":s(t=>t>=12800&&t<=13055,"Enclosed CJK Letters and Months"),"CJK Compatibility":s(t=>t>=13056&&t<=13311,"CJK Compatibility"),"Yijing Hexagram Symbols":s(t=>t>=19904&&t<=19967,"Yijing Hexagram Symbols"),"CJK Unified Ideographs":s(t=>t>=19968&&t<=40959,"CJK Unified Ideographs"),"Hangul Syllables":s(t=>t>=44032&&t<=55215,"Hangul Syllables"),"Private Use Area":s(t=>t>=57344&&t<=63743,"Private Use Area"),"Vertical Forms":s(t=>t>=65040&&t<=65055,"Vertical Forms"),"CJK Compatibility Forms":s(t=>t>=65072&&t<=65103,"CJK Compatibility Forms"),"Small Form Variants":s(t=>t>=65104&&t<=65135,"Small Form Variants"),"Halfwidth and Fullwidth Forms":s(t=>t>=65280&&t<=65519,"Halfwidth and Fullwidth Forms")};function mh(t){for(let e of t)if(ww(e.charCodeAt(0)))return!0;return!1}s(mh,"allowsVerticalWritingMode");function fh(t){let e=t.map(r=>{try{return new RegExp("\\p{sc=".concat(r,"}"),"u").source}catch(i){return null}}).filter(r=>r);return new RegExp(e.join("|"),"u")}s(fh,"sanitizedRegExpFromScriptCodes");var hD=["Arab","Dupl","Mong","Ougr","Syrc"],GZ=fh(hD);var dD=["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"],yD=fh(dD);function ww(t){return t===746||t===747?!0:t<4352?!1:!!(Xe["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Xe["CJK Compatibility"](t)||Xe["CJK Strokes"](t)||Xe["CJK Symbols and Punctuation"](t)&&!(t>=12296&&t<=12305)&&!(t>=12308&&t<=12319)&&t!==12336||Xe["Enclosed CJK Letters and Months"](t)||Xe["Ideographic Description Characters"](t)||Xe.Kanbun(t)||Xe.Katakana(t)&&t!==12540||Xe["Halfwidth and Fullwidth Forms"](t)&&t!==65288&&t!==65289&&t!==65293&&!(t>=65306&&t<=65310)&&t!==65339&&t!==65341&&t!==65343&&!(t>=65371&&t<=65503)&&t!==65507&&!(t>=65512&&t<=65519)||Xe["Small Form Variants"](t)&&!(t>=65112&&t<=65118)&&!(t>=65123&&t<=65126)||Xe["Vertical Forms"](t)||Xe["Yijing Hexagram Symbols"](t)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(t))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(t))||yD.test(String.fromCodePoint(t)))}s(ww,"charHasUprightVerticalOrientation");var gD=["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"],bD=fh(gD);function Sw(t){return bD.test(String.fromCodePoint(t))}s(Sw,"charInRTLScript");function xD(t,e){return!(!e&&Sw(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Xe.Khmer(t))}s(xD,"charInSupportedScript");function Tw(t){for(let e of t)if(Sw(e.charCodeAt(0)))return!0;return!1}s(Tw,"stringContainsRTLText");function Iw(t,e){for(let r of t)if(!xD(r.charCodeAt(0),e))return!1;return!0}s(Iw,"isStringInSupportedScript");m();var dh=class dh{constructor(){this.TIMEOUT=5e3;this.applyArabicShaping=null;this.processBidirectionalText=null;this.processStyledBidirectionalText=null;this.pluginStatus="unavailable";this.pluginURL=null;this.loadScriptResolve=s(()=>{},"loadScriptResolve")}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(_r.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}async syncState(e,r){if(this.isParsed())return this.getState();if(e.pluginStatus!=="loading")return this.setState(e),e;let i=e.pluginURL,n=new Promise(l=>{this.loadScriptResolve=l});r(i);let o=new Promise(l=>setTimeout(()=>l(),this.TIMEOUT));if(await Promise.race([n,o]),this.isParsed()){let l={pluginStatus:"loaded",pluginURL:i};return this.setState(l),l}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error("RTL Text Plugin failed to import scripts from ".concat(i))}};s(dh,"RTLWorkerPlugin");var hh=dh,_r=new hh;var yh=class yh{constructor(e,r){this.zoom=e,r?(this.now=r.now||0,this.fadeDuration=r.fadeDuration||0,this.zoomHistory=r.zoomHistory||new Hi,this.transition=r.transition||{},this.globalState=r.globalState||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Hi,this.transition={},this.globalState={})}isSupportedScript(e){return Iw(e,_r.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,r=e-Math.floor(e),i=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*r}}};s(yh,"EvaluationParameters");var he=yh;var bh=class bh{constructor(e,r){this.property=e,this.value=r,this.expression=nw(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,r,i){return this.property.possiblyEvaluate(this,e,r,i)}};s(bh,"PropertyValue");var ec=bh,xh=class xh{constructor(e){this.property=e,this.value=new ec(e,void 0)}transitioned(e,r){return new tc(this.property,this.value,r,W({},e.transition,this.transition),e.now)}untransitioned(){return new tc(this.property,this.value,null,{},0)}};s(xh,"TransitionablePropertyValue");var gh=xh;var _h=class _h{constructor(e,r,i,n,o){this.property=e,this.value=r,this.begin=o+n.delay||0,this.end=this.begin+n.duration||0,e.specification.transition&&(n.delay||n.duration)&&(this.prior=i)}possiblyEvaluate(e,r,i){let n=e.now||0,o=this.value.possiblyEvaluate(e,r,i),a=this.prior;if(a){if(n>this.end)return this.prior=null,o;if(this.value.isDataDriven())return this.prior=null,o;if(n<this.begin)return a.possiblyEvaluate(e,r,i);{let l=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,r,i),o,rf(l))}}else return o}};s(_h,"TransitioningPropertyValue");var tc=_h;var vh=class vh{constructor(e,r,i){this.property=e,this.value=r,this.parameters=i}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,i,n){return this.property.evaluate(this.value,this.parameters,e,r,i,n)}};s(vh,"PossiblyEvaluatedPropertyValue");var gt=vh,Ph=class Ph{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}};s(Ph,"PossiblyEvaluated");var xa=Ph,wh=class wh{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,i){let n=this.specification.type,o=Xu[n];return o?o(e,r,i):e}};s(wh,"DataConstantProperty");var Oe=wh,Sh=class Sh{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,i,n){return e.expression.kind==="constant"||e.expression.kind==="camera"?new gt(this,{kind:"constant",value:e.expression.evaluate(r,null,{},i,n)},r):new gt(this,e.expression,r)}interpolate(e,r,i){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new gt(this,{kind:"constant",value:void 0},e.parameters);let n=this.specification.type,o=Xu[n];if(o){let a=o(e.value.value,r.value.value,i);return new gt(this,{kind:"constant",value:a},e.parameters)}else return e}evaluate(e,r,i,n,o,a){return e.kind==="constant"?e.value:e.evaluate(r,i,n,o,a)}};s(Sh,"DataDrivenProperty");var ar=Sh,Th=class Th extends ar{possiblyEvaluate(e,r,i,n){if(e.value===void 0)return new gt(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){let o=e.expression.evaluate(r,null,{},i,n),l=e.property.specification.type==="resolvedImage"&&typeof o!="string"?o.name:o,c=this._calculate(l,l,l,r);return new gt(this,{kind:"constant",value:c},r)}else if(e.expression.kind==="camera"){let o=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new gt(this,{kind:"constant",value:o},r)}else return new gt(this,e.expression,r)}evaluate(e,r,i,n,o,a){if(e.kind==="source"){let l=e.evaluate(r,i,n,o,a);return this._calculate(l,l,l,r)}else return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},i,n),e.evaluate({zoom:Math.floor(r.zoom)},i,n),e.evaluate({zoom:Math.floor(r.zoom)+1},i,n),r):e.value}_calculate(e,r,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:i,to:r}}interpolate(e){return e}};s(Th,"CrossFadedDataDrivenProperty");var qi=Th,Ih=class Ih{constructor(e){this.specification=e}possiblyEvaluate(e,r,i,n){if(e.value!==void 0)if(e.expression.kind==="constant"){let o=e.expression.evaluate(r,null,{},i,n);return this._calculate(o,o,o,r)}else return this._calculate(e.expression.evaluate(new he(Math.floor(r.zoom-1),r)),e.expression.evaluate(new he(Math.floor(r.zoom),r)),e.expression.evaluate(new he(Math.floor(r.zoom+1),r)),r)}_calculate(e,r,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:i,to:r}}interpolate(e){return e}};s(Ih,"CrossFadedProperty");var _a=Ih,Ch=class Ch{constructor(e){this.specification=e}possiblyEvaluate(e,r,i,n){return!!e.expression.evaluate(r,null,{},i,n)}interpolate(){return!1}};s(Ch,"ColorRampProperty");var Wi=Ch,Mh=class Mh{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let r in e){let i=e[r];i.specification.overridable&&this.overridableProperties.push(r);let n=this.defaultPropertyValues[r]=new ec(i,void 0),o=this.defaultTransitionablePropertyValues[r]=new gh(i);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=n.possiblyEvaluate({})}}};s(Mh,"Properties");var ot=Mh;B("DataDrivenProperty",ar);B("DataConstantProperty",Oe);B("CrossFadedDataDrivenProperty",qi);B("CrossFadedProperty",_a);B("ColorRampProperty",Wi);m();m();m();var PD={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},kh=class kh{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}};s(kh,"Struct");var sn=kh,wD=128,SD=5,Lh=class Lh{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*SD),wD),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}};s(Lh,"StructArray");var Ie=Lh;function ge(t,e=1){let r=0,i=0,n=t.map(a=>{let l=TD(a.type),c=r=Cw(r,Math.max(e,l)),u=a.components||1;return i=Math.max(i,l),r+=l*u,{name:a.name,type:a.type,components:u,offset:c}}),o=Cw(r,Math.max(i,e));return{members:n,size:o,alignment:e}}s(ge,"createLayout");function TD(t){return PD[t].BYTES_PER_ELEMENT}s(TD,"sizeOf");function Cw(t,e){return Math.ceil(t/e)*e}s(Cw,"align");var Mw=J(te(),1);var Dh=class Dh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,r)}emplace(e,r,i){let n=e*2;return this.int16[n+0]=r,this.int16[n+1]=i,e}};s(Dh,"StructArrayLayout2i4");var Vn=Dh;Vn.prototype.bytesPerElement=4;B("StructArrayLayout2i4",Vn);var zh=class zh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,r,i)}emplace(e,r,i,n){let o=e*3;return this.int16[o+0]=r,this.int16[o+1]=i,this.int16[o+2]=n,e}};s(zh,"StructArrayLayout3i6");var va=zh;va.prototype.bytesPerElement=6;B("StructArrayLayout3i6",va);var Oh=class Oh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i,n){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,i,n)}emplace(e,r,i,n,o){let a=e*4;return this.int16[a+0]=r,this.int16[a+1]=i,this.int16[a+2]=n,this.int16[a+3]=o,e}};s(Oh,"StructArrayLayout4i8");var rc=Oh;rc.prototype.bytesPerElement=8;B("StructArrayLayout4i8",rc);var Rh=class Rh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a){let l=this.length;return this.resize(l+1),this.emplace(l,e,r,i,n,o,a)}emplace(e,r,i,n,o,a,l){let c=e*6;return this.int16[c+0]=r,this.int16[c+1]=i,this.int16[c+2]=n,this.int16[c+3]=o,this.int16[c+4]=a,this.int16[c+5]=l,e}};s(Rh,"StructArrayLayout2i4i12");var Pa=Rh;Pa.prototype.bytesPerElement=12;B("StructArrayLayout2i4i12",Pa);var Fh=class Fh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a){let l=this.length;return this.resize(l+1),this.emplace(l,e,r,i,n,o,a)}emplace(e,r,i,n,o,a,l){let c=e*4,u=e*8;return this.int16[c+0]=r,this.int16[c+1]=i,this.uint8[u+4]=n,this.uint8[u+5]=o,this.uint8[u+6]=a,this.uint8[u+7]=l,e}};s(Fh,"StructArrayLayout2i4ub8");var wa=Fh;wa.prototype.bytesPerElement=8;B("StructArrayLayout2i4ub8",wa);var Bh=class Bh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,r)}emplace(e,r,i){let n=e*2;return this.float32[n+0]=r,this.float32[n+1]=i,e}};s(Bh,"StructArrayLayout2f8");var ln=Bh;ln.prototype.bytesPerElement=8;B("StructArrayLayout2f8",ln);var Uh=class Uh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a,l,c,u,p){let f=this.length;return this.resize(f+1),this.emplace(f,e,r,i,n,o,a,l,c,u,p)}emplace(e,r,i,n,o,a,l,c,u,p,f){let h=e*10;return this.uint16[h+0]=r,this.uint16[h+1]=i,this.uint16[h+2]=n,this.uint16[h+3]=o,this.uint16[h+4]=a,this.uint16[h+5]=l,this.uint16[h+6]=c,this.uint16[h+7]=u,this.uint16[h+8]=p,this.uint16[h+9]=f,e}};s(Uh,"StructArrayLayout10ui20");var Sa=Uh;Sa.prototype.bytesPerElement=20;B("StructArrayLayout10ui20",Sa);var Nh=class Nh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a,l,c,u,p,f,h){let y=this.length;return this.resize(y+1),this.emplace(y,e,r,i,n,o,a,l,c,u,p,f,h)}emplace(e,r,i,n,o,a,l,c,u,p,f,h,y){let g=e*12;return this.int16[g+0]=r,this.int16[g+1]=i,this.int16[g+2]=n,this.int16[g+3]=o,this.uint16[g+4]=a,this.uint16[g+5]=l,this.uint16[g+6]=c,this.uint16[g+7]=u,this.int16[g+8]=p,this.int16[g+9]=f,this.int16[g+10]=h,this.int16[g+11]=y,e}};s(Nh,"StructArrayLayout4i4ui4i24");var Ta=Nh;Ta.prototype.bytesPerElement=24;B("StructArrayLayout4i4ui4i24",Ta);var $h=class $h extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,r,i)}emplace(e,r,i,n){let o=e*3;return this.float32[o+0]=r,this.float32[o+1]=i,this.float32[o+2]=n,e}};s($h,"StructArrayLayout3f12");var Ia=$h;Ia.prototype.bytesPerElement=12;B("StructArrayLayout3f12",Ia);var Vh=class Vh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let i=e*1;return this.uint32[i+0]=r,e}};s(Vh,"StructArrayLayout1ul4");var Ca=Vh;Ca.prototype.bytesPerElement=4;B("StructArrayLayout1ul4",Ca);var jh=class jh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a,l,c,u){let p=this.length;return this.resize(p+1),this.emplace(p,e,r,i,n,o,a,l,c,u)}emplace(e,r,i,n,o,a,l,c,u,p){let f=e*10,h=e*5;return this.int16[f+0]=r,this.int16[f+1]=i,this.int16[f+2]=n,this.int16[f+3]=o,this.int16[f+4]=a,this.int16[f+5]=l,this.uint32[h+3]=c,this.uint16[f+8]=u,this.uint16[f+9]=p,e}};s(jh,"StructArrayLayout6i1ul2ui20");var Ma=jh;Ma.prototype.bytesPerElement=20;B("StructArrayLayout6i1ul2ui20",Ma);var Gh=class Gh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a){let l=this.length;return this.resize(l+1),this.emplace(l,e,r,i,n,o,a)}emplace(e,r,i,n,o,a,l){let c=e*6;return this.int16[c+0]=r,this.int16[c+1]=i,this.int16[c+2]=n,this.int16[c+3]=o,this.int16[c+4]=a,this.int16[c+5]=l,e}};s(Gh,"StructArrayLayout2i2i2i12");var Aa=Gh;Aa.prototype.bytesPerElement=12;B("StructArrayLayout2i2i2i12",Aa);var Zh=class Zh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,i,n,o)}emplace(e,r,i,n,o,a){let l=e*4,c=e*8;return this.float32[l+0]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[c+6]=o,this.int16[c+7]=a,e}};s(Zh,"StructArrayLayout2f1f2i16");var nc=Zh;nc.prototype.bytesPerElement=16;B("StructArrayLayout2f1f2i16",nc);var Xh=class Xh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,i,n,o,a){let l=this.length;return this.resize(l+1),this.emplace(l,e,r,i,n,o,a)}emplace(e,r,i,n,o,a,l){let c=e*16,u=e*4,p=e*8;return this.uint8[c+0]=r,this.uint8[c+1]=i,this.float32[u+1]=n,this.float32[u+2]=o,this.int16[p+6]=a,this.int16[p+7]=l,e}};s(Xh,"StructArrayLayout2ub2f2i16");var Ea=Xh;Ea.prototype.bytesPerElement=16;B("StructArrayLayout2ub2f2i16",Ea);var Hh=class Hh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,r,i)}emplace(e,r,i,n){let o=e*3;return this.uint16[o+0]=r,this.uint16[o+1]=i,this.uint16[o+2]=n,e}};s(Hh,"StructArrayLayout3ui6");var ka=Hh;ka.prototype.bytesPerElement=6;B("StructArrayLayout3ui6",ka);var qh=class qh extends Ie{_refreshViews(){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)}emplaceBack(e,r,i,n,o,a,l,c,u,p,f,h,y,g,x,_,P){let I=this.length;return this.resize(I+1),this.emplace(I,e,r,i,n,o,a,l,c,u,p,f,h,y,g,x,_,P)}emplace(e,r,i,n,o,a,l,c,u,p,f,h,y,g,x,_,P,I){let v=e*24,w=e*12,T=e*48;return this.int16[v+0]=r,this.int16[v+1]=i,this.uint16[v+2]=n,this.uint16[v+3]=o,this.uint32[w+2]=a,this.uint32[w+3]=l,this.uint32[w+4]=c,this.uint16[v+10]=u,this.uint16[v+11]=p,this.uint16[v+12]=f,this.float32[w+7]=h,this.float32[w+8]=y,this.uint8[T+36]=g,this.uint8[T+37]=x,this.uint8[T+38]=_,this.uint32[w+10]=P,this.int16[v+22]=I,e}};s(qh,"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48");var La=qh;La.prototype.bytesPerElement=48;B("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",La);var Wh=class Wh extends Ie{_refreshViews(){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)}emplaceBack(e,r,i,n,o,a,l,c,u,p,f,h,y,g,x,_,P,I,v,w,T,A,k,L,R,Z,q,X){let G=this.length;return this.resize(G+1),this.emplace(G,e,r,i,n,o,a,l,c,u,p,f,h,y,g,x,_,P,I,v,w,T,A,k,L,R,Z,q,X)}emplace(e,r,i,n,o,a,l,c,u,p,f,h,y,g,x,_,P,I,v,w,T,A,k,L,R,Z,q,X,G){let F=e*32,K=e*16;return this.int16[F+0]=r,this.int16[F+1]=i,this.int16[F+2]=n,this.int16[F+3]=o,this.int16[F+4]=a,this.int16[F+5]=l,this.int16[F+6]=c,this.int16[F+7]=u,this.uint16[F+8]=p,this.uint16[F+9]=f,this.uint16[F+10]=h,this.uint16[F+11]=y,this.uint16[F+12]=g,this.uint16[F+13]=x,this.uint16[F+14]=_,this.uint16[F+15]=P,this.uint16[F+16]=I,this.uint16[F+17]=v,this.uint16[F+18]=w,this.uint16[F+19]=T,this.uint16[F+20]=A,this.uint16[F+21]=k,this.uint16[F+22]=L,this.uint32[K+12]=R,this.float32[K+13]=Z,this.float32[K+14]=q,this.uint16[F+30]=X,this.uint16[F+31]=G,e}};s(Wh,"StructArrayLayout8i15ui1ul2f2ui64");var Da=Wh;Da.prototype.bytesPerElement=64;B("StructArrayLayout8i15ui1ul2f2ui64",Da);var Yh=class Yh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let i=e*1;return this.float32[i+0]=r,e}};s(Yh,"StructArrayLayout1f4");var jn=Yh;jn.prototype.bytesPerElement=4;B("StructArrayLayout1f4",jn);var Jh=class Jh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,r,i)}emplace(e,r,i,n){let o=e*6,a=e*3;return this.uint16[o+0]=r,this.float32[a+1]=i,this.float32[a+2]=n,e}};s(Jh,"StructArrayLayout1ui2f12");var za=Jh;za.prototype.bytesPerElement=12;B("StructArrayLayout1ui2f12",za);var Kh=class Kh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,r,i)}emplace(e,r,i,n){let o=e*2,a=e*4;return this.uint32[o+0]=r,this.uint16[a+2]=i,this.uint16[a+3]=n,e}};s(Kh,"StructArrayLayout1ul2ui8");var Oa=Kh;Oa.prototype.bytesPerElement=8;B("StructArrayLayout1ul2ui8",Oa);var Qh=class Qh extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,r)}emplace(e,r,i){let n=e*2;return this.uint16[n+0]=r,this.uint16[n+1]=i,e}};s(Qh,"StructArrayLayout2ui4");var Ra=Qh;Ra.prototype.bytesPerElement=4;B("StructArrayLayout2ui4",Ra);var ed=class ed extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let i=e*1;return this.uint16[i+0]=r,e}};s(ed,"StructArrayLayout1ui2");var ic=ed;ic.prototype.bytesPerElement=2;B("StructArrayLayout1ui2",ic);var td=class td extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,i,n){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,i,n)}emplace(e,r,i,n,o){let a=e*4;return this.float32[a+0]=r,this.float32[a+1]=i,this.float32[a+2]=n,this.float32[a+3]=o,e}};s(td,"StructArrayLayout4f16");var Yi=td;Yi.prototype.bytesPerElement=16;B("StructArrayLayout4f16",Yi);var rd=class rd extends sn{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Mw.default(this.anchorPointX,this.anchorPointY)}};s(rd,"CollisionBoxStruct");var oc=rd;oc.prototype.size=20;var nd=class nd extends Ma{get(e){return new oc(this,e)}};s(nd,"CollisionBoxArray");var Fa=nd;B("CollisionBoxArray",Fa);var id=class id extends sn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}};s(id,"PlacedSymbolStruct");var ac=id;ac.prototype.size=48;var od=class od extends La{get(e){return new ac(this,e)}};s(od,"PlacedSymbolArray");var Ba=od;B("PlacedSymbolArray",Ba);var ad=class ad extends sn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}};s(ad,"SymbolInstanceStruct");var sc=ad;sc.prototype.size=64;var sd=class sd extends Da{get(e){return new sc(this,e)}};s(sd,"SymbolInstanceArray");var Ua=sd;B("SymbolInstanceArray",Ua);var ld=class ld extends jn{getoffsetX(e){return this.float32[e*1+0]}};s(ld,"GlyphOffsetArray");var Na=ld;B("GlyphOffsetArray",Na);var ud=class ud extends va{getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}};s(ud,"SymbolLineVertexArray");var $a=ud;B("SymbolLineVertexArray",$a);var cd=class cd extends sn{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};s(cd,"TextAnchorOffsetStruct");var lc=cd;lc.prototype.size=12;var pd=class pd extends za{get(e){return new lc(this,e)}};s(pd,"TextAnchorOffsetArray");var Va=pd;B("TextAnchorOffsetArray",Va);var md=class md extends sn{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};s(md,"FeatureIndexStruct");var uc=md;uc.prototype.size=8;var fd=class fd extends Oa{get(e){return new uc(this,e)}};s(fd,"FeatureIndexArray");var ja=fd;B("FeatureIndexArray",ja);var hd=class hd extends Vn{};s(hd,"PosArray");var Br=hd;var dd=class dd extends Vn{};s(dd,"CircleLayoutArray");var cc=dd,yd=class yd extends Vn{};s(yd,"FillLayoutArray");var pc=yd,gd=class gd extends Pa{};s(gd,"FillExtrusionLayoutArray");var mc=gd;var bd=class bd extends wa{};s(bd,"LineLayoutArray");var fc=bd,xd=class xd extends ln{};s(xd,"LineExtLayoutArray");var hc=xd,_d=class _d extends Sa{};s(_d,"PatternLayoutArray");var Ur=_d,vd=class vd extends Ta{};s(vd,"SymbolLayoutArray");var dc=vd,Pd=class Pd extends Ia{};s(Pd,"SymbolDynamicLayoutArray");var yc=Pd,wd=class wd extends Ca{};s(wd,"SymbolOpacityArray");var gc=wd,Sd=class Sd extends Aa{};s(Sd,"CollisionBoxLayoutArray");var Ga=Sd;var Td=class Td extends Ea{};s(Td,"CollisionVertexArray");var bc=Td;var Id=class Id extends ka{};s(Id,"TriangleIndexArray");var Qe=Id,Cd=class Cd extends Ra{};s(Cd,"LineIndexArray");var un=Cd;m();var ID=ge([{name:"a_pos",components:2,type:"Int16"}],4);var{members:Aw,size:C8,alignment:M8}=ID;m();var cn=class cn{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1;this.segments=e}prepareSegment(e,r,i,n){let o=this.segments[this.segments.length-1];return e>cn.MAX_VERTEX_ARRAY_LENGTH&&De("Max vertices per segment is ".concat(cn.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ").concat(e,". Consider using the `fillLargeMeshArrays` function if you require meshes with more than ").concat(cn.MAX_VERTEX_ARRAY_LENGTH," vertices.")),this._forceNewSegmentOnNextPrepare||!o||o.vertexLength+e>cn.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==n?this.createNewSegment(r,i,n):o}createNewSegment(e,r,i){let n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,r,i){return this.prepareSegment(0,e,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,i,n){return new cn([{vertexOffset:e,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};s(cn,"SegmentVector");var _e=cn;_e.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1;B("SegmentVector",_e);m();m();function Md(t,e){return t=Ne(Math.floor(t),0,255),e=Ne(Math.floor(e),0,255),256*t+e}s(Md,"packUint8ToFloat");m();var Za=ge([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);m();var zw=J(kd(),1);var vc=class vc{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,i,n){this.ids.push(Dw(e)),this.positions.push(r,i,n)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let r=Dw(e),i=0,n=this.ids.length-1;for(;i<n;){let a=i+n>>1;this.ids[a]>=r?n=a:i=a+1}let o=[];for(;this.ids[i]===r;){let a=this.positions[3*i],l=this.positions[3*i+1],c=this.positions[3*i+2];o.push({index:a,start:l,end:c}),i++}return o}static serialize(e,r){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Ld(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(e){let r=new vc;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};s(vc,"FeaturePositionMap");var Xa=vc;function Dw(t){let e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:(0,zw.default)(String(t))}s(Dw,"getNumericId");function Ld(t,e,r,i){for(;r<i;){let n=t[r+i>>1],o=r-1,a=i+1;for(;;){do o++;while(t[o]<n);do a--;while(t[a]>n);if(o>=a)break;_c(t,o,a),_c(e,3*o,3*a),_c(e,3*o+1,3*a+1),_c(e,3*o+2,3*a+2)}a-r<i-a?(Ld(t,e,r,a),r=a+1):(Ld(t,e,a+1,i),i=a)}}s(Ld,"sort");function _c(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}s(_c,"swap");B("FeaturePositionMap",Xa);m();var Dd=class Dd{constructor(e,r){this.gl=e.gl,this.location=r}};s(Dd,"Uniform");var Ha=Dd;var zd=class zd extends Ha{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}};s(zd,"Uniform1f");var je=zd;var Od=class Od extends Ha{constructor(e,r){super(e,r),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}};s(Od,"Uniform4f");var Nr=Od,Rd=class Rd extends Ha{constructor(e,r){super(e,r),this.current=re.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}};s(Rd,"UniformColor");var $r=Rd;var rX=new Float32Array(16);function Fd(t){return[Md(255*t.r,255*t.g),Md(255*t.b,255*t.a)]}s(Fd,"packColor");var Bd=class Bd{constructor(e,r,i){this.value=e,this.uniformNames=r.map(n=>"u_".concat(n)),this.type=i}setUniform(e,r,i){e.set(i.constantOr(this.value))}getBinding(e,r,i){return this.type==="color"?new $r(e,r):new je(e,r)}};s(Bd,"ConstantBinder");var Gn=Bd,Ud=class Ud{constructor(e,r){this.uniformNames=r.map(i=>"u_".concat(i)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,i,n){let o=n==="u_pattern_to"?this.patternTo:n==="u_pattern_from"?this.patternFrom:n==="u_pixel_ratio_to"?this.pixelRatioTo:n==="u_pixel_ratio_from"?this.pixelRatioFrom:null;o&&e.set(o)}getBinding(e,r,i){return i.substr(0,9)==="u_pattern"?new Nr(e,r):new je(e,r)}};s(Ud,"CrossFadedConstantBinder");var pn=Ud,Nd=class Nd{constructor(e,r,i,n){this.expression=e,this.type=i,this.maxValue=0,this.paintVertexAttributes=r.map(o=>({name:"a_".concat(o),type:"Float32",components:i==="color"?2:1,offset:0})),this.paintVertexArray=new n}populatePaintArray(e,r,i,n,o){let a=this.paintVertexArray.length,l=this.expression.evaluate(new he(0),r,{},n,[],o);this.paintVertexArray.resize(e),this._setPaintValue(a,e,l)}updatePaintArray(e,r,i,n){let o=this.expression.evaluate({zoom:0},i,n);this._setPaintValue(e,r,o)}_setPaintValue(e,r,i){if(this.type==="color"){let n=Fd(i);for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,n[0],n[1])}else{for(let n=e;n<r;n++)this.paintVertexArray.emplace(n,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}};s(Nd,"SourceExpressionBinder");var sr=Nd,$d=class $d{constructor(e,r,i,n,o,a){this.expression=e,this.uniformNames=r.map(l=>"u_".concat(l,"_t")),this.type=i,this.useIntegerZoom=n,this.zoom=o,this.maxValue=0,this.paintVertexAttributes=r.map(l=>({name:"a_".concat(l),type:"Float32",components:i==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,r,i,n,o){let a=this.expression.evaluate(new he(this.zoom),r,{},n,[],o),l=this.expression.evaluate(new he(this.zoom+1),r,{},n,[],o),c=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(c,e,a,l)}updatePaintArray(e,r,i,n){let o=this.expression.evaluate({zoom:this.zoom},i,n),a=this.expression.evaluate({zoom:this.zoom+1},i,n);this._setPaintValue(e,r,o,a)}_setPaintValue(e,r,i,n){if(this.type==="color"){let o=Fd(i),a=Fd(n);for(let l=e;l<r;l++)this.paintVertexArray.emplace(l,o[0],o[1],a[0],a[1])}else{for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,i,n);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r){let i=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,n=Ne(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);e.set(n)}getBinding(e,r,i){return new je(e,r)}};s($d,"CompositeExpressionBinder");var zt=$d,Vd=class Vd{constructor(e,r,i,n,o,a){this.expression=e,this.type=r,this.useIntegerZoom=i,this.zoom=n,this.layerId=a,this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o}populatePaintArray(e,r,i){let n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(n,e,r.patterns&&r.patterns[this.layerId],i)}updatePaintArray(e,r,i,n,o){this._setPaintValues(e,r,i.patterns&&i.patterns[this.layerId],o)}_setPaintValues(e,r,i,n){if(!n||!i)return;let{min:o,mid:a,max:l}=i,c=n[o],u=n[a],p=n[l];if(!(!c||!u||!p))for(let f=e;f<r;f++)this.zoomInPaintVertexArray.emplace(f,u.tl[0],u.tl[1],u.br[0],u.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],u.pixelRatio,c.pixelRatio),this.zoomOutPaintVertexArray.emplace(f,u.tl[0],u.tl[1],u.br[0],u.br[1],p.tl[0],p.tl[1],p.br[0],p.br[1],u.pixelRatio,p.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,Za.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,Za.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}};s(Vd,"CrossFadedCompositeBinder");var vr=Vd,jd=class jd{constructor(e,r,i){this.binders={},this._buffers=[];let n=[];for(let o in e.paint._values){if(!i(o))continue;let a=e.paint.get(o);if(!(a instanceof gt)||!Bi(a.property.specification))continue;let l=ED(o,e.type),c=a.value,u=a.property.specification.type,p=a.property.useIntegerZoom,f=a.property.specification["property-type"],h=f==="cross-faded"||f==="cross-faded-data-driven";if(c.kind==="constant")this.binders[o]=h?new pn(c.value,l):new Gn(c.value,l,u),n.push("/u_".concat(o));else if(c.kind==="source"||h){let y=Ow(o,u,"source");this.binders[o]=h?new vr(c,u,p,r,y,e.id):new sr(c,l,u,y),n.push("/a_".concat(o))}else{let y=Ow(o,u,"composite");this.binders[o]=new zt(c,l,u,p,r,y),n.push("/z_".concat(o))}}this.cacheKey=n.sort().join("")}getMaxValue(e){let r=this.binders[e];return r instanceof sr||r instanceof zt?r.maxValue:0}populatePaintArrays(e,r,i,n,o){for(let a in this.binders){let l=this.binders[a];(l instanceof sr||l instanceof zt||l instanceof vr)&&l.populatePaintArray(e,r,i,n,o)}}setConstantPatternPositions(e,r){for(let i in this.binders){let n=this.binders[i];n instanceof pn&&n.setConstantPatternPositions(e,r)}}updatePaintArrays(e,r,i,n,o){let a=!1;for(let l in e){let c=r.getPositions(l);for(let u of c){let p=i.feature(u.index);for(let f in this.binders){let h=this.binders[f];if((h instanceof sr||h instanceof zt||h instanceof vr)&&h.expression.isStateDependent===!0){let y=n.paint.get(f);h.expression=y.value,h.updatePaintArray(u.start,u.end,p,e[l],o),a=!0}}}}return a}defines(){let e=[];for(let r in this.binders){let i=this.binders[r];(i instanceof Gn||i instanceof pn)&&e.push(...i.uniformNames.map(n=>"#define HAS_UNIFORM_".concat(n)))}return e}getBinderAttributes(){let e=[];for(let r in this.binders){let i=this.binders[r];if(i instanceof sr||i instanceof zt)for(let n=0;n<i.paintVertexAttributes.length;n++)e.push(i.paintVertexAttributes[n].name);else if(i instanceof vr)for(let n=0;n<Za.members.length;n++)e.push(Za.members[n].name)}return e}getBinderUniforms(){let e=[];for(let r in this.binders){let i=this.binders[r];if(i instanceof Gn||i instanceof pn||i instanceof zt)for(let n of i.uniformNames)e.push(n)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){let i=[];for(let n in this.binders){let o=this.binders[n];if(o instanceof Gn||o instanceof pn||o instanceof zt){for(let a of o.uniformNames)if(r[a]){let l=o.getBinding(e,r[a],a);i.push({name:a,property:n,binding:l})}}}return i}setUniforms(e,r,i,n){for(let{name:o,property:a,binding:l}of r)this.binders[a].setUniform(l,n,i.get(a),o)}updatePaintBuffers(e){this._buffers=[];for(let r in this.binders){let i=this.binders[r];if(e&&i instanceof vr){let n=e.fromScale===2?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(i instanceof sr||i instanceof zt)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(e){for(let r in this.binders){let i=this.binders[r];(i instanceof sr||i instanceof zt||i instanceof vr)&&i.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let r=this.binders[e];(r instanceof sr||r instanceof zt||r instanceof vr)&&r.destroy()}}};s(jd,"ProgramConfiguration");var Pc=jd,Gd=class Gd{constructor(e,r,i=()=>!0){this.programConfigurations={};for(let n of e)this.programConfigurations[n.id]=new Pc(n,r,i);this.needsUpload=!1,this._featureMap=new Xa,this._bufferOffset=0}populatePaintArrays(e,r,i,n,o,a){for(let l in this.programConfigurations)this.programConfigurations[l].populatePaintArrays(e,r,n,o,a);r.id!==void 0&&this._featureMap.add(r.id,i,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,i,n){for(let o of i)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,r,o,n)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};s(Gd,"ProgramConfigurationSet");var bt=Gd;function ED(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace("".concat(e,"-"),"").replace(/-/g,"_")]}s(ED,"paintAttributeNames");function kD(t){return{"line-pattern":{source:Ur,composite:Ur},"fill-pattern":{source:Ur,composite:Ur},"fill-extrusion-pattern":{source:Ur,composite:Ur}}[t]}s(kD,"getLayoutException");function Ow(t,e,r){let i={color:{source:ln,composite:Yi},number:{source:jn,composite:ln}},n=kD(t);return n&&n[r]||i[e][r]}s(Ow,"layoutType");B("ConstantBinder",Gn);B("CrossFadedConstantBinder",pn);B("SourceExpressionBinder",sr);B("CrossFadedCompositeBinder",vr);B("CompositeExpressionBinder",zt);B("ProgramConfiguration",Pc,{omit:["_buffers"]});B("ProgramConfigurationSet",bt);m();m();var DD=15,Zd=Math.pow(2,DD-1)-1,Rw=-Zd-1;function xt(t){let e=8192/t.extent,r=t.loadGeometry();for(let i=0;i<r.length;i++){let n=r[i];for(let o=0;o<n.length;o++){let a=n[o],l=Math.round(a.x*e),c=Math.round(a.y*e);a.x=Ne(l,Rw,Zd),a.y=Ne(c,Rw,Zd),(l<a.x||l>a.x+1||c<a.y||c>a.y+1)&&De("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}s(xt,"loadGeometry");m();function _t(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?xt(t):[]}}s(_t,"toEvaluationFeature");var Fw=-32768;function zD(t,e,r,i,n){t.emplaceBack(Fw+e*8+i,Fw+r*8+n)}s(zD,"addCircleVertex");var Xd=class Xd{constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new cc,this.indexArray=new Qe,this.segments=new _e,this.programConfigurations=new bt(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,i){let n=this.layers[0],o=[],a=null,l=!1,c=n.type==="heatmap";if(n.type==="circle"){let p=n;a=p.layout.get("circle-sort-key"),l=!a.isConstant(),c=c||p.paint.get("circle-pitch-alignment")==="map"}let u=c?r.subdivisionGranularity.circle:1;for(let{feature:p,id:f,index:h,sourceLayerIndex:y}of e){let g=this.layers[0]._featureFilter.needGeometry,x=_t(p,g);if(!this.layers[0]._featureFilter.filter(new he(this.zoom,{globalState:this.globalState}),x,i))continue;let _=l?a.evaluate(x,{},i):void 0,P={id:f,properties:p.properties,type:p.type,sourceLayerIndex:y,index:h,geometry:g?x.geometry:xt(p),patterns:{},sortKey:_};o.push(P)}l&&o.sort((p,f)=>p.sortKey-f.sortKey);for(let p of o){let{geometry:f,index:h,sourceLayerIndex:y}=p,g=e[h].feature;this.addFeature(p,f,h,i,u),r.featureIndex.insert(g,f,h,y,this.index)}}update(e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,i)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Aw),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,i,n,o=1){let a;switch(o){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw new Error("Invalid circle bucket granularity: ".concat(o,"; valid values are 1, 3, 5, 7."))}let l=a.length;for(let c of r)for(let u of c){let p=u.x,f=u.y;if(p<0||p>=8192||f<0||f>=8192)continue;let h=this.segments.prepareSegment(l*l,this.layoutVertexArray,this.indexArray,e.sortKey),y=h.vertexLength;for(let g=0;g<l;g++)for(let x=0;x<l;x++)zD(this.layoutVertexArray,p,f,a[x],a[g]);for(let g=0;g<l-1;g++)for(let x=0;x<l-1;x++){let _=y+g*l+x,P=y+(g+1)*l+x;this.indexArray.emplaceBack(_,P+1,_+1),this.indexArray.emplaceBack(_,P,P+1)}h.vertexLength+=l*l,h.primitiveLength+=(l-1)*(l-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{},n)}};s(Xd,"CircleBucket");var Ji=Xd;B("CircleBucket",Ji,{omit:["layers"]});m();var qa=J(te(),1);function OD(t,e){let r=!1;for(let i=0,n=t.length-1;i<t.length;n=i++){let o=t[i],a=t[n];o.y>e.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}s(OD,"polygonContainsPoint");function Bw(t,e,r,i,n){for(let a of t)if(e<=a.x&&r<=a.y&&i>=a.x&&n>=a.y)return!0;let o=[new qa.default(e,r),new qa.default(e,n),new qa.default(i,n),new qa.default(i,r)];if(t.length>2){for(let a of o)if(OD(t,a))return!0}for(let a=0;a<t.length-1;a++){let l=t[a],c=t[a+1];if(RD(l,c,o))return!0}return!1}s(Bw,"polygonIntersectsBox");function RD(t,e,r){let i=r[0],n=r[2];if(t.x<i.x&&e.x<i.x||t.x>n.x&&e.x>n.x||t.y<i.y&&e.y<i.y||t.y>n.y&&e.y>n.y)return!1;let o=jo(t,e,r[0]);return o!==jo(t,e,r[1])||o!==jo(t,e,r[2])||o!==jo(t,e,r[3])}s(RD,"edgeIntersectsBox");m();var BD=J(te(),1);m();var ND=J(te(),1);m();m();var Wd=class Wd extends Ji{};s(Wd,"HeatmapBucket");var wc=Wd;B("HeatmapBucket",wc,{omit:["layers"]});m();m();m();function Yd(t,{width:e,height:r},i,n){if(!n)n=new Uint8Array(e*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*r*i)throw new RangeError("mismatched image size. expected: ".concat(n.length," but got: ").concat(e*r*i));return t.width=e,t.height=r,t.data=n,t}s(Yd,"createImage");function Uw(t,{width:e,height:r},i){if(e===t.width&&r===t.height)return;let n=Yd({},{width:e,height:r},i);Jd(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},i),t.width=e,t.height=r,t.data=n.data}s(Uw,"resizeImage");function Jd(t,e,r,i,n,o){if(n.width===0||n.height===0)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");let a=t.data,l=e.data;if(a===l)throw new Error("srcData equals dstData, so image is already copied");for(let c=0;c<n.height;c++){let u=((r.y+c)*t.width+r.x)*o,p=((i.y+c)*e.width+i.x)*o;for(let f=0;f<n.width*o;f++)l[p+f]=a[u+f]}return e}s(Jd,"copyImage");var Sc=class Sc{constructor(e,r){Yd(this,e,1,r)}resize(e){Uw(this,e,1)}clone(){return new Sc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,i,n,o){Jd(e,r,i,n,o,1)}};s(Sc,"AlphaImage");var Zn=Sc,Tc=class Tc{constructor(e,r){Yd(this,e,4,r)}resize(e){Uw(this,e,4)}replace(e,r){r?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e}clone(){return new Tc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,i,n,o){Jd(e,r,i,n,o,4)}setPixel(e,r,i){let n=(e*this.width+r)*4;this.data[n+0]=Math.round(i.r*255/i.a),this.data[n+1]=Math.round(i.g*255/i.a),this.data[n+2]=Math.round(i.b*255/i.a),this.data[n+3]=Math.round(i.a*255)}};s(Tc,"RGBAImage");var Ye=Tc;B("AlphaImage",Zn);B("RGBAImage",Ye);m();m();m();m();m();var Kd=class Kd{constructor(e,r,i,n){this.context=e,this.format=i,this.texture=e.gl.createTexture(),this.update(r,n)}update(e,r,i){let{width:n,height:o}=e,a=(!this.size||this.size[0]!==n||this.size[1]!==o)&&!i,{context:l}=this,{gl:c}=l;if(this.useMipmap=!!(r&&r.useMipmap),c.bindTexture(c.TEXTURE_2D,this.texture),l.pixelStoreUnpackFlipY.set(!1),l.pixelStoreUnpack.set(1),l.pixelStoreUnpackPremultiplyAlpha.set(this.format===c.RGBA&&(!r||r.premultiply!==!1)),a)this.size=[n,o],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||Jt(e)?c.texImage2D(c.TEXTURE_2D,0,this.format,this.format,c.UNSIGNED_BYTE,e):c.texImage2D(c.TEXTURE_2D,0,this.format,n,o,0,this.format,c.UNSIGNED_BYTE,e.data);else{let{x:u,y:p}=i||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||Jt(e)?c.texSubImage2D(c.TEXTURE_2D,0,u,p,c.RGBA,c.UNSIGNED_BYTE,e):c.texSubImage2D(c.TEXTURE_2D,0,u,p,n,o,c.RGBA,c.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&c.generateMipmap(c.TEXTURE_2D),l.pixelStoreUnpackFlipY.setDefault(),l.pixelStoreUnpack.setDefault(),l.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(e,r,i){let{context:n}=this,{gl:o}=n;o.bindTexture(o.TEXTURE_2D,this.texture),i===o.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(i=o.LINEAR),e!==this.filter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,e),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,i||e),this.filter=e),r!==this.wrap&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,r),this.wrap=r)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}};s(Kd,"Texture");var Ge=Kd;m();var ey=class ey{constructor(e,r,i,n=1,o=1,a=1,l=0){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i)){De('"'.concat(i,'" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".'));return}this.stride=r.height;let c=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=o,this.blueFactor=a,this.baseShift=l;break;case"mapbox":default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4;break}for(let u=0;u<c;u++)this.data[this._idx(-1,u)]=this.data[this._idx(0,u)],this.data[this._idx(c,u)]=this.data[this._idx(c-1,u)],this.data[this._idx(u,-1)]=this.data[this._idx(u,0)],this.data[this._idx(u,c)]=this.data[this._idx(u,c-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(c,-1)]=this.data[this._idx(c-1,0)],this.data[this._idx(-1,c)]=this.data[this._idx(0,c-1)],this.data[this._idx(c,c)]=this.data[this._idx(c-1,c-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let u=0;u<c;u++)for(let p=0;p<c;p++){let f=this.get(u,p);f>this.max&&(this.max=f),f<this.min&&(this.min=f)}}get(e,r){let i=new Uint8Array(this.data.buffer),n=this._idx(e,r)*4;return this.unpack(i[n],i[n+1],i[n+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,i){return e*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(e){return Nw(e,this.getUnpackVector())}getPixels(){return new Ye({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,i){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=r*this.dim,o=r*this.dim+this.dim,a=i*this.dim,l=i*this.dim+this.dim;switch(r){case-1:n=o-1;break;case 1:o=n+1;break}switch(i){case-1:a=l-1;break;case 1:l=a+1;break}let c=-r*this.dim,u=-i*this.dim;for(let p=a;p<l;p++)for(let f=n;f<o;f++)this.data[this._idx(f,p)]=e.data[this._idx(f+c,p+u)]}};s(ey,"DEMData");var Qd=ey;function Nw(t,e){let r=e[0],i=e[1],n=e[2],o=e[3],a=Math.min(r,i,n),l=Math.round((t+o)/a);return{r:Math.floor(l*a/r)%256,g:Math.floor(l*a/i)%256,b:Math.floor(l*a/n)%256}}s(Nw,"packDEMData");B("DEMData",Qd);m();m();m();var VD=ge([{name:"a_pos",components:2,type:"Int16"}],4);var{members:$w,size:Uq,alignment:Nq}=VD;m();function Ki(t,e,r){let i=r.patternDependencies,n=!1;for(let o of e){let a=o.paint.get("".concat(t,"-pattern"));a.isConstant()||(n=!0);let l=a.constantOr(null);l&&(n=!0,i[l.to]=!0,i[l.from]=!0)}return n}s(Ki,"hasPattern");function Qi(t,e,r,i,n){let o=n.patternDependencies;for(let a of e){let c=a.paint.get("".concat(t,"-pattern")).value;if(c.kind!=="constant"){let u=c.evaluate({zoom:i-1},r,{},n.availableImages),p=c.evaluate({zoom:i},r,{},n.availableImages),f=c.evaluate({zoom:i+1},r,{},n.availableImages);u=u&&u.name?u.name:u,p=p&&p.name?p.name:p,f=f&&f.name?f.name:f,o[u]=!0,o[p]=!0,o[f]=!0,r.patterns[a.id]={min:u,mid:p,max:f}}}return r}s(Qi,"addPatternDependencies");m();var es=J(te(),1);m();function ny(t,e,r=2){let i=e&&e.length,n=i?e[0]*r:t.length,o=jw(t,0,n,r,!0),a=[];if(!o||o.next===o.prev)return a;let l,c,u;if(i&&(o=HD(t,e,o,r)),t.length>80*r){l=1/0,c=1/0;let p=-1/0,f=-1/0;for(let h=r;h<n;h+=r){let y=t[h],g=t[h+1];y<l&&(l=y),g<c&&(c=g),y>p&&(p=y),g>f&&(f=g)}u=Math.max(p-l,f-c),u=u!==0?32767/u:0}return Ya(o,a,r,l,c,u,0),a}s(ny,"earcut");function jw(t,e,r,i,n){let o;if(n===iz(t,e,r,i)>0)for(let a=e;a<r;a+=i)o=Vw(a/i|0,t[a],t[a+1],o);else for(let a=r-i;a>=e;a-=i)o=Vw(a/i|0,t[a],t[a+1],o);return o&&eo(o,o.next)&&(Ka(o),o=o.next),o}s(jw,"linkedList");function Xn(t,e){if(!t)return t;e||(e=t);let r=t,i;do if(i=!1,!r.steiner&&(eo(r,r.next)||Ue(r.prev,r,r.next)===0)){if(Ka(r),r=e=r.prev,r===r.next)break;i=!0}else r=r.next;while(i||r!==e);return e}s(Xn,"filterPoints");function Ya(t,e,r,i,n,o,a){if(!t)return;!a&&o&&KD(t,i,n,o);let l=t;for(;t.prev!==t.next;){let c=t.prev,u=t.next;if(o?GD(t,i,n,o):jD(t)){e.push(c.i,t.i,u.i),Ka(t),t=u.next,l=u.next;continue}if(t=u,t===l){a?a===1?(t=ZD(Xn(t),e),Ya(t,e,r,i,n,o,2)):a===2&&XD(t,e,r,i,n,o):Ya(Xn(t),e,r,i,n,o,1);break}}}s(Ya,"earcutLinked");function jD(t){let e=t.prev,r=t,i=t.next;if(Ue(e,r,i)>=0)return!1;let n=e.x,o=r.x,a=i.x,l=e.y,c=r.y,u=i.y,p=Math.min(n,o,a),f=Math.min(l,c,u),h=Math.max(n,o,a),y=Math.max(l,c,u),g=i.next;for(;g!==e;){if(g.x>=p&&g.x<=h&&g.y>=f&&g.y<=y&&Wa(n,l,o,c,a,u,g.x,g.y)&&Ue(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}s(jD,"isEar");function GD(t,e,r,i){let n=t.prev,o=t,a=t.next;if(Ue(n,o,a)>=0)return!1;let l=n.x,c=o.x,u=a.x,p=n.y,f=o.y,h=a.y,y=Math.min(l,c,u),g=Math.min(p,f,h),x=Math.max(l,c,u),_=Math.max(p,f,h),P=ty(y,g,e,r,i),I=ty(x,_,e,r,i),v=t.prevZ,w=t.nextZ;for(;v&&v.z>=P&&w&&w.z<=I;){if(v.x>=y&&v.x<=x&&v.y>=g&&v.y<=_&&v!==n&&v!==a&&Wa(l,p,c,f,u,h,v.x,v.y)&&Ue(v.prev,v,v.next)>=0||(v=v.prevZ,w.x>=y&&w.x<=x&&w.y>=g&&w.y<=_&&w!==n&&w!==a&&Wa(l,p,c,f,u,h,w.x,w.y)&&Ue(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;v&&v.z>=P;){if(v.x>=y&&v.x<=x&&v.y>=g&&v.y<=_&&v!==n&&v!==a&&Wa(l,p,c,f,u,h,v.x,v.y)&&Ue(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;w&&w.z<=I;){if(w.x>=y&&w.x<=x&&w.y>=g&&w.y<=_&&w!==n&&w!==a&&Wa(l,p,c,f,u,h,w.x,w.y)&&Ue(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}s(GD,"isEarHashed");function ZD(t,e){let r=t;do{let i=r.prev,n=r.next.next;!eo(i,n)&&Zw(i,r,r.next,n)&&Ja(i,n)&&Ja(n,i)&&(e.push(i.i,r.i,n.i),Ka(r),Ka(r.next),r=t=n),r=r.next}while(r!==t);return Xn(r)}s(ZD,"cureLocalIntersections");function XD(t,e,r,i,n,o){let a=t;do{let l=a.next.next;for(;l!==a.prev;){if(a.i!==l.i&&tz(a,l)){let c=Xw(a,l);a=Xn(a,a.next),c=Xn(c,c.next),Ya(a,e,r,i,n,o,0),Ya(c,e,r,i,n,o,0);return}l=l.next}a=a.next}while(a!==t)}s(XD,"splitEarcut");function HD(t,e,r,i){let n=[];for(let o=0,a=e.length;o<a;o++){let l=e[o]*i,c=o<a-1?e[o+1]*i:t.length,u=jw(t,l,c,i,!1);u===u.next&&(u.steiner=!0),n.push(ez(u))}n.sort(qD);for(let o=0;o<n.length;o++)r=WD(n[o],r);return r}s(HD,"eliminateHoles");function qD(t,e){let r=t.x-e.x;if(r===0&&(r=t.y-e.y,r===0)){let i=(t.next.y-t.y)/(t.next.x-t.x),n=(e.next.y-e.y)/(e.next.x-e.x);r=i-n}return r}s(qD,"compareXYSlope");function WD(t,e){let r=YD(t,e);if(!r)return e;let i=Xw(r,t);return Xn(i,i.next),Xn(r,r.next)}s(WD,"eliminateHole");function YD(t,e){let r=e,i=t.x,n=t.y,o=-1/0,a;if(eo(t,r))return r;do{if(eo(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let f=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(f<=i&&f>o&&(o=f,a=r.x<r.next.x?r:r.next,f===i))return a}r=r.next}while(r!==e);if(!a)return null;let l=a,c=a.x,u=a.y,p=1/0;r=a;do{if(i>=r.x&&r.x>=c&&i!==r.x&&Gw(n<u?i:o,n,c,u,n<u?o:i,n,r.x,r.y)){let f=Math.abs(n-r.y)/(i-r.x);Ja(r,t)&&(f<p||f===p&&(r.x>a.x||r.x===a.x&&JD(a,r)))&&(a=r,p=f)}r=r.next}while(r!==l);return a}s(YD,"findHoleBridge");function JD(t,e){return Ue(t.prev,t,e.prev)<0&&Ue(e.next,t,t.next)<0}s(JD,"sectorContainsSector");function KD(t,e,r,i){let n=t;do n.z===0&&(n.z=ty(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,QD(n)}s(KD,"indexCurve");function QD(t){let e,r=1;do{let i=t,n;t=null;let o=null;for(e=0;i;){e++;let a=i,l=0;for(let u=0;u<r&&(l++,a=a.nextZ,!!a);u++);let c=r;for(;l>0||c>0&&a;)l!==0&&(c===0||!a||i.z<=a.z)?(n=i,i=i.nextZ,l--):(n=a,a=a.nextZ,c--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=a}o.nextZ=null,r*=2}while(e>1);return t}s(QD,"sortLinked");function ty(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}s(ty,"zOrder");function ez(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}s(ez,"getLeftmost");function Gw(t,e,r,i,n,o,a,l){return(n-a)*(e-l)>=(t-a)*(o-l)&&(t-a)*(i-l)>=(r-a)*(e-l)&&(r-a)*(o-l)>=(n-a)*(i-l)}s(Gw,"pointInTriangle");function Wa(t,e,r,i,n,o,a,l){return!(t===a&&e===l)&&Gw(t,e,r,i,n,o,a,l)}s(Wa,"pointInTriangleExceptFirst");function tz(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!rz(t,e)&&(Ja(t,e)&&Ja(e,t)&&nz(t,e)&&(Ue(t.prev,t,e.prev)||Ue(t,e.prev,e))||eo(t,e)&&Ue(t.prev,t,t.next)>0&&Ue(e.prev,e,e.next)>0)}s(tz,"isValidDiagonal");function Ue(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}s(Ue,"area");function eo(t,e){return t.x===e.x&&t.y===e.y}s(eo,"equals");function Zw(t,e,r,i){let n=Cc(Ue(t,e,r)),o=Cc(Ue(t,e,i)),a=Cc(Ue(r,i,t)),l=Cc(Ue(r,i,e));return!!(n!==o&&a!==l||n===0&&Ic(t,r,e)||o===0&&Ic(t,i,e)||a===0&&Ic(r,t,i)||l===0&&Ic(r,e,i))}s(Zw,"intersects");function Ic(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)}s(Ic,"onSegment");function Cc(t){return t>0?1:t<0?-1:0}s(Cc,"sign");function rz(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Zw(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}s(rz,"intersectsPolygon");function Ja(t,e){return Ue(t.prev,t,t.next)<0?Ue(t,e,t.next)>=0&&Ue(t,t.prev,e)>=0:Ue(t,e,t.prev)<0||Ue(t,t.next,e)<0}s(Ja,"locallyInside");function nz(t,e){let r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t);return i}s(nz,"middleInside");function Xw(t,e){let r=ry(t.i,t.x,t.y),i=ry(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}s(Xw,"splitPolygon");function Vw(t,e,r,i){let n=ry(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}s(Vw,"insertNode");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)}s(Ka,"removeNode");function ry(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}s(ry,"createNode");function iz(t,e,r,i){let n=0;for(let o=e,a=r-i;o<r;o+=i)n+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return n}s(iz,"signedArea");m();var iy=class iy{constructor(e,r){if(r>e)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=r}getGranularityForZoomLevel(e){let r=1<<e;return Math.max(Math.floor(this._baseZoomGranularity/r),this._minGranularity,1)}};s(iy,"SubdivisionGranularityExpression");var Ot=iy,Qa=class Qa{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}};s(Qa,"SubdivisionGranularitySetting"),Qa.noSubdivision=new Qa({fill:new Ot(0,0),line:new Ot(0,0),tile:new Ot(0,0),stencil:new Ot(0,0),circle:1});var Hn=Qa;B("SubdivisionGranularityExpression",Ot);B("SubdivisionGranularitySetting",Hn);var mn=-32768,qn=32767,ay=class ay{constructor(e,r){this._vertexBuffer=[];this._vertexDictionary=new Map;this._used=!1;this._granularity=e,this._granularityCellSize=8192/e,this._canonical=r}_getKey(e,r){return e=e+32768,r=r+32768,e<<16|r<<0}_vertexToIndex(e,r){if(e<-32768||r<-32768||e>32767||r>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");let i=Math.round(e)|0,n=Math.round(r)|0,o=this._getKey(i,n);if(this._vertexDictionary.has(o))return this._vertexDictionary.get(o);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(o,a),this._vertexBuffer.push(i,n),a}_subdivideTrianglesScanline(e){if(this._granularity<2)return az(this._vertexBuffer,e);let r=[],i=e.length;for(let n=0;n<i;n+=3){let o=[e[n+0],e[n+1],e[n+2]],a=[this._vertexBuffer[e[n+0]*2+0],this._vertexBuffer[e[n+0]*2+1],this._vertexBuffer[e[n+1]*2+0],this._vertexBuffer[e[n+1]*2+1],this._vertexBuffer[e[n+2]*2+0],this._vertexBuffer[e[n+2]*2+1]],l=1/0,c=1/0,u=-1/0,p=-1/0;for(let x=0;x<3;x++){let _=a[x*2],P=a[x*2+1];l=Math.min(l,_),u=Math.max(u,_),c=Math.min(c,P),p=Math.max(p,P)}if(l===u||c===p)continue;let f=Math.floor(l/this._granularityCellSize),h=Math.ceil(u/this._granularityCellSize),y=Math.floor(c/this._granularityCellSize),g=Math.ceil(p/this._granularityCellSize);if(f===h&&y===g){r.push(...o);continue}for(let x=y;x<g;x++){let _=this._scanlineGenerateVertexRingForCellRow(x,a,o);sz(this._vertexBuffer,_,r)}}return r}_scanlineGenerateVertexRingForCellRow(e,r,i){let n=e*this._granularityCellSize,o=n+this._granularityCellSize,a=[];for(let l=0;l<3;l++){let c=r[l*2],u=r[l*2+1],p=r[(l+1)*2%6],f=r[((l+1)*2+1)%6],h=r[(l+2)*2%6],y=r[((l+2)*2+1)%6],g=p-c,x=f-u,_=g===0,P=x===0,I=(n-u)/x,v=(o-u)/x,w=Math.min(I,v),T=Math.max(I,v);if(!P&&(w>=1||T<=0)||P&&(u<n||u>o)){f>=n&&f<=o&&a.push(i[(l+1)%3]);continue}if(!P&&w>0){let L=c+g*w,R=u+x*w;a.push(this._vertexToIndex(L,R))}let A=c+g*Math.max(w,0),k=c+g*Math.min(T,1);if(_||this._generateIntraEdgeVertices(a,c,u,p,f,A,k),!P&&T<1){let L=c+g*T,R=u+x*T;a.push(this._vertexToIndex(L,R))}(P||f>=n&&f<=o)&&a.push(i[(l+1)%3]),!P&&(f<=n||f>=o)&&this._generateInterEdgeVertices(a,c,u,p,f,h,y,k,n,o)}return a}_generateIntraEdgeVertices(e,r,i,n,o,a,l){let c=n-r,u=o-i,p=u===0,f=p?Math.min(r,n):Math.min(a,l),h=p?Math.max(r,n):Math.max(a,l),y=Math.floor(f/this._granularityCellSize)+1,g=Math.ceil(h/this._granularityCellSize)-1;if(p?r<n:a<l)for(let _=y;_<=g;_++){let P=_*this._granularityCellSize,I=i+u*(P-r)/c;e.push(this._vertexToIndex(P,I))}else for(let _=g;_>=y;_--){let P=_*this._granularityCellSize,I=i+u*(P-r)/c;e.push(this._vertexToIndex(P,I))}}_generateInterEdgeVertices(e,r,i,n,o,a,l,c,u,p){let f=o-i,h=a-n,y=l-o,g=(u-o)/y,x=(p-o)/y,_=Math.min(g,x),P=Math.max(g,x),I=n+h*_,v=Math.floor(Math.min(I,c)/this._granularityCellSize)+1,w=Math.ceil(Math.max(I,c)/this._granularityCellSize)-1,T=c<I,A=y===0;if(A&&(l===u||l===p))return;if(A||_>=1||P<=0){let L=r-a,R=i-l,Z=(u-l)/R,q=(p-l)/R,X=Math.min(Z,q),G=a+L*X;v=Math.floor(Math.min(G,c)/this._granularityCellSize)+1,w=Math.ceil(Math.max(G,c)/this._granularityCellSize)-1,T=c<G}let k=f>0?p:u;if(T)for(let L=v;L<=w;L++){let R=L*this._granularityCellSize;e.push(this._vertexToIndex(R,k))}else for(let L=w;L>=v;L--){let R=L*this._granularityCellSize;e.push(this._vertexToIndex(R,k))}}_generateOutline(e){let r=[];for(let i of e){let n=to(i,this._granularity,!0),o=this._pointArrayToIndices(n),a=[];for(let l=1;l<o.length;l++)a.push(o[l-1]),a.push(o[l]);r.push(a)}return r}_handlePoles(e){let r=!1,i=!1;this._canonical&&(this._canonical.y===0&&(r=!0),this._canonical.y===(1<<this._canonical.z)-1&&(i=!0)),(r||i)&&this._fillPoles(e,r,i)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let r=0;r<e.length;r+=2){let i=e[r+1];i===mn&&(e[r+1]=mn+1),i===qn&&(e[r+1]=qn-1)}}_generatePoleQuad(e,r,i,n,o,a){n>o!=(a===mn)?(e.push(r),e.push(i),e.push(this._vertexToIndex(n,a)),e.push(i),e.push(this._vertexToIndex(o,a)),e.push(this._vertexToIndex(n,a))):(e.push(i),e.push(r),e.push(this._vertexToIndex(n,a)),e.push(this._vertexToIndex(o,a)),e.push(i),e.push(this._vertexToIndex(n,a)))}_fillPoles(e,r,i){let n=this._vertexBuffer,o=0,a=8192,l=e.length;for(let c=2;c<l;c+=3){let u=e[c-2],p=e[c-1],f=e[c],h=n[u*2],y=n[u*2+1],g=n[p*2],x=n[p*2+1],_=n[f*2],P=n[f*2+1];r&&(y===o&&x===o&&this._generatePoleQuad(e,u,p,h,g,mn),x===o&&P===o&&this._generatePoleQuad(e,p,f,g,_,mn),P===o&&y===o&&this._generatePoleQuad(e,f,u,_,h,mn)),i&&(y===a&&x===a&&this._generatePoleQuad(e,u,p,h,g,qn),x===a&&P===a&&this._generatePoleQuad(e,p,f,g,_,qn),P===a&&y===a&&this._generatePoleQuad(e,f,u,_,h,qn))}}_initializeVertices(e){for(let r=0;r<e.length;r+=2)this._vertexToIndex(e[r],e[r+1])}subdividePolygonInternal(e,r){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:i,holeIndices:n}=oz(e);this._initializeVertices(i);let o;try{let l=ny(i,n),c=this._convertIndices(i,l);o=this._subdivideTrianglesScanline(c)}catch(l){console.error(l)}let a=[];return r&&(a=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(o),{verticesFlattened:this._vertexBuffer,indicesTriangles:o,indicesLineList:a}}_convertIndices(e,r){let i=[];for(let n=0;n<r.length;n++){let o=e[r[n]*2],a=e[r[n]*2+1];i.push(this._vertexToIndex(o,a))}return i}_pointArrayToIndices(e){let r=[];for(let i=0;i<e.length;i++){let n=e[i];r.push(this._vertexToIndex(n.x,n.y))}return r}};s(ay,"Subdivider");var oy=ay;function Mc(t,e,r,i=!0){return new oy(r,e).subdividePolygonInternal(t,i)}s(Mc,"subdividePolygon");function to(t,e,r=!1){if(!t||t.length<1)return[];if(t.length<2)return[];let i=t[0],n=t[t.length-1],o=r&&(i.x!==n.x||i.y!==n.y);if(e<2)return o?[...t,t[0]]:[...t];let a=Math.floor(8192/e),l=[];l.push(new es.default(t[0].x,t[0].y));let c=t.length,u=o?c:c-1;for(let p=0;p<u;p++){let f=t[p],h=p<c-1?t[p+1]:t[0],y=f.x,g=f.y,x=h.x,_=h.y,P=y!==x,I=g!==_;if(!P&&!I)continue;let v=x-y,w=_-g,T=Math.abs(v),A=Math.abs(w),k=y,L=g;for(;;){let Z=v>0?(Math.floor(k/a)+1)*a:(Math.ceil(k/a)-1)*a,q=w>0?(Math.floor(L/a)+1)*a:(Math.ceil(L/a)-1)*a,X=Math.abs(k-Z),G=Math.abs(L-q),F=Math.abs(k-x),K=Math.abs(L-_),fe=P?X/T:Number.POSITIVE_INFINITY,ve=I?G/A:Number.POSITIVE_INFINITY;if((F<=X||!P)&&(K<=G||!I))break;if(fe<ve&&P||!I){k=Z,L=L+w*fe;let Te=new es.default(k,Math.round(L));(l[l.length-1].x!==Te.x||l[l.length-1].y!==Te.y)&&l.push(Te)}else{k=k+v*ve,L=q;let Te=new es.default(Math.round(k),L);(l[l.length-1].x!==Te.x||l[l.length-1].y!==Te.y)&&l.push(Te)}}let R=new es.default(x,_);(l[l.length-1].x!==R.x||l[l.length-1].y!==R.y)&&l.push(R)}return l}s(to,"subdivideVertexLine");function oz(t){let e=[],r=[];for(let i of t)if(i.length!==0){i!==t[0]&&e.push(r.length/2);for(let n=0;n<i.length;n++)r.push(i[n].x),r.push(i[n].y)}return{flattened:r,holeIndices:e}}s(oz,"flatten");function az(t,e){let r=[];for(let i=0;i<e.length;i+=3){let n=e[i],o=e[i+1],a=e[i+2],l=t[n*2],c=t[n*2+1],u=t[o*2],p=t[o*2+1],f=t[a*2],h=t[a*2+1],y=u-l,g=p-c,x=f-l,_=h-c;y*_-g*x>0?(r.push(n),r.push(a),r.push(o)):(r.push(n),r.push(o),r.push(a))}return r}s(az,"fixWindingOrder");function sz(t,e,r){if(e.length===0)throw new Error("Subdivision vertex ring is empty.");let i=0,n=t[e[0]*2];for(let c=1;c<e.length;c++){let u=t[e[c]*2];u<n&&(n=u,i=c)}let o=e.length,a=i,l=(a+1)%o;for(;;){let c=a-1>=0?a-1:o-1,u=(l+1)%o,p=t[e[c]*2],f=t[e[c]*2+1],h=t[e[u]*2],y=t[e[u]*2+1],g=t[e[a]*2],x=t[e[a]*2+1],_=t[e[l]*2],P=t[e[l]*2+1],I=!1;if(p<h)I=!0;else if(p>h)I=!1;else{let v=_-g,T=P-x,A=-v,k=x<P?1:-1,L=((p-g)*T+(f-x)*A)*k,R=((h-g)*T+(y-x)*A)*k;L>R&&(I=!0)}if(I){let v=e[c],w=e[a],T=e[l];v!==w&&v!==T&&w!==T&&r.push(T,w,v),a--,a<0&&(a=o-1)}else{let v=e[u],w=e[a],T=e[l];v!==w&&v!==T&&w!==T&&r.push(T,w,v),l++,l>=o&&(l=0)}if(c===u)break}}s(sz,"scanlineTriangulateVertexRing");m();function Ac(t,e,r,i,n,o,a,l,c){let u=n.length/2,p=a&&l&&c;if(u<_e.MAX_VERTEX_ARRAY_LENGTH){let f=e.prepareSegment(u,r,i),h=f.vertexLength;for(let x=0;x<o.length;x+=3)i.emplaceBack(h+o[x],h+o[x+1],h+o[x+2]);f.vertexLength+=u,f.primitiveLength+=o.length/3;let y,g;p&&(g=a.prepareSegment(u,r,l),y=g.vertexLength,g.vertexLength+=u);for(let x=0;x<n.length;x+=2)t(n[x],n[x+1]);if(p)for(let x=0;x<c.length;x++){let _=c[x];for(let P=1;P<_.length;P+=2)l.emplaceBack(y+_[P-1],y+_[P]);g.primitiveLength+=_.length/2}}else lz(e,r,i,n,o,t),p&&uz(a,r,l,n,c,t),e.forceNewSegmentOnNextPrepare(),a==null||a.forceNewSegmentOnNextPrepare()}s(Ac,"fillLargeMeshArrays");function ts(t,e,r,i,n,o,a){if(o){let l=i.count;return r(e[n*2],e[n*2+1]),t[n]=i.count,i.count++,a.vertexLength++,l}else return t[n]}s(ts,"copyOrReuseVertex");function lz(t,e,r,i,n,o){let a=[];for(let f=0;f<i.length/2;f++)a.push(-1);let l={count:0},c=0,u=t.getOrCreateLatestSegment(e,r),p=u.vertexLength;for(let f=2;f<n.length;f+=3){let h=n[f-2],y=n[f-1],g=n[f],x=a[h]<c,_=a[y]<c,P=a[g]<c,I=(x?1:0)+(_?1:0)+(P?1:0);u.vertexLength+I>_e.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),c=l.count,x=!0,_=!0,P=!0,p=0);let v=ts(a,i,o,l,h,x,u),w=ts(a,i,o,l,y,_,u),T=ts(a,i,o,l,g,P,u);r.emplaceBack(p+v-c,p+w-c,p+T-c),u.primitiveLength++}}s(lz,"fillSegmentsTriangles");function uz(t,e,r,i,n,o){let a=[];for(let f=0;f<i.length/2;f++)a.push(-1);let l={count:0},c=0,u=t.getOrCreateLatestSegment(e,r),p=u.vertexLength;for(let f=0;f<n.length;f++){let h=n[f];for(let y=1;y<n[f].length;y+=2){let g=h[y-1],x=h[y],_=a[g]<c,P=a[x]<c,I=(_?1:0)+(P?1:0);u.vertexLength+I>_e.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),c=l.count,_=!0,P=!0,p=0);let v=ts(a,i,o,l,g,_,u),w=ts(a,i,o,l,x,P,u);r.emplaceBack(p+v-c,p+w-c),u.primitiveLength++}}}s(uz,"fillSegmentsLines");var cz=500,sy=class sy{constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new pc,this.indexArray=new Qe,this.indexArray2=new un,this.programConfigurations=new bt(e.layers,e.zoom),this.segments=new _e,this.segments2=new _e,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,i){this.hasPattern=Ki("fill",this.layers,r);let n=this.layers[0].layout.get("fill-sort-key"),o=!n.isConstant(),a=[];for(let{feature:l,id:c,index:u,sourceLayerIndex:p}of e){let f=this.layers[0]._featureFilter.needGeometry,h=_t(l,f);if(!this.layers[0]._featureFilter.filter(new he(this.zoom,{globalState:this.globalState}),h,i))continue;let y=o?n.evaluate(h,{},i,r.availableImages):void 0,g={id:c,properties:l.properties,type:l.type,sourceLayerIndex:p,index:u,geometry:f?h.geometry:xt(l),patterns:{},sortKey:y};a.push(g)}o&&a.sort((l,c)=>l.sortKey-c.sortKey);for(let l of a){let{geometry:c,index:u,sourceLayerIndex:p}=l;if(this.hasPattern){let h=Qi("fill",this.layers,l,this.zoom,r);this.patternFeatures.push(h)}else this.addFeature(l,c,u,i,{},r.subdivisionGranularity);let f=e[u].feature;r.featureIndex.insert(f,c,u,p,this.index)}}update(e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,i)}addFeatures(e,r,i){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,r,i,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,$w),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,i,n,o,a){for(let l of ya(r,cz)){let c=Mc(l,n,a.fill.getGranularityForZoomLevel(n.z)),u=this.layoutVertexArray;Ac((p,f)=>{u.emplaceBack(p,f)},this.segments,this.layoutVertexArray,this.indexArray,c.verticesFlattened,c.indicesTriangles,this.segments2,this.indexArray2,c.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,o,n)}};s(sy,"FillBucket");var Ec=sy;B("FillBucket",Ec,{omit:["layers","patternFeatures"]});m();m();m();m();var mz=ge([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Hw=ge([{name:"a_centroid",components:2,type:"Int16"}],4);var{members:qw,size:jW,alignment:GW}=mz;var tS=J(rs(),1);var Sz=tS.default.VectorTileFeature.types,Tz=500,cy=Math.pow(2,13);function ns(t,e,r,i,n,o,a,l){t.emplaceBack(e,r,Math.floor(i*cy)*2+a,n*cy*2,o*cy*2,Math.round(l))}s(ns,"addVertex");var py=class py{constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new mc,this.centroidVertexArray=new Br,this.indexArray=new Qe,this.programConfigurations=new bt(e.layers,e.zoom),this.segments=new _e,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,i){this.features=[],this.hasPattern=Ki("fill-extrusion",this.layers,r);for(let{feature:n,id:o,index:a,sourceLayerIndex:l}of e){let c=this.layers[0]._featureFilter.needGeometry,u=_t(n,c);if(!this.layers[0]._featureFilter.filter(new he(this.zoom,{globalState:this.globalState}),u,i))continue;let p={id:o,sourceLayerIndex:l,index:a,geometry:c?u.geometry:xt(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(Qi("fill-extrusion",this.layers,p,this.zoom,r)):this.addFeature(p,p.geometry,a,i,{},r.subdivisionGranularity),r.featureIndex.insert(n,p.geometry,a,l,this.index,!0)}}addFeatures(e,r,i){for(let n of this.features){let{geometry:o}=n;this.addFeature(n,o,n.index,r,i,e.subdivisionGranularity)}}update(e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,i)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,qw),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Hw.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,i,n,o,a){for(let l of ya(r,Tz)){let c={x:0,y:0,sampleCount:0},u=this.layoutVertexArray.length;this.processPolygon(c,n,e,l,a);let p=this.layoutVertexArray.length-u,f=Math.floor(c.x/c.sampleCount),h=Math.floor(c.y/c.sampleCount);for(let y=0;y<p;y++)this.centroidVertexArray.emplaceBack(f,h)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,o,n)}processPolygon(e,r,i,n,o){if(n.length<1||eS(n[0]))return;for(let f of n)f.length!==0&&Iz(e,f);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},l=o.fill.getGranularityForZoomLevel(r.z),c=Sz[i.type]==="Polygon";for(let f of n){if(f.length===0||eS(f))continue;let h=to(f,l,c);this._generateSideFaces(h,a)}if(!c)return;let u=Mc(n,r,l,!1),p=this.layoutVertexArray;Ac((f,h)=>{ns(p,f,h,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,u.verticesFlattened,u.indicesTriangles)}_generateSideFaces(e,r){let i=0;for(let n=1;n<e.length;n++){let o=e[n],a=e[n-1];if(Cz(o,a))continue;r.segment.vertexLength+4>_e.MAX_VERTEX_ARRAY_LENGTH&&(r.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let l=o.sub(a)._perp()._unit(),c=a.dist(o);i+c>32768&&(i=0),ns(this.layoutVertexArray,o.x,o.y,l.x,l.y,0,0,i),ns(this.layoutVertexArray,o.x,o.y,l.x,l.y,0,1,i),i+=c,ns(this.layoutVertexArray,a.x,a.y,l.x,l.y,0,0,i),ns(this.layoutVertexArray,a.x,a.y,l.x,l.y,0,1,i);let u=r.segment.vertexLength;this.indexArray.emplaceBack(u,u+2,u+1),this.indexArray.emplaceBack(u+1,u+2,u+3),r.segment.vertexLength+=4,r.segment.primitiveLength+=2}}};s(py,"FillExtrusionBucket");var Lc=py;function Iz(t,e){for(let r=0;r<e.length;r++){let i=e[r];r===e.length-1&&e[0].x===i.x&&e[0].y===i.y||(t.x+=i.x,t.y+=i.y,t.sampleCount++)}}s(Iz,"accumulatePointsToCentroid");B("FillExtrusionBucket",Lc,{omit:["layers","features"]});function Cz(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}s(Cz,"isBoundaryEdge");function eS(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}s(eS,"isEntirelyOutside");m();var Az=J(te(),1);m();m();m();var Ez=ge([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:rS,size:UY,alignment:NY}=Ez;m();var kz=ge([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:nS,size:GY,alignment:ZY}=kz;var aS=J(rs(),1);var Lz=aS.default.VectorTileFeature.types,iS=63,Dz=Math.cos(75/2*(Math.PI/180)),zz=15,Oz=20,Rz=15,sS=1/2,oS=Math.pow(2,Rz-1)/sS,my=class my{constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new fc,this.layoutVertexArray2=new hc,this.indexArray=new Qe,this.programConfigurations=new bt(e.layers,e.zoom),this.segments=new _e,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,i){this.hasPattern=Ki("line",this.layers,r);let n=this.layers[0].layout.get("line-sort-key"),o=!n.isConstant(),a=[];for(let{feature:l,id:c,index:u,sourceLayerIndex:p}of e){let f=this.layers[0]._featureFilter.needGeometry,h=_t(l,f);if(!this.layers[0]._featureFilter.filter(new he(this.zoom,{globalState:this.globalState}),h,i))continue;let y=o?n.evaluate(h,{},i):void 0,g={id:c,properties:l.properties,type:l.type,sourceLayerIndex:p,index:u,geometry:f?h.geometry:xt(l),patterns:{},sortKey:y};a.push(g)}o&&a.sort((l,c)=>l.sortKey-c.sortKey);for(let l of a){let{geometry:c,index:u,sourceLayerIndex:p}=l;if(this.hasPattern){let h=Qi("line",this.layers,l,this.zoom,r);this.patternFeatures.push(h)}else this.addFeature(l,c,u,i,{},r.subdivisionGranularity);let f=e[u].feature;r.featureIndex.insert(f,c,u,p,this.index)}}update(e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,i)}addFeatures(e,r,i){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,r,i,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,nS)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,rS),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end")){let r=+e.properties.mapbox_clip_start,i=+e.properties.mapbox_clip_end;return{start:r,end:i}}}addFeature(e,r,i,n,o,a){let l=this.layers[0].layout,c=l.get("line-join").evaluate(e,{}),u=l.get("line-cap"),p=l.get("line-miter-limit"),f=l.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let h of r)this.addLine(h,e,c,u,p,f,n,a);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,o,n)}addLine(e,r,i,n,o,a,l,c){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let u=l?c.line.getGranularityForZoomLevel(l.z):1;if(e=to(e,u),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let w=0;w<e.length-1;w++)this.totalDistance+=e[w].dist(e[w+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let p=Lz[r.type]==="Polygon",f=e.length;for(;f>=2&&e[f-1].equals(e[f-2]);)f--;let h=0;for(;h<f-1&&e[h].equals(e[h+1]);)h++;if(f<(p?3:2))return;i==="bevel"&&(o=1.05);let y=this.overscaling<=16?zz*8192/(512*this.overscaling):0,g=this.segments.prepareSegment(f*10,this.layoutVertexArray,this.indexArray),x,_,P,I,v;this.e1=this.e2=-1,p&&(x=e[f-2],v=e[h].sub(x)._unit()._perp());for(let w=h;w<f;w++){if(P=w===f-1?p?e[h+1]:void 0:e[w+1],P&&e[w].equals(P))continue;v&&(I=v),x&&(_=x),x=e[w],v=P?P.sub(x)._unit()._perp():I,I=I||v;let T=I.add(v);(T.x!==0||T.y!==0)&&T._unit();let A=I.x*v.x+I.y*v.y,k=T.x*v.x+T.y*v.y,L=k!==0?1/k:1/0,R=2*Math.sqrt(2-2*k),Z=k<Dz&&_&&P,q=I.x*v.y-I.y*v.x>0;if(Z&&w>h){let F=x.dist(_);if(F>2*y){let K=x.sub(x.sub(_)._mult(y/F)._round());this.updateDistance(_,K),this.addCurrentVertex(K,I,0,0,g),_=K}}let X=_&&P,G=X?i:p?"butt":n;if(X&&G==="round"&&(L<a?G="miter":L<=2&&(G="fakeround")),G==="miter"&&L>o&&(G="bevel"),G==="bevel"&&(L>2&&(G="flipbevel"),L<o&&(G="miter")),_&&this.updateDistance(_,x),G==="miter")T._mult(L),this.addCurrentVertex(x,T,0,0,g);else if(G==="flipbevel"){if(L>100)T=v.mult(-1);else{let F=L*I.add(v).mag()/I.sub(v).mag();T._perp()._mult(F*(q?-1:1))}this.addCurrentVertex(x,T,0,0,g),this.addCurrentVertex(x,T.mult(-1),0,0,g)}else if(G==="bevel"||G==="fakeround"){let F=-Math.sqrt(L*L-1),K=q?F:0,fe=q?0:F;if(_&&this.addCurrentVertex(x,I,K,fe,g),G==="fakeround"){let ve=Math.round(R*180/Math.PI/Oz);for(let Te=1;Te<ve;Te++){let Ct=Te/ve;if(Ct!==.5){let No=Ct-.5,Bm=1.0904+A*(-3.2452+A*(3.55645-A*1.43519)),Rl=.848013+A*(-1.06021+A*.215638);Ct=Ct+Ct*No*(Ct-1)*(Bm*No*No+Rl)}let Uo=v.sub(I)._mult(Ct)._add(I)._unit()._mult(q?-1:1);this.addHalfVertex(x,Uo.x,Uo.y,!1,q,0,g)}}P&&this.addCurrentVertex(x,v,-K,-fe,g)}else if(G==="butt")this.addCurrentVertex(x,T,0,0,g);else if(G==="square"){let F=_?1:-1;this.addCurrentVertex(x,T,F,F,g)}else G==="round"&&(_&&(this.addCurrentVertex(x,I,0,0,g),this.addCurrentVertex(x,I,1,1,g,!0)),P&&(this.addCurrentVertex(x,v,-1,-1,g,!0),this.addCurrentVertex(x,v,0,0,g)));if(Z&&w<f-1){let F=x.dist(P);if(F>2*y){let K=x.add(P.sub(x)._mult(y/F)._round());this.updateDistance(x,K),this.addCurrentVertex(K,v,0,0,g),x=K}}}}addCurrentVertex(e,r,i,n,o,a=!1){let l=r.x+r.y*i,c=r.y-r.x*i,u=-r.x+r.y*n,p=-r.y-r.x*n;this.addHalfVertex(e,l,c,a,!1,i,o),this.addHalfVertex(e,u,p,a,!0,-n,o),this.distance>oS/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,i,n,o,a))}addHalfVertex({x:e,y:r},i,n,o,a,l,c){let p=(this.lineClips?this.scaledDistance*(oS-1):this.scaledDistance)*sS;if(this.layoutVertexArray.emplaceBack((e<<1)+(o?1:0),(r<<1)+(a?1:0),Math.round(iS*i)+128,Math.round(iS*n)+128,(l===0?0:l<0?-1:1)+1|(p&63)<<2,p>>6),this.lineClips){let h=this.scaledDistance-this.lineClips.start,y=this.lineClips.end-this.lineClips.start,g=h/y;this.layoutVertexArray2.emplaceBack(g,this.lineClipsArray.length)}let f=c.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,f,this.e2),c.primitiveLength++),a?this.e2=f:this.e1=f}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}};s(my,"LineBucket");var Dc=my;B("LineBucket",Dc,{omit:["layers","patternFeatures"]});m();m();m();m();var lS=ge([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),uS=ge([{name:"a_projected_pos",components:3,type:"Float32"}],4),k9=ge([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),cS=ge([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]),L9=ge([{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"}]),fy=ge([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Fz=ge([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),D9=ge([{name:"triangle",components:3,type:"Uint16"}]),z9=ge([{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"}]),O9=ge([{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",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),R9=ge([{type:"Float32",name:"offsetX"}]),F9=ge([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),B9=ge([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var as=J(te(),1);m();function Bz(t,e,r){let i=e.layout.get("text-transform").evaluate(r,{});return i==="uppercase"?t=t.toLocaleUpperCase():i==="lowercase"&&(t=t.toLocaleLowerCase()),_r.applyArabicShaping&&(t=_r.applyArabicShaping(t)),t}s(Bz,"transformTextInternal");function pS(t,e,r){return t.sections.forEach(i=>{i.text=Bz(i.text,e,r)}),t}s(pS,"transformText");m();function mS(t){let e={},r={},i=[],n=0;function o(u){i.push(t[u]),n++}s(o,"add");function a(u,p,f){let h=r[u];return delete r[u],r[p]=h,i[h].geometry[0].pop(),i[h].geometry[0]=i[h].geometry[0].concat(f[0]),h}s(a,"mergeFromRight");function l(u,p,f){let h=e[p];return delete e[p],e[u]=h,i[h].geometry[0].shift(),i[h].geometry[0]=f[0].concat(i[h].geometry[0]),h}s(l,"mergeFromLeft");function c(u,p,f){let h=f?p[0][p[0].length-1]:p[0][0];return"".concat(u,":").concat(h.x,":").concat(h.y)}s(c,"getKey");for(let u=0;u<t.length;u++){let p=t[u],f=p.geometry,h=p.text?p.text.toString():null;if(!h){o(u);continue}let y=c(h,f),g=c(h,f,!0);if(y in r&&g in e&&r[y]!==e[g]){let x=l(y,g,f),_=a(y,g,i[x].geometry);delete e[y],delete r[g],r[c(h,i[_].geometry,!0)]=_,i[x].geometry=null}else y in r?a(y,g,f):g in e?l(y,g,f):(o(u),e[y]=n-1,r[g]=n-1)}return i.filter(u=>u.geometry)}s(mS,"mergeLines");m();m();var fS={"!":"\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"};m();m();var vS=J(yy(),1);var _S=3;function rO(t,e,r){t===1&&r.readMessage(nO,e)}s(rO,"readFontstacks");function nO(t,e,r){if(t===3){let{id:i,bitmap:n,width:o,height:a,left:l,top:c,advance:u}=r.readMessage(iO,{});e.push({id:i,bitmap:new Zn({width:o+2*_S,height:a+2*_S},n),metrics:{width:o,height:a,left:l,top:c,advance:u}})}}s(nO,"readFontstack");function iO(t,e,r){t===1?e.id=r.readVarint():t===2?e.bitmap=r.readBytes():t===3?e.width=r.readVarint():t===4?e.height=r.readVarint():t===5?e.left=r.readSVarint():t===6?e.top=r.readSVarint():t===7&&(e.advance=r.readVarint())}s(iO,"readGlyph");function PS(t){return new vS.default(t).readFields(rO,[])}s(PS,"parseGlyphPbf");m();m();m();function Rc(t){let e=0,r=0;for(let l of t)e+=l.w*l.h,r=Math.max(r,l.w);t.sort((l,c)=>c.h-l.h);let n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],o=0,a=0;for(let l of t)for(let c=n.length-1;c>=0;c--){let u=n[c];if(!(l.w>u.w||l.h>u.h)){if(l.x=u.x,l.y=u.y,a=Math.max(a,l.y+l.h),o=Math.max(o,l.x+l.w),l.w===u.w&&l.h===u.h){let p=n.pop();c<n.length&&(n[c]=p)}else l.h===u.h?(u.x+=l.w,u.w-=l.w):l.w===u.w?(u.y+=l.h,u.h-=l.h):(n.push({x:u.x+l.w,y:u.y,w:u.w-l.w,h:l.h}),u.y+=l.h,u.h-=l.h);break}}return{w:o,h:a,fill:e/(o*a)||0}}s(Rc,"potpack");var vt=1;var by=class by{constructor(e,{pixelRatio:r,version:i,stretchX:n,stretchY:o,content:a,textFitWidth:l,textFitHeight:c}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=n,this.stretchY=o,this.content=a,this.version=i,this.textFitWidth=l,this.textFitHeight=c}get tl(){return[this.paddedRect.x+vt,this.paddedRect.y+vt]}get br(){return[this.paddedRect.x+this.paddedRect.w-vt,this.paddedRect.y+this.paddedRect.h-vt]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-vt*2)/this.pixelRatio,(this.paddedRect.h-vt*2)/this.pixelRatio]}};s(by,"ImagePosition");var is=by,xy=class xy{constructor(e,r){let i={},n={};this.haveRenderCallbacks=[];let o=[];this.addImages(e,i,o),this.addImages(r,n,o);let{w:a,h:l}=Rc(o),c=new Ye({width:a||1,height:l||1});for(let u in e){let p=e[u],f=i[u].paddedRect;Ye.copy(p.data,c,{x:0,y:0},{x:f.x+vt,y:f.y+vt},p.data)}for(let u in r){let p=r[u],f=n[u].paddedRect,h=f.x+vt,y=f.y+vt,g=p.data.width,x=p.data.height;Ye.copy(p.data,c,{x:0,y:0},{x:h,y},p.data),Ye.copy(p.data,c,{x:0,y:x-1},{x:h,y:y-1},{width:g,height:1}),Ye.copy(p.data,c,{x:0,y:0},{x:h,y:y+x},{width:g,height:1}),Ye.copy(p.data,c,{x:g-1,y:0},{x:h-1,y},{width:1,height:x}),Ye.copy(p.data,c,{x:0,y:0},{x:h+g,y},{width:1,height:x})}this.image=c,this.iconPositions=i,this.patternPositions=n}addImages(e,r,i){for(let n in e){let o=e[n],a={x:0,y:0,w:o.data.width+2*vt,h:o.data.height+2*vt};i.push(a),r[n]=new is(a,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(e,r){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let i in e.updatedImages)this.patchUpdatedImage(this.iconPositions[i],e.getImage(i),r),this.patchUpdatedImage(this.patternPositions[i],e.getImage(i),r)}patchUpdatedImage(e,r,i){if(!e||!r||e.version===r.version)return;e.version=r.version;let[n,o]=e.tl;i.update(r.data,void 0,{x:n,y:o})}};s(xy,"ImageAtlas");var gy=xy;B("ImagePosition",is);B("ImageAtlas",gy);var Wn=(n=>(n[n.none=0]="none",n[n.horizontal=1]="horizontal",n[n.vertical=2]="vertical",n[n.horizontalOnly=3]="horizontalOnly",n))(Wn||{});var IS=J(rs(),1);m();var wS=255,SS=128,Fc=wS*SS;function _y(t,e){let{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new he(t+1))};if(r.kind==="source")return{kind:"source"};{let{zoomStops:i,interpolationType:n}=r,o=0;for(;o<i.length&&i[o]<=t;)o++;o=Math.max(0,o-1);let a=o;for(;a<i.length&&i[a]<t+1;)a++;a=Math.min(i.length-1,a);let l=i[o],c=i[a];if(r.kind==="composite")return{kind:"composite",minZoom:l,maxZoom:c,interpolationType:n};let u=r.evaluate(new he(l)),p=r.evaluate(new he(c));return{kind:"camera",minZoom:l,maxZoom:c,minSize:u,maxSize:p,interpolationType:n}}}s(_y,"getSizeData");m();function Bc(t,e,r){let i="never",n=t.get(e);return n?i=n:t.get(r)&&(i="always"),i}s(Bc,"getOverlapMode");var aO=IS.default.VectorTileFeature.types,sO=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Uc(t,e,r,i,n,o,a,l,c,u,p,f,h){let y=l?Math.min(Fc,Math.round(l[0])):0,g=l?Math.min(Fc,Math.round(l[1])):0;t.emplaceBack(e,r,Math.round(i*32),Math.round(n*32),o,a,(y<<1)+(c?1:0),g,u*16,p*16,f*256,h*256)}s(Uc,"addVertex");function Nc(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}s(Nc,"addDynamicAttributes");function lO(t){for(let e of t.sections)if(Tw(e.text))return!0;return!1}s(lO,"containsRTLText");var vy=class vy{constructor(e){this.layoutVertexArray=new dc,this.indexArray=new Qe,this.programConfigurations=e,this.segments=new _e,this.dynamicLayoutVertexArray=new yc,this.opacityVertexArray=new gc,this.hasVisibleVertices=!1,this.placedSymbolArray=new Ba}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,i,n){this.isEmpty()||(i&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,lS.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,uS.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,sO,!0),this.opacityVertexBuffer.itemSize=1),(i||n)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};s(vy,"SymbolBuffers");var ss=vy;B("SymbolBuffers",ss);var Py=class Py{constructor(e,r,i){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new i,this.segments=new _e,this.collisionVertexArray=new bc}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,cS.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};s(Py,"CollisionBuffers");var ls=Py;B("CollisionBuffers",ls);var wy=class wy{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(c=>c.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=_y(this.zoom,i["text-size"]),this.iconSizeData=_y(this.zoom,i["icon-size"]);let n=this.layers[0].layout,o=n.get("symbol-sort-key"),a=n.get("symbol-z-order");this.canOverlap=Bc(n,"text-overlap","text-allow-overlap")!=="never"||Bc(n,"icon-overlap","icon-allow-overlap")!=="never"||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&!o.isConstant();let l=a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=l&&this.canOverlap,n.get("symbol-placement")==="point"&&(this.writingModes=n.get("text-writing-mode").map(c=>Wn[c])),this.stateDependentLayerIds=this.layers.filter(c=>c.isStateDependent()).map(c=>c.id),this.sourceID=e.sourceID}createArrays(){this.text=new ss(new bt(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new ss(new bt(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Na,this.lineVertexArray=new $a,this.symbolInstances=new Ua,this.textAnchorOffsets=new Va}calculateGlyphDependencies(e,r,i,n,o){for(let a=0;a<e.length;a++)if(r[e.charCodeAt(a)]=!0,(i||n)&&o){let l=fS[e.charAt(a)];l&&(r[l.charCodeAt(0)]=!0)}}populate(e,r,i){let n=this.layers[0],o=n.layout,a=o.get("text-font"),l=o.get("text-field"),c=o.get("icon-image"),u=(l.value.kind!=="constant"||l.value.value instanceof tr&&!l.value.value.isEmpty()||l.value.value.toString().length>0)&&(a.value.kind!=="constant"||a.value.value.length>0),p=c.value.kind!=="constant"||!!c.value.value||Object.keys(c.parameters).length>0,f=o.get("symbol-sort-key");if(this.features=[],!u&&!p)return;let h=r.iconDependencies,y=r.glyphDependencies,g=r.availableImages,x=new he(this.zoom,{globalState:this.globalState});for(let{feature:_,id:P,index:I,sourceLayerIndex:v}of e){let w=n._featureFilter.needGeometry,T=_t(_,w);if(!n._featureFilter.filter(x,T,i))continue;w||(T.geometry=xt(_));let A;if(u){let Z=n.getValueAndResolveTokens("text-field",T,i,g),q=tr.factory(Z),X=this.hasRTLText=this.hasRTLText||lO(q);(!X||_r.getRTLTextPluginStatus()==="unavailable"||X&&_r.isParsed())&&(A=pS(q,n,T))}let k;if(p){let Z=n.getValueAndResolveTokens("icon-image",T,i,g);Z instanceof yt?k=Z:k=yt.fromString(Z)}if(!A&&!k)continue;let L=this.sortFeaturesByKey?f.evaluate(T,{},i):void 0,R={id:P,text:A,icon:k,index:I,sourceLayerIndex:v,geometry:T.geometry,properties:_.properties,type:aO[_.type],sortKey:L};if(this.features.push(R),k&&(h[k.name]=!0),A){let Z=a.evaluate(T,{},i).join(","),q=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(2)>=0;for(let X of A.sections)if(X.image)h[X.image.name]=!0;else{let G=mh(A.toString()),F=X.fontStack||Z,K=y[F]=y[F]||{};this.calculateGlyphDependencies(X.text,K,q,this.allowVerticalPlacement,G)}}}o.get("symbol-placement")==="line"&&(this.features=mS(this.features)),this.sortFeaturesByKey&&this.features.sort((_,P)=>_.sortKey-P.sortKey)}update(e,r,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,i),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,i))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){let i=this.lineVertexArray.length;if(e.segment!==void 0){let n=e.dist(r[e.segment+1]),o=e.dist(r[e.segment]),a={};for(let l=e.segment+1;l<r.length;l++)a[l]={x:r[l].x,y:r[l].y,tileUnitDistanceFromAnchor:n},l<r.length-1&&(n+=r[l+1].dist(r[l]));for(let l=e.segment||0;l>=0;l--)a[l]={x:r[l].x,y:r[l].y,tileUnitDistanceFromAnchor:o},l>0&&(o+=r[l-1].dist(r[l]));for(let l=0;l<r.length;l++){let c=a[l];this.lineVertexArray.emplaceBack(c.x,c.y,c.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,r,i,n,o,a,l,c,u,p,f,h){let y=e.indexArray,g=e.layoutVertexArray,x=e.segments.prepareSegment(4*r.length,g,y,this.canOverlap?a.sortKey:void 0),_=this.glyphOffsetArray.length,P=x.vertexLength,I=this.allowVerticalPlacement&&l===2?Math.PI/2:0,v=a.text&&a.text.sections;for(let w=0;w<r.length;w++){let{tl:T,tr:A,bl:k,br:L,tex:R,pixelOffsetTL:Z,pixelOffsetBR:q,minFontScaleX:X,minFontScaleY:G,glyphOffset:F,isSDF:K,sectionIndex:fe}=r[w],ve=x.vertexLength,Te=F[1];Uc(g,c.x,c.y,T.x,Te+T.y,R.x,R.y,i,K,Z.x,Z.y,X,G),Uc(g,c.x,c.y,A.x,Te+A.y,R.x+R.w,R.y,i,K,q.x,Z.y,X,G),Uc(g,c.x,c.y,k.x,Te+k.y,R.x,R.y+R.h,i,K,Z.x,q.y,X,G),Uc(g,c.x,c.y,L.x,Te+L.y,R.x+R.w,R.y+R.h,i,K,q.x,q.y,X,G),Nc(e.dynamicLayoutVertexArray,c,I),y.emplaceBack(ve,ve+2,ve+1),y.emplaceBack(ve+1,ve+2,ve+3),x.vertexLength+=4,x.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(F[0]),(w===r.length-1||fe!==r[w+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(g.length,a,a.index,{},h,v&&v[fe])}e.placedSymbolArray.emplaceBack(c.x,c.y,_,this.glyphOffsetArray.length-_,P,u,p,c.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],l,0,!1,0,f)}_addCollisionDebugVertex(e,r,i,n,o,a){return r.emplaceBack(0,0),e.emplaceBack(i.x,i.y,n,o,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,r,i,n,o,a,l){let c=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),u=c.vertexLength,p=o.layoutVertexArray,f=o.collisionVertexArray,h=l.anchorX,y=l.anchorY;this._addCollisionDebugVertex(p,f,a,h,y,new as.default(e,r)),this._addCollisionDebugVertex(p,f,a,h,y,new as.default(i,r)),this._addCollisionDebugVertex(p,f,a,h,y,new as.default(i,n)),this._addCollisionDebugVertex(p,f,a,h,y,new as.default(e,n)),c.vertexLength+=4;let g=o.indexArray;g.emplaceBack(u,u+1),g.emplaceBack(u+1,u+2),g.emplaceBack(u+2,u+3),g.emplaceBack(u+3,u),c.primitiveLength+=4}addDebugCollisionBoxes(e,r,i,n){for(let o=e;o<r;o++){let a=this.collisionBoxArray.get(o),l=a.x1,c=a.y1,u=a.x2,p=a.y2;this.addCollisionDebugVertices(l,c,u,p,n?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,i)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ls(Ga,fy.members,un),this.iconCollisionBox=new ls(Ga,fy.members,un);for(let e=0;e<this.symbolInstances.length;e++){let r=this.symbolInstances.get(e);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(e,r,i,n,o,a,l,c,u){let p={};for(let f=r;f<i;f++){let h=e.get(f);p.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},p.textFeatureIndex=h.featureIndex;break}for(let f=n;f<o;f++){let h=e.get(f);p.verticalTextBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},p.verticalTextFeatureIndex=h.featureIndex;break}for(let f=a;f<l;f++){let h=e.get(f);p.iconBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},p.iconFeatureIndex=h.featureIndex;break}for(let f=c;f<u;f++){let h=e.get(f);p.verticalIconBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},p.verticalIconFeatureIndex=h.featureIndex;break}return p}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){let i=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){let i=e.placedSymbolArray.get(r),n=i.vertexStartIndex+i.numGlyphs*4;for(let o=i.vertexStartIndex;o<n;o+=4)e.indexArray.emplaceBack(o,o+2,o+1),e.indexArray.emplaceBack(o+1,o+2,o+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let r=Math.sin(e),i=Math.cos(e),n=[],o=[],a=[];for(let l=0;l<this.symbolInstances.length;++l){a.push(l);let c=this.symbolInstances.get(l);n.push(Math.round(r*c.anchorX+i*c.anchorY)|0),o.push(c.featureIndex)}return a.sort((l,c)=>n[l]-n[c]||o[c]-o[l]),a}addToSortKeyRanges(e,r){let i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===r?i.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let r of this.symbolInstanceIndexes){let i=this.symbolInstances.get(r);this.featureSortOrder.push(i.featureIndex),[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((n,o,a)=>{n>=0&&a.indexOf(n)===o&&this.addIndicesForPlacedSymbol(this.text,n)}),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)}}};s(wy,"SymbolBucket");var wr=wy;B("SymbolBucket",wr,{omit:["layers","collisionBoxArray","features","compareText"]});wr.MAX_GLYPHS=65535;wr.addDynamicAttributes=Nc;m();m();m();var Sy=class Sy{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Vi,this.defaultValue=e}evaluate(e){if(e.formattedSection){let r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){if(!this.defaultValue.isConstant()){let r=this.defaultValue.value;e(r._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};s(Sy,"FormatSectionOverride");var $c=Sy;B("FormatSectionOverride",$c,{omit:["defaultValue"]});m();m();m();m();m();m();m();m();m();m();async function CS(t,e,r,i){let n=e*256,o=n+255,a=i.transformRequest(r.replace("{fontstack}",t).replace("{range}","".concat(n,"-").concat(o)),"Glyphs"),l=await fP(a,new AbortController);if(!l||!l.data)throw new Error("Could not load glyph range. range: ".concat(e,", ").concat(n,"-").concat(o));let c={};for(let u of PS(l.data))c[u.id]=u;return c}s(CS,"loadGlyphRange");m();var Ty=class Ty{constructor({fontSize:e=24,buffer:r=3,radius:i=8,cutoff:n=.25,fontFamily:o="sans-serif",fontWeight:a="normal",fontStyle:l="normal"}={}){this.buffer=r,this.cutoff=n,this.radius=i;let c=this.size=e+r*4,u=this._createCanvas(c),p=this.ctx=u.getContext("2d",{willReadFrequently:!0});p.font="".concat(l," ").concat(a," ").concat(e,"px ").concat(o),p.textBaseline="alphabetic",p.textAlign="left",p.fillStyle="black",this.gridOuter=new Float64Array(c*c),this.gridInner=new Float64Array(c*c),this.f=new Float64Array(c),this.z=new Float64Array(c+1),this.v=new Uint16Array(c)}_createCanvas(e){let r=document.createElement("canvas");return r.width=r.height=e,r}draw(e){let{width:r,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:o,actualBoundingBoxRight:a}=this.ctx.measureText(e),l=Math.ceil(i),c=0,u=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-o))),p=Math.min(this.size-this.buffer,l+Math.ceil(n)),f=u+2*this.buffer,h=p+2*this.buffer,y=Math.max(f*h,0),g=new Uint8ClampedArray(y),x={data:g,width:f,height:h,glyphWidth:u,glyphHeight:p,glyphTop:l,glyphLeft:c,glyphAdvance:r};if(u===0||p===0)return x;let{ctx:_,buffer:P,gridInner:I,gridOuter:v}=this;_.clearRect(P,P,u,p),_.fillText(e,P,P+l);let w=_.getImageData(P,P,u,p);v.fill(1e20,0,y),I.fill(0,0,y);for(let T=0;T<p;T++)for(let A=0;A<u;A++){let k=w.data[4*(T*u+A)+3]/255;if(k===0)continue;let L=(T+P)*f+A+P;if(k===1)v[L]=0,I[L]=1e20;else{let R=.5-k;v[L]=R>0?R*R:0,I[L]=R<0?R*R:0}}MS(v,0,0,f,h,f,this.f,this.v,this.z),MS(I,P,P,u,p,f,this.f,this.v,this.z);for(let T=0;T<y;T++){let A=Math.sqrt(v[T])-Math.sqrt(I[T]);g[T]=Math.round(255-255*(A/this.radius+this.cutoff))}return x}};s(Ty,"TinySDF");var us=Ty;function MS(t,e,r,i,n,o,a,l,c){for(let u=e;u<e+i;u++)AS(t,r*o+u,o,n,a,l,c);for(let u=r;u<r+n;u++)AS(t,u*o+e,1,i,a,l,c)}s(MS,"edt");function AS(t,e,r,i,n,o,a){o[0]=0,a[0]=-1e20,a[1]=1e20,n[0]=t[e];for(let l=1,c=0,u=0;l<i;l++){n[l]=t[e+l*r];let p=l*l;do{let f=o[c];u=(n[l]-n[f]+p-f*f)/(l-f)/2}while(u<=a[c]&&--c>-1);c++,o[c]=l,a[c]=u,a[c+1]=1e20}for(let l=0,c=0;l<i;l++){for(;a[c+1]<l;)c++;let u=o[c],p=l-u;t[e+l*r]=n[u]+p*p}}s(AS,"edt1d");var Yn=class Yn{constructor(e,r){this.requestManager=e,this.localIdeographFontFamily=r,this.entries={}}setURL(e){this.url=e}async getGlyphs(e){let r=[];for(let o in e)for(let a of e[o])r.push(this._getAndCacheGlyphsPromise(o,a));let i=await Promise.all(r),n={};for(let{stack:o,id:a,glyph:l}of i)n[o]||(n[o]={}),n[o][a]=l&&{id:l.id,bitmap:l.bitmap.clone(),metrics:l.metrics};return n}async _getAndCacheGlyphsPromise(e,r){let i=this.entries[e];i||(i=this.entries[e]={glyphs:{},requests:{},ranges:{}});let n=i.glyphs[r];if(n!==void 0)return{stack:e,id:r,glyph:n};if(n=this._tinySDF(i,e,r),n)return i.glyphs[r]=n,{stack:e,id:r,glyph:n};let o=Math.floor(r/256);if(o*256>65535)throw new Error("glyphs > 65535 not supported");if(i.ranges[o])return{stack:e,id:r,glyph:n};if(!this.url)throw new Error("glyphsUrl is not set");if(!i.requests[o]){let l=Yn.loadGlyphRange(e,o,this.url,this.requestManager);i.requests[o]=l}let a=await i.requests[o];for(let l in a)this._doesCharSupportLocalGlyph(+l)||(i.glyphs[+l]=a[+l]);return i.ranges[o]=!0,{stack:e,id:r,glyph:a[r]||null}}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&(new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))||Xe["CJK Unified Ideographs"](e)||Xe["Hangul Syllables"](e)||Xe.Hiragana(e)||Xe.Katakana(e)||Xe["CJK Symbols and Punctuation"](e)||Xe["Halfwidth and Fullwidth Forms"](e))}_tinySDF(e,r,i){let n=this.localIdeographFontFamily;if(!n||!this._doesCharSupportLocalGlyph(i))return;let o=2,a=e.tinySDF;if(!a){let p="400";/bold/i.test(r)?p="900":/medium/i.test(r)?p="500":/light/i.test(r)&&(p="200"),a=e.tinySDF=new Yn.TinySDF({fontSize:24*o,buffer:3*o,radius:8*o,cutoff:.25,fontFamily:n,fontWeight:p})}let l=a.draw(String.fromCharCode(i));return{id:i,bitmap:new Zn({width:l.width||30*o,height:l.height||30*o},l.data),metrics:{width:l.glyphWidth/o||24,height:l.glyphHeight/o||24,left:l.glyphLeft/o+.5||0,top:l.glyphTop/o-27.5||-8,advance:l.glyphAdvance/o||24,isDoubleResolution:!0}}}};s(Yn,"GlyphManager"),Yn.loadGlyphRange=CS,Yn.TinySDF=us;var Iy=Yn;m();m();var jQ=new ot({"sky-color":new Oe(lt.sky["sky-color"]),"horizon-color":new Oe(lt.sky["horizon-color"]),"fog-color":new Oe(lt.sky["fog-color"]),"fog-ground-blend":new Oe(lt.sky["fog-ground-blend"]),"horizon-fog-blend":new Oe(lt.sky["horizon-fog-blend"]),"sky-horizon-blend":new Oe(lt.sky["sky-horizon-blend"]),"atmosphere-blend":new Oe(lt.sky["atmosphere-blend"])});m();m();m();m();var Cy=class Cy{constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}};s(Cy,"ThrottledInvoker");var Vc=Cy;var cO={once:!0},My=class My{constructor(e,r){this.target=e,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Vc(()=>this.process()),this.subscription=Go(this.target,"message",i=>this.receive(i),!1),this.globalScope=zr(self)?e:window}registerMessageHandler(e,r){this.messageHandlers[e]=r}sendAsync(e,r){return new Promise((i,n)=>{let o=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=r?Go(r.signal,"abort",()=>{a==null||a.unsubscribe(),delete this.resolveRejects[o];let u={id:o,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(u)},cO):null;this.resolveRejects[o]={resolve:s(u=>{a==null||a.unsubscribe(),i(u)},"resolve"),reject:s(u=>{a==null||a.unsubscribe(),n(u)},"reject")};let l=[],c=j(C({},e),{id:o,sourceMapId:this.mapId,origin:location.origin,data:Zi(e.data,l)});this.target.postMessage(c,{transfer:l})})}receive(e){let r=e.data,i=r.id;if(!(r.origin!=="file://"&&location.origin!=="file://"&&r.origin!=="resource://android"&&location.origin!=="resource://android"&&r.origin!==location.origin)&&!(r.targetMapId&&this.mapId!==r.targetMapId)){if(r.type==="<cancel>"){delete this.tasks[i];let n=this.abortControllers[i];delete this.abortControllers[i],n&&n.abort();return}if(zr(self)||r.mustQueue){this.tasks[i]=r,this.taskQueue.push(i),this.invoker.trigger();return}this.processTask(i,r)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),r=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(e,r)}async processTask(e,r){if(r.type==="<response>"){let o=this.resolveRejects[e];if(delete this.resolveRejects[e],!o)return;r.error?o.reject(Xi(r.error)):o.resolve(Xi(r.data));return}if(!this.messageHandlers[r.type]){this.completeTask(e,new Error("Could not find a registered handler for ".concat(r.type,", map ID: ").concat(this.mapId,", available handlers: ").concat(Object.keys(this.messageHandlers).join(", "))));return}let i=Xi(r.data),n=new AbortController;this.abortControllers[e]=n;try{let o=await this.messageHandlers[r.type](r.sourceMapId,i,n);this.completeTask(e,null,o)}catch(o){this.completeTask(e,o)}}completeTask(e,r,i){let n=[];delete this.abortControllers[e];let o={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:r?Zi(r):null,data:Zi(i,n)};this.target.postMessage(o,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};s(My,"Actor");var jc=My;m();m();m();m();var ES='(()=>{var Xy=Object.create;var Wi=Object.defineProperty,Hy=Object.defineProperties,Zy=Object.getOwnPropertyDescriptor,Jy=Object.getOwnPropertyDescriptors,Yy=Object.getOwnPropertyNames,lu=Object.getOwnPropertySymbols,Ky=Object.getPrototypeOf,cu=Object.prototype.hasOwnProperty,Qy=Object.prototype.propertyIsEnumerable;var uu=(t,e,r)=>e in t?Wi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$t=(t,e)=>{for(var r in e||(e={}))cu.call(e,r)&&uu(t,r,e[r]);if(lu)for(var r of lu(e))Qy.call(e,r)&&uu(t,r,e[r]);return t},Xi=(t,e)=>Hy(t,Jy(e));var ve=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),em=(t,e)=>{for(var r in e)Wi(t,r,{get:e[r],enumerable:!0})},tm=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Yy(e))!cu.call(t,i)&&i!==r&&Wi(t,i,{get:()=>e[i],enumerable:!(n=Zy(e,i))||n.enumerable});return t};var Y=(t,e,r)=>(r=t!=null?Xy(Ky(t)):{},tm(e||!t||!t.__esModule?Wi(r,"default",{value:t,enumerable:!0}):r,t));var ye=ve((x0,pu)=>{"use strict";pu.exports=dr;function dr(t,e){this.x=t,this.y=e}dr.prototype={clone:function(){return new dr(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}};dr.convert=function(t){return t instanceof dr?t:Array.isArray(t)?new dr(t[0],t[1]):t}});var mu=ve((b0,yu)=>{"use strict";yu.exports=fu;function fu(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}fu.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)<e)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r=r-i/o}var a=0,s=1;for(r=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?a=r:s=r,r=(s-a)*.5+a;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}}});var cp=ve((Hv,rl)=>{function kg(t,e){var r,n,i,o,a,s,l,u,c,p;for(r=t.length&3,n=t.length-r,i=e,a=3432918353,l=461845907,p=0;p<n;)c=t.charCodeAt(p)&255|(t.charCodeAt(++p)&255)<<8|(t.charCodeAt(++p)&255)<<16|(t.charCodeAt(++p)&255)<<24,++p,c=(c&65535)*a+(((c>>>16)*a&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*l+(((c>>>16)*l&65535)<<16)&4294967295,i^=c,i=i<<13|i>>>19,o=(i&65535)*5+(((i>>>16)*5&65535)<<16)&4294967295,i=(o&65535)+27492+(((o>>>16)+58964&65535)<<16);switch(c=0,r){case 3:c^=(t.charCodeAt(p+2)&255)<<16;case 2:c^=(t.charCodeAt(p+1)&255)<<8;case 1:c^=t.charCodeAt(p)&255,c=(c&65535)*a+(((c>>>16)*a&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*l+(((c>>>16)*l&65535)<<16)&4294967295,i^=c}return i^=t.length,i^=i>>>16,i=(i&65535)*2246822507+(((i>>>16)*2246822507&65535)<<16)&4294967295,i^=i>>>13,i=(i&65535)*3266489909+(((i>>>16)*3266489909&65535)<<16)&4294967295,i^=i>>>16,i>>>0}typeof rl<"u"&&(rl.exports=kg)});var pp=ve((Zv,nl)=>{function Fg(t,e){for(var r=t.length,n=e^r,i=0,o;r>=4;)o=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.charCodeAt(++i)&255)<<24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),o^=o>>>24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)^o,r-=4,++i;switch(r){case 3:n^=(t.charCodeAt(i+2)&255)<<16;case 2:n^=(t.charCodeAt(i+1)&255)<<8;case 1:n^=t.charCodeAt(i)&255,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)}return n^=n>>>13,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16),n^=n>>>15,n>>>0}typeof nl!==void 0&&(nl.exports=Fg)});var il=ve((Jv,ia)=>{var fp=cp(),Eg=pp();ia.exports=fp;ia.exports.murmur3=fp;ia.exports.murmur2=Eg});var xl=ve((NS,Zp)=>{"use strict";var gx=ye();Zp.exports=zr;function zr(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(xx,this,e)}function xx(t,e,r){t==1?e.id=r.readVarint():t==2?bx(r,e):t==3?e.type=r.readVarint():t==4&&(e._geometry=r.pos)}function bx(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}zr.types=["Unknown","Point","LineString","Polygon"];zr.prototype.loadGeometry=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=[],s;t.pos<e;){if(n<=0){var l=t.readVarint();r=l&7,n=l>>3}if(n--,r===1||r===2)i+=t.readSVarint(),o+=t.readSVarint(),r===1&&(s&&a.push(s),s=[]),s.push(new gx(i,o));else if(r===7)s&&s.push(s[0].clone());else throw new Error("unknown command "+r)}return s&&a.push(s),a};zr.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,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();r=c&7,n=c>>3}if(n--,r===1||r===2)i+=t.readSVarint(),o+=t.readSVarint(),i<a&&(a=i),i>s&&(s=i),o<l&&(l=o),o>u&&(u=o);else if(r!==7)throw new Error("unknown command "+r)}return[a,l,s,u]};zr.prototype.toGeoJSON=function(t,e,r){var n=this.extent*Math.pow(2,r),i=this.extent*t,o=this.extent*e,a=this.loadGeometry(),s=zr.types[this.type],l,u;function c(y){for(var m=0;m<y.length;m++){var h=y[m],g=180-(h.y+o)*360/n;y[m]=[(h.x+i)*360/n-180,360/Math.PI*Math.atan(Math.exp(g*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(l=0;l<a.length;l++)p[l]=a[l][0];a=p,c(a);break;case 2:for(l=0;l<a.length;l++)c(a[l]);break;case 3:for(a=vx(a),l=0;l<a.length;l++)for(u=0;u<a[l].length;u++)c(a[l][u]);break}a.length===1?a=a[0]:s="Multi"+s;var f={type:"Feature",geometry:{type:s,coordinates:a},properties:this.properties};return"id"in this&&(f.id=this.id),f};function vx(t){var e=t.length;if(e<=1)return[t];for(var r=[],n,i,o=0;o<e;o++){var a=Px(t[o]);a!==0&&(i===void 0&&(i=a<0),i===a<0?(n&&r.push(n),n=[t[o]]):n.push(t[o]))}return n&&r.push(n),r}function Px(t){for(var e=0,r=0,n=t.length,i=n-1,o,a;r<n;i=r++)o=t[r],a=t[i],e+=(a.x-o.x)*(o.y+a.y);return e}});var bl=ve((US,Yp)=>{"use strict";var Sx=xl();Yp.exports=Jp;function Jp(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(wx,this,e),this.length=this._features.length}function wx(t,e,r){t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(Ax(r))}function Ax(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}Jp.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 Sx(this._pbf,e,this.extent,this._keys,this._values)}});var Qp=ve(($S,Kp)=>{"use strict";var _x=bl();Kp.exports=Ix;function Ix(t,e){this.layers=t.readFields(Tx,{},e)}function Tx(t,e,r){if(t===3){var n=new _x(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}});var Rt=ve((jS,Sa)=>{Sa.exports.VectorTile=Qp();Sa.exports.VectorTileFeature=xl();Sa.exports.VectorTileLayer=bl()});var Pf=ve(Al=>{Al.read=function(t,e,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,u=l>>1,c=-7,p=r?i-1:0,f=r?-1:1,y=t[e+p];for(p+=f,o=y&(1<<-c)-1,y>>=-c,c+=s;c>0;o=o*256+t[e+p],p+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+t[e+p],p+=f,c-=8);if(o===0)o=1-u;else{if(o===l)return a?NaN:(y?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-u}return(y?-1:1)*a*Math.pow(2,o-n)};Al.write=function(t,e,r,n,i,o){var a,s,l,u=o*8-i-1,c=(1<<u)-1,p=c>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:o-1,m=n?1:-1,h=e<0||e===0&&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*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?e+=f/l:e+=f*Math.pow(2,1-p),e*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*l-1)*Math.pow(2,i),a=a+p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+y]=s&255,y+=m,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[r+y]=a&255,y+=m,a/=256,u-=8);t[r+y-m]|=h*128}});var hi=ve((PA,If)=>{"use strict";If.exports=J;var Ta=Pf();function J(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}J.Varint=0;J.Fixed64=1;J.Bytes=2;J.Fixed32=5;var _l=65536*65536,Sf=1/_l,Wx=12,_f=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");J.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,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=Ca(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Af(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ca(this.buf,this.pos)+Ca(this.buf,this.pos+4)*_l;return this.pos+=8,t},readSFixed64:function(){var t=Ca(this.buf,this.pos)+Af(this.buf,this.pos+4)*_l;return this.pos+=8,t},readFloat:function(){var t=Ta.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ta.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e=this.buf,r,n;return n=e[this.pos++],r=n&127,n<128||(n=e[this.pos++],r|=(n&127)<<7,n<128)||(n=e[this.pos++],r|=(n&127)<<14,n<128)||(n=e[this.pos++],r|=(n&127)<<21,n<128)?r:(n=e[this.pos],r|=(n&15)<<28,Xx(r,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!!this.readVarint()},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=Wx&&_f?sb(this.buf,e,t):ab(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!==J.Bytes)return t.push(this.readVarint(e));var r=mt(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==J.Bytes)return t.push(this.readSVarint());var e=mt(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==J.Bytes)return t.push(this.readBoolean());var e=mt(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==J.Bytes)return t.push(this.readFloat());var e=mt(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==J.Bytes)return t.push(this.readDouble());var e=mt(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==J.Bytes)return t.push(this.readFixed32());var e=mt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==J.Bytes)return t.push(this.readSFixed32());var e=mt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==J.Bytes)return t.push(this.readFixed64());var e=mt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==J.Bytes)return t.push(this.readSFixed64());var e=mt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=t&7;if(e===J.Varint)for(;this.buf[this.pos++]>127;);else if(e===J.Bytes)this.pos=this.readVarint()+this.pos;else if(e===J.Fixed32)this.pos+=4;else if(e===J.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Nr(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Nr(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Nr(this.buf,t&-1,this.pos),Nr(this.buf,Math.floor(t*Sf),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Nr(this.buf,t&-1,this.pos),Nr(this.buf,Math.floor(t*Sf),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){Hx(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(!!t)},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=lb(this.buf,t,this.pos);var r=this.pos-e;r>=128&&wf(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Ta.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ta.write(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<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&wf(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,J.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Yx,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Kx,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,tb,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Qx,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,eb,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,rb,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,nb,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,ib,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ob,e)},writeBytesField:function(t,e){this.writeTag(t,J.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,J.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,J.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,J.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,J.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,J.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,J.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,J.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,J.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,J.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,!!e)}};function Xx(t,e,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return Gr(t,i,e);throw new Error("Expected varint not more than 10 bytes")}function mt(t){return t.type===J.Bytes?t.readVarint()+t.pos:t.pos+1}function Gr(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Hx(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(r=~(-t%4294967296),n=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),Zx(r,n,e),Jx(n,e)}function Zx(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function Jx(t,e){var r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function wf(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Yx(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Kx(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Qx(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function eb(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function tb(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function rb(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function nb(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function ib(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function ob(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Ca(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}function Nr(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Af(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function ab(t,e,r){for(var n="",i=e;i<r;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>r)break;var l,u,c;s===1?o<128&&(a=o):s===2?(l=t[i+1],(l&192)===128&&(a=(o&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=t[i+1],u=t[i+2],(l&192)===128&&(u&192)===128&&(a=(o&15)<<12|(l&63)<<6|u&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=t[i+1],u=t[i+2],c=t[i+3],(l&192)===128&&(u&192)===128&&(c&192)===128&&(a=(o&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=s}return n}function sb(t,e,r){return _f.decode(t.subarray(e,r))}function lb(t,e,r){for(var n=0,i,o;n<e.length;n++){if(i=e.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=i;continue}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=i&63|128)}return r}});var Sy=ve((yT,Py)=>{Py.exports=Ya;function Ya(t,e){var r=t&&t.type,n;if(r==="FeatureCollection")for(n=0;n<t.features.length;n++)Ya(t.features[n],e);else if(r==="GeometryCollection")for(n=0;n<t.geometries.length;n++)Ya(t.geometries[n],e);else if(r==="Feature")Ya(t.geometry,e);else if(r==="Polygon")by(t.coordinates,e);else if(r==="MultiPolygon")for(n=0;n<t.coordinates.length;n++)by(t.coordinates[n],e);return t}function by(t,e){if(t.length!==0){vy(t[0],e);for(var r=1;r<t.length;r++)vy(t[r],!e)}}function vy(t,e){for(var r=0,n=0,i=0,o=t.length,a=o-1;i<o;a=i++){var s=(t[i][0]-t[a][0])*(t[a][1]+t[i][1]),l=r+s;n+=Math.abs(r)>=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!e&&t.reverse()}});var Iy=ve((dT,_y)=>{"use strict";var Zb=ye(),Jb=Rt().VectorTileFeature;_y.exports=Ay;function Ay(t,e){this.options=e||{},this.features=t,this.length=t.length}Ay.prototype.feature=function(t){return new Qa(this.features[t],this.options.extent)};function Qa(t,e){this.id=typeof t.id=="number"?t.id:void 0,this.type=t.type,this.rawGeometry=t.type===1?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}Qa.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new Zb(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry};Qa.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var l=a[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]};Qa.prototype.toGeoJSON=Jb.prototype.toGeoJSON});var ky=ve((gT,Di)=>{var Yb=hi(),Cy=Iy();Di.exports=jl;Di.exports.fromVectorTileJs=jl;Di.exports.fromGeojsonVt=Kb;Di.exports.GeoJSONWrapper=Cy;function jl(t){var e=new Yb;return Qb(t,e),e.finish()}function Kb(t,e){e=e||{};var r={};for(var n in t)r[n]=new Cy(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return jl({layers:r})}function Qb(t,e){for(var r in t.layers)e.writeMessage(3,e0,t.layers[r])}function e0(t,e){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r,n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,t0,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var o=n.values;for(r=0;r<o.length;r++)e.writeMessage(4,i0,o[r])}function t0(t,e){var r=t.feature;r.id!==void 0&&e.writeVarintField(1,r.id),e.writeMessage(2,r0,t),e.writeVarintField(3,r.type),e.writeMessage(4,n0,r)}function r0(t,e){var r=t.feature,n=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in r.properties){var l=r.properties[s],u=o[s];if(l!==null){typeof u>"u"&&(n.push(s),u=n.length-1,o[s]=u),e.writeVarint(u);var c=typeof l;c!=="string"&&c!=="boolean"&&c!=="number"&&(l=JSON.stringify(l));var p=c+":"+l,f=a[p];typeof f>"u"&&(i.push(l),f=i.length-1,a[p]=f),e.writeVarint(f)}}}function $l(t,e){return(e<<3)+(t&7)}function Ty(t){return t<<1^t>>31}function n0(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s<a;s++){var l=r[s],u=1;n===1&&(u=l.length),e.writeVarint($l(1,u));for(var c=n===3?l.length-1:l.length,p=0;p<c;p++){p===1&&n!==1&&e.writeVarint($l(2,c-1));var f=l[p].x-i,y=l[p].y-o;e.writeVarint(Ty(f)),e.writeVarint(Ty(y)),i+=f,o+=y}n===3&&e.writeVarint($l(7,1))}}function i0(t,e){var r=typeof t;r==="string"?e.writeStringField(1,t):r==="boolean"?e.writeBooleanField(7,t):r==="number"&&(t%1!==0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}});var Vm=Y(ye(),1),Iu=Y(mu(),1);var cs;function hu(){return cs==null&&(cs=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),cs}var Hi;function du(){if(Hi==null&&(Hi=!1,hu())){let r=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(r){for(let i=0;i<5*5;i++){let o=i*4;r.fillStyle="rgb(".concat(o,",").concat(o+1,",").concat(o+2,")"),r.fillRect(i%5,Math.floor(i/5),1,1)}let n=r.getImageData(0,0,5,5).data;for(let i=0;i<5*5*4;i++)if(i%4!==3&&n[i]!==i){Hi=!0;break}}}return Hi||!1}var Yr=1e-6,Kr=typeof Float32Array<"u"?Float32Array:Array,Qr=Math.random;var w0=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Zi={};em(Zi,{add:()=>sm,ceil:()=>lm,clone:()=>nm,copy:()=>om,create:()=>gu,cross:()=>bm,dist:()=>Em,distance:()=>Pu,div:()=>Fm,divide:()=>vu,dot:()=>xm,equals:()=>Tm,exactEquals:()=>Im,floor:()=>um,forEach:()=>Bm,fromValues:()=>im,inverse:()=>dm,len:()=>Lm,length:()=>wu,lerp:()=>vm,max:()=>pm,min:()=>cm,mul:()=>km,multiply:()=>bu,negate:()=>hm,normalize:()=>gm,random:()=>Pm,round:()=>fm,scale:()=>ym,scaleAndAdd:()=>mm,set:()=>am,sqrDist:()=>Mm,sqrLen:()=>Dm,squaredDistance:()=>Su,squaredLength:()=>Au,str:()=>_m,sub:()=>Cm,subtract:()=>xu,transformMat4:()=>Sm,transformQuat:()=>wm,zero:()=>Am});function gu(){var t=new Kr(4);return Kr!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function nm(t){var e=new Kr(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function im(t,e,r,n){var i=new Kr(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function om(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function am(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function sm(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function xu(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function bu(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function vu(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function lm(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function um(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function cm(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function pm(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function fm(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function ym(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function mm(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function Pu(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(r,n,i,o)}function Su(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return r*r+n*n+i*i+o*o}function wu(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function Au(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function hm(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function dm(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function gm(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}function xm(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function bm(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],l=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],p=e[1],f=e[2],y=e[3];return t[0]=p*u-f*l+y*s,t[1]=-(c*u)+f*a-y*o,t[2]=c*l-p*a+y*i,t[3]=-(c*s)+p*o-f*i,t}function vm(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}function Pm(t,e){e=e||1;var r,n,i,o,a,s;do r=Qr()*2-1,n=Qr()*2-1,a=r*r+n*n;while(a>=1);do i=Qr()*2-1,o=Qr()*2-1,s=i*i+o*o;while(s>=1);var l=Math.sqrt((1-a)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*l,t[3]=e*o*l,t}function Sm(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}function wm(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*o-l*i,p=u*i+l*n-a*o,f=u*o+a*i-s*n,y=-a*n-s*i-l*o;return t[0]=c*u+y*-a+p*-l-f*-s,t[1]=p*u+y*-s+f*-a-c*-l,t[2]=f*u+y*-l+c*-s-p*-a,t[3]=e[3],t}function Am(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function _m(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function Im(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function Tm(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],l=e[2],u=e[3];return Math.abs(r-a)<=Yr*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=Yr*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-l)<=Yr*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-u)<=Yr*Math.max(1,Math.abs(o),Math.abs(u))}var Cm=xu,km=bu,Fm=vu,Em=Pu,Mm=Su,Lm=wu,Dm=Au,Bm=function(){var t=gu();return function(e,r,n,i,o,a){var s,l;for(r||(r=4),n||(n=0),i?l=Math.min(i*r+n,e.length):l=e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}();function Tu(t){if(t<=0)return 0;if(t>=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Rm(t,e,r,n){let i=new Iu.default(t,e,r,n);return o=>i.solve(o)}var E0=Rm(.25,.1,.25,1);function it(t,e,r){return Math.min(r,Math.max(e,t))}function Cu(t,e,r){let n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function de(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}function ku(t){return Math.log(t)/Math.LN2%1===0}function rn(t,e,r){let n={};for(let i in t)n[i]=e.call(r||this,t[i],i,t);return n}function Fu(t,e,r){let n={};for(let i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function nt(t){return Array.isArray(t)?t.map(nt):typeof t=="object"&&t?rn(t,nt):t}var _u={};function ce(t){_u[t]||(typeof console<"u"&&console.warn(t),_u[t]=!0)}function ot(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function at(t){return typeof WorkerGlobalScope<"u"&&typeof t<"u"&&t instanceof WorkerGlobalScope}function vt(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}function zm(t,e,r,n,i){let o=Math.max(-e,0)*4,l=(Math.max(0,r)-r)*n*4+o,u=n*4,c=Math.max(0,e),p=Math.max(0,r),f=Math.min(t.width,e+n),y=Math.min(t.height,r+i);return{rect:{x:c,y:p,width:f-c,height:y-p},layout:[{offset:l,stride:u}]}}async function Om(t,e,r,n,i){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let o=new VideoFrame(t,{timestamp:0});try{let a=o==null?void 0:o.format;if(!a||!(a.startsWith("BGR")||a.startsWith("RGB")))throw new Error("Unrecognized format ".concat(a));let s=a.startsWith("BGR"),l=new Uint8ClampedArray(n*i*4);if(await o.copyTo(l,zm(t,e,r,n,i)),s)for(let u=0;u<l.length;u+=4){let c=l[u];l[u]=l[u+2],l[u+2]=c}return l}finally{o.close()}}var en,tn;function Gm(t,e,r,n,i){let o=t.width,a=t.height;(!en||!tn)&&(en=new OffscreenCanvas(o,a),tn=en.getContext("2d",{willReadFrequently:!0})),en.width=o,en.height=a,tn.drawImage(t,0,0,o,a);let s=tn.getImageData(e,r,n,i);return tn.clearRect(0,0,o,a),s.data}async function Eu(t,e,r,n,i){if(du())try{return await Om(t,e,r,n,i)}catch(o){}return Gm(t,e,r,n,i)}function ps(t,e,r,n){return t.addEventListener(e,r,n),{unsubscribe:()=>{t.removeEventListener(e,r,n)}}}function fs(t){return t*Math.PI/180}var Ji=25,Yi=0;var jt=class t{constructor(e,r,n){let i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let a=new Int32Array(this.arrayBuffer);e=a[0],r=a[1],n=a[2],this.d=r+2*n;for(let u=0;u<this.d*this.d;u++){let c=a[3+u],p=a[3+u+1];i.push(c===p?null:a.subarray(c,p))}let s=a[3+i.length],l=a[3+i.length+1];this.keys=a.subarray(s,l),this.bboxes=a.subarray(l),this.insert=this._insertReadonly}else{this.d=r+2*n;for(let a=0;a<this.d*this.d;a++)i.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=n,this.scale=r/e,this.uid=0;let o=n/r*e;this.min=-o,this.max=e+o}insert(e,r,n,i,o){this._forEachCell(r,n,i,o,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(o)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,r,n,i,o,a){this.cells[o].push(a)}query(e,r,n,i,o){let a=this.min,s=this.max;if(e<=a&&r<=a&&s<=n&&s<=i&&!o)return Array.prototype.slice.call(this.keys);{let l=[],u={};return this._forEachCell(e,r,n,i,this._queryCell,l,u,o),l}}_queryCell(e,r,n,i,o,a,s,l){let u=this.cells[o];if(u!==null){let c=this.keys,p=this.bboxes;for(let f=0;f<u.length;f++){let y=u[f];if(s[y]===void 0){let m=y*4;(l?l(p[m+0],p[m+1],p[m+2],p[m+3]):e<=p[m+2]&&r<=p[m+3]&&n>=p[m+0]&&i>=p[m+1])?(s[y]=!0,a.push(c[y])):s[y]=!1}}}}_forEachCell(e,r,n,i,o,a,s,l){let u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),p=this._convertToCellCoord(n),f=this._convertToCellCoord(i);for(let y=u;y<=p;y++)for(let m=c;m<=f;m++){let h=this.d*m+y;if(!(l&&!l(this._convertFromCellCoord(y),this._convertFromCellCoord(m),this._convertFromCellCoord(y+1),this._convertFromCellCoord(m+1)))&&o.call(this,e,r,n,i,h,a,s,l))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,r=3+this.cells.length+1+1,n=0;for(let a=0;a<this.cells.length;a++)n+=this.cells[a].length;let i=new Int32Array(r+n+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;let o=r;for(let a=0;a<e.length;a++){let s=e[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+e.length]=o,i.set(this.keys,o),o+=this.keys.length,i[3+e.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer}static serialize(e,r){let n=e.toArrayBuffer();return r&&r.push(n),{buffer:n}}static deserialize(e){return new t(e.buffer)}};var Nm=8,Um={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},$m={"*":{type:"source"}},jm=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],qm={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Wm={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Xm={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Hm={type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Zm={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Jm={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Ym={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},Km=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],Qm={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},eh={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},th={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},rh={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},nh={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ih={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},oh={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ah={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},sh={type:"array",value:"*"},lh={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},uh={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},ch={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},ph={type:"array",value:"*",minimum:1},fh={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},yh={"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},mh={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},hh={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},dh=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],gh={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},xh={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},bh={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},vh={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Ph={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},Sh={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},wh={"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},Ah={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},_h={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Ih={"*":{type:"string"}},P={$version:Nm,$root:Um,sources:$m,source:jm,source_vector:qm,source_raster:Wm,source_raster_dem:Xm,source_geojson:Hm,source_video:Zm,source_image:Jm,layer:Ym,layout:Km,layout_background:Qm,layout_fill:eh,layout_circle:th,layout_heatmap:rh,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:nh,layout_symbol:ih,layout_raster:oh,layout_hillshade:ah,"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:sh,filter_operator:lh,geometry_type:uh,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:ch,expression:ph,light:fh,sky:yh,terrain:mh,projection:hh,paint:dh,paint_fill:gh,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:xh,paint_circle:bh,paint_heatmap:vh,paint_symbol:Ph,paint_raster:Sh,paint_hillshade:wh,"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:Ah,transition:_h,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:Ih},Th=["type","source","source-layer","minzoom","maxzoom","filter","layout"];var C=class{constructor(e,r,n,i){this.message=(e?"".concat(e,": "):"")+n,i&&(this.identifier=i),r!=null&&r.__line__&&(this.line=r.__line__)}};function vr(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}var Ve=class extends Error{constructor(e,r){super(r),this.message=r,this.key=e}},Ss=class t{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[n,i]of r)this.bindings[n]=i}concat(e){return new t(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error("".concat(e," not found in scope."))}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},Ar={kind:"null"},k={kind:"number"},$={kind:"string"},U={kind:"boolean"},ze={kind:"color"},go={kind:"projectionDefinition"},Xt={kind:"object"},N={kind:"value"},Ch={kind:"error"},xo={kind:"collator"},_r={kind:"formatted"},bo={kind:"padding"},sn={kind:"colorArray"},vo={kind:"numberArray"},Pn={kind:"resolvedImage"},Po={kind:"variableAnchorOffsetCollection"};function Ce(t,e){return{kind:"array",itemType:t,N:e}}function ie(t){if(t.kind==="array"){let e=ie(t.itemType);return typeof t.N=="number"?"array<".concat(e,", ").concat(t.N,">"):t.itemType.kind==="value"?"array":"array<".concat(e,">")}else return t.kind}var kh=[Ar,k,$,U,ze,go,_r,Xt,Ce(N),bo,vo,sn,Pn,Po];function ln(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!ln(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of kh)if(!ln(r,e))return null}}return"Expected ".concat(ie(t)," but found ").concat(ie(e)," instead.")}function Gs(t,e){return e.some(r=>r.kind===t.kind)}function Ht(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}function Pt(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}var Ku=.96422,Qu=1,ec=.82521,tc=4/29,br=6/29,rc=3*br*br,Fh=br*br*br,Eh=Math.PI/180,Mh=180/Math.PI;function nc(t){return t=t%360,t<0&&(t+=360),t}function ic([t,e,r,n]){t=ys(t),e=ys(e),r=ys(r);let i,o,a=ms((.2225045*t+.7168786*e+.0606169*r)/Qu);t===e&&e===r?i=o=a:(i=ms((.4360747*t+.3850649*e+.1430804*r)/Ku),o=ms((.0139322*t+.0971045*e+.7141733*r)/ec));let s=116*a-16;return[s<0?0:s,500*(i-a),200*(a-o),n]}function ys(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ms(t){return t>Fh?Math.pow(t,1/3):t/rc+tc}function oc([t,e,r,n]){let i=(t+16)/116,o=isNaN(e)?i:i+e/500,a=isNaN(r)?i:i-r/200;return i=Qu*ds(i),o=Ku*ds(o),a=ec*ds(a),[hs(3.1338561*o-1.6168667*i-.4906146*a),hs(-.9787684*o+1.9161415*i+.033454*a),hs(.0719453*o-.2289914*i+1.4052427*a),n]}function hs(t){return t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055,t<0?0:t>1?1:t}function ds(t){return t>br?t*t*t:rc*(t-tc)}function Lh(t){let[e,r,n,i]=ic(t),o=Math.sqrt(r*r+n*n);return[Math.round(o*1e4)?nc(Math.atan2(n,r)*Mh):NaN,o,e,i]}function Dh([t,e,r,n]){return t=isNaN(t)?0:t*Eh,oc([r,Math.cos(t)*e,Math.sin(t)*e,n])}function Bh([t,e,r,n]){t=nc(t),e/=100,r/=100;function i(o){let a=(o+t/30)%12,s=e*Math.min(r,1-r);return r-s*Math.max(-1,Math.min(a-3,9-a,1))}return[i(0),i(8),i(4),n]}var Vh=Object.hasOwn||function(e,r){return Object.prototype.hasOwnProperty.call(e,r)};function on(t,e){return Vh(t,e)?t[e]:void 0}function Rh(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=on(zh,t);if(e){let[i,o,a]=e;return[i/255,o/255,a/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let o=t.length<6?1:2,a=1;return[Ki(t.slice(a,a+=o)),Ki(t.slice(a,a+=o)),Ki(t.slice(a,a+=o)),Ki(t.slice(a,a+o)||"ff")]}if(t.startsWith("rgb")){let i=/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/,o=t.match(i);if(o){let[a,s,l,u,c,p,f,y,m,h,g,d]=o,b=[u||" ",f||" ",h].join("");if(b===" "||b===" /"||b===",,"||b===",,,"){let x=[l,p,m].join(""),v=x==="%%%"?100:x===""?255:0;if(v){let S=[gr(+s/v,0,1),gr(+c/v,0,1),gr(+y/v,0,1),g?Mu(+g,d):1];if(Lu(S))return S}}return}}let r=/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/,n=t.match(r);if(n){let[i,o,a,s,l,u,c,p,f]=n,y=[a||" ",l||" ",c].join("");if(y===" "||y===" /"||y===",,"||y===",,,"){let m=[+o,gr(+s,0,100),gr(+u,0,100),p?Mu(+p,f):1];if(Lu(m))return Bh(m)}}}function Ki(t){return parseInt(t.padEnd(2,t),16)/255}function Mu(t,e){return gr(e?t/100:t,0,1)}function gr(t,e,r){return Math.min(Math.max(e,t),r)}function Lu(t){return!t.some(Number.isNaN)}var zh={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function wt(t,e,r){return t+r*(e-t)}function Pr(t,e,r){return t.map((n,i)=>wt(n,e[i],r))}function Oh(t){return t==="rgb"||t==="hcl"||t==="lab"}var H=class t{constructor(e,r,n,i=1,o=!0){this.r=e,this.g=r,this.b=n,this.a=i,o||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,r,n,i]))}static parse(e){if(e instanceof t)return e;if(typeof e!="string")return;let r=Rh(e);if(r)return new t(...r,!1)}get rgb(){let{r:e,g:r,b:n,a:i}=this,o=i||1/0;return this.overwriteGetter("rgb",[e/o,r/o,n/o,i])}get hcl(){return this.overwriteGetter("hcl",Lh(this.rgb))}get lab(){return this.overwriteGetter("lab",ic(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,n,i]=this.rgb;return"rgba(".concat([e,r,n].map(o=>Math.round(o*255)).join(","),",").concat(i,")")}static interpolate(e,r,n,i="rgb"){switch(i){case"rgb":{let[o,a,s,l]=Pr(e.rgb,r.rgb,n);return new t(o,a,s,l,!1)}case"hcl":{let[o,a,s,l]=e.hcl,[u,c,p,f]=r.hcl,y,m;if(!isNaN(o)&&!isNaN(u)){let x=u-o;u>o&&x>180?x-=360:u<o&&o-u>180&&(x+=360),y=o+n*x}else isNaN(o)?isNaN(u)?y=NaN:(y=u,(s===1||s===0)&&(m=c)):(y=o,(p===1||p===0)&&(m=a));let[h,g,d,b]=Dh([y,m!=null?m:wt(a,c,n),wt(s,p,n),wt(l,f,n)]);return new t(h,g,d,b,!1)}case"lab":{let[o,a,s,l]=oc(Pr(e.lab,r.lab,n));return new t(o,a,s,l,!1)}}}};H.black=new H(0,0,0,1);H.white=new H(1,1,1,1);H.transparent=new H(0,0,0,0);H.red=new H(1,0,0,1);var un=class{constructor(e,r,n){e?this.sensitivity=r?"variant":"case":this.sensitivity=r?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}},Gh=["bottom","center","top"],cn=class{constructor(e,r,n,i,o,a){this.text=e,this.image=r,this.scale=n,this.fontStack=i,this.textColor=o,this.verticalAlign=a}},Fe=class t{constructor(e){this.sections=e}static fromString(e){return new t([new cn(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof t?e:t.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},Oe=class t{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="number")return new t([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]];break}return new t(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n){return new t(Pr(e.values,r.values,n))}},Ge=class t{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="number")return new t([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!="number")return;return new t(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n){return new t(Pr(e.values,r.values,n))}},Pe=class t{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="string"){let n=H.parse(e);return n?new t([n]):void 0}if(!Array.isArray(e))return;let r=[];for(let n of e){if(typeof n!="string")return;let i=H.parse(n);if(!i)return;r.push(i)}return new t(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n,i="rgb"){let o=[];if(e.values.length!=r.values.length)throw new Error("colorArray: Arrays have mismatched length (".concat(e.values.length," vs. ").concat(r.values.length,"), cannot interpolate."));for(let a=0;a<e.values.length;a++)o.push(H.interpolate(e.values[a],r.values[a],n,i));return new t(o)}},ne=class extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}},Nh=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),Ee=class t{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let r=0;r<e.length;r+=2){let n=e[r],i=e[r+1];if(typeof n!="string"||!Nh.has(n)||!Array.isArray(i)||i.length!==2||typeof i[0]!="number"||typeof i[1]!="number")return}return new t(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n){let i=e.values,o=r.values;if(i.length!==o.length)throw new ne("Cannot interpolate values of different length. from: ".concat(e.toString(),", to: ").concat(r.toString()));let a=[];for(let s=0;s<i.length;s+=2){if(i[s]!==o[s])throw new ne("Cannot interpolate values containing mismatched anchors. from[".concat(s,"]: ").concat(i[s],", to[").concat(s,"]: ").concat(o[s]));a.push(i[s]);let[l,u]=i[s+1],[c,p]=o[s+1];a.push([wt(l,c,n),wt(u,p,n)])}return new t(a)}},Se=class t{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new t({name:e,available:!1}):null}},At=class t{constructor(e,r,n){this.from=e,this.to=r,this.transition=n}static interpolate(e,r,n){return new t(e,r,n)}static parse(e){if(e instanceof t)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new t(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new t(e.from,e.to,e.transition);if(typeof e=="string")return new t(e,e,1)}};function ac(t,e,r,n){if(!(typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255)){let i=typeof n=="number"?[t,e,r,n]:[t,e,r];return"Invalid rgba value [".concat(i.join(", "),"]: \'r\', \'g\', and \'b\' must be between 0 and 255.")}return typeof n>"u"||typeof n=="number"&&n>=0&&n<=1?null:"Invalid rgba value [".concat([t,e,r,n].join(", "),"]: \'a\' must be between 0 and 1.")}function pn(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof At||t instanceof H||t instanceof un||t instanceof Fe||t instanceof Oe||t instanceof Ge||t instanceof Pe||t instanceof Ee||t instanceof Se)return!0;if(Array.isArray(t)){for(let e of t)if(!pn(e))return!1;return!0}else if(typeof t=="object"){for(let e in t)if(!pn(t[e]))return!1;return!0}else return!1}function ue(t){if(t===null)return Ar;if(typeof t=="string")return $;if(typeof t=="boolean")return U;if(typeof t=="number")return k;if(t instanceof H)return ze;if(t instanceof At)return go;if(t instanceof un)return xo;if(t instanceof Fe)return _r;if(t instanceof Oe)return bo;if(t instanceof Ge)return vo;if(t instanceof Pe)return sn;if(t instanceof Ee)return Po;if(t instanceof Se)return Pn;if(Array.isArray(t)){let e=t.length,r;for(let n of t){let i=ue(n);if(!r)r=i;else{if(r===i)continue;r=N;break}}return Ce(r||N,e)}else return Xt}function an(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof H||t instanceof At||t instanceof Fe||t instanceof Oe||t instanceof Ge||t instanceof Pe||t instanceof Ee||t instanceof Se?t.toString():JSON.stringify(t)}var _t=class t{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error("\'literal\' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(!pn(e[1]))return r.error("invalid value");let n=e[1],i=ue(n),o=r.expectedType;return i.kind==="array"&&i.N===0&&o&&o.kind==="array"&&(typeof o.N!="number"||o.N===0)&&(i=o),new t(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},Qi={string:$,number:k,boolean:U,object:Xt},$e=class t{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=1,i,o=e[0];if(o==="array"){let s;if(e.length>2){let u=e[1];if(typeof u!="string"||!(u in Qi)||u==="object")return r.error(\'The item type argument of "array" must be one of string, number, boolean\',1);s=Qi[u],n++}else s=N;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error(\'The length argument to "array" must be a positive integer literal\',2);l=e[2],n++}i=Ce(s,l)}else{if(!Qi[o])throw new Error("Types doesn\'t contain name = ".concat(o));i=Qi[o]}let a=[];for(;n<e.length;n++){let s=r.parse(e[n],n,N);if(!s)return null;a.push(s)}return new t(i,a)}evaluate(e){for(let r=0;r<this.args.length;r++){let n=this.args[r].evaluate(e);if(ln(this.type,ue(n))){if(r===this.args.length-1)throw new ne("Expected value to be of type ".concat(ie(this.type),", but found ").concat(ie(ue(n))," instead."))}else return n}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Du={"to-boolean":U,"to-color":ze,"to-number":k,"to-string":$},St=class t{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=e[0];if(!Du[n])throw new Error("Can\'t parse ".concat(n," as it is not part of the known types"));if((n==="to-boolean"||n==="to-string")&&e.length!==2)return r.error("Expected one argument.");let i=Du[n],o=[];for(let a=1;a<e.length;a++){let s=r.parse(e[a],a,N);if(!s)return null;o.push(s)}return new t(i,o)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,n;for(let i of this.args){if(r=i.evaluate(e),n=null,r instanceof H)return r;if(typeof r=="string"){let o=e.parseColor(r);if(o)return o}else if(Array.isArray(r)&&(r.length<3||r.length>4?n="Invalid rgba value ".concat(JSON.stringify(r),": expected an array containing either three or four numeric values."):n=ac(r[0],r[1],r[2],r[3]),!n))return new H(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ne(n||"Could not parse color from value \'".concat(typeof r=="string"?r:JSON.stringify(r),"\'"))}case"padding":{let r;for(let n of this.args){r=n.evaluate(e);let i=Oe.parse(r);if(i)return i}throw new ne("Could not parse padding from value \'".concat(typeof r=="string"?r:JSON.stringify(r),"\'"))}case"numberArray":{let r;for(let n of this.args){r=n.evaluate(e);let i=Ge.parse(r);if(i)return i}throw new ne("Could not parse numberArray from value \'".concat(typeof r=="string"?r:JSON.stringify(r),"\'"))}case"colorArray":{let r;for(let n of this.args){r=n.evaluate(e);let i=Pe.parse(r);if(i)return i}throw new ne("Could not parse colorArray from value \'".concat(typeof r=="string"?r:JSON.stringify(r),"\'"))}case"variableAnchorOffsetCollection":{let r;for(let n of this.args){r=n.evaluate(e);let i=Ee.parse(r);if(i)return i}throw new ne("Could not parse variableAnchorOffsetCollection from value \'".concat(typeof r=="string"?r:JSON.stringify(r),"\'"))}case"number":{let r=null;for(let n of this.args){if(r=n.evaluate(e),r===null)return 0;let i=Number(r);if(!isNaN(i))return i}throw new ne("Could not convert ".concat(JSON.stringify(r)," to number."))}case"formatted":return Fe.fromString(an(this.args[0].evaluate(e)));case"resolvedImage":return Se.fromString(an(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return an(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Uh=["Unknown","Point","LineString","Polygon"],no=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Uh[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache.get(e);return r||(r=H.parse(e),this._parseColorCache.set(e,r)),r}},io=class t{constructor(e,r,n=[],i,o=new Ss,a=[]){this.registry=e,this.path=n,this.key=n.map(s=>"[".concat(s,"]")).join(""),this.scope=o,this.errors=a,this.expectedType=i,this._isConstant=r}parse(e,r,n,i,o={}){return r?this.concat(r,n,i)._parse(e,o):this._parse(e,o)}_parse(e,r){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function n(i,o,a){return a==="assert"?new $e(o,[i]):a==="coerce"?new St(o,[i]):i}if(Array.isArray(e)){if(e.length===0)return this.error(\'Expected an array with at least one element. If you wanted a literal array, use ["literal", []].\');let i=e[0];if(typeof i!="string")return this.error("Expression name must be a string, but found ".concat(typeof i,\' instead. If you wanted a literal array, use ["literal", [...]].\'),0),null;let o=this.registry[i];if(o){let a=o.parse(e,this);if(!a)return null;if(this.expectedType){let s=this.expectedType,l=a.type;if((s.kind==="string"||s.kind==="number"||s.kind==="boolean"||s.kind==="object"||s.kind==="array")&&l.kind==="value")a=n(a,s,r.typeAnnotation||"assert");else if(s.kind==="projectionDefinition"&&["string","array"].includes(l.kind)||["color","formatted","resolvedImage"].includes(s.kind)&&["value","string"].includes(l.kind)||["padding","numberArray"].includes(s.kind)&&["value","number","array"].includes(l.kind)||s.kind==="colorArray"&&["value","string","array"].includes(l.kind)||s.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(l.kind))a=n(a,s,r.typeAnnotation||"coerce");else if(this.checkSubtype(s,l))return null}if(!(a instanceof _t)&&a.type.kind!=="resolvedImage"&&this._isConstant(a)){let s=new no;try{a=new _t(a.type,a.evaluate(s))}catch(l){return this.error(l.message),null}}return a}return this.error(\'Unknown expression "\'.concat(i,\'". If you wanted a literal array, use ["literal", [...]].\'),0)}else return typeof e>"u"?this.error("\'undefined\' value invalid. Use null instead."):typeof e=="object"?this.error(\'Bare objects invalid. Use ["literal", {...}] instead.\'):this.error("Expected an array, but found ".concat(typeof e," instead."))}concat(e,r,n){let i=typeof e=="number"?this.path.concat(e):this.path,o=n?this.scope.concat(n):this.scope;return new t(this.registry,this._isConstant,i,r||null,o,this.errors)}error(e,...r){let n="".concat(this.key).concat(r.map(i=>"[".concat(i,"]")).join(""));this.errors.push(new Ve(n,e))}checkSubtype(e,r){let n=ln(e,r);return n&&this.error(n),n}},oo=class t{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error("Expected at least 3 arguments, but found ".concat(e.length-1," instead."));let n=[];for(let o=1;o<e.length-1;o+=2){let a=e[o];if(typeof a!="string")return r.error("Expected string, but found ".concat(typeof a," instead."),o);if(/[^a-zA-Z0-9_]/.test(a))return r.error("Variable names must contain only alphanumeric characters or \'_\'.",o);let s=r.parse(e[o+1],o+1);if(!s)return null;n.push([a,s])}let i=r.parse(e[e.length-1],e.length-1,r.expectedType,n);return i?new t(n,i):null}outputDefined(){return this.result.outputDefined()}},ao=class t{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("\'var\' expression requires exactly one string literal argument.");let n=e[1];return r.scope.has(n)?new t(n,r.scope.get(n)):r.error(\'Unknown variable "\'.concat(n,\'". Make sure "\').concat(n,\'" has been bound in an enclosing "let" expression before using it.\'),1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},ws=class t{constructor(e,r,n){this.type=e,this.index=r,this.input=n}static parse(e,r){if(e.length!==3)return r.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));let n=r.parse(e[1],1,k),i=r.parse(e[2],2,Ce(r.expectedType||N));if(!n||!i)return null;let o=i.type;return new t(o.itemType,n,i)}evaluate(e){let r=this.index.evaluate(e),n=this.input.evaluate(e);if(r<0)throw new ne("Array index out of bounds: ".concat(r," < 0."));if(r>=n.length)throw new ne("Array index out of bounds: ".concat(r," > ").concat(n.length-1,"."));if(r!==Math.floor(r))throw new ne("Array index must be an integer, but found ".concat(r," instead."));return n[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},As=class t{constructor(e,r){this.type=U,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));let n=r.parse(e[1],1,N),i=r.parse(e[2],2,N);return!n||!i?null:Gs(n.type,[U,$,k,Ar,N])?new t(n,i):r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(ie(n.type)," instead"))}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!Ht(r,["boolean","string","number","null"]))throw new ne("Expected first argument to be of type boolean, string, number or null, but found ".concat(ie(ue(r))," instead."));if(!Ht(n,["string","array"]))throw new ne("Expected second argument to be of type array or string, but found ".concat(ie(ue(n))," instead."));return n.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},_s=class t{constructor(e,r,n){this.type=k,this.needle=e,this.haystack=r,this.fromIndex=n}static parse(e,r){if(e.length<=2||e.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(e.length-1," instead."));let n=r.parse(e[1],1,N),i=r.parse(e[2],2,N);if(!n||!i)return null;if(!Gs(n.type,[U,$,k,Ar,N]))return r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(ie(n.type)," instead"));if(e.length===4){let o=r.parse(e[3],3,k);return o?new t(n,i,o):null}else return new t(n,i)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Ht(r,["boolean","string","number","null"]))throw new ne("Expected first argument to be of type boolean, string, number or null, but found ".concat(ie(ue(r))," instead."));let i;if(this.fromIndex&&(i=this.fromIndex.evaluate(e)),Ht(n,["string"])){let o=n.indexOf(r,i);return o===-1?-1:[...n.slice(0,o)].length}else{if(Ht(n,["array"]))return n.indexOf(r,i);throw new ne("Expected second argument to be of type array or string, but found ".concat(ie(ue(n))," instead."))}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},Is=class t{constructor(e,r,n,i,o,a){this.inputType=e,this.type=r,this.input=n,this.cases=i,this.outputs=o,this.otherwise=a}static parse(e,r){if(e.length<5)return r.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!==1)return r.error("Expected an even number of arguments.");let n,i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let o={},a=[];for(let u=2;u<e.length-1;u+=2){let c=e[u],p=e[u+1];Array.isArray(c)||(c=[c]);let f=r.concat(u);if(c.length===0)return f.error("Expected at least one branch label.");for(let m of c){if(typeof m!="number"&&typeof m!="string")return f.error("Branch labels must be numbers or strings.");if(typeof m=="number"&&Math.abs(m)>Number.MAX_SAFE_INTEGER)return f.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if(typeof m=="number"&&Math.floor(m)!==m)return f.error("Numeric branch labels must be integer values.");if(!n)n=ue(m);else if(f.checkSubtype(n,ue(m)))return null;if(typeof o[String(m)]<"u")return f.error("Branch labels must be unique.");o[String(m)]=a.length}let y=r.parse(p,u,i);if(!y)return null;i=i||y.type,a.push(y)}let s=r.parse(e[1],1,N);if(!s)return null;let l=r.parse(e[e.length-1],e.length-1,i);return!l||s.type.kind!=="value"&&r.concat(1).checkSubtype(n,s.type)?null:new t(n,i,s,o,a,l)}evaluate(e){let r=this.input.evaluate(e);return(ue(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},Ts=class t{constructor(e,r,n){this.type=e,this.branches=r,this.otherwise=n}static parse(e,r){if(e.length<4)return r.error("Expected at least 3 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!==0)return r.error("Expected an odd number of arguments.");let n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let i=[];for(let a=1;a<e.length-1;a+=2){let s=r.parse(e[a],a,U);if(!s)return null;let l=r.parse(e[a+1],a+1,n);if(!l)return null;i.push([s,l]),n=n||l.type}let o=r.parse(e[e.length-1],e.length-1,n);if(!o)return null;if(!n)throw new Error("Can\'t infer output type");return new t(n,i,o)}evaluate(e){for(let[r,n]of this.branches)if(r.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[r,n]of this.branches)e(r),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},Cs=class t{constructor(e,r,n,i){this.type=e,this.input=r,this.beginIndex=n,this.endIndex=i}static parse(e,r){if(e.length<=2||e.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(e.length-1," instead."));let n=r.parse(e[1],1,N),i=r.parse(e[2],2,k);if(!n||!i)return null;if(!Gs(n.type,[Ce(N),$,N]))return r.error("Expected first argument to be of type array or string, but found ".concat(ie(n.type)," instead"));if(e.length===4){let o=r.parse(e[3],3,k);return o?new t(n.type,n,i,o):null}else return new t(n.type,n,i)}evaluate(e){let r=this.input.evaluate(e),n=this.beginIndex.evaluate(e),i;if(this.endIndex&&(i=this.endIndex.evaluate(e)),Ht(r,["string"]))return[...r].slice(n,i).join("");if(Ht(r,["array"]))return r.slice(n,i);throw new ne("Expected first argument to be of type array or string, but found ".concat(ie(ue(r))," instead."))}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function So(t,e){let r=t.length-1,n=0,i=r,o=0,a,s;for(;n<=i;)if(o=Math.floor((n+i)/2),a=t[o],s=t[o+1],a<=e){if(o===r||e<s)return o;n=o+1}else if(a>e)i=o-1;else throw new ne("Input is not a number.");return 0}var Sr=class t{constructor(e,r,n){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(let[i,o]of n)this.labels.push(i),this.outputs.push(o)}static parse(e,r){if(e.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!==0)return r.error("Expected an even number of arguments.");let n=r.parse(e[1],1,k);if(!n)return null;let i=[],o=null;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);for(let a=1;a<e.length;a+=2){let s=a===1?-1/0:e[a],l=e[a+1],u=a,c=a+1;if(typeof s!="number")return r.error(\'Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',u);if(i.length&&i[i.length-1][0]>=s)return r.error(\'Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.\',u);let p=r.parse(l,c,o);if(!p)return null;o=o||p.type,i.push([s,p])}return new t(o,n,i)}evaluate(e){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);let o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);let a=So(r,i);return n[a].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function $h(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gs,Bu;function jh(){if(Bu)return gs;Bu=1,gs=t;function t(e,r,n,i){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(i-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=n,this.p2y=i}return t.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,r){if(r===void 0&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,i=0;i<8;i++){var o=this.sampleCurveX(n)-e;if(Math.abs(o)<r)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n=n-o/a}var s=0,l=1;for(n=e,i=0;i<20&&(o=this.sampleCurveX(n),!(Math.abs(o-e)<r));i++)e>o?s=n:l=n,n=(l-s)*.5+s;return n},solve:function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))}},gs}var qh=jh(),Wh=$h(qh),ke=class t{constructor(e,r,n,i,o){this.type=e,this.operator=r,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(let[a,s]of o)this.labels.push(a),this.outputs.push(s)}static interpolationFactor(e,r,n,i){let o=0;if(e.name==="exponential")o=xs(r,e.base,n,i);else if(e.name==="linear")o=xs(r,1,n,i);else if(e.name==="cubic-bezier"){let a=e.controlPoints;o=new Wh(a[0],a[1],a[2],a[3]).solve(xs(r,1,n,i))}return o}static parse(e,r){let[n,i,o,...a]=e;if(!Array.isArray(i)||i.length===0)return r.error("Expected an interpolation type expression.",1);if(i[0]==="linear")i={name:"linear"};else if(i[0]==="exponential"){let u=i[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:u}}else if(i[0]==="cubic-bezier"){let u=i.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:u}}else return r.error("Unknown interpolation type ".concat(String(i[0])),1,0);if(e.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!==0)return r.error("Expected an even number of arguments.");if(o=r.parse(o,2,k),!o)return null;let s=[],l=null;(n==="interpolate-hcl"||n==="interpolate-lab")&&r.expectedType!=sn?l=ze:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u<a.length;u+=2){let c=a[u],p=a[u+1],f=u+3,y=u+4;if(typeof c!="number")return r.error(\'Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',f);if(s.length&&s[s.length-1][0]>=c)return r.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',f);let m=r.parse(p,y,l);if(!m)return null;l=l||m.type,s.push([c,m])}return!Pt(l,k)&&!Pt(l,go)&&!Pt(l,ze)&&!Pt(l,bo)&&!Pt(l,vo)&&!Pt(l,sn)&&!Pt(l,Po)&&!Pt(l,Ce(k))?r.error("Type ".concat(ie(l)," is not interpolatable.")):new t(l,n,i,o,s)}evaluate(e){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);let o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);let a=So(r,i),s=r[a],l=r[a+1],u=t.interpolationFactor(this.interpolation,i,s,l),c=n[a].evaluate(e),p=n[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return wt(c,p,u);case"color":return H.interpolate(c,p,u);case"padding":return Oe.interpolate(c,p,u);case"colorArray":return Pe.interpolate(c,p,u);case"numberArray":return Ge.interpolate(c,p,u);case"variableAnchorOffsetCollection":return Ee.interpolate(c,p,u);case"array":return Pr(c,p,u);case"projectionDefinition":return At.interpolate(c,p,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return H.interpolate(c,p,u,"hcl");case"colorArray":return Pe.interpolate(c,p,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return H.interpolate(c,p,u,"lab");case"colorArray":return Pe.interpolate(c,p,u,"lab")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function xs(t,e,r,n){let i=n-r,o=t-r;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}var lt={color:H.interpolate,number:wt,padding:Oe.interpolate,numberArray:Ge.interpolate,colorArray:Pe.interpolate,variableAnchorOffsetCollection:Ee.interpolate,array:Pr},so=class t{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=null,i=r.expectedType;i&&i.kind!=="value"&&(n=i);let o=[];for(let s of e.slice(1)){let l=r.parse(s,1+o.length,n,void 0,{typeAnnotation:"omit"});if(!l)return null;n=n||l.type,o.push(l)}if(!n)throw new Error("No output type");return i&&o.some(s=>ln(i,s.type))?new t(N,o):new t(n,o)}evaluate(e){let r=null,n=0,i;for(let o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof Se&&!r.available&&(i||(i=r.name),r=null,n===this.args.length&&(r=i)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function Vu(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Xh(t,e,r){return e===r}function Hh(t,e,r){return e!==r}function Zh(t,e,r){return e<r}function Jh(t,e,r){return e>r}function Yh(t,e,r){return e<=r}function Kh(t,e,r){return e>=r}function sc(t,e,r,n){return n.compare(e,r)===0}function Qh(t,e,r,n){return!sc(t,e,r,n)}function ed(t,e,r,n){return n.compare(e,r)<0}function td(t,e,r,n){return n.compare(e,r)>0}function rd(t,e,r,n){return n.compare(e,r)<=0}function nd(t,e,r,n){return n.compare(e,r)>=0}function Ir(t,e,r){let n=t!=="=="&&t!=="!=";return class lc{constructor(o,a,s){this.type=U,this.lhs=o,this.rhs=a,this.collator=s,this.hasUntypedArgument=o.type.kind==="value"||a.type.kind==="value"}static parse(o,a){if(o.length!==3&&o.length!==4)return a.error("Expected two or three arguments.");let s=o[0],l=a.parse(o[1],1,N);if(!l)return null;if(!Vu(s,l.type))return a.concat(1).error(\'"\'.concat(s,"\\" comparisons are not supported for type \'").concat(ie(l.type),"\'."));let u=a.parse(o[2],2,N);if(!u)return null;if(!Vu(s,u.type))return a.concat(2).error(\'"\'.concat(s,"\\" comparisons are not supported for type \'").concat(ie(u.type),"\'."));if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return a.error("Cannot compare types \'".concat(ie(l.type),"\' and \'").concat(ie(u.type),"\'."));n&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new $e(u.type,[l]):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new $e(l.type,[u])));let c=null;if(o.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return a.error("Cannot use collator to compare non-string types.");if(c=a.parse(o[3],3,xo),!c)return null}return new lc(l,u,c)}evaluate(o){let a=this.lhs.evaluate(o),s=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){let l=ue(a),u=ue(s);if(l.kind!==u.kind||!(l.kind==="string"||l.kind==="number"))throw new ne(\'Expected arguments for "\'.concat(t,\'" to be (string, string) or (number, number), but found (\').concat(l.kind,", ").concat(u.kind,") instead."))}if(this.collator&&!n&&this.hasUntypedArgument){let l=ue(a),u=ue(s);if(l.kind!=="string"||u.kind!=="string")return e(o,a,s)}return this.collator?r(o,a,s,this.collator.evaluate(o)):e(o,a,s)}eachChild(o){o(this.lhs),o(this.rhs),this.collator&&o(this.collator)}outputDefined(){return!0}}}var id=Ir("==",Xh,sc),od=Ir("!=",Hh,Qh),ad=Ir("<",Zh,ed),sd=Ir(">",Jh,td),ld=Ir("<=",Yh,rd),ud=Ir(">=",Kh,nd),lo=class t{constructor(e,r,n){this.type=xo,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let n=e[1];if(typeof n!="object"||Array.isArray(n))return r.error("Collator options argument must be an object.");let i=r.parse(n["case-sensitive"]===void 0?!1:n["case-sensitive"],1,U);if(!i)return null;let o=r.parse(n["diacritic-sensitive"]===void 0?!1:n["diacritic-sensitive"],1,U);if(!o)return null;let a=null;return n.locale&&(a=r.parse(n.locale,1,$),!a)?null:new t(i,o,a)}evaluate(e){return new un(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},ks=class t{constructor(e,r,n,i,o){this.type=$,this.number=e,this.locale=r,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let n=r.parse(e[1],1,k);if(!n)return null;let i=e[2];if(typeof i!="object"||Array.isArray(i))return r.error("NumberFormat options argument must be an object.");let o=null;if(i.locale&&(o=r.parse(i.locale,1,$),!o))return null;let a=null;if(i.currency&&(a=r.parse(i.currency,1,$),!a))return null;let s=null;if(i["min-fraction-digits"]&&(s=r.parse(i["min-fraction-digits"],1,k),!s))return null;let l=null;return i["max-fraction-digits"]&&(l=r.parse(i["max-fraction-digits"],1,k),!l)?null:new t(n,o,a,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},fn=class t{constructor(e){this.type=_r,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=e[1];if(!Array.isArray(n)&&typeof n=="object")return r.error("First argument must be an image or text section.");let i=[],o=!1;for(let a=1;a<=e.length-1;++a){let s=e[a];if(o&&typeof s=="object"&&!Array.isArray(s)){o=!1;let l=null;if(s["font-scale"]&&(l=r.parse(s["font-scale"],1,k),!l))return null;let u=null;if(s["text-font"]&&(u=r.parse(s["text-font"],1,Ce($)),!u))return null;let c=null;if(s["text-color"]&&(c=r.parse(s["text-color"],1,ze),!c))return null;let p=null;if(s["vertical-align"]){if(typeof s["vertical-align"]=="string"&&!Gh.includes(s["vertical-align"]))return r.error("\'vertical-align\' must be one of: \'bottom\', \'center\', \'top\' but found \'".concat(s["vertical-align"],"\' instead."));if(p=r.parse(s["vertical-align"],1,$),!p)return null}let f=i[i.length-1];f.scale=l,f.font=u,f.textColor=c,f.verticalAlign=p}else{let l=r.parse(e[a],1,N);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be \'string\', \'value\', \'image\' or \'null\'.");o=!0,i.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new t(i)}evaluate(e){let r=n=>{let i=n.content.evaluate(e);return ue(i)===Pn?new cn("",i,null,null,null,n.verticalAlign?n.verticalAlign.evaluate(e):null):new cn(an(i),null,n.scale?n.scale.evaluate(e):null,n.font?n.font.evaluate(e).join(","):null,n.textColor?n.textColor.evaluate(e):null,n.verticalAlign?n.verticalAlign.evaluate(e):null)};return new Fe(this.sections.map(r))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}},Fs=class t{constructor(e){this.type=Pn,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let n=r.parse(e[1],1,$);return n?new t(n):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),n=Se.fromString(r);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(r)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}},Es=class t{constructor(e){this.type=k,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected 1 argument, but found ".concat(e.length-1," instead."));let n=r.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?r.error("Expected argument of type string or array, but found ".concat(ie(n.type)," instead.")):new t(n):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new ne("Expected value to be of type string or array, but found ".concat(ie(ue(r))," instead."))}eachChild(e){e(this.input)}outputDefined(){return!1}},He=8192;function cd(t,e){let r=pd(t[0]),n=yd(t[1]),i=Math.pow(2,e.z);return[Math.round(r*i*He),Math.round(n*i*He)]}function Ns(t,e){let r=Math.pow(2,e.z),n=(t[0]/He+e.x)/r,i=(t[1]/He+e.y)/r;return[fd(n),md(i)]}function pd(t){return(180+t)/360}function fd(t){return t*360-180}function yd(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function md(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function Sn(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function yn(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function hd(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 dd(t,e,r){let n=t[0]-e[0],i=t[1]-e[1],o=t[0]-r[0],a=t[1]-r[1];return n*a-o*i===0&&n*o<=0&&i*a<=0}function wo(t,e,r,n){let i=[e[0]-t[0],e[1]-t[1]],o=[n[0]-r[0],n[1]-r[1]];return vd(o,i)===0?!1:!!(Ru(t,e,r,n)&&Ru(r,n,t,e))}function gd(t,e,r){for(let n of r)for(let i=0;i<n.length-1;++i)if(wo(t,e,n[i],n[i+1]))return!0;return!1}function Tr(t,e,r=!1){let n=!1;for(let i of e)for(let o=0;o<i.length-1;o++){if(dd(t,i[o],i[o+1]))return r;hd(t,i[o],i[o+1])&&(n=!n)}return n}function xd(t,e){for(let r of e)if(Tr(t,r))return!0;return!1}function uc(t,e){for(let r of t)if(!Tr(r,e))return!1;for(let r=0;r<t.length-1;++r)if(gd(t[r],t[r+1],e))return!1;return!0}function bd(t,e){for(let r of e)if(uc(t,r))return!0;return!1}function vd(t,e){return t[0]*e[1]-t[1]*e[0]}function Ru(t,e,r,n){let i=t[0]-r[0],o=t[1]-r[1],a=e[0]-r[0],s=e[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],c=i*u-l*o,p=a*u-l*s;return c>0&&p<0||c<0&&p>0}function Us(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=[];for(let a=0;a<t[i].length;a++){let s=cd(t[i][a],r);Sn(e,s),o.push(s)}n.push(o)}return n}function cc(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=Us(t[i],e,r);n.push(o)}return n}function pc(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){let i=n*.5,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;o===0&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}Sn(e,t)}function Pd(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function zu(t,e,r,n){let i=Math.pow(2,n.z)*He,o=[n.x*He,n.y*He],a=[];for(let s of t)for(let l of s){let u=[l.x+o[0],l.y+o[1]];pc(u,e,r,i),a.push(u)}return a}function Ou(t,e,r,n){let i=Math.pow(2,n.z)*He,o=[n.x*He,n.y*He],a=[];for(let s of t){let l=[];for(let u of s){let c=[u.x+o[0],u.y+o[1]];Sn(e,c),l.push(c)}a.push(l)}if(e[2]-e[0]<=i/2){Pd(e);for(let s of a)for(let l of s)pc(l,e,r,i)}return a}function Sd(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let o=Us(e.coordinates,n,i),a=zu(t.geometry(),r,n,i);if(!yn(r,n))return!1;for(let s of a)if(!Tr(s,o))return!1}if(e.type==="MultiPolygon"){let o=cc(e.coordinates,n,i),a=zu(t.geometry(),r,n,i);if(!yn(r,n))return!1;for(let s of a)if(!xd(s,o))return!1}return!0}function wd(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let o=Us(e.coordinates,n,i),a=Ou(t.geometry(),r,n,i);if(!yn(r,n))return!1;for(let s of a)if(!uc(s,o))return!1}if(e.type==="MultiPolygon"){let o=cc(e.coordinates,n,i),a=Ou(t.geometry(),r,n,i);if(!yn(r,n))return!1;for(let s of a)if(!bd(s,o))return!1}return!0}var mn=class t{constructor(e,r){this.type=U,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error("\'within\' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(pn(e[1])){let n=e[1];if(n.type==="FeatureCollection"){let i=[];for(let o of n.features){let{type:a,coordinates:s}=o.geometry;a==="Polygon"&&i.push(s),a==="MultiPolygon"&&i.push(...s)}if(i.length){let o={type:"MultiPolygon",coordinates:i};return new t(n,o)}}else if(n.type==="Feature"){let i=n.geometry.type;if(i==="Polygon"||i==="MultiPolygon")return new t(n,n.geometry)}else if(n.type==="Polygon"||n.type==="MultiPolygon")return new t(n,n)}return r.error("\'within\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return Sd(e,this.geometries);if(e.geometryType()==="LineString")return wd(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},uo=class{constructor(e=[],r=(n,i)=>n<i?-1:n>i?1:0){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:n}=this,i=r[e];for(;e>0;){let o=e-1>>1,a=r[o];if(n(i,a)>=0)break;r[e]=a,e=o}r[e]=i}_down(e){let{data:r,compare:n}=this,i=this.length>>1,o=r[e];for(;e<i;){let a=(e<<1)+1,s=a+1;if(s<this.length&&n(r[s],r[a])<0&&(a=s),n(r[a],o)>=0)break;r[e]=r[a],e=a}r[e]=o}};function fc(t,e,r=0,n=t.length-1,i=Ad){for(;n>r;){if(n-r>600){let l=n-r+1,u=e-r+1,c=Math.log(l),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(l-p)/l)*(u-l/2<0?-1:1),y=Math.max(r,Math.floor(e-u*p/l+f)),m=Math.min(n,Math.floor(e+(l-u)*p/l+f));fc(t,e,y,m,i)}let o=t[e],a=r,s=n;for(nn(t,r,e),i(t[n],o)>0&&nn(t,r,n);a<s;){for(nn(t,a,s),a++,s--;i(t[a],o)<0;)a++;for(;i(t[s],o)>0;)s--}i(t[r],o)===0?nn(t,r,s):(s++,nn(t,s,n)),s<=e&&(r=s+1),e<=s&&(n=s-1)}}function nn(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function Ad(t,e){return t<e?-1:t>e?1:0}function Kt(t,e){if(t.length<=1)return[t];let n=[],i,o;for(let a of t){let s=Id(a);s!==0&&(a.area=Math.abs(s),o===void 0&&(o=s<0),o===s<0?(i&&n.push(i),i=[a]):i.push(a))}if(i&&n.push(i),e>1)for(let a=0;a<n.length;a++)n[a].length<=e||(fc(n[a],e,1,n[a].length-1,_d),n[a]=n[a].slice(0,e));return n}function _d(t,e){return e.area-t.area}function Id(t){let e=0;for(let r=0,n=t.length,i=n-1,o,a;r<n;i=r++)o=t[r],a=t[i],e+=(a.x-o.x)*(o.y+a.y);return e}var Td=6378.137,Gu=1/298.257223563,Nu=Gu*(2-Gu),Uu=Math.PI/180,hn=class{constructor(e){let r=Uu*Td*1e3,n=Math.cos(e*Uu),i=1/(1-Nu*(1-n*n)),o=Math.sqrt(i);this.kx=r*o*n,this.ky=r*o*i*(1-Nu)}distance(e,r){let n=this.wrap(e[0]-r[0])*this.kx,i=(e[1]-r[1])*this.ky;return Math.sqrt(n*n+i*i)}pointOnLine(e,r){let n=1/0,i,o,a,s;for(let l=0;l<e.length-1;l++){let u=e[l][0],c=e[l][1],p=this.wrap(e[l+1][0]-u)*this.kx,f=(e[l+1][1]-c)*this.ky,y=0;(p!==0||f!==0)&&(y=(this.wrap(r[0]-u)*this.kx*p+(r[1]-c)*this.ky*f)/(p*p+f*f),y>1?(u=e[l+1][0],c=e[l+1][1]):y>0&&(u+=p/this.kx*y,c+=f/this.ky*y)),p=this.wrap(r[0]-u)*this.kx,f=(r[1]-c)*this.ky;let m=p*p+f*f;m<n&&(n=m,i=u,o=c,a=l,s=y)}return{point:[i,o],index:a,t:Math.max(0,Math.min(1,s))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}},Ms=100,Ls=50;function yc(t,e){return e[0]-t[0]}function co(t){return t[1]-t[0]+1}function st(t,e){return t[1]>=t[0]&&t[1]<e}function Ds(t,e){if(t[0]>t[1])return[null,null];let r=co(t);if(e){if(r===2)return[t,null];let i=Math.floor(r/2);return[[t[0],t[0]+i],[t[0]+i,t[1]]]}if(r===1)return[t,null];let n=Math.floor(r/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}function Bs(t,e){if(!st(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)Sn(r,t[n]);return r}function Vs(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let n of r)Sn(e,n);return e}function $u(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function $s(t,e,r){if(!$u(t)||!$u(e))return NaN;let n=0,i=0;return t[2]<e[0]&&(n=e[0]-t[2]),t[0]>e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]<e[1]&&(i=e[1]-t[3]),r.distance([0,0],[n,i])}function Wt(t,e,r){let n=r.pointOnLine(e,t);return r.distance(t,n.point)}function js(t,e,r,n,i){let o=Math.min(Wt(t,[r,n],i),Wt(e,[r,n],i)),a=Math.min(Wt(r,[t,e],i),Wt(n,[t,e],i));return Math.min(o,a)}function Cd(t,e,r,n,i){if(!(st(e,t.length)&&st(n,r.length)))return 1/0;let a=1/0;for(let s=e[0];s<e[1];++s){let l=t[s],u=t[s+1];for(let c=n[0];c<n[1];++c){let p=r[c],f=r[c+1];if(wo(l,u,p,f))return 0;a=Math.min(a,js(l,u,p,f,i))}}return a}function kd(t,e,r,n,i){if(!(st(e,t.length)&&st(n,r.length)))return NaN;let a=1/0;for(let s=e[0];s<=e[1];++s)for(let l=n[0];l<=n[1];++l)if(a=Math.min(a,i.distance(t[s],r[l])),a===0)return a;return a}function Fd(t,e,r){if(Tr(t,e,!0))return 0;let n=1/0;for(let i of e){let o=i[0],a=i[i.length-1];if(o!==a&&(n=Math.min(n,Wt(t,[a,o],r)),n===0))return n;let s=r.pointOnLine(i,t);if(n=Math.min(n,r.distance(t,s.point)),n===0)return n}return n}function Ed(t,e,r,n){if(!st(e,t.length))return NaN;for(let o=e[0];o<=e[1];++o)if(Tr(t[o],r,!0))return 0;let i=1/0;for(let o=e[0];o<e[1];++o){let a=t[o],s=t[o+1];for(let l of r)for(let u=0,c=l.length,p=c-1;u<c;p=u++){let f=l[p],y=l[u];if(wo(a,s,f,y))return 0;i=Math.min(i,js(a,s,f,y,n))}}return i}function ju(t,e){for(let r of t)for(let n of r)if(Tr(n,e,!0))return!0;return!1}function Md(t,e,r,n=1/0){let i=Vs(t),o=Vs(e);if(n!==1/0&&$s(i,o,r)>=n)return n;if(yn(i,o)){if(ju(t,e))return 0}else if(ju(e,t))return 0;let a=1/0;for(let s of t)for(let l=0,u=s.length,c=u-1;l<u;c=l++){let p=s[c],f=s[l];for(let y of e)for(let m=0,h=y.length,g=h-1;m<h;g=m++){let d=y[g],b=y[m];if(wo(p,f,d,b))return 0;a=Math.min(a,js(p,f,d,b,r))}}return a}function qu(t,e,r,n,i,o){if(!o)return;let a=$s(Bs(n,o),i,r);a<e&&t.push([a,o,[0,0]])}function eo(t,e,r,n,i,o,a){if(!o||!a)return;let s=$s(Bs(n,o),Bs(i,a),r);s<e&&t.push([s,o,a])}function po(t,e,r,n,i=1/0){let o=Math.min(n.distance(t[0],r[0][0]),i);if(o===0)return o;let a=new uo([[0,[0,t.length-1],[0,0]]],yc),s=Vs(r);for(;a.length>0;){let l=a.pop();if(l[0]>=o)continue;let u=l[1],c=e?Ls:Ms;if(co(u)<=c){if(!st(u,t.length))return NaN;if(e){let p=Ed(t,u,r,n);if(isNaN(p)||p===0)return p;o=Math.min(o,p)}else for(let p=u[0];p<=u[1];++p){let f=Fd(t[p],r,n);if(o=Math.min(o,f),o===0)return 0}}else{let p=Ds(u,e);qu(a,o,n,t,s,p[0]),qu(a,o,n,t,s,p[1])}}return o}function fo(t,e,r,n,i,o=1/0){let a=Math.min(o,i.distance(t[0],r[0]));if(a===0)return a;let s=new uo([[0,[0,t.length-1],[0,r.length-1]]],yc);for(;s.length>0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],c=l[2],p=e?Ls:Ms,f=n?Ls:Ms;if(co(u)<=p&&co(c)<=f){if(!st(u,t.length)&&st(c,r.length))return NaN;let y;if(e&&n)y=Cd(t,u,r,c,i),a=Math.min(a,y);else if(e&&!n){let m=t.slice(u[0],u[1]+1);for(let h=c[0];h<=c[1];++h)if(y=Wt(r[h],m,i),a=Math.min(a,y),a===0)return a}else if(!e&&n){let m=r.slice(c[0],c[1]+1);for(let h=u[0];h<=u[1];++h)if(y=Wt(t[h],m,i),a=Math.min(a,y),a===0)return a}else y=kd(t,u,r,c,i),a=Math.min(a,y)}else{let y=Ds(u,e),m=Ds(c,n);eo(s,a,i,t,r,y[0],m[0]),eo(s,a,i,t,r,y[0],m[1]),eo(s,a,i,t,r,y[1],m[0]),eo(s,a,i,t,r,y[1],m[1])}}return a}function Ld(t,e){let r=t.geometry(),n=r.flat().map(a=>Ns([a.x,a.y],t.canonical));if(r.length===0)return NaN;let i=new hn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,fo(n,!1,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,fo(n,!1,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,po(n,!1,a.coordinates,i,o));break}if(o===0)return o}return o}function Dd(t,e){let r=t.geometry(),n=r.flat().map(a=>Ns([a.x,a.y],t.canonical));if(r.length===0)return NaN;let i=new hn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,fo(n,!0,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,fo(n,!0,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,po(n,!0,a.coordinates,i,o));break}if(o===0)return o}return o}function Bd(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let n=Kt(r,0).map(a=>a.map(s=>s.map(l=>Ns([l.x,l.y],t.canonical)))),i=new hn(n[0][0][0][1]),o=1/0;for(let a of e)for(let s of n){switch(a.type){case"Point":o=Math.min(o,po([a.coordinates],!1,s,i,o));break;case"LineString":o=Math.min(o,po(a.coordinates,!0,s,i,o));break;case"Polygon":o=Math.min(o,Md(s,a.coordinates,i,o));break}if(o===0)return o}return o}function bs(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}var dn=class t{constructor(e,r){this.type=k,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error("\'distance\' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(pn(e[1])){let n=e[1];if(n.type==="FeatureCollection")return new t(n,n.features.map(i=>bs(i.geometry)).flat());if(n.type==="Feature")return new t(n,bs(n.geometry));if("type"in n&&"coordinates"in n)return new t(n,bs(n))}return r.error("\'distance\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return Ld(e,this.geometries);if(e.geometryType()==="LineString")return Dd(e,this.geometries);if(e.geometryType()==="Polygon")return Bd(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},gn=class t{constructor(e){this.type=N,this.key=e}static parse(e,r){if(e.length!==2)return r.error("Expected 1 argument, but found ".concat(e.length-1," instead."));let n=e[1];return n==null?r.error("Global state property must be defined."):typeof n!="string"?r.error("Global state property must be string, but found ".concat(typeof e[1]," instead.")):new t(n)}evaluate(e){var r;let n=(r=e.globals)===null||r===void 0?void 0:r.globalState;return!n||Object.keys(n).length===0?null:on(n,this.key)}eachChild(){}outputDefined(){return!1}},Qt={"==":id,"!=":od,">":sd,"<":ad,">=":ud,"<=":ld,array:$e,at:ws,boolean:$e,case:Ts,coalesce:so,collator:lo,format:fn,image:Fs,in:As,"index-of":_s,interpolate:ke,"interpolate-hcl":ke,"interpolate-lab":ke,length:Es,let:oo,literal:_t,match:Is,number:$e,"number-format":ks,object:$e,slice:Cs,step:Sr,string:$e,"to-boolean":St,"to-color":St,"to-number":St,"to-string":St,var:ao,within:mn,distance:dn,"global-state":gn},Ze=class t{constructor(e,r,n,i){this.name=e,this.type=r,this._evaluate=n,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let n=e[0],i=t.definitions[n];if(!i)return r.error(\'Unknown expression "\'.concat(n,\'". If you wanted a literal array, use ["literal", [...]].\'),0);let o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,c]of s){l=new io(r.registry,yo,r.path,null,r.scope);let p=[],f=!1;for(let y=1;y<e.length;y++){let m=e[y],h=Array.isArray(u)?u[y-1]:u.type,g=l.parse(m,1+p.length,h);if(!g){f=!0;break}p.push(g)}if(!f){if(Array.isArray(u)&&u.length!==p.length){l.error("Expected ".concat(u.length," arguments, but found ").concat(p.length," instead."));continue}for(let y=0;y<p.length;y++){let m=Array.isArray(u)?u[y]:u.type,h=p[y];l.concat(y+1).checkSubtype(m,h.type)}if(l.errors.length===0)return new t(n,o,c,p)}}if(s.length===1)r.errors.push(...l.errors);else{let c=(s.length?s:a).map(([f])=>Rd(f)).join(" | "),p=[];for(let f=1;f<e.length;f++){let y=r.parse(e[f],1+p.length);if(!y)return null;p.push(ie(y.type))}r.error("Expected arguments of type ".concat(c,", but found (").concat(p.join(", "),") instead."))}return null}static register(e,r){t.definitions=r;for(let n in r)e[n]=t}};function Wu(t,[e,r,n,i]){e=e.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);let o=i?i.evaluate(t):1,a=ac(e,r,n,o);if(a)throw new ne(a);return new H(e/255,r/255,n/255,o,!1)}function Xu(t,e){return t in e}function vs(t,e){let r=e[t];return typeof r>"u"?null:r}function Vd(t,e,r,n){for(;r<=n;){let i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}function qt(t){return{type:t}}Ze.register(Qt,{error:[Ch,[$],(t,[e])=>{throw new ne(e.evaluate(t))}],typeof:[$,[N],(t,[e])=>ie(ue(e.evaluate(t)))],"to-rgba":[Ce(k,4),[ze],(t,[e])=>{let[r,n,i,o]=e.evaluate(t).rgb;return[r*255,n*255,i*255,o]}],rgb:[ze,[k,k,k],Wu],rgba:[ze,[k,k,k,k],Wu],has:{type:U,overloads:[[[$],(t,[e])=>Xu(e.evaluate(t),t.properties())],[[$,Xt],(t,[e,r])=>Xu(e.evaluate(t),r.evaluate(t))]]},get:{type:N,overloads:[[[$],(t,[e])=>vs(e.evaluate(t),t.properties())],[[$,Xt],(t,[e,r])=>vs(e.evaluate(t),r.evaluate(t))]]},"feature-state":[N,[$],(t,[e])=>vs(e.evaluate(t),t.featureState||{})],properties:[Xt,[],t=>t.properties()],"geometry-type":[$,[],t=>t.geometryType()],id:[N,[],t=>t.id()],zoom:[k,[],t=>t.globals.zoom],"heatmap-density":[k,[],t=>t.globals.heatmapDensity||0],elevation:[k,[],t=>t.globals.elevation||0],"line-progress":[k,[],t=>t.globals.lineProgress||0],accumulated:[N,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[k,qt(k),(t,e)=>{let r=0;for(let n of e)r+=n.evaluate(t);return r}],"*":[k,qt(k),(t,e)=>{let r=1;for(let n of e)r*=n.evaluate(t);return r}],"-":{type:k,overloads:[[[k,k],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[k],(t,[e])=>-e.evaluate(t)]]},"/":[k,[k,k],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[k,[k,k],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[k,[],()=>Math.LN2],pi:[k,[],()=>Math.PI],e:[k,[],()=>Math.E],"^":[k,[k,k],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[k,[k],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[k,[k],(t,[e])=>Math.log(e.evaluate(t))],log2:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[k,[k],(t,[e])=>Math.sin(e.evaluate(t))],cos:[k,[k],(t,[e])=>Math.cos(e.evaluate(t))],tan:[k,[k],(t,[e])=>Math.tan(e.evaluate(t))],asin:[k,[k],(t,[e])=>Math.asin(e.evaluate(t))],acos:[k,[k],(t,[e])=>Math.acos(e.evaluate(t))],atan:[k,[k],(t,[e])=>Math.atan(e.evaluate(t))],min:[k,qt(k),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[k,qt(k),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[k,[k],(t,[e])=>Math.abs(e.evaluate(t))],round:[k,[k],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[k,[k],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[k,[k],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[U,[$,N],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[U,[N],(t,[e])=>t.id()===e.value],"filter-type-==":[U,[$],(t,[e])=>t.geometryType()===e.value],"filter-<":[U,[$,N],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[U,[N],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<n}],"filter->":[U,[$,N],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[U,[N],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>n}],"filter-<=":[U,[$,N],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[U,[N],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<=n}],"filter->=":[U,[$,N],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[U,[N],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>=n}],"filter-has":[U,[N],(t,[e])=>e.value in t.properties()],"filter-has-id":[U,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[U,[Ce($)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[U,[Ce(N)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[U,[$,Ce(N)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[U,[$,Ce(N)],(t,[e,r])=>Vd(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:U,overloads:[[[U,U],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[qt(U),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:U,overloads:[[[U,U],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[qt(U),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[U,[U],(t,[e])=>!e.evaluate(t)],"is-supported-script":[U,[$],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return r?r(e.evaluate(t)):!0}],upcase:[$,[$],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[$,[$],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[$,qt(N),(t,e)=>e.map(r=>an(r.evaluate(t))).join("")],"resolved-locale":[$,[xo],(t,[e])=>e.evaluate(t).resolvedLocale()]});function Rd(t){return Array.isArray(t)?"(".concat(t.map(ie).join(", "),")"):"(".concat(ie(t.type),"...)")}function yo(t){if(t instanceof ao)return yo(t.boundExpression);if(t instanceof Ze&&t.name==="error")return!1;if(t instanceof lo)return!1;if(t instanceof mn)return!1;if(t instanceof dn)return!1;if(t instanceof gn)return!1;let e=t instanceof St||t instanceof $e,r=!0;return t.eachChild(n=>{e?r=r&&yo(n):r=r&&n instanceof _t}),r?Ao(t)&&_o(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function Ao(t){if(t instanceof Ze){if(t.name==="get"&&t.args.length===1)return!1;if(t.name==="feature-state")return!1;if(t.name==="has"&&t.args.length===1)return!1;if(t.name==="properties"||t.name==="geometry-type"||t.name==="id")return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof mn||t instanceof dn)return!1;let e=!0;return t.eachChild(r=>{e&&!Ao(r)&&(e=!1)}),e}function xn(t){if(t instanceof Ze&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!xn(r)&&(e=!1)}),e}function _o(t,e){if(t instanceof Ze&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(n=>{r&&!_o(n,e)&&(r=!1)}),r}function Rs(t){return{result:"success",value:t}}function xr(t){return{result:"error",value:t}}function It(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function mc(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function qs(t){return!!t.expression&&t.expression.interpolated}function j(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function Io(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&ue(t)===Xt}function zd(t){return t}function Od(t){switch(t.type){case"color":return H.parse;case"padding":return Oe.parse;case"numberArray":return Ge.parse;case"colorArray":return Pe.parse;default:return null}}function Gd(t){switch(t){case"exponential":return dc;case"interval":return Ud;case"categorical":return Nd;case"identity":return $d;default:throw new Error(\'Unknown function type "\'.concat(t,\'"\'))}}function hc(t,e){let r=t.stops&&typeof t.stops[0][0]=="object",n=r||t.property!==void 0,i=r||!n,o=t.type||(qs(e)?"exponential":"interval"),a=Od(e);if(a&&(t=vr({},t),t.stops&&(t.stops=t.stops.map(c=>[c[0],a(c[1])])),t.default?t.default=a(t.default):t.default=a(e.default)),t.colorSpace&&!Oh(t.colorSpace))throw new Error(\'Unknown color space: "\'.concat(t.colorSpace,\'"\'));let s=Gd(o),l,u;if(o==="categorical"){l=Object.create(null);for(let c of t.stops)l[c[0]]=c[1];u=typeof t.stops[0][0]}if(r){let c={},p=[];for(let m=0;m<t.stops.length;m++){let h=t.stops[m],g=h[0].zoom;c[g]===void 0&&(c[g]={zoom:g,type:t.type,property:t.property,default:t.default,stops:[]},p.push(g)),c[g].stops.push([h[0].value,h[1]])}let f=[];for(let m of p)f.push([c[m].zoom,hc(c[m],e)]);let y={name:"linear"};return{kind:"composite",interpolationType:y,interpolationFactor:ke.interpolationFactor.bind(void 0,y),zoomStops:f.map(m=>m[0]),evaluate({zoom:m},h){return dc({stops:f,base:t.base},e,m).evaluate(m,h)}}}else if(i){let c=o==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:c,interpolationFactor:ke.interpolationFactor.bind(void 0,c),zoomStops:t.stops.map(p=>p[0]),evaluate:({zoom:p})=>s(t,e,p,l,u)}}else return{kind:"source",evaluate(c,p){let f=p&&p.properties?p.properties[t.property]:void 0;return f===void 0?wn(t.default,e.default):s(t,e,f,l,u)}}}function wn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function Nd(t,e,r,n,i){let o=typeof r===i?n[r]:void 0;return wn(o,t.default,e.default)}function Ud(t,e,r){if(j(r)!=="number")return wn(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let i=So(t.stops.map(o=>o[0]),r);return t.stops[i][1]}function dc(t,e,r){let n=t.base!==void 0?t.base:1;if(j(r)!=="number")return wn(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let o=So(t.stops.map(c=>c[0]),r),a=jd(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],l=t.stops[o+1][1],u=lt[e.type]||zd;return typeof s.evaluate=="function"?{evaluate(...c){let p=s.evaluate.apply(void 0,c),f=l.evaluate.apply(void 0,c);if(!(p===void 0||f===void 0))return u(p,f,a,t.colorSpace)}}:u(s,l,a,t.colorSpace)}function $d(t,e,r){switch(e.type){case"color":r=H.parse(r);break;case"formatted":r=Fe.fromString(r.toString());break;case"resolvedImage":r=Se.fromString(r.toString());break;case"padding":r=Oe.parse(r);break;case"colorArray":r=Pe.parse(r);break;case"numberArray":r=Ge.parse(r);break;default:j(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return wn(r,t.default,e.default)}function jd(t,e,r,n){let i=n-r,o=t-r;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}var Zt=class{constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new no,this._defaultValue=r?Wd(r):null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,n,i,o,a){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=n,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,r,n,i,o,a){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=n||null,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ne("Expected value to be one of ".concat(Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", "),", but found ").concat(JSON.stringify(s)," instead."));return s}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,typeof console<"u"&&console.warn(s.message)),this._defaultValue}}};function An(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Qt}function er(t,e){let r=new io(Qt,yo,[],e?qd(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Rs(new Zt(n,e)):xr(r.errors)}var Je=class{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!xn(r.expression),this.globalStateRefs=To(r.expression)}evaluateWithoutErrorHandling(e,r,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,r,n,i,o,a)}evaluate(e,r,n,i,o,a){return this._styleExpression.evaluate(e,r,n,i,o,a)}},Tt=class{constructor(e,r,n,i){this.kind=e,this.zoomStops=n,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!xn(r.expression),this.globalStateRefs=To(r.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,r,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,r,n,i,o,a)}evaluate(e,r,n,i,o,a){return this._styleExpression.evaluate(e,r,n,i,o,a)}interpolationFactor(e,r,n){return this.interpolationType?ke.interpolationFactor(this.interpolationType,e,r,n):0}};function gc(t){return t._styleExpression!==void 0}function xc(t,e){let r=er(t,e);if(r.result==="error")return r;let n=r.value.expression,i=Ao(n);if(!i&&!It(e))return xr([new Ve("","data expressions not supported")]);let o=_o(n,["zoom"]);if(!o&&!mc(e))return xr([new Ve("","zoom expressions not supported")]);let a=ro(n);if(!a&&!o)return xr([new Ve("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(a instanceof Ve)return xr([a]);if(a instanceof ke&&!qs(e))return xr([new Ve("",\'"interpolate" expressions cannot be used with this property\')]);if(!a)return Rs(i?new Je("constant",r.value):new Je("source",r.value));let s=a instanceof ke?a.interpolation:void 0;return Rs(i?new Tt("camera",r.value,a.labels,s):new Tt("composite",r.value,a.labels,s))}var bn=class t{constructor(e,r){this._parameters=e,this._specification=r,vr(this,hc(this._parameters,this._specification))}static deserialize(e){return new t(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}};function bc(t,e){if(Io(t))return new bn(t,e);if(An(t)){let r=xc(t,e);if(r.result==="error")throw new Error(r.value.map(n=>"".concat(n.key,": ").concat(n.message)).join(", "));return r.value}else{let r=t;return e.type==="color"&&typeof t=="string"?r=H.parse(t):e.type==="padding"&&(typeof t=="number"||Array.isArray(t))?r=Oe.parse(t):e.type==="numberArray"&&(typeof t=="number"||Array.isArray(t))?r=Ge.parse(t):e.type==="colorArray"&&(typeof t=="string"||Array.isArray(t))?r=Pe.parse(t):e.type==="variableAnchorOffsetCollection"&&Array.isArray(t)?r=Ee.parse(t):e.type==="projectionDefinition"&&typeof t=="string"&&(r=At.parse(t)),{globalStateRefs:new Set,kind:"constant",evaluate:()=>r}}}function ro(t){let e=null;if(t instanceof oo)e=ro(t.result);else if(t instanceof so){for(let r of t.args)if(e=ro(r),e)break}else(t instanceof Sr||t instanceof ke)&&t.input instanceof Ze&&t.input.name==="zoom"&&(e=t);return e instanceof Ve||t.eachChild(r=>{let n=ro(r);n instanceof Ve?e=n:!e&&n?e=new Ve("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):e&&n&&e!==n&&(e=new Ve("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),e}function To(t,e=new Set){return t instanceof gn&&e.add(t.key),t.eachChild(r=>{To(r,e)}),e}function qd(t){let e={color:ze,string:$,number:k,enum:$,boolean:U,formatted:_r,padding:bo,numberArray:vo,colorArray:sn,projectionDefinition:go,resolvedImage:Pn,variableAnchorOffsetCollection:Po};return t.type==="array"?Ce(e[t.value]||N,t.length):e[t.type]}function Wd(t){if(t.type==="color"&&Io(t.default))return new H(0,0,0,0);switch(t.type){case"color":return H.parse(t.default)||null;case"padding":return Oe.parse(t.default)||null;case"numberArray":return Ge.parse(t.default)||null;case"colorArray":return Pe.parse(t.default)||null;case"variableAnchorOffsetCollection":return Ee.parse(t.default)||null;case"projectionDefinition":return At.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function Ws(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let e of t.slice(1))if(!Ws(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}var Xd={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ct(t){if(t==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Ws(t)||(t=mo(t));let e=er(t,Xd);if(e.result==="error")throw new Error(e.value.map(r=>"".concat(r.key,": ").concat(r.message)).join(", "));{let r=vc(t);return{filter:(n,i,o)=>e.value.evaluate(n,i,{},o),needGeometry:r,getGlobalStateRefs:()=>To(e.value.expression)}}}function Hd(t,e){return t<e?-1:t>e?1:0}function vc(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e<t.length;e++)if(vc(t[e]))return!0;return!1}function mo(t){if(!t)return!0;let e=t[0];return t.length<=1?e!=="any":e==="=="?Ps(t[1],t[2],"=="):e==="!="?to(Ps(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Ps(t[1],t[2],e):e==="any"?Zd(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(mo)):e==="none"?["all"].concat(t.slice(1).map(mo).map(to)):e==="in"?Hu(t[1],t.slice(2)):e==="!in"?to(Hu(t[1],t.slice(2))):e==="has"?Zu(t[1]):e==="!has"?to(Zu(t[1])):!0}function Ps(t,e,r){switch(t){case"$type":return["filter-type-".concat(r),e];case"$id":return["filter-id-".concat(r),e];default:return["filter-".concat(r),t,e]}}function Zd(t){return["any"].concat(t.map(mo))}function Hu(t,e){if(e.length===0)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(r=>typeof r!=typeof e[0])?["filter-in-large",t,["literal",e.sort(Hd)]]:["filter-in-small",t,["literal",e]]}}function Zu(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function to(t){return["!",t]}function zs(t){let e=typeof t;if(e==="number"||e==="boolean"||e==="string"||t===void 0||t===null)return JSON.stringify(t);if(Array.isArray(t)){let i="[";for(let o of t)i+="".concat(zs(o),",");return"".concat(i,"]")}let r=Object.keys(t).sort(),n="{";for(let i=0;i<r.length;i++)n+="".concat(JSON.stringify(r[i]),":").concat(zs(t[r[i]]),",");return"".concat(n,"}")}function Jd(t){let e="";for(let r of Th)e+="/".concat(zs(t[r]));return e}function Pc(t,e){let r={};for(let i=0;i<t.length;i++){let o=e&&e[t[i].id]||Jd(t[i]);e&&(e[t[i].id]=o);let a=r[o];a||(a=r[o]=[]),a.push(t[i])}let n=[];for(let i in r)n.push(r[i]);return n}function Sc(t){let e=t.key,r=t.value;return r?[new C(e,r,"constants have been deprecated as of v8")]:[]}function le(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Jt(t){if(Array.isArray(t))return t.map(Jt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=Jt(t[r]);return e}return le(t)}function Re(t){let e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=t.validateSpec,l=[],u=j(r);if(u!=="object")return[new C(e,r,"object expected, ".concat(u," found"))];for(let c in r){let p=c.split(".")[0],f=on(n,p)||n["*"],y;if(on(i,p))y=i[p];else if(on(n,p))y=s;else if(i["*"])y=i["*"];else if(n["*"])y=s;else{l.push(new C(e,r[c],\'unknown property "\'.concat(c,\'"\')));continue}l=l.concat(y({key:(e&&"".concat(e,"."))+c,value:r[c],valueSpec:f,style:o,styleSpec:a,object:r,objectKey:c,validateSpec:s},r))}for(let c in n)i[c]||n[c].required&&n[c].default===void 0&&r[c]===void 0&&l.push(new C(e,r,\'missing required property "\'.concat(c,\'"\')));return l}function Xs(t){let e=t.value,r=t.valueSpec,n=t.validateSpec,i=t.style,o=t.styleSpec,a=t.key,s=t.arrayElementValidator||n;if(j(e)!=="array")return[new C(a,e,"array expected, ".concat(j(e)," found"))];if(r.length&&e.length!==r.length)return[new C(a,e,"array length ".concat(r.length," expected, length ").concat(e.length," found"))];if(r["min-length"]&&e.length<r["min-length"])return[new C(a,e,"array length at least ".concat(r["min-length"]," expected, length ").concat(e.length," found"))];let l={type:r.value,values:r.values};o.$version<7&&(l.function=r.function),j(r.value)==="object"&&(l=r.value);let u=[];for(let c=0;c<e.length;c++)u=u.concat(s({array:e,arrayIndex:c,value:e[c],valueSpec:l,validateSpec:t.validateSpec,style:i,styleSpec:o,key:"".concat(a,"[").concat(c,"]")}));return u}function Co(t){let e=t.key,r=t.value,n=t.valueSpec,i=j(r);return i==="number"&&r!==r&&(i="NaN"),i!=="number"?[new C(e,r,"number expected, ".concat(i," found"))]:"minimum"in n&&r<n.minimum?[new C(e,r,"".concat(r," is less than the minimum value ").concat(n.minimum))]:"maximum"in n&&r>n.maximum?[new C(e,r,"".concat(r," is greater than the maximum value ").concat(n.maximum))]:[]}function wc(t){let e=t.valueSpec,r=le(t.value.type),n,i={},o,a,s=r!=="categorical"&&t.value.property===void 0,l=!s,u=j(t.value.stops)==="array"&&j(t.value.stops[0])==="array"&&j(t.value.stops[0][0])==="object",c=Re({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:p,default:m}});return r==="identity"&&s&&c.push(new C(t.key,t.value,\'missing required property "property"\')),r!=="identity"&&!t.value.stops&&c.push(new C(t.key,t.value,\'missing required property "stops"\')),r==="exponential"&&t.valueSpec.expression&&!qs(t.valueSpec)&&c.push(new C(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!It(t.valueSpec)?c.push(new C(t.key,t.value,"property functions not supported")):s&&!mc(t.valueSpec)&&c.push(new C(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||u)&&t.value.property===void 0&&c.push(new C(t.key,t.value,\'"property" property is required\')),c;function p(h){if(r==="identity")return[new C(h.key,h.value,\'identity function may not have a "stops" property\')];let g=[],d=h.value;return g=g.concat(Xs({key:h.key,value:d,valueSpec:h.valueSpec,validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec,arrayElementValidator:f})),j(d)==="array"&&d.length===0&&g.push(new C(h.key,d,"array must have at least one stop")),g}function f(h){let g=[],d=h.value,b=h.key;if(j(d)!=="array")return[new C(b,d,"array expected, ".concat(j(d)," found"))];if(d.length!==2)return[new C(b,d,"array length 2 expected, length ".concat(d.length," found"))];if(u){if(j(d[0])!=="object")return[new C(b,d,"object expected, ".concat(j(d[0])," found"))];if(d[0].zoom===void 0)return[new C(b,d,"object stop key must have zoom")];if(d[0].value===void 0)return[new C(b,d,"object stop key must have value")];if(a&&a>le(d[0].zoom))return[new C(b,d[0].zoom,"stop zoom values must appear in ascending order")];le(d[0].zoom)!==a&&(a=le(d[0].zoom),o=void 0,i={}),g=g.concat(Re({key:"".concat(b,"[0]"),value:d[0],valueSpec:{zoom:{}},validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec,objectElementValidators:{zoom:Co,value:y}}))}else g=g.concat(y({key:"".concat(b,"[0]"),value:d[0],validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec},d));return An(Jt(d[1]))?g.concat([new C("".concat(b,"[1]"),d[1],"expressions are not allowed in function stops.")]):g.concat(h.validateSpec({key:"".concat(b,"[1]"),value:d[1],valueSpec:e,validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec}))}function y(h,g){let d=j(h.value),b=le(h.value),x=h.value!==null?h.value:g;if(!n)n=d;else if(d!==n)return[new C(h.key,x,"".concat(d," stop domain type must match previous stop domain type ").concat(n))];if(d!=="number"&&d!=="string"&&d!=="boolean")return[new C(h.key,x,"stop domain value must be a number, string, or boolean")];if(d!=="number"&&r!=="categorical"){let v="number expected, ".concat(d," found");return It(e)&&r===void 0&&(v+=\'\\nIf you intended to use a categorical function, specify `"type": "categorical"`.\'),[new C(h.key,x,v)]}return r==="categorical"&&d==="number"&&(!isFinite(b)||Math.floor(b)!==b)?[new C(h.key,x,"integer expected, found ".concat(b))]:r!=="categorical"&&d==="number"&&o!==void 0&&b<o?[new C(h.key,x,"stop domain values must appear in ascending order")]:(o=b,r==="categorical"&&b in i?[new C(h.key,x,"stop domain values must be unique")]:(i[b]=!0,[]))}function m(h){return h.validateSpec({key:h.key,value:h.value,valueSpec:e,validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec})}}function wr(t){let e=(t.expressionContext==="property"?xc:er)(Jt(t.value),t.valueSpec);if(e.result==="error")return e.value.map(n=>new C("".concat(t.key).concat(n.key),t.value,n.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new C(t.key,t.value,\'Invalid data expression for "\'.concat(t.propertyKey,\'". Output values must be contained as literals within the expression.\'))];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!xn(r))return[new C(t.key,t.value,\'"feature-state" data expressions are not supported with layout properties.\')];if(t.expressionContext==="filter"&&!xn(r))return[new C(t.key,t.value,\'"feature-state" data expressions are not supported with filters.\')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!_o(r,["zoom","feature-state"]))return[new C(t.key,t.value,\'"zoom" and "feature-state" expressions are not supported with cluster properties.\')];if(t.expressionContext==="cluster-initial"&&!Ao(r))return[new C(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Yd(t){let e=t.value,r=t.key,n=j(e);return n!=="boolean"?[new C(r,e,"boolean expected, ".concat(n," found"))]:[]}function Os(t){let e=t.key,r=t.value,n=j(r);return n!=="string"?[new C(e,r,"color expected, ".concat(n," found"))]:H.parse(String(r))?[]:[new C(e,r,\'color expected, "\'.concat(r,\'" found\'))]}function vn(t){let e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?n.values.indexOf(le(r))===-1&&i.push(new C(e,r,"expected one of [".concat(n.values.join(", "),"], ").concat(JSON.stringify(r)," found"))):Object.keys(n.values).indexOf(le(r))===-1&&i.push(new C(e,r,"expected one of [".concat(Object.keys(n.values).join(", "),"], ").concat(JSON.stringify(r)," found"))),i}function Hs(t){return Ws(Jt(t.value))?wr(vr({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Ac(t)}function Ac(t){let e=t.value,r=t.key;if(j(e)!=="array")return[new C(r,e,"array expected, ".concat(j(e)," found"))];let n=t.styleSpec,i,o=[];if(e.length<1)return[new C(r,e,"filter array must have at least 1 element")];switch(o=o.concat(vn({key:"".concat(r,"[0]"),value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),le(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&le(e[1])==="$type"&&o.push(new C(r,e,\'"$type" cannot be use with operator "\'.concat(e[0],\'"\')));case"==":case"!=":e.length!==3&&o.push(new C(r,e,\'filter array for operator "\'.concat(e[0],\'" must have 3 elements\')));case"in":case"!in":e.length>=2&&(i=j(e[1]),i!=="string"&&o.push(new C("".concat(r,"[1]"),e[1],"string expected, ".concat(i," found"))));for(let a=2;a<e.length;a++)i=j(e[a]),le(e[1])==="$type"?o=o.concat(vn({key:"".concat(r,"[").concat(a,"]"),value:e[a],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):i!=="string"&&i!=="number"&&i!=="boolean"&&o.push(new C("".concat(r,"[").concat(a,"]"),e[a],"string, number, or boolean expected, ".concat(i," found")));break;case"any":case"all":case"none":for(let a=1;a<e.length;a++)o=o.concat(Ac({key:"".concat(r,"[").concat(a,"]"),value:e[a],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":i=j(e[1]),e.length!==2?o.push(new C(r,e,\'filter array for "\'.concat(e[0],\'" operator must have 2 elements\'))):i!=="string"&&o.push(new C("".concat(r,"[1]"),e[1],"string expected, ".concat(i," found")));break}return o}function _c(t,e){let r=t.key,n=t.validateSpec,i=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,l=o["".concat(e,"_").concat(t.layerType)];if(!l)return[];let u=s.match(/^(.*)-transition$/);if(e==="paint"&&u&&l[u[1]]&&l[u[1]].transition)return n({key:r,value:a,valueSpec:o.transition,style:i,styleSpec:o});let c=t.valueSpec||l[s];if(!c)return[new C(r,a,\'unknown property "\'.concat(s,\'"\'))];let p;if(j(a)==="string"&&It(c)&&!c.tokens&&(p=/^{([^}]+)}$/.exec(a)))return[new C(r,a,\'"\'.concat(s,\'" does not support interpolation syntax\\n\')+\'Use an identity property function instead: `{ "type": "identity", "property": \'.concat(JSON.stringify(p[1])," }`."))];let f=[];return t.layerType==="symbol"&&(s==="text-field"&&i&&!i.glyphs&&f.push(new C(r,a,\'use of "text-field" requires a style "glyphs" property\')),s==="text-font"&&Io(Jt(a))&&le(a.type)==="identity"&&f.push(new C(r,a,\'"text-font" does not support identity functions\'))),f.concat(n({key:t.key,value:a,valueSpec:c,style:i,styleSpec:o,expressionContext:"property",propertyType:e,propertyKey:s}))}function Ic(t){return _c(t,"paint")}function Tc(t){return _c(t,"layout")}function Cc(t){let e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;if(j(r)!=="object")return[new C(n,r,"object expected, ".concat(j(r)," found"))];!r.type&&!r.ref&&e.push(new C(n,r,\'either "type" or "ref" is required\'));let a=le(r.type),s=le(r.ref);if(r.id){let l=le(r.id);for(let u=0;u<t.arrayIndex;u++){let c=i.layers[u];le(c.id)===l&&e.push(new C(n,r.id,\'duplicate layer id "\'.concat(r.id,\'", previously used at line \').concat(c.id.__line__)))}}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(u=>{u in r&&e.push(new C(n,r[u],\'"\'.concat(u,\'" is prohibited for ref layers\')))});let l;i.layers.forEach(u=>{le(u.id)===s&&(l=u)}),l?l.ref?e.push(new C(n,r.ref,"ref cannot reference another ref layer")):a=le(l.type):e.push(new C(n,r.ref,\'ref layer "\'.concat(s,\'" not found\')))}else if(a!=="background")if(!r.source)e.push(new C(n,r,\'missing required property "source"\'));else{let l=i.sources&&i.sources[r.source],u=l&&le(l.type);l?u==="vector"&&a==="raster"?e.push(new C(n,r.source,\'layer "\'.concat(r.id,\'" requires a raster source\'))):u!=="raster-dem"&&a==="hillshade"?e.push(new C(n,r.source,\'layer "\'.concat(r.id,\'" requires a raster-dem source\'))):u!=="raster-dem"&&a==="color-relief"?e.push(new C(n,r.source,\'layer "\'.concat(r.id,\'" requires a raster-dem source\'))):u==="raster"&&a!=="raster"?e.push(new C(n,r.source,\'layer "\'.concat(r.id,\'" requires a vector source\'))):u==="vector"&&!r["source-layer"]?e.push(new C(n,r,\'layer "\'.concat(r.id,\'" must specify a "source-layer"\'))):u==="raster-dem"&&a!=="hillshade"&&a!=="color-relief"?e.push(new C(n,r.source,"raster-dem source can only be used with layer type \'hillshade\' or \'color-relief\'.")):a==="line"&&r.paint&&r.paint["line-gradient"]&&(u!=="geojson"||!l.lineMetrics)&&e.push(new C(n,r,\'layer "\'.concat(r.id,\'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.\'))):e.push(new C(n,r.source,\'source "\'.concat(r.source,\'" not found\')))}return e=e.concat(Re({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:"".concat(n,".type"),value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter:Hs,layout(l){return Re({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return Tc(vr({layerType:a},u))}}})},paint(l){return Re({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return Ic(vr({layerType:a},u))}}})}}})),e}function Yt(t){let e=t.value,r=t.key,n=j(e);return n!=="string"?[new C(r,e,"string expected, ".concat(n," found"))]:[]}function Kd(t){var e;let r=(e=t.sourceName)!==null&&e!==void 0?e:"",n=t.value,i=t.styleSpec,o=i.source_raster_dem,a=t.style,s=[],l=j(n);if(n===void 0)return s;if(l!=="object")return s.push(new C("source_raster_dem",n,"object expected, ".concat(l," found"))),s;let c=le(n.encoding)==="custom",p=["redFactor","greenFactor","blueFactor","baseShift"],f=t.value.encoding?\'"\'.concat(t.value.encoding,\'"\'):"Default";for(let y in n)!c&&p.includes(y)?s.push(new C(y,n[y],\'In "\'.concat(r,\'": "\').concat(y,\'" is only valid when "encoding" is set to "custom". \').concat(f," encoding found"))):o[y]?s=s.concat(t.validateSpec({key:y,value:n[y],valueSpec:o[y],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new C(y,n[y],\'unknown property "\'.concat(y,\'"\')));return s}var Ju={promoteId:Qd};function kc(t){let e=t.value,r=t.key,n=t.styleSpec,i=t.style,o=t.validateSpec;if(!e.type)return[new C(r,e,\'"type" is required\')];let a=le(e.type),s;switch(a){case"vector":case"raster":return s=Re({key:r,value:e,valueSpec:n["source_".concat(a.replace("-","_"))],style:t.style,styleSpec:n,objectElementValidators:Ju,validateSpec:o}),s;case"raster-dem":return s=Kd({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:o}),s;case"geojson":if(s=Re({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:o,objectElementValidators:Ju}),e.cluster)for(let l in e.clusterProperties){let[u,c]=e.clusterProperties[l],p=typeof u=="string"?[u,["accumulated"],["get",l]]:u;s.push(...wr({key:"".concat(r,".").concat(l,".map"),value:c,expressionContext:"cluster-map"})),s.push(...wr({key:"".concat(r,".").concat(l,".reduce"),value:p,expressionContext:"cluster-reduce"}))}return s;case"video":return Re({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:o,styleSpec:n});case"image":return Re({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:o,styleSpec:n});case"canvas":return[new C(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return vn({key:"".concat(r,".type"),value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Qd({key:t,value:e}){if(j(e)==="string")return Yt({key:t,value:e});{let r=[];for(let n in e)r.push(...Yt({key:"".concat(t,".").concat(n),value:e[n]}));return r}}function Fc(t){let e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],a=j(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new C("light",e,"object expected, ".concat(a," found"))]),o;for(let s in e){let l=s.match(/^(.*)-transition$/);l&&n[l[1]]&&n[l[1]].transition?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:r.transition,validateSpec:t.validateSpec,style:i,styleSpec:r})):n[s]?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:t.validateSpec,style:i,styleSpec:r})):o=o.concat([new C(s,e[s],\'unknown property "\'.concat(s,\'"\'))])}return o}function Ec(t){let e=t.value,r=t.styleSpec,n=r.sky,i=t.style,o=j(e);if(e===void 0)return[];if(o!=="object")return[new C("sky",e,"object expected, ".concat(o," found"))];let a=[];for(let s in e)n[s]?a=a.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a=a.concat([new C(s,e[s],\'unknown property "\'.concat(s,\'"\'))]);return a}function Mc(t){let e=t.value,r=t.styleSpec,n=r.terrain,i=t.style,o=[],a=j(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new C("terrain",e,"object expected, ".concat(a," found"))]),o;for(let s in e)n[s]?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:t.validateSpec,style:i,styleSpec:r})):o=o.concat([new C(s,e[s],\'unknown property "\'.concat(s,\'"\'))]);return o}function eg(t){return Yt(t).length===0?[]:wr(t)}function tg(t){return Yt(t).length===0?[]:wr(t)}function rg(t){let e=t.key,r=t.value;if(j(r)==="array"){if(r.length<1||r.length>4)return[new C(e,r,"padding requires 1 to 4 values; ".concat(r.length," values found"))];let i={type:"number"},o=[];for(let a=0;a<r.length;a++)o=o.concat(t.validateSpec({key:"".concat(e,"[").concat(a,"]"),value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return o}else return Co({key:e,value:r,valueSpec:{}})}function ng(t){let e=t.key,r=t.value;if(j(r)==="array"){let i={type:"number"};if(r.length<1)return[new C(e,r,"array length at least 1 expected, length 0 found")];let o=[];for(let a=0;a<r.length;a++)o=o.concat(t.validateSpec({key:"".concat(e,"[").concat(a,"]"),value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return o}else return Co({key:e,value:r,valueSpec:{}})}function ig(t){let e=t.key,r=t.value;if(j(r)==="array"){if(r.length<1)return[new C(e,r,"array length at least 1 expected, length 0 found")];let i=[];for(let o=0;o<r.length;o++)i=i.concat(Os({key:"".concat(e,"[").concat(o,"]"),value:r[o]}));return i}else return Os({key:e,value:r})}function og(t){let e=t.key,r=t.value,n=j(r),i=t.styleSpec;if(n!=="array"||r.length<1||r.length%2!==0)return[new C(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let o=[];for(let a=0;a<r.length;a+=2)o=o.concat(vn({key:"".concat(e,"[").concat(a,"]"),value:r[a],valueSpec:i.layout_symbol["text-anchor"]})),o=o.concat(Xs({key:"".concat(e,"[").concat(a+1,"]"),value:r[a+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:i}));return o}function Lc(t){let e=[],r=t.value,n=t.key;if(Array.isArray(r)){let i=[],o=[];for(let a in r){r[a].id&&i.includes(r[a].id)&&e.push(new C(n,r,"all the sprites\' ids must be unique, but ".concat(r[a].id," is duplicated"))),i.push(r[a].id),r[a].url&&o.includes(r[a].url)&&e.push(new C(n,r,"all the sprites\' URLs must be unique, but ".concat(r[a].url," is duplicated"))),o.push(r[a].url);let s={id:{type:"string",required:!0},url:{type:"string",required:!0}};e=e.concat(Re({key:"".concat(n,"[").concat(a,"]"),value:r[a],valueSpec:s,validateSpec:t.validateSpec}))}return e}else return Yt({key:n,value:r})}function ag(t){let e=t.value,r=t.styleSpec,n=r.projection,i=t.style,o=j(e);if(e===void 0)return[];if(o!=="object")return[new C("projection",e,"object expected, ".concat(o," found"))];let a=[];for(let s in e)n[s]?a=a.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a=a.concat([new C(s,e[s],\'unknown property "\'.concat(s,\'"\'))]);return a}function sg(t){let e=t.key,r=t.value;r=r instanceof String?r.valueOf():r;let n=j(r);return n==="array"&&!ug(r)&&!lg(r)?[new C(e,r,"projection expected, invalid array ".concat(JSON.stringify(r)," found"))]:["array","string"].includes(n)?[]:[new C(e,r,\'projection expected, invalid type "\'.concat(n,\'" found\'))]}function lg(t){return!!["interpolate","step","literal"].includes(t[0])}function ug(t){return Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"}function cg(t){return!!t&&t.constructor===Object}function Dc(t){return cg(t.value)?[]:[new C(t.key,t.value,"object expected, ".concat(j(t.value)," found"))]}var Yu={"*"(){return[]},array:Xs,boolean:Yd,number:Co,color:Os,constants:Sc,enum:vn,filter:Hs,function:wc,layer:Cc,object:Re,source:kc,light:Fc,sky:Ec,terrain:Mc,projection:ag,projectionDefinition:sg,string:Yt,formatted:eg,resolvedImage:tg,padding:rg,numberArray:ng,colorArray:ig,variableAnchorOffsetCollection:og,sprite:Lc,state:Dc};function ho(t){let e=t.value,r=t.valueSpec,n=t.styleSpec;return t.validateSpec=ho,r.expression&&Io(le(e))?wc(t):r.expression&&An(Jt(e))?wr(t):r.type&&Yu[r.type]?Yu[r.type](t):Re(vr({},t,{valueSpec:r.type?n[r.type]:r}))}function Bc(t){let e=t.value,r=t.key,n=Yt(t);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new C(r,e,\'"glyphs" url must include a "{fontstack}" token\')),e.indexOf("{range}")===-1&&n.push(new C(r,e,\'"glyphs" url must include a "{range}" token\'))),n}function Me(t,e=P){let r=[];return r=r.concat(ho({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:ho,objectElementValidators:{glyphs:Bc,"*"(){return[]}}})),t.constants&&(r=r.concat(Sc({key:"constants",value:t.constants}))),Vc(r)}Me.source=qe(je(kc));Me.sprite=qe(je(Lc));Me.glyphs=qe(je(Bc));Me.light=qe(je(Fc));Me.sky=qe(je(Ec));Me.terrain=qe(je(Mc));Me.state=qe(je(Dc));Me.layer=qe(je(Cc));Me.filter=qe(je(Hs));Me.paintProperty=qe(je(Ic));Me.layoutProperty=qe(je(Tc));function je(t){return function(e){return t(Xi($t({},e),{validateSpec:ho}))}}function Vc(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function qe(t){return function(...e){return Vc(t.apply(this,e))}}var Rc="AbortError";function zc(t){return t.message===Rc}function Zs(){return new Error(Rc)}var ko={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Oc(t){return ko.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}function Gc(t,e){ko.REGISTERED_PROTOCOLS[t]=e}function Nc(t){delete ko.REGISTERED_PROTOCOLS[t]}var Uc="global-dispatcher",tr=class extends Error{constructor(e,r,n,i){super("AJAXError: ".concat(r," (").concat(e,"): ").concat(n)),this.status=e,this.statusText=r,this.url=n,this.body=i}},jc=()=>at(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,pg=t=>/^file:/.test(t)||/^file:/.test(jc())&&!/^\\w+:/.test(t);async function fg(t,e){let r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:jc(),signal:e.signal});t.type==="json"&&!r.headers.has("Accept")&&r.headers.set("Accept","application/json");let n;try{n=await fetch(r)}catch(a){throw new tr(0,a.message,t.url,new Blob)}if(!n.ok){let a=await n.blob();throw new tr(n.status,n.statusText,t.url,a)}let i;t.type==="arrayBuffer"||t.type==="image"?i=n.arrayBuffer():t.type==="json"?i=n.json():i=n.text();let o=await i;if(e.signal.aborted)throw Zs();return{data:o,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}function yg(t,e){return new Promise((r,n)=>{var o;let i=new XMLHttpRequest;i.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(i.responseType="arraybuffer");for(let a in t.headers)i.setRequestHeader(a,t.headers[a]);t.type==="json"&&(i.responseType="text",(o=t.headers)!=null&&o.Accept||i.setRequestHeader("Accept","application/json")),i.withCredentials=t.credentials==="include",i.onerror=()=>{n(new Error(i.statusText))},i.onload=()=>{if(!e.signal.aborted)if((i.status>=200&&i.status<300||i.status===0)&&i.response!==null){let a=i.response;if(t.type==="json")try{a=JSON.parse(i.response)}catch(s){n(s);return}r({data:a,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires")})}else{let a=new Blob([i.response],{type:i.getResponseHeader("Content-Type")});n(new tr(i.status,i.statusText,t.url,a))}},e.signal.addEventListener("abort",()=>{i.abort(),n(Zs())}),i.send(t.body)})}var qc=function(t,e){if(/:\\/\\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let r=Oc(t.url);if(r)return r(t,e);if(at(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:Uc},e)}if(!pg(t.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return fg(t,e);if(at(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:Uc},e)}return yg(t,e)},Wc=(t,e)=>qc(de(t,{type:"json"}),e),Xc=(t,e)=>qc(de(t,{type:"arrayBuffer"}),e);var ut={};function I(t,e,r={}){if(ut[t])throw new Error("".concat(t," is already registered."));Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),ut[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}I("Object",Object);I("Set",Set);I("TransferableGridIndex",jt);I("Color",H);I("Error",Error);I("AJAXError",tr);I("ResolvedImage",Se);I("StylePropertyFunction",bn);I("StyleExpression",Zt,{omit:["_evaluator"]});I("ZoomDependentExpression",Tt);I("ZoomConstantExpression",Je);I("CompoundExpression",Ze,{omit:["_evaluate"]});for(let t in Qt)Qt[t]._classRegistryKey||I("Expression_".concat(t),Qt[t]);function Hc(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}function Js(t){let e=t.constructor;return t.$name||e._classRegistryKey}function mg(t){if(t===null||typeof t!="object")return!1;let e=Js(t);return!!(e&&e!=="Object")}function Zc(t){return!mg(t)&&(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||Hc(t)||vt(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function Cr(t,e){if(Zc(t)){if((Hc(t)||vt(t))&&e&&e.push(t),ArrayBuffer.isView(t)){let o=t;e&&e.push(o.buffer)}return t instanceof ImageData&&e&&e.push(t.data.buffer),t}if(Array.isArray(t)){let o=[];for(let a of t)o.push(Cr(a,e));return o}if(typeof t!="object")throw new Error("can\'t serialize object of type ".concat(typeof t));let r=Js(t);if(!r)throw new Error("can\'t serialize object of unregistered class ".concat(t.constructor.name));if(!ut[r])throw new Error("".concat(r," is not registered."));let{klass:n}=ut[r],i=n.serialize?n.serialize(t,e):{};if(n.serialize){if(e&&i===e[e.length-1])throw new Error("statically serialized object won\'t survive transfer of $name property")}else{for(let o in t){if(!t.hasOwnProperty(o)||ut[r].omit.indexOf(o)>=0)continue;let a=t[o];i[o]=ut[r].shallow.indexOf(o)>=0?a:Cr(a,e)}t instanceof Error&&(i.message=t.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(i.$name=r),i}function kr(t){if(Zc(t))return t;if(Array.isArray(t))return t.map(kr);if(typeof t!="object")throw new Error("can\'t deserialize object of type ".concat(typeof t));let e=Js(t)||"Object";if(!ut[e])throw new Error("can\'t deserialize unregistered class ".concat(e));let{klass:r}=ut[e];if(!r)throw new Error("can\'t deserialize unregistered class ".concat(e));if(r.deserialize)return r.deserialize(t);let n=Object.create(r.prototype);for(let i of Object.keys(t)){if(i==="$name")continue;let o=t[i];n[i]=ut[e].shallow.indexOf(i)>=0?o:kr(o)}return n}var Fo=class{constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}};var hg={once:!0},Eo=class{constructor(e,r){this.target=e,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Fo(()=>this.process()),this.subscription=ps(this.target,"message",n=>this.receive(n),!1),this.globalScope=at(self)?e:window}registerMessageHandler(e,r){this.messageHandlers[e]=r}sendAsync(e,r){return new Promise((n,i)=>{let o=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=r?ps(r.signal,"abort",()=>{a==null||a.unsubscribe(),delete this.resolveRejects[o];let u={id:o,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(u)},hg):null;this.resolveRejects[o]={resolve:u=>{a==null||a.unsubscribe(),n(u)},reject:u=>{a==null||a.unsubscribe(),i(u)}};let s=[],l=Xi($t({},e),{id:o,sourceMapId:this.mapId,origin:location.origin,data:Cr(e.data,s)});this.target.postMessage(l,{transfer:s})})}receive(e){let r=e.data,n=r.id;if(!(r.origin!=="file://"&&location.origin!=="file://"&&r.origin!=="resource://android"&&location.origin!=="resource://android"&&r.origin!==location.origin)&&!(r.targetMapId&&this.mapId!==r.targetMapId)){if(r.type==="<cancel>"){delete this.tasks[n];let i=this.abortControllers[n];delete this.abortControllers[n],i&&i.abort();return}if(at(self)||r.mustQueue){this.tasks[n]=r,this.taskQueue.push(n),this.invoker.trigger();return}this.processTask(n,r)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),r=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(e,r)}async processTask(e,r){if(r.type==="<response>"){let o=this.resolveRejects[e];if(delete this.resolveRejects[e],!o)return;r.error?o.reject(kr(r.error)):o.resolve(kr(r.data));return}if(!this.messageHandlers[r.type]){this.completeTask(e,new Error("Could not find a registered handler for ".concat(r.type,", map ID: ").concat(this.mapId,", available handlers: ").concat(Object.keys(this.messageHandlers).join(", "))));return}let n=kr(r.data),i=new AbortController;this.abortControllers[e]=i;try{let o=await this.messageHandlers[r.type](r.sourceMapId,n,i);this.completeTask(e,null,o)}catch(o){this.completeTask(e,o)}}completeTask(e,r,n){let i=[];delete this.abortControllers[e];let o={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:r?Cr(r):null,data:Cr(n,i)};this.target.postMessage(o,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};function Jc(t,e,r){r[t]&&r[t].indexOf(e)!==-1||(r[t]=r[t]||[],r[t].push(e))}function Ys(t,e,r){if(r&&r[t]){let n=r[t].indexOf(e);n!==-1&&r[t].splice(n,1)}}var Mo=class{constructor(e,r={}){de(this,r),this.type=e}},_n=class extends Mo{constructor(e,r={}){super("error",de({error:e},r))}},Lo=class{on(e,r){return this._listeners=this._listeners||{},Jc(e,r,this._listeners),{unsubscribe:()=>{this.off(e,r)}}}off(e,r){return Ys(e,r,this._listeners),Ys(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Jc(e,r,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,r){typeof e=="string"&&(e=new Mo(e,r||{}));let n=e.type;if(this.listens(n)){e.target=this;let i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(let s of i)s.call(this,e);let o=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(let s of o)Ys(n,s,this._oneTimeListeners),s.call(this,e);let a=this._eventedParent;a&&(de(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),a.fire(e))}else e instanceof _n&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}};var ct=Me,sv=ct.source,lv=ct.light,uv=ct.sky,cv=ct.terrain,pv=ct.filter,Yc=ct.paintProperty,Kc=ct.layoutProperty;function Qc(t,e){let r=!1;if(e&&e.length)for(let n of e)t.fire(new _n(new Error(n.message))),r=!0;return r}var In=class{constructor(){this.first=!0}update(e,r){let n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=r),e!==this.lastZoom?(this.lastZoom=e,this.lastFloorZoom=n,!0):!1)}};var q={"Latin-1 Supplement":t=>t>=128&&t<=255,"Hangul Jamo":t=>t>=4352&&t<=4607,Khmer:t=>t>=6016&&t<=6143,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Kanbun:t=>t>=12688&&t<=12703,"CJK Strokes":t=>t>=12736&&t<=12783,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Hangul Syllables":t=>t>=44032&&t<=55215,"Private Use Area":t=>t>=57344&&t<=63743,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519};function Tn(t){for(let e of t)if(Do(e.charCodeAt(0)))return!0;return!1}function ep(t){for(let e of t)if(!xg(e.charCodeAt(0)))return!1;return!0}function Ks(t){let e=t.map(r=>{try{return new RegExp("\\\\p{sc=".concat(r,"}"),"u").source}catch(n){return null}}).filter(r=>r);return new RegExp(e.join("|"),"u")}var dg=["Arab","Dupl","Mong","Ougr","Syrc"],gg=Ks(dg);function xg(t){return!gg.test(String.fromCodePoint(t))}var bg=["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"],tp=Ks(bg);function rp(t){return t<11904?!1:q["CJK Compatibility Forms"](t)||q["CJK Compatibility"](t)||q["CJK Strokes"](t)||q["CJK Symbols and Punctuation"](t)||q["Enclosed CJK Letters and Months"](t)||q["Halfwidth and Fullwidth Forms"](t)||q["Ideographic Description Characters"](t)||q["Vertical Forms"](t)?!0:tp.test(String.fromCodePoint(t))}function Do(t){return t===746||t===747?!0:t<4352?!1:!!(q["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||q["CJK Compatibility"](t)||q["CJK Strokes"](t)||q["CJK Symbols and Punctuation"](t)&&!(t>=12296&&t<=12305)&&!(t>=12308&&t<=12319)&&t!==12336||q["Enclosed CJK Letters and Months"](t)||q["Ideographic Description Characters"](t)||q.Kanbun(t)||q.Katakana(t)&&t!==12540||q["Halfwidth and Fullwidth Forms"](t)&&t!==65288&&t!==65289&&t!==65293&&!(t>=65306&&t<=65310)&&t!==65339&&t!==65341&&t!==65343&&!(t>=65371&&t<=65503)&&t!==65507&&!(t>=65512&&t<=65519)||q["Small Form Variants"](t)&&!(t>=65112&&t<=65118)&&!(t>=65123&&t<=65126)||q["Vertical Forms"](t)||q["Yijing Hexagram Symbols"](t)||new RegExp("\\\\p{sc=Cans}","u").test(String.fromCodePoint(t))||new RegExp("\\\\p{sc=Hang}","u").test(String.fromCodePoint(t))||tp.test(String.fromCodePoint(t)))}function vg(t){return!!(q["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||q["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||q["Letterlike Symbols"](t)||q["Number Forms"](t)||q["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||q["Control Pictures"](t)&&t!==9251||q["Optical Character Recognition"](t)||q["Enclosed Alphanumerics"](t)||q["Geometric Shapes"](t)||q["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||q["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||q["CJK Symbols and Punctuation"](t)||q.Katakana(t)||q["Private Use Area"](t)||q["CJK Compatibility Forms"](t)||q["Small Form Variants"](t)||q["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}function Qs(t){return!(Do(t)||vg(t))}function np(t){return new RegExp("\\\\p{sc=Arab}","u").test(String.fromCodePoint(t))}var Pg=["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"],Sg=Ks(Pg);function ip(t){return Sg.test(String.fromCodePoint(t))}function wg(t,e){return!(!e&&ip(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||q.Khmer(t))}function op(t){for(let e of t)if(ip(e.charCodeAt(0)))return!0;return!1}function ap(t,e){for(let r of t)if(!wg(r.charCodeAt(0),e))return!1;return!0}var el=class{constructor(){this.TIMEOUT=5e3;this.applyArabicShaping=null;this.processBidirectionalText=null;this.processStyledBidirectionalText=null;this.pluginStatus="unavailable";this.pluginURL=null;this.loadScriptResolve=()=>{}}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(we.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}async syncState(e,r){if(this.isParsed())return this.getState();if(e.pluginStatus!=="loading")return this.setState(e),e;let n=e.pluginURL,i=new Promise(s=>{this.loadScriptResolve=s});r(n);let o=new Promise(s=>setTimeout(()=>s(),this.TIMEOUT));if(await Promise.race([i,o]),this.isParsed()){let s={pluginStatus:"loaded",pluginURL:n};return this.setState(s),s}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error("RTL Text Plugin failed to import scripts from ".concat(n))}},we=new el;var W=class{constructor(e,r){this.zoom=e,r?(this.now=r.now||0,this.fadeDuration=r.fadeDuration||0,this.zoomHistory=r.zoomHistory||new In,this.transition=r.transition||{},this.globalState=r.globalState||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new In,this.transition={},this.globalState={})}isSupportedScript(e){return ap(e,we.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,r=e-Math.floor(e),n=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*r}}};var Fr=class{constructor(e,r){this.property=e,this.value=r,this.expression=bc(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,r,n){return this.property.possiblyEvaluate(this,e,r,n)}},Cn=class{constructor(e){this.property=e,this.value=new Fr(e,void 0)}transitioned(e,r){return new Vo(this.property,this.value,r,de({},e.transition,this.transition),e.now)}untransitioned(){return new Vo(this.property,this.value,null,{},0)}},Bo=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return nt(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Cn(this._values[e].property)),this._values[e].value=new Fr(this._values[e].property,r===null?void 0:nt(r))}getTransition(e){return nt(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Cn(this._values[e].property)),this._values[e].transition=nt(r)||void 0}serialize(){let e={};for(let r of Object.keys(this._values)){let n=this.getValue(r);n!==void 0&&(e[r]=n);let i=this.getTransition(r);i!==void 0&&(e["".concat(r,"-transition")]=i)}return e}transitioned(e,r){let n=new Ro(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].transitioned(e,r._values[i]);return n}untransitioned(){let e=new Ro(this._properties);for(let r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}},Vo=class{constructor(e,r,n,i,o){this.property=e,this.value=r,this.begin=o+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=n)}possiblyEvaluate(e,r,n){let i=e.now||0,o=this.value.possiblyEvaluate(e,r,n),a=this.prior;if(a){if(i>this.end)return this.prior=null,o;if(this.value.isDataDriven())return this.prior=null,o;if(i<this.begin)return a.possiblyEvaluate(e,r,n);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,r,n),o,Tu(s))}}else return o}},Ro=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,n){let i=new kt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,r,n);return i}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}},zo=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return nt(this._values[e].value)}setValue(e,r){this._values[e]=new Fr(this._values[e].property,r===null?void 0:nt(r))}serialize(){let e={};for(let r of Object.keys(this._values)){let n=this.getValue(r);n!==void 0&&(e[r]=n)}return e}possiblyEvaluate(e,r,n){let i=new kt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,r,n);return i}},ge=class{constructor(e,r,n){this.property=e,this.value=r,this.parameters=n}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,n,i){return this.property.evaluate(this.value,this.parameters,e,r,n,i)}},kt=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}},F=class{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,n){let i=this.specification.type,o=lt[i];return o?o(e,r,n):e}},L=class{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,n,i){return e.expression.kind==="constant"||e.expression.kind==="camera"?new ge(this,{kind:"constant",value:e.expression.evaluate(r,null,{},n,i)},r):new ge(this,e.expression,r)}interpolate(e,r,n){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new ge(this,{kind:"constant",value:void 0},e.parameters);let i=this.specification.type,o=lt[i];if(o){let a=o(e.value.value,r.value.value,n);return new ge(this,{kind:"constant",value:a},e.parameters)}else return e}evaluate(e,r,n,i,o,a){return e.kind==="constant"?e.value:e.evaluate(r,n,i,o,a)}},pt=class extends L{possiblyEvaluate(e,r,n,i){if(e.value===void 0)return new ge(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){let o=e.expression.evaluate(r,null,{},n,i),s=e.property.specification.type==="resolvedImage"&&typeof o!="string"?o.name:o,l=this._calculate(s,s,s,r);return new ge(this,{kind:"constant",value:l},r)}else if(e.expression.kind==="camera"){let o=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new ge(this,{kind:"constant",value:o},r)}else return new ge(this,e.expression,r)}evaluate(e,r,n,i,o,a){if(e.kind==="source"){let s=e.evaluate(r,n,i,o,a);return this._calculate(s,s,s,r)}else return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},n,i),e.evaluate({zoom:Math.floor(r.zoom)},n,i),e.evaluate({zoom:Math.floor(r.zoom)+1},n,i),r):e.value}_calculate(e,r,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:n,to:r}}interpolate(e){return e}},rr=class{constructor(e){this.specification=e}possiblyEvaluate(e,r,n,i){if(e.value!==void 0)if(e.expression.kind==="constant"){let o=e.expression.evaluate(r,null,{},n,i);return this._calculate(o,o,o,r)}else return this._calculate(e.expression.evaluate(new W(Math.floor(r.zoom-1),r)),e.expression.evaluate(new W(Math.floor(r.zoom),r)),e.expression.evaluate(new W(Math.floor(r.zoom+1),r)),r)}_calculate(e,r,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:n,to:r}}interpolate(e){return e}},ft=class{constructor(e){this.specification=e}possiblyEvaluate(e,r,n,i){return!!e.expression.evaluate(r,null,{},n,i)}interpolate(){return!1}},ee=class{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let r in e){let n=e[r];n.specification.overridable&&this.overridableProperties.push(r);let i=this.defaultPropertyValues[r]=new Fr(n,void 0),o=this.defaultTransitionablePropertyValues[r]=new Cn(n);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate({})}}};I("DataDrivenProperty",L);I("DataConstantProperty",F);I("CrossFadedDataDrivenProperty",pt);I("CrossFadedProperty",rr);I("ColorRampProperty",ft);var Oo="-transition",oe=class extends Lo{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},e.type!=="custom"&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=Ct(e.filter)),r.layout&&(this._unevaluatedLayout=new zo(r.layout)),r.paint)){this._transitionablePaint=new Bo(r.paint);for(let n in e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(let n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new kt(r.paint)}}setFilter(e){this.filter=e,this._featureFilter=Ct(e)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;if(this._unevaluatedLayout)for(let r in this._unevaluatedLayout._values){let n=this._unevaluatedLayout._values[r];for(let i of n.getGlobalStateRefs())e.add(i)}for(let r of this._featureFilter.getGlobalStateRefs())e.add(r);return e}setLayoutProperty(e,r,n={}){if(r!=null){let i="layers.".concat(this.id,".layout.").concat(e);if(this._validate(Kc,i,e,r,n))return}if(e==="visibility"){this.visibility=r;return}this._unevaluatedLayout.setValue(e,r)}getPaintProperty(e){return e.endsWith(Oo)?this._transitionablePaint.getTransition(e.slice(0,-Oo.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,n={}){if(r!=null){let i="layers.".concat(this.id,".paint.").concat(e);if(this._validate(Yc,i,e,r,n))return!1}if(e.endsWith(Oo))return this._transitionablePaint.setTransition(e.slice(0,-Oo.length),r||void 0),!1;{let i=this._transitionablePaint._values[e],o=i.property.specification["property-type"]==="cross-faded-data-driven",a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);let l=this._transitionablePaint._values[e].value;return l.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(e,s,l)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,n){return!1}isHidden(e){return this.minzoom&&e<this.minzoom||this.maxzoom&&e>=this.maxzoom?!0:this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){let e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Fu(e,(r,n)=>r!==void 0&&!(n==="layout"&&!Object.keys(r).length)&&!(n==="paint"&&!Object.keys(r).length))}_validate(e,r,n,i,o={}){return o&&o.validate===!1?!1:Qc(this,e.call(ct,{key:r,layerType:this.type,objectKey:n,value:i,styleSpec:P,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let r=this.paint.get(e);if(!(!(r instanceof ge)||!It(r.property.specification))&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}};var Ag={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ft=class{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},_g=128,Ig=5,te=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*Ig),_g),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}};function Q(t,e=1){let r=0,n=0,i=t.map(a=>{let s=Tg(a.type),l=r=sp(r,Math.max(e,s)),u=a.components||1;return n=Math.max(n,s),r+=s*u,{name:a.name,type:a.type,components:u,offset:l}}),o=sp(r,Math.max(n,e));return{members:i,size:o,alignment:e}}function Tg(t){return Ag[t].BYTES_PER_ELEMENT}function sp(t,e){return Math.ceil(t/e)*e}var lp=Y(ye(),1),nr=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.int16[i+0]=r,this.int16[i+1]=n,e}};nr.prototype.bytesPerElement=4;I("StructArrayLayout2i4",nr);var kn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.int16[o+0]=r,this.int16[o+1]=n,this.int16[o+2]=i,e}};kn.prototype.bytesPerElement=6;I("StructArrayLayout3i6",kn);var Go=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,n,i)}emplace(e,r,n,i,o){let a=e*4;return this.int16[a+0]=r,this.int16[a+1]=n,this.int16[a+2]=i,this.int16[a+3]=o,e}};Go.prototype.bytesPerElement=8;I("StructArrayLayout4i8",Go);var Fn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let l=e*6;return this.int16[l+0]=r,this.int16[l+1]=n,this.int16[l+2]=i,this.int16[l+3]=o,this.int16[l+4]=a,this.int16[l+5]=s,e}};Fn.prototype.bytesPerElement=12;I("StructArrayLayout2i4i12",Fn);var En=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let l=e*4,u=e*8;return this.int16[l+0]=r,this.int16[l+1]=n,this.uint8[u+4]=i,this.uint8[u+5]=o,this.uint8[u+6]=a,this.uint8[u+7]=s,e}};En.prototype.bytesPerElement=8;I("StructArrayLayout2i4ub8",En);var Et=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.float32[i+0]=r,this.float32[i+1]=n,e}};Et.prototype.bytesPerElement=8;I("StructArrayLayout2f8",Et);var Mn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,l,u,c){let p=this.length;return this.resize(p+1),this.emplace(p,e,r,n,i,o,a,s,l,u,c)}emplace(e,r,n,i,o,a,s,l,u,c,p){let f=e*10;return this.uint16[f+0]=r,this.uint16[f+1]=n,this.uint16[f+2]=i,this.uint16[f+3]=o,this.uint16[f+4]=a,this.uint16[f+5]=s,this.uint16[f+6]=l,this.uint16[f+7]=u,this.uint16[f+8]=c,this.uint16[f+9]=p,e}};Mn.prototype.bytesPerElement=20;I("StructArrayLayout10ui20",Mn);var Ln=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,l,u,c,p,f){let y=this.length;return this.resize(y+1),this.emplace(y,e,r,n,i,o,a,s,l,u,c,p,f)}emplace(e,r,n,i,o,a,s,l,u,c,p,f,y){let m=e*12;return this.int16[m+0]=r,this.int16[m+1]=n,this.int16[m+2]=i,this.int16[m+3]=o,this.uint16[m+4]=a,this.uint16[m+5]=s,this.uint16[m+6]=l,this.uint16[m+7]=u,this.int16[m+8]=c,this.int16[m+9]=p,this.int16[m+10]=f,this.int16[m+11]=y,e}};Ln.prototype.bytesPerElement=24;I("StructArrayLayout4i4ui4i24",Ln);var Dn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.float32[o+0]=r,this.float32[o+1]=n,this.float32[o+2]=i,e}};Dn.prototype.bytesPerElement=12;I("StructArrayLayout3f12",Dn);var Bn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.uint32[n+0]=r,e}};Bn.prototype.bytesPerElement=4;I("StructArrayLayout1ul4",Bn);var Vn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,l,u){let c=this.length;return this.resize(c+1),this.emplace(c,e,r,n,i,o,a,s,l,u)}emplace(e,r,n,i,o,a,s,l,u,c){let p=e*10,f=e*5;return this.int16[p+0]=r,this.int16[p+1]=n,this.int16[p+2]=i,this.int16[p+3]=o,this.int16[p+4]=a,this.int16[p+5]=s,this.uint32[f+3]=l,this.uint16[p+8]=u,this.uint16[p+9]=c,e}};Vn.prototype.bytesPerElement=20;I("StructArrayLayout6i1ul2ui20",Vn);var Rn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let l=e*6;return this.int16[l+0]=r,this.int16[l+1]=n,this.int16[l+2]=i,this.int16[l+3]=o,this.int16[l+4]=a,this.int16[l+5]=s,e}};Rn.prototype.bytesPerElement=12;I("StructArrayLayout2i2i2i12",Rn);var No=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,n,i,o)}emplace(e,r,n,i,o,a){let s=e*4,l=e*8;return this.float32[s+0]=r,this.float32[s+1]=n,this.float32[s+2]=i,this.int16[l+6]=o,this.int16[l+7]=a,e}};No.prototype.bytesPerElement=16;I("StructArrayLayout2f1f2i16",No);var zn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let l=e*16,u=e*4,c=e*8;return this.uint8[l+0]=r,this.uint8[l+1]=n,this.float32[u+1]=i,this.float32[u+2]=o,this.int16[c+6]=a,this.int16[c+7]=s,e}};zn.prototype.bytesPerElement=16;I("StructArrayLayout2ub2f2i16",zn);var On=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.uint16[o+0]=r,this.uint16[o+1]=n,this.uint16[o+2]=i,e}};On.prototype.bytesPerElement=6;I("StructArrayLayout3ui6",On);var Gn=class extends te{_refreshViews(){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)}emplaceBack(e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,g,d){let b=this.length;return this.resize(b+1),this.emplace(b,e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,g,d)}emplace(e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,g,d,b){let x=e*24,v=e*12,S=e*48;return this.int16[x+0]=r,this.int16[x+1]=n,this.uint16[x+2]=i,this.uint16[x+3]=o,this.uint32[v+2]=a,this.uint32[v+3]=s,this.uint32[v+4]=l,this.uint16[x+10]=u,this.uint16[x+11]=c,this.uint16[x+12]=p,this.float32[v+7]=f,this.float32[v+8]=y,this.uint8[S+36]=m,this.uint8[S+37]=h,this.uint8[S+38]=g,this.uint32[v+10]=d,this.int16[x+22]=b,e}};Gn.prototype.bytesPerElement=48;I("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Gn);var Nn=class extends te{_refreshViews(){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)}emplaceBack(e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,g,d,b,x,v,S,A,w,T,E,D,B,z){let M=this.length;return this.resize(M+1),this.emplace(M,e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,g,d,b,x,v,S,A,w,T,E,D,B,z)}emplace(e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,g,d,b,x,v,S,A,w,T,E,D,B,z,M){let _=e*32,V=e*16;return this.int16[_+0]=r,this.int16[_+1]=n,this.int16[_+2]=i,this.int16[_+3]=o,this.int16[_+4]=a,this.int16[_+5]=s,this.int16[_+6]=l,this.int16[_+7]=u,this.uint16[_+8]=c,this.uint16[_+9]=p,this.uint16[_+10]=f,this.uint16[_+11]=y,this.uint16[_+12]=m,this.uint16[_+13]=h,this.uint16[_+14]=g,this.uint16[_+15]=d,this.uint16[_+16]=b,this.uint16[_+17]=x,this.uint16[_+18]=v,this.uint16[_+19]=S,this.uint16[_+20]=A,this.uint16[_+21]=w,this.uint16[_+22]=T,this.uint32[V+12]=E,this.float32[V+13]=D,this.float32[V+14]=B,this.uint16[_+30]=z,this.uint16[_+31]=M,e}};Nn.prototype.bytesPerElement=64;I("StructArrayLayout8i15ui1ul2f2ui64",Nn);var ir=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.float32[n+0]=r,e}};ir.prototype.bytesPerElement=4;I("StructArrayLayout1f4",ir);var Un=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*6,a=e*3;return this.uint16[o+0]=r,this.float32[a+1]=n,this.float32[a+2]=i,e}};Un.prototype.bytesPerElement=12;I("StructArrayLayout1ui2f12",Un);var $n=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*2,a=e*4;return this.uint32[o+0]=r,this.uint16[a+2]=n,this.uint16[a+3]=i,e}};$n.prototype.bytesPerElement=8;I("StructArrayLayout1ul2ui8",$n);var jn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.uint16[i+0]=r,this.uint16[i+1]=n,e}};jn.prototype.bytesPerElement=4;I("StructArrayLayout2ui4",jn);var Uo=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.uint16[n+0]=r,e}};Uo.prototype.bytesPerElement=2;I("StructArrayLayout1ui2",Uo);var Er=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,n,i)}emplace(e,r,n,i,o){let a=e*4;return this.float32[a+0]=r,this.float32[a+1]=n,this.float32[a+2]=i,this.float32[a+3]=o,e}};Er.prototype.bytesPerElement=16;I("StructArrayLayout4f16",Er);var $o=class extends Ft{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new lp.default(this.anchorPointX,this.anchorPointY)}};$o.prototype.size=20;var qn=class extends Vn{get(e){return new $o(this,e)}};I("CollisionBoxArray",qn);var jo=class extends Ft{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}};jo.prototype.size=48;var Wn=class extends Gn{get(e){return new jo(this,e)}};I("PlacedSymbolArray",Wn);var qo=class extends Ft{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}};qo.prototype.size=64;var Xn=class extends Nn{get(e){return new qo(this,e)}};I("SymbolInstanceArray",Xn);var Hn=class extends ir{getoffsetX(e){return this.float32[e*1+0]}};I("GlyphOffsetArray",Hn);var Zn=class extends kn{getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}};I("SymbolLineVertexArray",Zn);var Wo=class extends Ft{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};Wo.prototype.size=12;var Jn=class extends Un{get(e){return new Wo(this,e)}};I("TextAnchorOffsetArray",Jn);var Xo=class extends Ft{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};Xo.prototype.size=8;var Yn=class extends $n{get(e){return new Xo(this,e)}};I("FeatureIndexArray",Yn);var Ho=class extends nr{};var Zo=class extends nr{},Jo=class extends nr{},Yo=class extends Fn{};var Ko=class extends En{},Qo=class extends Et{},yt=class extends Mn{},ea=class extends Ln{},ta=class extends Dn{},ra=class extends Bn{},Kn=class extends Rn{};var na=class extends zn{};var Le=class extends On{},Mt=class extends jn{};var Cg=Q([{name:"a_pos",components:2,type:"Int16"}],4);var{members:up,size:zv,alignment:Ov}=Cg;var pe=class t{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1;this.segments=e}prepareSegment(e,r,n,i){let o=this.segments[this.segments.length-1];return e>t.MAX_VERTEX_ARRAY_LENGTH&&ce("Max vertices per segment is ".concat(t.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ").concat(e,". Consider using the `fillLargeMeshArrays` function if you require meshes with more than ").concat(t.MAX_VERTEX_ARRAY_LENGTH," vertices.")),this._forceNewSegmentOnNextPrepare||!o||o.vertexLength+e>t.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==i?this.createNewSegment(r,n,i):o}createNewSegment(e,r,n){let i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return n!==void 0&&(i.sortKey=n),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(i),i}getOrCreateLatestSegment(e,r,n){return this.prepareSegment(0,e,r,n)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,n,i){return new t([{vertexOffset:e,primitiveOffset:r,vertexLength:n,primitiveLength:i,vaos:{},sortKey:0}])}};pe.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1;I("SegmentVector",pe);function tl(t,e){return t=it(Math.floor(t),0,255),e=it(Math.floor(e),0,255),256*t+e}var Qn=Q([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var mp=Y(il(),1);var ei=class t{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,n,i){this.ids.push(yp(e)),this.positions.push(r,n,i)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let r=yp(e),n=0,i=this.ids.length-1;for(;n<i;){let a=n+i>>1;this.ids[a]>=r?i=a:n=a+1}let o=[];for(;this.ids[n]===r;){let a=this.positions[3*n],s=this.positions[3*n+1],l=this.positions[3*n+2];o.push({index:a,start:s,end:l}),n++}return o}static serialize(e,r){let n=new Float64Array(e.ids),i=new Uint32Array(e.positions);return ol(n,i,0,n.length-1),r&&r.push(n.buffer,i.buffer),{ids:n,positions:i}}static deserialize(e){let r=new t;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function yp(t){let e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:(0,mp.default)(String(t))}function ol(t,e,r,n){for(;r<n;){let i=t[r+n>>1],o=r-1,a=n+1;for(;;){do o++;while(t[o]<i);do a--;while(t[a]>i);if(o>=a)break;oa(t,o,a),oa(e,3*o,3*a),oa(e,3*o+1,3*a+1),oa(e,3*o+2,3*a+2)}a-r<n-a?(ol(t,e,r,a),r=a+1):(ol(t,e,a+1,n),n=a)}}function oa(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}I("FeaturePositionMap",ei);var ti=class{constructor(e,r){this.gl=e.gl,this.location=r}};var Mr=class extends ti{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}};var aa=class extends ti{constructor(e,r){super(e,r),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}},sa=class extends ti{constructor(e,r){super(e,r),this.current=H.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}};var eP=new Float32Array(16);function al(t){return[tl(255*t.r,255*t.g),tl(255*t.b,255*t.a)]}var or=class{constructor(e,r,n){this.value=e,this.uniformNames=r.map(i=>"u_".concat(i)),this.type=n}setUniform(e,r,n){e.set(n.constantOr(this.value))}getBinding(e,r,n){return this.type==="color"?new sa(e,r):new Mr(e,r)}},Lt=class{constructor(e,r){this.uniformNames=r.map(n=>"u_".concat(n)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,n,i){let o=i==="u_pattern_to"?this.patternTo:i==="u_pattern_from"?this.patternFrom:i==="u_pixel_ratio_to"?this.pixelRatioTo:i==="u_pixel_ratio_from"?this.pixelRatioFrom:null;o&&e.set(o)}getBinding(e,r,n){return n.substr(0,9)==="u_pattern"?new aa(e,r):new Mr(e,r)}},We=class{constructor(e,r,n,i){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=r.map(o=>({name:"a_".concat(o),type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(e,r,n,i,o){let a=this.paintVertexArray.length,s=this.expression.evaluate(new W(0),r,{},i,[],o);this.paintVertexArray.resize(e),this._setPaintValue(a,e,s)}updatePaintArray(e,r,n,i){let o=this.expression.evaluate({zoom:0},n,i);this._setPaintValue(e,r,o)}_setPaintValue(e,r,n){if(this.type==="color"){let i=al(n);for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,i[0],i[1])}else{for(let i=e;i<r;i++)this.paintVertexArray.emplace(i,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},De=class{constructor(e,r,n,i,o,a){this.expression=e,this.uniformNames=r.map(s=>"u_".concat(s,"_t")),this.type=n,this.useIntegerZoom=i,this.zoom=o,this.maxValue=0,this.paintVertexAttributes=r.map(s=>({name:"a_".concat(s),type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,r,n,i,o){let a=this.expression.evaluate(new W(this.zoom),r,{},i,[],o),s=this.expression.evaluate(new W(this.zoom+1),r,{},i,[],o),l=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(l,e,a,s)}updatePaintArray(e,r,n,i){let o=this.expression.evaluate({zoom:this.zoom},n,i),a=this.expression.evaluate({zoom:this.zoom+1},n,i);this._setPaintValue(e,r,o,a)}_setPaintValue(e,r,n,i){if(this.type==="color"){let o=al(n),a=al(i);for(let s=e;s<r;s++)this.paintVertexArray.emplace(s,o[0],o[1],a[0],a[1])}else{for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,n,i);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r){let n=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,i=it(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,r,n){return new Mr(e,r)}},Ye=class{constructor(e,r,n,i,o,a){this.expression=e,this.type=r,this.useIntegerZoom=n,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o}populatePaintArray(e,r,n){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,r.patterns&&r.patterns[this.layerId],n)}updatePaintArray(e,r,n,i,o){this._setPaintValues(e,r,n.patterns&&n.patterns[this.layerId],o)}_setPaintValues(e,r,n,i){if(!i||!n)return;let{min:o,mid:a,max:s}=n,l=i[o],u=i[a],c=i[s];if(!(!l||!u||!c))for(let p=e;p<r;p++)this.zoomInPaintVertexArray.emplace(p,u.tl[0],u.tl[1],u.br[0],u.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],u.pixelRatio,l.pixelRatio),this.zoomOutPaintVertexArray.emplace(p,u.tl[0],u.tl[1],u.br[0],u.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],u.pixelRatio,c.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,Qn.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,Qn.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},la=class{constructor(e,r,n){this.binders={},this._buffers=[];let i=[];for(let o in e.paint._values){if(!n(o))continue;let a=e.paint.get(o);if(!(a instanceof ge)||!It(a.property.specification))continue;let s=Mg(o,e.type),l=a.value,u=a.property.specification.type,c=a.property.useIntegerZoom,p=a.property.specification["property-type"],f=p==="cross-faded"||p==="cross-faded-data-driven";if(l.kind==="constant")this.binders[o]=f?new Lt(l.value,s):new or(l.value,s,u),i.push("/u_".concat(o));else if(l.kind==="source"||f){let y=hp(o,u,"source");this.binders[o]=f?new Ye(l,u,c,r,y,e.id):new We(l,s,u,y),i.push("/a_".concat(o))}else{let y=hp(o,u,"composite");this.binders[o]=new De(l,s,u,c,r,y),i.push("/z_".concat(o))}}this.cacheKey=i.sort().join("")}getMaxValue(e){let r=this.binders[e];return r instanceof We||r instanceof De?r.maxValue:0}populatePaintArrays(e,r,n,i,o){for(let a in this.binders){let s=this.binders[a];(s instanceof We||s instanceof De||s instanceof Ye)&&s.populatePaintArray(e,r,n,i,o)}}setConstantPatternPositions(e,r){for(let n in this.binders){let i=this.binders[n];i instanceof Lt&&i.setConstantPatternPositions(e,r)}}updatePaintArrays(e,r,n,i,o){let a=!1;for(let s in e){let l=r.getPositions(s);for(let u of l){let c=n.feature(u.index);for(let p in this.binders){let f=this.binders[p];if((f instanceof We||f instanceof De||f instanceof Ye)&&f.expression.isStateDependent===!0){let y=i.paint.get(p);f.expression=y.value,f.updatePaintArray(u.start,u.end,c,e[s],o),a=!0}}}}return a}defines(){let e=[];for(let r in this.binders){let n=this.binders[r];(n instanceof or||n instanceof Lt)&&e.push(...n.uniformNames.map(i=>"#define HAS_UNIFORM_".concat(i)))}return e}getBinderAttributes(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof We||n instanceof De)for(let i=0;i<n.paintVertexAttributes.length;i++)e.push(n.paintVertexAttributes[i].name);else if(n instanceof Ye)for(let i=0;i<Qn.members.length;i++)e.push(Qn.members[i].name)}return e}getBinderUniforms(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof or||n instanceof Lt||n instanceof De)for(let i of n.uniformNames)e.push(i)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){let n=[];for(let i in this.binders){let o=this.binders[i];if(o instanceof or||o instanceof Lt||o instanceof De){for(let a of o.uniformNames)if(r[a]){let s=o.getBinding(e,r[a],a);n.push({name:a,property:i,binding:s})}}}return n}setUniforms(e,r,n,i){for(let{name:o,property:a,binding:s}of r)this.binders[a].setUniform(s,i,n.get(a),o)}updatePaintBuffers(e){this._buffers=[];for(let r in this.binders){let n=this.binders[r];if(e&&n instanceof Ye){let i=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(n instanceof We||n instanceof De)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}}upload(e){for(let r in this.binders){let n=this.binders[r];(n instanceof We||n instanceof De||n instanceof Ye)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let r=this.binders[e];(r instanceof We||r instanceof De||r instanceof Ye)&&r.destroy()}}},Ae=class{constructor(e,r,n=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new la(i,r,n);this.needsUpload=!1,this._featureMap=new ei,this._bufferOffset=0}populatePaintArrays(e,r,n,i,o,a){for(let s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(e,r,i,o,a);r.id!==void 0&&this._featureMap.add(r.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,n,i){for(let o of n)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,r,o,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};function Mg(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace("".concat(e,"-"),"").replace(/-/g,"_")]}function Lg(t){return{"line-pattern":{source:yt,composite:yt},"fill-pattern":{source:yt,composite:yt},"fill-extrusion-pattern":{source:yt,composite:yt}}[t]}function hp(t,e,r){let n={color:{source:Et,composite:Er},number:{source:ir,composite:Et}},i=Lg(t);return i&&i[r]||n[e][r]}I("ConstantBinder",or);I("CrossFadedConstantBinder",Lt);I("SourceExpressionBinder",We);I("CrossFadedCompositeBinder",Ye);I("CompositeExpressionBinder",De);I("ProgramConfiguration",la,{omit:["_buffers"]});I("ProgramConfigurationSet",Ae);var Dg=15,sl=Math.pow(2,Dg-1)-1,dp=-sl-1;function _e(t){let e=8192/t.extent,r=t.loadGeometry();for(let n=0;n<r.length;n++){let i=r[n];for(let o=0;o<i.length;o++){let a=i[o],s=Math.round(a.x*e),l=Math.round(a.y*e);a.x=it(s,dp,sl),a.y=it(l,dp,sl),(s<a.x||s>a.x+1||l<a.y||l>a.y+1)&&ce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function Ne(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?_e(t):[]}}var gp=-32768;function Bg(t,e,r,n,i){t.emplaceBack(gp+e*8+n,gp+r*8+i)}var ar=class{constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Zo,this.indexArray=new Le,this.segments=new pe,this.programConfigurations=new Ae(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){let i=this.layers[0],o=[],a=null,s=!1,l=i.type==="heatmap";if(i.type==="circle"){let c=i;a=c.layout.get("circle-sort-key"),s=!a.isConstant(),l=l||c.paint.get("circle-pitch-alignment")==="map"}let u=l?r.subdivisionGranularity.circle:1;for(let{feature:c,id:p,index:f,sourceLayerIndex:y}of e){let m=this.layers[0]._featureFilter.needGeometry,h=Ne(c,m);if(!this.layers[0]._featureFilter.filter(new W(this.zoom,{globalState:this.globalState}),h,n))continue;let g=s?a.evaluate(h,{},n):void 0,d={id:p,properties:c.properties,type:c.type,sourceLayerIndex:y,index:f,geometry:m?h.geometry:_e(c),patterns:{},sortKey:g};o.push(d)}s&&o.sort((c,p)=>c.sortKey-p.sortKey);for(let c of o){let{geometry:p,index:f,sourceLayerIndex:y}=c,m=e[f].feature;this.addFeature(c,p,f,n,u),r.featureIndex.insert(m,p,f,y,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,up),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,n,i,o=1){let a;switch(o){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw new Error("Invalid circle bucket granularity: ".concat(o,"; valid values are 1, 3, 5, 7."))}let s=a.length;for(let l of r)for(let u of l){let c=u.x,p=u.y;if(c<0||c>=8192||p<0||p>=8192)continue;let f=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,e.sortKey),y=f.vertexLength;for(let m=0;m<s;m++)for(let h=0;h<s;h++)Bg(this.layoutVertexArray,c,p,a[h],a[m]);for(let m=0;m<s-1;m++)for(let h=0;h<s-1;h++){let g=y+m*s+h,d=y+(m+1)*s+h;this.indexArray.emplaceBack(g,d+1,g+1),this.indexArray.emplaceBack(g,d,d+1)}f.vertexLength+=s*s,f.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},i)}};I("CircleBucket",ar,{omit:["layers"]});var ri=Y(ye(),1);function bp(t,e){for(let r=0;r<t.length;r++)if(Lr(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Lr(t,e[r]))return!0;return!!ul(t,e)}function vp(t,e,r){return!!(Lr(t,e)||ll(e,t,r))}function ua(t,e){if(t.length===1)return xp(e,t[0]);for(let r=0;r<e.length;r++){let n=e[r];for(let i=0;i<n.length;i++)if(Lr(t,n[i]))return!0}for(let r=0;r<t.length;r++)if(xp(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(ul(t,e[r]))return!0;return!1}function Pp(t,e,r){for(let n=0;n<e.length;n++){let i=e[n];if(t.length>=3){for(let o=0;o<i.length;o++)if(Lr(t,i[o]))return!0}if(Vg(t,i,r))return!0}return!1}function Vg(t,e,r){if(t.length>1){if(ul(t,e))return!0;for(let n=0;n<e.length;n++)if(ll(e[n],t,r))return!0}for(let n=0;n<t.length;n++)if(ll(t[n],e,r))return!0;return!1}function ul(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r<t.length-1;r++){let n=t[r],i=t[r+1];for(let o=0;o<e.length-1;o++){let a=e[o],s=e[o+1];if(Rg(n,i,a,s))return!0}}return!1}function Rg(t,e,r,n){return ot(t,r,n)!==ot(e,r,n)&&ot(t,e,r)!==ot(t,e,n)}function ll(t,e,r){let n=r*r;if(e.length===1)return t.distSqr(e[0])<n;for(let i=1;i<e.length;i++){let o=e[i-1],a=e[i];if(cl(t,o,a)<n)return!0}return!1}function cl(t,e,r){let n=e.distSqr(r);if(n===0)return t.distSqr(e);let i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function xp(t,e){let r=!1,n,i,o;for(let a=0;a<t.length;a++){n=t[a];for(let s=0,l=n.length-1;s<n.length;l=s++)i=n[s],o=n[l],i.y>e.y!=o.y>e.y&&e.x<(o.x-i.x)*(e.y-i.y)/(o.y-i.y)+i.x&&(r=!r)}return r}function Lr(t,e){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let o=t[n],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function Sp(t,e,r,n,i){for(let a of t)if(e<=a.x&&r<=a.y&&n>=a.x&&i>=a.y)return!0;let o=[new ri.default(e,r),new ri.default(e,i),new ri.default(n,i),new ri.default(n,r)];if(t.length>2){for(let a of o)if(Lr(t,a))return!0}for(let a=0;a<t.length-1;a++){let s=t[a],l=t[a+1];if(zg(s,l,o))return!0}return!1}function zg(t,e,r){let n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;let o=ot(t,e,r[0]);return o!==ot(t,e,r[1])||o!==ot(t,e,r[2])||o!==ot(t,e,r[3])}var ca=Y(ye(),1);function sr(t,e,r){let n=e.paint.get(t).value;return n.kind==="constant"?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Dt(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Bt(t,e,r,n,i){if(!e[0]&&!e[1])return t;let o=ca.default.convert(e)._mult(i);r==="viewport"&&o._rotate(-n);let a=[];for(let s=0;s<t.length;s++){let l=t[s];a.push(l.sub(o))}return a}function wp(t,e){let r=[];for(let n=0;n<t.length;n++){let i=t[n],o=[];for(let a=0;a<i.length;a++){let s=i[a-1],l=i[a],u=i[a+1],c=a===0?new ca.default(0,0):l.sub(s)._unit()._perp(),p=a===i.length-1?new ca.default(0,0):u.sub(l)._unit()._perp(),f=c._add(p)._unit(),y=f.x*p.x+f.y*p.y;y!==0&&f._mult(1/y),o.push(f._mult(e)._add(l))}r.push(o)}return r}var Ap,Og=()=>Ap=Ap||new ee({"circle-sort-key":new L(P.layout_circle["circle-sort-key"])}),_p,Gg=()=>_p=_p||new ee({"circle-radius":new L(P.paint_circle["circle-radius"]),"circle-color":new L(P.paint_circle["circle-color"]),"circle-blur":new L(P.paint_circle["circle-blur"]),"circle-opacity":new L(P.paint_circle["circle-opacity"]),"circle-translate":new F(P.paint_circle["circle-translate"]),"circle-translate-anchor":new F(P.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new F(P.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new F(P.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new L(P.paint_circle["circle-stroke-width"]),"circle-stroke-color":new L(P.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new L(P.paint_circle["circle-stroke-opacity"])}),Ip={get paint(){return Gg()},get layout(){return Og()}};var Tp=Y(ye(),1);var pa=class extends oe{constructor(e){super(e,Ip)}createBucket(e){return new ar(e)}queryRadius(e){let r=e;return sr("circle-radius",this,r)+sr("circle-stroke-width",this,r)+Dt(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:n,geometry:i,transform:o,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:l}){let u=Bt(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-o.bearingInRadians,a),c=this.paint.get("circle-radius").evaluate(r,n),p=this.paint.get("circle-stroke-width").evaluate(r,n),f=c+p,y=this.paint.get("circle-pitch-alignment")==="map",m=y?u:Ng(u,o,s,l),h=y?f*a:f;for(let g of i)for(let d of g){let b=y?d:Cp(d,o,s,l),x=h,v=o.projectTileCoordinates(d.x,d.y,s,l).signedDistanceFromCamera;if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?x*=v/o.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(x*=o.cameraToCenterDistance/v),vp(m,b,x))return!0}return!1}};function Cp(t,e,r,n){let i=e.projectTileCoordinates(t.x,t.y,r,n).point;return new Tp.default((i.x*.5+.5)*e.width,(-i.y*.5+.5)*e.height)}function Ng(t,e,r,n){return t.map(i=>Cp(i,e,r,n))}var ni=class extends ar{};I("HeatmapBucket",ni,{omit:["layers"]});var kp,Ug=()=>kp=kp||new ee({"heatmap-radius":new L(P.paint_heatmap["heatmap-radius"]),"heatmap-weight":new L(P.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new F(P.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ft(P.paint_heatmap["heatmap-color"]),"heatmap-opacity":new F(P.paint_heatmap["heatmap-opacity"])}),Fp={get paint(){return Ug()}};function pl(t,{width:e,height:r},n,i){if(!i)i=new Uint8Array(e*r*n);else if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*r*n)throw new RangeError("mismatched image size. expected: ".concat(i.length," but got: ").concat(e*r*n));return t.width=e,t.height=r,t.data=i,t}function Ep(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;let i=pl({},{width:e,height:r},n);fl(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},n),t.width=e,t.height=r,t.data=i.data}function fl(t,e,r,n,i,o){if(i.width===0||i.height===0)return e;if(i.width>t.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");let a=t.data,s=e.data;if(a===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<i.height;l++){let u=((r.y+l)*t.width+r.x)*o,c=((n.y+l)*e.width+n.x)*o;for(let p=0;p<i.width*o;p++)s[c+p]=a[u+p]}return e}var lr=class t{constructor(e,r){pl(this,e,1,r)}resize(e){Ep(this,e,1)}clone(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,n,i,o){fl(e,r,n,i,o,1)}},fe=class t{constructor(e,r){pl(this,e,4,r)}resize(e){Ep(this,e,4)}replace(e,r){r?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e}clone(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,n,i,o){fl(e,r,n,i,o,4)}setPixel(e,r,n){let i=(e*this.width+r)*4;this.data[i+0]=Math.round(n.r*255/n.a),this.data[i+1]=Math.round(n.g*255/n.a),this.data[i+2]=Math.round(n.b*255/n.a),this.data[i+3]=Math.round(n.a*255)}};I("AlphaImage",lr);I("RGBAImage",fe);function Mp(t){let e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new fe({width:r,height:n});if(!ku(r))throw new Error("width is not a power of 2 - ".concat(r));let o=(a,s,l)=>{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);i.setPixel(a/4/r,s/4,u)};if(t.clips)for(let a=0,s=0;a<n;++a,s+=r*4)for(let l=0,u=0;l<r;l++,u+=4){let c=l/(r-1),{start:p,end:f}=t.clips[a],y=p*(1-c)+f*c;o(s,u,y)}else for(let a=0,s=0;a<r;a++,s+=4){let l=a/(r-1);o(0,s,l)}return i}var Lp="big-fb";var fa=class extends oe{createBucket(e){return new ni(e)}constructor(e){super(e,Fp),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Mp({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Lp)&&this.heatmapFbos.delete(Lp)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}};var Dp,$g=()=>Dp=Dp||new ee({"hillshade-illumination-direction":new F(P.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new F(P.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new F(P.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new F(P.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new F(P.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new F(P.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new F(P.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new F(P.paint_hillshade["hillshade-method"])}),Bp={get paint(){return $g()}};var ya=class extends oe{constructor(e){super(e,Bp),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,r=this.paint.get("hillshade-illumination-altitude").values,n=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,o=Math.max(e.length,r.length,n.length,i.length);e=e.concat(Array(o-e.length).fill(e.at(-1))),r=r.concat(Array(o-r.length).fill(r.at(-1))),n=n.concat(Array(o-n.length).fill(n.at(-1))),i=i.concat(Array(o-i.length).fill(i.at(-1)));let a=r.map(fs);return{directionRadians:e.map(fs),altitudeRadians:a,shadowColor:i,highlightColor:n}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}};var Vp,jg=()=>Vp=Vp||new ee({"color-relief-opacity":new F(P["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new ft(P["paint_color-relief"]["color-relief-color"])}),Rp={get paint(){return jg()}};var ii=class{constructor(e,r,n,i){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this.update(r,i)}update(e,r,n){let{width:i,height:o}=e,a=(!this.size||this.size[0]!==i||this.size[1]!==o)&&!n,{context:s}=this,{gl:l}=s;if(this.useMipmap=!!(r&&r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||r.premultiply!==!1)),a)this.size=[i,o],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||vt(e)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,e):l.texImage2D(l.TEXTURE_2D,0,this.format,i,o,0,this.format,l.UNSIGNED_BYTE,e.data);else{let{x:u,y:c}=n||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||vt(e)?l.texSubImage2D(l.TEXTURE_2D,0,u,c,l.RGBA,l.UNSIGNED_BYTE,e):l.texSubImage2D(l.TEXTURE_2D,0,u,c,i,o,l.RGBA,l.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(e,r,n){let{context:i}=this,{gl:o}=i;o.bindTexture(o.TEXTURE_2D,this.texture),n===o.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(n=o.LINEAR),e!==this.filter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,e),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,n||e),this.filter=e),r!==this.wrap&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,r),this.wrap=r)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}};var oi=class{constructor(e,r,n,i=1,o=1,a=1,s=0){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(n&&!["mapbox","terrarium","custom"].includes(n)){ce(\'"\'.concat(n,\'" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".\'));return}this.stride=r.height;let l=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),n){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=i,this.greenFactor=o,this.blueFactor=a,this.baseShift=s;break;case"mapbox":default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4;break}for(let u=0;u<l;u++)this.data[this._idx(-1,u)]=this.data[this._idx(0,u)],this.data[this._idx(l,u)]=this.data[this._idx(l-1,u)],this.data[this._idx(u,-1)]=this.data[this._idx(u,0)],this.data[this._idx(u,l)]=this.data[this._idx(u,l-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(l,-1)]=this.data[this._idx(l-1,0)],this.data[this._idx(-1,l)]=this.data[this._idx(0,l-1)],this.data[this._idx(l,l)]=this.data[this._idx(l-1,l-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let u=0;u<l;u++)for(let c=0;c<l;c++){let p=this.get(u,c);p>this.max&&(this.max=p),p<this.min&&(this.min=p)}}get(e,r){let n=new Uint8Array(this.data.buffer),i=this._idx(e,r)*4;return this.unpack(n[i],n[i+1],n[i+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,n){return e*this.redFactor+r*this.greenFactor+n*this.blueFactor-this.baseShift}pack(e){return yl(e,this.getUnpackVector())}getPixels(){return new fe({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let i=r*this.dim,o=r*this.dim+this.dim,a=n*this.dim,s=n*this.dim+this.dim;switch(r){case-1:i=o-1;break;case 1:o=i+1;break}switch(n){case-1:a=s-1;break;case 1:s=a+1;break}let l=-r*this.dim,u=-n*this.dim;for(let c=a;c<s;c++)for(let p=i;p<o;p++)this.data[this._idx(p,c)]=e.data[this._idx(p+l,c+u)]}};function yl(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],a=Math.min(r,n,i),s=Math.round((t+o)/a);return{r:Math.floor(s*a/r)%256,g:Math.floor(s*a/n)%256,b:Math.floor(s*a/i)%256}}I("DEMData",oi);var ma=class extends oe{constructor(e){super(e,Rp)}_createColorRamp(e){let r={elevationStops:[],colorStops:[]},n=this._transitionablePaint._values["color-relief-color"].value.expression;if(n instanceof Je&&n._styleExpression.expression instanceof ke){this.colorRampExpression=n;let a=n._styleExpression.expression;r.elevationStops=a.labels,r.colorStops=[];for(let s of r.elevationStops)r.colorStops.push(a.evaluate({globals:{elevation:s}}))}if(r.elevationStops.length<1&&(r.elevationStops=[0],r.colorStops=[H.transparent]),r.elevationStops.length<2&&(r.elevationStops.push(r.elevationStops[0]+1),r.colorStops.push(r.colorStops[0])),r.elevationStops.length<=e)return r;let i={elevationStops:[],colorStops:[]},o=(r.elevationStops.length-1)/(e-1);for(let a=0;a<r.elevationStops.length-.5;a+=o)i.elevationStops.push(r.elevationStops[Math.round(a)]),i.colorStops.push(r.colorStops[Math.round(a)]);return ce("Too many colors in specification of ".concat(this.id," color-relief layer, may not render properly.")),i}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,r,n){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let i=this._createColorRamp(r),o=new fe({width:i.colorStops.length,height:1}),a=new fe({width:i.colorStops.length,height:1});for(let s=0;s<i.elevationStops.length;s++){let l=yl(i.elevationStops[s],n);a.setPixel(0,s,new H(l.r/255,l.g/255,l.b/255,1)),o.setPixel(0,s,i.colorStops[s])}return this.colorRampTextures={elevationTexture:new ii(e,a,e.gl.RGBA),colorTexture:new ii(e,o,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return this.visibility!=="none"&&!!this.colorRampTextures}};var qg=Q([{name:"a_pos",components:2,type:"Int16"}],4);var{members:zp,size:Y1,alignment:K1}=qg;function Dr(t,e,r){let n=r.patternDependencies,i=!1;for(let o of e){let a=o.paint.get("".concat(t,"-pattern"));a.isConstant()||(i=!0);let s=a.constantOr(null);s&&(i=!0,n[s.to]=!0,n[s.from]=!0)}return i}function Br(t,e,r,n,i){let o=i.patternDependencies;for(let a of e){let l=a.paint.get("".concat(t,"-pattern")).value;if(l.kind!=="constant"){let u=l.evaluate({zoom:n-1},r,{},i.availableImages),c=l.evaluate({zoom:n},r,{},i.availableImages),p=l.evaluate({zoom:n+1},r,{},i.availableImages);u=u&&u.name?u.name:u,c=c&&c.name?c.name:c,p=p&&p.name?p.name:p,o[u]=!0,o[c]=!0,o[p]=!0,r.patterns[a.id]={min:u,mid:c,max:p}}}return r}var pi=Y(ye(),1);function dl(t,e,r=2){let n=e&&e.length,i=n?e[0]*r:t.length,o=Gp(t,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;let s,l,u;if(n&&(o=Jg(t,e,o,r)),t.length>80*r){s=1/0,l=1/0;let c=-1/0,p=-1/0;for(let f=r;f<i;f+=r){let y=t[f],m=t[f+1];y<s&&(s=y),m<l&&(l=m),y>c&&(c=y),m>p&&(p=m)}u=Math.max(c-s,p-l),u=u!==0?32767/u:0}return si(o,a,r,s,l,u,0),a}function Gp(t,e,r,n,i){let o;if(i===sx(t,e,r,n)>0)for(let a=e;a<r;a+=n)o=Op(a/n|0,t[a],t[a+1],o);else for(let a=r-n;a>=e;a-=n)o=Op(a/n|0,t[a],t[a+1],o);return o&&Vr(o,o.next)&&(ui(o),o=o.next),o}function ur(t,e){if(!t)return t;e||(e=t);let r=t,n;do if(n=!1,!r.steiner&&(Vr(r,r.next)||se(r.prev,r,r.next)===0)){if(ui(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}function si(t,e,r,n,i,o,a){if(!t)return;!a&&o&&tx(t,n,i,o);let s=t;for(;t.prev!==t.next;){let l=t.prev,u=t.next;if(o?Xg(t,n,i,o):Wg(t)){e.push(l.i,t.i,u.i),ui(t),t=u.next,s=u.next;continue}if(t=u,t===s){a?a===1?(t=Hg(ur(t),e),si(t,e,r,n,i,o,2)):a===2&&Zg(t,e,r,n,i,o):si(ur(t),e,r,n,i,o,1);break}}}function Wg(t){let e=t.prev,r=t,n=t.next;if(se(e,r,n)>=0)return!1;let i=e.x,o=r.x,a=n.x,s=e.y,l=r.y,u=n.y,c=Math.min(i,o,a),p=Math.min(s,l,u),f=Math.max(i,o,a),y=Math.max(s,l,u),m=n.next;for(;m!==e;){if(m.x>=c&&m.x<=f&&m.y>=p&&m.y<=y&&ai(i,s,o,l,a,u,m.x,m.y)&&se(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Xg(t,e,r,n){let i=t.prev,o=t,a=t.next;if(se(i,o,a)>=0)return!1;let s=i.x,l=o.x,u=a.x,c=i.y,p=o.y,f=a.y,y=Math.min(s,l,u),m=Math.min(c,p,f),h=Math.max(s,l,u),g=Math.max(c,p,f),d=ml(y,m,e,r,n),b=ml(h,g,e,r,n),x=t.prevZ,v=t.nextZ;for(;x&&x.z>=d&&v&&v.z<=b;){if(x.x>=y&&x.x<=h&&x.y>=m&&x.y<=g&&x!==i&&x!==a&&ai(s,c,l,p,u,f,x.x,x.y)&&se(x.prev,x,x.next)>=0||(x=x.prevZ,v.x>=y&&v.x<=h&&v.y>=m&&v.y<=g&&v!==i&&v!==a&&ai(s,c,l,p,u,f,v.x,v.y)&&se(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;x&&x.z>=d;){if(x.x>=y&&x.x<=h&&x.y>=m&&x.y<=g&&x!==i&&x!==a&&ai(s,c,l,p,u,f,x.x,x.y)&&se(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=b;){if(v.x>=y&&v.x<=h&&v.y>=m&&v.y<=g&&v!==i&&v!==a&&ai(s,c,l,p,u,f,v.x,v.y)&&se(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function Hg(t,e){let r=t;do{let n=r.prev,i=r.next.next;!Vr(n,i)&&Up(n,r,r.next,i)&&li(n,i)&&li(i,n)&&(e.push(n.i,r.i,i.i),ui(r),ui(r.next),r=t=i),r=r.next}while(r!==t);return ur(r)}function Zg(t,e,r,n,i,o){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&ix(a,s)){let l=$p(a,s);a=ur(a,a.next),l=ur(l,l.next),si(a,e,r,n,i,o,0),si(l,e,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==t)}function Jg(t,e,r,n){let i=[];for(let o=0,a=e.length;o<a;o++){let s=e[o]*n,l=o<a-1?e[o+1]*n:t.length,u=Gp(t,s,l,n,!1);u===u.next&&(u.steiner=!0),i.push(nx(u))}i.sort(Yg);for(let o=0;o<i.length;o++)r=Kg(i[o],r);return r}function Yg(t,e){let r=t.x-e.x;if(r===0&&(r=t.y-e.y,r===0)){let n=(t.next.y-t.y)/(t.next.x-t.x),i=(e.next.y-e.y)/(e.next.x-e.x);r=n-i}return r}function Kg(t,e){let r=Qg(t,e);if(!r)return e;let n=$p(r,t);return ur(n,n.next),ur(r,r.next)}function Qg(t,e){let r=e,n=t.x,i=t.y,o=-1/0,a;if(Vr(t,r))return r;do{if(Vr(t,r.next))return r.next;if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){let p=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(p<=n&&p>o&&(o=p,a=r.x<r.next.x?r:r.next,p===n))return a}r=r.next}while(r!==e);if(!a)return null;let s=a,l=a.x,u=a.y,c=1/0;r=a;do{if(n>=r.x&&r.x>=l&&n!==r.x&&Np(i<u?n:o,i,l,u,i<u?o:n,i,r.x,r.y)){let p=Math.abs(i-r.y)/(n-r.x);li(r,t)&&(p<c||p===c&&(r.x>a.x||r.x===a.x&&ex(a,r)))&&(a=r,c=p)}r=r.next}while(r!==s);return a}function ex(t,e){return se(t.prev,t,e.prev)<0&&se(e.next,t,t.next)<0}function tx(t,e,r,n){let i=t;do i.z===0&&(i.z=ml(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,rx(i)}function rx(t){let e,r=1;do{let n=t,i;t=null;let o=null;for(e=0;n;){e++;let a=n,s=0;for(let u=0;u<r&&(s++,a=a.nextZ,!!a);u++);let l=r;for(;s>0||l>0&&a;)s!==0&&(l===0||!a||n.z<=a.z)?(i=n,n=n.nextZ,s--):(i=a,a=a.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=a}o.nextZ=null,r*=2}while(e>1);return t}function ml(t,e,r,n,i){return t=(t-r)*i|0,e=(e-n)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function nx(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function Np(t,e,r,n,i,o,a,s){return(i-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(n-s)>=(r-a)*(e-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function ai(t,e,r,n,i,o,a,s){return!(t===a&&e===s)&&Np(t,e,r,n,i,o,a,s)}function ix(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!ox(t,e)&&(li(t,e)&&li(e,t)&&ax(t,e)&&(se(t.prev,t,e.prev)||se(t,e.prev,e))||Vr(t,e)&&se(t.prev,t,t.next)>0&&se(e.prev,e,e.next)>0)}function se(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Vr(t,e){return t.x===e.x&&t.y===e.y}function Up(t,e,r,n){let i=da(se(t,e,r)),o=da(se(t,e,n)),a=da(se(r,n,t)),s=da(se(r,n,e));return!!(i!==o&&a!==s||i===0&&ha(t,r,e)||o===0&&ha(t,n,e)||a===0&&ha(r,t,n)||s===0&&ha(r,e,n))}function ha(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 da(t){return t>0?1:t<0?-1:0}function ox(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Up(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function li(t,e){return se(t.prev,t,t.next)<0?se(t,e,t.next)>=0&&se(t,t.prev,e)>=0:se(t,e,t.prev)<0||se(t,t.next,e)<0}function ax(t,e){let 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}function $p(t,e){let r=hl(t.i,t.x,t.y),n=hl(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 Op(t,e,r,n){let i=hl(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 ui(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 hl(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function sx(t,e,r,n){let i=0;for(let o=e,a=r-n;o<r;o+=n)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}var Vt=class{constructor(e,r){if(r>e)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=r}getGranularityForZoomLevel(e){let r=1<<e;return Math.max(Math.floor(this._baseZoomGranularity/r),this._minGranularity,1)}},xa=class xa{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}};xa.noSubdivision=new xa({fill:new Vt(0,0),line:new Vt(0,0),tile:new Vt(0,0),stencil:new Vt(0,0),circle:1});var ga=xa;I("SubdivisionGranularityExpression",Vt);I("SubdivisionGranularitySetting",ga);var Rr=-32768,ci=32767,gl=class{constructor(e,r){this._vertexBuffer=[];this._vertexDictionary=new Map;this._used=!1;this._granularity=e,this._granularityCellSize=8192/e,this._canonical=r}_getKey(e,r){return e=e+32768,r=r+32768,e<<16|r<<0}_vertexToIndex(e,r){if(e<-32768||r<-32768||e>32767||r>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");let n=Math.round(e)|0,i=Math.round(r)|0,o=this._getKey(n,i);if(this._vertexDictionary.has(o))return this._vertexDictionary.get(o);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(o,a),this._vertexBuffer.push(n,i),a}_subdivideTrianglesScanline(e){if(this._granularity<2)return ux(this._vertexBuffer,e);let r=[],n=e.length;for(let i=0;i<n;i+=3){let o=[e[i+0],e[i+1],e[i+2]],a=[this._vertexBuffer[e[i+0]*2+0],this._vertexBuffer[e[i+0]*2+1],this._vertexBuffer[e[i+1]*2+0],this._vertexBuffer[e[i+1]*2+1],this._vertexBuffer[e[i+2]*2+0],this._vertexBuffer[e[i+2]*2+1]],s=1/0,l=1/0,u=-1/0,c=-1/0;for(let h=0;h<3;h++){let g=a[h*2],d=a[h*2+1];s=Math.min(s,g),u=Math.max(u,g),l=Math.min(l,d),c=Math.max(c,d)}if(s===u||l===c)continue;let p=Math.floor(s/this._granularityCellSize),f=Math.ceil(u/this._granularityCellSize),y=Math.floor(l/this._granularityCellSize),m=Math.ceil(c/this._granularityCellSize);if(p===f&&y===m){r.push(...o);continue}for(let h=y;h<m;h++){let g=this._scanlineGenerateVertexRingForCellRow(h,a,o);cx(this._vertexBuffer,g,r)}}return r}_scanlineGenerateVertexRingForCellRow(e,r,n){let i=e*this._granularityCellSize,o=i+this._granularityCellSize,a=[];for(let s=0;s<3;s++){let l=r[s*2],u=r[s*2+1],c=r[(s+1)*2%6],p=r[((s+1)*2+1)%6],f=r[(s+2)*2%6],y=r[((s+2)*2+1)%6],m=c-l,h=p-u,g=m===0,d=h===0,b=(i-u)/h,x=(o-u)/h,v=Math.min(b,x),S=Math.max(b,x);if(!d&&(v>=1||S<=0)||d&&(u<i||u>o)){p>=i&&p<=o&&a.push(n[(s+1)%3]);continue}if(!d&&v>0){let T=l+m*v,E=u+h*v;a.push(this._vertexToIndex(T,E))}let A=l+m*Math.max(v,0),w=l+m*Math.min(S,1);if(g||this._generateIntraEdgeVertices(a,l,u,c,p,A,w),!d&&S<1){let T=l+m*S,E=u+h*S;a.push(this._vertexToIndex(T,E))}(d||p>=i&&p<=o)&&a.push(n[(s+1)%3]),!d&&(p<=i||p>=o)&&this._generateInterEdgeVertices(a,l,u,c,p,f,y,w,i,o)}return a}_generateIntraEdgeVertices(e,r,n,i,o,a,s){let l=i-r,u=o-n,c=u===0,p=c?Math.min(r,i):Math.min(a,s),f=c?Math.max(r,i):Math.max(a,s),y=Math.floor(p/this._granularityCellSize)+1,m=Math.ceil(f/this._granularityCellSize)-1;if(c?r<i:a<s)for(let g=y;g<=m;g++){let d=g*this._granularityCellSize,b=n+u*(d-r)/l;e.push(this._vertexToIndex(d,b))}else for(let g=m;g>=y;g--){let d=g*this._granularityCellSize,b=n+u*(d-r)/l;e.push(this._vertexToIndex(d,b))}}_generateInterEdgeVertices(e,r,n,i,o,a,s,l,u,c){let p=o-n,f=a-i,y=s-o,m=(u-o)/y,h=(c-o)/y,g=Math.min(m,h),d=Math.max(m,h),b=i+f*g,x=Math.floor(Math.min(b,l)/this._granularityCellSize)+1,v=Math.ceil(Math.max(b,l)/this._granularityCellSize)-1,S=l<b,A=y===0;if(A&&(s===u||s===c))return;if(A||g>=1||d<=0){let T=r-a,E=n-s,D=(u-s)/E,B=(c-s)/E,z=Math.min(D,B),M=a+T*z;x=Math.floor(Math.min(M,l)/this._granularityCellSize)+1,v=Math.ceil(Math.max(M,l)/this._granularityCellSize)-1,S=l<M}let w=p>0?c:u;if(S)for(let T=x;T<=v;T++){let E=T*this._granularityCellSize;e.push(this._vertexToIndex(E,w))}else for(let T=v;T>=x;T--){let E=T*this._granularityCellSize;e.push(this._vertexToIndex(E,w))}}_generateOutline(e){let r=[];for(let n of e){let i=Ke(n,this._granularity,!0),o=this._pointArrayToIndices(i),a=[];for(let s=1;s<o.length;s++)a.push(o[s-1]),a.push(o[s]);r.push(a)}return r}_handlePoles(e){let r=!1,n=!1;this._canonical&&(this._canonical.y===0&&(r=!0),this._canonical.y===(1<<this._canonical.z)-1&&(n=!0)),(r||n)&&this._fillPoles(e,r,n)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let r=0;r<e.length;r+=2){let n=e[r+1];n===Rr&&(e[r+1]=Rr+1),n===ci&&(e[r+1]=ci-1)}}_generatePoleQuad(e,r,n,i,o,a){i>o!=(a===Rr)?(e.push(r),e.push(n),e.push(this._vertexToIndex(i,a)),e.push(n),e.push(this._vertexToIndex(o,a)),e.push(this._vertexToIndex(i,a))):(e.push(n),e.push(r),e.push(this._vertexToIndex(i,a)),e.push(this._vertexToIndex(o,a)),e.push(n),e.push(this._vertexToIndex(i,a)))}_fillPoles(e,r,n){let i=this._vertexBuffer,o=0,a=8192,s=e.length;for(let l=2;l<s;l+=3){let u=e[l-2],c=e[l-1],p=e[l],f=i[u*2],y=i[u*2+1],m=i[c*2],h=i[c*2+1],g=i[p*2],d=i[p*2+1];r&&(y===o&&h===o&&this._generatePoleQuad(e,u,c,f,m,Rr),h===o&&d===o&&this._generatePoleQuad(e,c,p,m,g,Rr),d===o&&y===o&&this._generatePoleQuad(e,p,u,g,f,Rr)),n&&(y===a&&h===a&&this._generatePoleQuad(e,u,c,f,m,ci),h===a&&d===a&&this._generatePoleQuad(e,c,p,m,g,ci),d===a&&y===a&&this._generatePoleQuad(e,p,u,g,f,ci))}}_initializeVertices(e){for(let r=0;r<e.length;r+=2)this._vertexToIndex(e[r],e[r+1])}subdividePolygonInternal(e,r){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:n,holeIndices:i}=lx(e);this._initializeVertices(n);let o;try{let s=dl(n,i),l=this._convertIndices(n,s);o=this._subdivideTrianglesScanline(l)}catch(s){console.error(s)}let a=[];return r&&(a=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(o),{verticesFlattened:this._vertexBuffer,indicesTriangles:o,indicesLineList:a}}_convertIndices(e,r){let n=[];for(let i=0;i<r.length;i++){let o=e[r[i]*2],a=e[r[i]*2+1];n.push(this._vertexToIndex(o,a))}return n}_pointArrayToIndices(e){let r=[];for(let n=0;n<e.length;n++){let i=e[n];r.push(this._vertexToIndex(i.x,i.y))}return r}};function ba(t,e,r,n=!0){return new gl(r,e).subdividePolygonInternal(t,n)}function Ke(t,e,r=!1){if(!t||t.length<1)return[];if(t.length<2)return[];let n=t[0],i=t[t.length-1],o=r&&(n.x!==i.x||n.y!==i.y);if(e<2)return o?[...t,t[0]]:[...t];let a=Math.floor(8192/e),s=[];s.push(new pi.default(t[0].x,t[0].y));let l=t.length,u=o?l:l-1;for(let c=0;c<u;c++){let p=t[c],f=c<l-1?t[c+1]:t[0],y=p.x,m=p.y,h=f.x,g=f.y,d=y!==h,b=m!==g;if(!d&&!b)continue;let x=h-y,v=g-m,S=Math.abs(x),A=Math.abs(v),w=y,T=m;for(;;){let D=x>0?(Math.floor(w/a)+1)*a:(Math.ceil(w/a)-1)*a,B=v>0?(Math.floor(T/a)+1)*a:(Math.ceil(T/a)-1)*a,z=Math.abs(w-D),M=Math.abs(T-B),_=Math.abs(w-h),V=Math.abs(T-g),G=d?z/S:Number.POSITIVE_INFINITY,O=b?M/A:Number.POSITIVE_INFINITY;if((_<=z||!d)&&(V<=M||!b))break;if(G<O&&d||!b){w=D,T=T+v*G;let R=new pi.default(w,Math.round(T));(s[s.length-1].x!==R.x||s[s.length-1].y!==R.y)&&s.push(R)}else{w=w+x*O,T=B;let R=new pi.default(Math.round(w),T);(s[s.length-1].x!==R.x||s[s.length-1].y!==R.y)&&s.push(R)}}let E=new pi.default(h,g);(s[s.length-1].x!==E.x||s[s.length-1].y!==E.y)&&s.push(E)}return s}function lx(t){let e=[],r=[];for(let n of t)if(n.length!==0){n!==t[0]&&e.push(r.length/2);for(let i=0;i<n.length;i++)r.push(n[i].x),r.push(n[i].y)}return{flattened:r,holeIndices:e}}function ux(t,e){let r=[];for(let n=0;n<e.length;n+=3){let i=e[n],o=e[n+1],a=e[n+2],s=t[i*2],l=t[i*2+1],u=t[o*2],c=t[o*2+1],p=t[a*2],f=t[a*2+1],y=u-s,m=c-l,h=p-s,g=f-l;y*g-m*h>0?(r.push(i),r.push(a),r.push(o)):(r.push(i),r.push(o),r.push(a))}return r}function cx(t,e,r){if(e.length===0)throw new Error("Subdivision vertex ring is empty.");let n=0,i=t[e[0]*2];for(let l=1;l<e.length;l++){let u=t[e[l]*2];u<i&&(i=u,n=l)}let o=e.length,a=n,s=(a+1)%o;for(;;){let l=a-1>=0?a-1:o-1,u=(s+1)%o,c=t[e[l]*2],p=t[e[l]*2+1],f=t[e[u]*2],y=t[e[u]*2+1],m=t[e[a]*2],h=t[e[a]*2+1],g=t[e[s]*2],d=t[e[s]*2+1],b=!1;if(c<f)b=!0;else if(c>f)b=!1;else{let x=g-m,S=d-h,A=-x,w=h<d?1:-1,T=((c-m)*S+(p-h)*A)*w,E=((f-m)*S+(y-h)*A)*w;T>E&&(b=!0)}if(b){let x=e[l],v=e[a],S=e[s];x!==v&&x!==S&&v!==S&&r.push(S,v,x),a--,a<0&&(a=o-1)}else{let x=e[u],v=e[a],S=e[s];x!==v&&x!==S&&v!==S&&r.push(S,v,x),s++,s>=o&&(s=0)}if(l===u)break}}function va(t,e,r,n,i,o,a,s,l){let u=i.length/2,c=a&&s&&l;if(u<pe.MAX_VERTEX_ARRAY_LENGTH){let p=e.prepareSegment(u,r,n),f=p.vertexLength;for(let h=0;h<o.length;h+=3)n.emplaceBack(f+o[h],f+o[h+1],f+o[h+2]);p.vertexLength+=u,p.primitiveLength+=o.length/3;let y,m;c&&(m=a.prepareSegment(u,r,s),y=m.vertexLength,m.vertexLength+=u);for(let h=0;h<i.length;h+=2)t(i[h],i[h+1]);if(c)for(let h=0;h<l.length;h++){let g=l[h];for(let d=1;d<g.length;d+=2)s.emplaceBack(y+g[d-1],y+g[d]);m.primitiveLength+=g.length/2}}else px(e,r,n,i,o,t),c&&fx(a,r,s,i,l,t),e.forceNewSegmentOnNextPrepare(),a==null||a.forceNewSegmentOnNextPrepare()}function fi(t,e,r,n,i,o,a){if(o){let s=n.count;return r(e[i*2],e[i*2+1]),t[i]=n.count,n.count++,a.vertexLength++,s}else return t[i]}function px(t,e,r,n,i,o){let a=[];for(let p=0;p<n.length/2;p++)a.push(-1);let s={count:0},l=0,u=t.getOrCreateLatestSegment(e,r),c=u.vertexLength;for(let p=2;p<i.length;p+=3){let f=i[p-2],y=i[p-1],m=i[p],h=a[f]<l,g=a[y]<l,d=a[m]<l,b=(h?1:0)+(g?1:0)+(d?1:0);u.vertexLength+b>pe.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=s.count,h=!0,g=!0,d=!0,c=0);let x=fi(a,n,o,s,f,h,u),v=fi(a,n,o,s,y,g,u),S=fi(a,n,o,s,m,d,u);r.emplaceBack(c+x-l,c+v-l,c+S-l),u.primitiveLength++}}function fx(t,e,r,n,i,o){let a=[];for(let p=0;p<n.length/2;p++)a.push(-1);let s={count:0},l=0,u=t.getOrCreateLatestSegment(e,r),c=u.vertexLength;for(let p=0;p<i.length;p++){let f=i[p];for(let y=1;y<i[p].length;y+=2){let m=f[y-1],h=f[y],g=a[m]<l,d=a[h]<l,b=(g?1:0)+(d?1:0);u.vertexLength+b>pe.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=s.count,g=!0,d=!0,c=0);let x=fi(a,n,o,s,m,g,u),v=fi(a,n,o,s,h,d,u);r.emplaceBack(c+x-l,c+v-l),u.primitiveLength++}}}var yx=500,cr=class{constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Jo,this.indexArray=new Le,this.indexArray2=new Mt,this.programConfigurations=new Ae(e.layers,e.zoom),this.segments=new pe,this.segments2=new pe,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.hasPattern=Dr("fill",this.layers,r);let i=this.layers[0].layout.get("fill-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:l,index:u,sourceLayerIndex:c}of e){let p=this.layers[0]._featureFilter.needGeometry,f=Ne(s,p);if(!this.layers[0]._featureFilter.filter(new W(this.zoom,{globalState:this.globalState}),f,n))continue;let y=o?i.evaluate(f,{},n,r.availableImages):void 0,m={id:l,properties:s.properties,type:s.type,sourceLayerIndex:c,index:u,geometry:p?f.geometry:_e(s),patterns:{},sortKey:y};a.push(m)}o&&a.sort((s,l)=>s.sortKey-l.sortKey);for(let s of a){let{geometry:l,index:u,sourceLayerIndex:c}=s;if(this.hasPattern){let f=Br("fill",this.layers,s,this.zoom,r);this.patternFeatures.push(f)}else this.addFeature(s,l,u,n,{},r.subdivisionGranularity);let p=e[u].feature;r.featureIndex.insert(p,l,u,c,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}addFeatures(e,r,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,r,n,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,zp),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,n,i,o,a){for(let s of Kt(r,yx)){let l=ba(s,i,a.fill.getGranularityForZoomLevel(i.z)),u=this.layoutVertexArray;va((c,p)=>{u.emplaceBack(c,p)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles,this.segments2,this.indexArray2,l.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}};I("FillBucket",cr,{omit:["layers","patternFeatures"]});var jp,mx=()=>jp=jp||new ee({"fill-sort-key":new L(P.layout_fill["fill-sort-key"])}),qp,hx=()=>qp=qp||new ee({"fill-antialias":new F(P.paint_fill["fill-antialias"]),"fill-opacity":new L(P.paint_fill["fill-opacity"]),"fill-color":new L(P.paint_fill["fill-color"]),"fill-outline-color":new L(P.paint_fill["fill-outline-color"]),"fill-translate":new F(P.paint_fill["fill-translate"]),"fill-translate-anchor":new F(P.paint_fill["fill-translate-anchor"]),"fill-pattern":new pt(P.paint_fill["fill-pattern"])}),Wp={get paint(){return hx()},get layout(){return mx()}};var Pa=class extends oe{constructor(e){super(e,Wp)}recalculate(e,r){super.recalculate(e,r);let n=this.paint._values["fill-outline-color"];n.value.kind==="constant"&&n.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new cr(e)}queryRadius(){return Dt(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:r,transform:n,pixelsToTileUnits:i}){let o=Bt(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-n.bearingInRadians,i);return ua(o,r)}isTileClipped(){return!0}};var dx=Q([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Xp=Q([{name:"a_centroid",components:2,type:"Int16"}],4);var{members:Hp,size:zS,alignment:OS}=dx;var tf=Y(Rt(),1);var Cx=tf.default.VectorTileFeature.types,kx=500,vl=Math.pow(2,13);function yi(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,Math.floor(n*vl)*2+a,i*vl*2,o*vl*2,Math.round(s))}var pr=class{constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Yo,this.centroidVertexArray=new Ho,this.indexArray=new Le,this.programConfigurations=new Ae(e.layers,e.zoom),this.segments=new pe,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.features=[],this.hasPattern=Dr("fill-extrusion",this.layers,r);for(let{feature:i,id:o,index:a,sourceLayerIndex:s}of e){let l=this.layers[0]._featureFilter.needGeometry,u=Ne(i,l);if(!this.layers[0]._featureFilter.filter(new W(this.zoom,{globalState:this.globalState}),u,n))continue;let c={id:o,sourceLayerIndex:s,index:a,geometry:l?u.geometry:_e(i),properties:i.properties,type:i.type,patterns:{}};this.hasPattern?this.features.push(Br("fill-extrusion",this.layers,c,this.zoom,r)):this.addFeature(c,c.geometry,a,n,{},r.subdivisionGranularity),r.featureIndex.insert(i,c.geometry,a,s,this.index,!0)}}addFeatures(e,r,n){for(let i of this.features){let{geometry:o}=i;this.addFeature(i,o,i.index,r,n,e.subdivisionGranularity)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Hp),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Xp.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,n,i,o,a){for(let s of Kt(r,kx)){let l={x:0,y:0,sampleCount:0},u=this.layoutVertexArray.length;this.processPolygon(l,i,e,s,a);let c=this.layoutVertexArray.length-u,p=Math.floor(l.x/l.sampleCount),f=Math.floor(l.y/l.sampleCount);for(let y=0;y<c;y++)this.centroidVertexArray.emplaceBack(p,f)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}processPolygon(e,r,n,i,o){if(i.length<1||ef(i[0]))return;for(let p of i)p.length!==0&&Fx(e,p);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=o.fill.getGranularityForZoomLevel(r.z),l=Cx[n.type]==="Polygon";for(let p of i){if(p.length===0||ef(p))continue;let f=Ke(p,s,l);this._generateSideFaces(f,a)}if(!l)return;let u=ba(i,r,s,!1),c=this.layoutVertexArray;va((p,f)=>{yi(c,p,f,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,u.verticesFlattened,u.indicesTriangles)}_generateSideFaces(e,r){let n=0;for(let i=1;i<e.length;i++){let o=e[i],a=e[i-1];if(Ex(o,a))continue;r.segment.vertexLength+4>pe.MAX_VERTEX_ARRAY_LENGTH&&(r.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=o.sub(a)._perp()._unit(),l=a.dist(o);n+l>32768&&(n=0),yi(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,0,n),yi(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,1,n),n+=l,yi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,n),yi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,n);let u=r.segment.vertexLength;this.indexArray.emplaceBack(u,u+2,u+1),this.indexArray.emplaceBack(u+1,u+2,u+3),r.segment.vertexLength+=4,r.segment.primitiveLength+=2}}};function Fx(t,e){for(let r=0;r<e.length;r++){let n=e[r];r===e.length-1&&e[0].x===n.x&&e[0].y===n.y||(t.x+=n.x,t.y+=n.y,t.sampleCount++)}}I("FillExtrusionBucket",pr,{omit:["layers","features"]});function Ex(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function ef(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}var rf,Mx=()=>rf=rf||new ee({"fill-extrusion-opacity":new F(P["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new L(P["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new F(P["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new F(P["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new pt(P["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new L(P["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new L(P["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new F(P["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),nf={get paint(){return Mx()}};var wa=Y(ye(),1);var Aa=class extends oe{constructor(e){super(e,nf)}createBucket(e){return new pr(e)}queryRadius(){return Dt(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:n,geometry:i,transform:o,pixelsToTileUnits:a,pixelPosMatrix:s}){let l=Bt(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-o.bearingInRadians,a),u=this.paint.get("fill-extrusion-height").evaluate(r,n),c=this.paint.get("fill-extrusion-base").evaluate(r,n),p=Bx(l,s,0),f=Dx(i,c,u,s),y=f[0],m=f[1];return Lx(y,m,p)}};function mi(t,e){return t.x*e.x+t.y*e.y}function of(t,e){if(t.length===1){let r=0,n=e[r++],i;for(;!i||n.equals(i);)if(i=e[r++],!i)return 1/0;for(;r<e.length;r++){let o=e[r],a=t[0],s=i.sub(n),l=o.sub(n),u=a.sub(n),c=mi(s,s),p=mi(s,l),f=mi(l,l),y=mi(u,s),m=mi(u,l),h=c*f-p*p,g=(f*y-p*m)/h,d=(c*m-p*y)/h,b=1-g-d,x=n.z*b+i.z*g+o.z*d;if(isFinite(x))return x}return 1/0}else{let r=1/0;for(let n of e)r=Math.min(r,n.z);return r}}function Lx(t,e,r){let n=1/0;ua(r,e)&&(n=of(r,e[0]));for(let i=0;i<e.length;i++){let o=e[i],a=t[i];for(let s=0;s<o.length-1;s++){let l=o[s],u=o[s+1],c=a[s],p=a[s+1],f=[l,u,p,c,l];bp(r,f)&&(n=Math.min(n,of(r,f)))}}return n===1/0?!1:n}function Dx(t,e,r,n){let i=[],o=[],a=n[8]*e,s=n[9]*e,l=n[10]*e,u=n[11]*e,c=n[8]*r,p=n[9]*r,f=n[10]*r,y=n[11]*r;for(let m of t){let h=[],g=[];for(let d of m){let b=d.x,x=d.y,v=n[0]*b+n[4]*x+n[12],S=n[1]*b+n[5]*x+n[13],A=n[2]*b+n[6]*x+n[14],w=n[3]*b+n[7]*x+n[15],T=v+a,E=S+s,D=A+l,B=w+u,z=v+c,M=S+p,_=A+f,V=w+y,G=new wa.default(T/B,E/B);G.z=D/B,h.push(G);let O=new wa.default(z/V,M/V);O.z=_/V,g.push(O)}i.push(h),o.push(g)}return[i,o]}function Bx(t,e,r){let n=[];for(let i of t){let o=[i.x,i.y,r,1];Zi.transformMat4(o,o,e),n.push(new wa.default(o[0]/o[3],o[1]/o[3]))}return n}var Vx=Q([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:af,size:Pw,alignment:Sw}=Vx;var Rx=Q([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:sf,size:_w,alignment:Iw}=Rx;var cf=Y(Rt(),1);var zx=cf.default.VectorTileFeature.types,lf=63,Ox=Math.cos(75/2*(Math.PI/180)),Gx=15,Nx=20,Ux=15,pf=1/2,uf=Math.pow(2,Ux-1)/pf,fr=class{constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Ko,this.layoutVertexArray2=new Qo,this.indexArray=new Le,this.programConfigurations=new Ae(e.layers,e.zoom),this.segments=new pe,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.hasPattern=Dr("line",this.layers,r);let i=this.layers[0].layout.get("line-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:l,index:u,sourceLayerIndex:c}of e){let p=this.layers[0]._featureFilter.needGeometry,f=Ne(s,p);if(!this.layers[0]._featureFilter.filter(new W(this.zoom,{globalState:this.globalState}),f,n))continue;let y=o?i.evaluate(f,{},n):void 0,m={id:l,properties:s.properties,type:s.type,sourceLayerIndex:c,index:u,geometry:p?f.geometry:_e(s),patterns:{},sortKey:y};a.push(m)}o&&a.sort((s,l)=>s.sortKey-l.sortKey);for(let s of a){let{geometry:l,index:u,sourceLayerIndex:c}=s;if(this.hasPattern){let f=Br("line",this.layers,s,this.zoom,r);this.patternFeatures.push(f)}else this.addFeature(s,l,u,n,{},r.subdivisionGranularity);let p=e[u].feature;r.featureIndex.insert(p,l,u,c,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}addFeatures(e,r,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,r,n,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,sf)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,af),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end")){let r=+e.properties.mapbox_clip_start,n=+e.properties.mapbox_clip_end;return{start:r,end:n}}}addFeature(e,r,n,i,o,a){let s=this.layers[0].layout,l=s.get("line-join").evaluate(e,{}),u=s.get("line-cap"),c=s.get("line-miter-limit"),p=s.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let f of r)this.addLine(f,e,l,u,c,p,i,a);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}addLine(e,r,n,i,o,a,s,l){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let u=s?l.line.getGranularityForZoomLevel(s.z):1;if(e=Ke(e,u),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v<e.length-1;v++)this.totalDistance+=e[v].dist(e[v+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let c=zx[r.type]==="Polygon",p=e.length;for(;p>=2&&e[p-1].equals(e[p-2]);)p--;let f=0;for(;f<p-1&&e[f].equals(e[f+1]);)f++;if(p<(c?3:2))return;n==="bevel"&&(o=1.05);let y=this.overscaling<=16?Gx*8192/(512*this.overscaling):0,m=this.segments.prepareSegment(p*10,this.layoutVertexArray,this.indexArray),h,g,d,b,x;this.e1=this.e2=-1,c&&(h=e[p-2],x=e[f].sub(h)._unit()._perp());for(let v=f;v<p;v++){if(d=v===p-1?c?e[f+1]:void 0:e[v+1],d&&e[v].equals(d))continue;x&&(b=x),h&&(g=h),h=e[v],x=d?d.sub(h)._unit()._perp():b,b=b||x;let S=b.add(x);(S.x!==0||S.y!==0)&&S._unit();let A=b.x*x.x+b.y*x.y,w=S.x*x.x+S.y*x.y,T=w!==0?1/w:1/0,E=2*Math.sqrt(2-2*w),D=w<Ox&&g&&d,B=b.x*x.y-b.y*x.x>0;if(D&&v>f){let _=h.dist(g);if(_>2*y){let V=h.sub(h.sub(g)._mult(y/_)._round());this.updateDistance(g,V),this.addCurrentVertex(V,b,0,0,m),g=V}}let z=g&&d,M=z?n:c?"butt":i;if(z&&M==="round"&&(T<a?M="miter":T<=2&&(M="fakeround")),M==="miter"&&T>o&&(M="bevel"),M==="bevel"&&(T>2&&(M="flipbevel"),T<o&&(M="miter")),g&&this.updateDistance(g,h),M==="miter")S._mult(T),this.addCurrentVertex(h,S,0,0,m);else if(M==="flipbevel"){if(T>100)S=x.mult(-1);else{let _=T*b.add(x).mag()/b.sub(x).mag();S._perp()._mult(_*(B?-1:1))}this.addCurrentVertex(h,S,0,0,m),this.addCurrentVertex(h,S.mult(-1),0,0,m)}else if(M==="bevel"||M==="fakeround"){let _=-Math.sqrt(T*T-1),V=B?_:0,G=B?0:_;if(g&&this.addCurrentVertex(h,b,V,G,m),M==="fakeround"){let O=Math.round(E*180/Math.PI/Nx);for(let R=1;R<O;R++){let K=R/O;if(K!==.5){let re=K-.5,me=1.0904+A*(-3.2452+A*(3.55645-A*1.43519)),Ut=.848013+A*(-1.06021+A*.215638);K=K+K*re*(K-1)*(me*re*re+Ut)}let X=x.sub(b)._mult(K)._add(b)._unit()._mult(B?-1:1);this.addHalfVertex(h,X.x,X.y,!1,B,0,m)}}d&&this.addCurrentVertex(h,x,-V,-G,m)}else if(M==="butt")this.addCurrentVertex(h,S,0,0,m);else if(M==="square"){let _=g?1:-1;this.addCurrentVertex(h,S,_,_,m)}else M==="round"&&(g&&(this.addCurrentVertex(h,b,0,0,m),this.addCurrentVertex(h,b,1,1,m,!0)),d&&(this.addCurrentVertex(h,x,-1,-1,m,!0),this.addCurrentVertex(h,x,0,0,m)));if(D&&v<p-1){let _=h.dist(d);if(_>2*y){let V=h.add(d.sub(h)._mult(y/_)._round());this.updateDistance(h,V),this.addCurrentVertex(V,x,0,0,m),h=V}}}}addCurrentVertex(e,r,n,i,o,a=!1){let s=r.x+r.y*n,l=r.y-r.x*n,u=-r.x+r.y*i,c=-r.y-r.x*i;this.addHalfVertex(e,s,l,a,!1,n,o),this.addHalfVertex(e,u,c,a,!0,-i,o),this.distance>uf/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,n,i,o,a))}addHalfVertex({x:e,y:r},n,i,o,a,s,l){let c=(this.lineClips?this.scaledDistance*(uf-1):this.scaledDistance)*pf;if(this.layoutVertexArray.emplaceBack((e<<1)+(o?1:0),(r<<1)+(a?1:0),Math.round(lf*n)+128,Math.round(lf*i)+128,(s===0?0:s<0?-1:1)+1|(c&63)<<2,c>>6),this.lineClips){let f=this.scaledDistance-this.lineClips.start,y=this.lineClips.end-this.lineClips.start,m=f/y;this.layoutVertexArray2.emplaceBack(m,this.lineClipsArray.length)}let p=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,p,this.e2),l.primitiveLength++),a?this.e2=p:this.e1=p}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}};I("LineBucket",fr,{omit:["layers","patternFeatures"]});var ff,$x=()=>ff=ff||new ee({"line-cap":new F(P.layout_line["line-cap"]),"line-join":new L(P.layout_line["line-join"]),"line-miter-limit":new F(P.layout_line["line-miter-limit"]),"line-round-limit":new F(P.layout_line["line-round-limit"]),"line-sort-key":new L(P.layout_line["line-sort-key"])}),yf,jx=()=>yf=yf||new ee({"line-opacity":new L(P.paint_line["line-opacity"]),"line-color":new L(P.paint_line["line-color"]),"line-translate":new F(P.paint_line["line-translate"]),"line-translate-anchor":new F(P.paint_line["line-translate-anchor"]),"line-width":new L(P.paint_line["line-width"]),"line-gap-width":new L(P.paint_line["line-gap-width"]),"line-offset":new L(P.paint_line["line-offset"]),"line-blur":new L(P.paint_line["line-blur"]),"line-dasharray":new rr(P.paint_line["line-dasharray"]),"line-pattern":new pt(P.paint_line["line-pattern"]),"line-gradient":new ft(P.paint_line["line-gradient"])}),Pl={get paint(){return jx()},get layout(){return $x()}};var Sl=class extends L{possiblyEvaluate(e,r){return r=new W(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,n,i){return r=de({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,n,i)}},_a;var Ia=class extends oe{constructor(e){super(e,Pl),this.gradientVersion=0,_a||(_a=new Sl(Pl.paint.properties["line-width"].specification),_a.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let r=this.gradientExpression();gc(r)?this.stepInterpolant=r._styleExpression.expression instanceof Sr:this.stepInterpolant=!1,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=_a.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new fr(e)}queryRadius(e){let r=e,n=mf(sr("line-width",this,r),sr("line-gap-width",this,r)),i=sr("line-offset",this,r);return n/2+Math.abs(i)+Dt(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:n,geometry:i,transform:o,pixelsToTileUnits:a}){let s=Bt(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-o.bearingInRadians,a),l=a/2*mf(this.paint.get("line-width").evaluate(r,n),this.paint.get("line-gap-width").evaluate(r,n)),u=this.paint.get("line-offset").evaluate(r,n);return u&&(i=wp(i,u*a)),Pp(s,i,l)}isTileClipped(){return!0}};function mf(t,e){return e>0?e+2*t:t}var hf=Q([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),df=Q([{name:"a_projected_pos",components:3,type:"Float32"}],4),iA=Q([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),gf=Q([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]),oA=Q([{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"}]),wl=Q([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),aA=Q([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),sA=Q([{name:"triangle",components:3,type:"Uint16"}]),lA=Q([{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"}]),uA=Q([{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",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),cA=Q([{type:"Float32",name:"offsetX"}]),pA=Q([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),fA=Q([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var Pi=Y(ye(),1);function qx(t,e,r){let n=e.layout.get("text-transform").evaluate(r,{});return n==="uppercase"?t=t.toLocaleUpperCase():n==="lowercase"&&(t=t.toLocaleLowerCase()),we.applyArabicShaping&&(t=we.applyArabicShaping(t)),t}function xf(t,e,r){return t.sections.forEach(n=>{n.text=qx(n.text,e,r)}),t}function bf(t){let e={},r={},n=[],i=0;function o(u){n.push(t[u]),i++}function a(u,c,p){let f=r[u];return delete r[u],r[c]=f,n[f].geometry[0].pop(),n[f].geometry[0]=n[f].geometry[0].concat(p[0]),f}function s(u,c,p){let f=e[c];return delete e[c],e[u]=f,n[f].geometry[0].shift(),n[f].geometry[0]=p[0].concat(n[f].geometry[0]),f}function l(u,c,p){let f=p?c[0][c[0].length-1]:c[0][0];return"".concat(u,":").concat(f.x,":").concat(f.y)}for(let u=0;u<t.length;u++){let c=t[u],p=c.geometry,f=c.text?c.text.toString():null;if(!f){o(u);continue}let y=l(f,p),m=l(f,p,!0);if(y in r&&m in e&&r[y]!==e[m]){let h=s(y,m,p),g=a(y,m,n[h].geometry);delete e[y],delete r[m],r[l(f,n[g].geometry,!0)]=g,n[h].geometry=null}else y in r?a(y,m,p):m in e?s(y,m,p):(o(u),e[y]=i-1,r[m]=i-1)}return n.filter(u=>u.geometry)}var Or={"!":"\\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"};function vf(t){let e="";for(let r=0;r<t.length;r++){let n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;(!n||!Qs(n)||Or[t[r+1]])&&(!i||!Qs(i)||Or[t[r-1]])&&Or[t[r]]?e+=Or[t[r]]:e+=t[r]}return e}var ae=24;var ub=Y(hi(),1),cb=3;var ka=cb;function di(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,l)=>l.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],o=0,a=0;for(let s of t)for(let l=i.length-1;l>=0;l--){let u=i[l];if(!(s.w>u.w||s.h>u.h)){if(s.x=u.x,s.y=u.y,a=Math.max(a,s.y+s.h),o=Math.max(o,s.x+s.w),s.w===u.w&&s.h===u.h){let c=i.pop();l<i.length&&(i[l]=c)}else s.h===u.h?(u.x+=s.w,u.w-=s.w):s.w===u.w?(u.y+=s.h,u.h-=s.h):(i.push({x:u.x+s.w,y:u.y,w:u.w-s.w,h:s.h}),u.y+=s.h,u.h-=s.h);break}}return{w:o,h:a,fill:e/(o*a)||0}}var he=1;var Fa=class{constructor(e,{pixelRatio:r,version:n,stretchX:i,stretchY:o,content:a,textFitWidth:s,textFitHeight:l}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n,this.textFitWidth=s,this.textFitHeight=l}get tl(){return[this.paddedRect.x+he,this.paddedRect.y+he]}get br(){return[this.paddedRect.x+this.paddedRect.w-he,this.paddedRect.y+this.paddedRect.h-he]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-he*2)/this.pixelRatio,(this.paddedRect.h-he*2)/this.pixelRatio]}},gi=class{constructor(e,r){let n={},i={};this.haveRenderCallbacks=[];let o=[];this.addImages(e,n,o),this.addImages(r,i,o);let{w:a,h:s}=di(o),l=new fe({width:a||1,height:s||1});for(let u in e){let c=e[u],p=n[u].paddedRect;fe.copy(c.data,l,{x:0,y:0},{x:p.x+he,y:p.y+he},c.data)}for(let u in r){let c=r[u],p=i[u].paddedRect,f=p.x+he,y=p.y+he,m=c.data.width,h=c.data.height;fe.copy(c.data,l,{x:0,y:0},{x:f,y},c.data),fe.copy(c.data,l,{x:0,y:h-1},{x:f,y:y-1},{width:m,height:1}),fe.copy(c.data,l,{x:0,y:0},{x:f,y:y+h},{width:m,height:1}),fe.copy(c.data,l,{x:m-1,y:0},{x:f-1,y},{width:1,height:h}),fe.copy(c.data,l,{x:0,y:0},{x:f+m,y},{width:1,height:h})}this.image=l,this.iconPositions=n,this.patternPositions=i}addImages(e,r,n){for(let i in e){let o=e[i],a={x:0,y:0,w:o.data.width+2*he,h:o.data.height+2*he};n.push(a),r[i]=new Fa(a,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,r){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),r),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),r)}patchUpdatedImage(e,r,n){if(!e||!r||e.version===r.version)return;e.version=r.version;let[i,o]=e.tl;n.update(r.data,void 0,{x:i,y:o})}};I("ImagePosition",Fa);I("ImageAtlas",gi);var La=(i=>(i[i.none=0]="none",i[i.horizontal=1]="horizontal",i[i.vertical=2]="vertical",i[i.horizontalOnly=3]="horizontalOnly",i))(La||{}),bi=-17;function pb(t){for(let e of t)if(e.positionedGlyphs.length!==0)return!1;return!0}var Tf=57344,Cf=63743,Ea=class t{constructor(){this.scale=1,this.fontStack="",this.imageName=null,this.verticalAlign="bottom"}static forText(e,r,n){let i=new t;return i.scale=e||1,i.fontStack=r,i.verticalAlign=n||"bottom",i}static forImage(e,r){let n=new t;return n.imageName=e,n.verticalAlign=r||"bottom",n}},xi=class t{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){let n=new t;for(let i=0;i<e.sections.length;i++){let o=e.sections[i];o.image?n.addImageSection(o):n.addTextSection(o,r)}return n}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=vf(this.text)}trim(){let e=0;for(let n=0;n<this.text.length&&Ma[this.text.charCodeAt(n)];n++)e++;let r=this.text.length;for(let n=this.text.length-1;n>=0&&n>=e&&Ma[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){let n=new t;return n.text=this.text.substring(e,r),n.sectionIndex=this.sectionIndex.slice(e,r),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,n=0;for(let i=0;i<this.length();i++){let o=this.getSection(i);if(o.imageName){let a=e[o.imageName];if(!a)continue;let s=a.displaySize;r=Math.max(r,s[0]),n=Math.max(n,s[1])}}return{maxImageWidth:r,maxImageHeight:n}}addTextSection(e,r){this.text+=e.text,this.sections.push(Ea.forText(e.scale,e.fontStack||r,e.verticalAlign));let n=this.sections.length-1;for(let i=0;i<e.text.length;++i)this.sectionIndex.push(n)}addImageSection(e){let r=e.image?e.image.name:"";if(r.length===0){ce("Can\'t add FormattedSection with an empty image.");return}let n=this.getNextImageSectionCharCode();if(!n){ce("Reached maximum number of images ".concat(Cf-Tf+2));return}this.text+=String.fromCharCode(n),this.sections.push(Ea.forImage(r,e.verticalAlign)),this.sectionIndex.push(this.sections.length-1)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=Cf?null:++this.imageSectionID:(this.imageSectionID=Tf,this.imageSectionID)}};function fb(t,e){let r=[],n=t.text,i=0;for(let o of e)r.push(t.substring(i,o)),i=o;return i<n.length&&r.push(t.substring(i,n.length)),r}function vi(t,e,r,n,i,o,a,s,l,u,c,p,f,y,m){let h=xi.fromFeature(t,i);p===2&&h.verticalizePunctuation();let g,{processBidirectionalText:d,processStyledBidirectionalText:b}=we;if(d&&h.sections.length===1){g=[];let S=d(h.toString(),Il(h,u,o,e,n,y));for(let A of S){let w=new xi;w.text=A,w.sections=h.sections;for(let T=0;T<A.length;T++)w.sectionIndex.push(0);g.push(w)}}else if(b){g=[];let S=b(h.text,h.sectionIndex,Il(h,u,o,e,n,y));for(let A of S){let w=new xi;w.text=A[0],w.sectionIndex=A[1],w.sections=h.sections,g.push(w)}}else g=fb(h,Il(h,u,o,e,n,y));let x=[],v={positionedLines:x,text:h.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:p,iconsInText:!1,verticalizable:!1};return vb(v,e,r,n,g,a,s,l,p,u,f,m),pb(x)?!1:v}var Ma={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},yb={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},mb={40:!0};function Ef(t,e,r,n,i,o){if(e.imageName){let a=n[e.imageName];return a?a.displaySize[0]*e.scale*ae/o+i:0}else{let a=r[e.fontStack],s=a&&a[t];return s?s.metrics.advance*e.scale+i:0}}function hb(t,e,r,n,i,o){let a=0;for(let l=0;l<t.length();l++){let u=t.getSection(l);a+=Ef(t.getCharCode(l),u,n,i,e,o)}let s=Math.max(1,Math.ceil(a/r));return a/s}function kf(t,e,r,n){let i=Math.pow(t-e,2);return n?t<e?i/2:i*2:i+Math.abs(r)*r}function db(t,e,r){let n=0;return t===10&&(n-=1e4),r&&(n+=150),(t===40||t===65288)&&(n+=50),(e===41||e===65289)&&(n+=50),n}function Ff(t,e,r,n,i,o){let a=null,s=kf(e,r,i,o);for(let l of n){let u=e-l.x,c=kf(u,r,i,o)+l.badness;c<=s&&(a=l,s=c)}return{index:t,x:e,priorBreak:a,badness:s}}function Mf(t){return t?Mf(t.priorBreak).concat(t.index):[]}function Il(t,e,r,n,i,o){if(!t)return[];let a=[],s=hb(t,e,r,n,i,o),l=t.text.indexOf("\\u200B")>=0,u=0;for(let c=0;c<t.length();c++){let p=t.getSection(c),f=t.getCharCode(c);if(Ma[f]||(u+=Ef(f,p,n,i,e,o)),c<t.length()-1){let y=rp(f);(yb[f]||y||p.imageName||c!==t.length()-2&&mb[t.getCharCode(c+1)])&&a.push(Ff(c+1,u,s,a,db(f,t.getCharCode(c+1),y&&l),!1))}}return Mf(Ff(t.length(),u,s,a,0,!0))}function Lf(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0;break}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0;break}return{horizontalAlign:e,verticalAlign:r}}function gb(t,e,r){let n=e.getMaxScale()*ae,{maxImageWidth:i,maxImageHeight:o}=e.getMaxImageSize(t),a=Math.max(n,o*r);return{verticalLineContentWidth:Math.max(n,i*r),horizontalLineContentHeight:a}}function Df(t){switch(t){case"top":return 0;case"center":return .5;default:return 1}}function xb(t,e,r,n){if(t&&t.rect)return t;let i=e[r.fontStack],o=i&&i[n];return o?{rect:null,metrics:o.metrics}:null}function bb(t,e,r){return!(t===1||!e&&!Do(r)||e&&(Ma[r]||np(r)))}function vb(t,e,r,n,i,o,a,s,l,u,c,p){let f=0,y=0,m=0,h=0,g=s==="right"?1:s==="left"?0:.5,d=ae/p,b=0;for(let S of i){S.trim();let A=S.getMaxScale(),w={positionedGlyphs:[],lineOffset:0};t.positionedLines[b]=w;let T=w.positionedGlyphs,E=0;if(!S.length()){y+=o,++b;continue}let D=gb(n,S,d);for(let M=0;M<S.length();M++){let _=S.getSection(M),V=S.getSectionIndex(M),G=S.getCharCode(M),O=bb(l,c,G),R;if(_.imageName){if(t.iconsInText=!0,_.scale=_.scale*d,R=Sb(_,O,A,D,n),!R)continue;E=Math.max(E,R.imageOffset)}else if(R=Pb(_,G,O,D,e,r),!R)continue;let{rect:K,metrics:X,baselineOffset:re}=R;if(T.push({glyph:G,imageName:_.imageName,x:f,y:y+re+bi,vertical:O,scale:_.scale,fontStack:_.fontStack,sectionIndex:V,metrics:X,rect:K}),!O)f+=X.advance*_.scale+u;else{t.verticalizable=!0;let me=_.imageName?X.advance:ae;f+=me*_.scale+u}}if(T.length!==0){let M=f-u;m=Math.max(M,m),wb(T,0,T.length-1,g)}f=0;let B=(A-1)*ae;w.lineOffset=Math.max(E,B);let z=o*A+E;y+=z,h=Math.max(z,h),++b}let{horizontalAlign:x,verticalAlign:v}=Lf(a);Ab(t.positionedLines,g,x,v,m,h,o,y,i.length),t.top+=-v*y,t.bottom=t.top+y,t.left+=-x*m,t.right=t.left+m}function Pb(t,e,r,n,i,o){let a=o[t.fontStack],s=a&&a[e],l=xb(s,i,t,e);if(l===null)return null;let u;if(r)u=n.verticalLineContentWidth-t.scale*ae;else{let c=Df(t.verticalAlign);u=(n.horizontalLineContentHeight-t.scale*ae)*c}return{rect:l.rect,metrics:l.metrics,baselineOffset:u}}function Sb(t,e,r,n,i){let o=i[t.imageName];if(!o)return null;let a=o.paddedRect,s=o.displaySize,l={width:s[0],height:s[1],left:he,top:-ka,advance:e?s[1]:s[0]},u;if(e)u=n.verticalLineContentWidth-s[1]*t.scale;else{let p=Df(t.verticalAlign);u=(n.horizontalLineContentHeight-s[1]*t.scale)*p}let c=(e?s[0]:s[1])*t.scale-ae*r;return{rect:a,metrics:l,baselineOffset:u,imageOffset:c}}function wb(t,e,r,n){if(n===0)return;let i=t[r],o=i.metrics.advance*i.scale,a=(t[r].x+o)*n;for(let s=e;s<=r;s++)t[s].x-=a}function Ab(t,e,r,n,i,o,a,s,l){let u=(e-r)*i,c=0;o!==a?c=-s*n-bi:c=-n*l*a+.5*a;for(let p of t)for(let f of p.positionedGlyphs)f.x+=u,f.y+=c}function Bf(t,e,r){let{horizontalAlign:n,verticalAlign:i}=Lf(r),o=e[0],a=e[1],s=o-t.displaySize[0]*n,l=s+t.displaySize[0],u=a-t.displaySize[1]*i,c=u+t.displaySize[1];return{image:t,top:u,bottom:c,left:s,right:l}}function Da(t){var c,p;let e=t.left,r=t.top,n=t.right-e,i=t.bottom-r,o=t.image.content[2]-t.image.content[0],a=t.image.content[3]-t.image.content[1],s=(c=t.image.textFitWidth)!=null?c:"stretchOrShrink",l=(p=t.image.textFitHeight)!=null?p:"stretchOrShrink",u=o/a;if(l==="proportional"){if(s==="stretchOnly"&&n/i<u||s==="proportional"){let f=Math.ceil(i*u);e*=f/n,n=f}}else if(s==="proportional"&&l==="stretchOnly"&&u!==0&&n/i>u){let f=Math.ceil(n/u);r*=f/i,i=f}return{x1:e,y1:r,x2:e+n,y2:r+i}}function Tl(t,e,r,n,i,o){let a=t.image,s;if(a.content){let g=a.content,d=a.pixelRatio||1;s=[g[0]/d,g[1]/d,a.displaySize[0]-g[2]/d,a.displaySize[1]-g[3]/d]}let l=e.left*o,u=e.right*o,c,p,f,y;r==="width"||r==="both"?(y=i[0]+l-n[3],p=i[0]+u+n[1]):(y=i[0]+(l+u-a.displaySize[0])/2,p=y+a.displaySize[0]);let m=e.top*o,h=e.bottom*o;return r==="height"||r==="both"?(c=i[1]+m-n[0],f=i[1]+h+n[2]):(c=i[1]+(m+h-a.displaySize[1])/2,f=c+a.displaySize[1]),{image:a,top:c,right:p,bottom:f,left:y,collisionPadding:s}}var Vf=Y(Rt(),1);var Ur=255,zt=128,Qe=Ur*zt;function Cl(t,e){let{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new W(t+1))};if(r.kind==="source")return{kind:"source"};{let{zoomStops:n,interpolationType:i}=r,o=0;for(;o<n.length&&n[o]<=t;)o++;o=Math.max(0,o-1);let a=o;for(;a<n.length&&n[a]<t+1;)a++;a=Math.min(n.length-1,a);let s=n[o],l=n[a];if(r.kind==="composite")return{kind:"composite",minZoom:s,maxZoom:l,interpolationType:i};let u=r.evaluate(new W(s)),c=r.evaluate(new W(l));return{kind:"camera",minZoom:s,maxZoom:l,minSize:u,maxSize:c,interpolationType:i}}}function kl(t,e,r){let n="never",i=t.get(e);return i?n=i:t.get(r)&&(n="always"),n}var _b=Vf.default.VectorTileFeature.types,Ib=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Ba(t,e,r,n,i,o,a,s,l,u,c,p,f){let y=s?Math.min(Qe,Math.round(s[0])):0,m=s?Math.min(Qe,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(n*32),Math.round(i*32),o,a,(y<<1)+(l?1:0),m,u*16,c*16,p*256,f*256)}function Rf(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function Tb(t){for(let e of t.sections)if(op(e.text))return!0;return!1}var Si=class{constructor(e){this.layoutVertexArray=new ea,this.indexArray=new Le,this.programConfigurations=e,this.segments=new pe,this.dynamicLayoutVertexArray=new ta,this.opacityVertexArray=new ra,this.hasVisibleVertices=!1,this.placedSymbolArray=new Wn}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,n,i){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,df.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Ib,!0),this.opacityVertexBuffer.itemSize=1),(n||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};I("SymbolBuffers",Si);var wi=class{constructor(e,r,n){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new n,this.segments=new pe,this.collisionVertexArray=new na}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,gf.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};I("CollisionBuffers",wi);var Xe=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(l=>l.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Cl(this.zoom,n["text-size"]),this.iconSizeData=Cl(this.zoom,n["icon-size"]);let i=this.layers[0].layout,o=i.get("symbol-sort-key"),a=i.get("symbol-z-order");this.canOverlap=kl(i,"text-overlap","text-allow-overlap")!=="never"||kl(i,"icon-overlap","icon-allow-overlap")!=="never"||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&!o.isConstant();let s=a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=s&&this.canOverlap,i.get("symbol-placement")==="point"&&(this.writingModes=i.get("text-writing-mode").map(l=>La[l])),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.sourceID=e.sourceID}createArrays(){this.text=new Si(new Ae(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Si(new Ae(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Hn,this.lineVertexArray=new Zn,this.symbolInstances=new Xn,this.textAnchorOffsets=new Jn}calculateGlyphDependencies(e,r,n,i,o){for(let a=0;a<e.length;a++)if(r[e.charCodeAt(a)]=!0,(n||i)&&o){let s=Or[e.charAt(a)];s&&(r[s.charCodeAt(0)]=!0)}}populate(e,r,n){let i=this.layers[0],o=i.layout,a=o.get("text-font"),s=o.get("text-field"),l=o.get("icon-image"),u=(s.value.kind!=="constant"||s.value.value instanceof Fe&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(a.value.kind!=="constant"||a.value.value.length>0),c=l.value.kind!=="constant"||!!l.value.value||Object.keys(l.parameters).length>0,p=o.get("symbol-sort-key");if(this.features=[],!u&&!c)return;let f=r.iconDependencies,y=r.glyphDependencies,m=r.availableImages,h=new W(this.zoom,{globalState:this.globalState});for(let{feature:g,id:d,index:b,sourceLayerIndex:x}of e){let v=i._featureFilter.needGeometry,S=Ne(g,v);if(!i._featureFilter.filter(h,S,n))continue;v||(S.geometry=_e(g));let A;if(u){let D=i.getValueAndResolveTokens("text-field",S,n,m),B=Fe.factory(D),z=this.hasRTLText=this.hasRTLText||Tb(B);(!z||we.getRTLTextPluginStatus()==="unavailable"||z&&we.isParsed())&&(A=xf(B,i,S))}let w;if(c){let D=i.getValueAndResolveTokens("icon-image",S,n,m);D instanceof Se?w=D:w=Se.fromString(D)}if(!A&&!w)continue;let T=this.sortFeaturesByKey?p.evaluate(S,{},n):void 0,E={id:d,text:A,icon:w,index:b,sourceLayerIndex:x,geometry:S.geometry,properties:g.properties,type:_b[g.type],sortKey:T};if(this.features.push(E),w&&(f[w.name]=!0),A){let D=a.evaluate(S,{},n).join(","),B=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(2)>=0;for(let z of A.sections)if(z.image)f[z.image.name]=!0;else{let M=Tn(A.toString()),_=z.fontStack||D,V=y[_]=y[_]||{};this.calculateGlyphDependencies(z.text,V,B,this.allowVerticalPlacement,M)}}}o.get("symbol-placement")==="line"&&(this.features=bf(this.features)),this.sortFeaturesByKey&&this.features.sort((g,d)=>g.sortKey-d.sortKey)}update(e,r,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,n),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,n))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){let n=this.lineVertexArray.length;if(e.segment!==void 0){let i=e.dist(r[e.segment+1]),o=e.dist(r[e.segment]),a={};for(let s=e.segment+1;s<r.length;s++)a[s]={x:r[s].x,y:r[s].y,tileUnitDistanceFromAnchor:i},s<r.length-1&&(i+=r[s+1].dist(r[s]));for(let s=e.segment||0;s>=0;s--)a[s]={x:r[s].x,y:r[s].y,tileUnitDistanceFromAnchor:o},s>0&&(o+=r[s-1].dist(r[s]));for(let s=0;s<r.length;s++){let l=a[s];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,r,n,i,o,a,s,l,u,c,p,f){let y=e.indexArray,m=e.layoutVertexArray,h=e.segments.prepareSegment(4*r.length,m,y,this.canOverlap?a.sortKey:void 0),g=this.glyphOffsetArray.length,d=h.vertexLength,b=this.allowVerticalPlacement&&s===2?Math.PI/2:0,x=a.text&&a.text.sections;for(let v=0;v<r.length;v++){let{tl:S,tr:A,bl:w,br:T,tex:E,pixelOffsetTL:D,pixelOffsetBR:B,minFontScaleX:z,minFontScaleY:M,glyphOffset:_,isSDF:V,sectionIndex:G}=r[v],O=h.vertexLength,R=_[1];Ba(m,l.x,l.y,S.x,R+S.y,E.x,E.y,n,V,D.x,D.y,z,M),Ba(m,l.x,l.y,A.x,R+A.y,E.x+E.w,E.y,n,V,B.x,D.y,z,M),Ba(m,l.x,l.y,w.x,R+w.y,E.x,E.y+E.h,n,V,D.x,B.y,z,M),Ba(m,l.x,l.y,T.x,R+T.y,E.x+E.w,E.y+E.h,n,V,B.x,B.y,z,M),Rf(e.dynamicLayoutVertexArray,l,b),y.emplaceBack(O,O+2,O+1),y.emplaceBack(O+1,O+2,O+3),h.vertexLength+=4,h.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(_[0]),(v===r.length-1||G!==r[v+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(m.length,a,a.index,{},f,x&&x[G])}e.placedSymbolArray.emplaceBack(l.x,l.y,g,this.glyphOffsetArray.length-g,d,u,c,l.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],s,0,!1,0,p)}_addCollisionDebugVertex(e,r,n,i,o,a){return r.emplaceBack(0,0),e.emplaceBack(n.x,n.y,i,o,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,r,n,i,o,a,s){let l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),u=l.vertexLength,c=o.layoutVertexArray,p=o.collisionVertexArray,f=s.anchorX,y=s.anchorY;this._addCollisionDebugVertex(c,p,a,f,y,new Pi.default(e,r)),this._addCollisionDebugVertex(c,p,a,f,y,new Pi.default(n,r)),this._addCollisionDebugVertex(c,p,a,f,y,new Pi.default(n,i)),this._addCollisionDebugVertex(c,p,a,f,y,new Pi.default(e,i)),l.vertexLength+=4;let m=o.indexArray;m.emplaceBack(u,u+1),m.emplaceBack(u+1,u+2),m.emplaceBack(u+2,u+3),m.emplaceBack(u+3,u),l.primitiveLength+=4}addDebugCollisionBoxes(e,r,n,i){for(let o=e;o<r;o++){let a=this.collisionBoxArray.get(o),s=a.x1,l=a.y1,u=a.x2,c=a.y2;this.addCollisionDebugVertices(s,l,u,c,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,n)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new wi(Kn,wl.members,Mt),this.iconCollisionBox=new wi(Kn,wl.members,Mt);for(let e=0;e<this.symbolInstances.length;e++){let r=this.symbolInstances.get(e);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(e,r,n,i,o,a,s,l,u){let c={};for(let p=r;p<n;p++){let f=e.get(p);c.textBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.textFeatureIndex=f.featureIndex;break}for(let p=i;p<o;p++){let f=e.get(p);c.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.verticalTextFeatureIndex=f.featureIndex;break}for(let p=a;p<s;p++){let f=e.get(p);c.iconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.iconFeatureIndex=f.featureIndex;break}for(let p=l;p<u;p++){let f=e.get(p);c.verticalIconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.verticalIconFeatureIndex=f.featureIndex;break}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){let n=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){let n=e.placedSymbolArray.get(r),i=n.vertexStartIndex+n.numGlyphs*4;for(let o=n.vertexStartIndex;o<i;o+=4)e.indexArray.emplaceBack(o,o+2,o+1),e.indexArray.emplaceBack(o+1,o+2,o+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let r=Math.sin(e),n=Math.cos(e),i=[],o=[],a=[];for(let s=0;s<this.symbolInstances.length;++s){a.push(s);let l=this.symbolInstances.get(s);i.push(Math.round(r*l.anchorX+n*l.anchorY)|0),o.push(l.featureIndex)}return a.sort((s,l)=>i[s]-i[l]||o[l]-o[s]),a}addToSortKeyRanges(e,r){let n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===r?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let r of this.symbolInstanceIndexes){let n=this.symbolInstances.get(r);this.featureSortOrder.push(n.featureIndex),[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((i,o,a)=>{i>=0&&a.indexOf(i)===o&&this.addIndicesForPlacedSymbol(this.text,i)}),n.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),n.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),n.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};I("SymbolBucket",Xe,{omit:["layers","collisionBoxArray","features","compareText"]});Xe.MAX_GLYPHS=65535;Xe.addDynamicAttributes=Rf;function zf(t,e){return e.replace(/{([^{}]+)}/g,(r,n)=>t&&n in t?String(t[n]):"")}var Of,Cb=()=>Of=Of||new ee({"symbol-placement":new F(P.layout_symbol["symbol-placement"]),"symbol-spacing":new F(P.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new F(P.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new L(P.layout_symbol["symbol-sort-key"]),"symbol-z-order":new F(P.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new F(P.layout_symbol["icon-allow-overlap"]),"icon-overlap":new F(P.layout_symbol["icon-overlap"]),"icon-ignore-placement":new F(P.layout_symbol["icon-ignore-placement"]),"icon-optional":new F(P.layout_symbol["icon-optional"]),"icon-rotation-alignment":new F(P.layout_symbol["icon-rotation-alignment"]),"icon-size":new L(P.layout_symbol["icon-size"]),"icon-text-fit":new F(P.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new F(P.layout_symbol["icon-text-fit-padding"]),"icon-image":new L(P.layout_symbol["icon-image"]),"icon-rotate":new L(P.layout_symbol["icon-rotate"]),"icon-padding":new L(P.layout_symbol["icon-padding"]),"icon-keep-upright":new F(P.layout_symbol["icon-keep-upright"]),"icon-offset":new L(P.layout_symbol["icon-offset"]),"icon-anchor":new L(P.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new F(P.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new F(P.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new F(P.layout_symbol["text-rotation-alignment"]),"text-field":new L(P.layout_symbol["text-field"]),"text-font":new L(P.layout_symbol["text-font"]),"text-size":new L(P.layout_symbol["text-size"]),"text-max-width":new L(P.layout_symbol["text-max-width"]),"text-line-height":new F(P.layout_symbol["text-line-height"]),"text-letter-spacing":new L(P.layout_symbol["text-letter-spacing"]),"text-justify":new L(P.layout_symbol["text-justify"]),"text-radial-offset":new L(P.layout_symbol["text-radial-offset"]),"text-variable-anchor":new F(P.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new L(P.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new L(P.layout_symbol["text-anchor"]),"text-max-angle":new F(P.layout_symbol["text-max-angle"]),"text-writing-mode":new F(P.layout_symbol["text-writing-mode"]),"text-rotate":new L(P.layout_symbol["text-rotate"]),"text-padding":new F(P.layout_symbol["text-padding"]),"text-keep-upright":new F(P.layout_symbol["text-keep-upright"]),"text-transform":new L(P.layout_symbol["text-transform"]),"text-offset":new L(P.layout_symbol["text-offset"]),"text-allow-overlap":new F(P.layout_symbol["text-allow-overlap"]),"text-overlap":new F(P.layout_symbol["text-overlap"]),"text-ignore-placement":new F(P.layout_symbol["text-ignore-placement"]),"text-optional":new F(P.layout_symbol["text-optional"])}),Gf,kb=()=>Gf=Gf||new ee({"icon-opacity":new L(P.paint_symbol["icon-opacity"]),"icon-color":new L(P.paint_symbol["icon-color"]),"icon-halo-color":new L(P.paint_symbol["icon-halo-color"]),"icon-halo-width":new L(P.paint_symbol["icon-halo-width"]),"icon-halo-blur":new L(P.paint_symbol["icon-halo-blur"]),"icon-translate":new F(P.paint_symbol["icon-translate"]),"icon-translate-anchor":new F(P.paint_symbol["icon-translate-anchor"]),"text-opacity":new L(P.paint_symbol["text-opacity"]),"text-color":new L(P.paint_symbol["text-color"],{runtimeType:ze,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new L(P.paint_symbol["text-halo-color"]),"text-halo-width":new L(P.paint_symbol["text-halo-width"]),"text-halo-blur":new L(P.paint_symbol["text-halo-blur"]),"text-translate":new F(P.paint_symbol["text-translate"]),"text-translate-anchor":new F(P.paint_symbol["text-translate-anchor"])}),Va={get paint(){return kb()},get layout(){return Cb()}};var Ai=class{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Ar,this.defaultValue=e}evaluate(e){if(e.formattedSection){let r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){if(!this.defaultValue.isConstant()){let r=this.defaultValue.value;e(r._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};I("FormatSectionOverride",Ai,{omit:["defaultValue"]});var Ra=class t extends oe{constructor(e){super(e,Va)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let n=this.layout.get("text-writing-mode");if(n){let i=[];for(let o of n)i.indexOf(o)<0&&i.push(o);this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,n,i){let o=this.layout.get(e).evaluate(r,{},n,i),a=this._unevaluatedLayout._values[e];return!a.isDataDriven()&&!An(a.value)&&o?zf(r.properties,o):o}createBucket(e){return new Xe(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of Va.paint.overridableProperties){if(!t.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),n=new Ai(r),i=new Zt(n,r.property.specification),o=null;r.value.kind==="constant"||r.value.kind==="source"?o=new Je("source",i):o=new Tt("composite",i,r.value.zoomStops),this.paint._values[e]=new ge(r.property,o,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,n){return!this.layout||r.isDataDriven()||n.isDataDriven()?!1:t.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let n=e.get("text-field"),i=Va.paint.properties[r],o=!1,a=s=>{for(let l of s)if(i.overrides&&i.overrides.hasOverride(l)){o=!0;return}};if(n.value.kind==="constant"&&n.value.value instanceof Fe)a(n.value.value.sections);else if(n.value.kind==="source"){let s=u=>{if(!o)if(u instanceof _t&&ue(u.value)===_r){let c=u.value;a(c.sections)}else u instanceof fn?a(u.sections):u.eachChild(s)},l=n.value;l._styleExpression&&s(l._styleExpression.expression)}return o}};function Nf(t,e,r,n=1){let i=t.get("icon-padding").evaluate(e,{},r),o=i&&i.values;return[o[0]*n,o[1]*n,o[2]*n,o[3]*n]}var Uf,Fb=()=>Uf=Uf||new ee({"background-color":new F(P.paint_background["background-color"]),"background-pattern":new rr(P.paint_background["background-pattern"]),"background-opacity":new F(P.paint_background["background-opacity"])}),$f={get paint(){return Fb()}};var za=class extends oe{constructor(e){super(e,$f)}};var jf,Eb=()=>jf=jf||new ee({"raster-opacity":new F(P.paint_raster["raster-opacity"]),"raster-hue-rotate":new F(P.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new F(P.paint_raster["raster-brightness-min"]),"raster-brightness-max":new F(P.paint_raster["raster-brightness-max"]),"raster-saturation":new F(P.paint_raster["raster-saturation"]),"raster-contrast":new F(P.paint_raster["raster-contrast"]),"raster-resampling":new F(P.paint_raster["raster-resampling"]),"raster-fade-duration":new F(P.paint_raster["raster-fade-duration"])}),qf={get paint(){return Eb()}};var Oa=class extends oe{constructor(e){super(e,qf)}};var Ga=class extends oe{constructor(r){super(r,{});this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)};this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)};this.implementation=r}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}};function Wf(t){if(t.type==="custom")return new Ga(t);switch(t.type){case"background":return new za(t);case"circle":return new pa(t);case"color-relief":return new ma(t);case"fill":return new Pa(t);case"fill-extrusion":return new Aa(t);case"heatmap":return new fa(t);case"hillshade":return new ya(t);case"line":return new Ia(t);case"raster":return new Oa(t);case"symbol":return new Ra(t)}}var Na=class{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(e,r){for(let i of e){this._layerConfigs[i.id]=i;let o=this._layers[i.id]=Wf(i);o._featureFilter=Ct(o.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(let i of r)delete this.keyCache[i],delete this._layerConfigs[i],delete this._layers[i];this.familiesBySource={};let n=Pc(Object.values(this._layerConfigs),this.keyCache);for(let i of n){let o=i.map(p=>this._layers[p.id]),a=o[0];if(a.visibility==="none")continue;let s=a.source||"",l=this.familiesBySource[s];l||(l=this.familiesBySource[s]={});let u=a.sourceLayer||"_geojsonTileLayer",c=l[u];c||(c=l[u]=[]),c.push(o)}}};var gy=Y(Rt(),1),xy=Y(hi(),1);var $r=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){let n=e[r];this._stringToNumber[n]=r,this._numberToString[r]=n}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error("Out of bounds. Index requested n=".concat(e," can\'t be >= this._numberToString.length ").concat(this._numberToString.length));return this._numberToString[e]}};var Hf=Y(Rt(),1),Zf=Y(hi(),1);var Ua=class{constructor(e,r,n,i,o){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=n,e._y=i,this.properties=e.properties,this.id=o}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let r in this)r==="_geometry"||r==="_vectorTileFeature"||(e[r]=this[r]);return e}};var _i=Y(ye(),1),yr=class t{constructor(){this.minX=1/0;this.maxX=-1/0;this.minY=1/0;this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new t;return r.extend(e(new _i.default(this.minX,this.minY))),r.extend(e(new _i.default(this.maxX,this.minY))),r.extend(e(new _i.default(this.minX,this.maxY))),r.extend(e(new _i.default(this.maxX,this.maxY))),r}static fromPoints(e){let r=new t;for(let n of e)r.extend(n);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}};var Ii=class{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new jt(8192,16,0),this.grid3D=new jt(8192,16,0),this.featureIndexArray=new Yn,this.promoteId=r}insert(e,r,n,i,o,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,i,o);let l=a?this.grid3D:this.grid;for(let u=0;u<r.length;u++){let c=r[u],p=[1/0,1/0,-1/0,-1/0];for(let f=0;f<c.length;f++){let y=c[f];p[0]=Math.min(p[0],y.x),p[1]=Math.min(p[1],y.y),p[2]=Math.max(p[2],y.x),p[3]=Math.max(p[3],y.y)}p[0]<8192&&p[1]<8192&&p[2]>=0&&p[3]>=0&&l.insert(s,p[0],p[1],p[2],p[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Hf.default.VectorTile(new Zf.default(this.rawTileData)).layers,this.sourceLayerCoder=new $r(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,n,i){this.loadVTLayers();let o=e.params,a=8192/e.tileSize/e.scale,s=Ct(o.filter),l=e.queryGeometry,u=e.queryPadding*a,c=yr.fromPoints(l),p=this.grid.query(c.minX-u,c.minY-u,c.maxX+u,c.maxY+u),f=yr.fromPoints(e.cameraQueryGeometry).expandBy(u),y=this.grid3D.query(f.minX,f.minY,f.maxX,f.maxY,(g,d,b,x)=>Sp(e.cameraQueryGeometry,g-u,d-u,b+u,x+u));for(let g of y)p.push(g);p.sort(Mb);let m={},h;for(let g=0;g<p.length;g++){let d=p[g];if(d===h)continue;h=d;let b=this.featureIndexArray.get(d),x=null;this.loadMatchingFeature(m,b.bucketIndex,b.sourceLayerIndex,b.featureIndex,s,o.layers,o.availableImages,r,n,i,(v,S,A)=>(x||(x=_e(v)),S.queryIntersectsFeature({queryGeometry:l,feature:v,featureState:A,geometry:x,zoom:this.z,transform:e.transform,pixelsToTileUnits:a,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return m}loadMatchingFeature(e,r,n,i,o,a,s,l,u,c,p){let f=this.bucketLayerIDs[r];if(a&&!f.some(d=>a.has(d)))return;let y=this.sourceLayerCoder.decode(n),h=this.vtLayers[y].feature(i);if(o.needGeometry){let d=Ne(h,!0);if(!o.filter(new W(this.tileID.overscaledZ),d,this.tileID.canonical))return}else if(!o.filter(new W(this.tileID.overscaledZ),h))return;let g=this.getId(h,y);for(let d=0;d<f.length;d++){let b=f[d];if(a&&!a.has(b))continue;let x=l[b];if(!x)continue;let v={};g&&c&&(v=c.getState(x.sourceLayer||"_geojsonTileLayer",g));let S=de({},u[b]);S.paint=Xf(S.paint,x.paint,h,v,s),S.layout=Xf(S.layout,x.layout,h,v,s);let A=!p||p(h,x,v);if(!A)continue;let w=new Ua(h,this.z,this.x,this.y,g);w.layer=S;let T=e[b];T===void 0&&(T=e[b]=[]),T.push({featureIndex:i,feature:w,intersectionZ:A})}}lookupSymbolFeatures(e,r,n,i,o,a,s,l){let u={};this.loadVTLayers();let c=Ct(o);for(let p of e)this.loadMatchingFeature(u,n,i,p,c,a,s,l,r);return u}hasLayer(e){for(let r of this.bucketLayerIDs)for(let n of r)if(e===n)return!0;return!1}getId(e,r){var i;let n=e.id;if(this.promoteId){let o=typeof this.promoteId=="string"?this.promoteId:this.promoteId[r];n=e.properties[o],typeof n=="boolean"&&(n=Number(n)),n===void 0&&((i=e.properties)!=null&&i.cluster)&&this.promoteId&&(n=Number(e.properties.cluster_id))}return n}};I("FeatureIndex",Ii,{omit:["rawTileData","sourceLayerCoder"]});function Xf(t,e,r,n,i){return rn(t,(o,a)=>{let s=e instanceof kt?e.get(a):null;return s&&s.evaluate?s.evaluate(r,n,i):s})}function Mb(t,e){return e-t}var Jf=Y(ye(),1);var et=class t extends Jf.default{constructor(e,r,n,i){super(e,r),this.angle=n,i!==void 0&&(this.segment=i)}clone(){return new t(this.x,this.y,this.angle,this.segment)}};I("Anchor",et);function Fl(t,e,r,n,i){if(e.segment===void 0||r===0)return!0;let o=e,a=e.segment+1,s=0;for(;s>-r/2;){if(a--,a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;let l=[],u=0;for(;s<r/2;){let c=t[a-1],p=t[a],f=t[a+1];if(!f)return!1;let y=c.angleTo(p)-p.angleTo(f);for(y=Math.abs((y+3*Math.PI)%(Math.PI*2)-Math.PI),l.push({distance:s,angleDelta:y}),u+=y;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;a++,s+=p.dist(f)}return!0}function Yf(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Kf(t,e,r){return t?3/5*e*r:0}function Qf(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function ey(t,e,r,n,i,o){let a=Kf(r,i,o),s=Qf(r,n)*o,l=0,u=Yf(t)/2;for(let c=0;c<t.length-1;c++){let p=t[c],f=t[c+1],y=p.dist(f);if(l+y>u){let m=(u-l)/y,h=lt.number(p.x,f.x,m),g=lt.number(p.y,f.y,m),d=new et(h,g,f.angleTo(p),c);return d._round(),!a||Fl(t,d,s,a,e)?d:void 0}l+=y}}function ty(t,e,r,n,i,o,a,s,l){let u=Kf(n,o,a),c=Qf(n,i),p=c*a,f=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-p<e/4&&(e=p+e/4);let y=o*2,m=f?e/2*s%e:(c/2+y)*a*s%e;return ry(t,m,e,u,r,p,f,!1,l)}function ry(t,e,r,n,i,o,a,s,l){let u=o/2,c=Yf(t),p=0,f=e-r,y=[];for(let m=0;m<t.length-1;m++){let h=t[m],g=t[m+1],d=h.dist(g),b=g.angleTo(h);for(;f+r<p+d;){f+=r;let x=(f-p)/d,v=lt.number(h.x,g.x,x),S=lt.number(h.y,g.y,x);if(v>=0&&v<l&&S>=0&&S<l&&f-u>=0&&f+u<=c){let A=new et(v,S,b,m);A._round(),(!n||Fl(t,A,o,n,i))&&y.push(A)}}p+=d}return!s&&!y.length&&!a&&(y=ry(t,p/2,r,n,i,o,a,!0,l)),y}var ht=Y(ye(),1);function ny(t,e,r,n,i){let o=[];for(let a=0;a<t.length;a++){let s=t[a],l;for(let u=0;u<s.length-1;u++){let c=s[u],p=s[u+1];c.x<e&&p.x<e||(c.x<e?c=new ht.default(e,c.y+(p.y-c.y)*((e-c.x)/(p.x-c.x)))._round():p.x<e&&(p=new ht.default(e,c.y+(p.y-c.y)*((e-c.x)/(p.x-c.x)))._round()),!(c.y<r&&p.y<r)&&(c.y<r?c=new ht.default(c.x+(p.x-c.x)*((r-c.y)/(p.y-c.y)),r)._round():p.y<r&&(p=new ht.default(c.x+(p.x-c.x)*((r-c.y)/(p.y-c.y)),r)._round()),!(c.x>=n&&p.x>=n)&&(c.x>=n?c=new ht.default(n,c.y+(p.y-c.y)*((n-c.x)/(p.x-c.x)))._round():p.x>=n&&(p=new ht.default(n,c.y+(p.y-c.y)*((n-c.x)/(p.x-c.x)))._round()),!(c.y>=i&&p.y>=i)&&(c.y>=i?c=new ht.default(c.x+(p.x-c.x)*((i-c.y)/(p.y-c.y)),i)._round():p.y>=i&&(p=new ht.default(c.x+(p.x-c.x)*((i-c.y)/(p.y-c.y)),i)._round()),(!l||!c.equals(l[l.length-1]))&&(l=[c],o.push(l)),l.push(p)))))}}return o}var xe=Y(ye(),1);var jr=he;function El(t,e,r,n){let i=[],o=t.image,a=o.pixelRatio,s=o.paddedRect.w-2*jr,l=o.paddedRect.h-2*jr,u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},c=o.stretchX||[[0,s]],p=o.stretchY||[[0,l]],f=(_,V)=>_+V[1]-V[0],y=c.reduce(f,0),m=p.reduce(f,0),h=s-y,g=l-m,d=0,b=y,x=0,v=m,S=0,A=h,w=0,T=g;if(o.content&&n){let _=o.content,V=_[2]-_[0],G=_[3]-_[1];(o.textFitWidth||o.textFitHeight)&&(u=Da(t)),d=$a(c,0,_[0]),x=$a(p,0,_[1]),b=$a(c,_[0],_[2]),v=$a(p,_[1],_[3]),S=_[0]-d,w=_[1]-x,A=V-b,T=G-v}let E=u.x1,D=u.y1,B=u.x2-E,z=u.y2-D,M=(_,V,G,O)=>{let R=ja(_.stretch-d,b,B,E),K=qa(_.fixed-S,A,_.stretch,y),X=ja(V.stretch-x,v,z,D),re=qa(V.fixed-w,T,V.stretch,m),me=ja(G.stretch-d,b,B,E),Ut=qa(G.fixed-S,A,G.stretch,y),tt=ja(O.stretch-x,v,z,D),gt=qa(O.fixed-w,T,O.stretch,m),Ni=new xe.default(R,X),Ui=new xe.default(me,X),$i=new xe.default(me,tt),ji=new xe.default(R,tt),ss=new xe.default(K/a,re/a),Ie=new xe.default(Ut/a,gt/a),xt=e*Math.PI/180;if(xt){let bt=Math.sin(xt),Jr=Math.cos(xt),Be=[Jr,-bt,bt,Jr];Ni._matMult(Be),Ui._matMult(Be),ji._matMult(Be),$i._matMult(Be)}let Zr=_.stretch+_.fixed,ls=G.stretch+G.fixed,qi=V.stretch+V.fixed,us=O.stretch+O.fixed,Te={x:o.paddedRect.x+jr+Zr,y:o.paddedRect.y+jr+qi,w:ls-Zr,h:us-qi},be=A/a/B,rt=T/a/z;return{tl:Ni,tr:Ui,bl:ji,br:$i,tex:Te,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ss,pixelOffsetBR:Ie,minFontScaleX:be,minFontScaleY:rt,isSDF:r}};if(!n||!o.stretchX&&!o.stretchY)i.push(M({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));else{let _=iy(c,h,y),V=iy(p,g,m);for(let G=0;G<_.length-1;G++){let O=_[G],R=_[G+1];for(let K=0;K<V.length-1;K++){let X=V[K],re=V[K+1];i.push(M(O,X,R,re))}}}return i}function $a(t,e,r){let n=0;for(let i of t)n+=Math.max(e,Math.min(r,i[1]))-Math.max(e,Math.min(r,i[0]));return n}function iy(t,e,r){let n=[{fixed:-jr,stretch:0}];for(let[i,o]of t){let a=n[n.length-1];n.push({fixed:i-a.stretch,stretch:a.stretch}),n.push({fixed:i-a.stretch,stretch:a.stretch+(o-i)})}return n.push({fixed:e+jr,stretch:r}),n}function ja(t,e,r,n){return t/e*r+n}function qa(t,e,r,n){return t-e*r/n}function oy(t,e,r,n,i,o,a,s){let l=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[];for(let c of e.positionedLines)for(let p of c.positionedGlyphs){if(!p.rect)continue;let f=p.rect||{},m=ka+1,h=!0,g=1,d=0,b=(i||s)&&p.vertical,x=p.metrics.advance*p.scale/2;if(s&&e.verticalizable){let X=(p.scale-1)*ae,re=(ae-p.metrics.width*p.scale)/2;d=c.lineOffset/2-(p.imageName?-re:X)}if(p.imageName){let X=a[p.imageName];h=X.sdf,g=X.pixelRatio,m=he/g}let v=i?[p.x+x,p.y]:[0,0],S=i?[0,0]:[p.x+x+r[0],p.y+r[1]-d],A=[0,0];b&&(A=S,S=[0,0]);let w=p.metrics.isDoubleResolution?2:1,T=(p.metrics.left-m)*p.scale-x+S[0],E=(-p.metrics.top-m)*p.scale+S[1],D=T+f.w/w*p.scale/g,B=E+f.h/w*p.scale/g,z=new xe.default(T,E),M=new xe.default(D,E),_=new xe.default(T,B),V=new xe.default(D,B);if(b){let X=new xe.default(-x,x-bi),re=-Math.PI/2,me=ae/2-x,Ut=p.imageName?me:0,tt=new xe.default(5-bi-me,-Ut),gt=new xe.default(...A);z._rotateAround(re,X)._add(tt)._add(gt),M._rotateAround(re,X)._add(tt)._add(gt),_._rotateAround(re,X)._add(tt)._add(gt),V._rotateAround(re,X)._add(tt)._add(gt)}if(l){let X=Math.sin(l),re=Math.cos(l),me=[re,-X,X,re];z._matMult(me),M._matMult(me),_._matMult(me),V._matMult(me)}let G=new xe.default(0,0),O=new xe.default(0,0);u.push({tl:z,tr:M,bl:_,br:V,tex:f,writingMode:e.writingMode,glyphOffset:v,sectionIndex:p.sectionIndex,isSDF:h,pixelOffsetTL:G,pixelOffsetBR:O,minFontScaleX:0,minFontScaleY:0})}return u}var Ti=Y(ye(),1);var mr=class{constructor(e,r,n,i,o,a,s,l,u,c){var p;if(this.boxStartIndex=e.length,u){let f=a.top,y=a.bottom,m=a.collisionPadding;m&&(f-=m[1],y+=m[3]);let h=y-f;h>0&&(h=Math.max(10,h),this.circleDiameter=h)}else{let f=(p=a.image)!=null&&p.content&&(a.image.textFitWidth||a.image.textFitHeight)?Da(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};f.y1=f.y1*s-l[0],f.y2=f.y2*s+l[2],f.x1=f.x1*s-l[3],f.x2=f.x2*s+l[1];let y=a.collisionPadding;if(y&&(f.x1-=y[0]*s,f.y1-=y[1]*s,f.x2+=y[2]*s,f.y2+=y[3]*s),c){let m=new Ti.default(f.x1,f.y1),h=new Ti.default(f.x2,f.y1),g=new Ti.default(f.x1,f.y2),d=new Ti.default(f.x2,f.y2),b=c*Math.PI/180;m._rotate(b),h._rotate(b),g._rotate(b),d._rotate(b),f.x1=Math.min(m.x,h.x,g.x,d.x),f.x2=Math.max(m.x,h.x,g.x,d.x),f.y1=Math.min(m.y,h.y,g.y,d.y),f.y2=Math.max(m.y,h.y,g.y,d.y)}e.emplaceBack(r.x,r.y,f.x1,f.y1,f.x2,f.y2,n,i,o)}this.boxEndIndex=e.length}};var Ci=class{constructor(e=[],r=(n,i)=>n<i?-1:n>i?1:0){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:n}=this,i=r[e];for(;e>0;){let o=e-1>>1,a=r[o];if(n(i,a)>=0)break;r[e]=a,e=o}r[e]=i}_down(e){let{data:r,compare:n}=this,i=this.length>>1,o=r[e];for(;e<i;){let a=(e<<1)+1,s=a+1;if(s<this.length&&n(r[s],r[a])<0&&(a=s),n(r[a],o)>=0)break;r[e]=r[a],e=a}r[e]=o}};var Ml=Y(ye(),1);function ay(t,e=1,r=!1){let n=yr.fromPoints(t[0]),i=Math.min(n.width(),n.height()),o=i/2,a=new Ci([],Lb),{minX:s,minY:l,maxX:u,maxY:c}=n;if(i===0)return new Ml.default(s,l);for(let y=s;y<u;y+=i)for(let m=l;m<c;m+=i)a.push(new qr(y+o,m+o,o,t));let p=Bb(t),f=a.length;for(;a.length;){let y=a.pop();(y.d>p.d||!p.d)&&(p=y,r&&console.log("found best %d after %d probes",Math.round(1e4*y.d)/1e4,f)),!(y.max-p.d<=e)&&(o=y.h/2,a.push(new qr(y.p.x-o,y.p.y-o,o,t)),a.push(new qr(y.p.x+o,y.p.y-o,o,t)),a.push(new qr(y.p.x-o,y.p.y+o,o,t)),a.push(new qr(y.p.x+o,y.p.y+o,o,t)),f+=4)}return r&&(console.log("num probes: ".concat(f)),console.log("best distance: ".concat(p.d))),p.p}function Lb(t,e){return e.max-t.max}function qr(t,e,r,n){this.p=new Ml.default(t,e),this.h=r,this.d=Db(this.p,n),this.max=this.d+this.h*Math.SQRT2}function Db(t,e){let r=!1,n=1/0;for(let i=0;i<e.length;i++){let o=e[i];for(let a=0,s=o.length,l=s-1;a<s;l=a++){let u=o[a],c=o[l];u.y>t.y!=c.y>t.y&&t.x<(c.x-u.x)*(t.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,cl(t,u,c))}}return(r?1:-1)*Math.sqrt(n)}function Bb(t){let e=0,r=0,n=0,i=t[0];for(let o=0,a=i.length,s=a-1;o<a;s=o++){let l=i[o],u=i[s],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,n+=(l.y+u.y)*c,e+=c*3}return new qr(r/e,n/e,0,t)}var Vl=Y(il(),1);var Ll=(o=>(o[o.center=1]="center",o[o.left=2]="left",o[o.right=3]="right",o[o.top=4]="top",o[o.bottom=5]="bottom",o[o["top-left"]=6]="top-left",o[o["top-right"]=7]="top-right",o[o["bottom-left"]=8]="bottom-left",o[o["bottom-right"]=9]="bottom-right",o))(Ll||{}),Ot=7,Wa=Number.POSITIVE_INFINITY;function Dl(t,e){function r(i,o){let a=0,s=0;o<0&&(o=0);let l=o/Math.SQRT2;switch(i){case"top-right":case"top-left":s=l-Ot;break;case"bottom-right":case"bottom-left":s=-l+Ot;break;case"bottom":s=-o+Ot;break;case"top":s=o-Ot;break}switch(i){case"top-right":case"bottom-right":a=-l;break;case"top-left":case"bottom-left":a=l;break;case"left":a=o;break;case"right":a=-o;break}return[a,s]}function n(i,o,a){let s=0,l=0;switch(o=Math.abs(o),a=Math.abs(a),i){case"top-right":case"top-left":case"top":l=a-Ot;break;case"bottom-right":case"bottom-left":case"bottom":l=-a+Ot;break}switch(i){case"top-right":case"bottom-right":case"right":s=-o;break;case"top-left":case"bottom-left":case"left":s=o;break}return[s,l]}return e[1]!==Wa?n(t,e[0],e[1]):r(t,e[0])}function Bl(t,e,r){var a;let n=t.layout,i=(a=n.get("text-variable-anchor-offset"))==null?void 0:a.evaluate(e,{},r);if(i){let s=i.values,l=[];for(let u=0;u<s.length;u+=2){let c=l[u]=s[u],p=s[u+1].map(f=>f*ae);c.startsWith("top")?p[1]-=Ot:c.startsWith("bottom")&&(p[1]+=Ot),l[u+1]=p}return new Ee(l)}let o=n.get("text-variable-anchor");if(o){let s;t._unevaluatedLayout.getValue("text-radial-offset")!==void 0?s=[n.get("text-radial-offset").evaluate(e,{},r)*ae,Wa]:s=n.get("text-offset").evaluate(e,{},r).map(c=>c*ae);let u=[];for(let c of o)u.push(c,Dl(c,s));return new Ee(u)}return null}function uy(t){t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=8192/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],n=r.layout,i=r._unevaluatedLayout._values,o={layoutIconSize:i["icon-size"].possiblyEvaluate(new W(t.bucket.zoom+1),t.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new W(t.bucket.zoom+1),t.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new W(18))};if(t.bucket.textSizeData.kind==="composite"){let{minZoom:c,maxZoom:p}=t.bucket.textSizeData;o.compositeTextSizes=[i["text-size"].possiblyEvaluate(new W(c),t.canonical),i["text-size"].possiblyEvaluate(new W(p),t.canonical)]}if(t.bucket.iconSizeData.kind==="composite"){let{minZoom:c,maxZoom:p}=t.bucket.iconSizeData;o.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new W(c),t.canonical),i["icon-size"].possiblyEvaluate(new W(p),t.canonical)]}let a=n.get("text-line-height")*ae,s=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point",l=n.get("text-keep-upright"),u=n.get("text-size");for(let c of t.bucket.features){let p=n.get("text-font").evaluate(c,{},t.canonical).join(","),f=u.evaluate(c,{},t.canonical),y=o.layoutTextSize.evaluate(c,{},t.canonical),m=o.layoutIconSize.evaluate(c,{},t.canonical),h={horizontal:{},vertical:void 0},g=c.text,d=[0,0];if(g){let S=g.toString(),A=n.get("text-letter-spacing").evaluate(c,{},t.canonical)*ae,w=ep(S)?A:0,T=n.get("text-anchor").evaluate(c,{},t.canonical),E=Bl(r,c,t.canonical);if(!E){let _=n.get("text-radial-offset").evaluate(c,{},t.canonical);_?d=Dl(T,[_*ae,Wa]):d=n.get("text-offset").evaluate(c,{},t.canonical).map(V=>V*ae)}let D=s?"center":n.get("text-justify").evaluate(c,{},t.canonical),z=n.get("symbol-placement")==="point"?n.get("text-max-width").evaluate(c,{},t.canonical)*ae:1/0,M=()=>{t.bucket.allowVerticalPlacement&&Tn(S)&&(h.vertical=vi(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,z,a,T,"left",w,d,2,!0,y,f))};if(!s&&E){let _=new Set;if(D==="auto")for(let G=0;G<E.values.length;G+=2)_.add(sy(E.values[G]));else _.add(D);let V=!1;for(let G of _)if(!h.horizontal[G])if(V)h.horizontal[G]=h.horizontal[0];else{let O=vi(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,z,a,"center",G,w,d,1,!1,y,f);O&&(h.horizontal[G]=O,V=O.positionedLines.length===1)}M()}else{D==="auto"&&(D=sy(T));let _=vi(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,z,a,T,D,w,d,1,!1,y,f);_&&(h.horizontal[D]=_),M(),Tn(S)&&s&&l&&(h.vertical=vi(g,t.glyphMap,t.glyphPositions,t.imagePositions,p,z,a,T,D,w,d,2,!1,y,f))}}let b,x=!1;if(c.icon&&c.icon.name){let S=t.imageMap[c.icon.name];S&&(b=Bf(t.imagePositions[c.icon.name],n.get("icon-offset").evaluate(c,{},t.canonical),n.get("icon-anchor").evaluate(c,{},t.canonical)),x=!!S.sdf,t.bucket.sdfIcons===void 0?t.bucket.sdfIcons=x:t.bucket.sdfIcons!==x&&ce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(S.pixelRatio!==t.bucket.pixelRatio||n.get("icon-rotate").constantOr(1)!==0)&&(t.bucket.iconsNeedLinear=!0))}let v=cy(h.horizontal)||h.vertical;t.bucket.iconsInText=v?v.iconsInText:!1,(v||b)&&Vb(t.bucket,c,h,b,t.imageMap,o,y,m,d,x,t.canonical,t.subdivisionGranularity)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()}function sy(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 Vb(t,e,r,n,i,o,a,s,l,u,c,p){let f=o.textMaxSize.evaluate(e,{});f===void 0&&(f=a);let y=t.layers[0].layout,m=y.get("icon-offset").evaluate(e,{},c),h=cy(r.horizontal),g=24,d=a/g,b=t.tilePixelRatio*d,x=t.tilePixelRatio*f/g,v=t.tilePixelRatio*s,S=t.tilePixelRatio*y.get("symbol-spacing"),A=y.get("text-padding")*t.tilePixelRatio,w=Nf(y,e,c,t.tilePixelRatio),T=y.get("text-max-angle")/180*Math.PI,E=y.get("text-rotation-alignment")!=="viewport"&&y.get("symbol-placement")!=="point",D=y.get("icon-rotation-alignment")==="map"&&y.get("symbol-placement")!=="point",B=y.get("symbol-placement"),z=S/2,M=y.get("icon-text-fit"),_;n&&M!=="none"&&(t.allowVerticalPlacement&&r.vertical&&(_=Tl(n,r.vertical,M,y.get("icon-text-fit-padding"),m,d)),h&&(n=Tl(n,h,M,y.get("icon-text-fit-padding"),m,d)));let V=c?p.line.getGranularityForZoomLevel(c.z):1,G=(O,R)=>{R.x<0||R.x>=8192||R.y<0||R.y>=8192||zb(t,R,O,r,n,i,_,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,b,[A,A,A,A],E,l,v,w,D,m,e,o,u,c,a)};if(B==="line")for(let O of ny(e.geometry,0,0,8192,8192)){let R=Ke(O,V),K=ty(R,S,T,r.vertical||h,n,g,x,t.overscaling,8192);for(let X of K){let re=h;(!re||!Ob(t,re.text,z,X))&&G(R,X)}}else if(B==="line-center"){for(let O of e.geometry)if(O.length>1){let R=Ke(O,V),K=ey(R,T,r.vertical||h,n,g,x);K&&G(R,K)}}else if(e.type==="Polygon")for(let O of Kt(e.geometry,0)){let R=ay(O,16),K=Ke(O[0],V,!0);G(K,new et(R.x,R.y,0))}else if(e.type==="LineString")for(let O of e.geometry){let R=Ke(O,V);G(R,new et(R[0].x,R[0].y,0))}else if(e.type==="Point")for(let O of e.geometry)for(let R of O)G([R],new et(R.x,R.y,0))}function Rb(t,e){let r=t.length,n=e==null?void 0:e.values;if((n==null?void 0:n.length)>0)for(let i=0;i<n.length;i+=2){let o=Ll[n[i]],a=n[i+1];t.emplaceBack(o,a[0],a[1])}return[r,t.length]}function ly(t,e,r,n,i,o,a,s,l,u,c,p,f,y,m){let h=oy(e,r,s,i,o,a,n,t.allowVerticalPlacement),g=t.textSizeData,d=null;g.kind==="source"?(d=[zt*i.layout.get("text-size").evaluate(a,{})],d[0]>Qe&&ce("".concat(t.layerIds[0],\': Value for "text-size" is >= \').concat(Ur,\'. Reduce your "text-size".\'))):g.kind==="composite"&&(d=[zt*y.compositeTextSizes[0].evaluate(a,{},m),zt*y.compositeTextSizes[1].evaluate(a,{},m)],(d[0]>Qe||d[1]>Qe)&&ce("".concat(t.layerIds[0],\': Value for "text-size" is >= \').concat(Ur,\'. Reduce your "text-size".\'))),t.addSymbols(t.text,h,d,s,o,a,u,e,l.lineStartIndex,l.lineLength,f,m);for(let b of c)p[b]=t.text.placedSymbolArray.length-1;return h.length*4}function cy(t){for(let e in t)return t[e];return null}function zb(t,e,r,n,i,o,a,s,l,u,c,p,f,y,m,h,g,d,b,x,v,S,A,w,T){let E=t.addToLineVertexArray(e,r),D,B,z,M,_=0,V=0,G=0,O=0,R=-1,K=-1,X={},re=(0,Vl.default)("");if(t.allowVerticalPlacement&&n.vertical){let be=s.layout.get("text-rotate").evaluate(v,{},w)+90,rt=n.vertical;z=new mr(l,e,u,c,p,rt,f,y,m,be),a&&(M=new mr(l,e,u,c,p,a,g,d,m,be))}if(i){let Te=s.layout.get("icon-rotate").evaluate(v,{}),be=s.layout.get("icon-text-fit")!=="none",rt=El(i,Te,A,be),bt=a?El(a,Te,A,be):void 0;B=new mr(l,e,u,c,p,i,g,d,!1,Te),_=rt.length*4;let Jr=t.iconSizeData,Be=null;Jr.kind==="source"?(Be=[zt*s.layout.get("icon-size").evaluate(v,{})],Be[0]>Qe&&ce("".concat(t.layerIds[0],\': Value for "icon-size" is >= \').concat(Ur,\'. Reduce your "icon-size".\'))):Jr.kind==="composite"&&(Be=[zt*S.compositeIconSizes[0].evaluate(v,{},w),zt*S.compositeIconSizes[1].evaluate(v,{},w)],(Be[0]>Qe||Be[1]>Qe)&&ce("".concat(t.layerIds[0],\': Value for "icon-size" is >= \').concat(Ur,\'. Reduce your "icon-size".\'))),t.addSymbols(t.icon,rt,Be,x,b,v,0,e,E.lineStartIndex,E.lineLength,-1,w),R=t.icon.placedSymbolArray.length-1,bt&&(V=bt.length*4,t.addSymbols(t.icon,bt,Be,x,b,v,2,e,E.lineStartIndex,E.lineLength,-1,w),K=t.icon.placedSymbolArray.length-1)}let me=Object.keys(n.horizontal);for(let Te of me){let be=n.horizontal[Te];if(!D){re=(0,Vl.default)(be.text);let bt=s.layout.get("text-rotate").evaluate(v,{},w);D=new mr(l,e,u,c,p,be,f,y,m,bt)}let rt=be.positionedLines.length===1;if(G+=ly(t,e,be,o,s,m,v,h,E,n.vertical?1:3,rt?me:[Te],X,R,S,w),rt)break}n.vertical&&(O+=ly(t,e,n.vertical,o,s,m,v,h,E,2,["vertical"],X,K,S,w));let Ut=D?D.boxStartIndex:t.collisionBoxArray.length,tt=D?D.boxEndIndex:t.collisionBoxArray.length,gt=z?z.boxStartIndex:t.collisionBoxArray.length,Ni=z?z.boxEndIndex:t.collisionBoxArray.length,Ui=B?B.boxStartIndex:t.collisionBoxArray.length,$i=B?B.boxEndIndex:t.collisionBoxArray.length,ji=M?M.boxStartIndex:t.collisionBoxArray.length,ss=M?M.boxEndIndex:t.collisionBoxArray.length,Ie=-1,xt=(Te,be)=>Te&&Te.circleDiameter?Math.max(Te.circleDiameter,be):be;Ie=xt(D,Ie),Ie=xt(z,Ie),Ie=xt(B,Ie),Ie=xt(M,Ie);let Zr=Ie>-1?1:0;Zr&&(Ie*=T/ae),t.glyphOffsetArray.length>=Xe.MAX_GLYPHS&&ce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),v.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,v.sortKey);let ls=Bl(s,v,w),[qi,us]=Rb(t.textAnchorOffsets,ls);t.symbolInstances.emplaceBack(e.x,e.y,X.right>=0?X.right:-1,X.center>=0?X.center:-1,X.left>=0?X.left:-1,X.vertical||-1,R,K,re,Ut,tt,gt,Ni,Ui,$i,ji,ss,u,G,O,_,V,Zr,0,f,Ie,qi,us)}function Ob(t,e,r,n){let i=t.compareText;if(!(e in i))i[e]=[];else{let o=i[e];for(let a=o.length-1;a>=0;a--)if(n.dist(o[a])<r)return!0}return i[e].push(n),!1}var Xa=1,ki=class{constructor(e){let r={},n=[];for(let s in e){let l=e[s],u=r[s]={};for(let c in l){let p=l[+c];if(!p||p.bitmap.width===0||p.bitmap.height===0)continue;let f={x:0,y:0,w:p.bitmap.width+2*Xa,h:p.bitmap.height+2*Xa};n.push(f),u[c]={rect:f,metrics:p.metrics}}}let{w:i,h:o}=di(n),a=new lr({width:i||1,height:o||1});for(let s in e){let l=e[s];for(let u in l){let c=l[+u];if(!c||c.bitmap.width===0||c.bitmap.height===0)continue;let p=r[s][u].rect;lr.copy(c.bitmap,a,{x:0,y:0},{x:p.x+Xa,y:p.y+Xa},c.bitmap)}}this.image=a,this.positions=r}};I("GlyphAtlas",ki);function fy(t,e,r){e=Math.pow(2,r)-e-1;var n=py(t*256,e*256,r),i=py((t+1)*256,(e+1)*256,r);return n[0]+","+n[1]+","+i[0]+","+i[1]}function py(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=t*n-2*Math.PI*6378137/2,o=e*n-2*Math.PI*6378137/2;return[i,o]}var dy=Y(ye(),1);var Rl=63710088e-1,Fi=class t{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid LngLat object: (".concat(e,", ").concat(r,")"));if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new t(Cu(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}distanceTo(e){let r=Math.PI/180,n=this.lat*r,i=e.lat*r,o=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((e.lng-this.lng)*r);return Rl*Math.acos(Math.min(o,1))}static convert(e){if(e instanceof t)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new t(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new t(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}};var yy=2*Math.PI*Rl;function my(t){return yy*Math.cos(t*Math.PI/180)}function Gb(t){return(180+t)/360}function Nb(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Ub(t,e){return t/my(e)}function $b(t){return t*360-180}function zl(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function jb(t,e){return t*my(zl(e))}function qb(t){return 1/Math.cos(t*Math.PI/180)}var Ei=class t{constructor(e,r,n=0){this.x=+e,this.y=+r,this.z=+n}static fromLngLat(e,r=0){let n=Fi.convert(e);return new t(Gb(n.lng),Nb(n.lat),Ub(r,n.lat))}toLngLat(){return new Fi($b(this.x),zl(this.y))}toAltitude(){return jb(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/yy*qb(zl(this.y))}};function hy(t,e,r){return!(t<Yi||t>Ji||r<0||r>=Math.pow(2,t)||e<0||e>=Math.pow(2,t))}var Ha=class{constructor(e,r,n){if(!hy(e,r,n))throw new Error("x=".concat(r,", y=").concat(n,", z=").concat(e," outside of bounds. 0<=x<").concat(Math.pow(2,e),", 0<=y<").concat(Math.pow(2,e)," ").concat(Yi,"<=z<=").concat(Ji," "));this.z=e,this.x=r,this.y=n,this.key=Mi(0,e,e,r,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,n){let i=fy(this.x,this.y,this.z),o=Wb(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(n==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,o).replace(/{bbox-epsg-3857}/g,i)}isChildOf(e){let r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){let r=Math.pow(2,this.z);return new dy.default((e.x*r-this.x)*8192,(e.y*r-this.y)*8192)}toString(){return"".concat(this.z,"/").concat(this.x,"/").concat(this.y)}},Ol=class{constructor(e,r){this.wrap=e,this.canonical=r,this.key=Mi(e,r.z,r.z,r.x,r.y)}},Li=class t{constructor(e,r,n,i,o){this.terrainRttPosMatrix32f=null;if(e<n)throw new Error("overscaledZ should be >= z; overscaledZ = ".concat(e,"; z = ").concat(n));this.overscaledZ=e,this.wrap=r,this.canonical=new Ha(n,+i,+o),this.key=Mi(r,e,n,i,o)}clone(){return new t(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(e,"; overscaledZ = ").concat(this.overscaledZ));let r=this.canonical.z-e;return e>this.canonical.z?new t(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new t(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(e,"; overscaledZ = ").concat(this.overscaledZ));let n=this.canonical.z-e;return e>this.canonical.z?Mi(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Mi(this.wrap*+r,e,e,this.canonical.x>>n,this.canonical.y>>n)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new t(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,n=this.canonical.x*2,i=this.canonical.y*2;return[new t(r,this.wrap,r,n,i),new t(r,this.wrap,r,n+1,i),new t(r,this.wrap,r,n,i+1),new t(r,this.wrap,r,n+1,i+1)]}isLessThan(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y}wrapped(){return new t(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new t(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Ol(this.wrap,this.canonical)}toString(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}getTilePoint(e){return this.canonical.getTilePoint(new Ei(e.x-this.wrap,e.y))}};function Mi(t,e,r,n,i){t*=2,t<0&&(t=t*-1-1);let o=1<<r;return(o*o*t+o*i+n).toString(36)+r.toString(36)+e.toString(36)}function Wb(t,e,r){let n="",i;for(let o=t;o>0;o--)i=1<<o-1,n+=(e&i?1:0)+(r&i?2:0);return n}I("CanonicalTileID",Ha);I("OverscaledTileID",Li,{omit:["terrainRttPosMatrix32f"]});var Za=class{constructor(e){this.tileID=new Li(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[],this.globalState=e.globalState}async parse(e,r,n,i,o){this.status="parsing",this.data=e,this.collisionBoxArray=new qn;let a=new $r(Object.keys(e.layers).sort()),s=new Ii(this.tileID,this.promoteId);s.bucketLayerIDs=[];let l={},u={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n,subdivisionGranularity:o},c=r.familiesBySource[this.source];for(let A in c){let w=e.layers[A];if(!w)continue;w.version===1&&ce(\'Vector tile source "\'.concat(this.source,\'" layer "\').concat(A,\'" \')+"does not use vector tile spec v2 and therefore may have some rendering errors.");let T=a.encode(A),E=[];for(let D=0;D<w.length;D++){let B=w.feature(D),z=s.getId(B,A);E.push({feature:B,id:z,index:D,sourceLayerIndex:T})}for(let D of c[A]){let B=D[0];if(B.source!==this.source&&ce("layer.source = ".concat(B.source," does not equal this.source = ").concat(this.source)),B.minzoom&&this.zoom<Math.floor(B.minzoom)||B.maxzoom&&this.zoom>=B.maxzoom||B.visibility==="none")continue;Gl(D,this.zoom,n),(l[B.id]=B.createBucket({index:s.bucketLayerIDs.length,layers:D,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:T,sourceID:this.source,globalState:this.globalState})).populate(E,u,this.tileID.canonical),s.bucketLayerIDs.push(D.map(M=>M.id))}}let p=rn(u.glyphDependencies,A=>Object.keys(A).map(Number));this.inFlightDependencies.forEach(A=>A==null?void 0:A.abort()),this.inFlightDependencies=[];let f=Promise.resolve({});if(Object.keys(p).length){let A=new AbortController;this.inFlightDependencies.push(A),f=i.sendAsync({type:"GG",data:{stacks:p,source:this.source,tileID:this.tileID,type:"glyphs"}},A)}let y=Object.keys(u.iconDependencies),m=Promise.resolve({});if(y.length){let A=new AbortController;this.inFlightDependencies.push(A),m=i.sendAsync({type:"GI",data:{icons:y,source:this.source,tileID:this.tileID,type:"icons"}},A)}let h=Object.keys(u.patternDependencies),g=Promise.resolve({});if(h.length){let A=new AbortController;this.inFlightDependencies.push(A),g=i.sendAsync({type:"GI",data:{icons:h,source:this.source,tileID:this.tileID,type:"patterns"}},A)}let[d,b,x]=await Promise.all([f,m,g]),v=new ki(d),S=new gi(b,x);for(let A in l){let w=l[A];w instanceof Xe?(Gl(w.layers,this.zoom,n),uy({bucket:w,glyphMap:d,glyphPositions:v.positions,imageMap:b,imagePositions:S.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:u.subdivisionGranularity})):w.hasPattern&&(w instanceof fr||w instanceof cr||w instanceof pr)&&(Gl(w.layers,this.zoom,n),w.addFeatures(u,this.tileID.canonical,S.patternPositions))}return this.status="done",{buckets:Object.values(l).filter(A=>!A.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:v.image,imageAtlas:S,glyphMap:this.returnDependencies?d:null,iconMap:this.returnDependencies?b:null,glyphPositions:this.returnDependencies?v.positions:null}}};function Gl(t,e,r){let n=new W(e);for(let i of t)i.recalculate(n,r)}var Xb=60,rT=1e3/Xb;var Wr=class{constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return e.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}};var Xr=class{constructor(e,r,n){this.actor=e,this.layerIndex=r,this.availableImages=n,this.fetching={},this.loading={},this.loaded={}}async loadVectorTile(e,r){let n=await Xc(e.request,r);try{return{vectorTile:new gy.default.VectorTile(new xy.default(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(i){let o=new Uint8Array(n.data),a=o[0]===31&&o[1]===139,s="Unable to parse the tile at ".concat(e.request.url,", ");throw a?s+="please make sure the data is not gzipped and that you have configured the relevant header in the server":s+="got error: ".concat(i.message),new Error(s)}}async loadTile(e){let r=e.uid,n=e&&e.request&&e.request.collectResourceTiming?new Wr(e.request):!1,i=new Za(e);this.loading[r]=i;let o=new AbortController;i.abort=o;try{let a=await this.loadVectorTile(e,o);if(delete this.loading[r],!a)return null;let s=a.rawData,l={};a.expires&&(l.expires=a.expires),a.cacheControl&&(l.cacheControl=a.cacheControl);let u={};if(n){let p=n.finish();p&&(u.resourceTiming=JSON.parse(JSON.stringify(p)))}i.vectorTile=a.vectorTile;let c=i.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);this.loaded[r]=i,this.fetching[r]={rawTileData:s,cacheControl:l,resourceTiming:u};try{let p=await c;return de({rawTileData:s.slice(0)},p,l,u)}finally{delete this.fetching[r]}}catch(a){throw delete this.loading[r],i.status="done",this.loaded[r]=i,a}}async reloadTile(e){let r=e.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let n=this.loaded[r];if(n.showCollisionBoxes=e.showCollisionBoxes,n.globalState=e.globalState,n.status==="parsing"){let i=await n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity),o;if(this.fetching[r]){let{rawTileData:a,cacheControl:s,resourceTiming:l}=this.fetching[r];delete this.fetching[r],o=de({rawTileData:a.slice(0)},i,s,l)}else o=i;return o}if(n.status==="done"&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity)}async abortTile(e){let r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort.abort(),delete r[n])}async removeTile(e){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]}};var Ja=class{constructor(){this.loaded={}}async loadTile(e){let{uid:r,encoding:n,rawImageData:i,redFactor:o,greenFactor:a,blueFactor:s,baseShift:l}=e,u=i.width+2,c=i.height+2,p=vt(i)?new fe({width:u,height:c},await Eu(i,-1,-1,u,c)):i,f=new oi(r,p,n,o,a,s,l);return this.loaded=this.loaded||{},this.loaded[r]=f,f}removeTile(e){let r=this.loaded,n=e.uid;r&&r[n]&&delete r[n]}};var qy=Y(Sy(),1);var Nl=Y(ye(),1),wy=Y(Rt(),1);var Hb=wy.default.VectorTileFeature.prototype.toGeoJSON,Ul=class{constructor(e){this._feature=e,this.extent=8192,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(this._feature.type===1){let e=[];for(let r of this._feature.geometry)e.push([new Nl.default(r[0],r[1])]);return e}else{let e=[];for(let r of this._feature.geometry){let n=[];for(let i of r)n.push(new Nl.default(i[0],i[1]));e.push(n)}return e}}toGeoJSON(e,r,n){return Hb.call(this,e,r,n)}},Ka=class{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=8192,this.length=e.length,this._features=e}feature(e){return new Ul(this._features[e])}};var Wy=Y(ky(),1);var Fy=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ql=1,Bi=8,Ri=class t{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[r,n]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");let i=n>>4;if(i!==ql)throw new Error("Got v".concat(i," data when expected v").concat(ql,"."));let o=Fy[n&15];if(!o)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new t(s,a,o,e)}constructor(e,r=64,n=Float64Array,i){if(isNaN(e)||e<0)throw new Error("Unpexpected numItems value: ".concat(e,"."));this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let o=Fy.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-s%8)%8;if(o<0)throw new Error("Unexpected typed array class: ".concat(n,"."));i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,Bi,e),this.coords=new this.ArrayType(this.data,Bi+s+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Bi+a+s+l),this.ids=new this.IndexArrayType(this.data,Bi,e),this.coords=new this.ArrayType(this.data,Bi+s+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ql<<4)+o]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=r,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error("Added ".concat(e," items when expected ").concat(this.numItems,"."));return Xl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:a,nodeSize:s}=this,l=[0,o.length-1,0],u=[];for(;l.length;){let c=l.pop()||0,p=l.pop()||0,f=l.pop()||0;if(p-f<=s){for(let g=f;g<=p;g++){let d=a[2*g],b=a[2*g+1];d>=e&&d<=n&&b>=r&&b<=i&&u.push(o[g])}continue}let y=f+p>>1,m=a[2*y],h=a[2*y+1];m>=e&&m<=n&&h>=r&&h<=i&&u.push(o[y]),(c===0?e<=m:r<=h)&&(l.push(f),l.push(y-1),l.push(1-c)),(c===0?n>=m:i>=h)&&(l.push(y+1),l.push(p),l.push(1-c))}return u}within(e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:i,coords:o,nodeSize:a}=this,s=[0,i.length-1,0],l=[],u=n*n;for(;s.length;){let c=s.pop()||0,p=s.pop()||0,f=s.pop()||0;if(p-f<=a){for(let g=f;g<=p;g++)Ey(o[2*g],o[2*g+1],e,r)<=u&&l.push(i[g]);continue}let y=f+p>>1,m=o[2*y],h=o[2*y+1];Ey(m,h,e,r)<=u&&l.push(i[y]),(c===0?e-n<=m:r-n<=h)&&(s.push(f),s.push(y-1),s.push(1-c)),(c===0?e+n>=m:r+n>=h)&&(s.push(y+1),s.push(p),s.push(1-c))}return l}};function Xl(t,e,r,n,i,o){if(i-n<=r)return;let a=n+i>>1;My(t,e,a,n,i,o),Xl(t,e,r,n,a-1,1-o),Xl(t,e,r,a+1,i,1-o)}function My(t,e,r,n,i,o){for(;i>n;){if(i-n>600){let u=i-n+1,c=r-n+1,p=Math.log(u),f=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*f*(u-f)/u)*(c-u/2<0?-1:1),m=Math.max(n,Math.floor(r-c*f/u+y)),h=Math.min(i,Math.floor(r+(u-c)*f/u+y));My(t,e,r,m,h,o)}let a=e[2*r+o],s=n,l=i;for(Vi(t,e,n,r),e[2*i+o]>a&&Vi(t,e,n,i);s<l;){for(Vi(t,e,s,l),s++,l--;e[2*s+o]<a;)s++;for(;e[2*l+o]>a;)l--}e[2*n+o]===a?Vi(t,e,n,l):(l++,Vi(t,e,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function Vi(t,e,r,n){Wl(t,r,n),Wl(e,2*r,2*n),Wl(e,2*r+1,2*n+1)}function Wl(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function Ey(t,e,r,n){let i=t-r,o=e-n;return i*i+o*o}var o0={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},Ly=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),hr=2,Nt=3,Hl=4,Gt=5,By=6,zi=class{constructor(e){this.options=Object.assign(Object.create(o0),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:r,minZoom:n,maxZoom:i}=this.options;r&&console.time("total time");let o="prepare ".concat(e.length," points");r&&console.time(o),this.points=e;let a=[];for(let l=0;l<e.length;l++){let u=e[l];if(!u.geometry)continue;let[c,p]=u.geometry.coordinates,f=Ly(es(c)),y=Ly(ts(p));a.push(f,y,1/0,l,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[i+1]=this._createTree(a);r&&console.timeEnd(o);for(let l=i;l>=n;l--){let u=+Date.now();s=this.trees[l]=this._createTree(this._cluster(s,l)),r&&console.log("z%d: %d clusters in %dms",l,s.numItems,+Date.now()-u)}return r&&console.timeEnd("total time"),this}getClusters(e,r){let n=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),o=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,o=180;else if(n>o){let p=this.getClusters([n,i,180,a],r),f=this.getClusters([-180,i,o,a],r);return p.concat(f)}let s=this.trees[this._limitZoom(r)],l=s.range(es(n),ts(a),es(o),ts(i)),u=s.data,c=[];for(let p of l){let f=this.stride*p;c.push(u[f+Gt]>1?Dy(u,f,this.clusterProps):this.points[u[f+Nt]])}return c}getChildren(e){let r=this._getOriginId(e),n=this._getOriginZoom(e),i="No cluster with the specified id.",o=this.trees[n];if(!o)throw new Error(i);let a=o.data;if(r*this.stride>=a.length)throw new Error(i);let s=this.options.radius/(this.options.extent*Math.pow(2,n-1)),l=a[r*this.stride],u=a[r*this.stride+1],c=o.within(l,u,s),p=[];for(let f of c){let y=f*this.stride;a[y+Hl]===e&&p.push(a[y+Gt]>1?Dy(a,y,this.clusterProps):this.points[a[y+Nt]])}if(p.length===0)throw new Error(i);return p}getLeaves(e,r,n){r=r||10,n=n||0;let i=[];return this._appendLeaves(i,e,r,n,0),i}getTile(e,r,n){let i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:a,radius:s}=this.options,l=s/a,u=(n-l)/o,c=(n+1+l)/o,p={features:[]};return this._addTileFeatures(i.range((r-l)/o,u,(r+1+l)/o,c),i.data,r,n,o,p),r===0&&this._addTileFeatures(i.range(1-l/o,u,1,c),i.data,o,n,o,p),r===o-1&&this._addTileFeatures(i.range(0,u,l/o,c),i.data,-1,n,o,p),p.features.length?p:null}getClusterExpansionZoom(e){let r=this._getOriginZoom(e)-1;for(;r<=this.options.maxZoom;){let n=this.getChildren(e);if(r++,n.length!==1)break;e=n[0].properties.cluster_id}return r}_appendLeaves(e,r,n,i,o){let a=this.getChildren(r);for(let s of a){let l=s.properties;if(l&&l.cluster?o+l.point_count<=i?o+=l.point_count:o=this._appendLeaves(e,l.cluster_id,n,i,o):o<i?o++:e.push(s),e.length===n)break}return o}_createTree(e){let r=new Ri(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)r.add(e[n],e[n+1]);return r.finish(),r.data=e,r}_addTileFeatures(e,r,n,i,o,a){for(let s of e){let l=s*this.stride,u=r[l+Gt]>1,c,p,f;if(u)c=Vy(r,l,this.clusterProps),p=r[l],f=r[l+1];else{let h=this.points[r[l+Nt]];c=h.properties;let[g,d]=h.geometry.coordinates;p=es(g),f=ts(d)}let y={type:1,geometry:[[Math.round(this.options.extent*(p*o-n)),Math.round(this.options.extent*(f*o-i))]],tags:c},m;u||this.options.generateId?m=r[l+Nt]:m=this.points[r[l+Nt]].id,m!==void 0&&(y.id=m),a.features.push(y)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,r){let{radius:n,extent:i,reduce:o,minPoints:a}=this.options,s=n/(i*Math.pow(2,r)),l=e.data,u=[],c=this.stride;for(let p=0;p<l.length;p+=c){if(l[p+hr]<=r)continue;l[p+hr]=r;let f=l[p],y=l[p+1],m=e.within(l[p],l[p+1],s),h=l[p+Gt],g=h;for(let d of m){let b=d*c;l[b+hr]>r&&(g+=l[b+Gt])}if(g>h&&g>=a){let d=f*h,b=y*h,x,v=-1,S=((p/c|0)<<5)+(r+1)+this.points.length;for(let A of m){let w=A*c;if(l[w+hr]<=r)continue;l[w+hr]=r;let T=l[w+Gt];d+=l[w]*T,b+=l[w+1]*T,l[w+Hl]=S,o&&(x||(x=this._map(l,p,!0),v=this.clusterProps.length,this.clusterProps.push(x)),o(x,this._map(l,w)))}l[p+Hl]=S,u.push(d/g,b/g,1/0,S,-1,g),o&&u.push(v)}else{for(let d=0;d<c;d++)u.push(l[p+d]);if(g>1)for(let d of m){let b=d*c;if(!(l[b+hr]<=r)){l[b+hr]=r;for(let x=0;x<c;x++)u.push(l[b+x])}}}}return u}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,r,n){if(e[r+Gt]>1){let a=this.clusterProps[e[r+By]];return n?Object.assign({},a):a}let i=this.points[e[r+Nt]].properties,o=this.options.map(i);return n&&o===i?Object.assign({},o):o}};function Dy(t,e,r){return{type:"Feature",id:t[e+Nt],properties:Vy(t,e,r),geometry:{type:"Point",coordinates:[a0(t[e]),s0(t[e+1])]}}}function Vy(t,e,r){let n=t[e+Gt],i=n>=1e4?"".concat(Math.round(n/1e3),"k"):n>=1e3?"".concat(Math.round(n/100)/10,"k"):n,o=t[e+By],a=o===-1?{}:Object.assign({},r[o]);return Object.assign(a,{cluster:!0,cluster_id:t[e+Nt],point_count:n,point_count_abbreviated:i})}function es(t){return t/360+.5}function ts(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function a0(t){return(t-.5)*360}function s0(t){let e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function Oi(t,e,r,n){let i=n,o=e+(r-e>>1),a=r-e,s,l=t[e],u=t[e+1],c=t[r],p=t[r+1];for(let f=e+3;f<r;f+=3){let y=l0(t[f],t[f+1],l,u,c,p);if(y>i)s=f,i=y;else if(y===i){let m=Math.abs(f-o);m<a&&(s=f,a=m)}}i>n&&(s-e>3&&Oi(t,e,s,n),t[s+2]=i,r-s>3&&Oi(t,s,r,n))}function l0(t,e,r,n,i,o){let a=i-r,s=o-n;if(a!==0||s!==0){let l=((t-r)*a+(e-n)*s)/(a*a+s*s);l>1?(r=i,n=o):l>0&&(r+=a*l,n+=s*l)}return a=t-r,s=e-n,a*a+s*s}function dt(t,e,r,n){let i={id:t==null?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(e==="Point"||e==="MultiPoint"||e==="LineString")rs(i,r);else if(e==="Polygon")rs(i,r[0]);else if(e==="MultiLineString")for(let o of r)rs(i,o);else if(e==="MultiPolygon")for(let o of r)rs(i,o[0]);return i}function rs(t,e){for(let r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function Yl(t,e){let r=[];if(t.type==="FeatureCollection")for(let n=0;n<t.features.length;n++)ns(r,t.features[n],e,n);else t.type==="Feature"?ns(r,t,e):ns(r,{geometry:t},e);return r}function ns(t,e,r,n){if(!e.geometry)return;let i=e.geometry.coordinates;if(i&&i.length===0)return;let o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=n||0),o==="Point")Ry(i,s);else if(o==="MultiPoint")for(let u of i)Ry(u,s);else if(o==="LineString")Jl(i,s,a,!1);else if(o==="MultiLineString")if(r.lineMetrics){for(let u of i)s=[],Jl(u,s,a,!1),t.push(dt(l,"LineString",s,e.properties));return}else Zl(i,s,a,!1);else if(o==="Polygon")Zl(i,s,a,!0);else if(o==="MultiPolygon")for(let u of i){let c=[];Zl(u,c,a,!0),s.push(c)}else if(o==="GeometryCollection"){for(let u of e.geometry.geometries)ns(t,{id:l,geometry:u,properties:e.properties},r,n);return}else throw new Error("Input data is not a valid GeoJSON object.");t.push(dt(l,o,s,e.properties))}function Ry(t,e){e.push(zy(t[0]),Oy(t[1]),0)}function Jl(t,e,r,n){let i,o,a=0;for(let l=0;l<t.length;l++){let u=zy(t[l][0]),c=Oy(t[l][1]);e.push(u,c,0),l>0&&(n?a+=(i*c-u*o)/2:a+=Math.sqrt(Math.pow(u-i,2)+Math.pow(c-o,2))),i=u,o=c}let s=e.length-3;e[2]=1,Oi(e,0,s,r),e[s+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function Zl(t,e,r,n){for(let i=0;i<t.length;i++){let o=[];Jl(t[i],o,r,n),e.push(o)}}function zy(t){return t/360+.5}function Oy(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function Ue(t,e,r,n,i,o,a,s){if(r/=e,n/=e,o>=r&&a<n)return t;if(a<r||o>=n)return null;let l=[];for(let u of t){let c=u.geometry,p=u.type,f=i===0?u.minX:u.minY,y=i===0?u.maxX:u.maxY;if(f>=r&&y<n){l.push(u);continue}else if(y<r||f>=n)continue;let m=[];if(p==="Point"||p==="MultiPoint")u0(c,m,r,n,i);else if(p==="LineString")Ny(c,m,r,n,i,!1,s.lineMetrics);else if(p==="MultiLineString")Kl(c,m,r,n,i,!1);else if(p==="Polygon")Kl(c,m,r,n,i,!0);else if(p==="MultiPolygon")for(let h of c){let g=[];Kl(h,g,r,n,i,!0),g.length&&m.push(g)}if(m.length){if(s.lineMetrics&&p==="LineString"){for(let h of m)l.push(dt(u.id,p,h,u.tags));continue}(p==="LineString"||p==="MultiLineString")&&(m.length===1?(p="LineString",m=m[0]):p="MultiLineString"),(p==="Point"||p==="MultiPoint")&&(p=m.length===3?"Point":"MultiPoint"),l.push(dt(u.id,p,m,u.tags))}}return l.length?l:null}function u0(t,e,r,n,i){for(let o=0;o<t.length;o+=3){let a=t[o+i];a>=r&&a<=n&&Hr(e,t[o],t[o+1],t[o+2])}}function Ny(t,e,r,n,i,o,a){let s=Gy(t),l=i===0?c0:p0,u=t.start,c,p;for(let d=0;d<t.length-3;d+=3){let b=t[d],x=t[d+1],v=t[d+2],S=t[d+3],A=t[d+4],w=i===0?b:x,T=i===0?S:A,E=!1;a&&(c=Math.sqrt(Math.pow(b-S,2)+Math.pow(x-A,2))),w<r?T>r&&(p=l(s,b,x,S,A,r),a&&(s.start=u+c*p)):w>n?T<n&&(p=l(s,b,x,S,A,n),a&&(s.start=u+c*p)):Hr(s,b,x,v),T<r&&w>=r&&(p=l(s,b,x,S,A,r),E=!0),T>n&&w<=n&&(p=l(s,b,x,S,A,n),E=!0),!o&&E&&(a&&(s.end=u+c*p),e.push(s),s=Gy(t)),a&&(u+=c)}let f=t.length-3,y=t[f],m=t[f+1],h=t[f+2],g=i===0?y:m;g>=r&&g<=n&&Hr(s,y,m,h),f=s.length-3,o&&f>=3&&(s[f]!==s[0]||s[f+1]!==s[1])&&Hr(s,s[0],s[1],s[2]),s.length&&e.push(s)}function Gy(t){let e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Kl(t,e,r,n,i,o){for(let a of t)Ny(a,e,r,n,i,o,!1)}function Hr(t,e,r,n){t.push(e,r,n)}function c0(t,e,r,n,i,o){let a=(o-e)/(n-e);return Hr(t,o,r+(i-r)*a,1),a}function p0(t,e,r,n,i,o){let a=(o-r)/(i-r);return Hr(t,e+(n-e)*a,o,1),a}function eu(t,e){let r=e.buffer/e.extent,n=t,i=Ue(t,1,-1-r,r,0,-1,2,e),o=Ue(t,1,1-r,2+r,0,-1,2,e);return(i||o)&&(n=Ue(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=Uy(i,1).concat(n)),o&&(n=n.concat(Uy(o,-1)))),n}function Uy(t,e){let r=[];for(let n=0;n<t.length;n++){let i=t[n],o=i.type,a;if(o==="Point"||o==="MultiPoint"||o==="LineString")a=Ql(i.geometry,e);else if(o==="MultiLineString"||o==="Polygon"){a=[];for(let s of i.geometry)a.push(Ql(s,e))}else if(o==="MultiPolygon"){a=[];for(let s of i.geometry){let l=[];for(let u of s)l.push(Ql(u,e));a.push(l)}}r.push(dt(i.id,o,a,i.tags))}return r}function Ql(t,e){let r=[];r.size=t.size,t.start!==void 0&&(r.start=t.start,r.end=t.end);for(let n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function is(t,e){if(t.transformed)return t;let r=1<<t.z,n=t.x,i=t.y;for(let o of t.features){let a=o.geometry,s=o.type;if(o.geometry=[],s===1)for(let l=0;l<a.length;l+=2)o.geometry.push($y(a[l],a[l+1],e,r,n,i));else for(let l=0;l<a.length;l++){let u=[];for(let c=0;c<a[l].length;c+=2)u.push($y(a[l][c],a[l][c+1],e,r,n,i));o.geometry.push(u)}}return t.transformed=!0,t}function $y(t,e,r,n,i,o){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-o))]}function ru(t,e,r,n,i){let o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let s of t)f0(a,s,o,i);return a}function f0(t,e,r,n){let i=e.geometry,o=e.type,a=[];if(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),o==="Point"||o==="MultiPoint")for(let s=0;s<i.length;s+=3)a.push(i[s],i[s+1]),t.numPoints++,t.numSimplified++;else if(o==="LineString")tu(a,i,t,r,!1,!1);else if(o==="MultiLineString"||o==="Polygon")for(let s=0;s<i.length;s++)tu(a,i[s],t,r,o==="Polygon",s===0);else if(o==="MultiPolygon")for(let s=0;s<i.length;s++){let l=i[s];for(let u=0;u<l.length;u++)tu(a,l[u],t,r,!0,u===0)}if(a.length){let s=e.tags||null;if(o==="LineString"&&n.lineMetrics){s={};for(let u in e.tags)s[u]=e.tags[u];s.mapbox_clip_start=i.start/i.size,s.mapbox_clip_end=i.end/i.size}let l={geometry:a,type:o==="Polygon"||o==="MultiPolygon"?3:o==="LineString"||o==="MultiLineString"?2:1,tags:s};e.id!==null&&(l.id=e.id),t.features.push(l)}}function tu(t,e,r,n,i,o){let a=n*n;if(n>0&&e.size<(i?a:n)){r.numPoints+=e.length/3;return}let s=[];for(let l=0;l<e.length;l+=3)(n===0||e[l+2]>a)&&(r.numSimplified++,s.push(e[l],e[l+1])),r.numPoints++;i&&y0(s,o),t.push(s)}function y0(t,e){let r=0;for(let n=0,i=t.length,o=i-2;n<i;o=n,n+=2)r+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(r>0===e)for(let n=0,i=t.length;n<i/2;n+=2){let o=t[n],a=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=o,t[i-1-n]=a}}var m0={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},iu=class{constructor(e,r){r=this.options=h0(Object.create(m0),r);let n=r.debug;if(n&&console.time("preprocess data"),r.maxZoom<0||r.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(r.promoteId&&r.generateId)throw new Error("promoteId and generateId cannot be used together.");let i=Yl(e,r);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",r.indexMaxZoom,r.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=eu(i,r),i.length&&this.splitTile(i,0,0,0),n&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(e,r,n,i,o,a,s){let l=[e,r,n,i],u=this.options,c=u.debug;for(;l.length;){i=l.pop(),n=l.pop(),r=l.pop(),e=l.pop();let p=1<<r,f=nu(r,n,i),y=this.tiles[f];if(!y&&(c>1&&console.time("creation"),y=this.tiles[f]=ru(e,r,n,i,u),this.tileCoords.push({z:r,x:n,y:i}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",r,n,i,y.numFeatures,y.numPoints,y.numSimplified),console.timeEnd("creation"));let T="z".concat(r);this.stats[T]=(this.stats[T]||0)+1,this.total++}if(y.source=e,o==null){if(r===u.indexMaxZoom||y.numPoints<=u.indexMaxPoints)continue}else{if(r===u.maxZoom||r===o)continue;if(o!=null){let T=o-r;if(n!==a>>T||i!==s>>T)continue}}if(y.source=null,e.length===0)continue;c>1&&console.time("clipping");let m=.5*u.buffer/u.extent,h=.5-m,g=.5+m,d=1+m,b=null,x=null,v=null,S=null,A=Ue(e,p,n-m,n+g,0,y.minX,y.maxX,u),w=Ue(e,p,n+h,n+d,0,y.minX,y.maxX,u);e=null,A&&(b=Ue(A,p,i-m,i+g,1,y.minY,y.maxY,u),x=Ue(A,p,i+h,i+d,1,y.minY,y.maxY,u),A=null),w&&(v=Ue(w,p,i-m,i+g,1,y.minY,y.maxY,u),S=Ue(w,p,i+h,i+d,1,y.minY,y.maxY,u),w=null),c>1&&console.timeEnd("clipping"),l.push(b||[],r+1,n*2,i*2),l.push(x||[],r+1,n*2,i*2+1),l.push(v||[],r+1,n*2+1,i*2),l.push(S||[],r+1,n*2+1,i*2+1)}}getTile(e,r,n){e=+e,r=+r,n=+n;let i=this.options,{extent:o,debug:a}=i;if(e<0||e>24)return null;let s=1<<e;r=r+s&s-1;let l=nu(e,r,n);if(this.tiles[l])return is(this.tiles[l],o);a>1&&console.log("drilling down to z%d-%d-%d",e,r,n);let u=e,c=r,p=n,f;for(;!f&&u>0;)u--,c=c>>1,p=p>>1,f=this.tiles[nu(u,c,p)];return!f||!f.source?null:(a>1&&(console.log("found parent tile z%d-%d-%d",u,c,p),console.time("drilling down")),this.splitTile(f.source,u,c,p,e,r,n),a>1&&console.timeEnd("drilling down"),this.tiles[l]?is(this.tiles[l],o):null)}};function nu(t,e,r){return((1<<t)*r+e)*32+t}function h0(t,e){for(let r in e)t[r]=e[r];return t}function ou(t,e){return new iu(t,e)}function Gi(t,e){return e?t.properties[e]:t.id}function au(t,e){if(t==null)return!0;if(t.type==="Feature")return Gi(t,e)!=null;if(t.type==="FeatureCollection"){let r=new Set;for(let n of t.features){let i=Gi(n,e);if(i==null||r.has(i))return!1;r.add(i)}return!0}return!1}function su(t,e){let r=new Map;if(t!=null)if(t.type==="Feature")r.set(Gi(t,e),t);else for(let n of t.features)r.set(Gi(n,e),n);return r}function jy(t,e,r){var n,i,o,a;if(e.removeAll&&t.clear(),e.remove)for(let s of e.remove)t.delete(s);if(e.add)for(let s of e.add){let l=Gi(s,r);l!=null&&t.set(l,s)}if(e.update)for(let s of e.update){let l=t.get(s.id);if(l==null)continue;let u=s.newGeometry||s.removeAllProperties,c=!s.removeAllProperties&&(((n=s.removeProperties)==null?void 0:n.length)>0||((i=s.addOrUpdateProperties)==null?void 0:i.length)>0);if((u||c)&&(l=$t({},l),t.set(s.id,l),c&&(l.properties=$t({},l.properties))),s.newGeometry&&(l.geometry=s.newGeometry),s.removeAllProperties)l.properties={};else if(((o=s.removeProperties)==null?void 0:o.length)>0)for(let p of s.removeProperties)Object.prototype.hasOwnProperty.call(l.properties,p)&&delete l.properties[p];if(((a=s.addOrUpdateProperties)==null?void 0:a.length)>0)for(let{key:p,value:f}of s.addOrUpdateProperties)l.properties[p]=f}}var os=class extends Xr{constructor(){super(...arguments);this._dataUpdateable=new Map}async loadVectorTile(r,n){let i=r.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let o=this._geoJSONIndex.getTile(i.z,i.x,i.y);if(!o)return null;let a=new Ka(o.features),s=(0,Wy.default)(a);return(s.byteOffset!==0||s.byteLength!==s.buffer.byteLength)&&(s=new Uint8Array(s)),{vectorTile:a,rawData:s.buffer}}async loadData(r){var i;(i=this._pendingRequest)==null||i.abort();let n=r&&r.request&&r.request.collectResourceTiming?new Wr(r.request):!1;this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(r,this._pendingRequest),this._geoJSONIndex=r.cluster?new zi(d0(r)).load((await this._pendingData).features):ou(await this._pendingData,r.geojsonVtOptions),this.loaded={};let o={};if(n){let a=n.finish();a&&(o.resourceTiming={},o.resourceTiming[r.source]=JSON.parse(JSON.stringify(a)))}return o}catch(o){if(delete this._pendingRequest,zc(o))return{abandoned:!0};throw o}}async getData(){return this._pendingData}reloadTile(r){let n=this.loaded,i=r.uid;return n&&n[i]?super.reloadTile(r):this.loadTile(r)}async loadAndProcessGeoJSON(r,n){let i=await this.loadGeoJSON(r,n);if(delete this._pendingRequest,typeof i!="object")throw new Error("Input data given to \'".concat(r.source,"\' is not a valid GeoJSON object."));if((0,qy.default)(i,!0),r.filter){let o=er(r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(o.result==="error")throw new Error(o.value.map(s=>"".concat(s.key,": ").concat(s.message)).join(", "));i={type:"FeatureCollection",features:i.features.filter(s=>o.value.evaluate({zoom:0},s))}}return i}async loadGeoJSON(r,n){let{promoteId:i}=r;if(r.request){let o=await Wc(r.request,n);return this._dataUpdateable=au(o.data,i)?su(o.data,i):void 0,o.data}if(typeof r.data=="string")try{let o=JSON.parse(r.data);return this._dataUpdateable=au(o,i)?su(o,i):void 0,o}catch(o){throw new Error("Input data given to \'".concat(r.source,"\' is not a valid GeoJSON object."))}if(!r.dataDiff)throw new Error("Input data given to \'".concat(r.source,"\' is not a valid GeoJSON object."));if(!this._dataUpdateable)throw new Error("Cannot update existing geojson data in ".concat(r.source));return jy(this._dataUpdateable,r.dataDiff,i),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}async removeSource(r){this._pendingRequest&&this._pendingRequest.abort()}getClusterExpansionZoom(r){return this._geoJSONIndex.getClusterExpansionZoom(r.clusterId)}getClusterChildren(r){return this._geoJSONIndex.getChildren(r.clusterId)}getClusterLeaves(r){return this._geoJSONIndex.getLeaves(r.clusterId,r.limit,r.offset)}};function d0({superclusterOptions:t,clusterProperties:e}){if(!e||!t)return t;let r={},n={},i={accumulated:null,zoom:0},o={properties:null},a=Object.keys(e);for(let s of a){let[l,u]=e[s],c=er(u),p=er(typeof l=="string"?[l,["accumulated"],["get",s]]:l);r[s]=c.value,n[s]=p.value}return t.map=s=>{o.properties=s;let l={};for(let u of a)l[u]=r[u].evaluate(i,o);return l},t.reduce=(s,l)=>{o.properties=l;for(let u of a)i.accumulated=s[u],s[u]=n[u].evaluate(i,o)},t}var as=class{constructor(e){this.self=e,this.actor=new Eo(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(r,n)=>{if(this.externalWorkerSourceTypes[r])throw new Error(\'Worker source with name "\'.concat(r,\'" already registered.\'));this.externalWorkerSourceTypes[r]=n},this.self.addProtocol=Gc,this.self.removeProtocol=Nc,this.self.registerRTLTextPlugin=r=>{we.setMethods(r)},this.actor.registerMessageHandler("LDT",(r,n)=>this._getDEMWorkerSource(r,n.source).loadTile(n)),this.actor.registerMessageHandler("RDT",async(r,n)=>{this._getDEMWorkerSource(r,n.source).removeTile(n)}),this.actor.registerMessageHandler("GCEZ",async(r,n)=>this._getWorkerSource(r,n.type,n.source).getClusterExpansionZoom(n)),this.actor.registerMessageHandler("GCC",async(r,n)=>this._getWorkerSource(r,n.type,n.source).getClusterChildren(n)),this.actor.registerMessageHandler("GCL",async(r,n)=>this._getWorkerSource(r,n.type,n.source).getClusterLeaves(n)),this.actor.registerMessageHandler("LD",(r,n)=>this._getWorkerSource(r,n.type,n.source).loadData(n)),this.actor.registerMessageHandler("GD",(r,n)=>this._getWorkerSource(r,n.type,n.source).getData()),this.actor.registerMessageHandler("LT",(r,n)=>this._getWorkerSource(r,n.type,n.source).loadTile(n)),this.actor.registerMessageHandler("RT",(r,n)=>this._getWorkerSource(r,n.type,n.source).reloadTile(n)),this.actor.registerMessageHandler("AT",(r,n)=>this._getWorkerSource(r,n.type,n.source).abortTile(n)),this.actor.registerMessageHandler("RMT",(r,n)=>this._getWorkerSource(r,n.type,n.source).removeTile(n)),this.actor.registerMessageHandler("RS",async(r,n)=>{if(!this.workerSources[r]||!this.workerSources[r][n.type]||!this.workerSources[r][n.type][n.source])return;let i=this.workerSources[r][n.type][n.source];delete this.workerSources[r][n.type][n.source],i.removeSource!==void 0&&i.removeSource(n)}),this.actor.registerMessageHandler("RM",async r=>{delete this.layerIndexes[r],delete this.availableImages[r],delete this.workerSources[r],delete this.demWorkerSources[r]}),this.actor.registerMessageHandler("SR",async(r,n)=>{this.referrer=n}),this.actor.registerMessageHandler("SRPS",(r,n)=>this._syncRTLPluginState(r,n)),this.actor.registerMessageHandler("IS",async(r,n)=>{this.self.importScripts(n)}),this.actor.registerMessageHandler("SI",(r,n)=>this._setImages(r,n)),this.actor.registerMessageHandler("UL",async(r,n)=>{this._getLayerIndex(r).update(n.layers,n.removedIds)}),this.actor.registerMessageHandler("SL",async(r,n)=>{this._getLayerIndex(r).replace(n)})}async _setImages(e,r){this.availableImages[e]=r;for(let n in this.workerSources[e]){let i=this.workerSources[e][n];for(let o in i)i[o].availableImages=r}}async _syncRTLPluginState(e,r){return await we.syncState(r,this.self.importScripts)}_getAvailableImages(e){let r=this.availableImages[e];return r||(r=[]),r}_getLayerIndex(e){let r=this.layerIndexes[e];return r||(r=this.layerIndexes[e]=new Na),r}_getWorkerSource(e,r,n){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][r]||(this.workerSources[e][r]={}),!this.workerSources[e][r][n]){let i={sendAsync:(o,a)=>(o.targetMapId=e,this.actor.sendAsync(o,a))};switch(r){case"vector":this.workerSources[e][r][n]=new Xr(i,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][r][n]=new os(i,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][r][n]=new this.externalWorkerSourceTypes[r](i,this._getLayerIndex(e),this._getAvailableImages(e));break}}return this.workerSources[e][r][n]}_getDEMWorkerSource(e,r){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][r]||(this.demWorkerSources[e][r]=new Ja),this.demWorkerSources[e][r]}};at(self)&&(self.worker=new as(self));})();\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n*/\n';var pO=s(()=>kt.WORKER_URL?kt.WORKER_URL:URL.createObjectURL(new Blob([ES],{type:"text/javascript"})),"getWorkerURL");function kS(){return new Worker(pO())}s(kS,"workerFactory");var LS="maplibre_preloaded_worker_pool",Gc=class Gc{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<Gc.workerCount;)this.workers.push(kS());return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.numActive()===0&&(this.workers.forEach(r=>{r.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[LS]}numActive(){return Object.keys(this.active).length}};s(Gc,"WorkerPool");var oo=Gc,mO=Math.floor(xe.hardwareConcurrency/2);oo.workerCount=lP(globalThis)?Math.max(Math.min(mO,3),1):1;var Ay;function Ey(){return Ay||(Ay=new oo),Ay}s(Ey,"getGlobalWorkerPool");var Ly=class Ly{constructor(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=r;let i=this.workerPool.acquire(r);for(let n=0;n<i.length;n++){let o=i[n],a=new jc(o,r);a.name="Worker ".concat(n),this.actors.push(a)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,r){let i=[];for(let n of this.actors)i.push(n.sendAsync({type:e,data:r}));return Promise.all(i)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach(r=>{r.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,r){for(let i of this.actors)i.registerMessageHandler(e,r)}};s(Ly,"Dispatcher");var Xc=Ly,Zc;function ky(){return Zc||(Zc=new Xc(Ey(),Kl),Zc.registerMessageHandler("GR",(t,e,r)=>Ii(e,r))),Zc}s(ky,"getGlobalDispatcher");m();m();m();m();m();async function Hc(t,e,r){let i=t;if(t.url?i=(await Zo(e.transformRequest(t.url,"Source"),r)).data:await xe.frameAsync(r),!i)return null;let n=Qr(W(i,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in i&&i.vector_layers&&(n.vectorLayerIds=i.vector_layers.map(o=>o.id)),n}s(Hc,"loadTileJson");m();m();m();var ao=63710088e-1,Jn=class Jn{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid LngLat object: (".concat(e,", ").concat(r,")"));if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Jn(Si(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}distanceTo(e){let r=Math.PI/180,i=this.lat*r,n=e.lat*r,o=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*r);return ao*Math.acos(Math.min(o,1))}static convert(e){if(e instanceof Jn)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Jn(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Jn(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}};s(Jn,"LngLat");var ne=Jn;var Tr=class Tr{constructor(e,r){e&&(r?this.setSouthWest(e).setNorthEast(r):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof ne?new ne(e.lng,e.lat):ne.convert(e),this}setSouthWest(e){return this._sw=e instanceof ne?new ne(e.lng,e.lat):ne.convert(e),this}extend(e){let r=this._sw,i=this._ne,n,o;if(e instanceof ne)n=e,o=e;else if(e instanceof Tr){if(n=e._sw,o=e._ne,!n||!o)return this}else{if(Array.isArray(e))if(e.length===4||e.every(Array.isArray)){let a=e;return this.extend(Tr.convert(a))}else{let a=e;return this.extend(ne.convert(a))}else if(e&&("lng"in e||"lon"in e)&&"lat"in e)return this.extend(ne.convert(e));return this}return!r&&!i?(this._sw=new ne(n.lng,n.lat),this._ne=new ne(o.lng,o.lat)):(r.lng=Math.min(n.lng,r.lng),r.lat=Math.min(n.lat,r.lat),i.lng=Math.max(o.lng,i.lng),i.lat=Math.max(o.lat,i.lat)),this}getCenter(){return new ne((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new ne(this.getWest(),this.getNorth())}getSouthEast(){return new ne(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return"LngLatBounds(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")}isEmpty(){return!(this._sw&&this._ne)}contains(e){let{lng:r,lat:i}=ne.convert(e),n=this._sw.lat<=i&&i<=this._ne.lat,o=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=r&&r>=this._ne.lng),n&&o}static convert(e){return e instanceof Tr||!e?e:new Tr(e)}static fromLngLat(e,r=0){let n=360*r/40075017,o=n/Math.cos(Math.PI/180*e.lat);return new Tr(new ne(e.lng-o,e.lat-n),new ne(e.lng+o,e.lat+n))}adjustAntiMeridian(){let e=new ne(this._sw.lng,this._sw.lat),r=new ne(this._ne.lng,this._ne.lat);return e.lng>r.lng?new Tr(e,new ne(r.lng+360,r.lat)):new Tr(e,r)}};s(Tr,"LngLatBounds");var ut=Tr;m();var DS=2*Math.PI*ao;function zS(t){return DS*Math.cos(t*Math.PI/180)}s(zS,"circumferenceAtLatitude");function so(t){return(180+t)/360}s(so,"mercatorXfromLng");function Kn(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}s(Kn,"mercatorYfromLat");function Wc(t,e){return t/zS(e)}s(Wc,"mercatorZfromAltitude");function fO(t){return t*360-180}s(fO,"lngFromMercatorX");function Dy(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}s(Dy,"latFromMercatorY");function OS(t,e){return t*zS(Dy(e))}s(OS,"altitudeFromMercatorZ");function hO(t){return 1/Math.cos(t*Math.PI/180)}s(hO,"mercatorScale");var qc=class qc{constructor(e,r,i=0){this.x=+e,this.y=+r,this.z=+i}static fromLngLat(e,r=0){let i=ne.convert(e);return new qc(so(i.lng),Kn(i.lat),Wc(r,i.lat))}toLngLat(){return new ne(fO(this.x),Dy(this.y))}toAltitude(){return OS(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/DS*hO(Dy(this.y))}};s(qc,"MercatorCoordinate");var Je=qc;var zy=class zy{constructor(e,r,i){this.bounds=ut.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=i||24}validateBounds(e){return!Array.isArray(e)||e.length!==4?[-180,-90,180,90]:[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]}contains(e){let r=Math.pow(2,e.z),i={minX:Math.floor(so(this.bounds.getWest())*r),minY:Math.floor(Kn(this.bounds.getNorth())*r),maxX:Math.ceil(so(this.bounds.getEast())*r),maxY:Math.ceil(Kn(this.bounds.getSouth())*r)};return e.x>=i.minX&&e.x<i.maxX&&e.y>=i.minY&&e.y<i.maxY}};s(zy,"TileBounds");var lo=zy;var Oy=class Oy extends we{constructor(e,r,i,n){if(super(),this.id=e,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,W(this,Qr(r,["url","scheme","tileSize","promoteId"])),this._options=W({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n)}async load(){this._loaded=!1,this.fire(new Q("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let e=await Hc(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),e&&(W(this,e),e.bounds&&(this.tileBounds=new lo(e.bounds,this.minzoom,this.maxzoom)),this.fire(new Q("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new Q("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new Pe(e))}}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return W({},this._options)}async loadTile(e){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i={request:this.map._requestManager.transformRequest(r,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,globalState:this.map.getGlobalState()};i.request.collectResourceTiming=this._collectResourceTiming;let n="RT";if(!e.actor||e.state==="expired")e.actor=this.dispatcher.getActor(),n="LT";else if(e.state==="loading")return new Promise((o,a)=>{e.reloadPromise={resolve:o,reject:a}});e.abortController=new AbortController;try{let o=await e.actor.sendAsync({type:n,data:i},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,o)}catch(o){if(delete e.abortController,e.aborted)return;if(o&&o.status!==404)throw o;this._afterTileLoadWorkerResponse(e,null)}}_afterTileLoadWorkerResponse(e,r){if(r&&r.resourceTiming&&(e.resourceTiming=r.resourceTiming),r&&this.map._refreshExpiredTiles&&e.setExpiryData(r),e.loadVectorData(r,this.map.painter),e.reloadPromise){let i=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(i.resolve).catch(i.reject)}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&await e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}})}async unloadTile(e){e.unloadVectorData(),e.actor&&await e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})}hasTransition(){return!1}};s(Oy,"VectorTileSource");var cs=Oy;m();var Ry=class Ry extends we{constructor(e,r,i,n){super(),this.id=e,this.dispatcher=i,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=W({type:"raster"},r),W(this,Qr(r,["url","scheme","tileSize"]))}async load(e=!1){this._loaded=!1,this.fire(new Q("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let r=await Hc(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,r&&(W(this,r),r.bounds&&(this.tileBounds=new lo(r.bounds,this.minzoom,this.maxzoom)),this.fire(new Q("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new Q("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:e})))}catch(r){this._tileJSONRequest=null,this.fire(new Pe(r))}}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load(!0)}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return W({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}async loadTile(e){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{let i=await Kt.getImage(this.map._requestManager.transformRequest(r,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted){e.state="unloaded";return}if(i&&i.data){this.map._refreshExpiredTiles&&(i.cacheControl||i.expires)&&e.setExpiryData({cacheControl:i.cacheControl,expires:i.expires});let n=this.map.painter.context,o=n.gl,a=i.data;e.texture=this.map.painter.getTileTexture(a.width),e.texture?e.texture.update(a,{useMipmap:!0}):(e.texture=new Ge(n,a,o.RGBA,{useMipmap:!0}),e.texture.bind(o.LINEAR,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(i){if(delete e.abortController,e.aborted)e.state="unloaded";else if(i)throw e.state="errored",i}}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController)}async unloadTile(e){e.texture&&this.map.painter.saveTileTexture(e.texture)}hasTransition(){return!1}};s(Ry,"RasterTileSource");var Qn=Ry;m();m();m();function FS(t,e,r){e=Math.pow(2,r)-e-1;var i=RS(t*256,e*256,r),n=RS((t+1)*256,(e+1)*256,r);return i[0]+","+i[1]+","+n[0]+","+n[1]}s(FS,"getTileBBox");function RS(t,e,r){var i=2*Math.PI*6378137/256/Math.pow(2,r),n=t*i-2*Math.PI*6378137/2,o=e*i-2*Math.PI*6378137/2;return[n,o]}s(RS,"getMercCoords");var US=J(te(),1);m();function BS(t,e,r){return!(t<Wl||t>Ti||r<0||r>=Math.pow(2,t)||e<0||e>=Math.pow(2,t))}s(BS,"isInBoundsForTileZoomXY");var Fy=class Fy{constructor(e,r,i){if(!BS(e,r,i))throw new Error("x=".concat(r,", y=").concat(i,", z=").concat(e," outside of bounds. 0<=x<").concat(Math.pow(2,e),", 0<=y<").concat(Math.pow(2,e)," ").concat(Wl,"<=z<=").concat(Ti," "));this.z=e,this.x=r,this.y=i,this.key=uo(0,e,e,r,i)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,i){let n=FS(this.x,this.y,this.z),o=dO(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(i==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,o).replace(/{bbox-epsg-3857}/g,n)}isChildOf(e){let r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){let r=Math.pow(2,this.z);return new US.default((e.x*r-this.x)*8192,(e.y*r-this.y)*8192)}toString(){return"".concat(this.z,"/").concat(this.x,"/").concat(this.y)}};s(Fy,"CanonicalTileID");var ei=Fy,By=class By{constructor(e,r){this.wrap=e,this.canonical=r,this.key=uo(e,r.z,r.z,r.x,r.y)}};s(By,"UnwrappedTileID");var ps=By,Rt=class Rt{constructor(e,r,i,n,o){this.terrainRttPosMatrix32f=null;if(e<i)throw new Error("overscaledZ should be >= z; overscaledZ = ".concat(e,"; z = ").concat(i));this.overscaledZ=e,this.wrap=r,this.canonical=new ei(i,+n,+o),this.key=uo(r,e,i,n,o)}clone(){return new Rt(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(e,"; overscaledZ = ").concat(this.overscaledZ));let r=this.canonical.z-e;return e>this.canonical.z?new Rt(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Rt(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(e,"; overscaledZ = ").concat(this.overscaledZ));let i=this.canonical.z-e;return e>this.canonical.z?uo(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):uo(this.wrap*+r,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new Rt(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new Rt(r,this.wrap,r,i,n),new Rt(r,this.wrap,r,i+1,n),new Rt(r,this.wrap,r,i,n+1),new Rt(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y}wrapped(){return new Rt(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Rt(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new ps(this.wrap,this.canonical)}toString(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}getTilePoint(e){return this.canonical.getTilePoint(new Je(e.x-this.wrap,e.y))}};s(Rt,"OverscaledTileID");var He=Rt;function uo(t,e,r,i,n){t*=2,t<0&&(t=t*-1-1);let o=1<<r;return(o*o*t+o*n+i).toString(36)+r.toString(36)+e.toString(36)}s(uo,"calculateTileKey");function dO(t,e,r){let i="",n;for(let o=t;o>0;o--)n=1<<o-1,i+=(e&n?1:0)+(r&n?2:0);return i}s(dO,"getQuadkey");B("CanonicalTileID",ei);B("OverscaledTileID",He,{omit:["terrainRttPosMatrix32f"]});var Uy=class Uy extends Qn{constructor(e,r,i,n){super(e,r,i,n),this.type="raster-dem",this.maxzoom=22,this._options=W({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}async loadTile(e){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i=this.map._requestManager.transformRequest(r,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let n=await Kt.getImage(i,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted){e.state="unloaded";return}if(n&&n.data){let o=n.data;this.map._refreshExpiredTiles&&(n.cacheControl||n.expires)&&e.setExpiryData({cacheControl:n.cacheControl,expires:n.expires});let l=Jt(o)&&Gl()?o:await this.readImageNow(o),c={type:this.type,uid:e.uid,source:this.id,rawImageData:l,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||e.state==="expired"){e.actor=this.dispatcher.getActor();let u=await e.actor.sendAsync({type:"LDT",data:c});e.dem=u,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(n){if(delete e.abortController,e.aborted)e.state="unloaded";else if(n)throw e.state="errored",n}}async readImageNow(e){if(typeof VideoFrame<"u"&&ef()){let r=e.width+2,i=e.height+2;try{return new Ye({width:r,height:i},await pP(e,-1,-1,r,i))}catch(n){}}return xe.getImageData(e,1)}_getNeighboringTiles(e){let r=e.canonical,i=Math.pow(2,r.z),n=(r.x-1+i)%i,o=r.x===0?e.wrap-1:e.wrap,a=(r.x+1+i)%i,l=r.x+1===i?e.wrap+1:e.wrap,c={};return c[new He(e.overscaledZ,o,r.z,n,r.y).key]={backfilled:!1},c[new He(e.overscaledZ,l,r.z,a,r.y).key]={backfilled:!1},r.y>0&&(c[new He(e.overscaledZ,o,r.z,n,r.y-1).key]={backfilled:!1},c[new He(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},c[new He(e.overscaledZ,l,r.z,a,r.y-1).key]={backfilled:!1}),r.y+1<i&&(c[new He(e.overscaledZ,o,r.z,n,r.y+1).key]={backfilled:!1},c[new He(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},c[new He(e.overscaledZ,l,r.z,a,r.y+1).key]={backfilled:!1}),c}async unloadTile(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&await e.actor.sendAsync({type:"RDT",data:{type:this.type,uid:e.uid,source:this.id}})}};s(Uy,"RasterDEMTileSource");var ms=Uy;m();var Ny=class Ny extends we{constructor(e,r,i,n){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=i.getActor(),this.setEventedParent(n),this._data=r.data,this._options=W({},r),this._collectResourceTiming=r.collectResourceTiming,r.maxzoom!==void 0&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId,r.clusterMaxZoom!==void 0&&this.maxzoom<=r.clusterMaxZoom&&De('The maxzoom value "'.concat(this.maxzoom,'" is expected to be greater than the clusterMaxZoom value "').concat(r.clusterMaxZoom,'".')),this.workerOptions=W({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(r.buffer!==void 0?r.buffer:128),tolerance:this._pixelsToTileUnits(r.tolerance!==void 0?r.tolerance:.375),extent:8192,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:this._getClusterMaxZoom(r.clusterMaxZoom),minPoints:Math.max(2,r.clusterMinPoints||2),extent:8192,radius:this._pixelsToTileUnits(r.clusterRadius||50),log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}_pixelsToTileUnits(e){return e*(8192/this.tileSize)}_getClusterMaxZoom(e){let r=e?Math.round(e):this.maxzoom-1;return Number.isInteger(e)||e===void 0||De("Integer expected for option 'clusterMaxZoom': provided value \"".concat(e,'" rounded to "').concat(r,'"')),r}async load(){await this._updateWorkerData()}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(e){return this._updateWorkerData(e),this}async getData(){let e=W({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:e})}getCoordinatesFromGeometry(e){return e.type==="GeometryCollection"?e.geometries.map(r=>r.coordinates).flat(1/0):e.coordinates.flat(1/0)}async getBounds(){let e=new ut,r=await this.getData(),i;switch(r.type){case"FeatureCollection":i=r.features.map(n=>this.getCoordinatesFromGeometry(n.geometry)).flat(1/0);break;case"Feature":i=this.getCoordinatesFromGeometry(r.geometry);break;default:i=this.getCoordinatesFromGeometry(r);break}if(i.length==0)return e;for(let n=0;n<i.length-1;n+=2)e.extend([i[n],i[n+1]]);return e}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(e.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),e.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=this._getClusterMaxZoom(e.clusterMaxZoom))),this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,r,i){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:r,offset:i}})}async _updateWorkerData(e){let r=W({type:this.type},this.workerOptions);e?r.dataDiff=e:typeof this._data=="string"?(r.request=this.map._requestManager.transformRequest(xe.resolveURL(this._data),"Source"),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new Q("dataloading",{dataType:"source"}));try{let i=await this.actor.sendAsync({type:"LD",data:r});if(this._pendingLoads--,this._removed||i.abandoned){this.fire(new Q("dataabort",{dataType:"source"}));return}let n=null;i.resourceTiming&&i.resourceTiming[this.id]&&(n=i.resourceTiming[this.id].slice(0));let o={dataType:"source"};this._collectResourceTiming&&n&&n.length>0&&W(o,{resourceTiming:n}),this.fire(new Q("data",j(C({},o),{sourceDataType:"metadata"}))),this.fire(new Q("data",j(C({},o),{sourceDataType:"content"})))}catch(i){if(this._pendingLoads--,this._removed){this.fire(new Q("dataabort",{dataType:"source"}));return}this.fire(new Pe(i))}}loaded(){return this._pendingLoads===0}async loadTile(e){let r=e.actor?"RT":"LT";e.actor=this.actor;let i={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,globalState:this.map.getGlobalState()};e.abortController=new AbortController;let n=await this.actor.sendAsync({type:r,data:i},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(n,this.map.painter,r==="RT")}async abortTile(e){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}async unloadTile(e){e.unloadVectorData(),await this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return W({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}};s(Ny,"GeoJSONSource");var fs=Ny;m();m();m();var hs=J(te(),1);var ds=class ds{constructor(){this.minX=1/0;this.maxX=-1/0;this.minY=1/0;this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new ds;return r.extend(e(new hs.default(this.minX,this.minY))),r.extend(e(new hs.default(this.maxX,this.minY))),r.extend(e(new hs.default(this.minX,this.maxY))),r.extend(e(new hs.default(this.maxX,this.maxY))),r}static fromPoints(e){let r=new ds;for(let i of e)r.extend(i);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}};s(ds,"Bounds");var at=ds;var $y=class $y extends we{constructor(r,i,n,o){super();this.flippedWindingOrder=!1;this.id=r,this.dispatcher=n,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=i}async load(r){this._loaded=!1,this.fire(new Q("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let i=await Kt.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,i&&i.data&&(this.image=i.data,r&&(this.coordinates=r),this._finishLoading())}catch(i){this._request=null,this._loaded=!0,this.fire(new Pe(i))}}loaded(){return this._loaded}updateImage(r){return r.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=r.url,this.load(r.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new Q("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(r){this.map=r,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(r){this.coordinates=r;let i=r.map(Je.fromLngLat);return this.tileID=yO(i),this.terrainTileRanges=this._getOverlappingTileRanges(i),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=i.map(n=>this.tileID.getTilePoint(n)._round()),this.flippedWindingOrder=gO(this.tileCoords),this.fire(new Q("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let r=this.map.painter.context,i=r.gl;this.texture||(this.texture=new Ge(r,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let n=!1;for(let o in this.tiles){let a=this.tiles[o];a.state!=="loaded"&&(a.state="loaded",a.texture=this.texture,n=!0)}n&&this.fire(new Q("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}async loadTile(r){this.tileID&&this.tileID.equals(r.tileID.canonical)?(this.tiles[String(r.tileID.wrap)]=r,r.buckets={}):r.state="errored"}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(r){let{minX:i,minY:n,maxX:o,maxY:a}=at.fromPoints(r),l={};for(let c=0;c<=Ti;c++){let u=Math.pow(2,c),p=Math.floor(i*u),f=Math.floor(n*u),h=Math.floor(o*u),y=Math.floor(a*u);l[c]={minTileX:p,minTileY:f,maxTileX:h,maxTileY:y}}return l}};s($y,"ImageSource");var lr=$y;function yO(t){let e=at.fromPoints(t),r=e.width(),i=e.height(),n=Math.max(r,i),o=Math.max(0,Math.floor(-Math.log(n)/Math.LN2)),a=Math.pow(2,o);return new ei(o,Math.floor((e.minX+e.maxX)/2*a),Math.floor((e.minY+e.maxY)/2*a))}s(yO,"getCoordinatesCenterTileID");function gO(t){let e=t[1].x-t[0].x,r=t[1].y-t[0].y,i=t[2].x-t[0].x,n=t[2].y-t[0].y;return e*n-r*i<0}s(gO,"hasWrongWindingOrder");var Vy=class Vy extends lr{constructor(e,r,i,n){super(e,r,i,n),this.roundZoom=!0,this.type="video",this.options=r}async load(){this._loaded=!1;let e=this.options;this.urls=[];for(let r of e.urls)this.urls.push(this.map._requestManager.transformRequest(r,"Source").url);try{let r=await hP(this.urls);if(this._loaded=!0,!r)return;this.video=r,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(r){this.fire(new Pe(r))}}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new Pe(new z("sources.".concat(this.id),null,"Playback for this video can be set only between the ".concat(r.start(0)," and ").concat(r.end(0),"-second mark.")))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let e=this.map.painter.context,r=e.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new Ge(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let i=!1;for(let n in this.tiles){let o=this.tiles[n];o.state!=="loaded"&&(o.state="loaded",o.texture=this.texture,i=!0)}i&&this.fire(new Q("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}};s(Vy,"VideoSource");var ys=Vy;m();var jy=class jy extends lr{constructor(e,r,i,n){super(e,r,i,n),r.coordinates?(!Array.isArray(r.coordinates)||r.coordinates.length!==4||r.coordinates.some(o=>!Array.isArray(o)||o.length!==2||o.some(a=>typeof a!="number")))&&this.fire(new Pe(new z("sources.".concat(e),null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new Pe(new z("sources.".concat(e),null,'missing required property "coordinates"'))),r.animate&&typeof r.animate!="boolean"&&this.fire(new Pe(new z("sources.".concat(e),null,'optional "animate" property must be a boolean value'))),r.canvas?typeof r.canvas!="string"&&!(r.canvas instanceof HTMLCanvasElement)&&this.fire(new Pe(new z("sources.".concat(e),null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new Pe(new z("sources.".concat(e),null,'missing required property "canvas"'))),this.options=r,this.animate=r.animate!==void 0?r.animate:!0}async load(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new Pe(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let r=this.map.painter.context,i=r.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Ge(r,this.canvas,i.RGBA,{premultiply:!0});let n=!1;for(let o in this.tiles){let a=this.tiles[o];a.state!=="loaded"&&(a.state="loaded",a.texture=this.texture,n=!0)}n&&this.fire(new Q("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}};s(jy,"CanvasSource");var gs=jy;var bO={},NS=s((t,e,r,i)=>{let n=xO(e.type),o=new n(t,e,r,i);if(o.id!==t)throw new Error("Expected Source id to be ".concat(t," instead of ").concat(o.id));return o},"create"),xO=s(t=>{switch(t){case"geojson":return fs;case"image":return lr;case"raster":return Qn;case"raster-dem":return ms;case"vector":return cs;case"video":return ys;case"canvas":return gs}return bO[t]},"getSourceType");m();m();function $S(t,e){let r={};if(!e)return r;for(let i of t){let n=i.layerIds.map(o=>e.getLayer(o)).filter(Boolean);if(n.length!==0){i.layers=n,i.stateDependentLayerIds&&(i.stateDependentLayers=i.stateDependentLayerIds.map(o=>n.filter(a=>a.id===o)[0]));for(let o of n)r[o.id]=i}}return r}s($S,"deserialize");m();m();var Gy=class Gy{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){let i=e[r];this._stringToNumber[i]=r,this._numberToString[r]=i}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error("Out of bounds. Index requested n=".concat(e," can't be >= this._numberToString.length ").concat(this._numberToString.length));return this._numberToString[e]}};s(Gy,"DictionaryCoder");var Yc=Gy;var jS=J(rs(),1),GS=J(yy(),1);m();var Zy=class Zy{constructor(e,r,i,n,o){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=i,e._y=n,this.properties=e.properties,this.id=o}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let r in this)r==="_geometry"||r==="_vectorTileFeature"||(e[r]=this[r]);return e}};s(Zy,"GeoJSONFeature");var co=Zy;var Hy=class Hy{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new $n(8192,16,0),this.grid3D=new $n(8192,16,0),this.featureIndexArray=new ja,this.promoteId=r}insert(e,r,i,n,o,a){let l=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,n,o);let c=a?this.grid3D:this.grid;for(let u=0;u<r.length;u++){let p=r[u],f=[1/0,1/0,-1/0,-1/0];for(let h=0;h<p.length;h++){let y=p[h];f[0]=Math.min(f[0],y.x),f[1]=Math.min(f[1],y.y),f[2]=Math.max(f[2],y.x),f[3]=Math.max(f[3],y.y)}f[0]<8192&&f[1]<8192&&f[2]>=0&&f[3]>=0&&c.insert(l,f[0],f[1],f[2],f[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new jS.default.VectorTile(new GS.default(this.rawTileData)).layers,this.sourceLayerCoder=new Yc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,i,n){this.loadVTLayers();let o=e.params,a=8192/e.tileSize/e.scale,l=ba(o.filter),c=e.queryGeometry,u=e.queryPadding*a,p=at.fromPoints(c),f=this.grid.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u),h=at.fromPoints(e.cameraQueryGeometry).expandBy(u),y=this.grid3D.query(h.minX,h.minY,h.maxX,h.maxY,(_,P,I,v)=>Bw(e.cameraQueryGeometry,_-u,P-u,I+u,v+u));for(let _ of y)f.push(_);f.sort(_O);let g={},x;for(let _=0;_<f.length;_++){let P=f[_];if(P===x)continue;x=P;let I=this.featureIndexArray.get(P),v=null;this.loadMatchingFeature(g,I.bucketIndex,I.sourceLayerIndex,I.featureIndex,l,o.layers,o.availableImages,r,i,n,(w,T,A)=>(v||(v=xt(w)),T.queryIntersectsFeature({queryGeometry:c,feature:w,featureState:A,geometry:v,zoom:this.z,transform:e.transform,pixelsToTileUnits:a,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return g}loadMatchingFeature(e,r,i,n,o,a,l,c,u,p,f){let h=this.bucketLayerIDs[r];if(a&&!h.some(P=>a.has(P)))return;let y=this.sourceLayerCoder.decode(i),x=this.vtLayers[y].feature(n);if(o.needGeometry){let P=_t(x,!0);if(!o.filter(new he(this.tileID.overscaledZ),P,this.tileID.canonical))return}else if(!o.filter(new he(this.tileID.overscaledZ),x))return;let _=this.getId(x,y);for(let P=0;P<h.length;P++){let I=h[P];if(a&&!a.has(I))continue;let v=c[I];if(!v)continue;let w={};_&&p&&(w=p.getState(v.sourceLayer||"_geojsonTileLayer",_));let T=W({},u[I]);T.paint=VS(T.paint,v.paint,x,w,l),T.layout=VS(T.layout,v.layout,x,w,l);let A=!f||f(x,v,w);if(!A)continue;let k=new co(x,this.z,this.x,this.y,_);k.layer=T;let L=e[I];L===void 0&&(L=e[I]=[]),L.push({featureIndex:n,feature:k,intersectionZ:A})}}lookupSymbolFeatures(e,r,i,n,o,a,l,c){let u={};this.loadVTLayers();let p=ba(o);for(let f of e)this.loadMatchingFeature(u,i,n,f,p,a,l,c,r);return u}hasLayer(e){for(let r of this.bucketLayerIDs)for(let i of r)if(e===i)return!0;return!1}getId(e,r){var n;let i=e.id;if(this.promoteId){let o=typeof this.promoteId=="string"?this.promoteId:this.promoteId[r];i=e.properties[o],typeof i=="boolean"&&(i=Number(i)),i===void 0&&((n=e.properties)!=null&&n.cluster)&&this.promoteId&&(i=Number(e.properties.cluster_id))}return i}};s(Hy,"FeatureIndex");var Xy=Hy;B("FeatureIndex",Xy,{omit:["rawTileData","sourceLayerCoder"]});function VS(t,e,r,i,n){return of(t,(o,a)=>{let l=e instanceof xa?e.get(a):null;return l&&l.evaluate?l.evaluate(r,i,n):l})}s(VS,"evaluateProperties");function _O(t,e){return e-t}s(_O,"topDownFeatureComparator");m();m();var qy="RTLPluginLoaded";var Jy=class Jy extends we{constructor(){super(...arguments);this.status="unavailable";this.url=null;this.dispatcher=ky()}_syncState(r){return this.status=r,this.dispatcher.broadcast("SRPS",{pluginStatus:r,pluginURL:this.url}).catch(i=>{throw this.status="error",i})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}async setRTLTextPlugin(r,i=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=xe.resolveURL(r),!this.url)throw new Error("requested url ".concat(r," is invalid"));if(this.status==="unavailable")if(i)this.status="deferred",this._syncState(this.status);else return this._requestImport();else if(this.status==="requested")return this._requestImport()}async _requestImport(){await this._syncState("loading"),this.status="loaded",this.fire(new Q(qy))}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}};s(Jy,"RTLMainThreadPlugin");var Yy=Jy,Wy=null;function Jc(){return Wy||(Wy=new Yy),Wy}s(Jc,"rtlMainThreadPluginFactory");var vO=3e4,Ky=class Ky{constructor(e,r){this.timeAdded=0;this.fadeEndTime=0;this.tileID=e,this.uid=nf(),this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){let r=e+this.timeAdded;r<this.fadeEndTime||(this.fadeEndTime=r)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,r,i){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!e){this.collisionBoxArray=new Fa;return}e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=$S(e.buckets,r==null?void 0:r.style),this.hasSymbolBuckets=!1;for(let n in this.buckets){let o=this.buckets[n];if(o instanceof wr)if(this.hasSymbolBuckets=!0,i)o.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let n in this.buckets){let o=this.buckets[n];if(o instanceof wr&&o.hasRTLText){this.hasRTLText=!0,Jc().lazyLoad();break}}this.queryPadding=0;for(let n in this.buckets){let o=this.buckets[n];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(n).queryRadius(o))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(let i in this.buckets){let n=this.buckets[i];n.uploadPending()&&n.upload(e)}let r=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Ge(e,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Ge(e,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,r,i,n,o,a,l,c,u,p,f){return!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData?{}:this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:o,scale:a,tileSize:this.tileSize,pixelPosMatrix:p,transform:c,params:l,queryPadding:this.queryPadding*u,getElevation:f},e,r,i)}querySourceFeatures(e,r){let i=this.latestFeatureIndex;if(!i||!i.rawTileData)return;let n=i.loadVTLayers(),o=r&&r.sourceLayer?r.sourceLayer:"",a=n._geojsonTileLayer||n[o];if(!a)return;let l=ba(r&&r.filter),{z:c,x:u,y:p}=this.tileID.canonical,f={z:c,x:u,y:p};for(let h=0;h<a.length;h++){let y=a.feature(h);if(l.needGeometry){let _=_t(y,!0);if(!l.filter(new he(this.tileID.overscaledZ),_,this.tileID.canonical))continue}else if(!l.filter(new he(this.tileID.overscaledZ),y))continue;let g=i.getId(y,o),x=new co(y,c,u,p,g);x.tile=f,e.push(x)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){let r=this.expirationTime;if(e.cacheControl){let i=sP(e.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+i["max-age"]*1e3)}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){let i=Date.now(),n=!1;if(this.expirationTime>i)n=!1;else if(!r)n=!0;else if(this.expirationTime<r)n=!0;else{let o=this.expirationTime-r;o?this.expirationTime=i+Math.max(o,vO):n=!0}n?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(e,r){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0)return;let i=this.latestFeatureIndex.loadVTLayers();for(let n in this.buckets){if(!r.style.hasLayer(n))continue;let o=this.buckets[n],a=o.layers[0].sourceLayer||"_geojsonTileLayer",l=i[a],c=e[a];if(!l||!c||Object.keys(c).length===0)continue;o.update(c,l,this.imageAtlas&&this.imageAtlas.patternPositions||{});let u=r&&r.style&&r.style.getLayer(n);u&&(this.queryPadding=Math.max(this.queryPadding,u.queryRadius(o)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<xe.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=xe.now()+e}setDependencies(e,r){let i={};for(let n of r)i[n]=!0;this.dependencies[e]=i}hasDependency(e,r){for(let i of e){let n=this.dependencies[i];if(n){for(let o of r)if(n[o])return!0}}return!1}};s(Ky,"Tile");var bs=Ky;m();var Qy=class Qy{constructor(e,r){this.max=e,this.onRemove=r,this.reset()}reset(){for(let e in this.data)for(let r of this.data[e])r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);return this.data={},this.order=[],this}add(e,r,i){let n=e.wrapped().key;this.data[n]===void 0&&(this.data[n]=[]);let o={value:r,timeout:void 0};if(i!==void 0&&(o.timeout=setTimeout(()=>{this.remove(e,o)},i)),this.data[n].push(o),this.order.push(n),this.order.length>this.max){let a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){let r=this.data[e].shift();return r.timeout&&clearTimeout(r.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),r.value}getByKey(e){let r=this.data[e];return r?r[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,r){if(!this.has(e))return this;let i=e.wrapped().key,n=r===void 0?0:this.data[i].indexOf(r),o=this.data[i][n];return this.data[i].splice(n,1),o.timeout&&clearTimeout(o.timeout),this.data[i].length===0&&delete this.data[i],this.onRemove(o.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let r=this._getAndRemoveByKey(this.order[0]);r&&this.onRemove(r)}return this}filter(e){let r=[];for(let i in this.data)for(let n of this.data[i])e(n.value)||r.push(n);for(let i of r)this.remove(i.value.tileID,i)}};s(Qy,"TileCache");var Kc=Qy;var rg=J(te(),1);m();var eg=class eg{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,r,i){let n=String(r);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][n]=this.stateChanges[e][n]||{},W(this.stateChanges[e][n],i),this.deletedStates[e]===null){this.deletedStates[e]={};for(let o in this.state[e])o!==n&&(this.deletedStates[e][o]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][n]===null){this.deletedStates[e][n]={};for(let a in this.state[e][n])i[a]||(this.deletedStates[e][n][a]=null)}else for(let a in i)this.deletedStates[e]&&this.deletedStates[e][n]&&this.deletedStates[e][n][a]===null&&delete this.deletedStates[e][n][a]}removeFeatureState(e,r,i){if(this.deletedStates[e]===null)return;let o=String(r);if(this.deletedStates[e]=this.deletedStates[e]||{},i&&r!==void 0)this.deletedStates[e][o]!==null&&(this.deletedStates[e][o]=this.deletedStates[e][o]||{},this.deletedStates[e][o][i]=null);else if(r!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][o]){this.deletedStates[e][o]={};for(i in this.stateChanges[e][o])this.deletedStates[e][o][i]=null}else this.deletedStates[e][o]=null;else this.deletedStates[e]=null}getState(e,r){let i=String(r),n=this.state[e]||{},o=this.stateChanges[e]||{},a=W({},n[i],o[i]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){let l=this.deletedStates[e][r];if(l===null)return{};for(let c in l)delete a[c]}return a}initializeTileState(e,r){e.setFeatureState(this.state,r)}coalesceChanges(e,r){let i={};for(let n in this.stateChanges){this.state[n]=this.state[n]||{};let o={};for(let a in this.stateChanges[n])this.state[n][a]||(this.state[n][a]={}),W(this.state[n][a],this.stateChanges[n][a]),o[a]=this.state[n][a];i[n]=o}for(let n in this.deletedStates){this.state[n]=this.state[n]||{};let o={};if(this.deletedStates[n]===null)for(let a in this.state[n])o[a]={},this.state[n][a]={};else for(let a in this.deletedStates[n]){if(this.deletedStates[n][a]===null)this.state[n][a]={};else for(let c of Object.keys(this.deletedStates[n][a]))delete this.state[n][a][c];o[a]=this.state[n][a]}i[n]=i[n]||{},W(i[n],o)}if(this.stateChanges={},this.deletedStates={},Object.keys(i).length!==0)for(let n in e)e[n].setFeatureState(i,r)}};s(eg,"SourceFeatureState");var Qc=eg;m();m();var PO=J(te(),1);var xs=89.25;m();function wO(t,e,r){let i=e.intersectsFrustum(t);if(!r||i===0)return i;let n=e.intersectsPlane(r);return n===0?0:i===2&&n===2?2:1}s(wO,"isTileVisible");function ZS(t,e,r){let n=0,o=(r-e)/10;for(let a=0;a<10;a++){let l=e+(a+.5)/10*(r-e);n+=o*Math.pow(Math.cos(l),t)}return n}s(ZS,"integralOfCosXByP");function HS(t,e){return function(r,i,n,o,a){let l=2*((t-1)/st(Math.cos(Et(xs-a))/Math.cos(Et(xs)))-1),c=Math.acos(n/o),u=2*ZS(l-1,0,Et(a/2)),p=Math.min(Et(xs),c+Et(a/2)),f=Math.min(p,c-Et(a/2)),h=ZS(l-1,f,p),y=Math.atan(i/n),g=Math.hypot(i,n),x=r;return x=x+st(o/g/Math.max(.5,Math.cos(Et(a/2)))),x+=l*st(Math.cos(y))/2,x-=st(Math.max(1,h/u/e))/2,x}}s(HS,"createCalculateTileZoomFunction");var SO=9.314,TO=3,IO=HS(SO,TO);function _s(t,e){let r=(e.roundZoom?Math.round:Math.floor)(t.zoom+st(t.tileSize/e.tileSize));return Math.max(0,r)}s(_s,"coveringZoomLevel");function vs(t,e){let r=t.getCameraFrustum(),i=t.getClippingPlane(),n=t.screenPointToMercatorCoordinate(t.getCameraPoint()),o=Je.fromLngLat(t.center,t.elevation);n.z=o.z+Math.cos(t.pitchInRadians)*t.cameraToCenterDistance/t.worldSize;let a=t.getCoveringTilesDetailsProvider(),l=a.allowVariableZoom(t,e),c=_s(t,e),u=e.minzoom||0,p=e.maxzoom!==void 0?e.maxzoom:t.maxZoom,f=Math.min(Math.max(0,c),p),h=Math.pow(2,f),y=[h*n.x,h*n.y,0],g=[h*o.x,h*o.y,0],x=Math.hypot(o.x-n.x,o.y-n.y),_=Math.abs(o.z-n.z),P=Math.hypot(x,_),I=s(T=>({zoom:0,x:0,y:0,wrap:T,fullyVisible:!1}),"newRootTile"),v=[],w=[];if(t.renderWorldCopies&&a.allowWorldCopies())for(let T=1;T<=3;T++)v.push(I(-T)),v.push(I(T));for(v.push(I(0));v.length>0;){let T=v.pop(),A=T.x,k=T.y,L=T.fullyVisible,R={x:A,y:k,z:T.zoom},Z=a.getTileBoundingVolume(R,T.wrap,t.elevation,e);if(!L){let F=wO(r,Z,i);if(F===0)continue;L=F===2}let q=a.distanceToTile2d(n.x,n.y,R,Z),X=c;l&&(X=(e.calculateTileZoom||IO)(t.zoom+st(t.tileSize/e.tileSize),q,_,P,t.fov)),X=(e.roundZoom?Math.round:Math.floor)(X),X=Math.max(0,X);let G=Math.min(X,p);if(T.wrap=a.getWrap(o,R,T.wrap),T.zoom>=G){if(T.zoom<u)continue;let F=f-T.zoom,K=y[0]-.5-(A<<F),fe=y[1]-.5-(k<<F),ve=e.reparseOverscaled?Math.max(T.zoom,X):T.zoom;w.push({tileID:new He(T.zoom===p?ve:T.zoom,T.wrap,T.zoom,A,k),distanceSq:Hl.sqrLen([g[0]-.5-A,g[1]-.5-k]),tileDistanceToCamera:Math.sqrt(K*K+fe*fe)});continue}for(let F=0;F<4;F++){let K=(A<<1)+F%2,fe=(k<<1)+(F>>1),ve=T.zoom+1;v.push({zoom:ve,x:K,y:fe,wrap:T.wrap,fullyVisible:L})}}return w.sort((T,A)=>T.distanceSq-A.distanceSq).map(T=>T.tileID)}s(vs,"coveringTiles");m();var tg=J(te(),1);var qS=at.fromPoints([new tg.default(0,0),new tg.default(8192,8192)]);var ti=class ti extends we{constructor(e,r,i){super(),this.id=e,this.dispatcher=i,this.on("data",n=>this._dataHandler(n)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=NS(e,r,i,this),this._tiles={},this._cache=new Kc(0,n=>this._unloadTile(n)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Qc,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if((this.used!==void 0||this.usedForTerrain!==void 0)&&!this.used&&!this.usedForTerrain)return!0;if(!this._updated)return!1;for(let e in this._tiles){let r=this._tiles[e];if(r.state!=="loaded"&&r.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}async _loadTile(e,r,i){try{await this._source.loadTile(e),this._tileLoaded(e,r,i)}catch(n){e.state="errored",n.status!==404?this._source.fire(new Pe(n,{tile:e})):this.update(this.transform,this.terrain)}}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new Q("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let r in this._tiles){let i=this._tiles[r];i.upload(e),i.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(WS).map(e=>e.key)}getRenderableIds(e){let r=[];for(let i in this._tiles)this._isIdRenderable(i,e)&&r.push(this._tiles[i]);return e?r.sort((i,n)=>{let o=i.tileID,a=n.tileID,l=new rg.default(o.canonical.x,o.canonical.y)._rotate(-this.transform.bearingInRadians),c=new rg.default(a.canonical.x,a.canonical.y)._rotate(-this.transform.bearingInRadians);return o.overscaledZ-a.overscaledZ||c.y-l.y||c.x-l.x}).map(i=>i.tileID.key):r.map(i=>i.tileID).sort(WS).map(i=>i.key)}hasRenderableParent(e){let r=this.findLoadedParent(e,0);return r?this._isIdRenderable(r.tileID.key):!1}_isIdRenderable(e,r){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(r||!this._tiles[e].holdingForFade())}reload(e){if(this._paused){this._shouldReloadOnResume=!0;return}this._cache.reset();for(let r in this._tiles)e?this._reloadTile(r,"expired"):this._tiles[r].state!=="errored"&&this._reloadTile(r,"reloading")}async _reloadTile(e,r){let i=this._tiles[e];i&&(i.state!=="loading"&&(i.state=r),await this._loadTile(i,e,r))}_tileLoaded(e,r,i){e.timeAdded=xe.now(),i==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new Q("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){let r=this.getRenderableIds();for(let n=0;n<r.length;n++){let o=r[n];if(e.neighboringTiles&&e.neighboringTiles[o]){let a=this.getTileByID(o);i(e,a),i(a,e)}}function i(n,o){n.needsHillshadePrepare=!0,n.needsTerrainPrepare=!0;let a=o.tileID.canonical.x-n.tileID.canonical.x,l=o.tileID.canonical.y-n.tileID.canonical.y,c=Math.pow(2,n.tileID.canonical.z),u=o.tileID.key;a===0&&l===0||Math.abs(l)>1||(Math.abs(a)>1&&(Math.abs(a+c)===1?a+=c:Math.abs(a-c)===1&&(a-=c)),!(!o.dem||!n.dem)&&(n.dem.backfillBorder(o.dem,a,l),n.neighboringTiles&&n.neighboringTiles[u]&&(n.neighboringTiles[u].backfilled=!0)))}s(i,"fillBorder")}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,r,i,n){for(let o in this._tiles){let a=this._tiles[o];if(n[o]||!a.hasData()||a.tileID.overscaledZ<=r||a.tileID.overscaledZ>i)continue;let l=a.tileID;for(;a&&a.tileID.overscaledZ>r+1;){let u=a.tileID.scaledTo(a.tileID.overscaledZ-1);a=this._tiles[u.key],a&&a.hasData()&&(l=u)}let c=l;for(;c.overscaledZ>r;)if(c=c.scaledTo(c.overscaledZ-1),e[c.key]||e[c.canonical.key]){n[l.key]=l;break}}}findLoadedParent(e,r){if(e.key in this._loadedParentTiles){let i=this._loadedParentTiles[e.key];return i&&i.tileID.overscaledZ>=r?i:null}for(let i=e.overscaledZ-1;i>=r;i--){let n=e.scaledTo(i),o=this._getLoadedTile(n);if(o)return o}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){let r=this._tiles[e.key];return r&&r.hasData()?r:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){let r=Math.ceil(e.width/this._source.tileSize)+1,i=Math.ceil(e.height/this._source.tileSize)+1,n=r*i,o=this._maxTileCacheZoomLevels===null?kt.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels,a=Math.floor(n*o),l=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,a):a;this._cache.setMaxSize(l)}handleWrapJump(e){let r=this._prevLng===void 0?e:this._prevLng,n=(e-r)/360,o=Math.round(n);if(this._prevLng=e,o){let a={};for(let l in this._tiles){let c=this._tiles[l];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+o),a[c.tileID.key]=c}this._tiles=a;for(let l in this._timers)clearTimeout(this._timers[l]),delete this._timers[l];for(let l in this._tiles){let c=this._tiles[l];this._setTileReloadTimer(l,c)}}}_updateCoveredAndRetainedTiles(e,r,i,n,o,a){let l={},c={},u=Object.keys(e),p=xe.now();for(let f of u){let h=e[f],y=this._tiles[f];if(!y||y.fadeEndTime!==0&&y.fadeEndTime<=p)continue;let g=this.findLoadedParent(h,r),x=this.findLoadedSibling(h),_=g||x||null;_&&(this._addTile(_.tileID),l[_.tileID.key]=_.tileID),c[f]=h}this._retainLoadedChildren(c,n,i,e);for(let f in l)e[f]||(this._coveredTiles[f]=!0,e[f]=l[f]);if(a){let f={},h={};for(let y of o)this._tiles[y.key].hasData()?f[y.key]=y:h[y.key]=y;for(let y in h){let g=h[y].children(this._source.maxzoom);this._tiles[g[0].key]&&this._tiles[g[1].key]&&this._tiles[g[2].key]&&this._tiles[g[3].key]&&(f[g[0].key]=e[g[0].key]=g[0],f[g[1].key]=e[g[1].key]=g[1],f[g[2].key]=e[g[2].key]=g[2],f[g[3].key]=e[g[3].key]=g[3],delete h[y])}for(let y in h){let g=h[y],x=this.findLoadedParent(g,this._source.minzoom),_=this.findLoadedSibling(g),P=x||_||null;if(P){f[P.tileID.key]=e[P.tileID.key]=P.tileID;for(let I in f)f[I].isChildOf(P.tileID)&&delete f[I]}}for(let y in this._tiles)f[y]||(this._coveredTiles[y]=!0)}}update(e,r){if(!this._sourceLoaded||this._paused)return;this.transform=e,this.terrain=r,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};let i;!this.used&&!this.usedForTerrain?i=[]:this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(p=>new He(p.canonical.z,p.wrap,p.canonical.z,p.canonical.x,p.canonical.y)):(i=vs(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this.usedForTerrain?!1:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(i=i.filter(p=>this._source.hasTile(p))));let n=_s(e,this._source),o=Math.max(n-ti.maxOverzooming,this._source.minzoom),a=Math.max(n+ti.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let p={};for(let f of i)if(f.canonical.z>this._source.minzoom){let h=f.scaledTo(f.canonical.z-1);p[h.key]=h;let y=f.scaledTo(Math.max(this._source.minzoom,Math.min(f.canonical.z,5)));p[y.key]=y}i=i.concat(Object.values(p))}let l=i.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,l&&this.fire(new Q("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let c=this._updateRetainedTiles(i,n);YS(this._source.type)&&this._updateCoveredAndRetainedTiles(c,o,a,n,i,r);for(let p in c)this._tiles[p].clearFadeHold();let u=aP(this._tiles,c);for(let p of u){let f=this._tiles[p];f.hasSymbolBuckets&&!f.holdingForFade()?f.setHoldDuration(this.map._fadeDuration):(!f.hasSymbolBuckets||f.symbolFadeFinished())&&this._removeTile(p)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,r){var c;let i={},n={},o=Math.max(r-ti.maxOverzooming,this._source.minzoom),a=Math.max(r+ti.maxUnderzooming,this._source.minzoom),l={};for(let u of e){let p=this._addTile(u);i[u.key]=u,!p.hasData()&&r<this._source.maxzoom&&(l[u.key]=u)}this._retainLoadedChildren(l,r,a,i);for(let u of e){let p=this._tiles[u.key];if(p.hasData())continue;if(r+1>this._source.maxzoom){let h=u.children(this._source.maxzoom)[0],y=this.getTile(h);if(y&&y.hasData()){i[h.key]=h;continue}}else{let h=u.children(this._source.maxzoom);if(i[h[0].key]&&i[h[1].key]&&i[h[2].key]&&i[h[3].key])continue}let f=p.wasRequested();for(let h=u.overscaledZ-1;h>=o;--h){let y=u.scaledTo(h);if(n[y.key])break;if(n[y.key]=!0,p=this.getTile(y),!p&&f&&(p=this._addTile(y)),p){let g=p.hasData();if((g||!((c=this.map)!=null&&c.cancelPendingTileRequestsWhileZooming)||f)&&(i[y.key]=y),f=p.wasRequested(),g)break}}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let e in this._tiles){let r=[],i,n=this._tiles[e].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){i=this._loadedParentTiles[n.key];break}r.push(n.key);let o=n.scaledTo(n.overscaledZ-1);if(i=this._getLoadedTile(o),i)break;n=o}for(let o of r)this._loadedParentTiles[o]=i}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let e in this._tiles){let r=this._tiles[e].tileID,i=this._getLoadedTile(r);this._loadedSiblingTiles[r.key]=i}}_addTile(e){let r=this._tiles[e.key];if(r)return r;r=this._cache.getAndRemove(e),r&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));let i=r;return r||(r=new bs(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,e.key,r.state)),r.uses++,this._tiles[e.key]=r,i||this._source.fire(new Q("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(e,r){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);let i=r.getExpiryTimeout();i&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},i))}refreshTiles(e){for(let r in this._tiles)!this._isIdRenderable(r)&&this._tiles[r].state!="errored"||e.some(i=>i.equals(this._tiles[r].tileID.canonical))&&this._reloadTile(r,"expired")}_removeTile(e){let r=this._tiles[e];r&&(r.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),!(r.uses>0)&&(r.hasData()&&r.state!=="reloading"?this._cache.add(r.tileID,r,r.getExpiryTimeout()):(r.aborted=!0,this._abortTile(r),this._unloadTile(r))))}_dataHandler(e){let r=e.sourceDataType;e.dataType==="source"&&r==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&e.dataType==="source"&&r==="content"&&(this.reload(e.sourceDataChanged),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,r,i){let n=[],o=this.transform;if(!o)return n;let a=o.getCoveringTilesDetailsProvider().allowWorldCopies(),l=i?o.getCameraQueryGeometry(e):e,c=s(y=>o.screenPointToMercatorCoordinate(y,this.terrain),"project"),u=this.transformBbox(e,c,!a),p=this.transformBbox(l,c,!a),f=this.getIds(),h=at.fromPoints(p);for(let y=0;y<f.length;y++){let g=this._tiles[f[y]];if(g.holdingForFade())continue;let x=a?[g.tileID]:[g.tileID.unwrapTo(-1),g.tileID.unwrapTo(0)],_=Math.pow(2,o.zoom-g.tileID.overscaledZ),P=r*g.queryPadding*8192/g.tileSize/_;for(let I of x){let v=h.map(w=>I.getTilePoint(new Je(w.x,w.y)));if(v.expandBy(P),v.intersects(qS)){let w=u.map(A=>I.getTilePoint(A)),T=p.map(A=>I.getTilePoint(A));n.push({tile:g,tileID:a?I:I.unwrapTo(0),queryGeometry:w,cameraQueryGeometry:T,scale:_})}}}return n}transformBbox(e,r,i){let n=e.map(r);if(i){let o=at.fromPoints(e);o.shrinkBy(Math.min(o.width(),o.height())*.001);let a=o.map(r);at.fromPoints(n).covers(a)||(n=n.map(c=>c.x>.5?new Je(c.x-1,c.y,c.z):c))}return n}getVisibleCoordinates(e){let r=this.getRenderableIds(e).map(i=>this._tiles[i].tileID);return this.transform&&this.transform.populateCache(r),r}hasTransition(){if(this._source.hasTransition())return!0;if(YS(this._source.type)){let e=xe.now();for(let r in this._tiles)if(this._tiles[r].fadeEndTime>=e)return!0}return!1}setFeatureState(e,r,i){e=e||"_geojsonTileLayer",this._state.updateState(e,r,i)}removeFeatureState(e,r,i){e=e||"_geojsonTileLayer",this._state.removeFeatureState(e,r,i)}getFeatureState(e,r){return e=e||"_geojsonTileLayer",this._state.getState(e,r)}setDependencies(e,r,i){let n=this._tiles[e];n&&n.setDependencies(r,i)}reloadTilesForDependencies(e,r){for(let i in this._tiles)this._tiles[i].hasDependency(e,r)&&this._reloadTile(i,"reloading");this._cache.filter(i=>!i.hasDependency(e,r))}};s(ti,"SourceCache");var mo=ti;mo.maxOverzooming=10;mo.maxUnderzooming=3;function WS(t,e){let r=Math.abs(t.wrap*2)-+(t.wrap<0),i=Math.abs(e.wrap*2)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||i-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}s(WS,"compareTileId");function YS(t){return t==="raster"||t==="image"||t==="video"}s(YS,"isRasterType");m();m();m();var LO=J(te(),1);m();var CO=J(te(),1);m();m();m();var MO=J(te(),1);var Jie=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);m();m();var QS=J(te(),1);var tp=class tp extends QS.default{constructor(e,r,i,n){super(e,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new tp(this.x,this.y,this.angle,this.segment)}};s(tp,"Anchor");var Ps=tp;B("Anchor",Ps);m();m();m();var zO=J(te(),1);m();var OO=J(te(),1);m();m();var RO=J(te(),1);var UO=J(kd(),1);m();var FO=Number.POSITIVE_INFINITY;var VO=J(te(),1);var Hae=Math.pow(2,25),qae=Math.pow(2,24),Wae=Math.pow(2,17),Yae=Math.pow(2,16),Jae=Math.pow(2,9),Kae=Math.pow(2,8),Qae=Math.pow(2,1);m();var cse=512/8192/2;m();m();m();m();var eT="#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nout highp vec4 fragColor;";m();var tT="#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c\n);}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\n#ifdef GLOBE\nif ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}\n#endif\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;";m();var rT="uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var nT="in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}";m();var iT="uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var oT="uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}";m();var aT="in vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var sT="uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {\n#ifdef GLOBE\nvec3 center_vector=projectToSphere(circle_center);\n#endif\nfloat angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {\n#ifdef GLOBE\nvec4 projected_center=interpolateProjection(circle_center,center_vector,ele);\n#else\nvec4 projected_center=projectTileWithElevation(circle_center,ele);\n#endif\ncorner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}\n#ifdef GLOBE\nvec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);\n#else\ngl_Position=projectTileWithElevation(corner_position,ele);\n#endif\n} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}";m();var ng="void main() {fragColor=vec4(1.0);}";m();var lT="in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}";m();var uT="uniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var cT="uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0);\n#ifdef GLOBE\nvec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);\n#else\ngl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));\n#endif\n}";m();var pT="uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(0.0);\n#endif\n}";m();var mT="uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}";m();var fT="in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}";m();var hT="in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}";m();var dT="in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}";m();var yT="in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}";m();var gT="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(textureSize(u_elevation_stops,0)[0]);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int num_elevation_stops=textureSize(u_elevation_stops,0)[0];int r=(num_elevation_stops-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else\n{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(textureSize(u_color_stops,0)[0]);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var bT="uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}";m();var xT="uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}";m();var _T="in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}";m();var vT="in vec2 a_pos;void main() {\n#ifdef GLOBE\ngl_Position=projectTileFor3D(a_pos,0.0);\n#else\ngl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);\n#endif\n}";m();var PT="#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nfragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var wT="uniform vec2 u_fill_translate;in vec2 a_pos;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);}";m();var ST="in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var TT="uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}";m();var IT="uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var CT="uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}";m();var MT="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var AT="uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}";m();var ET="in vec4 v_color;void main() {fragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var kT="uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\nout vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nfloat colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);\n#ifdef GLOBE\nmat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);\n#endif\ndirectional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}";m();var LT="uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var DT="uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\n#ifdef GLOBE\nout vec3 v_sphere_pos;\n#endif\nout vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}";m();var zT="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/pow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var OT="uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}";m();var RT="uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];\n#define PI 3.141592653589793\n#define STANDARD 0\n#define COMBINED 1\n#define IGOR 2\n#define MULTIDIRECTIONAL 3\n#define BASIC 4\nfloat get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else\n{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else\n{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;switch(u_method){case BASIC:\nbasic_hillshade(deriv);break;case COMBINED:\ncombined_hillshade(deriv);break;case IGOR:\nigor_hillshade(deriv);break;case MULTIDIRECTIONAL:\nmultidirectional_hillshade(deriv);break;case STANDARD:\ndefault:\nstandard_hillshade(deriv);break;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var FT="uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}";m();var BT="uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var UT="\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}";m();var NT="uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var $T="\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}";m();var VT="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var jT="\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}";m();var GT="uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var ZT="\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}";m();var XT="uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0);vec4 color1=texture(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var HT="uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;\n#ifdef GLOBE\nif (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}\n#endif\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}";m();var qT="uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var WT="in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}";m();var YT="#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var JT="in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}";m();var KT="#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;fragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}";m();var QT="in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}";m();var eI="in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}";m();var tI="precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}";m();var rI="uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}";m();var nI="in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}";m();var iI="in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}";m();var oI="in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}";m();var aI="in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}";m();var sI="in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}";m();var lI="float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}";m();var uI="#define GLOBE_RADIUS 6371008.8\nuniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos\n);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); \nif (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len\n);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}";m();var cI="in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758\n);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}";m();var pI="in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}";m();var mI="uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}";m();var fI="in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}";var rp={prelude:me(eT,tT),projectionMercator:me("",lI),projectionGlobe:me("",uI),background:me(rT,nT),backgroundPattern:me(iT,oT),circle:me(aT,sT),clippingMask:me(ng,lT),heatmap:me(uT,cT),heatmapTexture:me(pT,mT),collisionBox:me(fT,hT),collisionCircle:me(dT,yT),colorRelief:me(gT,bT),debug:me(xT,_T),depth:me(ng,vT),fill:me(PT,wT),fillOutline:me(ST,TT),fillOutlinePattern:me(IT,CT),fillPattern:me(MT,AT),fillExtrusion:me(ET,kT),fillExtrusionPattern:me(LT,DT),hillshadePrepare:me(zT,OT),hillshade:me(RT,FT),line:me(BT,UT),lineGradient:me(NT,$T),linePattern:me(VT,jT),lineSDF:me(GT,ZT),raster:me(XT,HT),symbolIcon:me(qT,WT),symbolSDF:me(YT,JT),symbolTextAndIcon:me(KT,QT),terrain:me(rI,nI),terrainDepth:me(eI,iI),terrainCoords:me(tI,oI),projectionErrorMeasurement:me(sI,aI),atmosphere:me(cI,pI),sky:me(mI,fI)};function me(t,e){let r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=e.match(/in ([\w]+) ([\w]+)/g),n=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(n):n,l={};return t=t.replace(r,(c,u,p,f,h)=>(l[h]=!0,u==="define"?"\n#ifndef HAS_UNIFORM_u_".concat(h,"\nin ").concat(p," ").concat(f," ").concat(h,";\n#else\nuniform ").concat(p," ").concat(f," u_").concat(h,";\n#endif\n"):"\n#ifdef HAS_UNIFORM_u_".concat(h,"\n ").concat(p," ").concat(f," ").concat(h," = u_").concat(h,";\n#endif\n"))),e=e.replace(r,(c,u,p,f,h)=>{let y=f==="float"?"vec2":"vec4",g=h.match(/color/)?"color":y;return l[h]?u==="define"?"\n#ifndef HAS_UNIFORM_u_".concat(h,"\nuniform lowp float u_").concat(h,"_t;\nin ").concat(p," ").concat(y," a_").concat(h,";\nout ").concat(p," ").concat(f," ").concat(h,";\n#else\nuniform ").concat(p," ").concat(f," u_").concat(h,";\n#endif\n"):g==="vec4"?"\n#ifndef HAS_UNIFORM_u_".concat(h,"\n ").concat(h," = a_").concat(h,";\n#else\n ").concat(p," ").concat(f," ").concat(h," = u_").concat(h,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(h,"\n ").concat(h," = unpack_mix_").concat(g,"(a_").concat(h,", u_").concat(h,"_t);\n#else\n ").concat(p," ").concat(f," ").concat(h," = u_").concat(h,";\n#endif\n"):u==="define"?"\n#ifndef HAS_UNIFORM_u_".concat(h,"\nuniform lowp float u_").concat(h,"_t;\nin ").concat(p," ").concat(y," a_").concat(h,";\n#else\nuniform ").concat(p," ").concat(f," u_").concat(h,";\n#endif\n"):g==="vec4"?"\n#ifndef HAS_UNIFORM_u_".concat(h,"\n ").concat(p," ").concat(f," ").concat(h," = a_").concat(h,";\n#else\n ").concat(p," ").concat(f," ").concat(h," = u_").concat(h,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(h,"\n ").concat(p," ").concat(f," ").concat(h," = unpack_mix_").concat(g,"(a_").concat(h,", u_").concat(h,"_t);\n#else\n ").concat(p," ").concat(f," ").concat(h," = u_").concat(h,";\n#endif\n")}),{fragmentSource:t,vertexSource:e,staticAttributes:i,staticUniforms:a}}s(me,"prepare");m();m();var Ss=ge([{name:"a_pos",type:"Int16",components:2}]);m();var QO=J(te(),1);m();var XO=J(te(),1);m();var jO=J(te(),1);m();m();m();m();m();var eR=J(te(),1);m();m();m();m();var oR=0,bI=1,aR=771,ig=class ig{constructor(e,r,i){this.blendFunction=e,this.blendColor=r,this.mask=i}};s(ig,"ColorMode");var et=ig;et.Replace=[bI,oR];et.disabled=new et(et.Replace,re.transparent,[!1,!1,!1,!1]);et.unblended=new et(et.Replace,re.transparent,[!0,!0,!0,!0]);et.alphaBlended=new et([bI,aR],re.transparent,[!0,!0,!0,!0]);m();var og=class og{constructor(e,r,i){this.enable=e,this.mode=r,this.frontFace=i}};s(og,"CullFaceMode");var Re=og;Re.disabled=new Re(!1,1029,2305);Re.backCCW=new Re(!0,1029,2305);Re.frontCCW=new Re(!0,1028,2305);m();var ag=class ag{constructor(e,r,i){this.func=e,this.mask=r,this.range=i}};s(ag,"DepthMode");var Fe=ag;Fe.ReadOnly=!1;Fe.ReadWrite=!0;Fe.disabled=new Fe(519,Fe.ReadOnly,[0,1]);m();var sg=class sg{constructor(e,r,i,n,o,a){this.test=e,this.ref=r,this.mask=i,this.fail=n,this.depthFail=o,this.pass=a}};s(sg,"StencilMode");var it=sg;it.disabled=new it({func:519,mask:0},0,0,7680,7680,7680);m();m();m();var _fe=8192/128;var Dfe=new Hn({fill:new Ot(128,2),line:new Ot(512,0),tile:new Ot(128,32),stencil:new Ot(128,1),circle:3});var jfe=new ot({type:new Oe(lt.projection.type)});m();m();var hR=J(te(),1);m();m();m();m();m();m();var yR=J(te(),1);var yye=ow();m();m();var _R=ge([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();m();var PR=J(te(),1);m();var mve=Xl.identity(new Float32Array(16));m();m();m();m();m();m();m();m();m();var Cs=J(te(),1);var t1e=[new Cs.default(0,0),new Cs.default(8192,0),new Cs.default(8192,8192),new Cs.default(0,8192)];m();m();var P1e=new re(1,0,0,1),w1e=new re(0,1,0,1),S1e=new re(0,0,1,1),T1e=new re(1,0,1,1),I1e=new re(0,1,1,1);m();m();m();m();m();m();m();var TR=J(te(),1);var Ms={linearity:.3,easing:ql(0,0,.3,1)},Hwe=W({deceleration:2500,maxSpeed:1400},Ms),qwe=W({deceleration:20,maxSpeed:1400},Ms),Wwe=W({deceleration:1e3,maxSpeed:360},Ms),Ywe=W({deceleration:1e3,maxSpeed:90},Ms),Jwe=W({deceleration:1e3,maxSpeed:360},Ms);m();m();var IR=J(te(),1);m();m();var AR=J(te(),1);m();m();var kR=J(te(),1);m();m();var FR=J(te(),1);m();m();var DR=0,zR=2,FSe={[DR]:1,[zR]:2};m();var BR=J(te(),1);m();m();m();var mTe=1/100,fTe=1/450;m();m();m();m();m();m();m();var YR=J(te(),1);m();var JR=J(te(),1);var iF=J(te(),1);m();var TI={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};m();m();m();var KR=60,HIe=1e3/KR;m();m();var QR=ge([{name:"a_pos3d",type:"Int16",components:3}]);m();m();m();m();var OMe=jl.version,oF=-2,aF=22,sF=0,lF=60;var RMe={hash:!1,interactive:!0,bearingSnap:7,attributionControl:TI,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:oF,maxZoom:aF,minPitch:sF,maxPitch:lF,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:kt.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0};m();var uF=J(te(),1);m();m();m();var fF=J(te(),1);m();m();m();m();m();m();m();var dF=J(te(),1);var qAe=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");var yF=J(te(),1);var i2e=jl.version;m();m();m();m();m();m();m();var ct=63710088e-1,l2e={centimeters:ct*100,centimetres:ct*100,degrees:ct/111325,feet:ct*3.28084,inches:ct*39.37,kilometers:ct/1e3,kilometres:ct/1e3,meters:ct,metres:ct,miles:ct/1609.344,millimeters:ct*1e3,millimetres:ct*1e3,nauticalmiles:ct/1852,radians:1,yards:ct*1.0936},u2e={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/ct,yards:1.0936133};function fn(t,e,r){r===void 0&&(r={});var i={type:"Feature"};return(r.id===0||r.id)&&(i.id=r.id),r.bbox&&(i.bbox=r.bbox),i.properties=e||{},i.geometry=t,i}s(fn,"feature");function gF(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!II(t[0])||!II(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return fn(i,e,r)}s(gF,"point");function c2e(t,e,r){r===void 0&&(r={});for(var i=0,n=t;i<n.length;i++){var o=n[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:t};return fn(l,e,r)}s(c2e,"polygon");function bF(t,e,r){if(r===void 0&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:t};return fn(i,e,r)}s(bF,"lineString");function p2e(t,e){e===void 0&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}s(p2e,"featureCollection");function m2e(t,e,r){r===void 0&&(r={});var i={type:"MultiLineString",coordinates:t};return fn(i,e,r)}s(m2e,"multiLineString");function f2e(t,e,r){r===void 0&&(r={});var i={type:"MultiPolygon",coordinates:t};return fn(i,e,r)}s(f2e,"multiPolygon");function II(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}s(II,"isNumber");function ug(t,e,r){if(t!==null)for(var i,n,o,a,l,c,u,p=0,f=0,h,y=t.type,g=y==="FeatureCollection",x=y==="Feature",_=g?t.features.length:1,P=0;P<_;P++){u=g?t.features[P].geometry:x?t.geometry:t,h=u?u.type==="GeometryCollection":!1,l=h?u.geometries.length:1;for(var I=0;I<l;I++){var v=0,w=0;if(a=h?u.geometries[I]:u,a!==null){c=a.coordinates;var T=a.type;switch(p=r&&(T==="Polygon"||T==="MultiPolygon")?1:0,T){case null:break;case"Point":if(e(c,f,P,v,w)===!1)return!1;f++,v++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],f,P,v,w)===!1)return!1;f++,T==="MultiPoint"&&v++}T==="LineString"&&v++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(n=0;n<c[i].length-p;n++){if(e(c[i][n],f,P,v,w)===!1)return!1;f++}T==="MultiLineString"&&v++,T==="Polygon"&&w++}T==="Polygon"&&v++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(w=0,n=0;n<c[i].length;n++){for(o=0;o<c[i][n].length-p;o++){if(e(c[i][n][o],f,P,v,w)===!1)return!1;f++}w++}v++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(ug(a.geometries[i],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}s(ug,"coordEach");function x2e(t,e){if(t.type==="Feature")e(t,0);else if(t.type==="FeatureCollection")for(var r=0;r<t.features.length&&e(t.features[r],r)!==!1;r++);}s(x2e,"featureEach");function xF(t,e){var r,i,n,o,a,l,c,u,p,f,h=0,y=t.type==="FeatureCollection",g=t.type==="Feature",x=y?t.features.length:1;for(r=0;r<x;r++){for(l=y?t.features[r].geometry:g?t.geometry:t,u=y?t.features[r].properties:g?t.properties:{},p=y?t.features[r].bbox:g?t.bbox:void 0,f=y?t.features[r].id:g?t.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,n=0;n<a;n++){if(o=c?l.geometries[n]:l,o===null){if(e(null,h,u,p,f)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,h,u,p,f)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],h,u,p,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}s(xF,"geomEach");function _2e(t,e){xF(t,function(r,i,n,o,a){var l=r===null?null:r.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return e(fn(r,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<r.coordinates.length;u++){var p=r.coordinates[u],f={type:c,coordinates:p};if(e(fn(f,n),i,u)===!1)return!1}})}s(_2e,"flattenEach");function cg(t){var e=[1/0,1/0,-1/0,-1/0];return ug(t,function(r){e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]<r[0]&&(e[2]=r[0]),e[3]<r[1]&&(e[3]=r[1])}),e}s(cg,"bbox");cg.default=cg;var CI=cg;function MI(t){return CI(t)}s(MI,"getBoundingBoxFromFeature");m();m();m();m();m();var pg=class pg{constructor(){S(this,"type","interaction");S(this,"hover",!1);S(this,"dirty",!1)}};s(pg,"InteractionComponent");var fo=pg;m();m();m();var D={};kr(D,{$brand:()=>op,$input:()=>w_,$output:()=>P_,NEVER:()=>mg,TimePrecision:()=>C_,ZodAny:()=>fC,ZodArray:()=>gC,ZodBase64:()=>Xv,ZodBase64URL:()=>Hv,ZodBigInt:()=>yl,ZodBigIntFormat:()=>Yv,ZodBoolean:()=>dl,ZodCIDRv4:()=>Gv,ZodCIDRv6:()=>Zv,ZodCUID:()=>Fv,ZodCUID2:()=>Bv,ZodCatch:()=>RC,ZodCodec:()=>a0,ZodCustom:()=>um,ZodCustomStringFormat:()=>fl,ZodDate:()=>am,ZodDefault:()=>EC,ZodDiscriminatedUnion:()=>bC,ZodE164:()=>qv,ZodEmail:()=>zv,ZodEmoji:()=>Ov,ZodEnum:()=>pl,ZodError:()=>q3,ZodFile:()=>CC,ZodFirstPartyTypeKind:()=>s0,ZodFunction:()=>ZC,ZodGUID:()=>tm,ZodIPv4:()=>Vv,ZodIPv6:()=>jv,ZodISODate:()=>Kp,ZodISODateTime:()=>Jp,ZodISODuration:()=>em,ZodISOTime:()=>Qp,ZodIntersection:()=>xC,ZodIssueCode:()=>oU,ZodJWT:()=>Wv,ZodKSUID:()=>$v,ZodLazy:()=>VC,ZodLiteral:()=>IC,ZodMap:()=>SC,ZodNaN:()=>BC,ZodNanoID:()=>Rv,ZodNever:()=>dC,ZodNonOptional:()=>i0,ZodNull:()=>pC,ZodNullable:()=>AC,ZodNumber:()=>hl,ZodNumberFormat:()=>Ao,ZodObject:()=>lm,ZodOptional:()=>n0,ZodPipe:()=>o0,ZodPrefault:()=>LC,ZodPromise:()=>GC,ZodReadonly:()=>UC,ZodRealError:()=>St,ZodRecord:()=>e0,ZodSet:()=>TC,ZodString:()=>ml,ZodStringFormat:()=>Ce,ZodSuccess:()=>OC,ZodSymbol:()=>uC,ZodTemplateLiteral:()=>$C,ZodTransform:()=>MC,ZodTuple:()=>vC,ZodType:()=>le,ZodULID:()=>Uv,ZodURL:()=>om,ZodUUID:()=>Xr,ZodUndefined:()=>cC,ZodUnion:()=>Kv,ZodUnknown:()=>hC,ZodVoid:()=>yC,ZodXID:()=>Nv,_ZodString:()=>Dv,_default:()=>kC,_function:()=>K4,any:()=>L4,array:()=>sm,base64:()=>d4,base64url:()=>y4,bigint:()=>C4,boolean:()=>lC,catch:()=>FC,check:()=>Q4,cidrv4:()=>f4,cidrv6:()=>h4,clone:()=>pt,codec:()=>W4,coerce:()=>cm,config:()=>qe,core:()=>Mr,cuid:()=>a4,cuid2:()=>s4,custom:()=>eU,date:()=>z4,decode:()=>Sv,decodeAsync:()=>Iv,discriminatedUnion:()=>U4,e164:()=>g4,email:()=>Y3,emoji:()=>i4,encode:()=>wv,encodeAsync:()=>Tv,endsWith:()=>nl,enum:()=>t0,file:()=>Z4,flattenError:()=>Fs,float32:()=>w4,float64:()=>S4,formatError:()=>Bs,function:()=>K4,getErrorMap:()=>sU,globalRegistry:()=>Cr,gt:()=>Gr,gte:()=>wt,guid:()=>J3,hash:()=>P4,hex:()=>v4,hostname:()=>_4,httpUrl:()=>n4,includes:()=>tl,instanceof:()=>tU,int:()=>Lv,int32:()=>T4,int64:()=>M4,intersection:()=>_C,ipv4:()=>p4,ipv6:()=>m4,iso:()=>cl,json:()=>nU,jwt:()=>b4,keyof:()=>O4,ksuid:()=>c4,lazy:()=>jC,length:()=>Io,literal:()=>G4,locales:()=>oi,looseObject:()=>B4,lowercase:()=>Qs,lt:()=>jr,lte:()=>qt,map:()=>$4,maxLength:()=>To,maxSize:()=>So,mime:()=>il,minLength:()=>_n,minSize:()=>si,multipleOf:()=>ai,nan:()=>q4,nanoid:()=>o4,nativeEnum:()=>j4,negative:()=>rv,never:()=>Jv,nonnegative:()=>iv,nonoptional:()=>zC,nonpositive:()=>nv,normalize:()=>ol,null:()=>mC,nullable:()=>nm,nullish:()=>X4,number:()=>sC,object:()=>R4,optional:()=>rm,overwrite:()=>Zr,parse:()=>xv,parseAsync:()=>_v,partialRecord:()=>N4,pipe:()=>im,positive:()=>tv,prefault:()=>DC,preprocess:()=>iU,prettifyError:()=>Ig,promise:()=>J4,property:()=>ov,readonly:()=>NC,record:()=>wC,refine:()=>XC,regex:()=>Ks,regexes:()=>Ut,registry:()=>Ep,safeDecode:()=>Mv,safeDecodeAsync:()=>Ev,safeEncode:()=>Cv,safeEncodeAsync:()=>Av,safeParse:()=>vv,safeParseAsync:()=>Pv,set:()=>V4,setErrorMap:()=>aU,size:()=>Js,startsWith:()=>rl,strictObject:()=>F4,string:()=>kv,stringFormat:()=>x4,stringbool:()=>rU,success:()=>H4,superRefine:()=>HC,symbol:()=>E4,templateLiteral:()=>Y4,toJSONSchema:()=>mv,toLowerCase:()=>sl,toUpperCase:()=>ll,transform:()=>r0,treeifyError:()=>Tg,trim:()=>al,tuple:()=>PC,uint32:()=>I4,uint64:()=>A4,ulid:()=>l4,undefined:()=>k4,union:()=>Qv,unknown:()=>Mo,uppercase:()=>el,url:()=>r4,util:()=>N,uuid:()=>K3,uuidv4:()=>Q3,uuidv6:()=>e4,uuidv7:()=>t4,void:()=>D4,xid:()=>u4});m();var Mr={};kr(Mr,{$ZodAny:()=>tx,$ZodArray:()=>ax,$ZodAsyncError:()=>pr,$ZodBase64:()=>Zb,$ZodBase64URL:()=>Xb,$ZodBigInt:()=>Cp,$ZodBigIntFormat:()=>Jb,$ZodBoolean:()=>Vs,$ZodCIDRv4:()=>Vb,$ZodCIDRv6:()=>jb,$ZodCUID:()=>kb,$ZodCUID2:()=>Lb,$ZodCatch:()=>wx,$ZodCheck:()=>ke,$ZodCheckBigIntFormat:()=>ab,$ZodCheckEndsWith:()=>bb,$ZodCheckGreaterThan:()=>_p,$ZodCheckIncludes:()=>yb,$ZodCheckLengthEquals:()=>mb,$ZodCheckLessThan:()=>xp,$ZodCheckLowerCase:()=>hb,$ZodCheckMaxLength:()=>cb,$ZodCheckMaxSize:()=>sb,$ZodCheckMimeType:()=>_b,$ZodCheckMinLength:()=>pb,$ZodCheckMinSize:()=>lb,$ZodCheckMultipleOf:()=>ib,$ZodCheckNumberFormat:()=>ob,$ZodCheckOverwrite:()=>vb,$ZodCheckProperty:()=>xb,$ZodCheckRegex:()=>fb,$ZodCheckSizeEquals:()=>ub,$ZodCheckStartsWith:()=>gb,$ZodCheckStringFormat:()=>Po,$ZodCheckUpperCase:()=>db,$ZodCodec:()=>js,$ZodCustom:()=>kx,$ZodCustomStringFormat:()=>Wb,$ZodDate:()=>ox,$ZodDefault:()=>xx,$ZodDiscriminatedUnion:()=>lx,$ZodE164:()=>Hb,$ZodEmail:()=>Cb,$ZodEmoji:()=>Ab,$ZodEncodeError:()=>hn,$ZodEnum:()=>fx,$ZodError:()=>Rs,$ZodFile:()=>dx,$ZodFunction:()=>Mx,$ZodGUID:()=>Tb,$ZodIPv4:()=>Nb,$ZodIPv6:()=>$b,$ZodISODate:()=>Fb,$ZodISODateTime:()=>Rb,$ZodISODuration:()=>Ub,$ZodISOTime:()=>Bb,$ZodIntersection:()=>ux,$ZodJWT:()=>qb,$ZodKSUID:()=>Ob,$ZodLazy:()=>Ex,$ZodLiteral:()=>hx,$ZodMap:()=>px,$ZodNaN:()=>Sx,$ZodNanoID:()=>Eb,$ZodNever:()=>nx,$ZodNonOptional:()=>vx,$ZodNull:()=>ex,$ZodNullable:()=>bx,$ZodNumber:()=>Ip,$ZodNumberFormat:()=>Yb,$ZodObject:()=>eC,$ZodObjectJIT:()=>sx,$ZodOptional:()=>gx,$ZodPipe:()=>Tx,$ZodPrefault:()=>_x,$ZodPromise:()=>Ax,$ZodReadonly:()=>Ix,$ZodRealError:()=>Pt,$ZodRecord:()=>cx,$ZodRegistry:()=>wo,$ZodSet:()=>mx,$ZodString:()=>ii,$ZodStringFormat:()=>Se,$ZodSuccess:()=>Px,$ZodSymbol:()=>Kb,$ZodTemplateLiteral:()=>Cx,$ZodTransform:()=>yx,$ZodTuple:()=>Ap,$ZodType:()=>ee,$ZodULID:()=>Db,$ZodURL:()=>Mb,$ZodUUID:()=>Ib,$ZodUndefined:()=>Qb,$ZodUnion:()=>Mp,$ZodUnknown:()=>rx,$ZodVoid:()=>ix,$ZodXID:()=>zb,$brand:()=>op,$constructor:()=>M,$input:()=>w_,$output:()=>P_,Doc:()=>$s,JSONSchema:()=>hv,JSONSchemaGenerator:()=>ul,NEVER:()=>mg,TimePrecision:()=>C_,_any:()=>q_,_array:()=>av,_base64:()=>Hp,_base64url:()=>qp,_bigint:()=>$_,_boolean:()=>U_,_catch:()=>$3,_check:()=>iC,_cidrv4:()=>Zp,_cidrv6:()=>Xp,_coercedBigint:()=>V_,_coercedBoolean:()=>N_,_coercedDate:()=>Q_,_coercedNumber:()=>D_,_coercedString:()=>I_,_cuid:()=>Bp,_cuid2:()=>Up,_custom:()=>lv,_date:()=>K_,_decode:()=>pp,_decodeAsync:()=>fp,_default:()=>B3,_discriminatedUnion:()=>I3,_e164:()=>Wp,_email:()=>kp,_emoji:()=>Rp,_encode:()=>cp,_encodeAsync:()=>mp,_endsWith:()=>nl,_enum:()=>L3,_file:()=>sv,_float32:()=>O_,_float64:()=>R_,_gt:()=>Gr,_gte:()=>wt,_guid:()=>Ws,_includes:()=>tl,_int:()=>z_,_int32:()=>F_,_int64:()=>j_,_intersection:()=>C3,_ipv4:()=>jp,_ipv6:()=>Gp,_isoDate:()=>A_,_isoDateTime:()=>M_,_isoDuration:()=>k_,_isoTime:()=>E_,_jwt:()=>Yp,_ksuid:()=>Vp,_lazy:()=>Z3,_length:()=>Io,_literal:()=>z3,_lowercase:()=>Qs,_lt:()=>jr,_lte:()=>qt,_map:()=>E3,_max:()=>qt,_maxLength:()=>To,_maxSize:()=>So,_mime:()=>il,_min:()=>wt,_minLength:()=>_n,_minSize:()=>si,_multipleOf:()=>ai,_nan:()=>ev,_nanoid:()=>Fp,_nativeEnum:()=>D3,_negative:()=>rv,_never:()=>Y_,_nonnegative:()=>iv,_nonoptional:()=>U3,_nonpositive:()=>nv,_normalize:()=>ol,_null:()=>H_,_nullable:()=>F3,_number:()=>L_,_optional:()=>R3,_overwrite:()=>Zr,_parse:()=>bo,_parseAsync:()=>xo,_pipe:()=>V3,_positive:()=>tv,_promise:()=>X3,_property:()=>ov,_readonly:()=>j3,_record:()=>A3,_refine:()=>uv,_regex:()=>Ks,_safeDecode:()=>dp,_safeDecodeAsync:()=>gp,_safeEncode:()=>hp,_safeEncodeAsync:()=>yp,_safeParse:()=>_o,_safeParseAsync:()=>vo,_set:()=>k3,_size:()=>Js,_startsWith:()=>rl,_string:()=>T_,_stringFormat:()=>Co,_stringbool:()=>pv,_success:()=>N3,_superRefine:()=>cv,_symbol:()=>Z_,_templateLiteral:()=>G3,_toLowerCase:()=>sl,_toUpperCase:()=>ll,_transform:()=>O3,_trim:()=>al,_tuple:()=>M3,_uint32:()=>B_,_uint64:()=>G_,_ulid:()=>Np,_undefined:()=>X_,_union:()=>T3,_unknown:()=>W_,_uppercase:()=>el,_url:()=>Ys,_uuid:()=>Lp,_uuidv4:()=>Dp,_uuidv6:()=>zp,_uuidv7:()=>Op,_void:()=>J_,_xid:()=>$p,clone:()=>pt,config:()=>qe,decode:()=>HF,decodeAsync:()=>WF,encode:()=>XF,encodeAsync:()=>qF,flattenError:()=>Fs,formatError:()=>Bs,globalConfig:()=>As,globalRegistry:()=>Cr,isValidBase64:()=>Gb,isValidBase64URL:()=>YI,isValidJWT:()=>JI,locales:()=>oi,parse:()=>lp,parseAsync:()=>up,prettifyError:()=>Ig,regexes:()=>Ut,registry:()=>Ep,safeDecode:()=>JF,safeDecodeAsync:()=>QF,safeEncode:()=>YF,safeEncodeAsync:()=>KF,safeParse:()=>Cg,safeParseAsync:()=>Mg,toDotPath:()=>DI,toJSONSchema:()=>mv,treeifyError:()=>Tg,util:()=>N,version:()=>wb});m();m();var mg=Object.freeze({status:"aborted"});function M(t,e,r){var l;function i(u,p){var h,y;var f;Object.defineProperty(u,"_zod",{value:(h=u._zod)!=null?h:{},enumerable:!1}),(y=(f=u._zod).traits)!=null||(f.traits=new Set),u._zod.traits.add(t),e(u,p);for(let g in a.prototype)g in u||Object.defineProperty(u,g,{value:a.prototype[g].bind(u)});u._zod.constr=a,u._zod.def=p}s(i,"init");let n=(l=r==null?void 0:r.Parent)!=null?l:Object,c=class c extends n{};s(c,"Definition");let o=c;Object.defineProperty(o,"name",{value:t});function a(u){var h;var p;let f=r!=null&&r.Parent?new o:this;i(f,u),(h=(p=f._zod).deferred)!=null||(p.deferred=[]);for(let y of f._zod.deferred)y();return f}return s(a,"_"),Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:s(u=>{var p,f;return r!=null&&r.Parent&&u instanceof r.Parent?!0:(f=(p=u==null?void 0:u._zod)==null?void 0:p.traits)==null?void 0:f.has(t)},"value")}),Object.defineProperty(a,"name",{value:t}),a}s(M,"$constructor");var op=Symbol("zod_brand"),hg=class hg extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};s(hg,"$ZodAsyncError");var pr=hg,dg=class dg extends Error{constructor(e){super("Encountered unidirectional transform during encode: ".concat(e)),this.name="ZodEncodeError"}};s(dg,"$ZodEncodeError");var hn=dg,As={};function qe(t){return t&&Object.assign(As,t),As}s(qe,"config");m();m();var N={};kr(N,{BIGINT_FORMAT_RANGES:()=>wg,Class:()=>yg,NUMBER_FORMAT_RANGES:()=>Pg,aborted:()=>xn,allowsEval:()=>bg,assert:()=>SF,assertEqual:()=>_F,assertIs:()=>PF,assertNever:()=>wF,assertNotEqual:()=>vF,assignProp:()=>yn,base64ToUint8Array:()=>EI,base64urlToUint8Array:()=>$F,cached:()=>yo,captureStackTrace:()=>sp,cleanEnum:()=>NF,cleanRegex:()=>Ls,clone:()=>pt,cloneDef:()=>IF,createTransparentProxy:()=>LF,defineLazy:()=>ce,esc:()=>ap,escapeRegex:()=>Ir,extend:()=>OF,finalizeIssue:()=>Bt,floatSafeRemainder:()=>gg,getElementAtPath:()=>CF,getEnumValues:()=>ks,getLengthableOrigin:()=>Os,getParsedType:()=>kF,getSizableOrigin:()=>zs,hexToUint8Array:()=>jF,isObject:()=>ri,isPlainObject:()=>bn,issue:()=>go,joinValues:()=>E,jsonStringifyReplacer:()=>ho,merge:()=>FF,mergeDefs:()=>gn,normalizeParams:()=>$,nullish:()=>dn,numKeys:()=>EF,objectClone:()=>TF,omit:()=>zF,optionalKeys:()=>vg,partial:()=>BF,pick:()=>DF,prefixIssues:()=>Ft,primitiveTypes:()=>_g,promiseAllObject:()=>MF,propertyKeyTypes:()=>Ds,randomString:()=>AF,required:()=>UF,safeExtend:()=>RF,shallowClone:()=>xg,stringifyPrimitive:()=>U,uint8ArrayToBase64:()=>kI,uint8ArrayToBase64url:()=>VF,uint8ArrayToHex:()=>GF,unwrapMessage:()=>Es});m();function _F(t){return t}s(_F,"assertEqual");function vF(t){return t}s(vF,"assertNotEqual");function PF(t){}s(PF,"assertIs");function wF(t){throw new Error}s(wF,"assertNever");function SF(t){}s(SF,"assert");function ks(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}s(ks,"getEnumValues");function E(t,e="|"){return t.map(r=>U(r)).join(e)}s(E,"joinValues");function ho(t,e){return typeof e=="bigint"?e.toString():e}s(ho,"jsonStringifyReplacer");function yo(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}s(yo,"cached");function dn(t){return t==null}s(dn,"nullish");function Ls(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}s(Ls,"cleanRegex");function gg(t,e){let r=(t.toString().split(".")[1]||"").length,i=e.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let c=i.match(/\d?e-(\d?)/);c!=null&&c[1]&&(n=Number.parseInt(c[1]))}let o=r>n?r:n,a=Number.parseInt(t.toFixed(o).replace(".","")),l=Number.parseInt(e.toFixed(o).replace(".",""));return a%l/10**o}s(gg,"floatSafeRemainder");var AI=Symbol("evaluating");function ce(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==AI)return i===void 0&&(i=AI,i=r()),i},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}s(ce,"defineLazy");function TF(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}s(TF,"objectClone");function yn(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}s(yn,"assignProp");function gn(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}s(gn,"mergeDefs");function IF(t){return gn(t._zod.def)}s(IF,"cloneDef");function CF(t,e){return e?e.reduce((r,i)=>r==null?void 0:r[i],t):t}s(CF,"getElementAtPath");function MF(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}s(MF,"promiseAllObject");function AF(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}s(AF,"randomString");function ap(t){return JSON.stringify(t)}s(ap,"esc");var sp="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ri(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}s(ri,"isObject");var bg=yo(()=>{var t;if(typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{let e=Function;return new e(""),!0}catch(e){return!1}});function bn(t){if(ri(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(ri(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}s(bn,"isPlainObject");function xg(t){return bn(t)?C({},t):Array.isArray(t)?[...t]:t}s(xg,"shallowClone");function EF(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}s(EF,"numKeys");var kF=s(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error("Unknown data type: ".concat(e))}},"getParsedType"),Ds=new Set(["string","number","symbol"]),_g=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ir(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(Ir,"escapeRegex");function pt(t,e,r){let i=new t._zod.constr(e!=null?e:t._zod.def);return(!e||r!=null&&r.parent)&&(i._zod.parent=t),i}s(pt,"clone");function $(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:s(()=>e,"error")};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?j(C({},e),{error:s(()=>e.error,"error")}):e}s($,"normalizeParams");function LF(t){let e;return new Proxy({},{get(r,i,n){return e!=null||(e=t()),Reflect.get(e,i,n)},set(r,i,n,o){return e!=null||(e=t()),Reflect.set(e,i,n,o)},has(r,i){return e!=null||(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e!=null||(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e!=null||(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e!=null||(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e!=null||(e=t()),Reflect.defineProperty(e,i,n)}})}s(LF,"createTransparentProxy");function U(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?'"'.concat(t,'"'):"".concat(t)}s(U,"stringifyPrimitive");function vg(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}s(vg,"optionalKeys");var Pg={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},wg={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function DF(t,e){let r=t._zod.def,i=gn(t._zod.def,{get shape(){let n={};for(let o in e){if(!(o in r.shape))throw new Error('Unrecognized key: "'.concat(o,'"'));e[o]&&(n[o]=r.shape[o])}return yn(this,"shape",n),n},checks:[]});return pt(t,i)}s(DF,"pick");function zF(t,e){let r=t._zod.def,i=gn(t._zod.def,{get shape(){let n=C({},t._zod.def.shape);for(let o in e){if(!(o in r.shape))throw new Error('Unrecognized key: "'.concat(o,'"'));e[o]&&delete n[o]}return yn(this,"shape",n),n},checks:[]});return pt(t,i)}s(zF,"omit");function OF(t,e){if(!bn(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let n=gn(t._zod.def,{get shape(){let o=C(C({},t._zod.def.shape),e);return yn(this,"shape",o),o},checks:[]});return pt(t,n)}s(OF,"extend");function RF(t,e){if(!bn(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=j(C({},t._zod.def),{get shape(){let i=C(C({},t._zod.def.shape),e);return yn(this,"shape",i),i},checks:t._zod.def.checks});return pt(t,r)}s(RF,"safeExtend");function FF(t,e){let r=gn(t._zod.def,{get shape(){let i=C(C({},t._zod.def.shape),e._zod.def.shape);return yn(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return pt(t,r)}s(FF,"merge");function BF(t,e,r){let i=gn(e._zod.def,{get shape(){let n=e._zod.def.shape,o=C({},n);if(r)for(let a in r){if(!(a in n))throw new Error('Unrecognized key: "'.concat(a,'"'));r[a]&&(o[a]=t?new t({type:"optional",innerType:n[a]}):n[a])}else for(let a in n)o[a]=t?new t({type:"optional",innerType:n[a]}):n[a];return yn(this,"shape",o),o},checks:[]});return pt(e,i)}s(BF,"partial");function UF(t,e,r){let i=gn(e._zod.def,{get shape(){let n=e._zod.def.shape,o=C({},n);if(r)for(let a in r){if(!(a in o))throw new Error('Unrecognized key: "'.concat(a,'"'));r[a]&&(o[a]=new t({type:"nonoptional",innerType:n[a]}))}else for(let a in n)o[a]=new t({type:"nonoptional",innerType:n[a]});return yn(this,"shape",o),o},checks:[]});return pt(e,i)}s(UF,"required");function xn(t,e=0){var r;if(t.aborted===!0)return!0;for(let i=e;i<t.issues.length;i++)if(((r=t.issues[i])==null?void 0:r.continue)!==!0)return!0;return!1}s(xn,"aborted");function Ft(t,e){return e.map(r=>{var n;var i;return(n=(i=r).path)!=null||(i.path=[]),r.path.unshift(t),r})}s(Ft,"prefixIssues");function Es(t){return typeof t=="string"?t:t==null?void 0:t.message}s(Es,"unwrapMessage");function Bt(t,e,r){var n,o,a,l,c,u,p,f,h,y,g;let i=j(C({},t),{path:(n=t.path)!=null?n:[]});if(!t.message){let x=(g=(y=(f=(u=Es((l=(a=(o=t.inst)==null?void 0:o._zod.def)==null?void 0:a.error)==null?void 0:l.call(a,t)))!=null?u:Es((c=e==null?void 0:e.error)==null?void 0:c.call(e,t)))!=null?f:Es((p=r.customError)==null?void 0:p.call(r,t)))!=null?y:Es((h=r.localeError)==null?void 0:h.call(r,t)))!=null?g:"Invalid input";i.message=x}return delete i.inst,delete i.continue,e!=null&&e.reportInput||delete i.input,i}s(Bt,"finalizeIssue");function zs(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}s(zs,"getSizableOrigin");function Os(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}s(Os,"getLengthableOrigin");function go(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:C({},e)}s(go,"issue");function NF(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}s(NF,"cleanEnum");function EI(t){let e=atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}s(EI,"base64ToUint8Array");function kI(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}s(kI,"uint8ArrayToBase64");function $F(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return EI(e+r)}s($F,"base64urlToUint8Array");function VF(t){return kI(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}s(VF,"uint8ArrayToBase64url");function jF(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}s(jF,"hexToUint8Array");function GF(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}s(GF,"uint8ArrayToHex");var Sg=class Sg{constructor(...e){}};s(Sg,"Class");var yg=Sg;var LI=s((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,ho,2),Object.defineProperty(t,"toString",{value:s(()=>t.message,"value"),enumerable:!1})},"initializer"),Rs=M("$ZodError",LI),Pt=M("$ZodError",LI,{Parent:Error});function Fs(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}s(Fs,"flattenError");function Bs(t,e=r=>r.message){let r={_errors:[]},i=s(n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(e(o));else{let a=r,l=0;for(;l<o.path.length;){let c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(e(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}},"processError");return i(t),r}s(Bs,"formatError");function Tg(t,e=r=>r.message){let r={errors:[]},i=s((n,o=[])=>{var c,u,p,f;var a,l;for(let h of n.issues)if(h.code==="invalid_union"&&h.errors.length)h.errors.map(y=>i({issues:y},h.path));else if(h.code==="invalid_key")i({issues:h.issues},h.path);else if(h.code==="invalid_element")i({issues:h.issues},h.path);else{let y=[...o,...h.path];if(y.length===0){r.errors.push(e(h));continue}let g=r,x=0;for(;x<y.length;){let _=y[x],P=x===y.length-1;typeof _=="string"?((c=g.properties)!=null||(g.properties={}),(u=(a=g.properties)[_])!=null||(a[_]={errors:[]}),g=g.properties[_]):((p=g.items)!=null||(g.items=[]),(f=(l=g.items)[_])!=null||(l[_]={errors:[]}),g=g.items[_]),P&&g.errors.push(e(h)),x++}}},"processError");return i(t),r}s(Tg,"treeifyError");function DI(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push("[".concat(i,"]")):typeof i=="symbol"?e.push("[".concat(JSON.stringify(String(i)),"]")):/[^\w$]/.test(i)?e.push("[".concat(JSON.stringify(i),"]")):(e.length&&e.push("."),e.push(i));return e.join("")}s(DI,"toDotPath");function Ig(t){var i;let e=[],r=[...t.issues].sort((n,o)=>{var a,l;return((a=n.path)!=null?a:[]).length-((l=o.path)!=null?l:[]).length});for(let n of r)e.push("\u2716 ".concat(n.message)),(i=n.path)!=null&&i.length&&e.push(" \u2192 at ".concat(DI(n.path)));return e.join("\n")}s(Ig,"prettifyError");var bo=s(t=>(e,r,i,n)=>{var l;let o=i?Object.assign(i,{async:!1}):{async:!1},a=e._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new pr;if(a.issues.length){let c=new((l=n==null?void 0:n.Err)!=null?l:t)(a.issues.map(u=>Bt(u,o,qe())));throw sp(c,n==null?void 0:n.callee),c}return a.value},"_parse"),lp=bo(Pt),xo=s(t=>async(e,r,i,n)=>{var l;let o=i?Object.assign(i,{async:!0}):{async:!0},a=e._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new((l=n==null?void 0:n.Err)!=null?l:t)(a.issues.map(u=>Bt(u,o,qe())));throw sp(c,n==null?void 0:n.callee),c}return a.value},"_parseAsync"),up=xo(Pt),_o=s(t=>(e,r,i)=>{let n=i?j(C({},i),{async:!1}):{async:!1},o=e._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new pr;return o.issues.length?{success:!1,error:new(t!=null?t:Rs)(o.issues.map(a=>Bt(a,n,qe())))}:{success:!0,data:o.value}},"_safeParse"),Cg=_o(Pt),vo=s(t=>async(e,r,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(a=>Bt(a,n,qe())))}:{success:!0,data:o.value}},"_safeParseAsync"),Mg=vo(Pt),cp=s(t=>(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return bo(t)(e,r,n)},"_encode"),XF=cp(Pt),pp=s(t=>(e,r,i)=>bo(t)(e,r,i),"_decode"),HF=pp(Pt),mp=s(t=>async(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return xo(t)(e,r,n)},"_encodeAsync"),qF=mp(Pt),fp=s(t=>async(e,r,i)=>xo(t)(e,r,i),"_decodeAsync"),WF=fp(Pt),hp=s(t=>(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return _o(t)(e,r,n)},"_safeEncode"),YF=hp(Pt),dp=s(t=>(e,r,i)=>_o(t)(e,r,i),"_safeDecode"),JF=dp(Pt),yp=s(t=>async(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return vo(t)(e,r,n)},"_safeEncodeAsync"),KF=yp(Pt),gp=s(t=>async(e,r,i)=>vo(t)(e,r,i),"_safeDecodeAsync"),QF=gp(Pt);m();m();var Ut={};kr(Ut,{base64:()=>jg,base64url:()=>bp,bigint:()=>Yg,boolean:()=>Qg,browserEmail:()=>sB,cidrv4:()=>$g,cidrv6:()=>Vg,cuid:()=>Ag,cuid2:()=>Eg,date:()=>Xg,datetime:()=>qg,domain:()=>uB,duration:()=>Og,e164:()=>Zg,email:()=>Fg,emoji:()=>Bg,extendedDuration:()=>eB,guid:()=>Rg,hex:()=>cB,hostname:()=>Gg,html5Email:()=>iB,idnEmail:()=>aB,integer:()=>Jg,ipv4:()=>Ug,ipv6:()=>Ng,ksuid:()=>Dg,lowercase:()=>rb,md5_base64:()=>mB,md5_base64url:()=>fB,md5_hex:()=>pB,nanoid:()=>zg,null:()=>eb,number:()=>Kg,rfc5322Email:()=>oB,sha1_base64:()=>dB,sha1_base64url:()=>yB,sha1_hex:()=>hB,sha256_base64:()=>bB,sha256_base64url:()=>xB,sha256_hex:()=>gB,sha384_base64:()=>vB,sha384_base64url:()=>PB,sha384_hex:()=>_B,sha512_base64:()=>SB,sha512_base64url:()=>TB,sha512_hex:()=>wB,string:()=>Wg,time:()=>Hg,ulid:()=>kg,undefined:()=>tb,unicodeEmail:()=>zI,uppercase:()=>nb,uuid:()=>ni,uuid4:()=>tB,uuid6:()=>rB,uuid7:()=>nB,xid:()=>Lg});m();var Ag=/^[cC][^\s-]{8,}$/,Eg=/^[0-9a-z]+$/,kg=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Lg=/^[0-9a-vA-V]{20}$/,Dg=/^[A-Za-z0-9]{27}$/,zg=/^[a-zA-Z0-9_-]{21}$/,Og=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eB=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Rg=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ni=s(t=>t?new RegExp("^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-".concat(t,"[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$")):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),tB=ni(4),rB=ni(6),nB=ni(7),Fg=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,iB=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,oB=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,zI=new RegExp('^[^\\s@"]{1,64}@[^\\s@]{1,255}$',"u"),aB=zI,sB=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,lB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Bg(){return new RegExp(lB,"u")}s(Bg,"emoji");var Ug=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ng=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,$g=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Vg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bp=/^[A-Za-z0-9_-]*$/,Gg=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,uB=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Zg=/^\+(?:[0-9]){6,14}[0-9]$/,OI="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Xg=new RegExp("^".concat(OI,"$"));function RI(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?"".concat(e):t.precision===0?"".concat(e,":[0-5]\\d"):"".concat(e,":[0-5]\\d\\.\\d{").concat(t.precision,"}"):"".concat(e,"(?::[0-5]\\d(?:\\.\\d+)?)?")}s(RI,"timeSource");function Hg(t){return new RegExp("^".concat(RI(t),"$"))}s(Hg,"time");function qg(t){let e=RI({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i="".concat(e,"(?:").concat(r.join("|"),")");return new RegExp("^".concat(OI,"T(?:").concat(i,")$"))}s(qg,"datetime");var Wg=s(t=>{var r,i;let e=t?"[\\s\\S]{".concat((r=t==null?void 0:t.minimum)!=null?r:0,",").concat((i=t==null?void 0:t.maximum)!=null?i:"","}"):"[\\s\\S]*";return new RegExp("^".concat(e,"$"))},"string"),Yg=/^-?\d+n?$/,Jg=/^-?\d+$/,Kg=/^-?\d+(?:\.\d+)?/,Qg=/^(?:true|false)$/i,eb=/^null$/i;var tb=/^undefined$/i;var rb=/^[^A-Z]*$/,nb=/^[^a-z]*$/,cB=/^[0-9a-fA-F]*$/;function Us(t,e){return new RegExp("^[A-Za-z0-9+/]{".concat(t,"}").concat(e,"$"))}s(Us,"fixedBase64");function Ns(t){return new RegExp("^[A-Za-z0-9_-]{".concat(t,"}$"))}s(Ns,"fixedBase64url");var pB=/^[0-9a-fA-F]{32}$/,mB=Us(22,"=="),fB=Ns(22),hB=/^[0-9a-fA-F]{40}$/,dB=Us(27,"="),yB=Ns(27),gB=/^[0-9a-fA-F]{64}$/,bB=Us(43,"="),xB=Ns(43),_B=/^[0-9a-fA-F]{96}$/,vB=Us(64,""),PB=Ns(64),wB=/^[0-9a-fA-F]{128}$/,SB=Us(86,"=="),TB=Ns(86);var ke=M("$ZodCheck",(t,e)=>{var i,n;var r;(i=t._zod)!=null||(t._zod={}),t._zod.def=e,(n=(r=t._zod).onattach)!=null||(r.onattach=[])}),BI={number:"number",bigint:"bigint",object:"date"},xp=M("$ZodCheckLessThan",(t,e)=>{ke.init(t,e);let r=BI[typeof e.value];t._zod.onattach.push(i=>{var a;let n=i._zod.bag,o=(a=e.inclusive?n.maximum:n.exclusiveMaximum)!=null?a:Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),_p=M("$ZodCheckGreaterThan",(t,e)=>{ke.init(t,e);let r=BI[typeof e.value];t._zod.onattach.push(i=>{var a;let n=i._zod.bag,o=(a=e.inclusive?n.minimum:n.exclusiveMinimum)!=null?a:Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),ib=M("$ZodCheckMultipleOf",(t,e)=>{ke.init(t,e),t._zod.onattach.push(r=>{var n;var i;(n=(i=r._zod.bag).multipleOf)!=null||(i.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):gg(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),ob=M("$ZodCheckNumberFormat",(t,e)=>{var a;ke.init(t,e),e.format=e.format||"float64";let r=(a=e.format)==null?void 0:a.includes("int"),i=r?"int":"number",[n,o]=Pg[e.format];t._zod.onattach.push(l=>{let c=l._zod.bag;c.format=e.format,c.minimum=n,c.maximum=o,r&&(c.pattern=Jg)}),t._zod.check=l=>{let c=l.value;if(r){if(!Number.isInteger(c)){l.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,continue:!e.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,continue:!e.abort});return}}c<n&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),c>o&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inst:t})}}),ab=M("$ZodCheckBigIntFormat",(t,e)=>{ke.init(t,e);let[r,i]=wg[e.format];t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,o.minimum=r,o.maximum=i}),t._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:t})}}),sb=M("$ZodCheckMaxSize",(t,e)=>{var i;var r;ke.init(t,e),(i=(r=t._zod.def).when)!=null||(r.when=n=>{let o=n.value;return!dn(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{var a;let o=(a=n._zod.bag.maximum)!=null?a:Number.POSITIVE_INFINITY;e.maximum<o&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let o=n.value;o.size<=e.maximum||n.issues.push({origin:zs(o),code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),lb=M("$ZodCheckMinSize",(t,e)=>{var i;var r;ke.init(t,e),(i=(r=t._zod.def).when)!=null||(r.when=n=>{let o=n.value;return!dn(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{var a;let o=(a=n._zod.bag.minimum)!=null?a:Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;o.size>=e.minimum||n.issues.push({origin:zs(o),code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),ub=M("$ZodCheckSizeEquals",(t,e)=>{var i;var r;ke.init(t,e),(i=(r=t._zod.def).when)!=null||(r.when=n=>{let o=n.value;return!dn(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.size,o.maximum=e.size,o.size=e.size}),t._zod.check=n=>{let o=n.value,a=o.size;if(a===e.size)return;let l=a>e.size;n.issues.push(j(C({origin:zs(o)},l?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size}),{inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort}))}}),cb=M("$ZodCheckMaxLength",(t,e)=>{var i;var r;ke.init(t,e),(i=(r=t._zod.def).when)!=null||(r.when=n=>{let o=n.value;return!dn(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{var a;let o=(a=n._zod.bag.maximum)!=null?a:Number.POSITIVE_INFINITY;e.maximum<o&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let o=n.value;if(o.length<=e.maximum)return;let l=Os(o);n.issues.push({origin:l,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),pb=M("$ZodCheckMinLength",(t,e)=>{var i;var r;ke.init(t,e),(i=(r=t._zod.def).when)!=null||(r.when=n=>{let o=n.value;return!dn(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{var a;let o=(a=n._zod.bag.minimum)!=null?a:Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let l=Os(o);n.issues.push({origin:l,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),mb=M("$ZodCheckLengthEquals",(t,e)=>{var i;var r;ke.init(t,e),(i=(r=t._zod.def).when)!=null||(r.when=n=>{let o=n.value;return!dn(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,a=o.length;if(a===e.length)return;let l=Os(o),c=a>e.length;n.issues.push(j(C({origin:l},c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length}),{inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort}))}}),Po=M("$ZodCheckStringFormat",(t,e)=>{var n,o;var r,i;ke.init(t,e),t._zod.onattach.push(a=>{var c;let l=a._zod.bag;l.format=e.format,e.pattern&&((c=l.patterns)!=null||(l.patterns=new Set),l.patterns.add(e.pattern))}),e.pattern?(n=(r=t._zod).check)!=null||(r.check=a=>{e.pattern.lastIndex=0,!e.pattern.test(a.value)&&a.issues.push(j(C({origin:"string",code:"invalid_format",format:e.format,input:a.value},e.pattern?{pattern:e.pattern.toString()}:{}),{inst:t,continue:!e.abort}))}):(o=(i=t._zod).check)!=null||(i.check=()=>{})}),fb=M("$ZodCheckRegex",(t,e)=>{Po.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),hb=M("$ZodCheckLowerCase",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=rb),Po.init(t,e)}),db=M("$ZodCheckUpperCase",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=nb),Po.init(t,e)}),yb=M("$ZodCheckIncludes",(t,e)=>{ke.init(t,e);let r=Ir(e.includes),i=new RegExp(typeof e.position=="number"?"^.{".concat(e.position,"}").concat(r):r);e.pattern=i,t._zod.onattach.push(n=>{var a;let o=n._zod.bag;(a=o.patterns)!=null||(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),gb=M("$ZodCheckStartsWith",(t,e)=>{var i;ke.init(t,e);let r=new RegExp("^".concat(Ir(e.prefix),".*"));(i=e.pattern)!=null||(e.pattern=r),t._zod.onattach.push(n=>{var a;let o=n._zod.bag;(a=o.patterns)!=null||(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),bb=M("$ZodCheckEndsWith",(t,e)=>{var i;ke.init(t,e);let r=new RegExp(".*".concat(Ir(e.suffix),"$"));(i=e.pattern)!=null||(e.pattern=r),t._zod.onattach.push(n=>{var a;let o=n._zod.bag;(a=o.patterns)!=null||(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});function FI(t,e,r){t.issues.length&&e.issues.push(...Ft(r,t.issues))}s(FI,"handleCheckPropertyResult");var xb=M("$ZodCheckProperty",(t,e)=>{ke.init(t,e),t._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>FI(n,r,e.property));FI(i,r,e.property)}}),_b=M("$ZodCheckMimeType",(t,e)=>{ke.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),vb=M("$ZodCheckOverwrite",(t,e)=>{ke.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});m();var Pb=class Pb{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split("\n").filter(a=>a),n=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){var o;let e=Function,r=this==null?void 0:this.args,n=[...((o=this==null?void 0:this.content)!=null?o:[""]).map(a=>" ".concat(a))];return new e(...r,n.join("\n"))}};s(Pb,"Doc");var $s=Pb;m();var wb={major:4,minor:1,patch:12};var ee=M("$ZodType",(t,e)=>{var n,o,a;var r;t!=null||(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=wb;let i=[...(n=t._zod.def.checks)!=null?n:[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let l of i)for(let c of l._zod.onattach)c(t);if(i.length===0)(o=(r=t._zod).deferred)!=null||(r.deferred=[]),(a=t._zod.deferred)==null||a.push(()=>{t._zod.run=t._zod.parse});else{let l=s((u,p,f)=>{let h=xn(u),y;for(let g of p){if(g._zod.def.when){if(!g._zod.def.when(u))continue}else if(h)continue;let x=u.issues.length,_=g._zod.check(u);if(_ instanceof Promise&&(f==null?void 0:f.async)===!1)throw new pr;if(y||_ instanceof Promise)y=(y!=null?y:Promise.resolve()).then(async()=>{await _,u.issues.length!==x&&(h||(h=xn(u,x)))});else{if(u.issues.length===x)continue;h||(h=xn(u,x))}}return y?y.then(()=>u):u},"runChecks"),c=s((u,p,f)=>{if(xn(u))return u.aborted=!0,u;let h=l(p,i,f);if(h instanceof Promise){if(f.async===!1)throw new pr;return h.then(y=>t._zod.parse(y,f))}return t._zod.parse(h,f)},"handleCanaryResult");t._zod.run=(u,p)=>{if(p.skipChecks)return t._zod.parse(u,p);if(p.direction==="backward"){let h=t._zod.parse({value:u.value,issues:[]},j(C({},p),{skipChecks:!0}));return h instanceof Promise?h.then(y=>c(y,u,p)):c(h,u,p)}let f=t._zod.parse(u,p);if(f instanceof Promise){if(p.async===!1)throw new pr;return f.then(h=>l(h,i,p))}return l(f,i,p)}}t["~standard"]={validate:s(l=>{var c;try{let u=Cg(t,l);return u.success?{value:u.data}:{issues:(c=u.error)==null?void 0:c.issues}}catch(u){return Mg(t,l).then(p=>{var f;return p.success?{value:p.data}:{issues:(f=p.error)==null?void 0:f.issues}})}},"validate"),vendor:"zod",version:1}}),ii=M("$ZodString",(t,e)=>{var r,i,n;ee.init(t,e),t._zod.pattern=(n=[...(i=(r=t==null?void 0:t._zod.bag)==null?void 0:r.patterns)!=null?i:[]].pop())!=null?n:Wg(t._zod.bag),t._zod.parse=(o,a)=>{if(e.coerce)try{o.value=String(o.value)}catch(l){}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:t}),o}}),Se=M("$ZodStringFormat",(t,e)=>{Po.init(t,e),ii.init(t,e)}),Tb=M("$ZodGUID",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Rg),Se.init(t,e)}),Ib=M("$ZodUUID",(t,e)=>{var r,i;if(e.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(o===void 0)throw new Error('Invalid UUID version: "'.concat(e.version,'"'));(r=e.pattern)!=null||(e.pattern=ni(o))}else(i=e.pattern)!=null||(e.pattern=ni());Se.init(t,e)}),Cb=M("$ZodEmail",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Fg),Se.init(t,e)}),Mb=M("$ZodURL",(t,e)=>{Se.init(t,e),t._zod.check=r=>{try{let i=r.value.trim(),n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Gg.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=i;return}catch(i){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),Ab=M("$ZodEmoji",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Bg()),Se.init(t,e)}),Eb=M("$ZodNanoID",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=zg),Se.init(t,e)}),kb=M("$ZodCUID",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Ag),Se.init(t,e)}),Lb=M("$ZodCUID2",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Eg),Se.init(t,e)}),Db=M("$ZodULID",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=kg),Se.init(t,e)}),zb=M("$ZodXID",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Lg),Se.init(t,e)}),Ob=M("$ZodKSUID",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Dg),Se.init(t,e)}),Rb=M("$ZodISODateTime",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=qg(e)),Se.init(t,e)}),Fb=M("$ZodISODate",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Xg),Se.init(t,e)}),Bb=M("$ZodISOTime",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Hg(e)),Se.init(t,e)}),Ub=M("$ZodISODuration",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Og),Se.init(t,e)}),Nb=M("$ZodIPv4",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Ug),Se.init(t,e),t._zod.onattach.push(i=>{let n=i._zod.bag;n.format="ipv4"})}),$b=M("$ZodIPv6",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Ng),Se.init(t,e),t._zod.onattach.push(i=>{let n=i._zod.bag;n.format="ipv6"}),t._zod.check=i=>{try{new URL("http://[".concat(i.value,"]"))}catch(n){i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:t,continue:!e.abort})}}}),Vb=M("$ZodCIDRv4",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=$g),Se.init(t,e)}),jb=M("$ZodCIDRv6",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Vg),Se.init(t,e),t._zod.check=i=>{let n=i.value.split("/");try{if(n.length!==2)throw new Error;let[o,a]=n;if(!a)throw new Error;let l=Number(a);if("".concat(l)!==a)throw new Error;if(l<0||l>128)throw new Error;new URL("http://[".concat(o,"]"))}catch(o){i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:t,continue:!e.abort})}}});function Gb(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch(e){return!1}}s(Gb,"isValidBase64");var Zb=M("$ZodBase64",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=jg),Se.init(t,e),t._zod.onattach.push(i=>{i._zod.bag.contentEncoding="base64"}),t._zod.check=i=>{Gb(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:t,continue:!e.abort})}});function YI(t){if(!bp.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Gb(r)}s(YI,"isValidBase64URL");var Xb=M("$ZodBase64URL",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=bp),Se.init(t,e),t._zod.onattach.push(i=>{i._zod.bag.contentEncoding="base64url"}),t._zod.check=i=>{YI(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:t,continue:!e.abort})}}),Hb=M("$ZodE164",(t,e)=>{var r;(r=e.pattern)!=null||(e.pattern=Zg),Se.init(t,e)});function JI(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch(r){return!1}}s(JI,"isValidJWT");var qb=M("$ZodJWT",(t,e)=>{Se.init(t,e),t._zod.check=r=>{JI(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Wb=M("$ZodCustomStringFormat",(t,e)=>{Se.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),Ip=M("$ZodNumber",(t,e)=>{var r;ee.init(t,e),t._zod.pattern=(r=t._zod.bag.pattern)!=null?r:Kg,t._zod.parse=(i,n)=>{if(e.coerce)try{i.value=Number(i.value)}catch(l){}let o=i.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return i;let a=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return i.issues.push(C({expected:"number",code:"invalid_type",input:o,inst:t},a?{received:a}:{})),i}}),Yb=M("$ZodNumber",(t,e)=>{ob.init(t,e),Ip.init(t,e)}),Vs=M("$ZodBoolean",(t,e)=>{ee.init(t,e),t._zod.pattern=Qg,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=!!r.value}catch(o){}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),r}}),Cp=M("$ZodBigInt",(t,e)=>{ee.init(t,e),t._zod.pattern=Yg,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch(n){}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),Jb=M("$ZodBigInt",(t,e)=>{ab.init(t,e),Cp.init(t,e)}),Kb=M("$ZodSymbol",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r}}),Qb=M("$ZodUndefined",(t,e)=>{ee.init(t,e),t._zod.pattern=tb,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r}}),ex=M("$ZodNull",(t,e)=>{ee.init(t,e),t._zod.pattern=eb,t._zod.values=new Set([null]),t._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}}),tx=M("$ZodAny",(t,e)=>{ee.init(t,e),t._zod.parse=r=>r}),rx=M("$ZodUnknown",(t,e)=>{ee.init(t,e),t._zod.parse=r=>r}),nx=M("$ZodNever",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),ix=M("$ZodVoid",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r}}),ox=M("$ZodDate",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value)}catch(l){}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push(j(C({expected:"date",code:"invalid_type",input:n},o?{received:"Invalid Date"}:{}),{inst:t})),r}});function NI(t,e,r){t.issues.length&&e.issues.push(...Ft(r,t.issues)),e.value[r]=t.value}s(NI,"handleArrayResult");var ax=M("$ZodArray",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let o=[];for(let a=0;a<n.length;a++){let l=n[a],c=e.element._zod.run({value:l,issues:[]},i);c instanceof Promise?o.push(c.then(u=>NI(u,r,a))):NI(c,r,a)}return o.length?Promise.all(o).then(()=>r):r}});function Tp(t,e,r,i){t.issues.length&&e.issues.push(...Ft(r,t.issues)),t.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=t.value}s(Tp,"handlePropertyResult");function KI(t){var i,n,o,a;let e=Object.keys(t.shape);for(let l of e)if(!((a=(o=(n=(i=t.shape)==null?void 0:i[l])==null?void 0:n._zod)==null?void 0:o.traits)!=null&&a.has("$ZodType")))throw new Error('Invalid element at key "'.concat(l,'": expected a Zod schema'));let r=vg(t.shape);return j(C({},t),{keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)})}s(KI,"normalizeDef");function QI(t,e,r,i,n,o){let a=[],l=n.keySet,c=n.catchall._zod,u=c.def.type;for(let p of Object.keys(e)){if(l.has(p))continue;if(u==="never"){a.push(p);continue}let f=c.run({value:e[p],issues:[]},i);f instanceof Promise?t.push(f.then(h=>Tp(h,r,p,e))):Tp(f,r,p,e)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),t.length?Promise.all(t).then(()=>r):r}s(QI,"handleCatchall");var eC=M("$ZodObject",(t,e)=>{ee.init(t,e);let r=Object.getOwnPropertyDescriptor(e,"shape");if(!(r!=null&&r.get)){let l=e.shape;Object.defineProperty(e,"shape",{get:s(()=>{let c=C({},l);return Object.defineProperty(e,"shape",{value:c}),c},"get")})}let i=yo(()=>KI(e));ce(t._zod,"propValues",()=>{var u;let l=e.shape,c={};for(let p in l){let f=l[p]._zod;if(f.values){(u=c[p])!=null||(c[p]=new Set);for(let h of f.values)c[p].add(h)}}return c});let n=ri,o=e.catchall,a;t._zod.parse=(l,c)=>{a!=null||(a=i.value);let u=l.value;if(!n(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),l;l.value={};let p=[],f=a.shape;for(let h of a.keys){let g=f[h]._zod.run({value:u[h],issues:[]},c);g instanceof Promise?p.push(g.then(x=>Tp(x,l,h,u))):Tp(g,l,h,u)}return o?QI(p,u,l,c,i.value,t):p.length?Promise.all(p).then(()=>l):l}}),sx=M("$ZodObjectJIT",(t,e)=>{eC.init(t,e);let r=t._zod.parse,i=yo(()=>KI(e)),n=s(h=>{let y=new $s(["shape","payload","ctx"]),g=i.value,x=s(v=>{let w=ap(v);return"shape[".concat(w,"]._zod.run({ value: input[").concat(w,"], issues: [] }, ctx)")},"parseStr");y.write("const input = payload.value;");let _=Object.create(null),P=0;for(let v of g.keys)_[v]="key_".concat(P++);y.write("const newResult = {};");for(let v of g.keys){let w=_[v],T=ap(v);y.write("const ".concat(w," = ").concat(x(v),";")),y.write("\n if (".concat(w,".issues.length) {\n payload.issues = payload.issues.concat(").concat(w,".issues.map(iss => ({\n ...iss,\n path: iss.path ? [").concat(T,", ...iss.path] : [").concat(T,"]\n })));\n }\n \n \n if (").concat(w,".value === undefined) {\n if (").concat(T," in input) {\n newResult[").concat(T,"] = undefined;\n }\n } else {\n newResult[").concat(T,"] = ").concat(w,".value;\n }\n \n "))}y.write("payload.value = newResult;"),y.write("return payload;");let I=y.compile();return(v,w)=>I(h,v,w)},"generateFastpass"),o,a=ri,l=!As.jitless,u=l&&bg.value,p=e.catchall,f;t._zod.parse=(h,y)=>{f!=null||(f=i.value);let g=h.value;return a(g)?l&&u&&(y==null?void 0:y.async)===!1&&y.jitless!==!0?(o||(o=n(e.shape)),h=o(h,y),p?QI([],g,h,y,f,t):h):r(h,y):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),h)}});function $I(t,e,r,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let n=t.filter(o=>!xn(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(a=>Bt(a,i,qe())))}),e)}s($I,"handleUnionResults");var Mp=M("$ZodUnion",(t,e)=>{ee.init(t,e),ce(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),ce(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ce(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),ce(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp("^(".concat(n.map(o=>Ls(o.source)).join("|"),")$"))}});let r=e.options.length===1,i=e.options[0]._zod.run;t._zod.parse=(n,o)=>{if(r)return i(n,o);let a=!1,l=[];for(let c of e.options){let u=c._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)l.push(u),a=!0;else{if(u.issues.length===0)return u;l.push(u)}}return a?Promise.all(l).then(c=>$I(c,n,t,o)):$I(l,n,t,o)}}),lx=M("$ZodDiscriminatedUnion",(t,e)=>{Mp.init(t,e);let r=t._zod.parse;ce(t._zod,"propValues",()=>{let n={};for(let o of e.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error('Invalid discriminated union option at index "'.concat(e.options.indexOf(o),'"'));for(let[l,c]of Object.entries(a)){n[l]||(n[l]=new Set);for(let u of c)n[l].add(u)}}return n});let i=yo(()=>{var a;let n=e.options,o=new Map;for(let l of n){let c=(a=l._zod.propValues)==null?void 0:a[e.discriminator];if(!c||c.size===0)throw new Error('Invalid discriminated union option at index "'.concat(e.options.indexOf(l),'"'));for(let u of c){if(o.has(u))throw new Error('Duplicate discriminator value "'.concat(String(u),'"'));o.set(u,l)}}return o});t._zod.parse=(n,o)=>{let a=n.value;if(!ri(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),n;let l=i.value.get(a==null?void 0:a[e.discriminator]);return l?l._zod.run(n,o):e.unionFallback?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:t}),n)}}),ux=M("$ZodIntersection",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>{let n=r.value,o=e.left._zod.run({value:n,issues:[]},i),a=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,u])=>VI(r,c,u)):VI(r,o,a)}});function Sb(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(bn(t)&&bn(e)){let r=Object.keys(e),i=Object.keys(t).filter(o=>r.indexOf(o)!==-1),n=C(C({},t),e);for(let o of i){let a=Sb(t[o],e[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let n=t[i],o=e[i],a=Sb(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}s(Sb,"mergeValues");function VI(t,e,r){if(e.issues.length&&t.issues.push(...e.issues),r.issues.length&&t.issues.push(...r.issues),xn(t))return t;let i=Sb(e.value,r.value);if(!i.valid)throw new Error("Unmergable intersection. Error path: "+"".concat(JSON.stringify(i.mergeErrorPath)));return t.value=i.data,t}s(VI,"handleIntersectionResults");var Ap=M("$ZodTuple",(t,e)=>{ee.init(t,e);let r=e.items,i=r.length-[...r].reverse().findIndex(n=>n._zod.optin!=="optional");t._zod.parse=(n,o)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let l=[];if(!e.rest){let u=a.length>r.length,p=a.length<i-1;if(u||p)return n.issues.push(j(C({},u?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}),{input:a,inst:t,origin:"array"})),n}let c=-1;for(let u of r){if(c++,c>=a.length&&c>=i)continue;let p=u._zod.run({value:a[c],issues:[]},o);p instanceof Promise?l.push(p.then(f=>vp(f,n,c))):vp(p,n,c)}if(e.rest){let u=a.slice(r.length);for(let p of u){c++;let f=e.rest._zod.run({value:p,issues:[]},o);f instanceof Promise?l.push(f.then(h=>vp(h,n,c))):vp(f,n,c)}}return l.length?Promise.all(l).then(()=>n):n}});function vp(t,e,r){t.issues.length&&e.issues.push(...Ft(r,t.issues)),e.value[r]=t.value}s(vp,"handleTupleResult");var cx=M("$ZodRecord",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!bn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let o=[];if(e.keyType._zod.values){let a=e.keyType._zod.values;r.value={};for(let c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){let u=e.valueType._zod.run({value:n[c],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...Ft(c,p.issues)),r.value[c]=p.value})):(u.issues.length&&r.issues.push(...Ft(c,u.issues)),r.value[c]=u.value)}let l;for(let c in n)a.has(c)||(l=l!=null?l:[],l.push(c));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:l})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__")continue;let l=e.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>Bt(u,i,qe())),input:a,path:[a],inst:t}),r.value[l.value]=l.value;continue}let c=e.valueType._zod.run({value:n[a],issues:[]},i);c instanceof Promise?o.push(c.then(u=>{u.issues.length&&r.issues.push(...Ft(a,u.issues)),r.value[l.value]=u.value})):(c.issues.length&&r.issues.push(...Ft(a,c.issues)),r.value[l.value]=c.value)}}return o.length?Promise.all(o).then(()=>r):r}}),px=M("$ZodMap",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:t}),r;let o=[];r.value=new Map;for(let[a,l]of n){let c=e.keyType._zod.run({value:a,issues:[]},i),u=e.valueType._zod.run({value:l,issues:[]},i);c instanceof Promise||u instanceof Promise?o.push(Promise.all([c,u]).then(([p,f])=>{jI(p,f,r,a,n,t,i)})):jI(c,u,r,a,n,t,i)}return o.length?Promise.all(o).then(()=>r):r}});function jI(t,e,r,i,n,o,a){t.issues.length&&(Ds.has(typeof i)?r.issues.push(...Ft(i,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:t.issues.map(l=>Bt(l,a,qe()))})),e.issues.length&&(Ds.has(typeof i)?r.issues.push(...Ft(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(l=>Bt(l,a,qe()))})),r.value.set(t.value,e.value)}s(jI,"handleMapResult");var mx=M("$ZodSet",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:t,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let a of n){let l=e.valueType._zod.run({value:a,issues:[]},i);l instanceof Promise?o.push(l.then(c=>GI(c,r))):GI(l,r)}return o.length?Promise.all(o).then(()=>r):r}});function GI(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}s(GI,"handleSetResult");var fx=M("$ZodEnum",(t,e)=>{ee.init(t,e);let r=ks(e.entries),i=new Set(r);t._zod.values=i,t._zod.pattern=new RegExp("^(".concat(r.filter(n=>Ds.has(typeof n)).map(n=>typeof n=="string"?Ir(n):n.toString()).join("|"),")$")),t._zod.parse=(n,o)=>{let a=n.value;return i.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:t}),n}}),hx=M("$ZodLiteral",(t,e)=>{if(ee.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");t._zod.values=new Set(e.values),t._zod.pattern=new RegExp("^(".concat(e.values.map(r=>typeof r=="string"?Ir(r):r?Ir(r.toString()):String(r)).join("|"),")$")),t._zod.parse=(r,i)=>{let n=r.value;return t._zod.values.has(n)||r.issues.push({code:"invalid_value",values:e.values,input:n,inst:t}),r}}),dx=M("$ZodFile",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),r}}),yx=M("$ZodTransform",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new hn(t.constructor.name);let n=e.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r));if(n instanceof Promise)throw new pr;return r.value=n,r}});function ZI(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}s(ZI,"handleOptionalResult");var gx=M("$ZodOptional",(t,e)=>{ee.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ce(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ce(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp("^(".concat(Ls(r.source),")?$")):void 0}),t._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>ZI(o,r.value)):ZI(n,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),bx=M("$ZodNullable",(t,e)=>{ee.init(t,e),ce(t._zod,"optin",()=>e.innerType._zod.optin),ce(t._zod,"optout",()=>e.innerType._zod.optout),ce(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp("^(".concat(Ls(r.source),"|null)$")):void 0}),ce(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),xx=M("$ZodDefault",(t,e)=>{ee.init(t,e),t._zod.optin="optional",ce(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>XI(o,e)):XI(n,e)}});function XI(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}s(XI,"handleDefaultResult");var _x=M("$ZodPrefault",(t,e)=>{ee.init(t,e),t._zod.optin="optional",ce(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),vx=M("$ZodNonOptional",(t,e)=>{ee.init(t,e),ce(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>HI(o,t)):HI(n,t)}});function HI(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}s(HI,"handleNonOptionalResult");var Px=M("$ZodSuccess",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new hn("ZodSuccess");let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),wx=M("$ZodCatch",(t,e)=>{ee.init(t,e),ce(t._zod,"optin",()=>e.innerType._zod.optin),ce(t._zod,"optout",()=>e.innerType._zod.optout),ce(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue(j(C({},r),{error:{issues:o.issues.map(a=>Bt(a,i,qe()))},input:r.value})),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue(j(C({},r),{error:{issues:n.issues.map(o=>Bt(o,i,qe()))},input:r.value})),r.issues=[]),r)}}),Sx=M("$ZodNaN",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),Tx=M("$ZodPipe",(t,e)=>{ee.init(t,e),ce(t._zod,"values",()=>e.in._zod.values),ce(t._zod,"optin",()=>e.in._zod.optin),ce(t._zod,"optout",()=>e.out._zod.optout),ce(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(a=>Pp(a,e.in,i)):Pp(o,e.in,i)}let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(o=>Pp(o,e.out,i)):Pp(n,e.out,i)}});function Pp(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}s(Pp,"handlePipeResult");var js=M("$ZodCodec",(t,e)=>{ee.init(t,e),ce(t._zod,"values",()=>e.in._zod.values),ce(t._zod,"optin",()=>e.in._zod.optin),ce(t._zod,"optout",()=>e.out._zod.optout),ce(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(r,i);return o instanceof Promise?o.then(a=>wp(a,e,i)):wp(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(a=>wp(a,e,i)):wp(o,e,i)}}});function wp(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>Sp(t,o,e.out,r)):Sp(t,n,e.out,r)}else{let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(o=>Sp(t,o,e.in,r)):Sp(t,n,e.in,r)}}s(wp,"handleCodecAResult");function Sp(t,e,r,i){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},i)}s(Sp,"handleCodecTxResult");var Ix=M("$ZodReadonly",(t,e)=>{ee.init(t,e),ce(t._zod,"propValues",()=>e.innerType._zod.propValues),ce(t._zod,"values",()=>e.innerType._zod.values),ce(t._zod,"optin",()=>e.innerType._zod.optin),ce(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(qI):qI(n)}});function qI(t){return t.value=Object.freeze(t.value),t}s(qI,"handleReadonlyResult");var Cx=M("$ZodTemplateLiteral",(t,e)=>{ee.init(t,e);let r=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error("Invalid template literal part, no pattern found: ".concat([...i._zod.traits].shift()));let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error("Invalid template literal part: ".concat(i._zod.traits));let o=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,a))}else if(i===null||_g.has(typeof i))r.push(Ir("".concat(i)));else throw new Error("Invalid template literal part: ".concat(i));t._zod.pattern=new RegExp("^".concat(r.join(""),"$")),t._zod.parse=(i,n)=>{var o;return typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"template_literal",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:(o=e.format)!=null?o:"template_literal",pattern:t._zod.pattern.source}),i)}}),Mx=M("$ZodFunction",(t,e)=>(ee.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let n=t._def.input?lp(t._def.input,i):i,o=Reflect.apply(r,this,n);return t._def.output?lp(t._def.output,o):o}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=t._def.input?await up(t._def.input,i):i,o=await Reflect.apply(r,this,n);return t._def.output?await up(t._def.output,o):o}},t._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let i=t.constructor;return Array.isArray(r[0])?new i({type:"function",input:new Ap({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new i({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:r})},t)),Ax=M("$ZodPromise",(t,e)=>{ee.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),Ex=M("$ZodLazy",(t,e)=>{ee.init(t,e),ce(t._zod,"innerType",()=>e.getter()),ce(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),ce(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),ce(t._zod,"optin",()=>{var r;return(r=t._zod.innerType._zod.optin)!=null?r:void 0}),ce(t._zod,"optout",()=>{var r;return(r=t._zod.innerType._zod.optout)!=null?r:void 0}),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i)}),kx=M("$ZodCustom",(t,e)=>{ke.init(t,e),ee.init(t,e),t._zod.parse=(r,i)=>r,t._zod.check=r=>{let i=r.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>WI(o,r,i,t));WI(n,r,i,t)}});function WI(t,e,r,i){var n;if(!t){let o={code:"custom",input:r,inst:i,path:[...(n=i._zod.def.path)!=null?n:[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),e.issues.push(go(o))}}s(WI,"handleRefineResult");var oi={};kr(oi,{ar:()=>Lx,az:()=>Dx,be:()=>zx,bg:()=>Ox,ca:()=>Rx,cs:()=>Fx,da:()=>Bx,de:()=>Ux,en:()=>Gs,eo:()=>Nx,es:()=>$x,fa:()=>Vx,fi:()=>jx,fr:()=>Gx,frCA:()=>Zx,he:()=>Xx,hu:()=>Hx,id:()=>qx,is:()=>Wx,it:()=>Yx,ja:()=>Jx,ka:()=>Kx,kh:()=>Qx,km:()=>Zs,ko:()=>e_,lt:()=>t_,mk:()=>r_,ms:()=>n_,nl:()=>i_,no:()=>o_,ota:()=>a_,pl:()=>l_,ps:()=>s_,pt:()=>u_,ru:()=>c_,sl:()=>p_,sv:()=>m_,ta:()=>f_,th:()=>h_,tr:()=>d_,ua:()=>y_,uk:()=>qs,ur:()=>g_,vi:()=>b_,yo:()=>v_,zhCN:()=>x_,zhTW:()=>__});m();m();var CB=s(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ".concat(n.expected,"\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ".concat(U(n.values[0])):"\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?" \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ".concat((o=n.origin)!=null?o:"\u0627\u0644\u0642\u064A\u0645\u0629"," ").concat(u," ").concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"\u0639\u0646\u0635\u0631"):"\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ".concat((l=n.origin)!=null?l:"\u0627\u0644\u0642\u064A\u0645\u0629"," ").concat(u," ").concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ".concat(n.origin," \u0623\u0646 \u064A\u0643\u0648\u0646 ").concat(u," ").concat(n.minimum.toString()," ").concat(p.unit):"\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ".concat(n.origin," \u0623\u0646 \u064A\u0643\u0648\u0646 ").concat(u," ").concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "'.concat(n.prefix,'"'):u.format==="ends_with"?'\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "'.concat(u.suffix,'"'):u.format==="includes"?'\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "'.concat(u.includes,'"'):u.format==="regex"?"\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ".concat(u.pattern):"".concat((c=i[u.format])!=null?c:n.format," \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644")}case"not_multiple_of":return"\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ".concat(n.divisor);case"unrecognized_keys":return"\u0645\u0639\u0631\u0641".concat(n.keys.length>1?"\u0627\u062A":""," \u063A\u0631\u064A\u0628").concat(n.keys.length>1?"\u0629":"",": ").concat(E(n.keys,"\u060C "));case"invalid_key":return"\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ".concat(n.origin);case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ".concat(n.origin);default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function Lx(){return{localeError:CB()}}s(Lx,"default");m();var MB=s(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ".concat(n.expected,", daxil olan ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ".concat(U(n.values[0])):"Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ".concat((o=n.origin)!=null?o:"d\u0259y\u0259r"," ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"element"):"\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ".concat((l=n.origin)!=null?l:"d\u0259y\u0259r"," ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ".concat(n.origin," ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ".concat(n.origin," ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'Yanl\u0131\u015F m\u0259tn: "'.concat(u.prefix,'" il\u0259 ba\u015Flamal\u0131d\u0131r'):u.format==="ends_with"?'Yanl\u0131\u015F m\u0259tn: "'.concat(u.suffix,'" il\u0259 bitm\u0259lidir'):u.format==="includes"?'Yanl\u0131\u015F m\u0259tn: "'.concat(u.includes,'" daxil olmal\u0131d\u0131r'):u.format==="regex"?"Yanl\u0131\u015F m\u0259tn: ".concat(u.pattern," \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r"):"Yanl\u0131\u015F ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"Yanl\u0131\u015F \u0259d\u0259d: ".concat(n.divisor," il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r");case"unrecognized_keys":return"Tan\u0131nmayan a\xE7ar".concat(n.keys.length>1?"lar":"",": ").concat(E(n.keys,", "));case"invalid_key":return"".concat(n.origin," daxilind\u0259 yanl\u0131\u015F a\xE7ar");case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return"".concat(n.origin," daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r");default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function Dx(){return{localeError:MB()}}s(Dx,"default");m();function tC(t,e,r,i){let n=Math.abs(t),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?r:i}s(tC,"getBelarusianPlural");var AB=s(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0456\u045E";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return n=>{var o,a,l;switch(n.code){case"invalid_type":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ".concat(n.expected,", \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ".concat(U(n.values[0])):"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ".concat(E(n.values,"|"));case"too_big":{let c=n.inclusive?"<=":"<",u=e(n.origin);if(u){let p=Number(n.maximum),f=tC(p,u.unit.one,u.unit.few,u.unit.many);return"\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ".concat((o=n.origin)!=null?o:"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"," \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ").concat(u.verb," ").concat(c).concat(n.maximum.toString()," ").concat(f)}return"\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ".concat((a=n.origin)!=null?a:"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"," \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ").concat(c).concat(n.maximum.toString())}case"too_small":{let c=n.inclusive?">=":">",u=e(n.origin);if(u){let p=Number(n.minimum),f=tC(p,u.unit.one,u.unit.few,u.unit.many);return"\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ".concat(n.origin," \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ").concat(u.verb," ").concat(c).concat(n.minimum.toString()," ").concat(f)}return"\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ".concat(n.origin," \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ").concat(c).concat(n.minimum.toString())}case"invalid_format":{let c=n;return c.format==="starts_with"?'\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "'.concat(c.prefix,'"'):c.format==="ends_with"?'\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "'.concat(c.suffix,'"'):c.format==="includes"?'\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "'.concat(c.includes,'"'):c.format==="regex"?"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ".concat(c.pattern):"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ".concat((l=i[c.format])!=null?l:n.format)}case"not_multiple_of":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ".concat(n.divisor);case"unrecognized_keys":return"\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ".concat(n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447",": ").concat(E(n.keys,", "));case"invalid_key":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ".concat(n.origin);case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ".concat(n.origin);default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function zx(){return{localeError:AB()}}s(zx,"default");m();var EB=s(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(t))return"\u043C\u0430\u0441\u0438\u0432";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),kB=s(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(i){var n;return(n=t[i])!=null?n:null}s(e,"getSizing");let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"};return i=>{var n,o,a,l;switch(i.code){case"invalid_type":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ".concat(i.expected,", \u043F\u043E\u043B\u0443\u0447\u0435\u043D ").concat(EB(i.input));case"invalid_value":return i.values.length===1?"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ".concat(U(i.values[0])):"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ".concat(E(i.values,"|"));case"too_big":{let c=i.inclusive?"<=":"<",u=e(i.origin);return u?"\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ".concat((n=i.origin)!=null?n:"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"," \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ").concat(c).concat(i.maximum.toString()," ").concat((o=u.unit)!=null?o:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"):"\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ".concat((a=i.origin)!=null?a:"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"," \u0434\u0430 \u0431\u044A\u0434\u0435 ").concat(c).concat(i.maximum.toString())}case"too_small":{let c=i.inclusive?">=":">",u=e(i.origin);return u?"\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ".concat(i.origin," \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ").concat(c).concat(i.minimum.toString()," ").concat(u.unit):"\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ".concat(i.origin," \u0434\u0430 \u0431\u044A\u0434\u0435 ").concat(c).concat(i.minimum.toString())}case"invalid_format":{let c=i;if(c.format==="starts_with")return'\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "'.concat(c.prefix,'"');if(c.format==="ends_with")return'\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "'.concat(c.suffix,'"');if(c.format==="includes")return'\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "'.concat(c.includes,'"');if(c.format==="regex")return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ".concat(c.pattern);let u="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return c.format==="emoji"&&(u="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),c.format==="datetime"&&(u="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),c.format==="date"&&(u="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),c.format==="time"&&(u="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),c.format==="duration"&&(u="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),"".concat(u," ").concat((l=r[c.format])!=null?l:i.format)}case"not_multiple_of":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ".concat(i.divisor);case"unrecognized_keys":return"\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442".concat(i.keys.length>1?"\u0438":""," \u043A\u043B\u044E\u0447").concat(i.keys.length>1?"\u043E\u0432\u0435":"",": ").concat(E(i.keys,", "));case"invalid_key":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ".concat(i.origin);case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ".concat(i.origin);default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},"error");function Ox(){return{localeError:kB()}}s(Ox,"default");m();var LB=s(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"Tipus inv\xE0lid: s'esperava ".concat(n.expected,", s'ha rebut ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Valor inv\xE0lid: s'esperava ".concat(U(n.values[0])):"Opci\xF3 inv\xE0lida: s'esperava una de ".concat(E(n.values," o "));case"too_big":{let u=n.inclusive?"com a m\xE0xim":"menys de",p=e(n.origin);return p?"Massa gran: s'esperava que ".concat((o=n.origin)!=null?o:"el valor"," contingu\xE9s ").concat(u," ").concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"elements"):"Massa gran: s'esperava que ".concat((l=n.origin)!=null?l:"el valor"," fos ").concat(u," ").concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?"com a m\xEDnim":"m\xE9s de",p=e(n.origin);return p?"Massa petit: s'esperava que ".concat(n.origin," contingu\xE9s ").concat(u," ").concat(n.minimum.toString()," ").concat(p.unit):"Massa petit: s'esperava que ".concat(n.origin," fos ").concat(u," ").concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'Format inv\xE0lid: ha de comen\xE7ar amb "'.concat(u.prefix,'"'):u.format==="ends_with"?"Format inv\xE0lid: ha d'acabar amb \"".concat(u.suffix,'"'):u.format==="includes"?"Format inv\xE0lid: ha d'incloure \"".concat(u.includes,'"'):u.format==="regex"?"Format inv\xE0lid: ha de coincidir amb el patr\xF3 ".concat(u.pattern):"Format inv\xE0lid per a ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ".concat(n.divisor);case"unrecognized_keys":return"Clau".concat(n.keys.length>1?"s":""," no reconeguda").concat(n.keys.length>1?"s":"",": ").concat(E(n.keys,", "));case"invalid_key":return"Clau inv\xE0lida a ".concat(n.origin);case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return"Element inv\xE0lid a ".concat(n.origin);default:return"Entrada inv\xE0lida"}}},"error");function Rx(){return{localeError:LB()}}s(Rx,"default");m();var DB=s(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return n=>{var o,a,l,c,u,p,f;switch(n.code){case"invalid_type":return"Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ".concat(n.expected,", obdr\u017Eeno ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ".concat(U(n.values[0])):"Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ".concat(E(n.values,"|"));case"too_big":{let h=n.inclusive?"<=":"<",y=e(n.origin);return y?"Hodnota je p\u0159\xEDli\u0161 velk\xE1: ".concat((o=n.origin)!=null?o:"hodnota"," mus\xED m\xEDt ").concat(h).concat(n.maximum.toString()," ").concat((a=y.unit)!=null?a:"prvk\u016F"):"Hodnota je p\u0159\xEDli\u0161 velk\xE1: ".concat((l=n.origin)!=null?l:"hodnota"," mus\xED b\xFDt ").concat(h).concat(n.maximum.toString())}case"too_small":{let h=n.inclusive?">=":">",y=e(n.origin);return y?"Hodnota je p\u0159\xEDli\u0161 mal\xE1: ".concat((c=n.origin)!=null?c:"hodnota"," mus\xED m\xEDt ").concat(h).concat(n.minimum.toString()," ").concat((u=y.unit)!=null?u:"prvk\u016F"):"Hodnota je p\u0159\xEDli\u0161 mal\xE1: ".concat((p=n.origin)!=null?p:"hodnota"," mus\xED b\xFDt ").concat(h).concat(n.minimum.toString())}case"invalid_format":{let h=n;return h.format==="starts_with"?'Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "'.concat(h.prefix,'"'):h.format==="ends_with"?'Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "'.concat(h.suffix,'"'):h.format==="includes"?'Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "'.concat(h.includes,'"'):h.format==="regex"?"Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ".concat(h.pattern):"Neplatn\xFD form\xE1t ".concat((f=i[h.format])!=null?f:n.format)}case"not_multiple_of":return"Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ".concat(n.divisor);case"unrecognized_keys":return"Nezn\xE1m\xE9 kl\xED\u010De: ".concat(E(n.keys,", "));case"invalid_key":return"Neplatn\xFD kl\xED\u010D v ".concat(n.origin);case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return"Neplatn\xE1 hodnota v ".concat(n.origin);default:return"Neplatn\xFD vstup"}}},"error");function Fx(){return{localeError:DB()}}s(Fx,"default");m();var zB=s(()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},e={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};function r(a){var l;return(l=t[a])!=null?l:null}s(r,"getSizing");function i(a){var l;return(l=e[a])!=null?l:a}s(i,"getTypeName");let n=s(a=>{let l=typeof a;switch(l){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return l},"parsedType"),o={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return a=>{var l,c;switch(a.code){case"invalid_type":return"Ugyldigt input: forventede ".concat(i(a.expected),", fik ").concat(i(n(a.input)));case"invalid_value":return a.values.length===1?"Ugyldig v\xE6rdi: forventede ".concat(U(a.values[0])):"Ugyldigt valg: forventede en af f\xF8lgende ".concat(E(a.values,"|"));case"too_big":{let u=a.inclusive?"<=":"<",p=r(a.origin),f=i(a.origin);return p?"For stor: forventede ".concat(f!=null?f:"value"," ").concat(p.verb," ").concat(u," ").concat(a.maximum.toString()," ").concat((l=p.unit)!=null?l:"elementer"):"For stor: forventede ".concat(f!=null?f:"value"," havde ").concat(u," ").concat(a.maximum.toString())}case"too_small":{let u=a.inclusive?">=":">",p=r(a.origin),f=i(a.origin);return p?"For lille: forventede ".concat(f," ").concat(p.verb," ").concat(u," ").concat(a.minimum.toString()," ").concat(p.unit):"For lille: forventede ".concat(f," havde ").concat(u," ").concat(a.minimum.toString())}case"invalid_format":{let u=a;return u.format==="starts_with"?'Ugyldig streng: skal starte med "'.concat(u.prefix,'"'):u.format==="ends_with"?'Ugyldig streng: skal ende med "'.concat(u.suffix,'"'):u.format==="includes"?'Ugyldig streng: skal indeholde "'.concat(u.includes,'"'):u.format==="regex"?"Ugyldig streng: skal matche m\xF8nsteret ".concat(u.pattern):"Ugyldig ".concat((c=o[u.format])!=null?c:a.format)}case"not_multiple_of":return"Ugyldigt tal: skal v\xE6re deleligt med ".concat(a.divisor);case"unrecognized_keys":return"".concat(a.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle",": ").concat(E(a.keys,", "));case"invalid_key":return"Ugyldig n\xF8gle i ".concat(a.origin);case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return"Ugyldig v\xE6rdi i ".concat(a.origin);default:return"Ugyldigt input"}}},"error");function Bx(){return{localeError:zB()}}s(Bx,"default");m();var OB=s(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"Ung\xFCltige Eingabe: erwartet ".concat(n.expected,", erhalten ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Ung\xFCltige Eingabe: erwartet ".concat(U(n.values[0])):"Ung\xFCltige Option: erwartet eine von ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"Zu gro\xDF: erwartet, dass ".concat((o=n.origin)!=null?o:"Wert"," ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"Elemente"," hat"):"Zu gro\xDF: erwartet, dass ".concat((l=n.origin)!=null?l:"Wert"," ").concat(u).concat(n.maximum.toString()," ist")}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"Zu klein: erwartet, dass ".concat(n.origin," ").concat(u).concat(n.minimum.toString()," ").concat(p.unit," hat"):"Zu klein: erwartet, dass ".concat(n.origin," ").concat(u).concat(n.minimum.toString()," ist")}case"invalid_format":{let u=n;return u.format==="starts_with"?'Ung\xFCltiger String: muss mit "'.concat(u.prefix,'" beginnen'):u.format==="ends_with"?'Ung\xFCltiger String: muss mit "'.concat(u.suffix,'" enden'):u.format==="includes"?'Ung\xFCltiger String: muss "'.concat(u.includes,'" enthalten'):u.format==="regex"?"Ung\xFCltiger String: muss dem Muster ".concat(u.pattern," entsprechen"):"Ung\xFCltig: ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"Ung\xFCltige Zahl: muss ein Vielfaches von ".concat(n.divisor," sein");case"unrecognized_keys":return"".concat(n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel",": ").concat(E(n.keys,", "));case"invalid_key":return"Ung\xFCltiger Schl\xFCssel in ".concat(n.origin);case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return"Ung\xFCltiger Wert in ".concat(n.origin);default:return"Ung\xFCltige Eingabe"}}},"error");function Ux(){return{localeError:OB()}}s(Ux,"default");m();var RB=s(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),FB=s(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(i){var n;return(n=t[i])!=null?n:null}s(e,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return i=>{var n,o,a,l;switch(i.code){case"invalid_type":return"Invalid input: expected ".concat(i.expected,", received ").concat(RB(i.input));case"invalid_value":return i.values.length===1?"Invalid input: expected ".concat(U(i.values[0])):"Invalid option: expected one of ".concat(E(i.values,"|"));case"too_big":{let c=i.inclusive?"<=":"<",u=e(i.origin);return u?"Too big: expected ".concat((n=i.origin)!=null?n:"value"," to have ").concat(c).concat(i.maximum.toString()," ").concat((o=u.unit)!=null?o:"elements"):"Too big: expected ".concat((a=i.origin)!=null?a:"value"," to be ").concat(c).concat(i.maximum.toString())}case"too_small":{let c=i.inclusive?">=":">",u=e(i.origin);return u?"Too small: expected ".concat(i.origin," to have ").concat(c).concat(i.minimum.toString()," ").concat(u.unit):"Too small: expected ".concat(i.origin," to be ").concat(c).concat(i.minimum.toString())}case"invalid_format":{let c=i;return c.format==="starts_with"?'Invalid string: must start with "'.concat(c.prefix,'"'):c.format==="ends_with"?'Invalid string: must end with "'.concat(c.suffix,'"'):c.format==="includes"?'Invalid string: must include "'.concat(c.includes,'"'):c.format==="regex"?"Invalid string: must match pattern ".concat(c.pattern):"Invalid ".concat((l=r[c.format])!=null?l:i.format)}case"not_multiple_of":return"Invalid number: must be a multiple of ".concat(i.divisor);case"unrecognized_keys":return"Unrecognized key".concat(i.keys.length>1?"s":"",": ").concat(E(i.keys,", "));case"invalid_key":return"Invalid key in ".concat(i.origin);case"invalid_union":return"Invalid input";case"invalid_element":return"Invalid value in ".concat(i.origin);default:return"Invalid input"}}},"error");function Gs(){return{localeError:FB()}}s(Gs,"default");m();var BB=s(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),UB=s(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(i){var n;return(n=t[i])!=null?n:null}s(e,"getSizing");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return i=>{var n,o,a,l;switch(i.code){case"invalid_type":return"Nevalida enigo: atendi\u011Dis ".concat(i.expected,", ricevi\u011Dis ").concat(BB(i.input));case"invalid_value":return i.values.length===1?"Nevalida enigo: atendi\u011Dis ".concat(U(i.values[0])):"Nevalida opcio: atendi\u011Dis unu el ".concat(E(i.values,"|"));case"too_big":{let c=i.inclusive?"<=":"<",u=e(i.origin);return u?"Tro granda: atendi\u011Dis ke ".concat((n=i.origin)!=null?n:"valoro"," havu ").concat(c).concat(i.maximum.toString()," ").concat((o=u.unit)!=null?o:"elementojn"):"Tro granda: atendi\u011Dis ke ".concat((a=i.origin)!=null?a:"valoro"," havu ").concat(c).concat(i.maximum.toString())}case"too_small":{let c=i.inclusive?">=":">",u=e(i.origin);return u?"Tro malgranda: atendi\u011Dis ke ".concat(i.origin," havu ").concat(c).concat(i.minimum.toString()," ").concat(u.unit):"Tro malgranda: atendi\u011Dis ke ".concat(i.origin," estu ").concat(c).concat(i.minimum.toString())}case"invalid_format":{let c=i;return c.format==="starts_with"?'Nevalida karaktraro: devas komenci\u011Di per "'.concat(c.prefix,'"'):c.format==="ends_with"?'Nevalida karaktraro: devas fini\u011Di per "'.concat(c.suffix,'"'):c.format==="includes"?'Nevalida karaktraro: devas inkluzivi "'.concat(c.includes,'"'):c.format==="regex"?"Nevalida karaktraro: devas kongrui kun la modelo ".concat(c.pattern):"Nevalida ".concat((l=r[c.format])!=null?l:i.format)}case"not_multiple_of":return"Nevalida nombro: devas esti oblo de ".concat(i.divisor);case"unrecognized_keys":return"Nekonata".concat(i.keys.length>1?"j":""," \u015Dlosilo").concat(i.keys.length>1?"j":"",": ").concat(E(i.keys,", "));case"invalid_key":return"Nevalida \u015Dlosilo en ".concat(i.origin);case"invalid_union":return"Nevalida enigo";case"invalid_element":return"Nevalida valoro en ".concat(i.origin);default:return"Nevalida enigo"}}},"error");function Nx(){return{localeError:UB()}}s(Nx,"default");m();var NB=s(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},e={string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};function r(a){var l;return(l=t[a])!=null?l:null}s(r,"getSizing");function i(a){var l;return(l=e[a])!=null?l:a}s(i,"getTypeName");let n=s(a=>{let l=typeof a;switch(l){case"number":return Number.isNaN(a)?"NaN":"number";case"object":return Array.isArray(a)?"array":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype?a.constructor.name:"object"}return l},"parsedType"),o={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return a=>{var l,c;switch(a.code){case"invalid_type":return"Entrada inv\xE1lida: se esperaba ".concat(i(a.expected),", recibido ").concat(i(n(a.input)));case"invalid_value":return a.values.length===1?"Entrada inv\xE1lida: se esperaba ".concat(U(a.values[0])):"Opci\xF3n inv\xE1lida: se esperaba una de ".concat(E(a.values,"|"));case"too_big":{let u=a.inclusive?"<=":"<",p=r(a.origin),f=i(a.origin);return p?"Demasiado grande: se esperaba que ".concat(f!=null?f:"valor"," tuviera ").concat(u).concat(a.maximum.toString()," ").concat((l=p.unit)!=null?l:"elementos"):"Demasiado grande: se esperaba que ".concat(f!=null?f:"valor"," fuera ").concat(u).concat(a.maximum.toString())}case"too_small":{let u=a.inclusive?">=":">",p=r(a.origin),f=i(a.origin);return p?"Demasiado peque\xF1o: se esperaba que ".concat(f," tuviera ").concat(u).concat(a.minimum.toString()," ").concat(p.unit):"Demasiado peque\xF1o: se esperaba que ".concat(f," fuera ").concat(u).concat(a.minimum.toString())}case"invalid_format":{let u=a;return u.format==="starts_with"?'Cadena inv\xE1lida: debe comenzar con "'.concat(u.prefix,'"'):u.format==="ends_with"?'Cadena inv\xE1lida: debe terminar en "'.concat(u.suffix,'"'):u.format==="includes"?'Cadena inv\xE1lida: debe incluir "'.concat(u.includes,'"'):u.format==="regex"?"Cadena inv\xE1lida: debe coincidir con el patr\xF3n ".concat(u.pattern):"Inv\xE1lido ".concat((c=o[u.format])!=null?c:a.format)}case"not_multiple_of":return"N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ".concat(a.divisor);case"unrecognized_keys":return"Llave".concat(a.keys.length>1?"s":""," desconocida").concat(a.keys.length>1?"s":"",": ").concat(E(a.keys,", "));case"invalid_key":return"Llave inv\xE1lida en ".concat(i(a.origin));case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return"Valor inv\xE1lido en ".concat(i(a.origin));default:return"Entrada inv\xE1lida"}}},"error");function $x(){return{localeError:NB()}}s($x,"default");m();var $B=s(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0622\u0631\u0627\u06CC\u0647";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ".concat(n.expected," \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ").concat(r(n.input)," \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F");case"invalid_value":return n.values.length===1?"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ".concat(U(n.values[0])," \u0645\u06CC\u200C\u0628\u0648\u062F"):"\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ".concat(E(n.values,"|")," \u0645\u06CC\u200C\u0628\u0648\u062F");case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ".concat((o=n.origin)!=null?o:"\u0645\u0642\u062F\u0627\u0631"," \u0628\u0627\u06CC\u062F ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"\u0639\u0646\u0635\u0631"," \u0628\u0627\u0634\u062F"):"\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ".concat((l=n.origin)!=null?l:"\u0645\u0642\u062F\u0627\u0631"," \u0628\u0627\u06CC\u062F ").concat(u).concat(n.maximum.toString()," \u0628\u0627\u0634\u062F")}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ".concat(n.origin," \u0628\u0627\u06CC\u062F ").concat(u).concat(n.minimum.toString()," ").concat(p.unit," \u0628\u0627\u0634\u062F"):"\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ".concat(n.origin," \u0628\u0627\u06CC\u062F ").concat(u).concat(n.minimum.toString()," \u0628\u0627\u0634\u062F")}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "'.concat(u.prefix,'" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F'):u.format==="ends_with"?'\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "'.concat(u.suffix,'" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F'):u.format==="includes"?'\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "'.concat(u.includes,'" \u0628\u0627\u0634\u062F'):u.format==="regex"?"\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ".concat(u.pattern," \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"):"".concat((c=i[u.format])!=null?c:n.format," \u0646\u0627\u0645\u0639\u062A\u0628\u0631")}case"not_multiple_of":return"\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ".concat(n.divisor," \u0628\u0627\u0634\u062F");case"unrecognized_keys":return"\u06A9\u0644\u06CC\u062F".concat(n.keys.length>1?"\u0647\u0627\u06CC":""," \u0646\u0627\u0634\u0646\u0627\u0633: ").concat(E(n.keys,", "));case"invalid_key":return"\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ".concat(n.origin);case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return"\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ".concat(n.origin);default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function Vx(){return{localeError:$B()}}s(Vx,"default");m();var VB=s(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return n=>{var o;switch(n.code){case"invalid_type":return"Virheellinen tyyppi: odotettiin ".concat(n.expected,", oli ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Virheellinen sy\xF6te: t\xE4ytyy olla ".concat(U(n.values[0])):"Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ".concat(E(n.values,"|"));case"too_big":{let a=n.inclusive?"<=":"<",l=e(n.origin);return l?"Liian suuri: ".concat(l.subject," t\xE4ytyy olla ").concat(a).concat(n.maximum.toString()," ").concat(l.unit).trim():"Liian suuri: arvon t\xE4ytyy olla ".concat(a).concat(n.maximum.toString())}case"too_small":{let a=n.inclusive?">=":">",l=e(n.origin);return l?"Liian pieni: ".concat(l.subject," t\xE4ytyy olla ").concat(a).concat(n.minimum.toString()," ").concat(l.unit).trim():"Liian pieni: arvon t\xE4ytyy olla ".concat(a).concat(n.minimum.toString())}case"invalid_format":{let a=n;return a.format==="starts_with"?'Virheellinen sy\xF6te: t\xE4ytyy alkaa "'.concat(a.prefix,'"'):a.format==="ends_with"?'Virheellinen sy\xF6te: t\xE4ytyy loppua "'.concat(a.suffix,'"'):a.format==="includes"?'Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "'.concat(a.includes,'"'):a.format==="regex"?"Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ".concat(a.pattern):"Virheellinen ".concat((o=i[a.format])!=null?o:n.format)}case"not_multiple_of":return"Virheellinen luku: t\xE4ytyy olla luvun ".concat(n.divisor," monikerta");case"unrecognized_keys":return"".concat(n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain",": ").concat(E(n.keys,", "));case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function jx(){return{localeError:VB()}}s(jx,"default");m();var jB=s(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"Entr\xE9e invalide : ".concat(n.expected," attendu, ").concat(r(n.input)," re\xE7u");case"invalid_value":return n.values.length===1?"Entr\xE9e invalide : ".concat(U(n.values[0])," attendu"):"Option invalide : une valeur parmi ".concat(E(n.values,"|")," attendue");case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"Trop grand : ".concat((o=n.origin)!=null?o:"valeur"," doit ").concat(p.verb," ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"\xE9l\xE9ment(s)"):"Trop grand : ".concat((l=n.origin)!=null?l:"valeur"," doit \xEAtre ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"Trop petit : ".concat(n.origin," doit ").concat(p.verb," ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"Trop petit : ".concat(n.origin," doit \xEAtre ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'Cha\xEEne invalide : doit commencer par "'.concat(u.prefix,'"'):u.format==="ends_with"?'Cha\xEEne invalide : doit se terminer par "'.concat(u.suffix,'"'):u.format==="includes"?'Cha\xEEne invalide : doit inclure "'.concat(u.includes,'"'):u.format==="regex"?"Cha\xEEne invalide : doit correspondre au mod\xE8le ".concat(u.pattern):"".concat((c=i[u.format])!=null?c:n.format," invalide")}case"not_multiple_of":return"Nombre invalide : doit \xEAtre un multiple de ".concat(n.divisor);case"unrecognized_keys":return"Cl\xE9".concat(n.keys.length>1?"s":""," non reconnue").concat(n.keys.length>1?"s":""," : ").concat(E(n.keys,", "));case"invalid_key":return"Cl\xE9 invalide dans ".concat(n.origin);case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return"Valeur invalide dans ".concat(n.origin);default:return"Entr\xE9e invalide"}}},"error");function Gx(){return{localeError:jB()}}s(Gx,"default");m();var GB=s(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return n=>{var o,a,l;switch(n.code){case"invalid_type":return"Entr\xE9e invalide : attendu ".concat(n.expected,", re\xE7u ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Entr\xE9e invalide : attendu ".concat(U(n.values[0])):"Option invalide : attendu l'une des valeurs suivantes ".concat(E(n.values,"|"));case"too_big":{let c=n.inclusive?"\u2264":"<",u=e(n.origin);return u?"Trop grand : attendu que ".concat((o=n.origin)!=null?o:"la valeur"," ait ").concat(c).concat(n.maximum.toString()," ").concat(u.unit):"Trop grand : attendu que ".concat((a=n.origin)!=null?a:"la valeur"," soit ").concat(c).concat(n.maximum.toString())}case"too_small":{let c=n.inclusive?"\u2265":">",u=e(n.origin);return u?"Trop petit : attendu que ".concat(n.origin," ait ").concat(c).concat(n.minimum.toString()," ").concat(u.unit):"Trop petit : attendu que ".concat(n.origin," soit ").concat(c).concat(n.minimum.toString())}case"invalid_format":{let c=n;return c.format==="starts_with"?'Cha\xEEne invalide : doit commencer par "'.concat(c.prefix,'"'):c.format==="ends_with"?'Cha\xEEne invalide : doit se terminer par "'.concat(c.suffix,'"'):c.format==="includes"?'Cha\xEEne invalide : doit inclure "'.concat(c.includes,'"'):c.format==="regex"?"Cha\xEEne invalide : doit correspondre au motif ".concat(c.pattern):"".concat((l=i[c.format])!=null?l:n.format," invalide")}case"not_multiple_of":return"Nombre invalide : doit \xEAtre un multiple de ".concat(n.divisor);case"unrecognized_keys":return"Cl\xE9".concat(n.keys.length>1?"s":""," non reconnue").concat(n.keys.length>1?"s":""," : ").concat(E(n.keys,", "));case"invalid_key":return"Cl\xE9 invalide dans ".concat(n.origin);case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return"Valeur invalide dans ".concat(n.origin);default:return"Entr\xE9e invalide"}}},"error");function Zx(){return{localeError:GB()}}s(Zx,"default");m();var ZB=s(()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ".concat(n.expected,", \u05D4\u05EA\u05E7\u05D1\u05DC ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ".concat(U(n.values[0])):"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ".concat((o=n.origin)!=null?o:"value"," \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"elements"):"\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ".concat((l=n.origin)!=null?l:"value"," \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ".concat(n.origin," \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ".concat(n.origin," \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"'.concat(u.prefix,'"'):u.format==="ends_with"?'\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "'.concat(u.suffix,'"'):u.format==="includes"?'\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "'.concat(u.includes,'"'):u.format==="regex"?"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ".concat(u.pattern):"".concat((c=i[u.format])!=null?c:n.format," \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF")}case"not_multiple_of":return"\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ".concat(n.divisor);case"unrecognized_keys":return"\u05DE\u05E4\u05EA\u05D7".concat(n.keys.length>1?"\u05D5\u05EA":""," \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4").concat(n.keys.length>1?"\u05D9\u05DD":"\u05D4",": ").concat(E(n.keys,", "));case"invalid_key":return"\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1".concat(n.origin);case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1".concat(n.origin);default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function Xx(){return{localeError:ZB()}}s(Xx,"default");m();var XB=s(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(n))return"t\xF6mb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ".concat(n.expected,", a kapott \xE9rt\xE9k ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ".concat(U(n.values[0])):"\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"T\xFAl nagy: ".concat((o=n.origin)!=null?o:"\xE9rt\xE9k"," m\xE9rete t\xFAl nagy ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"elem"):"T\xFAl nagy: a bemeneti \xE9rt\xE9k ".concat((l=n.origin)!=null?l:"\xE9rt\xE9k"," t\xFAl nagy: ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"T\xFAl kicsi: a bemeneti \xE9rt\xE9k ".concat(n.origin," m\xE9rete t\xFAl kicsi ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"T\xFAl kicsi: a bemeneti \xE9rt\xE9k ".concat(n.origin," t\xFAl kicsi ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'\xC9rv\xE9nytelen string: "'.concat(u.prefix,'" \xE9rt\xE9kkel kell kezd\u0151dnie'):u.format==="ends_with"?'\xC9rv\xE9nytelen string: "'.concat(u.suffix,'" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie'):u.format==="includes"?'\xC9rv\xE9nytelen string: "'.concat(u.includes,'" \xE9rt\xE9ket kell tartalmaznia'):u.format==="regex"?"\xC9rv\xE9nytelen string: ".concat(u.pattern," mint\xE1nak kell megfelelnie"):"\xC9rv\xE9nytelen ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"\xC9rv\xE9nytelen sz\xE1m: ".concat(n.divisor," t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie");case"unrecognized_keys":return"Ismeretlen kulcs".concat(n.keys.length>1?"s":"",": ").concat(E(n.keys,", "));case"invalid_key":return"\xC9rv\xE9nytelen kulcs ".concat(n.origin);case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return"\xC9rv\xE9nytelen \xE9rt\xE9k: ".concat(n.origin);default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function Hx(){return{localeError:XB()}}s(Hx,"default");m();var HB=s(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"Input tidak valid: diharapkan ".concat(n.expected,", diterima ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Input tidak valid: diharapkan ".concat(U(n.values[0])):"Pilihan tidak valid: diharapkan salah satu dari ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"Terlalu besar: diharapkan ".concat((o=n.origin)!=null?o:"value"," memiliki ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"elemen"):"Terlalu besar: diharapkan ".concat((l=n.origin)!=null?l:"value"," menjadi ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"Terlalu kecil: diharapkan ".concat(n.origin," memiliki ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"Terlalu kecil: diharapkan ".concat(n.origin," menjadi ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'String tidak valid: harus dimulai dengan "'.concat(u.prefix,'"'):u.format==="ends_with"?'String tidak valid: harus berakhir dengan "'.concat(u.suffix,'"'):u.format==="includes"?'String tidak valid: harus menyertakan "'.concat(u.includes,'"'):u.format==="regex"?"String tidak valid: harus sesuai pola ".concat(u.pattern):"".concat((c=i[u.format])!=null?c:n.format," tidak valid")}case"not_multiple_of":return"Angka tidak valid: harus kelipatan dari ".concat(n.divisor);case"unrecognized_keys":return"Kunci tidak dikenali ".concat(n.keys.length>1?"s":"",": ").concat(E(n.keys,", "));case"invalid_key":return"Kunci tidak valid di ".concat(n.origin);case"invalid_union":return"Input tidak valid";case"invalid_element":return"Nilai tidak valid di ".concat(n.origin);default:return"Input tidak valid"}}},"error");function qx(){return{localeError:HB()}}s(qx,"default");m();var qB=s(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"n\xFAmer";case"object":{if(Array.isArray(t))return"fylki";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),WB=s(()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(i){var n;return(n=t[i])!=null?n:null}s(e,"getSizing");let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"};return i=>{var n,o,a,l;switch(i.code){case"invalid_type":return"Rangt gildi: \xDE\xFA sl\xF3st inn ".concat(qB(i.input)," \xFEar sem \xE1 a\xF0 vera ").concat(i.expected);case"invalid_value":return i.values.length===1?"Rangt gildi: gert r\xE1\xF0 fyrir ".concat(U(i.values[0])):"\xD3gilt val: m\xE1 vera eitt af eftirfarandi ".concat(E(i.values,"|"));case"too_big":{let c=i.inclusive?"<=":"<",u=e(i.origin);return u?"Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ".concat((n=i.origin)!=null?n:"gildi"," hafi ").concat(c).concat(i.maximum.toString()," ").concat((o=u.unit)!=null?o:"hluti"):"Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ".concat((a=i.origin)!=null?a:"gildi"," s\xE9 ").concat(c).concat(i.maximum.toString())}case"too_small":{let c=i.inclusive?">=":">",u=e(i.origin);return u?"Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ".concat(i.origin," hafi ").concat(c).concat(i.minimum.toString()," ").concat(u.unit):"Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ".concat(i.origin," s\xE9 ").concat(c).concat(i.minimum.toString())}case"invalid_format":{let c=i;return c.format==="starts_with"?'\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "'.concat(c.prefix,'"'):c.format==="ends_with"?'\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "'.concat(c.suffix,'"'):c.format==="includes"?'\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "'.concat(c.includes,'"'):c.format==="regex"?"\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ".concat(c.pattern):"Rangt ".concat((l=r[c.format])!=null?l:i.format)}case"not_multiple_of":return"R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ".concat(i.divisor);case"unrecognized_keys":return"\xD3\xFEekkt ".concat(i.keys.length>1?"ir lyklar":"ur lykill",": ").concat(E(i.keys,", "));case"invalid_key":return"Rangur lykill \xED ".concat(i.origin);case"invalid_union":return"Rangt gildi";case"invalid_element":return"Rangt gildi \xED ".concat(i.origin);default:return"Rangt gildi"}}},"error");function Wx(){return{localeError:WB()}}s(Wx,"default");m();var YB=s(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"Input non valido: atteso ".concat(n.expected,", ricevuto ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Input non valido: atteso ".concat(U(n.values[0])):"Opzione non valida: atteso uno tra ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"Troppo grande: ".concat((o=n.origin)!=null?o:"valore"," deve avere ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"elementi"):"Troppo grande: ".concat((l=n.origin)!=null?l:"valore"," deve essere ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"Troppo piccolo: ".concat(n.origin," deve avere ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"Troppo piccolo: ".concat(n.origin," deve essere ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'Stringa non valida: deve iniziare con "'.concat(u.prefix,'"'):u.format==="ends_with"?'Stringa non valida: deve terminare con "'.concat(u.suffix,'"'):u.format==="includes"?'Stringa non valida: deve includere "'.concat(u.includes,'"'):u.format==="regex"?"Stringa non valida: deve corrispondere al pattern ".concat(u.pattern):"Invalid ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"Numero non valido: deve essere un multiplo di ".concat(n.divisor);case"unrecognized_keys":return"Chiav".concat(n.keys.length>1?"i":"e"," non riconosciut").concat(n.keys.length>1?"e":"a",": ").concat(E(n.keys,", "));case"invalid_key":return"Chiave non valida in ".concat(n.origin);case"invalid_union":return"Input non valido";case"invalid_element":return"Valore non valido in ".concat(n.origin);default:return"Input non valido"}}},"error");function Yx(){return{localeError:YB()}}s(Yx,"default");m();var JB=s(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(n))return"\u914D\u5217";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u7121\u52B9\u306A\u5165\u529B: ".concat(n.expected,"\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001").concat(r(n.input),"\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F");case"invalid_value":return n.values.length===1?"\u7121\u52B9\u306A\u5165\u529B: ".concat(U(n.values[0]),"\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F"):"\u7121\u52B9\u306A\u9078\u629E: ".concat(E(n.values,"\u3001"),"\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059");case"too_big":{let u=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",p=e(n.origin);return p?"\u5927\u304D\u3059\u304E\u308B\u5024: ".concat((o=n.origin)!=null?o:"\u5024","\u306F").concat(n.maximum.toString()).concat((a=p.unit)!=null?a:"\u8981\u7D20").concat(u,"\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"):"\u5927\u304D\u3059\u304E\u308B\u5024: ".concat((l=n.origin)!=null?l:"\u5024","\u306F").concat(n.maximum.toString()).concat(u,"\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059")}case"too_small":{let u=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",p=e(n.origin);return p?"\u5C0F\u3055\u3059\u304E\u308B\u5024: ".concat(n.origin,"\u306F").concat(n.minimum.toString()).concat(p.unit).concat(u,"\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"):"\u5C0F\u3055\u3059\u304E\u308B\u5024: ".concat(n.origin,"\u306F").concat(n.minimum.toString()).concat(u,"\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059")}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u7121\u52B9\u306A\u6587\u5B57\u5217: "'.concat(u.prefix,'"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059'):u.format==="ends_with"?'\u7121\u52B9\u306A\u6587\u5B57\u5217: "'.concat(u.suffix,'"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059'):u.format==="includes"?'\u7121\u52B9\u306A\u6587\u5B57\u5217: "'.concat(u.includes,'"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059'):u.format==="regex"?"\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3".concat(u.pattern,"\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"):"\u7121\u52B9\u306A".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"\u7121\u52B9\u306A\u6570\u5024: ".concat(n.divisor,"\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059");case"unrecognized_keys":return"\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC".concat(n.keys.length>1?"\u7FA4":"",": ").concat(E(n.keys,"\u3001"));case"invalid_key":return"".concat(n.origin,"\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC");case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return"".concat(n.origin,"\u5185\u306E\u7121\u52B9\u306A\u5024");default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function Jx(){return{localeError:JB()}}s(Jx,"default");m();var KB=s(t=>{var i;let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8";case"object":{if(Array.isArray(t))return"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return(i={string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0"}[e])!=null?i:e},"parsedType"),QB=s(()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(i){var n;return(n=t[i])!=null?n:null}s(e,"getSizing");let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"};return i=>{var n,o,a;switch(i.code){case"invalid_type":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ".concat(i.expected,", \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ").concat(KB(i.input));case"invalid_value":return i.values.length===1?"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ".concat(U(i.values[0])):"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ".concat(E(i.values,"|"),"-\u10D3\u10D0\u10DC");case"too_big":{let l=i.inclusive?"<=":"<",c=e(i.origin);return c?"\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ".concat((n=i.origin)!=null?n:"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"," ").concat(c.verb," ").concat(l).concat(i.maximum.toString()," ").concat(c.unit):"\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ".concat((o=i.origin)!=null?o:"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"," \u10D8\u10E7\u10DD\u10E1 ").concat(l).concat(i.maximum.toString())}case"too_small":{let l=i.inclusive?">=":">",c=e(i.origin);return c?"\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ".concat(i.origin," ").concat(c.verb," ").concat(l).concat(i.minimum.toString()," ").concat(c.unit):"\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ".concat(i.origin," \u10D8\u10E7\u10DD\u10E1 ").concat(l).concat(i.minimum.toString())}case"invalid_format":{let l=i;return l.format==="starts_with"?'\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "'.concat(l.prefix,'"-\u10D8\u10D7'):l.format==="ends_with"?'\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "'.concat(l.suffix,'"-\u10D8\u10D7'):l.format==="includes"?'\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "'.concat(l.includes,'"-\u10E1'):l.format==="regex"?"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ".concat(l.pattern):"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ".concat((a=r[l.format])!=null?a:i.format)}case"not_multiple_of":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ".concat(i.divisor,"-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8");case"unrecognized_keys":return"\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1".concat(i.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8",": ").concat(E(i.keys,", "));case"invalid_key":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ".concat(i.origin,"-\u10E8\u10D8");case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ".concat(i.origin,"-\u10E8\u10D8");default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},"error");function Kx(){return{localeError:QB()}}s(Kx,"default");m();m();var e3=s(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(n))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(n===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ".concat(n.expected," \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ".concat(U(n.values[0])):"\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ".concat((o=n.origin)!=null?o:"\u178F\u1798\u17D2\u179B\u17C3"," ").concat(u," ").concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"\u1792\u17B6\u178F\u17BB"):"\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ".concat((l=n.origin)!=null?l:"\u178F\u1798\u17D2\u179B\u17C3"," ").concat(u," ").concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ".concat(n.origin," ").concat(u," ").concat(n.minimum.toString()," ").concat(p.unit):"\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ".concat(n.origin," ").concat(u," ").concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "'.concat(u.prefix,'"'):u.format==="ends_with"?'\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "'.concat(u.suffix,'"'):u.format==="includes"?'\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "'.concat(u.includes,'"'):u.format==="regex"?"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ".concat(u.pattern):"\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ".concat(n.divisor);case"unrecognized_keys":return"\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ".concat(E(n.keys,", "));case"invalid_key":return"\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ".concat(n.origin);case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ".concat(n.origin);default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function Zs(){return{localeError:e3()}}s(Zs,"default");function Qx(){return Zs()}s(Qx,"default");m();var t3=s(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return n=>{var o,a,l,c,u,p,f;switch(n.code){case"invalid_type":return"\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ".concat(n.expected,", \uBC1B\uC740 \uD0C0\uC785\uC740 ").concat(r(n.input),"\uC785\uB2C8\uB2E4");case"invalid_value":return n.values.length===1?"\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ".concat(U(n.values[0])," \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4"):"\uC798\uBABB\uB41C \uC635\uC158: ".concat(E(n.values,"\uB610\uB294 ")," \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4");case"too_big":{let h=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",y=h==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",g=e(n.origin),x=(o=g==null?void 0:g.unit)!=null?o:"\uC694\uC18C";return g?"".concat((a=n.origin)!=null?a:"\uAC12","\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ").concat(n.maximum.toString()).concat(x," ").concat(h).concat(y):"".concat((l=n.origin)!=null?l:"\uAC12","\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ").concat(n.maximum.toString()," ").concat(h).concat(y)}case"too_small":{let h=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",y=h==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",g=e(n.origin),x=(c=g==null?void 0:g.unit)!=null?c:"\uC694\uC18C";return g?"".concat((u=n.origin)!=null?u:"\uAC12","\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ").concat(n.minimum.toString()).concat(x," ").concat(h).concat(y):"".concat((p=n.origin)!=null?p:"\uAC12","\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ").concat(n.minimum.toString()," ").concat(h).concat(y)}case"invalid_format":{let h=n;return h.format==="starts_with"?'\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "'.concat(h.prefix,'"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4'):h.format==="ends_with"?'\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "'.concat(h.suffix,'"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4'):h.format==="includes"?'\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "'.concat(h.includes,'"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4'):h.format==="regex"?"\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ".concat(h.pattern," \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4"):"\uC798\uBABB\uB41C ".concat((f=i[h.format])!=null?f:n.format)}case"not_multiple_of":return"\uC798\uBABB\uB41C \uC22B\uC790: ".concat(n.divisor,"\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4");case"unrecognized_keys":return"\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ".concat(E(n.keys,", "));case"invalid_key":return"\uC798\uBABB\uB41C \uD0A4: ".concat(n.origin);case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return"\uC798\uBABB\uB41C \uAC12: ".concat(n.origin);default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function e_(){return{localeError:t3()}}s(e_,"default");m();var r3=s(t=>Hs(typeof t,t),"parsedType"),Hs=s((t,e=void 0)=>{switch(t){case"number":return Number.isNaN(e)?"NaN":"skai\u010Dius";case"bigint":return"sveikasis skai\u010Dius";case"string":return"eilut\u0117";case"boolean":return"login\u0117 reik\u0161m\u0117";case"undefined":case"void":return"neapibr\u0117\u017Eta reik\u0161m\u0117";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return e===void 0?"ne\u017Einomas objektas":e===null?"nulin\u0117 reik\u0161m\u0117":Array.isArray(e)?"masyvas":Object.getPrototypeOf(e)!==Object.prototype&&e.constructor?e.constructor.name:"objektas";case"null":return"nulin\u0117 reik\u0161m\u0117"}return t},"parsedTypeFromType"),Xs=s(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalizeFirstCharacter");function rC(t){let e=Math.abs(t),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}s(rC,"getUnitTypeFromNumber");var n3=s(()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(i,n,o,a){var c;let l=(c=t[i])!=null?c:null;return l===null?l:{unit:l.unit[n],verb:l.verb[a][o?"inclusive":"notInclusive"]}}s(e,"getSizing");let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"};return i=>{var n,o,a,l,c,u,p,f,h,y;switch(i.code){case"invalid_type":return"Gautas tipas ".concat(r3(i.input),", o tik\u0117tasi - ").concat(Hs(i.expected));case"invalid_value":return i.values.length===1?"Privalo b\u016Bti ".concat(U(i.values[0])):"Privalo b\u016Bti vienas i\u0161 ".concat(E(i.values,"|")," pasirinkim\u0173");case"too_big":{let g=Hs(i.origin),x=e(i.origin,rC(Number(i.maximum)),(n=i.inclusive)!=null?n:!1,"smaller");if(x!=null&&x.verb)return"".concat(Xs((o=g!=null?g:i.origin)!=null?o:"reik\u0161m\u0117")," ").concat(x.verb," ").concat(i.maximum.toString()," ").concat((a=x.unit)!=null?a:"element\u0173");let _=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return"".concat(Xs((l=g!=null?g:i.origin)!=null?l:"reik\u0161m\u0117")," turi b\u016Bti ").concat(_," ").concat(i.maximum.toString()," ").concat(x==null?void 0:x.unit)}case"too_small":{let g=Hs(i.origin),x=e(i.origin,rC(Number(i.minimum)),(c=i.inclusive)!=null?c:!1,"bigger");if(x!=null&&x.verb)return"".concat(Xs((u=g!=null?g:i.origin)!=null?u:"reik\u0161m\u0117")," ").concat(x.verb," ").concat(i.minimum.toString()," ").concat((p=x.unit)!=null?p:"element\u0173");let _=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return"".concat(Xs((f=g!=null?g:i.origin)!=null?f:"reik\u0161m\u0117")," turi b\u016Bti ").concat(_," ").concat(i.minimum.toString()," ").concat(x==null?void 0:x.unit)}case"invalid_format":{let g=i;return g.format==="starts_with"?'Eilut\u0117 privalo prasid\u0117ti "'.concat(g.prefix,'"'):g.format==="ends_with"?'Eilut\u0117 privalo pasibaigti "'.concat(g.suffix,'"'):g.format==="includes"?'Eilut\u0117 privalo \u012Ftraukti "'.concat(g.includes,'"'):g.format==="regex"?"Eilut\u0117 privalo atitikti ".concat(g.pattern):"Neteisingas ".concat((h=r[g.format])!=null?h:i.format)}case"not_multiple_of":return"Skai\u010Dius privalo b\u016Bti ".concat(i.divisor," kartotinis.");case"unrecognized_keys":return"Neatpa\u017Eint".concat(i.keys.length>1?"i":"as"," rakt").concat(i.keys.length>1?"ai":"as",": ").concat(E(i.keys,", "));case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let g=Hs(i.origin);return"".concat(Xs((y=g!=null?g:i.origin)!=null?y:"reik\u0161m\u0117")," turi klaiding\u0105 \u012Fvest\u012F")}default:return"Klaidinga \u012Fvestis"}}},"error");function t_(){return{localeError:n3()}}s(t_,"default");m();var i3=s(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(n))return"\u043D\u0438\u0437\u0430";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ".concat(n.expected,", \u043F\u0440\u0438\u043C\u0435\u043D\u043E ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Invalid input: expected ".concat(U(n.values[0])):"\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ".concat((o=n.origin)!=null?o:"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"," \u0434\u0430 \u0438\u043C\u0430 ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"):"\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ".concat((l=n.origin)!=null?l:"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"," \u0434\u0430 \u0431\u0438\u0434\u0435 ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ".concat(n.origin," \u0434\u0430 \u0438\u043C\u0430 ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ".concat(n.origin," \u0434\u0430 \u0431\u0438\u0434\u0435 ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "'.concat(u.prefix,'"'):u.format==="ends_with"?'\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "'.concat(u.suffix,'"'):u.format==="includes"?'\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "'.concat(u.includes,'"'):u.format==="regex"?"\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ".concat(u.pattern):"Invalid ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ".concat(n.divisor);case"unrecognized_keys":return"".concat(n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447",": ").concat(E(n.keys,", "));case"invalid_key":return"\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ".concat(n.origin);case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return"\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ".concat(n.origin);default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function r_(){return{localeError:i3()}}s(r_,"default");m();var o3=s(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"Input tidak sah: dijangka ".concat(n.expected,", diterima ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Input tidak sah: dijangka ".concat(U(n.values[0])):"Pilihan tidak sah: dijangka salah satu daripada ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"Terlalu besar: dijangka ".concat((o=n.origin)!=null?o:"nilai"," ").concat(p.verb," ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"elemen"):"Terlalu besar: dijangka ".concat((l=n.origin)!=null?l:"nilai"," adalah ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"Terlalu kecil: dijangka ".concat(n.origin," ").concat(p.verb," ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"Terlalu kecil: dijangka ".concat(n.origin," adalah ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'String tidak sah: mesti bermula dengan "'.concat(u.prefix,'"'):u.format==="ends_with"?'String tidak sah: mesti berakhir dengan "'.concat(u.suffix,'"'):u.format==="includes"?'String tidak sah: mesti mengandungi "'.concat(u.includes,'"'):u.format==="regex"?"String tidak sah: mesti sepadan dengan corak ".concat(u.pattern):"".concat((c=i[u.format])!=null?c:n.format," tidak sah")}case"not_multiple_of":return"Nombor tidak sah: perlu gandaan ".concat(n.divisor);case"unrecognized_keys":return"Kunci tidak dikenali: ".concat(E(n.keys,", "));case"invalid_key":return"Kunci tidak sah dalam ".concat(n.origin);case"invalid_union":return"Input tidak sah";case"invalid_element":return"Nilai tidak sah dalam ".concat(n.origin);default:return"Input tidak sah"}}},"error");function n_(){return{localeError:o3()}}s(n_,"default");m();var a3=s(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"Ongeldige invoer: verwacht ".concat(n.expected,", ontving ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Ongeldige invoer: verwacht ".concat(U(n.values[0])):"Ongeldige optie: verwacht \xE9\xE9n van ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"Te lang: verwacht dat ".concat((o=n.origin)!=null?o:"waarde"," ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"elementen"," bevat"):"Te lang: verwacht dat ".concat((l=n.origin)!=null?l:"waarde"," ").concat(u).concat(n.maximum.toString()," is")}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"Te kort: verwacht dat ".concat(n.origin," ").concat(u).concat(n.minimum.toString()," ").concat(p.unit," bevat"):"Te kort: verwacht dat ".concat(n.origin," ").concat(u).concat(n.minimum.toString()," is")}case"invalid_format":{let u=n;return u.format==="starts_with"?'Ongeldige tekst: moet met "'.concat(u.prefix,'" beginnen'):u.format==="ends_with"?'Ongeldige tekst: moet op "'.concat(u.suffix,'" eindigen'):u.format==="includes"?'Ongeldige tekst: moet "'.concat(u.includes,'" bevatten'):u.format==="regex"?"Ongeldige tekst: moet overeenkomen met patroon ".concat(u.pattern):"Ongeldig: ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"Ongeldig getal: moet een veelvoud van ".concat(n.divisor," zijn");case"unrecognized_keys":return"Onbekende key".concat(n.keys.length>1?"s":"",": ").concat(E(n.keys,", "));case"invalid_key":return"Ongeldige key in ".concat(n.origin);case"invalid_union":return"Ongeldige invoer";case"invalid_element":return"Ongeldige waarde in ".concat(n.origin);default:return"Ongeldige invoer"}}},"error");function i_(){return{localeError:a3()}}s(i_,"default");m();var s3=s(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"Ugyldig input: forventet ".concat(n.expected,", fikk ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Ugyldig verdi: forventet ".concat(U(n.values[0])):"Ugyldig valg: forventet en av ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"For stor(t): forventet ".concat((o=n.origin)!=null?o:"value"," til \xE5 ha ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"elementer"):"For stor(t): forventet ".concat((l=n.origin)!=null?l:"value"," til \xE5 ha ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"For lite(n): forventet ".concat(n.origin," til \xE5 ha ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"For lite(n): forventet ".concat(n.origin," til \xE5 ha ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'Ugyldig streng: m\xE5 starte med "'.concat(u.prefix,'"'):u.format==="ends_with"?'Ugyldig streng: m\xE5 ende med "'.concat(u.suffix,'"'):u.format==="includes"?'Ugyldig streng: m\xE5 inneholde "'.concat(u.includes,'"'):u.format==="regex"?"Ugyldig streng: m\xE5 matche m\xF8nsteret ".concat(u.pattern):"Ugyldig ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"Ugyldig tall: m\xE5 v\xE6re et multiplum av ".concat(n.divisor);case"unrecognized_keys":return"".concat(n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel",": ").concat(E(n.keys,", "));case"invalid_key":return"Ugyldig n\xF8kkel i ".concat(n.origin);case"invalid_union":return"Ugyldig input";case"invalid_element":return"Ugyldig verdi i ".concat(n.origin);default:return"Ugyldig input"}}},"error");function o_(){return{localeError:s3()}}s(o_,"default");m();var l3=s(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"F\xE2sit giren: umulan ".concat(n.expected,", al\u0131nan ").concat(r(n.input));case"invalid_value":return n.values.length===1?"F\xE2sit giren: umulan ".concat(U(n.values[0])):"F\xE2sit tercih: m\xFBteberler ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"Fazla b\xFCy\xFCk: ".concat((o=n.origin)!=null?o:"value",", ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"elements"," sahip olmal\u0131yd\u0131."):"Fazla b\xFCy\xFCk: ".concat((l=n.origin)!=null?l:"value",", ").concat(u).concat(n.maximum.toString()," olmal\u0131yd\u0131.")}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"Fazla k\xFC\xE7\xFCk: ".concat(n.origin,", ").concat(u).concat(n.minimum.toString()," ").concat(p.unit," sahip olmal\u0131yd\u0131."):"Fazla k\xFC\xE7\xFCk: ".concat(n.origin,", ").concat(u).concat(n.minimum.toString()," olmal\u0131yd\u0131.")}case"invalid_format":{let u=n;return u.format==="starts_with"?'F\xE2sit metin: "'.concat(u.prefix,'" ile ba\u015Flamal\u0131.'):u.format==="ends_with"?'F\xE2sit metin: "'.concat(u.suffix,'" ile bitmeli.'):u.format==="includes"?'F\xE2sit metin: "'.concat(u.includes,'" ihtiv\xE2 etmeli.'):u.format==="regex"?"F\xE2sit metin: ".concat(u.pattern," nak\u015F\u0131na uymal\u0131."):"F\xE2sit ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"F\xE2sit say\u0131: ".concat(n.divisor," kat\u0131 olmal\u0131yd\u0131.");case"unrecognized_keys":return"Tan\u0131nmayan anahtar ".concat(n.keys.length>1?"s":"",": ").concat(E(n.keys,", "));case"invalid_key":return"".concat(n.origin," i\xE7in tan\u0131nmayan anahtar var.");case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return"".concat(n.origin," i\xE7in tan\u0131nmayan k\u0131ymet var.");default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function a_(){return{localeError:l3()}}s(a_,"default");m();var u3=s(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0627\u0631\u06D0";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ".concat(n.expected," \u0648\u0627\u06CC, \u0645\u06AB\u0631 ").concat(r(n.input)," \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648");case"invalid_value":return n.values.length===1?"\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ".concat(U(n.values[0])," \u0648\u0627\u06CC"):"\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ".concat(E(n.values,"|")," \u0685\u062E\u0647 \u0648\u0627\u06CC");case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"\u0689\u06CC\u0631 \u0644\u0648\u06CC: ".concat((o=n.origin)!=null?o:"\u0627\u0631\u0632\u069A\u062A"," \u0628\u0627\u06CC\u062F ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"," \u0648\u0644\u0631\u064A"):"\u0689\u06CC\u0631 \u0644\u0648\u06CC: ".concat((l=n.origin)!=null?l:"\u0627\u0631\u0632\u069A\u062A"," \u0628\u0627\u06CC\u062F ").concat(u).concat(n.maximum.toString()," \u0648\u064A")}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ".concat(n.origin," \u0628\u0627\u06CC\u062F ").concat(u).concat(n.minimum.toString()," ").concat(p.unit," \u0648\u0644\u0631\u064A"):"\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ".concat(n.origin," \u0628\u0627\u06CC\u062F ").concat(u).concat(n.minimum.toString()," \u0648\u064A")}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "'.concat(u.prefix,'" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A'):u.format==="ends_with"?'\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "'.concat(u.suffix,'" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A'):u.format==="includes"?'\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "'.concat(u.includes,'" \u0648\u0644\u0631\u064A'):u.format==="regex"?"\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ".concat(u.pattern," \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A"):"".concat((c=i[u.format])!=null?c:n.format," \u0646\u0627\u0633\u0645 \u062F\u06CC")}case"not_multiple_of":return"\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ".concat(n.divisor," \u0645\u0636\u0631\u0628 \u0648\u064A");case"unrecognized_keys":return"\u0646\u0627\u0633\u0645 ".concat(n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689",": ").concat(E(n.keys,", "));case"invalid_key":return"\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ".concat(n.origin," \u06A9\u06D0");case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return"\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ".concat(n.origin," \u06A9\u06D0");default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function s_(){return{localeError:u3()}}s(s_,"default");m();var c3=s(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return n=>{var o,a,l,c,u,p,f;switch(n.code){case"invalid_type":return"Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ".concat(n.expected,", otrzymano ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ".concat(U(n.values[0])):"Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ".concat(E(n.values,"|"));case"too_big":{let h=n.inclusive?"<=":"<",y=e(n.origin);return y?"Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ".concat((o=n.origin)!=null?o:"warto\u015B\u0107"," b\u0119dzie mie\u0107 ").concat(h).concat(n.maximum.toString()," ").concat((a=y.unit)!=null?a:"element\xF3w"):"Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ".concat((l=n.origin)!=null?l:"warto\u015B\u0107"," b\u0119dzie wynosi\u0107 ").concat(h).concat(n.maximum.toString())}case"too_small":{let h=n.inclusive?">=":">",y=e(n.origin);return y?"Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ".concat((c=n.origin)!=null?c:"warto\u015B\u0107"," b\u0119dzie mie\u0107 ").concat(h).concat(n.minimum.toString()," ").concat((u=y.unit)!=null?u:"element\xF3w"):"Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ".concat((p=n.origin)!=null?p:"warto\u015B\u0107"," b\u0119dzie wynosi\u0107 ").concat(h).concat(n.minimum.toString())}case"invalid_format":{let h=n;return h.format==="starts_with"?'Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "'.concat(h.prefix,'"'):h.format==="ends_with"?'Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "'.concat(h.suffix,'"'):h.format==="includes"?'Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "'.concat(h.includes,'"'):h.format==="regex"?"Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ".concat(h.pattern):"Nieprawid\u0142ow(y/a/e) ".concat((f=i[h.format])!=null?f:n.format)}case"not_multiple_of":return"Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ".concat(n.divisor);case"unrecognized_keys":return"Nierozpoznane klucze".concat(n.keys.length>1?"s":"",": ").concat(E(n.keys,", "));case"invalid_key":return"Nieprawid\u0142owy klucz w ".concat(n.origin);case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return"Nieprawid\u0142owa warto\u015B\u0107 w ".concat(n.origin);default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function l_(){return{localeError:c3()}}s(l_,"default");m();var p3=s(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"Tipo inv\xE1lido: esperado ".concat(n.expected,", recebido ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Entrada inv\xE1lida: esperado ".concat(U(n.values[0])):"Op\xE7\xE3o inv\xE1lida: esperada uma das ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"Muito grande: esperado que ".concat((o=n.origin)!=null?o:"valor"," tivesse ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"elementos"):"Muito grande: esperado que ".concat((l=n.origin)!=null?l:"valor"," fosse ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"Muito pequeno: esperado que ".concat(n.origin," tivesse ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"Muito pequeno: esperado que ".concat(n.origin," fosse ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'Texto inv\xE1lido: deve come\xE7ar com "'.concat(u.prefix,'"'):u.format==="ends_with"?'Texto inv\xE1lido: deve terminar com "'.concat(u.suffix,'"'):u.format==="includes"?'Texto inv\xE1lido: deve incluir "'.concat(u.includes,'"'):u.format==="regex"?"Texto inv\xE1lido: deve corresponder ao padr\xE3o ".concat(u.pattern):"".concat((c=i[u.format])!=null?c:n.format," inv\xE1lido")}case"not_multiple_of":return"N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ".concat(n.divisor);case"unrecognized_keys":return"Chave".concat(n.keys.length>1?"s":""," desconhecida").concat(n.keys.length>1?"s":"",": ").concat(E(n.keys,", "));case"invalid_key":return"Chave inv\xE1lida em ".concat(n.origin);case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return"Valor inv\xE1lido em ".concat(n.origin);default:return"Campo inv\xE1lido"}}},"error");function u_(){return{localeError:p3()}}s(u_,"default");m();function nC(t,e,r,i){let n=Math.abs(t),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?r:i}s(nC,"getRussianPlural");var m3=s(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return n=>{var o,a,l;switch(n.code){case"invalid_type":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ".concat(n.expected,", \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ".concat(U(n.values[0])):"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ".concat(E(n.values,"|"));case"too_big":{let c=n.inclusive?"<=":"<",u=e(n.origin);if(u){let p=Number(n.maximum),f=nC(p,u.unit.one,u.unit.few,u.unit.many);return"\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ".concat((o=n.origin)!=null?o:"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"," \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ").concat(c).concat(n.maximum.toString()," ").concat(f)}return"\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ".concat((a=n.origin)!=null?a:"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"," \u0431\u0443\u0434\u0435\u0442 ").concat(c).concat(n.maximum.toString())}case"too_small":{let c=n.inclusive?">=":">",u=e(n.origin);if(u){let p=Number(n.minimum),f=nC(p,u.unit.one,u.unit.few,u.unit.many);return"\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ".concat(n.origin," \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ").concat(c).concat(n.minimum.toString()," ").concat(f)}return"\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ".concat(n.origin," \u0431\u0443\u0434\u0435\u0442 ").concat(c).concat(n.minimum.toString())}case"invalid_format":{let c=n;return c.format==="starts_with"?'\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "'.concat(c.prefix,'"'):c.format==="ends_with"?'\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "'.concat(c.suffix,'"'):c.format==="includes"?'\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "'.concat(c.includes,'"'):c.format==="regex"?"\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ".concat(c.pattern):"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ".concat((l=i[c.format])!=null?l:n.format)}case"not_multiple_of":return"\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ".concat(n.divisor);case"unrecognized_keys":return"\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D".concat(n.keys.length>1?"\u044B\u0435":"\u044B\u0439"," \u043A\u043B\u044E\u0447").concat(n.keys.length>1?"\u0438":"",": ").concat(E(n.keys,", "));case"invalid_key":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ".concat(n.origin);case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return"\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ".concat(n.origin);default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function c_(){return{localeError:m3()}}s(c_,"default");m();var f3=s(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"Neveljaven vnos: pri\u010Dakovano ".concat(n.expected,", prejeto ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Neveljaven vnos: pri\u010Dakovano ".concat(U(n.values[0])):"Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"Preveliko: pri\u010Dakovano, da bo ".concat((o=n.origin)!=null?o:"vrednost"," imelo ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"elementov"):"Preveliko: pri\u010Dakovano, da bo ".concat((l=n.origin)!=null?l:"vrednost"," ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"Premajhno: pri\u010Dakovano, da bo ".concat(n.origin," imelo ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"Premajhno: pri\u010Dakovano, da bo ".concat(n.origin," ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'Neveljaven niz: mora se za\u010Deti z "'.concat(u.prefix,'"'):u.format==="ends_with"?'Neveljaven niz: mora se kon\u010Dati z "'.concat(u.suffix,'"'):u.format==="includes"?'Neveljaven niz: mora vsebovati "'.concat(u.includes,'"'):u.format==="regex"?"Neveljaven niz: mora ustrezati vzorcu ".concat(u.pattern):"Neveljaven ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ".concat(n.divisor);case"unrecognized_keys":return"Neprepoznan".concat(n.keys.length>1?"i klju\u010Di":" klju\u010D",": ").concat(E(n.keys,", "));case"invalid_key":return"Neveljaven klju\u010D v ".concat(n.origin);case"invalid_union":return"Neveljaven vnos";case"invalid_element":return"Neveljavna vrednost v ".concat(n.origin);default:return"Neveljaven vnos"}}},"error");function p_(){return{localeError:f3()}}s(p_,"default");m();var h3=s(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return n=>{var o,a,l,c,u,p,f,h;switch(n.code){case"invalid_type":return"Ogiltig inmatning: f\xF6rv\xE4ntat ".concat(n.expected,", fick ").concat(r(n.input));case"invalid_value":return n.values.length===1?"Ogiltig inmatning: f\xF6rv\xE4ntat ".concat(U(n.values[0])):"Ogiltigt val: f\xF6rv\xE4ntade en av ".concat(E(n.values,"|"));case"too_big":{let y=n.inclusive?"<=":"<",g=e(n.origin);return g?"F\xF6r stor(t): f\xF6rv\xE4ntade ".concat((o=n.origin)!=null?o:"v\xE4rdet"," att ha ").concat(y).concat(n.maximum.toString()," ").concat((a=g.unit)!=null?a:"element"):"F\xF6r stor(t): f\xF6rv\xE4ntat ".concat((l=n.origin)!=null?l:"v\xE4rdet"," att ha ").concat(y).concat(n.maximum.toString())}case"too_small":{let y=n.inclusive?">=":">",g=e(n.origin);return g?"F\xF6r lite(t): f\xF6rv\xE4ntade ".concat((c=n.origin)!=null?c:"v\xE4rdet"," att ha ").concat(y).concat(n.minimum.toString()," ").concat(g.unit):"F\xF6r lite(t): f\xF6rv\xE4ntade ".concat((u=n.origin)!=null?u:"v\xE4rdet"," att ha ").concat(y).concat(n.minimum.toString())}case"invalid_format":{let y=n;return y.format==="starts_with"?'Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "'.concat(y.prefix,'"'):y.format==="ends_with"?'Ogiltig str\xE4ng: m\xE5ste sluta med "'.concat(y.suffix,'"'):y.format==="includes"?'Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "'.concat(y.includes,'"'):y.format==="regex"?'Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "'.concat(y.pattern,'"'):"Ogiltig(t) ".concat((p=i[y.format])!=null?p:n.format)}case"not_multiple_of":return"Ogiltigt tal: m\xE5ste vara en multipel av ".concat(n.divisor);case"unrecognized_keys":return"".concat(n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel",": ").concat(E(n.keys,", "));case"invalid_key":return"Ogiltig nyckel i ".concat((f=n.origin)!=null?f:"v\xE4rdet");case"invalid_union":return"Ogiltig input";case"invalid_element":return"Ogiltigt v\xE4rde i ".concat((h=n.origin)!=null?h:"v\xE4rdet");default:return"Ogiltig input"}}},"error");function m_(){return{localeError:h3()}}s(m_,"default");m();var d3=s(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(n))return"\u0B85\u0BA3\u0BBF";if(n===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ".concat(n.expected,", \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ".concat(U(n.values[0])):"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ".concat(E(n.values,"|")," \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1");case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ".concat((o=n.origin)!=null?o:"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"," ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"," \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"):"\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ".concat((l=n.origin)!=null?l:"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"," ").concat(u).concat(n.maximum.toString()," \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD")}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ".concat(n.origin," ").concat(u).concat(n.minimum.toString()," ").concat(p.unit," \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"):"\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ".concat(n.origin," ").concat(u).concat(n.minimum.toString()," \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD")}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "'.concat(u.prefix,'" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD'):u.format==="ends_with"?'\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "'.concat(u.suffix,'" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD'):u.format==="includes"?'\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "'.concat(u.includes,'" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD'):u.format==="regex"?"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ".concat(u.pattern," \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"):"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ".concat(n.divisor," \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD");case"unrecognized_keys":return"\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8".concat(n.keys.length>1?"\u0B95\u0BB3\u0BCD":"",": ").concat(E(n.keys,", "));case"invalid_key":return"".concat(n.origin," \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8");case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return"".concat(n.origin," \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1");default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function f_(){return{localeError:d3()}}s(f_,"default");m();var y3=s(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(n))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(n===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ".concat(n.expected," \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ".concat(U(n.values[0])):"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",p=e(n.origin);return p?"\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ".concat((o=n.origin)!=null?o:"\u0E04\u0E48\u0E32"," \u0E04\u0E27\u0E23\u0E21\u0E35").concat(u," ").concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"):"\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ".concat((l=n.origin)!=null?l:"\u0E04\u0E48\u0E32"," \u0E04\u0E27\u0E23\u0E21\u0E35").concat(u," ").concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",p=e(n.origin);return p?"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ".concat(n.origin," \u0E04\u0E27\u0E23\u0E21\u0E35").concat(u," ").concat(n.minimum.toString()," ").concat(p.unit):"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ".concat(n.origin," \u0E04\u0E27\u0E23\u0E21\u0E35").concat(u," ").concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "'.concat(u.prefix,'"'):u.format==="ends_with"?'\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "'.concat(u.suffix,'"'):u.format==="includes"?'\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "'.concat(u.includes,'" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21'):u.format==="regex"?"\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ".concat(u.pattern):"\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ".concat(n.divisor," \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27");case"unrecognized_keys":return"\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ".concat(E(n.keys,", "));case"invalid_key":return"\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ".concat(n.origin);case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ".concat(n.origin);default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function h_(){return{localeError:y3()}}s(h_,"default");m();var g3=s(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),b3=s(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(i){var n;return(n=t[i])!=null?n:null}s(e,"getSizing");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return i=>{var n,o,a,l;switch(i.code){case"invalid_type":return"Ge\xE7ersiz de\u011Fer: beklenen ".concat(i.expected,", al\u0131nan ").concat(g3(i.input));case"invalid_value":return i.values.length===1?"Ge\xE7ersiz de\u011Fer: beklenen ".concat(U(i.values[0])):"Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ".concat(E(i.values,"|"));case"too_big":{let c=i.inclusive?"<=":"<",u=e(i.origin);return u?"\xC7ok b\xFCy\xFCk: beklenen ".concat((n=i.origin)!=null?n:"de\u011Fer"," ").concat(c).concat(i.maximum.toString()," ").concat((o=u.unit)!=null?o:"\xF6\u011Fe"):"\xC7ok b\xFCy\xFCk: beklenen ".concat((a=i.origin)!=null?a:"de\u011Fer"," ").concat(c).concat(i.maximum.toString())}case"too_small":{let c=i.inclusive?">=":">",u=e(i.origin);return u?"\xC7ok k\xFC\xE7\xFCk: beklenen ".concat(i.origin," ").concat(c).concat(i.minimum.toString()," ").concat(u.unit):"\xC7ok k\xFC\xE7\xFCk: beklenen ".concat(i.origin," ").concat(c).concat(i.minimum.toString())}case"invalid_format":{let c=i;return c.format==="starts_with"?'Ge\xE7ersiz metin: "'.concat(c.prefix,'" ile ba\u015Flamal\u0131'):c.format==="ends_with"?'Ge\xE7ersiz metin: "'.concat(c.suffix,'" ile bitmeli'):c.format==="includes"?'Ge\xE7ersiz metin: "'.concat(c.includes,'" i\xE7ermeli'):c.format==="regex"?"Ge\xE7ersiz metin: ".concat(c.pattern," desenine uymal\u0131"):"Ge\xE7ersiz ".concat((l=r[c.format])!=null?l:i.format)}case"not_multiple_of":return"Ge\xE7ersiz say\u0131: ".concat(i.divisor," ile tam b\xF6l\xFCnebilmeli");case"unrecognized_keys":return"Tan\u0131nmayan anahtar".concat(i.keys.length>1?"lar":"",": ").concat(E(i.keys,", "));case"invalid_key":return"".concat(i.origin," i\xE7inde ge\xE7ersiz anahtar");case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return"".concat(i.origin," i\xE7inde ge\xE7ersiz de\u011Fer");default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function d_(){return{localeError:b3()}}s(d_,"default");m();m();var x3=s(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ".concat(n.expected,", \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ".concat(U(n.values[0])):"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ".concat((o=n.origin)!=null?o:"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"," ").concat(p.verb," ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"):"\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ".concat((l=n.origin)!=null?l:"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"," \u0431\u0443\u0434\u0435 ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ".concat(n.origin," ").concat(p.verb," ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ".concat(n.origin," \u0431\u0443\u0434\u0435 ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "'.concat(u.prefix,'"'):u.format==="ends_with"?'\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "'.concat(u.suffix,'"'):u.format==="includes"?'\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "'.concat(u.includes,'"'):u.format==="regex"?"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ".concat(u.pattern):"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ".concat(n.divisor);case"unrecognized_keys":return"\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447".concat(n.keys.length>1?"\u0456":"",": ").concat(E(n.keys,", "));case"invalid_key":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ".concat(n.origin);case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ".concat(n.origin);default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function qs(){return{localeError:x3()}}s(qs,"default");function y_(){return qs()}s(y_,"default");m();var _3=s(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(n))return"\u0622\u0631\u06D2";if(n===null)return"\u0646\u0644";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ".concat(n.expected," \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ").concat(r(n.input)," \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627");case"invalid_value":return n.values.length===1?"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ".concat(U(n.values[0])," \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627"):"\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ".concat(E(n.values,"|")," \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627");case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"\u0628\u06C1\u062A \u0628\u0691\u0627: ".concat((o=n.origin)!=null?o:"\u0648\u06CC\u0644\u06CC\u0648"," \u06A9\u06D2 ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"\u0639\u0646\u0627\u0635\u0631"," \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2"):"\u0628\u06C1\u062A \u0628\u0691\u0627: ".concat((l=n.origin)!=null?l:"\u0648\u06CC\u0644\u06CC\u0648"," \u06A9\u0627 ").concat(u).concat(n.maximum.toString()," \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627")}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ".concat(n.origin," \u06A9\u06D2 ").concat(u).concat(n.minimum.toString()," ").concat(p.unit," \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2"):"\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ".concat(n.origin," \u06A9\u0627 ").concat(u).concat(n.minimum.toString()," \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627")}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "'.concat(u.prefix,'" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2'):u.format==="ends_with"?'\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "'.concat(u.suffix,'" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2'):u.format==="includes"?'\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "'.concat(u.includes,'" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2'):u.format==="regex"?"\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ".concat(u.pattern," \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2"):"\u063A\u0644\u0637 ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ".concat(n.divisor," \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2");case"unrecognized_keys":return"\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC".concat(n.keys.length>1?"\u0632":"",": ").concat(E(n.keys,"\u060C "));case"invalid_key":return"".concat(n.origin," \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC");case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return"".concat(n.origin," \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648");default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function g_(){return{localeError:_3()}}s(g_,"default");m();var v3=s(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(n))return"m\u1EA3ng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ".concat(n.expected,", nh\u1EADn \u0111\u01B0\u1EE3c ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ".concat(U(n.values[0])):"T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ".concat((o=n.origin)!=null?o:"gi\xE1 tr\u1ECB"," ").concat(p.verb," ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"ph\u1EA7n t\u1EED"):"Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ".concat((l=n.origin)!=null?l:"gi\xE1 tr\u1ECB"," ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ".concat(n.origin," ").concat(p.verb," ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ".concat(n.origin," ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "'.concat(u.prefix,'"'):u.format==="ends_with"?'Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "'.concat(u.suffix,'"'):u.format==="includes"?'Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "'.concat(u.includes,'"'):u.format==="regex"?"Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ".concat(u.pattern):"".concat((c=i[u.format])!=null?c:n.format," kh\xF4ng h\u1EE3p l\u1EC7")}case"not_multiple_of":return"S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ".concat(n.divisor);case"unrecognized_keys":return"Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ".concat(E(n.keys,", "));case"invalid_key":return"Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ".concat(n.origin);case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return"Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ".concat(n.origin);default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function b_(){return{localeError:v3()}}s(b_,"default");m();var P3=s(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(n))return"\u6570\u7EC4";if(n===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ".concat(n.expected,"\uFF0C\u5B9E\u9645\u63A5\u6536 ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ".concat(U(n.values[0])):"\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ".concat((o=n.origin)!=null?o:"\u503C"," ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"\u4E2A\u5143\u7D20"):"\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ".concat((l=n.origin)!=null?l:"\u503C"," ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ".concat(n.origin," ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ".concat(n.origin," ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "'.concat(u.prefix,'" \u5F00\u5934'):u.format==="ends_with"?'\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "'.concat(u.suffix,'" \u7ED3\u5C3E'):u.format==="includes"?'\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "'.concat(u.includes,'"'):u.format==="regex"?"\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ".concat(u.pattern):"\u65E0\u6548".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ".concat(n.divisor," \u7684\u500D\u6570");case"unrecognized_keys":return"\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ".concat(E(n.keys,", "));case"invalid_key":return"".concat(n.origin," \u4E2D\u7684\u952E(key)\u65E0\u6548");case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return"".concat(n.origin," \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)");default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function x_(){return{localeError:P3()}}s(x_,"default");m();var w3=s(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return n=>{var o,a,l,c;switch(n.code){case"invalid_type":return"\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ".concat(n.expected,"\uFF0C\u4F46\u6536\u5230 ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ".concat(U(n.values[0])):"\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ".concat(E(n.values,"|"));case"too_big":{let u=n.inclusive?"<=":"<",p=e(n.origin);return p?"\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ".concat((o=n.origin)!=null?o:"\u503C"," \u61C9\u70BA ").concat(u).concat(n.maximum.toString()," ").concat((a=p.unit)!=null?a:"\u500B\u5143\u7D20"):"\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ".concat((l=n.origin)!=null?l:"\u503C"," \u61C9\u70BA ").concat(u).concat(n.maximum.toString())}case"too_small":{let u=n.inclusive?">=":">",p=e(n.origin);return p?"\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ".concat(n.origin," \u61C9\u70BA ").concat(u).concat(n.minimum.toString()," ").concat(p.unit):"\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ".concat(n.origin," \u61C9\u70BA ").concat(u).concat(n.minimum.toString())}case"invalid_format":{let u=n;return u.format==="starts_with"?'\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "'.concat(u.prefix,'" \u958B\u982D'):u.format==="ends_with"?'\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "'.concat(u.suffix,'" \u7D50\u5C3E'):u.format==="includes"?'\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "'.concat(u.includes,'"'):u.format==="regex"?"\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ".concat(u.pattern):"\u7121\u6548\u7684 ".concat((c=i[u.format])!=null?c:n.format)}case"not_multiple_of":return"\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ".concat(n.divisor," \u7684\u500D\u6578");case"unrecognized_keys":return"\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C".concat(n.keys.length>1?"\u5011":"","\uFF1A").concat(E(n.keys,"\u3001"));case"invalid_key":return"".concat(n.origin," \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C");case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return"".concat(n.origin," \u4E2D\u6709\u7121\u6548\u7684\u503C");default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function __(){return{localeError:w3()}}s(__,"default");m();var S3=s(()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(n){var o;return(o=t[n])!=null?o:null}s(e,"getSizing");let r=s(n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\u1ECD\u0301mb\xE0";case"object":{if(Array.isArray(n))return"akop\u1ECD";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},"parsedType"),i={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"};return n=>{var o,a;switch(n.code){case"invalid_type":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ".concat(n.expected,", \xE0m\u1ECD\u0300 a r\xED ").concat(r(n.input));case"invalid_value":return n.values.length===1?"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ".concat(U(n.values[0])):"\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ".concat(E(n.values,"|"));case"too_big":{let l=n.inclusive?"<=":"<",c=e(n.origin);return c?"T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ".concat((o=n.origin)!=null?o:"iye"," ").concat(c.verb," ").concat(l).concat(n.maximum," ").concat(c.unit):"T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ".concat(l).concat(n.maximum)}case"too_small":{let l=n.inclusive?">=":">",c=e(n.origin);return c?"K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ".concat(n.origin," ").concat(c.verb," ").concat(l).concat(n.minimum," ").concat(c.unit):"K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ".concat(l).concat(n.minimum)}case"invalid_format":{let l=n;return l.format==="starts_with"?'\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "'.concat(l.prefix,'"'):l.format==="ends_with"?'\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "'.concat(l.suffix,'"'):l.format==="includes"?'\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "'.concat(l.includes,'"'):l.format==="regex"?"\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ".concat(l.pattern):"A\u1E63\xEC\u1E63e: ".concat((a=i[l.format])!=null?a:n.format)}case"not_multiple_of":return"N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ".concat(n.divisor);case"unrecognized_keys":return"B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ".concat(E(n.keys,", "));case"invalid_key":return"B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ".concat(n.origin);case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return"Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ".concat(n.origin);default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},"error");function v_(){return{localeError:S3()}}s(v_,"default");m();var P_=Symbol("ZodOutput"),w_=Symbol("ZodInput"),S_=class S_{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let i=r[0];if(this._map.set(e,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error("ID ".concat(i.id," already exists in the registry"));this._idmap.set(i.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){var i;let r=e._zod.parent;if(r){let n=C({},(i=this.get(r))!=null?i:{});delete n.id;let o=C(C({},n),this._map.get(e));return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};s(S_,"$ZodRegistry");var wo=S_;function Ep(){return new wo}s(Ep,"registry");var Cr=Ep();m();function T_(t,e){return new t(C({type:"string"},$(e)))}s(T_,"_string");function I_(t,e){return new t(C({type:"string",coerce:!0},$(e)))}s(I_,"_coercedString");function kp(t,e){return new t(C({type:"string",format:"email",check:"string_format",abort:!1},$(e)))}s(kp,"_email");function Ws(t,e){return new t(C({type:"string",format:"guid",check:"string_format",abort:!1},$(e)))}s(Ws,"_guid");function Lp(t,e){return new t(C({type:"string",format:"uuid",check:"string_format",abort:!1},$(e)))}s(Lp,"_uuid");function Dp(t,e){return new t(C({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4"},$(e)))}s(Dp,"_uuidv4");function zp(t,e){return new t(C({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6"},$(e)))}s(zp,"_uuidv6");function Op(t,e){return new t(C({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7"},$(e)))}s(Op,"_uuidv7");function Ys(t,e){return new t(C({type:"string",format:"url",check:"string_format",abort:!1},$(e)))}s(Ys,"_url");function Rp(t,e){return new t(C({type:"string",format:"emoji",check:"string_format",abort:!1},$(e)))}s(Rp,"_emoji");function Fp(t,e){return new t(C({type:"string",format:"nanoid",check:"string_format",abort:!1},$(e)))}s(Fp,"_nanoid");function Bp(t,e){return new t(C({type:"string",format:"cuid",check:"string_format",abort:!1},$(e)))}s(Bp,"_cuid");function Up(t,e){return new t(C({type:"string",format:"cuid2",check:"string_format",abort:!1},$(e)))}s(Up,"_cuid2");function Np(t,e){return new t(C({type:"string",format:"ulid",check:"string_format",abort:!1},$(e)))}s(Np,"_ulid");function $p(t,e){return new t(C({type:"string",format:"xid",check:"string_format",abort:!1},$(e)))}s($p,"_xid");function Vp(t,e){return new t(C({type:"string",format:"ksuid",check:"string_format",abort:!1},$(e)))}s(Vp,"_ksuid");function jp(t,e){return new t(C({type:"string",format:"ipv4",check:"string_format",abort:!1},$(e)))}s(jp,"_ipv4");function Gp(t,e){return new t(C({type:"string",format:"ipv6",check:"string_format",abort:!1},$(e)))}s(Gp,"_ipv6");function Zp(t,e){return new t(C({type:"string",format:"cidrv4",check:"string_format",abort:!1},$(e)))}s(Zp,"_cidrv4");function Xp(t,e){return new t(C({type:"string",format:"cidrv6",check:"string_format",abort:!1},$(e)))}s(Xp,"_cidrv6");function Hp(t,e){return new t(C({type:"string",format:"base64",check:"string_format",abort:!1},$(e)))}s(Hp,"_base64");function qp(t,e){return new t(C({type:"string",format:"base64url",check:"string_format",abort:!1},$(e)))}s(qp,"_base64url");function Wp(t,e){return new t(C({type:"string",format:"e164",check:"string_format",abort:!1},$(e)))}s(Wp,"_e164");function Yp(t,e){return new t(C({type:"string",format:"jwt",check:"string_format",abort:!1},$(e)))}s(Yp,"_jwt");var C_={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function M_(t,e){return new t(C({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null},$(e)))}s(M_,"_isoDateTime");function A_(t,e){return new t(C({type:"string",format:"date",check:"string_format"},$(e)))}s(A_,"_isoDate");function E_(t,e){return new t(C({type:"string",format:"time",check:"string_format",precision:null},$(e)))}s(E_,"_isoTime");function k_(t,e){return new t(C({type:"string",format:"duration",check:"string_format"},$(e)))}s(k_,"_isoDuration");function L_(t,e){return new t(C({type:"number",checks:[]},$(e)))}s(L_,"_number");function D_(t,e){return new t(C({type:"number",coerce:!0,checks:[]},$(e)))}s(D_,"_coercedNumber");function z_(t,e){return new t(C({type:"number",check:"number_format",abort:!1,format:"safeint"},$(e)))}s(z_,"_int");function O_(t,e){return new t(C({type:"number",check:"number_format",abort:!1,format:"float32"},$(e)))}s(O_,"_float32");function R_(t,e){return new t(C({type:"number",check:"number_format",abort:!1,format:"float64"},$(e)))}s(R_,"_float64");function F_(t,e){return new t(C({type:"number",check:"number_format",abort:!1,format:"int32"},$(e)))}s(F_,"_int32");function B_(t,e){return new t(C({type:"number",check:"number_format",abort:!1,format:"uint32"},$(e)))}s(B_,"_uint32");function U_(t,e){return new t(C({type:"boolean"},$(e)))}s(U_,"_boolean");function N_(t,e){return new t(C({type:"boolean",coerce:!0},$(e)))}s(N_,"_coercedBoolean");function $_(t,e){return new t(C({type:"bigint"},$(e)))}s($_,"_bigint");function V_(t,e){return new t(C({type:"bigint",coerce:!0},$(e)))}s(V_,"_coercedBigint");function j_(t,e){return new t(C({type:"bigint",check:"bigint_format",abort:!1,format:"int64"},$(e)))}s(j_,"_int64");function G_(t,e){return new t(C({type:"bigint",check:"bigint_format",abort:!1,format:"uint64"},$(e)))}s(G_,"_uint64");function Z_(t,e){return new t(C({type:"symbol"},$(e)))}s(Z_,"_symbol");function X_(t,e){return new t(C({type:"undefined"},$(e)))}s(X_,"_undefined");function H_(t,e){return new t(C({type:"null"},$(e)))}s(H_,"_null");function q_(t){return new t({type:"any"})}s(q_,"_any");function W_(t){return new t({type:"unknown"})}s(W_,"_unknown");function Y_(t,e){return new t(C({type:"never"},$(e)))}s(Y_,"_never");function J_(t,e){return new t(C({type:"void"},$(e)))}s(J_,"_void");function K_(t,e){return new t(C({type:"date"},$(e)))}s(K_,"_date");function Q_(t,e){return new t(C({type:"date",coerce:!0},$(e)))}s(Q_,"_coercedDate");function ev(t,e){return new t(C({type:"nan"},$(e)))}s(ev,"_nan");function jr(t,e){return new xp(j(C({check:"less_than"},$(e)),{value:t,inclusive:!1}))}s(jr,"_lt");function qt(t,e){return new xp(j(C({check:"less_than"},$(e)),{value:t,inclusive:!0}))}s(qt,"_lte");function Gr(t,e){return new _p(j(C({check:"greater_than"},$(e)),{value:t,inclusive:!1}))}s(Gr,"_gt");function wt(t,e){return new _p(j(C({check:"greater_than"},$(e)),{value:t,inclusive:!0}))}s(wt,"_gte");function tv(t){return Gr(0,t)}s(tv,"_positive");function rv(t){return jr(0,t)}s(rv,"_negative");function nv(t){return qt(0,t)}s(nv,"_nonpositive");function iv(t){return wt(0,t)}s(iv,"_nonnegative");function ai(t,e){return new ib(j(C({check:"multiple_of"},$(e)),{value:t}))}s(ai,"_multipleOf");function So(t,e){return new sb(j(C({check:"max_size"},$(e)),{maximum:t}))}s(So,"_maxSize");function si(t,e){return new lb(j(C({check:"min_size"},$(e)),{minimum:t}))}s(si,"_minSize");function Js(t,e){return new ub(j(C({check:"size_equals"},$(e)),{size:t}))}s(Js,"_size");function To(t,e){return new cb(j(C({check:"max_length"},$(e)),{maximum:t}))}s(To,"_maxLength");function _n(t,e){return new pb(j(C({check:"min_length"},$(e)),{minimum:t}))}s(_n,"_minLength");function Io(t,e){return new mb(j(C({check:"length_equals"},$(e)),{length:t}))}s(Io,"_length");function Ks(t,e){return new fb(j(C({check:"string_format",format:"regex"},$(e)),{pattern:t}))}s(Ks,"_regex");function Qs(t){return new hb(C({check:"string_format",format:"lowercase"},$(t)))}s(Qs,"_lowercase");function el(t){return new db(C({check:"string_format",format:"uppercase"},$(t)))}s(el,"_uppercase");function tl(t,e){return new yb(j(C({check:"string_format",format:"includes"},$(e)),{includes:t}))}s(tl,"_includes");function rl(t,e){return new gb(j(C({check:"string_format",format:"starts_with"},$(e)),{prefix:t}))}s(rl,"_startsWith");function nl(t,e){return new bb(j(C({check:"string_format",format:"ends_with"},$(e)),{suffix:t}))}s(nl,"_endsWith");function ov(t,e,r){return new xb(C({check:"property",property:t,schema:e},$(r)))}s(ov,"_property");function il(t,e){return new _b(C({check:"mime_type",mime:t},$(e)))}s(il,"_mime");function Zr(t){return new vb({check:"overwrite",tx:t})}s(Zr,"_overwrite");function ol(t){return Zr(e=>e.normalize(t))}s(ol,"_normalize");function al(){return Zr(t=>t.trim())}s(al,"_trim");function sl(){return Zr(t=>t.toLowerCase())}s(sl,"_toLowerCase");function ll(){return Zr(t=>t.toUpperCase())}s(ll,"_toUpperCase");function av(t,e,r){return new t(C({type:"array",element:e},$(r)))}s(av,"_array");function T3(t,e,r){return new t(C({type:"union",options:e},$(r)))}s(T3,"_union");function I3(t,e,r,i){return new t(C({type:"union",options:r,discriminator:e},$(i)))}s(I3,"_discriminatedUnion");function C3(t,e,r){return new t({type:"intersection",left:e,right:r})}s(C3,"_intersection");function M3(t,e,r,i){let n=r instanceof ee,o=n?i:r,a=n?r:null;return new t(C({type:"tuple",items:e,rest:a},$(o)))}s(M3,"_tuple");function A3(t,e,r,i){return new t(C({type:"record",keyType:e,valueType:r},$(i)))}s(A3,"_record");function E3(t,e,r,i){return new t(C({type:"map",keyType:e,valueType:r},$(i)))}s(E3,"_map");function k3(t,e,r){return new t(C({type:"set",valueType:e},$(r)))}s(k3,"_set");function L3(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t(C({type:"enum",entries:i},$(r)))}s(L3,"_enum");function D3(t,e,r){return new t(C({type:"enum",entries:e},$(r)))}s(D3,"_nativeEnum");function z3(t,e,r){return new t(C({type:"literal",values:Array.isArray(e)?e:[e]},$(r)))}s(z3,"_literal");function sv(t,e){return new t(C({type:"file"},$(e)))}s(sv,"_file");function O3(t,e){return new t({type:"transform",transform:e})}s(O3,"_transform");function R3(t,e){return new t({type:"optional",innerType:e})}s(R3,"_optional");function F3(t,e){return new t({type:"nullable",innerType:e})}s(F3,"_nullable");function B3(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():xg(r)}})}s(B3,"_default");function U3(t,e,r){return new t(C({type:"nonoptional",innerType:e},$(r)))}s(U3,"_nonoptional");function N3(t,e){return new t({type:"success",innerType:e})}s(N3,"_success");function $3(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}s($3,"_catch");function V3(t,e,r){return new t({type:"pipe",in:e,out:r})}s(V3,"_pipe");function j3(t,e){return new t({type:"readonly",innerType:e})}s(j3,"_readonly");function G3(t,e,r){return new t(C({type:"template_literal",parts:e},$(r)))}s(G3,"_templateLiteral");function Z3(t,e){return new t({type:"lazy",getter:e})}s(Z3,"_lazy");function X3(t,e){return new t({type:"promise",innerType:e})}s(X3,"_promise");function lv(t,e,r){var o;let i=$(r);return(o=i.abort)!=null||(i.abort=!0),new t(C({type:"custom",check:"custom",fn:e},i))}s(lv,"_custom");function uv(t,e,r){return new t(C({type:"custom",check:"custom",fn:e},$(r)))}s(uv,"_refine");function cv(t){let e=iC(r=>(r.addIssue=i=>{var n,o,a,l;if(typeof i=="string")r.issues.push(go(i,r.value,e._zod.def));else{let c=i;c.fatal&&(c.continue=!1),(n=c.code)!=null||(c.code="custom"),(o=c.input)!=null||(c.input=r.value),(a=c.inst)!=null||(c.inst=e),(l=c.continue)!=null||(c.continue=!e._zod.def.abort),r.issues.push(go(c))}},t(r.value,r)));return e}s(cv,"_superRefine");function iC(t,e){let r=new ke(C({check:"custom"},$(e)));return r._zod.check=t,r}s(iC,"_check");function pv(t,e){var y,g,x,_,P;let r=$(e),i=(y=r.truthy)!=null?y:["true","1","yes","on","y","enabled"],n=(g=r.falsy)!=null?g:["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(I=>typeof I=="string"?I.toLowerCase():I),n=n.map(I=>typeof I=="string"?I.toLowerCase():I));let o=new Set(i),a=new Set(n),l=(x=t.Codec)!=null?x:js,c=(_=t.Boolean)!=null?_:Vs,u=(P=t.String)!=null?P:ii,p=new u({type:"string",error:r.error}),f=new c({type:"boolean",error:r.error}),h=new l({type:"pipe",in:p,out:f,transform:s((I,v)=>{let w=I;return r.case!=="sensitive"&&(w=w.toLowerCase()),o.has(w)?!0:a.has(w)?!1:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:v.value,inst:h,continue:!1}),{})},"transform"),reverseTransform:s((I,v)=>I===!0?i[0]||"true":n[0]||"false","reverseTransform"),error:r.error});return h}s(pv,"_stringbool");function Co(t,e,r,i={}){let n=$(i),o=C(j(C({},$(i)),{check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:l=>r.test(l)}),n);return r instanceof RegExp&&(o.pattern=r),new t(o)}s(Co,"_stringFormat");m();var fv=class fv{constructor(e){var r,i,n,o,a;this.counter=0,this.metadataRegistry=(r=e==null?void 0:e.metadata)!=null?r:Cr,this.target=(i=e==null?void 0:e.target)!=null?i:"draft-2020-12",this.unrepresentable=(n=e==null?void 0:e.unrepresentable)!=null?n:"throw",this.override=(o=e==null?void 0:e.override)!=null?o:()=>{},this.io=(a=e==null?void 0:e.io)!=null?a:"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var f,h,y,g,x;var i;let n=e._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;let l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,l);let c=(h=(f=e._zod).toJSONSchema)==null?void 0:h.call(f);if(c)l.schema=c;else{let _=j(C({},r),{schemaPath:[...r.schemaPath,e],path:r.path}),P=e._zod.parent;if(P)l.ref=P,this.process(P,_),this.seen.get(P).isParent=!0;else{let I=l.schema;switch(n.type){case"string":{let v=I;v.type="string";let{minimum:w,maximum:T,format:A,patterns:k,contentEncoding:L}=e._zod.bag;if(typeof w=="number"&&(v.minLength=w),typeof T=="number"&&(v.maxLength=T),A&&(v.format=(y=o[A])!=null?y:A,v.format===""&&delete v.format),L&&(v.contentEncoding=L),k&&k.size>0){let R=[...k];R.length===1?v.pattern=R[0].source:R.length>1&&(l.schema.allOf=[...R.map(Z=>j(C({},this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{}),{pattern:Z.source}))])}break}case"number":{let v=I,{minimum:w,maximum:T,format:A,multipleOf:k,exclusiveMaximum:L,exclusiveMinimum:R}=e._zod.bag;typeof A=="string"&&A.includes("int")?v.type="integer":v.type="number",typeof R=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(v.minimum=R,v.exclusiveMinimum=!0):v.exclusiveMinimum=R),typeof w=="number"&&(v.minimum=w,typeof R=="number"&&this.target!=="draft-4"&&(R>=w?delete v.minimum:delete v.exclusiveMinimum)),typeof L=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(v.maximum=L,v.exclusiveMaximum=!0):v.exclusiveMaximum=L),typeof T=="number"&&(v.maximum=T,typeof L=="number"&&this.target!=="draft-4"&&(L<=T?delete v.maximum:delete v.exclusiveMaximum)),typeof k=="number"&&(v.multipleOf=k);break}case"boolean":{let v=I;v.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{this.target==="openapi-3.0"?(I.type="string",I.nullable=!0,I.enum=[null]):I.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{I.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let v=I,{minimum:w,maximum:T}=e._zod.bag;typeof w=="number"&&(v.minItems=w),typeof T=="number"&&(v.maxItems=T),v.type="array",v.items=this.process(n.element,j(C({},_),{path:[..._.path,"items"]}));break}case"object":{let v=I;v.type="object",v.properties={};let w=n.shape;for(let k in w)v.properties[k]=this.process(w[k],j(C({},_),{path:[..._.path,"properties",k]}));let T=new Set(Object.keys(w)),A=new Set([...T].filter(k=>{let L=n.shape[k]._zod;return this.io==="input"?L.optin===void 0:L.optout===void 0}));A.size>0&&(v.required=Array.from(A)),((g=n.catchall)==null?void 0:g._zod.def.type)==="never"?v.additionalProperties=!1:n.catchall?n.catchall&&(v.additionalProperties=this.process(n.catchall,j(C({},_),{path:[..._.path,"additionalProperties"]}))):this.io==="output"&&(v.additionalProperties=!1);break}case"union":{let v=I,w=n.options.map((T,A)=>this.process(T,j(C({},_),{path:[..._.path,"anyOf",A]})));v.anyOf=w;break}case"intersection":{let v=I,w=this.process(n.left,j(C({},_),{path:[..._.path,"allOf",0]})),T=this.process(n.right,j(C({},_),{path:[..._.path,"allOf",1]})),A=s(L=>"allOf"in L&&Object.keys(L).length===1,"isSimpleIntersection"),k=[...A(w)?w.allOf:[w],...A(T)?T.allOf:[T]];v.allOf=k;break}case"tuple":{let v=I;v.type="array";let w=this.target==="draft-2020-12"?"prefixItems":"items",T=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",A=n.items.map((Z,q)=>this.process(Z,j(C({},_),{path:[..._.path,w,q]}))),k=n.rest?this.process(n.rest,j(C({},_),{path:[..._.path,T,...this.target==="openapi-3.0"?[n.items.length]:[]]})):null;this.target==="draft-2020-12"?(v.prefixItems=A,k&&(v.items=k)):this.target==="openapi-3.0"?(v.items={anyOf:A},k&&v.items.anyOf.push(k),v.minItems=A.length,k||(v.maxItems=A.length)):(v.items=A,k&&(v.additionalItems=k));let{minimum:L,maximum:R}=e._zod.bag;typeof L=="number"&&(v.minItems=L),typeof R=="number"&&(v.maxItems=R);break}case"record":{let v=I;v.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(v.propertyNames=this.process(n.keyType,j(C({},_),{path:[..._.path,"propertyNames"]}))),v.additionalProperties=this.process(n.valueType,j(C({},_),{path:[..._.path,"additionalProperties"]}));break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let v=I,w=ks(n.entries);w.every(T=>typeof T=="number")&&(v.type="number"),w.every(T=>typeof T=="string")&&(v.type="string"),v.enum=w;break}case"literal":{let v=I,w=[];for(let T of n.values)if(T===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof T=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");w.push(Number(T))}else w.push(T);if(w.length!==0)if(w.length===1){let T=w[0];v.type=T===null?"null":typeof T,this.target==="draft-4"||this.target==="openapi-3.0"?v.enum=[T]:v.const=T}else w.every(T=>typeof T=="number")&&(v.type="number"),w.every(T=>typeof T=="string")&&(v.type="string"),w.every(T=>typeof T=="boolean")&&(v.type="string"),w.every(T=>T===null)&&(v.type="null"),v.enum=w;break}case"file":{let v=I,w={type:"string",format:"binary",contentEncoding:"binary"},{minimum:T,maximum:A,mime:k}=e._zod.bag;T!==void 0&&(w.minLength=T),A!==void 0&&(w.maxLength=A),k?k.length===1?(w.contentMediaType=k[0],Object.assign(v,w)):v.anyOf=k.map(L=>j(C({},w),{contentMediaType:L})):Object.assign(v,w);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let v=this.process(n.innerType,_);this.target==="openapi-3.0"?(l.ref=n.innerType,I.nullable=!0):I.anyOf=[v,{type:"null"}];break}case"nonoptional":{this.process(n.innerType,_),l.ref=n.innerType;break}case"success":{let v=I;v.type="boolean";break}case"default":{this.process(n.innerType,_),l.ref=n.innerType,I.default=JSON.parse(JSON.stringify(n.defaultValue));break}case"prefault":{this.process(n.innerType,_),l.ref=n.innerType,this.io==="input"&&(I._prefault=JSON.parse(JSON.stringify(n.defaultValue)));break}case"catch":{this.process(n.innerType,_),l.ref=n.innerType;let v;try{v=n.catchValue(void 0)}catch(w){throw new Error("Dynamic catch values are not supported in JSON Schema")}I.default=v;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let v=I,w=e._zod.pattern;if(!w)throw new Error("Pattern not found in template literal");v.type="string",v.pattern=w.source;break}case"pipe":{let v=this.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;this.process(v,_),l.ref=v;break}case"readonly":{this.process(n.innerType,_),l.ref=n.innerType,I.readOnly=!0;break}case"promise":{this.process(n.innerType,_),l.ref=n.innerType;break}case"optional":{this.process(n.innerType,_),l.ref=n.innerType;break}case"lazy":{let v=e._zod.innerType;this.process(v,_),l.ref=v;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema");break}default:}}}let u=this.metadataRegistry.get(e);return u&&Object.assign(l.schema,u),this.io==="input"&&tt(e)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((x=(i=l.schema).default)!=null||(i.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,r){var p,f,h,y,g,x,_,P,I,v;let i={cycles:(p=r==null?void 0:r.cycles)!=null?p:"ref",reused:(f=r==null?void 0:r.reused)!=null?f:"inline",external:(h=r==null?void 0:r.external)!=null?h:void 0},n=this.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s(w=>{var R,Z,q,X,G;let T=this.target==="draft-2020-12"?"$defs":"definitions";if(i.external){let F=(R=i.external.registry.get(w[0]))==null?void 0:R.id,K=(Z=i.external.uri)!=null?Z:ve=>ve;if(F)return{ref:K(F)};let fe=(X=(q=w[1].defId)!=null?q:w[1].schema.id)!=null?X:"schema".concat(this.counter++);return w[1].defId=fe,{defId:fe,ref:"".concat(K("__shared"),"#/").concat(T,"/").concat(fe)}}if(w[1]===n)return{ref:"#"};let k="".concat("#","/").concat(T,"/"),L=(G=w[1].schema.id)!=null?G:"__schema".concat(this.counter++);return{defId:L,ref:k+L}},"makeURI"),a=s(w=>{if(w[1].schema.$ref)return;let T=w[1],{ref:A,defId:k}=o(w);T.def=C({},T.schema),k&&(T.defId=k);let L=T.schema;for(let R in L)delete L[R];L.$ref=A},"extractToDef");if(i.cycles==="throw")for(let w of this.seen.entries()){let T=w[1];if(T.cycle)throw new Error("Cycle detected: "+"#/".concat((y=T.cycle)==null?void 0:y.join("/"),"/<root>")+'\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.')}for(let w of this.seen.entries()){let T=w[1];if(e===w[0]){a(w);continue}if(i.external){let k=(g=i.external.registry.get(w[0]))==null?void 0:g.id;if(e!==w[0]&&k){a(w);continue}}if((x=this.metadataRegistry.get(w[0]))==null?void 0:x.id){a(w);continue}if(T.cycle){a(w);continue}if(T.count>1&&i.reused==="ref"){a(w);continue}}let l=s((w,T)=>{var Z,q,X;let A=this.seen.get(w),k=(Z=A.def)!=null?Z:A.schema,L=C({},k);if(A.ref===null)return;let R=A.ref;if(A.ref=null,R){l(R,T);let G=this.seen.get(R).schema;G.$ref&&(T.target==="draft-7"||T.target==="draft-4"||T.target==="openapi-3.0")?(k.allOf=(q=k.allOf)!=null?q:[],k.allOf.push(G)):(Object.assign(k,G),Object.assign(k,L))}A.isParent||this.override({zodSchema:w,jsonSchema:k,path:(X=A.path)!=null?X:[]})},"flattenRef");for(let w of[...this.seen.entries()].reverse())l(w[0],{target:this.target});let c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?c.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn("Invalid target: ".concat(this.target)),(_=i.external)!=null&&_.uri){let w=(P=i.external.registry.get(e))==null?void 0:P.id;if(!w)throw new Error("Schema is missing an `id` property");c.$id=i.external.uri(w)}Object.assign(c,n.def);let u=(v=(I=i.external)==null?void 0:I.defs)!=null?v:{};for(let w of this.seen.entries()){let T=w[1];T.def&&T.defId&&(u[T.defId]=T.def)}i.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{return JSON.parse(JSON.stringify(c))}catch(w){throw new Error("Error converting schema to JSON.")}}};s(fv,"JSONSchemaGenerator");var ul=fv;function mv(t,e){if(t instanceof wo){let i=new ul(e),n={};for(let l of t._idmap.entries()){let[c,u]=l;i.process(u)}let o={},a={registry:t,uri:e==null?void 0:e.uri,defs:n};for(let l of t._idmap.entries()){let[c,u]=l;o[c]=i.emit(u,j(C({},e),{external:a}))}if(Object.keys(n).length>0){let l=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[l]:n}}return{schemas:o}}let r=new ul(e);return r.process(t),r.emit(t,e)}s(mv,"toJSONSchema");function tt(t,e){let r=e!=null?e:{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return tt(n.element,r);case"object":{for(let o in n.shape)if(tt(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(tt(o,r))return!0;return!1}case"intersection":return tt(n.left,r)||tt(n.right,r);case"tuple":{for(let o of n.items)if(tt(o,r))return!0;return!!(n.rest&&tt(n.rest,r))}case"record":return tt(n.keyType,r)||tt(n.valueType,r);case"map":return tt(n.keyType,r)||tt(n.valueType,r);case"set":return tt(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return tt(n.innerType,r);case"lazy":return tt(n.getter(),r);case"default":return tt(n.innerType,r);case"prefault":return tt(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return tt(n.in,r)||tt(n.out,r);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw new Error("Unknown schema type: ".concat(n.type))}s(tt,"isTransforming");var hv={};m();m();m();var cl={};kr(cl,{ZodISODate:()=>Kp,ZodISODateTime:()=>Jp,ZodISODuration:()=>em,ZodISOTime:()=>Qp,date:()=>yv,datetime:()=>dv,duration:()=>bv,time:()=>gv});m();var Jp=M("ZodISODateTime",(t,e)=>{Rb.init(t,e),Ce.init(t,e)});function dv(t){return M_(Jp,t)}s(dv,"datetime");var Kp=M("ZodISODate",(t,e)=>{Fb.init(t,e),Ce.init(t,e)});function yv(t){return A_(Kp,t)}s(yv,"date");var Qp=M("ZodISOTime",(t,e)=>{Bb.init(t,e),Ce.init(t,e)});function gv(t){return E_(Qp,t)}s(gv,"time");var em=M("ZodISODuration",(t,e)=>{Ub.init(t,e),Ce.init(t,e)});function bv(t){return k_(em,t)}s(bv,"duration");m();m();var aC=s((t,e)=>{Rs.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:s(r=>Bs(t,r),"value")},flatten:{value:s(r=>Fs(t,r),"value")},addIssue:{value:s(r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,ho,2)},"value")},addIssues:{value:s(r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,ho,2)},"value")},isEmpty:{get(){return t.issues.length===0}}})},"initializer"),q3=M("ZodError",aC),St=M("ZodError",aC,{Parent:Error});var xv=bo(St),_v=xo(St),vv=_o(St),Pv=vo(St),wv=cp(St),Sv=pp(St),Tv=mp(St),Iv=fp(St),Cv=hp(St),Mv=dp(St),Av=yp(St),Ev=gp(St);var le=M("ZodType",(t,e)=>(ee.init(t,e),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>{var i;return t.clone(N.mergeDefs(e,{checks:[...(i=e.checks)!=null?i:[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}))},t.clone=(r,i)=>pt(t,r,i),t.brand=()=>t,t.register=(r,i)=>(r.add(t,i),t),t.parse=(r,i)=>xv(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>vv(t,r,i),t.parseAsync=async(r,i)=>_v(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>Pv(t,r,i),t.spa=t.safeParseAsync,t.encode=(r,i)=>wv(t,r,i),t.decode=(r,i)=>Sv(t,r,i),t.encodeAsync=async(r,i)=>Tv(t,r,i),t.decodeAsync=async(r,i)=>Iv(t,r,i),t.safeEncode=(r,i)=>Cv(t,r,i),t.safeDecode=(r,i)=>Mv(t,r,i),t.safeEncodeAsync=async(r,i)=>Av(t,r,i),t.safeDecodeAsync=async(r,i)=>Ev(t,r,i),t.refine=(r,i)=>t.check(XC(r,i)),t.superRefine=r=>t.check(HC(r)),t.overwrite=r=>t.check(Zr(r)),t.optional=()=>rm(t),t.nullable=()=>nm(t),t.nullish=()=>rm(nm(t)),t.nonoptional=r=>zC(t,r),t.array=()=>sm(t),t.or=r=>Qv([t,r]),t.and=r=>_C(t,r),t.transform=r=>im(t,r0(r)),t.default=r=>kC(t,r),t.prefault=r=>DC(t,r),t.catch=r=>FC(t,r),t.pipe=r=>im(t,r),t.readonly=()=>NC(t),t.describe=r=>{let i=t.clone();return Cr.add(i,{description:r}),i},Object.defineProperty(t,"description",{get(){var r;return(r=Cr.get(t))==null?void 0:r.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return Cr.get(t);let i=t.clone();return Cr.add(i,r[0]),i},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),Dv=M("_ZodString",(t,e)=>{var i,n,o;ii.init(t,e),le.init(t,e);let r=t._zod.bag;t.format=(i=r.format)!=null?i:null,t.minLength=(n=r.minimum)!=null?n:null,t.maxLength=(o=r.maximum)!=null?o:null,t.regex=(...a)=>t.check(Ks(...a)),t.includes=(...a)=>t.check(tl(...a)),t.startsWith=(...a)=>t.check(rl(...a)),t.endsWith=(...a)=>t.check(nl(...a)),t.min=(...a)=>t.check(_n(...a)),t.max=(...a)=>t.check(To(...a)),t.length=(...a)=>t.check(Io(...a)),t.nonempty=(...a)=>t.check(_n(1,...a)),t.lowercase=a=>t.check(Qs(a)),t.uppercase=a=>t.check(el(a)),t.trim=()=>t.check(al()),t.normalize=(...a)=>t.check(ol(...a)),t.toLowerCase=()=>t.check(sl()),t.toUpperCase=()=>t.check(ll())}),ml=M("ZodString",(t,e)=>{ii.init(t,e),Dv.init(t,e),t.email=r=>t.check(kp(zv,r)),t.url=r=>t.check(Ys(om,r)),t.jwt=r=>t.check(Yp(Wv,r)),t.emoji=r=>t.check(Rp(Ov,r)),t.guid=r=>t.check(Ws(tm,r)),t.uuid=r=>t.check(Lp(Xr,r)),t.uuidv4=r=>t.check(Dp(Xr,r)),t.uuidv6=r=>t.check(zp(Xr,r)),t.uuidv7=r=>t.check(Op(Xr,r)),t.nanoid=r=>t.check(Fp(Rv,r)),t.guid=r=>t.check(Ws(tm,r)),t.cuid=r=>t.check(Bp(Fv,r)),t.cuid2=r=>t.check(Up(Bv,r)),t.ulid=r=>t.check(Np(Uv,r)),t.base64=r=>t.check(Hp(Xv,r)),t.base64url=r=>t.check(qp(Hv,r)),t.xid=r=>t.check($p(Nv,r)),t.ksuid=r=>t.check(Vp($v,r)),t.ipv4=r=>t.check(jp(Vv,r)),t.ipv6=r=>t.check(Gp(jv,r)),t.cidrv4=r=>t.check(Zp(Gv,r)),t.cidrv6=r=>t.check(Xp(Zv,r)),t.e164=r=>t.check(Wp(qv,r)),t.datetime=r=>t.check(dv(r)),t.date=r=>t.check(yv(r)),t.time=r=>t.check(gv(r)),t.duration=r=>t.check(bv(r))});function kv(t){return T_(ml,t)}s(kv,"string");var Ce=M("ZodStringFormat",(t,e)=>{Se.init(t,e),Dv.init(t,e)}),zv=M("ZodEmail",(t,e)=>{Cb.init(t,e),Ce.init(t,e)});function Y3(t){return kp(zv,t)}s(Y3,"email");var tm=M("ZodGUID",(t,e)=>{Tb.init(t,e),Ce.init(t,e)});function J3(t){return Ws(tm,t)}s(J3,"guid");var Xr=M("ZodUUID",(t,e)=>{Ib.init(t,e),Ce.init(t,e)});function K3(t){return Lp(Xr,t)}s(K3,"uuid");function Q3(t){return Dp(Xr,t)}s(Q3,"uuidv4");function e4(t){return zp(Xr,t)}s(e4,"uuidv6");function t4(t){return Op(Xr,t)}s(t4,"uuidv7");var om=M("ZodURL",(t,e)=>{Mb.init(t,e),Ce.init(t,e)});function r4(t){return Ys(om,t)}s(r4,"url");function n4(t){return Ys(om,C({protocol:/^https?$/,hostname:Ut.domain},N.normalizeParams(t)))}s(n4,"httpUrl");var Ov=M("ZodEmoji",(t,e)=>{Ab.init(t,e),Ce.init(t,e)});function i4(t){return Rp(Ov,t)}s(i4,"emoji");var Rv=M("ZodNanoID",(t,e)=>{Eb.init(t,e),Ce.init(t,e)});function o4(t){return Fp(Rv,t)}s(o4,"nanoid");var Fv=M("ZodCUID",(t,e)=>{kb.init(t,e),Ce.init(t,e)});function a4(t){return Bp(Fv,t)}s(a4,"cuid");var Bv=M("ZodCUID2",(t,e)=>{Lb.init(t,e),Ce.init(t,e)});function s4(t){return Up(Bv,t)}s(s4,"cuid2");var Uv=M("ZodULID",(t,e)=>{Db.init(t,e),Ce.init(t,e)});function l4(t){return Np(Uv,t)}s(l4,"ulid");var Nv=M("ZodXID",(t,e)=>{zb.init(t,e),Ce.init(t,e)});function u4(t){return $p(Nv,t)}s(u4,"xid");var $v=M("ZodKSUID",(t,e)=>{Ob.init(t,e),Ce.init(t,e)});function c4(t){return Vp($v,t)}s(c4,"ksuid");var Vv=M("ZodIPv4",(t,e)=>{Nb.init(t,e),Ce.init(t,e)});function p4(t){return jp(Vv,t)}s(p4,"ipv4");var jv=M("ZodIPv6",(t,e)=>{$b.init(t,e),Ce.init(t,e)});function m4(t){return Gp(jv,t)}s(m4,"ipv6");var Gv=M("ZodCIDRv4",(t,e)=>{Vb.init(t,e),Ce.init(t,e)});function f4(t){return Zp(Gv,t)}s(f4,"cidrv4");var Zv=M("ZodCIDRv6",(t,e)=>{jb.init(t,e),Ce.init(t,e)});function h4(t){return Xp(Zv,t)}s(h4,"cidrv6");var Xv=M("ZodBase64",(t,e)=>{Zb.init(t,e),Ce.init(t,e)});function d4(t){return Hp(Xv,t)}s(d4,"base64");var Hv=M("ZodBase64URL",(t,e)=>{Xb.init(t,e),Ce.init(t,e)});function y4(t){return qp(Hv,t)}s(y4,"base64url");var qv=M("ZodE164",(t,e)=>{Hb.init(t,e),Ce.init(t,e)});function g4(t){return Wp(qv,t)}s(g4,"e164");var Wv=M("ZodJWT",(t,e)=>{qb.init(t,e),Ce.init(t,e)});function b4(t){return Yp(Wv,t)}s(b4,"jwt");var fl=M("ZodCustomStringFormat",(t,e)=>{Wb.init(t,e),Ce.init(t,e)});function x4(t,e,r={}){return Co(fl,t,e,r)}s(x4,"stringFormat");function _4(t){return Co(fl,"hostname",Ut.hostname,t)}s(_4,"hostname");function v4(t){return Co(fl,"hex",Ut.hex,t)}s(v4,"hex");function P4(t,e){var o;let r=(o=e==null?void 0:e.enc)!=null?o:"hex",i="".concat(t,"_").concat(r),n=Ut[i];if(!n)throw new Error("Unrecognized hash format: ".concat(i));return Co(fl,i,n,e)}s(P4,"hash");var hl=M("ZodNumber",(t,e)=>{var i,n,o,a,l,c,u,p,f;Ip.init(t,e),le.init(t,e),t.gt=(h,y)=>t.check(Gr(h,y)),t.gte=(h,y)=>t.check(wt(h,y)),t.min=(h,y)=>t.check(wt(h,y)),t.lt=(h,y)=>t.check(jr(h,y)),t.lte=(h,y)=>t.check(qt(h,y)),t.max=(h,y)=>t.check(qt(h,y)),t.int=h=>t.check(Lv(h)),t.safe=h=>t.check(Lv(h)),t.positive=h=>t.check(Gr(0,h)),t.nonnegative=h=>t.check(wt(0,h)),t.negative=h=>t.check(jr(0,h)),t.nonpositive=h=>t.check(qt(0,h)),t.multipleOf=(h,y)=>t.check(ai(h,y)),t.step=(h,y)=>t.check(ai(h,y)),t.finite=()=>t;let r=t._zod.bag;t.minValue=(o=Math.max((i=r.minimum)!=null?i:Number.NEGATIVE_INFINITY,(n=r.exclusiveMinimum)!=null?n:Number.NEGATIVE_INFINITY))!=null?o:null,t.maxValue=(c=Math.min((a=r.maximum)!=null?a:Number.POSITIVE_INFINITY,(l=r.exclusiveMaximum)!=null?l:Number.POSITIVE_INFINITY))!=null?c:null,t.isInt=((u=r.format)!=null?u:"").includes("int")||Number.isSafeInteger((p=r.multipleOf)!=null?p:.5),t.isFinite=!0,t.format=(f=r.format)!=null?f:null});function sC(t){return L_(hl,t)}s(sC,"number");var Ao=M("ZodNumberFormat",(t,e)=>{Yb.init(t,e),hl.init(t,e)});function Lv(t){return z_(Ao,t)}s(Lv,"int");function w4(t){return O_(Ao,t)}s(w4,"float32");function S4(t){return R_(Ao,t)}s(S4,"float64");function T4(t){return F_(Ao,t)}s(T4,"int32");function I4(t){return B_(Ao,t)}s(I4,"uint32");var dl=M("ZodBoolean",(t,e)=>{Vs.init(t,e),le.init(t,e)});function lC(t){return U_(dl,t)}s(lC,"boolean");var yl=M("ZodBigInt",(t,e)=>{var i,n,o;Cp.init(t,e),le.init(t,e),t.gte=(a,l)=>t.check(wt(a,l)),t.min=(a,l)=>t.check(wt(a,l)),t.gt=(a,l)=>t.check(Gr(a,l)),t.gte=(a,l)=>t.check(wt(a,l)),t.min=(a,l)=>t.check(wt(a,l)),t.lt=(a,l)=>t.check(jr(a,l)),t.lte=(a,l)=>t.check(qt(a,l)),t.max=(a,l)=>t.check(qt(a,l)),t.positive=a=>t.check(Gr(BigInt(0),a)),t.negative=a=>t.check(jr(BigInt(0),a)),t.nonpositive=a=>t.check(qt(BigInt(0),a)),t.nonnegative=a=>t.check(wt(BigInt(0),a)),t.multipleOf=(a,l)=>t.check(ai(a,l));let r=t._zod.bag;t.minValue=(i=r.minimum)!=null?i:null,t.maxValue=(n=r.maximum)!=null?n:null,t.format=(o=r.format)!=null?o:null});function C4(t){return $_(yl,t)}s(C4,"bigint");var Yv=M("ZodBigIntFormat",(t,e)=>{Jb.init(t,e),yl.init(t,e)});function M4(t){return j_(Yv,t)}s(M4,"int64");function A4(t){return G_(Yv,t)}s(A4,"uint64");var uC=M("ZodSymbol",(t,e)=>{Kb.init(t,e),le.init(t,e)});function E4(t){return Z_(uC,t)}s(E4,"symbol");var cC=M("ZodUndefined",(t,e)=>{Qb.init(t,e),le.init(t,e)});function k4(t){return X_(cC,t)}s(k4,"_undefined");var pC=M("ZodNull",(t,e)=>{ex.init(t,e),le.init(t,e)});function mC(t){return H_(pC,t)}s(mC,"_null");var fC=M("ZodAny",(t,e)=>{tx.init(t,e),le.init(t,e)});function L4(){return q_(fC)}s(L4,"any");var hC=M("ZodUnknown",(t,e)=>{rx.init(t,e),le.init(t,e)});function Mo(){return W_(hC)}s(Mo,"unknown");var dC=M("ZodNever",(t,e)=>{nx.init(t,e),le.init(t,e)});function Jv(t){return Y_(dC,t)}s(Jv,"never");var yC=M("ZodVoid",(t,e)=>{ix.init(t,e),le.init(t,e)});function D4(t){return J_(yC,t)}s(D4,"_void");var am=M("ZodDate",(t,e)=>{ox.init(t,e),le.init(t,e),t.min=(i,n)=>t.check(wt(i,n)),t.max=(i,n)=>t.check(qt(i,n));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function z4(t){return K_(am,t)}s(z4,"date");var gC=M("ZodArray",(t,e)=>{ax.init(t,e),le.init(t,e),t.element=e.element,t.min=(r,i)=>t.check(_n(r,i)),t.nonempty=r=>t.check(_n(1,r)),t.max=(r,i)=>t.check(To(r,i)),t.length=(r,i)=>t.check(Io(r,i)),t.unwrap=()=>t.element});function sm(t,e){return av(gC,t,e)}s(sm,"array");function O4(t){let e=t._zod.def.shape;return t0(Object.keys(e))}s(O4,"keyof");var lm=M("ZodObject",(t,e)=>{sx.init(t,e),le.init(t,e),N.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>t0(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone(j(C({},t._zod.def),{catchall:r})),t.passthrough=()=>t.clone(j(C({},t._zod.def),{catchall:Mo()})),t.loose=()=>t.clone(j(C({},t._zod.def),{catchall:Mo()})),t.strict=()=>t.clone(j(C({},t._zod.def),{catchall:Jv()})),t.strip=()=>t.clone(j(C({},t._zod.def),{catchall:void 0})),t.extend=r=>N.extend(t,r),t.safeExtend=r=>N.safeExtend(t,r),t.merge=r=>N.merge(t,r),t.pick=r=>N.pick(t,r),t.omit=r=>N.omit(t,r),t.partial=(...r)=>N.partial(n0,t,r[0]),t.required=(...r)=>N.required(i0,t,r[0])});function R4(t,e){let r=C({type:"object",shape:t!=null?t:{}},N.normalizeParams(e));return new lm(r)}s(R4,"object");function F4(t,e){return new lm(C({type:"object",shape:t,catchall:Jv()},N.normalizeParams(e)))}s(F4,"strictObject");function B4(t,e){return new lm(C({type:"object",shape:t,catchall:Mo()},N.normalizeParams(e)))}s(B4,"looseObject");var Kv=M("ZodUnion",(t,e)=>{Mp.init(t,e),le.init(t,e),t.options=e.options});function Qv(t,e){return new Kv(C({type:"union",options:t},N.normalizeParams(e)))}s(Qv,"union");var bC=M("ZodDiscriminatedUnion",(t,e)=>{Kv.init(t,e),lx.init(t,e)});function U4(t,e,r){return new bC(C({type:"union",options:e,discriminator:t},N.normalizeParams(r)))}s(U4,"discriminatedUnion");var xC=M("ZodIntersection",(t,e)=>{ux.init(t,e),le.init(t,e)});function _C(t,e){return new xC({type:"intersection",left:t,right:e})}s(_C,"intersection");var vC=M("ZodTuple",(t,e)=>{Ap.init(t,e),le.init(t,e),t.rest=r=>t.clone(j(C({},t._zod.def),{rest:r}))});function PC(t,e,r){let i=e instanceof ee,n=i?r:e,o=i?e:null;return new vC(C({type:"tuple",items:t,rest:o},N.normalizeParams(n)))}s(PC,"tuple");var e0=M("ZodRecord",(t,e)=>{cx.init(t,e),le.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function wC(t,e,r){return new e0(C({type:"record",keyType:t,valueType:e},N.normalizeParams(r)))}s(wC,"record");function N4(t,e,r){let i=pt(t);return i._zod.values=void 0,new e0(C({type:"record",keyType:i,valueType:e},N.normalizeParams(r)))}s(N4,"partialRecord");var SC=M("ZodMap",(t,e)=>{px.init(t,e),le.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function $4(t,e,r){return new SC(C({type:"map",keyType:t,valueType:e},N.normalizeParams(r)))}s($4,"map");var TC=M("ZodSet",(t,e)=>{mx.init(t,e),le.init(t,e),t.min=(...r)=>t.check(si(...r)),t.nonempty=r=>t.check(si(1,r)),t.max=(...r)=>t.check(So(...r)),t.size=(...r)=>t.check(Js(...r))});function V4(t,e){return new TC(C({type:"set",valueType:t},N.normalizeParams(e)))}s(V4,"set");var pl=M("ZodEnum",(t,e)=>{fx.init(t,e),le.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let o={};for(let a of i)if(r.has(a))o[a]=e.entries[a];else throw new Error("Key ".concat(a," not found in enum"));return new pl(j(C(j(C({},e),{checks:[]}),N.normalizeParams(n)),{entries:o}))},t.exclude=(i,n)=>{let o=C({},e.entries);for(let a of i)if(r.has(a))delete o[a];else throw new Error("Key ".concat(a," not found in enum"));return new pl(j(C(j(C({},e),{checks:[]}),N.normalizeParams(n)),{entries:o}))}});function t0(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new pl(C({type:"enum",entries:r},N.normalizeParams(e)))}s(t0,"_enum");function j4(t,e){return new pl(C({type:"enum",entries:t},N.normalizeParams(e)))}s(j4,"nativeEnum");var IC=M("ZodLiteral",(t,e)=>{hx.init(t,e),le.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function G4(t,e){return new IC(C({type:"literal",values:Array.isArray(t)?t:[t]},N.normalizeParams(e)))}s(G4,"literal");var CC=M("ZodFile",(t,e)=>{dx.init(t,e),le.init(t,e),t.min=(r,i)=>t.check(si(r,i)),t.max=(r,i)=>t.check(So(r,i)),t.mime=(r,i)=>t.check(il(Array.isArray(r)?r:[r],i))});function Z4(t){return sv(CC,t)}s(Z4,"file");var MC=M("ZodTransform",(t,e)=>{yx.init(t,e),le.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new hn(t.constructor.name);r.addIssue=o=>{var a,l,c;if(typeof o=="string")r.issues.push(N.issue(o,r.value,e));else{let u=o;u.fatal&&(u.continue=!1),(a=u.code)!=null||(u.code="custom"),(l=u.input)!=null||(u.input=r.value),(c=u.inst)!=null||(u.inst=t),r.issues.push(N.issue(u))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function r0(t){return new MC({type:"transform",transform:t})}s(r0,"transform");var n0=M("ZodOptional",(t,e)=>{gx.init(t,e),le.init(t,e),t.unwrap=()=>t._zod.def.innerType});function rm(t){return new n0({type:"optional",innerType:t})}s(rm,"optional");var AC=M("ZodNullable",(t,e)=>{bx.init(t,e),le.init(t,e),t.unwrap=()=>t._zod.def.innerType});function nm(t){return new AC({type:"nullable",innerType:t})}s(nm,"nullable");function X4(t){return rm(nm(t))}s(X4,"nullish");var EC=M("ZodDefault",(t,e)=>{xx.init(t,e),le.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function kC(t,e){return new EC({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():N.shallowClone(e)}})}s(kC,"_default");var LC=M("ZodPrefault",(t,e)=>{_x.init(t,e),le.init(t,e),t.unwrap=()=>t._zod.def.innerType});function DC(t,e){return new LC({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():N.shallowClone(e)}})}s(DC,"prefault");var i0=M("ZodNonOptional",(t,e)=>{vx.init(t,e),le.init(t,e),t.unwrap=()=>t._zod.def.innerType});function zC(t,e){return new i0(C({type:"nonoptional",innerType:t},N.normalizeParams(e)))}s(zC,"nonoptional");var OC=M("ZodSuccess",(t,e)=>{Px.init(t,e),le.init(t,e),t.unwrap=()=>t._zod.def.innerType});function H4(t){return new OC({type:"success",innerType:t})}s(H4,"success");var RC=M("ZodCatch",(t,e)=>{wx.init(t,e),le.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function FC(t,e){return new RC({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}s(FC,"_catch");var BC=M("ZodNaN",(t,e)=>{Sx.init(t,e),le.init(t,e)});function q4(t){return ev(BC,t)}s(q4,"nan");var o0=M("ZodPipe",(t,e)=>{Tx.init(t,e),le.init(t,e),t.in=e.in,t.out=e.out});function im(t,e){return new o0({type:"pipe",in:t,out:e})}s(im,"pipe");var a0=M("ZodCodec",(t,e)=>{o0.init(t,e),js.init(t,e)});function W4(t,e,r){return new a0({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}s(W4,"codec");var UC=M("ZodReadonly",(t,e)=>{Ix.init(t,e),le.init(t,e),t.unwrap=()=>t._zod.def.innerType});function NC(t){return new UC({type:"readonly",innerType:t})}s(NC,"readonly");var $C=M("ZodTemplateLiteral",(t,e)=>{Cx.init(t,e),le.init(t,e)});function Y4(t,e){return new $C(C({type:"template_literal",parts:t},N.normalizeParams(e)))}s(Y4,"templateLiteral");var VC=M("ZodLazy",(t,e)=>{Ex.init(t,e),le.init(t,e),t.unwrap=()=>t._zod.def.getter()});function jC(t){return new VC({type:"lazy",getter:t})}s(jC,"lazy");var GC=M("ZodPromise",(t,e)=>{Ax.init(t,e),le.init(t,e),t.unwrap=()=>t._zod.def.innerType});function J4(t){return new GC({type:"promise",innerType:t})}s(J4,"promise");var ZC=M("ZodFunction",(t,e)=>{Mx.init(t,e),le.init(t,e)});function K4(t){var e,r;return new ZC({type:"function",input:Array.isArray(t==null?void 0:t.input)?PC(t==null?void 0:t.input):(e=t==null?void 0:t.input)!=null?e:sm(Mo()),output:(r=t==null?void 0:t.output)!=null?r:Mo()})}s(K4,"_function");var um=M("ZodCustom",(t,e)=>{kx.init(t,e),le.init(t,e)});function Q4(t){let e=new ke({check:"custom"});return e._zod.check=t,e}s(Q4,"check");function eU(t,e){return lv(um,t!=null?t:()=>!0,e)}s(eU,"custom");function XC(t,e={}){return uv(um,t,e)}s(XC,"refine");function HC(t){return cv(t)}s(HC,"superRefine");function tU(t,e={error:"Input not instance of ".concat(t.name)}){let r=new um(C({type:"custom",check:"custom",fn:s(i=>i instanceof t,"fn"),abort:!0},N.normalizeParams(e)));return r._zod.bag.Class=t,r}s(tU,"_instanceof");var rU=s((...t)=>pv({Codec:a0,Boolean:dl,String:ml},...t),"stringbool");function nU(t){let e=jC(()=>Qv([kv(t),sC(),lC(),mC(),sm(e),wC(kv(),e)]));return e}s(nU,"json");function iU(t,e){return im(r0(t),e)}s(iU,"preprocess");m();var oU={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function aU(t){qe({customError:t})}s(aU,"setErrorMap");function sU(){return qe().customError}s(sU,"getErrorMap");var s0;s0||(s0={});var cm={};kr(cm,{bigint:()=>pU,boolean:()=>cU,date:()=>mU,number:()=>uU,string:()=>lU});m();function lU(t){return I_(ml,t)}s(lU,"string");function uU(t){return D_(hl,t)}s(uU,"number");function cU(t){return N_(dl,t)}s(cU,"boolean");function pU(t){return V_(yl,t)}s(pU,"bigint");function mU(t){return Q_(am,t)}s(mU,"date");qe(Gs());var Ar=D;var qC=D.union([D.enum(["low","medium","high","always-visible"]),D.number()]),WC=["","","low","medium","high","always-visible"],fU=2,hU=3;var dU=5;function YC(t){return Math.min(dU,Math.max(fU,t))}s(YC,"clampTierNumber");function Eo(t){if(typeof t=="number")return YC(t);let e=WC.indexOf(t);return e===-1?hU:e}s(Eo,"convertCollisionRankingTierToNumber");function FOe(t){let e=YC(t);return WC[e]}s(FOe,"convertNumberToCollisionRankingTier");m();m();m();var yU=Ar.enum(L1),gU=s(t=>{let e=t[0];for(let r=1;r<t.length;r++){let i=t[r];if(i<=e)return!1;e=i}return!0},"isStrictlyIncreasing"),bU=s(t=>{let e=t[0];for(let r=1;r<t.length;r++){let i=t[r];if(i>=e)return!1;e=i}return!0},"isStrictlyDecreasing"),xU=s(t=>gU(t)||bU(t),"isStrictlyIncreasingOrDecreasing"),JC=Ar.object({on:Ar.literal("zoom-level"),input:Ar.tuple([Ar.number()]).rest(Ar.number()).refine(xU,{message:"input array must be strictly increasing or decreasing"}),output:Ar.tuple([Ar.number()]).rest(Ar.number()),easing:yU.default("linear")}).refine(t=>t.input.length===t.output.length,{message:"input and output must have the same length"});m();function pm(t){"@babel/helpers - typeof";return pm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pm(t)}s(pm,"_typeof");var _U=/^\s+/,vU=/\s+$/;function H(t,e){if(t=t||"",e=e||{},t instanceof H)return t;if(!(this instanceof H))return new H(t,e);var r=PU(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}s(H,"tinycolor");H.prototype={isDark:s(function(){return this.getBrightness()<128},"isDark"),isLight:s(function(){return!this.isDark()},"isLight"),isValid:s(function(){return this._ok},"isValid"),getOriginalInput:s(function(){return this._originalInput},"getOriginalInput"),getFormat:s(function(){return this._format},"getFormat"),getAlpha:s(function(){return this._a},"getAlpha"),getBrightness:s(function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},"getBrightness"),getLuminance:s(function(){var e=this.toRgb(),r,i,n,o,a,l;return r=e.r/255,i=e.g/255,n=e.b/255,r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),n<=.03928?l=n/12.92:l=Math.pow((n+.055)/1.055,2.4),.2126*o+.7152*a+.0722*l},"getLuminance"),setAlpha:s(function(e){return this._a=iM(e),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:s(function(){var e=QC(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},"toHsv"),toHsvString:s(function(){var e=QC(this._r,this._g,this._b),r=Math.round(e.h*360),i=Math.round(e.s*100),n=Math.round(e.v*100);return this._a==1?"hsv("+r+", "+i+"%, "+n+"%)":"hsva("+r+", "+i+"%, "+n+"%, "+this._roundA+")"},"toHsvString"),toHsl:s(function(){var e=KC(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},"toHsl"),toHslString:s(function(){var e=KC(this._r,this._g,this._b),r=Math.round(e.h*360),i=Math.round(e.s*100),n=Math.round(e.l*100);return this._a==1?"hsl("+r+", "+i+"%, "+n+"%)":"hsla("+r+", "+i+"%, "+n+"%, "+this._roundA+")"},"toHslString"),toHex:s(function(e){return eM(this._r,this._g,this._b,e)},"toHex"),toHexString:s(function(e){return"#"+this.toHex(e)},"toHexString"),toHex8:s(function(e){return IU(this._r,this._g,this._b,this._a,e)},"toHex8"),toHex8String:s(function(e){return"#"+this.toHex8(e)},"toHex8String"),toRgb:s(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:s(function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},"toRgbString"),toPercentageRgb:s(function(){return{r:Math.round(Be(this._r,255)*100)+"%",g:Math.round(Be(this._g,255)*100)+"%",b:Math.round(Be(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:s(function(){return this._a==1?"rgb("+Math.round(Be(this._r,255)*100)+"%, "+Math.round(Be(this._g,255)*100)+"%, "+Math.round(Be(this._b,255)*100)+"%)":"rgba("+Math.round(Be(this._r,255)*100)+"%, "+Math.round(Be(this._g,255)*100)+"%, "+Math.round(Be(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:s(function(){return this._a===0?"transparent":this._a<1?!1:BU[eM(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:s(function(e){var r="#"+tM(this._r,this._g,this._b,this._a),i=r,n=this._gradientType?"GradientType = 1, ":"";if(e){var o=H(e);i="#"+tM(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+r+",endColorstr="+i+")"},"toFilter"),toString:s(function(e){var r=!!e;e=e||this._format;var i=!1,n=this._a<1&&this._a>=0,o=!r&&n&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},"toString"),clone:s(function(){return H(this.toString())},"clone"),_applyModification:s(function(e,r){var i=e.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},"_applyModification"),lighten:s(function(){return this._applyModification(EU,arguments)},"lighten"),brighten:s(function(){return this._applyModification(kU,arguments)},"brighten"),darken:s(function(){return this._applyModification(LU,arguments)},"darken"),desaturate:s(function(){return this._applyModification(CU,arguments)},"desaturate"),saturate:s(function(){return this._applyModification(MU,arguments)},"saturate"),greyscale:s(function(){return this._applyModification(AU,arguments)},"greyscale"),spin:s(function(){return this._applyModification(DU,arguments)},"spin"),_applyCombination:s(function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},"_applyCombination"),analogous:s(function(){return this._applyCombination(RU,arguments)},"analogous"),complement:s(function(){return this._applyCombination(zU,arguments)},"complement"),monochromatic:s(function(){return this._applyCombination(FU,arguments)},"monochromatic"),splitcomplement:s(function(){return this._applyCombination(OU,arguments)},"splitcomplement"),triad:s(function(){return this._applyCombination(rM,[3])},"triad"),tetrad:s(function(){return this._applyCombination(rM,[4])},"tetrad")};H.fromRatio=function(t,e){if(pm(t)=="object"){var r={};for(var i in t)t.hasOwnProperty(i)&&(i==="a"?r[i]=t[i]:r[i]=gl(t[i]));t=r}return H(t,e)};function PU(t){var e={r:0,g:0,b:0},r=1,i=null,n=null,o=null,a=!1,l=!1;return typeof t=="string"&&(t=VU(t)),pm(t)=="object"&&(Hr(t.r)&&Hr(t.g)&&Hr(t.b)?(e=wU(t.r,t.g,t.b),a=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Hr(t.h)&&Hr(t.s)&&Hr(t.v)?(i=gl(t.s),n=gl(t.v),e=TU(t.h,i,n),a=!0,l="hsv"):Hr(t.h)&&Hr(t.s)&&Hr(t.l)&&(i=gl(t.s),o=gl(t.l),e=SU(t.h,i,o),a=!0,l="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=iM(r),{ok:a,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}s(PU,"inputToRGB");function wU(t,e,r){return{r:Be(t,255)*255,g:Be(e,255)*255,b:Be(r,255)*255}}s(wU,"rgbToRgb");function KC(t,e,r){t=Be(t,255),e=Be(e,255),r=Be(r,255);var i=Math.max(t,e,r),n=Math.min(t,e,r),o,a,l=(i+n)/2;if(i==n)o=a=0;else{var c=i-n;switch(a=l>.5?c/(2-i-n):c/(i+n),i){case t:o=(e-r)/c+(e<r?6:0);break;case e:o=(r-t)/c+2;break;case r:o=(t-e)/c+4;break}o/=6}return{h:o,s:a,l}}s(KC,"rgbToHsl");function SU(t,e,r){var i,n,o;t=Be(t,360),e=Be(e,100),r=Be(r,100);function a(u,p,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?u+(p-u)*6*f:f<1/2?p:f<2/3?u+(p-u)*(2/3-f)*6:u}if(s(a,"hue2rgb"),e===0)i=n=o=r;else{var l=r<.5?r*(1+e):r+e-r*e,c=2*r-l;i=a(c,l,t+1/3),n=a(c,l,t),o=a(c,l,t-1/3)}return{r:i*255,g:n*255,b:o*255}}s(SU,"hslToRgb");function QC(t,e,r){t=Be(t,255),e=Be(e,255),r=Be(r,255);var i=Math.max(t,e,r),n=Math.min(t,e,r),o,a,l=i,c=i-n;if(a=i===0?0:c/i,i==n)o=0;else{switch(i){case t:o=(e-r)/c+(e<r?6:0);break;case e:o=(r-t)/c+2;break;case r:o=(t-e)/c+4;break}o/=6}return{h:o,s:a,v:l}}s(QC,"rgbToHsv");function TU(t,e,r){t=Be(t,360)*6,e=Be(e,100),r=Be(r,100);var i=Math.floor(t),n=t-i,o=r*(1-e),a=r*(1-n*e),l=r*(1-(1-n)*e),c=i%6,u=[r,a,o,o,l,r][c],p=[l,r,r,a,o,o][c],f=[o,o,l,r,r,a][c];return{r:u*255,g:p*255,b:f*255}}s(TU,"hsvToRgb");function eM(t,e,r,i){var n=[fr(Math.round(t).toString(16)),fr(Math.round(e).toString(16)),fr(Math.round(r).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}s(eM,"rgbToHex");function IU(t,e,r,i,n){var o=[fr(Math.round(t).toString(16)),fr(Math.round(e).toString(16)),fr(Math.round(r).toString(16)),fr(oM(i))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}s(IU,"rgbaToHex");function tM(t,e,r,i){var n=[fr(oM(i)),fr(Math.round(t).toString(16)),fr(Math.round(e).toString(16)),fr(Math.round(r).toString(16))];return n.join("")}s(tM,"rgbaToArgbHex");H.equals=function(t,e){return!t||!e?!1:H(t).toRgbString()==H(e).toRgbString()};H.random=function(){return H.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function CU(t,e){e=e===0?0:e||10;var r=H(t).toHsl();return r.s-=e/100,r.s=mm(r.s),H(r)}s(CU,"_desaturate");function MU(t,e){e=e===0?0:e||10;var r=H(t).toHsl();return r.s+=e/100,r.s=mm(r.s),H(r)}s(MU,"_saturate");function AU(t){return H(t).desaturate(100)}s(AU,"_greyscale");function EU(t,e){e=e===0?0:e||10;var r=H(t).toHsl();return r.l+=e/100,r.l=mm(r.l),H(r)}s(EU,"_lighten");function kU(t,e){e=e===0?0:e||10;var r=H(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),H(r)}s(kU,"_brighten");function LU(t,e){e=e===0?0:e||10;var r=H(t).toHsl();return r.l-=e/100,r.l=mm(r.l),H(r)}s(LU,"_darken");function DU(t,e){var r=H(t).toHsl(),i=(r.h+e)%360;return r.h=i<0?360+i:i,H(r)}s(DU,"_spin");function zU(t){var e=H(t).toHsl();return e.h=(e.h+180)%360,H(e)}s(zU,"_complement");function rM(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=H(t).toHsl(),i=[H(t)],n=360/e,o=1;o<e;o++)i.push(H({h:(r.h+o*n)%360,s:r.s,l:r.l}));return i}s(rM,"polyad");function OU(t){var e=H(t).toHsl(),r=e.h;return[H(t),H({h:(r+72)%360,s:e.s,l:e.l}),H({h:(r+216)%360,s:e.s,l:e.l})]}s(OU,"_splitcomplement");function RU(t,e,r){e=e||6,r=r||30;var i=H(t).toHsl(),n=360/r,o=[H(t)];for(i.h=(i.h-(n*e>>1)+720)%360;--e;)i.h=(i.h+n)%360,o.push(H(i));return o}s(RU,"_analogous");function FU(t,e){e=e||6;for(var r=H(t).toHsv(),i=r.h,n=r.s,o=r.v,a=[],l=1/e;e--;)a.push(H({h:i,s:n,v:o})),o=(o+l)%1;return a}s(FU,"_monochromatic");H.mix=function(t,e,r){r=r===0?0:r||50;var i=H(t).toRgb(),n=H(e).toRgb(),o=r/100,a={r:(n.r-i.r)*o+i.r,g:(n.g-i.g)*o+i.g,b:(n.b-i.b)*o+i.b,a:(n.a-i.a)*o+i.a};return H(a)};H.readability=function(t,e){var r=H(t),i=H(e);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};H.isReadable=function(t,e,r){var i=H.readability(t,e),n,o;switch(o=!1,n=jU(r),n.level+n.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7;break}return o};H.mostReadable=function(t,e,r){var i=null,n=0,o,a,l,c;r=r||{},a=r.includeFallbackColors,l=r.level,c=r.size;for(var u=0;u<e.length;u++)o=H.readability(t,e[u]),o>n&&(n=o,i=H(e[u]));return H.isReadable(t,i,{level:l,size:c})||!a?i:(r.includeFallbackColors=!1,H.mostReadable(t,["#fff","#000"],r))};var l0=H.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},BU=H.hexNames=UU(l0);function UU(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}s(UU,"flip");function iM(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}s(iM,"boundAlpha");function Be(t,e){NU(t)&&(t="100%");var r=$U(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}s(Be,"bound01");function mm(t){return Math.min(1,Math.max(0,t))}s(mm,"clamp01");function Nt(t){return parseInt(t,16)}s(Nt,"parseIntFromHex");function NU(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}s(NU,"isOnePointZero");function $U(t){return typeof t=="string"&&t.indexOf("%")!=-1}s($U,"isPercentage");function fr(t){return t.length==1?"0"+t:""+t}s(fr,"pad2");function gl(t){return t<=1&&(t=t*100+"%"),t}s(gl,"convertToPercentage");function oM(t){return Math.round(parseFloat(t)*255).toString(16)}s(oM,"convertDecimalToHex");function nM(t){return Nt(t)/255}s(nM,"convertHexToDecimal");var mr=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Hr(t){return!!mr.CSS_UNIT.exec(t)}s(Hr,"isValidCSSUnit");function VU(t){t=t.replace(_U,"").replace(vU,"").toLowerCase();var e=!1;if(l0[t])t=l0[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=mr.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=mr.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=mr.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=mr.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=mr.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=mr.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=mr.hex8.exec(t))?{r:Nt(r[1]),g:Nt(r[2]),b:Nt(r[3]),a:nM(r[4]),format:e?"name":"hex8"}:(r=mr.hex6.exec(t))?{r:Nt(r[1]),g:Nt(r[2]),b:Nt(r[3]),format:e?"name":"hex"}:(r=mr.hex4.exec(t))?{r:Nt(r[1]+""+r[1]),g:Nt(r[2]+""+r[2]),b:Nt(r[3]+""+r[3]),a:nM(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=mr.hex3.exec(t))?{r:Nt(r[1]+""+r[1]),g:Nt(r[2]+""+r[2]),b:Nt(r[3]+""+r[3]),format:e?"name":"hex"}:!1}s(VU,"stringInputToObject");function jU(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}s(jU,"validateWCAG2Parms");var Ke={RIGHT:"right",LEFT:"left",TOP:"top",HIDDEN:"hidden",CENTER:"center"},li="low-priority",aM=Object.values(Ke),u0=[Ke.RIGHT,Ke.LEFT,Ke.TOP,Ke.HIDDEN],sM=D.object({margin:D.number().min(6).default(6),maxLines:D.number().min(1).default(2),textSize:D.number().min(0).default(11.5),maxWidth:D.number().min(0).default(150),lineHeight:D.number().min(0).default(1.2),color:D.string().default("#333"),outlineColor:D.string().default("white"),textColor:D.string().optional(),textOutlineColor:D.string().optional(),pinColor:D.string().optional(),pinOutlineColor:D.string().optional(),pinColorInactive:D.string().optional(),pinOutlineColorInactive:D.string().optional(),icon:D.string().optional(),iconSize:D.number().min(0).default(20),iconScale:D.union([D.number(),JC]).default(1),iconPadding:D.number().min(0).default(2),iconFit:D.enum(["fill","contain","cover"]).default("cover"),iconOverflow:D.enum(["visible","hidden"]).default("hidden"),iconVisible:D.union([D.boolean(),D.number()]).default(!0),opacity:D.number().min(0).max(1).default(1)}),tRe=D.strictObject(sM.shape),c0=s(t=>{var n,o;let e=C({},t);e.color!=null&&(e.textColor==null&&(e.textColor=e.color),e.pinColor==null&&(e.pinColor=e.color)),e.outlineColor!=null&&(e.textOutlineColor==null&&(e.textOutlineColor=e.outlineColor),e.pinOutlineColor==null&&(e.pinOutlineColor=e.outlineColor));let r=(n=e.pinColor)!=null?n:e.color,i=(o=e.pinOutlineColor)!=null?o:e.outlineColor;return r!=null&&e.pinColorInactive==null&&(e.pinColorInactive=H(r).toRgbString()),i!=null&&e.pinOutlineColorInactive==null&&(e.pinOutlineColorInactive=H(i).toRgbString()),e},"applyLabelAppearanceShorthands"),lM=sM.transform(t=>c0(t)),uM=s(t=>lM.parse(t),"parseLabelAppearance"),GU=D.object({rank:qC.optional(),appearance:lM.optional(),interactive:D.boolean().default(!1),textPlacement:D.union([D.enum(aM),D.array(D.enum(aM))]).default(u0),occlude:D.boolean().default(!0)}),ZU=s(t=>{GU.parse(t!=null?t:{})},"validateLabelOptions"),XU=D.array(D.number()).min(2).max(3),HU=D.string(),rRe=s((t,e,r)=>{XU.parse(t),HU.parse(e),ZU(r)},"validateLabel"),cM=["color","outlineColor"],qU=[...cM,"maxLines","lineHeight","textSize","maxWidth","textColor","textOutlineColor"],WU=[...cM,"icon","iconSize","iconScale","iconVisible","iconPadding","pinColor","pinOutlineColor","pinColorInactive","pinOutlineColorInactive"],pM=s((t,e)=>qU.some(r=>e[r]!=null&&t[r]!==e[r]),"isOneOfTextDirtyOptions"),mM=s((t,e)=>WU.some(r=>e[r]!=null&&t[r]!==e[r]),"isOneOfPinDirtyOptions"),YU=["textPlacement"],JU=["margin"],fM=s((t,e)=>{let r=YU.some(n=>e[n]!=null&&t[n]!==e[n]),i=JU.some(n=>{var o,a,l;return((o=e.appearance)==null?void 0:o[n])!=null&&((a=t.appearance)==null?void 0:a[n])!==((l=e.appearance)==null?void 0:l[n])});return r||i},"isOneOfColliderDirtyOptions");var hM=4,QU=6,yM=6.5,fm=yM/2,dM=[fm,fm,fm,fm],ui=class ui{constructor(e,r,i){S(this,"lines",0);S(this,"id");S(this,"rank");S(this,"type","label");S(this,"initialRank");S(this,"contextConfigured",!1);S(this,"fillText");S(this,"newStyle",{});S(this,"currentOpacity",0);S(this,"visibilityNeedsUpdate",!1);S(this,"activePlacement",Ke.RIGHT);S(this,"text");S(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});S(this,"projection",new Lr);S(this,"labelCacheId");S(this,"_cache",{});S(this,"appearance");S(this,"options");S(this,"visible",!0);S(this,"enabled",!0);S(this,"isOccluded",!1);S(this,"offscreen",!1);S(this,"canShow",!1);S(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});S(this,"dimensions",{width:0,height:0});S(this,"currentStrategyIndex",-1);S(this,"totalPinSize",0);S(this,"iconScale",1);S(this,"iconPadding");S(this,"dirty",!0);S(this,"textDirty",!0);S(this,"pinDirty",!0);S(this,"attachedDirty",!0);S(this,"collisionDirty",!0);S(this,"lastTextAlign");S(this,"imageHash");S(this,"pinSize",0);S(this,"iconVisible",!1);S(this,"dp");S(this,"animate",!0);S(this,"onStrategySelected",s(e=>{var i;if(this.currentStrategyIndex===e)return;this.currentStrategyIndex=e;let r=this.strategies[e];if(this.activePlacement=(i=r==null?void 0:r.name)!=null?i:this.activePlacement,r){r.onStrategySelected();let n=this.style;this.style=this.newStyle,this.newStyle=n}},"onStrategySelected"));S(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var o,a,l;if(this.id=(o=r.id)!=null?o:Dr(),this.options=r!=null?r:{},this.text=e,this.dp=(c=1)=>c*i.pixelRatio,typeof r.rank=="string")this.rank=Eo(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let c=Math.trunc(b.env.NODE_ENV==="test"?ui.testId:ui.testId*10)/10;ui.testId+=.001,this.rank=c,this.initialRank=c}this.options.textPlacement=(a=r.textPlacement)!=null?a:u0;let n=uM((l=r.appearance)!=null?l:{});this.appearance=n,this.iconPadding=n.iconPadding}get scaledPinSize(){return this.totalPinSize*this.iconScale}get scaledIconPadding(){return this.appearance.iconPadding*this.iconScale}calculatePinSize(){let e=this.dp();this.iconVisible&&typeof this.appearance.iconSize<"u"&&this.imageHash?this.pinSize=this.dp(this.appearance.iconSize):this.pinSize=this.dp(yM),this.totalPinSize=Math.ceil((this.pinSize+2.5)/e)}getNoTextBbox(e){let r=this.scaledPinSize/2+e;return[r,r,r,r]}getHiddenTextPlacementBbox(e){return this.iconVisible?this.getNoTextBbox(e):dM}getBoundingBoxForPlacement(e){let{width:r,height:i}=this.dimensions,{margin:n}=this.appearance,o=Math.max(QU,n);if(this.text==="")return this.getNoTextBbox(o);let a=Math.max(this.scaledPinSize,i);switch(e){case Ke.RIGHT:return[a/2+o,a/2+o,this.scaledPinSize/2+o,this.scaledPinSize/2+r+o];case Ke.LEFT:return[a/2+o,a/2+o,this.scaledPinSize/2+r+o,this.scaledPinSize/2+o];case Ke.TOP:{let l=this.dp();return[i+this.scaledPinSize/2/l+o,this.scaledPinSize/2+o,r/2+o,r/2+o]}case Ke.CENTER:return[i/2+o,i/2+o,r/2+o,r/2+o];case Ke.HIDDEN:return this.getHiddenTextPlacementBbox(o);case li:return dM;default:return this.getNoTextBbox(o)}}getStrategyStyleForPlacement(e){let{width:r,height:i}=this.dimensions;switch(e){case Ke.TOP:this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-i-this.scaledPinSize/2,this.newStyle.left=-r/2;return;case Ke.LEFT:this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-i/2,this.newStyle.left=-r-this.scaledPinSize/2-hM,this.newStyle.textLabelVisible=!0;return;case Ke.RIGHT:this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-i/2,this.newStyle.left=this.scaledPinSize/2+hM,this.newStyle.textLabelVisible=!0;return;case Ke.CENTER:this.newStyle.pinVisibility=0,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-i/2,this.newStyle.left=-r/2;return;case Ke.HIDDEN:this.newStyle.pinVisibility=this.iconVisible?1:.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0;return;case li:default:this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0;return}}get strategies(){let e=Array.isArray(this.options.textPlacement)?this.options.textPlacement:[this.options.textPlacement],r=[],i=!1;for(let n of e)this.options.rank==="always-visible"&&n===Ke.HIDDEN&&e.length>1||(r.push({name:n,getBoundingBox:s(()=>this.getBoundingBoxForPlacement(n),"getBoundingBox"),onStrategySelected:s(()=>this.getStrategyStyleForPlacement(n),"onStrategySelected")}),n===Ke.HIDDEN&&(i=!0));return i&&r.push({name:li,getBoundingBox:s(()=>this.getBoundingBoxForPlacement(li),"getBoundingBox"),onStrategySelected:s(()=>this.getStrategyStyleForPlacement(li),"onStrategySelected")}),r}recomputeCurrentStrategy(e=this.iconScale){let r=this.iconScale!==e;if(r||this.dirty){let i=this.pinDirty,n=this.strategies[this.currentStrategyIndex];if(this.iconScale=e,this.collisionDirty=!0,r&&!i&&this.calculatePinSize(),n){n.onStrategySelected();let o=this.style;this.style=this.newStyle,this.newStyle=o}this.dirty=!1}}toPackedMessage(e=!1){var n;let r=this.strategies[this.currentStrategyIndex],i=this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.text!==""&&r!=null&&r.name!==Ke.HIDDEN&&r.name!==li;if(this.visible&&e&&this.collisionDirty===!1&&i?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,i&&this.currentStrategyIndex!==((n=this.packedMessage.bboxes[0])==null?void 0:n[4])){let o=this.packedMessage.bboxes.findIndex(a=>a[4]===this.currentStrategyIndex);if(o!==-1){let a=this.packedMessage.bboxes.splice(o,1)[0];this.packedMessage.bboxes.unshift(a)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let o=0;o<this.strategies.length;o++){let l=this.strategies[o].getBoundingBox(),c=[l[0],l[1],l[2],l[3],o];i&&o===this.currentStrategyIndex?this.packedMessage.bboxes.unshift(c):this.packedMessage.bboxes.push(c)}return this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage}destroy(){}};s(ui,"LabelComponent"),S(ui,"testId",0);var p0=ui,gM=p0;m();var JM=J(XM());m();var HM="0.6",Me={TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right",CENTER:"center",TOP_LEFT:"top-left",TOP_RIGHT:"top-right",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",HIDDEN:"hidden"},P0=Object.values(Me),qM=[Me.CENTER,Me.HIDDEN],WM=Object.freeze({size:8,color:"#666"});var w0=D.object({rank:D.union([D.enum(["low","medium","high","always-visible"]),D.number()]).optional(),interactive:D.union([D.boolean(),D.literal("pointer-events-auto")]).optional(),id:D.string().optional(),placement:D.union([D.enum(P0),D.array(D.enum(P0))]).optional(),dynamicResize:D.boolean().optional(),zIndex:D.number().optional(),lowPriorityPin:D.object({size:D.number().positive().optional(),color:D.string().optional()}).optional()});function MRe(t,e,r){D.array(D.number()).min(2).max(3).parse(t),D.string().parse(e),w0.parse(r)}s(MRe,"validateMarker");var fi=class fi{constructor(e,r={}){S(this,"id");S(this,"type","marker");S(this,"rank",0);S(this,"initialRank",0);S(this,"activePlacement","center");S(this,"pointerEvents","none");S(this,"options",{rank:"low",interactive:!1,id:"",placement:qM,dynamicResize:!1,occlude:!0,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:C({},WM)});S(this,"projection",new Lr);S(this,"enabled",!0);S(this,"canShow",!1);S(this,"visible",!0);S(this,"isOccluded",!1);S(this,"offscreen",!1);S(this,"strategyIndex",-1);S(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});S(this,"dimensions",{width:0,height:0});S(this,"markerContainer");S(this,"containerEl");S(this,"contentEl",null);S(this,"contentHtml","");S(this,"style",{top:"0px",left:"0px"});S(this,"dirty",!1);S(this,"attachedDirty",!0);S(this,"collisionDirty",!0);S(this,"visibilityNeedsUpdate","show");S(this,"animation",null);S(this,"currentStrategyIndex",-1);S(this,"onStrategySelected",s((e,r=!1)=>{var n;if(this.currentStrategyIndex===e&&!r)return;this.currentStrategyIndex=e;let i=this.strategies[e];if(this.activePlacement=(n=i==null?void 0:i.name)!=null?n:"center",this.activePlacement===Me.HIDDEN){this.markerContainer.setAttribute("data-placement",Me.HIDDEN);let o=this.options.lowPriorityPin,a=o.size,l=o.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(a,"px")),this.markerContainer.style.setProperty("--pin-color",l),this.markerContainer.style.opacity=HM,this.style.top=-a/2+"px",this.style.left=-a/2+"px"}else{this.markerContainer.setAttribute("data-placement",this.activePlacement),this.markerContainer.style.removeProperty("--mappedin-pin-size"),this.markerContainer.style.removeProperty("--pin-color"),this.markerContainer.style.opacity="1";let{width:o,height:a}=this.dimensions,l=-a/2+"px",c=-o/2+"px";switch(this.style.top=l,this.style.left=c,this.activePlacement){case Me.TOP:{this.style.top=-a+"px";break}case Me.BOTTOM:{this.style.top="0px";break}case Me.LEFT:{this.style.left=-o+"px";break}case Me.RIGHT:{this.style.left="0px";break}case Me.TOP_LEFT:{this.style.top=-a+"px",this.style.left=-o+"px";break}case Me.TOP_RIGHT:{this.style.top=-a+"px",this.style.left="0px";break}case Me.BOTTOM_LEFT:{this.style.top="0px",this.style.left=-o+"px";break}case Me.BOTTOM_RIGHT:{this.style.top="0px",this.style.left="0px";break}case Me.CENTER:default:this.style.top=l,this.style.left=c}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left},"onStrategySelected"));S(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});var i,n,o,a;if(this.id=(r==null?void 0:r.id)||Dr(),this.options=(0,JM.default)(this.options,r),this.options.placement=(i=r.placement)!=null?i:this.options.placement,typeof r.rank=="string")this.rank=Eo(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let l=Math.trunc(b.env.NODE_ENV==="test"?fi.testId:fi.testId*10)/10;fi.testId+=.001,this.rank=l}typeof r.interactive=="string"&&(this.pointerEvents=r.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=e,this.initialRank=this.rank,this.markerContainer=document.createElement("div"),this.markerContainer.className="mappedin-marker",this.markerContainer.style.opacity="0",this.markerContainer.innerHTML='<div class="mappedin-marker-content">'.concat(this.contentHtml,"</div>"),this.markerContainer.setAttribute("data-marker-id",this.id.toString()),this.containerEl=(n=this.markerContainer.firstElementChild)!=null?n:null,this.contentEl=(a=(o=this.markerContainer.firstElementChild)==null?void 0:o.firstElementChild)!=null?a:null}updateDimensionsIfZeroWidthHeight(e,r){this.dimensions.width===0&&this.dimensions.height===0&&this.updateDimensions(e,r)}updateDimensions(e,r){if(e!=null&&r!=null)this.dimensions={width:e,height:r};else{let{width:i,height:n}=this.markerContainer.getBoundingClientRect();this.dimensions={width:i,height:n}}Object.assign(this.markerContainer,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){let{width:e,height:r}=this.dimensions;if(e===0||r===0)return[];let i=Array.isArray(this.options.placement)?this.options.placement:[this.options.placement],n=[];for(let o of i)this.options.rank==="always-visible"&&o===Me.HIDDEN&&i.length>1||n.push({name:o,getBoundingBox:s(()=>{let a=r/2,l=r/2,c=e/2,u=e/2;switch(o){case Me.TOP:{a=r,l=0;break}case Me.BOTTOM:{a=0,l=r;break}case Me.LEFT:{c=e,u=0;break}case Me.RIGHT:{c=0,u=e;break}case Me.TOP_LEFT:{a=r,c=e,l=0,u=0;break}case Me.TOP_RIGHT:{a=r,u=e,l=0,c=0;break}case Me.BOTTOM_LEFT:{l=r,c=e,a=0,u=0;break}case Me.BOTTOM_RIGHT:{l=r,u=e,a=0,c=0;break}case Me.HIDDEN:let p=Math.max(2,4/2);return[this.options.lowPriorityPin.size/2+p,this.options.lowPriorityPin.size/2+p,this.options.lowPriorityPin.size/2+p,this.options.lowPriorityPin.size/2+p]}return[a+4,l+4,c+4,u+4]},"getBoundingBox")});return n}toPackedMessage(e=!1){var i;this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0;let r=this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityPinStrategyIndex;if(this.visible&&e&&r&&this.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,r&&this.currentStrategyIndex!==((i=this.packedMessage.bboxes[0])==null?void 0:i[4])){let n=this.packedMessage.bboxes.findIndex(o=>o[4]===this.currentStrategyIndex);if(n!==-1){let o=this.packedMessage.bboxes.splice(n,1)[0];this.packedMessage.bboxes.unshift(o)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let n=0;n<this.strategies.length;n++){let o=this.strategies[n];n===this.currentStrategyIndex&&r?this.packedMessage.bboxes.unshift([...o.getBoundingBox(),n]):this.packedMessage.bboxes.push([...o.getBoundingBox(),n])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){return this.options.rank==="always-visible"?-1:this.strategies.findIndex(e=>e.name===Me.HIDDEN)}destroy(){}};s(fi,"MarkerComponent"),S(fi,"testId",0);var YM=fi;m();var S0=class S0 extends ht{constructor(){super(...arguments);S(this,"type","geometry");S(this,"userData",{entityId:"",type:"geometry"});S(this,"components",[])}raycast(r,i){this.userData.type==="model"&&this.children[0]&&r.intersectObject(this.children[0],!0).forEach(n=>{i.push(n)})}};s(S0,"Geometry3DObject3D");var hi=S0,T0=class T0{constructor(e,r){S(this,"id",Dr());S(this,"components");S(this,"parentId");S(this,"type");S(this,"entities2D",new Map);this.components=[e,r],this.type=e.type}getComponent(e){return this.components.find(r=>(r==null?void 0:r.type)===e)}get object3d(){return this.components[0].mesh}get parentObject3D(){var e;return(e=this.components[0].mesh)==null?void 0:e.parent}attach(e){this.parentObject3D instanceof Tt?e.object3d.userData.attachedEntityId=this.id:this.entities2D.set(e.id,e)}detach(e){this.parentObject3D instanceof Tt&&(e.object3d.userData.parentEntityId=void 0),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.detach(e)}};s(T0,"Geometry3D");var $t=T0;m();var I0=class I0 extends ht{};s(I0,"Geometry2DObject3D");var Er=I0,C0=class C0{constructor(e,r,i=0){S(this,"id");S(this,"type");S(this,"verticalOffset");S(this,"object3d",new Er);S(this,"components");S(this,"disposed",!1);S(this,"worldPosition",new Ze);this.id=e.id||Dr(),this.components=[e],this.verticalOffset=i,this.object3d=new Er,this.object3d.position.set(r.x,r.y,r.z+i),this.object3d.userData.entityId=this.id,this.type=e.type,this.object3d.userData.type=this.type,this.positionDirty=!0}get parentObject3D(){return this.object3d.parent}get attachedTo(){return this.object3d.userData.attachedEntityId}getComponent(e){return this.components.find(r=>(r==null?void 0:r.type)===e)}get position(){return this.positionDirty&&(this.object3d.matrixAutoUpdate=!0,this.object3d.getWorldPosition(this.worldPosition),this.positionDirty=!1,this.object3d.matrixAutoUpdate=!1),this.worldPosition}get positionDirty(){return this.object3d.userData.worldPositionDirty}set positionDirty(e){this.object3d.userData.worldPositionDirty=e}updatePosition(e){this.object3d.position.copy(e),this.positionDirty=!0}setAltitude(e){this.object3d.position.z=e,this.positionDirty=!0}};s(C0,"Geometry2D");var Yr=C0;m();m();var k0=class k0 extends Vo{constructor(r,i,n=!0){super();S(this,"rendererState");S(this,"convertTo3DMapPosition");S(this,"textSet",new Set);S(this,"batchedTextMap",new Map);S(this,"useWorker",!0);S(this,"debugTextAreaMesh",new Map);n===!1&&(this.useWorker=!1,X$(!1)),this.rendererState=r,this.convertTo3DMapPosition=i}remove(r){this.textSet.delete(r)}update(r){var l,c,u;let i,n,o,a=[];for(let p of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(p),(i==null?void 0:i.type)==="text3d"){n=i.components[0],o=i.components[1];let f=(l=n.mesh)==null?void 0:l.parent;if(!f||!(f instanceof It)||!(n instanceof wm))continue;if("textArea"in n.feature.properties&&n.mesh!=null&&n.polygonEntityId!=null&&n.textMesh==null&&n.mesh.parent!=null&&((u=(c=n.feature.properties)==null?void 0:c.textArea)==null?void 0:u.position)!=null){if(this.textSet.has(n.polygonEntityId))continue;this.textSet.add(n.polygonEntityId),this.batchedTextMap.has(f)||this.batchedTextMap.set(f,Tl().then(({BatchedText:g})=>{let x=new g;return x.type="batchedtext",f.add(x),x}));let y=this.batchedTextMap.get(f);if(!y)throw new Error("batched text required");a.push(QM({entityId:p,textComponent:n,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:y,rendererState:this.rendererState,type:"text-area"}).then(()=>{this.publish("render")}))}else if(n.mesh!=null&&n.textMesh==null&&n.mesh.parent!=null){if(this.textSet.has(p.toString()))continue;this.textSet.add(p.toString()),this.batchedTextMap.has(f)||this.batchedTextMap.set(f,Tl().then(({BatchedText:g})=>{let x=new g;return x.type="batchedtext",f.add(x),x}));let y=this.batchedTextMap.get(f);if(!y)throw new Error("batched text required");a.push(QM({entityId:p,textComponent:n,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:y,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let h=this.batchedTextMap.get(f);n.textMesh&&h&&n.polygonEntityId!=null&&Promise.all([h,Promise.resolve({meshComponent:n,styleComponent:o})]).then(([y,{meshComponent:g,styleComponent:x}])=>{let{textMesh:_}=g;if(y&&_){let P=E0(y,_);g.visible&&!P?y.add(_):!g.visible&&P&&y.remove(_)}x.flipToFaceCamera&&this.flipIfNeeded(g,r)})}return Promise.all(a)}flipIfNeeded(r,i){let n=r.textMesh;if(!n)return!1;let o=n.rotation.z,a=Vl(o+i);a>Math.PI/2&&a<3*Math.PI/2&&(n.rotation.z=Vl(o+Math.PI))}showTextAreaMesh(){let r,i;for(let n of this.rendererState.geometry3DIdsInScene)if(r=this.rendererState.geometry3DMap.get(n),(r==null?void 0:r.type)==="text3d"&&(i=r.components[0],"textArea"in i.feature.properties)){let o=i.feature.properties.textArea;if(!o)continue;let a=new M1(o.maxWidth,o.maxHeight),l=new Kr(a,new Cn({color:"pink"})),{textMesh:c}=i;if(!c)continue;let u=this.convertTo3DMapPosition(o.position,Sl);l.position.copy(u),l.position.z=c.position.z-.1,l.rotation.z=c.rotation.z,M0.identity(),M0.makeRotationAxis(new Ze(0,0,1),c.userData.rotationZ),Sl.set(o.maxWidth/2,0,0),Sl.applyMatrix4(M0),l.position.x-=Sl.x,l.position.y-=Sl.y,this.rendererState.geometryScene.add(l),this.debugTextAreaMesh.set(n,l)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.geometryScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}};s(k0,"Text3DSystem");var KM=k0;function X$(t){Tl().then(({configureTroikaTextBuilder:e})=>{e({useWorker:t})})}s(X$,"configureWorker");var M0=new In,Sl=new Ze,A0;function Tl(){return A0||(A0=import("./text3d-V33HAOF5.js").then(t=>t)),A0}s(Tl,"getText3DService");async function QM({entityId:t,textComponent:e,styleComponent:r,convertTo3DMapPosition:i,batchedMeshPromise:n,rendererState:o,type:a="text-area"}){return Promise.all([Tl(),Promise.resolve({entityId:t,meshComponent:e,styleComponent:r})]).then(([{createTroikaTextPoint:l,createTroikaTextArea:c},u])=>a==="text-area"?c(u.entityId,u.meshComponent,u.styleComponent,i):l(u.entityId,u.meshComponent,u.styleComponent,i)).catch(l=>{nt.warn("Trouble creating text: ",l)}).then(l=>{if(!(l!=null&&l.text))return;let c=[Promise.resolve(l.text),n,Promise.resolve()];if(e.polygonEntityId){let u=o.geometry3DMap.get(e.polygonEntityId);if((u==null?void 0:u.type)==="geometry"){let p=u.components[0],f=u.components[1];p.textMesh=l.text,l.text.position.z=f.altitude+f.height+H$}}else c[2]=Tl().then(({syncText:u})=>u(l.text));return Promise.all(c)}).then(l=>{if(!l)return;let[c,u]=l;u.add(c),e.batchedText||(e.batchedText=u)})}s(QM,"createText");function E0(t,e){return t._members.has(e)}s(E0,"doesBatchedTextContainsText");var H$=.5;var q$=D.object({visible:D.boolean(),color:D.string(),flipToFaceCamera:D.boolean(),font:D.string().optional(),fontSize:D.number(),margin:D.union([D.number(),D.tuple([D.number(),D.number(),D.number(),D.number()])]),outlineColor:D.string(),outlineOpacity:D.number(),outlineBlur:D.union([D.number(),D.string()]),outlineWidth:D.number(),outlineOffsetX:D.number(),outlineOffsetY:D.number(),strokeWidth:D.number(),maxWidth:D.number().optional(),maxHeight:D.number().optional(),strokeOpacity:D.number(),strokeColor:D.string(),fillOpacity:D.number(),hoverColor:D.string().optional(),id:D.union([D.string(),D.number()]),type:D.literal("text3d"),position:D.tuple([D.number(),D.number(),D.number()]),content:D.string()}),eA=D.strictObject(q$.partial().omit({id:!0,type:!0}).shape),tA=D.strictObject(eA.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).shape),tFe=D.strictObject({appearance:eA.optional(),parentId:D.string().optional()}),L0=class L0{constructor(e){S(this,"mesh",new hi);S(this,"textMesh");S(this,"type","text3d");S(this,"feature");S(this,"parent");S(this,"batchedText");S(this,"polygonEntityId");this.feature=e}get visible(){return this.batchedText&&this.textMesh?E0(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(e){this.batchedText&&this.textMesh?e?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=e),this.mesh.visible=e}};s(L0,"Text3DComponent");var wm=L0;m();var zo,D0=class D0{constructor(e){S(this,"type","outline");S(this,"color");S(this,"dirty",!0);S(this,"enabled",!0);hr(this,zo,!1);S(this,"edgeColors");S(this,"edgeVisibility");S(this,"geometry");S(this,"ranges");S(this,"topFaceVerticesIndices");this.color=e}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[this.ranges.start*4+3]:0}set visible(e){if(!this.edgeVisibility||!this.ranges||At(this,zo)===e)return;dr(this,zo,e);let r=this.edgeVisibility.array,i=e?1:0;for(let n=0;n<this.ranges.count;n++){let o=this.ranges.start+n;r[o]=i}this.edgeVisibility.needsUpdate=!0}get visible(){return At(this,zo)}get currentColor(){return this.edgeColors&&this.ranges?[this.edgeColors.array[this.ranges.start*4],this.edgeColors.array[this.ranges.start*4+1],this.edgeColors.array[this.ranges.start*4+2]]:[0,0,0]}};zo=new WeakMap,s(D0,"OutlineComponent");var Sm=D0;m();m();m();var z0=class z0 extends w1{constructor(r){let i=r,n=3,o=n*4;super(new Uint8Array(r*o),n,r,_1,x1);S(this,"_width");S(this,"_height");S(this,"_propertiesLength");this._width=o,this._height=i,this._propertiesLength=n}setColor(r,i,n){let o=this.image.data,a=r*this._width;o[a]=Math.round(i.r*255),o[a+1]=Math.round(i.g*255),o[a+2]=Math.round(i.b*255),o[a+3]=0,o[a+4]=Math.round(n.r*255),o[a+5]=Math.round(n.g*255),o[a+6]=Math.round(n.b*255),o[a+7]=0,this.needsUpdate=!0}getColor(r){let i=this.image.data,n=r*this._width,o=new Yt(i[n]/255,i[n+1]/255,i[n+2]/255),a=new Yt(i[n+4]/255,i[n+5]/255,i[n+6]/255);return{color:o,topColor:a}}setTexture(r,i,n){let o=this.image.data,a=r*this._width;o[a+8]=i?255:0,o[a+9]=n?255:0,o[a+10]=0,o[a+11]=0,this.needsUpdate=!0}getTexture(r){let i=this.image.data,n=r*this._width,o=i[n+8]===255,a=i[n+9]===255;return{texture:o,topTexture:a}}};s(z0,"BatchedPropertiesTexture");var Tm=z0;m();var rA="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying float vVerticalOffset;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vVerticalOffset = position.z;\n}\n";m();var nA="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nuniform bool uBlendTexture;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying float vVerticalOffset;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {\n vec3 texturedColor = diffuseColor * texColor.rgb;\n return mix(diffuseColor, texturedColor, texColor.a);\n}\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r > 0.99;\n\n if(shouldShowTexture) {\n vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));\n diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;\n }\n\n // if this is a fragment facing upwards, use topColor. Avoid any sort of '==' comparison, due to floating point precision issue\n if(angle < 0.02) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;\n\n if(shouldShowTopTexture) {\n vec4 topTex2d = texture2D(uTopTexture, vUv);\n diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vVerticalOffset) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n\n // accumulation\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n\n}\n";var W$=-.05,Y$=1,O0=class O0 extends A1{constructor(r,i,n=1){super(r);S(this,"propertiesTexture");S(this,"texturesVisible",!1);S(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:void 0},uTexture:{value:void 0},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});S(this,"colorSpace",Vm);S(this,"showTextures",s(r=>{this.texturesVisible=!0;let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(r,i,n),this.needsUpdate=!0)},"showTextures"));this.alphaTest=.01,this.propertiesTexture=new Tm(i),this.uniforms.uRepeatYFactor.value=n,this.onBeforeCompile=o=>{let a=this.uniforms.uGradientIntensity,l=this.uniforms.uGradientEnd,c=this.uniforms.uGradientStart,u=this.uniforms.uTopTexture,p=this.uniforms.uTexture,f=this.uniforms.uRepeatYFactor,h=this.uniforms.uBlendTexture;this.uniforms=o.uniforms,o.vertexShader=rA,o.fragmentShader=nA,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:l,uGradientStart:c,uMinSideAlpha:{value:W$},uMaxSideAlpha:{value:Y$},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:u,uTexture:p,uRepeatYFactor:f,uBlendTexture:h})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(r){r!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=r,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(r){if(r==null){this.uniforms.uTexture.value=null;return}r.wrapS=$o,r.wrapT=$o,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){if(r==null){this.uniforms.uTopTexture.value=null;return}r.wrapS=$o,r.wrapT=$o,r.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=r}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(r){r!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=r,this.colorSpace=r?v1:Vm,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}setGradientShading(r,i,n){this.uniforms.uGradientStart.value=r,this.uniforms.uGradientEnd.value=i,this.uniforms.uGradientIntensity.value=n}getGradientShading(){return{start:this.uniforms.uGradientStart.value,end:this.uniforms.uGradientEnd.value,intensity:this.uniforms.uGradientIntensity.value}}setColor(r,i,n){this.propertiesTexture.setColor(r,i,n)}getColor(r){return this.propertiesTexture.getColor(r)}hideTextures(r){this.texturesVisible=!1;let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(r,!1,!1),this.needsUpdate=!0)}removeSideTexture(r){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let i=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(r,!1,i),this.needsUpdate=!0}}removeTopTexture(r){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let i=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(r,i,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};s(O0,"BatchedStandardMaterial");var Il=O0;m();var wFe={top:0,bottom:0,left:0,right:0,type:"pixel"},Cl={enabled:!1,thickness:0,size:0,offset:0,segments:3};function SFe(t,e){var r,i,n,o,a;return{bevelEnabled:(r=t==null?void 0:t.enabled)!=null?r:Cl.enabled,bevelThickness:(i=t==null?void 0:t.thickness)!=null?i:Cl.thickness,bevelSize:(n=t==null?void 0:t.size)!=null?n:(t==null?void 0:t.thickness)||Cl.size,bevelOffset:(o=t==null?void 0:t.offset)!=null?o:Cl.offset,bevelSegments:(a=t==null?void 0:t.segments)!=null?a:Cl.segments,depth:e}}s(SFe,"createExtrudeSettings");var iA="mappedin";var oA={MASKS:12,GEOMETRY:0,IMAGE_MESH:1,XRAY_PATH:9,STENCIL_PATH:10,ALWAYS_ON_TOP_PATHS:11,ALWAYS_ON_TOP_MODELS:12},TFe=250,IFe={tension:0,cornerRadius:.5};m();function jFe(t,e){var u,p,f;let r=0;for(let h of t)r+=((p=(u=h.components[0])==null?void 0:u.geometry)==null?void 0:p.attributes.position.count)||0;let i=new Yt(e.color),n;n=new Il({color:i,side:e.side==="back"?g1:e.side==="front"?y1:b1,opacity:(f=e.opacity)!=null?f:1,transparent:e.opacity!==void 0?e.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},t.length);let o=new Oo(t.length,r,0,n);o.renderOrder=oA.GEOMETRY;let a,l,c;for(let h of t)a=h.components[0],!(!(a instanceof vn)||!a.geometry)&&(a.mesh=o,a.material=n,a.instanceIndex=o.addGeometry(a.geometry),o.addInstance(a.instanceIndex),o.userData.entities[a.instanceIndex]=h.id,n instanceof Il&&n.setColor(a.instanceIndex,i,e.topColor?new Yt(e.topColor):i),l=o.getGeometryIdAt(a.instanceIndex),a.batchedProps&&(c=o.getGeometryRangeAt(l),c&&(a.batchedProps.range=c),a.batchedProps.geometryId=l));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}s(jFe,"batchGeometries");function R0(t){return H(t).darken(30).toRgbString()}s(R0,"darkenColorForOutline");function GFe(t,e,r,i){if(e.length<1)return;t.boundingBox||t.computeBoundingBox();let n=t.boundingBox,o=t.getAttribute("position"),a=t.getAttribute("normal"),l=t.getAttribute("uv"),c,u;t.index?(c=t.index.count/3,u=s(function(v,w){return t.index.getX(v*3+w)},"meshIndex")):(c=o.count/3,u=s(function(v,w){return v*3+w},"meshIndex"));let p=new In;p.makeRotationFromQuaternion(new jm().setFromEuler(new Zm(0,0,r/180*Math.PI)));let f=e.find(v=>v.face==="top"),h;f&&(h={min:i(f.bounds[1],f.bounds[0],0),max:i(f.bounds[3],f.bounds[2],n.max.z)});let y=e.find(v=>v.face==="side"),g;if(y&&(g={min:i(y.bounds[1],y.bounds[0],0),max:i(y.bounds[3],y.bounds[2],n.max.z)}),!(!g&&!h))for(let v=0;v<c;++v){let w=a.getX(u(v,0))+a.getX(u(v,1))+a.getX(u(v,2)),T=a.getY(u(v,0))+a.getY(u(v,1))+a.getY(u(v,2)),A=a.getZ(u(v,0))+a.getZ(u(v,1))+a.getZ(u(v,2)),k=Math.abs(w),L=Math.abs(T),R=Math.abs(A);var x,_;k<=L&&k<=R?(x="x",L<=R?_="y":_="z"):L<=k&&L<=R?(x="y",k<=R?_="x":_="z"):(x="z",k<=L?_="x":_="y"),x==="z"&&(x=_,_="z");let Z,q,X,G,F,K;if(_==="z"||x==="z"){if(!y||!g)continue;Z=y.repeat.u,q=y.repeat.v,X=y.offset.u,G=y.offset.v,F=y.rotation,K=g}else{if(!f||!h)continue;Z=f.repeat.u,q=f.repeat.v,X=f.offset.u,G=f.offset.v,F=(360-r+f.rotation)%360,K=h}let{min:fe,max:ve}=K,Te=new ht;Te.position.set(fe.x,fe.y,0),Te.updateMatrix(),Te.updateMatrixWorld();let Ct=fe.clone().applyMatrix4(p),Uo=ve.clone().applyMatrix4(p),No=Math.abs(Uo.x-Ct.x),Bm=Math.abs(Uo.y-Ct.y),Rl=new Ze(No,Bm,ve.z).applyMatrix4(Te.matrixWorld),Um=Math.abs(Rl[x]-fe[x]),Nm=Math.abs(Rl[_]-fe[_]),u1=F*Math.PI/180||0,c1=Math.cos(u1),p1=Math.sin(u1),BA=Te.matrixWorld.clone().invert(),UA=new jm().setFromEuler(new Zm(0,0,r/180*Math.PI));for(let Tn=0;Tn<3;Tn++){let m1=new Ze(o.getX(u(v,Tn)),o.getY(u(v,Tn)),o.getZ(u(v,Tn))).applyMatrix4(BA);m1.applyQuaternion(UA);let $m=m1.applyMatrix4(Te.matrixWorld),f1=$m.x,h1=$m.y,d1=$m.z;var P,I;x==="x"?P=Z*(f1-fe[x])/Um+X:x==="y"?P=Z*(h1-fe[x])/Um+X:P=Z*(d1-fe[x])/Um+X,_==="x"?I=q*(f1-fe[_])/Nm+G:_==="y"?I=q*(h1-fe[_])/Nm+G:I=q*(d1-fe[_])/Nm+G,P-=.5,I-=.5;let NA=P*c1-I*p1+.5,$A=P*p1+I*c1+.5;l.setX(u(v,Tn),NA),l.setY(u(v,Tn),$A)}}}s(GFe,"updateUVsLegacy");m();var F0=class F0{constructor(){S(this,"type","focusable");S(this,"focusMesh");S(this,"dirty",!0)}};s(F0,"FocusableComponent");var Im=F0;m();var B0=class B0{constructor(e,r){S(this,"type","texture");S(this,"texture");S(this,"topTexture");S(this,"showTexture",!0);S(this,"showTopTexture",!0);S(this,"textureInstance");S(this,"topTextureInstance");S(this,"dirty",!0);this.texture=typeof e=="string"?{path:e}:e,this.topTexture=typeof r=="string"?{path:r}:r}};s(B0,"TextureComponent");var Cm=B0;m();var U0=class U0{constructor(){S(this,"type","border");S(this,"dirty",!0);S(this,"needsRebuild",!1);S(this,"mesh")}set visible(e){this.mesh&&(this.mesh.visible=e)}get visible(){return this.mesh?this.mesh.visible:!1}};s(U0,"BorderComponent");var Mm=U0;m();var N0=class N0{constructor(){S(this,"type","mask");S(this,"maskId",0);S(this,"enabled",!0);S(this,"mode","mask");S(this,"effect","hide");S(this,"dirty",!0)}};s(N0,"Mask");var Am=N0;m();var $0=class $0{constructor(){S(this,"type","clippingPlane");S(this,"dirty",!0);S(this,"needsRebuild",!1);S(this,"verticalOffset",1/0);S(this,"plane");S(this,"holeFillMesh");S(this,"topColor");S(this,"topVisible",!0)}};s($0,"ClippingPlaneComponent");var Em=$0;function Ml(t,e,r){if(e!==void 0){if(t.type==="model"||t.type==="path"||t.type==="marker"||t.type==="label"||t.type==="geometry"||t.type==="group-container"||t.type==="custom-geometry")return e===!0?(t instanceof Yr&&t.components[1]===void 0?(t.components[1]=new fo,t.components[1].dirty=!0):t instanceof $t&&t.components[2]===void 0?(t.components[2]=new fo,t.components[2].dirty=!0):t instanceof It&&t.components[0]===void 0&&(t.components[0]=new fo,t.components[0].dirty=!0),!0):(t instanceof Yr?t.components[1]=void 0:t instanceof $t?t.components[2]=void 0:t instanceof It&&(t.components[0]=void 0),!0);if(t.type==="geometry-group"){let i;for(let n of t.userData.entities3D.values())i=r.geometry3DMap.get(n),Ml(i,e,r);return!0}}return!1}s(Ml,"updateInteractivity");function ABe(t,e,r){if(!(!(r!=null&&r.color)&&!("topColor"in r))){if(r!==void 0&&t.type==="geometry-group"){let i;for(let n of t.userData.entities3D.values())i=e.geometry3DMap.get(n),i&&aA(i,r);return!0}return!1}}s(ABe,"updateGroupColor");function Q$(t,e){e!==void 0&&t.type==="geometry"&&(t.components[1].shading=e,t.components[1].dirty=!0)}s(Q$,"updateShading");function EBe(t,e,r){if(r!==void 0&&t.type==="geometry-group"){for(let i of t.userData.entities3D.values()){let n=e.geometry3DMap.get(i);n&&Q$(n,r)}return!0}return!1}s(EBe,"updateGroupShading");function kBe(t,e){e!==void 0&&t.type==="geometry"&&(e.showImage!==void 0&&(t.components[1].showImage=e.showImage),e.flipImageToFaceCamera!==void 0&&(t.components[1].flipImageToFaceCamera=e.flipImageToFaceCamera))}s(kBe,"updateImageProps");function e6(t,e,r){if(r!==void 0){if(t.type==="geometry"){let i=t.components[1];if(i.height!==r)return i.height=r,i.dirty=!0,t.components[3]&&(t.components[3].dirty=!0),t.components[5]&&(t.components[5].needsRebuild=!0,t.components[5].dirty=!0),!0}else if(t.type==="geometry-group"){for(let i of t.userData.entities3D.values()){let n=e.geometry3DMap.get(i);((n==null?void 0:n.type)==="geometry"||(n==null?void 0:n.type)==="model")&&e6(n,e,r)}return!0}}return!1}s(e6,"updateHeight");function aA(t,e){if(e!==void 0){let r=!1;(t.type==="path"||t.type==="geometry")&&(e.initialColor!==void 0&&e.initialColor!==t.components[1].initialColor&&(t.components[1].initialColor=e.initialColor,r=!0),e.color!==void 0&&e.color!==t.components[1].color&&(t.components[1].color=e.color,r=!0,t.components[3]&&(t.components[3].color=R0(e.color),t.components[3].dirty=!0)),"topColor"in e&&(t.components[1].topColor=e.topColor,r=!0),r&&(t.components[1].dirty=!0))}}s(aA,"updateColor");function LBe(t,e,r){e!==void 0&&(t.type==="label"||t.type==="marker"?t.updatePosition(r(e[1],e[0],e[2]||0)):t.type==="custom-geometry"&&t.components[0].position.copy(r(e[1],e[0],e[2]||0)))}s(LBe,"updatePosition");function DBe(t,e){var r;return e!==void 0&&(t.type==="marker"||t.type==="label"||t.type==="custom-geometry")&&t.parentObject3D!==e&&t.parentObject3D instanceof It?((r=t.parentObject3D)==null||r.removeEntity(t),e.addEntity(t),!0):!1}s(DBe,"updateParent");function zBe(t,e){e!==void 0&&(t.type==="marker"||t.type==="label")&&t.components[0].enabled!==e&&(t.components[0].enabled=e)}s(zBe,"updateEnabled");function OBe(t,e,r){var i;if(e!==void 0&&t.type==="marker"){let n=t.components[0],o=!1;if(e.contentHTML!==void 0&&(n.containerEl.innerHTML=e.contentHTML,n.contentHtml=e.contentHTML,o=!0),uA(t,e.placement)&&(n.collisionDirty=!0,o=!0),e.dynamicResize!==void 0&&(n.options.dynamicResize=e.dynamicResize,o=!0),lA(t,(i=e.options)==null?void 0:i.occlude)&&(o=!0),e.options!=null){try{w0.parse(e.options||{})}catch(a){return nt.error(a),!1}e.options.interactive!=null&&(e.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",Ml(t,!1,r)):(n.pointerEvents="none",Ml(t,e.options.interactive,r))),sA(t,e.options.rank),o=!0}return o}return!1}s(OBe,"updateMarker");function sA(t,e){return e!==void 0&&(t.type==="marker"||t.type==="label")?(t.components[0].rank=Eo(e),!0):!1}s(sA,"updateRank");function t6(t,e){var a;if(((a=e==null?void 0:e.options)==null?void 0:a.appearance)==null)return;let r=c0(e.options.appearance||{}),i=r.opacity!=null&&r.opacity!==t.appearance.opacity,o=r.iconScale!=null&&r.iconScale!==t.appearance.iconScale&&typeof r.iconScale=="number"&&Number.isFinite(r.iconScale);i&&(r.opacity=V0(r.opacity)),o&&(r.iconScale=V0(r.iconScale)),G0(t.appearance,r),i&&t.canShow&&t.visibilityNeedsUpdate!=="hide"&&(t.visibilityNeedsUpdate="show")}s(t6,"updateLabelAppearance");function RBe(t,e,r){var i,n,o,a,l,c;if(e!==void 0&&t.type==="label"){let u=t.components[0];e.text!==void 0&&e.text!==u.text&&(u.text=e.text,u.textDirty=!0),pM(u.appearance,((i=e.options)==null?void 0:i.appearance)||{})&&(u.textDirty=!0),mM(u.appearance,((n=e.options)==null?void 0:n.appearance)||{})&&(u.pinDirty=!0),t6(u,e),fM(u.options,e.options||{})&&(uA(t,(o=e.options)==null?void 0:o.textPlacement),u.currentStrategyIndex=-1,u.collisionDirty=!0),Ml(t,(a=e.options)==null?void 0:a.interactive,r),sA(t,(l=e.options)==null?void 0:l.rank),lA(t,(c=e.options)==null?void 0:c.occlude)}}s(RBe,"updateLabel");function lA(t,e){if(e!==void 0&&(t.type==="label"||t.type==="marker")){let r=t.components[2];if(r)return r.enabled=e,!0}return!1}s(lA,"updateOcclusion");function uA(t,e){if(e!==void 0){if(t.type==="label"){let r=t.components[0];return r.options.textPlacement=e,!0}else if(t.type==="marker"){let r=t.components[0];return r.options.placement=e,!0}}return!1}s(uA,"updatePlacement");function FBe(t,e){e!==void 0&&t.type==="geometry"&&(t.components[1].hoverColor=e,t.components[1].dirty=!0)}s(FBe,"updateHoverColor");function BBe(t,e){if(e!==void 0){let r=t.components[2];if(t.type==="geometry"&&r!=null)return r.hover=e,r.dirty=!0,!0}return!1}s(BBe,"updateHovered");function UBe(t,e){e!==void 0&&t.type==="image"&&(t.components[1].flipImageToFaceCamera=e)}s(UBe,"updateFlipImageToFaceCamera");function NBe(t,e){e!==void 0&&t.type==="geometry"&&(t.components[1].enableImageCollisions=e)}s(NBe,"updateEnableImageCollisions");function cA(t,e,r){if(r!==void 0)if(t.type==="model"||t.type==="path"||t.type==="geometry"||t.type==="custom-geometry"||t.type==="image"||t.type==="text3d"){r!==t.components[1].visible&&(t.components[1].visible=r,t.components[1].dirty=!0);let i=t.components[3];return i&&(i.dirty=!0),!0}else{if(t.type==="geometry-group")return t.setVisible(r),!0;if(t.type==="group-container"){if(t.visible!==r)return t.setVisible(r),r===!1&&t.traverse(i=>{if(i instanceof Er){let n=e.geometry2DMap.get(i.userData.entityId);if(n){let o=n.components[0];o instanceof gM&&(o.canShow=r)}}}),!0}else if(t.type==="label")return t.components[0].visible=r,!0}return!1}s(cA,"updateVisibility");function r6(t,e,r){if(r!==void 0)if(t.type==="geometry-group"){for(let i of t.userData.entities3D.values()){let n=e.geometry3DMap.get(i);((n==null?void 0:n.type)==="geometry"||(n==null?void 0:n.type)==="model")&&r6(n,e,r)}return!0}else if(t.type==="group-container"){if(t.opacity!==r){t.setOpacity(r);let i=1;return t.parent instanceof It&&(i=t.parent.opacity),pA(t,e,i),!0}}else t instanceof $t&&t.components[1].opacity!==r&&(t.components[1].opacity=r,t.components[1].dirty=!0);return!1}s(r6,"updateOpacity");function pA(t,e,r=1){if(t.type==="group-container"&&"children"in t&&t.children.length>0){let i=r*t.opacity;t.userData.computedOpacity=i;for(let n of t.children)(n instanceof Tt&&n.type==="geometry-group"||n instanceof It&&n.type==="group-container")&&pA(n,e,i)}else if(t.type==="geometry-group")for(let i of t.userData.entities3D.values()){let n=e.geometry3DMap.get(i),o;((n==null?void 0:n.type)==="geometry"||(n==null?void 0:n.type)==="model")&&(o=n.components[1],o.dirty=!0)}}s(pA,"cascadeOpacity");function $Be(t,e,r){let i=!1;if((r==null?void 0:r.texture)!=null||(r==null?void 0:r.topTexture)!=null){if(t.type==="geometry-group")for(let n of t.userData.entities3D.values()){let o=e.geometry3DMap.get(n);o&&n6(o,r)}return!0}return i}s($Be,"updateGroupTexture");function n6(t,e){if(t.type==="geometry"&&((e==null?void 0:e.texture)!=null||(e==null?void 0:e.topTexture)!=null)){let r=!1,i=t.components[6];if(i==null?(t.components[6]=new Cm(e==null?void 0:e.texture,e==null?void 0:e.topTexture),r=!0):((e==null?void 0:e.texture)!=null&&(i==null?void 0:i.texture)!==(e==null?void 0:e.texture)&&(i.texture=typeof e.texture=="string"?{path:e.texture}:e.texture,r=!0,i.dirty=!0),(e==null?void 0:e.topTexture)!=null&&(i==null?void 0:i.topTexture)!==(e==null?void 0:e.topTexture)&&(i.topTexture=typeof e.topTexture=="string"?{path:e.topTexture}:e.topTexture,r=!0,i.dirty=!0)),r&&t.components[0]instanceof vn){let n=t.components[0];return n.detached===!1&&(n.shouldDetach=!0,n.dirty=!0),!0}}return!1}s(n6,"updateIndividualGeometryTexture");function VBe(t,e){if(Object.keys(e!=null?e:{}).length===0||e==null)return!1;if(t.type==="geometry-group"){t.components[0]==null&&e.enabled===!0&&(t.components[0]=new Am);let r=t.components[0];if(r==null)return!1;e.enabled!=null&&r.enabled!==e.enabled&&(r.enabled=e.enabled,r.dirty=!0),e.maskId!=null&&Number.isInteger(e.maskId)&&r.maskId!==e.maskId&&(r.maskId=e.maskId,r.dirty=!0),e.effect!=null&&r&&r.effect!==e.effect&&(r.effect=e.effect,r.dirty=!0),e.mode!=null&&r&&r.mode!==e.mode&&(r.mode=e.mode,r.dirty=!0)}return!1}s(VBe,"updateMask");function jBe(t,e){if(e!==void 0&&t.type==="geometry"){let r=t.components[1];if(r.opacity!==e){r.opacity=e;let i=t.components[0],n=t.components[3];n&&(n.dirty=!0),i.detached===!1&&(i.shouldDetach=!0,i.dirty=!0),r.dirty=!0;let o=t.parentObject3D;return(o==null?void 0:o.type)==="geometry-group"&&(o.userData.shadingDirty=!0),!0}}return!1}s(jBe,"updateIndividualGeometryOpacity");function i6(t,e,r){if(r!==void 0)if(t.type==="geometry"||t.type==="path"||t.type==="custom-geometry"){let i=t.components[1];if(i.altitude!==r)return i.altitude=r,i.dirty=!0,t.components[3]&&(t.components[3].dirty=!0),t.components[5]&&(t.components[5].needsRebuild=!0,t.components[5].dirty=!0),!0}else{if(t.type==="group-container"&&t.altitude!==r)return t.setAltitude(r),!0;if(t.type==="geometry-group"){let i;for(let n of t.userData.entities3D.values())i=e.geometry3DMap.get(n),i&&i6(i,e,r)}}return!1}s(i6,"updateAltitude");function o6(t,e,r){if(r!==void 0){if(t.type==="geometry-group")for(let i of t.userData.entities3D.values()){let n=e.geometry3DMap.get(i);n instanceof $t&&o6(n,e,r)}else if(t.type==="geometry"){let i=t.components[3],n=t.components[1];!i&&r===!0?t.components[3]=new Sm(R0(n.color)):i&&(i.enabled=r,i.dirty=!0)}return!0}return!1}s(o6,"updateOutline");function GBe(t,e){if(e!==void 0){let r,i=4;if(t.type==="geometry"?(r=t.components[4],i=4):t.type==="group-container"&&(r=t.components[1],i=1),e===!0&&r==null)return t.components[i]=new Im,!0;if(e===!1&&r!=null)return t.components[i]=void 0,!0}return!1}s(GBe,"updateFocusable");function ZBe(t,e){if(e!==void 0&&t.type==="geometry"){let r=t.components[1];if(r.renderOrder!==e){r.renderOrder=e;let i=t.components[0];return i.detached===!1&&(i.shouldDetach=!0,i.dirty=!0),i.imageMesh&&(i.imageMesh.renderOrder=e+1),r.dirty=!0,!0}}return!1}s(ZBe,"updateIndividualGeometryRenderOrder");function a6(t,e,r){if(r!=null){if(t.type==="geometry"){let i=t.components[1];i.side!==r&&(i.side=r,i.dirty=!0)}else if(t.type==="geometry-group")for(let i of t.userData.entities3D.values()){let n=e.geometry3DMap.get(i);n instanceof $t&&a6(n,e,r)}}}s(a6,"updateSide");function XBe(t,e){if(e!==void 0&&t.type==="geometry"){let r=t.components[1],i;if(i=t.components[5],e.borderVisible!==r.borderVisible&&e.borderVisible!=null){if(e.borderVisible===!0){if(i==null){let n=new Mm;t.components[5]=n,i=t.components[5]}i.visible=!0,i.dirty=!0}else e.borderVisible===!1&&i!=null&&(i.visible=!1,i.dirty=!0);r.borderVisible=e.borderVisible}r.borderColor!==e.borderColor&&e.borderColor!=null&&(r.borderColor=e.borderColor,i&&(i.dirty=!0)),r.borderWidth!==e.borderWidth&&e.borderWidth!=null&&(r.borderWidth=e.borderWidth,i&&(i.needsRebuild=!0))}}s(XBe,"updateBorder");function HBe(t,e,r){let{visible:i,color:n}=r;if(t.type!=="path")return;let o=t.components[0];i!=null&&cA(t,e,i),n!=null&&aA(t,{color:n}),Object.assign(o,s6(r)),j0(r)||(o.materialDirty=!0,r.width!=null&&(o.dirty=!0),(r.smoothingTension!=null||r.smoothingCornerRadius!=null)&&(o.dirty=!0))}s(HBe,"handlePathUpdate");function s6(t){return Al(t,l6)}s(s6,"pickPathOptions");var l6=["smoothingTension","smoothingCornerRadius","animateArrowsOnPath","displayArrowsOnPath","width","accentColor","completeFraction","highlightCompleteFraction","highlightStartFraction","highlightEndFraction","highlightColor","highlightWidthMultiplier","dashed","visibleThroughGeometry","xrayOpacity"];function qBe(t){if(!(t instanceof $t&&t.type==="text3d"))throw new Error("expect target is TextGeometry3D")}s(qBe,"assetGeometryIsText3D");var u6=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function WBe(t,e,r){cA(t,e,r.visible);let i=t.components[1],n=Al(r,u6);"margin"in r&&nt.warn("update to margin is not supported atm"),"content"in r&&nt.warn("content update is not supported atm");try{tA.parse(n)}catch(o){nt.error(o);return}Object.keys(n).length>0&&(Object.assign(i,n),i.dirty=!0)}s(WBe,"handleText3DUpdate");var c6=["color","material","opacity","verticalOffset","rotation","position","scale"];function YBe(t,e){let r=Al(e,c6),i=t.components[1],n=t.components[0];Object.keys(r).length>0&&(r.material&&(i.material=r.material),r.opacity!=null&&(i.opacity=r.opacity),r.verticalOffset!=null&&(i.verticalOffset=r.verticalOffset),r.color!=null&&(i.color=r.color),r.position!=null&&(n.feature.geometry.coordinates=r.position,n.positionDirty=!0),r.rotation!=null&&(i.rotation=r.rotation),r.scale!=null&&(i.scale=r.scale),r.visibleThroughGeometry!=null&&(n.visibleThroughGeometry=r.visibleThroughGeometry),i.dirty=!0)}s(YBe,"handleModelStyleUpdate");function JBe(t,e){if(e!==void 0&&t.type==="model"){let r=t.components[7];r==null&&(t.components[7]=new Em,r=t.components[7]),r=t.components[7],e.clippingPlaneZOffset!=null&&r.verticalOffset!==e.clippingPlaneZOffset&&(r.verticalOffset=e.clippingPlaneZOffset,r.dirty=!0),e.clippingPlaneTopColor!=null&&r.topColor!==e.clippingPlaneTopColor&&(r.topColor=e.clippingPlaneTopColor,r.dirty=!0),e.clippingPlaneTopVisible!=null&&r.topVisible!==e.clippingPlaneTopVisible&&(r.topVisible=e.clippingPlaneTopVisible,r.dirty=!0)}}s(JBe,"updateClippingPlane");m();m();var H0=J(vA());function PA(t){this.name="JSClipperError",this.message=t,this.stack=new Error().stack}s(PA,"JSClipperError");PA.prototype=Error.prototype;H0.default.Error=function(t){throw new PA(t)};var Jr=H0.default;var ij="gray",q0=new Jr.ClipperOffset,ft=100;function W0(t,e,r){let{color:i=ij,opacity:n=1,width:o=1,join:a="round",cap:l="round",height:c=.01,altitude:u=0}=r||{};Array.isArray(n)&&(n=0);let p=[],f=t.geometry.coordinates.every(P=>P[2]!=null);for(let P=0;P<t.geometry.coordinates.length-1;P++){let I=e(t.geometry.coordinates[P][1],t.geometry.coordinates[P][0],t.geometry.coordinates[P][2]),v=e(t.geometry.coordinates[P+1][1],t.geometry.coordinates[P+1][0],t.geometry.coordinates[P+1][2]);p.push([I,v])}let h=p[0][0].y;q0.AddPaths(p.map(P=>P.map(I=>({X:I.x*ft,Y:(f?I.z:I.y)*ft}))),a==="round"?Jr.JoinType.jsRound:a==="miter"?Jr.JoinType.jsMiter:Jr.JoinType.jsSquare,l==="round"?Jr.EndType.etOpenRound:l==="butt"?Jr.EndType.etOpenButt:Jr.EndType.etOpenSquare);let y=new Jr.PolyTree;q0.Execute(y,o/2*ft);let g=[],x={bevelEnabled:!1,depth:c};for(let P of y.m_AllPolys){let I=new I1;if(P.IsHole())continue;let v=P.m_polygon;I.moveTo(v[0].X/ft,v[0].Y/ft),v.slice(1).forEach(w=>I.lineTo(w.X/ft,w.Y/ft)),I.lineTo(v[0].X/ft,v[0].Y/ft),I.holes=P.m_Childs.map(w=>{let T=new T1,A=w.m_polygon;return T.moveTo(A[0].X/ft,A[0].Y/ft),A.slice(1).forEach(k=>T.lineTo(k.X/ft,k.Y/ft)),T.lineTo(A[0].X/ft,A[0].Y/ft),T}),g.push(new C1(I,x))}let _=Bl(g);return f&&(_.rotateX(Math.PI/2),_.translate(0,h+c/2,u||0)),_.userData={style:{color:i,opacity:n}},q0.Clear(),_}s(W0,"renderLineStringGeometry");m();m();var Vt=63710088e-1,x3e={centimeters:Vt*100,centimetres:Vt*100,degrees:360/(2*Math.PI),feet:Vt*3.28084,inches:Vt*39.37,kilometers:Vt/1e3,kilometres:Vt/1e3,meters:Vt,metres:Vt,miles:Vt/1609.344,millimeters:Vt*1e3,millimetres:Vt*1e3,nauticalmiles:Vt/1852,radians:1,yards:Vt*1.0936};function wA(t,e,r={}){let i={type:"Feature"};return(r.id===0||r.id)&&(i.id=r.id),r.bbox&&(i.bbox=r.bbox),i.properties=e||{},i.geometry=t,i}s(wA,"feature");function SA(t,e,r={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return wA({type:"LineString",coordinates:t},e,r)}s(SA,"lineString");function TA(t,e={}){let r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}s(TA,"featureCollection");function IA(t,e,r={}){return wA({type:"MultiLineString",coordinates:t},e,r)}s(IA,"multiLineString");m();function Om(t){return t.type==="Feature"?t.geometry:t}s(Om,"getGeom");function oj(t,e={}){let r=Om(t);switch(!e.properties&&t.type==="Feature"&&(e.properties=t.properties),r.type){case"Polygon":return aj(r,e);case"MultiPolygon":return sj(r,e);default:throw new Error("invalid poly")}}s(oj,"polygonToLine");function aj(t,e={}){let i=Om(t).coordinates,n=e.properties?e.properties:t.type==="Feature"?t.properties:{};return CA(i,n)}s(aj,"singlePolygonToLine");function sj(t,e={}){let i=Om(t).coordinates,n=e.properties?e.properties:t.type==="Feature"?t.properties:{},o=[];return i.forEach(a=>{o.push(CA(a,n))}),TA(o)}s(sj,"multiPolygonToLine");function CA(t,e){return t.length>1?IA(t,e):SA(t[0],e)}s(CA,"coordsToLine");var Y0=oj;m();function MA(t){t&&(t.map&&(t.map.dispose(),t.map=void 0),t.dispose())}s(MA,"scrubMaterial");function J0(t){for(;t.children.length>0;)J0(t.children[0]);"geometry"in t&&t.geometry&&t.geometry.dispose(),"material"in t&&Array.isArray(t.material)?t.material.forEach(function(e){MA(e)}):"material"in t&&typeof t.material<"u"&&MA(t.material),t.parent&&t.parent.remove(t)}s(J0,"destroyObject3D");m();function AA(t){return t!=null&&t.geometry.type==="Polygon"&&t.geometry.coordinates[0].length>2}s(AA,"isValidPolygon");function lj(t,e){let r=t[0]*e[0]+t[1]*e[1],i=Math.sqrt(t[0]*t[0]+t[1]*t[1]),n=Math.sqrt(e[0]*e[0]+e[1]*e[1]);if(i===0||n===0)return 0;let o=r/(i*n),a=Math.max(-1,Math.min(1,o));return Math.acos(a)*(180/Math.PI)}s(lj,"calculateAngle");function uj(t,e=5){if(t.length<3)return t;let r=t.length>3&&t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1],i=[],n=r?t.length-1:t.length;for(let o=0;o<n;o++){let a=r&&o===0?t[t.length-2]:t[o-1],l=t[o],c=r&&o===t.length-1?t[1]:t[o+1];if(a==null||c==null){i.push(l);continue}let u=[l[0]-a[0],l[1]-a[1]],p=[c[0]-l[0],c[1]-l[1]];lj(u,p)>e&&i.push(l)}if(r&&i.length>0){let o=i[0],a=i[i.length-1];(o[0]!==a[0]||o[1]!==a[1])&&i.push([o[0],o[1]])}return i}s(uj,"filterVerticesByAngle");function EA(t,e=5){return j(C({},t),{geometry:j(C({},t.geometry),{coordinates:t.geometry.coordinates.map(r=>uj(r,e))})})}s(EA,"filterPolygonVerticesByAngle");var LA=.1,cj=15,pj=.25,K0=class K0{constructor(e,r){S(this,"rendererState");S(this,"dirty",!1);S(this,"convertTo3DMapPosition");S(this,"colorToMaterialCache",{});this.rendererState=e,this.convertTo3DMapPosition=r}update(){var n,o,a;let e,r,i;for(let l of this.rendererState.geometry3DsInScene)if(i=l.components[0],e=l.components[1],r=l.components[5],l.type==="geometry"&&i instanceof vn&&r!=null){if(r!=null&&r.dirty){if(r.mesh==null)try{if(!AA(i.feature))continue;let c=this.buildBorder(i.feature,e,r);(n=i.mesh)==null||n.add(c)}catch(c){nt.error(c),r.dirty=!1}(o=r.mesh)==null||o.children.forEach(c=>{r&&c.material.color.set(e.borderColor)}),r.dirty=!1,r.visible=e.borderVisible}if(r!=null&&r.needsRebuild){J0(r.mesh);try{let c=this.buildBorder(i.feature,e,r);(a=i.mesh)==null||a.add(c)}catch(c){nt.error(c)}r.needsRebuild=!1,r.visible=e.borderVisible}}}buildBorder(e,r,i){var v,w,T;let n=Y0(e),o=EA(e,cj),a=Y0(o),l=r.borderWidth/2,c=r.borderColor,u=W0(n,this.convertTo3DMapPosition,{width:l,height:l,color:c,cap:"square"}),p=u.clone();p.translate(0,0,r.height);let f;a.geometry.type==="LineString"?f=a.geometry.coordinates:f=a.geometry.coordinates.flat();let h=[];f.pop();for(let A of f||[])try{let k=W0({type:"Feature",geometry:{type:"LineString",coordinates:[[A[0],A[1],0],[A[0],A[1],r.height]]},properties:{}},this.convertTo3DMapPosition,{width:l,height:l,color:c,cap:"butt"});h.push(k)}catch(k){nt.warn(k)}let y=Bl([u,p,...h]),g=(v=this.colorToMaterialCache[c])==null?void 0:v[0];g==null&&(g=new Cn({color:c}));let x=(w=this.colorToMaterialCache[c])==null?void 0:w[1];x==null&&(x=new Cn({color:c})),this.colorToMaterialCache[c]=[g,x];let _=new ht,P=new Kr(y,g),I=new Kr(y,x);return _.add(P),_.add(I),I.material.depthWrite=!1,I.material.depthTest=!1,I.material.opacity=pj,I.material.transparent=!0,_.position.z=(T=r.altitude)!=null?T:0,i.mesh=_,_}destroy(){for(let[e,[r,i]]of Object.entries(this.colorToMaterialCache))r.dispose(),i.dispose();this.colorToMaterialCache={}}};s(K0,"BorderSystem");var kA=K0;var Q0="#ffffff",mj=.1,Rm=.1,fj="#333333",Ll,Dl,zl,t1=class t1{constructor(e={}){S(this,"type","style");S(this,"initialColor",Q0);hr(this,Ll,Q0);S(this,"initialTopColor");hr(this,Dl);hr(this,zl);S(this,"dirty",!0);S(this,"visible",!0);S(this,"opacity",1);S(this,"width",mj);S(this,"height",Rm);S(this,"initialHeight",Rm);S(this,"altitude",0);S(this,"join","round");S(this,"cap","round");S(this,"showImage",!0);S(this,"flipImageToFaceCamera",!0);S(this,"enableImageCollisions",!1);S(this,"url");S(this,"side","double");S(this,"renderOrder",0);S(this,"shading");S(this,"bevel");S(this,"borderVisible",!1);S(this,"borderColor",fj);S(this,"borderWidth");this.color=(e==null?void 0:e.color)!==void 0?e.color:this.color,this.initialColor=this.color,this.width=(e==null?void 0:e.width)!==void 0?e.width:this.width,this.opacity=(e==null?void 0:e.opacity)!==void 0?e.opacity:this.opacity,this.visible=(e==null?void 0:e.visible)!==void 0?e.visible:this.visible,this.height=(e==null?void 0:e.height)!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=(e==null?void 0:e.altitude)!==void 0?e.altitude:this.altitude,this.join=(e==null?void 0:e.join)!==void 0?e.join:this.join,this.cap=(e==null?void 0:e.cap)!==void 0?e.cap:this.cap,this.topColor=e==null?void 0:e.topColor,this.initialTopColor=this.topColor,this.showImage=(e==null?void 0:e.showImage)!==void 0?e.showImage:this.showImage,this.flipImageToFaceCamera=(e==null?void 0:e.flipImageToFaceCamera)!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=e==null?void 0:e.url,this.side=(e==null?void 0:e.side)!==void 0?e.side:this.side,this.renderOrder=(e==null?void 0:e.renderOrder)!==void 0?e.renderOrder:this.renderOrder,this.shading=e==null?void 0:e.shading,this.bevel=e==null?void 0:e.bevel,this.borderVisible=(e==null?void 0:e.borderVisible)!==void 0?e.borderVisible:this.borderVisible,this.borderColor=(e==null?void 0:e.borderColor)!==void 0?e.borderColor:this.borderColor,this.borderWidth=(e==null?void 0:e.borderWidth)!==void 0?e.borderWidth:LA,this.enableImageCollisions=(e==null?void 0:e.enableImageCollisions)!==void 0?e.enableImageCollisions:this.enableImageCollisions}set color(e){$l(e)?dr(this,Ll,e):nt.warn('Failed to update color. Invalid color "'.concat(e,'".'))}get color(){return At(this,Ll)}set topColor(e){e===void 0||$l(e)?dr(this,Dl,e):nt.warn('Failed to update top color. Invalid color "'.concat(e,'".'))}get topColor(){return At(this,Dl)}set hoverColor(e){$l(e)?dr(this,zl,e):nt.warn('Failed to update hover color. Invalid color "'.concat(e,'".'))}get hoverColor(){return At(this,zl)}};Ll=new WeakMap,Dl=new WeakMap,zl=new WeakMap,s(t1,"StyleComponent");var e1=t1;var r1=class r1 extends S1{constructor(){super(...arguments);S(this,"type","entityBatchedMesh");S(this,"userData",{entities:{}})}};s(r1,"EntityBatchedMesh");var Oo=r1,Ol,bi,n1=class n1{constructor(e){S(this,"mesh");S(this,"imageMesh");S(this,"textMesh");S(this,"textEntityId");S(this,"type","geometry");S(this,"dirty",!0);S(this,"shouldDetach",!1);S(this,"detached",!1);S(this,"instanceIndex",-1);S(this,"geometry");S(this,"batchedProps");S(this,"material");S(this,"feature");S(this,"currentHeight",Rm);S(this,"color",new Yt);S(this,"topColor",new Yt);S(this,"position",new Ze);S(this,"altitude",0);hr(this,Ol,1);hr(this,bi);this.feature=e}get visible(){return this.mesh&&this.instanceIndex!==-1?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.instanceIndex!==-1&&this.mesh.setVisibleAt(this.instanceIndex,e)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(e){this.mesh&&(this.mesh.renderOrder=e)}setColor(e,r){this.color.set(e),this.topColor.set(r),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var e;return(e=this.material)==null?void 0:e.getColor(this.instanceIndex)}get opacity(){return At(this,Ol)}set opacity(e){if(this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),this.imageMesh){let r=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let i of r)i.opacity=e,i.needsUpdate=!0}dr(this,Ol,e)}get featureBbox(){return At(this,bi)?At(this,bi):(dr(this,bi,MI(this.feature)),At(this,bi))}};Ol=new WeakMap,bi=new WeakMap,s(n1,"MeshComponent");var vn=n1;var i1=class i1 extends ht{constructor(r){super();S(this,"visible",!0);S(this,"type","geometry-group");S(this,"components",[]);S(this,"userData",{entityId:"",entities3D:new Set,dirty:!0,shadingDirty:!0});this.userData.entityId=r}getComponent(r){return this.components.find(i=>(i==null?void 0:i.type)===r)}setVisible(r){this.visible!==r&&(this.visible=r,this.dispatchEvent({type:"childremoved",child:this}))}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let r;for(let n of this.children)if(!n.userData.detached){r=n;break}return r instanceof Oo?Object.values(r.userData.entities)[0]:void 0}};s(i1,"GeometryGroupObject3D");var Tt=i1;var Bo=class Bo extends ht{constructor(r){super();S(this,"childrenIds",new Set);S(this,"children",[]);S(this,"type","group-container");S(this,"userData",{entityId:"",entities2D:new Set,dirty:!0,occluderDirty:!1,opacity:1,computedOpacity:1,preloadGeometry:!1});S(this,"components",[]);this.userData.entityId=r}getComponent(){}addOccluderFeature(r,i){this.userData.occluderFeature=r,this.userData.occluderId=i,this.userData.occluderDirty=!0}addEntity(r){r instanceof Bo?(this.childrenIds.add(r.userData.entityId),this.add(r)):r instanceof Yr?(this.childrenIds.add(r.id),this.add(r.object3d),this.userData.entities2D.add(r.id),r.positionDirty=!0):r instanceof Tt?(this.childrenIds.add(r.userData.entityId),this.add(r)):r instanceof $t&&r.object3d&&(this.childrenIds.add(r.id),this.add(r.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(r){r instanceof Bo?(this.childrenIds.delete(r.userData.entityId),this.remove(r)):r instanceof Yr?(this.childrenIds.delete(r.id),this.userData.entities2D.delete(r.id),this.remove(r.object3d)):r instanceof Tt?(this.childrenIds.delete(r.userData.entityId),this.remove(r)):r instanceof $t&&r.object3d&&(this.childrenIds.delete(r.id),this.add(r.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(r){this.visible!==r&&(this.visible=r,this.dispatchEvent({type:"childremoved",child:this}))}setAltitude(r){if(this.position.z!==r){let i=!1;this.matrixWorldAutoUpdate===!1&&(i=!0,xi(this)),this.position.z=r,this.updateMatrixWorld(),i&&_i(this),this.dispatchEvent({type:"childremoved",child:this}),this.set2DGeometryChildrenPositionDirty()}}set2DGeometryChildrenPositionDirty(){this.children.forEach(r=>{r instanceof Er?r.userData.worldPositionDirty=!0:r instanceof Bo&&r.set2DGeometryChildrenPositionDirty()})}get altitude(){return this.position.z}setOpacity(r){this.userData.opacity=r}get opacity(){return this.userData.opacity}};s(Bo,"GroupContainerObject3D");var It=Bo;m();function hj(t){let e=t.min,r=t.max,i=new Ze(e.x,e.y,e.z),n=new Ze(r.x,e.y,e.z),o=new Ze(e.x,r.y,e.z),a=new Ze(r.x,r.y,e.z);return[i,n,o,a]}s(hj,"getCornersOfBoundingBox");m();function DA(t,e){let r;return typeof e=="string"||typeof e=="number"?(r=t.geometry2DMap.get(e),r==null&&(r=t.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(r=t.geometry2DMap.get(e.id),r==null&&(r=t.geometry3DMap.get(e.id))):r=e,r}s(DA,"getGeometryByGeometryId");function w4e(t,e,r=[],i=new Gm,n){(t.getSystems().renderSystem.threeDdirty||t.getSystems().renderSystem.twoDdirty)&&t.renderSync();let o=DA(t.getInternalState(),e);return zA(o,r,i,n),r}s(w4e,"getVerticesOfEntity");var Fm=new Ze;function zA(t,e=[],r=new Gm,i){if(t.visible){if(t.isMesh||t.isLine||t.isPoints){let n=t.geometry;if(n.isBufferGeometry){let o=n.attributes.position;for(let a=0;a<o.count;a++)Fm.fromBufferAttribute(o,a),i!==void 0&&(Fm.z=i),e.push(Fm.clone()),r.expandByPoint(Fm)}}for(let n of t.children)zA(n,e,r,i)}}s(zA,"traverse");m();function dj(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}s(dj,"getPixelRatio");m();function Al(t,e){let r={};for(let i=0;i<e.length;i++){let n=e[i];n in t&&(r[n]=t[n])}return r}s(Al,"pick");function j0(t){return Object.keys(t).length===0}s(j0,"isEmpty");m();function Y4e(t,e,r,i){let n=t*(Math.PI/180),o=i/vi,a=t+o*180/Math.PI,l=r/vi/Math.cos(n),c=e+l*180/Math.PI;return{lat:a,lon:c}}s(Y4e,"cartesianToGeographic");function J4e(t,e,r,i){let n=r*(Math.PI/180),o=i*(Math.PI/180),a=t*(Math.PI/180),l=e*(Math.PI/180),c=n-a,u=o-l,p=vi*u*Math.cos(a),f=vi*c;return{x:p,y:f}}s(J4e,"geographicToCartesian");var yj=s(()=>{},"noopFn");function xi(t,e=!1){e?t.traverse(r=>{xi(r)}):(t.matrixWorldAutoUpdate=!0,t.updateMatrixWorld=ht.prototype.updateMatrixWorld)}s(xi,"markAsDynamic");function _i(t,e=!1){e?t.traverse(r=>{_i(r)}):(t.matrixWorldAutoUpdate=!1,t.updateMatrixWorld=yj)}s(_i,"markAsStatic");var gj=s((t,e,r,i,n,o=!1)=>{var c;let a=t instanceof It&&t.userData.preloadGeometry,l=o||a&&!t.visible;if(t.children&&(t.visible||a)){xi(t);for(let u of t.children){if(u.visible&&u.type&&!l)if(xi(u),"entities3D"in u.userData&&((c=u.userData)!=null&&c.entities3D)&&u instanceof Tt){r.add(u.userData.entityId),i.add(u);for(let p of u.userData.entities3D.values())r.add(p),e.has(p)&&i.add(e.get(p))}else u.type==="group-container"||u.type==="custom-geometry"?(r.add(u.userData.entityId),i.add(u)):u instanceof hi&&(r.add(u.userData.entityId),e.has(u.userData.entityId)&&i.add(e.get(u.userData.entityId)));else _i(u);u instanceof Tt&&u.userData.dirty&&n.add(u.userData.entityId),gj(u,e,r,i,n,l)}}else _i(t);return r},"populateGeometry3DIdsInScene"),bj=s((t,e,r,i)=>{var n;if(t.children&&t.visible&&!((n=t.userData)!=null&&n.hidden)){xi(t);for(let o of t.children)o instanceof Er&&(o.visible?(xi(o),r.add(o.userData.entityId),e.has(o.userData.entityId)&&i.add(e.get(o.userData.entityId))):_i(o)),bj(o,e,r,i)}else _i(t);return r},"populateGeometry2DIdsInScene");function G0(t,e){for(let r in e)if(!(r==="__proto__"||r==="constructor"||r==="prototype")){if(e[r]==null){t[r]=void 0;continue}Array.isArray(e[r])?t[r]=e[r]:typeof e[r]=="object"&&typeof t[r]=="object"&&t[r]!==null&&!Array.isArray(t[r])?G0(t[r],e[r]):t[r]=e[r]}return t}s(G0,"mergeObjects");function K4e(t,e,r){let i={translateX:t.x,translateY:t.y,translateZ:t.z,scale:t.meterInMercatorCoordinateUnits()},n=new In,o=new Ze(i.scale,-i.scale,i.scale),a=new In().makeTranslation(i.translateX,i.translateY,i.translateZ).scale(o);return{id:iA,type:"custom",renderingMode:"3d",render:s((l,c)=>{n.fromArray(c.defaultProjectionData.mainMatrix),e.projectionMatrix=n.multiply(a),r()},"render")}}s(K4e,"createCustomLayer");function Q4e(t,e=0){let r=3735928559^e,i=1103547991^e;for(let n=0,o;n<t.length;n++)o=t.charCodeAt(n),r=Math.imul(r^o,2654435761),i=Math.imul(i^o,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&i)+(r>>>0)}s(Q4e,"cyrb53");function eUe(t,e,r){let i=t*(Math.PI/180)/2,n=e/2;return r*Math.tan(i)/n}s(eUe,"getProjectionScaleFactor");function tUe(t){return new ut(new ne(t[0][0],t[0][1]),new ne(t[1][0],t[1][1])).getCenter().toArray()}s(tUe,"getBoundingBoxCenter");function rUe(t,e){return t<e||e<=12}s(rUe,"shouldExpandZoomLevel");function nUe(t){let e=1;return t.type==="geometry-group"&&t.parent!=null&&t.parent instanceof It?e=t.parent.userData.computedOpacity:(t.type==="geometry"||t.type==="custom-geometry"||t.type==="model")&&t.parentObject3D!=null&&t.parentObject3D instanceof Tt&&t.parentObject3D.parent!=null&&t.parentObject3D.parent instanceof It&&(e=t.parentObject3D.parent.userData.computedOpacity),e}s(nUe,"getGroupContainerOpacity");function iUe(t,e,r=1e-10){if(t.length!==e.length)return!1;let i=Math.abs(t[0]-e[0])<r,n=Math.abs(t[1]-e[1])<r;if(t.length===3&&e.length===3){let o=Math.abs(t[2]-e[2])<r;return i&&n&&o}return i&&n}s(iUe,"coordinatesEqual");var xj="maplibre-frustum-culling-hack";function oUe(){let t=new P1(.01,.01,.01),e=new Cn({opacity:0,depthWrite:!1,transparent:!0}),r=new Kr(t,e);return r.position.copy(new Ze(0,50,0)),r.frustumCulled=!1,r.name=xj,r}s(oUe,"maplibreFrustrumCullHack");var Sn=new Ze,OA=new Lr;function aUe(t,e,r=new Fl){return t.updateMatrixWorld(),t.traverse(i=>{if(i instanceof Kr){let o=i.geometry.attributes.position;if(e.position.distanceTo(i.position)<e.near)return;for(let l=0;l<o.count;l++)Sn.fromBufferAttribute(o,l),Sn.applyMatrix4(i.matrixWorld),Sn.applyMatrix4(e.matrixWorldInverse),Sn.applyMatrix4(e.projectionMatrix),Sn.z<1&&Sn.z>0&&(OA.set(Sn.x,Sn.y),r.expandByPoint(OA))}}),r}s(aUe,"projectToBox2D");function RA(t,e){let r=e.clientWidth,i=e.clientHeight;return new Lr((t.x+1)*r/2,(1-t.y)*i/2)}s(RA,"ndcToScreen");function sUe(t,e,r){let i=document.createElement("div");i.style.position="absolute",i.style.border="2px solid ".concat(e),i.style.pointerEvents="none";let n=RA(new Lr(t.min.x,t.min.y),r),o=RA(new Lr(t.max.x,t.max.y),r);i.style.left="".concat(n.x,"px"),i.style.top="".concat(o.y,"px");let a=Math.abs(o.x-n.x),l=Math.abs(o.y-n.y);return i.style.width="".concat(a,"px"),i.style.height="".concat(l,"px"),r.appendChild(i),i}s(sUe,"drawProjectedBox");function lUe(t,e){let r=0,i=0,n=t.clientWidth,o=t.clientHeight;if(e){let{left:a,top:l,right:c,bottom:u,type:p}=e,f=a!=null?a:0,h=l!=null?l:0,y=c!=null?c:0,g=u!=null?u:0;p==="portion"?(r=f*n,i=h*o,n=n-r-y*n,o=o-i-g*o):(r=f,i=h,n=n-r-y,o=o-i-g)}return[r,i,n,o].map(a=>Math.max(a,0))}s(lUe,"rectFromScreenOffsets");function V0(t){return(t*100|0)/100}s(V0,"fastTrunc");m();var a1=class a1{constructor(e){S(this,"type","text3dStyle");S(this,"visible");S(this,"altitude");S(this,"color");S(this,"dirty",!0);S(this,"maxWidth");S(this,"maxHeight");S(this,"hoverByPolygon");S(this,"flipToFaceCamera",FA.flipToFaceCamera);S(this,"font");S(this,"fillOpacity");S(this,"fontSize");S(this,"margin");S(this,"outlineWidth");S(this,"outlineBlur");S(this,"outlineOffsetX");S(this,"strokeColor");S(this,"strokeOpacity");S(this,"strokeWidth");S(this,"hoverColor");S(this,"outlineOffsetY");S(this,"outlineColor");S(this,"outlineOpacity");e&&Object.assign(this,e)}getState(e=!1){let r={};for(let i in this)!e&&i==="dirty"||this[i]!==void 0&&(r[i]=this[i]);return r}};s(a1,"Text3DStyleComponent");var o1=a1,FA=Object.freeze({visible:!0,color:"black",flipToFaceCamera:!0,fillOpacity:1,font:void 0,fontSize:2,margin:[.2,1,.2,1.5],outlineColor:"black",outlineOpacity:1,outlineWidth:0,outlineOffsetX:0,outlineOffsetY:0,outlineBlur:0,strokeOpacity:1,strokeWidth:0,maxWidth:void 0,maxHeight:void 0,strokeColor:"black",hoverColor:void 0});m();m();var l1=class l1{constructor(e){S(this,"type","modelStyle");S(this,"dirty",!0);S(this,"visible",!0);S(this,"opacity",1);S(this,"verticalOffset",0);S(this,"interactive",!1);S(this,"color");S(this,"material");S(this,"rotation");S(this,"scale");S(this,"visibleThroughGeometry",!1);S(this,"clippingPlaneZOffset",1/0);S(this,"clippingPlaneTopColor");S(this,"clippingPlaneTopVisible",!0);e&&Object.assign(this,e)}};s(l1,"ModelStyleComponnet");var s1=l1;m();var _j=[1,1,1],vj=[0,0,0];export{Je as a,yF as b,fn as c,gF as d,c2e as e,bF as f,p2e as g,m2e as h,f2e as i,x2e as j,_2e as k,CI as l,VA as m,nt as n,vi as o,ZA as p,XA as q,Wj as r,Yj as s,Jj as t,HA as u,qA as v,n5 as w,s5 as x,Dr as y,Vo as z,$l as A,D1 as B,tE as C,w5 as D,nE as E,S5 as F,D as G,dU as H,FOe as I,rRe as J,gM as K,MRe as L,YM as M,Yr as N,hi as O,$t as P,wFe as Q,SFe as R,oA as S,TFe as T,IFe as U,hj as V,DA as W,w4e as X,dj as Y,Vl as Z,Y4e as _,J4e as $,xi as aa,gj as ba,bj as ca,K4e as da,Q4e as ea,eUe as fa,tUe as ga,rUe as ha,nUe as ia,iUe as ja,oUe as ka,aUe as la,sUe as ma,lUe as na,V0 as oa,o1 as pa,FA as qa,s1 as ra,_j as sa,vj as ta,KM as ua,tFe as va,wm as wa,Sm as xa,Il as ya,jFe as za,R0 as Aa,GFe as Ba,Im as Ca,Cm as Da,Em as Ea,Ml as Fa,ABe as Ga,EBe as Ha,kBe as Ia,e6 as Ja,aA as Ka,LBe as La,DBe as Ma,zBe as Na,OBe as Oa,RBe as Pa,lA as Qa,FBe as Ra,BBe as Sa,UBe as Ta,NBe as Ua,cA as Va,r6 as Wa,$Be as Xa,n6 as Ya,VBe as Za,jBe as _a,i6 as $a,o6 as ab,GBe as bb,ZBe as cb,a6 as db,XBe as eb,HBe as fb,s6 as gb,qBe as hb,WBe as ib,YBe as jb,JBe as kb,Jr as lb,W0 as mb,J0 as nb,kA as ob,Q0 as pb,e1 as qb,Oo as rb,vn as sb,Tt as tb,It as ub};