import{aasC}from"./chunk-JRSUZBXX.js";import{aasv}from"./chunk-N5SNKJ43.js";import{basz}from"./chunk-ZMGESOEZ.js";import"./chunk-ZBEWS6NN.js";import{aasO}from"./chunk-YFQNY2YN.js";import{aasY}from"./chunk-NT26NNVH.js";import{basB,casq,dasy}from"./chunk-NW2YE576.js";import{dasR}from"./chunk-2NIQ5ECB.js";import{hasb}from"./chunk-7YEOLR2L.js";import{aasT}from"./chunk-QHHYYTCM.js";import{aasU,basM,dasw}from"./chunk-RH3GFHG2.js";import{aasP}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{aasE}from"./chunk-TA3RE4KQ.js";import{aasN}from"./chunk-RTY3VPG6.js";import{easS}from"./chunk-LRNH5AEO.js";varj=newR,K=newR,Q=newU,W=newb;functionF(t,e){leti=t._ellipsoid,m=e.height,s=e.width,h=e.northCap,a=e.southCap,_=m,A=2,o=0,g=4;h&&(A-=1,_-=1,o+=1,g-=2),a&&(A-=1,_-=1,o+=1,g-=2),o+=A*s+2*_-g;letn=newFloat64Array(o*3),l=0,f=0,p,r=Q;if(h)C.computePosition(e,i,!1,f,0,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;elsefor(p=0;p<s;p++)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(p=s-1,f=1;f<m;f++)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;if(f=m-1,!a)for(p=s-2;p>=0;p--)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(p=0,f=m-2;f>0;f--)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;letu=n.length/3*2,c=O.createTypedArray(n.length/3,u),H=0;for(letD=0;D<n.length/3-1;D++)c[H++]=D,c[H++]=D+1;c[H++]=n.length/3-1,c[H++]=0;letd=newq({attributes:newY,primitiveType:B.LINES});returnd.attributes.position=newy({componentDatatype:T.DOUBLE,componentsPerAttribute:3,values:n}),d.indices=c,d}functionX(t,e){leti=t._surfaceHeight,m=t._extrudedHeight,s=t._ellipsoid,h=F(t,e),a=e.height,_=e.width,A=z.scaleToGeodeticHeight(h.attributes.position.values,i,s,!1),o=A.length,g=newFloat64Array(o*2);g.set(A);letn=z.scaleToGeodeticHeight(h.attributes.position.values,m,s);g.set(n,o),h.attributes.position.values=g;letl=e.northCap,f=e.southCap,p=4;l&&(p-=1),f&&(p-=1);letr=(g.length/3+p)*2,u=O.createTypedArray(g.length/3,r);o=g.length/6;letc=0;for(letd=0;d<o-1;d++)u[c++]=d,u[c++]=d+1,u[c++]=d+o,u[c++]=d+o+1;u[c++]=o-1,u[c++]=0,u[c++]=o+o-1,u[c++]=o,u[c++]=0,u[c++]=o;letH;if(l)H=a-1;else{letd=_-1;u[c++]=d,u[c++]=d+o,H=_+a-2}if(u[c++]=H,u[c++]=H+o,!f){letd=_+H-1;u[c++]=d,u[c]=d+o}returnh.indices=u,h}functionL(t){t=E(t,E.EMPTY_OBJECT);lete=t.rectangle,i=E(t.granularity,P.RADIANS_PER_DEGREE),m=E(t.ellipsoid,w.default),s=E(t.rotation,0);if(!S(e))thrownewN("rectangle is required.");if(b._validate(e),e.north<e.south)thrownewN("options.rectangle.north must be greater than options.rectangle.south");leth=E(t.height,0),a=E(t.extrudedHeight,h);this._rectangle=b.clone(e),this._granularity=i,this._ellipsoid=m,this._surfaceHeight=Math.max(h,a),this._rotation=s,this._extrudedHeight=Math.min(h,a),this._offsetAttribute=t.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}L.packedLength=b.packedLength+w.packedLength+5;L.pack=function(t,e,i){if(!S(t))thrownewN("value is required");if(!S(e))thrownewN("array is required");returni=E(i,0),b.pack(t._rectangle,e,i),i+=b.packedLength,w.pack(t._ellipsoid,e,i),i+=w.packedLength,e[i++]=t._granularity,e[i++]=t._surfaceHeight,e[i++]=t._rotation,e[i++]=t._extrudedHeight,e[i]=E(t._offsetAttribute,-1),e};varV=newb,J=w.clone(w.UNIT_SPHERE),k={rectangle:V,ellipsoid:J,granularity:void0,height:void0,rotation:void0,extrudedHeight:void0,offsetAttribute:void0};L.unpack=function(t,e,i){if(!S(t))thrownewN("array is required");e=E(e,0);letm=b.unpack(t,e,V);e+=b.packedLength;lets=w.unpack(t,e,J);e+=w.packedLength;leth=t[e++],a=t[e++],_=t[e++],A=t[e++],o=t[e];returnS(i)?(i._rectangle=b.clone(m,i._rectangle),i._ellipsoid=w.clone(s,i._ellipsoid),i._surfaceHeight=a,i._rotation=_,i._extrudedHeight=A,i._offsetAttribute=o===-1?void0:o,i):(k.granularity=h,k.height=a,k.rotation=_,k.extrudedHeight=A,k.offsetAttribute=o===-1?void0:o,newL(k))};varZ=newM;L.createGeometry=function(t){lete=t._rectangle,i=t._ellipsoid,m=C.computeOptions(e,t._granularity,t._rotation,0,W