earthsdk3-cesium 3.7.0-beta.20 → 3.7.0-beta.22

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
+ (function(){"use strict";const Y=23283064365386963e-26,ht=12,K=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),j=0,N=1,L=2,G=5;class lt{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,e,s=this.length){for(;this.pos<s;){const n=this.readVarint(),r=n>>3,o=this.pos;this.type=n&7,t(r,e,this),this.pos===o&&this.skip(n)}return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){const t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){const t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readSFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readFloat(){const t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){const t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){const e=this.buf;let s,n;return n=e[this.pos++],s=n&127,n<128||(n=e[this.pos++],s|=(n&127)<<7,n<128)||(n=e[this.pos++],s|=(n&127)<<14,n<128)||(n=e[this.pos++],s|=(n&127)<<21,n<128)?s:(n=e[this.pos],s|=(n&15)<<28,ft(s,t,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const t=this.readVarint();return t%2===1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){const t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=ht&&K?K.decode(this.buf.subarray(e,t)):_t(this.buf,e,t)}readBytes(){const t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){const s=this.readPackedEnd();for(;this.pos<s;)t.push(this.readVarint(e));return t}readPackedSVarint(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFloat());return t}readPackedDouble(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===L?this.readVarint()+this.pos:this.pos+1}skip(t){const e=t&7;if(e===j)for(;this.buf[this.pos++]>127;);else if(e===L)this.pos=this.readVarint()+this.pos;else if(e===G)this.pos+=4;else if(e===N)this.pos+=8;else throw new Error(`Unimplemented type: ${e}`)}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e<this.pos+t;)e*=2;if(e!==this.length){const s=new Uint8Array(e);s.set(this.buf),this.buf=s,this.dataView=new DataView(s.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*Y),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*Y),!0),this.pos+=8}writeVarint(t){if(t=+t||0,t>268435455||t<0){ut(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(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;const e=this.pos;this.pos=mt(this.buf,t,this.pos);const s=this.pos-e;s>=128&&Q(e,s,this),this.pos=e-1,this.writeVarint(s),this.pos+=s}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){const e=t.length;this.writeVarint(e),this.realloc(e);for(let s=0;s<e;s++)this.buf[this.pos++]=t[s]}writeRawMessage(t,e){this.pos++;const s=this.pos;t(e,this);const n=this.pos-s;n>=128&&Q(s,n,this),this.pos=s-1,this.writeVarint(n),this.pos+=n}writeMessage(t,e,s){this.writeTag(t,L),this.writeRawMessage(e,s)}writePackedVarint(t,e){e.length&&this.writeMessage(t,xt,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,yt,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,Ft,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,pt,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,wt,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,gt,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,Vt,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,Pt,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,St,e)}writeBytesField(t,e){this.writeTag(t,L),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,G),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,G),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,N),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,N),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,j),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,j),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,L),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,G),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,N),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}}function ft(i,t,e){const s=e.buf;let n,r;if(r=s[e.pos++],n=(r&112)>>4,r<128||(r=s[e.pos++],n|=(r&127)<<3,r<128)||(r=s[e.pos++],n|=(r&127)<<10,r<128)||(r=s[e.pos++],n|=(r&127)<<17,r<128)||(r=s[e.pos++],n|=(r&127)<<24,r<128)||(r=s[e.pos++],n|=(r&1)<<31,r<128))return T(i,n,t);throw new Error("Expected varint not more than 10 bytes")}function T(i,t,e){return e?t*4294967296+(i>>>0):(t>>>0)*4294967296+(i>>>0)}function ut(i,t){let e,s;if(i>=0?(e=i%4294967296|0,s=i/4294967296|0):(e=~(-i%4294967296),s=~(-i/4294967296),e^4294967295?e=e+1|0:(e=0,s=s+1|0)),i>=18446744073709552e3||i<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),ct(e,s,t),dt(s,t)}function ct(i,t,e){e.buf[e.pos++]=i&127|128,i>>>=7,e.buf[e.pos++]=i&127|128,i>>>=7,e.buf[e.pos++]=i&127|128,i>>>=7,e.buf[e.pos++]=i&127|128,i>>>=7,e.buf[e.pos]=i&127}function dt(i,t){const e=(i&7)<<4;t.buf[t.pos++]|=e|((i>>>=3)?128:0),i&&(t.buf[t.pos++]=i&127|((i>>>=7)?128:0),i&&(t.buf[t.pos++]=i&127|((i>>>=7)?128:0),i&&(t.buf[t.pos++]=i&127|((i>>>=7)?128:0),i&&(t.buf[t.pos++]=i&127|((i>>>=7)?128:0),i&&(t.buf[t.pos++]=i&127)))))}function Q(i,t,e){const s=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));e.realloc(s);for(let n=e.pos-1;n>=i;n--)e.buf[n+s]=e.buf[n]}function xt(i,t){for(let e=0;e<i.length;e++)t.writeVarint(i[e])}function yt(i,t){for(let e=0;e<i.length;e++)t.writeSVarint(i[e])}function pt(i,t){for(let e=0;e<i.length;e++)t.writeFloat(i[e])}function wt(i,t){for(let e=0;e<i.length;e++)t.writeDouble(i[e])}function Ft(i,t){for(let e=0;e<i.length;e++)t.writeBoolean(i[e])}function gt(i,t){for(let e=0;e<i.length;e++)t.writeFixed32(i[e])}function Vt(i,t){for(let e=0;e<i.length;e++)t.writeSFixed32(i[e])}function Pt(i,t){for(let e=0;e<i.length;e++)t.writeFixed64(i[e])}function St(i,t){for(let e=0;e<i.length;e++)t.writeSFixed64(i[e])}function _t(i,t,e){let s="",n=t;for(;n<e;){const r=i[n];let o=null,l=r>239?4:r>223?3:r>191?2:1;if(n+l>e)break;let a,f,d;l===1?r<128&&(o=r):l===2?(a=i[n+1],(a&192)===128&&(o=(r&31)<<6|a&63,o<=127&&(o=null))):l===3?(a=i[n+1],f=i[n+2],(a&192)===128&&(f&192)===128&&(o=(r&15)<<12|(a&63)<<6|f&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):l===4&&(a=i[n+1],f=i[n+2],d=i[n+3],(a&192)===128&&(f&192)===128&&(d&192)===128&&(o=(r&15)<<18|(a&63)<<12|(f&63)<<6|d&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,l=1):o>65535&&(o-=65536,s+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),s+=String.fromCharCode(o),n+=l}return s}function mt(i,t,e){for(let s=0,n,r;s<t.length;s++){if(n=t.charCodeAt(s),n>55295&&n<57344)if(r)if(n<56320){i[e++]=239,i[e++]=191,i[e++]=189,r=n;continue}else n=r-55296<<10|n-56320|65536,r=null;else{n>56319||s+1===t.length?(i[e++]=239,i[e++]=191,i[e++]=189):r=n;continue}else r&&(i[e++]=239,i[e++]=191,i[e++]=189,r=null);n<128?i[e++]=n:(n<2048?i[e++]=n>>6|192:(n<65536?i[e++]=n>>12|224:(i[e++]=n>>18|240,i[e++]=n>>12&63|128),i[e++]=n>>6&63|128),i[e++]=n&63|128)}return e}function m(i,t){this.x=i,this.y=t}m.prototype={clone(){return new m(this.x,this.y)},add(i){return this.clone()._add(i)},sub(i){return this.clone()._sub(i)},multByPoint(i){return this.clone()._multByPoint(i)},divByPoint(i){return this.clone()._divByPoint(i)},mult(i){return this.clone()._mult(i)},div(i){return this.clone()._div(i)},rotate(i){return this.clone()._rotate(i)},rotateAround(i,t){return this.clone()._rotateAround(i,t)},matMult(i){return this.clone()._matMult(i)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(i){return this.x===i.x&&this.y===i.y},dist(i){return Math.sqrt(this.distSqr(i))},distSqr(i){const t=i.x-this.x,e=i.y-this.y;return t*t+e*e},angle(){return Math.atan2(this.y,this.x)},angleTo(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith(i){return this.angleWithSep(i.x,i.y)},angleWithSep(i,t){return Math.atan2(this.x*t-this.y*i,this.x*i+this.y*t)},_matMult(i){const t=i[0]*this.x+i[1]*this.y,e=i[2]*this.x+i[3]*this.y;return this.x=t,this.y=e,this},_add(i){return this.x+=i.x,this.y+=i.y,this},_sub(i){return this.x-=i.x,this.y-=i.y,this},_mult(i){return this.x*=i,this.y*=i,this},_div(i){return this.x/=i,this.y/=i,this},_multByPoint(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint(i){return this.x/=i.x,this.y/=i.y,this},_unit(){return this._div(this.mag()),this},_perp(){const i=this.y;return this.y=this.x,this.x=-i,this},_rotate(i){const t=Math.cos(i),e=Math.sin(i),s=t*this.x-e*this.y,n=e*this.x+t*this.y;return this.x=s,this.y=n,this},_rotateAround(i,t){const e=Math.cos(i),s=Math.sin(i),n=t.x+e*(this.x-t.x)-s*(this.y-t.y),r=t.y+s*(this.x-t.x)+e*(this.y-t.y);return this.x=n,this.y=r,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:m},m.convert=function(i){if(i instanceof m)return i;if(Array.isArray(i))return new m(+i[0],+i[1]);if(i.x!==void 0&&i.y!==void 0)return new m(+i.x,+i.y);throw new Error("Expected [x, y] or {x, y} point format")};class Z{constructor(t,e,s,n,r){this.properties={},this.extent=s,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=r,t.readFields(kt,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos,s=[];let n,r=1,o=0,l=0,a=0;for(;t.pos<e;){if(o<=0){const f=t.readVarint();r=f&7,o=f>>3}if(o--,r===1||r===2)l+=t.readSVarint(),a+=t.readSVarint(),r===1&&(n&&s.push(n),n=[]),n&&n.push(new m(l,a));else if(r===7)n&&n.push(n[0].clone());else throw new Error(`unknown command ${r}`)}return n&&s.push(n),s}bbox(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let s=1,n=0,r=0,o=0,l=1/0,a=-1/0,f=1/0,d=-1/0;for(;t.pos<e;){if(n<=0){const P=t.readVarint();s=P&7,n=P>>3}if(n--,s===1||s===2)r+=t.readSVarint(),o+=t.readSVarint(),r<l&&(l=r),r>a&&(a=r),o<f&&(f=o),o>d&&(d=o);else if(s!==7)throw new Error(`unknown command ${s}`)}return[l,f,a,d]}toGeoJSON(t,e,s){const n=this.extent*Math.pow(2,s),r=this.extent*t,o=this.extent*e,l=this.loadGeometry();function a(c){return[(c.x+r)*360/n-180,360/Math.PI*Math.atan(Math.exp((1-(c.y+o)*2/n)*Math.PI))-90]}function f(c){return c.map(a)}let d;if(this.type===1){const c=[];for(const E of l)c.push(E[0]);const u=f(c);d=c.length===1?{type:"Point",coordinates:u[0]}:{type:"MultiPoint",coordinates:u}}else if(this.type===2){const c=l.map(f);d=c.length===1?{type:"LineString",coordinates:c[0]}:{type:"MultiLineString",coordinates:c}}else if(this.type===3){const c=Et(l),u=[];for(const E of c)u.push(E.map(f));d=u.length===1?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}else throw new Error("unknown feature type");const P={type:"Feature",geometry:d,properties:this.properties};return this.id!=null&&(P.id=this.id),P}}Z.types=["Unknown","Point","LineString","Polygon"];function kt(i,t,e){i===1?t.id=e.readVarint():i===2?Mt(e,t):i===3?t.type=e.readVarint():i===4&&(t._geometry=e.pos)}function Mt(i,t){const e=i.readVarint()+i.pos;for(;i.pos<e;){const s=t._keys[i.readVarint()],n=t._values[i.readVarint()];t.properties[s]=n}}function Et(i){const t=i.length;if(t<=1)return[i];const e=[];let s,n;for(let r=0;r<t;r++){const o=Tt(i[r]);o!==0&&(n===void 0&&(n=o<0),n===o<0?(s&&e.push(s),s=[i[r]]):s&&s.push(i[r]))}return s&&e.push(s),e}function Tt(i){let t=0;for(let e=0,s=i.length,n=s-1,r,o;e<s;n=e++)r=i[e],o=i[n],t+=(o.x-r.x)*(r.y+o.y);return t}class Bt{constructor(t,e){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Dt,this,e),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const e=this._pbf.readVarint()+this._pbf.pos;return new Z(this._pbf,e,this.extent,this._keys,this._values)}}function Dt(i,t,e){i===15?t.version=e.readVarint():i===1?t.name=e.readString():i===5?t.extent=e.readVarint():i===2?t._features.push(e.pos):i===3?t._keys.push(e.readString()):i===4&&t._values.push(Ct(e))}function Ct(i){let t=null;const e=i.readVarint()+i.pos;for(;i.pos<e;){const s=i.readVarint()>>3;t=s===1?i.readString():s===2?i.readFloat():s===3?i.readDouble():s===4?i.readVarint64():s===5?i.readVarint():s===6?i.readSVarint():s===7?i.readBoolean():null}if(t==null)throw new Error("unknown feature value");return t}class It{constructor(t,e){this.layers=t.readFields(vt,{},e)}}function vt(i,t,e){if(i===3){const s=new Bt(e,e.readVarint()+e.pos);s.length&&(t[s.name]=s)}}self.onmessage=async i=>{var t,e,s,n,r,o,l;if(i.data.type==="fetch"){const{url:a,x:f,y:d,z:P,style:c,tileSize:u}=i.data,E=new Map,z=new Map;try{const $=await(await fetch(a)).arrayBuffer(),it=new It(new lt($)),W={};for(const h in it.layers){const x=it.layers[h],y=x.extent||4096,U=[],R=[],p=[],F=[],B=[],D=[],C=[],I=[];let _=E.get(h),g=z.get(h);_||(_={extent:y,features:[]},E.set(h,_)),g||(g={extent:y,features:[]},z.set(h,g));for(let O=0;O<x.length;O++){const v=x.feature(O);let V;try{V=v.loadGeometry()}catch{continue}const X=v.type,J=v.properties||{};if(X===1){let A=0,k=0,M=0;for(const Rt of V)for(const b of Rt)b.x<0||b.y<0||b.x>y||b.y>y||(A+=b.x,k+=b.y,M++);if(!M)continue;const[H,bt]=[A/M,k/M],[Lt,Ut]=q(H,bt,f,d,P,y);U.push(Lt,Ut,0),R.push(J)}else if(X===2){g.features.push(V),F.push(p.length/3);for(const A of V)for(const k of A){const[M,H]=q(k.x,k.y,f,d,P,y);p.push(M,H,0)}B.push(J)}else if(X===3){_.features.push({geometry:V,area:At(V)}),C.push(D.length/3);for(const A of V)for(const k of A){const[M,H]=q(k.x,k.y,f,d,P,y);D.push(M,H,0)}I.push(J)}}W[h]={points:new Float32Array(U),pointProps:R,lines:new Float32Array(p),lineOffsets:new Uint32Array(F),lineProps:B,polygons:new Float32Array(D),polygonOffsets:new Uint32Array(C),polygonProps:I}}const st=[];for(const h in W){const x=W[h];st.push(x.points.buffer,x.lines.buffer,x.lineOffsets.buffer,x.polygons.buffer,x.polygonOffsets.buffer)}const nt=new OffscreenCanvas(u,u),rt=new OffscreenCanvas(u,u),w=nt.getContext("2d"),S=rt.getContext("2d");if(w.clearRect(0,0,u,u),S.clearRect(0,0,u,u),c)for(const h of c){const x=E.get(h["source-layer"])??{extent:4096,features:[]},y=z.get(h["source-layer"])??{extent:4096,features:[]},U=u/x.extent,R=u/y.extent;for(let p=0;p<y.features.length;p++){S.beginPath();const F=y.features[p];h.polylineStyle&&(!h.polylineStyle.visibility||h.polylineStyle.visibility==="visible")&&(S.strokeStyle=((t=h.polylineStyle)==null?void 0:t.color)||"#000000",S.lineWidth=((e=h.polylineStyle)==null?void 0:e.width)||1,S.lineCap=((s=h.polylineStyle)==null?void 0:s.cap)||"butt",S.lineJoin=((n=h.polylineStyle)==null?void 0:n.join)||"miter",F.forEach((B,D)=>{B.forEach((C,I)=>{const[_,g]=[C.x*R,C.y*R];I===0?S.moveTo(_,g):S.lineTo(_,g)})})),S.stroke()}if(x.features.sort((p,F)=>F.area-p.area),h.polygonStyle&&(!h.polygonStyle.visibility||h.polygonStyle.visibility==="visible")){const p=((r=h.polygonStyle)==null?void 0:r.color)||"#000000",F=(o=h.polygonStyle)==null?void 0:o.outlineColor,B=((l=h.polygonStyle)==null?void 0:l.outlineWidth)||1;w.fillStyle=p,F&&(w.strokeStyle=F,w.lineWidth=B),x.features.forEach(({geometry:D})=>{tt(D).forEach(I=>{w.beginPath(),I.forEach(_=>{_.forEach((g,O)=>{const v=g.x*U,V=g.y*U;O===0?w.moveTo(v,V):w.lineTo(v,V)}),w.closePath()}),w.fill("evenodd"),F&&w.stroke()})})}}const ot=nt.transferToImageBitmap(),at=rt.transferToImageBitmap();self.postMessage({url:a,tileData:W,bitmapPolygon:ot,bitmapPolyline:at},[...st,ot,at])}catch($){self.postMessage({url:a,error:$.message})}}};function q(i,t,e,s,n,r=4096){const o=r*Math.pow(2,n),l=e*r,a=s*r;return[(i+l)*360/o-180,360/Math.PI*Math.atan(Math.exp((1-(t+a)*2/o)*Math.PI))-90]}function tt(i){const t=i.length;if(t<=1)return[i];const e=[];let s,n;for(let r=0;r<t;r++){const o=et(i[r]);o!==0&&(n===void 0&&(n=o<0),n===o<0?(s&&e.push(s),s=[i[r]]):s&&s.push(i[r]))}return s&&e.push(s),e}function At(i){const t=tt(i);let e=0;for(const s of t){let n=0;for(const r of s)n+=Math.abs(et(r));e+=n}return e}function et(i){let t=0;for(let e=0,s=i.length,n=s-1,r,o;e<s;n=e++)r=i[e],o=i[n],t+=(o.x-r.x)*(r.y+o.y);return t}})();