define(["./createTaskProcessorWorker","./ComponentDatatype-c140a87d","./Color-5008547b","./S3MCompressType-4145c64c","./pako_inflate-f73548c4","./when-b60132fc","./Check-7b2a090c","./WebGLConstants-4ae0db90","./FeatureDetection-c3b71206","./Math-119be1a3","./RuntimeError-4a5c8994","./BoundingSphere-561b54d0","./Cartographic-3309dd0d","./Cartesian2-47311507","./Cartesian4-3ca25aab","./BoundingRectangle-01b3e970","./PrimitiveType-39acab88","./IndexDatatype-8a5eead4"],(function(t,e,n,r,a,i,E,o,s,y,T,p,A,_,u,v,c,B){"use strict";function f(t,e,n,r,a,i){this.left=t,this.bottom=e,this.right=n,this.top=r,this.minHeight=a,this.maxHeight=i,this.width=n-t,this.length=r-e,this.height=i-a}function m(t,n,r,a,i){var E=r.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var o=0,s={},y=s.vertexAttributes=[],T=s.attrLocation={};s.instanceCount=0,s.instanceMode=0;var p=0;r.getUint32(a,!0),a+=Uint32Array.BYTES_PER_ELEMENT;var A=r.getUint16(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var _=A;A>4&&(_=A>>8,A&=15);var u=r.getUint32(a,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,u>0){var v=r.getUint16(a,!0);v=A*Float32Array.BYTES_PER_ELEMENT,a+=Uint32Array.BYTES_PER_ELEMENT,o=u*v,T.aPosition=p,y.push({index:T.aPosition,typedArray:n.subarray(a,a+o),componentsPerAttribute:A,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:v,normalize:!1}),p++,a+=o}var c=r.getUint32(a,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,c>0){var B=r.getUint16(a,!0);B=_*Float32Array.BYTES_PER_ELEMENT,a+=Uint32Array.BYTES_PER_ELEMENT,o=c*B,t.ignoreNormal||(T.aNormal=p,y.push({index:T.aNormal,typedArray:n.subarray(a,a+o),componentsPerAttribute:_,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:B,normalize:!1}),p++),a+=o}var f=r.getUint32(a,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,f>0){var m=new Uint8Array(4*f);i.push(m.buffer);var l=r.getUint32(a,!0);l=4*Float32Array.BYTES_PER_ELEMENT,a+=Uint32Array.BYTES_PER_ELEMENT,o=f*l;for(var U=new Float32Array(n.buffer,a,4*u),P=0;P0&&(a+=o=16*d);var g=r.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;for(var L,N,M=-1,S=0;S0&&(0==F?(a+=o=C*Uint16Array.BYTES_PER_ELEMENT,C%2==1&&(a+=2)):a+=o=4*C),I.indicesTypedArray=n.subarray(w,w+o);var k=r.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var O=r.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT*k,I.materialCode=O,b.push(I)}return t[E]={vertexPackage:s,arrIndexPackage:b},a}function l(t,n,r){var a=t.vertexAttributes,i=t.attrLocation,E=a.length;i[1===r?"instanceId":"batchId"]=E,a.push({index:E,typedArray:n,componentsPerAttribute:1,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0,instanceDivisor:r})}return new n.Color,t((function(t,e){var n=t.buffer,i=t.supportCompressType,E=t.bVolume,o=null,s=null,y=null;if(E&&t.volbuffer.byteLength<8&&(E=!1),E){var T=t.volbuffer,p=new Uint8Array(T,8),A=a.pako.inflate(p).buffer,_=new Float64Array(A,0,1),u=new Uint32Array(A,48,1);if(0===_[0]||3200===u[0]||3201===u[0]){var v=0;0===_[0]&&(v=8),e.push(A);var c=new Float64Array(A,v,6),B=c[0],U=c[1],P=c[2],d=c[3],g=c[4]c[5]?c[4]:c[5];s={left:B,top:U,right:P,bottom:d,minHeight:g,maxHeight:L,width:(o=new f(B,d,P,U,g,L)).width,length:o.length,height:o.height};var N=new Uint32Array(A,48+v,7),M=N[0],S=N[1],h=N[2],R=N[3];y={nFormat:M,nSideBlockCount:S,nBlockLength:h,nLength:R,nWidth:N[4],nHeight:N[5],nDepth:N[6],imageArray:new Uint8Array(A,76+v,R*R*4)}}}var Y=0,D=new Uint8Array(n,0,4);if(115!==D[0]||51!==D[1]||109!==D[2])return{result:!1};var b=D[3],I=(p=new Uint8Array(n,4),a.pako.inflate(p).buffer),C=new Uint8Array(I);e.push(C.buffer);var F=new DataView(I),x=F.getUint32(Y,!0);Y+=Uint32Array.BYTES_PER_ELEMENT;var w=new Uint8Array(I,Y,x),k=x%4;k&&(k=4-k),Y+=x+k;var O=r.getStringFromTypedArray(w,void 0,void 0,"gbk");O=(O=O.replace(new RegExp("\r\n","gm"),"")).replace(new RegExp(":","gm"),""),F.getUint32(Y,!0),Y+=Uint32Array.BYTES_PER_ELEMENT;var z=F.getUint32(Y,!0);Y+=Uint32Array.BYTES_PER_ELEMENT;var H={};H.ignoreNormal=t.ignoreNormal;for(var G=0;Gr.S3MPixelFormat.BGR||_t===r.S3MPixelFormat.LUMINANCE_ALPHA?(vt=new Uint8Array(I,Y,Tt*pt),ut=new Uint8Array(Tt*pt*4)):(vt=new Uint16Array(I,Y,Q/2),ut=new Uint16Array(Tt*pt)),r.DXTTextureDecode.decode(ut,Tt,pt,vt,_t),e.push(ut.buffer),At=0}else ut=new Uint8Array(I,Y,Q);st[yt]={id:yt,width:Tt,height:pt,compressType:At,nFormat:_t,imageBuffer:ut},Y+=Q}return{result:!0,version:b,xmlDoc:O,geoPackage:H,texturePackage:st,volImageBuffer:y,volBounds:s}}))}));