import{aasCt,basvt}from"./chunk-VQ4ICMD3.js";import{aasMt}from"./chunk-4E3APMCC.js";import{aasz}from"./chunk-HMHR6SIB.js";import"./chunk-VMXXQ6B4.js";import{aasWt}from"./chunk-VYMAIP2A.js";import{aasX}from"./chunk-YFQNY2YN.js";import"./chunk-2NIQ5ECB.js";import{basU,gasbt,hasAt}from"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{aasP,baswt,caslt,daspt}from"./chunk-RH3GFHG2.js";import{aasf}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import{aasm}from"./chunk-RTY3VPG6.js";import{easw}from"./chunk-LRNH5AEO.js";functionT(){m.throwInstantiationError()}Object.defineProperties(T.prototype,{errorEvent:{get:m.throwInstantiationError},credit:{get:m.throwInstantiationError},tilingScheme:{get:m.throwInstantiationError},hasWaterMask:{get:m.throwInstantiationError},hasVertexNormals:{get:m.throwInstantiationError},availability:{get:m.throwInstantiationError}});varOt=[];T.getRegularGridIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)thrownewm("The total number of vertices (width * height) must be less than 4,294,967,296.");leto=Ot[t];w(o)||(Ot[t]=o=[]);lete=o[n];returnw(e)||(t*n<f.SIXTY_FOUR_KILOBYTES?e=o[n]=newUint16Array((t-1)*(n-1)*6):e=o[n]=newUint32Array((t-1)*(n-1)*6),Pt(t,n,e,0)),e};varGt=[];T.getRegularGridIndicesAndEdgeIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)thrownewm("The total number of vertices (width * height) must be less than 4,294,967,296.");leto=Gt[t];w(o)||(Gt[t]=o=[]);lete=o[n];if(!w(e)){letr=T.getRegularGridIndices(t,n),s=Lt(t,n),i=s.westIndicesSouthToNorth,c=s.southIndicesEastToWest,h=s.eastIndicesNorthToSouth,E=s.northIndicesWestToEast;e=o[n]={indices:r,westIndicesSouthToNorth:i,southIndicesEastToWest:c,eastIndicesNorthToSouth:h,northIndicesWestToEast:E}}returne};varkt=[];T.getRegularGridAndSkirtIndicesAndEdgeIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)thrownewm("The total number of vertices (width * height) must be less than 4,294,967,296.");leto=kt[t];w(o)||(kt[t]=o=[]);lete=o[n];if(!w(e)){letr=t*n,s=(t-1)*(n-1)*6,i=t*2+n*2,c=Math.max(0,i-4)*6,h=r+i,E=s+c,g=Lt(t,n),d=g.westIndicesSouthToNorth,p=g.southIndicesEastToWest,b=g.eastIndicesNorthToSouth,L=g.northIndicesWestToEast,N=X.createTypedArray(h,E);Pt(t,n,N,0),T.addSkirtIndices(d,p,b,L,r,N,s),e=o[n]={indices:N,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:b,northIndicesWestToEast:L,indexCountWithoutSkirts:s}}returne};T.addSkirtIndices=function(t,n,o,e,r,s,i){letc=r;i=Z(t,c,s,i),c+=t.length,i=Z(n,c,s,i),c+=n.length,i=Z(o,c,s,i),c+=o.length,Z(e,c,s,i)};functionLt(t,n){leto=newArray(n),e=newArray(t),r=newArray(n),s=newArray(t),i;for(i=0;i<t;++i)s[i]=i,e[i]=t*n-1-i;for(i=0;i<n;++i)r[i]=(i+1)*t-1,o[i]=(n-i-1)*t;return{westIndicesSouthToNorth:o,southIndicesEastToWest:e,eastIndicesNorthToSouth:r,northIndicesWestToEast:s}}functionPt(t,n,o,e){letr=0;for(lets=0;s<n-1;++s){for(leti=0;i<t-1;++i){letc=r,h=c+t,E=h+1,g=c+1;o[e++]=c,o[e++]=h,o[e++]=g,o[e++]=g,o[e++]=h,o[e++]=E,++r}++r}}functionZ(t,n,o,e){letr=t[0],s=t.length;for(leti=1;i<s;++i){letc=t[i];o[e++]=r,o[e++]=c,o[e++]=n,o[e++]=n,o[e++]=c,o[e++]=n+1,r=c,++n}returne}T.heightmapTerrainQuality=.25;T.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(t,n,o){returnt.maximumRadius*2*Math.PI*T.heightmapTerrainQuality/(n*o)};T.prototype.requestTileGeometry=m.throwInstantiationError;T.prototype.getLevelMaximumGeometricError=m.throwInstantiationError;T.prototype.getTileDataAvailable=m.throwInstantiationError;T.prototype.loadTileDataAvailability=m.throwInstantiationError;varVt=T;varht=32767,D=newP,Xt=newP,Zt=newP,u=newwt,Y=newlt;functionJt(t,n){leto=t.quantizedVertices,e=o.length/3,r=t.octEncodedNormals,s=t.westIndices.length+t.eastIndices.length+t.southIndices.length+t.northIndices.length,i=t.includeWebMercatorT,c=t.exaggeration,h=t.exaggerationRelativeHeight,g=c!==1,d=At.clone(t.rectangle),p=d.west,b=d.south,L=d.east,N=d.north,I=pt.clone(t.ellipsoid),y=t.minimumHeight,v=t.maximumHeight,S=t.relativeToCenter,_=bt.eastNorthUpToFixed