suerprisePlus
2024-06-14 c3be71b180ea95f7928bdffccbec0525911eca9d
1
(()=>{var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__markAsModule=e=>__defProp(e,"__esModule",{value:!0}),__commonJS=(e,n)=>function(){return n||(0,e[Object.keys(e)[0]])((n={exports:{}}).exports,n),n.exports},__reExport=(e,n,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of __getOwnPropNames(n))!__hasOwnProp.call(e,r)&&r!=="default"&&__defProp(e,r,{get:()=>n[r],enumerable:!(t=__getOwnPropDesc(n,r))||t.enumerable});return e},__toModule=e=>__reExport(__markAsModule(__defProp(e!=null?__create(__getProtoOf(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),require_ieee754=__commonJS({"../../node_modules/ieee754/index.js"(e){e.read=function(n,t,r,o,u){var a,h,f=u*8-o-1,d=(1<<f)-1,g=d>>1,F=-7,_=r?u-1:0,p=r?-1:1,w=n[t+_];for(_+=p,a=w&(1<<-F)-1,w>>=-F,F+=f;F>0;a=a*256+n[t+_],_+=p,F-=8);for(h=a&(1<<-F)-1,a>>=-F,F+=o;F>0;h=h*256+n[t+_],_+=p,F-=8);if(a===0)a=1-g;else{if(a===d)return h?NaN:(w?-1:1)*(1/0);h=h+Math.pow(2,o),a=a-g}return(w?-1:1)*h*Math.pow(2,a-o)},e.write=function(n,t,r,o,u,a){var h,f,d,g=a*8-u-1,F=(1<<g)-1,_=F>>1,p=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=o?0:a-1,V=o?1:-1,O=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,h=F):(h=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-h))<1&&(h--,d*=2),h+_>=1?t+=p/d:t+=p*Math.pow(2,1-_),t*d>=2&&(h++,d/=2),h+_>=F?(f=0,h=F):h+_>=1?(f=(t*d-1)*Math.pow(2,u),h=h+_):(f=t*Math.pow(2,_-1)*Math.pow(2,u),h=0));u>=8;n[r+w]=f&255,w+=V,f/=256,u-=8);for(h=h<<u|f,g+=u;g>0;n[r+w]=h&255,w+=V,h/=256,g-=8);n[r+w-V]|=O*128}}}),require_pbf=__commonJS({"../../node_modules/pbf/index.js"(e,n){"use strict";n.exports=r;var t=require_ieee754();function r(s){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(s)?s:new Uint8Array(s||0),this.pos=0,this.type=0,this.length=this.buf.length}r.Varint=0,r.Fixed64=1,r.Bytes=2,r.Fixed32=5;var o=65536*65536,u=1/o,a=12,h=typeof TextDecoder>"u"?null:new TextDecoder("utf8");r.prototype={destroy:function(){this.buf=null},readFields:function(s,l,c){for(c=c||this.length;this.pos<c;){var P=this.readVarint(),v=P>>3,m=this.pos;this.type=P&7,s(v,l,this),this.pos===m&&this.skip(P)}return l},readMessage:function(s,l){return this.readFields(s,l,this.readVarint()+this.pos)},readFixed32:function(){var s=I(this.buf,this.pos);return this.pos+=4,s},readSFixed32:function(){var s=j(this.buf,this.pos);return this.pos+=4,s},readFixed64:function(){var s=I(this.buf,this.pos)+I(this.buf,this.pos+4)*o;return this.pos+=8,s},readSFixed64:function(){var s=I(this.buf,this.pos)+j(this.buf,this.pos+4)*o;return this.pos+=8,s},readFloat:function(){var s=t.read(this.buf,this.pos,!0,23,4);return this.pos+=4,s},readDouble:function(){var s=t.read(this.buf,this.pos,!0,52,8);return this.pos+=8,s},readVarint:function(s){var l=this.buf,c,P;return P=l[this.pos++],c=P&127,P<128||(P=l[this.pos++],c|=(P&127)<<7,P<128)||(P=l[this.pos++],c|=(P&127)<<14,P<128)||(P=l[this.pos++],c|=(P&127)<<21,P<128)?c:(P=l[this.pos],c|=(P&15)<<28,f(c,s,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var s=this.readVarint();return s%2===1?(s+1)/-2:s/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var s=this.readVarint()+this.pos,l=this.pos;return this.pos=s,s-l>=a&&h?G(this.buf,l,s):U(this.buf,l,s)},readBytes:function(){var s=this.readVarint()+this.pos,l=this.buf.subarray(this.pos,s);return this.pos=s,l},readPackedVarint:function(s,l){if(this.type!==r.Bytes)return s.push(this.readVarint(l));var c=d(this);for(s=s||[];this.pos<c;)s.push(this.readVarint(l));return s},readPackedSVarint:function(s){if(this.type!==r.Bytes)return s.push(this.readSVarint());var l=d(this);for(s=s||[];this.pos<l;)s.push(this.readSVarint());return s},readPackedBoolean:function(s){if(this.type!==r.Bytes)return s.push(this.readBoolean());var l=d(this);for(s=s||[];this.pos<l;)s.push(this.readBoolean());return s},readPackedFloat:function(s){if(this.type!==r.Bytes)return s.push(this.readFloat());var l=d(this);for(s=s||[];this.pos<l;)s.push(this.readFloat());return s},readPackedDouble:function(s){if(this.type!==r.Bytes)return s.push(this.readDouble());var l=d(this);for(s=s||[];this.pos<l;)s.push(this.readDouble());return s},readPackedFixed32:function(s){if(this.type!==r.Bytes)return s.push(this.readFixed32());var l=d(this);for(s=s||[];this.pos<l;)s.push(this.readFixed32());return s},readPackedSFixed32:function(s){if(this.type!==r.Bytes)return s.push(this.readSFixed32());var l=d(this);for(s=s||[];this.pos<l;)s.push(this.readSFixed32());return s},readPackedFixed64:function(s){if(this.type!==r.Bytes)return s.push(this.readFixed64());var l=d(this);for(s=s||[];this.pos<l;)s.push(this.readFixed64());return s},readPackedSFixed64:function(s){if(this.type!==r.Bytes)return s.push(this.readSFixed64());var l=d(this);for(s=s||[];this.pos<l;)s.push(this.readSFixed64());return s},skip:function(s){var l=s&7;if(l===r.Varint)for(;this.buf[this.pos++]>127;);else if(l===r.Bytes)this.pos=this.readVarint()+this.pos;else if(l===r.Fixed32)this.pos+=4;else if(l===r.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+l)},writeTag:function(s,l){this.writeVarint(s<<3|l)},realloc:function(s){for(var l=this.length||16;l<this.pos+s;)l*=2;if(l!==this.length){var c=new Uint8Array(l);c.set(this.buf),this.buf=c,this.length=l}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(s){this.realloc(4),k(this.buf,s,this.pos),this.pos+=4},writeSFixed32:function(s){this.realloc(4),k(this.buf,s,this.pos),this.pos+=4},writeFixed64:function(s){this.realloc(8),k(this.buf,s&-1,this.pos),k(this.buf,Math.floor(s*u),this.pos+4),this.pos+=8},writeSFixed64:function(s){this.realloc(8),k(this.buf,s&-1,this.pos),k(this.buf,Math.floor(s*u),this.pos+4),this.pos+=8},writeVarint:function(s){if(s=+s||0,s>268435455||s<0){F(s,this);return}this.realloc(4),this.buf[this.pos++]=s&127|(s>127?128:0),!(s<=127)&&(this.buf[this.pos++]=(s>>>=7)&127|(s>127?128:0),!(s<=127)&&(this.buf[this.pos++]=(s>>>=7)&127|(s>127?128:0),!(s<=127)&&(this.buf[this.pos++]=s>>>7&127)))},writeSVarint:function(s){this.writeVarint(s<0?-s*2-1:s*2)},writeBoolean:function(s){this.writeVarint(!!s)},writeString:function(s){s=String(s),this.realloc(s.length*4),this.pos++;var l=this.pos;this.pos=W(this.buf,s,this.pos);var c=this.pos-l;c>=128&&w(l,c,this),this.pos=l-1,this.writeVarint(c),this.pos+=c},writeFloat:function(s){this.realloc(4),t.write(this.buf,s,this.pos,!0,23,4),this.pos+=4},writeDouble:function(s){this.realloc(8),t.write(this.buf,s,this.pos,!0,52,8),this.pos+=8},writeBytes:function(s){var l=s.length;this.writeVarint(l),this.realloc(l);for(var c=0;c<l;c++)this.buf[this.pos++]=s[c]},writeRawMessage:function(s,l){this.pos++;var c=this.pos;s(l,this);var P=this.pos-c;P>=128&&w(c,P,this),this.pos=c-1,this.writeVarint(P),this.pos+=P},writeMessage:function(s,l,c){this.writeTag(s,r.Bytes),this.writeRawMessage(l,c)},writePackedVarint:function(s,l){l.length&&this.writeMessage(s,V,l)},writePackedSVarint:function(s,l){l.length&&this.writeMessage(s,O,l)},writePackedBoolean:function(s,l){l.length&&this.writeMessage(s,C,l)},writePackedFloat:function(s,l){l.length&&this.writeMessage(s,N,l)},writePackedDouble:function(s,l){l.length&&this.writeMessage(s,z,l)},writePackedFixed32:function(s,l){l.length&&this.writeMessage(s,A,l)},writePackedSFixed32:function(s,l){l.length&&this.writeMessage(s,S,l)},writePackedFixed64:function(s,l){l.length&&this.writeMessage(s,B,l)},writePackedSFixed64:function(s,l){l.length&&this.writeMessage(s,M,l)},writeBytesField:function(s,l){this.writeTag(s,r.Bytes),this.writeBytes(l)},writeFixed32Field:function(s,l){this.writeTag(s,r.Fixed32),this.writeFixed32(l)},writeSFixed32Field:function(s,l){this.writeTag(s,r.Fixed32),this.writeSFixed32(l)},writeFixed64Field:function(s,l){this.writeTag(s,r.Fixed64),this.writeFixed64(l)},writeSFixed64Field:function(s,l){this.writeTag(s,r.Fixed64),this.writeSFixed64(l)},writeVarintField:function(s,l){this.writeTag(s,r.Varint),this.writeVarint(l)},writeSVarintField:function(s,l){this.writeTag(s,r.Varint),this.writeSVarint(l)},writeStringField:function(s,l){this.writeTag(s,r.Bytes),this.writeString(l)},writeFloatField:function(s,l){this.writeTag(s,r.Fixed32),this.writeFloat(l)},writeDoubleField:function(s,l){this.writeTag(s,r.Fixed64),this.writeDouble(l)},writeBooleanField:function(s,l){this.writeVarintField(s,!!l)}};function f(s,l,c){var P=c.buf,v,m;if(m=P[c.pos++],v=(m&112)>>4,m<128||(m=P[c.pos++],v|=(m&127)<<3,m<128)||(m=P[c.pos++],v|=(m&127)<<10,m<128)||(m=P[c.pos++],v|=(m&127)<<17,m<128)||(m=P[c.pos++],v|=(m&127)<<24,m<128)||(m=P[c.pos++],v|=(m&1)<<31,m<128))return g(s,v,l);throw new Error("Expected varint not more than 10 bytes")}function d(s){return s.type===r.Bytes?s.readVarint()+s.pos:s.pos+1}function g(s,l,c){return c?l*4294967296+(s>>>0):(l>>>0)*4294967296+(s>>>0)}function F(s,l){var c,P;if(s>=0?(c=s%4294967296|0,P=s/4294967296|0):(c=~(-s%4294967296),P=~(-s/4294967296),c^4294967295?c=c+1|0:(c=0,P=P+1|0)),s>=18446744073709552e3||s<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");l.realloc(10),_(c,P,l),p(P,l)}function _(s,l,c){c.buf[c.pos++]=s&127|128,s>>>=7,c.buf[c.pos++]=s&127|128,s>>>=7,c.buf[c.pos++]=s&127|128,s>>>=7,c.buf[c.pos++]=s&127|128,s>>>=7,c.buf[c.pos]=s&127}function p(s,l){var c=(s&7)<<4;l.buf[l.pos++]|=c|((s>>>=3)?128:0),s&&(l.buf[l.pos++]=s&127|((s>>>=7)?128:0),s&&(l.buf[l.pos++]=s&127|((s>>>=7)?128:0),s&&(l.buf[l.pos++]=s&127|((s>>>=7)?128:0),s&&(l.buf[l.pos++]=s&127|((s>>>=7)?128:0),s&&(l.buf[l.pos++]=s&127)))))}function w(s,l,c){var P=l<=16383?1:l<=2097151?2:l<=268435455?3:Math.floor(Math.log(l)/(Math.LN2*7));c.realloc(P);for(var v=c.pos-1;v>=s;v--)c.buf[v+P]=c.buf[v]}function V(s,l){for(var c=0;c<s.length;c++)l.writeVarint(s[c])}function O(s,l){for(var c=0;c<s.length;c++)l.writeSVarint(s[c])}function N(s,l){for(var c=0;c<s.length;c++)l.writeFloat(s[c])}function z(s,l){for(var c=0;c<s.length;c++)l.writeDouble(s[c])}function C(s,l){for(var c=0;c<s.length;c++)l.writeBoolean(s[c])}function A(s,l){for(var c=0;c<s.length;c++)l.writeFixed32(s[c])}function S(s,l){for(var c=0;c<s.length;c++)l.writeSFixed32(s[c])}function B(s,l){for(var c=0;c<s.length;c++)l.writeFixed64(s[c])}function M(s,l){for(var c=0;c<s.length;c++)l.writeSFixed64(s[c])}function I(s,l){return(s[l]|s[l+1]<<8|s[l+2]<<16)+s[l+3]*16777216}function k(s,l,c){s[c]=l,s[c+1]=l>>>8,s[c+2]=l>>>16,s[c+3]=l>>>24}function j(s,l){return(s[l]|s[l+1]<<8|s[l+2]<<16)+(s[l+3]<<24)}function U(s,l,c){for(var P="",v=l;v<c;){var m=s[v],T=null,E=m>239?4:m>223?3:m>191?2:1;if(v+E>c)break;var L,D,Z;E===1?m<128&&(T=m):E===2?(L=s[v+1],(L&192)===128&&(T=(m&31)<<6|L&63,T<=127&&(T=null))):E===3?(L=s[v+1],D=s[v+2],(L&192)===128&&(D&192)===128&&(T=(m&15)<<12|(L&63)<<6|D&63,(T<=2047||T>=55296&&T<=57343)&&(T=null))):E===4&&(L=s[v+1],D=s[v+2],Z=s[v+3],(L&192)===128&&(D&192)===128&&(Z&192)===128&&(T=(m&15)<<18|(L&63)<<12|(D&63)<<6|Z&63,(T<=65535||T>=1114112)&&(T=null))),T===null?(T=65533,E=1):T>65535&&(T-=65536,P+=String.fromCharCode(T>>>10&1023|55296),T=56320|T&1023),P+=String.fromCharCode(T),v+=E}return P}function G(s,l,c){return h.decode(s.subarray(l,c))}function W(s,l,c){for(var P=0,v,m;P<l.length;P++){if(v=l.charCodeAt(P),v>55295&&v<57344)if(m)if(v<56320){s[c++]=239,s[c++]=191,s[c++]=189,m=v;continue}else v=m-55296<<10|v-56320|65536,m=null;else{v>56319||P+1===l.length?(s[c++]=239,s[c++]=191,s[c++]=189):m=v;continue}else m&&(s[c++]=239,s[c++]=191,s[c++]=189,m=null);v<128?s[c++]=v:(v<2048?s[c++]=v>>6|192:(v<65536?s[c++]=v>>12|224:(s[c++]=v>>18|240,s[c++]=v>>12&63|128),s[c++]=v>>6&63|128),s[c++]=v&63|128)}return c}}});function getPolygonSignedArea(e,n={}){const{start:t=0,end:r=e.length}=n,o=n.size||2;let u=0;for(let a=t,h=r-o;a<r;a+=o)u+=(e[a]-e[h])*(e[a+1]+e[h+1]),h=a;return u/2}function earcut(e,n,t=2,r){const o=n&&n.length,u=o?n[0]*t:e.length;let a=linkedList(e,0,u,t,!0,r&&r[0]);const h=[];if(!a||a.next===a.prev)return h;let f,d,g,F,_,p,w;if(o&&(a=eliminateHoles(e,n,a,t,r)),e.length>80*t){F=d=e[0],_=g=e[1];for(let V=t;V<u;V+=t)p=e[V],w=e[V+1],p<F&&(F=p),w<_&&(_=w),p>d&&(d=p),w>g&&(g=w);f=Math.max(d-F,g-_),f=f!==0?1/f:0}return earcutLinked(a,h,t,F,_,f),h}function linkedList(e,n,t,r,o,u){let a,h;if(u===void 0&&(u=getPolygonSignedArea(e,{start:n,end:t,size:r})),o===u<0)for(a=n;a<t;a+=r)h=insertNode(a,e[a],e[a+1],h);else for(a=t-r;a>=n;a-=r)h=insertNode(a,e[a],e[a+1],h);return h&&equals(h,h.next)&&(removeNode(h),h=h.next),h}function filterPoints(e,n){if(!e)return e;n||(n=e);let t=e,r;do if(r=!1,!t.steiner&&(equals(t,t.next)||area(t.prev,t,t.next)===0)){if(removeNode(t),t=n=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==n);return n}function earcutLinked(e,n,t,r,o,u,a){if(!e)return;!a&&u&&indexCurve(e,r,o,u);let h=e,f,d;for(;e.prev!==e.next;){if(f=e.prev,d=e.next,u?isEarHashed(e,r,o,u):isEar(e)){n.push(f.i/t),n.push(e.i/t),n.push(d.i/t),removeNode(e),e=d.next,h=d.next;continue}if(e=d,e===h){a?a===1?(e=cureLocalIntersections(filterPoints(e),n,t),earcutLinked(e,n,t,r,o,u,2)):a===2&&splitEarcut(e,n,t,r,o,u):earcutLinked(filterPoints(e),n,t,r,o,u,1);break}}}function isEar(e){const n=e.prev,t=e,r=e.next;if(area(n,t,r)>=0)return!1;let o=e.next.next;for(;o!==e.prev;){if(pointInTriangle(n.x,n.y,t.x,t.y,r.x,r.y,o.x,o.y)&&area(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function isEarHashed(e,n,t,r){const o=e.prev,u=e,a=e.next;if(area(o,u,a)>=0)return!1;const h=o.x<u.x?o.x<a.x?o.x:a.x:u.x<a.x?u.x:a.x,f=o.y<u.y?o.y<a.y?o.y:a.y:u.y<a.y?u.y:a.y,d=o.x>u.x?o.x>a.x?o.x:a.x:u.x>a.x?u.x:a.x,g=o.y>u.y?o.y>a.y?o.y:a.y:u.y>a.y?u.y:a.y,F=zOrder(h,f,n,t,r),_=zOrder(d,g,n,t,r);let p=e.prevZ,w=e.nextZ;for(;p&&p.z>=F&&w&&w.z<=_;){if(p!==e.prev&&p!==e.next&&pointInTriangle(o.x,o.y,u.x,u.y,a.x,a.y,p.x,p.y)&&area(p.prev,p,p.next)>=0||(p=p.prevZ,w!==e.prev&&w!==e.next&&pointInTriangle(o.x,o.y,u.x,u.y,a.x,a.y,w.x,w.y)&&area(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;p&&p.z>=F;){if(p!==e.prev&&p!==e.next&&pointInTriangle(o.x,o.y,u.x,u.y,a.x,a.y,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;w&&w.z<=_;){if(w!==e.prev&&w!==e.next&&pointInTriangle(o.x,o.y,u.x,u.y,a.x,a.y,w.x,w.y)&&area(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function cureLocalIntersections(e,n,t){let r=e;do{const o=r.prev,u=r.next.next;!equals(o,u)&&intersects(o,r,r.next,u)&&locallyInside(o,u)&&locallyInside(u,o)&&(n.push(o.i/t),n.push(r.i/t),n.push(u.i/t),removeNode(r),removeNode(r.next),r=e=u),r=r.next}while(r!==e);return filterPoints(r)}function splitEarcut(e,n,t,r,o,u){let a=e;do{let h=a.next.next;for(;h!==a.prev;){if(a.i!==h.i&&isValidDiagonal(a,h)){let f=splitPolygon(a,h);a=filterPoints(a,a.next),f=filterPoints(f,f.next),earcutLinked(a,n,t,r,o,u),earcutLinked(f,n,t,r,o,u);return}h=h.next}a=a.next}while(a!==e)}function eliminateHoles(e,n,t,r,o){const u=[];let a,h,f,d,g;for(a=0,h=n.length;a<h;a++)f=n[a]*r,d=a<h-1?n[a+1]*r:e.length,g=linkedList(e,f,d,r,!1,o&&o[a+1]),g===g.next&&(g.steiner=!0),u.push(getLeftmost(g));for(u.sort(compareX),a=0;a<u.length;a++)eliminateHole(u[a],t),t=filterPoints(t,t.next);return t}function compareX(e,n){return e.x-n.x}function eliminateHole(e,n){if(n=findHoleBridge(e,n),n){const t=splitPolygon(n,e);filterPoints(n,n.next),filterPoints(t,t.next)}}function findHoleBridge(e,n){let t=n;const r=e.x,o=e.y;let u=-1/0,a;do{if(o<=t.y&&o>=t.next.y&&t.next.y!==t.y){const _=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(_<=r&&_>u){if(u=_,_===r){if(o===t.y)return t;if(o===t.next.y)return t.next}a=t.x<t.next.x?t:t.next}}t=t.next}while(t!==n);if(!a)return null;if(r===u)return a;const h=a,f=a.x,d=a.y;let g=1/0,F;t=a;do r>=t.x&&t.x>=f&&r!==t.x&&pointInTriangle(o<d?r:u,o,f,d,o<d?u:r,o,t.x,t.y)&&(F=Math.abs(o-t.y)/(r-t.x),locallyInside(t,e)&&(F<g||F===g&&(t.x>a.x||t.x===a.x&&sectorContainsSector(a,t)))&&(a=t,g=F)),t=t.next;while(t!==h);return a}function sectorContainsSector(e,n){return area(e.prev,e,n.prev)<0&&area(n.next,e,e.next)<0}function indexCurve(e,n,t,r){let o=e;do o.z===null&&(o.z=zOrder(o.x,o.y,n,t,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,sortLinked(o)}function sortLinked(e){let n,t,r=1,o,u,a,h,f,d;do{for(u=e,e=null,d=null,o=0;u;){for(o++,h=u,a=0,t=0;t<r&&(a++,h=h.nextZ,!!h);t++);for(f=r;a>0||f>0&&h;)a!==0&&(f===0||!h||u.z<=h.z)?(n=u,u=u.nextZ,a--):(n=h,h=h.nextZ,f--),d?d.nextZ=n:e=n,n.prevZ=d,d=n;u=h}d.nextZ=null,r*=2}while(o>1);return e}function zOrder(e,n,t,r,o){return e=32767*(e-t)*o,n=32767*(n-r)*o,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e|n<<1}function getLeftmost(e){let n=e,t=e;do(n.x<t.x||n.x===t.x&&n.y<t.y)&&(t=n),n=n.next;while(n!==e);return t}function pointInTriangle(e,n,t,r,o,u,a,h){return(o-a)*(n-h)-(e-a)*(u-h)>=0&&(e-a)*(r-h)-(t-a)*(n-h)>=0&&(t-a)*(u-h)-(o-a)*(r-h)>=0}function isValidDiagonal(e,n){return e.next.i!==n.i&&e.prev.i!==n.i&&!intersectsPolygon(e,n)&&(locallyInside(e,n)&&locallyInside(n,e)&&middleInside(e,n)&&(area(e.prev,e,n.prev)||area(e,n.prev,n))||equals(e,n)&&area(e.prev,e,e.next)>0&&area(n.prev,n,n.next)>0)}function area(e,n,t){return(n.y-e.y)*(t.x-n.x)-(n.x-e.x)*(t.y-n.y)}function equals(e,n){return e.x===n.x&&e.y===n.y}function intersects(e,n,t,r){const o=sign(area(e,n,t)),u=sign(area(e,n,r)),a=sign(area(t,r,e)),h=sign(area(t,r,n));return!!(o!==u&&a!==h||o===0&&onSegment(e,t,n)||u===0&&onSegment(e,r,n)||a===0&&onSegment(t,e,r)||h===0&&onSegment(t,n,r))}function onSegment(e,n,t){return n.x<=Math.max(e.x,t.x)&&n.x>=Math.min(e.x,t.x)&&n.y<=Math.max(e.y,t.y)&&n.y>=Math.min(e.y,t.y)}function sign(e){return e>0?1:e<0?-1:0}function intersectsPolygon(e,n){let t=e;do{if(t.i!==e.i&&t.next.i!==e.i&&t.i!==n.i&&t.next.i!==n.i&&intersects(t,t.next,e,n))return!0;t=t.next}while(t!==e);return!1}function locallyInside(e,n){return area(e.prev,e,e.next)<0?area(e,n,e.next)>=0&&area(e,e.prev,n)>=0:area(e,n,e.prev)<0||area(e,e.next,n)<0}function middleInside(e,n){let t=e,r=!1;const o=(e.x+n.x)/2,u=(e.y+n.y)/2;do t.y>u!=t.next.y>u&&t.next.y!==t.y&&o<(t.next.x-t.x)*(u-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==e);return r}function splitPolygon(e,n){const t=new Node(e.i,e.x,e.y),r=new Node(n.i,n.x,n.y),o=e.next,u=n.prev;return e.next=n,n.prev=e,t.next=o,o.prev=t,r.next=t,t.prev=r,u.next=r,r.prev=u,r}function insertNode(e,n,t,r){const o=new Node(e,n,t);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function removeNode(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Node(e,n,t){this.i=e,this.x=n,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function flatGeojsonToBinary(e,n,t){const r=extractNumericPropTypes(e),o=Object.keys(r).filter(u=>r[u]!==Array);return fillArrays(e,{propArrayTypes:r,...n},{numericPropKeys:t&&t.numericPropKeys||o,PositionDataType:t?t.PositionDataType:Float32Array,triangulate:t?t.triangulate:!0})}function extractNumericPropTypes(e){const n={};for(const t of e)if(t.properties)for(const r in t.properties){const o=t.properties[r];n[r]=deduceArrayType(o,n[r])}return n}function fillArrays(e,n,t){const{pointPositionsCount:r,pointFeaturesCount:o,linePositionsCount:u,linePathsCount:a,lineFeaturesCount:h,polygonPositionsCount:f,polygonObjectsCount:d,polygonRingsCount:g,polygonFeaturesCount:F,propArrayTypes:_,coordLength:p}=n,{numericPropKeys:w=[],PositionDataType:V=Float32Array,triangulate:O=!0}=t,N=e[0]&&"id"in e[0],z=e.length>65535?Uint32Array:Uint16Array,C={type:"Point",positions:new V(r*p),globalFeatureIds:new z(r),featureIds:o>65535?new Uint32Array(r):new Uint16Array(r),numericProps:{},properties:[],fields:[]},A={type:"LineString",pathIndices:u>65535?new Uint32Array(a+1):new Uint16Array(a+1),positions:new V(u*p),globalFeatureIds:new z(u),featureIds:h>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]},S={type:"Polygon",polygonIndices:f>65535?new Uint32Array(d+1):new Uint16Array(d+1),primitivePolygonIndices:f>65535?new Uint32Array(g+1):new Uint16Array(g+1),positions:new V(f*p),globalFeatureIds:new z(f),featureIds:F>65535?new Uint32Array(f):new Uint16Array(f),numericProps:{},properties:[],fields:[]};O&&(S.triangles=[]);for(const M of[C,A,S])for(const I of w){const k=_[I];M.numericProps[I]=new k(M.positions.length/p)}A.pathIndices[a]=u,S.polygonIndices[d]=f,S.primitivePolygonIndices[g]=f;const B={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(const M of e){const I=M.geometry,k=M.properties||{};switch(I.type){case"Point":handlePoint(I,C,B,p,k),C.properties.push(keepStringProperties(k,w)),N&&C.fields.push({id:M.id}),B.pointFeature++;break;case"LineString":handleLineString(I,A,B,p,k),A.properties.push(keepStringProperties(k,w)),N&&A.fields.push({id:M.id}),B.lineFeature++;break;case"Polygon":handlePolygon(I,S,B,p,k),S.properties.push(keepStringProperties(k,w)),N&&S.fields.push({id:M.id}),B.polygonFeature++;break;default:throw new Error("Invalid geometry type")}B.feature++}return makeAccessorObjects(C,A,S,p)}function handlePoint(e,n,t,r,o){n.positions.set(e.data,t.pointPosition*r);const u=e.data.length/r;fillNumericProperties(n,o,t.pointPosition,u),n.globalFeatureIds.fill(t.feature,t.pointPosition,t.pointPosition+u),n.featureIds.fill(t.pointFeature,t.pointPosition,t.pointPosition+u),t.pointPosition+=u}function handleLineString(e,n,t,r,o){n.positions.set(e.data,t.linePosition*r);const u=e.data.length/r;fillNumericProperties(n,o,t.linePosition,u),n.globalFeatureIds.fill(t.feature,t.linePosition,t.linePosition+u),n.featureIds.fill(t.lineFeature,t.linePosition,t.linePosition+u);for(let a=0,h=e.indices.length;a<h;++a){const f=e.indices[a],d=a===h-1?e.data.length:e.indices[a+1];n.pathIndices[t.linePath++]=t.linePosition,t.linePosition+=(d-f)/r}}function handlePolygon(e,n,t,r,o){n.positions.set(e.data,t.polygonPosition*r);const u=e.data.length/r;fillNumericProperties(n,o,t.polygonPosition,u),n.globalFeatureIds.fill(t.feature,t.polygonPosition,t.polygonPosition+u),n.featureIds.fill(t.polygonFeature,t.polygonPosition,t.polygonPosition+u);for(let a=0,h=e.indices.length;a<h;++a){const f=t.polygonPosition;n.polygonIndices[t.polygonObject++]=f;const d=e.areas[a],g=e.indices[a],F=e.indices[a+1];for(let p=0,w=g.length;p<w;++p){const V=g[p],O=p===w-1?F===void 0?e.data.length:F[0]:g[p+1];n.primitivePolygonIndices[t.polygonRing++]=t.polygonPosition,t.polygonPosition+=(O-V)/r}const _=t.polygonPosition;triangulatePolygon(n,d,g,{startPosition:f,endPosition:_,coordLength:r})}}function triangulatePolygon(e,n,t,{startPosition:r,endPosition:o,coordLength:u}){if(!e.triangles)return;const a=r*u,h=o*u,f=e.positions.subarray(a,h),d=t[0],g=t.slice(1).map(_=>(_-d)/u),F=earcut(f,g,u,n);for(let _=0,p=F.length;_<p;++_)e.triangles.push(r+F[_])}function wrapProps(e,n){const t={};for(const r in e)t[r]={value:e[r],size:n};return t}function makeAccessorObjects(e,n,t,r){const o={points:{...e,positions:{value:e.positions,size:r},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:wrapProps(e.numericProps,1)},lines:{...n,positions:{value:n.positions,size:r},pathIndices:{value:n.pathIndices,size:1},globalFeatureIds:{value:n.globalFeatureIds,size:1},featureIds:{value:n.featureIds,size:1},numericProps:wrapProps(n.numericProps,1)},polygons:{...t,positions:{value:t.positions,size:r},polygonIndices:{value:t.polygonIndices,size:1},primitivePolygonIndices:{value:t.primitivePolygonIndices,size:1},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:wrapProps(t.numericProps,1)}};return t.triangles&&(o.polygons.triangles={value:new Uint32Array(t.triangles),size:1}),o}function fillNumericProperties(e,n,t,r){for(const o in e.numericProps)if(o in n){const u=n[o];e.numericProps[o].fill(u,t,t+r)}}function keepStringProperties(e,n){const t={};for(const r in e)n.includes(r)||(t[r]=e[r]);return t}function deduceArrayType(e,n){return n===Array||!Number.isFinite(e)?Array:n===Float64Array||Math.fround(e)!==e?Float64Array:Float32Array}var import_pbf=__toModule(require_pbf());function classifyRings(e){const n=e.length;if(n<=1)return[e];const t=[];let r,o;for(let u=0;u<n;u++){const a=signedArea(e[u]);a!==0&&(o===void 0&&(o=a<0),o===a<0?(r&&t.push(r),r=[e[u]]):r&&r.push(e[u]))}return r&&t.push(r),t}function signedArea(e){let n=0;for(let t=0,r=e.length-1,o,u;t<e.length;r=t++)o=e[t],u=e[r],n+=(u[0]-o[0])*(o[1]+u[1]);return n}function readFeature(e,n,t){n&&t&&(e===1?n.id=t.readVarint():e===2?readTag(t,n):e===3?n.type=t.readVarint():e===4&&(n._geometry=t.pos))}function readTag(e,n){const t=e.readVarint()+e.pos;for(;e.pos<t;){const r=n._keys[e.readVarint()],o=n._values[e.readVarint()];n.properties[r]=o}}var VectorTileFeature=class{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,n,t,r,o){this.properties={},this.extent=t,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=r,this._values=o,e.readFields(readFeature,this,n)}loadGeometry(){const e=this._pbf;e.pos=this._geometry;const n=e.readVarint()+e.pos;let t=1,r=0,o=0,u=0;const a=[];let h;for(;e.pos<n;){if(r<=0){const f=e.readVarint();t=f&7,r=f>>3}if(r--,t===1||t===2)o+=e.readSVarint(),u+=e.readSVarint(),t===1&&(h&&a.push(h),h=[]),h&&h.push([o,u]);else if(t===7)h&&h.push(h[0].slice());else throw new Error(`unknown command ${t}`)}return h&&a.push(h),a}bbox(){const e=this._pbf;e.pos=this._geometry;const n=e.readVarint()+e.pos;let t=1,r=0,o=0,u=0,a=1/0,h=-1/0,f=1/0,d=-1/0;for(;e.pos<n;){if(r<=0){const g=e.readVarint();t=g&7,r=g>>3}if(r--,t===1||t===2)o+=e.readSVarint(),u+=e.readSVarint(),o<a&&(a=o),o>h&&(h=o),u<f&&(f=u),u>d&&(d=u);else if(t!==7)throw new Error(`unknown command ${t}`)}return[a,f,h,d]}_toGeoJSON(e){let n=this.loadGeometry(),t=VectorTileFeature.types[this.type],r,o;switch(this.type){case 1:const a=[];for(r=0;r<n.length;r++)a[r]=n[r][0];n=a,e(n,this);break;case 2:for(r=0;r<n.length;r++)e(n[r],this);break;case 3:for(n=classifyRings(n),r=0;r<n.length;r++)for(o=0;o<n[r].length;o++)e(n[r][o],this);break}n.length===1?n=n[0]:t=`Multi${t}`;const u={type:"Feature",geometry:{type:t,coordinates:n},properties:this.properties};return this.id!==null&&(u.id=this.id),u}toGeoJSON(e){if(typeof e=="function")return this._toGeoJSON(e);const{x:n,y:t,z:r}=e,o=this.extent*Math.pow(2,r),u=this.extent*n,a=this.extent*t;function h(f){for(let d=0;d<f.length;d++){const g=f[d];g[0]=(g[0]+u)*360/o-180;const F=180-(g[1]+a)*360/o;g[1]=360/Math.PI*Math.atan(Math.exp(F*Math.PI/180))-90}}return this._toGeoJSON(h)}},VectorTileLayer=class{constructor(e,n){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(readLayer,this,n),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const n=this._pbf.readVarint()+this._pbf.pos;return new VectorTileFeature(this._pbf,n,this.extent,this._keys,this._values)}};function readLayer(e,n,t){n&&t&&(e===15?n.version=t.readVarint():e===1?n.name=t.readString():e===5?n.extent=t.readVarint():e===2?n._features.push(t.pos):e===3?n._keys.push(t.readString()):e===4&&n._values.push(readValueMessage(t)))}function readValueMessage(e){let n=null;const t=e.readVarint()+e.pos;for(;e.pos<t;){const r=e.readVarint()>>3;n=r===1?e.readString():r===2?e.readFloat():r===3?e.readDouble():r===4?e.readVarint64():r===5?e.readVarint():r===6?e.readSVarint():r===7?e.readBoolean():null}return n}var VectorTile=class{constructor(e,n){this.layers=e.readFields(readTile,{},n)}};function readTile(e,n,t){if(e===3&&t){const r=new VectorTileLayer(t,t.readVarint()+t.pos);r.length&&n&&(n[r.name]=r)}}function classifyRings2(e){const n=e.indices.length,t="Polygon";if(n<=1)return{type:t,data:e.data,areas:[[getPolygonSignedArea(e.data)]],indices:[e.indices]};const r=[],o=[];let u=[],a=[],h,f=0;for(let d,g=0,F;g<n;g++){F=e.indices[g]-f,d=e.indices[g+1]-f||e.data.length;const _=e.data.slice(F,d),p=getPolygonSignedArea(_);if(p===0){const w=e.data.slice(0,F),V=e.data.slice(d);e.data=w.concat(V),f+=d-F;continue}h===void 0&&(h=p<0),h===p<0?(a.length&&(r.push(u),o.push(a)),a=[F],u=[p]):(u.push(p),a.push(F))}return u&&r.push(u),a.length&&o.push(a),{type:t,areas:r,indices:o,data:e.data}}function project(e,n,t,r){for(let o=0,u=e.length;o<u;o+=2){e[o]=(e[o]+n)*360/r-180;const a=180-(e[o+1]+t)*360/r;e[o+1]=360/Math.PI*Math.atan(Math.exp(a*Math.PI/180))-90}}function readFeature2(e,n,t){n&&t&&(e===1?n.id=t.readVarint():e===2?readTag2(t,n):e===3?n.type=t.readVarint():e===4&&(n._geometry=t.pos))}function readTag2(e,n){const t=e.readVarint()+e.pos;for(;e.pos<t;){const r=n._keys[e.readVarint()],o=n._values[e.readVarint()];n.properties[r]=o}}var endPos,cmd,cmdLen,length,x,y,i,VectorTileFeature2=class{constructor(e,n,t,r,o,u){this.properties={},this.extent=t,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=r,this._values=o,this._geometryInfo=u,e.readFields(readFeature2,this,n)}loadGeometry(){const e=this._pbf;e.pos=this._geometry,endPos=e.readVarint()+e.pos,cmd=1,length=0,x=0,y=0,i=0;const n=[],t=[];for(;e.pos<endPos;)if(length<=0&&(cmdLen=e.readVarint(),cmd=cmdLen&7,length=cmdLen>>3),length--,cmd===1||cmd===2)x+=e.readSVarint(),y+=e.readSVarint(),cmd===1&&n.push(i),t.push(x,y),i+=2;else if(cmd===7){if(i>0){const r=n[n.length-1];t.push(t[r],t[r+1]),i+=2}}else throw new Error(`unknown command ${cmd}`);return{data:t,indices:n}}_toBinaryCoordinates(e){const n=this.loadGeometry();let t;e(n.data,this);const r=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=n.indices.length,t={type:"Point",...n};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=n.indices.length,this._geometryInfo.linePositionsCount+=n.data.length/r,t={type:"LineString",...n};break;case 3:t=classifyRings2(n),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=t.indices.length;for(const u of t.indices)this._geometryInfo.polygonRingsCount+=u.length;this._geometryInfo.polygonPositionsCount+=t.data.length/r;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}const o={type:"Feature",geometry:t,properties:this.properties};return this.id!==null&&(o.id=this.id),o}toBinaryCoordinates(e){if(typeof e=="function")return this._toBinaryCoordinates(e);const{x:n,y:t,z:r}=e,o=this.extent*Math.pow(2,r),u=this.extent*n,a=this.extent*t;return this._toBinaryCoordinates(h=>project(h,u,a,o))}},VectorTileLayer2=class{constructor(e,n){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(readLayer2,this,n),this.length=this._features.length}feature(e,n){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const t=this._pbf.readVarint()+this._pbf.pos;return new VectorTileFeature2(this._pbf,t,this.extent,this._keys,this._values,n)}};function readLayer2(e,n,t){n&&t&&(e===15?n.version=t.readVarint():e===1?n.name=t.readString():e===5?n.extent=t.readVarint():e===2?n._features.push(t.pos):e===3?n._keys.push(t.readString()):e===4&&n._values.push(readValueMessage2(t)))}function readValueMessage2(e){let n=null;const t=e.readVarint()+e.pos;for(;e.pos<t;){const r=e.readVarint()>>3;n=r===1?e.readString():r===2?e.readFloat():r===3?e.readDouble():r===4?e.readVarint64():r===5?e.readVarint():r===6?e.readSVarint():r===7?e.readBoolean():null}return n}var VectorTile2=class{constructor(e,n){this.layers=e.readFields(readTile2,{},n)}};function readTile2(e,n,t){if(e===3&&t){const r=new VectorTileLayer2(t,t.readVarint()+t.pos);r.length&&n&&(n[r.name]=r)}}function parseMVT(e,n){const t=normalizeOptions(n),r=n?.gis?.format||n?.mvt?.shape;switch(r){case"columnar-table":return{shape:"columnar-table",data:parseToBinary(e,t)};case"geojson-row-table":return{shape:"geojson-row-table",data:parseToGeojson(e,t)};case"geojson":return parseToGeojson(e,t);case"binary-geometry":return parseToBinary(e,t);case"binary":return parseToBinary(e,t);default:throw new Error(r)}}function parseToBinary(e,n){const[t,r]=parseToFlatGeoJson(e,n),o=flatGeojsonToBinary(t,r);return o.byteLength=e.byteLength,o}function parseToFlatGeoJson(e,n){const t=[],r={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength<=0)return[t,r];const o=new VectorTile2(new import_pbf.default(e));return(n&&Array.isArray(n.layers)?n.layers:Object.keys(o.layers)).forEach(a=>{const h=o.layers[a];if(h)for(let f=0;f<h.length;f++){const d=h.feature(f,r),g=getDecodedFeatureBinary(d,n,a);t.push(g)}}),[t,r]}function parseToGeojson(e,n){if(e.byteLength<=0)return[];const t=[],r=new VectorTile(new import_pbf.default(e));return(Array.isArray(n.layers)?n.layers:Object.keys(r.layers)).forEach(u=>{const a=r.layers[u];if(a)for(let h=0;h<a.length;h++){const f=a.feature(h),d=getDecodedFeature(f,n,u);t.push(d)}}),t}function normalizeOptions(e){if(!e?.mvt)throw new Error("mvt options required");const n=e.mvt?.coordinates==="wgs84",{tileIndex:t}=e.mvt,r=t&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.z);if(n&&!r)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return e.mvt}function getDecodedFeature(e,n,t){const r=e.toGeoJSON(n.coordinates==="wgs84"?n.tileIndex:transformToLocalCoordinates);return n.layerProperty&&(r.properties[n.layerProperty]=t),r}function getDecodedFeatureBinary(e,n,t){const r=e.toBinaryCoordinates(n.coordinates==="wgs84"?n.tileIndex:transformToLocalCoordinatesBinary);return n.layerProperty&&r.properties&&(r.properties[n.layerProperty]=t),r}function transformToLocalCoordinates(e,n){const{extent:t}=n;for(let r=0;r<e.length;r++){const o=e[r];o[0]/=t,o[1]/=t}}function transformToLocalCoordinatesBinary(e,n){const{extent:t}=n;for(let r=0,o=e.length;r<o;++r)e[r]/=t}var VERSION="3.4.11",DEFAULT_MVT_LOADER_OPTIONS={mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}},MVTWorkerLoader={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:VERSION,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:DEFAULT_MVT_LOADER_OPTIONS},MVTLoader={...MVTWorkerLoader,parse:async(e,n)=>parseMVT(e,n),parseSync:parseMVT,binary:!0};function getTransferList(e,n=!0,t){const r=t||new Set;if(e){if(isTransferable(e))r.add(e);else if(isTransferable(e.buffer))r.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(n&&typeof e=="object")for(const o in e)getTransferList(e[o],n,r)}}return t===void 0?Array.from(r):[]}function isTransferable(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}function getParentPort(){let parentPort;try{eval("globalThis.parentPort = require('worker_threads').parentPort"),parentPort=globalThis.parentPort}catch{}return parentPort}var onMessageWrapperMap=new Map,WorkerBody=class{static inWorkerThread(){return typeof self<"u"||!!getParentPort()}static set onmessage(e){function n(r){const o=getParentPort(),{type:u,payload:a}=o?r:r.data;e(u,a)}const t=getParentPort();t?(t.on("message",n),t.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=n}static addEventListener(e){let n=onMessageWrapperMap.get(e);n||(n=r=>{if(!isKnownMessage(r))return;const o=getParentPort(),{type:u,payload:a}=o?r:r.data;e(u,a)}),getParentPort()?console.error("not implemented"):globalThis.addEventListener("message",n)}static removeEventListener(e){const n=onMessageWrapperMap.get(e);onMessageWrapperMap.delete(e),getParentPort()?console.error("not implemented"):globalThis.removeEventListener("message",n)}static postMessage(e,n){const t={source:"loaders.gl",type:e,payload:n},r=getTransferList(n),o=getParentPort();o?o.postMessage(t,r):globalThis.postMessage(t,r)}};function isKnownMessage(e){const{type:n,data:t}=e;return n==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}var requestId=0;function createLoaderWorker(e){WorkerBody.inWorkerThread()&&(WorkerBody.onmessage=async(n,t)=>{switch(n){case"process":try{const{input:r,options:o={},context:u={}}=t,a=await parseData({loader:e,arrayBuffer:r,options:o,context:{...u,parse:parseOnMainThread}});WorkerBody.postMessage("done",{result:a})}catch(r){const o=r instanceof Error?r.message:"";WorkerBody.postMessage("error",{error:o})}break;default:}})}function parseOnMainThread(e,n){return new Promise((t,r)=>{const o=requestId++,u=(h,f)=>{if(f.id===o)switch(h){case"done":WorkerBody.removeEventListener(u),t(f.result);break;case"error":WorkerBody.removeEventListener(u),r(f.error);break;default:}};WorkerBody.addEventListener(u);const a={id:o,input:e,options:n};WorkerBody.postMessage("process",a)})}async function parseData({loader:e,arrayBuffer:n,options:t,context:r}){let o,u;if(e.parseSync||e.parse)o=n,u=e.parseSync||e.parse;else if(e.parseTextSync)o=new TextDecoder().decode(n),u=e.parseTextSync;else throw new Error(`Could not load data with ${e.name} loader`);return t={...t,modules:e&&e.options&&e.options.modules||{},worker:!1},await u(o,{...t},r,e)}createLoaderWorker(MVTLoader)})();/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */