S3MBTilesParser.js 254 KB

1
  1. define(["./createTaskProcessorWorker","./Check-7b2a090c","./FeatureDetection-c3b71206","./when-b60132fc","./Matrix4-cde86d0e","./Cartesian2-47311507","./Cartographic-3309dd0d","./Cartesian4-3ca25aab","./Color-5008547b","./ComponentDatatype-c140a87d","./S3MCompressType-25e9ba65","./buildModuleUrl-57a32107","./IndexDatatype-8a5eead4","./RuntimeError-4a5c8994","./BoundingRectangle-c09cdb4c","./WebGLConstants-4ae0db90","./pako_inflate-f73548c4","./arrayFill-4513d7ad","./CompressedTextureBuffer-290a1ff4","./PixelFormat-fd637eac","./Math-119be1a3"],(function(e,t,r,n,o,a,i,s,c,E,u,l,f,d,A,p,g,_,m,y,B){"use strict";function T(e,t,n){if("function"==typeof e.slice)return e.slice(t,n);for(var o=Array.prototype.slice.call(e,t,n),a=r.FeatureDetection.typedArrayTypes,i=a.length,s=0;s<i;++s)if(e instanceof a[s]){o=new a[s](o);break}return o}var C,D={SVC_Vertex:1,SVC_Normal:2,SVC_VertexColor:4,SVC_SecondColor:8,SVC_TexutreCoord:16,SVC_TexutreCoordIsW:32},h=Object.freeze(D);function v(){}function P(e,t){for(var r=e.num_points(),n=e.num_faces(),o=new C.DracoInt32Array,a=3*n,i=f.IndexDatatype.createTypedArray(r,a),s=0,c=0;c<n;++c)t.GetFaceFromMesh(e,c,o),i[s+0]=o.GetValue(0),i[s+1]=o.GetValue(1),i[s+2]=o.GetValue(2),s+=3;var E=f.IndexDatatype.UNSIGNED_SHORT;return i instanceof Uint32Array&&(E=f.IndexDatatype.UNSIGNED_INT),C.destroy(o),{typedArray:i,numberOfIndices:a,indexDataType:E}}function O(e,t,r,n,o){var a,i;n.quantizationBits<=8?(i=new C.DracoUInt8Array,a=new Uint8Array(o),t.GetAttributeUInt8ForAllPoints(e,r,i)):(i=new C.DracoUInt16Array,a=new Uint16Array(o),t.GetAttributeUInt16ForAllPoints(e,r,i));for(var s=0;s<o;++s)a[s]=i.GetValue(s);return C.destroy(i),a}function b(e,t,r,n){var o,a;switch(r.data_type()){case 1:case 11:a=new C.DracoInt8Array,o=new Int8Array(n),t.GetAttributeInt8ForAllPoints(e,r,a);break;case 2:a=new C.DracoUInt8Array,o=new Uint8Array(n),t.GetAttributeUInt8ForAllPoints(e,r,a);break;case 3:a=new C.DracoInt16Array,o=new Int16Array(n),t.GetAttributeInt16ForAllPoints(e,r,a);break;case 4:a=new C.DracoUInt16Array,o=new Uint16Array(n),t.GetAttributeUInt16ForAllPoints(e,r,a);break;case 5:case 7:a=new C.DracoInt32Array,o=new Int32Array(n),t.GetAttributeInt32ForAllPoints(e,r,a);break;case 6:case 8:a=new C.DracoUInt32Array,o=new Uint32Array(n),t.GetAttributeUInt32ForAllPoints(e,r,a);break;case 9:case 10:a=new C.DracoFloat32Array,o=new Float32Array(n),t.GetAttributeFloatForAllPoints(e,r,a)}for(var i=0;i<n;++i)o[i]=a.GetValue(i);return C.destroy(a),o}function F(e,t,r){var o,a=e.num_points(),i=r.num_components(),s=new C.AttributeQuantizationTransform;if(s.InitFromAttribute(r)){for(var c=new Array(i),u=0;u<i;++u)c[u]=s.min_value(u);o={quantizationBits:s.quantization_bits(),minValues:c,range:s.range(),octEncoded:!1}}C.destroy(s),(s=new C.AttributeOctahedronTransform).InitFromAttribute(r)&&(o={quantizationBits:s.quantization_bits(),octEncoded:!0}),C.destroy(s);var l,f=a*i;l=n.defined(o)?O(e,t,r,o,f):b(e,t,r,f);var d=E.ComponentDatatype.fromTypedArray(l);return{array:l,data:{componentsPerAttribute:i,componentDatatype:d,byteOffset:r.byte_offset(),byteStride:E.ComponentDatatype.getSizeInBytes(d)*i,normalized:r.normalized(),quantization:o}}}function S(e,t,r,c,u,l,f){var d=void 0,A=void 0,p=r.vertexAttributes,g=r.attrLocation;if(r.nCompressOptions=0,n.defined(c.posUniqueID)&&c.posUniqueID>=0){r.nCompressOptions|=h.SVC_Vertex;var _=t.GetAttribute(e,c.posUniqueID),m=F(e,t,_),y=m.data.componentsPerAttribute;r.verticesCount=m.array.length/y,r.vertCompressConstant=m.data.quantization.range/(1<<m.data.quantization.quantizationBits);var B=m.data.quantization.minValues;if(r.minVerticesValue=new s.Cartesian4(B[0],B[1],B[2],1),y>3&&(r.minVerticesValue.w=B[3]),g.aPosition=p.length,p.push({index:g.aPosition,typedArray:m.array,componentsPerAttribute:y,componentDatatype:m.data.componentDatatype,offsetInBytes:m.data.byteOffset,strideInBytes:m.data.byteStride,normalize:m.data.normalized}),l){var T=r.verticesCount,C=new i.Cartesian3,D=new i.Cartesian3,v=new i.Cartographic;d=new i.Cartographic,A=new i.Cartographic;for(var P=new Float32Array(2*T),O=new Float64Array(2*T),b=0;b<T;b++)o.Matrix4.multiplyByPoint(u,i.Cartesian3.fromElements(m.array[3*b]*r.vertCompressConstant+B[0],m.array[3*b+1]*r.vertCompressConstant+B[1],m.array[3*b+2]*r.vertCompressConstant+B[2],C),D),v=i.Cartographic.fromCartesian(D),O[2*b]=v.longitude,O[2*b+1]=v.latitude,0===b?(d.longitude=v.longitude,d.latitude=v.latitude,A.longitude=v.longitude,A.latitude=v.latitude):(d.longitude=Math.max(v.longitude,d.longitude),d.latitude=Math.max(v.latitude,d.latitude),A.longitude=Math.min(v.longitude,A.longitude),A.latitude=Math.min(v.latitude,A.latitude));for(b=0;b<T;b++)P[2*b]=O[2*b]-A.longitude,P[2*b+1]=O[2*b+1]-A.latitude;g.img=p.length,p.push({index:g.img,typedArray:P,componentsPerAttribute:2,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:2*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),f.max=d,f.min=A}}if(n.defined(c.normalUniqueID)&&c.normalUniqueID>=0){r.nCompressOptions|=h.SVC_Normal;var S=t.GetAttribute(e,c.normalUniqueID),M=F(e,t,S),R=M.data.quantization;r.normalRangeConstant=(1<<R.quantizationBits)-1,g.aNormal=p.length,p.push({index:g.aNormal,typedArray:M.array,componentsPerAttribute:M.data.componentsPerAttribute,componentDatatype:M.data.componentDatatype,offsetInBytes:M.data.byteOffset,strideInBytes:M.data.byteStride,normalize:M.data.normalized})}if(n.defined(c.colorUniqueID)&&c.colorUniqueID>=0){r.nCompressOptions|=h.SVC_VertexColor;var w=t.GetAttribute(e,c.colorUniqueID),I=F(e,t,w);g.aColor=p.length,p.push({index:g.aColor,typedArray:I.array,componentsPerAttribute:I.data.componentsPerAttribute,componentDatatype:I.data.componentDatatype,offsetInBytes:I.data.byteOffset,strideInBytes:I.data.byteStride,normalize:I.data.normalized})}for(b=0;b<c.texCoordUniqueIDs.length;b++){r.texCoordCompressConstant=[],r.minTexCoordValue=[];var L=c.texCoordUniqueIDs[b];if(!(L<0)){var x=t.GetAttribute(e,L),N=F(e,t,x);if(n.defined(N.data.quantization)){r.nCompressOptions|=h.SVC_TexutreCoord,r.texCoordCompressConstant.push(N.data.quantization.range/(1<<N.data.quantization.quantizationBits));B=N.data.quantization.minValues;r.minTexCoordValue.push(new a.Cartesian2(B[0],B[1]))}var U="aTexCoord"+b;g[U]=p.length,p.push({index:g[U],typedArray:N.array,componentsPerAttribute:N.data.componentsPerAttribute,componentDatatype:N.data.componentDatatype,offsetInBytes:N.data.byteOffset,strideInBytes:N.data.byteStride,normalize:N.data.normalized})}}}v.dracoDecodePointCloud=function(e,t,r,n,o){for(var a=new(C=e).Decoder,i=["POSITION","NORMAL","COLOR"],s=0;s<i.length;++s)a.SkipAttributeTransform(C[i[s]]);var c=new C.DecoderBuffer;if(c.Init(t,r),a.GetEncodedGeometryType(c)!==C.POINT_CLOUD)throw new d.RuntimeError("Draco geometry type must be POINT_CLOUD.");var E=new C.PointCloud,u=a.DecodeBufferToPointCloud(c,E);if(!u.ok()||0===E.ptr)throw new d.RuntimeError("Error decoding draco point cloud: "+u.error_msg());C.destroy(c),S(E,a,n,o),C.destroy(E),C.destroy(a)},v.dracoDecodeMesh=function(e,t,r,n,o,a,i,s,c){for(var E=new(C=e).Decoder,u=["POSITION","NORMAL","COLOR","TEX_COORD"],f=0;f<u.length;++f)E.SkipAttributeTransform(C[u[f]]);var A=new C.DecoderBuffer;if(A.Init(t,r),E.GetEncodedGeometryType(A)!==C.TRIANGULAR_MESH)throw new d.RuntimeError("Unsupported draco mesh geometry type.");var p=new C.Mesh,g=E.DecodeBufferToMesh(A,p);if(!g.ok()||0===p.ptr)throw new d.RuntimeError("Error decoding draco mesh geometry: "+g.error_msg());C.destroy(A),S(p,E,n,a,i,s,c);var _=P(p,E);o.indicesTypedArray=_.typedArray,o.indicesCount=_.numberOfIndices,o.indexType=_.indexDataType,o.primitiveType=l.PrimitiveType.TRIANGLES,C.destroy(p),C.destroy(E)};var M={OSGBFile:0,OSGBCacheFile:1,ClampGroundPolygon:2,ClampObjectPolygon:3,ClampGroundLine:4,ClampObjectLine:5,IconPoint:6,Text:7,PointCloudFile:8,ExtendRegion3D:9,ExtendClampPolygonCache:10,PolylineEffect:11,RegionEffect:12,ClampGroundAndObjectLineCache:13,ClampGroundRealtimeRasterCache:14},R=Object.freeze(M);function w(){}function I(e){var t=new l.BoundingSphere,r=e.instanceBounds;if(!n.defined(r))return t;var o=new i.Cartesian3(r[0],r[1],r[2]),a=new i.Cartesian3(r[3],r[4],r[5]),s=i.Cartesian3.lerp(o,a,.5,new i.Cartesian3),c=i.Cartesian3.distance(s,o);return t.center=s,t.radius=c,t}function L(e){var t,r,o=new l.BoundingSphere,a=new i.Cartesian3,s=e.vertexAttributes[0],c=s.componentsPerAttribute,E=n.defined(e.nCompressOptions)&&(e.nCompressOptions&h.SVC_Vertex)===h.SVC_Vertex,u=1;E?(u=e.vertCompressConstant,t=new i.Cartesian3(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),r=new Uint16Array(s.typedArray.buffer,s.typedArray.byteOffset,s.typedArray.byteLength/2)):r=new Float32Array(s.typedArray.buffer,s.typedArray.byteOffset,s.typedArray.byteLength/4);for(var f=[],d=0;d<e.verticesCount;d++)i.Cartesian3.fromArray(r,c*d,a),E&&(a=i.Cartesian3.multiplyByScalar(a,u,a),a=i.Cartesian3.add(a,t,a)),f.push(i.Cartesian3.clone(a));return l.BoundingSphere.fromPoints(f,o),f.length=0,o}function x(e){var t,r,o=new l.BoundingSphere,a=new i.Cartesian3,s=n.defined(e.nCompressOptions)&&(e.nCompressOptions&h.SVC_Vertex)===h.SVC_Vertex,c=e.vertexAttributes[0],E=c.componentsPerAttribute,u=1;s?(u=e.vertCompressConstant,r=new i.Cartesian3(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),t=new Uint16Array(c.typedArray.buffer,c.typedArray.byteOffset,c.typedArray.byteLength/2)):t=new Float32Array(c.typedArray.buffer,c.typedArray.byteOffset,c.typedArray.byteLength/4);for(var f=[],d=0;d<e.verticesCount;d++)i.Cartesian3.fromArray(t,E*d,a),s&&(a=i.Cartesian3.multiplyByScalar(a,u,a),a=i.Cartesian3.add(a,r,a)),f.push(i.Cartesian3.clone(a));return l.BoundingSphere.fromPoints(f,o),f.length=0,o}function N(e){var t,r,o=n.defined(e.nCompressOptions)&&(e.nCompressOptions&h.SVC_Vertex)===h.SVC_Vertex,s=new A.BoundingRectangle,c=e.vertexAttributes[0],E=c.componentsPerAttribute,u=1;o?(u=e.vertCompressConstant,r=new i.Cartesian3(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),t=new Uint16Array(c.typedArray.buffer,c.typedArray.byteOffset,c.typedArray.byteLength/2)):t=new Float32Array(c.typedArray.buffer,c.typedArray.byteOffset,c.typedArray.byteLength/4);for(var l=[],f=0;f<e.verticesCount;f++){var d=t[E*f],p=t[E*f+1];o&&(d=u*d+r.x,p=u*p+r.y),l.push(new a.Cartesian2(d,p))}return A.BoundingRectangle.fromPoints(l,s),l.length=0,s}function U(e){var t,r,o=n.defined(e.nCompressOptions)&&(e.nCompressOptions&h.SVC_Vertex)===h.SVC_Vertex,a=new l.BoundingSphere,s=new i.Cartesian3,c=new i.Cartesian3,E=e.vertexAttributes[0],u=E.componentsPerAttribute,f=e.attrLocation.aPosition,d=e.vertexAttributes[f],A=e.attrLocation.aTexCoord5,p=e.vertexAttributes[A],g=p.componentsPerAttribute;o?(u=3,g=3,t=H(e,d),r=X(e,p,5)):(t=new Float32Array(E.typedArray.buffer,E.typedArray.byteOffset,E.typedArray.byteLength/4),r=new Float32Array(p.typedArray.buffer,p.typedArray.byteOffset,p.typedArray.byteLength/4));for(var _=[],m=0;m<e.verticesCount;m++)i.Cartesian3.fromArray(t,u*m,s),i.Cartesian3.fromArray(r,g*m,c),i.Cartesian3.add(s,c,s),_.push(i.Cartesian3.clone(s));return l.BoundingSphere.fromPoints(_,a),_.length=0,a}function G(e){var t=l.PrimitiveType.TRIANGLES;switch(e){case 1:t=l.PrimitiveType.POINTS;break;case 2:t=l.PrimitiveType.LINES;break;case 3:t=l.PrimitiveType.LINE_STRIP;break;case 4:t=l.PrimitiveType.TRIANGLES}return t}function k(e,t,r,n){var o,a={};a.indicesCount=6*(e-t),a.indexType=n>65535?1:0,a.primitiveType=l.PrimitiveType.TRIANGLES,o=0===a.indexType?new Uint16Array(a.indicesCount):new Uint32Array(a.indicesCount);for(var i=0,s=0;s<t;s++){for(var c=0;c<r[s]-1;c++)o[6*(i-s+c)]=4*(i-s+c),o[6*(i-s+c)+1]=4*(i-s+c)+2,o[6*(i-s+c)+2]=4*(i-s+c)+1,o[6*(i-s+c)+3]=4*(i-s+c)+1,o[6*(i-s+c)+4]=4*(i-s+c)+2,o[6*(i-s+c)+5]=4*(i-s+c)+3;i+=r[s]}return a.indicesTypedArray=o,a}function H(e,t){for(var r,n,o,a=t.componentsPerAttribute,s=e.vertCompressConstant,c=new i.Cartesian3(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),E=new Uint16Array(t.typedArray.buffer,t.typedArray.byteOffset,t.typedArray.byteLength/2),u=new Float32Array(3*e.verticesCount),l=0;l<e.verticesCount;l++)r=E[a*l]*s+c.x,n=E[a*l+1]*s+c.y,o=E[a*l+2]*s+c.z,u[3*l]=r,u[3*l+1]=n,u[3*l+2]=o;return u}function X(e,t,r){for(var n,o,a,i=t.componentsPerAttribute,c=e.texCoordCompressConstant[r],E=new s.Cartesian4(e.minTexCoordValue[r].x,e.minTexCoordValue[r].y,e.minTexCoordValue[r].z,e.minTexCoordValue[r].w),u=new Uint16Array(t.typedArray.buffer,t.typedArray.byteOffset,t.typedArray.byteLength/2),l=new Float32Array(3*e.verticesCount),f=0;f<e.verticesCount;f++)n=u[i*f]*c+E.x,o=u[i*f+1]*c+E.y,a=u[i*f+2]*c+E.z,l[3*f]=n,l[3*f+1]=o,l[3*f+2]=a;return l}function V(e){for(var t=[],r=e.length,n=0;n<r;n++){var o=G(e[n].primitiveType);o!==l.PrimitiveType.LINES&&o!==l.PrimitiveType.LINE_STRIP||t.push(e[n])}return t}function K(e){for(var t=0,r=e.length,n=0;n<r;n++){var o=e[n],a=G(o.primitiveType);a==l.PrimitiveType.LINES?t+=o.indicesCount/2:a==l.PrimitiveType.LINE_STRIP&&t++}return t}function j(e){for(var t=0,r=e.length,n=0;n<r;n++){t+=e[n].indicesCount}return t}function Y(e,t,r){for(var n,o=[],a=r.length,s=0;s<a;s++){var c,E=r[s];c=0===E.indexType?new Uint16Array(E.indicesTypedArray.buffer,E.indicesTypedArray.byteOffset,E.indicesTypedArray.byteLength/2):new Uint32Array(E.indicesTypedArray.buffer,E.indicesTypedArray.byteOffset,E.indicesTypedArray.byteLength/4);var u=G(E.primitiveType);if(u==l.PrimitiveType.LINES)for(n=0;n<E.indicesCount;n+=2){var f=[],d=new i.Cartesian3;d.x=e[c[n]*t],d.y=e[c[n]*t+1],d.z=e[c[n]*t+2],f.push(d);var A=new i.Cartesian3;A.x=e[c[n+1]*t],A.y=e[c[n+1]*t+1],A.z=e[c[n+1]*t+2],f.push(A),o.push(f)}else if(u==l.PrimitiveType.LINE_STRIP){f=[];for(n=0;n<E.indicesCount;n++){var p=new i.Cartesian3;p.x=e[c[n]*t],p.y=e[c[n]*t+1],p.z=e[c[n]*t+2],f.push(p)}o.push(f)}}return o}function Q(){return!0}function J(e,t){function r(){}for(var n in e)"function"==typeof e[n]&&(e[n]=r);e.isDestroyed=Q}w.calcBoundingSphereInWorker=function(e,t){return t.instanceIndex>-1?I(t):n.defined(t.clampRegionEdge)?U(t):e>=R.ClampGroundPolygon&&e<=R.ClampObjectLine?x(t):e==R.ClampGroundAndObjectLineCache?U(t):L(t)},w.calcBoundingSphere=function(e,t,r){var o,a=e._fileType;return o=t.instanceIndex>-1?I(t):n.defined(t.clampRegionEdge)?U(t):a>=R.ClampGroundPolygon&&a<=R.ClampObjectLine?x(t):a==R.ClampGroundAndObjectLineCache?U(t):L(t),l.BoundingSphere.transform(o,r,o),o},w.calcBoundingRectangle=function(e,t){var r;return e._fileType===R.ClampGroundPolygon&&(r=N(t)),r},w.createEdge=function(e,t){if(!(t.length<1)){var r=V(t);if(0!=r.length){var o,a=K(r),i=e.attrLocation.aPosition,s=e.vertexAttributes[i],c=n.defined(e.nCompressOptions)&&(e.nCompressOptions&h.SVC_Vertex)===h.SVC_Vertex,u=s.componentsPerAttribute;c?(u=3,o=H(e,s)):o=new Float32Array(s.typedArray.buffer,s.typedArray.byteOffset,s.typedArray.byteLength/4);for(var l=j(r),f=Y(o,u,r),d=4*l-4*a,A=new Float32Array(3*d),p=new Float32Array(3*d),g=new Float32Array(3*d),_=new Int8Array(2*d),m=0,y=0;y<a;y++){for(var B=f[y].length,T=0;T<B;T++){var C=4*m-4*y,D=3*C+12*T,v=f[y][T];0!=T&&(A[D-6]=v.x,A[D-5]=v.y,A[D-4]=v.z,A[D-3]=v.x,A[D-2]=v.y,A[D-1]=v.z),T!=B-1&&(A[D]=v.x,A[D+1]=v.y,A[D+2]=v.z,A[D+3]=v.x,A[D+4]=v.y,A[D+5]=v.z);var P=v;T+1<B&&(P=f[y][T+1]),0!=T&&(g[D-6]=P.x,g[D-5]=P.y,g[D-4]=P.z,g[D-3]=P.x,g[D-2]=P.y,g[D-1]=P.z),T!=B-1&&(g[D]=P.x,g[D+1]=P.y,g[D+2]=P.z,g[D+3]=P.x,g[D+4]=P.y,g[D+5]=P.z);var O=v;T>=1&&(O=f[y][T-1]),0!=T&&(p[D-6]=O.x,p[D-5]=O.y,p[D-4]=O.z,p[D-3]=O.x,p[D-2]=O.y,p[D-1]=O.z),T!=B-1&&(p[D]=O.x,p[D+1]=O.y,p[D+2]=O.z,p[D+3]=O.x,p[D+4]=O.y,p[D+5]=O.z),D=2*C+8*T,0!=T&&(_[D-4]=-1,_[D-3]=-1,_[D-2]=1,_[D-1]=-1),T!=B-1&&(_[D]=-1,_[D+1]=1,_[D+2]=1,_[D+3]=1)}m+=f[y].length}var b={vertexAttributes:[],attrLocation:{}},F=b.vertexAttributes,S=b.attrLocation;b.instanceCount=0,b.instanceMode=0,S.aPosition=0,F.push({index:S.aPosition,typedArray:A,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),S.aNormal=1,F.push({index:S.aNormal,typedArray:p,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),S.aTexCoord0=2,F.push({index:S.aTexCoord0,typedArray:g,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),S.aTexCoord1=3,F.push({index:S.aTexCoord1,typedArray:_,componentsPerAttribute:2,componentDatatype:E.ComponentDatatype.BYTE,offsetInBytes:0,strideInBytes:2*Int8Array.BYTES_PER_ELEMENT,normalize:!1});for(var M=[],R=0;R<f.length;R++)M.push(f[R].length);return{vertexPackage:b,indexPackage:k(l,a,M,d)}}}};var z={STREAM_DRAW:p.WebGLConstants.STREAM_DRAW,STATIC_DRAW:p.WebGLConstants.STATIC_DRAW,DYNAMIC_DRAW:p.WebGLConstants.DYNAMIC_DRAW,validate:function(e){return e===z.STREAM_DRAW||e===z.STATIC_DRAW||e===z.DYNAMIC_DRAW}};function W(e){var t=(e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT)).context._gl,r=e.bufferTarget,o=e.typedArray,a=e.sizeInBytes,i=e.usage,s=n.defined(o);s&&(a=o.byteLength);var c=t.createBuffer();t.bindBuffer(r,c),t.bufferData(r,s?o:a,i),t.bindBuffer(r,null),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=r,this._sizeInBytes=a,this._usage=i,this._buffer=c,this.vertexArrayDestroyable=!0,this.context=e.context,e.context.memorySize+=a}function Z(){}function q(e){--e;for(var t=1;32>t;t<<=1)e|=e>>t;return e+1}W.createVertexBuffer=function(e){return new W({context:e.context,bufferTarget:p.WebGLConstants.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},W.createIndexBuffer=function(e){var t=e.context,r=e.indexDatatype,n=f.IndexDatatype.getSizeInBytes(r),o=new W({context:t,bufferTarget:p.WebGLConstants.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),a=o.sizeInBytes/n;return Object.defineProperties(o,{indexDatatype:{get:function(){return r}},bytesPerIndex:{get:function(){return n}},numberOfIndices:{get:function(){return a}}}),o},Object.defineProperties(W.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),W.prototype._getBuffer=function(){return this._buffer},W.prototype.copyFromArrayView=function(e,t){t=n.defaultValue(t,0);var r=this._gl,o=this._bufferTarget;r.bindBuffer(o,this._buffer),r.bufferSubData(o,t,e),r.bindBuffer(o,null)},W.prototype.copyFromBuffer=function(e,t,r,n){var o=p.WebGLConstants.COPY_READ_BUFFER,a=p.WebGLConstants.COPY_WRITE_BUFFER,i=this._gl;i.bindBuffer(a,this._buffer),i.bindBuffer(o,e._buffer),i.copyBufferSubData(o,a,t,r,n),i.bindBuffer(a,null),i.bindBuffer(o,null)},W.prototype.getBufferData=function(e,t,r,o){t=n.defaultValue(t,0),r=n.defaultValue(r,0);var a=this._gl,i=p.WebGLConstants.COPY_READ_BUFFER;a.bindBuffer(i,this._buffer),a.getBufferSubData(i,t,e,r,o),a.bindBuffer(i,null)},W.prototype.isDestroyed=function(){return!1},W.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),this.context.memorySize-=this.sizeInBytes,J(this)},Z.computeNeighbors=function(e,t){for(var r=e.length/3,n=new Uint32Array(t+1),o=new Uint32Array(t+1),a=function(e,t){e<t?n[e+1]++:o[t+1]++},i=0;i<r;i++){var s=e[3*i],c=e[3*i+1],E=e[3*i+2];a(s,c),a(c,E),a(E,s)}for(i=c=s=0;i<t;i++)E=n[i+1],a=o[i+1],n[i+1]=s,o[i+1]=c,s+=E,c+=a;var u=new Uint32Array(6*r),l=n[t];for(a=function(e,t,r){if(e<t){var a=n[e+1]++;u[2*a]=t,u[2*a+1]=r}else a=o[t+1]++,u[2*l+2*a]=e,u[2*l+2*a+1]=r},i=0;i<r;i++)s=e[3*i],c=e[3*i+1],E=e[3*i+2],a(s,c,i),a(c,E,i),a(E,s,i);for(s=function(e,t){var r=2*e;for(e=t-e,t=1;t<e;t++){for(var n=u[r+2*t],o=u[r+2*t+1],a=t-1;0<=a&&u[r+2*a]>n;a--)u[r+2*a+2]=u[r+2*a],u[r+2*a+3]=u[r+2*a+1];u[r+2*a+2]=n,u[r+2*a+3]=o}},i=0;i<t;i++)s(n[i],n[i+1]),s(l+o[i],l+o[i+1]);var f=new Int32Array(3*r),d=function(t,r){return t===e[3*r]?0:t===e[3*r+1]?1:t===e[3*r+2]?2:-1};for(r=function(e,t){e=d(e,t),f[3*t+e]=-1},s=function(e,t,r,n){e=d(e,t),f[3*t+e]=n,r=d(r,n),f[3*n+r]=t},i=0;i<t;i++){c=n[i],E=n[i+1],a=o[i];for(var A=o[i+1];c<E&&a<A;){var p=u[2*c],g=u[2*l+2*a];p===g?(s(i,u[2*c+1],g,u[2*l+2*a+1]),c++,a++):p<g?(r(i,u[2*c+1]),c++):(r(g,u[2*l+2*a+1]),a++)}for(;c<E;)r(i,u[2*c+1]),c++;for(;a<A;)r(g=u[2*l+2*a],u[2*l+2*a+1]),a++}return f};var $=null;function ee(){}function te(e){return Math.acos(1<e?1:-1>e?-1:e)}function re(e){return e*Math.PI/180}Z.deduplicate=function(e,t,r,n,o){void 0===r&&(r=0),void 0===n&&(n=0),void 0===o&&(o=e.byteLength/(4*t)),e=new Uint32Array(e,n,o*t),n=new Uint32Array(o);var a=Math.floor(1.1*o)+1;(null==$||$.length<2*a)&&($=new Uint32Array(q(2*a)));for(var i=0;i<2*a;i++)$[i]=0;var s=0,c=0!==r?Math.ceil(7.84*1.96/(r*r)*r*(1-r)):o;for(i=0;i<o;i++){if(i===c){if((u=1-s/i)+1.96*Math.sqrt(u*(1-u)/i)<r)return null;c*=2}for(var E,u=i*t,l=E=0;l<t;l++)E=(E=e[u+l]+E|0)+(E<<11)+(E>>>2)|0;l=(E>>>=0)%a;for(var f=s;0!==$[2*l+1];){if($[2*l]===E){var d=$[2*l+1]-1,A=d*t;e:{for(var p=0;p<t;p++)if(e[u+p]!==e[A+p]){A=!1;break e}A=!0}if(A){f=n[d];break}}++l>=a&&(l-=a)}f===s&&($[2*l]=E,$[2*l+1]=i+1,s++),n[i]=f}if(0!==r&&1-s/o<r)return null;for(r=new Uint32Array(t*s),i=s=0;i<o;i++)if(n[i]===s){for(a=e,c=i*t,u=r,E=s*t,l=t,f=0;f<l;f++)u[E+f]=a[c+f];s++}return{buffer:r.buffer,indices:n,uniqueCount:s}};var ne=4,oe=35,ae=re(ne),ie=re(oe),se=Math.cos(ie),ce=Math.cos(ae);function Ee(e,t,r){var n=r.x-t.x,o=r.y-t.y;return(r=n*n+o*o+(t=r.z-t.z)*t)?(r=1/Math.sqrt(r),e.x=n*r,e.y=o*r,e.z=t*r,e):(e.x=0,e.y=0,e.z=0,e)}var ue={position0:new i.Cartesian3,position1:new i.Cartesian3,faceNormal0:new i.Cartesian3,faceNormal1:new i.Cartesian3,cosAngle:0},le=new i.Cartesian3,fe=new i.Cartesian3;function de(e,t){var r=te(e.cosAngle);return Ee(fe,e.position1,e.position0),i.Cartesian3.cross(e.faceNormal0,e.faceNormal1,le),r*(0<i.Cartesian3.dot(le,fe)?-1:1)>t}function Ae(e){var t=e.faces.length/3,r=e.faces,n=e.neighbors,o=0,a=0;for(a=0;a<t;a++){var i=n[3*a+0],s=n[3*a+1],c=n[3*a+2],E=r[3*a+0],u=r[3*a+1],l=r[3*a+2];o+=-1===i||E<u?1:0,o+=-1===s||u<l?1:0,o+=-1===c||l<E?1:0}var f=new Int32Array(4*o),d=0;for(a=0;a<t;a++){i=n[3*a+0],s=n[3*a+1],c=n[3*a+2],E=r[3*a+0],u=r[3*a+1],l=r[3*a+2];(-1===i||E<u)&&(f[d++]=E,f[d++]=u,f[d++]=a,f[d++]=i),(-1===s||u<l)&&(f[d++]=u,f[d++]=l,f[d++]=a,f[d++]=s),(-1===c||l<E)&&(f[d++]=l,f[d++]=E,f[d++]=a,f[d++]=c)}return f}var pe=new i.Cartesian3,ge=new i.Cartesian3,_e=new i.Cartesian3;function me(e){var t=e.x*e.x+e.y*e.y+e.z*e.z;t>0&&(t=1/Math.sqrt(t),e.x*=t,e.y*=t,e.z*=t)}function ye(e){for(var t=e.faces.length/3,r=e.vertices,n=e.dim,o=e.faces,a=new Float32Array(3*t),s=0;s<t;s++){var c=o[3*s+0],E=o[3*s+1],u=o[3*s+2];pe.x=r[n*c],pe.y=r[n*c+1],pe.z=r[n*c+2],ge.x=r[n*E],ge.y=r[n*E+1],ge.z=r[n*E+2],_e.x=r[n*u],_e.y=r[n*u+1],_e.z=r[n*u+2],i.Cartesian3.subtract(ge,pe,ge),i.Cartesian3.subtract(_e,pe,_e),i.Cartesian3.cross(ge,_e,pe),me(pe),a[3*s+0]=pe.x,a[3*s+1]=pe.y,a[3*s+2]=pe.z}return a}function Be(e,t){0===t&&(t=e,e=0);for(var r=Array(t-e),n=e;n<t;n++)r[n-e]=n;return r}function Te(e){}function Ce(e){if(n.defined(e.cachedSidenessVertexBuffer))return e.cachedSidenessVertexBuffer;var t=new Float32Array(8),r=0;return t[r++]=0,t[r++]=0,t[r++]=0,t[r++]=1,t[r++]=1,t[r++]=1,t[r++]=1,t[r++]=0,e.cachedSidenessVertexBuffer=W.createVertexBuffer({context:e,typedArray:t,usage:z.STATIC_DRAW}),e.cachedSidenessVertexBuffer.vertexArrayDestroyable=!1,e.cachedSidenessVertexBuffer}function De(){var e=new Uint16Array(6),t=0;return e[t++]=2,e[t++]=1,e[t++]=0,e[t++]=3,e[t++]=2,e[t++]=0,e}function he(e,t){for(var r,n,o,a=t.componentsPerAttribute,s=e.vertCompressConstant,c=new i.Cartesian3(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),E=new Uint16Array(t.typedArray.buffer,t.typedArray.byteOffset,t.typedArray.byteLength/2),u=new Float32Array(3*e.verticesCount),l=0;l<e.verticesCount;l++)r=E[a*l]*s+c.x,n=E[a*l+1]*s+c.y,o=E[a*l+2]*s+c.z,u[3*l]=r,u[3*l+1]=n,u[3*l+2]=o;return u}ee.extractEdges=function(e){var t=e.vertices,r=e.dim,n=ue,o=n.position0,a=n.position1,s=n.faceNormal0,c=n.faceNormal1,E=ye(e),u=Ae(e),l=u.length/4,f=new Float32Array(9*l),d=0,A=new Float32Array(12*l),p=0,g=0,_=0,m=Be(0,l),y=new Float32Array(l);y.forEach((function(e,n,s){var c=u[4*n+0],E=u[4*n+1];o.x=t[c*r],o.y=t[c*r+1],o.z=t[c*r+2],a.x=t[E*r],a.y=t[E*r+1],a.z=t[E*r+2],s[n]=i.Cartesian3.distance(o,a)})),m.sort((function(e,t){return y[t]-y[e]}));for(var B=[],T=[],C=0;C<l;C++){var D=m[C],h=y[D],v=u[4*D+0],P=u[4*D+1],O=u[4*D+2],b=u[4*D+3],F=-1===b;if(o.x=t[v*r],o.y=t[v*r+1],o.z=t[v*r+2],a.x=t[P*r],a.y=t[P*r+1],a.z=t[P*r+2],F)s.x=E[3*O],s.y=E[3*O+1],s.z=E[3*O+2],c.x=s.x,c.y=s.y,c.z=s.z,n.cosAngle=i.Cartesian3.dot(s,c);else if(s.x=E[3*O],s.y=E[3*O+1],s.z=E[3*O+2],c.x=E[3*b],c.y=E[3*b+1],c.z=E[3*b+2],n.cosAngle=i.Cartesian3.dot(s,c),n.cosAngle>ce)continue;g+=h,_++,F||n.cosAngle<se?(f[d++]=n.position0.x,f[d++]=n.position0.y,f[d++]=n.position0.z,f[d++]=n.position1.x,f[d++]=n.position1.y,f[d++]=n.position1.z,f[d++]=n.faceNormal0.x,f[d++]=n.faceNormal0.y,f[d++]=n.faceNormal0.z,B.push(h)):de(n,ae)&&(A[p++]=n.position0.x,A[p++]=n.position0.y,A[p++]=n.position0.z,A[p++]=n.position1.x,A[p++]=n.position1.y,A[p++]=n.position1.z,A[p++]=n.faceNormal0.x,A[p++]=n.faceNormal0.y,A[p++]=n.faceNormal0.z,A[p++]=n.faceNormal1.x,A[p++]=n.faceNormal1.y,A[p++]=n.faceNormal1.z,T.push(h))}f=f.slice(0,d),A=A.slice(0,p);var S=g/_,M=B.length,R=T.length;return{regular:{instancesData:f,instanceCount:M,edgeLength:M*S},silhouette:{instancesData:A,instanceCount:R,edgeLength:R*S},averageEdgeLength:S}},Te.RegularInstanceStride=12,Te.SilhouetteInstanceStride=15,Te.createEdgeData=function(e,t,r){if(0==t.length)return null;var o,a=t[0];o=0===a.indexType?new Uint16Array(a.indicesTypedArray.buffer,a.indicesTypedArray.byteOffset,a.indicesTypedArray.byteLength/2):new Uint32Array(a.indicesTypedArray.buffer,a.indicesTypedArray.byteOffset,a.indicesTypedArray.byteLength/4);var i=Te.extractEdgeInformation(e,!1,o),s=ee.extractEdges(i);return n.defined(r)&&(n.defined(s.regular.instancesData)&&r.push(s.regular.instancesData.buffer),n.defined(s.silhouette.instancesData)&&r.push(s.silhouette.instancesData.buffer)),s},Te.createIndexBuffer=function(e){return n.defined(e.cachedSidenessIndexBuffer)||(e.cachedSidenessIndexBuffer=W.createIndexBuffer({context:e,typedArray:De(),usage:z.STATIC_DRAW,indexDatatype:f.IndexDatatype.UNSIGNED_SHORT}),e.cachedSidenessIndexBuffer.vertexArrayDestroyable=!1),e.cachedSidenessIndexBuffer},Te.createRegularEdgeAttributes=function(e,t){if(n.defined(t.instancesData)&&0!=t.instancesData.length){var r={},o=[];t.attributeLocations=r,t.attributes=o;var a=W.createVertexBuffer({context:e,typedArray:t.instancesData,usage:z.STATIC_DRAW});t.instancesData=null;var i=E.ComponentDatatype.getSizeInBytes(E.ComponentDatatype.FLOAT),s=Ce(e),c=0;r.aSideness=c++,o.push({index:r.aSideness,vertexBuffer:s,componentsPerAttribute:2,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:2*E.ComponentDatatype.getSizeInBytes(E.ComponentDatatype.FLOAT),normalize:!1});var u=Te.RegularInstanceStride,l=0;r.aPosition0=c++,o.push({index:r.aPosition0,vertexBuffer:a,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:i*l,strideInBytes:i*u,instanceDivisor:1}),l+=3,r.aPosition1=c++,o.push({index:r.aPosition1,vertexBuffer:a,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:i*l,strideInBytes:i*u,instanceDivisor:1}),l+=3,r.aNormal=c++,o.push({index:r.aNormal,vertexBuffer:a,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!0,offsetInBytes:i*l,strideInBytes:i*u,instanceDivisor:1}),l+=3,r.batchId=c++,o.push({index:r.batchId,vertexBuffer:a,componentsPerAttribute:1,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!0,offsetInBytes:i*l,strideInBytes:i*u,instanceDivisor:1}),l+=1,r.aVariantStroke=c++,o.push({index:r.aVariantStroke,vertexBuffer:a,componentsPerAttribute:1,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!0,offsetInBytes:i*l,strideInBytes:i*u,instanceDivisor:1}),l+=1,r.aVariantExtension=c++,o.push({index:r.aVariantExtension,vertexBuffer:a,componentsPerAttribute:1,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!0,offsetInBytes:i*l,strideInBytes:i*u,instanceDivisor:1}),l+=1}},Te.createSilhouetteEdgeAttributes=function(e,t){if(n.defined(t.instancesData)&&0!=t.instancesData.length){var r={},o=[];t.attributeLocations=r,t.attributes=o;var a=W.createVertexBuffer({context:e,typedArray:t.instancesData,usage:z.STATIC_DRAW});t.instancesData=null;var i=E.ComponentDatatype.getSizeInBytes(E.ComponentDatatype.FLOAT),s=0;r.aSideness=s++,o.push({index:r.aSideness,vertexBuffer:Ce(e),componentsPerAttribute:2,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:2*i,normalize:!1});var c=Te.SilhouetteInstanceStride,u=0;r.aPosition0=s++,o.push({index:r.aPosition0,vertexBuffer:a,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:i*u,strideInBytes:i*c,instanceDivisor:1}),u+=3,r.aPosition1=s++,o.push({index:r.aPosition1,vertexBuffer:a,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:i*u,strideInBytes:i*c,instanceDivisor:1}),u+=3,r.aNormalA=s++,o.push({index:r.aNormalA,vertexBuffer:a,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!0,offsetInBytes:i*u,strideInBytes:i*c,instanceDivisor:1}),u+=3,r.aNormalB=s++,o.push({index:r.aNormalB,vertexBuffer:a,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!0,offsetInBytes:i*u,strideInBytes:i*c,instanceDivisor:1}),u+=3,r.batchId=s++,o.push({index:r.batchId,vertexBuffer:a,componentsPerAttribute:1,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!0,offsetInBytes:i*u,strideInBytes:i*c,instanceDivisor:1}),u+=1,r.aVariantStroke=s++,o.push({index:r.aVariantStroke,vertexBuffer:a,componentsPerAttribute:1,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!0,offsetInBytes:i*u,strideInBytes:i*c,instanceDivisor:1}),u+=1,r.aVariantExtension=s++,o.push({index:r.aVariantExtension,vertexBuffer:a,componentsPerAttribute:1,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!0,offsetInBytes:i*u,strideInBytes:i*c,instanceDivisor:1}),u+=1}},Te.extractEdgeInformation=function(e,t,r){var o,a=e.attrLocation.aPosition,i=e.vertexAttributes[a],s=n.defined(e.nCompressOptions)&&(e.nCompressOptions&h.SVC_Vertex)===h.SVC_Vertex,c=i.componentsPerAttribute;s?(c=3,o=he(e,i)):o=new Float32Array(i.typedArray.buffer,i.typedArray.byteOffset,i.typedArray.byteLength/4);var E=o.length/c;if(t&&r)return{faces:r,neighbors:Z.computeNeighbors(r,E),vertices:o,dim:c};var u,l=i.typedArray.buffer;u=s?o.buffer:l.slice(i.typedArray.byteOffset,i.typedArray.byteOffset+i.typedArray.byteLength);var f=Z.deduplicate(u,c),d=Te.selectIndexData(f.indices,r);return{faces:d,neighbors:Z.computeNeighbors(d,f.uniqueCount),vertices:new Float32Array(f.buffer),dim:c}},Te.selectIndexData=function(e,t){if(t){t=t.slice();for(var r=0;r<t.length;r++)t[r]=e[t[r]];return t}return e};var ve=new i.Cartesian3,Pe=new i.Cartesian3,Oe=new i.Cartesian3,be=new i.Cartesian3,Fe=new i.Cartesian3,Se=new i.Cartesian3,Me=new i.Cartesian3,Re=new i.Cartesian3;function we(e,t){function r(e,t,r){var n=48217*e%2147483647,o=t+n/2147483647*(r-=t);return{seed:n,result:Math.round(o)}}var o=function(e,t){var r=new Float32Array(6),n=new Uint32Array(r.buffer),o=new Uint32Array(1);r[0]=e.x,r[1]=e.y,r[2]=e.z,r[3]=t.x,r[4]=t.y,r[5]=t.z,o[0]=5381;for(var a=0;a<n.length;a++)o[0]=31*o[0]+n[a];return o[0]}(e,t);n.defined(o)||(o=2147483647*Math.random());var a=r(o,0,255);o=a.seed,a.result,o=(a=r(o,0,5)).seed;var i=a.result;a=function(e){var t=48217*e%2147483647;return{seed:t,result:t/2147483646}}(o),o=a.seed;var s=a.result;return s=-(1-Math.min(s/.7,1))+Math.max(0,s-.7)/(1-.7),{variantStroke:i,variantExtension:s=255*(Math.abs(s)**1.2*(0>s?-1:1)*.5+.5)}}Te.createEdgeDataByIndices=function(e,t){var r,o,a=e.attrLocation.aPosition,s=e.vertexAttributes[a],c=n.defined(e.nCompressOptions)&&(e.nCompressOptions&h.SVC_Vertex)===h.SVC_Vertex,E=s.componentsPerAttribute;c?(E=3,r=he(e,s)):r=new Float32Array(s.typedArray.buffer,s.typedArray.byteOffset,s.typedArray.byteLength/4);for(var u=[],l=[],f=(o=0===t.indexType?new Uint16Array(t.indicesTypedArray.buffer,t.indicesTypedArray.byteOffset,t.indicesTypedArray.byteLength/2):new Uint32Array(t.indicesTypedArray.buffer,t.indicesTypedArray.byteOffset,t.indicesTypedArray.byteLength/4)).length,d=0,A=0,p=4*Math.floor(f/4);A<p;A+=4){var g=o[A],_=o[A+1],m=o[A+2],y=o[A+3];if(ve.x=r[E*g],ve.y=r[E*g+1],ve.z=r[E*g+2],Pe.x=r[E*_],Pe.y=r[E*_+1],Pe.z=r[E*_+2],Oe.x=r[E*m],Oe.y=r[E*m+1],Oe.z=r[E*m+2],be.x=r[E*y],be.y=r[E*y+1],be.z=r[E*y+2],!(i.Cartesian3.equals(Pe,Oe)||i.Cartesian3.equals(Pe,be)||i.Cartesian3.equals(Pe,ve)||i.Cartesian3.equals(Oe,ve)||i.Cartesian3.equals(be,ve))){if(m===y){if(i.Cartesian3.subtract(Pe,ve,Fe),i.Cartesian3.subtract(Oe,ve,Se),i.Cartesian3.cross(Fe,Se,Fe),i.Cartesian3.equals(Fe,i.Cartesian3.ZERO))continue;i.Cartesian3.normalize(Fe,Fe),u.push(ve.x),u.push(ve.y),u.push(ve.z),u.push(Pe.x),u.push(Pe.y),u.push(Pe.z),u.push(Fe.x),u.push(Fe.y),u.push(Fe.z),u.push(g);var B=(C=we(ve,Pe)).variantStroke,T=C.variantExtension;u.push(B),u.push(T)}else{if(i.Cartesian3.subtract(Pe,ve,Fe),i.Cartesian3.subtract(Oe,ve,Se),i.Cartesian3.cross(Fe,Se,Fe),i.Cartesian3.equals(Fe,i.Cartesian3.ZERO))continue;if(i.Cartesian3.normalize(Fe,Fe),i.Cartesian3.subtract(Pe,ve,Me),i.Cartesian3.subtract(be,ve,Re),i.Cartesian3.cross(Me,Re,Me),i.Cartesian3.equals(Me,i.Cartesian3.ZERO))continue;i.Cartesian3.normalize(Me,Me),l.push(ve.x),l.push(ve.y),l.push(ve.z),l.push(Pe.x),l.push(Pe.y),l.push(Pe.z),l.push(Fe.x),l.push(Fe.y),l.push(Fe.z),l.push(Me.x),l.push(Me.y),l.push(Me.z),l.push(g);var C;B=(C=we(ve,Pe)).variantStroke,T=C.variantExtension;l.push(B),l.push(T)}d+=i.Cartesian3.distance(ve,Pe)}}var D=d/(f/4),v=u.length/Te.RegularInstanceStride,P=l.length/Te.SilhouetteInstanceStride;return{regular:{instancesData:new Float32Array(u),instanceCount:v,edgeLength:v*D},silhouette:{instancesData:new Float32Array(l),instanceCount:P,edgeLength:P},averageEdgeLength:D}};var Ie,Le={S3M:49,S3M4:1},xe=Object.freeze(Le),Ne=function(){var e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return{supported:!1};var r,n="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";WebAssembly.validate(e)&&(n="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");var o=WebAssembly.instantiate(function(e){for(var r=new Uint8Array(e.length),n=0;n<e.length;++n){var o=e.charCodeAt(n);r[n]=o>96?o-71:o>64?o-65:o>47?o+4:o>46?63:62}var a=0;for(n=0;n<e.length;++n)r[a++]=r[n]<60?t[r[n]]:64*(r[n]-60)+r[++n];return r.buffer.slice(0,a)}(n),{}).then((function(e){(r=e.instance).exports.__wasm_call_ctors()}));function a(e,t,n,o,a,i){var s=r.exports.sbrk,c=n+3&-4,E=s(c*o),u=s(a.length),l=new Uint8Array(r.exports.memory.buffer);l.set(a,u);var f=e(E,n,o,u,a.length);if(0==f&&i&&i(E,c,o),t.set(l.subarray(E,E+n*o)),s(E-s(0)),0!=f)throw new Error("Malformed buffer data: "+f)}var i={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},s={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:o,supported:!0,decodeVertexBuffer:function(e,t,n,o,s){a(r.exports.meshopt_decodeVertexBuffer,e,t,n,o,r.exports[i[s]])},decodeIndexBuffer:function(e,t,n,o){a(r.exports.meshopt_decodeIndexBuffer,e,t,n,o)},decodeIndexSequence:function(e,t,n,o){a(r.exports.meshopt_decodeIndexSequence,e,t,n,o)},decodeGltfBuffer:function(e,t,n,o,c,E){a(r.exports[s[c]],e,t,n,o,r.exports[i[E]])}}}(),Ue=void 0!==Ue?Ue:{},Ge={};for(Ie in Ue)Ue.hasOwnProperty(Ie)&&(Ge[Ie]=Ue[Ie]);var ke="./this.program",He=function(e,t){throw t},Xe=!1,Ve=!1,Ke=!1,je=!1;if(Xe="object"==typeof window,Ve="function"==typeof importScripts,Ke="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,je=!Xe&&!Ke&&!Ve,Ue.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var Ye,Qe,Je,ze,We,Ze="";function qe(e){return Ue.locateFile?Ue.locateFile(e,Ze):Ze+e}if(Ke)Ze=Ve?require("path").dirname(Ze)+"/":__dirname+"/",Ye=function(e,t){return ze||(ze=require("fs")),We||(We=require("path")),e=We.normalize(e),ze.readFileSync(e,t?null:"utf8")},Je=function(e){var t=Ye(e,!0);return t.buffer||(t=new Uint8Array(t)),ft(t.buffer),t},process.argv.length>1&&(ke=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Ue),process.on("uncaughtException",(function(e){if(!(e instanceof Cc))throw e})),process.on("unhandledRejection",sr),He=function(e){process.exit(e)},Ue.inspect=function(){return"[Emscripten Module object]"};else if(je)"undefined"!=typeof read&&(Ye=function(e){return read(e)}),Je=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(ft("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs&&scriptArgs,"function"==typeof quit&&(He=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print);else{if(!Xe&&!Ve)throw new Error("environment detection error");Ve?Ze=self.location.href:"undefined"!=typeof document&&document.currentScript&&(Ze=document.currentScript.src),Ze=0!==Ze.indexOf("blob:")?Ze.substr(0,Ze.lastIndexOf("/")+1):"",Ye=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},Ve&&(Je=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Qe=function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)}}var $e=Ue.print||console.log.bind(console),et=Ue.printErr||console.warn.bind(console);for(Ie in Ge)Ge.hasOwnProperty(Ie)&&(Ue[Ie]=Ge[Ie]);Ge=null,Ue.arguments,Object.getOwnPropertyDescriptor(Ue,"arguments")||Object.defineProperty(Ue,"arguments",{configurable:!0,get:function(){sr("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Ue.thisProgram&&(ke=Ue.thisProgram),Object.getOwnPropertyDescriptor(Ue,"thisProgram")||Object.defineProperty(Ue,"thisProgram",{configurable:!0,get:function(){sr("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Ue.quit&&(He=Ue.quit),Object.getOwnPropertyDescriptor(Ue,"quit")||Object.defineProperty(Ue,"quit",{configurable:!0,get:function(){sr("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),ft(void 0===Ue.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),ft(void 0===Ue.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),ft(void 0===Ue.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),ft(void 0===Ue.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),ft(void 0===Ue.read,"Module.read option was removed (modify read_ in JS)"),ft(void 0===Ue.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),ft(void 0===Ue.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),ft(void 0===Ue.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),ft(void 0===Ue.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Object.getOwnPropertyDescriptor(Ue,"read")||Object.defineProperty(Ue,"read",{configurable:!0,get:function(){sr("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(Ue,"readAsync")||Object.defineProperty(Ue,"readAsync",{configurable:!0,get:function(){sr("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(Ue,"readBinary")||Object.defineProperty(Ue,"readBinary",{configurable:!0,get:function(){sr("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(Ue,"setWindowTitle")||Object.defineProperty(Ue,"setWindowTitle",{configurable:!0,get:function(){sr("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});var tt=16;function rt(e,t){return t||(t=tt),Math.ceil(e/t)*t}function nt(e){nt.shown||(nt.shown={}),nt.shown[e]||(nt.shown[e]=1,et(e))}var ot,at=0,it=function(e){at=e},st=function(){return at};Ue.wasmBinary&&(ot=Ue.wasmBinary),Object.getOwnPropertyDescriptor(Ue,"wasmBinary")||Object.defineProperty(Ue,"wasmBinary",{configurable:!0,get:function(){sr("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});var ct,Et=Ue.noExitRuntime||!0;function ut(e,t,r){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return _t[e>>0];case"i16":return yt[e>>1];case"i32":case"i64":return Tt[e>>2];case"float":return Dt[e>>2];case"double":return ht[e>>3];default:sr("invalid type for getValue: "+t)}return null}Object.getOwnPropertyDescriptor(Ue,"noExitRuntime")||Object.defineProperty(Ue,"noExitRuntime",{configurable:!0,get:function(){sr("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),"object"!=typeof WebAssembly&&sr("no native wasm support detected");var lt=!1;function ft(e,t){e||sr("Assertion failed: "+t)}function dt(e){var t=Ue["_"+e];return ft(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function At(e,t,r,n,o){var a={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);Ft(e,t=Ec(r),r)}return t},array:function(e){var t=Ec(e.length);return Rt(e,t),t}};var i=dt(e),s=[],c=0;if(ft("array"!==t,'Return type should not be "array".'),n)for(var E=0;E<n.length;E++){var u=a[r[E]];u?(0===c&&(c=sc()),s[E]=u(n[E])):s[E]=n[E]}var l=i.apply(null,s);return l=function(e){return"string"===t?Ot(e):"boolean"===t?Boolean(e):e}(l),0!==c&&cc(c),l}function pt(e,t,r,n){return function(){return At(e,t,r,arguments)}}var gt,_t,mt,yt,Bt,Tt,Ct,Dt,ht,vt="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function Pt(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.subarray&&vt)return vt.decode(e.subarray(t,o));for(var a="";t<o;){var i=e[t++];if(128&i){var s=63&e[t++];if(192!=(224&i)){var c=63&e[t++];if(224==(240&i)?i=(15&i)<<12|s<<6|c:(240!=(248&i)&&nt("Invalid UTF-8 leading byte 0x"+i.toString(16)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),i=(7&i)<<18|s<<12|c<<6|63&e[t++]),i<65536)a+=String.fromCharCode(i);else{var E=i-65536;a+=String.fromCharCode(55296|E>>10,56320|1023&E)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function Ot(e,t){return e?Pt(mt,e,t):""}function bt(e,t,r,n){if(!(n>0))return 0;for(var o=r,a=r+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i);if(s<=127){if(r>=a)break;t[r++]=s}else if(s<=2047){if(r+1>=a)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=a)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=a)break;s>=2097152&&nt("Invalid Unicode code point 0x"+s.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x1FFFFF)."),t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function Ft(e,t,r){return ft("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),bt(e,mt,t,r)}function St(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}function Mt(e){var t=St(e)+1,r=Ac(t);return r&&bt(e,_t,r,t),r}function Rt(e,t){ft(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),_t.set(e,t)}function wt(e,t,r){for(var n=0;n<e.length;++n)ft(e.charCodeAt(n)==e.charCodeAt(n)&255),_t[t++>>0]=e.charCodeAt(n);r||(_t[t>>0]=0)}function It(e,t){return e%t>0&&(e+=t-e%t),e}function Lt(e){gt=e,Ue.HEAP8=_t=new Int8Array(e),Ue.HEAP16=yt=new Int16Array(e),Ue.HEAP32=Tt=new Int32Array(e),Ue.HEAPU8=mt=new Uint8Array(e),Ue.HEAPU16=Bt=new Uint16Array(e),Ue.HEAPU32=Ct=new Uint32Array(e),Ue.HEAPF32=Dt=new Float32Array(e),Ue.HEAPF64=ht=new Float64Array(e)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var xt=5242880;Ue.TOTAL_STACK&&ft(xt===Ue.TOTAL_STACK,"the stack size can no longer be determined at runtime");var Nt,Ut=Ue.INITIAL_MEMORY||16777216;function Gt(){var e=fc();ft(0==(3&e)),Ct[1+(e>>2)]=34821223,Ct[2+(e>>2)]=2310721022,Tt[0]=1668509029}function kt(){if(!lt){var e=fc(),t=Ct[1+(e>>2)],r=Ct[2+(e>>2)];34821223==t&&2310721022==r||sr("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" "+t.toString(16)),1668509029!==Tt[0]&&sr("Runtime error: The application has corrupted its heap memory area (address zero)!")}}Object.getOwnPropertyDescriptor(Ue,"INITIAL_MEMORY")||Object.defineProperty(Ue,"INITIAL_MEMORY",{configurable:!0,get:function(){sr("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),ft(Ut>=xt,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+Ut+"! (TOTAL_STACK="+xt+")"),ft("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support"),ft(!Ue.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally"),ft(16777216==Ut,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian!"}();var Ht=[],Xt=[],Vt=[],Kt=[],jt=!1,Yt=!1;function Qt(){if(Ue.preRun)for("function"==typeof Ue.preRun&&(Ue.preRun=[Ue.preRun]);Ue.preRun.length;)qt(Ue.preRun.shift());Tr(Ht)}function Jt(){kt(),ft(!jt),jt=!0,Ue.noFSInit||Wr.init.initialized||Wr.init(),jr.init(),Tr(Xt)}function zt(){kt(),Wr.ignorePermissions=!1,Tr(Vt)}function Wt(){kt(),Yt=!0}function Zt(){if(kt(),Ue.postRun)for("function"==typeof Ue.postRun&&(Ue.postRun=[Ue.postRun]);Ue.postRun.length;)$t(Ue.postRun.shift());Tr(Kt)}function qt(e){Ht.unshift(e)}function $t(e){Kt.unshift(e)}Xt.push({func:function(){rc()}}),ft(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),ft(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),ft(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),ft(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var er=0,tr=null,rr=null,nr={};function or(e){for(var t=e;;){if(!nr[e])return e;e=t+Math.random()}}function ar(e){er++,Ue.monitorRunDependencies&&Ue.monitorRunDependencies(er),e?(ft(!nr[e]),nr[e]=1,null===tr&&"undefined"!=typeof setInterval&&(tr=setInterval((function(){if(lt)return clearInterval(tr),void(tr=null);var e=!1;for(var t in nr)e||(e=!0,et("still waiting on run dependencies:")),et("dependency: "+t);e&&et("(end of list)")}),1e4))):et("warning: run dependency added without ID")}function ir(e){if(er--,Ue.monitorRunDependencies&&Ue.monitorRunDependencies(er),e?(ft(nr[e]),delete nr[e]):et("warning: run dependency removed without ID"),0==er&&(null!==tr&&(clearInterval(tr),tr=null),rr)){var t=rr;rr=null,t()}}function sr(e){throw Ue.onAbort&&Ue.onAbort(e),et(e+=""),lt=!0,e="abort("+e+") at "+vr(),new WebAssembly.RuntimeError(e)}function cr(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}Ue.preloadedImages={},Ue.preloadedAudios={};var Er="data:application/octet-stream;base64,";function ur(e){return cr(e,Er)}var lr="file://";function fr(e){return cr(e,lr)}function dr(e,t){return function(){var r=e,n=t;return t||(n=Ue.asm),ft(jt,"native function `"+r+"` called before runtime initialization"),ft(!Yt,"native function `"+r+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),n[e]||ft(n[e],"exported native function `"+r+"` not found"),n[e].apply(null,arguments)}}var Ar,pr,gr,_r="ThirdParty/OSGBToS3M.wasm";function mr(e){try{if(e==_r&&ot)return new Uint8Array(ot);if(Je)return Je(e);throw"both async and sync fetching of the wasm failed"}catch(e){sr(e)}}function yr(){if(!ot&&(Xe||Ve)){if("function"==typeof fetch&&!fr(_r))return fetch(_r,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+_r+"'";return e.arrayBuffer()})).catch((function(){return mr(_r)}));if(Qe)return new Promise((function(e,t){Qe(_r,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return mr(_r)}))}function Br(){var e={env:tc,wasi_snapshot_preview1:tc};function t(e,t){var r=e.exports;Ue.asm=r,ft(ct=Ue.asm.memory,"memory not found in wasm exports"),Lt(ct.buffer),ft(Nt=Ue.asm.__indirect_function_table,"table not found in wasm exports"),ir("wasm-instantiate")}ar("wasm-instantiate");var r=Ue;function n(e){ft(Ue===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,t(e.instance)}function o(t){return yr().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){et("failed to asynchronously prepare wasm: "+e),fr(_r)&&et("warning: Loading from a file URI ("+_r+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),sr(e)}))}if(Ue.instantiateWasm)try{return Ue.instantiateWasm(e,t)}catch(e){return et("Module.instantiateWasm callback failed with error: "+e),!1}return ot||"function"!=typeof WebAssembly.instantiateStreaming||ur(_r)||fr(_r)||"function"!=typeof fetch?o(n):fetch(_r,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return et("wasm streaming compile failed: "+e),et("falling back to ArrayBuffer instantiation"),o(n)}))})),{}}function Tr(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?Nt.get(r)():Nt.get(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(Ue)}}function Cr(e){return nt("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function Dr(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){var t=Cr(e);return e===t?e:t+" ["+e+"]"}))}function hr(){var e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function vr(){var e=hr();return Ue.extraStackTrace&&(e+="\n"+Ue.extraStackTrace()),Dr(e)}function Pr(e,t,r,n){sr("Assertion failed: "+Ot(e)+", at: "+[t?Ot(t):"unknown filename",r,n?Ot(n):"unknown function"])}ur(_r)||(_r=qe(_r)),Ue.callRuntimeCallbacks=Tr,Ue.demangle=Cr,Ue.demangleAll=Dr,Ue.jsStackTrace=hr,Ue.stackTrace=vr,Ue.___assert_fail=Pr,gr=Ke?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()},Ue._emscripten_get_now=gr;var Or=!0;function br(e){return Tt[nc()>>2]=e,e}function Fr(e,t){var r;if(0===e)r=Date.now();else{if(1!==e&&4!==e||!Or)return br(28),-1;r=gr()}return Tt[t>>2]=r/1e3|0,Tt[t+4>>2]=r%1e3*1e3*1e3|0,0}function Sr(e,t){return Fr(e,t)}Ue._emscripten_get_now_is_monotonic=Or,Ue.setErrNo=br,Ue._clock_gettime=Fr,Ue.___clock_gettime=Sr;var Mr={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function Rr(e){return Ac(e+Mr.SIZE)+Mr.SIZE}function wr(e,t){}function Ir(e,t){}function Lr(e){this.excPtr=e,this.ptr=e-Mr.SIZE,this.set_type=function(e){Tt[this.ptr+Mr.TYPE_OFFSET>>2]=e},this.get_type=function(){return Tt[this.ptr+Mr.TYPE_OFFSET>>2]},this.set_destructor=function(e){Tt[this.ptr+Mr.DESTRUCTOR_OFFSET>>2]=e},this.get_destructor=function(){return Tt[this.ptr+Mr.DESTRUCTOR_OFFSET>>2]},this.set_refcount=function(e){Tt[this.ptr+Mr.REFCOUNT_OFFSET>>2]=e},this.set_caught=function(e){e=e?1:0,_t[this.ptr+Mr.CAUGHT_OFFSET>>0]=e},this.get_caught=function(){return 0!=_t[this.ptr+Mr.CAUGHT_OFFSET>>0]},this.set_rethrown=function(e){e=e?1:0,_t[this.ptr+Mr.RETHROWN_OFFSET>>0]=e},this.get_rethrown=function(){return 0!=_t[this.ptr+Mr.RETHROWN_OFFSET>>0]},this.init=function(e,t){this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=Tt[this.ptr+Mr.REFCOUNT_OFFSET>>2];Tt[this.ptr+Mr.REFCOUNT_OFFSET>>2]=e+1},this.release_ref=function(){var e=Tt[this.ptr+Mr.REFCOUNT_OFFSET>>2];return Tt[this.ptr+Mr.REFCOUNT_OFFSET>>2]=e-1,ft(e>0),1===e}}Ue.ExceptionInfoAttrs=Mr,Ue.___cxa_allocate_exception=Rr,Ue._atexit=wr,Ue.___cxa_atexit=Ir,Ue.ExceptionInfo=Lr;var xr=0;Ue.exceptionLast=xr;var Nr=0;function Ur(e,t,r){throw new Lr(e).init(t,r),xr=e,Nr++,e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}function Gr(){if(!Gr.called){Gr.called=!0;var e=(new Date).getFullYear(),t=new Date(e,0,1),r=new Date(e,6,1),n=t.getTimezoneOffset(),o=r.getTimezoneOffset(),a=Math.max(n,o);Tt[ic()>>2]=60*a,Tt[ac()>>2]=Number(n!=o);var i=u(t),s=u(r),c=Mt(i),E=Mt(s);o<n?(Tt[oc()>>2]=c,Tt[oc()+4>>2]=E):(Tt[oc()>>2]=E,Tt[oc()+4>>2]=c)}function u(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}}function kr(e,t){Gr();var r=new Date(1e3*Tt[e>>2]);Tt[t>>2]=r.getSeconds(),Tt[t+4>>2]=r.getMinutes(),Tt[t+8>>2]=r.getHours(),Tt[t+12>>2]=r.getDate(),Tt[t+16>>2]=r.getMonth(),Tt[t+20>>2]=r.getFullYear()-1900,Tt[t+24>>2]=r.getDay();var n=new Date(r.getFullYear(),0,1),o=(r.getTime()-n.getTime())/864e5|0;Tt[t+28>>2]=o,Tt[t+36>>2]=-60*r.getTimezoneOffset();var a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),i=n.getTimezoneOffset(),s=0|(a!=i&&r.getTimezoneOffset()==Math.min(i,a));Tt[t+32>>2]=s;var c=Tt[oc()+(s?4:0)>>2];return Tt[t+40>>2]=c,t}function Hr(e,t){return kr(e,t)}Ue.uncaughtExceptionCount=Nr,Ue.___cxa_throw=Ur,Ue._tzset=Gr,Ue._localtime_r=kr,Ue.___localtime_r=Hr;var Xr={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=Xr.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=Xr.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=Xr.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return Xr.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return Xr.normalize(e.join("/"))},join2:function(e,t){return Xr.normalize(e+"/"+t)}};function Vr(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(Ke)try{var t=require("crypto");return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){sr("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}}Ue.PATH=Xr,Ue.getRandomDevice=Vr;var Kr={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Wr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t="/"===n.charAt(0)}return(t?"/":"")+(e=Xr.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=Kr.resolve(e).substr(1),t=Kr.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var c=[];for(s=i;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(i))).join("/")}};Ue.PATH_FS=Kr;var jr={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){jr.ttys[e]={input:[],output:[],ops:t},Wr.registerDevice(e,jr.stream_ops)},stream_ops:{open:function(e){var t=jr.ttys[e.node.rdev];if(!t)throw new Wr.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Wr.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Wr.ErrnoError(29)}if(void 0===s&&0===a)throw new Wr.ErrnoError(6);if(null==s)break;a++,t[r+i]=s}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Wr.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,t[r+a])}catch(e){throw new Wr.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(Ke){var r=Buffer.alloc?Buffer.alloc(256):new Buffer(256),n=0;try{n=ze.readSync(process.stdin.fd,r,0,256,null)}catch(e){if(-1==e.toString().indexOf("EOF"))throw e;n=0}t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=ec(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?($e(Pt(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&($e(Pt(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(et(Pt(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(et(Pt(e.output,0)),e.output=[])}}};function Yr(e){for(var t=rt(e,16384),r=Ac(t);e<t;)_t[r+e++]=0;return r}Ue.TTY=jr,Ue.mmapAlloc=Yr;var Qr={ops_table:null,mount:function(e){return Qr.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(Wr.isBlkdev(r)||Wr.isFIFO(r))throw new Wr.ErrnoError(63);Qr.ops_table||(Qr.ops_table={dir:{node:{getattr:Qr.node_ops.getattr,setattr:Qr.node_ops.setattr,lookup:Qr.node_ops.lookup,mknod:Qr.node_ops.mknod,rename:Qr.node_ops.rename,unlink:Qr.node_ops.unlink,rmdir:Qr.node_ops.rmdir,readdir:Qr.node_ops.readdir,symlink:Qr.node_ops.symlink},stream:{llseek:Qr.stream_ops.llseek}},file:{node:{getattr:Qr.node_ops.getattr,setattr:Qr.node_ops.setattr},stream:{llseek:Qr.stream_ops.llseek,read:Qr.stream_ops.read,write:Qr.stream_ops.write,allocate:Qr.stream_ops.allocate,mmap:Qr.stream_ops.mmap,msync:Qr.stream_ops.msync}},link:{node:{getattr:Qr.node_ops.getattr,setattr:Qr.node_ops.setattr,readlink:Qr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Qr.node_ops.getattr,setattr:Qr.node_ops.setattr},stream:Wr.chrdev_stream_ops}});var o=Wr.createNode(e,t,r,n);return Wr.isDir(o.mode)?(o.node_ops=Qr.ops_table.dir.node,o.stream_ops=Qr.ops_table.dir.stream,o.contents={}):Wr.isFile(o.mode)?(o.node_ops=Qr.ops_table.file.node,o.stream_ops=Qr.ops_table.file.stream,o.usedBytes=0,o.contents=null):Wr.isLink(o.mode)?(o.node_ops=Qr.ops_table.link.node,o.stream_ops=Qr.ops_table.link.stream):Wr.isChrdev(o.mode)&&(o.node_ops=Qr.ops_table.chrdev.node,o.stream_ops=Qr.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=Wr.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Wr.isDir(e.mode)?t.size=4096:Wr.isFile(e.mode)?t.size=e.usedBytes:Wr.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&Qr.resizeFileStorage(e,t.size)},lookup:function(e,t){throw Wr.genericErrors[44]},mknod:function(e,t,r,n){return Qr.createNode(e,t,r,n)},rename:function(e,t,r){if(Wr.isDir(e.mode)){var n;try{n=Wr.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Wr.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=Wr.lookupNode(e,t);for(var n in r.contents)throw new Wr.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=Qr.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!Wr.isLink(e.mode))throw new Wr.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(ft(i>=0),i>8&&a.subarray)t.set(a.subarray(o,o+i),r);else for(var s=0;s<i;s++)t[r+s]=a[o+s];return i},write:function(e,t,r,n,o,a){if(ft(!(t instanceof ArrayBuffer)),t.buffer===_t.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.timestamp=Date.now(),t.subarray&&(!i.contents||i.contents.subarray)){if(a)return ft(0===o,"canOwn must imply no weird position inside the file"),i.contents=t.subarray(r,r+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=t.slice(r,r+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(t.subarray(r,r+n),o),n}if(Qr.expandFileStorage(i,o+n),i.contents.subarray&&t.subarray)i.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=t[r+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Wr.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Wr.ErrnoError(28);return n},allocate:function(e,t,r){Qr.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,a){if(0!==t)throw new Wr.ErrnoError(28);if(!Wr.isFile(e.node.mode))throw new Wr.ErrnoError(43);var i,s,c=e.node.contents;if(2&a||c.buffer!==gt){if((n>0||n+r<c.length)&&(c=c.subarray?c.subarray(n,n+r):Array.prototype.slice.call(c,n,n+r)),s=!0,!(i=Yr(r)))throw new Wr.ErrnoError(48);_t.set(c,i)}else s=!1,i=c.byteOffset;return{ptr:i,allocated:s}},msync:function(e,t,r,n,o){if(!Wr.isFile(e.node.mode))throw new Wr.ErrnoError(43);return 2&o||Qr.stream_ops.write(e,t,0,n,r,!1),0}}};Ue.MEMFS=Qr;var Jr={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"};Ue.ERRNO_MESSAGES=Jr;var zr={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};Ue.ERRNO_CODES=zr;var Wr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(e,t){if(t=t||{},!(e=Kr.resolve(Wr.cwd(),e)))return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};for(var n in r)void 0===t[n]&&(t[n]=r[n]);if(t.recurse_count>8)throw new Wr.ErrnoError(32);for(var o=Xr.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),a=Wr.root,i="/",s=0;s<o.length;s++){var c=s===o.length-1;if(c&&t.parent)break;if(a=Wr.lookupNode(a,o[s]),i=Xr.join2(i,o[s]),Wr.isMountpoint(a)&&(!c||c&&t.follow_mount)&&(a=a.mounted.root),!c||t.follow)for(var E=0;Wr.isLink(a.mode);){var u=Wr.readlink(i);if(i=Kr.resolve(Xr.dirname(i),u),a=Wr.lookupPath(i,{recurse_count:t.recurse_count}).node,E++>40)throw new Wr.ErrnoError(32)}}return{path:i,node:a}},getPath:function(e){for(var t;;){if(Wr.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Wr.nameTable.length},hashAddNode:function(e){var t=Wr.hashName(e.parent.id,e.name);e.name_next=Wr.nameTable[t],Wr.nameTable[t]=e},hashRemoveNode:function(e){var t=Wr.hashName(e.parent.id,e.name);if(Wr.nameTable[t]===e)Wr.nameTable[t]=e.name_next;else for(var r=Wr.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=Wr.mayLookup(e);if(r)throw new Wr.ErrnoError(r,e);for(var n=Wr.hashName(e.id,t),o=Wr.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return Wr.lookup(e,t)},createNode:function(e,t,r,n){ft("object"==typeof e);var o=new Wr.FSNode(e,t,r,n);return Wr.hashAddNode(o),o},destroyNode:function(e){Wr.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(e){var t=Wr.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return Wr.ignorePermissions||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){var t=Wr.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{Wr.lookupNode(e,t);return 20}catch(e){}return Wr.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var n;try{n=Wr.lookupNode(e,t)}catch(e){return e.errno}var o=Wr.nodePermissions(e,"wx");if(o)return o;if(r){if(!Wr.isDir(n.mode))return 54;if(Wr.isRoot(n)||Wr.getPath(n)===Wr.cwd())return 10}else if(Wr.isDir(n.mode))return 31;return 0},mayOpen:function(e,t){return e?Wr.isLink(e.mode)?32:Wr.isDir(e.mode)&&("r"!==Wr.flagsToPermissionString(t)||512&t)?31:Wr.nodePermissions(e,Wr.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||Wr.MAX_OPEN_FDS;for(var r=e;r<=t;r++)if(!Wr.streams[r])return r;throw new Wr.ErrnoError(33)},getStream:function(e){return Wr.streams[e]},createStream:function(e,t,r){Wr.FSStream||(Wr.FSStream=function(){},Wr.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new Wr.FSStream;for(var o in e)n[o]=e[o];e=n;var a=Wr.nextfd(t,r);return e.fd=a,Wr.streams[a]=e,e},closeStream:function(e){Wr.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=Wr.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new Wr.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){Wr.devices[e]={stream_ops:t}},getDevice:function(e){return Wr.devices[e]},getMounts:function(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),Wr.syncFSRequests++,Wr.syncFSRequests>1&&et("warning: "+Wr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=Wr.getMounts(Wr.root.mount),n=0;function o(e){return ft(Wr.syncFSRequests>0),Wr.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((function(t){if(!t.type.syncfs)return a(null);t.type.syncfs(t,e,a)}))},mount:function(e,t,r){if("string"==typeof e)throw e;var n,o="/"===r,a=!r;if(o&&Wr.root)throw new Wr.ErrnoError(10);if(!o&&!a){var i=Wr.lookupPath(r,{follow_mount:!1});if(r=i.path,n=i.node,Wr.isMountpoint(n))throw new Wr.ErrnoError(10);if(!Wr.isDir(n.mode))throw new Wr.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,o?Wr.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:function(e){var t=Wr.lookupPath(e,{follow_mount:!1});if(!Wr.isMountpoint(t.node))throw new Wr.ErrnoError(28);var r=t.node,n=r.mounted,o=Wr.getMounts(n);Object.keys(Wr.nameTable).forEach((function(e){for(var t=Wr.nameTable[e];t;){var r=t.name_next;-1!==o.indexOf(t.mount)&&Wr.destroyNode(t),t=r}})),r.mounted=null;var a=r.mount.mounts.indexOf(n);ft(-1!==a),r.mount.mounts.splice(a,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var n=Wr.lookupPath(e,{parent:!0}).node,o=Xr.basename(e);if(!o||"."===o||".."===o)throw new Wr.ErrnoError(28);var a=Wr.mayCreate(n,o);if(a)throw new Wr.ErrnoError(a);if(!n.node_ops.mknod)throw new Wr.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,Wr.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,Wr.mknod(e,t,0)},mkdirTree:function(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Wr.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,t,r){return void 0===r&&(r=t,t=438),t|=8192,Wr.mknod(e,t,r)},symlink:function(e,t){if(!Kr.resolve(e))throw new Wr.ErrnoError(44);var r=Wr.lookupPath(t,{parent:!0}).node;if(!r)throw new Wr.ErrnoError(44);var n=Xr.basename(t),o=Wr.mayCreate(r,n);if(o)throw new Wr.ErrnoError(o);if(!r.node_ops.symlink)throw new Wr.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:function(e,t){var r,n,o=Xr.dirname(e),a=Xr.dirname(t),i=Xr.basename(e),s=Xr.basename(t);if(r=Wr.lookupPath(e,{parent:!0}).node,n=Wr.lookupPath(t,{parent:!0}).node,!r||!n)throw new Wr.ErrnoError(44);if(r.mount!==n.mount)throw new Wr.ErrnoError(75);var c,E=Wr.lookupNode(r,i),u=Kr.relative(e,a);if("."!==u.charAt(0))throw new Wr.ErrnoError(28);if("."!==(u=Kr.relative(t,o)).charAt(0))throw new Wr.ErrnoError(55);try{c=Wr.lookupNode(n,s)}catch(e){}if(E!==c){var l=Wr.isDir(E.mode),f=Wr.mayDelete(r,i,l);if(f)throw new Wr.ErrnoError(f);if(f=c?Wr.mayDelete(n,s,l):Wr.mayCreate(n,s))throw new Wr.ErrnoError(f);if(!r.node_ops.rename)throw new Wr.ErrnoError(63);if(Wr.isMountpoint(E)||c&&Wr.isMountpoint(c))throw new Wr.ErrnoError(10);if(n!==r&&(f=Wr.nodePermissions(r,"w")))throw new Wr.ErrnoError(f);try{Wr.trackingDelegate.willMovePath&&Wr.trackingDelegate.willMovePath(e,t)}catch(r){et("FS.trackingDelegate['willMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}Wr.hashRemoveNode(E);try{r.node_ops.rename(E,n,s)}catch(e){throw e}finally{Wr.hashAddNode(E)}try{Wr.trackingDelegate.onMovePath&&Wr.trackingDelegate.onMovePath(e,t)}catch(r){et("FS.trackingDelegate['onMovePath']('"+e+"', '"+t+"') threw an exception: "+r.message)}}},rmdir:function(e){var t=Wr.lookupPath(e,{parent:!0}).node,r=Xr.basename(e),n=Wr.lookupNode(t,r),o=Wr.mayDelete(t,r,!0);if(o)throw new Wr.ErrnoError(o);if(!t.node_ops.rmdir)throw new Wr.ErrnoError(63);if(Wr.isMountpoint(n))throw new Wr.ErrnoError(10);try{Wr.trackingDelegate.willDeletePath&&Wr.trackingDelegate.willDeletePath(e)}catch(t){et("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.rmdir(t,r),Wr.destroyNode(n);try{Wr.trackingDelegate.onDeletePath&&Wr.trackingDelegate.onDeletePath(e)}catch(t){et("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readdir:function(e){var t=Wr.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Wr.ErrnoError(54);return t.node_ops.readdir(t)},unlink:function(e){var t=Wr.lookupPath(e,{parent:!0}).node,r=Xr.basename(e),n=Wr.lookupNode(t,r),o=Wr.mayDelete(t,r,!1);if(o)throw new Wr.ErrnoError(o);if(!t.node_ops.unlink)throw new Wr.ErrnoError(63);if(Wr.isMountpoint(n))throw new Wr.ErrnoError(10);try{Wr.trackingDelegate.willDeletePath&&Wr.trackingDelegate.willDeletePath(e)}catch(t){et("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}t.node_ops.unlink(t,r),Wr.destroyNode(n);try{Wr.trackingDelegate.onDeletePath&&Wr.trackingDelegate.onDeletePath(e)}catch(t){et("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},readlink:function(e){var t=Wr.lookupPath(e).node;if(!t)throw new Wr.ErrnoError(44);if(!t.node_ops.readlink)throw new Wr.ErrnoError(28);return Kr.resolve(Wr.getPath(t.parent),t.node_ops.readlink(t))},stat:function(e,t){var r=Wr.lookupPath(e,{follow:!t}).node;if(!r)throw new Wr.ErrnoError(44);if(!r.node_ops.getattr)throw new Wr.ErrnoError(63);return r.node_ops.getattr(r)},lstat:function(e){return Wr.stat(e,!0)},chmod:function(e,t,r){var n;"string"==typeof e?n=Wr.lookupPath(e,{follow:!r}).node:n=e;if(!n.node_ops.setattr)throw new Wr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,t){Wr.chmod(e,t,!0)},fchmod:function(e,t){var r=Wr.getStream(e);if(!r)throw new Wr.ErrnoError(8);Wr.chmod(r.node,t)},chown:function(e,t,r,n){var o;"string"==typeof e?o=Wr.lookupPath(e,{follow:!n}).node:o=e;if(!o.node_ops.setattr)throw new Wr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,t,r){Wr.chown(e,t,r,!0)},fchown:function(e,t,r){var n=Wr.getStream(e);if(!n)throw new Wr.ErrnoError(8);Wr.chown(n.node,t,r)},truncate:function(e,t){if(t<0)throw new Wr.ErrnoError(28);var r;"string"==typeof e?r=Wr.lookupPath(e,{follow:!0}).node:r=e;if(!r.node_ops.setattr)throw new Wr.ErrnoError(63);if(Wr.isDir(r.mode))throw new Wr.ErrnoError(31);if(!Wr.isFile(r.mode))throw new Wr.ErrnoError(28);var n=Wr.nodePermissions(r,"w");if(n)throw new Wr.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var r=Wr.getStream(e);if(!r)throw new Wr.ErrnoError(8);if(0==(2097155&r.flags))throw new Wr.ErrnoError(28);Wr.truncate(r.node,t)},utime:function(e,t,r){var n=Wr.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:function(e,t,r,n,o){if(""===e)throw new Wr.ErrnoError(44);var a;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?Wr.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)a=e;else{e=Xr.normalize(e);try{a=Wr.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var i=!1;if(64&t)if(a){if(128&t)throw new Wr.ErrnoError(20)}else a=Wr.mknod(e,r,0),i=!0;if(!a)throw new Wr.ErrnoError(44);if(Wr.isChrdev(a.mode)&&(t&=-513),65536&t&&!Wr.isDir(a.mode))throw new Wr.ErrnoError(54);if(!i){var s=Wr.mayOpen(a,t);if(s)throw new Wr.ErrnoError(s)}512&t&&Wr.truncate(a,0),t&=-131713;var c=Wr.createStream({node:a,path:Wr.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,o);c.stream_ops.open&&c.stream_ops.open(c),!Ue.logReadFiles||1&t||(Wr.readFiles||(Wr.readFiles={}),e in Wr.readFiles||(Wr.readFiles[e]=1,et("FS.trackingDelegate error on read file: "+e)));try{if(Wr.trackingDelegate.onOpenFile){var E=0;1!=(2097155&t)&&(E|=Wr.tracking.openFlags.READ),0!=(2097155&t)&&(E|=Wr.tracking.openFlags.WRITE),Wr.trackingDelegate.onOpenFile(e,E)}}catch(t){et("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+t.message)}return c},close:function(e){if(Wr.isClosed(e))throw new Wr.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Wr.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,t,r){if(Wr.isClosed(e))throw new Wr.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Wr.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Wr.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:function(e,t,r,n,o){if(n<0||o<0)throw new Wr.ErrnoError(28);if(Wr.isClosed(e))throw new Wr.ErrnoError(8);if(1==(2097155&e.flags))throw new Wr.ErrnoError(8);if(Wr.isDir(e.node.mode))throw new Wr.ErrnoError(31);if(!e.stream_ops.read)throw new Wr.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new Wr.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,t,r,n,o);return a||(e.position+=i),i},write:function(e,t,r,n,o,a){if(n<0||o<0)throw new Wr.ErrnoError(28);if(Wr.isClosed(e))throw new Wr.ErrnoError(8);if(0==(2097155&e.flags))throw new Wr.ErrnoError(8);if(Wr.isDir(e.node.mode))throw new Wr.ErrnoError(31);if(!e.stream_ops.write)throw new Wr.ErrnoError(28);e.seekable&&1024&e.flags&&Wr.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new Wr.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,a);i||(e.position+=s);try{e.path&&Wr.trackingDelegate.onWriteToFile&&Wr.trackingDelegate.onWriteToFile(e.path)}catch(t){et("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+t.message)}return s},allocate:function(e,t,r){if(Wr.isClosed(e))throw new Wr.ErrnoError(8);if(t<0||r<=0)throw new Wr.ErrnoError(28);if(0==(2097155&e.flags))throw new Wr.ErrnoError(8);if(!Wr.isFile(e.node.mode)&&!Wr.isDir(e.node.mode))throw new Wr.ErrnoError(43);if(!e.stream_ops.allocate)throw new Wr.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,n,o,a){if(0!=(2&o)&&0==(2&a)&&2!=(2097155&e.flags))throw new Wr.ErrnoError(2);if(1==(2097155&e.flags))throw new Wr.ErrnoError(2);if(!e.stream_ops.mmap)throw new Wr.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o,a)},msync:function(e,t,r,n,o){return e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0},munmap:function(e){return 0},ioctl:function(e,t,r){if(!e.stream_ops.ioctl)throw new Wr.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:function(e,t){if((t=t||{}).flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,n=Wr.open(e,t.flags),o=Wr.stat(e).size,a=new Uint8Array(o);return Wr.read(n,a,0,o,0),"utf8"===t.encoding?r=Pt(a,0):"binary"===t.encoding&&(r=a),Wr.close(n),r},writeFile:function(e,t,r){(r=r||{}).flags=r.flags||577;var n=Wr.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(St(t)+1),a=bt(t,o,0,o.length);Wr.write(n,o,0,a,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Wr.write(n,t,0,t.byteLength,void 0,r.canOwn)}Wr.close(n)},cwd:function(){return Wr.currentPath},chdir:function(e){var t=Wr.lookupPath(e,{follow:!0});if(null===t.node)throw new Wr.ErrnoError(44);if(!Wr.isDir(t.node.mode))throw new Wr.ErrnoError(54);var r=Wr.nodePermissions(t.node,"x");if(r)throw new Wr.ErrnoError(r);Wr.currentPath=t.path},createDefaultDirectories:function(){Wr.mkdir("/tmp"),Wr.mkdir("/home"),Wr.mkdir("/home/web_user")},createDefaultDevices:function(){Wr.mkdir("/dev"),Wr.registerDevice(Wr.makedev(1,3),{read:function(){return 0},write:function(e,t,r,n,o){return n}}),Wr.mkdev("/dev/null",Wr.makedev(1,3)),jr.register(Wr.makedev(5,0),jr.default_tty_ops),jr.register(Wr.makedev(6,0),jr.default_tty1_ops),Wr.mkdev("/dev/tty",Wr.makedev(5,0)),Wr.mkdev("/dev/tty1",Wr.makedev(6,0));var e=Vr();Wr.createDevice("/dev","random",e),Wr.createDevice("/dev","urandom",e),Wr.mkdir("/dev/shm"),Wr.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){Wr.mkdir("/proc");var e=Wr.mkdir("/proc/self");Wr.mkdir("/proc/self/fd"),Wr.mount({mount:function(){var t=Wr.createNode(e,"fd",16895,73);return t.node_ops={lookup:function(e,t){var r=+t,n=Wr.getStream(r);if(!n)throw new Wr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:function(){Ue.stdin?Wr.createDevice("/dev","stdin",Ue.stdin):Wr.symlink("/dev/tty","/dev/stdin"),Ue.stdout?Wr.createDevice("/dev","stdout",null,Ue.stdout):Wr.symlink("/dev/tty","/dev/stdout"),Ue.stderr?Wr.createDevice("/dev","stderr",null,Ue.stderr):Wr.symlink("/dev/tty1","/dev/stderr");var e=Wr.open("/dev/stdin",0),t=Wr.open("/dev/stdout",1),r=Wr.open("/dev/stderr",1);ft(0===e.fd,"invalid handle for stdin ("+e.fd+")"),ft(1===t.fd,"invalid handle for stdout ("+t.fd+")"),ft(2===r.fd,"invalid handle for stderr ("+r.fd+")")},ensureErrnoError:function(){Wr.ErrnoError||(Wr.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){for(var t in this.errno=e,zr)if(zr[t]===e){this.code=t;break}},this.setErrno(e),this.message=Jr[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=Dr(this.stack))},Wr.ErrnoError.prototype=new Error,Wr.ErrnoError.prototype.constructor=Wr.ErrnoError,[44].forEach((function(e){Wr.genericErrors[e]=new Wr.ErrnoError(e),Wr.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:function(){Wr.ensureErrnoError(),Wr.nameTable=new Array(4096),Wr.mount(Qr,{},"/"),Wr.createDefaultDirectories(),Wr.createDefaultDevices(),Wr.createSpecialDirectories(),Wr.filesystems={MEMFS:Qr}},init:function(e,t,r){ft(!Wr.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),Wr.init.initialized=!0,Wr.ensureErrnoError(),Ue.stdin=e||Ue.stdin,Ue.stdout=t||Ue.stdout,Ue.stderr=r||Ue.stderr,Wr.createStandardStreams()},quit:function(){Wr.init.initialized=!1;var e=Ue._fflush;e&&e(0);for(var t=0;t<Wr.streams.length;t++){var r=Wr.streams[t];r&&Wr.close(r)}},getMode:function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:function(e,t){var r=Wr.analyzePath(e,t);return r.exists?r.object:null},analyzePath:function(e,t){try{e=(n=Wr.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Wr.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=Xr.basename(e),n=Wr.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:function(e,t,r,n){e="string"==typeof e?e:Wr.getPath(e);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Xr.join2(e,a);try{Wr.mkdir(i)}catch(e){}e=i}}return i},createFile:function(e,t,r,n,o){var a=Xr.join2("string"==typeof e?e:Wr.getPath(e),t),i=Wr.getMode(n,o);return Wr.create(a,i)},createDataFile:function(e,t,r,n,o,a){var i=t?Xr.join2("string"==typeof e?e:Wr.getPath(e),t):e,s=Wr.getMode(n,o),c=Wr.create(i,s);if(r){if("string"==typeof r){for(var E=new Array(r.length),u=0,l=r.length;u<l;++u)E[u]=r.charCodeAt(u);r=E}Wr.chmod(c,146|s);var f=Wr.open(c,577);Wr.write(f,r,0,r.length,0,a),Wr.close(f),Wr.chmod(c,s)}return c},createDevice:function(e,t,r,n){var o=Xr.join2("string"==typeof e?e:Wr.getPath(e),t),a=Wr.getMode(!!r,!!n);Wr.createDevice.major||(Wr.createDevice.major=64);var i=Wr.makedev(Wr.createDevice.major++,0);return Wr.registerDevice(i,{open:function(e){e.seekable=!1},close:function(e){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,t,n,o,a){for(var i=0,s=0;s<o;s++){var c;try{c=r()}catch(e){throw new Wr.ErrnoError(29)}if(void 0===c&&0===i)throw new Wr.ErrnoError(6);if(null==c)break;i++,t[n+s]=c}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,o,a){for(var i=0;i<o;i++)try{n(t[r+i])}catch(e){throw new Wr.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),Wr.mkdev(o,a,i)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!Ye)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ec(Ye(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Wr.ErrnoError(29)}},createLazyFile:function(e,t,r,n,o){function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=n);var s=this;s.setDataGetter((function(e){var t=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ec(o.responseText||"",!0)}(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,$e("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!Ve)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a;Object.defineProperties(i,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:i}}else s={isDevice:!1,url:r};var c=Wr.createFile(e,t,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var E={};return Object.keys(c.stream_ops).forEach((function(e){var t=c.stream_ops[e];E[e]=function(){return Wr.forceLoadFile(c),t.apply(null,arguments)}})),E.read=function(e,t,r,n,o){Wr.forceLoadFile(c);var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(ft(i>=0),a.slice)for(var s=0;s<i;s++)t[r+s]=a[o+s];else for(s=0;s<i;s++)t[r+s]=a.get(o+s);return i},c.stream_ops=E,c},createPreloadedFile:function(e,t,r,n,o,a,i,s,c,E){Browser.init();var u=t?Kr.resolve(Xr.join2(e,t)):e,l=or("cp "+u);function f(r){function f(r){E&&E(),s||Wr.createDataFile(e,t,r,n,o,c),a&&a(),ir(l)}var d=!1;Ue.preloadPlugins.forEach((function(e){d||e.canHandle(u)&&(e.handle(r,u,f,(function(){i&&i(),ir(l)})),d=!0)})),d||f(r)}ar(l),"string"==typeof r?Browser.asyncLoad(r,(function(e){f(e)}),i):f(r)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=Wr.indexedDB();try{var o=n.open(Wr.DB_NAME(),Wr.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=function(){$e("creating db"),o.result.createObjectStore(Wr.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([Wr.DB_STORE_NAME],"readwrite"),a=n.objectStore(Wr.DB_STORE_NAME),i=0,s=0,c=e.length;function E(){0==s?t():r()}e.forEach((function(e){var t=a.put(Wr.analyzePath(e).object.contents,e);t.onsuccess=function(){++i+s==c&&E()},t.onerror=function(){s++,i+s==c&&E()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=Wr.indexedDB();try{var o=n.open(Wr.DB_NAME(),Wr.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=function(){var n=o.result;try{var a=n.transaction([Wr.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var i=a.objectStore(Wr.DB_STORE_NAME),s=0,c=0,E=e.length;function u(){0==c?t():r()}e.forEach((function(e){var t=i.get(e);t.onsuccess=function(){Wr.analyzePath(e).exists&&Wr.unlink(e),Wr.createDataFile(Xr.dirname(e),Xr.basename(e),t.result,!0,!0,!0),++s+c==E&&u()},t.onerror=function(){c++,s+c==E&&u()}})),a.onerror=r},o.onerror=r},absolutePath:function(){sr("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder:function(){sr("FS.createFolder has been removed; use FS.mkdir instead")},createLink:function(){sr("FS.createLink has been removed; use FS.symlink instead")},joinPath:function(){sr("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc:function(){sr("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath:function(){sr("FS.standardizePath has been removed; use PATH.normalize instead")}};Ue.FS=Wr;var Zr={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(e,t,r){if("/"===t[0])return t;var n;if(-100===e)n=Wr.cwd();else{var o=Wr.getStream(e);if(!o)throw new Wr.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new Wr.ErrnoError(44);return n}return Xr.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&Xr.normalize(t)!==Xr.normalize(Wr.getPath(e.node)))return-54;throw e}return Tt[r>>2]=n.dev,Tt[r+4>>2]=0,Tt[r+8>>2]=n.ino,Tt[r+12>>2]=n.mode,Tt[r+16>>2]=n.nlink,Tt[r+20>>2]=n.uid,Tt[r+24>>2]=n.gid,Tt[r+28>>2]=n.rdev,Tt[r+32>>2]=0,pr=[n.size>>>0,(Ar=n.size,+Math.abs(Ar)>=1?Ar>0?(0|Math.min(+Math.floor(Ar/4294967296),4294967295))>>>0:~~+Math.ceil((Ar-+(~~Ar>>>0))/4294967296)>>>0:0)],Tt[r+40>>2]=pr[0],Tt[r+44>>2]=pr[1],Tt[r+48>>2]=4096,Tt[r+52>>2]=n.blocks,Tt[r+56>>2]=n.atime.getTime()/1e3|0,Tt[r+60>>2]=0,Tt[r+64>>2]=n.mtime.getTime()/1e3|0,Tt[r+68>>2]=0,Tt[r+72>>2]=n.ctime.getTime()/1e3|0,Tt[r+76>>2]=0,pr=[n.ino>>>0,(Ar=n.ino,+Math.abs(Ar)>=1?Ar>0?(0|Math.min(+Math.floor(Ar/4294967296),4294967295))>>>0:~~+Math.ceil((Ar-+(~~Ar>>>0))/4294967296)>>>0:0)],Tt[r+80>>2]=pr[0],Tt[r+84>>2]=pr[1],0},doMsync:function(e,t,r,n,o){var a=mt.slice(e,e+r);Wr.msync(t,a,o,r,n)},doMkdir:function(e,t){return"/"===(e=Xr.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),Wr.mkdir(e,t,0),0},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return Wr.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var n=Wr.readlink(e),o=Math.min(r,St(n)),a=_t[t+o];return Ft(n,t,r+1),_t[t+o]=a,o},doAccess:function(e,t){if(-8&t)return-28;var r;if(!(r=Wr.lookupPath(e,{follow:!0}).node))return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&Wr.nodePermissions(r,n)?-2:0},doDup:function(e,t,r){var n=Wr.getStream(r);return n&&Wr.close(n),Wr.open(e,t,0,r,r).fd},doReadv:function(e,t,r,n){for(var o=0,a=0;a<r;a++){var i=Tt[t+8*a>>2],s=Tt[t+(8*a+4)>>2],c=Wr.read(e,_t,i,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o},doWritev:function(e,t,r,n){for(var o=0,a=0;a<r;a++){var i=Tt[t+8*a>>2],s=Tt[t+(8*a+4)>>2],c=Wr.write(e,_t,i,s,n);if(c<0)return-1;o+=c}return o},varargs:void 0,get:function(){return ft(null!=Zr.varargs),Zr.varargs+=4,Tt[Zr.varargs-4>>2]},getStr:function(e){return Ot(e)},getStreamFromFD:function(e){var t=Wr.getStream(e);if(!t)throw new Wr.ErrnoError(8);return t},get64:function(e,t){return ft(e>=0?0===t:-1===t),e}};function qr(e,t){try{return e=Zr.getStr(e),Zr.doAccess(e,t)}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function $r(e){try{var t=Zr.getStreamFromFD(e);return Wr.open(t.path,t.flags,0).fd}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function en(e,t,r){Zr.varargs=r;try{var n=Zr.getStreamFromFD(e);switch(t){case 0:return(o=Zr.get())<0?-28:Wr.open(n.path,n.flags,0,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=Zr.get();return n.flags|=o,0;case 12:o=Zr.get();return yt[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return br(28),-1}}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function tn(e,t){try{var r=Zr.getStreamFromFD(e);return Zr.doStat(Wr.stat,r.path,t)}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function rn(e,t){try{if(0===t)return-28;var r=Wr.cwd();return t<St(r)+1?-68:(Ft(r,e,t),e)}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function nn(e,t,r){try{var n=Zr.getStreamFromFD(e);n.getdents||(n.getdents=Wr.readdir(n.path));for(var o=280,a=0,i=Wr.llseek(n,0,1),s=Math.floor(i/o);s<n.getdents.length&&a+o<=r;){var c,E,u=n.getdents[s];if("."===u[0])c=1,E=4;else{var l=Wr.lookupNode(n.node,u);c=l.id,E=Wr.isChrdev(l.mode)?2:Wr.isDir(l.mode)?4:Wr.isLink(l.mode)?10:8}pr=[c>>>0,(Ar=c,+Math.abs(Ar)>=1?Ar>0?(0|Math.min(+Math.floor(Ar/4294967296),4294967295))>>>0:~~+Math.ceil((Ar-+(~~Ar>>>0))/4294967296)>>>0:0)],Tt[t+a>>2]=pr[0],Tt[t+a+4>>2]=pr[1],pr=[(s+1)*o>>>0,(Ar=(s+1)*o,+Math.abs(Ar)>=1?Ar>0?(0|Math.min(+Math.floor(Ar/4294967296),4294967295))>>>0:~~+Math.ceil((Ar-+(~~Ar>>>0))/4294967296)>>>0:0)],Tt[t+a+8>>2]=pr[0],Tt[t+a+12>>2]=pr[1],yt[t+a+16>>1]=280,_t[t+a+18>>0]=E,Ft(u,t+a+19,256),a+=o,s+=1}return Wr.llseek(n,s*o,0),a}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function on(e,t,r){Zr.varargs=r;try{var n=Zr.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=Zr.get();return Tt[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:o=Zr.get();return Wr.ioctl(n,t,o);default:sr("bad ioctl syscall "+t)}}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function an(e,t){try{return e=Zr.getStr(e),Zr.doStat(Wr.lstat,e,t)}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function sn(e,t){try{return e=Zr.getStr(e),Zr.doMkdir(e,t)}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function cn(e,t,r){Zr.varargs=r;try{var n=Zr.getStr(e),o=r?Zr.get():0;return Wr.open(n,t,o).fd}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function En(e,t,r){try{return e=Zr.getStr(e),Zr.doReadlink(e,t,r)}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function un(e,t){try{return e=Zr.getStr(e),t=Zr.getStr(t),Wr.rename(e,t),0}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function ln(e){try{return e=Zr.getStr(e),Wr.rmdir(e),0}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function fn(e,t){try{return e=Zr.getStr(e),Zr.doStat(Wr.stat,e,t)}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function dn(e){try{return e=Zr.getStr(e),Wr.unlink(e),0}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),-e.errno}}function An(){sr()}function pn(e){sr("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function gn(){sr("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function _n(e,t){sr("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function mn(e){var t=e.getExtension("ANGLE_instanced_arrays");if(t)return e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,o){t.drawArraysInstancedANGLE(e,r,n,o)},e.drawElementsInstanced=function(e,r,n,o,a){t.drawElementsInstancedANGLE(e,r,n,o,a)},1}function yn(e){var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)},1}function Bn(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function Tn(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}Ue.SYSCALLS=Zr,Ue.___sys_access=qr,Ue.___sys_dup=$r,Ue.___sys_fcntl64=en,Ue.___sys_fstat64=tn,Ue.___sys_getcwd=rn,Ue.___sys_getdents64=nn,Ue.___sys_ioctl=on,Ue.___sys_lstat64=an,Ue.___sys_mkdir=sn,Ue.___sys_open=cn,Ue.___sys_readlink=En,Ue.___sys_rename=un,Ue.___sys_rmdir=ln,Ue.___sys_stat64=fn,Ue.___sys_unlink=dn,Ue._abort=An,Ue._dlclose=pn,Ue._dlerror=gn,Ue._dlopen=_n,Ue.__webgl_enable_ANGLE_instanced_arrays=mn,Ue.__webgl_enable_OES_vertex_array_object=yn,Ue.__webgl_enable_WEBGL_draw_buffers=Bn,Ue.__webgl_enable_WEBGL_multi_draw=Tn;var Cn={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,recordError:function(e){Cn.lastError||(Cn.lastError=e)},getNewId:function(e){for(var t=Cn.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:function(e,t,r,n){for(var o="",a=0;a<t;++a){var i=n?Tt[n+4*a>>2]:-1;o+=Ot(Tt[r+4*a>>2],i<0?void 0:i)}return o},createContext:function(e,t){var r=e.getContext("webgl",t);return r?Cn.registerContext(r,t):0},registerContext:function(e,t){var r=Cn.getNewId(Cn.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),Cn.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&Cn.initExtensions(n),r},makeContextCurrent:function(e){return Cn.currentContext=Cn.contexts[e],Ue.ctx=Qs=Cn.currentContext&&Cn.currentContext.GLctx,!(e&&!Qs)},getContext:function(e){return Cn.contexts[e]},deleteContext:function(e){Cn.currentContext===Cn.contexts[e]&&(Cn.currentContext=null),"object"==typeof JSEvents&&JSEvents.removeAllHandlersOnTarget(Cn.contexts[e].GLctx.canvas),Cn.contexts[e]&&Cn.contexts[e].GLctx.canvas&&(Cn.contexts[e].GLctx.canvas.GLctxObject=void 0),Cn.contexts[e]=null},initExtensions:function(e){if(e||(e=Cn.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;mn(t),yn(t),Bn(t),t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query"),Tn(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.indexOf("lose_context")<0&&e.indexOf("debug")<0&&t.getExtension(e)}))}},populateUniformTable:function(e){for(var t=Cn.programs[e],r=Cn.programInfos[e]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1},n=r.uniforms,o=Qs.getProgramParameter(t,35718),a=0;a<o;++a){var i=Qs.getActiveUniform(t,a),s=i.name;r.maxUniformLength=Math.max(r.maxUniformLength,s.length+1),"]"==s.slice(-1)&&(s=s.slice(0,s.lastIndexOf("[")));var c=Qs.getUniformLocation(t,s);if(c){var E=Cn.getNewId(Cn.uniforms);n[s]=[i.size,E],Cn.uniforms[E]=c;for(var u=1;u<i.size;++u){var l=s+"["+u+"]";c=Qs.getUniformLocation(t,l),E=Cn.getNewId(Cn.uniforms),Cn.uniforms[E]=c}}}}};function Dn(e){Qs.activeTexture(e)}function hn(e,t){Qs.attachShader(Cn.programs[e],Cn.shaders[t])}function vn(e,t){Qs.disjointTimerQueryExt.beginQueryEXT(e,Cn.timerQueriesEXT[t])}function Pn(e,t,r){Qs.bindAttribLocation(Cn.programs[e],t,Ot(r))}function On(e,t){Qs.bindBuffer(e,Cn.buffers[t])}function bn(e,t){Qs.bindFramebuffer(e,Cn.framebuffers[t])}function Fn(e,t){Qs.bindRenderbuffer(e,Cn.renderbuffers[t])}function Sn(e,t){Qs.bindTexture(e,Cn.textures[t])}function Mn(e){Qs.bindVertexArray(Cn.vaos[e])}function Rn(e,t,r,n){Qs.blendColor(e,t,r,n)}function wn(e){Qs.blendEquation(e)}function In(e,t){Qs.blendEquationSeparate(e,t)}function Ln(e,t){Qs.blendFunc(e,t)}function xn(e,t,r,n){Qs.blendFuncSeparate(e,t,r,n)}function Nn(e,t,r,n){Qs.bufferData(e,r?mt.subarray(r,r+t):t,n)}function Un(e,t,r,n){Qs.bufferSubData(e,t,mt.subarray(n,n+r))}function Gn(e){return Qs.checkFramebufferStatus(e)}function kn(e){Qs.clear(e)}function Hn(e,t,r,n){Qs.clearColor(e,t,r,n)}function Xn(e){Qs.clearDepth(e)}function Vn(e){Qs.clearStencil(e)}function Kn(e,t,r,n){Qs.colorMask(!!e,!!t,!!r,!!n)}function jn(e){Qs.compileShader(Cn.shaders[e])}function Yn(e,t,r,n,o,a,i,s){Qs.compressedTexImage2D(e,t,r,n,o,a,s?mt.subarray(s,s+i):null)}function Qn(e,t,r,n,o,a,i,s,c){Qs.compressedTexSubImage2D(e,t,r,n,o,a,i,c?mt.subarray(c,c+s):null)}function Jn(e,t,r,n,o,a,i,s){Qs.copyTexImage2D(e,t,r,n,o,a,i,s)}function zn(e,t,r,n,o,a,i,s){Qs.copyTexSubImage2D(e,t,r,n,o,a,i,s)}function Wn(){var e=Cn.getNewId(Cn.programs),t=Qs.createProgram();return t.name=e,Cn.programs[e]=t,e}function Zn(e){var t=Cn.getNewId(Cn.shaders);return Cn.shaders[t]=Qs.createShader(e),t}function qn(e){Qs.cullFace(e)}function $n(e,t){for(var r=0;r<e;r++){var n=Tt[t+4*r>>2],o=Cn.buffers[n];o&&(Qs.deleteBuffer(o),o.name=0,Cn.buffers[n]=null)}}function eo(e,t){for(var r=0;r<e;++r){var n=Tt[t+4*r>>2],o=Cn.framebuffers[n];o&&(Qs.deleteFramebuffer(o),o.name=0,Cn.framebuffers[n]=null)}}function to(e){if(e){var t=Cn.programs[e];t?(Qs.deleteProgram(t),t.name=0,Cn.programs[e]=null,Cn.programInfos[e]=null):Cn.recordError(1281)}}function ro(e,t){for(var r=0;r<e;r++){var n=Tt[t+4*r>>2],o=Cn.timerQueriesEXT[n];o&&(Qs.disjointTimerQueryExt.deleteQueryEXT(o),Cn.timerQueriesEXT[n]=null)}}function no(e,t){for(var r=0;r<e;r++){var n=Tt[t+4*r>>2],o=Cn.renderbuffers[n];o&&(Qs.deleteRenderbuffer(o),o.name=0,Cn.renderbuffers[n]=null)}}function oo(e){if(e){var t=Cn.shaders[e];t?(Qs.deleteShader(t),Cn.shaders[e]=null):Cn.recordError(1281)}}function ao(e,t){for(var r=0;r<e;r++){var n=Tt[t+4*r>>2],o=Cn.textures[n];o&&(Qs.deleteTexture(o),o.name=0,Cn.textures[n]=null)}}function io(e,t){for(var r=0;r<e;r++){var n=Tt[t+4*r>>2];Qs.deleteVertexArray(Cn.vaos[n]),Cn.vaos[n]=null}}function so(e){Qs.depthFunc(e)}function co(e){Qs.depthMask(!!e)}function Eo(e,t){Qs.depthRange(e,t)}function uo(e,t){Qs.detachShader(Cn.programs[e],Cn.shaders[t])}function lo(e){Qs.disable(e)}function fo(e){Qs.disableVertexAttribArray(e)}function Ao(e,t,r){Qs.drawArrays(e,t,r)}function po(e,t,r,n){Qs.drawArraysInstanced(e,t,r,n)}Ue.GL=Cn,Ue._emscripten_glActiveTexture=Dn,Ue._emscripten_glAttachShader=hn,Ue._emscripten_glBeginQueryEXT=vn,Ue._emscripten_glBindAttribLocation=Pn,Ue._emscripten_glBindBuffer=On,Ue._emscripten_glBindFramebuffer=bn,Ue._emscripten_glBindRenderbuffer=Fn,Ue._emscripten_glBindTexture=Sn,Ue._emscripten_glBindVertexArrayOES=Mn,Ue._emscripten_glBlendColor=Rn,Ue._emscripten_glBlendEquation=wn,Ue._emscripten_glBlendEquationSeparate=In,Ue._emscripten_glBlendFunc=Ln,Ue._emscripten_glBlendFuncSeparate=xn,Ue._emscripten_glBufferData=Nn,Ue._emscripten_glBufferSubData=Un,Ue._emscripten_glCheckFramebufferStatus=Gn,Ue._emscripten_glClear=kn,Ue._emscripten_glClearColor=Hn,Ue._emscripten_glClearDepthf=Xn,Ue._emscripten_glClearStencil=Vn,Ue._emscripten_glColorMask=Kn,Ue._emscripten_glCompileShader=jn,Ue._emscripten_glCompressedTexImage2D=Yn,Ue._emscripten_glCompressedTexSubImage2D=Qn,Ue._emscripten_glCopyTexImage2D=Jn,Ue._emscripten_glCopyTexSubImage2D=zn,Ue._emscripten_glCreateProgram=Wn,Ue._emscripten_glCreateShader=Zn,Ue._emscripten_glCullFace=qn,Ue._emscripten_glDeleteBuffers=$n,Ue._emscripten_glDeleteFramebuffers=eo,Ue._emscripten_glDeleteProgram=to,Ue._emscripten_glDeleteQueriesEXT=ro,Ue._emscripten_glDeleteRenderbuffers=no,Ue._emscripten_glDeleteShader=oo,Ue._emscripten_glDeleteTextures=ao,Ue._emscripten_glDeleteVertexArraysOES=io,Ue._emscripten_glDepthFunc=so,Ue._emscripten_glDepthMask=co,Ue._emscripten_glDepthRangef=Eo,Ue._emscripten_glDetachShader=uo,Ue._emscripten_glDisable=lo,Ue._emscripten_glDisableVertexAttribArray=fo,Ue._emscripten_glDrawArrays=Ao,Ue._emscripten_glDrawArraysInstancedANGLE=po;var go=[];function _o(e,t){for(var r=go[e],n=0;n<e;n++)r[n]=Tt[t+4*n>>2];Qs.drawBuffers(r)}function mo(e,t,r,n){Qs.drawElements(e,t,r,n)}function yo(e,t,r,n,o){Qs.drawElementsInstanced(e,t,r,n,o)}function Bo(e){Qs.enable(e)}function To(e){Qs.enableVertexAttribArray(e)}function Co(e){Qs.disjointTimerQueryExt.endQueryEXT(e)}function Do(){Qs.finish()}function ho(){Qs.flush()}function vo(e,t,r,n){Qs.framebufferRenderbuffer(e,t,r,Cn.renderbuffers[n])}function Po(e,t,r,n,o){Qs.framebufferTexture2D(e,t,r,Cn.textures[n],o)}function Oo(e){Qs.frontFace(e)}function bo(e,t,r,n){for(var o=0;o<e;o++){var a=Qs[r](),i=a&&Cn.getNewId(n);a?(a.name=i,n[i]=a):Cn.recordError(1282),Tt[t+4*o>>2]=i}}function Fo(e,t){bo(e,t,"createBuffer",Cn.buffers)}function So(e,t){bo(e,t,"createFramebuffer",Cn.framebuffers)}function Mo(e,t){for(var r=0;r<e;r++){var n=Qs.disjointTimerQueryExt.createQueryEXT();if(!n){for(Cn.recordError(1282);r<e;)Tt[t+4*r++>>2]=0;return}var o=Cn.getNewId(Cn.timerQueriesEXT);n.name=o,Cn.timerQueriesEXT[o]=n,Tt[t+4*r>>2]=o}}function Ro(e,t){bo(e,t,"createRenderbuffer",Cn.renderbuffers)}function wo(e,t){bo(e,t,"createTexture",Cn.textures)}function Io(e,t){bo(e,t,"createVertexArray",Cn.vaos)}function Lo(e){Qs.generateMipmap(e)}function xo(e,t,r,n,o,a,i,s){t=Cn.programs[t];var c=Qs[e](t,r);if(c){var E=s&&Ft(c.name,s,n);o&&(Tt[o>>2]=E),a&&(Tt[a>>2]=c.size),i&&(Tt[i>>2]=c.type)}}function No(e,t,r,n,o,a,i){xo("getActiveAttrib",e,t,r,n,o,a,i)}function Uo(e,t,r,n,o,a,i){xo("getActiveUniform",e,t,r,n,o,a,i)}function Go(e,t,r,n){var o=Qs.getAttachedShaders(Cn.programs[e]),a=o.length;a>t&&(a=t),Tt[r>>2]=a;for(var i=0;i<a;++i){var s=Cn.shaders.indexOf(o[i]);Tt[n+4*i>>2]=s}}function ko(e,t){return Qs.getAttribLocation(Cn.programs[e],Ot(t))}function Ho(e){return Ct[e>>2]+4294967296*Tt[e+4>>2]}function Xo(e){return Ct[e>>2]+4294967296*Ct[e+4>>2]}function Vo(e,t){Ct[e>>2]=t,Ct[e+4>>2]=(t-Ct[e>>2])/4294967296;var r=t>=0?Xo(e):Ho(e);r!=t&&nt("writeI53ToI64() out of range: serialized JS Number "+t+" to Wasm heap as bytes lo=0x"+Ct[e>>2].toString(16)+", hi=0x"+Ct[e+4>>2].toString(16)+", which deserializes back to "+r+" instead!")}function Ko(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&Cn.recordError(1280));case 36345:n=0;break;case 34466:var o=Qs.getParameter(34467);n=o?o.length:0}if(void 0===n){var a=Qs.getParameter(e);switch(typeof a){case"number":n=a;break;case"boolean":n=a?1:0;break;case"string":return void Cn.recordError(1280);case"object":if(null===a)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 34068:n=0;break;default:return void Cn.recordError(1280)}else{if(a instanceof Float32Array||a instanceof Uint32Array||a instanceof Int32Array||a instanceof Array){for(var i=0;i<a.length;++i)switch(r){case 0:Tt[t+4*i>>2]=a[i];break;case 2:Dt[t+4*i>>2]=a[i];break;case 4:_t[t+i>>0]=a[i]?1:0}return}try{n=0|a.name}catch(t){return Cn.recordError(1280),void et("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return Cn.recordError(1280),void et("GL_INVALID_ENUM in glGet"+r+"v: Native code calling glGet"+r+"v("+e+") and it returns "+a+" of type "+typeof a+"!")}}switch(r){case 1:Vo(t,n);break;case 0:Tt[t>>2]=n;break;case 2:Dt[t>>2]=n;break;case 4:_t[t>>0]=n?1:0}}else Cn.recordError(1281)}function jo(e,t){Ko(e,t,4)}function Yo(e,t,r){r?Tt[r>>2]=Qs.getBufferParameter(e,t):Cn.recordError(1281)}function Qo(){var e=Qs.getError()||Cn.lastError;return Cn.lastError=0,e}function Jo(e,t){Ko(e,t,2)}function zo(e,t,r,n){var o=Qs.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),Tt[n>>2]=o}function Wo(e,t){Ko(e,t,0)}function Zo(e,t,r,n){var o=Qs.getProgramInfoLog(Cn.programs[e]);null===o&&(o="(unknown error)");var a=t>0&&n?Ft(o,n,t):0;r&&(Tt[r>>2]=a)}function qo(e,t,r){if(r)if(e>=Cn.counter)Cn.recordError(1281);else{var n=Cn.programInfos[e];if(n)if(35716==t){var o=Qs.getProgramInfoLog(Cn.programs[e]);null===o&&(o="(unknown error)"),Tt[r>>2]=o.length+1}else if(35719==t)Tt[r>>2]=n.maxUniformLength;else if(35722==t){if(-1==n.maxAttributeLength){e=Cn.programs[e];var a=Qs.getProgramParameter(e,35721);n.maxAttributeLength=0;for(var i=0;i<a;++i){var s=Qs.getActiveAttrib(e,i);n.maxAttributeLength=Math.max(n.maxAttributeLength,s.name.length+1)}}Tt[r>>2]=n.maxAttributeLength}else if(35381==t){if(-1==n.maxUniformBlockNameLength){e=Cn.programs[e];var c=Qs.getProgramParameter(e,35382);n.maxUniformBlockNameLength=0;for(i=0;i<c;++i){var E=Qs.getActiveUniformBlockName(e,i);n.maxUniformBlockNameLength=Math.max(n.maxUniformBlockNameLength,E.length+1)}}Tt[r>>2]=n.maxUniformBlockNameLength}else Tt[r>>2]=Qs.getProgramParameter(Cn.programs[e],t);else Cn.recordError(1282)}else Cn.recordError(1281)}function $o(e,t,r){if(r){var n=Cn.timerQueriesEXT[e],o=Qs.disjointTimerQueryExt.getQueryObjectEXT(n,t);Vo(r,"boolean"==typeof o?o?1:0:o)}else Cn.recordError(1281)}function ea(e,t,r){if(r){var n,o=Cn.timerQueriesEXT[e],a=Qs.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof a?a?1:0:a,Tt[r>>2]=n}else Cn.recordError(1281)}function ta(e,t,r){if(r){var n=Cn.timerQueriesEXT[e],o=Qs.disjointTimerQueryExt.getQueryObjectEXT(n,t);Vo(r,"boolean"==typeof o?o?1:0:o)}else Cn.recordError(1281)}function ra(e,t,r){if(r){var n,o=Cn.timerQueriesEXT[e],a=Qs.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof a?a?1:0:a,Tt[r>>2]=n}else Cn.recordError(1281)}function na(e,t,r){r?Tt[r>>2]=Qs.disjointTimerQueryExt.getQueryEXT(e,t):Cn.recordError(1281)}function oa(e,t,r){r?Tt[r>>2]=Qs.getRenderbufferParameter(e,t):Cn.recordError(1281)}function aa(e,t,r,n){var o=Qs.getShaderInfoLog(Cn.shaders[e]);null===o&&(o="(unknown error)");var a=t>0&&n?Ft(o,n,t):0;r&&(Tt[r>>2]=a)}function ia(e,t,r,n){var o=Qs.getShaderPrecisionFormat(e,t);Tt[r>>2]=o.rangeMin,Tt[r+4>>2]=o.rangeMax,Tt[n>>2]=o.precision}function sa(e,t,r,n){var o=Qs.getShaderSource(Cn.shaders[e]);if(o){var a=t>0&&n?Ft(o,n,t):0;r&&(Tt[r>>2]=a)}}function ca(e,t,r){if(r)if(35716==t){var n=Qs.getShaderInfoLog(Cn.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;Tt[r>>2]=o}else if(35720==t){var a=Qs.getShaderSource(Cn.shaders[e]),i=a?a.length+1:0;Tt[r>>2]=i}else Tt[r>>2]=Qs.getShaderParameter(Cn.shaders[e],t);else Cn.recordError(1281)}function Ea(e){var t=St(e)+1,r=Ac(t);return Ft(e,r,t),r}function ua(e){if(Cn.stringCache[e])return Cn.stringCache[e];var t;switch(e){case 7939:var r=Qs.getSupportedExtensions()||[];t=Ea((r=r.concat(r.map((function(e){return"GL_"+e})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=Qs.getParameter(e);n||Cn.recordError(1280),t=Ea(n);break;case 7938:var o=Qs.getParameter(7938);t=Ea(o="OpenGL ES 2.0 ("+o+")");break;case 35724:var a=Qs.getParameter(35724),i=a.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==i&&(3==i[1].length&&(i[1]=i[1]+"0"),a="OpenGL ES GLSL ES "+i[1]+" ("+a+")"),t=Ea(a);break;default:return Cn.recordError(1280),0}return Cn.stringCache[e]=t,t}function la(e,t,r){r?Dt[r>>2]=Qs.getTexParameter(e,t):Cn.recordError(1281)}function fa(e,t,r){r?Tt[r>>2]=Qs.getTexParameter(e,t):Cn.recordError(1281)}function da(e){return parseInt(e)}function Aa(e,t){var r=0;if("]"==(t=Ot(t))[t.length-1]){var n=t.lastIndexOf("[");r="]"!=t[n+1]?da(t.slice(n+1)):0,t=t.slice(0,n)}var o=Cn.programInfos[e]&&Cn.programInfos[e].uniforms[t];return o&&r>=0&&r<o[0]?o[1]+r:-1}function pa(e,t,r,n){if(r){var o=Qs.getUniform(Cn.programs[e],Cn.uniforms[t]);if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:Tt[r>>2]=o;break;case 2:Dt[r>>2]=o}else for(var a=0;a<o.length;a++)switch(n){case 0:Tt[r+4*a>>2]=o[a];break;case 2:Dt[r+4*a>>2]=o[a]}}else Cn.recordError(1281)}function ga(e,t,r){pa(e,t,r,2)}function _a(e,t,r){pa(e,t,r,0)}function ma(e,t,r){r?Tt[r>>2]=Qs.getVertexAttribOffset(e,t):Cn.recordError(1281)}function ya(e,t,r,n){if(r){var o=Qs.getVertexAttrib(e,t);if(34975==t)Tt[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:Tt[r>>2]=o;break;case 2:Dt[r>>2]=o;break;case 5:Tt[r>>2]=Math.fround(o)}else for(var a=0;a<o.length;a++)switch(n){case 0:Tt[r+4*a>>2]=o[a];break;case 2:Dt[r+4*a>>2]=o[a];break;case 5:Tt[r+4*a>>2]=Math.fround(o[a])}}else Cn.recordError(1281)}function Ba(e,t,r){ya(e,t,r,2)}function Ta(e,t,r){ya(e,t,r,5)}function Ca(e,t){Qs.hint(e,t)}function Da(e){var t=Cn.buffers[e];return t?Qs.isBuffer(t):0}function ha(e){return Qs.isEnabled(e)}function va(e){var t=Cn.framebuffers[e];return t?Qs.isFramebuffer(t):0}function Pa(e){return(e=Cn.programs[e])?Qs.isProgram(e):0}function Oa(e){var t=Cn.timerQueriesEXT[e];return t?Qs.disjointTimerQueryExt.isQueryEXT(t):0}function ba(e){var t=Cn.renderbuffers[e];return t?Qs.isRenderbuffer(t):0}function Fa(e){var t=Cn.shaders[e];return t?Qs.isShader(t):0}function Sa(e){var t=Cn.textures[e];return t?Qs.isTexture(t):0}function Ma(e){var t=Cn.vaos[e];return t?Qs.isVertexArray(t):0}function Ra(e){Qs.lineWidth(e)}function wa(e){Qs.linkProgram(Cn.programs[e]),Cn.populateUniformTable(e)}function Ia(e,t){3317==e&&(Cn.unpackAlignment=t),Qs.pixelStorei(e,t)}function La(e,t){Qs.polygonOffset(e,t)}function xa(e,t){Qs.disjointTimerQueryExt.queryCounterEXT(Cn.timerQueriesEXT[e],t)}function Na(e,t,r,n){var o;return t*(e*r+(o=n)-1&-o)}function Ua(e){return{5:3,6:4,8:2,29502:3,29504:4}[e-6402]||1}function Ga(e){return 1==(e-=5120)?mt:4==e?Tt:6==e?Dt:5==e||28922==e?Ct:Bt}function ka(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function Ha(e,t,r,n,o,a){var i=Ga(e),s=ka(i),c=1<<s,E=Na(r,n,Ua(t)*c,Cn.unpackAlignment);return i.subarray(o>>s,o+E>>s)}function Xa(e,t,r,n,o,a,i){var s=Ha(a,o,r,n,i);s?Qs.readPixels(e,t,r,n,o,a,s):Cn.recordError(1280)}function Va(){}function Ka(e,t,r,n){Qs.renderbufferStorage(e,t,r,n)}function ja(e,t){Qs.sampleCoverage(e,!!t)}function Ya(e,t,r,n){Qs.scissor(e,t,r,n)}function Qa(){Cn.recordError(1280)}function Ja(e,t,r,n){var o=Cn.getSource(e,t,r,n);Qs.shaderSource(Cn.shaders[e],o)}function za(e,t,r){Qs.stencilFunc(e,t,r)}function Wa(e,t,r,n){Qs.stencilFuncSeparate(e,t,r,n)}function Za(e){Qs.stencilMask(e)}function qa(e,t){Qs.stencilMaskSeparate(e,t)}function $a(e,t,r){Qs.stencilOp(e,t,r)}function ei(e,t,r,n){Qs.stencilOpSeparate(e,t,r,n)}function ti(e,t,r,n,o,a,i,s,c){Qs.texImage2D(e,t,r,n,o,a,i,s,c?Ha(s,i,n,o,c):null)}function ri(e,t,r){Qs.texParameterf(e,t,r)}function ni(e,t,r){var n=Dt[r>>2];Qs.texParameterf(e,t,n)}function oi(e,t,r){Qs.texParameteri(e,t,r)}function ai(e,t,r){var n=Tt[r>>2];Qs.texParameteri(e,t,n)}function ii(e,t,r,n,o,a,i,s,c){var E=null;c&&(E=Ha(s,i,o,a,c)),Qs.texSubImage2D(e,t,r,n,o,a,i,s,E)}function si(e,t){Qs.uniform1f(Cn.uniforms[e],t)}Ue.tempFixedLengthArray=go,Ue._emscripten_glDrawBuffersWEBGL=_o,Ue._emscripten_glDrawElements=mo,Ue._emscripten_glDrawElementsInstancedANGLE=yo,Ue._emscripten_glEnable=Bo,Ue._emscripten_glEnableVertexAttribArray=To,Ue._emscripten_glEndQueryEXT=Co,Ue._emscripten_glFinish=Do,Ue._emscripten_glFlush=ho,Ue._emscripten_glFramebufferRenderbuffer=vo,Ue._emscripten_glFramebufferTexture2D=Po,Ue._emscripten_glFrontFace=Oo,Ue.__glGenObject=bo,Ue._emscripten_glGenBuffers=Fo,Ue._emscripten_glGenFramebuffers=So,Ue._emscripten_glGenQueriesEXT=Mo,Ue._emscripten_glGenRenderbuffers=Ro,Ue._emscripten_glGenTextures=wo,Ue._emscripten_glGenVertexArraysOES=Io,Ue._emscripten_glGenerateMipmap=Lo,Ue.__glGetActiveAttribOrUniform=xo,Ue._emscripten_glGetActiveAttrib=No,Ue._emscripten_glGetActiveUniform=Uo,Ue._emscripten_glGetAttachedShaders=Go,Ue._emscripten_glGetAttribLocation=ko,Ue.readI53FromI64=Ho,Ue.readI53FromU64=Xo,Ue.writeI53ToI64=Vo,Ue.emscriptenWebGLGet=Ko,Ue._emscripten_glGetBooleanv=jo,Ue._emscripten_glGetBufferParameteriv=Yo,Ue._emscripten_glGetError=Qo,Ue._emscripten_glGetFloatv=Jo,Ue._emscripten_glGetFramebufferAttachmentParameteriv=zo,Ue._emscripten_glGetIntegerv=Wo,Ue._emscripten_glGetProgramInfoLog=Zo,Ue._emscripten_glGetProgramiv=qo,Ue._emscripten_glGetQueryObjecti64vEXT=$o,Ue._emscripten_glGetQueryObjectivEXT=ea,Ue._emscripten_glGetQueryObjectui64vEXT=ta,Ue._emscripten_glGetQueryObjectuivEXT=ra,Ue._emscripten_glGetQueryivEXT=na,Ue._emscripten_glGetRenderbufferParameteriv=oa,Ue._emscripten_glGetShaderInfoLog=aa,Ue._emscripten_glGetShaderPrecisionFormat=ia,Ue._emscripten_glGetShaderSource=sa,Ue._emscripten_glGetShaderiv=ca,Ue.stringToNewUTF8=Ea,Ue._emscripten_glGetString=ua,Ue._emscripten_glGetTexParameterfv=la,Ue._emscripten_glGetTexParameteriv=fa,Ue.jstoi_q=da,Ue._emscripten_glGetUniformLocation=Aa,Ue.emscriptenWebGLGetUniform=pa,Ue._emscripten_glGetUniformfv=ga,Ue._emscripten_glGetUniformiv=_a,Ue._emscripten_glGetVertexAttribPointerv=ma,Ue.emscriptenWebGLGetVertexAttrib=ya,Ue._emscripten_glGetVertexAttribfv=Ba,Ue._emscripten_glGetVertexAttribiv=Ta,Ue._emscripten_glHint=Ca,Ue._emscripten_glIsBuffer=Da,Ue._emscripten_glIsEnabled=ha,Ue._emscripten_glIsFramebuffer=va,Ue._emscripten_glIsProgram=Pa,Ue._emscripten_glIsQueryEXT=Oa,Ue._emscripten_glIsRenderbuffer=ba,Ue._emscripten_glIsShader=Fa,Ue._emscripten_glIsTexture=Sa,Ue._emscripten_glIsVertexArrayOES=Ma,Ue._emscripten_glLineWidth=Ra,Ue._emscripten_glLinkProgram=wa,Ue._emscripten_glPixelStorei=Ia,Ue._emscripten_glPolygonOffset=La,Ue._emscripten_glQueryCounterEXT=xa,Ue.computeUnpackAlignedImageSize=Na,Ue.__colorChannelsInGlTextureFormat=Ua,Ue.heapObjectForWebGLType=Ga,Ue.heapAccessShiftForWebGLHeap=ka,Ue.emscriptenWebGLGetTexPixelData=Ha,Ue._emscripten_glReadPixels=Xa,Ue._emscripten_glReleaseShaderCompiler=Va,Ue._emscripten_glRenderbufferStorage=Ka,Ue._emscripten_glSampleCoverage=ja,Ue._emscripten_glScissor=Ya,Ue._emscripten_glShaderBinary=Qa,Ue._emscripten_glShaderSource=Ja,Ue._emscripten_glStencilFunc=za,Ue._emscripten_glStencilFuncSeparate=Wa,Ue._emscripten_glStencilMask=Za,Ue._emscripten_glStencilMaskSeparate=qa,Ue._emscripten_glStencilOp=$a,Ue._emscripten_glStencilOpSeparate=ei,Ue._emscripten_glTexImage2D=ti,Ue._emscripten_glTexParameterf=ri,Ue._emscripten_glTexParameterfv=ni,Ue._emscripten_glTexParameteri=oi,Ue._emscripten_glTexParameteriv=ai,Ue._emscripten_glTexSubImage2D=ii,Ue._emscripten_glUniform1f=si;var ci=[];function Ei(e,t,r){if(t<=288)for(var n=ci[t-1],o=0;o<t;++o)n[o]=Dt[r+4*o>>2];else n=Dt.subarray(r>>2,r+4*t>>2);Qs.uniform1fv(Cn.uniforms[e],n)}function ui(e,t){Qs.uniform1i(Cn.uniforms[e],t)}Ue.miniTempWebGLFloatBuffers=ci,Ue._emscripten_glUniform1fv=Ei,Ue._emscripten_glUniform1i=ui;var li=[];function fi(e,t,r){if(t<=288)for(var n=li[t-1],o=0;o<t;++o)n[o]=Tt[r+4*o>>2];else n=Tt.subarray(r>>2,r+4*t>>2);Qs.uniform1iv(Cn.uniforms[e],n)}function di(e,t,r){Qs.uniform2f(Cn.uniforms[e],t,r)}function Ai(e,t,r){if(t<=144)for(var n=ci[2*t-1],o=0;o<2*t;o+=2)n[o]=Dt[r+4*o>>2],n[o+1]=Dt[r+(4*o+4)>>2];else n=Dt.subarray(r>>2,r+8*t>>2);Qs.uniform2fv(Cn.uniforms[e],n)}function pi(e,t,r){Qs.uniform2i(Cn.uniforms[e],t,r)}function gi(e,t,r){if(t<=144)for(var n=li[2*t-1],o=0;o<2*t;o+=2)n[o]=Tt[r+4*o>>2],n[o+1]=Tt[r+(4*o+4)>>2];else n=Tt.subarray(r>>2,r+8*t>>2);Qs.uniform2iv(Cn.uniforms[e],n)}function _i(e,t,r,n){Qs.uniform3f(Cn.uniforms[e],t,r,n)}function mi(e,t,r){if(t<=96)for(var n=ci[3*t-1],o=0;o<3*t;o+=3)n[o]=Dt[r+4*o>>2],n[o+1]=Dt[r+(4*o+4)>>2],n[o+2]=Dt[r+(4*o+8)>>2];else n=Dt.subarray(r>>2,r+12*t>>2);Qs.uniform3fv(Cn.uniforms[e],n)}function yi(e,t,r,n){Qs.uniform3i(Cn.uniforms[e],t,r,n)}function Bi(e,t,r){if(t<=96)for(var n=li[3*t-1],o=0;o<3*t;o+=3)n[o]=Tt[r+4*o>>2],n[o+1]=Tt[r+(4*o+4)>>2],n[o+2]=Tt[r+(4*o+8)>>2];else n=Tt.subarray(r>>2,r+12*t>>2);Qs.uniform3iv(Cn.uniforms[e],n)}function Ti(e,t,r,n,o){Qs.uniform4f(Cn.uniforms[e],t,r,n,o)}function Ci(e,t,r){if(t<=72){var n=ci[4*t-1],o=Dt;r>>=2;for(var a=0;a<4*t;a+=4){var i=r+a;n[a]=o[i],n[a+1]=o[i+1],n[a+2]=o[i+2],n[a+3]=o[i+3]}}else n=Dt.subarray(r>>2,r+16*t>>2);Qs.uniform4fv(Cn.uniforms[e],n)}function Di(e,t,r,n,o){Qs.uniform4i(Cn.uniforms[e],t,r,n,o)}function hi(e,t,r){if(t<=72)for(var n=li[4*t-1],o=0;o<4*t;o+=4)n[o]=Tt[r+4*o>>2],n[o+1]=Tt[r+(4*o+4)>>2],n[o+2]=Tt[r+(4*o+8)>>2],n[o+3]=Tt[r+(4*o+12)>>2];else n=Tt.subarray(r>>2,r+16*t>>2);Qs.uniform4iv(Cn.uniforms[e],n)}function vi(e,t,r,n){if(t<=72)for(var o=ci[4*t-1],a=0;a<4*t;a+=4)o[a]=Dt[n+4*a>>2],o[a+1]=Dt[n+(4*a+4)>>2],o[a+2]=Dt[n+(4*a+8)>>2],o[a+3]=Dt[n+(4*a+12)>>2];else o=Dt.subarray(n>>2,n+16*t>>2);Qs.uniformMatrix2fv(Cn.uniforms[e],!!r,o)}function Pi(e,t,r,n){if(t<=32)for(var o=ci[9*t-1],a=0;a<9*t;a+=9)o[a]=Dt[n+4*a>>2],o[a+1]=Dt[n+(4*a+4)>>2],o[a+2]=Dt[n+(4*a+8)>>2],o[a+3]=Dt[n+(4*a+12)>>2],o[a+4]=Dt[n+(4*a+16)>>2],o[a+5]=Dt[n+(4*a+20)>>2],o[a+6]=Dt[n+(4*a+24)>>2],o[a+7]=Dt[n+(4*a+28)>>2],o[a+8]=Dt[n+(4*a+32)>>2];else o=Dt.subarray(n>>2,n+36*t>>2);Qs.uniformMatrix3fv(Cn.uniforms[e],!!r,o)}function Oi(e,t,r,n){if(t<=18){var o=ci[16*t-1],a=Dt;n>>=2;for(var i=0;i<16*t;i+=16){var s=n+i;o[i]=a[s],o[i+1]=a[s+1],o[i+2]=a[s+2],o[i+3]=a[s+3],o[i+4]=a[s+4],o[i+5]=a[s+5],o[i+6]=a[s+6],o[i+7]=a[s+7],o[i+8]=a[s+8],o[i+9]=a[s+9],o[i+10]=a[s+10],o[i+11]=a[s+11],o[i+12]=a[s+12],o[i+13]=a[s+13],o[i+14]=a[s+14],o[i+15]=a[s+15]}}else o=Dt.subarray(n>>2,n+64*t>>2);Qs.uniformMatrix4fv(Cn.uniforms[e],!!r,o)}function bi(e){Qs.useProgram(Cn.programs[e])}function Fi(e){Qs.validateProgram(Cn.programs[e])}function Si(e,t){Qs.vertexAttrib1f(e,t)}function Mi(e,t){Qs.vertexAttrib1f(e,Dt[t>>2])}function Ri(e,t,r){Qs.vertexAttrib2f(e,t,r)}function wi(e,t){Qs.vertexAttrib2f(e,Dt[t>>2],Dt[t+4>>2])}function Ii(e,t,r,n){Qs.vertexAttrib3f(e,t,r,n)}function Li(e,t){Qs.vertexAttrib3f(e,Dt[t>>2],Dt[t+4>>2],Dt[t+8>>2])}function xi(e,t,r,n,o){Qs.vertexAttrib4f(e,t,r,n,o)}function Ni(e,t){Qs.vertexAttrib4f(e,Dt[t>>2],Dt[t+4>>2],Dt[t+8>>2],Dt[t+12>>2])}function Ui(e,t){Qs.vertexAttribDivisor(e,t)}function Gi(e,t,r,n,o,a){Qs.vertexAttribPointer(e,t,r,!!n,o,a)}function ki(e,t,r,n){Qs.viewport(e,t,r,n)}function Hi(e,t){throw dc(e,t||1),"longjmp"}function Xi(e,t){return Hi(e,t)}function Vi(e,t,r){mt.copyWithin(e,t,t+r)}function Ki(){return mt.length}function ji(e){try{return ct.grow(e-gt.byteLength+65535>>>16),Lt(ct.buffer),1}catch(t){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+gt.byteLength+" bytes to "+e+" bytes, but got error: "+t)}}function Yi(e){var t=Ki();ft(e>t);var r=2147483648;if(e>r)return et("Cannot enlarge memory, asked to go up to "+e+" bytes, but the limit is "+"2147483648 bytes!"),!1;for(var n=1;n<=4;n*=2){var o=t*(1+.2/n);o=Math.min(o,e+100663296);var a=Math.min(r,It(Math.max(e,o),65536));if(ji(a))return!0}return et("Failed to grow the heap from "+t+" bytes to "+a+" bytes, not enough memory!"),!1}Ue.__miniTempWebGLIntBuffers=li,Ue._emscripten_glUniform1iv=fi,Ue._emscripten_glUniform2f=di,Ue._emscripten_glUniform2fv=Ai,Ue._emscripten_glUniform2i=pi,Ue._emscripten_glUniform2iv=gi,Ue._emscripten_glUniform3f=_i,Ue._emscripten_glUniform3fv=mi,Ue._emscripten_glUniform3i=yi,Ue._emscripten_glUniform3iv=Bi,Ue._emscripten_glUniform4f=Ti,Ue._emscripten_glUniform4fv=Ci,Ue._emscripten_glUniform4i=Di,Ue._emscripten_glUniform4iv=hi,Ue._emscripten_glUniformMatrix2fv=vi,Ue._emscripten_glUniformMatrix3fv=Pi,Ue._emscripten_glUniformMatrix4fv=Oi,Ue._emscripten_glUseProgram=bi,Ue._emscripten_glValidateProgram=Fi,Ue._emscripten_glVertexAttrib1f=Si,Ue._emscripten_glVertexAttrib1fv=Mi,Ue._emscripten_glVertexAttrib2f=Ri,Ue._emscripten_glVertexAttrib2fv=wi,Ue._emscripten_glVertexAttrib3f=Ii,Ue._emscripten_glVertexAttrib3fv=Li,Ue._emscripten_glVertexAttrib4f=xi,Ue._emscripten_glVertexAttrib4fv=Ni,Ue._emscripten_glVertexAttribDivisorANGLE=Ui,Ue._emscripten_glVertexAttribPointer=Gi,Ue._emscripten_glViewport=ki,Ue._longjmp=Hi,Ue._emscripten_longjmp=Xi,Ue._emscripten_memcpy_big=Vi,Ue._emscripten_get_heap_size=Ki,Ue.emscripten_realloc_buffer=ji,Ue._emscripten_resize_heap=Yi;var Qi={};function Ji(){return ke||"./this.program"}function zi(){if(!zi.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:Ji()};for(var t in Qi)e[t]=Qi[t];var r=[];for(var t in e)r.push(t+"="+e[t]);zi.strings=r}return zi.strings}function Wi(e,t){try{var r=0;return zi().forEach((function(n,o){var a=t+r;Tt[e+4*o>>2]=a,wt(n,a),r+=n.length+1})),0}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),e.errno}}function Zi(e,t){try{var r=zi();Tt[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),Tt[t>>2]=n,0}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),e.errno}}function qi(e){Pc(e)}function $i(e){try{var t=Zr.getStreamFromFD(e);return Wr.close(t),0}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),e.errno}}function es(e,t){try{var r=Zr.getStreamFromFD(e),n=r.tty?2:Wr.isDir(r.mode)?3:Wr.isLink(r.mode)?7:4;return _t[t>>0]=n,0}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),e.errno}}function ts(e,t,r,n){try{var o=Zr.getStreamFromFD(e),a=Zr.doReadv(o,t,r);return Tt[n>>2]=a,0}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),e.errno}}function rs(e,t,r,n,o){try{var a=Zr.getStreamFromFD(e),i=4294967296*r+(t>>>0),s=9007199254740992;return i<=-s||i>=s?-61:(Wr.llseek(a,i,n),pr=[a.position>>>0,(Ar=a.position,+Math.abs(Ar)>=1?Ar>0?(0|Math.min(+Math.floor(Ar/4294967296),4294967295))>>>0:~~+Math.ceil((Ar-+(~~Ar>>>0))/4294967296)>>>0:0)],Tt[o>>2]=pr[0],Tt[o+4>>2]=pr[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0)}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),e.errno}}function ns(e,t,r,n){try{var o=Zr.getStreamFromFD(e),a=Zr.doWritev(o,t,r);return Tt[n>>2]=a,0}catch(e){return void 0!==Wr&&e instanceof Wr.ErrnoError||sr(e),e.errno}}function os(){return 0|st()}function as(e,t){Qs.bindTexture(e,Cn.textures[t])}function is(e,t){Qs.blendFunc(e,t)}function ss(e,t,r,n){Qs.colorMask(!!e,!!t,!!r,!!n)}function cs(e){Qs.cullFace(e)}function Es(e,t){for(var r=0;r<e;r++){var n=Tt[t+4*r>>2],o=Cn.textures[n];o&&(Qs.deleteTexture(o),o.name=0,Cn.textures[n]=null)}}function us(e){Qs.depthFunc(e)}function ls(e){Qs.depthMask(!!e)}function fs(e,t){Qs.depthRange(e,t)}function ds(e,t,r){Qs.drawArrays(e,t,r)}function As(e,t,r,n){Qs.drawElements(e,t,r,n)}function ps(e){Qs.enable(e)}function gs(e){Qs.frontFace(e)}function _s(e,t){bo(e,t,"createTexture",Cn.textures)}function ms(){var e=Qs.getError()||Cn.lastError;return Cn.lastError=0,e}function ys(e,t){Ko(e,t,0)}function Bs(e){if(Cn.stringCache[e])return Cn.stringCache[e];var t;switch(e){case 7939:var r=Qs.getSupportedExtensions()||[];t=Ea((r=r.concat(r.map((function(e){return"GL_"+e})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=Qs.getParameter(e);n||Cn.recordError(1280),t=Ea(n);break;case 7938:var o=Qs.getParameter(7938);t=Ea(o="OpenGL ES 2.0 ("+o+")");break;case 35724:var a=Qs.getParameter(35724),i=a.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==i&&(3==i[1].length&&(i[1]=i[1]+"0"),a="OpenGL ES GLSL ES "+i[1]+" ("+a+")"),t=Ea(a);break;default:return Cn.recordError(1280),0}return Cn.stringCache[e]=t,t}function Ts(e,t){Qs.hint(e,t)}function Cs(e){Qs.lineWidth(e)}function Ds(e,t){3317==e&&(Cn.unpackAlignment=t),Qs.pixelStorei(e,t)}function hs(e,t){Qs.polygonOffset(e,t)}function vs(e,t,r,n,o,a,i){var s=Ha(a,o,r,n,i);s?Qs.readPixels(e,t,r,n,o,a,s):Cn.recordError(1280)}function Ps(e,t,r,n){Qs.scissor(e,t,r,n)}function Os(){Cn.recordError(1280)}function bs(e,t,r){Qs.stencilFunc(e,t,r)}function Fs(e){Qs.stencilMask(e)}function Ss(e,t,r){Qs.stencilOp(e,t,r)}function Ms(e,t,r,n,o,a,i,s,c){Qs.texImage2D(e,t,r,n,o,a,i,s,c?Ha(s,i,n,o,c):null)}function Rs(e,t,r){Qs.texParameterf(e,t,r)}function ws(e,t,r){var n=Dt[r>>2];Qs.texParameterf(e,t,n)}function Is(e,t,r){Qs.texParameteri(e,t,r)}function Ls(e,t,r){var n=Tt[r>>2];Qs.texParameteri(e,t,n)}function xs(e,t,r,n,o,a,i,s,c){var E=null;c&&(E=Ha(s,i,o,a,c)),Qs.texSubImage2D(e,t,r,n,o,a,i,s,E)}function Ns(e,t,r,n){Qs.viewport(e,t,r,n)}function Us(e){it(0|e)}function Gs(e){return e%4==0&&(e%100!=0||e%400==0)}function ks(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}Ue.ENV=Qi,Ue.getExecutableName=Ji,Ue.getEnvStrings=zi,Ue._environ_get=Wi,Ue._environ_sizes_get=Zi,Ue._exit=qi,Ue._fd_close=$i,Ue._fd_fdstat_get=es,Ue._fd_read=ts,Ue._fd_seek=rs,Ue._fd_write=ns,Ue._getTempRet0=os,Ue._glBindTexture=as,Ue._glBlendFunc=is,Ue._glColorMask=ss,Ue._glCullFace=cs,Ue._glDeleteTextures=Es,Ue._glDepthFunc=us,Ue._glDepthMask=ls,Ue._glDepthRangef=fs,Ue._glDrawArrays=ds,Ue._glDrawElements=As,Ue._glEnable=ps,Ue._glFrontFace=gs,Ue._glGenTextures=_s,Ue._glGetError=ms,Ue._glGetIntegerv=ys,Ue._glGetString=Bs,Ue._glHint=Ts,Ue._glLineWidth=Cs,Ue._glPixelStorei=Ds,Ue._glPolygonOffset=hs,Ue._glReadPixels=vs,Ue._glScissor=Ps,Ue._glShaderBinary=Os,Ue._glStencilFunc=bs,Ue._glStencilMask=Fs,Ue._glStencilOp=Ss,Ue._glTexImage2D=Ms,Ue._glTexParameterf=Rs,Ue._glTexParameterfv=ws,Ue._glTexParameteri=Is,Ue._glTexParameteriv=Ls,Ue._glTexSubImage2D=xs,Ue._glViewport=Ns,Ue._setTempRet0=Us,Ue.__isLeapYear=Gs,Ue.__arraySum=ks;var Hs=[31,29,31,30,31,30,31,31,30,31,30,31];Ue.__MONTH_DAYS_LEAP=Hs;var Xs=[31,28,31,30,31,30,31,31,30,31,30,31];function Vs(e,t){for(var r=new Date(e.getTime());t>0;){var n=Gs(r.getFullYear()),o=r.getMonth(),a=(n?Hs:Xs)[o];if(!(t>a-r.getDate()))return r.setDate(r.getDate()+t),r;t-=a-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}function Ks(e,t,r,n){var o=Tt[n+40>>2],a={tm_sec:Tt[n>>2],tm_min:Tt[n+4>>2],tm_hour:Tt[n+8>>2],tm_mday:Tt[n+12>>2],tm_mon:Tt[n+16>>2],tm_year:Tt[n+20>>2],tm_wday:Tt[n+24>>2],tm_yday:Tt[n+28>>2],tm_isdst:Tt[n+32>>2],tm_gmtoff:Tt[n+36>>2],tm_zone:o?Ot(o):""},i=Ot(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var c in s)i=i.replace(new RegExp(c,"g"),s[c]);var E=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function f(e,t){return l(e,t,"0")}function d(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function A(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function p(e){var t=Vs(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=A(r),a=A(n);return d(o,t)<=0?d(a,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":function(e){return E[e.tm_wday].substring(0,3)},"%A":function(e){return E[e.tm_wday]},"%b":function(e){return u[e.tm_mon].substring(0,3)},"%B":function(e){return u[e.tm_mon]},"%C":function(e){return f((e.tm_year+1900)/100|0,2)},"%d":function(e){return f(e.tm_mday,2)},"%e":function(e){return l(e.tm_mday,2," ")},"%g":function(e){return p(e).toString().substring(2)},"%G":function(e){return p(e)},"%H":function(e){return f(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),f(t,2)},"%j":function(e){return f(e.tm_mday+ks(Gs(e.tm_year+1900)?Hs:Xs,e.tm_mon-1),3)},"%m":function(e){return f(e.tm_mon+1,2)},"%M":function(e){return f(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return f(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),r=0===t.getDay()?t:Vs(t,7-t.getDay()),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(d(r,n)<0){var o=ks(Gs(n.getFullYear())?Hs:Xs,n.getMonth()-1)-31,a=31-r.getDate()+o+n.getDate();return f(Math.ceil(a/7),2)}return 0===d(r,t)?"01":"00"},"%V":function(e){var t,r=new Date(e.tm_year+1900,0,4),n=new Date(e.tm_year+1901,0,4),o=A(r),a=A(n),i=Vs(new Date(e.tm_year+1900,0,1),e.tm_yday);return d(i,o)<0?"53":d(a,i)<=0?"01":(t=o.getFullYear()<e.tm_year+1900?e.tm_yday+32-o.getDate():e.tm_yday+1-o.getDate(),f(Math.ceil(t/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var t=new Date(e.tm_year,0,1),r=1===t.getDay()?t:Vs(t,0===t.getDay()?1:7-t.getDay()+1),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(d(r,n)<0){var o=ks(Gs(n.getFullYear())?Hs:Xs,n.getMonth()-1)-31,a=31-r.getDate()+o+n.getDate();return f(Math.ceil(a/7),2)}return 0===d(r,t)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var c in g)i.indexOf(c)>=0&&(i=i.replace(new RegExp(c,"g"),g[c](a)));var _=ec(i,!1);return _.length>t?0:(Rt(_,e),_.length-1)}function js(e,t,r,n){return Ks(e,t,r,n)}function Ys(e){var t=Date.now()/1e3|0;return e&&(Tt[e>>2]=t),t}Ue.__MONTH_DAYS_REGULAR=Xs,Ue.__addDays=Vs,Ue._strftime=Ks,Ue._strftime_l=js,Ue._time=Ys;var Qs,Js=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Wr.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},zs=365,Ws=146;Object.defineProperties(Js.prototype,{read:{get:function(){return(this.mode&zs)===zs},set:function(e){e?this.mode|=zs:this.mode&=~zs}},write:{get:function(){return(this.mode&Ws)===Ws},set:function(e){e?this.mode|=Ws:this.mode&=~Ws}},isFolder:{get:function(){return Wr.isDir(this.mode)}},isDevice:{get:function(){return Wr.isChrdev(this.mode)}}}),Wr.FSNode=Js,Wr.staticInit();for(var Zs=0;Zs<32;++Zs)go.push(new Array(Zs));var qs=new Float32Array(288);for(Zs=0;Zs<288;++Zs)ci[Zs]=qs.subarray(0,Zs+1);var $s=new Int32Array(288);for(Zs=0;Zs<288;++Zs)li[Zs]=$s.subarray(0,Zs+1);function ec(e,t,r){var n=r>0?r:St(e)+1,o=new Array(n),a=bt(e,o,0,o.length);return t&&(o.length=a),o}var tc={__assert_fail:Pr,__clock_gettime:Sr,__cxa_allocate_exception:Rr,__cxa_atexit:Ir,__cxa_throw:Ur,__localtime_r:Hr,__sys_access:qr,__sys_dup:$r,__sys_fcntl64:en,__sys_fstat64:tn,__sys_getcwd:rn,__sys_getdents64:nn,__sys_ioctl:on,__sys_lstat64:an,__sys_mkdir:sn,__sys_open:cn,__sys_readlink:En,__sys_rename:un,__sys_rmdir:ln,__sys_stat64:fn,__sys_unlink:dn,abort:An,clock_gettime:Fr,dlclose:pn,dlerror:gn,dlopen:_n,emscripten_glActiveTexture:Dn,emscripten_glAttachShader:hn,emscripten_glBeginQueryEXT:vn,emscripten_glBindAttribLocation:Pn,emscripten_glBindBuffer:On,emscripten_glBindFramebuffer:bn,emscripten_glBindRenderbuffer:Fn,emscripten_glBindTexture:Sn,emscripten_glBindVertexArrayOES:Mn,emscripten_glBlendColor:Rn,emscripten_glBlendEquation:wn,emscripten_glBlendEquationSeparate:In,emscripten_glBlendFunc:Ln,emscripten_glBlendFuncSeparate:xn,emscripten_glBufferData:Nn,emscripten_glBufferSubData:Un,emscripten_glCheckFramebufferStatus:Gn,emscripten_glClear:kn,emscripten_glClearColor:Hn,emscripten_glClearDepthf:Xn,emscripten_glClearStencil:Vn,emscripten_glColorMask:Kn,emscripten_glCompileShader:jn,emscripten_glCompressedTexImage2D:Yn,emscripten_glCompressedTexSubImage2D:Qn,emscripten_glCopyTexImage2D:Jn,emscripten_glCopyTexSubImage2D:zn,emscripten_glCreateProgram:Wn,emscripten_glCreateShader:Zn,emscripten_glCullFace:qn,emscripten_glDeleteBuffers:$n,emscripten_glDeleteFramebuffers:eo,emscripten_glDeleteProgram:to,emscripten_glDeleteQueriesEXT:ro,emscripten_glDeleteRenderbuffers:no,emscripten_glDeleteShader:oo,emscripten_glDeleteTextures:ao,emscripten_glDeleteVertexArraysOES:io,emscripten_glDepthFunc:so,emscripten_glDepthMask:co,emscripten_glDepthRangef:Eo,emscripten_glDetachShader:uo,emscripten_glDisable:lo,emscripten_glDisableVertexAttribArray:fo,emscripten_glDrawArrays:Ao,emscripten_glDrawArraysInstancedANGLE:po,emscripten_glDrawBuffersWEBGL:_o,emscripten_glDrawElements:mo,emscripten_glDrawElementsInstancedANGLE:yo,emscripten_glEnable:Bo,emscripten_glEnableVertexAttribArray:To,emscripten_glEndQueryEXT:Co,emscripten_glFinish:Do,emscripten_glFlush:ho,emscripten_glFramebufferRenderbuffer:vo,emscripten_glFramebufferTexture2D:Po,emscripten_glFrontFace:Oo,emscripten_glGenBuffers:Fo,emscripten_glGenFramebuffers:So,emscripten_glGenQueriesEXT:Mo,emscripten_glGenRenderbuffers:Ro,emscripten_glGenTextures:wo,emscripten_glGenVertexArraysOES:Io,emscripten_glGenerateMipmap:Lo,emscripten_glGetActiveAttrib:No,emscripten_glGetActiveUniform:Uo,emscripten_glGetAttachedShaders:Go,emscripten_glGetAttribLocation:ko,emscripten_glGetBooleanv:jo,emscripten_glGetBufferParameteriv:Yo,emscripten_glGetError:Qo,emscripten_glGetFloatv:Jo,emscripten_glGetFramebufferAttachmentParameteriv:zo,emscripten_glGetIntegerv:Wo,emscripten_glGetProgramInfoLog:Zo,emscripten_glGetProgramiv:qo,emscripten_glGetQueryObjecti64vEXT:$o,emscripten_glGetQueryObjectivEXT:ea,emscripten_glGetQueryObjectui64vEXT:ta,emscripten_glGetQueryObjectuivEXT:ra,emscripten_glGetQueryivEXT:na,emscripten_glGetRenderbufferParameteriv:oa,emscripten_glGetShaderInfoLog:aa,emscripten_glGetShaderPrecisionFormat:ia,emscripten_glGetShaderSource:sa,emscripten_glGetShaderiv:ca,emscripten_glGetString:ua,emscripten_glGetTexParameterfv:la,emscripten_glGetTexParameteriv:fa,emscripten_glGetUniformLocation:Aa,emscripten_glGetUniformfv:ga,emscripten_glGetUniformiv:_a,emscripten_glGetVertexAttribPointerv:ma,emscripten_glGetVertexAttribfv:Ba,emscripten_glGetVertexAttribiv:Ta,emscripten_glHint:Ca,emscripten_glIsBuffer:Da,emscripten_glIsEnabled:ha,emscripten_glIsFramebuffer:va,emscripten_glIsProgram:Pa,emscripten_glIsQueryEXT:Oa,emscripten_glIsRenderbuffer:ba,emscripten_glIsShader:Fa,emscripten_glIsTexture:Sa,emscripten_glIsVertexArrayOES:Ma,emscripten_glLineWidth:Ra,emscripten_glLinkProgram:wa,emscripten_glPixelStorei:Ia,emscripten_glPolygonOffset:La,emscripten_glQueryCounterEXT:xa,emscripten_glReadPixels:Xa,emscripten_glReleaseShaderCompiler:Va,emscripten_glRenderbufferStorage:Ka,emscripten_glSampleCoverage:ja,emscripten_glScissor:Ya,emscripten_glShaderBinary:Qa,emscripten_glShaderSource:Ja,emscripten_glStencilFunc:za,emscripten_glStencilFuncSeparate:Wa,emscripten_glStencilMask:Za,emscripten_glStencilMaskSeparate:qa,emscripten_glStencilOp:$a,emscripten_glStencilOpSeparate:ei,emscripten_glTexImage2D:ti,emscripten_glTexParameterf:ri,emscripten_glTexParameterfv:ni,emscripten_glTexParameteri:oi,emscripten_glTexParameteriv:ai,emscripten_glTexSubImage2D:ii,emscripten_glUniform1f:si,emscripten_glUniform1fv:Ei,emscripten_glUniform1i:ui,emscripten_glUniform1iv:fi,emscripten_glUniform2f:di,emscripten_glUniform2fv:Ai,emscripten_glUniform2i:pi,emscripten_glUniform2iv:gi,emscripten_glUniform3f:_i,emscripten_glUniform3fv:mi,emscripten_glUniform3i:yi,emscripten_glUniform3iv:Bi,emscripten_glUniform4f:Ti,emscripten_glUniform4fv:Ci,emscripten_glUniform4i:Di,emscripten_glUniform4iv:hi,emscripten_glUniformMatrix2fv:vi,emscripten_glUniformMatrix3fv:Pi,emscripten_glUniformMatrix4fv:Oi,emscripten_glUseProgram:bi,emscripten_glValidateProgram:Fi,emscripten_glVertexAttrib1f:Si,emscripten_glVertexAttrib1fv:Mi,emscripten_glVertexAttrib2f:Ri,emscripten_glVertexAttrib2fv:wi,emscripten_glVertexAttrib3f:Ii,emscripten_glVertexAttrib3fv:Li,emscripten_glVertexAttrib4f:xi,emscripten_glVertexAttrib4fv:Ni,emscripten_glVertexAttribDivisorANGLE:Ui,emscripten_glVertexAttribPointer:Gi,emscripten_glViewport:ki,emscripten_longjmp:Xi,emscripten_memcpy_big:Vi,emscripten_resize_heap:Yi,environ_get:Wi,environ_sizes_get:Zi,exit:qi,fd_close:$i,fd_fdstat_get:es,fd_read:ts,fd_seek:rs,fd_write:ns,getTempRet0:os,glBindTexture:as,glBlendFunc:is,glColorMask:ss,glCullFace:cs,glDeleteTextures:Es,glDepthFunc:us,glDepthMask:ls,glDepthRangef:fs,glDrawArrays:ds,glDrawElements:As,glEnable:ps,glFrontFace:gs,glGenTextures:_s,glGetError:ms,glGetIntegerv:ys,glGetString:Bs,glHint:Ts,glLineWidth:Cs,glPixelStorei:Ds,glPolygonOffset:hs,glReadPixels:vs,glScissor:Ps,glShaderBinary:Os,glStencilFunc:bs,glStencilMask:Fs,glStencilOp:Ss,glTexImage2D:Ms,glTexParameterf:Rs,glTexParameterfv:ws,glTexParameteri:Is,glTexParameteriv:Ls,glTexSubImage2D:xs,glViewport:Ns,invoke_ii:pc,invoke_iii:yc,invoke_iiii:Tc,invoke_iiiii:Bc,invoke_vi:gc,invoke_vii:mc,invoke_viii:_c,setTempRet0:Us,strftime:Ks,strftime_l:js,time:Ys};Br();var rc=Ue.___wasm_call_ctors=dr("__wasm_call_ctors");Ue._FreeMemory=dr("FreeMemory"),Ue._OSGBToS3MB=dr("OSGBToS3MB");var nc=Ue.___errno_location=dr("__errno_location");Ue._fflush=dr("fflush");var oc=Ue.__get_tzname=dr("_get_tzname"),ac=Ue.__get_daylight=dr("_get_daylight"),ic=Ue.__get_timezone=dr("_get_timezone");Ue._emscripten_main_thread_process_queued_calls=dr("emscripten_main_thread_process_queued_calls");var sc=Ue.stackSave=dr("stackSave"),cc=Ue.stackRestore=dr("stackRestore"),Ec=Ue.stackAlloc=dr("stackAlloc"),uc=Ue._emscripten_stack_init=function(){return(uc=Ue._emscripten_stack_init=Ue.asm.emscripten_stack_init).apply(null,arguments)};Ue._emscripten_stack_get_free=function(){return(Ue._emscripten_stack_get_free=Ue.asm.emscripten_stack_get_free).apply(null,arguments)};var lc,fc=Ue._emscripten_stack_get_end=function(){return(fc=Ue._emscripten_stack_get_end=Ue.asm.emscripten_stack_get_end).apply(null,arguments)},dc=Ue._setThrew=dr("setThrew"),Ac=Ue._malloc=dr("malloc");function pc(e,t){var r=sc();try{return Nt.get(e)(t)}catch(e){if(cc(r),e!==e+0&&"longjmp"!==e)throw e;dc(1,0)}}function gc(e,t){var r=sc();try{Nt.get(e)(t)}catch(e){if(cc(r),e!==e+0&&"longjmp"!==e)throw e;dc(1,0)}}function _c(e,t,r,n){var o=sc();try{Nt.get(e)(t,r,n)}catch(e){if(cc(o),e!==e+0&&"longjmp"!==e)throw e;dc(1,0)}}function mc(e,t,r){var n=sc();try{Nt.get(e)(t,r)}catch(e){if(cc(n),e!==e+0&&"longjmp"!==e)throw e;dc(1,0)}}function yc(e,t,r){var n=sc();try{return Nt.get(e)(t,r)}catch(e){if(cc(n),e!==e+0&&"longjmp"!==e)throw e;dc(1,0)}}function Bc(e,t,r,n,o){var a=sc();try{return Nt.get(e)(t,r,n,o)}catch(e){if(cc(a),e!==e+0&&"longjmp"!==e)throw e;dc(1,0)}}function Tc(e,t,r,n){var o=sc();try{return Nt.get(e)(t,r,n)}catch(e){if(cc(o),e!==e+0&&"longjmp"!==e)throw e;dc(1,0)}}function Cc(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Dc(){uc(),Gt()}function hc(e){function t(){lc||(lc=!0,Ue.calledRun=!0,lt||(Jt(),zt(),Ue.onRuntimeInitialized&&Ue.onRuntimeInitialized(),ft(!Ue._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),Zt()))}er>0||(Dc(),Qt(),er>0||(Ue.setStatus?(Ue.setStatus("Running..."),setTimeout((function(){setTimeout((function(){Ue.setStatus("")}),1),t()}),1)):t(),kt()))}function vc(){var e=$e,t=et,r=!1;$e=et=function(e){r=!0};try{var n=Ue._fflush;n&&n(0),["stdout","stderr"].forEach((function(e){var t=Wr.analyzePath("/dev/"+e);if(t){var n=t.object.rdev,o=jr.ttys[n];o&&o.output&&o.output.length&&(r=!0)}}))}catch(e){}$e=e,et=t,r&&nt("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.")}function Pc(e,t){if(vc(),!t||!Et||0!==e){if(Et){if(!t)et("program exited (with status: "+e+"), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)")}else Wt(),Ue.onExit&&Ue.onExit(e),lt=!0;He(e,new Cc(e))}}if(Ue._free=dr("free"),Ue.dynCall_jiji=dr("dynCall_jiji"),Ue.dynCall_iiiiij=dr("dynCall_iiiiij"),Ue.dynCall_iiiiijj=dr("dynCall_iiiiijj"),Ue.dynCall_iiiiiijj=dr("dynCall_iiiiiijj"),Ue.dynCall_viijii=dr("dynCall_viijii"),Ue.dynCall_vij=dr("dynCall_vij"),Ue.dynCall_jii=dr("dynCall_jii"),Ue.dynCall_iiiji=dr("dynCall_iiiji"),Ue.dynCall_ij=dr("dynCall_ij"),Ue.dynCall_ji=dr("dynCall_ji"),Ue.dynCall_iiiij=dr("dynCall_iiiij"),Object.getOwnPropertyDescriptor(Ue,"intArrayFromString")||(Ue.intArrayFromString=function(){sr("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"intArrayToString")||(Ue.intArrayToString=function(){sr("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Ue.ccall=At,Ue.cwrap=pt,Object.getOwnPropertyDescriptor(Ue,"setValue")||(Ue.setValue=function(){sr("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Ue.getValue=ut,Object.getOwnPropertyDescriptor(Ue,"allocate")||(Ue.allocate=function(){sr("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"UTF8ArrayToString")||(Ue.UTF8ArrayToString=function(){sr("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"UTF8ToString")||(Ue.UTF8ToString=function(){sr("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"stringToUTF8Array")||(Ue.stringToUTF8Array=function(){sr("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"stringToUTF8")||(Ue.stringToUTF8=function(){sr("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"lengthBytesUTF8")||(Ue.lengthBytesUTF8=function(){sr("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"stackTrace")||(Ue.stackTrace=function(){sr("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"addOnPreRun")||(Ue.addOnPreRun=function(){sr("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"addOnInit")||(Ue.addOnInit=function(){sr("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"addOnPreMain")||(Ue.addOnPreMain=function(){sr("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"addOnExit")||(Ue.addOnExit=function(){sr("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"addOnPostRun")||(Ue.addOnPostRun=function(){sr("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"writeStringToMemory")||(Ue.writeStringToMemory=function(){sr("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"writeArrayToMemory")||(Ue.writeArrayToMemory=function(){sr("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"writeAsciiToMemory")||(Ue.writeAsciiToMemory=function(){sr("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"addRunDependency")||(Ue.addRunDependency=function(){sr("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(Ue,"removeRunDependency")||(Ue.removeRunDependency=function(){sr("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(Ue,"FS_createFolder")||(Ue.FS_createFolder=function(){sr("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"FS_createPath")||(Ue.FS_createPath=function(){sr("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(Ue,"FS_createDataFile")||(Ue.FS_createDataFile=function(){sr("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(Ue,"FS_createPreloadedFile")||(Ue.FS_createPreloadedFile=function(){sr("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(Ue,"FS_createLazyFile")||(Ue.FS_createLazyFile=function(){sr("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(Ue,"FS_createLink")||(Ue.FS_createLink=function(){sr("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"FS_createDevice")||(Ue.FS_createDevice=function(){sr("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(Ue,"FS_unlink")||(Ue.FS_unlink=function(){sr("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),Object.getOwnPropertyDescriptor(Ue,"getLEB")||(Ue.getLEB=function(){sr("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getFunctionTables")||(Ue.getFunctionTables=function(){sr("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"alignFunctionTables")||(Ue.alignFunctionTables=function(){sr("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerFunctions")||(Ue.registerFunctions=function(){sr("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"addFunction")||(Ue.addFunction=function(){sr("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"removeFunction")||(Ue.removeFunction=function(){sr("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getFuncWrapper")||(Ue.getFuncWrapper=function(){sr("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"prettyPrint")||(Ue.prettyPrint=function(){sr("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"makeBigInt")||(Ue.makeBigInt=function(){sr("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"dynCall")||(Ue.dynCall=function(){sr("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getCompilerSetting")||(Ue.getCompilerSetting=function(){sr("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"print")||(Ue.print=function(){sr("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"printErr")||(Ue.printErr=function(){sr("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getTempRet0")||(Ue.getTempRet0=function(){sr("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"setTempRet0")||(Ue.setTempRet0=function(){sr("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"callMain")||(Ue.callMain=function(){sr("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"abort")||(Ue.abort=function(){sr("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"stringToNewUTF8")||(Ue.stringToNewUTF8=function(){sr("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"setFileTime")||(Ue.setFileTime=function(){sr("'setFileTime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"emscripten_realloc_buffer")||(Ue.emscripten_realloc_buffer=function(){sr("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"ENV")||(Ue.ENV=function(){sr("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"ERRNO_CODES")||(Ue.ERRNO_CODES=function(){sr("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"ERRNO_MESSAGES")||(Ue.ERRNO_MESSAGES=function(){sr("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"setErrNo")||(Ue.setErrNo=function(){sr("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"inetPton4")||(Ue.inetPton4=function(){sr("'inetPton4' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"inetNtop4")||(Ue.inetNtop4=function(){sr("'inetNtop4' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"inetPton6")||(Ue.inetPton6=function(){sr("'inetPton6' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"inetNtop6")||(Ue.inetNtop6=function(){sr("'inetNtop6' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"readSockaddr")||(Ue.readSockaddr=function(){sr("'readSockaddr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"writeSockaddr")||(Ue.writeSockaddr=function(){sr("'writeSockaddr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"DNS")||(Ue.DNS=function(){sr("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getHostByName")||(Ue.getHostByName=function(){sr("'getHostByName' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"GAI_ERRNO_MESSAGES")||(Ue.GAI_ERRNO_MESSAGES=function(){sr("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"Protocols")||(Ue.Protocols=function(){sr("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"Sockets")||(Ue.Sockets=function(){sr("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getRandomDevice")||(Ue.getRandomDevice=function(){sr("'getRandomDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"traverseStack")||(Ue.traverseStack=function(){sr("'traverseStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"UNWIND_CACHE")||(Ue.UNWIND_CACHE=function(){sr("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"withBuiltinMalloc")||(Ue.withBuiltinMalloc=function(){sr("'withBuiltinMalloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"readAsmConstArgsArray")||(Ue.readAsmConstArgsArray=function(){sr("'readAsmConstArgsArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"readAsmConstArgs")||(Ue.readAsmConstArgs=function(){sr("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"mainThreadEM_ASM")||(Ue.mainThreadEM_ASM=function(){sr("'mainThreadEM_ASM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"jstoi_q")||(Ue.jstoi_q=function(){sr("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"jstoi_s")||(Ue.jstoi_s=function(){sr("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getExecutableName")||(Ue.getExecutableName=function(){sr("'getExecutableName' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"listenOnce")||(Ue.listenOnce=function(){sr("'listenOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"autoResumeAudioContext")||(Ue.autoResumeAudioContext=function(){sr("'autoResumeAudioContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"dynCallLegacy")||(Ue.dynCallLegacy=function(){sr("'dynCallLegacy' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getDynCaller")||(Ue.getDynCaller=function(){sr("'getDynCaller' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"dynCall")||(Ue.dynCall=function(){sr("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"callRuntimeCallbacks")||(Ue.callRuntimeCallbacks=function(){sr("'callRuntimeCallbacks' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"reallyNegative")||(Ue.reallyNegative=function(){sr("'reallyNegative' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"unSign")||(Ue.unSign=function(){sr("'unSign' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"reSign")||(Ue.reSign=function(){sr("'reSign' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"formatString")||(Ue.formatString=function(){sr("'formatString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"PATH")||(Ue.PATH=function(){sr("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"PATH_FS")||(Ue.PATH_FS=function(){sr("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"SYSCALLS")||(Ue.SYSCALLS=function(){sr("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"syscallMmap2")||(Ue.syscallMmap2=function(){sr("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"syscallMunmap")||(Ue.syscallMunmap=function(){sr("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getSocketFromFD")||(Ue.getSocketFromFD=function(){sr("'getSocketFromFD' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getSocketAddress")||(Ue.getSocketAddress=function(){sr("'getSocketAddress' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"JSEvents")||(Ue.JSEvents=function(){sr("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerKeyEventCallback")||(Ue.registerKeyEventCallback=function(){sr("'registerKeyEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"specialHTMLTargets")||(Ue.specialHTMLTargets=function(){sr("'specialHTMLTargets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"maybeCStringToJsString")||(Ue.maybeCStringToJsString=function(){sr("'maybeCStringToJsString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"findEventTarget")||(Ue.findEventTarget=function(){sr("'findEventTarget' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"findCanvasEventTarget")||(Ue.findCanvasEventTarget=function(){sr("'findCanvasEventTarget' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getBoundingClientRect")||(Ue.getBoundingClientRect=function(){sr("'getBoundingClientRect' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"fillMouseEventData")||(Ue.fillMouseEventData=function(){sr("'fillMouseEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerMouseEventCallback")||(Ue.registerMouseEventCallback=function(){sr("'registerMouseEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerWheelEventCallback")||(Ue.registerWheelEventCallback=function(){sr("'registerWheelEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerUiEventCallback")||(Ue.registerUiEventCallback=function(){sr("'registerUiEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerFocusEventCallback")||(Ue.registerFocusEventCallback=function(){sr("'registerFocusEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"fillDeviceOrientationEventData")||(Ue.fillDeviceOrientationEventData=function(){sr("'fillDeviceOrientationEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerDeviceOrientationEventCallback")||(Ue.registerDeviceOrientationEventCallback=function(){sr("'registerDeviceOrientationEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"fillDeviceMotionEventData")||(Ue.fillDeviceMotionEventData=function(){sr("'fillDeviceMotionEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerDeviceMotionEventCallback")||(Ue.registerDeviceMotionEventCallback=function(){sr("'registerDeviceMotionEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"screenOrientation")||(Ue.screenOrientation=function(){sr("'screenOrientation' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"fillOrientationChangeEventData")||(Ue.fillOrientationChangeEventData=function(){sr("'fillOrientationChangeEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerOrientationChangeEventCallback")||(Ue.registerOrientationChangeEventCallback=function(){sr("'registerOrientationChangeEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"fillFullscreenChangeEventData")||(Ue.fillFullscreenChangeEventData=function(){sr("'fillFullscreenChangeEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerFullscreenChangeEventCallback")||(Ue.registerFullscreenChangeEventCallback=function(){sr("'registerFullscreenChangeEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerRestoreOldStyle")||(Ue.registerRestoreOldStyle=function(){sr("'registerRestoreOldStyle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"hideEverythingExceptGivenElement")||(Ue.hideEverythingExceptGivenElement=function(){sr("'hideEverythingExceptGivenElement' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"restoreHiddenElements")||(Ue.restoreHiddenElements=function(){sr("'restoreHiddenElements' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"setLetterbox")||(Ue.setLetterbox=function(){sr("'setLetterbox' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"currentFullscreenStrategy")||(Ue.currentFullscreenStrategy=function(){sr("'currentFullscreenStrategy' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"restoreOldWindowedStyle")||(Ue.restoreOldWindowedStyle=function(){sr("'restoreOldWindowedStyle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"softFullscreenResizeWebGLRenderTarget")||(Ue.softFullscreenResizeWebGLRenderTarget=function(){sr("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"doRequestFullscreen")||(Ue.doRequestFullscreen=function(){sr("'doRequestFullscreen' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"fillPointerlockChangeEventData")||(Ue.fillPointerlockChangeEventData=function(){sr("'fillPointerlockChangeEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerPointerlockChangeEventCallback")||(Ue.registerPointerlockChangeEventCallback=function(){sr("'registerPointerlockChangeEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerPointerlockErrorEventCallback")||(Ue.registerPointerlockErrorEventCallback=function(){sr("'registerPointerlockErrorEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"requestPointerLock")||(Ue.requestPointerLock=function(){sr("'requestPointerLock' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"fillVisibilityChangeEventData")||(Ue.fillVisibilityChangeEventData=function(){sr("'fillVisibilityChangeEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerVisibilityChangeEventCallback")||(Ue.registerVisibilityChangeEventCallback=function(){sr("'registerVisibilityChangeEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerTouchEventCallback")||(Ue.registerTouchEventCallback=function(){sr("'registerTouchEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"fillGamepadEventData")||(Ue.fillGamepadEventData=function(){sr("'fillGamepadEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerGamepadEventCallback")||(Ue.registerGamepadEventCallback=function(){sr("'registerGamepadEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerBeforeUnloadEventCallback")||(Ue.registerBeforeUnloadEventCallback=function(){sr("'registerBeforeUnloadEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"fillBatteryEventData")||(Ue.fillBatteryEventData=function(){sr("'fillBatteryEventData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"battery")||(Ue.battery=function(){sr("'battery' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"registerBatteryEventCallback")||(Ue.registerBatteryEventCallback=function(){sr("'registerBatteryEventCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"setCanvasElementSize")||(Ue.setCanvasElementSize=function(){sr("'setCanvasElementSize' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getCanvasElementSize")||(Ue.getCanvasElementSize=function(){sr("'getCanvasElementSize' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"polyfillSetImmediate")||(Ue.polyfillSetImmediate=function(){sr("'polyfillSetImmediate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"demangle")||(Ue.demangle=function(){sr("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"demangleAll")||(Ue.demangleAll=function(){sr("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"jsStackTrace")||(Ue.jsStackTrace=function(){sr("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"stackTrace")||(Ue.stackTrace=function(){sr("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getEnvStrings")||(Ue.getEnvStrings=function(){sr("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"checkWasiClock")||(Ue.checkWasiClock=function(){sr("'checkWasiClock' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"writeI53ToI64")||(Ue.writeI53ToI64=function(){sr("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"writeI53ToI64Clamped")||(Ue.writeI53ToI64Clamped=function(){sr("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"writeI53ToI64Signaling")||(Ue.writeI53ToI64Signaling=function(){sr("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"writeI53ToU64Clamped")||(Ue.writeI53ToU64Clamped=function(){sr("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"writeI53ToU64Signaling")||(Ue.writeI53ToU64Signaling=function(){sr("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"readI53FromI64")||(Ue.readI53FromI64=function(){sr("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"readI53FromU64")||(Ue.readI53FromU64=function(){sr("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"convertI32PairToI53")||(Ue.convertI32PairToI53=function(){sr("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"convertU32PairToI53")||(Ue.convertU32PairToI53=function(){sr("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"uncaughtExceptionCount")||(Ue.uncaughtExceptionCount=function(){sr("'uncaughtExceptionCount' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"exceptionLast")||(Ue.exceptionLast=function(){sr("'exceptionLast' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"exceptionCaught")||(Ue.exceptionCaught=function(){sr("'exceptionCaught' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"ExceptionInfoAttrs")||(Ue.ExceptionInfoAttrs=function(){sr("'ExceptionInfoAttrs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"ExceptionInfo")||(Ue.ExceptionInfo=function(){sr("'ExceptionInfo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"CatchInfo")||(Ue.CatchInfo=function(){sr("'CatchInfo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"exception_addRef")||(Ue.exception_addRef=function(){sr("'exception_addRef' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"exception_decRef")||(Ue.exception_decRef=function(){sr("'exception_decRef' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"Browser")||(Ue.Browser=function(){sr("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"funcWrappers")||(Ue.funcWrappers=function(){sr("'funcWrappers' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"getFuncWrapper")||(Ue.getFuncWrapper=function(){sr("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"setMainLoop")||(Ue.setMainLoop=function(){sr("'setMainLoop' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"FS")||(Ue.FS=function(){sr("'FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"mmapAlloc")||(Ue.mmapAlloc=function(){sr("'mmapAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"MEMFS")||(Ue.MEMFS=function(){sr("'MEMFS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"TTY")||(Ue.TTY=function(){sr("'TTY' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"PIPEFS")||(Ue.PIPEFS=function(){sr("'PIPEFS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"SOCKFS")||(Ue.SOCKFS=function(){sr("'SOCKFS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"_setNetworkCallback")||(Ue._setNetworkCallback=function(){sr("'_setNetworkCallback' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"tempFixedLengthArray")||(Ue.tempFixedLengthArray=function(){sr("'tempFixedLengthArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"miniTempWebGLFloatBuffers")||(Ue.miniTempWebGLFloatBuffers=function(){sr("'miniTempWebGLFloatBuffers' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"heapObjectForWebGLType")||(Ue.heapObjectForWebGLType=function(){sr("'heapObjectForWebGLType' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"heapAccessShiftForWebGLHeap")||(Ue.heapAccessShiftForWebGLHeap=function(){sr("'heapAccessShiftForWebGLHeap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"GL")||(Ue.GL=function(){sr("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"emscriptenWebGLGet")||(Ue.emscriptenWebGLGet=function(){sr("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"computeUnpackAlignedImageSize")||(Ue.computeUnpackAlignedImageSize=function(){sr("'computeUnpackAlignedImageSize' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"emscriptenWebGLGetTexPixelData")||(Ue.emscriptenWebGLGetTexPixelData=function(){sr("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"emscriptenWebGLGetUniform")||(Ue.emscriptenWebGLGetUniform=function(){sr("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"emscriptenWebGLGetVertexAttrib")||(Ue.emscriptenWebGLGetVertexAttrib=function(){sr("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"writeGLArray")||(Ue.writeGLArray=function(){sr("'writeGLArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"AL")||(Ue.AL=function(){sr("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"SDL_unicode")||(Ue.SDL_unicode=function(){sr("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"SDL_ttfContext")||(Ue.SDL_ttfContext=function(){sr("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"SDL_audio")||(Ue.SDL_audio=function(){sr("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"SDL")||(Ue.SDL=function(){sr("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"SDL_gfx")||(Ue.SDL_gfx=function(){sr("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"GLUT")||(Ue.GLUT=function(){sr("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"EGL")||(Ue.EGL=function(){sr("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"GLFW_Window")||(Ue.GLFW_Window=function(){sr("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"GLFW")||(Ue.GLFW=function(){sr("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"GLEW")||(Ue.GLEW=function(){sr("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"IDBStore")||(Ue.IDBStore=function(){sr("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"runAndAbortIfError")||(Ue.runAndAbortIfError=function(){sr("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"warnOnce")||(Ue.warnOnce=function(){sr("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"stackSave")||(Ue.stackSave=function(){sr("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"stackRestore")||(Ue.stackRestore=function(){sr("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"stackAlloc")||(Ue.stackAlloc=function(){sr("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"AsciiToString")||(Ue.AsciiToString=function(){sr("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"stringToAscii")||(Ue.stringToAscii=function(){sr("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"UTF16ToString")||(Ue.UTF16ToString=function(){sr("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"stringToUTF16")||(Ue.stringToUTF16=function(){sr("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"lengthBytesUTF16")||(Ue.lengthBytesUTF16=function(){sr("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"UTF32ToString")||(Ue.UTF32ToString=function(){sr("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"stringToUTF32")||(Ue.stringToUTF32=function(){sr("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"lengthBytesUTF32")||(Ue.lengthBytesUTF32=function(){sr("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"allocateUTF8")||(Ue.allocateUTF8=function(){sr("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Ue,"allocateUTF8OnStack")||(Ue.allocateUTF8OnStack=function(){sr("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Ue.writeStackCookie=Gt,Ue.checkStackCookie=kt,Object.getOwnPropertyDescriptor(Ue,"ALLOC_NORMAL")||Object.defineProperty(Ue,"ALLOC_NORMAL",{configurable:!0,get:function(){sr("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Object.getOwnPropertyDescriptor(Ue,"ALLOC_STACK")||Object.defineProperty(Ue,"ALLOC_STACK",{configurable:!0,get:function(){sr("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),rr=function e(){lc||hc(),lc||(rr=e)},Ue.run=hc,Ue.preInit)for("function"==typeof Ue.preInit&&(Ue.preInit=[Ue.preInit]);Ue.preInit.length>0;)Ue.preInit.pop()();hc();var Oc,bc,Fc={cCRNFmtInvalid:-1,cCRNFmtDXT1:0,cCRNFmtDXT3:1,cCRNFmtDXT5:2},Sc={};Sc[Fc.cCRNFmtDXT1]=y.PixelFormat.RGB_DXT1,Sc[Fc.cCRNFmtDXT3]=y.PixelFormat.RGBA_DXT3,Sc[Fc.cCRNFmtDXT5]=y.PixelFormat.RGBA_DXT5;var Mc,Rc=0,wc=!1;function Ic(e,t,r,n){var o,a=r/4,i=n%4,s=new Uint32Array(e.buffer,0,(n-i)/4),c=new Uint32Array(t.buffer);for(o=0;o<s.length;o++)c[a+o]=s[o];for(o=n-i;o<n;o++)t[r+o]=e[o]}function Lc(e,t){var r=e.data,o=r.byteLength,a=new Uint8Array(r),i=Mc._malloc(o);Ic(a,Mc.HEAPU8,i,o);var s=Mc._crn_get_dxt_format(i,o),c=Sc[s];if(!n.defined(c))throw new d.RuntimeError("Unsupported compressed format.");var E,u=Mc._crn_get_levels(i,o),l=Mc._crn_get_width(i,o),f=Mc._crn_get_height(i,o),A=0;for(E=0;E<u;++E)A+=y.PixelFormat.compressedTextureSizeInBytes(c,l>>E,f>>E);if(Rc<A&&(n.defined(Oc)&&Mc._free(Oc),Oc=Mc._malloc(A),bc=new Uint8Array(Mc.HEAPU8.buffer,Oc,A),Rc=A),Mc._crn_decompress(i,o,Oc,A,0,u),Mc._free(i),n.defaultValue(e.bMipMap,!1)){var p=bc.slice(0,A);return t.push(p.buffer),new m.CompressedTextureBuffer(c,l,f,p)}var g=y.PixelFormat.compressedTextureSizeInBytes(c,l,f),_=bc.subarray(0,g),B=new Uint8Array(g);return B.set(_,0),t.push(B.buffer),new m.CompressedTextureBuffer(c,l,f,B)}var xc,Nc={SVO_HasInstSelInfo:1},Uc={SV_Unkown:0,SV_Standard:1,SV_Compressed:2,SV_DracoCompressed:3},Gc={Standard:0,Draco:1,MeshOpt:2},kc=new c.Color,Hc="ClampGroundAndObjectLinePass",Xc=!1;if(n.defined(Ue)){Ue.onRuntimeInitialized=function(){Xc=!0};var Vc=Ue.cwrap("OSGBToS3MB","number",["number","number","number","number"])}function Kc(e,t,r,n,o,a){this.left=e,this.bottom=t,this.right=r,this.top=n,this.minHeight=o,this.maxHeight=a,this.width=r-e,this.length=n-t,this.height=a-o}function jc(e,t,r){var n=r,o=e.getUint32(n,!0),a=n+=Uint32Array.BYTES_PER_ELEMENT,i=new Uint8Array(t,n,o);return{dataViewByteOffset:a,byteOffset:n+=o*Uint8Array.BYTES_PER_ELEMENT,buffer:i}}function Yc(e,t,r,n){var o=e.getUint32(n+t,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=r.subarray(n,n+o);return{string:u.getStringFromTypedArray(a),bytesOffset:n+=o}}function Qc(e,t,r,n,o,a){var i=r,s=e.getUint16(r+n,!0);i+=Uint16Array.BYTES_PER_ELEMENT,a||(i+=Uint16Array.BYTES_PER_ELEMENT);for(var c=0;c<s;c++){var u=e.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var l=e.getUint16(i+n,!0);if(i+=Uint16Array.BYTES_PER_ELEMENT,e.getUint16(i+n,!0),i+=Uint16Array.BYTES_PER_ELEMENT,20==l||35==l);else{var f=u*l*Float32Array.BYTES_PER_ELEMENT,d=t.subarray(i,i+f);i+=f;var A="aTexCoord"+c,p=o.vertexAttributes,g=o.attrLocation;g[A]=p.length,p.push({index:g[A],typedArray:d,componentsPerAttribute:l,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:l*Float32Array.BYTES_PER_ELEMENT,normalize:!1})}}return{bytesOffset:i}}function Jc(e,t,r,n,o){o.texCoordCompressConstant=[],o.minTexCoordValue=[];var a=r,i=e.getUint16(r+n,!0);a+=Uint16Array.BYTES_PER_ELEMENT,a+=Uint16Array.BYTES_PER_ELEMENT;for(var c=0,u=0;u<i;u++){var l=e.getUint8(a+n,!0);a+=Uint8Array.BYTES_PER_ELEMENT,a+=3*Uint8Array.BYTES_PER_ELEMENT;var f=e.getUint32(a+n,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var d=e.getUint16(a+n,!0);a+=Uint16Array.BYTES_PER_ELEMENT,e.getUint16(a+n,!0),a+=Uint16Array.BYTES_PER_ELEMENT;var A=e.getFloat32(a+n,!0);a+=Float32Array.BYTES_PER_ELEMENT,o.texCoordCompressConstant.push(A);var p=new s.Cartesian4;p.x=e.getFloat32(a+n,!0),a+=Float32Array.BYTES_PER_ELEMENT,p.y=e.getFloat32(a+n,!0),a+=Float32Array.BYTES_PER_ELEMENT,p.z=e.getFloat32(a+n,!0),a+=Float32Array.BYTES_PER_ELEMENT,p.w=e.getFloat32(a+n,!0),a+=Float32Array.BYTES_PER_ELEMENT,o.minTexCoordValue.push(p);var g=f*d*Int16Array.BYTES_PER_ELEMENT,_=t.subarray(a,a+g),m=(a+=g)%4;0!==m&&(a+=4-m);var y="aTexCoord"+c,B=o.vertexAttributes,T=o.attrLocation;if(T[y]=B.length,B.push({index:T[y],typedArray:_,componentsPerAttribute:d,componentDatatype:E.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:d*Int16Array.BYTES_PER_ELEMENT,normalize:!1}),l){g=f*Float32Array.BYTES_PER_ELEMENT;var C=t.subarray(a,a+g);a+=g,o.texCoordZMatrix=!0,T[y="aTexCoordZ"+c]=B.length,B.push({index:T[y],typedArray:C,componentsPerAttribute:1,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:Float32Array.BYTES_PER_ELEMENT,normalize:!1})}c++}return{bytesOffset:a}}function zc(e,t,r,n,o){var a=r,i=e.getUint16(a+n,!0);a+=Uint16Array.BYTES_PER_ELEMENT,a+=Uint16Array.BYTES_PER_ELEMENT;for(var s=o.vertexAttributes,c=o.attrLocation,u=0;u<i;u++){var l=e.getUint32(a+n,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var f=e.getUint16(a+n,!0);if(a+=Uint16Array.BYTES_PER_ELEMENT,16===f){a-=Uint16Array.BYTES_PER_ELEMENT;var d=l*(f*Float32Array.BYTES_PER_ELEMENT+Uint16Array.BYTES_PER_ELEMENT),A=t.subarray(a,a+d);a+=d;var p=new Uint8Array(Float32Array.BYTES_PER_ELEMENT*f*l);o.instanceCount=l,o.instanceMode=f,o.instanceBuffer=p,o.instanceIndex=1;for(var g=Float32Array.BYTES_PER_ELEMENT*f+Uint16Array.BYTES_PER_ELEMENT,_=0;_<l;_++){var m=_*g+Uint16Array.BYTES_PER_ELEMENT,y=A.subarray(m,m+g);p.set(y,_*(g-Uint16Array.BYTES_PER_ELEMENT))}B=16*Float32Array.BYTES_PER_ELEMENT,c.uv2=s.length,s.push({index:c.uv2,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:B,instanceDivisor:1}),c.uv3=s.length,s.push({index:c.uv3,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}),c.uv4=s.length,s.push({index:c.uv4,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}),c.secondary_colour=s.length,s.push({index:c.secondary_colour,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1})}else{e.getUint16(a+n,!0),a+=Uint16Array.BYTES_PER_ELEMENT;d=l*f*Float32Array.BYTES_PER_ELEMENT;if(17===f||29===f){var B;p=t.subarray(a,a+d);o.instanceCount=l,o.instanceMode=f,o.instanceBuffer=p,o.instanceIndex=1,17===f?(B=17*Float32Array.BYTES_PER_ELEMENT,c.uv2=s.length,s.push({index:c.uv2,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:B,instanceDivisor:1}),c.uv3=s.length,s.push({index:c.uv3,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}),c.uv4=s.length,s.push({index:c.uv4,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}),c.secondary_colour=s.length,s.push({index:c.secondary_colour,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}),c.uv6=s.length,s.push({index:c.uv6,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.UNSIGNED_BYTE,normalize:!0,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1})):29===f&&(B=29*Float32Array.BYTES_PER_ELEMENT,c.uv1=s.length,s.push({index:c.uv1,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:B,instanceDivisor:1,byteLength:d}),c.uv2=s.length,s.push({index:c.uv2,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}),c.uv3=s.length,s.push({index:c.uv3,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}),c.uv4=s.length,s.push({index:c.uv4,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}),c.uv5=s.length,s.push({index:c.uv5,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}),c.uv6=s.length,s.push({index:c.uv6,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:20*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}),c.uv7=s.length,s.push({index:c.uv7,componentsPerAttribute:3,componentDatatype:E.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:24*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}),c.secondary_colour=s.length,s.push({index:c.secondary_colour,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.UNSIGNED_BYTE,normalize:!0,offsetInBytes:27*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}),c.uv9=s.length,s.push({index:c.uv9,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.UNSIGNED_BYTE,normalize:!0,offsetInBytes:28*Float32Array.BYTES_PER_ELEMENT,strideInBytes:B,instanceDivisor:1}))}else{var T=l*f;o.instanceBounds=new Float32Array(T);for(var C=0;C<T;C++)o.instanceBounds[C]=e.getFloat32(a+n+C*Float32Array.BYTES_PER_ELEMENT,!0)}a+=d}}return{bytesOffset:a}}var Wc=new i.Cartesian3(40680631590769,40680631590769,40408299984661.445),Zc=new i.Cartesian3,qc=new i.Cartesian3;function $c(e,t,r,o){var a=Math.cos(t);Zc.x=a*Math.cos(e),Zc.y=a*Math.sin(e),Zc.z=Math.sin(t),Zc=i.Cartesian3.normalize(Zc,Zc),i.Cartesian3.multiplyComponents(Wc,Zc,qc);var s=Math.sqrt(i.Cartesian3.dot(Zc,qc));return qc=i.Cartesian3.divideByScalar(qc,s,qc),Zc=i.Cartesian3.multiplyByScalar(Zc,r,Zc),n.defined(o)||(o=new i.Cartesian3),i.Cartesian3.add(qc,Zc,o)}var eE=new i.Cartesian3,tE=new i.Cartographic,rE=new o.Matrix4,nE=new o.Matrix4;function oE(e,t,r,c,u,l,f,d){var A=c,p=t.getUint32(A+r,!0);if(u.verticesCount=p,A+=Uint32Array.BYTES_PER_ELEMENT,p<=0)return{bytesOffset:A};var g=t.getUint16(A+r,!0);A+=Uint16Array.BYTES_PER_ELEMENT;var _=t.getUint16(A+r,!0);_=g*Float32Array.BYTES_PER_ELEMENT,A+=Uint16Array.BYTES_PER_ELEMENT;var m=p*g*Float32Array.BYTES_PER_ELEMENT,y=e.subarray(A,A+m);A+=m;var B=u.vertexAttributes,T=u.attrLocation,C=void 0,D=void 0;if(f){T.aPosition=B.length,B.push({index:T.aPosition,typedArray:y,componentsPerAttribute:g,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:_,normalize:!1});var h=new i.Cartesian3,v=new i.Cartesian3,P=new Float32Array(y.buffer,y.byteOffset,y.byteLength/4),O=new i.Cartographic;C=new i.Cartographic,D=new i.Cartographic;for(var b=new Float32Array(2*p),F=new Float64Array(2*p),S=0;S<p;S++)o.Matrix4.multiplyByPoint(l,i.Cartesian3.fromElements(P[3*S],P[3*S+1],P[3*S+2],h),v),O=i.Cartographic.fromCartesian(v),F[2*S]=O.longitude,F[2*S+1]=O.latitude,0===S?(C.longitude=O.longitude,C.latitude=O.latitude,D.longitude=O.longitude,D.latitude=O.latitude):(C.longitude=Math.max(O.longitude,C.longitude),C.latitude=Math.max(O.latitude,C.latitude),D.longitude=Math.min(O.longitude,D.longitude),D.latitude=Math.min(O.latitude,D.latitude));for(S=0;S<p;S++)b[2*S]=F[2*S]-D.longitude,b[2*S+1]=F[2*S+1]-D.latitude;T.img=B.length,B.push({index:T.img,typedArray:b,componentsPerAttribute:2,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:2*Float32Array.BYTES_PER_ELEMENT,normalize:!1})}else{if(3===g&&n.defined(l)){v=new i.Cartesian3,P=new Float32Array(y.buffer,y.byteOffset,y.byteLength/4);for(var M=new Float32Array(y.byteLength/4+p),R=P.length,w=(S=0,0);S<R;S+=3,w+=4)M[w]=P[S],M[w+1]=P[S+1],M[w+2]=P[S+2],o.Matrix4.multiplyByPoint(l,i.Cartesian3.fromElements(M[w],M[w+1],M[w+2],h),v),M[w+3]=i.Cartographic.fromCartesian(v).height;y=M,_=(g=4)*Float32Array.BYTES_PER_ELEMENT}if(n.defined(d)){var I,L=new Float32Array(y.byteLength/4),x=new Float32Array(y.buffer,y.byteOffset,y.byteLength/4);I=3===g?i.Cartesian3.unpackArray(x):s.Cartesian4.unpackArray(x);var N=o.Matrix4.multiply(d.sphereMatrix,d.geoMatrix,rE),U=o.Matrix4.multiply(d.ellipsoidMatrix,d.geoMatrix,nE);o.Matrix4.inverse(U,U);for(var G=new a.Ellipsoid(6378137,6378137,6378137),k=0,H=0,X=I.length;H<X;H++){var V=I[H];o.Matrix4.multiplyByPoint(N,V,eE);var K=G.cartesianToCartographic(eE,tE),j=$c(K.longitude,K.latitude,K.height,eE);o.Matrix4.multiplyByPoint(U,j,V),3===g?(i.Cartesian3.pack(V,L,k),k+=3):(s.Cartesian4.pack(V,L,k),k+=4)}y=L}T.aPosition=B.length,B.push({index:T.aPosition,typedArray:y,componentsPerAttribute:g,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:_,normalize:!1})}return{bytesOffset:A,cartographicBounds:{max:C,min:D}}}function aE(e,t,r,c,u,l){var f=c,d=t.getUint32(f+r,!0);if(u.verticesCount=d,f+=Uint32Array.BYTES_PER_ELEMENT,d<=0)return{bytesOffset:f};var A=t.getUint16(f+r,!0);f+=Uint16Array.BYTES_PER_ELEMENT;var p=t.getUint16(f+r,!0);p=A*Int16Array.BYTES_PER_ELEMENT,f+=Uint16Array.BYTES_PER_ELEMENT;var g=t.getFloat32(f+r,!0);f+=Float32Array.BYTES_PER_ELEMENT;var _=new s.Cartesian4;_.x=t.getFloat32(f+r,!0),f+=Float32Array.BYTES_PER_ELEMENT,_.y=t.getFloat32(f+r,!0),f+=Float32Array.BYTES_PER_ELEMENT,_.z=t.getFloat32(f+r,!0),f+=Float32Array.BYTES_PER_ELEMENT,_.w=t.getFloat32(f+r,!0),f+=Float32Array.BYTES_PER_ELEMENT,u.vertCompressConstant=g,u.minVerticesValue=_;var m=d*A*Int16Array.BYTES_PER_ELEMENT,y=e.subarray(f,f+m);if(f+=m,n.defined(l)){var B=new Float32Array(y.byteLength/4),T=new Float32Array(y.buffer,y.byteOffset,y.byteLength/4),C=i.Cartesian3.unpackArray(T);for(let e=0,t=C.length;e<t;e++){let t=C[e];i.Cartesian3.multiplyByScalar(t,g,t),i.Cartesian3.add(t,_,t)}var D=o.Matrix4.multiply(l.sphereMatrix,l.geoMatrix,rE),h=o.Matrix4.multiply(l.ellipsoidMatrix,l.geoMatrix,nE);o.Matrix4.inverse(h,h);var v=new a.Ellipsoid(6378137,6378137,6378137),P=0;for(let e=0,t=C.length;e<t;e++){let t=C[e];o.Matrix4.multiplyByPoint(D,t,eE);let r=v.cartesianToCartographic(eE,tE),n=$c(r.longitude,r.latitude,r.height,eE);o.Matrix4.multiplyByPoint(h,n,t),i.Cartesian3.pack(t,B,P),P+=3}y=B}var O=u.vertexAttributes,b=u.attrLocation;return b.aPosition=O.length,O.push({index:b.aPosition,typedArray:y,componentsPerAttribute:A,componentDatatype:E.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:p,normalize:!1}),{bytesOffset:f}}function iE(e,t,r,n,o){var a=n,i=t.getUint32(a+r,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,i<=0)return{bytesOffset:a};var s=t.getUint16(a+r,!0);a+=Uint16Array.BYTES_PER_ELEMENT;var c=t.getUint16(a+r,!0);a+=Uint16Array.BYTES_PER_ELEMENT;var u=i*s*Float32Array.BYTES_PER_ELEMENT,l=e.subarray(a,a+u);if(a+=u,!o.ignoreNormal){var f=o.vertexAttributes,d=o.attrLocation;d.aNormal=f.length,f.push({index:d.aNormal,typedArray:l,componentsPerAttribute:s,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:c,normalize:!1})}return{bytesOffset:a}}function sE(e,t,r,n,o){var a=n,i=t.getUint32(a+r,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,i<=0)return{bytesOffset:a};var s=t.getUint16(a+r,!0);return a+=Uint16Array.BYTES_PER_ELEMENT,t.getUint16(a+r,!0),a+=Uint16Array.BYTES_PER_ELEMENT,{bytesOffset:a+=i*s*Float32Array.BYTES_PER_ELEMENT}}var cE={0:Uint32Array.BYTES_PER_ELEMENT,1:Float32Array.BYTES_PER_ELEMENT,2:Float64Array.BYTES_PER_ELEMENT};function EE(e,t,r,n,o){var a=n,i=t.getUint32(a+r,!0);a+=Uint32Array.BYTES_PER_ELEMENT;for(var s=0;s<i;s++){var c=t.getUint32(a+r,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var u=t.getUint16(a+r,!0);a+=Uint16Array.BYTES_PER_ELEMENT;var l=t.getUint16(a+r,!0);a+=Uint16Array.BYTES_PER_ELEMENT;var f=c*u*cE[l],d=e.subarray(a,a+f);a+=f;var A=o.vertexAttributes,p=o.attrLocation,g="aCustom"+s;p[g]=A.length,A.push({index:p[g],typedArray:d,componentsPerAttribute:u,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1})}return{bytesOffset:a}}function uE(e,t,r,n,o){var a=n,i=t.getUint32(a+r,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,i<=0)return{bytesOffset:a};t.getUint16(a+r,!0),a+=Uint16Array.BYTES_PER_ELEMENT;var s=t.getUint16(a+r,!0);a+=Uint16Array.BYTES_PER_ELEMENT;var c=2*i*Int16Array.BYTES_PER_ELEMENT,u=e.subarray(a,a+c);if(a+=c,!o.ignoreNormal){var l=o.vertexAttributes,f=o.attrLocation;f.aNormal=l.length,l.push({index:f.aNormal,typedArray:u,componentsPerAttribute:2,componentDatatype:E.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:s,normalize:!1})}return{bytesOffset:a}}function lE(e,t,r,n,o){var a,i=n,s=t.getUint32(i+r,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,o.verticesCount,s>0){t.getUint16(i+r,!0),i+=Uint16Array.BYTES_PER_ELEMENT,i+=2*Uint8Array.BYTES_PER_ELEMENT;var c=s*Uint8Array.BYTES_PER_ELEMENT*4;a=T(e,i,i+c),i+=c;var u=o.vertexAttributes,l=o.attrLocation;l.aColor=u.length,u.push({index:l.aColor,typedArray:a,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:4,normalize:!0})}return{bytesOffset:i}}function fE(e,t,r,n,o){var a=n,i=t.getUint32(a+r,!0);return a+=Uint32Array.BYTES_PER_ELEMENT,i<=0?{bytesOffset:a}:(t.getUint16(a+r,!0),a+=Uint16Array.BYTES_PER_ELEMENT,a+=2*Uint8Array.BYTES_PER_ELEMENT,{bytesOffset:a+=i*Uint8Array.BYTES_PER_ELEMENT*4})}function dE(e,t,r,n,o){var a=o,i=[],s=r.getUint32(a+n,!0);a+=Uint32Array.BYTES_PER_ELEMENT;for(var c=0;c<s;c++){var E={};3===e&&(r.getUint32(a+n,!0),a+=Uint32Array.BYTES_PER_ELEMENT);var u=r.getUint32(a+n,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var l=r.getUint8(a+n,!0);a+=Uint8Array.BYTES_PER_ELEMENT,r.getUint8(a+n,!0),a+=Uint8Array.BYTES_PER_ELEMENT;var f=r.getUint8(a+n,!0);if(a+=Uint8Array.BYTES_PER_ELEMENT,a+=Uint8Array.BYTES_PER_ELEMENT,u>0){var d=0,A=null;1===l||3===l?(d=u*Uint32Array.BYTES_PER_ELEMENT,A=t.subarray(a,a+d)):(d=u*Uint16Array.BYTES_PER_ELEMENT,A=t.subarray(a,a+d),u%2!=0&&(d+=2)),E.indicesTypedArray=A,a+=d}E.indicesCount=u,E.indexType=l,E.primitiveType=f;var p=[],g=r.getUint32(a+n,!0);a+=Uint32Array.BYTES_PER_ELEMENT;for(var _=0;_<g;_++){var m=Yc(r,n,t,a),y=m.string;a=m.bytesOffset,p.push(y),E.materialCode=y}if(0===g&&(E.materialCode="OSGBEmpty"),i.push(E),0!==a%4)a+=4-a%4}return{bytesOffset:a,arrIndexPackage:i}}function AE(e,t,r,n,o,a,i,s,c){var E=n,u=t.getUint32(E+r,!0);return o.nCompressOptions=u,E+=Uint32Array.BYTES_PER_ELEMENT,E=(u&h.SVC_Vertex)==h.SVC_Vertex?aE(e,t,r,E,o,c).bytesOffset:oE(e,t,r,E,o,i,s,c).bytesOffset,E=(u&h.SVC_Normal)==h.SVC_Normal?uE(e,t,r,E,o).bytesOffset:iE(e,t,r,E,o).bytesOffset,E=fE(0,t,r,E=lE(e,t,r,E,o).bytesOffset).bytesOffset,E=(u&h.SVC_TexutreCoord)==h.SVC_TexutreCoord?Jc(t,e,E,r,o).bytesOffset:Qc(t,e,E,r,o,a).bytesOffset,(u&h.SVC_TexutreCoordIsW)==h.SVC_TexutreCoordIsW&&(o.textureCoordIsW=!0),{bytesOffset:E=zc(t,e,E,r,o).bytesOffset}}function pE(e,t,r,o,a,i,s,c,E,u){3===e&&(r.getUint32(a,!0),a+=Uint32Array.BYTES_PER_ELEMENT,c=void 0);var l,f=a;f=(l=oE(t,r,o,f,i,c,E,u)).bytesOffset;var d=l.cartographicBounds;if(f=(l=lE(t,r,o,f=(l=iE(t,r,o,f,i)).bytesOffset,i)).bytesOffset,3!==e&&(f=(l=fE(0,r,o,f)).bytesOffset),f=(l=zc(r,t,f=(l=Qc(r,t,f,o,i,s)).bytesOffset,o,i)).bytesOffset,3===e&&(f=(l=EE(t,r,o,f,i)).bytesOffset),3==e){var A=Yc(r,o,t,f);f=A.bytesOffset,i.customVertexAttribute=JSON.parse(A.string);var p="aCustom"+i.customVertexAttribute.TextureCoordMatrix,g="aCustom"+i.customVertexAttribute.VertexWeight;n.defined(i.attrLocation[p])&&(i.attrLocation.aTextureCoordMatrix=i.attrLocation[p],delete i.attrLocation[p]),n.defined(i.attrLocation[g])&&(i.attrLocation.aVertexWeight=i.attrLocation[g],delete i.attrLocation[g]);var _=(f+o)%4;_&&(_=4-_),f+=_}return 3===e&&(f=(l=sE(0,r,o,f)).bytesOffset),{bytesOffset:f,cartographicBounds:d}}function gE(e){return 0!==e.length&&e[0].materialCode===Hc}var _E={AttributeType_Invalid:0,AttributeType_Position:1,AttributeType_PositionW:2,AttributeType_Normal:4,AttributeType_Tangent:8,AttributeType_FirstTexcoord:16,AttributeType_SecondTexcoord:32,AttributeType_Color:64,AttributeType_SecondColor:128,AttributeType_Custom0:512,AttributeType_Custom1:1024};function mE(e,t,r,c,u,l,f,d,A,p,g,_,m){var y=e,B=0,C=t.getUint32(B+r,!0);B+=Uint32Array.BYTES_PER_ELEMENT,p=n.defaultValue(p,n.defaultValue.EMPTY_OBJECT);for(var D=void 0,h=0;h<C;h++){3===d&&(t.getUint32(B+r,!0),B+=Uint32Array.BYTES_PER_ELEMENT);var P=(De=Yc(t,r,y,B)).string;if(n.defined(A)){var O=n.defaultValue(p[P],o.Matrix4.IDENTITY);D=new o.Matrix4,o.Matrix4.multiply(A,O,D)}n.defined(m)&&(m.geoMatrix=n.defaultValue(p[P],o.Matrix4.IDENTITY));var b=(B=De.bytesOffset)%4;0!==b&&(B+=4-b);var F=Uc.SV_Unkown;if(F=t.getUint32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT,(je={vertexAttributes:[],attrLocation:{},instanceCount:0,instanceMode:0,instanceIndex:-1}).ignoreNormal=c.ignoreNormal,3===d)switch(F){case Gc.Standard:F=Uc.SV_Standard;break;case Gc.Draco:F=Uc.SV_DracoCompressed;break;case Gc.MeshOpt:F=Uc.SV_Compressed}if(F===Uc.SV_DracoCompressed){3===d&&(t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT),d>=2&&(t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT);var S,M={};M.posUniqueID=t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT,M.normalUniqueID=t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT,M.colorUniqueID=t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT,M.secondColorUniqueID=t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT,3===d?(S=t.getUint32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT):(S=t.getUint16(B+r,!0),B+=Int16Array.BYTES_PER_ELEMENT);for(var R=[],w=0;w<S;w++){var I=t.getInt32(B+r,!0);R.push(I),B+=Int32Array.BYTES_PER_ELEMENT}if(M.texCoordUniqueIDs=R,3===d){var L=t.getUint32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT,B+=Int32Array.BYTES_PER_ELEMENT*L}var x=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT;var N=[],U={};if(x>0){var G=Yc(t,r,y,B),k=G.string;B=G.bytesOffset,U.materialCode=k,N.push(U)}3===d&&((Oe=(B+r)%4)&&(Oe=4-Oe),B+=Oe);var H=new Object,X=t.getUint32(B+r,!0),V=T(y,B+=Int32Array.BYTES_PER_ELEMENT,B+X);x>0?v.dracoDecodeMesh(xc,V,X,je,U,M,D,g,H):v.dracoDecodePointCloud(xc,V,X,je,M),n.defined(H.min)&&n.defined(H.max)||(H=void 0),B+=X,3===d&&((Oe=(B+r)%4)&&(Oe=4-Oe),B+=Oe),c[P]={vertexPackage:je,arrIndexPackage:N,cartographicBounds:H}}else if(F==Uc.SV_Compressed&&3==d){var K=t.getUint32(B+r,!0);B+=Uint32Array.BYTES_PER_ELEMENT;var j=t.getUint32(B+r,!0);B+=Uint32Array.BYTES_PER_ELEMENT,je.minVerticesValue=new s.Cartesian4,je.minTexCoordValue=[new a.Cartesian2,new a.Cartesian2],je.texCoordCompressConstant=[new i.Cartesian3,new i.Cartesian3];N=[];for(var Y=0;Y<j;Y++){var Q=t.getUint32(B+r,!0);B+=Uint32Array.BYTES_PER_ELEMENT,je.vertCompressConstant=t.getFloat32(B+r,!0),B+=Float32Array.BYTES_PER_ELEMENT,je.minVerticesValue.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,je.minVerticesValue.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,je.minVerticesValue.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT;var J=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var z=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var W=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var Z=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var q=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var $=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var ee=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT;var te=t.getFloat64(B+r,!0);B+=Float64Array.BYTES_PER_ELEMENT,je.minTexCoordValue[0].x=W,je.minTexCoordValue[0].y=Z,je.minTexCoordValue[1].x=ee,je.minTexCoordValue[1].y=te,je.texCoordCompressConstant[0].x=J,je.texCoordCompressConstant[0].y=z,je.texCoordCompressConstant[1].x=q,je.texCoordCompressConstant[1].y=$;var re=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT;for(var ne=0;ne<re;ne++){var oe=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT;var ae=oe,ie=0;ae!=_E.AttributeType_Custom0&&ae!=_E.AttributeType_Custom1||(ie=t.getInt32(B+r,!0),B+=Int32Array.BYTES_PER_ELEMENT);var se=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT;var ce=new Uint8Array(t.buffer,B+r,se);(Oe=((B+=Uint8Array.BYTES_PER_ELEMENT*se)+r)%4)&&(Oe=4-Oe),B+=Oe,BE(Q,ae,ie,ce,je,K)}B=(Pe=Yc(t,r,y,B)).bytesOffset,je.customVertexAttribute=JSON.parse(Pe.string);var Ee="aCustom"+je.customVertexAttribute.TextureCoordMatrix,ue="aCustom"+je.customVertexAttribute.VertexWeight;n.defined(je.attrLocation[Ee])&&(je.attrLocation.aTextureCoordMatrix=je.attrLocation[Ee],Y===j-1&&delete je.attrLocation[Ee]),n.defined(je.attrLocation[ue])&&(je.attrLocation.aVertexWeight=je.attrLocation[ue],Y===j-1&&delete je.attrLocation[ue]),(Oe=(B+r)%4)&&(Oe=4-Oe),B+=Oe;var le=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT;for(var fe=0;fe<le;fe++){U={};var de=t.getInt32(B+r,!0);if(B+=Int32Array.BYTES_PER_ELEMENT,de>0){var Ae=t.getInt8(B+r,!0);B+=Int8Array.BYTES_PER_ELEMENT,t.getInt8(B+r,!0),B+=Int8Array.BYTES_PER_ELEMENT;var pe=t.getInt8(B+r,!0);B+=Int8Array.BYTES_PER_ELEMENT,t.getInt8(B+r,!0),B+=Int8Array.BYTES_PER_ELEMENT;var ge,_e,me=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT,13!==pe?(ge=new Uint8Array(t.buffer,B+r,me),B+=Uint8Array.BYTES_PER_ELEMENT*me):(ge=new Uint32Array(t.buffer,B+r,me),B+=Uint32Array.BYTES_PER_ELEMENT*me),(Oe=(B+r)%4)&&(Oe=4-Oe),B+=Oe,13!==pe?(_e=E.ComponentDatatype.createTypedArray(E.ComponentDatatype.UNSIGNED_BYTE,de*Uint32Array.BYTES_PER_ELEMENT),Ne.decodeIndexBuffer(_e,de,Uint32Array.BYTES_PER_ELEMENT,ge)):_e=ge;var ye,Be=t.getInt32(B+r,!0);B+=Int32Array.BYTES_PER_ELEMENT,U.indexType=Ae,0===Ae?ye=new Uint16Array(de):1===Ae&&(ye=new Uint32Array(de)),U.indicesCount=de;var Ce=new Uint32Array(_e.buffer,_e.byteOffset,_e.byteLength/4);ye.set(Ce,0),U.indicesTypedArray=ye,U.primitiveType=pe;for(ne=0;ne<Be;ne++){var De;k=(De=Yc(t,r,y,B)).string;B=De.bytesOffset,U.materialCode=k}if(N.length>0&&13!==pe){var he=je.preVertexCount;U.indicesTypedArray=Ce.map((function(e){return e+he})),U.indexType=1}N.push(U),(Oe=(B+r)%4)&&(Oe=4-Oe),B+=Oe}}}je.nCompressOptions=K,2===N.length&&13===N[1].primitiveType&&N[1].indicesCount>=3&&(ve=Te.createEdgeDataByIndices(je,N[1],l)),c[P]={vertexPackage:je,arrIndexPackage:N,edgeGeometry:ve}}else{var ve;if(F===Uc.SV_Standard||F===Uc.SV_Unkown)B=(De=pE(d,y,t,r,B,je,u,D,g,m)).bytesOffset,H=De.cartographicBounds;else if(F===Uc.SV_Compressed&&(B=(De=AE(y,t,r,B,je,u,D,g,m)).bytesOffset,3==d)){var Pe;B=(Pe=Yc(t,r,y,B)).bytesOffset,je.customVertexAttribute=JSON.parse(Pe.string);var Oe;Ee="aCustom"+je.customVertexAttribute.TextureCoordMatrix,ue="aCustom"+je.customVertexAttribute.VertexWeight;n.defined(je.attrLocation[Ee])&&(je.attrLocation.aTextureCoordMatrix=je.attrLocation[Ee],delete je.attrLocation[Ee]),n.defined(je.attrLocation[ue])&&(je.attrLocation.aVertexWeight=je.attrLocation[ue],delete je.attrLocation[ue]),(Oe=(B+r)%4)&&(Oe=4-Oe),B+=Oe}gE(N=(De=dE(d,y,t,r,B)).arrIndexPackage)&&(je.clampRegionEdge=!0),2===N.length&&13===N[1].primitiveType&&N[1].indicesCount>=3&&(ve=Te.createEdgeDataByIndices(je,N[1],l)),B=De.bytesOffset,c[P]={vertexPackage:je,arrIndexPackage:N,edgeGeometry:ve,cartographicBounds:H}}if(3!==d&&n.defined(f)&&f){var be=t.getUint16(B+r,!0);if(B+=Uint16Array.BYTES_PER_ELEMENT,1===be){var Fe=t.getUint32(B+r,!0);B+=Uint32Array.BYTES_PER_ELEMENT;var Se,Me=t.getUint32(B+r,!0);B+=Uint32Array.BYTES_PER_ELEMENT,t.getFloat32(B+r,!0),B+=Float32Array.BYTES_PER_ELEMENT;var Re=new Array(Fe),we=new Array(Fe),Ie=new Array(Fe),Le=new Array(Fe);for(Se=0;Se<Fe;Se++){var xe=t.getFloat32(B+r,!0);B+=Float32Array.BYTES_PER_ELEMENT,Re[Se]=xe;var Ue=t.getUint16(B+r,!0);B+=Uint16Array.BYTES_PER_ELEMENT,we[Se]=Ue;var Ge=t.getUint16(B+r,!0);B+=Uint16Array.BYTES_PER_ELEMENT,Ie[Se]=Ge;for(var ke=Ge*Me,He=new Array(ke),Xe=0;Xe<ke;Xe++){Ee=t.getFloat32(B+r,!0);B+=Float32Array.BYTES_PER_ELEMENT,He[Xe]=Ee}Le[Se]=He}}var Ve=new i.Cartesian3,Ke=new i.Cartesian3;Ve.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Ve.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Ve.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Ke.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Ke.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Ke.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,c[P].min=Ve,c[P].max=Ke;var je=c[P].vertexPackage;n.defined(je.instanceBuffer)&&2===d&&(je.instanceBounds=new Float32Array(6),i.Cartesian3.pack(Ve,je.instanceBounds,0),i.Cartesian3.pack(Ke,je.instanceBounds,3))}if(3===d){var Ye=new i.Cartesian3;Ye.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Ye.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Ye.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT;var Qe=new i.Cartesian3;Qe.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Qe.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Qe.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT;var Je=new i.Cartesian3;Je.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Je.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,Je.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT;var ze=new i.Cartesian3;ze.x=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,ze.y=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT,ze.z=t.getFloat64(B+r,!0),B+=Float64Array.BYTES_PER_ELEMENT}}}function yE(e,t,r){var n=e.typedArray,o=new r(n.length+t.length);o.set(n,0),o.set(t,n.length),e.typedArray=o}function BE(e,t,r,n,o,a){var i,s=0,c=o.vertexAttributes,u=o.attrLocation;switch(t){case _E.AttributeType_Normal:case _E.AttributeType_FirstTexcoord:case _E.AttributeType_SecondTexcoord:s=2*Uint16Array.BYTES_PER_ELEMENT,0!=(16&a)||t!==_E.AttributeType_FirstTexcoord&&t!==_E.AttributeType_SecondTexcoord||(s=2*Float32Array.BYTES_PER_ELEMENT),i=E.ComponentDatatype.createTypedArray(E.ComponentDatatype.UNSIGNED_BYTE,e*s);break;case _E.AttributeType_Color:case _E.AttributeType_SecondColor:s=4*Uint8Array.BYTES_PER_ELEMENT,i=E.ComponentDatatype.createTypedArray(E.ComponentDatatype.UNSIGNED_BYTE,4*e);break;case _E.AttributeType_Custom0:case _E.AttributeType_Custom1:s=Float32Array.BYTES_PER_ELEMENT*r,i=E.ComponentDatatype.createTypedArray(E.ComponentDatatype.UNSIGNED_BYTE,e*r*4);break;default:s=4*Uint16Array.BYTES_PER_ELEMENT,i=E.ComponentDatatype.createTypedArray(E.ComponentDatatype.UNSIGNED_BYTE,e*s)}switch(Ne.decodeVertexBuffer(i,e,s,n,n.length),t){case _E.AttributeType_Position:var l=new Uint16Array(i.buffer,0,i.length/2);void 0!==(f=u.aPosition)?(yE(c[f],l,Uint16Array),o.preVertexCount=o.verticesCount,o.verticesCount+=e):(u.aPosition=c.length,c.push({index:u.aPosition,typedArray:l,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:0,normalize:!1}),o.verticesCount=e);break;case _E.AttributeType_Normal:var f=u.aNormal,d=new Int16Array(i.buffer,0,i.length/2);void 0!==f?yE(c[f],d,Uint16Array):(u.aNormal=c.length,c.push({index:u.aNormal,typedArray:d,componentsPerAttribute:2,componentDatatype:E.ComponentDatatype.SHORT,offsetInBytes:0,strideInBytes:0,normalize:!1}));break;case _E.AttributeType_FirstTexcoord:var A=new Uint16Array(i.buffer,0,i.length/2),p=(f=u.aTexCoord0,E.ComponentDatatype.SHORT),g=Uint16Array;0==(16&a)&&(p=E.ComponentDatatype.FLOAT,g=Float32Array,A=new Float32Array(i.buffer,0,i.length/4)),void 0!==f?yE(c[f],A,g):(u.aTexCoord0=c.length,c.push({index:u.aTexCoord0,typedArray:A,componentsPerAttribute:2,componentDatatype:p,offsetInBytes:0,strideInBytes:0,normalize:!1}));break;case _E.AttributeType_SecondTexcoord:A=new Uint16Array(i.buffer,0,i.length/2),f=u.aTexCoord1,p=E.ComponentDatatype.SHORT,g=Uint16Array;0==(16&a)&&(p=E.ComponentDatatype.FLOAT,g=Float32Array,A=new Float32Array(i.buffer,0,i.length/4)),void 0!==f?yE(c[f],A,g):(u.aTexCoord1=c.length,c.push({index:u.aTexCoord1,typedArray:A,componentsPerAttribute:2,componentDatatype:p,offsetInBytes:0,strideInBytes:0,normalize:!1}));break;case _E.AttributeType_Color:void 0!==(f=u.aColor)?yE(c[f],i,Uint8Array):(u.aColor=c.length,c.push({index:u.aColor,typedArray:i,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:0,normalize:!0}));break;case _E.AttributeType_SecondColor:void 0!==(f=u.aSecondColor)?yE(c[f],i,Uint8Array):(u.aSecondColor=c.length,c.push({index:u.aSecondColor,typedArray:i,componentsPerAttribute:4,componentDatatype:E.ComponentDatatype.BYTE,offsetInBytes:0,strideInBytes:0,normalize:!1}));break;case _E.AttributeType_Custom0:A=new Float32Array(i.buffer,0,i.length/4);void 0!==(f=u.aCustom0)?yE(c[f],A,Float32Array):(u.aCustom0=c.length,c.push({index:u.aCustom0,typedArray:A,componentsPerAttribute:r,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1}));break;case _E.AttributeType_Custom1:var _=new Float32Array(i.buffer,0,i.length/4);void 0!==(f=u.aCustom1)?yE(c[f],_,Float32Array):(u.aCustom1=c.length,c.push({index:u.aCustom1,typedArray:_,componentsPerAttribute:r,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1}))}}function TE(e,t,r,a,i){var s={},c=[],E=new o.Matrix4,u=e;i=n.defaultValue(i,{});for(var l=0;l<16;l++)E[l]=t.getFloat64(r+a,!0),r+=Float64Array.BYTES_PER_ELEMENT;s.matrix=E,s.skeletonNames=c;var f=t.getUint32(r+a,!0);r+=Uint32Array.BYTES_PER_ELEMENT;for(var d=0;d<f;d++){var A=Yc(t,a,u,r),p=A.string;r=A.bytesOffset,c.push(p),i[p]=E}return{byteOffset:r,geode:s}}function CE(e){var t=e.indexOf("Geometry");if(-1===t)return e;var r=e.substring(t,e.length);return e.replace(r,"")}function DE(e,t,r,n,o,a){var s={},c=r.getFloat32(n+o,!0);n+=Float32Array.BYTES_PER_ELEMENT;var E=r.getUint16(n+o,!0);n+=Uint16Array.BYTES_PER_ELEMENT,s.rangeMode=E,s.rangeList=c;var u=new i.Cartesian3;u.x=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,u.y=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,u.z=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT;var f=r.getFloat64(n+o,!0);if(n+=Float64Array.BYTES_PER_ELEMENT,s.boundingSphere=new l.BoundingSphere(u,f),3===e){var d=new i.Cartesian3;d.x=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,d.y=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,d.z=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT;var A=new i.Cartesian3;A.x=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,A.y=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,A.z=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT;var p=new i.Cartesian3;p.x=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,p.y=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,p.z=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT;var g=new i.Cartesian3;g.x=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,g.y=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,g.z=r.getFloat64(n+o,!0),n+=Float64Array.BYTES_PER_ELEMENT,s._obb={xExtent:A,yExtent:p,zExtent:g,obbCenter:d}}var _=t,m=(T=Yc(r,o,_,n)).string;n=T.bytesOffset,m=CE(m=(m=m.replace(/(\.s3mblock)|(\.s3mbz)|(\.s3mb)/gi,"")).replace(/\\/gi,"/")),s.childTile=m,s.geodes=[];var y=r.getUint32(n+o,!0);n+=Uint32Array.BYTES_PER_ELEMENT;for(var B=0;B<y;B++){var T;n=(T=TE(t,r,n,o,a)).byteOffset,s.geodes.push(T.geode)}return 3===e&&(n=(T=Yc(r,o,_,n)).bytesOffset),{pageLOD:s,bytesOffset:n}}function hE(e,t,r,n,o){var a=0,i={},s=[],c=r.getUint32(a+n,!0);a+=Uint32Array.BYTES_PER_ELEMENT;for(var E=0;E<c;E++){var u=DE(e,t,r,a,n,o);a=u.bytesOffset,s.push(u.pageLOD)}return i.pageLods=s,i}function vE(e,t,r,n,o,a){var i=0,s=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var c=0;c<s;c++){var E=Yc(r,n,t,i),l=E.string,f=(i=E.bytesOffset)%4;0!==f&&(i+=4-f);var d=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var A=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var p=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var g=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var _=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var m=r.getUint32(i+n,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var y=t.subarray(i,i+_);i+=_;var B=null,T=g;g===u.S3MCompressType.enrS3TCDXTN&&1!=e?(u.DXTTextureDecode.decode(B,A,p,y,m),B=m>u.S3MPixelFormat.BGR||m===u.S3MPixelFormat.LUMINANCE_ALPHA?new Uint8Array(A*p*4):new Uint16Array(A*p),u.DXTTextureDecode.decode(B,A,p,y,m),a.push(B.buffer),g=0):B=y,o[l]={id:l,width:A,height:p,compressType:g,oriCompressType:T,nFormat:m,imageBuffer:B,mipmapLevel:d}}}function PE(e,t,r){var n=e.vertexAttributes,o=e.attrLocation,a=n.length;o["aTextureBatchId"+r]=a,n.push({index:a,typedArray:t,componentsPerAttribute:1,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0})}function OE(e,t,r,o){for(var a=r.length,i=0;i<a;i++)for(var s=r[i],c=s.subName.split("_")[0],E=s.subVertexOffsetArr,u=0;u<E.length;u++){var l=E[u],f=l.geoName,d=l.offset,A=l.count,p=l.texUnitIndex,g=t[f].vertexPackage.verticesCount,m=o[f];n.defined(m)||(m=o[f]={});var y=m[p];n.defined(y)||(y=m[p]=new Float32Array(g),_.arrayFill(y,-1));var B=n.defined(e)?e[c]:i;_.arrayFill(y,B,d,d+A)}}function bE(e,t,r,o,a,i,s,c,E,l){var f=c,d=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;for(var A={},p=0;p<d;p++){var g=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var _=u.getStringFromTypedArray(i,f-c,g),m=(f+=g)%4;0!==m&&(f+=4-m),s.getUint32(f,!0),f+=Uint32Array.BYTES_PER_ELEMENT;var y=s.getUint8(f,!0);f+=Uint8Array.BYTES_PER_ELEMENT;var B=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var T=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var C=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var D=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var h,v=s.getUint32(f,!0);if(f+=Uint32Array.BYTES_PER_ELEMENT,o&&y){var P=f-c;h=i.subarray(P,P+D),f+=D}var O=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;for(var b=[],F=0;F<O;F++){g=s.getUint32(f,!0),f+=Uint32Array.BYTES_PER_ELEMENT;var S=u.getStringFromTypedArray(i,f-c,g);f+=g,b.push(S),r[S]=_}var M=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var R=[];for(F=0;F<M;F++){g=s.getUint32(f,!0),f+=Uint32Array.BYTES_PER_ELEMENT;var w=u.getStringFromTypedArray(i,f-c,g);f+=g,R.push(w)}var I=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var L=[],x=void 0,N=_;if(o)x=t[_]={};else{var U=r[_];for(N=U;n.defined(U)&&U!==_;)N=U,U=r[U];n.defined(N)&&(x=t[N])}var G=0;for(F=0;F<I;F++){g=s.getUint32(f,!0),f+=Uint32Array.BYTES_PER_ELEMENT;var k=u.getStringFromTypedArray(i,f-c,g);if(f+=g,o){var H=k.split("_")[0];n.defined(x[H])?G++:x[H]=F-G}var X=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var V=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var K=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var j=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var Y=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;for(var Q=[],J=0;J<Y;J++){g=s.getUint32(f,!0),f+=Uint32Array.BYTES_PER_ELEMENT;var z=u.getStringFromTypedArray(i,f-c,g);f+=g;var W=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var Z=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;var q=s.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT,Q.push({geoName:z,offset:W,count:Z,texUnitIndex:q})}L.push({subName:k,offsetX:X,offsetY:V,width:K,height:j,subVertexOffsetArr:Q})}OE(x,e,L,A),n.defined(h)&&C===u.S3MPixelFormat.CRN_DXT5&&wc&&(h=Lc({data:h},l).bufferView),E[_]={id:_,rootTextureName:N,width:B,height:T,compressType:C,size:D,format:v,textureData:h,subTexInfos:L,requestNames:R}}for(var z in A)if(A.hasOwnProperty(z)){var $=e[z].vertexPackage,ee=A[z];for(var q in ee){if(ee.hasOwnProperty(q))PE($,ee[q],q)}}}function FE(e,t,r){var n=e.vertexAttributes,o=e.attrLocation,a=n.length;o[1===r?"instanceId":"batchId"]=a,n.push({index:a,typedArray:t,componentsPerAttribute:1,componentDatatype:E.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0,instanceDivisor:r})}var SE=65536;function ME(e,t,r,n,o){var a=0,i=e,s=t.getUint32(a+r,!0);a+=Uint32Array.BYTES_PER_ELEMENT;for(var E=0;E<s;E++){var u=Yc(t,r,i,a),l=u.string;a=u.bytesOffset;var f=t.getUint32(a+r,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var d={};if(n[l].pickInfo=d,n[l].edgeGeometry,-1==n[l].vertexPackage.instanceIndex){for(var A=new Float32Array(n[l].vertexPackage.verticesCount),p=0;p<f;p++){var g=t.getUint32(a+r,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var m=t.getUint32(a+r,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var y=0,B=0;d[g]={batchId:p};for(var T=0;T<m;T++)B=t.getUint32(a+r,!0),a+=Uint32Array.BYTES_PER_ELEMENT,y=t.getUint32(a+r,!0),a+=Uint32Array.BYTES_PER_ELEMENT,_.arrayFill(A,p,B,B+y);d[g].vertexColorOffset=B,d[g].vertexCount=y}FE(n[l].vertexPackage,A,void 0)}else{var C=n[l].vertexPackage.instanceCount,D=n[l].vertexPackage.instanceBuffer,h=n[l].vertexPackage.instanceMode,v=new Float32Array(C),P=17===h?16:28;P*=Float32Array.BYTES_PER_ELEMENT;var O=0;for(p=0;p<f;p++){var b=t.getUint32(a+r,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,2!==o){var F=O*h*Float32Array.BYTES_PER_ELEMENT+P;c.Color.unpack(D,F,kc),b=kc.red+256*kc.green+kc.blue*SE}m=t.getUint32(a+r,!0);a+=Uint32Array.BYTES_PER_ELEMENT;for(T=0;T<m;T++){var S=t.getUint32(a+r,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,v[O]=O,void 0===d[b]&&(d[b]={vertexColorCount:1,instanceIds:[],vertexColorOffset:O}),d[b].instanceIds.push(S),O++,3===o){y=t.getUint32(a+r,!0);a+=Uint32Array.BYTES_PER_ELEMENT}}}FE(n[l].vertexPackage,v,1)}}}function RE(e){return e<1e-10&&e>-1e-10}function wE(e,t,r,n,o,a,i,s){var c=new DataView(e),E=new Uint8Array(e),l=c.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;var f=u.getStringFromTypedArray(E,r,l);f=f.replace(/(\.s3mblock)|(\.s3mbz)|(\.s3mb)/gi,""),r+=l;var d=c.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;for(var A=0;A<d;A++){var p={},_=c.getFloat32(r,!0);r+=Float32Array.BYTES_PER_ELEMENT;var m=c.getUint16(r,!0);r+=Uint16Array.BYTES_PER_ELEMENT,p.rangeMode=m,p.rangeList=_;var y={};y.x=c.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,y.y=c.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,y.z=c.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT;var B=c.getFloat64(r,!0);r+=Float64Array.BYTES_PER_ELEMENT,p.boundingSphere={center:y,radius:B},l=c.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT;var T=u.getStringFromTypedArray(E,r,l);r+=l,T=CE(T=T.replace(/(\.s3mblock)|(\.s3mbz)|(\.s3mb)/gi,"")),p.childTile=T}var C={},D=c.getFloat32(r,!0);r+=Float32Array.BYTES_PER_ELEMENT;D>=3&&(c.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT),c.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT;var h=c.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;var v=new Uint8Array(e,r,h),P=r+h,O=g.pako.inflate(v).buffer;s.push(O),c=new DataView(O);E=new Uint8Array(O);r=0;var b=c.getUint32(r,!0),F=jc(c,O,r+=Uint32Array.BYTES_PER_ELEMENT),S=F.buffer;r=F.byteOffset;var M=hE(D,S,c,F.dataViewByteOffset),R=r%4;0!==R&&(r+=4-R),mE((F=jc(c,O,r)).buffer,c,F.dataViewByteOffset,C,!1,void 0,void 0,D),r=F.byteOffset,3!==D&&((F=jc(c,O,r)).buffer,r=F.byteOffset);var I={};bE(C,n,o,a,0,(F=jc(c,O,r)).buffer,c,F.dataViewByteOffset,I,s),r=F.byteOffset;var L=c.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;var x=E.subarray(r,r+L),N=u.getStringFromTypedArray(x);r+=L;var U=JSON.parse(N);(3===D&&(b=c.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT),(b&Nc.SVO_HasInstSelInfo)==Nc.SVO_HasInstSelInfo)&&(ME((F=jc(c,O,r)).buffer,c,F.dataViewByteOffset,C,D),r=F.byteOffset);var G=M.pageLods,k=!0;for(A=0;A<G.length;A++){var H=G[A];k=""===H.childTile;for(var X=H.geodes,V=0;V<X.length;V++)for(var K=X[V].skeletonNames,j=0;j<K.length;j++){var Y=K[j];if(k){var Q=C[Y].vertexPackage;Q.boundingSphere=w.calcBoundingSphereInWorker(1,Q)}}}i[f]={result:!0,groupNode:M,geoPackage:C,matrials:U,texturePackage:I,version:xe.S3M4,rootBatchIdMap:n,ancestorMap:o},P<t&&wE(e,t,P,n,o,!1,i,s)}function IE(e,t,r){for(var o in delete e.ignoreNormal,e)if(e.hasOwnProperty(o)){var a=e[o],i=a.arrIndexPackage;if(i.length<1)continue;if(1===i.length||2===i.length&&13===i[1].primitiveType){var s=a.vertexPackage.attrLocation.aTextureCoordMatrix;if(void 0!==s){if((c=(S=a.vertexPackage.vertexAttributes[s]).typedArray)[0]<0)continue}else if(void 0!==(s=a.vertexPackage.attrLocation.aTextureCoordMatrix||a.vertexPackage.attrLocation.aTexCoord0)){S=a.vertexPackage.vertexAttributes[s];var c=new Float32Array(S.typedArray.buffer,S.typedArray.byteOffset,S.typedArray.byteLength/4);if(3===S.componentsPerAttribute&&c[2]<0)continue}}var E,u,l=0,f={},d=void 0;for(E=0,u=i.length;E<u;E++)13!==i[E].primitiveType?l+=i[E].indicesTypedArray.byteLength:d=i[E],0===E&&(f.indicesCount=0,f.indexType=i[E].indexType,f.primitiveType=i[E].primitiveType,f.materialCode=i[E].materialCode);f.indicesCount=l/2;var A=a.vertexPackage.verticesCount>65535?new Uint32Array(l/2):new Uint16Array(l/2),p=0;for(E=0,u=i.length;E<u;E++){if(13!==(M=i[E]).primitiveType){var g=0===M.indexType?Uint16Array:Uint32Array,_=0===M.indexType?M.indicesTypedArray.byteLength/2:M.indicesTypedArray.byteLength/4,m=new g(M.indicesTypedArray.buffer,M.indicesTypedArray.byteOffset,_);A.set(m,p),p+=m.length}}f.indicesTypedArray=A,a.arrIndexPackage=[f],n.defined(d)&&(a.arrIndexPackage.push(d),a.edgeGeometry=Te.createEdgeDataByIndices(a.vertexPackage,d));var y=2*i.length*4,B=new Float32Array(y),T={};for(E=0,u=r.material.length;E<u;E++){T[(R=r.material[E].material).id]=R}for(E=0,u=i.length;E<u;E++){if(R=T[(M=i[E]).materialCode]){var C=R.pbrMetallicRoughness;if(C){B[8*E]=C.metallicFactor,B[8*E+1]=C.roughnessFactor,B[8*E+2]=R.alphaCutoff;var D=""===R.alphaMode?0:1,h="none"===R.cullMode?0:1;B[8*E+3]=h|D<<16,B[8*E+4]=C.emissiveFactor.x,B[8*E+5]=C.emissiveFactor.y,B[8*E+6]=C.emissiveFactor.z,B[8*E+7]=0,R.pbrIndex=E}}}var v="PBRMaterialParam_"+o;for(E=0,u=r.material.length;E<u;E++){if((R=r.material[E].material).id===f.materialCode){R.textureunitstates.push({textureunitstate:{addressmode:{u:0,v:0,w:0},filteringoption:0,filtermax:2,filtermin:2,id:v,texmodmatrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],url:""}});break}}var P,O,b=a.vertexPackage,F=b.attrLocation.aTexCoord1;if(void 0!==F){var S=b.vertexAttributes[F];P=new Float32Array(2*b.verticesCount),S.typedArray=P}else P=new Float32Array(2*b.verticesCount),F=b.vertexAttributes.length,b.attrLocation.aTexCoord1=F,b.vertexAttributes.push({index:F,typedArray:P,componentsPerAttribute:2,componentDatatype:5126,offsetInBytes:0,strideInBytes:8,normalize:!1});if(void 0!==(F=b.attrLocation.aColor))O=(S=b.vertexAttributes[F]).typedArray;for(E=0,u=i.length;E<u;E++){var M,R;if((R=T[(M=i[E]).materialCode])&&R.pbrMetallicRoughness)for(var w=R.pbrMetallicRoughness.baseColor,I=void 0!==O,L=R.pbrIndex,x=(A=M.indicesTypedArray,0),N=(A=0===M.indexType?new Uint16Array(A.buffer,A.byteOffset,A.byteLength/2):new Uint32Array(A.buffer,A.byteOffset,A.byteLength/4)).length;x<N;x++){var U=A[x];P[2*U]=L,I&&(O[4*U]=255*w.x,O[4*U+1]=255*w.y,O[4*U+2]=255*w.z,O[4*U+3]=255*w.w)}}t[v]={id:v,width:2*i.length,height:1,compressType:0,nFormat:25,imageBuffer:B,mipmapLevel:0}}}function LE(e,t,r){var n=Ue._malloc(20*t),o=Ue._malloc(Uint8Array.BYTES_PER_ELEMENT*t);Ue.HEAPU8.set(e,o/Uint8Array.BYTES_PER_ELEMENT);var a=Vc(o,t,n,r),i=new Uint8Array(Ue.HEAPU8.buffer,n,a);e=null;e=new Uint8Array(i).buffer;return Ue._free(n),Ue._free(o),e}function xE(e,t){var r=e.buffer;if(e.isOSGB){if(!Xc)return null;var o;switch(e.suffix){case"dae":case"DAE":o=4;break;case"x":o=2;break;default:o=0}r=LE(new Uint8Array(r),r.byteLength,o)}var a=e.isS3MZ,i=e.fileType,s=e.supportCompressType,c=e.bVolume,E=e.isS3MBlock,l=e.modelMatrix,f=e.materialType,d=e.isCoverImageryLayer,A=e.transformPar,p=null,_=null,m=null;if(c&&e.volbuffer.byteLength<8&&(c=!1),c){var y=e.volbuffer,B=new Uint8Array(y,8),T=g.pako.inflate(B).buffer,C=new Float64Array(T,0,1),D=new Uint32Array(T,48,1);if(0===C[0]||3200===D[0]||3201===D[0]){var h=0;0==C[0]&&(h=8),t.push(T);var v=new Float64Array(T,h,6),P=v[0],O=v[1],b=v[2],F=v[3],S=v[4]<v[5]?v[4]:v[5],M=v[4]>v[5]?v[4]:v[5];_={left:P,top:O,right:b,bottom:F,minHeight:S,maxHeight:M,width:(p=new Kc(P,F,b,O,S,M)).width,length:p.length,height:p.height};var R=new Uint32Array(T,48+h,7),I=R[0],L=R[1],x=R[2],N=R[3];m={nFormat:I,nSideBlockCount:L,nBlockLength:x,nLength:N,nWidth:R[4],nHeight:R[5],nDepth:R[6],imageArray:new Uint8Array(T,76+h,N*N*4)}}}var U=0,G={};G.ignoreNormal=e.ignoreNormal;var k=e.rootBatchIdMap||{},H=e.ancestorMap||{},X={},V=new DataView(r),K=V.getFloat32(U,!0);if(U+=Float32Array.BYTES_PER_ELEMENT,E)return V.getUint32(U,!0),U+=Uint32Array.BYTES_PER_ELEMENT,wE(r,r.byteLength,U,k,H,e.isRoot,X,t),X;var j=!1;if(K>=3&&(V.getUint32(U,!0),U+=Uint32Array.BYTES_PER_ELEMENT),K>=2&&(V.getUint32(U,!0),U+=Uint32Array.BYTES_PER_ELEMENT),RE(K-1)||RE(K-2)||RE(K-3)||K>2.09&&K<2.11){var Y=V.getUint32(U,!0);U+=Uint32Array.BYTES_PER_ELEMENT;var Q=new Uint8Array(r,U,Y);r=g.pako.inflate(Q).buffer,t.push(r),V=new DataView(r),U=0}else if(K>1.199&&K<1.201){Y=V.getUint32(U,!0);U+=Uint32Array.BYTES_PER_ELEMENT,t.push(r)}else{j=!0,U=0;Y=V.getInt32(U,!0);if(U+=Int32Array.BYTES_PER_ELEMENT,U+=Uint8Array.BYTES_PER_ELEMENT*Y,a){V.getUint32(U,!0),U+=Uint32Array.BYTES_PER_ELEMENT;B=new Uint8Array(r,U);r=g.pako.inflate(B).buffer,t.push(r),V=new DataView(r),U=0}}var J=V.getUint32(U,!0),z=jc(V,r,U+=Uint32Array.BYTES_PER_ELEMENT),W=z.buffer;U=z.byteOffset;var Z={},q=hE(K,W,V,z.dataViewByteOffset,Z),$=U%4;0!==$&&(U+=4-$);var ee=K>2.09&&3!==K;if(mE((z=jc(V,r,U)).buffer,V,z.dataViewByteOffset,G,j,t,ee,K,l,Z,d,e.fileType,A),U=z.byteOffset,ee)for(var te=0;te<q.pageLods.length;te++)for(var re=q.pageLods[te],ne=re.geodes,oe=0;oe<ne.length;oe++)for(var ae=ne[oe].skeletonNames,ie=0;ie<ae.length;ie++){var se=ae[ie];n.defined(G[se].max)&&(n.defined(re.max)?(re.max.x=Math.max(G[se].max.x,re.max.x),re.max.y=Math.max(G[se].max.y,re.max.y),re.max.z=Math.max(G[se].max.z,re.max.z),re.min.x=Math.min(G[se].min.x,re.min.x),re.min.y=Math.min(G[se].min.y,re.min.y),re.min.z=Math.min(G[se].min.z,re.min.z)):(re.max=G[se].max,re.min=G[se].min))}3!==K&&((z=jc(V,r,U)).buffer,U=z.byteOffset);var ce={};vE(s,(z=jc(V,r,U)).buffer,V,z.dataViewByteOffset,ce,t),U=z.byteOffset;var Ee=V.getUint32(U,!0);U+=Uint32Array.BYTES_PER_ELEMENT;var ue=new Uint8Array(r).subarray(U,U+Ee),le=u.getStringFromTypedArray(ue);U+=Ee,le=le.replace(/\n\0/,"");var fe=JSON.parse(le);(3===K&&(J=V.getUint32(U,!0),U+=Uint32Array.BYTES_PER_ELEMENT),(J&Nc.SVO_HasInstSelInfo)==Nc.SVO_HasInstSelInfo)&&ME((z=jc(V,r,U)).buffer,V,z.dataViewByteOffset,G,K);var de=q.pageLods,Ae=!0;for(te=0;te<de.length;te++){var pe=de[te];Ae=""===pe.childTile;for(var ge=pe.geodes,_e=0;_e<ge.length;_e++){ae=ge[_e].skeletonNames;for(var me=0;me<ae.length;me++){var ye=ae[me];if(Ae){var Be=G[ye].vertexPackage;Be.boundingSphere=w.calcBoundingSphereInWorker(i,Be)}}}}return"BatchPBR"===f&&IE(G,ce,fe),{result:!0,groupNode:q,geoPackage:G,matrials:fe,texturePackage:ce,version:xe.S3M4,volImageBuffer:m,volBounds:_}}function NE(){n.defined(Mc)&&n.defined(xc)&&(Mc.onRuntimeInitialized=function(){wc=!0},self.onmessage=e(xE),self.postMessage(!0))}function UE(t){if("undefined"==typeof WebAssembly)return self.onmessage=e(xE),void self.postMessage(!0);var o=t.data.webAssemblyConfig;return n.defined(o)?r.FeatureDetection.isInternetExplorer()?require([l.buildModuleUrl("ThirdParty/Workers/ie-webworker-promise-polyfill.js")],(function(e){return self.Promise=e,-1!==o.modulePath.indexOf("crunch")?require([o.modulePath],(function(e){n.defined(o.wasmBinaryFile)?(n.defined(e)||(e=self.Module),Mc=e,NE()):(Mc=e,NE())})):require([o.modulePath],(function(e){n.defined(o.wasmBinaryFile)?(n.defined(e)||(e=self.DracoDecoderModule),e(o).then((function(e){xc=e,NE()}))):(xc=e(),NE())}))})):-1!==o.modulePath.indexOf("crunch")?require([o.modulePath],(function(e){n.defined(o.wasmBinaryFile)?(n.defined(e)||(e=self.Module),Mc=e,NE()):(Mc=e,NE())})):require([o.modulePath],(function(e){n.defined(o.wasmBinaryFile)?(n.defined(e)||(e=self.DracoDecoderModule),e(o).then((function(e){xc=e,NE()}))):(xc=e(),NE())})):void 0}return UE}));