Untitled
unknown
plain_text
a year ago
72 kB
0
Indexable
Never
var e;"undefined"!=typeof self&&self,e=function(){return function(A){var B={};function t(e){if(B[e])return B[e].exports;var g=B[e]={i:e,l:!1,exports:{}};return A[e].call(g.exports,g,g.exports,t),g.l=!0,g.exports}return t.m=A,t.c=B,t.d=function(A,B,e){t.o(A,B)||Object.defineProperty(A,B,{configurable:!1,enumerable:!0,get:e})},t.n=function(A){var B=A&&A.__esModule?function(){return A.default}:function(){return A};return t.d(B,"a",B),B},t.o=function(A,B){return Object.prototype.hasOwnProperty.call(A,B)},t.p="",t(t.s=9)}([function(A,B,t){"use strict";B.__esModule=!0,B.copyExistingProperties=function(A,B){Object.keys(B).forEach((function(t){B.hasOwnProperty(t)&&A.hasOwnProperty(t)&&(B[t]=A[t])}))},B.copyNamedProperties=function(A,B,t){A.forEach((function(A){var e=B[A];void 0!==e&&(t[A]=e)}))},B.isBuffer=function(A,B){return Q||(Q=A.createBuffer()),B instanceof Q.constructor},B.isRenderbuffer=function(A,B){return s||(s=A.createRenderbuffer()),B instanceof s.constructor},B.isShader=function(A,B){return n||(n=A.createShader(A.VERTEX_SHADER)),B instanceof n.constructor},B.isTexture=function(A,B){return r||(r=A.createTexture()),B instanceof r.constructor},B.isSampler=function(A,B){if(!c){if(!A.createSampler)return!1;c=A.createSampler()}return B instanceof c.constructor},B.warn=B.error=void 0;var e,g=(e=t(2))&&e.__esModule?e:{default:e},i=g.default.console&&g.default.console.error&&"function"==typeof g.default.console.error?g.default.console.error.bind(g.default.console):function(){};B.error=i;var Q,s,n,r,c,E=g.default.console&&g.default.console.warn&&"function"==typeof g.default.console.warn?g.default.console.warn.bind(g.default.console):function(){};B.warn=E},function(A,B,t){"use strict";B.__esModule=!0,B.getGLTypeForTypedArray=function(A){if(A instanceof Int8Array)return 5120;if(A instanceof Uint8Array)return 5121;if(A instanceof Uint8ClampedArray)return 5121;if(A instanceof Int16Array)return 5122;if(A instanceof Uint16Array)return 5123;if(A instanceof Int32Array)return 5124;if(A instanceof Uint32Array)return 5125;if(A instanceof Float32Array)return 5126;throw"unsupported typed array type"},B.getGLTypeForTypedArrayType=function(A){if(A===Int8Array)return 5120;if(A===Uint8Array)return 5121;if(A===Uint8ClampedArray)return 5121;if(A===Int16Array)return 5122;if(A===Uint16Array)return 5123;if(A===Int32Array)return 5124;if(A===Uint32Array)return 5125;if(A===Float32Array)return 5126;throw"unsupported typed array type"},B.getTypedArrayTypeForGLType=function(A){var B=i[A];if(!B)throw"unknown gl type";return B},B.isArrayBuffer=void 0;var e,g=(e=t(2))&&e.__esModule?e:{default:e},i={},Q=i;Q[5120]=Int8Array,Q[5121]=Uint8Array,Q[5122]=Int16Array,Q[5123]=Uint16Array,Q[5124]=Int32Array,Q[5125]=Uint32Array,Q[5126]=Float32Array,Q[32819]=Uint16Array,Q[32820]=Uint16Array,Q[33635]=Uint16Array,Q[5131]=Uint16Array,Q[33640]=Uint32Array,Q[35899]=Uint32Array,Q[35902]=Uint32Array,Q[36269]=Uint32Array,Q[34042]=Uint32Array;var s=g.default.SharedArrayBuffer?function(A){return A&&A.buffer&&(A.buffer instanceof ArrayBuffer||A.buffer instanceof g.default.SharedArrayBuffer)}:function(A){return A&&A.buffer&&A.buffer instanceof ArrayBuffer};B.isArrayBuffer=s},function(A,B,t){"use strict";B.__esModule=!0,B.default=void 0;var e=void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};B.default=e},function(A,B,t){"use strict";B.__esModule=!0,B.add=function(A,B,t){return(t=t||new e(3))[0]=A[0]+B[0],t[1]=A[1]+B[1],t[2]=A[2]+B[2],t},B.copy=function(A,B){return(B=B||new e(3))[0]=A[0],B[1]=A[1],B[2]=A[2],B},B.create=function(A,B,t){var g=new e(3);return A&&(g[0]=A),B&&(g[1]=B),t&&(g[2]=t),g},B.cross=function(A,B,t){t=t||new e(3);var g=A[2]*B[0]-A[0]*B[2],i=A[0]*B[1]-A[1]*B[0];return t[0]=A[1]*B[2]-A[2]*B[1],t[1]=g,t[2]=i,t},B.distance=function(A,B){var t=A[0]-B[0],e=A[1]-B[1],g=A[2]-B[2];return Math.sqrt(t*t+e*e+g*g)},B.distanceSq=function(A,B){var t=A[0]-B[0],e=A[1]-B[1],g=A[2]-B[2];return t*t+e*e+g*g},B.divide=function(A,B,t){return(t=t||new e(3))[0]=A[0]/B[0],t[1]=A[1]/B[1],t[2]=A[2]/B[2],t},B.divScalar=function(A,B,t){return(t=t||new e(3))[0]=A[0]/B,t[1]=A[1]/B,t[2]=A[2]/B,t},B.dot=function(A,B){return A[0]*B[0]+A[1]*B[1]+A[2]*B[2]},B.lerp=function(A,B,t,g){return(g=g||new e(3))[0]=(1-t)*A[0]+t*B[0],g[1]=(1-t)*A[1]+t*B[1],g[2]=(1-t)*A[2]+t*B[2],g},B.length=function(A){return Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2])},B.lengthSq=function(A){return A[0]*A[0]+A[1]*A[1]+A[2]*A[2]},B.mulScalar=function(A,B,t){return(t=t||new e(3))[0]=A[0]*B,t[1]=A[1]*B,t[2]=A[2]*B,t},B.multiply=function(A,B,t){return(t=t||new e(3))[0]=A[0]*B[0],t[1]=A[1]*B[1],t[2]=A[2]*B[2],t},B.negate=function(A,B){return(B=B||new e(3))[0]=-A[0],B[1]=-A[1],B[2]=-A[2],B},B.normalize=function(A,B){B=B||new e(3);var t=A[0]*A[0]+A[1]*A[1]+A[2]*A[2],g=Math.sqrt(t);return g>1e-5?(B[0]=A[0]/g,B[1]=A[1]/g,B[2]=A[2]/g):(B[0]=0,B[1]=0,B[2]=0),B},B.setDefaultType=function(A){var B=e;return e=A,B},B.subtract=function(A,B,t){return(t=t||new e(3))[0]=A[0]-B[0],t[1]=A[1]-B[1],t[2]=A[2]-B[2],t};var e=Float32Array},function(A,B,t){"use strict";B.__esModule=!0,B.isWebGL1=function(A){return!A.texStorage2D},B.isWebGL2=function(A){return!!A.texStorage2D},B.glEnumToString=void 0;var e,g,i=(e={},g={},function(A,B){return function(A){var B=A.constructor.name;if(!e[B]){for(var t in A)if("number"==typeof A[t]){var i=g[A[t]];g[A[t]]=i?"".concat(i," | ").concat(t):t}e[B]=!0}}(A),g[B]||"0x"+B.toString(16)});B.glEnumToString=i},function(A,B,t){"use strict";B.__esModule=!0,B.createAttributeSetters=z,B.createProgram=H,B.createProgramFromScripts=function(A,B,t,e,g){for(var i=N(t,e,g),Q=[],s=0;s<B.length;++s){var n=R(A,B[s],A[m[s]],i.errorCallback);if(!n)return null;Q.push(n)}return H(A,Q,i)},B.createProgramFromSources=p,B.createProgramInfo=function(A,B,t,e,g){var i=N(t,e,g),Q=!0;if(B=B.map((function(A){if(A.indexOf("\n")<0){var B=c(A);B?A=B.text:(i.errorCallback("no element with id: "+A),Q=!1)}return A})),!Q)return null;var s=p(A,B,i);return s?P(A,s):null},B.createProgramInfoFromProgram=P,B.createUniformSetters=J,B.createUniformBlockSpecFromProgram=j,B.createUniformBlockInfoFromProgram=S,B.createUniformBlockInfo=function(A,B,t){return S(A,B.program,B.uniformBlockSpec,t)},B.createTransformFeedback=function(A,B,t){var e=A.createTransformFeedback();return A.bindTransformFeedback(A.TRANSFORM_FEEDBACK,e),A.useProgram(B.program),T(A,B,t),A.bindTransformFeedback(A.TRANSFORM_FEEDBACK,null),function(A,B,t){for(var e in B.transformFeedbackInfo&&(B=B.transformFeedbackInfo),t.attribs&&(t=t.attribs),t){var g=B[e];g&&A.bindBufferBase(A.TRANSFORM_FEEDBACK_BUFFER,g.index,null)}}(A,B,t),e},B.createTransformFeedbackInfo=k,B.bindTransformFeedbackInfo=T,B.setAttributes=L,B.setBuffersAndAttributes=function(A,B,t){t.vertexArrayObject?A.bindVertexArray(t.vertexArrayObject):(L(B.attribSetters||B,t.attribs),t.indices&&A.bindBuffer(A.ELEMENT_ARRAY_BUFFER,t.indices))},B.setUniforms=function A(B,t){for(var e=B.uniformSetters||B,g=arguments.length,i=1;i<g;++i){var Q=arguments[i];if(Array.isArray(Q))for(var s=Q.length,n=0;n<s;++n)A(e,Q[n]);else for(var r in Q){var c=e[r];c&&c(Q[r])}}},B.setUniformBlock=function(A,B,t){b(A,B,t)&&A.bufferData(A.UNIFORM_BUFFER,t.array,A.DYNAMIC_DRAW)},B.setBlockUniforms=function(A,B){var t=A.uniforms;for(var e in B){var g=t[e];if(g){var i=B[e];i.length?g.set(i):g[0]=i}}},B.bindUniformBlock=b;var e,g=s(t(4)),i=s(t(0)),Q=(e=t(2))&&e.__esModule?e:{default:e};function s(A){if(A&&A.__esModule)return A;var B={};if(null!=A)for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)){var e=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,t):{};e.get||e.set?Object.defineProperty(B,t,e):B[t]=A[t]}return B.default=A,B}var n=i.error,r=i.warn,c=Q.default&&Q.default.document&&Q.default.document.getElementById?Q.default.document.getElementById.bind(Q.default.document):function(){return null},E={};function o(A,B){return E[B].bindPoint}function w(A,B){return function(t){A.uniform1i(B,t)}}function C(A,B){return function(t){A.uniform1iv(B,t)}}function a(A,B){return function(t){A.uniform2iv(B,t)}}function I(A,B){return function(t){A.uniform3iv(B,t)}}function Y(A,B){return function(t){A.uniform4iv(B,t)}}function h(A,B,t,e){var Q=o(0,B);return g.isWebGL2(A)?function(B){var g,s;i.isTexture(A,B)?(g=B,s=null):(g=B.texture,s=B.sampler),A.uniform1i(e,t),A.activeTexture(A.TEXTURE0+t),A.bindTexture(Q,g),A.bindSampler(t,s)}:function(B){A.uniform1i(e,t),A.activeTexture(A.TEXTURE0+t),A.bindTexture(Q,B)}}function M(A,B,t,e,Q){for(var s=o(0,B),n=new Int32Array(Q),r=0;r<Q;++r)n[r]=t+r;return g.isWebGL2(A)?function(B){A.uniform1iv(e,n),B.forEach((function(B,e){var g,Q;A.activeTexture(A.TEXTURE0+n[e]),i.isTexture(A,B)?(g=B,Q=null):(g=B.texture,Q=B.sampler),A.bindSampler(t,Q),A.bindTexture(s,g)}))}:function(B){A.uniform1iv(e,n),B.forEach((function(B,t){A.activeTexture(A.TEXTURE0+n[t]),A.bindTexture(s,B)}))}}function F(A,B){return function(t){A.bindBuffer(A.ARRAY_BUFFER,t.buffer),A.enableVertexAttribArray(B),A.vertexAttribPointer(B,t.numComponents||t.size,t.type||A.FLOAT,t.normalize||!1,t.stride||0,t.offset||0),void 0!==t.divisor&&A.vertexAttribDivisor(B,t.divisor)}}function D(A,B){return function(t){A.bindBuffer(A.ARRAY_BUFFER,t.buffer),A.enableVertexAttribArray(B),A.vertexAttribIPointer(B,t.numComponents||t.size,t.type||A.INT,t.stride||0,t.offset||0),void 0!==t.divisor&&A.vertexAttribDivisor(B,t.divisor)}}function u(A,B,t){var e=t.size,g=t.count;return function(t){A.bindBuffer(A.ARRAY_BUFFER,t.buffer);for(var i=t.size||t.numComponents||e,Q=i/g,s=t.type||A.FLOAT,n=E[s].size*i,r=t.normalize||!1,c=t.offset||0,o=n/g,w=0;w<g;++w)A.enableVertexAttribArray(B+w),A.vertexAttribPointer(B+w,Q,s,r,n,c+o*w),void 0!==t.divisor&&A.vertexAttribDivisor(B+w,t.divisor)}}E[5126]={Type:Float32Array,size:4,setter:function(A,B){return function(t){A.uniform1f(B,t)}},arraySetter:function(A,B){return function(t){A.uniform1fv(B,t)}}},E[35664]={Type:Float32Array,size:8,setter:function(A,B){return function(t){A.uniform2fv(B,t)}}},E[35665]={Type:Float32Array,size:12,setter:function(A,B){return function(t){A.uniform3fv(B,t)}}},E[35666]={Type:Float32Array,size:16,setter:function(A,B){return function(t){A.uniform4fv(B,t)}}},E[5124]={Type:Int32Array,size:4,setter:w,arraySetter:C},E[35667]={Type:Int32Array,size:8,setter:a},E[35668]={Type:Int32Array,size:12,setter:I},E[35669]={Type:Int32Array,size:16,setter:Y},E[5125]={Type:Uint32Array,size:4,setter:function(A,B){return function(t){A.uniform1ui(B,t)}},arraySetter:function(A,B){return function(t){A.uniform1uiv(B,t)}}},E[36294]={Type:Uint32Array,size:8,setter:function(A,B){return function(t){A.uniform2uiv(B,t)}}},E[36295]={Type:Uint32Array,size:12,setter:function(A,B){return function(t){A.uniform3uiv(B,t)}}},E[36296]={Type:Uint32Array,size:16,setter:function(A,B){return function(t){A.uniform4uiv(B,t)}}},E[35670]={Type:Uint32Array,size:4,setter:w,arraySetter:C},E[35671]={Type:Uint32Array,size:8,setter:a},E[35672]={Type:Uint32Array,size:12,setter:I},E[35673]={Type:Uint32Array,size:16,setter:Y},E[35674]={Type:Float32Array,size:16,setter:function(A,B){return function(t){A.uniformMatrix2fv(B,!1,t)}}},E[35675]={Type:Float32Array,size:36,setter:function(A,B){return function(t){A.uniformMatrix3fv(B,!1,t)}}},E[35676]={Type:Float32Array,size:64,setter:function(A,B){return function(t){A.uniformMatrix4fv(B,!1,t)}}},E[35685]={Type:Float32Array,size:24,setter:function(A,B){return function(t){A.uniformMatrix2x3fv(B,!1,t)}}},E[35686]={Type:Float32Array,size:32,setter:function(A,B){return function(t){A.uniformMatrix2x4fv(B,!1,t)}}},E[35687]={Type:Float32Array,size:24,setter:function(A,B){return function(t){A.uniformMatrix3x2fv(B,!1,t)}}},E[35688]={Type:Float32Array,size:48,setter:function(A,B){return function(t){A.uniformMatrix3x4fv(B,!1,t)}}},E[35689]={Type:Float32Array,size:32,setter:function(A,B){return function(t){A.uniformMatrix4x2fv(B,!1,t)}}},E[35690]={Type:Float32Array,size:48,setter:function(A,B){return function(t){A.uniformMatrix4x3fv(B,!1,t)}}},E[35678]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:3553},E[35680]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:34067},E[35679]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:32879},E[35682]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:3553},E[36289]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:35866},E[36292]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:35866},E[36293]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:34067},E[36298]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:3553},E[36299]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:32879},E[36300]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:34067},E[36303]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:35866},E[36306]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:3553},E[36307]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:32879},E[36308]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:34067},E[36311]={Type:null,size:0,setter:h,arraySetter:M,bindPoint:35866};var l={};l[5126]={size:4,setter:F},l[35664]={size:8,setter:F},l[35665]={size:12,setter:F},l[35666]={size:16,setter:F},l[5124]={size:4,setter:D},l[35667]={size:8,setter:D},l[35668]={size:12,setter:D},l[35669]={size:16,setter:D},l[5125]={size:4,setter:D},l[36294]={size:8,setter:D},l[36295]={size:12,setter:D},l[36296]={size:16,setter:D},l[35670]={size:4,setter:D},l[35671]={size:8,setter:D},l[35672]={size:12,setter:D},l[35673]={size:16,setter:D},l[35674]={size:4,setter:u,count:2},l[35675]={size:9,setter:u,count:3},l[35676]={size:16,setter:u,count:4};var d=/^[ \t]*\n/;function U(A,B,t,e){var g=e||n,i=A.createShader(t),Q=0;if(d.test(B)&&(Q=1,B=B.replace(d,"")),A.shaderSource(i,B),A.compileShader(i),!A.getShaderParameter(i,A.COMPILE_STATUS)){var s=A.getShaderInfoLog(i);return g(function(A,B){return B=B||0,++B,A.split("\n").map((function(A,t){return t+B+": "+A})).join("\n")}(B,Q)+"\n*** Error compiling shader: "+s),A.deleteShader(i),null}return i}function N(A,B,t){var e;if("function"==typeof B&&(t=B,B=void 0),"function"==typeof A)t=A,A=void 0;else if(A&&!Array.isArray(A)){if(A.errorCallback)return A;var g=A;t=g.errorCallback,A=g.attribLocations,e=g.transformFeedbackVaryings}var i={errorCallback:t||n,transformFeedbackVaryings:e};if(A){var Q={};Array.isArray(A)?A.forEach((function(A,t){Q[A]=B?B[t]:t})):Q=A,i.attribLocations=Q}return i}var m=["VERTEX_SHADER","FRAGMENT_SHADER"];function G(A){return A.indexOf("frag")>=0?(void 0).FRAGMENT_SHADER:A.indexOf("vert")>=0?(void 0).VERTEX_SHADER:void 0}function f(A,B){B.forEach((function(B){A.deleteShader(B)}))}function H(A,B,t,e,g){for(var Q=N(t,e,g),s=[],n=[],r=0;r<B.length;++r){var E=B[r];if("string"==typeof E){var o=c(E),w=o?o.text:E,C=A[m[r]];o&&o.type&&(C=G(o.type)||C),E=U(A,w,C,Q.errorCallback),n.push(E)}i.isShader(A,E)&&s.push(E)}if(s.length!==B.length)return Q.errorCallback("not enough shaders for program"),f(A,n),null;var a=A.createProgram();s.forEach((function(B){A.attachShader(a,B)})),Q.attribLocations&&Object.keys(Q.attribLocations).forEach((function(B){A.bindAttribLocation(a,Q.attribLocations[B],B)}));var I=Q.transformFeedbackVaryings;if(I&&(I.attribs&&(I=I.attribs),Array.isArray(I)||(I=Object.keys(I)),A.transformFeedbackVaryings(a,I,Q.transformFeedbackMode||A.SEPARATE_ATTRIBS)),A.linkProgram(a),!A.getProgramParameter(a,A.LINK_STATUS)){var Y=A.getProgramInfoLog(a);return Q.errorCallback("Error in program linking:"+Y),A.deleteProgram(a),f(A,n),null}return a}function R(A,B,t,e){var g,i=c(B);if(!i)throw"*** Error: unknown script element"+B;g=i.text;var Q=t||G(i.type);if(!Q)throw"*** Error: unknown shader type";return U(A,g,Q,e)}function p(A,B,t,e,g){for(var i=N(t,e,g),Q=[],s=0;s<B.length;++s){var n=U(A,B[s],A[m[s]],i.errorCallback);if(!n)return null;Q.push(n)}return H(A,Q,i)}function y(A){var B=A.name;return B.startsWith("gl_")||B.startsWith("webgl_")}function J(A,B){var t=0;function e(B,e){var g,i=A.getUniformLocation(B,e.name),Q=e.size>1&&"[0]"===e.name.substr(-3),s=e.type,n=E[s];if(!n)throw"unknown type: 0x"+s.toString(16);if(n.bindPoint){var r=t;t+=e.size,g=Q?n.arraySetter(A,s,r,i,e.size):n.setter(A,s,r,i,e.size)}else g=n.arraySetter&&Q?n.arraySetter(A,i):n.setter(A,i);return g.location=i,g}for(var g={},i=A.getProgramParameter(B,A.ACTIVE_UNIFORMS),Q=0;Q<i;++Q){var s=A.getActiveUniform(B,Q);if(!y(s)){var n=s.name;"[0]"===n.substr(-3)&&(n=n.substr(0,n.length-3));var r=e(B,s);g[n]=r}}return g}function k(A,B){for(var t={},e=A.getProgramParameter(B,A.TRANSFORM_FEEDBACK_VARYINGS),g=0;g<e;++g){var i=A.getTransformFeedbackVarying(B,g);t[i.name]={index:g,type:i.type,size:i.size}}return t}function T(A,B,t){for(var e in B.transformFeedbackInfo&&(B=B.transformFeedbackInfo),t.attribs&&(t=t.attribs),t){var g=B[e];if(g){var i=t[e];i.offset?A.bindBufferRange(A.TRANSFORM_FEEDBACK_BUFFER,g.index,i.buffer,i.offset,i.size):A.bindBufferBase(A.TRANSFORM_FEEDBACK_BUFFER,g.index,i.buffer)}}}function j(A,B){for(var t=A.getProgramParameter(B,A.ACTIVE_UNIFORMS),e=[],g=[],i=0;i<t;++i){g.push(i),e.push({});var Q=A.getActiveUniform(B,i);if(y(Q))break;e[i].name=Q.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach((function(t){var i=t[0],Q=t[1];A.getActiveUniforms(B,g,A[i]).forEach((function(A,B){e[B][Q]=A}))}));for(var s={},n=A.getProgramParameter(B,A.ACTIVE_UNIFORM_BLOCKS),r=0;r<n;++r){var c=A.getActiveUniformBlockName(B,r),E={index:r,usedByVertexShader:A.getActiveUniformBlockParameter(B,r,A.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),usedByFragmentShader:A.getActiveUniformBlockParameter(B,r,A.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),size:A.getActiveUniformBlockParameter(B,r,A.UNIFORM_BLOCK_DATA_SIZE),uniformIndices:A.getActiveUniformBlockParameter(B,r,A.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES)};E.used=E.usedByVertexSahder||E.usedByFragmentShader,s[c]=E}return{blockSpecs:s,uniformData:e}}var x=/\[\d+\]\.$/;function S(A,B,t,e){var g=t.blockSpecs,i=t.uniformData,Q=g[e];if(!Q)return r("no uniform block object named:",e),{name:e,uniforms:{}};var s=new ArrayBuffer(Q.size),n=A.createBuffer(),c=Q.index;A.bindBuffer(A.UNIFORM_BUFFER,n),A.uniformBlockBinding(B,Q.index,c);var o=e+".";x.test(o)&&(o=o.replace(x,"."));var w={};return Q.uniformIndices.forEach((function(A){var B=i[A],t=E[B.type],e=t.Type,g=B.size*t.size,Q=B.name;Q.substr(0,o.length)===o&&(Q=Q.substr(o.length)),w[Q]=new e(s,B.offset,g/e.BYTES_PER_ELEMENT)})),{name:e,array:s,asFloat:new Float32Array(s),buffer:n,uniforms:w}}function b(A,B,t){var e=(B.uniformBlockSpec||B).blockSpecs[t.name];if(e){var g=e.index;return A.bindBufferRange(A.UNIFORM_BUFFER,g,t.buffer,t.offset||0,t.array.byteLength),!0}return!1}function z(A,B){for(var t={},e=A.getProgramParameter(B,A.ACTIVE_ATTRIBUTES),g=0;g<e;++g){var i=A.getActiveAttrib(B,g);if(!y(i)){var Q=A.getAttribLocation(B,i.name),s=l[i.type],n=s.setter(A,Q,s);n.location=Q,t[i.name]=n}}return t}function L(A,B){for(var t in B){var e=A[t];e&&e(B[t])}}function P(A,B){var t={program:B,uniformSetters:J(A,B),attribSetters:z(A,B)};return g.isWebGL2(A)&&(t.uniformBlockSpec=j(A,B),t.transformFeedbackInfo=k(A,B)),t}},function(A,B,t){"use strict";B.__esModule=!0,B.axisRotate=function(A,B,t,e){e=e||new g(16);var i=B[0],Q=B[1],s=B[2],n=Math.sqrt(i*i+Q*Q+s*s),r=(i/=n)*i,c=(Q/=n)*Q,E=(s/=n)*s,o=Math.cos(t),w=Math.sin(t),C=1-o,a=r+(1-r)*o,I=i*Q*C+s*w,Y=i*s*C-Q*w,h=i*Q*C-s*w,M=c+(1-c)*o,F=Q*s*C+i*w,D=i*s*C+Q*w,u=Q*s*C-i*w,l=E+(1-E)*o,d=A[0],U=A[1],N=A[2],m=A[3],G=A[4],f=A[5],H=A[6],R=A[7],p=A[8],y=A[9],J=A[10],k=A[11];return e[0]=a*d+I*G+Y*p,e[1]=a*U+I*f+Y*y,e[2]=a*N+I*H+Y*J,e[3]=a*m+I*R+Y*k,e[4]=h*d+M*G+F*p,e[5]=h*U+M*f+F*y,e[6]=h*N+M*H+F*J,e[7]=h*m+M*R+F*k,e[8]=D*d+u*G+l*p,e[9]=D*U+u*f+l*y,e[10]=D*N+u*H+l*J,e[11]=D*m+u*R+l*k,A!==e&&(e[12]=A[12],e[13]=A[13],e[14]=A[14],e[15]=A[15]),e},B.axisRotation=function(A,B,t){t=t||new g(16);var e=A[0],i=A[1],Q=A[2],s=Math.sqrt(e*e+i*i+Q*Q),n=(e/=s)*e,r=(i/=s)*i,c=(Q/=s)*Q,E=Math.cos(B),o=Math.sin(B),w=1-E;return t[0]=n+(1-n)*E,t[1]=e*i*w+Q*o,t[2]=e*Q*w-i*o,t[3]=0,t[4]=e*i*w-Q*o,t[5]=r+(1-r)*E,t[6]=i*Q*w+e*o,t[7]=0,t[8]=e*Q*w+i*o,t[9]=i*Q*w-e*o,t[10]=c+(1-c)*E,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},B.copy=n,B.frustum=function(A,B,t,e,i,Q,s){s=s||new g(16);var n=B-A,r=e-t,c=i-Q;return s[0]=2*i/n,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/r,s[6]=0,s[7]=0,s[8]=(A+B)/n,s[9]=(e+t)/r,s[10]=Q/c,s[11]=-1,s[12]=0,s[13]=0,s[14]=i*Q/c,s[15]=0,s},B.getAxis=function(A,B,t){t=t||e.create();var g=4*B;return t[0]=A[g+0],t[1]=A[g+1],t[2]=A[g+2],t},B.getTranslation=function(A,B){return(B=B||e.create())[0]=A[12],B[1]=A[13],B[2]=A[14],B},B.identity=r,B.inverse=c,B.lookAt=function(A,B,t,n){n=n||new g(16);var r=i,c=Q,E=s;return e.normalize(e.subtract(A,B,E),E),e.normalize(e.cross(t,E,r),r),e.normalize(e.cross(E,r,c),c),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=0,n[4]=c[0],n[5]=c[1],n[6]=c[2],n[7]=0,n[8]=E[0],n[9]=E[1],n[10]=E[2],n[11]=0,n[12]=A[0],n[13]=A[1],n[14]=A[2],n[15]=1,n},B.multiply=function(A,B,t){t=t||new g(16);var e=A[0],i=A[1],Q=A[2],s=A[3],n=A[4],r=A[5],c=A[6],E=A[7],o=A[8],w=A[9],C=A[10],a=A[11],I=A[12],Y=A[13],h=A[14],M=A[15],F=B[0],D=B[1],u=B[2],l=B[3],d=B[4],U=B[5],N=B[6],m=B[7],G=B[8],f=B[9],H=B[10],R=B[11],p=B[12],y=B[13],J=B[14],k=B[15];return t[0]=e*F+n*D+o*u+I*l,t[1]=i*F+r*D+w*u+Y*l,t[2]=Q*F+c*D+C*u+h*l,t[3]=s*F+E*D+a*u+M*l,t[4]=e*d+n*U+o*N+I*m,t[5]=i*d+r*U+w*N+Y*m,t[6]=Q*d+c*U+C*N+h*m,t[7]=s*d+E*U+a*N+M*m,t[8]=e*G+n*f+o*H+I*R,t[9]=i*G+r*f+w*H+Y*R,t[10]=Q*G+c*f+C*H+h*R,t[11]=s*G+E*f+a*H+M*R,t[12]=e*p+n*y+o*J+I*k,t[13]=i*p+r*y+w*J+Y*k,t[14]=Q*p+c*y+C*J+h*k,t[15]=s*p+E*y+a*J+M*k,t},B.negate=function(A,B){return(B=B||new g(16))[0]=-A[0],B[1]=-A[1],B[2]=-A[2],B[3]=-A[3],B[4]=-A[4],B[5]=-A[5],B[6]=-A[6],B[7]=-A[7],B[8]=-A[8],B[9]=-A[9],B[10]=-A[10],B[11]=-A[11],B[12]=-A[12],B[13]=-A[13],B[14]=-A[14],B[15]=-A[15],B},B.ortho=function(A,B,t,e,i,Q,s){return(s=s||new g(16))[0]=2/(B-A),s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2/(e-t),s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=2/(i-Q),s[11]=0,s[12]=(B+A)/(A-B),s[13]=(e+t)/(t-e),s[14]=(Q+i)/(i-Q),s[15]=1,s},B.perspective=function(A,B,t,e,i){i=i||new g(16);var Q=Math.tan(.5*Math.PI-.5*A),s=1/(t-e);return i[0]=Q/B,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=Q,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=(t+e)*s,i[11]=-1,i[12]=0,i[13]=0,i[14]=t*e*s*2,i[15]=0,i},B.rotateX=function(A,B,t){t=t||new g(16);var e=A[4],i=A[5],Q=A[6],s=A[7],n=A[8],r=A[9],c=A[10],E=A[11],o=Math.cos(B),w=Math.sin(B);return t[4]=o*e+w*n,t[5]=o*i+w*r,t[6]=o*Q+w*c,t[7]=o*s+w*E,t[8]=o*n-w*e,t[9]=o*r-w*i,t[10]=o*c-w*Q,t[11]=o*E-w*s,A!==t&&(t[0]=A[0],t[1]=A[1],t[2]=A[2],t[3]=A[3],t[12]=A[12],t[13]=A[13],t[14]=A[14],t[15]=A[15]),t},B.rotateY=function(A,B,t){t=t||new g(16);var e=A[0],i=A[1],Q=A[2],s=A[3],n=A[8],r=A[9],c=A[10],E=A[11],o=Math.cos(B),w=Math.sin(B);return t[0]=o*e-w*n,t[1]=o*i-w*r,t[2]=o*Q-w*c,t[3]=o*s-w*E,t[8]=o*n+w*e,t[9]=o*r+w*i,t[10]=o*c+w*Q,t[11]=o*E+w*s,A!==t&&(t[4]=A[4],t[5]=A[5],t[6]=A[6],t[7]=A[7],t[12]=A[12],t[13]=A[13],t[14]=A[14],t[15]=A[15]),t},B.rotateZ=function(A,B,t){t=t||new g(16);var e=A[0],i=A[1],Q=A[2],s=A[3],n=A[4],r=A[5],c=A[6],E=A[7],o=Math.cos(B),w=Math.sin(B);return t[0]=o*e+w*n,t[1]=o*i+w*r,t[2]=o*Q+w*c,t[3]=o*s+w*E,t[4]=o*n-w*e,t[5]=o*r-w*i,t[6]=o*c-w*Q,t[7]=o*E-w*s,A!==t&&(t[8]=A[8],t[9]=A[9],t[10]=A[10],t[11]=A[11],t[12]=A[12],t[13]=A[13],t[14]=A[14],t[15]=A[15]),t},B.rotationX=function(A,B){B=B||new g(16);var t=Math.cos(A),e=Math.sin(A);return B[0]=1,B[1]=0,B[2]=0,B[3]=0,B[4]=0,B[5]=t,B[6]=e,B[7]=0,B[8]=0,B[9]=-e,B[10]=t,B[11]=0,B[12]=0,B[13]=0,B[14]=0,B[15]=1,B},B.rotationY=function(A,B){B=B||new g(16);var t=Math.cos(A),e=Math.sin(A);return B[0]=t,B[1]=0,B[2]=-e,B[3]=0,B[4]=0,B[5]=1,B[6]=0,B[7]=0,B[8]=e,B[9]=0,B[10]=t,B[11]=0,B[12]=0,B[13]=0,B[14]=0,B[15]=1,B},B.rotationZ=function(A,B){B=B||new g(16);var t=Math.cos(A),e=Math.sin(A);return B[0]=t,B[1]=e,B[2]=0,B[3]=0,B[4]=-e,B[5]=t,B[6]=0,B[7]=0,B[8]=0,B[9]=0,B[10]=1,B[11]=0,B[12]=0,B[13]=0,B[14]=0,B[15]=1,B},B.scale=function(A,B,t){t=t||new g(16);var e=B[0],i=B[1],Q=B[2];return t[0]=e*A[0],t[1]=e*A[1],t[2]=e*A[2],t[3]=e*A[3],t[4]=i*A[4],t[5]=i*A[5],t[6]=i*A[6],t[7]=i*A[7],t[8]=Q*A[8],t[9]=Q*A[9],t[10]=Q*A[10],t[11]=Q*A[11],A!==t&&(t[12]=A[12],t[13]=A[13],t[14]=A[14],t[15]=A[15]),t},B.scaling=function(A,B){return(B=B||new g(16))[0]=A[0],B[1]=0,B[2]=0,B[3]=0,B[4]=0,B[5]=A[1],B[6]=0,B[7]=0,B[8]=0,B[9]=0,B[10]=A[2],B[11]=0,B[12]=0,B[13]=0,B[14]=0,B[15]=1,B},B.setAxis=function(A,B,t,e){e!==A&&(e=n(A,e));var g=4*t;return e[g+0]=B[0],e[g+1]=B[1],e[g+2]=B[2],e},B.setDefaultType=function(A){var B=g;return g=A,B},B.setTranslation=function(A,B,t){return t=t||r(),A!==t&&(t[0]=A[0],t[1]=A[1],t[2]=A[2],t[3]=A[3],t[4]=A[4],t[5]=A[5],t[6]=A[6],t[7]=A[7],t[8]=A[8],t[9]=A[9],t[10]=A[10],t[11]=A[11]),t[12]=B[0],t[13]=B[1],t[14]=B[2],t[15]=1,t},B.transformDirection=function(A,B,t){t=t||e.create();var g=B[0],i=B[1],Q=B[2];return t[0]=g*A[0]+i*A[4]+Q*A[8],t[1]=g*A[1]+i*A[5]+Q*A[9],t[2]=g*A[2]+i*A[6]+Q*A[10],t},B.transformNormal=function(A,B,t){t=t||e.create();var g=c(A),i=B[0],Q=B[1],s=B[2];return t[0]=i*g[0]+Q*g[1]+s*g[2],t[1]=i*g[4]+Q*g[5]+s*g[6],t[2]=i*g[8]+Q*g[9]+s*g[10],t},B.transformPoint=function(A,B,t){t=t||e.create();var g=B[0],i=B[1],Q=B[2],s=g*A[3]+i*A[7]+Q*A[11]+A[15];return t[0]=(g*A[0]+i*A[4]+Q*A[8]+A[12])/s,t[1]=(g*A[1]+i*A[5]+Q*A[9]+A[13])/s,t[2]=(g*A[2]+i*A[6]+Q*A[10]+A[14])/s,t},B.translate=function(A,B,t){t=t||new g(16);var e=B[0],i=B[1],Q=B[2],s=A[0],n=A[1],r=A[2],c=A[3],E=A[4],o=A[5],w=A[6],C=A[7],a=A[8],I=A[9],Y=A[10],h=A[11],M=A[12],F=A[13],D=A[14],u=A[15];return A!==t&&(t[0]=s,t[1]=n,t[2]=r,t[3]=c,t[4]=E,t[5]=o,t[6]=w,t[7]=C,t[8]=a,t[9]=I,t[10]=Y,t[11]=h),t[12]=s*e+E*i+a*Q+M,t[13]=n*e+o*i+I*Q+F,t[14]=r*e+w*i+Y*Q+D,t[15]=c*e+C*i+h*Q+u,t},B.translation=function(A,B){return(B=B||new g(16))[0]=1,B[1]=0,B[2]=0,B[3]=0,B[4]=0,B[5]=1,B[6]=0,B[7]=0,B[8]=0,B[9]=0,B[10]=1,B[11]=0,B[12]=A[0],B[13]=A[1],B[14]=A[2],B[15]=1,B},B.transpose=function(A,B){var t;if((B=B||new g(16))===A)return t=A[1],A[1]=A[4],A[4]=t,t=A[2],A[2]=A[8],A[8]=t,t=A[3],A[3]=A[12],A[12]=t,t=A[6],A[6]=A[9],A[9]=t,t=A[7],A[7]=A[13],A[13]=t,t=A[11],A[11]=A[14],A[14]=t,B;var e=A[0],i=A[1],Q=A[2],s=A[3],n=A[4],r=A[5],c=A[6],E=A[7],o=A[8],w=A[9],C=A[10],a=A[11],I=A[12],Y=A[13],h=A[14],M=A[15];return B[0]=e,B[1]=n,B[2]=o,B[3]=I,B[4]=i,B[5]=r,B[6]=w,B[7]=Y,B[8]=Q,B[9]=c,B[10]=C,B[11]=h,B[12]=s,B[13]=E,B[14]=a,B[15]=M,B};var e=function(A){if(A&&A.__esModule)return A;var B={};if(null!=A)for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)){var e=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,t):{};e.get||e.set?Object.defineProperty(B,t,e):B[t]=A[t]}return B.default=A,B}(t(3)),g=Float32Array,i=e.create(),Q=e.create(),s=e.create();function n(A,B){return(B=B||new g(16))[0]=A[0],B[1]=A[1],B[2]=A[2],B[3]=A[3],B[4]=A[4],B[5]=A[5],B[6]=A[6],B[7]=A[7],B[8]=A[8],B[9]=A[9],B[10]=A[10],B[11]=A[11],B[12]=A[12],B[13]=A[13],B[14]=A[14],B[15]=A[15],B}function r(A){return(A=A||new g(16))[0]=1,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=1,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function c(A,B){B=B||new g(16);var t=A[0],e=A[1],i=A[2],Q=A[3],s=A[4],n=A[5],r=A[6],c=A[7],E=A[8],o=A[9],w=A[10],C=A[11],a=A[12],I=A[13],Y=A[14],h=A[15],M=w*h,F=Y*C,D=r*h,u=Y*c,l=r*C,d=w*c,U=i*h,N=Y*Q,m=i*C,G=w*Q,f=i*c,H=r*Q,R=E*I,p=a*o,y=s*I,J=a*n,k=s*o,T=E*n,j=t*I,x=a*e,S=t*o,b=E*e,z=t*n,L=s*e,P=M*n+u*o+l*I-(F*n+D*o+d*I),v=F*e+U*o+G*I-(M*e+N*o+m*I),W=D*e+N*n+f*I-(u*e+U*n+H*I),V=d*e+m*n+H*o-(l*e+G*n+f*o),K=1/(t*P+s*v+E*W+a*V);return B[0]=K*P,B[1]=K*v,B[2]=K*W,B[3]=K*V,B[4]=K*(F*s+D*E+d*a-(M*s+u*E+l*a)),B[5]=K*(M*t+N*E+m*a-(F*t+U*E+G*a)),B[6]=K*(u*t+U*s+H*a-(D*t+N*s+f*a)),B[7]=K*(l*t+G*s+f*E-(d*t+m*s+H*E)),B[8]=K*(R*c+J*C+k*h-(p*c+y*C+T*h)),B[9]=K*(p*Q+j*C+b*h-(R*Q+x*C+S*h)),B[10]=K*(y*Q+x*c+z*h-(J*Q+j*c+L*h)),B[11]=K*(T*Q+S*c+L*C-(k*Q+b*c+z*C)),B[12]=K*(y*w+T*Y+p*r-(k*Y+R*r+J*w)),B[13]=K*(S*Y+R*i+x*w-(j*w+b*Y+p*i)),B[14]=K*(j*r+L*Y+J*i-(z*Y+y*i+x*r)),B[15]=K*(z*w+k*i+b*r-(S*r+L*w+T*i)),B}},function(A,B,t){"use strict";B.__esModule=!0,B.createAttribsFromArrays=I,B.createBuffersFromArrays=function(A,B){var t={};return Object.keys(B).forEach((function(e){t[e]=h(A,B[e],e)})),B.indices?(t.numElements=B.indices.length,t.elementType=e.getGLTypeForTypedArray(a(B.indices),"indices")):t.numElements=function(A){for(var B,t=0;t<Y.length&&!((B=Y[t])in A);++t);ii===Y.length&&(B=Object.keys(A)[0]);var e=A[B],g=c(e).length,i=C(e,B),Q=g/i;if(g%i>0)throw"numComponents "+i+" not correct for length "+g;return Q}(B),t},B.createBufferFromArray=h,B.createBufferFromTypedArray=n,B.createBufferInfoFromArrays=function(A,B){var t={attribs:I(A,B)},g=B.indices;if(g){var i=a(g,"indices");t.indices=n(A,i,A.ELEMENT_ARRAY_BUFFER),t.numElements=i.length,t.elementType=e.getGLTypeForTypedArray(i)}else t.numElements=function(A,B){var t,e;for(e=0;e<Y.length&&!((t=Y[e])in B)&&!((t=Q.attribPrefix+t)in B);++e);e===Y.length&&(t=Object.keys(B)[0]);var g=B[t];A.bindBuffer(A.ARRAY_BUFFER,g.buffer);var i=A.getBufferParameter(A.ARRAY_BUFFER,A.BUFFER_SIZE);A.bindBuffer(A.ARRAY_BUFFER,null);var s=function(A,B){return B===A.BYTE||B===A.UNSIGNED_BYTE?1:B===A.SHORT||B===A.UNSIGNED_SHORT?2:B===A.INT||B===A.UNSIGNED_INT||B===A.FLOAT?4:0}(A,g.type),n=i/s,r=g.numComponents||g.size,c=n/r;if(c%1!=0)throw"numComponents "+r+" not correct for length "+length;return c}(A,t.attribs);return t},B.setAttribInfoBufferFromArray=function(A,B,t,e){t=a(t),void 0!==e?(A.bindBuffer(A.ARRAY_BUFFER,B.buffer),A.bufferSubData(A.ARRAY_BUFFER,e,t)):s(A,A.ARRAY_BUFFER,B.buffer,t,B.drawType)},B.setAttributePrefix=function(A){Q.attribPrefix=A},B.setAttributeDefaults_=function(A){g.copyExistingProperties(A,Q)},B.getNumComponents_=C,B.getArray_=c;var e=i(t(1)),g=i(t(0));function i(A){if(A&&A.__esModule)return A;var B={};if(null!=A)for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)){var e=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,t):{};e.get||e.set?Object.defineProperty(B,t,e):B[t]=A[t]}return B.default=A,B}var Q={attribPrefix:""};function s(A,B,t,e,g){A.bindBuffer(B,t),A.bufferData(B,e,g||A.STATIC_DRAW)}function n(A,B,t,e){if(g.isBuffer(A,B))return B;t=t||A.ARRAY_BUFFER;var i=A.createBuffer();return s(A,t,i,B,e),i}function r(A){return"indices"===A}function c(A){return A.length?A:A.data}var E=/coord|texture/i,o=/color|colour/i;function w(A,B){var t;if(B%(t=E.test(A)?2:o.test(A)?4:3)>0)throw"Can not guess numComponents for attribute '"+A+"'. Tried "+t+" but "+B+" values is not evenly divisible by "+t+". You should specify it.";return t}function C(A,B){return A.numComponents||A.size||w(B,c(A).length)}function a(A,B){if(e.isArrayBuffer(A))return A;if(e.isArrayBuffer(A.data))return A.data;Array.isArray(A)&&(A={data:A});var t=A.type;return t||(t=r(B)?Uint16Array:Float32Array),new t(A.data)}function I(A,B){var t={};return Object.keys(B).forEach((function(g){if(!r(g)){var i,s,c,E,o,I=B[g],Y=I.attrib||I.name||I.attribName||Q.attribPrefix+g;if("number"==typeof I||"number"==typeof I.data){o=I.data||I;var h=I.type||Float32Array,M=o*h.BYTES_PER_ELEMENT;s=e.getGLTypeForTypedArrayType(h),c=void 0!==I.normalize?I.normalize:(D=h)===Int8Array||D===Uint8Array,E=I.numComponents||I.size||w(g,o),i=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,i),A.bufferData(A.ARRAY_BUFFER,M,I.drawType||A.STATIC_DRAW)}else{var F=a(I,g);i=n(A,F,void 0,I.drawType),s=e.getGLTypeForTypedArray(F),c=void 0!==I.normalize?I.normalize:function(A){return A instanceof Int8Array||A instanceof Uint8Array}(F),E=C(I,g),o=F.length}t[Y]={buffer:i,numComponents:E,type:s,normalize:c,stride:I.stride||0,offset:I.offset||0,divisor:void 0===I.divisor?void 0:I.divisor,drawType:I.drawType}}var D})),A.bindBuffer(A.ARRAY_BUFFER,null),t}var Y=["position","positions","a_position"];function h(A,B,t){var e="indices"===t?A.ELEMENT_ARRAY_BUFFER:A.ARRAY_BUFFER;return n(A,a(B,t),e)}},function(A,B,t){"use strict";B.__esModule=!0,B.setTextureDefaults_=function(A){Q.copyExistingProperties(A,r),A.textureColor&&l(A.textureColor)},B.createSampler=p,B.createSamplers=function(A,B){var t={};return Object.keys(B).forEach((function(e){t[e]=p(A,B[e])})),t},B.setSamplerParameters=R,B.createTexture=K,B.setEmptyTexture=V,B.setTextureFromArray=W,B.loadTextureFromUrl=L,B.setTextureFromElement=j,B.setTextureFilteringForSize=y,B.setTextureParameters=H,B.setDefaultTextureColor=l,B.createTextures=function(A,B,t){t=t||x;var e=0,g=[],i={},Q={};function s(){0===e&&setTimeout((function(){t(g.length?g:void 0,i,Q)}),0)}return Object.keys(B).forEach((function(t){var n,r,c=B[t];("string"==typeof(r=c.src)||Array.isArray(r)&&"string"==typeof r[0])&&(n=function(A,B,i){Q[t]=i,--e,A&&g.push(A),s()},++e),i[t]=K(A,c,n)})),s(),i},B.resizeTexture=function(A,B,t,e,g){e=e||t.width,g=g||t.height;var i=t.target||A.TEXTURE_2D;A.bindTexture(i,B);var Q,s=t.level||0,n=t.internalFormat||t.format||A.RGBA,r=M(n),E=t.format||r.format,o=t.src;if(Q=o&&(c(o)||Array.isArray(o)&&"number"==typeof o[0])?t.type||D(A,o,r.type):t.type||r.type,i===A.TEXTURE_CUBE_MAP)for(var w=0;w<6;++w)A.texImage2D(A.TEXTURE_CUBE_MAP_POSITIVE_X+w,s,n,e,g,0,E,Q,null);else A.texImage2D(i,s,n,e,g,0,E,Q,null)},B.getNumComponentsForFormat=function(A){var B=C[A];if(!B)throw"unknown format: "+A;return B.numColorComponents},B.getBytesPerElementForInternalFormat=h;var e,g=n(t(4)),i=n(t(1)),Q=n(t(0)),s=(e=t(2))&&e.__esModule?e:{default:e};function n(A){if(A&&A.__esModule)return A;var B={};if(null!=A)for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)){var e=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,t):{};e.get||e.set?Object.defineProperty(B,t,e):B[t]=A[t]}return B.default=A,B}var r={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},c=i.isArrayBuffer,E=s.default.document&&s.default.document.createElement?s.default.document.createElement("canvas").getContext("2d"):null,o=6407,w=33319,C={},a=C;a[6406]={numColorComponents:1},a[6409]={numColorComponents:1},a[6410]={numColorComponents:2},a[o]={numColorComponents:3},a[6408]={numColorComponents:4},a[6403]={numColorComponents:1},a[36244]={numColorComponents:1},a[w]={numColorComponents:2},a[33320]={numColorComponents:2},a[o]={numColorComponents:3},a[36248]={numColorComponents:3},a[6408]={numColorComponents:4},a[36249]={numColorComponents:4},a[6402]={numColorComponents:1},a[34041]={numColorComponents:2};var I={},Y=I;function h(A,B){var t=I[A];if(!t)throw"unknown internal format";var e=t.bytesPerElementMap[B];if(void 0===e)throw"unknown internal format";return e}function M(A){var B=I[A];if(!B)throw"unknown internal format";return{format:B.textureFormat,type:Array.isArray(B.type)?B.type[0]:B.type}}function F(A){return 0==(A&A-1)}function D(A,B,t){return c(B)?i.getGLTypeForTypedArray(B):t||A.UNSIGNED_BYTE}function u(A,B,t,e,g){if(g%1!=0)throw"can't guess dimensions";if(t||e){if(e){if(!t&&(t=g/e)%1)throw"can't guess dimensions"}else if((e=g/t)%1)throw"can't guess dimensions"}else{var i=Math.sqrt(g/(B===A.TEXTURE_CUBE_MAP?6:1));i%1==0?(t=i,e=i):(t=g,e=1)}return{width:t,height:e}}function l(A){r.textureColor=new Uint8Array([255*A[0],255*A[1],255*A[2],255*A[3]])}Y[6406]={textureFormat:6406,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[5121,5131,36193,5126]},Y[6409]={textureFormat:6409,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[5121,5131,36193,5126]},Y[6410]={textureFormat:6410,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[5121,5131,36193,5126]},Y[o]={textureFormat:o,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[5121,5131,36193,5126,33635]},Y[6408]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[5121,5131,36193,5126,32819,32820]},Y[33321]={textureFormat:6403,colorRenderable:!0,textureFilterable:!0,bytesPerElement:1,type:5121},Y[36756]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:1,type:5120},Y[33325]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[5126,5131]},Y[33326]={textureFormat:6403,colorRenderable:!1,textureFilterable:!1,bytesPerElement:4,type:5126},Y[33330]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:5121},Y[33329]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:5120},Y[33332]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5123},Y[33331]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5122},Y[33334]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5125},Y[33333]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5124},Y[33323]={textureFormat:w,colorRenderable:!0,textureFilterable:!0,bytesPerElement:2,type:5121},Y[36757]={textureFormat:w,colorRenderable:!1,textureFilterable:!0,bytesPerElement:2,type:5120},Y[33327]={textureFormat:w,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[5126,5131]},Y[33328]={textureFormat:w,colorRenderable:!1,textureFilterable:!1,bytesPerElement:8,type:5126},Y[33336]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5121},Y[33335]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5120},Y[33338]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5123},Y[33337]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5122},Y[33340]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5125},Y[33339]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5124},Y[32849]={textureFormat:o,colorRenderable:!0,textureFilterable:!0,bytesPerElement:3,type:5121},Y[35905]={textureFormat:o,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:5121},Y[36194]={textureFormat:o,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[5121,33635]},Y[36758]={textureFormat:o,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:5120},Y[35898]={textureFormat:o,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[5126,5131,35899]},Y[35901]={textureFormat:o,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[5126,5131,35902]},Y[34843]={textureFormat:o,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[5126,5131]},Y[34837]={textureFormat:o,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5126},Y[36221]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:5121},Y[36239]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:5120},Y[36215]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:5123},Y[36233]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:5122},Y[36209]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5125},Y[36227]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5124},Y[32856]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:5121},Y[35907]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:5121},Y[36759]={textureFormat:6408,colorRenderable:!1,textureFilterable:!0,bytesPerElement:4,type:5120},Y[32855]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[5121,32820,33640]},Y[32854]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[5121,32819]},Y[32857]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:33640},Y[34842]={textureFormat:6408,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[5126,5131]},Y[34836]={textureFormat:6408,colorRenderable:!1,textureFilterable:!1,bytesPerElement:16,type:5126},Y[36220]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5121},Y[36238]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5120},Y[36975]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:33640},Y[36214]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5123},Y[36232]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5122},Y[36226]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:5124},Y[36208]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:5125},Y[33189]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[5123,5125]},Y[33190]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5125},Y[36012]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5126},Y[35056]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:34042},Y[36013]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:36269},Object.keys(Y).forEach((function(A){var B=Y[A];if(B.bytesPerElementMap={},Array.isArray(B.bytesPerElement))B.bytesPerElement.forEach((function(A,t){var e=B.type[t];B.bytesPerElementMap[e]=A}));else{var t=B.type;B.bytesPerElementMap[t]=B.bytesPerElement}}));var d={};function U(A,B){void 0!==B.colorspaceConversion&&(d.colorspaceConversion=A.getParameter(A.UNPACK_COLORSPACE_CONVERSION_WEBGL),A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,B.colorspaceConversion)),void 0!==B.premultiplyAlpha&&(d.premultiplyAlpha=A.getParameter(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL),A.pixelStorei(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha)),void 0!==B.flipY&&(d.flipY=A.getParameter(A.UNPACK_FLIP_Y_WEBGL),A.pixelStorei(A.UNPACK_FLIP_Y_WEBGL,B.flipY))}function N(A,B){void 0!==B.colorspaceConversion&&A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,d.colorspaceConversion),void 0!==B.premultiplyAlpha&&A.pixelStorei(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d.premultiplyAlpha),void 0!==B.flipY&&A.pixelStorei(A.UNPACK_FLIP_Y_WEBGL,d.flipY)}function m(A){d.unpackAlignment=A.getParameter(A.UNPACK_ALIGNMENT),g.isWebGL2(A)&&(d.unpackRowLength=A.getParameter(A.UNPACK_ROW_LENGTH),d.unpackImageHeight=A.getParameter(A.UNPACK_IMAGE_HEIGHT),d.unpackSkipPixels=A.getParameter(A.UNPACK_SKIP_PIXELS),d.unpackSkipRows=A.getParameter(A.UNPACK_SKIP_ROWS),d.unpackSkipImages=A.getParameter(A.UNPACK_SKIP_IMAGES))}function G(A){A.pixelStorei(A.UNPACK_ALIGNMENT,d.unpackAlignment),g.isWebGL2(A)&&(A.pixelStorei(A.UNPACK_ROW_LENGTH,d.unpackRowLength),A.pixelStorei(A.UNPACK_IMAGE_HEIGHT,d.unpackImageHeight),A.pixelStorei(A.UNPACK_SKIP_PIXELS,d.unpackSkipPixels),A.pixelStorei(A.UNPACK_SKIP_ROWS,d.unpackSkipRows),A.pixelStorei(A.UNPACK_SKIP_IMAGES,d.unpackSkipImages))}function f(A,B,t,e){e.minMag&&(t.call(A,B,A.TEXTURE_MIN_FILTER,e.minMag),t.call(A,B,A.TEXTURE_MAG_FILTER,e.minMag)),e.min&&t.call(A,B,A.TEXTURE_MIN_FILTER,e.min),e.mag&&t.call(A,B,A.TEXTURE_MAG_FILTER,e.mag),e.wrap&&(t.call(A,B,A.TEXTURE_WRAP_S,e.wrap),t.call(A,B,A.TEXTURE_WRAP_T,e.wrap),(B===A.TEXTURE_3D||Q.isSampler(A,B))&&t.call(A,B,A.TEXTURE_WRAP_R,e.wrap)),e.wrapR&&t.call(A,B,A.TEXTURE_WRAP_R,e.wrapR),e.wrapS&&t.call(A,B,A.TEXTURE_WRAP_S,e.wrapS),e.wrapT&&t.call(A,B,A.TEXTURE_WRAP_T,e.wrapT),e.minLod&&t.call(A,B,A.TEXTURE_MIN_LOD,e.minLod),e.maxLod&&t.call(A,B,A.TEXTURE_MAX_LOD,e.maxLod),e.baseLevel&&t.call(A,B,A.TEXTURE_BASE_LEVEL,e.baseLevel),e.maxLevel&&t.call(A,B,A.TEXTURE_MAX_LEVEL,e.maxLevel)}function H(A,B,t){var e=t.target||A.TEXTURE_2D;A.bindTexture(e,B),f(A,e,A.texParameteri,t)}function R(A,B,t){f(A,B,A.samplerParameteri,t)}function p(A,B){var t=A.createSampler();return R(A,t,B),t}function y(A,B,t,e,i,Q,s){t=t||r.textureOptions,Q=Q||A.RGBA,s=s||A.UNSIGNED_BYTE;var n=t.target||A.TEXTURE_2D;if(e=e||t.width,i=i||t.height,A.bindTexture(n,B),function(A,B,t,e){if(!g.isWebGL2(A))return F(B)&&F(t);var i=I[e];if(!i)throw"unknown internal format";return i.colorRenderable&&i.textureFilterable}(A,e,i,Q))A.generateMipmap(n);else{var c=function(A){var B=I[A];if(!B)throw"unknown internal format";return B.textureFilterable}(Q)?A.LINEAR:A.NEAREST;A.texParameteri(n,A.TEXTURE_MIN_FILTER,c),A.texParameteri(n,A.TEXTURE_MAG_FILTER,c),A.texParameteri(n,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(n,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE)}}function J(A){return!0===A.auto||void 0===A.auto&&void 0===A.level}function k(A,B){return(B=B||{}).cubeFaceOrder||[A.TEXTURE_CUBE_MAP_POSITIVE_X,A.TEXTURE_CUBE_MAP_NEGATIVE_X,A.TEXTURE_CUBE_MAP_POSITIVE_Y,A.TEXTURE_CUBE_MAP_NEGATIVE_Y,A.TEXTURE_CUBE_MAP_POSITIVE_Z,A.TEXTURE_CUBE_MAP_NEGATIVE_Z]}function T(A,B){var t=k(A,B).map((function(A,B){return{face:A,ndx:B}}));return t.sort((function(A,B){return A.face-B.face})),t}function j(A,B,t,e){var g=(e=e||r.textureOptions).target||A.TEXTURE_2D,i=e.level||0,Q=t.width,n=t.height,c=e.internalFormat||e.format||A.RGBA,o=M(c),w=e.format||o.format,C=e.type||o.type;if(U(A,e),A.bindTexture(g,B),g===A.TEXTURE_CUBE_MAP){var a,I,Y=t.width,h=t.height;if(Y/6===h)a=h,I=[0,0,1,0,2,0,3,0,4,0,5,0];else if(h/6===Y)a=Y,I=[0,0,0,1,0,2,0,3,0,4,0,5];else if(Y/3==h/2)a=Y/3,I=[0,0,1,0,2,0,0,1,1,1,2,1];else{if(Y/2!=h/3)throw"can't figure out cube map from element: "+(t.src?t.src:t.nodeName);a=Y/2,I=[0,0,1,0,0,1,1,1,0,2,1,2]}E?(E.canvas.width=a,E.canvas.height=a,Q=a,n=a,T(A,e).forEach((function(B){var e=I[2*B.ndx+0]*a,g=I[2*B.ndx+1]*a;E.drawImage(t,e,g,a,a,0,0,a,a),A.texImage2D(B.face,i,c,w,C,E.canvas)})),E.canvas.width=1,E.canvas.height=1):s.default.createImageBitmap&&(Q=a,n=a,T(A,e).forEach((function(r){var E=I[2*r.ndx+0]*a,o=I[2*r.ndx+1]*a;A.texImage2D(r.face,i,c,a,a,0,w,C,null),s.default.createImageBitmap(t,E,o,a,a,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then((function(t){U(A,e),A.bindTexture(g,B),A.texImage2D(r.face,i,c,w,C,t),N(A,e),J(e)&&y(A,B,e,Q,n,c,C)}))})))}else if(g===A.TEXTURE_3D||g===A.TEXTURE_2D_ARRAY){var F=Math.min(t.width,t.height),D=Math.max(t.width,t.height),u=D/F;if(u%1!=0)throw"can not compute 3D dimensions of element";var l=t.width===D?1:0,d=t.height===D?1:0;m(A),A.pixelStorei(A.UNPACK_ALIGNMENT,1),A.pixelStorei(A.UNPACK_ROW_LENGTH,t.width),A.pixelStorei(A.UNPACK_IMAGE_HEIGHT,0),A.pixelStorei(A.UNPACK_SKIP_IMAGES,0),A.texImage3D(g,i,c,F,F,F,0,w,C,null);for(var f=0;f<u;++f){var R=f*F*l,p=f*F*d;A.pixelStorei(A.UNPACK_SKIP_PIXELS,R),A.pixelStorei(A.UNPACK_SKIP_ROWS,p),A.texSubImage3D(g,i,0,0,f,F,F,1,w,C,t)}G(A)}else A.texImage2D(g,i,c,w,C,t);N(A,e),J(e)&&y(A,B,e,Q,n,c,C),H(A,B,e)}function x(){}function S(A){return s.default.ImageBitmap&&A instanceof s.default.ImageBitmap||s.default.ImageData&&A instanceof s.default.ImageData||s.default.HTMLElement&&A instanceof s.default.HTMLElement}function b(A,B,t){return S(A)?(setTimeout((function(){t(null,A)})),A):function(A,B,t){var e;if(t=t||x,s.default.Image){e=new s.default.Image,void 0!==(B=void 0!==B?B:r.crossOrigin)&&(e.crossOrigin=B);var g=function(){e.removeEventListener("error",i),e.removeEventListener("load",n),e=null},i=function(){var B="couldn't load image: "+A;Q.error(B),t(B,e),g()},n=function(){t(null,e),g()};return e.addEventListener("error",i),e.addEventListener("load",n),e.src=A,e}if(s.default.ImageBitmap){var c,E,o=function(){t(c,E)},w={};B&&(w.mode="cors"),fetch(A,w).then((function(A){if(!A.ok)throw A;return A.blob()})).then((function(A){return s.default.createImageBitmap(A,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(A){E=A,setTimeout(o)})).catch((function(A){c=A,setTimeout(o)})),e=null}return e}(A,B,t)}function z(A,B,t){var e=(t=t||r.textureOptions).target||A.TEXTURE_2D;if(A.bindTexture(e,B),!1!==t.color){var g=function(A){return A=A||r.textureColor,c(A)?A:new Uint8Array([255*A[0],255*A[1],255*A[2],255*A[3]])}(t.color);if(e===A.TEXTURE_CUBE_MAP)for(var i=0;i<6;++i)A.texImage2D(A.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,A.RGBA,1,1,0,A.RGBA,A.UNSIGNED_BYTE,g);else e===A.TEXTURE_3D||e===A.TEXTURE_2D_ARRAY?A.texImage3D(e,0,A.RGBA,1,1,1,0,A.RGBA,A.UNSIGNED_BYTE,g):A.texImage2D(e,0,A.RGBA,1,1,0,A.RGBA,A.UNSIGNED_BYTE,g)}}function L(A,B,t,e){return e=e||x,t=t||r.textureOptions,z(A,B,t),b((t=Object.assign({},t)).src,t.crossOrigin,(function(g,i){g?e(g,B,i):(j(A,B,i,t),e(null,B,i))}))}function P(A,B,t,e){e=e||x;var g=t.src;if(6!==g.length)throw"there must be 6 urls for a cubemap";var i=t.level||0,Q=t.internalFormat||t.format||A.RGBA,s=M(Q),n=t.format||s.format,r=t.type||A.UNSIGNED_BYTE,c=t.target||A.TEXTURE_2D;if(c!==A.TEXTURE_CUBE_MAP)throw"target must be TEXTURE_CUBE_MAP";z(A,B,t),t=Object.assign({},t);var E,o=6,w=[],C=k(A,t);E=g.map((function(g,s){return b(g,t.crossOrigin,(a=C[s],function(g,s){--o,g?w.push(g):s.width!==s.height?w.push("cubemap face img is not a square: "+s.src):(U(A,t),A.bindTexture(c,B),5===o?k(A).forEach((function(B){A.texImage2D(B,i,Q,n,r,s)})):A.texImage2D(a,i,Q,n,r,s),N(A,t),J(t)&&A.generateMipmap(c)),0===o&&e(w.length?w:void 0,B,E)}));var a}))}function v(A,B,t,e){e=e||x;var g=t.src,i=t.internalFormat||t.format||A.RGBA,Q=M(i),s=t.format||Q.format,n=t.type||A.UNSIGNED_BYTE,r=t.target||A.TEXTURE_2D_ARRAY;if(r!==A.TEXTURE_3D&&r!==A.TEXTURE_2D_ARRAY)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";z(A,B,t),t=Object.assign({},t);var c,o=g.length,w=[],C=t.level||0,a=t.width,I=t.height,Y=g.length,h=!0;c=g.map((function(g,Q){return b(g,t.crossOrigin,(M=Q,function(g,Q){if(--o,g)w.push(g);else{if(U(A,t),A.bindTexture(r,B),h){h=!1,a=t.width||Q.width,I=t.height||Q.height,A.texImage3D(r,C,i,a,I,Y,0,s,n,null);for(var F=0;F<Y;++F)A.texSubImage3D(r,C,0,0,F,a,I,1,s,n,Q)}else{var D=Q;Q.width===a&&Q.height===I||(D=E.canvas,E.canvas.width=a,E.canvas.height=I,E.drawImage(Q,0,0,a,I)),A.texSubImage3D(r,C,0,0,M,a,I,1,s,n,D),D===E.canvas&&(E.canvas.width=0,E.canvas.height=0)}N(A,t),J(t)&&A.generateMipmap(r)}0===o&&e(w.length?w:void 0,B,c)}));var M}))}function W(A,B,t,e){var Q=(e=e||r.textureOptions).target||A.TEXTURE_2D;A.bindTexture(Q,B);var s=e.width,n=e.height,E=e.depth,o=e.level||0,w=e.internalFormat||e.format||A.RGBA,C=M(w),a=e.format||C.format,I=e.type||D(A,t,C.type);if(c(t))t instanceof Uint8ClampedArray&&(t=new Uint8Array(t.buffer));else{var Y=i.getTypedArrayTypeForGLType(I);t=new Y(t)}var F,l=h(w,I),d=t.byteLength/l;if(d%1)throw"length wrong size for format: "+g.glEnumToString(A,a);if(Q===A.TEXTURE_3D)if(s||n||E)!s||n&&E?!n||s&&E?(F=u(A,Q,s,n,d/E),s=F.width,n=F.height):(F=u(A,Q,s,E,d/n),s=F.width,E=F.height):(F=u(A,Q,n,E,d/s),n=F.width,E=F.height);else{var f=Math.cbrt(d);if(f%1!=0)throw"can't guess cube size of array of numElements: "+d;s=f,n=f,E=f}else F=u(A,Q,s,n,d),s=F.width,n=F.height;if(m(A),A.pixelStorei(A.UNPACK_ALIGNMENT,e.unpackAlignment||1),U(A,e),Q===A.TEXTURE_CUBE_MAP){var H=d/6*(l/t.BYTES_PER_ELEMENT);T(A,e).forEach((function(B){var e=H*B.ndx,g=t.subarray(e,e+H);A.texImage2D(B.face,o,w,s,n,0,a,I,g)}))}else Q===A.TEXTURE_3D?A.texImage3D(Q,o,w,s,n,E,0,a,I,t):A.texImage2D(Q,o,w,s,n,0,a,I,t);return N(A,e),G(A),{width:s,height:n,depth:E,type:I}}function V(A,B,t){var e=t.target||A.TEXTURE_2D;A.bindTexture(e,B);var g=t.level||0,i=t.internalFormat||t.format||A.RGBA,Q=M(i),s=t.format||Q.format,n=t.type||Q.type;if(U(A,t),e===A.TEXTURE_CUBE_MAP)for(var r=0;r<6;++r)A.texImage2D(A.TEXTURE_CUBE_MAP_POSITIVE_X+r,g,i,t.width,t.height,0,s,n,null);else e===A.TEXTURE_3D?A.texImage3D(e,g,i,t.width,t.height,t.depth,0,s,n,null):A.texImage2D(e,g,i,t.width,t.height,0,s,n,null);N(A,t)}function K(A,B,t){t=t||x,B=B||r.textureOptions;var e=A.createTexture(),g=B.target||A.TEXTURE_2D,i=B.width||1,Q=B.height||1,s=B.internalFormat||A.RGBA,n=M(s),E=B.type||n.type;A.bindTexture(g,e),g===A.TEXTURE_CUBE_MAP&&(A.texParameteri(g,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(g,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE));var o=B.src;if(o)if("function"==typeof o&&(o=o(A,B)),"string"==typeof o)L(A,e,B,t);else if(c(o)||Array.isArray(o)&&("number"==typeof o[0]||Array.isArray(o[0])||c(o[0]))){var w=W(A,e,o,B);i=w.width,Q=w.height,E=w.type}else if(Array.isArray(o)&&("string"==typeof o[0]||S(o[0])))g===A.TEXTURE_CUBE_MAP?P(A,e,B,t):v(A,e,B,t);else{if(!S(o))throw"unsupported src type";j(A,e,o,B),i=o.width,Q=o.height}else V(A,e,B);return J(B)&&y(A,e,B,i,Q,s,E),H(A,e,B),e}},function(A,B,t){"use strict";B.__esModule=!0;var e={m4:!0,v3:!0,primitives:!0};B.primitives=B.v3=B.m4=void 0;var g=n(t(6));B.m4=g;var i=n(t(3));B.v3=i;var Q=n(t(10));B.primitives=Q;var s=t(11);function n(A){if(A&&A.__esModule)return A;var B={};if(null!=A)for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)){var e=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,t):{};e.get||e.set?Object.defineProperty(B,t,e):B[t]=A[t]}return B.default=A,B}Object.keys(s).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(e,A)||(B[A]=s[A]))}))},function(A,B,t){"use strict";B.__esModule=!0,B.create3DFVertices=m,B.createAugmentedTypedArray=o,B.createCubeVertices=d,B.createPlaneVertices=D,B.createSphereVertices=u,B.createTruncatedConeVertices=U,B.createXYQuadVertices=F,B.createCresentVertices=G,B.createCylinderVertices=f,B.createTorusVertices=H,B.createDiscVertices=R,B.deindexVertices=function(A){var B=A.indices,t={},e=B.length;return Object.keys(A).filter(w).forEach((function(g){for(var i=A[g],Q=i.numComponents,s=o(Q,e,i.constructor),n=0;n<e;++n)for(var r=B[n]*Q,c=0;c<Q;++c)s.push(i[r+c]);t[g]=s})),t},B.flattenNormals=function(A){if(A.indices)throw"can't flatten normals of indexed vertices. deindex them first";for(var B=A.normal,t=B.length,e=0;e<t;e+=9){var g=B[e+0],i=B[e+1],Q=B[e+2],s=B[e+3],n=B[e+4],r=B[e+5],c=B[e+6],E=B[e+7],o=B[e+8],w=g+s+c,C=i+n+E,a=Q+r+o,I=Math.sqrt(w*w+C*C+a*a);w/=I,C/=I,a/=I,B[e+0]=w,B[e+1]=C,B[e+2]=a,B[e+3]=w,B[e+4]=C,B[e+5]=a,B[e+6]=w,B[e+7]=C,B[e+8]=a}return A},B.makeRandomVertexColors=function(A,B){B=B||{};var t=A.position.numElements,e=o(4,t,Uint8Array),g=B.rand||function(A,B){return B<3?(t=256,Math.random()*t|0):255;var t};if(A.color=e,A.indices)for(var i=0;i<t;++i)e.push(g(i,0),g(i,1),g(i,2),g(i,3));else for(var Q=B.vertsPerColor||3,s=t/Q,n=0;n<s;++n)for(var r=[g(n,0),g(n,1),g(n,2),g(n,3)],c=0;c<Q;++c)e.push(r);return A},B.reorientDirections=I,B.reorientNormals=Y,B.reorientPositions=h,B.reorientVertices=M,B.concatVertices=function(A){for(var B,t={},e=function(e){var g=A[e];Object.keys(g).forEach((function(A){t[A]||(t[A]=[]),B||"indices"===A||(B=A);var e=g[A],i=c(e,A),Q=r(e).length/i;t[A].push(Q)}))},g=0;g<A.length;++g)e(g);var i=t[B],Q={};return Object.keys(t).forEach((function(B){var t=function(B){for(var t,e=0,g=0;g<A.length;++g){var i=A[g][B],Q=r(i);e+=Q.length,t&&!i.data||(t=i)}return{length:e,spec:t}}(B),e=T(t.spec,t.length);!function(B,t,e){for(var g=0,i=0,Q=0;Q<A.length;++Q){var s=A[Q][B],n=r(s);"indices"===B?(k(n,e,i,g),g+=t[Q]):k(n,e,i),i+=n.length}}(B,i,r(e)),Q[B]=e})),Q},B.duplicateVertices=function(A){var B={};return Object.keys(A).forEach((function(t){var e=A[t],g=r(e),i=T(e,g.length);k(g,r(i),0),B[t]=i})),B},B.createDiscBuffers=B.createDiscBufferInfo=B.createTorusBuffers=B.createTorusBufferInfo=B.createCylinderBuffers=B.createCylinderBufferInfo=B.createCresentBuffers=B.createCresentBufferInfo=B.createXYQuadBuffers=B.createXYQuadBufferInfo=B.createTruncatedConeBuffers=B.createTruncatedConeBufferInfo=B.createSphereBuffers=B.createSphereBufferInfo=B.createPlaneBuffers=B.createPlaneBufferInfo=B.createCubeBuffers=B.createCubeBufferInfo=B.create3DFBuffers=B.create3DFBufferInfo=void 0;var e=n(t(7)),g=n(t(0)),i=n(t(1)),Q=n(t(6)),s=n(t(3));function n(A){if(A&&A.__esModule)return A;var B={};if(null!=A)for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)){var e=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,t):{};e.get||e.set?Object.defineProperty(B,t,e):B[t]=A[t]}return B.default=A,B}var r=e.getArray_,c=e.getNumComponents_;function E(A,B){var t=0;return A.push=function(){for(var B=0;B<arguments.length;++B){var e=arguments[B];if(e instanceof Array||i.isArrayBuffer(e))for(var g=0;g<e.length;++g)A[t++]=e[g];else A[t++]=e}},A.reset=function(A){t=A||0},A.numComponents=B,Object.defineProperty(A,"numElements",{get:function(){return this.length/this.numComponents|0}}),A}function o(A,B,t){return E(new(t||Float32Array)(A*B),A)}function w(A){return"indices"!==A}function C(A,B,t){for(var e=A.length,g=new Float32Array(3),i=0;i<e;i+=3)t(B,[A[i],A[i+1],A[i+2]],g),A[i]=g[0],A[i+1]=g[1],A[i+2]=g[2]}function a(A,B,t){t=t||s.create();var e=B[0],g=B[1],i=B[2];return t[0]=e*A[0]+g*A[1]+i*A[2],t[1]=e*A[4]+g*A[5]+i*A[6],t[2]=e*A[8]+g*A[9]+i*A[10],t}function I(A,B){return C(A,B,Q.transformDirection),A}function Y(A,B){return C(A,Q.inverse(B),a),A}function h(A,B){return C(A,B,Q.transformPoint),A}function M(A,B){return Object.keys(A).forEach((function(t){var e=A[t];t.indexOf("pos")>=0?h(e,B):t.indexOf("tan")>=0||t.indexOf("binorm")>=0?I(e,B):t.indexOf("norm")>=0&&Y(e,B)})),A}function F(A,B,t){return A=A||2,{position:{numComponents:2,data:[(B=B||0)+-1*(A*=.5),(t=t||0)+-1*A,B+1*A,t+-1*A,B+-1*A,t+1*A,B+1*A,t+1*A]},normal:[0,0,1,0,0,1,0,0,1,0,0,1],texcoord:[0,0,1,0,0,1,1,1],indices:[0,1,2,2,1,3]}}function D(A,B,t,e,g){A=A||1,B=B||1,t=t||1,e=e||1,g=g||Q.identity();for(var i=(t+1)*(e+1),s=o(3,i),n=o(3,i),r=o(2,i),c=0;c<=e;c++)for(var E=0;E<=t;E++){var w=E/t,C=c/e;s.push(A*w-.5*A,0,B*C-.5*B),n.push(0,1,0),r.push(w,C)}for(var a=t+1,I=o(3,t*e*2,Uint16Array),Y=0;Y<e;Y++)for(var h=0;h<t;h++)I.push((Y+0)*a+h,(Y+1)*a+h,(Y+0)*a+h+1),I.push((Y+1)*a+h,(Y+1)*a+h+1,(Y+0)*a+h+1);return M({position:s,normal:n,texcoord:r,indices:I},g)}function u(A,B,t,e,g,i,Q){if(B<=0||t<=0)throw Error("subdivisionAxis and subdivisionHeight must be > 0");e=e||0,i=i||0;for(var s=(g=g||Math.PI)-e,n=(Q=Q||2*Math.PI)-i,r=(B+1)*(t+1),c=o(3,r),E=o(3,r),w=o(2,r),C=0;C<=t;C++)for(var a=0;a<=B;a++){var I=a/B,Y=C/t,h=n*I,M=s*Y,F=Math.sin(h),D=Math.cos(h),u=Math.sin(M),l=D*u,d=Math.cos(M),U=F*u;c.push(A*l,A*d,A*U),E.push(l,d,U),w.push(1-I,Y)}for(var N=B+1,m=o(3,B*t*2,Uint16Array),G=0;G<B;G++)for(var f=0;f<t;f++)m.push((f+0)*N+G,(f+0)*N+G+1,(f+1)*N+G),m.push((f+1)*N+G,(f+0)*N+G+1,(f+1)*N+G+1);return{position:c,normal:E,texcoord:w,indices:m}}var l=[[3,7,5,1],[6,2,0,4],[6,7,3,2],[0,1,5,4],[7,6,4,5],[2,3,1,0]];function d(A){for(var B=(A=A||1)/2,t=[[-B,-B,-B],[+B,-B,-B],[-B,+B,-B],[+B,+B,-B],[-B,-B,+B],[+B,-B,+B],[-B,+B,+B],[+B,+B,+B]],e=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],g=[[1,0],[0,0],[0,1],[1,1]],i=o(3,24),Q=o(3,24),s=o(2,24),n=o(3,12,Uint16Array),r=0;r<6;++r){for(var c=l[r],E=0;E<4;++E){var w=t[c[E]],C=e[r],a=g[E];i.push(w),Q.push(C),s.push(a)}var I=4*r;n.push(I+0,I+1,I+2),n.push(I+0,I+2,I+3)}return{position:i,normal:Q,texcoord:s,indices:n}}function U(A,B,t,e,g,i,Q){if(e<3)throw Error("radialSubdivisions must be 3 or greater");if(g<1)throw Error("verticalSubdivisions must be 1 or greater");for(var s=void 0===i||i,n=void 0===Q||Q,r=(s?2:0)+(n?2:0),c=(e+1)*(g+1+r),E=o(3,c),w=o(3,c),C=o(2,c),a=o(3,e*(g+r)*2,Uint16Array),I=e+1,Y=Math.atan2(A-B,t),h=Math.cos(Y),M=Math.sin(Y),F=g+(n?2:0),D=s?-2:0;D<=F;++D){var u=D/g,l=t*u,d=void 0;D<0?(l=0,u=1,d=A):D>g?(l=t,u=1,d=B):d=A+D/g*(B-A),-2!==D&&D!==g+2||(d=0,u=0),l-=t/2;for(var U=0;U<I;++U){var N=Math.sin(U*Math.PI*2/e),m=Math.cos(U*Math.PI*2/e);E.push(N*d,l,m*d),w.push(D<0||D>g?0:N*h,D<0?-1:D>g?1:M,D<0||D>g?0:m*h),C.push(U/e,1-u)}}for(var G=0;G<g+r;++G)for(var f=0;f<e;++f)a.push(I*(G+0)+0+f,I*(G+0)+1+f,I*(G+1)+1+f),a.push(I*(G+0)+0+f,I*(G+1)+1+f,I*(G+1)+0+f);return{position:E,normal:w,texcoord:C,indices:a}}function N(A,B){B=B||[];for(var t=[],e=0;e<A.length;e+=4){var g=A[e],i=A.slice(e+1,e+4);i.push.apply(i,B);for(var Q=0;Q<g;++Q)t.push.apply(t,i)}return t}function m(){var A=[0,0,0,0,150,0,30,0,0,0,150,0,30,150,0,30,0,0,30,0,0,30,30,0,100,0,0,30,30,0,100,30,0,100,0,0,30,60,0,30,90,0,67,60,0,30,90,0,67,90,0,67,60,0,0,0,30,30,0,30,0,150,30,0,150,30,30,0,30,30,150,30,30,0,30,100,0,30,30,30,30,30,30,30,100,0,30,100,30,30,30,60,30,67,60,30,30,90,30,30,90,30,67,60,30,67,90,30,0,0,0,100,0,0,100,0,30,0,0,0,100,0,30,0,0,30,100,0,0,100,30,0,100,30,30,100,0,0,100,30,30,100,0,30,30,30,0,30,30,30,100,30,30,30,30,0,100,30,30,100,30,0,30,30,0,30,60,30,30,30,30,30,30,0,30,60,0,30,60,30,30,60,0,67,60,30,30,60,30,30,60,0,67,60,0,67,60,30,67,60,0,67,90,30,67,60,30,67,60,0,67,90,0,67,90,30,30,90,0,30,90,30,67,90,30,30,90,0,67,90,30,67,90,0,30,90,0,30,150,30,30,90,30,30,90,0,30,150,0,30,150,30,0,150,0,0,150,30,30,150,30,0,150,0,30,150,30,30,150,0,0,0,0,0,0,30,0,150,30,0,0,0,0,150,30,0,150,0],B=N([18,0,0,1,18,0,0,-1,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,-1,0,6,-1,0,0]),t=N([18,200,70,120,18,80,70,200,6,70,200,210,6,200,200,70,6,210,100,70,6,210,160,70,6,70,180,210,6,100,70,210,6,76,210,100,6,140,210,80,6,90,130,110,6,160,160,220],[255]),e=A.length/3,g={position:o(3,e),texcoord:o(2,e),normal:o(3,e),color:o(4,e,Uint8Array),indices:o(3,e/3,Uint16Array)};g.position.push(A),g.texcoord.push([.22,.19,.22,.79,.34,.19,.22,.79,.34,.79,.34,.19,.34,.19,.34,.31,.62,.19,.34,.31,.62,.31,.62,.19,.34,.43,.34,.55,.49,.43,.34,.55,.49,.55,.49,.43,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1,0]),g.normal.push(B),g.color.push(t);for(var i=0;i<e;++i)g.indices.push(i);return g}function G(A,B,t,e,g,i,Q){if(g<=0)throw Error("subdivisionDown must be > 0");var n=(Q=Q||1)-(i=i||0),r=2*(g+1)*4,c=o(3,r),E=o(3,r),w=o(2,r);function C(A,B,t){return A+(B-A)*t}function a(B,t,Q,r,o,a){for(var I=0;I<=g;I++){var Y=t/1,h=I/g,M=2*(Y-.5),F=(i+h*n)*Math.PI,D=Math.sin(F),u=Math.cos(F),l=C(A,B,D),d=M*e,U=u*A,N=D*l;c.push(d,U,N);var m=s.add(s.multiply([0,D,u],Q),r);E.push(m),w.push(Y*o+a,h)}}for(var I=0;I<2;I++){var Y=2*(I/1-.5);a(B,I,[1,1,1],[0,0,0],1,0),a(B,I,[0,0,0],[Y,0,0],0,0),a(t,I,[1,1,1],[0,0,0],1,0),a(t,I,[0,0,0],[Y,0,0],0,1)}var h=o(3,2*g*4,Uint16Array);function M(A,B){for(var t=0;t<g;++t)h.push(A+t+0,A+t+1,B+t+0),h.push(A+t+1,B+t+1,B+t+0)}var F=g+1;return M(0*F,4*F),M(5*F,7*F),M(6*F,2*F),M(3*F,1*F),{position:c,normal:E,texcoord:w,indices:h}}function f(A,B,t,e,g,i){return U(A,A,B,t,e,g,i)}function H(A,B,t,e,g,i){if(t<3)throw Error("radialSubdivisions must be 3 or greater");if(e<3)throw Error("verticalSubdivisions must be 3 or greater");g=g||0;for(var Q=(i=i||2*Math.PI)-g,s=t+1,n=e+1,r=s*n,c=o(3,r),E=o(3,r),w=o(2,r),C=o(3,t*e*2,Uint16Array),a=0;a<n;++a)for(var I=a/e,Y=I*Math.PI*2,h=Math.sin(Y),M=A+h*B,F=Math.cos(Y),D=F*B,u=0;u<s;++u){var l=u/t,d=g+l*Q,U=Math.sin(d),N=Math.cos(d),m=U*M,G=N*M,f=U*h,H=N*h;c.push(m,D,G),E.push(f,F,H),w.push(l,1-I)}for(var R=0;R<e;++R)for(var p=0;p<t;++p){var y=1+p,J=1+R;C.push(s*R+p,s*J+p,s*R+y),C.push(s*J+p,s*J+y,s*R+y)}return{position:c,normal:E,texcoord:w,indices:C}}function R(A,B,t,e,g){if(B<3)throw Error("divisions must be at least 3");g=g||1,e=e||0;for(var i=(B+1)*((t=t||1)+1),Q=o(3,i),s=o(3,i),n=o(2,i),r=o(3,t*B*2,Uint16Array),c=0,E=A-e,w=B+1,C=0;C<=t;++C){for(var a=e+E*Math.pow(C/t,g),I=0;I<=B;++I){var Y=2*Math.PI*I/B,h=a*Math.cos(Y),M=a*Math.sin(Y);if(Q.push(h,0,M),s.push(0,1,0),n.push(1-I/B,C/t),C>0&&I!==B){var F=c+(I+1),D=c+I,u=c+I-w,l=c+(I+1)-w;r.push(F,D,u),r.push(F,u,l)}}c+=B+1}return{position:Q,normal:s,texcoord:n,indices:r}}function p(A){return function(B){var t=A.apply(this,Array.prototype.slice.call(arguments,1));return e.createBuffersFromArrays(B,t)}}function y(A){return function(B){var t=A.apply(null,Array.prototype.slice.call(arguments,1));return e.createBufferInfoFromArrays(B,t)}}var J=["numComponents","size","type","normalize","stride","offset","attrib","name","attribName"];function k(A,B,t,e){e=e||0;for(var g=A.length,i=0;i<g;++i)B[t+i]=A[i]+e}function T(A,B){var t=r(A),e=new t.constructor(B),i=e;return t.numComponents&&t.numElements&&E(e,t.numComponents),A.data&&(i={data:e},g.copyNamedProperties(J,A,i)),i}var j=y(m);B.create3DFBufferInfo=j;var x=p(m);B.create3DFBuffers=x;var S=y(d);B.createCubeBufferInfo=S;var b=p(d);B.createCubeBuffers=b;var z=y(D);B.createPlaneBufferInfo=z;var L=p(D);B.createPlaneBuffers=L;var P=y(u);B.createSphereBufferInfo=P;var v=p(u);B.createSphereBuffers=v;var W=y(U);B.createTruncatedConeBufferInfo=W;var V=p(U);B.createTruncatedConeBuffers=V;var K=y(F);B.createXYQuadBufferInfo=K;var O=p(F);B.createXYQuadBuffers=O;var X=y(G);B.createCresentBufferInfo=X;var Z=p(G);B.createCresentBuffers=Z;var _=y(f);B.createCylinderBufferInfo=_;var q=p(f);B.createCylinderBuffers=q;var $=y(H);B.createTorusBufferInfo=$;var AA=p(H);B.createTorusBuffers=AA;var BA=y(R);B.createDiscBufferInfo=BA;var tA=p(R);B.createDiscBuffers=tA},function(A,B,t){"use strict";B.__esModule=!0;var e={addExtensionsToContext:!0,getContext:!0,getWebGLContext:!0,resizeCanvasToDisplaySize:!0,setDefaults:!0};B.addExtensionsToContext=h,B.getContext=function(A,B){return function(A,B){for(var t=["webgl2","webgl","experimental-webgl"],e=null,g=0;g<t.length;++g)if(e=A.getContext(t[g],B)){C.addExtensionsToContext&&h(e);break}return e}(A,B)},B.getWebGLContext=function(A,B){return function(A,B){for(var t=["webgl","experimental-webgl"],e=null,g=0;g<t.length;++g)if(e=A.getContext(t[g],B)){C.addExtensionsToContext&&h(e);break}return e}(A,B)},B.resizeCanvasToDisplaySize=function(A,B){B=B||1,B=Math.max(0,B);var t=A.clientWidth*B|0,e=A.clientHeight*B|0;return(A.width!==t||A.height!==e)&&(A.width=t,A.height=e,!0)},B.setDefaults=function(A){Q.copyExistingProperties(A,C),g.setAttributeDefaults_(A),i.setTextureDefaults_(A)};var g=w(t(7));Object.keys(g).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(e,A)||(B[A]=g[A]))}));var i=w(t(8));Object.keys(i).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(e,A)||(B[A]=i[A]))}));var Q=w(t(0)),s=w(t(4));Object.keys(s).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(e,A)||(B[A]=s[A]))}));var n=t(12);Object.keys(n).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(e,A)||(B[A]=n[A]))}));var r=t(13);Object.keys(r).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(e,A)||(B[A]=r[A]))}));var c=t(5);Object.keys(c).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(e,A)||(B[A]=c[A]))}));var E=t(1);Object.keys(E).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(e,A)||(B[A]=E[A]))}));var o=t(14);function w(A){if(A&&A.__esModule)return A;var B={};if(null!=A)for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)){var e=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,t):{};e.get||e.set?Object.defineProperty(B,t,e):B[t]=A[t]}return B.default=A,B}Object.keys(o).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(e,A)||(B[A]=o[A]))}));var C={addExtensionsToContext:!0},a=/^(.*?)_/;function I(A,B){s.glEnumToString(A,0);var t=A.getExtension(B);if(t){var e={},g=a.exec(B)[1],i="_"+g;for(var n in t){var r=t[n],c="function"==typeof r,E=c?g:i,o=n;n.endsWith(E)&&(o=n.substring(0,n.length-E.length)),void 0!==A[o]?c||A[o]===r||Q.warn(o,A[o],r,n):c?A[o]=function(A){return function(){return A.apply(t,arguments)}}(r):(A[o]=r,e[o]=r)}e.constructor={name:t.constructor.name},s.glEnumToString(e,0)}return t}var Y=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_float","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2","EXT_frag_depth","EXT_sRGB","EXT_shader_texture_lod","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_depth_texture","WEBGL_draw_buffers"];function h(A){for(var B=0;B<Y.length;++B)I(A,Y[B])}},function(A,B,t){"use strict";B.__esModule=!0,B.drawBufferInfo=g,B.drawObjectList=function(A,B){var t=null,i=null;B.forEach((function(B){if(!1!==B.active){var Q=B.programInfo,s=B.vertexArrayInfo||B.bufferInfo,n=!1,r=void 0===B.type?A.TRIANGLES:B.type;Q!==t&&(t=Q,A.useProgram(Q.program),n=!0),(n||s!==i)&&(i&&i.vertexArrayObject&&!s.vertexArrayObject&&A.bindVertexArray(null),i=s,e.setBuffersAndAttributes(A,Q,s)),e.setUniforms(Q,B.uniforms),g(A,s,r,B.count,B.offset,B.instanceCount)}})),i.vertexArrayObject&&A.bindVertexArray(null)};var e=function(A){if(A&&A.__esModule)return A;var B={};if(null!=A)for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)){var e=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,t):{};e.get||e.set?Object.defineProperty(B,t,e):B[t]=A[t]}return B.default=A,B}(t(5));function g(A,B,t,e,g,i){t=void 0===t?A.TRIANGLES:t;var Q=B.indices,s=B.elementType,n=void 0===e?B.numElements:e;g=void 0===g?0:g,s||Q?void 0!==i?A.drawElementsInstanced(t,n,void 0===s?A.UNSIGNED_SHORT:B.elementType,g,i):A.drawElements(t,n,void 0===s?A.UNSIGNED_SHORT:B.elementType,g):void 0!==i?A.drawArraysInstanced(t,g,n,i):A.drawArrays(t,g,n)}},function(A,B,t){"use strict";B.__esModule=!0,B.bindFramebufferInfo=function(A,B,t){t=t||A.FRAMEBUFFER,B?(A.bindFramebuffer(t,B.framebuffer),A.viewport(0,0,B.width,B.height)):(A.bindFramebuffer(t,null),A.viewport(0,0,A.drawingBufferWidth,A.drawingBufferHeight))},B.createFramebufferInfo=function(A,B,t,i){var r=A.FRAMEBUFFER,c=A.createFramebuffer();A.bindFramebuffer(r,c),t=t||A.drawingBufferWidth,i=i||A.drawingBufferHeight;var E=0,o={framebuffer:c,attachments:[],width:t,height:i};return(B=B||Q).forEach((function(B){var Q=B.attachment,c=B.format,w=function(A){return s[A]}(c);if(w||(w=36064+E++),!Q)if(function(A){return n[A]}(c))Q=A.createRenderbuffer(),A.bindRenderbuffer(A.RENDERBUFFER,Q),A.renderbufferStorage(A.RENDERBUFFER,c,t,i);else{var C=Object.assign({},B);C.width=t,C.height=i,void 0===C.auto&&(C.auto=!1,C.min=C.min||C.minMag||A.LINEAR,C.mag=C.mag||C.minMag||A.LINEAR,C.wrapS=C.wrapS||C.wrap||A.CLAMP_TO_EDGE,C.wrapT=C.wrapT||C.wrap||A.CLAMP_TO_EDGE),Q=e.createTexture(A,C)}if(g.isRenderbuffer(A,Q))A.framebufferRenderbuffer(r,w,A.RENDERBUFFER,Q);else{if(!g.isTexture(A,Q))throw"unknown attachment type";A.framebufferTexture2D(r,w,B.texTarget||A.TEXTURE_2D,Q,B.level||0)}o.attachments.push(Q)})),o},B.resizeFramebufferInfo=function(A,B,t,i,s){i=i||A.drawingBufferWidth,s=s||A.drawingBufferHeight,B.width=i,B.height=s,(t=t||Q).forEach((function(t,Q){var n=B.attachments[Q],r=t.format;if(g.isRenderbuffer(A,n))A.bindRenderbuffer(A.RENDERBUFFER,n),A.renderbufferStorage(A.RENDERBUFFER,r,i,s);else{if(!g.isTexture(A,n))throw"unknown attachment type";e.resizeTexture(A,n,t,i,s)}}))};var e=i(t(8)),g=i(t(0));function i(A){if(A&&A.__esModule)return A;var B={};if(null!=A)for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)){var e=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,t):{};e.get||e.set?Object.defineProperty(B,t,e):B[t]=A[t]}return B.default=A,B}var Q=[{format:6408,type:5121,min:9729,wrap:33071},{format:34041}],s={34041:33306,6401:36128,36168:36128,6402:36096,33189:36096},n={32854:!0,32855:!0,36194:!0,34041:!0,33189:!0,6401:!0,36168:!0}},function(A,B,t){"use strict";B.__esModule=!0,B.createVertexArrayInfo=function(A,B,t){var g=A.createVertexArray();return A.bindVertexArray(g),B.length||(B=[B]),B.forEach((function(B){e.setBuffersAndAttributes(A,B,t)})),A.bindVertexArray(null),{numElements:t.numElements,elementType:t.elementType,vertexArrayObject:g}},B.createVAOAndSetAttributes=g,B.createVAOFromBufferInfo=function(A,B,t){return g(A,B.attribSetters||B,t.attribs,t.indices)};var e=function(A){if(A&&A.__esModule)return A;var B={};if(null!=A)for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t)){var e=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,t):{};e.get||e.set?Object.defineProperty(B,t,e):B[t]=A[t]}return B.default=A,B}(t(5));function g(A,B,t,g){var i=A.createVertexArray();return A.bindVertexArray(i),e.setAttributes(B,t),g&&A.bindBuffer(A.ELEMENT_ARRAY_BUFFER,g),A.bindVertexArray(null),i}}])},A.exports=e()},function(A,B,t){"use strict";(function(A){