import{aasm}from"./chunk-H2CDK6OB.js";import{aasN}from"./chunk-GMMUK6QU.js";import{aasU}from"./chunk-AKRPIQPN.js";import"./chunk-NHNM56MI.js";import{aask}from"./chunk-6VK5R74O.js";import{aasle}from"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{aasse}from"./chunk-YFQNY2YN.js";import{aasce}from"./chunk-NT26NNVH.js";import{aasne,basre,casie,dasO}from"./chunk-NW2YE576.js";import{dasoe}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{aasx}from"./chunk-QHHYYTCM.js";import{aasp,dasu}from"./chunk-RH3GFHG2.js";import{aasJ}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{aasA}from"./chunk-TA3RE4KQ.js";import{aasV}from"./chunk-RTY3VPG6.js";import{eash}from"./chunk-LRNH5AEO.js";varme=[];functionAe(e,o,t,n,c){lets=me;s.length=c;letl,E=t.red,a=t.green,r=t.blue,w=t.alpha,b=n.red,i=n.green,f=n.blue,L=n.alpha;if(m.equals(t,n)){for(l=0;l<c;l++)s[l]=m.clone(t);returns}letM=(b-E)/c,z=(i-a)/c,H=(f-r)/c,B=(L-w)/c;for(l=0;l<c;l++)s[l]=newm(E+l*M,a+l*z,r+l*H,w+l*B);returns}functionG(e){e=A(e,A.EMPTY_OBJECT);leto=e.positions,t=e.colors,n=A(e.width,1),c=A(e.colorsPerVertex,!1);if(!h(o)||o.length<2)thrownewV("At least two positions are required.");if(typeofn!="number")thrownewV("width must be a number");if(h(t)&&(c&&t.length<o.length||!c&&t.length<o.length-1))thrownewV("colors has an invalid length.");this._positions=o,this._colors=t,this._width=n,this._colorsPerVertex=c,this._vertexFormat=k.clone(A(e.vertexFormat,k.DEFAULT)),this._arcType=A(e.arcType,N.GEODESIC),this._granularity=A(e.granularity,J.RADIANS_PER_DEGREE),this._ellipsoid=u.clone(A(e.ellipsoid,u.default)),this._workerName="createPolylineGeometry";lets=1+o.length*p.packedLength;s+=h(t)?1+t.length*m.packedLength:1,this.packedLength=s+u.packedLength+k.packedLength+4}G.pack=function(e,o,t){if(!h(e))thrownewV("value is required");if(!h(o))thrownewV("array is required");t=A(t,0);letn,c=e._positions,s=c.length;for(o[t++]=s,n=0;n<s;++n,t+=p.packedLength)p.pack(c[n],o,t);letl=e._colors;for(s=h(l)?l.length:0,o[t++]=s,n=0;n<s;++n,t+=m.packedLength)m.pack(l[n],o,t);returnu.pack(e._ellipsoid,o,t),t+=u.packedLength,k.pack(e._vertexFormat,o,t),t+=k.packedLength,o[t++]=e._width,o[t++]=e._colorsPerVertex?1:0,o[t++]=e._arcType,o[t]=e._granularity,o};varde=u.clone(u.UNIT_SPHERE),ue=newk,S={positions:void0,colors:void0,ellipsoid:de,vertexFormat:ue,width:void0,colorsPerVertex:void0,arcType:void0,granularity:void0};G.unpack=function(e,o,t){if(!h(e))thrownewV("array is required");o=A(o,0);letn,c=e[o++],s=newArray(c);for(n=0;n<c;++n,o+=p.packedLength)s[n]=p.unpack(e,o);c=e[o++];letl=c>0?newArray(c):void0;for(n=0;n<c;++n,o+=m.packedLength)l[n]=m.unpack(e,o);letE=u.unpack(e,o,de);o+=u.packedLength;leta=k.unpack(e,o,ue);o+=k.packedLength;letr=e[o++],w=e[o++]===1,b=e[o++],i=e[o];returnh(t)?(t._positions=s,t._colors=l,t._ellipsoid=u.clone(E,t._ellipsoid),t._vertexFormat=k.clone(a,t._vertexFormat),t._width=r,t._colorsPerVertex=w,t._arcType=b,t._granularity=i,t):(S.positions=s,S.colors=l,S.width=r,S.colorsPerVertex=w,S.arcType=b,S.granularity=i,newG(S))};varpe=newp,ae=newp,fe=newp,he=newp;G.createGeometry=function(e){leto=e._width,t=e._vertexFormat,n=e._colors,c=e._colorsPerVertex,s=e._arcType,l=e._granularity,E=e._ellipsoid,a,r,w,b=[],i=le(e._positions,p.equalsEpsilon,!1,b);if(h(n)&&b.length>0){letd=0,P=b[0];n=n.filter(function(q,T){letg=!1;returnc?g=T===P||T===0&&P===1:g=T+1===P,g?(d++,P=b[d],!1):!0})}letf=i.length;if(f<2||o<=0)return;if(s===N.GEODESIC||s===N.RHUMB){letd,P;s===N.GEODESIC?(d=J.chordLength(l,E.maximumRadius),P=U.numberOfPoints):(d=l,P=U.numberOfPointsRhumbLine);letq=U.extractHeights(i,E);if(h(n)){letT=1;for(a=0;a<f-1;++a)T+=P(i[a],i[a+1],d);letg=newArray(T),D=0;for(a=0;a<f-1;++a){letZ=i[a],$=i[a+1],I=n[a],ee=P(Z,$,d);if(c&&a<T){let_e=n[a+1],te=Ae(Z,$,I,_e,ee),Pe=te.length;for(r=0;r<Pe;++r)g[D++]=te[r]}elsefor(r=0;r<ee;++r)g[D++]=m.clone(I)}g[D]=m.clone(n[n.length-1]),n=g,me.length=0}