UNPKG

echarts-gl

Version:

Extension pack of ECharts providing 3D plots and globe visualization

1 lines 640 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("echarts")):"function"==typeof define&&define.amd?define(["echarts"],t):"object"==typeof exports?exports["echarts-gl"]=t(require("echarts")):e["echarts-gl"]=t(e.echarts)}(self,(function(e){return(()=>{"use strict";var t={535:(e,t,r)=>{r.r(t);var i=r(83);function n(e,t,r){"object"==typeof t&&(r=t,t=null);var i,n=this;if(!(e instanceof Function))for(var s in i=[],e)e.hasOwnProperty(s)&&i.push(s);var l=function(t){if(n.apply(this,arguments),e instanceof Function?a(this,e.call(this,t)):o(this,e,i),this.constructor===l)for(var r=l.__initializers__,s=0;s<r.length;s++)r[s].apply(this,arguments)};l.__super__=n,n.__initializers__?l.__initializers__=n.__initializers__.slice():l.__initializers__=[],t&&l.__initializers__.push(t);var h=function(){};return h.prototype=n.prototype,l.prototype=new h,l.prototype.constructor=l,a(l.prototype,r),l.extend=n.extend,l.derive=n.extend,l}function a(e,t){if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}function o(e,t,r){for(var i=0;i<r.length;i++){var n=r[i];e[n]=t[n]}}const s={extend:n,derive:n};function l(e,t){this.action=e,this.context=t}const h={trigger:function(e){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(e)){var t=this.__handlers__[e],r=t.length,i=-1,n=arguments;switch(n.length){case 1:for(;++i<r;)t[i].action.call(t[i].context);return;case 2:for(;++i<r;)t[i].action.call(t[i].context,n[1]);return;case 3:for(;++i<r;)t[i].action.call(t[i].context,n[1],n[2]);return;case 4:for(;++i<r;)t[i].action.call(t[i].context,n[1],n[2],n[3]);return;case 5:for(;++i<r;)t[i].action.call(t[i].context,n[1],n[2],n[3],n[4]);return;default:for(;++i<r;)t[i].action.apply(t[i].context,Array.prototype.slice.call(n,1));return}}},on:function(e,t,r){if(e&&t){var i=this.__handlers__||(this.__handlers__={});if(i[e]){if(this.has(e,t))return}else i[e]=[];var n=new l(t,r||this);return i[e].push(n),this}},once:function(e,t,r){if(e&&t){var i=this;return this.on(e,(function r(){i.off(e,r),t.apply(this,arguments)}),r)}},before:function(e,t,r){if(e&&t)return e="before"+e,this.on(e,t,r)},after:function(e,t,r){if(e&&t)return e="after"+e,this.on(e,t,r)},success:function(e,t){return this.once("success",e,t)},error:function(e,t){return this.once("error",e,t)},off:function(e,t){var r=this.__handlers__||(this.__handlers__={});if(t){if(r[e]){for(var i=r[e],n=[],a=0;a<i.length;a++)t&&i[a].action!==t&&n.push(i[a]);r[e]=n}return this}r[e]=[]},has:function(e,t){var r=this.__handlers__;if(!r||!r[e])return!1;for(var i=r[e],n=0;n<i.length;n++)if(i[n].action===t)return!0}};var u=0,c=Array.prototype.forEach,d={genGUID:function(){return++u},relative2absolute:function(e,t){if(!t||e.match(/^\//))return e;for(var r=e.split("/"),i=t.split("/"),n=r[0];"."===n||".."===n;)".."===n&&i.pop(),r.shift(),n=r[0];return i.join("/")+"/"+r.join("/")},extend:function(e,t){if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},defaults:function(e,t){if(t)for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},extendWithPropList:function(e,t,r){if(t)for(var i=0;i<r.length;i++){var n=r[i];e[n]=t[n]}return e},defaultsWithPropList:function(e,t,r){if(t)for(var i=0;i<r.length;i++){var n=r[i];null==e[n]&&(e[n]=t[n])}return e},each:function(e,t,r){if(e&&t)if(e.forEach&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length)for(var i=0,n=e.length;i<n;i++)t.call(r,e[i],i,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(r,e[a],a,e)},isObject:function(e){return e===Object(e)},isArray:function(e){return Array.isArray(e)},isArrayLike:function(e){return!!e&&e.length===+e.length},clone:function(e){if(d.isObject(e)){if(d.isArray(e))return e.slice();if(d.isArrayLike(e)){for(var t=new e.constructor(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}return d.extend({},e)}return e}};const f=d;var p=function(){this.__uid__=f.genGUID()};p.__initializers__=[function(e){f.extend(this,e)}],f.extend(p,s),f.extend(p.prototype,h);const m=p;var g,_=1e-6,v=Array,y=Math.random,x={create:function(){var e=new v(3);return e[0]=0,e[1]=0,e[2]=0,e},clone:function(e){var t=new v(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:function(e,t,r){var i=new v(3);return i[0]=e,i[1]=t,i[2]=r,i},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},set:function(e,t,r,i){return e[0]=t,e[1]=r,e[2]=i,e},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},subtract:function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}};x.sub=x.subtract,x.multiply=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e},x.mul=x.multiply,x.divide=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e},x.div=x.divide,x.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e},x.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e},x.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},x.scaleAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e},x.distance=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+i*i+n*n)},x.dist=x.distance,x.squaredDistance=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return r*r+i*i+n*n},x.sqrDist=x.squaredDistance,x.length=function(e){var t=e[0],r=e[1],i=e[2];return Math.sqrt(t*t+r*r+i*i)},x.len=x.length,x.squaredLength=function(e){var t=e[0],r=e[1],i=e[2];return t*t+r*r+i*i},x.sqrLen=x.squaredLength,x.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},x.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},x.normalize=function(e,t){var r=t[0],i=t[1],n=t[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e},x.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},x.cross=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=n*l-a*s,e[1]=a*o-i*l,e[2]=i*s-n*o,e},x.lerp=function(e,t,r,i){var n=t[0],a=t[1],o=t[2];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=o+i*(r[2]-o),e},x.random=function(e,t){t=t||1;var r=2*y()*Math.PI,i=2*y()-1,n=Math.sqrt(1-i*i)*t;return e[0]=Math.cos(r)*n,e[1]=Math.sin(r)*n,e[2]=i*t,e},x.transformMat4=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[3]*i+r[7]*n+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*i+r[4]*n+r[8]*a+r[12])/o,e[1]=(r[1]*i+r[5]*n+r[9]*a+r[13])/o,e[2]=(r[2]*i+r[6]*n+r[10]*a+r[14])/o,e},x.transformMat3=function(e,t,r){var i=t[0],n=t[1],a=t[2];return e[0]=i*r[0]+n*r[3]+a*r[6],e[1]=i*r[1]+n*r[4]+a*r[7],e[2]=i*r[2]+n*r[5]+a*r[8],e},x.transformQuat=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2],h=r[3],u=h*i+s*a-l*n,c=h*n+l*i-o*a,d=h*a+o*n-s*i,f=-o*i-s*n-l*a;return e[0]=u*h+f*-o+c*-l-d*-s,e[1]=c*h+f*-s+d*-o-u*-l,e[2]=d*h+f*-l+u*-s-c*-o,e},x.rotateX=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0],a[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),a[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},x.rotateY=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),a[1]=n[1],a[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},x.rotateZ=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),a[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),a[2]=n[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},x.forEach=(g=x.create(),function(e,t,r,i,n,a){var o,s;for(t||(t=3),r||(r=0),s=i?Math.min(i*t+r,e.length):e.length,o=r;o<s;o+=t)g[0]=e[o],g[1]=e[o+1],g[2]=e[o+2],n(g,g,a),e[o]=g[0],e[o+1]=g[1],e[o+2]=g[2];return e}),x.angle=function(e,t){var r=x.fromValues(e[0],e[1],e[2]),i=x.fromValues(t[0],t[1],t[2]);x.normalize(r,r),x.normalize(i,i);var n=x.dot(r,i);return n>1?0:Math.acos(n)};const b=x;var w=function(e,t,r){e=e||0,t=t||0,r=r||0,this.array=b.fromValues(e,t,r),this._dirty=!0};w.prototype={constructor:w,add:function(e){return b.add(this.array,this.array,e.array),this._dirty=!0,this},set:function(e,t,r){return this.array[0]=e,this.array[1]=t,this.array[2]=r,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this._dirty=!0,this},clone:function(){return new w(this.x,this.y,this.z)},copy:function(e){return b.copy(this.array,e.array),this._dirty=!0,this},cross:function(e,t){return b.cross(this.array,e.array,t.array),this._dirty=!0,this},dist:function(e){return b.dist(this.array,e.array)},distance:function(e){return b.distance(this.array,e.array)},div:function(e){return b.div(this.array,this.array,e.array),this._dirty=!0,this},divide:function(e){return b.divide(this.array,this.array,e.array),this._dirty=!0,this},dot:function(e){return b.dot(this.array,e.array)},len:function(){return b.len(this.array)},length:function(){return b.length(this.array)},lerp:function(e,t,r){return b.lerp(this.array,e.array,t.array,r),this._dirty=!0,this},min:function(e){return b.min(this.array,this.array,e.array),this._dirty=!0,this},max:function(e){return b.max(this.array,this.array,e.array),this._dirty=!0,this},mul:function(e){return b.mul(this.array,this.array,e.array),this._dirty=!0,this},multiply:function(e){return b.multiply(this.array,this.array,e.array),this._dirty=!0,this},negate:function(){return b.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return b.normalize(this.array,this.array),this._dirty=!0,this},random:function(e){return b.random(this.array,e),this._dirty=!0,this},scale:function(e){return b.scale(this.array,this.array,e),this._dirty=!0,this},scaleAndAdd:function(e,t){return b.scaleAndAdd(this.array,this.array,e.array,t),this._dirty=!0,this},sqrDist:function(e){return b.sqrDist(this.array,e.array)},squaredDistance:function(e){return b.squaredDistance(this.array,e.array)},sqrLen:function(){return b.sqrLen(this.array)},squaredLength:function(){return b.squaredLength(this.array)},sub:function(e){return b.sub(this.array,this.array,e.array),this._dirty=!0,this},subtract:function(e){return b.subtract(this.array,this.array,e.array),this._dirty=!0,this},transformMat3:function(e){return b.transformMat3(this.array,this.array,e.array),this._dirty=!0,this},transformMat4:function(e){return b.transformMat4(this.array,this.array,e.array),this._dirty=!0,this},transformQuat:function(e){return b.transformQuat(this.array,this.array,e.array),this._dirty=!0,this},applyProjection:function(e){var t=this.array;if(0===(e=e.array)[15]){var r=-1/t[2];t[0]=e[0]*t[0]*r,t[1]=e[5]*t[1]*r,t[2]=(e[10]*t[2]+e[14])*r}else t[0]=e[0]*t[0]+e[12],t[1]=e[5]*t[1]+e[13],t[2]=e[10]*t[2]+e[14];return this._dirty=!0,this},eulerFromQuat:function(e,t){w.eulerFromQuat(this,e,t)},eulerFromMat3:function(e,t){w.eulerFromMat3(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var T=Object.defineProperty;if(T){var S=w.prototype;T(S,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),T(S,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),T(S,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}})}function M(e,t,r){return e<t?t:e>r?r:e}w.add=function(e,t,r){return b.add(e.array,t.array,r.array),e._dirty=!0,e},w.set=function(e,t,r,i){b.set(e.array,t,r,i),e._dirty=!0},w.copy=function(e,t){return b.copy(e.array,t.array),e._dirty=!0,e},w.cross=function(e,t,r){return b.cross(e.array,t.array,r.array),e._dirty=!0,e},w.distance=w.dist=function(e,t){return b.distance(e.array,t.array)},w.divide=w.div=function(e,t,r){return b.divide(e.array,t.array,r.array),e._dirty=!0,e},w.dot=function(e,t){return b.dot(e.array,t.array)},w.len=function(e){return b.length(e.array)},w.lerp=function(e,t,r,i){return b.lerp(e.array,t.array,r.array,i),e._dirty=!0,e},w.min=function(e,t,r){return b.min(e.array,t.array,r.array),e._dirty=!0,e},w.max=function(e,t,r){return b.max(e.array,t.array,r.array),e._dirty=!0,e},w.multiply=w.mul=function(e,t,r){return b.multiply(e.array,t.array,r.array),e._dirty=!0,e},w.negate=function(e,t){return b.negate(e.array,t.array),e._dirty=!0,e},w.normalize=function(e,t){return b.normalize(e.array,t.array),e._dirty=!0,e},w.random=function(e,t){return b.random(e.array,t),e._dirty=!0,e},w.scale=function(e,t,r){return b.scale(e.array,t.array,r),e._dirty=!0,e},w.scaleAndAdd=function(e,t,r,i){return b.scaleAndAdd(e.array,t.array,r.array,i),e._dirty=!0,e},w.squaredDistance=w.sqrDist=function(e,t){return b.sqrDist(e.array,t.array)},w.squaredLength=w.sqrLen=function(e){return b.sqrLen(e.array)},w.subtract=w.sub=function(e,t,r){return b.subtract(e.array,t.array,r.array),e._dirty=!0,e},w.transformMat3=function(e,t,r){return b.transformMat3(e.array,t.array,r.array),e._dirty=!0,e},w.transformMat4=function(e,t,r){return b.transformMat4(e.array,t.array,r.array),e._dirty=!0,e},w.transformQuat=function(e,t,r){return b.transformQuat(e.array,t.array,r.array),e._dirty=!0,e};var A=Math.atan2,E=Math.asin,C=Math.abs;w.eulerFromQuat=function(e,t,r){e._dirty=!0,t=t.array;var i=e.array,n=t[0],a=t[1],o=t[2],s=t[3],l=n*n,h=a*a,u=o*o,c=s*s;switch(r=(r||"XYZ").toUpperCase()){case"XYZ":i[0]=A(2*(n*s-a*o),c-l-h+u),i[1]=E(M(2*(n*o+a*s),-1,1)),i[2]=A(2*(o*s-n*a),c+l-h-u);break;case"YXZ":i[0]=E(M(2*(n*s-a*o),-1,1)),i[1]=A(2*(n*o+a*s),c-l-h+u),i[2]=A(2*(n*a+o*s),c-l+h-u);break;case"ZXY":i[0]=E(M(2*(n*s+a*o),-1,1)),i[1]=A(2*(a*s-o*n),c-l-h+u),i[2]=A(2*(o*s-n*a),c-l+h-u);break;case"ZYX":i[0]=A(2*(n*s+o*a),c-l-h+u),i[1]=E(M(2*(a*s-n*o),-1,1)),i[2]=A(2*(n*a+o*s),c+l-h-u);break;case"YZX":i[0]=A(2*(n*s-o*a),c-l+h-u),i[1]=A(2*(a*s-n*o),c+l-h-u),i[2]=E(M(2*(n*a+o*s),-1,1));break;case"XZY":i[0]=A(2*(n*s+a*o),c-l+h-u),i[1]=A(2*(n*o+a*s),c+l-h-u),i[2]=E(M(2*(o*s-n*a),-1,1));break;default:console.warn("Unkown order: "+r)}return e},w.eulerFromMat3=function(e,t,r){var i=t.array,n=i[0],a=i[3],o=i[6],s=i[1],l=i[4],h=i[7],u=i[2],c=i[5],d=i[8],f=e.array;switch(r=(r||"XYZ").toUpperCase()){case"XYZ":f[1]=E(M(o,-1,1)),C(o)<.99999?(f[0]=A(-h,d),f[2]=A(-a,n)):(f[0]=A(c,l),f[2]=0);break;case"YXZ":f[0]=E(-M(h,-1,1)),C(h)<.99999?(f[1]=A(o,d),f[2]=A(s,l)):(f[1]=A(-u,n),f[2]=0);break;case"ZXY":f[0]=E(M(c,-1,1)),C(c)<.99999?(f[1]=A(-u,d),f[2]=A(-a,l)):(f[1]=0,f[2]=A(s,n));break;case"ZYX":f[1]=E(-M(u,-1,1)),C(u)<.99999?(f[0]=A(c,d),f[2]=A(s,n)):(f[0]=0,f[2]=A(-a,l));break;case"YZX":f[2]=E(M(s,-1,1)),C(s)<.99999?(f[0]=A(-h,l),f[1]=A(-u,n)):(f[0]=0,f[1]=A(o,d));break;case"XZY":f[2]=E(-M(a,-1,1)),C(a)<.99999?(f[0]=A(c,l),f[1]=A(o,n)):(f[0]=A(-h,d),f[1]=0);break;default:console.warn("Unkown order: "+r)}return e._dirty=!0,e},Object.defineProperties(w,{POSITIVE_X:{get:function(){return new w(1,0,0)}},NEGATIVE_X:{get:function(){return new w(-1,0,0)}},POSITIVE_Y:{get:function(){return new w(0,1,0)}},NEGATIVE_Y:{get:function(){return new w(0,-1,0)}},POSITIVE_Z:{get:function(){return new w(0,0,1)}},NEGATIVE_Z:{get:function(){return new w(0,0,-1)}},UP:{get:function(){return new w(0,1,0)}},ZERO:{get:function(){return new w}}});const D=w;var L={create:function(){var e=new v(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},clone:function(e){var t=new v(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},fromValues:function(e,t,r,i){var n=new v(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},set:function(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e},subtract:function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}};L.sub=L.subtract,L.multiply=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e},L.mul=L.multiply,L.divide=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e},L.div=L.divide,L.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e},L.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e},L.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},L.scaleAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e},L.distance=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+i*i+n*n+a*a)},L.dist=L.distance,L.squaredDistance=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return r*r+i*i+n*n+a*a},L.sqrDist=L.squaredDistance,L.length=function(e){var t=e[0],r=e[1],i=e[2],n=e[3];return Math.sqrt(t*t+r*r+i*i+n*n)},L.len=L.length,L.squaredLength=function(e){var t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n},L.sqrLen=L.squaredLength,L.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},L.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},L.normalize=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r*r+i*i+n*n+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o),e},L.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},L.lerp=function(e,t,r,i){var n=t[0],a=t[1],o=t[2],s=t[3];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=o+i*(r[2]-o),e[3]=s+i*(r[3]-s),e},L.random=function(e,t){return t=t||1,e[0]=y(),e[1]=y(),e[2]=y(),e[3]=y(),L.normalize(e,e),L.scale(e,e,t),e},L.transformMat4=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*o,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*o,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*o,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*o,e},L.transformQuat=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2],h=r[3],u=h*i+s*a-l*n,c=h*n+l*i-o*a,d=h*a+o*n-s*i,f=-o*i-s*n-l*a;return e[0]=u*h+f*-o+c*-l-d*-s,e[1]=c*h+f*-s+d*-o-u*-l,e[2]=d*h+f*-l+u*-s-c*-o,e},L.forEach=function(){var e=L.create();return function(t,r,i,n,a,o){var s,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,s=i;s<l;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();const P=L;var O={create:function(){var e=new v(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat4:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},clone:function(e){var t=new v(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:function(e,t){if(e===t){var r=t[1],i=t[2],n=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=n}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},invert:function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],h=t[7],u=t[8],c=u*o-s*h,d=-u*a+s*l,f=h*a-o*l,p=r*c+i*d+n*f;return p?(p=1/p,e[0]=c*p,e[1]=(-u*i+n*h)*p,e[2]=(s*i-n*o)*p,e[3]=d*p,e[4]=(u*r-n*l)*p,e[5]=(-s*r+n*a)*p,e[6]=f*p,e[7]=(-h*r+i*l)*p,e[8]=(o*r-i*a)*p,e):null},adjoint:function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],h=t[7],u=t[8];return e[0]=o*u-s*h,e[1]=n*h-i*u,e[2]=i*s-n*o,e[3]=s*l-a*u,e[4]=r*u-n*l,e[5]=n*a-r*s,e[6]=a*h-o*l,e[7]=i*l-r*h,e[8]=r*o-i*a,e},determinant:function(e){var t=e[0],r=e[1],i=e[2],n=e[3],a=e[4],o=e[5],s=e[6],l=e[7],h=e[8];return t*(h*a-o*l)+r*(-h*n+o*s)+i*(l*n-a*s)},multiply:function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],h=t[6],u=t[7],c=t[8],d=r[0],f=r[1],p=r[2],m=r[3],g=r[4],_=r[5],v=r[6],y=r[7],x=r[8];return e[0]=d*i+f*o+p*h,e[1]=d*n+f*s+p*u,e[2]=d*a+f*l+p*c,e[3]=m*i+g*o+_*h,e[4]=m*n+g*s+_*u,e[5]=m*a+g*l+_*c,e[6]=v*i+y*o+x*h,e[7]=v*n+y*s+x*u,e[8]=v*a+y*l+x*c,e}};O.mul=O.multiply,O.translate=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],h=t[6],u=t[7],c=t[8],d=r[0],f=r[1];return e[0]=i,e[1]=n,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=d*i+f*o+h,e[7]=d*n+f*s+u,e[8]=d*a+f*l+c,e},O.rotate=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],h=t[6],u=t[7],c=t[8],d=Math.sin(r),f=Math.cos(r);return e[0]=f*i+d*o,e[1]=f*n+d*s,e[2]=f*a+d*l,e[3]=f*o-d*i,e[4]=f*s-d*n,e[5]=f*l-d*a,e[6]=h,e[7]=u,e[8]=c,e},O.scale=function(e,t,r){var i=r[0],n=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},O.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},O.fromQuat=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r+r,s=i+i,l=n+n,h=r*o,u=i*o,c=i*s,d=n*o,f=n*s,p=n*l,m=a*o,g=a*s,_=a*l;return e[0]=1-c-p,e[3]=u-_,e[6]=d+g,e[1]=u+_,e[4]=1-h-p,e[7]=f-m,e[2]=d-g,e[5]=f+m,e[8]=1-h-c,e},O.normalFromMat4=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],h=t[7],u=t[8],c=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15],v=r*s-i*o,y=r*l-n*o,x=r*h-a*o,b=i*l-n*s,w=i*h-a*s,T=n*h-a*l,S=u*m-c*p,M=u*g-d*p,A=u*_-f*p,E=c*g-d*m,C=c*_-f*m,D=d*_-f*g,L=v*D-y*C+x*E+b*A-w*M+T*S;return L?(L=1/L,e[0]=(s*D-l*C+h*E)*L,e[1]=(l*A-o*D-h*M)*L,e[2]=(o*C-s*A+h*S)*L,e[3]=(n*C-i*D-a*E)*L,e[4]=(r*D-n*A+a*M)*L,e[5]=(i*A-r*C-a*S)*L,e[6]=(m*T-g*w+_*b)*L,e[7]=(g*x-p*T-_*y)*L,e[8]=(p*w-m*x+_*v)*L,e):null},O.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2))};const N=O;var I,R,B,F,z={create:function(){var e=new v(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}};z.rotationTo=(I=b.create(),R=b.fromValues(1,0,0),B=b.fromValues(0,1,0),function(e,t,r){var i=b.dot(t,r);return i<-.999999?(b.cross(I,R,t),b.length(I)<1e-6&&b.cross(I,B,t),b.normalize(I,I),z.setAxisAngle(e,I,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(b.cross(I,t,r),e[0]=I[0],e[1]=I[1],e[2]=I[2],e[3]=1+i,z.normalize(e,e))}),z.setAxes=(F=N.create(),function(e,t,r,i){return F[0]=r[0],F[3]=r[1],F[6]=r[2],F[1]=i[0],F[4]=i[1],F[7]=i[2],F[2]=-t[0],F[5]=-t[1],F[8]=-t[2],z.normalize(e,z.fromMat3(e,F))}),z.clone=P.clone,z.fromValues=P.fromValues,z.copy=P.copy,z.set=P.set,z.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},z.setAxisAngle=function(e,t,r){r*=.5;var i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e},z.add=P.add,z.multiply=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=r[0],l=r[1],h=r[2],u=r[3];return e[0]=i*u+o*s+n*h-a*l,e[1]=n*u+o*l+a*s-i*h,e[2]=a*u+o*h+i*l-n*s,e[3]=o*u-i*s-n*l-a*h,e},z.mul=z.multiply,z.scale=P.scale,z.rotateX=function(e,t,r){r*=.5;var i=t[0],n=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*s,e[1]=n*l+a*s,e[2]=a*l-n*s,e[3]=o*l-i*s,e},z.rotateY=function(e,t,r){r*=.5;var i=t[0],n=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-a*s,e[1]=n*l+o*s,e[2]=a*l+i*s,e[3]=o*l-n*s,e},z.rotateZ=function(e,t,r){r*=.5;var i=t[0],n=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+n*s,e[1]=n*l-i*s,e[2]=a*l+o*s,e[3]=o*l-a*s,e},z.calculateW=function(e,t){var r=t[0],i=t[1],n=t[2];return e[0]=r,e[1]=i,e[2]=n,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),e},z.dot=P.dot,z.lerp=P.lerp,z.slerp=function(e,t,r,i){var n,a,o,s,l,h=t[0],u=t[1],c=t[2],d=t[3],f=r[0],p=r[1],m=r[2],g=r[3];return(a=h*f+u*p+c*m+d*g)<0&&(a=-a,f=-f,p=-p,m=-m,g=-g),1-a>1e-6?(n=Math.acos(a),o=Math.sin(n),s=Math.sin((1-i)*n)/o,l=Math.sin(i*n)/o):(s=1-i,l=i),e[0]=s*h+l*f,e[1]=s*u+l*p,e[2]=s*c+l*m,e[3]=s*d+l*g,e},z.invert=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r*r+i*i+n*n+a*a,s=o?1/o:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-n*s,e[3]=a*s,e},z.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},z.length=P.length,z.len=z.length,z.squaredLength=P.squaredLength,z.sqrLen=z.squaredLength,z.normalize=P.normalize,z.fromMat3=function(e,t){var r,i=t[0]+t[4]+t[8];if(i>0)r=Math.sqrt(i+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var n=0;t[4]>t[0]&&(n=1),t[8]>t[3*n+n]&&(n=2);var a=(n+1)%3,o=(n+2)%3;r=Math.sqrt(t[3*n+n]-t[3*a+a]-t[3*o+o]+1),e[n]=.5*r,r=.5/r,e[3]=(t[3*a+o]-t[3*o+a])*r,e[a]=(t[3*a+n]+t[3*n+a])*r,e[o]=(t[3*o+n]+t[3*n+o])*r}return e};const G=z;var U,k=function(e,t,r,i){e=e||0,t=t||0,r=r||0,i=void 0===i?1:i,this.array=G.fromValues(e,t,r,i),this._dirty=!0};k.prototype={constructor:k,add:function(e){return G.add(this.array,this.array,e.array),this._dirty=!0,this},calculateW:function(){return G.calculateW(this.array,this.array),this._dirty=!0,this},set:function(e,t,r,i){return this.array[0]=e,this.array[1]=t,this.array[2]=r,this.array[3]=i,this._dirty=!0,this},setArray:function(e){return this.array[0]=e[0],this.array[1]=e[1],this.array[2]=e[2],this.array[3]=e[3],this._dirty=!0,this},clone:function(){return new k(this.x,this.y,this.z,this.w)},conjugate:function(){return G.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(e){return G.copy(this.array,e.array),this._dirty=!0,this},dot:function(e){return G.dot(this.array,e.array)},fromMat3:function(e){return G.fromMat3(this.array,e.array),this._dirty=!0,this},fromMat4:(U=N.create(),function(e){return N.fromMat4(U,e.array),N.transpose(U,U),G.fromMat3(this.array,U),this._dirty=!0,this}),identity:function(){return G.identity(this.array),this._dirty=!0,this},invert:function(){return G.invert(this.array,this.array),this._dirty=!0,this},len:function(){return G.len(this.array)},length:function(){return G.length(this.array)},lerp:function(e,t,r){return G.lerp(this.array,e.array,t.array,r),this._dirty=!0,this},mul:function(e){return G.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return G.multiply(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return G.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return G.multiply(this.array,e.array,this.array),this._dirty=!0,this},normalize:function(){return G.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(e){return G.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return G.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return G.rotateZ(this.array,this.array,e),this._dirty=!0,this},rotationTo:function(e,t){return G.rotationTo(this.array,e.array,t.array),this._dirty=!0,this},setAxes:function(e,t,r){return G.setAxes(this.array,e.array,t.array,r.array),this._dirty=!0,this},setAxisAngle:function(e,t){return G.setAxisAngle(this.array,e.array,t),this._dirty=!0,this},slerp:function(e,t,r){return G.slerp(this.array,e.array,t.array,r),this._dirty=!0,this},sqrLen:function(){return G.sqrLen(this.array)},squaredLength:function(){return G.squaredLength(this.array)},fromEuler:function(e,t){return k.fromEuler(this,e,t)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var V=Object.defineProperty;if(V){var H=k.prototype;V(H,"x",{get:function(){return this.array[0]},set:function(e){this.array[0]=e,this._dirty=!0}}),V(H,"y",{get:function(){return this.array[1]},set:function(e){this.array[1]=e,this._dirty=!0}}),V(H,"z",{get:function(){return this.array[2]},set:function(e){this.array[2]=e,this._dirty=!0}}),V(H,"w",{get:function(){return this.array[3]},set:function(e){this.array[3]=e,this._dirty=!0}})}k.add=function(e,t,r){return G.add(e.array,t.array,r.array),e._dirty=!0,e},k.set=function(e,t,r,i,n){G.set(e.array,t,r,i,n),e._dirty=!0},k.copy=function(e,t){return G.copy(e.array,t.array),e._dirty=!0,e},k.calculateW=function(e,t){return G.calculateW(e.array,t.array),e._dirty=!0,e},k.conjugate=function(e,t){return G.conjugate(e.array,t.array),e._dirty=!0,e},k.identity=function(e){return G.identity(e.array),e._dirty=!0,e},k.invert=function(e,t){return G.invert(e.array,t.array),e._dirty=!0,e},k.dot=function(e,t){return G.dot(e.array,t.array)},k.len=function(e){return G.length(e.array)},k.lerp=function(e,t,r,i){return G.lerp(e.array,t.array,r.array,i),e._dirty=!0,e},k.slerp=function(e,t,r,i){return G.slerp(e.array,t.array,r.array,i),e._dirty=!0,e},k.multiply=k.mul=function(e,t,r){return G.multiply(e.array,t.array,r.array),e._dirty=!0,e},k.rotateX=function(e,t,r){return G.rotateX(e.array,t.array,r),e._dirty=!0,e},k.rotateY=function(e,t,r){return G.rotateY(e.array,t.array,r),e._dirty=!0,e},k.rotateZ=function(e,t,r){return G.rotateZ(e.array,t.array,r),e._dirty=!0,e},k.setAxisAngle=function(e,t,r){return G.setAxisAngle(e.array,t.array,r),e._dirty=!0,e},k.normalize=function(e,t){return G.normalize(e.array,t.array),e._dirty=!0,e},k.squaredLength=k.sqrLen=function(e){return G.sqrLen(e.array)},k.fromMat3=function(e,t){return G.fromMat3(e.array,t.array),e._dirty=!0,e},k.setAxes=function(e,t,r,i){return G.setAxes(e.array,t.array,r.array,i.array),e._dirty=!0,e},k.rotationTo=function(e,t,r){return G.rotationTo(e.array,t.array,r.array),e._dirty=!0,e},k.fromEuler=function(e,t,r){e._dirty=!0,t=t.array;var i=e.array,n=Math.cos(t[0]/2),a=Math.cos(t[1]/2),o=Math.cos(t[2]/2),s=Math.sin(t[0]/2),l=Math.sin(t[1]/2),h=Math.sin(t[2]/2);switch(r=(r||"XYZ").toUpperCase()){case"XYZ":i[0]=s*a*o+n*l*h,i[1]=n*l*o-s*a*h,i[2]=n*a*h+s*l*o,i[3]=n*a*o-s*l*h;break;case"YXZ":i[0]=s*a*o+n*l*h,i[1]=n*l*o-s*a*h,i[2]=n*a*h-s*l*o,i[3]=n*a*o+s*l*h;break;case"ZXY":i[0]=s*a*o-n*l*h,i[1]=n*l*o+s*a*h,i[2]=n*a*h+s*l*o,i[3]=n*a*o-s*l*h;break;case"ZYX":i[0]=s*a*o-n*l*h,i[1]=n*l*o+s*a*h,i[2]=n*a*h-s*l*o,i[3]=n*a*o+s*l*h;break;case"YZX":i[0]=s*a*o+n*l*h,i[1]=n*l*o+s*a*h,i[2]=n*a*h-s*l*o,i[3]=n*a*o-s*l*h;break;case"XZY":i[0]=s*a*o-n*l*h,i[1]=n*l*o-s*a*h,i[2]=n*a*h+s*l*o,i[3]=n*a*o+s*l*h}};const W=k;var j={create:function(){var e=new v(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},clone:function(e){var t=new v(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},transpose:function(e,t){if(e===t){var r=t[1],i=t[2],n=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=n,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},invert:function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],h=t[7],u=t[8],c=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15],v=r*s-i*o,y=r*l-n*o,x=r*h-a*o,b=i*l-n*s,w=i*h-a*s,T=n*h-a*l,S=u*m-c*p,M=u*g-d*p,A=u*_-f*p,E=c*g-d*m,C=c*_-f*m,D=d*_-f*g,L=v*D-y*C+x*E+b*A-w*M+T*S;return L?(L=1/L,e[0]=(s*D-l*C+h*E)*L,e[1]=(n*C-i*D-a*E)*L,e[2]=(m*T-g*w+_*b)*L,e[3]=(d*w-c*T-f*b)*L,e[4]=(l*A-o*D-h*M)*L,e[5]=(r*D-n*A+a*M)*L,e[6]=(g*x-p*T-_*y)*L,e[7]=(u*T-d*x+f*y)*L,e[8]=(o*C-s*A+h*S)*L,e[9]=(i*A-r*C-a*S)*L,e[10]=(p*w-m*x+_*v)*L,e[11]=(c*x-u*w-f*v)*L,e[12]=(s*M-o*E-l*S)*L,e[13]=(r*E-i*M+n*S)*L,e[14]=(m*y-p*b-g*v)*L,e[15]=(u*b-c*y+d*v)*L,e):null},adjoint:function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],h=t[7],u=t[8],c=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15];return e[0]=s*(d*_-f*g)-c*(l*_-h*g)+m*(l*f-h*d),e[1]=-(i*(d*_-f*g)-c*(n*_-a*g)+m*(n*f-a*d)),e[2]=i*(l*_-h*g)-s*(n*_-a*g)+m*(n*h-a*l),e[3]=-(i*(l*f-h*d)-s*(n*f-a*d)+c*(n*h-a*l)),e[4]=-(o*(d*_-f*g)-u*(l*_-h*g)+p*(l*f-h*d)),e[5]=r*(d*_-f*g)-u*(n*_-a*g)+p*(n*f-a*d),e[6]=-(r*(l*_-h*g)-o*(n*_-a*g)+p*(n*h-a*l)),e[7]=r*(l*f-h*d)-o*(n*f-a*d)+u*(n*h-a*l),e[8]=o*(c*_-f*m)-u*(s*_-h*m)+p*(s*f-h*c),e[9]=-(r*(c*_-f*m)-u*(i*_-a*m)+p*(i*f-a*c)),e[10]=r*(s*_-h*m)-o*(i*_-a*m)+p*(i*h-a*s),e[11]=-(r*(s*f-h*c)-o*(i*f-a*c)+u*(i*h-a*s)),e[12]=-(o*(c*g-d*m)-u*(s*g-l*m)+p*(s*d-l*c)),e[13]=r*(c*g-d*m)-u*(i*g-n*m)+p*(i*d-n*c),e[14]=-(r*(s*g-l*m)-o*(i*g-n*m)+p*(i*l-n*s)),e[15]=r*(s*d-l*c)-o*(i*d-n*c)+u*(i*l-n*s),e},determinant:function(e){var t=e[0],r=e[1],i=e[2],n=e[3],a=e[4],o=e[5],s=e[6],l=e[7],h=e[8],u=e[9],c=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15];return(t*o-r*a)*(c*g-d*m)-(t*s-i*a)*(u*g-d*p)+(t*l-n*a)*(u*m-c*p)+(r*s-i*o)*(h*g-d*f)-(r*l-n*o)*(h*m-c*f)+(i*l-n*s)*(h*p-u*f)},multiply:function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],h=t[6],u=t[7],c=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],_=t[14],v=t[15],y=r[0],x=r[1],b=r[2],w=r[3];return e[0]=y*i+x*s+b*c+w*m,e[1]=y*n+x*l+b*d+w*g,e[2]=y*a+x*h+b*f+w*_,e[3]=y*o+x*u+b*p+w*v,y=r[4],x=r[5],b=r[6],w=r[7],e[4]=y*i+x*s+b*c+w*m,e[5]=y*n+x*l+b*d+w*g,e[6]=y*a+x*h+b*f+w*_,e[7]=y*o+x*u+b*p+w*v,y=r[8],x=r[9],b=r[10],w=r[11],e[8]=y*i+x*s+b*c+w*m,e[9]=y*n+x*l+b*d+w*g,e[10]=y*a+x*h+b*f+w*_,e[11]=y*o+x*u+b*p+w*v,y=r[12],x=r[13],b=r[14],w=r[15],e[12]=y*i+x*s+b*c+w*m,e[13]=y*n+x*l+b*d+w*g,e[14]=y*a+x*h+b*f+w*_,e[15]=y*o+x*u+b*p+w*v,e},multiplyAffine:function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[4],s=t[5],l=t[6],h=t[8],u=t[9],c=t[10],d=t[12],f=t[13],p=t[14],m=r[0],g=r[1],_=r[2];return e[0]=m*i+g*o+_*h,e[1]=m*n+g*s+_*u,e[2]=m*a+g*l+_*c,m=r[4],g=r[5],_=r[6],e[4]=m*i+g*o+_*h,e[5]=m*n+g*s+_*u,e[6]=m*a+g*l+_*c,m=r[8],g=r[9],_=r[10],e[8]=m*i+g*o+_*h,e[9]=m*n+g*s+_*u,e[10]=m*a+g*l+_*c,m=r[12],g=r[13],_=r[14],e[12]=m*i+g*o+_*h+d,e[13]=m*n+g*s+_*u+f,e[14]=m*a+g*l+_*c+p,e}};j.mul=j.multiply,j.mulAffine=j.multiplyAffine,j.translate=function(e,t,r){var i,n,a,o,s,l,h,u,c,d,f,p,m=r[0],g=r[1],_=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*_+t[12],e[13]=t[1]*m+t[5]*g+t[9]*_+t[13],e[14]=t[2]*m+t[6]*g+t[10]*_+t[14],e[15]=t[3]*m+t[7]*g+t[11]*_+t[15]):(i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],h=t[6],u=t[7],c=t[8],d=t[9],f=t[10],p=t[11],e[0]=i,e[1]=n,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=h,e[7]=u,e[8]=c,e[9]=d,e[10]=f,e[11]=p,e[12]=i*m+s*g+c*_+t[12],e[13]=n*m+l*g+d*_+t[13],e[14]=a*m+h*g+f*_+t[14],e[15]=o*m+u*g+p*_+t[15]),e},j.scale=function(e,t,r){var i=r[0],n=r[1],a=r[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},j.rotate=function(e,t,r,i){var n,a,o,s,l,h,u,c,d,f,p,m,g,v,y,x,b,w,T,S,M,A,E,C,D=i[0],L=i[1],P=i[2],O=Math.sqrt(D*D+L*L+P*P);return Math.abs(O)<_?null:(D*=O=1/O,L*=O,P*=O,n=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],l=t[1],h=t[2],u=t[3],c=t[4],d=t[5],f=t[6],p=t[7],m=t[8],g=t[9],v=t[10],y=t[11],x=D*D*o+a,b=L*D*o+P*n,w=P*D*o-L*n,T=D*L*o-P*n,S=L*L*o+a,M=P*L*o+D*n,A=D*P*o+L*n,E=L*P*o-D*n,C=P*P*o+a,e[0]=s*x+c*b+m*w,e[1]=l*x+d*b+g*w,e[2]=h*x+f*b+v*w,e[3]=u*x+p*b+y*w,e[4]=s*T+c*S+m*M,e[5]=l*T+d*S+g*M,e[6]=h*T+f*S+v*M,e[7]=u*T+p*S+y*M,e[8]=s*A+c*E+m*C,e[9]=l*A+d*E+g*C,e[10]=h*A+f*E+v*C,e[11]=u*A+p*E+y*C,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)},j.rotateX=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],h=t[8],u=t[9],c=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*n+h*i,e[5]=o*n+u*i,e[6]=s*n+c*i,e[7]=l*n+d*i,e[8]=h*n-a*i,e[9]=u*n-o*i,e[10]=c*n-s*i,e[11]=d*n-l*i,e},j.rotateY=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],h=t[8],u=t[9],c=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n-h*i,e[1]=o*n-u*i,e[2]=s*n-c*i,e[3]=l*n-d*i,e[8]=a*i+h*n,e[9]=o*i+u*n,e[10]=s*i+c*n,e[11]=l*i+d*n,e},j.rotateZ=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],h=t[4],u=t[5],c=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n+h*i,e[1]=o*n+u*i,e[2]=s*n+c*i,e[3]=l*n+d*i,e[4]=h*n-a*i,e[5]=u*n-o*i,e[6]=c*n-s*i,e[7]=d*n-l*i,e},j.fromRotationTranslation=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=i+i,l=n+n,h=a+a,u=i*s,c=i*l,d=i*h,f=n*l,p=n*h,m=a*h,g=o*s,_=o*l,v=o*h;return e[0]=1-(f+m),e[1]=c+v,e[2]=d-_,e[3]=0,e[4]=c-v,e[5]=1-(u+m),e[6]=p+g,e[7]=0,e[8]=d+_,e[9]=p-g,e[10]=1-(u+f),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e},j.fromQuat=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r+r,s=i+i,l=n+n,h=r*o,u=i*o,c=i*s,d=n*o,f=n*s,p=n*l,m=a*o,g=a*s,_=a*l;return e[0]=1-c-p,e[1]=u+_,e[2]=d-g,e[3]=0,e[4]=u-_,e[5]=1-h-p,e[6]=f+m,e[7]=0,e[8]=d+g,e[9]=f-m,e[10]=1-h-c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},j.frustum=function(e,t,r,i,n,a,o){var s=1/(r-t),l=1/(n-i),h=1/(a-o);return e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(n+i)*l,e[10]=(o+a)*h,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*h,e[15]=0,e},j.perspective=function(e,t,r,i,n){var a=1/Math.tan(t/2),o=1/(i-n);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(n+i)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*n*i*o,e[15]=0,e},j.ortho=function(e,t,r,i,n,a,o){var s=1/(t-r),l=1/(i-n),h=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*h,e[11]=0,e[12]=(t+r)*s,e[13]=(n+i)*l,e[14]=(o+a)*h,e[15]=1,e},j.lookAt=function(e,t,r,i){var n,a,o,s,l,h,u,c,d,f,p=t[0],m=t[1],g=t[2],v=i[0],y=i[1],x=i[2],b=r[0],w=r[1],T=r[2];return Math.abs(p-b)<_&&Math.abs(m-w)<_&&Math.abs(g-T)<_?j.identity(e):(u=p-b,c=m-w,d=g-T,n=y*(d*=f=1/Math.sqrt(u*u+c*c+d*d))-x*(c*=f),a=x*(u*=f)-v*d,o=v*c-y*u,(f=Math.sqrt(n*n+a*a+o*o))?(n*=f=1/f,a*=f,o*=f):(n=0,a=0,o=0),s=c*o-d*a,l=d*n-u*o,h=u*a-c*n,(f=Math.sqrt(s*s+l*l+h*h))?(s*=f=1/f,l*=f,h*=f):(s=0,l=0,h=0),e[0]=n,e[1]=s,e[2]=u,e[3]=0,e[4]=a,e[5]=l,e[6]=c,e[7]=0,e[8]=o,e[9]=h,e[10]=d,e[11]=0,e[12]=-(n*p+a*m+o*g),e[13]=-(s*p+l*m+h*g),e[14]=-(u*p+c*m+d*g),e[15]=1,e)},j.frob=function(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2)+Math.pow(e[3],2)+Math.pow(e[4],2)+Math.pow(e[5],2)+Math.pow(e[6],2)+Math.pow(e[7],2)+Math.pow(e[8],2)+Math.pow(e[9],2)+Math.pow(e[10],2)+Math.pow(e[11],2)+Math.pow(e[12],2)+Math.pow(e[13],2)+Math.pow(e[14],2)+Math.pow(e[15],2))};const X=j;var q=function(){this._axisX=new D,this._axisY=new D,this._axisZ=new D,this.array=X.create(),this._dirty=!0};q.prototype={constructor:q,setArray:function(e){for(var t=0;t<this.array.length;t++)this.array[t]=e[t];return this._dirty=!0,this},adjoint:function(){return X.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new q).copy(this)},copy:function(e){return X.copy(this.array,e.array),this._dirty=!0,this},determinant:function(){return X.determinant(this.array)},fromQuat:function(e){return X.fromQuat(this.array,e.array),this._dirty=!0,this},fromRotationTranslation:function(e,t){return X.fromRotationTranslation(this.array,e.array,t.array),this._dirty=!0,this},fromMat2d:function(e){return q.fromMat2d(this,e),this},frustum:function(e,t,r,i,n,a){return X.frustum(this.array,e,t,r,i,n,a),this._dirty=!0,this},identity:function(){return X.identity(this.array),this._dirty=!0,this},invert:function(){return X.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(e,t,r){return X.lookAt(this.array,e.array,t.array,r.array),this._dirty=!0,this},mul:function(e){return X.mul(this.array,this.array,e.array),this._dirty=!0,this},mulLeft:function(e){return X.mul(this.array,e.array,this.array),this._dirty=!0,this},multiply:function(e){return X.multiply(this.array,this.array,e.array),this._dirty=!0,this},multiplyLeft:function(e){return X.multiply(this.array,e.array,this.array),this._dirty=!0,this},ortho:function(e,t,r,i,n,a){return X.ortho(this.array,e,t,r,i,n,a),this._dirty=!0,this},perspective:function(e,t,r,i){return X.perspective(this.array,e,t,r,i),this._dirty=!0,this},rotate:function(e,t){return X.rotate(this.array,this.array,e,t.array),this._dirty=!0,this},rotateX:function(e){return X.rotateX(this.array,this.array,e),this._dirty=!0,this},rotateY:function(e){return X.rotateY(this.array,this.array,e),this._dirty=!0,this},rotateZ:function(e){return X.rotateZ(this.array,this.array,e),this._dirty=!0,this},scale:function(e){return X.scale(this.array,this.array,e.array),this._dirty=!0,this},translate:function(e){return X.translate(this.array,this.array,e.array),this._dirty=!0,this},transpose:function(){return X.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:function(){var e=b.create(),t=b.create(),r=b.create(),i=N.create();return function(n,a,o){var s=this.array;b.set(e,s[0],s[1],s[2]),b.set(t,s[4],s[5],s[6]),b.set(r,s[8],s[9],s[10]);var l=b.length(e),h=b.length(t),u=b.length(r);this.determinant()<0&&(l=-l),n&&n.set(l,h,u),o.set(s[12],s[13],s[14]),N.fromMat4(i,s),i[0]/=l,i[1]/=l,i[2]/=l,i[3]/=h,i[4]/=h,i[5]/=h,i[6]/=u,i[7]/=u,i[8]/=u,G.fromMat3(a.array,i),G.normalize(a.array,a.array),a._dirty=!0,o._dirty=!0}}(),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var Z=Object.defineProperty;if(Z){var Y=q.prototype;Z(Y,"z",{get:function(){var e=this.array;return this._axisZ.set(e[8],e[9],e[10]),this._axisZ},set:function(e){var t=this.array;e=e.array,t[8]=e[0],t[9]=e[1],t[10]=e[2],this._dirty=!0}}),Z(Y,"y",{get:function(){var e=this.array;return this._axisY.set(e[4],e[5],e[6]),this._axisY},set:function(e){var t=this.array;e=e.array,t[4]=e[0],t[5]=e[1],t[6]=e[2],this._dirty=!0}}),Z(Y,"x",{get:function(){var e=this.array;return this._axisX.set(e[0],e[1],e[2]),this._axisX},set:function(e){var t=this.array;e=e.array,t[0]=e[0],t[1]=e[1],t[2]=e[2],this._dirty=!0}})}q.adjoint=function(e,t){return X.adjoint(e.array,t.array),e._dirty=!0,e},q.copy=function(e,t){return X.copy(e.array,t.array),e._dirty=!0,e},q.determinant=function(e){return X.determinant(e.array)},q.identity=function(e){return X.identity(e.array),e._dirty=!0,e},q.ortho=function(e,t,r,i,n,a,o){return X.ortho(e.array,t,r,i,n,a,o),e._dirty=!0,e},q.perspective=function(e,t,r,i,n){return X.perspective(e.array,t,r,i,n),e._dirty=!0,e},q.lookAt=function(e,t,r,i){return X.lookAt(e.array,t.array,r.array,i.array),e._dirty=!0,e},q.invert=function(e,t){return X.invert(e.array,t.array),e._dirty=!0,e},q.multiply=q.mul=function(e,t,r){return X.mul(e.array,t.array,r.array),e._dirty=!0,e},q.fromQuat=function(e,t){return X.fromQuat(e.array,t.array),e._dirty=!0,e},q.fromRotationTranslation=function(e,t,r){return X.fromRotationTranslation(e.array,t.array,r.array),e._dirty=!0,e},q.fromMat2d=function(e,t){return e._dirty=!0,t=t.array,(e=e.array)[0]=t[0],e[4]=t[2],e[12]=t[4],e[1]=t[1],e[5]=t[3],e[13]=t[5],e},q.rotate=function(e,t,r,i){return X.rotate(e.array,t.array,r,i.array),e._dirty=!0,e},q.rotateX=function(e,t,r){return X.rotateX(e.array,t.array,r),e._dirty=!0,e},q.rotateY=function(e,t,r){return X.rotateY(e.array,t.array,r),e._dirty=!0,e},q.rotateZ=function(e,t,r){return X.rotateZ(e.array,t.array,r),e._dirty=!0,e},q.scale=function(e,t,r){return X.scale(e.array,t.array,r.array),e._dirty=!0,e},q.transpose=function(e,t){return X.transpose(e.array,t.array),e._dirty=!0,e},q.translate=function(e,t,r){return X.translate(e.array,t.array,r.array),e._dirty=!0,e};const K=q;var Q,J,$,ee,te,re,ie=b.set,ne=b.copy,ae=function(e,t){this.min=e||new D(1/0,1/0,1/0),this.max=t||new D(-1/0,-1/0,-1/0),this.vertices=null};ae.prototype={constructor:ae,updateFromVertices:function(e){if(e.length>0){var t=this.min,r=this.max,i=t.array,n=r.array;ne(i,e[0]),ne(n,e[0]);for(var a=1;a<e.length;a++){var o=e[a];o[0]<i[0]&&(i[0]=o[0]),o[1]<i[1]&&(i[1]=o[1]),o[2]<i[2]&&(i[2]=o[2]),o[0]>n[0]&&(n[0]=o[0]),o[1]>n[1]&&(n[1]=o[1]),o[2]>n[2]&&(n[2]=o[2])}t._dirty=!0,r._dirty=!0}},union:function(e){var t=this.min,r=this.max;return b.min(t.array,t.array,e.min.array),b.max(r.array,r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},intersection:function(e){var t=this.min,r=this.max;return b.max(t.array,t.array,e.min.array),b.min(r.array,r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},intersectBoundingBox:function(e){var t=this.min.array,r=this.max.array,i=e.min.array,n=e.max.array;return!(t[0]>n[0]||t[1]>n[1]||t[2]>n[2]||r[0]<i[0]||r[1]<i[1]||r[2]<i[2])},containBoundingBox:function(e){var t=this.min.array,r=this.max.array,i=e.min.array,n=e.max.array;return t[0]<=i[0]&&t[1]<=i[1]&&t[2]<=i[2]&&r[0]>=n[0]&&r[1]>=n[1]&&r[2]>=n[2]},containPoint:function(e){var t=this.min.array,r=this.max.array,i=e.array;return t[0]<=i[0]&&t[1]<=i[1]&&t[2]<=i[2]&&r[0]>=i[0]&&r[1]>=i[1]&&r[2]>=i[2]},isFinite:function(){var e=this.min.array,t=this.max.array;return isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])&&isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])},applyTransform:function(e){this.transformFrom(this,e)},transformFrom:(Q=b.create(),J=b.create(),$=b.create(),ee=b.create(),te=b.create(),re=b.create(),function(e,t){var r=e.min.array,i=e.max.array,n=t.array;return Q[0]=n[0]*r[0],Q[1]=n[1]*r[0],Q[2]=n[2]*r[0],J[0]=n[0]*i[0],J[1]=n[1]*i[0],J[2]=n[2]*i[0],$[0]=n[4]*r[1],$[1]=n[5]*r[1],$[2]=n[6]*r[1],ee[0]=n[4]*i[1],ee[1]=n[5]*i[1],ee[2]=n[6]*i[1],te[0]=n[8]*r[2],te[1]=n[9]*r[2],te[2]=n[10]*r[2],re[0]=n[8]*i[2],re[1]=n[9]*i[2],re[2]=n[10]*i[2],r=this.min.array,i=this.max.array,r[0]=Math.min(Q[0],J[0])+Math.min($[0],ee[0])+Math.min(te[0],re[0])+n[12],r[1]=Math.min(Q[1],J[1])+Math.min($[1],ee[1])+Math.min(te[1],re[1])+n[13],r[2]=Math.min(Q[2],J[2])+Math.min($[2],ee[2])+Math.min(te[2],re[2])+n[14],i[0]=Math.max(Q[0],J[0])+Math.max($[0],ee[0])+Math.max(te[0],re[0])+n[12],i[1]=Math.max(Q[1],J[1])+Math.max($[1],ee[1])+Math.max(te[1],re[1])+n[13],i[2]=Math.max(Q[2],J[2])+Math.max($[2],ee[2])+Math.max(te[2],re[2])+n[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(e){var t=this.min.array,r=this.max.array,i=e.array,n=t[0],a=t[1],o=t[2],s=r[0],l=r[1],h=t[2],u=r[0],c=r[1],d=r[2];if(1===i[15])t[0]=i[0]*n+i[12],t[1]=i[5]*a+i[13],r[2]=i[10]*o+i[14],r[0]=i[0]*u+i[12],r[1]=i[5]*c+i[13],t[2]=i[10]*d+i[14];else{var f=-1/o;t[0]=i[0]*n*f,t[1]=i[5]*a*f,r[2]=(i[10]*o+i[14])*f,f=-1/h,r[0]=i[0]*s*f,r[1]=i[5]*l*f,f=-1/d,t[2]=(i[10]*d+i[14])*f}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var e=this.vertices;if(!e){e=[];for(var t=0;t<8;t++)e[t]=b.fromValues(0,0,0);this.vertices=e}var r=this.min.array,i=this.max.array;return ie(e[0],r[0],r[1],r[2]),ie(e[1],r[0],i[1],r[2]),ie(e[2],i[0],r[1],r[2]),ie(e[3],i[0],i[1],r[2]),ie(e[4],r[0],r[1],i[2]),ie(e[5],r[0],i[1],i[2]),ie(e[6],i[0],r[1],i[2]),ie(e[7],i[0],i[1],i[2]),this},copy:function(e){var t=this.min,r=this.max;return ne(t.array,e.min.array),ne(r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},clone:function(){var e=new ae;return e.copy(this),e}};const oe=ae;var se,le,he,ue,ce=0;const de=m.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},(function(){this.name||(this.name=(this.type||"NODE")+"_"+ce++),this.position||(this.position=new D),this.rotation||(this.rotation=new W),this.scale||(this.scale=new D(1,1,1)),this.worldTransform=new K,this.localTransform=new K,this._children=[]}),{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(e){var t=this._scene;if(t){var r=t._nodeRepository;delete r[this.name],r[e]=this}this.name=e},add:function(e){var t=e._parent;if(t!==this){t&&t.remove(e),e._parent=this,this._children.push(e);var r=this._scene;r&&r!==e.scene&&e.traverse(this._addSelfToScene,this),e._needsUpdateWorldTransform=!0}},remove:function(e){var t=this._children,r=t.indexOf(e);r<0||(t.splice(r,1),e._parent=null,this._scene&&e.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var e=this._children,t=0;t<e.length;t++)e[t]._parent=null,this._scene&&e[t].traverse(this._removeSelfFromScene,this);this._children=[]},getScene:function(){return this._scene},getParent:function(){return this._parent},_removeSelfFromScene:function(e){e._scene.removeFromScene(e),e._scene=null},_addSelfToScene:function(e){this._scene.addToScene(e),e._scene=this._scene},isAncestor:function(e){for(var t=e._parent;t;){if(t===this)return!0;t=t._parent}return!1},children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},getChildByName:function(e){for(var t=this._children,r=0;r<t.length;r++)if(t[r].name===e)return t[r]},getDescendantByName:function(e){for(var t=this._children,r=0;r<t.length;r++){var i=t[r];if(i.name===e)return i;var n=i.getDescendantByName(e);if(n)return n}},queryNode:function(e){if(e){for(var t=e.split("/"),r=this,i=0;i<t.length;i++){var n=t[i];if(n){for(var a=!1,o=r._children,s=0;s<o.length;s++){var l=o[s];if(l.name===n){r=l,a=!0;break}}if(!a)return}}return r}},getPath:function(e){if(!this._parent)return"/";for(var t=this._parent,r=this.name;t._parent&&(r=t.name+"/"+r,t._parent!=e);)t=t._parent;return!t._parent&&e?null:r},traverse:function(e,t){e.call(t,this);for(var r=this._children,i=0,n=r.length;i<n;i++)r[i].traverse(e,t)},eachChild:function(e,t){for(var r=this._children,i=0,n=r.length;i<n;i++){var a=r[i];e.call(t,a,i)}},setLocalTransform:function(e){X.copy(this.localTransform.array,e.array),this.decomposeLocalTransform()},decomposeLocalTransform:function(e){var t=e?null:this.scale;this.localTransform.decomposeMatrix(t,this.rotation,this.position)},setWorldTransform:function(e){X.copy(this.worldTransform.array,e.array),this.decomposeWorldTransform()},decomposeWorldTransform:(ue=X.create(),function(e){var t=this.localTransform,r=this.worldTransform;this._parent?(X.invert(ue,this._parent.worldTransform.array),X.multiply(t.array,ue,r.array)):X.copy(t.array,r.array);var i=e?null:this.scale;t.decomposeMatrix(i,this.rotation,this.position)}),transformNeedsUpdate:function(){return this.position._dirty||this.rotation._dirty||this.scale._dirty},updateLocalTransform:function(){var e=this.position,t