-
Notifications
You must be signed in to change notification settings - Fork 0
/
TWGL.js
6 lines (6 loc) · 88 KB
/
TWGL.js
1
2
3
4
5
6
/*!
* @license twgl.js 5.6.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
* Available via the MIT license.
* see: http://github.com/greggman/twgl.js for details
*/
!function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.twgl=t():r.twgl=t()}("undefined"!=typeof self?self:this,(()=>(()=>{"use strict";var r={650:(r,t,e)=>{function n(r){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n(r)}t.__esModule=!0,t.createAttribsFromArrays=R,t.createBufferFromArray=k,t.createBufferFromTypedArray=j,t.createBufferInfoFromArrays=function(r,t,e){var n=R(r,t),i=Object.assign({},e||{});i.attribs=Object.assign({},e?e.attribs:{},n);var u=t.indices;if(u){var a=S(u,"indices");i.indices=j(r,a,l),i.numElements=a.length,i.elementType=o.getGLTypeForTypedArray(a)}else i.numElements||(i.numElements=function(r,t){var e,n;for(n=0;n<z.length&&!((e=z[n])in t)&&!((e=w.attribPrefix+e)in t);++n);n===z.length&&(e=Object.keys(t)[0]);var o=t[e];if(!o.buffer)return 1;r.bindBuffer(c,o.buffer);var i=r.getBufferParameter(c,s);r.bindBuffer(c,null);var u=(x=o.type,x===v||x===y?1:x===b||x===m?2:x===d||x===p||x===h?4:0),a=i/u,f=o.numComponents||o.size,l=a/f;var x;if(l%1!=0)throw new Error("numComponents ".concat(f," not correct for length ").concat(length));return l}(r,i.attribs));return i},t.createBuffersFromArrays=function(r,t){var e={};Object.keys(t).forEach((function(n){e[n]=k(r,t[n],n)})),t.indices?(e.numElements=t.indices.length,e.elementType=o.getGLTypeForTypedArray(S(t.indices),"indices")):e.numElements=function(r){var t,e;for(e=0;e<z.length&&!((t=z[e])in r);++e);e===z.length&&(t=Object.keys(r)[0]);var n=r[t],o=_(n).length;if(void 0===o)return 1;var i=A(n,t),u=o/i;if(o%i>0)throw new Error("numComponents ".concat(i," not correct for length ").concat(o));return u}(t);return e},t.getArray_=_,t.getNumComponents_=A,t.setAttribInfoBufferFromArray=function(r,t,e,n){e=S(e),void 0!==n?(r.bindBuffer(c,t.buffer),r.bufferSubData(c,n,e)):x(r,c,t.buffer,e,t.drawType)},t.setAttributeDefaults_=function(r){i.copyExistingProperties(r,w)},t.setAttributePrefix=function(r){w.attribPrefix=r};var o=a(e(801)),i=a(e(303));function u(r){if("function"!=typeof WeakMap)return null;var t=new WeakMap,e=new WeakMap;return(u=function(r){return r?e:t})(r)}function a(r,t){if(!t&&r&&r.__esModule)return r;if(null===r||"object"!=n(r)&&"function"!=typeof r)return{default:r};var e=u(t);if(e&&e.has(r))return e.get(r);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if("default"!==a&&Object.prototype.hasOwnProperty.call(r,a)){var f=i?Object.getOwnPropertyDescriptor(r,a):null;f&&(f.get||f.set)?Object.defineProperty(o,a,f):o[a]=r[a]}return o.default=r,e&&e.set(r,o),o}var f=35044,c=34962,l=34963,s=34660,v=5120,y=5121,b=5122,m=5123,d=5124,p=5125,h=5126,w={attribPrefix:""};function x(r,t,e,n,o){r.bindBuffer(t,e),r.bufferData(t,n,o||f)}function j(r,t,e,n){if(i.isBuffer(r,t))return t;e=e||c;var o=r.createBuffer();return x(r,e,o,t,n),o}function F(r){return"indices"===r}function _(r){return r.length?r:r.data}var O=/coord|texture/i,E=/color|colour/i;function A(r,t,e){return r.numComponents||r.size||function(r,t){var e;if(t%(e=O.test(r)?2:E.test(r)?4:3)>0)throw new Error("Can not guess numComponents for attribute '".concat(r,"'. Tried ").concat(e," but ").concat(t," values is not evenly divisible by ").concat(e,". You should specify it."));return e}(t,e||_(r).length)}function S(r,t){if(o.isArrayBuffer(r))return r;if(o.isArrayBuffer(r.data))return r.data;Array.isArray(r)&&(r={data:r});var e=r.type?M(r.type):void 0;return e||(e=F(t)?Uint16Array:Float32Array),new e(r.data)}function M(r){return"number"==typeof r?o.getTypedArrayTypeForGLType(r):r||Float32Array}function g(r,t){return{buffer:t.buffer,numValues:24,type:(e=t.type,"number"==typeof e?e:e?o.getGLTypeForTypedArrayType(e):h),arrayType:M(t.type)};var e}function T(r,t){var e=t.data||t,n=M(t.type),i=e*n.BYTES_PER_ELEMENT,u=r.createBuffer();return r.bindBuffer(c,u),r.bufferData(c,i,t.drawType||f),{buffer:u,numValues:e,type:o.getGLTypeForTypedArrayType(n),arrayType:n}}function P(r,t,e){var n=S(t,e);return{arrayType:n.constructor,buffer:j(r,n,void 0,t.drawType),type:o.getGLTypeForTypedArray(n),numValues:0}}function R(r,t){var e={};return Object.keys(t).forEach((function(n){if(!F(n)){var i=t[n],u=i.attrib||i.name||i.attribName||w.attribPrefix+n;if(i.value){if(!Array.isArray(i.value)&&!o.isArrayBuffer(i.value))throw new Error("array.value is not array or typedarray");e[u]={value:i.value}}else{var a=(i.buffer&&i.buffer instanceof WebGLBuffer?g:"number"==typeof i||"number"==typeof i.data?T:P)(r,i,n),f=a.buffer,c=a.type,l=a.numValues,s=a.arrayType,v=void 0!==i.normalize?i.normalize:(b=s)===Int8Array||b===Uint8Array,y=A(i,n,l);e[u]={buffer:f,numComponents:y,type:c,normalize:v,stride:i.stride||0,offset:i.offset||0,divisor:void 0===i.divisor?void 0:i.divisor,drawType:i.drawType}}}var b})),r.bindBuffer(c,null),e}var z=["position","positions","a_position"];function k(r,t,e){var n="indices"===e?l:c;return j(r,S(t,e),n)}},341:(r,t,e)=>{function n(r){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n(r)}t.__esModule=!0,t.drawBufferInfo=f,t.drawObjectList=function(r,t){var e=null,n=null;t.forEach((function(t){if(!1!==t.active){var i=t.programInfo,a=t.vertexArrayInfo||t.bufferInfo,c=!1,l=void 0===t.type?u:t.type;i!==e&&(e=i,r.useProgram(i.program),c=!0),(c||a!==n)&&(n&&n.vertexArrayObject&&!a.vertexArrayObject&&r.bindVertexArray(null),n=a,o.setBuffersAndAttributes(r,i,a)),o.setUniforms(i,t.uniforms),f(r,a,l,t.count,t.offset,t.instanceCount)}})),n&&n.vertexArrayObject&&r.bindVertexArray(null)};var o=function(r,t){if(!t&&r&&r.__esModule)return r;if(null===r||"object"!=n(r)&&"function"!=typeof r)return{default:r};var e=i(t);if(e&&e.has(r))return e.get(r);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if("default"!==a&&Object.prototype.hasOwnProperty.call(r,a)){var f=u?Object.getOwnPropertyDescriptor(r,a):null;f&&(f.get||f.set)?Object.defineProperty(o,a,f):o[a]=r[a]}return o.default=r,e&&e.set(r,o),o}(e(38));function i(r){if("function"!=typeof WeakMap)return null;var t=new WeakMap,e=new WeakMap;return(i=function(r){return r?e:t})(r)}var u=4,a=5123;function f(r,t,e,n,o,i){e=void 0===e?u:e;var f=t.indices,c=t.elementType,l=void 0===n?t.numElements:n;o=void 0===o?0:o,c||f?void 0!==i?r.drawElementsInstanced(e,l,void 0===c?a:t.elementType,o,i):r.drawElements(e,l,void 0===c?a:t.elementType,o):void 0!==i?r.drawArraysInstanced(e,o,l,i):r.drawArrays(e,o,l)}},167:(r,t,e)=>{function n(r){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n(r)}t.__esModule=!0,t.bindFramebufferInfo=function(r,t,e){e=e||f,t?(r.bindFramebuffer(e,t.framebuffer),r.viewport(0,0,t.width,t.height)):(r.bindFramebuffer(e,null),r.viewport(0,0,r.drawingBufferWidth,r.drawingBufferHeight))},t.createFramebufferInfo=function(r,t,e,n){var u=f,a=r.createFramebuffer();r.bindFramebuffer(u,a),e=e||r.drawingBufferWidth,n=n||r.drawingBufferHeight;var s=[],y={framebuffer:a,attachments:[],width:e,height:n};(t=t||p).forEach((function(t,a){var f=t.attachment,b=t.samples,p=t.format,j=t.attachmentPoint||function(r,t){return h[r]||h[t]}(p,t.internalFormat);if(j||(j=v+a),function(r){return r>=v&&r<v+x}(j)&&s.push(j),!f)if(void 0!==b||function(r){return w[r]}(p))f=r.createRenderbuffer(),r.bindRenderbuffer(c,f),b>1?r.renderbufferStorageMultisample(c,b,p,e,n):r.renderbufferStorage(c,p,e,n);else{var F=Object.assign({},t);F.width=e,F.height=n,void 0===F.auto&&(F.auto=!1,F.min=F.min||F.minMag||d,F.mag=F.mag||F.minMag||d,F.wrapS=F.wrapS||F.wrap||m,F.wrapT=F.wrapT||F.wrap||m),f=o.createTexture(r,F)}if(i.isRenderbuffer(r,f))r.framebufferRenderbuffer(u,j,c,f);else{if(!i.isTexture(r,f))throw new Error("unknown attachment type");void 0!==t.layer?r.framebufferTextureLayer(u,j,f,t.level||0,t.layer):r.framebufferTexture2D(u,j,t.target||l,f,t.level||0)}y.attachments.push(f)})),r.drawBuffers&&r.drawBuffers(s);return y},t.resizeFramebufferInfo=function(r,t,e,n,u){n=n||r.drawingBufferWidth,u=u||r.drawingBufferHeight,t.width=n,t.height=u,(e=e||p).forEach((function(e,a){var f=t.attachments[a],l=e.format,s=e.samples;if(void 0!==s||i.isRenderbuffer(r,f))r.bindRenderbuffer(c,f),s>1?r.renderbufferStorageMultisample(c,s,l,n,u):r.renderbufferStorage(c,l,n,u);else{if(!i.isTexture(r,f))throw new Error("unknown attachment type");o.resizeTexture(r,f,e,n,u)}}))};var o=a(e(175)),i=a(e(303));function u(r){if("function"!=typeof WeakMap)return null;var t=new WeakMap,e=new WeakMap;return(u=function(r){return r?e:t})(r)}function a(r,t){if(!t&&r&&r.__esModule)return r;if(null===r||"object"!=n(r)&&"function"!=typeof r)return{default:r};var e=u(t);if(e&&e.has(r))return e.get(r);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if("default"!==a&&Object.prototype.hasOwnProperty.call(r,a)){var f=i?Object.getOwnPropertyDescriptor(r,a):null;f&&(f.get||f.set)?Object.defineProperty(o,a,f):o[a]=r[a]}return o.default=r,e&&e.set(r,o),o}var f=36160,c=36161,l=3553,s=34041,v=36064,y=36096,b=33306,m=33071,d=9729,p=[{format:6408,type:5121,min:d,wrap:m},{format:s}],h={};h[34041]=b,h[6401]=36128,h[36168]=36128,h[6402]=y,h[33189]=y,h[33190]=y,h[36012]=y,h[35056]=b,h[36013]=b;var w={};w[32854]=!0,w[32855]=!0,w[36194]=!0,w[34041]=!0,w[33189]=!0,w[6401]=!0,w[36168]=!0;var x=32},303:(r,t)=>{function e(r){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e(r)}t.__esModule=!0,t.copyExistingProperties=function(r,t){Object.keys(t).forEach((function(e){t.hasOwnProperty(e)&&r.hasOwnProperty(e)&&(t[e]=r[e])}))},t.copyNamedProperties=function(r,t,e){r.forEach((function(r){var n=t[r];void 0!==n&&(e[r]=n)}))},t.error=function(){var r;(r=console).error.apply(r,arguments)},t.isBuffer=function(r,t){return"undefined"!=typeof WebGLBuffer&&o(t,"WebGLBuffer")},t.isRenderbuffer=function(r,t){return"undefined"!=typeof WebGLRenderbuffer&&o(t,"WebGLRenderbuffer")},t.isSampler=function(r,t){return"undefined"!=typeof WebGLSampler&&o(t,"WebGLSampler")},t.isShader=function(r,t){return"undefined"!=typeof WebGLShader&&o(t,"WebGLShader")},t.isTexture=function(r,t){return"undefined"!=typeof WebGLTexture&&o(t,"WebGLTexture")},t.warn=function(){var r;(r=console).warn.apply(r,arguments)};var n=new Map;function o(r,t){if(!r||"object"!==e(r))return!1;var o=n.get(t);o||(o=new WeakMap,n.set(t,o));var i=o.get(r);if(void 0===i){var u=Object.prototype.toString.call(r);i=u.substring(8,u.length-1)===t,o.set(r,i)}return i}},362:(r,t,e)=>{function n(r){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n(r)}t.__esModule=!0,t.axisRotate=function(r,t,e,n){n=n||new c(16);var o=t[0],i=t[1],u=t[2],a=Math.sqrt(o*o+i*i+u*u),f=(o/=a)*o,l=(i/=a)*i,s=(u/=a)*u,v=Math.cos(e),y=Math.sin(e),b=1-v,m=f+(1-f)*v,d=o*i*b+u*y,p=o*u*b-i*y,h=o*i*b-u*y,w=l+(1-l)*v,x=i*u*b+o*y,j=o*u*b+i*y,F=i*u*b-o*y,_=s+(1-s)*v,O=r[0],E=r[1],A=r[2],S=r[3],M=r[4],g=r[5],T=r[6],P=r[7],R=r[8],z=r[9],k=r[10],U=r[11];n[0]=m*O+d*M+p*R,n[1]=m*E+d*g+p*z,n[2]=m*A+d*T+p*k,n[3]=m*S+d*P+p*U,n[4]=h*O+w*M+x*R,n[5]=h*E+w*g+x*z,n[6]=h*A+w*T+x*k,n[7]=h*S+w*P+x*U,n[8]=j*O+F*M+_*R,n[9]=j*E+F*g+_*z,n[10]=j*A+F*T+_*k,n[11]=j*S+F*P+_*U,r!==n&&(n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15]);return n},t.axisRotation=function(r,t,e){e=e||new c(16);var n=r[0],o=r[1],i=r[2],u=Math.sqrt(n*n+o*o+i*i),a=(n/=u)*n,f=(o/=u)*o,l=(i/=u)*i,s=Math.cos(t),v=Math.sin(t),y=1-s;return e[0]=a+(1-a)*s,e[1]=n*o*y+i*v,e[2]=n*i*y-o*v,e[3]=0,e[4]=n*o*y-i*v,e[5]=f+(1-f)*s,e[6]=o*i*y+n*v,e[7]=0,e[8]=n*i*y+o*v,e[9]=o*i*y-n*v,e[10]=l+(1-l)*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},t.copy=l,t.create=function(){return new c(16).fill(0)},t.frustum=function(r,t,e,n,o,i,u){u=u||new c(16);var a=t-r,f=n-e,l=o-i;return u[0]=2*o/a,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=2*o/f,u[6]=0,u[7]=0,u[8]=(r+t)/a,u[9]=(n+e)/f,u[10]=i/l,u[11]=-1,u[12]=0,u[13]=0,u[14]=o*i/l,u[15]=0,u},t.getAxis=function(r,t,e){e=e||o.create();var n=4*t;return e[0]=r[n+0],e[1]=r[n+1],e[2]=r[n+2],e},t.getTranslation=function(r,t){return(t=t||o.create())[0]=r[12],t[1]=r[13],t[2]=r[14],t},t.identity=s,t.inverse=v,t.lookAt=function(r,t,e,n){return n=n||new c(16),u=u||o.create(),a=a||o.create(),f=f||o.create(),o.normalize(o.subtract(r,t,f),f),o.normalize(o.cross(e,f,u),u),o.normalize(o.cross(f,u,a),a),n[0]=u[0],n[1]=u[1],n[2]=u[2],n[3]=0,n[4]=a[0],n[5]=a[1],n[6]=a[2],n[7]=0,n[8]=f[0],n[9]=f[1],n[10]=f[2],n[11]=0,n[12]=r[0],n[13]=r[1],n[14]=r[2],n[15]=1,n},t.multiply=function(r,t,e){e=e||new c(16);var n=r[0],o=r[1],i=r[2],u=r[3],a=r[4],f=r[5],l=r[6],s=r[7],v=r[8],y=r[9],b=r[10],m=r[11],d=r[12],p=r[13],h=r[14],w=r[15],x=t[0],j=t[1],F=t[2],_=t[3],O=t[4],E=t[5],A=t[6],S=t[7],M=t[8],g=t[9],T=t[10],P=t[11],R=t[12],z=t[13],k=t[14],U=t[15];return e[0]=n*x+a*j+v*F+d*_,e[1]=o*x+f*j+y*F+p*_,e[2]=i*x+l*j+b*F+h*_,e[3]=u*x+s*j+m*F+w*_,e[4]=n*O+a*E+v*A+d*S,e[5]=o*O+f*E+y*A+p*S,e[6]=i*O+l*E+b*A+h*S,e[7]=u*O+s*E+m*A+w*S,e[8]=n*M+a*g+v*T+d*P,e[9]=o*M+f*g+y*T+p*P,e[10]=i*M+l*g+b*T+h*P,e[11]=u*M+s*g+m*T+w*P,e[12]=n*R+a*z+v*k+d*U,e[13]=o*R+f*z+y*k+p*U,e[14]=i*R+l*z+b*k+h*U,e[15]=u*R+s*z+m*k+w*U,e},t.negate=function(r,t){return(t=t||new c(16))[0]=-r[0],t[1]=-r[1],t[2]=-r[2],t[3]=-r[3],t[4]=-r[4],t[5]=-r[5],t[6]=-r[6],t[7]=-r[7],t[8]=-r[8],t[9]=-r[9],t[10]=-r[10],t[11]=-r[11],t[12]=-r[12],t[13]=-r[13],t[14]=-r[14],t[15]=-r[15],t},t.ortho=function(r,t,e,n,o,i,u){return(u=u||new c(16))[0]=2/(t-r),u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=2/(n-e),u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=2/(o-i),u[11]=0,u[12]=(t+r)/(r-t),u[13]=(n+e)/(e-n),u[14]=(i+o)/(o-i),u[15]=1,u},t.perspective=function(r,t,e,n,o){o=o||new c(16);var i=Math.tan(.5*Math.PI-.5*r),u=1/(e-n);return o[0]=i/t,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=i,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=(e+n)*u,o[11]=-1,o[12]=0,o[13]=0,o[14]=e*n*u*2,o[15]=0,o},t.rotateX=function(r,t,e){e=e||new c(16);var n=r[4],o=r[5],i=r[6],u=r[7],a=r[8],f=r[9],l=r[10],s=r[11],v=Math.cos(t),y=Math.sin(t);e[4]=v*n+y*a,e[5]=v*o+y*f,e[6]=v*i+y*l,e[7]=v*u+y*s,e[8]=v*a-y*n,e[9]=v*f-y*o,e[10]=v*l-y*i,e[11]=v*s-y*u,r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]);return e},t.rotateY=function(r,t,e){e=e||new c(16);var n=r[0],o=r[1],i=r[2],u=r[3],a=r[8],f=r[9],l=r[10],s=r[11],v=Math.cos(t),y=Math.sin(t);e[0]=v*n-y*a,e[1]=v*o-y*f,e[2]=v*i-y*l,e[3]=v*u-y*s,e[8]=v*a+y*n,e[9]=v*f+y*o,e[10]=v*l+y*i,e[11]=v*s+y*u,r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]);return e},t.rotateZ=function(r,t,e){e=e||new c(16);var n=r[0],o=r[1],i=r[2],u=r[3],a=r[4],f=r[5],l=r[6],s=r[7],v=Math.cos(t),y=Math.sin(t);e[0]=v*n+y*a,e[1]=v*o+y*f,e[2]=v*i+y*l,e[3]=v*u+y*s,e[4]=v*a-y*n,e[5]=v*f-y*o,e[6]=v*l-y*i,e[7]=v*s-y*u,r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]);return e},t.rotationX=function(r,t){t=t||new c(16);var e=Math.cos(r),n=Math.sin(r);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.rotationY=function(r,t){t=t||new c(16);var e=Math.cos(r),n=Math.sin(r);return t[0]=e,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.rotationZ=function(r,t){t=t||new c(16);var e=Math.cos(r),n=Math.sin(r);return t[0]=e,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.scale=function(r,t,e){e=e||new c(16);var n=t[0],o=t[1],i=t[2];e[0]=n*r[0],e[1]=n*r[1],e[2]=n*r[2],e[3]=n*r[3],e[4]=o*r[4],e[5]=o*r[5],e[6]=o*r[6],e[7]=o*r[7],e[8]=i*r[8],e[9]=i*r[9],e[10]=i*r[10],e[11]=i*r[11],r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]);return e},t.scaling=function(r,t){return(t=t||new c(16))[0]=r[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=r[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.setAxis=function(r,t,e,n){n!==r&&(n=l(r,n));var o=4*e;return n[o+0]=t[0],n[o+1]=t[1],n[o+2]=t[2],n},t.setDefaultType=function(r){var t=c;return c=r,t},t.setTranslation=function(r,t,e){e=e||s(),r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11]);return e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e},t.transformDirection=function(r,t,e){e=e||o.create();var n=t[0],i=t[1],u=t[2];return e[0]=n*r[0]+i*r[4]+u*r[8],e[1]=n*r[1]+i*r[5]+u*r[9],e[2]=n*r[2]+i*r[6]+u*r[10],e},t.transformNormal=function(r,t,e){e=e||o.create();var n=v(r),i=t[0],u=t[1],a=t[2];return e[0]=i*n[0]+u*n[1]+a*n[2],e[1]=i*n[4]+u*n[5]+a*n[6],e[2]=i*n[8]+u*n[9]+a*n[10],e},t.transformPoint=function(r,t,e){e=e||o.create();var n=t[0],i=t[1],u=t[2],a=n*r[3]+i*r[7]+u*r[11]+r[15];return e[0]=(n*r[0]+i*r[4]+u*r[8]+r[12])/a,e[1]=(n*r[1]+i*r[5]+u*r[9]+r[13])/a,e[2]=(n*r[2]+i*r[6]+u*r[10]+r[14])/a,e},t.translate=function(r,t,e){e=e||new c(16);var n=t[0],o=t[1],i=t[2],u=r[0],a=r[1],f=r[2],l=r[3],s=r[4],v=r[5],y=r[6],b=r[7],m=r[8],d=r[9],p=r[10],h=r[11],w=r[12],x=r[13],j=r[14],F=r[15];r!==e&&(e[0]=u,e[1]=a,e[2]=f,e[3]=l,e[4]=s,e[5]=v,e[6]=y,e[7]=b,e[8]=m,e[9]=d,e[10]=p,e[11]=h);return e[12]=u*n+s*o+m*i+w,e[13]=a*n+v*o+d*i+x,e[14]=f*n+y*o+p*i+j,e[15]=l*n+b*o+h*i+F,e},t.translation=function(r,t){return(t=t||new c(16))[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},t.transpose=function(r,t){if((t=t||new c(16))===r){var e;return e=r[1],r[1]=r[4],r[4]=e,e=r[2],r[2]=r[8],r[8]=e,e=r[3],r[3]=r[12],r[12]=e,e=r[6],r[6]=r[9],r[9]=e,e=r[7],r[7]=r[13],r[13]=e,e=r[11],r[11]=r[14],r[14]=e,t}var n=r[0],o=r[1],i=r[2],u=r[3],a=r[4],f=r[5],l=r[6],s=r[7],v=r[8],y=r[9],b=r[10],m=r[11],d=r[12],p=r[13],h=r[14],w=r[15];return t[0]=n,t[1]=a,t[2]=v,t[3]=d,t[4]=o,t[5]=f,t[6]=y,t[7]=p,t[8]=i,t[9]=l,t[10]=b,t[11]=h,t[12]=u,t[13]=s,t[14]=m,t[15]=w,t};var o=function(r,t){if(!t&&r&&r.__esModule)return r;if(null===r||"object"!=n(r)&&"function"!=typeof r)return{default:r};var e=i(t);if(e&&e.has(r))return e.get(r);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if("default"!==a&&Object.prototype.hasOwnProperty.call(r,a)){var f=u?Object.getOwnPropertyDescriptor(r,a):null;f&&(f.get||f.set)?Object.defineProperty(o,a,f):o[a]=r[a]}return o.default=r,e&&e.set(r,o),o}(e(304));function i(r){if("function"!=typeof WeakMap)return null;var t=new WeakMap,e=new WeakMap;return(i=function(r){return r?e:t})(r)}var u,a,f,c=Float32Array;function l(r,t){return(t=t||new c(16))[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t}function s(r){return(r=r||new c(16))[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function v(r,t){t=t||new c(16);var e=r[0],n=r[1],o=r[2],i=r[3],u=r[4],a=r[5],f=r[6],l=r[7],s=r[8],v=r[9],y=r[10],b=r[11],m=r[12],d=r[13],p=r[14],h=r[15],w=y*h,x=p*b,j=f*h,F=p*l,_=f*b,O=y*l,E=o*h,A=p*i,S=o*b,M=y*i,g=o*l,T=f*i,P=s*d,R=m*v,z=u*d,k=m*a,U=u*v,C=s*a,W=e*d,I=m*n,L=e*v,G=s*n,B=e*a,N=u*n,X=w*a+F*v+_*d-(x*a+j*v+O*d),D=x*n+E*v+M*d-(w*n+A*v+S*d),H=j*n+A*a+g*d-(F*n+E*a+T*d),V=O*n+S*a+T*v-(_*n+M*a+g*v),Y=1/(e*X+u*D+s*H+m*V);return t[0]=Y*X,t[1]=Y*D,t[2]=Y*H,t[3]=Y*V,t[4]=Y*(x*u+j*s+O*m-(w*u+F*s+_*m)),t[5]=Y*(w*e+A*s+S*m-(x*e+E*s+M*m)),t[6]=Y*(F*e+E*u+T*m-(j*e+A*u+g*m)),t[7]=Y*(_*e+M*u+g*s-(O*e+S*u+T*s)),t[8]=Y*(P*l+k*b+U*h-(R*l+z*b+C*h)),t[9]=Y*(R*i+W*b+G*h-(P*i+I*b+L*h)),t[10]=Y*(z*i+I*l+B*h-(k*i+W*l+N*h)),t[11]=Y*(C*i+L*l+N*b-(U*i+G*l+B*b)),t[12]=Y*(z*y+C*p+R*f-(U*p+P*f+k*y)),t[13]=Y*(L*p+P*o+I*y-(W*y+G*p+R*o)),t[14]=Y*(W*f+N*p+k*o-(B*p+z*o+I*f)),t[15]=Y*(B*y+U*o+G*f-(L*f+N*y+C*o)),t}},777:(r,t,e)=>{function n(r){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n(r)}t.__esModule=!0,t.concatVertices=function(r){for(var t,e={},n=function(){var n=r[o];Object.keys(n).forEach((function(r){e[r]||(e[r]=[]),t||"indices"===r||(t=r);var o=n[r],i=v(o,r),u=s(o).length/i;e[r].push(u)}))},o=0;o<r.length;++o)n();var i=e[t],u={};return Object.keys(e).forEach((function(t){var e=function(t){for(var e,n=0,o=0;o<r.length;++o){var i=r[o][t];n+=s(i).length,e&&!i.data||(e=i)}return{length:n,spec:e}}(t),n=I(e.spec,e.length);!function(t,e,n){for(var o=0,i=0,u=0;u<r.length;++u){var a=r[u][t],f=s(a);"indices"===t?(W(f,n,i,o),o+=e[u]):W(f,n,i),i+=f.length}}(t,i,s(n)),u[t]=n})),u},t.create3DFBuffers=t.create3DFBufferInfo=void 0,t.create3DFVertices=g,t.createAugmentedTypedArray=b,t.createCrescentBuffers=t.createCrescentBufferInfo=void 0,t.createCrescentVertices=T,t.createCubeBuffers=t.createCubeBufferInfo=t.createCresentVertices=t.createCresentBuffers=t.createCresentBufferInfo=void 0,t.createCubeVertices=A,t.createCylinderBuffers=t.createCylinderBufferInfo=void 0,t.createCylinderVertices=P,t.createDiscBuffers=t.createDiscBufferInfo=void 0,t.createDiscVertices=z,t.createPlaneBuffers=t.createPlaneBufferInfo=void 0,t.createPlaneVertices=_,t.createSphereBuffers=t.createSphereBufferInfo=void 0,t.createSphereVertices=O,t.createTorusBuffers=t.createTorusBufferInfo=void 0,t.createTorusVertices=R,t.createTruncatedConeBuffers=t.createTruncatedConeBufferInfo=void 0,t.createTruncatedConeVertices=S,t.createXYQuadBuffers=t.createXYQuadBufferInfo=void 0,t.createXYQuadVertices=F,t.deindexVertices=function(r){var t=r.indices,e={},n=t.length;return Object.keys(r).filter(m).forEach((function(o){for(var i=r[o],u=i.numComponents,a=b(u,n,i.constructor),f=0;f<n;++f)for(var c=t[f]*u,l=0;l<u;++l)a.push(i[c+l]);e[o]=a})),e},t.duplicateVertices=function(r){var t={};return Object.keys(r).forEach((function(e){var n=r[e],o=s(n),i=I(n,o.length);W(o,s(i),0),t[e]=i})),t},t.flattenNormals=function(r){if(r.indices)throw new Error("can not flatten normals of indexed vertices. deindex them first");for(var t=r.normal,e=t.length,n=0;n<e;n+=9){var o=t[n+0],i=t[n+1],u=t[n+2],a=t[n+3],f=t[n+4],c=t[n+5],l=o+a+t[n+6],s=i+f+t[n+7],v=u+c+t[n+8],y=Math.sqrt(l*l+s*s+v*v);l/=y,s/=y,v/=y,t[n+0]=l,t[n+1]=s,t[n+2]=v,t[n+3]=l,t[n+4]=s,t[n+5]=v,t[n+6]=l,t[n+7]=s,t[n+8]=v}return r},t.makeRandomVertexColors=function(r,t){t=t||{};var e=r.position.numElements,n=b(4,e,Uint8Array),o=t.rand||function(r,t){return t<3?(e=256,Math.random()*e|0):255;var e};if(r.color=n,r.indices)for(var i=0;i<e;++i)n.push(o(i,0),o(i,1),o(i,2),o(i,3));else for(var u=t.vertsPerColor||3,a=e/u,f=0;f<a;++f)for(var c=[o(f,0),o(f,1),o(f,2),o(f,3)],l=0;l<u;++l)n.push(c);return r},t.reorientDirections=h,t.reorientNormals=w,t.reorientPositions=x,t.reorientVertices=j;var o=l(e(650)),i=l(e(303)),u=l(e(801)),a=l(e(362)),f=l(e(304));function c(r){if("function"!=typeof WeakMap)return null;var t=new WeakMap,e=new WeakMap;return(c=function(r){return r?e:t})(r)}function l(r,t){if(!t&&r&&r.__esModule)return r;if(null===r||"object"!=n(r)&&"function"!=typeof r)return{default:r};var e=c(t);if(e&&e.has(r))return e.get(r);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in r)if("default"!==u&&Object.prototype.hasOwnProperty.call(r,u)){var a=i?Object.getOwnPropertyDescriptor(r,u):null;a&&(a.get||a.set)?Object.defineProperty(o,u,a):o[u]=r[u]}return o.default=r,e&&e.set(r,o),o}var s=o.getArray_,v=o.getNumComponents_;function y(r,t){var e=0;return r.push=function(){for(var t=0;t<arguments.length;++t){var n=arguments[t];if(n instanceof Array||u.isArrayBuffer(n))for(var o=0;o<n.length;++o)r[e++]=n[o];else r[e++]=n}},r.reset=function(r){e=r||0},r.numComponents=t,Object.defineProperty(r,"numElements",{get:function(){return this.length/this.numComponents|0}}),r}function b(r,t,e){return y(new(e||Float32Array)(r*t),r)}function m(r){return"indices"!==r}function d(r,t,e){for(var n=r.length,o=new Float32Array(3),i=0;i<n;i+=3)e(t,[r[i],r[i+1],r[i+2]],o),r[i]=o[0],r[i+1]=o[1],r[i+2]=o[2]}function p(r,t,e){e=e||f.create();var n=t[0],o=t[1],i=t[2];return e[0]=n*r[0]+o*r[1]+i*r[2],e[1]=n*r[4]+o*r[5]+i*r[6],e[2]=n*r[8]+o*r[9]+i*r[10],e}function h(r,t){return d(r,t,a.transformDirection),r}function w(r,t){return d(r,a.inverse(t),p),r}function x(r,t){return d(r,t,a.transformPoint),r}function j(r,t){return Object.keys(r).forEach((function(e){var n=r[e];e.indexOf("pos")>=0?x(n,t):e.indexOf("tan")>=0||e.indexOf("binorm")>=0?h(n,t):e.indexOf("norm")>=0&&w(n,t)})),r}function F(r,t,e){return r=r||2,{position:{numComponents:2,data:[(t=t||0)+-1*(r*=.5),(e=e||0)+-1*r,t+1*r,e+-1*r,t+-1*r,e+1*r,t+1*r,e+1*r]},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 _(r,t,e,n,o){r=r||1,t=t||1,e=e||1,n=n||1,o=o||a.identity();for(var i=(e+1)*(n+1),u=b(3,i),f=b(3,i),c=b(2,i),l=0;l<=n;l++)for(var s=0;s<=e;s++){var v=s/e,y=l/n;u.push(r*v-.5*r,0,t*y-.5*t),f.push(0,1,0),c.push(v,y)}for(var m=e+1,d=b(3,e*n*2,Uint16Array),p=0;p<n;p++)for(var h=0;h<e;h++)d.push((p+0)*m+h,(p+1)*m+h,(p+0)*m+h+1),d.push((p+1)*m+h,(p+1)*m+h+1,(p+0)*m+h+1);return j({position:u,normal:f,texcoord:c,indices:d},o)}function O(r,t,e,n,o,i,u){if(t<=0||e<=0)throw new Error("subdivisionAxis and subdivisionHeight must be > 0");n=n||0,i=i||0;for(var a=(o=o||Math.PI)-n,f=(u=u||2*Math.PI)-i,c=(t+1)*(e+1),l=b(3,c),s=b(3,c),v=b(2,c),y=0;y<=e;y++)for(var m=0;m<=t;m++){var d=m/t,p=y/e,h=f*d+i,w=a*p+n,x=Math.sin(h),j=Math.cos(h),F=Math.sin(w),_=j*F,O=Math.cos(w),E=x*F;l.push(r*_,r*O,r*E),s.push(_,O,E),v.push(1-d,p)}for(var A=t+1,S=b(3,t*e*2,Uint16Array),M=0;M<t;M++)for(var g=0;g<e;g++)S.push((g+0)*A+M,(g+0)*A+M+1,(g+1)*A+M),S.push((g+1)*A+M,(g+0)*A+M+1,(g+1)*A+M+1);return{position:l,normal:s,texcoord:v,indices:S}}var E=[[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 A(r){for(var t=(r=r||1)/2,e=[[-t,-t,-t],[+t,-t,-t],[-t,+t,-t],[+t,+t,-t],[-t,-t,+t],[+t,-t,+t],[-t,+t,+t],[+t,+t,+t]],n=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],o=[[1,0],[0,0],[0,1],[1,1]],i=b(3,24),u=b(3,24),a=b(2,24),f=b(3,12,Uint16Array),c=0;c<6;++c){for(var l=E[c],s=0;s<4;++s){var v=e[l[s]],y=n[c],m=o[s];i.push(v),u.push(y),a.push(m)}var d=4*c;f.push(d+0,d+1,d+2),f.push(d+0,d+2,d+3)}return{position:i,normal:u,texcoord:a,indices:f}}function S(r,t,e,n,o,i,u){if(n<3)throw new Error("radialSubdivisions must be 3 or greater");if(o<1)throw new Error("verticalSubdivisions must be 1 or greater");for(var a=void 0===i||i,f=void 0===u||u,c=(a?2:0)+(f?2:0),l=(n+1)*(o+1+c),s=b(3,l),v=b(3,l),y=b(2,l),m=b(3,n*(o+c/2)*2,Uint16Array),d=n+1,p=Math.atan2(r-t,e),h=Math.cos(p),w=Math.sin(p),x=o+(f?2:0),j=a?-2:0;j<=x;++j){var F=j/o,_=e*F,O=void 0;j<0?(_=0,F=1,O=r):j>o?(_=e,F=1,O=t):O=r+j/o*(t-r),-2!==j&&j!==o+2||(O=0,F=0),_-=e/2;for(var E=0;E<d;++E){var A=Math.sin(E*Math.PI*2/n),S=Math.cos(E*Math.PI*2/n);s.push(A*O,_,S*O),j<0?v.push(0,-1,0):j>o?v.push(0,1,0):0===O?v.push(0,0,0):v.push(A*h,w,S*h),y.push(E/n,1-F)}}for(var M=0;M<o+c;++M)if(!(1===M&&a||M===o+c-2&&f))for(var g=0;g<n;++g)m.push(d*(M+0)+0+g,d*(M+0)+1+g,d*(M+1)+1+g),m.push(d*(M+0)+0+g,d*(M+1)+1+g,d*(M+1)+0+g);return{position:s,normal:v,texcoord:y,indices:m}}function M(r,t){t=t||[];for(var e=[],n=0;n<r.length;n+=4){var o=r[n],i=r.slice(n+1,n+4);i.push.apply(i,t);for(var u=0;u<o;++u)e.push.apply(e,i)}return e}function g(){var r=[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],t=M([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]),e=M([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]),n=r.length/3,o={position:b(3,n),texcoord:b(2,n),normal:b(3,n),color:b(4,n,Uint8Array),indices:b(3,n/3,Uint16Array)};o.position.push(r),o.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]),o.normal.push(t),o.color.push(e);for(var i=0;i<n;++i)o.indices.push(i);return o}function T(r,t,e,n,o,i,u){if(o<=0)throw new Error("subdivisionDown must be > 0");var a=(u=u||1)-(i=i||0),c=2*(o+1)*4,l=b(3,c),s=b(3,c),v=b(2,c);function y(r,t,e){return r+(t-r)*e}function m(t,e,u,c,b,m){for(var d=0;d<=o;d++){var p=e/1,h=d/o,w=2*(p-.5),x=(i+h*a)*Math.PI,j=Math.sin(x),F=Math.cos(x),_=y(r,t,j),O=w*n,E=F*r,A=j*_;l.push(O,E,A);var S=f.add(f.multiply([0,j,F],u),c);s.push(S),v.push(p*b+m,h)}}for(var d=0;d<2;d++){var p=2*(d/1-.5);m(t,d,[1,1,1],[0,0,0],1,0),m(t,d,[0,0,0],[p,0,0],0,0),m(e,d,[1,1,1],[0,0,0],1,0),m(e,d,[0,0,0],[p,0,0],0,1)}var h=b(3,2*o*4,Uint16Array);function w(r,t){for(var e=0;e<o;++e)h.push(r+e+0,r+e+1,t+e+0),h.push(r+e+1,t+e+1,t+e+0)}var x=o+1;return w(0*x,4*x),w(5*x,7*x),w(6*x,2*x),w(3*x,1*x),{position:l,normal:s,texcoord:v,indices:h}}function P(r,t,e,n,o,i){return S(r,r,t,e,n,o,i)}function R(r,t,e,n,o,i){if(e<3)throw new Error("radialSubdivisions must be 3 or greater");if(n<3)throw new Error("verticalSubdivisions must be 3 or greater");o=o||0;for(var u=(i=i||2*Math.PI)-o,a=e+1,f=n+1,c=a*f,l=b(3,c),s=b(3,c),v=b(2,c),y=b(3,e*n*2,Uint16Array),m=0;m<f;++m)for(var d=m/n,p=d*Math.PI*2,h=Math.sin(p),w=r+h*t,x=Math.cos(p),j=x*t,F=0;F<a;++F){var _=F/e,O=o+_*u,E=Math.sin(O),A=Math.cos(O),S=E*w,M=A*w,g=E*h,T=A*h;l.push(S,j,M),s.push(g,x,T),v.push(_,1-d)}for(var P=0;P<n;++P)for(var R=0;R<e;++R){var z=1+R,k=1+P;y.push(a*P+R,a*k+R,a*P+z),y.push(a*k+R,a*k+z,a*P+z)}return{position:l,normal:s,texcoord:v,indices:y}}function z(r,t,e,n,o){if(t<3)throw new Error("divisions must be at least 3");o=o||1,n=n||0;for(var i=(t+1)*((e=e||1)+1),u=b(3,i),a=b(3,i),f=b(2,i),c=b(3,e*t*2,Uint16Array),l=0,s=r-n,v=t+1,y=0;y<=e;++y){for(var m=n+s*Math.pow(y/e,o),d=0;d<=t;++d){var p=2*Math.PI*d/t,h=m*Math.cos(p),w=m*Math.sin(p);if(u.push(h,0,w),a.push(0,1,0),f.push(1-d/t,y/e),y>0&&d!==t){var x=l+(d+1),j=l+d,F=l+d-v,_=l+(d+1)-v;c.push(x,j,F),c.push(x,F,_)}}l+=t+1}return{position:u,normal:a,texcoord:f,indices:c}}function k(r){return function(t){var e=r.apply(this,Array.prototype.slice.call(arguments,1));return o.createBuffersFromArrays(t,e)}}function U(r){return function(t){var e=r.apply(null,Array.prototype.slice.call(arguments,1));return o.createBufferInfoFromArrays(t,e)}}var C=["numComponents","size","type","normalize","stride","offset","attrib","name","attribName"];function W(r,t,e,n){n=n||0;for(var o=r.length,i=0;i<o;++i)t[e+i]=r[i]+n}function I(r,t){var e=s(r),n=new e.constructor(t),o=n;return e.numComponents&&e.numElements&&y(n,e.numComponents),r.data&&(o={data:n},i.copyNamedProperties(C,r,o)),o}t.create3DFBufferInfo=U(g),t.create3DFBuffers=k(g),t.createCubeBufferInfo=U(A),t.createCubeBuffers=k(A),t.createPlaneBufferInfo=U(_),t.createPlaneBuffers=k(_),t.createSphereBufferInfo=U(O),t.createSphereBuffers=k(O),t.createTruncatedConeBufferInfo=U(S),t.createTruncatedConeBuffers=k(S),t.createXYQuadBufferInfo=U(F),t.createXYQuadBuffers=k(F);var L=t.createCrescentBufferInfo=U(T),G=t.createCrescentBuffers=k(T);t.createCylinderBufferInfo=U(P),t.createCylinderBuffers=k(P),t.createTorusBufferInfo=U(R),t.createTorusBuffers=k(R),t.createDiscBufferInfo=U(z),t.createDiscBuffers=k(z),t.createCresentBufferInfo=L,t.createCresentBuffers=G,t.createCresentVertices=T},38:(r,t,e)=>{function n(r){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n(r)}t.__esModule=!0,t.bindTransformFeedbackInfo=Pr,t.bindUniformBlock=Cr,t.createAttributeSetters=Lr,t.createProgram=hr,t.createProgramAsync=void 0,t.createProgramFromScripts=function(r,t,e,n,o){var i,u=br(e,n,o),a=[],f=m(t);try{for(f.s();!(i=f.n()).done;){var c=i.value,l=j(c);if(!l)return vr(u,"unknown script element: ".concat(c));a.push(l.text)}}catch(r){f.e(r)}finally{f.f()}return hr(r,a,u)},t.createProgramFromSources=Or,t.createProgramInfo=Xr,t.createProgramInfoAsync=void 0,t.createProgramInfoFromProgram=Br,t.createProgramInfos=Vr,t.createProgramInfosAsync=void 0,t.createPrograms=Hr,t.createProgramsAsync=void 0,t.createTransformFeedback=function(r,t,e){var n=r.createTransformFeedback();return r.bindTransformFeedback(M,n),r.useProgram(t.program),Pr(r,t,e),r.bindTransformFeedback(M,null),n},t.createTransformFeedbackInfo=Tr,t.createUniformBlockInfo=function(r,t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Ur(r,t.program,t.uniformBlockSpec,e,n)},t.createUniformBlockInfoFromProgram=Ur,t.createUniformBlockSpecFromProgram=Rr,t.createUniformSetters=gr,t.setAttributes=Gr,t.setBlockUniforms=function(r,t){var e=r.setters;for(var n in t){var o=e[n];if(o)o(t[n])}},t.setBuffersAndAttributes=function(r,t,e){e.vertexArrayObject?r.bindVertexArray(e.vertexArrayObject):(Gr(t.attribSetters||t,e.attribs),e.indices&&r.bindBuffer(E,e.indices))},t.setUniformBlock=function(r,t,e){Cr(r,t,e)&&r.bufferSubData(A,0,e.asUint8,e.offset||0,e.size||0)},t.setUniforms=Ir,t.setUniformsAndBindTextures=void 0;var o=a(e(854)),i=a(e(303));function u(r){if("function"!=typeof WeakMap)return null;var t=new WeakMap,e=new WeakMap;return(u=function(r){return r?e:t})(r)}function a(r,t){if(!t&&r&&r.__esModule)return r;if(null===r||"object"!=n(r)&&"function"!=typeof r)return{default:r};var e=u(t);if(e&&e.has(r))return e.get(r);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if("default"!==a&&Object.prototype.hasOwnProperty.call(r,a)){var f=i?Object.getOwnPropertyDescriptor(r,a):null;f&&(f.get||f.set)?Object.defineProperty(o,a,f):o[a]=r[a]}return o.default=r,e&&e.set(r,o),o}function f(){f=function(){return t};var r,t={},e=Object.prototype,o=e.hasOwnProperty,i=Object.defineProperty||function(r,t,e){r[t]=e.value},u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function s(r,t,e){return Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{s({},"")}catch(r){s=function(r,t,e){return r[t]=e}}function v(r,t,e,n){var o=t&&t.prototype instanceof w?t:w,u=Object.create(o.prototype),a=new R(n||[]);return i(u,"_invoke",{value:M(r,e,a)}),u}function y(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(r){return{type:"throw",arg:r}}}t.wrap=v;var b="suspendedStart",m="suspendedYield",d="executing",p="completed",h={};function w(){}function x(){}function j(){}var F={};s(F,a,(function(){return this}));var _=Object.getPrototypeOf,O=_&&_(_(z([])));O&&O!==e&&o.call(O,a)&&(F=O);var E=j.prototype=w.prototype=Object.create(F);function A(r){["next","throw","return"].forEach((function(t){s(r,t,(function(r){return this._invoke(t,r)}))}))}function S(r,t){function e(i,u,a,f){var c=y(r[i],r,u);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==n(s)&&o.call(s,"__await")?t.resolve(s.__await).then((function(r){e("next",r,a,f)}),(function(r){e("throw",r,a,f)})):t.resolve(s).then((function(r){l.value=r,a(l)}),(function(r){return e("throw",r,a,f)}))}f(c.arg)}var u;i(this,"_invoke",{value:function(r,n){function o(){return new t((function(t,o){e(r,n,t,o)}))}return u=u?u.then(o,o):o()}})}function M(t,e,n){var o=b;return function(i,u){if(o===d)throw new Error("Generator is already running");if(o===p){if("throw"===i)throw u;return{value:r,done:!0}}for(n.method=i,n.arg=u;;){var a=n.delegate;if(a){var f=g(a,n);if(f){if(f===h)continue;return f}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===b)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=y(t,e,n);if("normal"===c.type){if(o=n.done?p:m,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=p,n.method="throw",n.arg=c.arg)}}}function g(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,g(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=y(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var u=i.arg;return u?u.done?(e[t.resultName]=u.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,h):u:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function T(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function P(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function R(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(T,this),this.reset(!0)}function z(t){if(t||""===t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,u=function e(){for(;++i<t.length;)if(o.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=r,e.done=!0,e};return u.next=u}}throw new TypeError(n(t)+" is not iterable")}return x.prototype=j,i(E,"constructor",{value:j,configurable:!0}),i(j,"constructor",{value:x,configurable:!0}),x.displayName=s(j,l,"GeneratorFunction"),t.isGeneratorFunction=function(r){var t="function"==typeof r&&r.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,j):(r.__proto__=j,s(r,l,"GeneratorFunction")),r.prototype=Object.create(E),r},t.awrap=function(r){return{__await:r}},A(S.prototype),s(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var u=new S(v(r,e,n,o),i);return t.isGeneratorFunction(e)?u:u.next().then((function(r){return r.done?r.value:u.next()}))},A(E),s(E,l,"Generator"),s(E,a,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),t.keys=function(r){var t=Object(r),e=[];for(var n in t)e.push(n);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=z,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var r=this.tryEntries[0].completion;if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return a.type="throw",a.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],a=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var f=o.call(u,"catchLoc"),c=o.call(u,"finallyLoc");if(f&&c){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(f){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.finallyLoc)}}}},abrupt:function(r,t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===r||"continue"===r)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=r,u.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(u)},complete:function(r,t){if("throw"===r.type)throw r.arg;return"break"===r.type||"continue"===r.type?this.next=r.arg:"return"===r.type?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):"normal"===r.type&&t&&(this.next=t),h},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e.finallyLoc===r)return this.complete(e.completion,e.afterLoc),P(e),h}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e.tryLoc===r){var n=e.completion;if("throw"===n.type){var o=n.arg;P(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:z(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),h}},t}function c(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function l(r){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?c(Object(e),!0).forEach((function(t){s(r,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):c(Object(e)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}))}return r}function s(r,t,e){var o;return o=function(r,t){if("object"!=n(r)||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var o=e.call(r,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(t,"string"),(t="symbol"==n(o)?o:String(o))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function v(r,t,e,n,o,i,u){try{var a=r[i](u),f=a.value}catch(r){return void e(r)}a.done?t(f):Promise.resolve(f).then(n,o)}function y(r){return function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function u(r){v(i,n,o,u,a,"next",r)}function a(r){v(i,n,o,u,a,"throw",r)}u(void 0)}))}}function b(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,o,i,u,a=[],f=!0,c=!1;try{if(i=(e=e.call(r)).next,0===t){if(Object(e)!==e)return;f=!1}else for(;!(f=(n=i.call(e)).done)&&(a.push(n.value),a.length!==t);f=!0);}catch(r){c=!0,o=r}finally{try{if(!f&&null!=e.return&&(u=e.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(r,t)||p(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=p(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return u=r.done,r},e:function(r){a=!0,i=r},f:function(){try{u||null==e.return||e.return()}finally{if(a)throw i}}}}function d(r){return function(r){if(Array.isArray(r))return h(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||p(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(r,t){if(r){if("string"==typeof r)return h(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?h(r,t):void 0}}function h(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var w=i.error,x=i.warn;function j(r){return"undefined"!=typeof document&&document.getElementById?document.getElementById(r):null}var F=33984,_=35048,O=34962,E=34963,A=35345,S=35982,M=36386,g=35713,T=35714,P=35632,R=35633,z=35981,k=35718,U=35721,C=35971,W=35382,I=35396,L=35398,G=35392,B=35395,N=5126,X=5124,D=5125,H=3553,V=34067,Y=32879,q=35866,K={};function $(r,t){return K[t].bindPoint}function Z(r,t){return function(e){r.uniform1i(t,e)}}function J(r,t){return function(e){r.uniform1iv(t,e)}}function Q(r,t){return function(e){r.uniform2iv(t,e)}}function rr(r,t){return function(e){r.uniform3iv(t,e)}}function tr(r,t){return function(e){r.uniform4iv(t,e)}}function er(r,t,e,n){var u=$(0,t);return o.isWebGL2(r)?function(t){var o,a;!t||i.isTexture(r,t)?(o=t,a=null):(o=t.texture,a=t.sampler),r.uniform1i(n,e),r.activeTexture(F+e),r.bindTexture(u,o),r.bindSampler(e,a)}:function(t){r.uniform1i(n,e),r.activeTexture(F+e),r.bindTexture(u,t)}}function nr(r,t,e,n,u){for(var a=$(0,t),f=new Int32Array(u),c=0;c<u;++c)f[c]=e+c;return o.isWebGL2(r)?function(t){r.uniform1iv(n,f),t.forEach((function(t,n){var o,u;r.activeTexture(F+f[n]),!t||i.isTexture(r,t)?(o=t,u=null):(o=t.texture,u=t.sampler),r.bindSampler(e,u),r.bindTexture(a,o)}))}:function(t){r.uniform1iv(n,f),t.forEach((function(t,e){r.activeTexture(F+f[e]),r.bindTexture(a,t)}))}}function or(r,t){return function(e){if(e.value)switch(r.disableVertexAttribArray(t),e.value.length){case 4:r.vertexAttrib4fv(t,e.value);break;case 3:r.vertexAttrib3fv(t,e.value);break;case 2:r.vertexAttrib2fv(t,e.value);break;case 1:r.vertexAttrib1fv(t,e.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else r.bindBuffer(O,e.buffer),r.enableVertexAttribArray(t),r.vertexAttribPointer(t,e.numComponents||e.size,e.type||N,e.normalize||!1,e.stride||0,e.offset||0),r.vertexAttribDivisor&&r.vertexAttribDivisor(t,e.divisor||0)}}function ir(r,t){return function(e){if(e.value){if(r.disableVertexAttribArray(t),4!==e.value.length)throw new Error("The length of an integer constant value must be 4!");r.vertexAttrib4iv(t,e.value)}else r.bindBuffer(O,e.buffer),r.enableVertexAttribArray(t),r.vertexAttribIPointer(t,e.numComponents||e.size,e.type||X,e.stride||0,e.offset||0),r.vertexAttribDivisor&&r.vertexAttribDivisor(t,e.divisor||0)}}function ur(r,t){return function(e){if(e.value){if(r.disableVertexAttribArray(t),4!==e.value.length)throw new Error("The length of an unsigned integer constant value must be 4!");r.vertexAttrib4uiv(t,e.value)}else r.bindBuffer(O,e.buffer),r.enableVertexAttribArray(t),r.vertexAttribIPointer(t,e.numComponents||e.size,e.type||D,e.stride||0,e.offset||0),r.vertexAttribDivisor&&r.vertexAttribDivisor(t,e.divisor||0)}}function ar(r,t,e){var n=e.size,o=e.count;return function(e){r.bindBuffer(O,e.buffer);for(var i=e.size||e.numComponents||n,u=i/o,a=e.type||N,f=K[a].size*i,c=e.normalize||!1,l=e.offset||0,s=f/o,v=0;v<o;++v)r.enableVertexAttribArray(t+v),r.vertexAttribPointer(t+v,u,a,c,f,l+s*v),r.vertexAttribDivisor&&r.vertexAttribDivisor(t+v,e.divisor||0)}}K[5126]={Type:Float32Array,size:4,setter:function(r,t){return function(e){r.uniform1f(t,e)}},arraySetter:function(r,t){return function(e){r.uniform1fv(t,e)}}},K[35664]={Type:Float32Array,size:8,setter:function(r,t){return function(e){r.uniform2fv(t,e)}},cols:2},K[35665]={Type:Float32Array,size:12,setter:function(r,t){return function(e){r.uniform3fv(t,e)}},cols:3},K[35666]={Type:Float32Array,size:16,setter:function(r,t){return function(e){r.uniform4fv(t,e)}},cols:4},K[X]={Type:Int32Array,size:4,setter:Z,arraySetter:J},K[35667]={Type:Int32Array,size:8,setter:Q,cols:2},K[35668]={Type:Int32Array,size:12,setter:rr,cols:3},K[35669]={Type:Int32Array,size:16,setter:tr,cols:4},K[5125]={Type:Uint32Array,size:4,setter:function(r,t){return function(e){r.uniform1ui(t,e)}},arraySetter:function(r,t){return function(e){r.uniform1uiv(t,e)}}},K[36294]={Type:Uint32Array,size:8,setter:function(r,t){return function(e){r.uniform2uiv(t,e)}},cols:2},K[36295]={Type:Uint32Array,size:12,setter:function(r,t){return function(e){r.uniform3uiv(t,e)}},cols:3},K[36296]={Type:Uint32Array,size:16,setter:function(r,t){return function(e){r.uniform4uiv(t,e)}},cols:4},K[35670]={Type:Uint32Array,size:4,setter:Z,arraySetter:J},K[35671]={Type:Uint32Array,size:8,setter:Q,cols:2},K[35672]={Type:Uint32Array,size:12,setter:rr,cols:3},K[35673]={Type:Uint32Array,size:16,setter:tr,cols:4},K[35674]={Type:Float32Array,size:32,setter:function(r,t){return function(e){r.uniformMatrix2fv(t,!1,e)}},rows:2,cols:2},K[35675]={Type:Float32Array,size:48,setter:function(r,t){return function(e){r.uniformMatrix3fv(t,!1,e)}},rows:3,cols:3},K[35676]={Type:Float32Array,size:64,setter:function(r,t){return function(e){r.uniformMatrix4fv(t,!1,e)}},rows:4,cols:4},K[35685]={Type:Float32Array,size:32,setter:function(r,t){return function(e){r.uniformMatrix2x3fv(t,!1,e)}},rows:2,cols:3},K[35686]={Type:Float32Array,size:32,setter:function(r,t){return function(e){r.uniformMatrix2x4fv(t,!1,e)}},rows:2,cols:4},K[35687]={Type:Float32Array,size:48,setter:function(r,t){return function(e){r.uniformMatrix3x2fv(t,!1,e)}},rows:3,cols:2},K[35688]={Type:Float32Array,size:48,setter:function(r,t){return function(e){r.uniformMatrix3x4fv(t,!1,e)}},rows:3,cols:4},K[35689]={Type:Float32Array,size:64,setter:function(r,t){return function(e){r.uniformMatrix4x2fv(t,!1,e)}},rows:4,cols:2},K[35690]={Type:Float32Array,size:64,setter:function(r,t){return function(e){r.uniformMatrix4x3fv(t,!1,e)}},rows:4,cols:3},K[35678]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:H},K[35680]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:V},K[35679]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:Y},K[35682]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:H},K[36289]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:q},K[36292]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:q},K[36293]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:V},K[36298]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:H},K[36299]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:Y},K[36300]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:V},K[36303]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:q},K[36306]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:H},K[36307]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:Y},K[36308]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:V},K[36311]={Type:null,size:0,setter:er,arraySetter:nr,bindPoint:q};var fr={};fr[5126]={size:4,setter:or},fr[35664]={size:8,setter:or},fr[35665]={size:12,setter:or},fr[35666]={size:16,setter:or},fr[X]={size:4,setter:ir},fr[35667]={size:8,setter:ir},fr[35668]={size:12,setter:ir},fr[35669]={size:16,setter:ir},fr[5125]={size:4,setter:ur},fr[36294]={size:8,setter:ur},fr[36295]={size:12,setter:ur},fr[36296]={size:16,setter:ur},fr[35670]={size:4,setter:ir},fr[35671]={size:8,setter:ir},fr[35672]={size:12,setter:ir},fr[35673]={size:16,setter:ir},fr[35674]={size:4,setter:ar,count:2},fr[35675]={size:9,setter:ar,count:3},fr[35676]={size:16,setter:ar,count:4};var cr=/ERROR:\s*\d+:(\d+)/gi;var lr=/^[ \t]*\n/;function sr(r){var t=0;return lr.test(r)&&(t=1,r=r.replace(lr,"")),{lineOffset:t,shaderSource:r}}function vr(r,t){return r.errorCallback(t),r.callback&&setTimeout((function(){r.callback("".concat(t,"\n").concat(r.errors.join("\n")))})),null}function yr(r,t,e,n){if(n=n||w,!r.getShaderParameter(e,g)){var i=r.getShaderInfoLog(e),u=sr(r.getShaderSource(e)),a=u.lineOffset,f=u.shaderSource,c="".concat(function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=d(t.matchAll(cr)),o=new Map(n.map((function(r,e){var o=parseInt(r[1]),i=n[e+1],u=i?i.index:t.length;return[o-1,t.substring(r.index,u)]})));return r.split("\n").map((function(r,t){var n=o.get(t);return"".concat(t+1+e,": ").concat(r).concat(n?"\n\n^^^ ".concat(n):"")})).join("\n")}(f,i,a),"\nError compiling ").concat(o.glEnumToString(r,t),": ").concat(i);return n(c),c}return""}function br(r,t,e){var n,o,i;if("function"==typeof t&&(e=t,t=void 0),"function"==typeof r)e=r,r=void 0;else if(r&&!Array.isArray(r)){var u=r;e=u.errorCallback,r=u.attribLocations,n=u.transformFeedbackVaryings,o=u.transformFeedbackMode,i=u.callback}var a=e||w,f=[],c={errorCallback:function(r){f.push(r);for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];a.apply(void 0,[r].concat(e))},transformFeedbackVaryings:n,transformFeedbackMode:o,callback:i,errors:f},l={};return Array.isArray(r)?r.forEach((function(r,e){l[r]=t?t[e]:e})):l=r||{},c.attribLocations=l,c}var mr=["VERTEX_SHADER","FRAGMENT_SHADER"];var dr=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,r)}))};function pr(r,t,e){for(var n,o=r.createProgram(),i=br(e),u=i.attribLocations,a=i.transformFeedbackVaryings,f=i.transformFeedbackMode,c=0;c<t.length;++c){var l=t[c];if("string"==typeof l){var s=j(l),v=s?s.text:l,y=r[mr[c]];s&&s.type&&(y=((n=s.type).indexOf("frag")>=0?P:n.indexOf("vert")>=0?R:void 0)||y),l=r.createShader(y),r.shaderSource(l,sr(v).shaderSource),r.compileShader(l),r.attachShader(o,l)}}Object.entries(u).forEach((function(t){var e=b(t,2),n=e[0],i=e[1];return r.bindAttribLocation(o,i,n)}));var m=a;return m&&(m.attribs&&(m=m.attribs),Array.isArray(m)||(m=Object.keys(m)),r.transformFeedbackVaryings(o,m,f||z)),r.linkProgram(o),o}function hr(r,t,e,n,o){var i=br(e,n,o),u=new Set(t),a=pr(r,t,i);function f(r,t){var e=_r(r,t,i.errorCallback);return e&&function(r,t,e){var n,o=m(r.getAttachedShaders(t));try{for(o.s();!(n=o.n()).done;){var i=n.value;e.has(i)&&r.deleteShader(i)}}catch(r){o.e(r)}finally{o.f()}r.deleteProgram(t)}(r,t,u),e}if(!i.callback)return f(r,a)?void 0:a;xr(r,a).then((function(){var t=f(r,a);i.callback(t,t?void 0:a)}))}function wr(r){return function(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return new Promise((function(n,i){var u=br.apply(void 0,o);u.callback=function(r,t){r?i(r):n(t)},r(t,e,u)}))}}t.createProgramAsync=wr(hr),t.createProgramInfoAsync=wr(Xr);function xr(r,t){return jr.apply(this,arguments)}function jr(){return jr=y(f().mark((function r(t,e){var n,o,i;return f().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=t.getExtension("KHR_parallel_shader_compile"),o=n?function(r,t){return r.getProgramParameter(t,n.COMPLETION_STATUS_KHR)}:function(){return!0},i=0;case 3:return r.next=5,dr(i);case 5:i=1e3/60;case 6:if(!o(t,e)){r.next=3;break}case 7:case"end":return r.stop()}}),r)}))),jr.apply(this,arguments)}function Fr(){return Fr=y(f().mark((function r(t,e){var n,o,i;return f().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=0,o=Object.values(e);case 1:if(!(n<o.length)){r.next=8;break}return i=o[n],r.next=5,xr(t,i);case 5:n++,r.next=1;break;case 8:case"end":return r.stop()}}),r)}))),Fr.apply(this,arguments)}function _r(r,t,e){if(e=e||w,!r.getProgramParameter(t,T)){var n=r.getProgramInfoLog(t);e("Error in program linking: ".concat(n));var o=r.getAttachedShaders(t).map((function(t){return yr(r,r.getShaderParameter(t,r.SHADER_TYPE),t,e)}));return"".concat(n,"\n").concat(o.filter((function(r){return r})).join("\n"))}}function Or(r,t,e,n,o){return hr(r,t,e,n,o)}function Er(r){var t=r.name;return t.startsWith("gl_")||t.startsWith("webgl_")}var Ar=/(\.|\[|]|\w+)/g,Sr=function(r){return r>="0"&&r<="9"};function Mr(r,t,e,n){for(var o=r.split(Ar).filter((function(r){return""!==r})),i=0,u="";;){var a=o[i++];u+=a;var f=Sr(a[0]),c=f?parseInt(a):a;if(f&&(u+=o[i++]),i===o.length){e[c]=t;break}var l=o[i++],s="["===l,v=e[c]||(s?[]:{});e[c]=v,e=v,n[u]=n[u]||function(r){return function(t){Wr(r,t)}}(v),u+=l}}function gr(r,t){var e=0;function n(t,n,o){var i,u=n.name.endsWith("[0]"),a=n.type,f=K[a];if(!f)throw new Error("unknown type: 0x".concat(a.toString(16)));if(f.bindPoint){var c=e;e+=n.size,i=u?f.arraySetter(r,a,c,o,n.size):f.setter(r,a,c,o,n.size)}else i=f.arraySetter&&u?f.arraySetter(r,o):f.setter(r,o);return i.location=o,i}for(var o={},i={},u=r.getProgramParameter(t,k),a=0;a<u;++a){var f=r.getActiveUniform(t,a);if(!Er(f)){var c=f.name;c.endsWith("[0]")&&(c=c.substr(0,c.length-3));var l=r.getUniformLocation(t,f.name);if(l){var s=n(0,f,l);o[c]=s,Mr(c,s,i,o)}}}return o}function Tr(r,t){for(var e={},n=r.getProgramParameter(t,C),o=0;o<n;++o){var i=r.getTransformFeedbackVarying(t,o);e[i.name]={index:o,type:i.type,size:i.size}}return e}function Pr(r,t,e){for(var n in t.transformFeedbackInfo&&(t=t.transformFeedbackInfo),e.attribs&&(e=e.attribs),e){var o=t[n];if(o){var i=e[n];i.offset?r.bindBufferRange(S,o.index,i.buffer,i.offset,i.size):r.bindBufferBase(S,o.index,i.buffer)}}}function Rr(r,t){for(var e=r.getProgramParameter(t,k),n=[],o=[],i=0;i<e;++i){o.push(i),n.push({});var u=r.getActiveUniform(t,i);n[i].name=u.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach((function(e){var i=e[0],u=e[1];r.getActiveUniforms(t,o,r[i]).forEach((function(r,t){n[t][u]=r}))}));for(var a={},f=r.getProgramParameter(t,W),c=0;c<f;++c){var l=r.getActiveUniformBlockName(t,c),s={index:r.getUniformBlockIndex(t,l),usedByVertexShader:r.getActiveUniformBlockParameter(t,c,I),usedByFragmentShader:r.getActiveUniformBlockParameter(t,c,L),size:r.getActiveUniformBlockParameter(t,c,G),uniformIndices:r.getActiveUniformBlockParameter(t,c,B)};s.used=s.usedByVertexShader||s.usedByFragmentShader,a[l]=s}return{blockSpecs:a,uniformData:n}}var zr=/\[\d+\]\.$/,kr=function(r,t){return((r+(t-1))/t|0)*t};function Ur(r,t,e,n){var o,i,u,a,f=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},c=e.blockSpecs,l=e.uniformData,s=c[n];if(!s)return x("no uniform block object named:",n),{name:n,uniforms:{}};var v=null!==(o=f.offset)&&void 0!==o?o:0,y=null!==(i=f.array)&&void 0!==i?i:new ArrayBuffer(s.size),b=null!==(u=f.buffer)&&void 0!==u?u:r.createBuffer(),m=s.index;r.bindBuffer(A,b),f.buffer||r.bufferData(A,y.byteLength,_),r.uniformBlockBinding(t,s.index,m);var d=n+".";zr.test(d)&&(d=d.replace(zr,"."));var p={},h={},w={};return s.uniformIndices.forEach((function(r){var t=l[r],e=t.name;e.startsWith(d)&&(e=e.substr(d.length));var n=e.endsWith("[0]");n&&(e=e.substr(0,e.length-3));var o=K[t.type],i=o.Type,u=n?kr(o.size,16)*t.size:o.size*t.size,a=new i(y,v+t.offset,u/i.BYTES_PER_ELEMENT);p[e]=a;var f=function(r,t,e,n){if(t||e){n=n||1;var o=r.length/4;return function(t){for(var e=0,i=0,u=0;u<o;++u){for(var a=0;a<n;++a)r[e++]=t[i++];e+=4-n}}}return function(t){t.length?r.set(t):r[0]=t}}(a,n,o.rows,o.cols);h[e]=f,Mr(e,f,w,h)})),{name:n,array:y,asFloat:new Float32Array(y),asUint8:new Uint8Array(y),buffer:b,uniforms:p,setters:h,offset:null!==(a=f.bufferOffset)&&void 0!==a?a:v,size:s.size}}function Cr(r,t,e){var n=(t.uniformBlockSpec||t).blockSpecs[e.name];if(n){var o,i=n.index;return r.bindBufferRange(A,i,e.buffer,e.offset||0,null!==(o=e.size)&&void 0!==o?o:e.array.byteLength),!0}return!1}function Wr(r,t){for(var e in t){var n=r[e];"function"==typeof n?n(t[e]):Wr(r[e],t[e])}}function Ir(r){for(var t=r.uniformSetters||r,e=arguments.length<=1?0:arguments.length-1,n=0;n<e;++n){var o=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];if(Array.isArray(o))for(var i=o.length,u=0;u<i;++u)Ir(t,o[u]);else for(var a in o){var f=t[a];f&&f(o[a])}}}t.setUniformsAndBindTextures=Ir;function Lr(r,t){for(var e={},n=r.getProgramParameter(t,U),o=0;o<n;++o){var i=r.getActiveAttrib(t,o);if(!Er(i)){var u=r.getAttribLocation(t,i.name),a=fr[i.type],f=a.setter(r,u,a);f.location=u,e[i.name]=f}}return e}function Gr(r,t){for(var e in t){var n=r[e];n&&n(t[e])}}function Br(r,t){var e=gr(r,t),n=Lr(r,t),i={program:t,uniformSetters:e,attribSetters:n,uniformLocations:Object.fromEntries(Object.entries(e).map((function(r){var t=b(r,2);return[t[0],t[1].location]}))),attribLocations:Object.fromEntries(Object.entries(n).map((function(r){var t=b(r,2);return[t[0],t[1].location]})))};return o.isWebGL2(r)&&(i.uniformBlockSpec=Rr(r,t),i.transformFeedbackInfo=Tr(r,t)),i}var Nr=/\s|{|}|;/;function Xr(r,t,e,n,o){var i=br(e,n,o),u=[];if(t=t.map((function(r){if(!Nr.test(r)){var t=j(r);if(t)r=t.text;else{var e="no element with id: ".concat(r);i.errorCallback(e),u.push(e)}}return r})),u.length)return vr(i,"");var a=i.callback;a&&(i.callback=function(t,e){a(t,t?void 0:Br(r,e))});var f=Or(r,t,i);return f?Br(r,f):null}function Dr(r,t,e,n,o){for(var i=0,u=Object.entries(t);i<u.length;i++){var a=b(u[i],2),f=a[0],c=a[1],s=l({},o),v=e[f];Array.isArray(v)||Object.assign(s,v);var y=_r(r,c,s.errorCallback);if(y){for(var d=0,p=Object.values(t);d<p.length;d++){var h=p[d],w=r.getAttachedShaders(h);r.deleteProgram(h);var x,j=m(w);try{for(j.s();!(x=j.n()).done;){var F=x.value;n.has(F)||r.deleteShader(F)}}catch(r){j.e(r)}finally{j.f()}}return y}}}function Hr(r,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new Set,o=Object.fromEntries(Object.entries(t).map((function(t){var o=b(t,2),i=o[0],u=o[1],a=l({},e),f=Array.isArray(u)?u:u.shaders;return Array.isArray(u)||Object.assign(a,u),f.forEach(n.add,n),[i,pr(r,f,a)]})));if(!e.callback)return Dr(r,o,t,n,e)?void 0:o;(function(r,t){return Fr.apply(this,arguments)})(r,o).then((function(){var i=Dr(r,o,t,n,e);e.callback(i,i?void 0:o)}))}function Vr(r,t,e){function n(r,t){return Object.fromEntries(Object.entries(t).map((function(t){var e=b(t,2),n=e[0],o=e[1];return[n,Br(r,o)]})))}var o=(e=br(e)).callback;o&&(e.callback=function(t,e){o(t,t?void 0:n(r,e))});var i=Hr(r,t,e);if(!o&&i)return n(r,i)}t.createProgramsAsync=wr(Hr),t.createProgramInfosAsync=wr(Vr)},175:(r,t,e)=>{function n(r){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n(r)}t.__esModule=!0,t.canFilter=Tt,t.canGenerateMipmap=gt,t.createSampler=Lt,t.createSamplers=function(r,t){var e={};return Object.keys(t).forEach((function(n){e[n]=Lt(r,t[n])})),e},t.createTexture=te,t.createTextures=function(r,t,e){e=e||Ht;var n=0,o=[],i={},u={};function a(){0===n&&setTimeout((function(){e(o.length?o:void 0,i,u)}),0)}return Object.keys(t).forEach((function(e){var f,c,l=t[e];("string"==typeof(c=l.src)||Array.isArray(c)&&"string"==typeof c[0])&&(f=function(r,t,i){u[e]=i,--n,r&&o.push(r),a()},++n),i[e]=te(r,l,f)})),a(),i},t.getBytesPerElementForInternalFormat=At,t.getFormatAndTypeForInternalFormat=St,t.getNumComponentsForFormat=function(r){var t=_t[r];if(!t)throw"unknown format: "+r;return t.t},t.loadTextureFromUrl=$t,t.resizeTexture=function(r,t,e,n,o,i){n=n||e.width,o=o||e.height,i=i||e.depth;var u=e.target||O;r.bindTexture(u,t);var a,f=e.level||0,c=e.internalFormat||e.format||d,l=St(c),s=e.format||l.format,y=e.src;a=y&&(v(y)||Array.isArray(y)&&"number"==typeof y[0])?e.type||Pt(r,y,l.type):e.type||l.type;if(u===E)for(var b=0;b<6;++b)r.texImage2D(M+b,f,c,n,o,0,s,a,null);else u===A||u===S?r.texImage3D(u,f,c,n,o,i,0,s,a,null):r.texImage2D(u,f,c,n,o,0,s,a,null)},t.setDefaultTextureColor=zt,t.setEmptyTexture=re,t.setSamplerParameters=It,t.setTextureDefaults_=function(r){u.copyExistingProperties(r,s),r.textureColor&&zt(r.textureColor)},t.setTextureFilteringForSize=Gt,t.setTextureFromArray=Qt,t.setTextureFromElement=Dt,t.setTextureParameters=Wt;var o=f(e(854)),i=f(e(801)),u=f(e(303));function a(r){if("function"!=typeof WeakMap)return null;var t=new WeakMap,e=new WeakMap;return(a=function(r){return r?e:t})(r)}function f(r,t){if(!t&&r&&r.__esModule)return r;if(null===r||"object"!=n(r)&&"function"!=typeof r)return{default:r};var e=a(t);if(e&&e.has(r))return e.get(r);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in r)if("default"!==u&&Object.prototype.hasOwnProperty.call(r,u)){var f=i?Object.getOwnPropertyDescriptor(r,u):null;f&&(f.get||f.set)?Object.defineProperty(o,u,f):o[u]=r[u]}return o.default=r,e&&e.set(r,o),o}var c,l,s={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},v=i.isArrayBuffer,y=function(){return c=c||("undefined"!=typeof document&&document.createElement?document.createElement("canvas").getContext("2d"):null)},b=6406,m=6407,d=6408,p=6409,h=6410,w=6402,x=34041,j=33071,F=9728,_=9729,O=3553,E=34067,A=32879,S=35866,M=34069,g=34070,T=34071,P=34072,R=34073,z=34074,k=10241,U=10240,C=10242,W=10243,I=32882,L=33082,G=33083,B=33084,N=33085,X=34892,D=34893,H=3317,V=3314,Y=32878,q=3316,K=3315,$=32877,Z=37443,J=37441,Q=37440,rr=33321,tr=36756,er=33325,nr=33326,or=33330,ir=33329,ur=33338,ar=33337,fr=33340,cr=33339,lr=33323,sr=36757,vr=33327,yr=33328,br=33336,mr=33335,dr=33332,pr=33331,hr=33334,wr=33333,xr=32849,jr=35905,Fr=36194,_r=36758,Or=35898,Er=35901,Ar=34843,Sr=34837,Mr=36221,gr=36239,Tr=36215,Pr=36233,Rr=36209,zr=36227,kr=32856,Ur=35907,Cr=36759,Wr=32855,Ir=32854,Lr=32857,Gr=34842,Br=34836,Nr=36220,Xr=36238,Dr=36975,Hr=36214,Vr=36232,Yr=36226,qr=36208,Kr=33189,$r=33190,Zr=36012,Jr=36013,Qr=35056,rt=5120,tt=5121,et=5122,nt=5123,ot=5124,it=5125,ut=5126,at=32819,ft=32820,ct=33635,lt=5131,st=36193,vt=33640,yt=35899,bt=35902,mt=36269,dt=34042,pt=33319,ht=33320,wt=6403,xt=36244,jt=36248,Ft=36249,_t={},Ot=_t;function Et(r){if(!l){var t={};t[b]={o:b,i:!0,u:!0,l:[1,2,2,4],type:[tt,lt,st,ut]},t[p]={o:p,i:!0,u:!0,l:[1,2,2,4],type:[tt,lt,st,ut]},t[h]={o:h,i:!0,u:!0,l:[2,4,4,8],type:[tt,lt,st,ut]},t[m]={o:m,i:!0,u:!0,l:[3,6,6,12,2],type:[tt,lt,st,ut,ct]},t[d]={o:d,i:!0,u:!0,l:[4,8,8,16,2,2],type:[tt,lt,st,ut,at,ft]},t[w]={o:w,i:!0,u:!1,l:[2,4],type:[it,nt]},t[rr]={o:wt,i:!0,u:!0,l:[1],type:[tt]},t[tr]={o:wt,i:!1,u:!0,l:[1],type:[rt]},t[er]={o:wt,i:!1,u:!0,l:[4,2],type:[ut,lt]},t[nr]={o:wt,i:!1,u:!1,l:[4],type:[ut]},t[or]={o:xt,i:!0,u:!1,l:[1],type:[tt]},t[ir]={o:xt,i:!0,u:!1,l:[1],type:[rt]},t[dr]={o:xt,i:!0,u:!1,l:[2],type:[nt]},t[pr]={o:xt,i:!0,u:!1,l:[2],type:[et]},t[hr]={o:xt,i:!0,u:!1,l:[4],type:[it]},t[wr]={o:xt,i:!0,u:!1,l:[4],type:[ot]},t[lr]={o:pt,i:!0,u:!0,l:[2],type:[tt]},t[sr]={o:pt,i:!1,u:!0,l:[2],type:[rt]},t[vr]={o:pt,i:!1,u:!0,l:[8,4],type:[ut,lt]},t[yr]={o:pt,i:!1,u:!1,l:[8],type:[ut]},t[br]={o:ht,i:!0,u:!1,l:[2],type:[tt]},t[mr]={o:ht,i:!0,u:!1,l:[2],type:[rt]},t[ur]={o:ht,i:!0,u:!1,l:[4],type:[nt]},t[ar]={o:ht,i:!0,u:!1,l:[4],type:[et]},t[fr]={o:ht,i:!0,u:!1,l:[8],type:[it]},t[cr]={o:ht,i:!0,u:!1,l:[8],type:[ot]},t[xr]={o:m,i:!0,u:!0,l:[3],type:[tt]},t[jr]={o:m,i:!1,u:!0,l:[3],type:[tt]},t[Fr]={o:m,i:!0,u:!0,l:[3,2],type:[tt,ct]},t[_r]={o:m,i:!1,u:!0,l:[3],type:[rt]},t[Or]={o:m,i:!1,u:!0,l:[12,6,4],type:[ut,lt,yt]},t[Er]={o:m,i:!1,u:!0,l:[12,6,4],type:[ut,lt,bt]},t[Ar]={o:m,i:!1,u:!0,l:[12,6],type:[ut,lt]},t[Sr]={o:m,i:!1,u:!1,l:[12],type:[ut]},t[Mr]={o:jt,i:!1,u:!1,l:[3],type:[tt]},t[gr]={o:jt,i:!1,u:!1,l:[3],type:[rt]},t[Tr]={o:jt,i:!1,u:!1,l:[6],type:[nt]},t[Pr]={o:jt,i:!1,u:!1,l:[6],type:[et]},t[Rr]={o:jt,i:!1,u:!1,l:[12],type:[it]},t[zr]={o:jt,i:!1,u:!1,l:[12],type:[ot]},t[kr]={o:d,i:!0,u:!0,l:[4],type:[tt]},t[Ur]={o:d,i:!0,u:!0,l:[4],type:[tt]},t[Cr]={o:d,i:!1,u:!0,l:[4],type:[rt]},t[Wr]={o:d,i:!0,u:!0,l:[4,2,4],type:[tt,ft,vt]},t[Ir]={o:d,i:!0,u:!0,l:[4,2],type:[tt,at]},t[Lr]={o:d,i:!0,u:!0,l:[4],type:[vt]},t[Gr]={o:d,i:!1,u:!0,l:[16,8],type:[ut,lt]},t[Br]={o:d,i:!1,u:!1,l:[16],type:[ut]},t[Nr]={o:Ft,i:!0,u:!1,l:[4],type:[tt]},t[Xr]={o:Ft,i:!0,u:!1,l:[4],type:[rt]},t[Dr]={o:Ft,i:!0,u:!1,l:[4],type:[vt]},t[Hr]={o:Ft,i:!0,u:!1,l:[8],type:[nt]},t[Vr]={o:Ft,i:!0,u:!1,l:[8],type:[et]},t[Yr]={o:Ft,i:!0,u:!1,l:[16],type:[ot]},t[qr]={o:Ft,i:!0,u:!1,l:[16],type:[it]},t[Kr]={o:w,i:!0,u:!1,l:[2,4],type:[nt,it]},t[$r]={o:w,i:!0,u:!1,l:[4],type:[it]},t[Zr]={o:w,i:!0,u:!1,l:[4],type:[ut]},t[Qr]={o:x,i:!0,u:!1,l:[4],type:[dt]},t[Jr]={o:x,i:!0,u:!1,l:[4],type:[mt]},Object.keys(t).forEach((function(r){var e=t[r];e.bytesPerElementMap={},e.l.forEach((function(r,t){var n=e.type[t];e.bytesPerElementMap[n]=r}))})),l=t}return l[r]}function At(r,t){var e=Et(r);if(!e)throw"unknown internal format";var n=e.bytesPerElementMap[t];if(void 0===n)throw"unknown internal format";return n}function St(r){var t=Et(r);if(!t)throw"unknown internal format";return{format:t.o,type:t.type[0]}}function Mt(r){return 0==(r&r-1)}function gt(r,t,e,n){if(!o.isWebGL2(r))return Mt(t)&&Mt(e);var i=Et(n);if(!i)throw"unknown internal format";return i.i&&i.u}function Tt(r){var t=Et(r);if(!t)throw"unknown internal format";return t.u}function Pt(r,t,e){return v(t)?i.getGLTypeForTypedArray(t):e||tt}function Rt(r,t,e,n,o){if(o%1!=0)throw"can't guess dimensions";if(e||n){if(n){if(!e&&(e=o/n)%1)throw"can't guess dimensions"}else if((n=o/e)%1)throw"can't guess dimensions"}else{var i=Math.sqrt(o/(t===E?6:1));i%1==0?(e=i,n=i):(e=o,n=1)}return{width:e,height:n}}function zt(r){s.textureColor=new Uint8Array([255*r[0],255*r[1],255*r[2],255*r[3]])}function kt(r,t){void 0!==t.colorspaceConversion&&r.pixelStorei(Z,t.colorspaceConversion),void 0!==t.premultiplyAlpha&&r.pixelStorei(J,t.premultiplyAlpha),void 0!==t.flipY&&r.pixelStorei(Q,t.flipY)}function Ut(r){r.pixelStorei(H,4),o.isWebGL2(r)&&(r.pixelStorei(V,0),r.pixelStorei(Y,0),r.pixelStorei(q,0),r.pixelStorei(K,0),r.pixelStorei($,0))}function Ct(r,t,e,n){n.minMag&&(e.call(r,t,k,n.minMag),e.call(r,t,U,n.minMag)),n.min&&e.call(r,t,k,n.min),n.mag&&e.call(r,t,U,n.mag),n.wrap&&(e.call(r,t,C,n.wrap),e.call(r,t,W,n.wrap),(t===A||u.isSampler(r,t))&&e.call(r,t,I,n.wrap)),n.wrapR&&e.call(r,t,I,n.wrapR),n.wrapS&&e.call(r,t,C,n.wrapS),n.wrapT&&e.call(r,t,W,n.wrapT),void 0!==n.minLod&&e.call(r,t,L,n.minLod),void 0!==n.maxLod&&e.call(r,t,G,n.maxLod),void 0!==n.baseLevel&&e.call(r,t,B,n.baseLevel),void 0!==n.maxLevel&&e.call(r,t,N,n.maxLevel),void 0!==n.compareFunc&&e.call(r,t,D,n.compareFunc),void 0!==n.compareMode&&e.call(r,t,X,n.compareMode)}function Wt(r,t,e){var n=e.target||O;r.bindTexture(n,t),Ct(r,n,r.texParameteri,e)}function It(r,t,e){Ct(r,t,r.samplerParameteri,e)}function Lt(r,t){var e=r.createSampler();return It(r,e,t),e}function Gt(r,t,e,n,o,i){e=e||s.textureOptions,i=i||d;var u=e.target||O;if(n=n||e.width,o=o||e.height,r.bindTexture(u,t),gt(r,n,o,i))r.generateMipmap(u);else{var a=Tt(i)?_:F;r.texParameteri(u,k,a),r.texParameteri(u,U,a),r.texParameteri(u,C,j),r.texParameteri(u,W,j)}}function Bt(r){return!0===r.auto||void 0===r.auto&&void 0===r.level}function Nt(r,t){return(t=t||{}).cubeFaceOrder||[M,g,T,P,R,z]}function Xt(r,t){var e=Nt(0,t).map((function(r,t){return{face:r,ndx:t}}));return e.sort((function(r,t){return r.face-t.face})),e}function Dt(r,t,e,n){var o=(n=n||s.textureOptions).target||O,i=n.level||0,u=e.width,a=e.height,f=n.internalFormat||n.format||d,c=St(f),l=n.format||c.format,v=n.type||c.type;if(kt(r,n),r.bindTexture(o,t),o===E){var b,m,p=e.width,h=e.height;if(p/6===h)b=h,m=[0,0,1,0,2,0,3,0,4,0,5,0];else if(h/6===p)b=p,m=[0,0,0,1,0,2,0,3,0,4,0,5];else if(p/3==h/2)b=p/3,m=[0,0,1,0,2,0,0,1,1,1,2,1];else{if(p/2!=h/3)throw"can't figure out cube map from element: "+(e.src?e.src:e.nodeName);b=p/2,m=[0,0,1,0,0,1,1,1,0,2,1,2]}var w=y();w?(w.canvas.width=b,w.canvas.height=b,u=b,a=b,Xt(0,n).forEach((function(t){var n=m[2*t.ndx+0]*b,o=m[2*t.ndx+1]*b;w.drawImage(e,n,o,b,b,0,0,b,b),r.texImage2D(t.face,i,f,l,v,w.canvas)})),w.canvas.width=1,w.canvas.height=1):"undefined"!=typeof createImageBitmap&&(u=b,a=b,Xt(0,n).forEach((function(c){var s=m[2*c.ndx+0]*b,y=m[2*c.ndx+1]*b;r.texImage2D(c.face,i,f,b,b,0,l,v,null),createImageBitmap(e,s,y,b,b,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then((function(e){kt(r,n),r.bindTexture(o,t),r.texImage2D(c.face,i,f,l,v,e),Bt(n)&&Gt(r,t,n,u,a,f)}))})))}else if(o===A||o===S){var x=Math.min(e.width,e.height),j=Math.max(e.width,e.height),F=j/x;if(F%1!=0)throw"can not compute 3D dimensions of element";var _=e.width===j?1:0,M=e.height===j?1:0;r.pixelStorei(H,1),r.pixelStorei(V,e.width),r.pixelStorei(Y,0),r.pixelStorei($,0),r.texImage3D(o,i,f,x,x,x,0,l,v,null);for(var g=0;g<F;++g){var T=g*x*_,P=g*x*M;r.pixelStorei(q,T),r.pixelStorei(K,P),r.texSubImage3D(o,i,0,0,g,x,x,1,l,v,e)}Ut(r)}else r.texImage2D(o,i,f,l,v,e);Bt(n)&&Gt(r,t,n,u,a,f),Wt(r,t,n)}function Ht(){}function Vt(r,t){return void 0!==t||function(r){if("undefined"!=typeof document){var t=document.createElement("a");return t.href=r,t.hostname===location.hostname&&t.port===location.port&&t.protocol===location.protocol}var e=new URL(location.href).origin;return new URL(r,location.href).origin===e}(r)?t:"anonymous"}function Yt(r){return"undefined"!=typeof ImageBitmap&&r instanceof ImageBitmap||"undefined"!=typeof ImageData&&r instanceof ImageData||"undefined"!=typeof HTMLElement&&r instanceof HTMLElement}function qt(r,t,e){return Yt(r)?(setTimeout((function(){e(null,r)})),r):function(r,t,e){var n;if(e=e||Ht,t=void 0!==t?t:s.crossOrigin,t=Vt(r,t),"undefined"!=typeof Image){n=new Image,void 0!==t&&(n.crossOrigin=t);var o=function(){n.removeEventListener("error",i),n.removeEventListener("load",a),n=null},i=function(){var t="couldn't load image: "+r;u.error(t),e(t,n),o()},a=function(){e(null,n),o()};return n.addEventListener("error",i),n.addEventListener("load",a),n.src=r,n}if("undefined"!=typeof ImageBitmap){var f,c,l=function(){e(f,c)},v={};t&&(v.mode="cors"),fetch(r,v).then((function(r){if(!r.ok)throw r;return r.blob()})).then((function(r){return createImageBitmap(r,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(r){c=r,setTimeout(l)})).catch((function(r){f=r,setTimeout(l)})),n=null}return n}(r,t,e)}function Kt(r,t,e){var n=(e=e||s.textureOptions).target||O;if(r.bindTexture(n,t),!1!==e.color){var o=function(r){return r=r||s.textureColor,v(r)?r:new Uint8Array([255*r[0],255*r[1],255*r[2],255*r[3]])}(e.color);if(n===E)for(var i=0;i<6;++i)r.texImage2D(M+i,0,d,1,1,0,d,tt,o);else n===A||n===S?r.texImage3D(n,0,d,1,1,1,0,d,tt,o):r.texImage2D(n,0,d,1,1,0,d,tt,o)}}function $t(r,t,e,n){return n=n||Ht,e=e||s.textureOptions,Kt(r,t,e),qt((e=Object.assign({},e)).src,e.crossOrigin,(function(o,i){o?n(o,t,i):(Dt(r,t,i,e),n(null,t,i))}))}function Zt(r,t,e,n){n=n||Ht;var o=e.src;if(6!==o.length)throw"there must be 6 urls for a cubemap";var i=e.level||0,u=e.internalFormat||e.format||d,a=St(u),f=e.format||a.format,c=e.type||tt,l=e.target||O;if(l!==E)throw"target must be TEXTURE_CUBE_MAP";Kt(r,t,e),e=Object.assign({},e);var s,v=6,y=[],b=Nt(0,e);s=o.map((function(o,a){return qt(o,e.crossOrigin,(m=b[a],function(o,a){--v,o?y.push(o):a.width!==a.height?y.push("cubemap face img is not a square: "+a.src):(kt(r,e),r.bindTexture(l,t),5===v?Nt().forEach((function(t){r.texImage2D(t,i,u,f,c,a)})):r.texImage2D(m,i,u,f,c,a),Bt(e)&&r.generateMipmap(l)),0===v&&n(y.length?y:void 0,t,s)}));var m}))}function Jt(r,t,e,n){n=n||Ht;var o=e.src,i=e.internalFormat||e.format||d,u=St(i),a=e.format||u.format,f=e.type||tt,c=e.target||S;if(c!==A&&c!==S)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";Kt(r,t,e),e=Object.assign({},e);var l,s=o.length,v=[],b=e.level||0,m=e.width,p=e.height,h=o.length,w=!0;l=o.map((function(o,u){return qt(o,e.crossOrigin,(d=u,function(o,u){if(--s,o)v.push(o);else{if(kt(r,e),r.bindTexture(c,t),w){w=!1,m=e.width||u.width,p=e.height||u.height,r.texImage3D(c,b,i,m,p,h,0,a,f,null);for(var x=0;x<h;++x)r.texSubImage3D(c,b,0,0,x,m,p,1,a,f,u)}else{var j,F=u;u.width===m&&u.height===p||(F=(j=y()).canvas,j.canvas.width=m,j.canvas.height=p,j.drawImage(u,0,0,m,p)),r.texSubImage3D(c,b,0,0,d,m,p,1,a,f,F),j&&F===j.canvas&&(j.canvas.width=0,j.canvas.height=0)}Bt(e)&&r.generateMipmap(c)}0===s&&n(v.length?v:void 0,t,l)}));var d}))}function Qt(r,t,e,n){var u=(n=n||s.textureOptions).target||O;r.bindTexture(u,t);var a=n.width,f=n.height,c=n.depth,l=n.level||0,y=n.internalFormat||n.format||d,b=St(y),m=n.format||b.format,p=n.type||Pt(0,e,b.type);if(v(e))e instanceof Uint8ClampedArray&&(e=new Uint8Array(e.buffer));else{var h=i.getTypedArrayTypeForGLType(p);e=new h(e)}var w,x=At(y,p),j=e.byteLength/x;if(j%1)throw"length wrong size for format: "+o.glEnumToString(r,m);if(u===A||u===S)if(a||f||c)!a||f&&c?!f||a&&c?(w=Rt(0,u,a,f,j/c),a=w.width,f=w.height):(w=Rt(0,u,a,c,j/f),a=w.width,c=w.height):(w=Rt(0,u,f,c,j/a),f=w.width,c=w.height);else{var F=Math.cbrt(j);if(F%1!=0)throw"can't guess cube size of array of numElements: "+j;a=F,f=F,c=F}else w=Rt(0,u,a,f,j),a=w.width,f=w.height;if(Ut(r),r.pixelStorei(H,n.unpackAlignment||1),kt(r,n),u===E){var _=j/6*(x/e.BYTES_PER_ELEMENT);Xt(0,n).forEach((function(t){var n=_*t.ndx,o=e.subarray(n,n+_);r.texImage2D(t.face,l,y,a,f,0,m,p,o)}))}else u===A||u===S?r.texImage3D(u,l,y,a,f,c,0,m,p,e):r.texImage2D(u,l,y,a,f,0,m,p,e);return{width:a,height:f,depth:c,type:p}}function re(r,t,e){var n=e.target||O;r.bindTexture(n,t);var o=e.level||0,i=e.internalFormat||e.format||d,u=St(i),a=e.format||u.format,f=e.type||u.type;if(kt(r,e),n===E)for(var c=0;c<6;++c)r.texImage2D(M+c,o,i,e.width,e.height,0,a,f,null);else n===A||n===S?r.texImage3D(n,o,i,e.width,e.height,e.depth,0,a,f,null):r.texImage2D(n,o,i,e.width,e.height,0,a,f,null)}function te(r,t,e){e=e||Ht,t=t||s.textureOptions;var n=r.createTexture(),o=t.target||O,i=t.width||1,u=t.height||1,a=t.internalFormat||d;r.bindTexture(o,n),o===E&&(r.texParameteri(o,C,j),r.texParameteri(o,W,j));var f=t.src;if(f)if("function"==typeof f&&(f=f(r,t)),"string"==typeof f)$t(r,n,t,e);else if(v(f)||Array.isArray(f)&&("number"==typeof f[0]||Array.isArray(f[0])||v(f[0]))){var c=Qt(r,n,f,t);i=c.width,u=c.height}else Array.isArray(f)&&("string"==typeof f[0]||Yt(f[0]))?o===E?Zt(r,n,t,e):Jt(r,n,t,e):(Dt(r,n,f,t),i=f.width,u=f.height);else re(r,n,t);return Bt(t)&&Gt(r,n,t,i,u,a),Wt(r,n,t),n}Ot[b]={t:1},Ot[p]={t:1},Ot[h]={t:2},Ot[m]={t:3},Ot[d]={t:4},Ot[wt]={t:1},Ot[xt]={t:1},Ot[pt]={t:2},Ot[ht]={t:2},Ot[m]={t:3},Ot[jt]={t:3},Ot[d]={t:4},Ot[Ft]={t:4},Ot[w]={t:1},Ot[x]={t:2}},395:(r,t,e)=>{function n(r){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n(r)}t.__esModule=!0;var o={m4:!0,v3:!0,primitives:!0};t.v3=t.primitives=t.m4=void 0;var i=l(e(362));t.m4=i;var u=l(e(304));t.v3=u;var a=l(e(777));t.primitives=a;var f=e(373);function c(r){if("function"!=typeof WeakMap)return null;var t=new WeakMap,e=new WeakMap;return(c=function(r){return r?e:t})(r)}function l(r,t){if(!t&&r&&r.__esModule)return r;if(null===r||"object"!=n(r)&&"function"!=typeof r)return{default:r};var e=c(t);if(e&&e.has(r))return e.get(r);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in r)if("default"!==u&&Object.prototype.hasOwnProperty.call(r,u)){var a=i?Object.getOwnPropertyDescriptor(r,u):null;a&&(a.get||a.set)?Object.defineProperty(o,u,a):o[u]=r[u]}return o.default=r,e&&e.set(r,o),o}Object.keys(f).forEach((function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(o,r)||r in t&&t[r]===f[r]||(t[r]=f[r]))}))},373:(r,t,e)=>{function n(r){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n(r)}t.__esModule=!0;var o={addExtensionsToContext:!0,getContext:!0,getWebGLContext:!0,resizeCanvasToDisplaySize:!0,setDefaults:!0,attributes:!0,textures:!0,utils:!0,draw:!0,framebuffers:!0,programs:!0,typedarrays:!0,vertexArrays:!0};t.addExtensionsToContext=x,t.framebuffers=t.draw=t.attributes=void 0,t.getContext=function(r,t){var e=function(r,t){for(var e=["webgl2","webgl","experimental-webgl"],n=null,o=0;o<e.length;++o)if(n=r.getContext(e[o],t)){d.addExtensionsToContext&&x(n);break}return n}(r,t);return e},t.getWebGLContext=function(r,t){var e=function(r,t){for(var e=["webgl","experimental-webgl"],n=null,o=0;o<e.length;++o)if(n=r.getContext(e[o],t)){d.addExtensionsToContext&&x(n);break}return n}(r,t);return e},t.programs=void 0,t.resizeCanvasToDisplaySize=function(r,t){t=t||1,t=Math.max(0,t);var e=r.clientWidth*t|0,n=r.clientHeight*t|0;if(r.width!==e||r.height!==n)return r.width=e,r.height=n,!0;return!1},t.setDefaults=function(r){a.copyExistingProperties(r,d),i.setAttributeDefaults_(r),u.setTextureDefaults_(r)},t.vertexArrays=t.utils=t.typedarrays=t.textures=void 0;var i=m(e(650));t.attributes=i,Object.keys(i).forEach((function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(o,r)||r in t&&t[r]===i[r]||(t[r]=i[r]))}));var u=m(e(175));t.textures=u,Object.keys(u).forEach((function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(o,r)||r in t&&t[r]===u[r]||(t[r]=u[r]))}));var a=m(e(303)),f=m(e(854));t.utils=f,Object.keys(f).forEach((function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(o,r)||r in t&&t[r]===f[r]||(t[r]=f[r]))}));var c=m(e(341));t.draw=c,Object.keys(c).forEach((function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(o,r)||r in t&&t[r]===c[r]||(t[r]=c[r]))}));var l=m(e(167));t.framebuffers=l,Object.keys(l).forEach((function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(o,r)||r in t&&t[r]===l[r]||(t[r]=l[r]))}));var s=m(e(38));t.programs=s,Object.keys(s).forEach((function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(o,r)||r in t&&t[r]===s[r]||(t[r]=s[r]))}));var v=m(e(801));t.typedarrays=v,Object.keys(v).forEach((function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(o,r)||r in t&&t[r]===v[r]||(t[r]=v[r]))}));var y=m(e(496));function b(r){if("function"!=typeof WeakMap)return null;var t=new WeakMap,e=new WeakMap;return(b=function(r){return r?e:t})(r)}function m(r,t){if(!t&&r&&r.__esModule)return r;if(null===r||"object"!=n(r)&&"function"!=typeof r)return{default:r};var e=b(t);if(e&&e.has(r))return e.get(r);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in r)if("default"!==u&&Object.prototype.hasOwnProperty.call(r,u)){var a=i?Object.getOwnPropertyDescriptor(r,u):null;a&&(a.get||a.set)?Object.defineProperty(o,u,a):o[u]=r[u]}return o.default=r,e&&e.set(r,o),o}t.vertexArrays=y,Object.keys(y).forEach((function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(o,r)||r in t&&t[r]===y[r]||(t[r]=y[r]))}));var d={addExtensionsToContext:!0};var p=/^(.*?)_/;function h(r,t){f.glEnumToString(r,0);var e=r.getExtension(t);if(e){var n={},o=p.exec(t)[1],i="_"+o;for(var u in e){var c=e[u],l="function"==typeof c,s=l?o:i,v=u;u.endsWith(s)&&(v=u.substring(0,u.length-s.length)),void 0!==r[v]?l||r[v]===c||a.warn(v,r[v],c,u):l?r[v]=function(r){return function(){return r.apply(e,arguments)}}(c):(r[v]=c,n[v]=c)}n.constructor={name:e.constructor.name},f.glEnumToString(n,0)}return e}var w=["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 x(r){for(var t=0;t<w.length;++t)h(r,w[t])}},801:(r,t)=>{t.__esModule=!0,t.getGLTypeForTypedArray=function(r){if(r instanceof Int8Array)return e;if(r instanceof Uint8Array)return n;if(r instanceof Uint8ClampedArray)return n;if(r instanceof Int16Array)return o;if(r instanceof Uint16Array)return i;if(r instanceof Int32Array)return u;if(r instanceof Uint32Array)return a;if(r instanceof Float32Array)return f;throw new Error("unsupported typed array type")},t.getGLTypeForTypedArrayType=function(r){if(r===Int8Array)return e;if(r===Uint8Array)return n;if(r===Uint8ClampedArray)return n;if(r===Int16Array)return o;if(r===Uint16Array)return i;if(r===Int32Array)return u;if(r===Uint32Array)return a;if(r===Float32Array)return f;throw new Error("unsupported typed array type")},t.getTypedArrayTypeForGLType=function(r){var t=c[r];if(!t)throw new Error("unknown gl type");return t},t.isArrayBuffer=void 0;var e=5120,n=5121,o=5122,i=5123,u=5124,a=5125,f=5126,c={},l=c;l[e]=Int8Array,l[n]=Uint8Array,l[o]=Int16Array,l[i]=Uint16Array,l[u]=Int32Array,l[a]=Uint32Array,l[f]=Float32Array,l[32819]=Uint16Array,l[32820]=Uint16Array,l[33635]=Uint16Array,l[5131]=Uint16Array,l[33640]=Uint32Array,l[35899]=Uint32Array,l[35902]=Uint32Array,l[36269]=Uint32Array,l[34042]=Uint32Array;t.isArrayBuffer="undefined"!=typeof SharedArrayBuffer?function(r){return r&&r.buffer&&(r.buffer instanceof ArrayBuffer||r.buffer instanceof SharedArrayBuffer)}:function(r){return r&&r.buffer&&r.buffer instanceof ArrayBuffer}},854:(r,t)=>{t.__esModule=!0,t.glEnumToString=void 0,t.isWebGL1=function(r){return!r.texStorage2D},t.isWebGL2=function(r){return!!r.texStorage2D};var e,n;t.glEnumToString=(e={},n={},function(r,t){return function(r){var t=r.constructor.name;if(!e[t]){for(var o in r)if("number"==typeof r[o]){var i=n[r[o]];n[r[o]]=i?"".concat(i," | ").concat(o):o}e[t]=!0}}(r),n[t]||("number"==typeof t?"0x".concat(t.toString(16)):t)})},304:(r,t)=>{t.__esModule=!0,t.add=function(r,t,n){return(n=n||new e(3))[0]=r[0]+t[0],n[1]=r[1]+t[1],n[2]=r[2]+t[2],n},t.copy=function(r,t){return(t=t||new e(3))[0]=r[0],t[1]=r[1],t[2]=r[2],t},t.create=function(r,t,n){var o=new e(3);r&&(o[0]=r);t&&(o[1]=t);n&&(o[2]=n);return o},t.cross=function(r,t,n){n=n||new e(3);var o=r[2]*t[0]-r[0]*t[2],i=r[0]*t[1]-r[1]*t[0];return n[0]=r[1]*t[2]-r[2]*t[1],n[1]=o,n[2]=i,n},t.distance=function(r,t){var e=r[0]-t[0],n=r[1]-t[1],o=r[2]-t[2];return Math.sqrt(e*e+n*n+o*o)},t.distanceSq=function(r,t){var e=r[0]-t[0],n=r[1]-t[1],o=r[2]-t[2];return e*e+n*n+o*o},t.divScalar=function(r,t,n){return(n=n||new e(3))[0]=r[0]/t,n[1]=r[1]/t,n[2]=r[2]/t,n},t.divide=function(r,t,n){return(n=n||new e(3))[0]=r[0]/t[0],n[1]=r[1]/t[1],n[2]=r[2]/t[2],n},t.dot=function(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]},t.length=function(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2])},t.lengthSq=function(r){return r[0]*r[0]+r[1]*r[1]+r[2]*r[2]},t.lerp=function(r,t,n,o){return(o=o||new e(3))[0]=r[0]+n*(t[0]-r[0]),o[1]=r[1]+n*(t[1]-r[1]),o[2]=r[2]+n*(t[2]-r[2]),o},t.lerpV=function(r,t,n,o){return(o=o||new e(3))[0]=r[0]+n[0]*(t[0]-r[0]),o[1]=r[1]+n[1]*(t[1]-r[1]),o[2]=r[2]+n[2]*(t[2]-r[2]),o},t.max=function(r,t,n){return(n=n||new e(3))[0]=Math.max(r[0],t[0]),n[1]=Math.max(r[1],t[1]),n[2]=Math.max(r[2],t[2]),n},t.min=function(r,t,n){return(n=n||new e(3))[0]=Math.min(r[0],t[0]),n[1]=Math.min(r[1],t[1]),n[2]=Math.min(r[2],t[2]),n},t.mulScalar=function(r,t,n){return(n=n||new e(3))[0]=r[0]*t,n[1]=r[1]*t,n[2]=r[2]*t,n},t.multiply=function(r,t,n){return(n=n||new e(3))[0]=r[0]*t[0],n[1]=r[1]*t[1],n[2]=r[2]*t[2],n},t.negate=function(r,t){return(t=t||new e(3))[0]=-r[0],t[1]=-r[1],t[2]=-r[2],t},t.normalize=function(r,t){t=t||new e(3);var n=r[0]*r[0]+r[1]*r[1]+r[2]*r[2],o=Math.sqrt(n);o>1e-5?(t[0]=r[0]/o,t[1]=r[1]/o,t[2]=r[2]/o):(t[0]=0,t[1]=0,t[2]=0);return t},t.setDefaultType=function(r){var t=e;return e=r,t},t.subtract=function(r,t,n){return(n=n||new e(3))[0]=r[0]-t[0],n[1]=r[1]-t[1],n[2]=r[2]-t[2],n};var e=Float32Array},496:(r,t,e)=>{function n(r){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n(r)}t.__esModule=!0,t.createVAOAndSetAttributes=a,t.createVAOFromBufferInfo=function(r,t,e){return a(r,t.attribSetters||t,e.attribs,e.indices)},t.createVertexArrayInfo=function(r,t,e){var n=r.createVertexArray();r.bindVertexArray(n),t.length||(t=[t]);return t.forEach((function(t){o.setBuffersAndAttributes(r,t,e)})),r.bindVertexArray(null),{numElements:e.numElements,elementType:e.elementType,vertexArrayObject:n}};var o=function(r,t){if(!t&&r&&r.__esModule)return r;if(null===r||"object"!=n(r)&&"function"!=typeof r)return{default:r};var e=i(t);if(e&&e.has(r))return e.get(r);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if("default"!==a&&Object.prototype.hasOwnProperty.call(r,a)){var f=u?Object.getOwnPropertyDescriptor(r,a):null;f&&(f.get||f.set)?Object.defineProperty(o,a,f):o[a]=r[a]}return o.default=r,e&&e.set(r,o),o}(e(38));function i(r){if("function"!=typeof WeakMap)return null;var t=new WeakMap,e=new WeakMap;return(i=function(r){return r?e:t})(r)}var u=34963;function a(r,t,e,n){var i=r.createVertexArray();return r.bindVertexArray(i),o.setAttributes(t,e),n&&r.bindBuffer(u,n),r.bindVertexArray(null),i}}},t={};var e=function e(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return r[n](i,i.exports,e),i.exports}(395);return e})()));