{ "pandav:/index.js": { "cubeCode": "Cube('pandav:/com/common-utils/1.0.0',['pandav:/com/common-utils/1.0.0/utils','pandav:/com/common-utils/1.0.0/getColor','pandav:/com/common-utils/1.0.0/dispose','pandav:/com/common-utils/1.0.0/WebGLRenderContext'],function(a,b,c){var d=c('pandav:/com/common-utils/1.0.0/utils'),e=c('pandav:/com/common-utils/1.0.0/getColor'),f=e.getColor,g=c('pandav:/com/common-utils/1.0.0/dispose'),h=g.disposeMaterial,i=g.dispose,j=g.deepDispose,k=g.deepDisposeGroup,l=g.deepDisposeGroupGeometry,m=c('pandav:/com/common-utils/1.0.0/WebGLRenderContext'),n=m.WebGLRenderContext;return a.exports=Object.assign({},d,{getColor:f,disposeMaterial:h,dispose:i,deepDispose:j,deepDisposeGroup:k,deepDisposeGroupGeometry:l,WebGLRenderContext:n}),a.exports});", "requires": [ "pandav:/utils.js", "pandav:/getColor.js", "pandav:/dispose.js", "pandav:/WebGLRenderContext.js" ], "buildLevel": 1, "outputDir": "/com/common-utils/1.0.0", "outputPath": "/com/common-utils/1.0.0/index.js", "fileName": "/index.js" }, "pandav:/getColor.js": { "cubeCode": "Cube('pandav:/com/common-utils/1.0.0/getColor',['pandav:/npm/color-parse/1.4.2'],function(a,b,c){function d(a){for(var b=a.stops,d=a.angle,f=a.opacity,g=void 0===f?1:f,h='linear-gradient('+d+'deg, ',i=function(a){var b;return(b=a).reduce(function(a,c,d){var e=c.offset;return 1===a?a:b[d+1]?e>b[d+1].offset:a},!1)?a.sort(function(c,a){return c.offset-a.offset}):a}(b),j=0,k=i.length;ja.length)for(var d,e=1;3>=e;e++)d=a[e],b.push(parseInt(d+d,16));else for(var f=1;5>=f;f+=2)b.push(parseInt(a.slice(f,f+2),16));b.push(1)}else a.startsWith('R')||a.startsWith('r')?(b=a.slice(5,-1).split(',').map(function(a){return parseFloat(a)}),4>b.length&&(b[3]=1)):b=[0,0,0,1];return b}function g(a){var b=1b?n+b:b},useShaderProgram:function(a,b,c){var d=function(a,b,c){var d=i(a,a.VERTEX_SHADER,b),e=i(a,a.FRAGMENT_SHADER,c);if(!d||!e)return null;var f=a.createProgram();return f?(a.attachShader(f,d),a.attachShader(f,e),a.linkProgram(f),a.getProgramParameter(f,a.LINK_STATUS)?f:(console.log('link shader fail'),null)):(console.log('create program fail'),null)}(a,b,c);return d?(a.useProgram(d),d):null},decomposeRadioColor:function(a){if('string'!=typeof a)return[];var b=[];if(a.startsWith('#')){if(7>a.length)for(var d,e=1;3>=e;e++)d=a[e],b.push(parseInt(d+d,16));else for(var f=1;5>=f;f+=2)b.push(parseInt(a.slice(f,f+2),16));b.push(1)}else b=a.startsWith('R')||a.startsWith('r')?a.slice(5,-1).split(',').map(function(a,b){return 3==b?parseFloat(a):parseFloat(a)/255}):[0,0,0,1];return b}},a.exports});", "requires": [], "buildLevel": 2, "outputDir": "/com/common-utils/1.0.0", "outputPath": "/com/common-utils/1.0.0/utils.js", "fileName": "/utils.js" }, "pandav:/WebGLRenderContext.js": { "cubeCode": "Cube('pandav:/com/common-utils/1.0.0/WebGLRenderContext',['pandav:/com/common-utils/1.0.0/utils','pandav:/npm/lodash/4.6.1'],function(a,b,c){var d=Math.pow,j=Math.sqrt,k=Math.sin,l=Math.cos,n=Math.PI;function p(a){\"@babel/helpers - typeof\";return p='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&'function'==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?'symbol':typeof a},p(a)}function q(a,b,c){return b=w(b),r(a,u()?Reflect.construct(b,c||[],w(a).constructor):b.apply(a,c))}function r(a,b){if(b&&('object'===p(b)||'function'==typeof b))return b;if(void 0!==b)throw new TypeError('Derived constructors may only return object or undefined');return s(a)}function s(a){if(void 0===a)throw new ReferenceError('this hasn\\'t been initialised - super() hasn\\'t been called');return a}function u(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(u=function b(){return!!a})()}function w(a){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function b(a){return a.__proto__||Object.getPrototypeOf(a)},w(a)}function x(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function');a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,'prototype',{writable:!1}),b&&y(a,b)}function y(a,b){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function c(a,b){return a.__proto__=b,a},y(a,b)}function z(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function A(a,b){for(var c,d=0;dk(b[0]-d[0])&&1e-6>k(b[1]-d[1])&&1e-6>k(b[2]-d[2]))){x=b[0]-d[0],y=b[1]-d[1],z=b[2]-d[2],m=e[1]*(z*=A=1/j(x*x+y*y+z*z))-e[2]*(y*=A),n=e[2]*(x*=A)-e[0]*z,p=e[0]*y-e[1]*x,(A=j(m*m+n*n+p*p))?(m*=A=1/A,n*=A,p*=A):(m=0,n=0,p=0),q=y*p-z*n,t=z*m-x*p,v=x*n-y*m,(A=j(q*q+t*t+v*v))?(q*=A=1/A,t*=A,v*=A):(q=0,t=0,v=0);var B=[m,q,x,0,n,t,y,0,p,v,z,0,-(m*b[0]+n*b[1]+p*b[2]),-(q*b[0]+t*b[1]+v*b[2]),-(x*b[0]+y*b[1]+z*b[2]),1];this.multiply(B)}}},{key:'ortho',value:function h(a,b,d,e,f,g){var i=this.data,j=1/(a-b),k=1/(d-e),l=1/(f-g);i[0]=-2*j,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*k,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*l,i[11]=0,i[12]=(a+b)*j,i[13]=(e+d)*k,i[14]=(g+f)*l,i[15]=1}}]),b}(t),I=d(2,16)-1,J=I,K=function(){function a(b){z(this,a),this.vertices=new Float32Array(J),this.indices=new Uint16Array(I),this.vertexIndex=0,this.indexIndex=0,this.context=b}return B(a,[{key:'clear',value:function a(){this.vertexIndex=0,this.indexIndex=0}},{key:'getArrayBuffer',value:function a(){return{vertexArrayBuffer:this.vertices.subarray(0,this.vertexIndex),indexArrayBuffer:this.indices.subarray(0,this.indexIndex)}}},{key:'willFull',value:function c(a,b){return this.vertexIndex+a>J||this.indexIndex+b>I}},{key:'push',value:function c(a,b){this.willFull(a.length,b.length)&&this.context.draw();var d,e=this.vertexIndex;for(d=0;dM;M+=1)G=M*(2*n/80),L.push(.5*l(G),.5*k(G),0);var N,O=[];for(N=1;N= startIdx && t <= endIdx && endIdx > startIdx){\\n vec4 startColor = u_Color[i];\\n vec4 endColor = u_Color[i + 1];\\n color = (endColor - startColor) * ((t - startIdx) / (endIdx - startIdx)) + startColor;\\n break;\\n }\\n }\\n gl_FragColor = color;\\n}\\n',uniforms:[{name:'u_Color',type:'4fv'},{name:'u_Offset',type:'1fv'},{name:'u_Rotate',type:'1f'},{name:'u_Center',type:'2fv'}]}),S=[{name:'u_vpMatrix',type:'Matrix4fv'},{name:'u_modelMatrix',type:'Matrix4fv'}],T=B(function d(a,b,c){z(this,d);var e=this;this.locationCaches={},this.program=a,this.locationCaches.a_Position=c.getAttribLocation(a,'a_Position'),(b=b.concat(S)).forEach(function(b){return e.locationCaches[b.name]=c.getUniformLocation(a,b.name)})}),U=function(){function a(b){z(this,a);var c=this;this.curShader=null,this.shaderCaches={},this.shaderId=null,this.gl=b,this.shaderData={},Object.keys(R).forEach(function(a){var b=R[a],d=b.vert,e=b.frag,f=b.uniforms;c.registShader(+a,d,e,f)})}return B(a,[{key:'setAttPointer',value:function a(){var b=Float32Array.BYTES_PER_ELEMENT,c=this.getLocation('a_Position');this.gl.vertexAttribPointer(c,3,this.gl.FLOAT,!1,3*b,0),this.gl.enableVertexAttribArray(c)}},{key:'useProgram',value:function b(a){if(this.shaderId==a)return this.shaderData[a].type;var c=this.shaderCaches[a];if(!c){if(!(c=this.initShader(a)))return;this.shaderCaches[a]=c}return this.curShader=c,this.gl.useProgram(c.program),this.shaderId=a,this.setAttPointer(),this.shaderData[a].uniforms}},{key:'getLocation',value:function b(a){return this.curShader.locationCaches[a]}},{key:'registShader',value:function e(a,b,c,d){this.shaderData[a]={id:a,vert:b,frag:c,uniforms:d}}},{key:'initShader',value:function b(a){var c=this.shaderData[a];if(!c)return null;var d=h(this.gl,c.vert,c.frag);return new T(d,c.uniforms,this.gl)}}]),a}(),V=2*n,W=B(function d(a,b,c){z(this,d),this.shaderData=a,this.drawData=b,this.matrix=c}),X=function(){function a(b,c,d){var e=3