import{aasB}from"./chunk-2GHT2S2L.js";import"./chunk-AKRPIQPN.js";import"./chunk-NHNM56MI.js";import"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{aasW}from"./chunk-YFQNY2YN.js";import{aasN}from"./chunk-NT26NNVH.js";import{basR,casS,dasM}from"./chunk-NW2YE576.js";import{dasD}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{aasq}from"./chunk-QHHYYTCM.js";import{aasp,dasl}from"./chunk-RH3GFHG2.js";import{aasO}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{aasd}from"./chunk-TA3RE4KQ.js";import{aas_}from"./chunk-RTY3VPG6.js";import{easm}from"./chunk-LRNH5AEO.js";varU=newp,z=newp;functionw(i){i=d(i,d.EMPTY_OBJECT);lett=i.positions,e=i.maximumHeights,o=i.minimumHeights;if(!m(t))thrownew_("options.positions is required.");if(m(e)&&e.length!==t.length)thrownew_("options.positions and options.maximumHeights must have the same length.");if(m(o)&&o.length!==t.length)thrownew_("options.positions and options.minimumHeights must have the same length.");lets=d(i.granularity,O.RADIANS_PER_DEGREE),r=d(i.ellipsoid,l.default);this._positions=t,this._minimumHeights=o,this._maximumHeights=e,this._granularity=s,this._ellipsoid=l.clone(r),this._workerName="createWallOutlineGeometry";letn=1+t.length*p.packedLength+2;m(o)&&(n+=o.length),m(e)&&(n+=e.length),this.packedLength=n+l.packedLength+1}w.pack=function(i,t,e){if(!m(i))thrownew_("value is required");if(!m(t))thrownew_("array is required");e=d(e,0);leto,s=i._positions,r=s.length;for(t[e++]=r,o=0;o<r;++o,e+=p.packedLength)p.pack(s[o],t,e);letn=i._minimumHeights;if(r=m(n)?n.length:0,t[e++]=r,m(n))for(o=0;o<r;++o)t[e++]=n[o];letc=i._maximumHeights;if(r=m(c)?c.length:0,t[e++]=r,m(c))for(o=0;o<r;++o)t[e++]=c[o];returnl.pack(i._ellipsoid,t,e),e+=l.packedLength,t[e]=i._granularity,t};varG=l.clone(l.UNIT_SPHERE),b={positions:void0,minimumHeights:void0,maximumHeights:void0,ellipsoid:G,granularity:void0};w.unpack=function(i,t,e){if(!m(i))thrownew_("array is required");t=d(t,0);leto,s=i[t++],r=newArray(s);for(o=0;o<s;++o,t+=p.packedLength)r[o]=p.unpack(i,t);s=i[t++];letn;if(s>0)for(n=newArray(s),o=0;o<s;++o)n[o]=i[t++];s=i[t++];letc;if(s>0)for(c=newArray(s),o=0;o<s;++o)c[o]=i[t++];letE=l.unpack(i,t,G);t+=l.packedLength;letu=i[t];returnm(e)?(e._positions=r,e._minimumHeights=n,e._maximumHeights=c,e._ellipsoid=l.clone(E,e._ellipsoid),e._granularity=u,e):(b.positions=r,b.minimumHeights=n,b.maximumHeights=c,b.granularity=u,neww(b))};w.fromConstantHeights=function(i){i=d(i,d.EMPTY_OBJECT);lett=i.positions;if(!m(t))thrownew_("options.positions is required.");lete,o,s=i.minimumHeight,r=i.maximumHeight,n=m(s),c=m(r);if(n||c){letu=t.length;e=n?newArray(u):void0,o=c?newArray(u):void0;for(leta=0;a<u;++a)n&&(e[a]=s),c&&(o[a]=r)}letE={positions:t,maximumHeights:o,minimumHeights:e,ellipsoid:i.ellipsoid};returnneww(E)};w.createGeometry=function(i){lett=i._positions,e=i._minimumHeights,o=i._maximumHeights,s=i._granularity,r=i._ellipsoid,n=B.computePositions(r,t,o,e,s,!1);if(!m(n))return;letc=n.bottomPositions,E=n.topPositions,u=E.length,a=u*2,f=newFloat64Array(a),P=0;u/=3;leth;for(h=0;h<u;++h){letA=h*3,k=p.fromArray(E,A,U),L=p.fromArray(c,A,z);f[P++]=L.x,f[P++]=L.y,f[P++]=L.z,f[P++]=k.x,f[P++]=k.y,f[P++]=k.z}letV=newN({position:newM({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f})}),y=a/3;a=2*y-4+y;letg=W.createTypedArray(y,a),H=0;for(h=0;h<y-2;h+=2){letA=h,k=h+2,L=p.fromArray(f,A*3,U),v=p.fromArray(f,k*3,z);if(p.equalsEpsilon(L,v,O.EPSILON10))continue;letT=h+1,x=h+3;g[H++]=T,g[H++]=A,g[H++]=T,g[H++]=x,g[H++]=A,g[H++]=k}returng[H++]=y-2,g[H++]=y-1,newS({attributes:V,indices:g,primitiveType:R.LINES,boundingSphere:newD.fromVertices(f)})};varC=w;functionJ(i,t){returnm(t)&&(i=C.unpack(i,t)),i._ellipsoid=l.clone(i._ellipsoid),C.createGeometry(i)}varpi=J;export{piasdefault};