>1)>23?(o=o<<1|this.readBit())>199?o=(o-=128)<<1|this.readBit():(o-=48)>143&&(o+=136):o+=256,o<256)this.addBuffer(o);else{if(256===o)break;for(o-=257,p=this.readBits(i.cplext[o])+i.cplens[o],o=i.bitReverse[this.readBits(5)]>>3,i.cpdext[o]>8?(m=this.readBits(8),m|=this.readBits(i.cpdext[o]-8)<<8):m=this.readBits(i.cpdext[o]),m+=i.cpdist[o],o=0;ol)return this.flushBuffer(),1;for(f=n?_[n-1]:0;o--;)_[n++]=f}else{if(n+(o=17===o?3+this.readBits(3):11+this.readBits(7))>l)return this.flushBuffer(),1;for(;o--;)_[n++]=0}for(p=this.literalTree.length,n=0;n
=256){var p,m;if(0==(o-=256))break;for(o--,p=this.readBits(i.cplext[o])+i.cplens[o],o=this.DecodeValue(this.distanceTree),i.cpdext[o]>8?(m=this.readBits(8),m|=this.readBits(i.cpdext[o]-8)<<8):m=this.readBits(i.cpdext[o]),m+=i.cpdist[o];p--;)a=this.buf32k[this.bIdx-m&32767],this.addBuffer(a)}else this.addBuffer(o)}}while(!t);return this.flushBuffer(),this.byteAlign(),0},i.prototype.unzipFile=function(t){var e;for(this.gunzip(),e=0;e>>0;t=n}for(var r,s=1,a=0,o=t.length,l=0;0>>0}function o(e,i){this.index="number"==typeof i?i:0,this.i=0,this.buffer=e instanceof(s?Uint8Array:Array)?e:new(s?Uint8Array:Array)(32768),2*this.buffer.length<=this.index&&t(Error("invalid index")),this.buffer.length<=this.index&&this.f()}o.prototype.f=function(){var t,e=this.buffer,i=e.length,n=new(s?Uint8Array:Array)(i<<1);if(s)n.set(e);else for(t=0;t>>8&255]<<16|f[t>>>16&255]<<8|f[t>>>24&255])>>32-e:f[t]>>8-e),8>e+a)o=o<>e-n-1&1,8==++a&&(a=0,r[s++]=f[o],o=0,s===r.length&&(r=this.f()));r[s]=o,this.buffer=r,this.i=a,this.index=s},o.prototype.finish=function(){var t,e=this.buffer,i=this.index;return 0l;++l){for(var h=_=l,u=7,_=_>>>1;_;_>>>=1)h<<=1,h|=1&_,--u;c[l]=(h<>>0}var f=c;function d(t){this.buffer=new(s?Uint16Array:Array)(2*t),this.length=0}function p(t){var e,i,n,r,a,o,l,c,h,u=t.length,_=0,f=Number.POSITIVE_INFINITY;for(c=0;c_&&(_=t[c]),t[c]>=1;for(h=o;hs[n]);)r=s[i],s[i]=s[n],s[n]=r,r=s[i+1],s[i+1]=s[n+1],s[n+1]=r,i=n;return this.length},d.prototype.pop=function(){var t,e,i,n,r,s=this.buffer;for(e=s[0],t=s[1],this.length-=2,s[0]=s[this.length],s[1]=s[this.length+1],r=0;!((n=2*r+2)>=this.length)&&(n+2s[n]&&(n+=2),s[n]>s[r]);)i=s[r],s[r]=s[n],s[n]=i,i=s[r+1],s[r+1]=s[n+1],s[n+1]=i,r=n;return{index:t,value:e,length:this.length}};var y,v=2,g={NONE:0,r:1,j:v,N:3},b=[];for(y=0;288>y;y++)switch(i){case 143>=y:b.push([y+48,8]);break;case 255>=y:b.push([y-144+400,9]);break;case 279>=y:b.push([y-256+0,7]);break;case 287>=y:b.push([y-280+192,8]);break;default:t("invalid literal: "+y)}function A(t,e){this.length=t,this.G=e}function x(){var e=C;switch(i){case 3===e:return[257,e-3,0];case 4===e:return[258,e-4,0];case 5===e:return[259,e-5,0];case 6===e:return[260,e-6,0];case 7===e:return[261,e-7,0];case 8===e:return[262,e-8,0];case 9===e:return[263,e-9,0];case 10===e:return[264,e-10,0];case 12>=e:return[265,e-11,1];case 14>=e:return[266,e-13,1];case 16>=e:return[267,e-15,1];case 18>=e:return[268,e-17,1];case 22>=e:return[269,e-19,2];case 26>=e:return[270,e-23,2];case 30>=e:return[271,e-27,2];case 34>=e:return[272,e-31,2];case 42>=e:return[273,e-35,3];case 50>=e:return[274,e-43,3];case 58>=e:return[275,e-51,3];case 66>=e:return[276,e-59,3];case 82>=e:return[277,e-67,4];case 98>=e:return[278,e-83,4];case 114>=e:return[279,e-99,4];case 130>=e:return[280,e-115,4];case 162>=e:return[281,e-131,5];case 194>=e:return[282,e-163,5];case 226>=e:return[283,e-195,5];case 257>=e:return[284,e-227,5];case 258===e:return[285,e-258,0];default:t("invalid length: "+e)}}m.prototype.n=function(){var n,r,a,l,c=this.input;switch(this.h){case 0:for(a=0,l=c.length;a>>8&255,y[g++]=255&_,y[g++]=_>>>8&255,s)y.set(f,g),g+=f.length,y=y.subarray(0,g);else{for(p=0,m=f.length;pJ)for(;0J?J:138)>J-3&&Q=Q?(it[K++]=17,it[K++]=Q-3,nt[17]++):(it[K++]=18,it[K++]=Q-11,nt[18]++),J-=Q;else if(it[K++]=et[Y],nt[et[Y]]++,3>--J)for(;0J?J:6)>J-3&&QU;U++)X[U]=N[W[U]];for(R=19;4=C;C++)T=x(),S[C]=T[2]<<24|T[1]<<16|T[0];var w=s?new Uint32Array(S):S;function E(n,r){function a(e,n){var r,s,a,o,l=e.G,c=[],h=0;switch(r=w[e.length],c[h++]=65535&r,c[h++]=r>>16&255,c[h++]=r>>24,i){case 1===l:s=[0,l-1,0];break;case 2===l:s=[1,l-2,0];break;case 3===l:s=[2,l-3,0];break;case 4===l:s=[3,l-4,0];break;case 6>=l:s=[4,l-5,1];break;case 8>=l:s=[5,l-7,1];break;case 12>=l:s=[6,l-9,2];break;case 16>=l:s=[7,l-13,2];break;case 24>=l:s=[8,l-17,3];break;case 32>=l:s=[9,l-25,3];break;case 48>=l:s=[10,l-33,4];break;case 64>=l:s=[11,l-49,4];break;case 96>=l:s=[12,l-65,5];break;case 128>=l:s=[13,l-97,5];break;case 192>=l:s=[14,l-129,6];break;case 256>=l:s=[15,l-193,6];break;case 384>=l:s=[16,l-257,7];break;case 512>=l:s=[17,l-385,7];break;case 768>=l:s=[18,l-513,8];break;case 1024>=l:s=[19,l-769,8];break;case 1536>=l:s=[20,l-1025,9];break;case 2048>=l:s=[21,l-1537,9];break;case 3072>=l:s=[22,l-2049,10];break;case 4096>=l:s=[23,l-3073,10];break;case 6144>=l:s=[24,l-4097,11];break;case 8192>=l:s=[25,l-6145,11];break;case 12288>=l:s=[26,l-8193,12];break;case 16384>=l:s=[27,l-12289,12];break;case 24576>=l:s=[28,l-16385,13];break;case 32768>=l:s=[29,l-24577,13];break;default:t("invalid distance")}for(r=s,c[h++]=r[0],c[h++]=r[1],c[h++]=r[2],a=0,o=c.length;a=c;)b[c++]=0;for(c=0;29>=c;)x[c++]=0}for(b[256]=1,o=0,l=r.length;o=l){for(d&&a(d,-1),c=0,h=l-o;cM&&o+ME&&(S=T,E=M),258===M)break}f=new A(E,o-S),d?d.length2*g[f-1]+b[f]&&(g[f]=2*g[f-1]+b[f]),x[f]=Array(g[f]),C[f]=Array(g[f]);for(_=0;_r[_]?(x[f][p]=m,C[f][p]=v,y+=2):(x[f][p]=r[_],C[f][p]=_,++_);T[f]=0,1===b[f]&&i(f)}for(a=A,o=0,l=n.length;o1<h&&t("undercommitted"),i=0,n=e.length;i>>=1;return o}function B(t,e){this.input=t,this.a=new(s?Uint8Array:Array)(32768),this.h=P.j;var i,n={};for(i in!e&&(e={})||"number"!=typeof e.compressionType||(this.h=e.compressionType),e)n[i]=e[i];n.outputBuffer=this.a,this.z=new m(this.input,n)}var P=g;function I(e,i){switch(this.k=[],this.l=32768,this.e=this.g=this.c=this.q=0,this.input=s?new Uint8Array(e):e,this.s=!1,this.m=O,this.B=!1,!i&&(i={})||(i.index&&(this.c=i.index),i.bufferSize&&(this.l=i.bufferSize),i.bufferType&&(this.m=i.bufferType),i.resize&&(this.B=i.resize)),this.m){case R:this.b=32768,this.a=new(s?Uint8Array:Array)(32768+this.l+258);break;case O:this.b=0,this.a=new(s?Uint8Array:Array)(this.l),this.f=this.J,this.t=this.H,this.o=this.I;break;default:t(Error("invalid inflate mode"))}}B.prototype.n=function(){var e,i,n,r,o,l,c,h=0;switch(c=this.a,e=ht){case ht:i=Math.LOG2E*Math.log(32768)-8;break;default:t(Error("invalid compression method"))}switch(n=i<<4|e,c[h++]=n,e){case ht:switch(this.h){case P.NONE:o=0;break;case P.r:o=1;break;case P.j:o=2;break;default:t(Error("unsupported compression type"))}break;default:t(Error("invalid compression method"))}return r=o<<6|0,c[h++]=r|31-(256*n+r)%31,l=a(this.input),this.z.b=h,h=(c=this.z.n()).length,s&&((c=new Uint8Array(c.buffer)).length<=h+4&&(this.a=new Uint8Array(c.length+4),this.a.set(c),c=this.a),c=c.subarray(0,h+4)),c[h++]=l>>24&255,c[h++]=l>>16&255,c[h++]=l>>8&255,c[h++]=255&l,c},r("Zlib.Deflate",B),r("Zlib.Deflate.compress",(function(t,e){return new B(t,e).n()})),r("Zlib.Deflate.CompressionType",P),r("Zlib.Deflate.CompressionType.NONE",P.NONE),r("Zlib.Deflate.CompressionType.FIXED",P.r),r("Zlib.Deflate.CompressionType.DYNAMIC",P.j);var R=0,O=1,L={D:R,C:O};I.prototype.p=function(){for(;!this.s;){var n=tt(this,3);switch(1&n&&(this.s=i),n>>>=1){case 0:var r=this.input,a=this.c,o=this.a,l=this.b,c=e,h=e,u=e,_=o.length,f=e;switch(this.e=this.g=0,(c=r[a++])===e&&t(Error("invalid uncompressed block header: LEN (first byte)")),h=c,(c=r[a++])===e&&t(Error("invalid uncompressed block header: LEN (second byte)")),h|=c<<8,(c=r[a++])===e&&t(Error("invalid uncompressed block header: NLEN (first byte)")),u=c,(c=r[a++])===e&&t(Error("invalid uncompressed block header: NLEN (second byte)")),h===~(u|=c<<8)&&t(Error("invalid uncompressed block header: length verify")),a+h>r.length&&t(Error("input buffer is broken")),this.m){case R:for(;l+h>o.length;){if(h-=f=_-l,s)o.set(r.subarray(a,a+f),l),l+=f,a+=f;else for(;f--;)o[l++]=r[a++];this.b=l,o=this.f(),l=this.b}break;case O:for(;l+h>o.length;)o=this.f({v:2});break;default:t(Error("invalid inflate mode"))}if(s)o.set(r.subarray(a,a+h),l),l+=h,a+=h;else for(;h--;)o[l++]=r[a++];this.c=a,this.b=l,this.a=o;break;case 1:this.o(K,$);break;case 2:it(this);break;default:t(Error("unknown BTYPE: "+n))}}return this.t()};var F,V,N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=s?new Uint16Array(N):N,z=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],G=s?new Uint16Array(z):z,U=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],j=s?new Uint8Array(U):U,H=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],W=s?new Uint16Array(H):H,X=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Y=s?new Uint8Array(X):X,q=new(s?Uint8Array:Array)(288);for(F=0,V=q.length;F=F?8:255>=F?9:279>=F?7:8;var J,Z,K=p(q),Q=new(s?Uint8Array:Array)(30);for(J=0,Z=Q.length;J>>n,i.e=a-n,i.c=l,r}function et(i,n){for(var r,s,a,o=i.g,l=i.e,c=i.input,h=i.c,u=n[0],_=n[1];l<_;)(r=c[h++])===e&&t(Error("input buffer is broken")),o|=r<>>16,i.g=o>>a,i.e=l-a,i.c=h,65535&s}function it(t){function e(t,e,i){var n,r,s,a;for(a=0;ar)n>=l&&(this.b=n,i=this.f(),n=this.b),i[n++]=r;else for(o=G[s=r-257],0=l&&(this.b=n,i=this.f(),n=this.b);o--;)i[n]=i[n++-a];for(;8<=this.e;)this.e-=8,this.c--;this.b=n},I.prototype.I=function(t,e){var i=this.a,n=this.b;this.u=t;for(var r,s,a,o,l=i.length;256!==(r=et(this,t));)if(256>r)n>=l&&(l=(i=this.f()).length),i[n++]=r;else for(o=G[s=r-257],0l&&(l=(i=this.f()).length);o--;)i[n]=i[n++-a];for(;8<=this.e;)this.e-=8,this.c--;this.b=n},I.prototype.f=function(){var t,e,i=new(s?Uint8Array:Array)(this.b-32768),n=this.b-32768,r=this.a;if(s)i.set(r.subarray(32768,i.length));else for(t=0,e=i.length;tt;++t)r[t]=r[n+t];return this.b=32768,r},I.prototype.J=function(t){var e,i,n,r=this.input.length/this.c+1|0,a=this.input,o=this.a;return t&&("number"==typeof t.v&&(r=t.v),"number"==typeof t.F&&(r+=t.F)),i=2>r?(n=(a.length-this.c)/this.u[2]/2*258|0)e&&(this.a.length=e),t=this.a),this.buffer=t},nt.prototype.p=function(){var e,i=this.input;return e=this.A.p(),this.c=this.A.c,this.M&&(i[this.c++]<<24|i[this.c++]<<16|i[this.c++]<<8|i[this.c++])>>>0!==a(e)&&t(Error("invalid adler-32 checksum")),e},r("Zlib.Inflate",nt),r("Zlib.Inflate.BufferType",L),L.ADAPTIVE=L.C,L.BLOCK=L.D,r("Zlib.Inflate.prototype.decompress",nt.prototype.p),s&&new Uint16Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s&&new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258]),s&&new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0]),s&&new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577]),s&&new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);var rt,st,at=new(s?Uint8Array:Array)(288);for(rt=0,st=at.length;rt=rt?8:255>=rt?9:279>=rt?7:8;p(at);var ot,lt,ct=new(s?Uint8Array:Array)(30);for(ot=0,lt=ct.length;ot1&&this.colorKeys.sort((function(t,e){return t.time-e.time})),this.alphaKeys.length>1&&this.alphaKeys.sort((function(t,e){return t.time-e.time}))},e.evaluate=function(t){return this.getRGB(t),this._color._fastSetA(this.getAlpha(t)),this._color},e.randomColor=function(){var t=this.colorKeys[Math.trunc(Math.random()*this.colorKeys.length)],e=this.alphaKeys[Math.trunc(Math.random()*this.alphaKeys.length)];return this._color.set(t.color),this._color._fastSetA(e.alpha),this._color},e.getRGB=function(t){if(!(this.colorKeys.length>1))return 1===this.colorKeys.length?(this._color.set(this.colorKeys[0].color),this._color):(this._color.set(cc.Color.WHITE),this._color);t=(0,S.repeat)(t,1);for(var e=1;e=i&&tthis.colorKeys[s].time&&this.colorKeys[s].color.lerp(cc.Color.BLACK,(t-this.colorKeys[s].time)/(1-this.colorKeys[s].time),this._color)},e.getAlpha=function(t){if(!(this.alphaKeys.length>1))return 1===this.alphaKeys.length?this.alphaKeys[0].alpha:255;t=(0,S.repeat)(t,1);for(var e=1;e=i&&tthis.alphaKeys[s].time?(0,S.lerp)(this.alphaKeys[s].alpha,255,(t-this.alphaKeys[s].time)/(1-this.alphaKeys[s].time)):void 0},t})(),A.Mode=M,v=E((y=x).prototype,"colorKeys",[f],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Array}}),g=E(y.prototype,"alphaKeys",[d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Array}}),b=E(y.prototype,"mode",[p],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return M.Blend}}),m=y))||m);i.Gradient=P,cc.ColorKey=D,cc.AlphaKey=B,cc.Gradient=P}),{"../../../platform/CCClassDecorator":240,"../../../platform/CCEnum":241,"../../../value-types":339}],35:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r,s,a,o,l,c,h,u,_,f,d,p,m,y,v,g,b=t("../../../platform/CCClassDecorator"),A=t("../../../value-types"),x=t("../enum"),C=(n=t("./curve-range"))&&n.__esModule?n:{default:n};function T(t,e,i,n){i&&Object.defineProperty(t,e,{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.initializer?i.initializer.call(n):void 0})}function S(t,e,i,n,r){var s={};return Object.keys(n).forEach((function(t){s[t]=n[t]})),s.enumerable=!!s.enumerable,s.configurable=!!s.configurable,("value"in s||s.initializer)&&(s.writable=!0),s=i.slice().reverse().reduce((function(i,n){return n(t,e,i)||i}),s),r&&void 0!==s.initializer&&(s.value=s.initializer?s.initializer.call(r):void 0,s.initializer=void 0),void 0===s.initializer&&(Object.defineProperty(t,e,s),s=null),s}var w=cc.v3(),E=cc.v3();function M(t,e,i){var n=Math.sign(t),r=Math.abs(t);return r>e&&(r=(0,A.lerp)(r,e,i)),r*n}var D=(r=(0,b.ccclass)("cc.LimitVelocityOvertimeModule"),s=(0,b.property)({type:x.Space}),a=(0,b.property)({type:C.default,range:[-1,1],visible:function(){return!this.separateAxes}}),o=(0,b.property)({type:C.default,range:[-1,1],visible:function(){return this.separateAxes}}),l=(0,b.property)({type:C.default,range:[-1,1],visible:function(){return this.separateAxes}}),c=(0,b.property)({type:C.default,range:[-1,1],visible:function(){return this.separateAxes}}),r((_=S((u=(function(){function t(){T(this,"enable",_,this),T(this,"space",f,this),T(this,"separateAxes",d,this),T(this,"limit",p,this),T(this,"limitX",m,this),T(this,"limitY",y,this),T(this,"limitZ",v,this),T(this,"dampen",g,this),this.drag=null,this.multiplyDragByParticleSize=!1,this.multiplyDragByParticleVelocity=!1,this.rotation=null,this.needTransform=!1,this.rotation=new A.Quat,this.needTransform=!1}var e=t.prototype;return e.update=function(t,e){this.needTransform=calculateTransform(t,this.space,e,this.rotation)},e.animate=function(t){var e=1-t.remainingLifetime/t.startLifetime,i=w;this.separateAxes?(A.Vec3.set(E,this.limitX.evaluate(e,(0,A.pseudoRandom)(t.randomSeed+23541)),this.limitY.evaluate(e,(0,A.pseudoRandom)(t.randomSeed+23541)),this.limitZ.evaluate(e,(0,A.pseudoRandom)(t.randomSeed+23541))),this.needTransform&&A.Vec3.transformQuat(E,E,this.rotation),A.Vec3.set(i,M(t.ultimateVelocity.x,E.x,this.dampen),M(t.ultimateVelocity.y,E.y,this.dampen),M(t.ultimateVelocity.z,E.z,this.dampen))):(A.Vec3.normalize(i,t.ultimateVelocity),A.Vec3.scale(i,i,M(t.ultimateVelocity.len(),this.limit.evaluate(e,(0,A.pseudoRandom)(t.randomSeed+23541)),this.dampen))),A.Vec3.copy(t.ultimateVelocity,i)},t})()).prototype,"enable",[b.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),f=S(u.prototype,"space",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return x.Space.Local}}),d=S(u.prototype,"separateAxes",[b.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),p=S(u.prototype,"limit",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new C.default}}),m=S(u.prototype,"limitX",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new C.default}}),y=S(u.prototype,"limitY",[l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new C.default}}),v=S(u.prototype,"limitZ",[c],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new C.default}}),g=S(u.prototype,"dampen",[b.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 3}}),h=u))||h);i.default=D,e.exports=i.default}),{"../../../platform/CCClassDecorator":240,"../../../value-types":339,"../enum":43,"./curve-range":31}],36:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r,s,a,o,l,c,h,u,_,f,d,p=t("../../../platform/CCClassDecorator"),m=t("../../../value-types"),y=(n=t("./curve-range"))&&n.__esModule?n:{default:n};function v(t,e,i,n){i&&Object.defineProperty(t,e,{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.initializer?i.initializer.call(n):void 0})}function g(t,e){for(var i=0;i0){var i=(0,p.repeat)(t._time-t.startDelay.evaluate(0,1),t.duration)-e;i=i>0?i:0;var n=(0,p.repeat)(t.time-t.startDelay.evaluate(0,1),t.duration);this._curTime>=i&&this._curTimethis.keyFrames[0].time)if(e>=this.keyFrames[this.keyFrames.length-1].time)s=this.keyFrames.length-2;else for(var a=0;a=this.keyFrames[0].time&&e<=this.keyFrames[a+1].time){s=a;break}var o=this.keyFrames[s],l=this.keyFrames[s+1],c=(0,b.inverseLerp)(o.time,l.time,e),h=l.time-o.time,u=o.outTangent*h,_=l.inTangent*h,f=c*c,d=f*c,p=d-2*f+c,m=d-f,y=-2*d+3*f;return(2*d-3*f+1)*o.value+p*u+m*_+y*l.value},e.evaluate=function(t){var e=t,i=t<0?this.preWrapMode:this.postWrapMode,n=this.keyFrames[0].time,r=this.keyFrames[this.keyFrames.length-1].time;switch(i){case T.Loop:e=(0,b.repeat)(t-n,r-n)+n;break;case T.PingPong:e=(0,b.pingPong)(t-n,r-n)+n;break;case T.ClampForever:e=(0,b.clamp)(t,n,r)}if(e>=this.cachedKey.time&ðis.keyFrames[i].time)for(var n=0;n<3;n++){var r=i+n;if(r+1e)return r}else for(var s=0;s<3;s++){var a=i-s;if(a-1>=0&&this.keyFrames[a-1].time<=e)return a-1}for(var o,l=0,c=this.keyFrames.length;c-l>1;)o=Math.floor((l+c)/2),this.keyFrames[o].time>=e?c=o:l=o;return l},t})()).prototype,"keyFrames",[u],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Array}}),y=C(p.prototype,"preWrapMode",[_],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return T.ClampForever}}),v=C(p.prototype,"postWrapMode",[f],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return T.ClampForever}}),d=p))||d);i.AnimationCurve=B,cc.Keyframe=S,cc.AnimationCurve=B}),{"../../platform/CCClassDecorator":240,"../../platform/CCEnum":241,"../../value-types":339}],42:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n,r,s,a,o,l,c,h,u,_,f,d,p,m,y,v,g,b,A,x,C,T,S,w,E,M,D,B=t("../../../platform/CCClassDecorator"),P=t("../../../value-types"),I=(n=t("../animator/curve-range"))&&n.__esModule?n:{default:n},R=t("../particle-general-function"),O=t("../enum");function L(t,e,i,n){i&&Object.defineProperty(t,e,{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.initializer?i.initializer.call(n):void 0})}function F(t,e){for(var i=0;i0&&(t.position.x+=(0,P.randomRange)(-this.randomPositionAmount,this.randomPositionAmount),t.position.y+=(0,P.randomRange)(-this.randomPositionAmount,this.randomPositionAmount),t.position.z+=(0,P.randomRange)(-this.randomPositionAmount,this.randomPositionAmount)),P.Vec3.transformQuat(t.velocity,t.velocity,this.quat),P.Vec3.transformMat4(t.position,t.position,this.mat),this.sphericalDirectionAmount>0){var a=P.Vec3.normalize(N,t.position);P.Vec3.lerp(t.velocity,t.velocity,a,this.sphericalDirectionAmount)}this.lastTime=this.particleSystem._time},n.generateArcAngle=function(){if(this.arcMode===O.ArcMode.Random)return(0,P.randomRange)(0,this._arc);var t=this.totalAngle+2*Math.PI*this.arcSpeed.evaluate(this.particleSystem._time,1)*(this.particleSystem._time-this.lastTime);switch(this.totalAngle=t,0!==this.arcSpread&&(t=Math.floor(t/(this._arc*this.arcSpread))*this._arc*this.arcSpread),this.arcMode){case O.ArcMode.Loop:return(0,P.repeat)(t,this._arc);case O.ArcMode.PingPong:return(0,P.pingPong)(t,this._arc)}},e=t,(i=[{key:"shapeType",get:function(){return this._shapeType},set:function(t){switch(this._shapeType=t,this._shapeType){case O.ShapeType.Box:this.emitFrom===O.EmitLocation.Base&&(this.emitFrom=O.EmitLocation.Volume);break;case O.ShapeType.Cone:this.emitFrom===O.EmitLocation.Edge&&(this.emitFrom=O.EmitLocation.Base);break;case O.ShapeType.Sphere:case O.ShapeType.Hemisphere:this.emitFrom!==O.EmitLocation.Base&&this.emitFrom!==O.EmitLocation.Edge||(this.emitFrom=O.EmitLocation.Volume)}}},{key:"angle",get:function(){return Math.round(100*(0,P.toDegree)(this._angle))/100},set:function(t){this._angle=(0,P.toRadian)(t)}},{key:"arc",get:function(){return(0,P.toDegree)(this._arc)},set:function(t){this._arc=(0,P.toRadian)(t)}},{key:"position",get:function(){return this._position},set:function(t){this._position=t,this.constructMat()}},{key:"rotation",get:function(){return this._rotation},set:function(t){this._rotation=t,this.constructMat()}},{key:"scale",get:function(){return this._scale},set:function(t){this._scale=t,this.constructMat()}}])&&F(e.prototype,i),t})()).prototype,"enable",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),_=V(h.prototype,"_shapeType",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return O.ShapeType.Cone}}),V(h.prototype,"shapeType",[s],Object.getOwnPropertyDescriptor(h.prototype,"shapeType"),h.prototype),f=V(h.prototype,"emitFrom",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return O.EmitLocation.Volume}}),d=V(h.prototype,"radius",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),p=V(h.prototype,"radiusThickness",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),m=V(h.prototype,"_angle",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return(0,P.toRadian)(25)}}),V(h.prototype,"angle",[B.property],Object.getOwnPropertyDescriptor(h.prototype,"angle"),h.prototype),y=V(h.prototype,"_arc",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return(0,P.toRadian)(360)}}),V(h.prototype,"arc",[B.property],Object.getOwnPropertyDescriptor(h.prototype,"arc"),h.prototype),v=V(h.prototype,"arcMode",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return O.ArcMode.Random}}),g=V(h.prototype,"arcSpread",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),b=V(h.prototype,"arcSpeed",[l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new I.default}}),A=V(h.prototype,"length",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 5}}),x=V(h.prototype,"boxThickness",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new P.Vec3(0,0,0)}}),C=V(h.prototype,"_position",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new P.Vec3(0,0,0)}}),V(h.prototype,"position",[B.property],Object.getOwnPropertyDescriptor(h.prototype,"position"),h.prototype),T=V(h.prototype,"_rotation",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new P.Vec3(0,0,0)}}),V(h.prototype,"rotation",[B.property],Object.getOwnPropertyDescriptor(h.prototype,"rotation"),h.prototype),S=V(h.prototype,"_scale",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new P.Vec3(1,1,1)}}),V(h.prototype,"scale",[B.property],Object.getOwnPropertyDescriptor(h.prototype,"scale"),h.prototype),w=V(h.prototype,"alignToDirection",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),E=V(h.prototype,"randomDirectionAmount",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),M=V(h.prototype,"sphericalDirectionAmount",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),D=V(h.prototype,"randomPositionAmount",[B.property],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),c=h))||c);function U(t,e,i,n,r){switch(t){case O.EmitLocation.Volume:(0,R.randomPointBetweenSphere)(n,e*(1-i),e),P.Vec3.copy(r,n),P.Vec3.normalize(r,r);break;case O.EmitLocation.Shell:(0,R.randomUnitVector)(n),P.Vec3.scale(n,n,e),P.Vec3.copy(r,n);break;default:console.warn(t+" is not supported for sphere emitter.")}}function j(t,e,i,n,r){switch(t){case O.EmitLocation.Volume:(0,R.randomPointBetweenSphere)(n,e*(1-i),e),n.z>0&&(n.z*=-1),P.Vec3.copy(r,n),P.Vec3.normalize(r,r);break;case O.EmitLocation.Shell:(0,R.randomUnitVector)(n),P.Vec3.scale(n,n,e),n.z<0&&(n.z*=-1),P.Vec3.copy(r,n);break;default:console.warn(t+" is not supported for hemisphere emitter.")}}function H(t,e,i,n,r,s,a,o){switch(t){case O.EmitLocation.Base:(0,R.randomPointBetweenCircleAtFixedAngle)(a,e*(1-i),e,n),P.Vec2.scale(o,a,Math.sin(r)),o.z=-Math.cos(r)*e,P.Vec3.normalize(o,o),a.z=0;break;case O.EmitLocation.Shell:(0,R.fixedAngleUnitVector2)(a,n),P.Vec2.scale(o,a,Math.sin(r)),o.z=-Math.cos(r),P.Vec3.normalize(o,o),P.Vec2.scale(a,a,e),a.z=0;break;case O.EmitLocation.Volume:(0,R.randomPointBetweenCircleAtFixedAngle)(a,e*(1-i),e,n),P.Vec2.scale(o,a,Math.sin(r)),o.z=-Math.cos(r)*e,P.Vec3.normalize(o,o),a.z=0,P.Vec3.add(a,a,P.Vec3.scale(N,o,s*(0,P.random)()/-o.z));break;default:console.warn(t+" is not supported for cone emitter.")}}function W(t,e,i,n){switch(t){case O.EmitLocation.Volume:(0,R.randomPointInCube)(i,z);break;case O.EmitLocation.Shell:k.splice(0,k.length),k.push((0,P.randomRange)(-.5,.5)),k.push((0,P.randomRange)(-.5,.5)),k.push(.5*(0,R.randomSign)()),(0,R.randomSortArray)(k),X(k,e),P.Vec3.set(i,k[0],k[1],k[2]);break;case O.EmitLocation.Edge:k.splice(0,k.length),k.push((0,P.randomRange)(-.5,.5)),k.push(.5*(0,R.randomSign)()),k.push(.5*(0,R.randomSign)()),(0,R.randomSortArray)(k),X(k,e),P.Vec3.set(i,k[0],k[1],k[2]);break;default:console.warn(t+" is not supported for box emitter.")}P.Vec3.copy(n,R.particleEmitZAxis)}function X(t,e){e.x>0&&(t[0]+=.5*(0,P.randomRange)(-e.x,e.x),t[0]=(0,P.clamp)(t[0],-.5,.5)),e.y>0&&(t[1]+=.5*(0,P.randomRange)(-e.y,e.y),t[1]=(0,P.clamp)(t[1],-.5,.5)),e.z>0&&(t[2]+=.5*(0,P.randomRange)(-e.z,e.z),t[2]=(0,P.clamp)(t[2],-.5,.5))}i.default=G,e.exports=i.default}),{"../../../platform/CCClassDecorator":240,"../../../value-types":339,"../animator/curve-range":31,"../enum":43,"../particle-general-function":44}],43:[(function(t,e,i){"use strict";i.__esModule=!0,i.TrailMode=i.TextureMode=i.Space=i.ShapeType=i.RenderMode=i.EmitLocation=i.ArcMode=void 0;var n,r=(n=t("../../platform/CCEnum"))&&n.__esModule?n:{default:n},s=(0,r.default)({World:0,Local:1,Custom:2});i.Space=s;var a=(0,r.default)({Billboard:0,StrecthedBillboard:1,HorizontalBillboard:2,VerticalBillboard:3,Mesh:4});i.RenderMode=a;var o=(0,r.default)({Box:0,Circle:1,Cone:2,Sphere:3,Hemisphere:4});i.ShapeType=o;var l=(0,r.default)({Base:0,Edge:1,Shell:2,Volume:3});i.EmitLocation=l;var c=(0,r.default)({Random:0,Loop:1,PingPong:2});i.ArcMode=c;var h=(0,r.default)({Particles:0,Ribbon:1});i.TrailMode=h;var u=(0,r.default)({Stretch:0,Repeat:1});i.TextureMode=u}),{"../../platform/CCEnum":241}],44:[(function(t,e,i){"use strict";i.__esModule=!0,i.calculateTransform=function(t,e,i,r){return e!==t?(t===s.Space.World?n.Mat4.getRotation(r,i):(n.Mat4.invert(i,i),n.Mat4.getRotation(r,i)),!0):(n.Quat.set(r,0,0,0,1),!1)},i.fixedAngleUnitVector2=o,i.particleEmitZAxis=void 0,i.randomPointBetweenCircle=function(t,e,i){l(t),t.z=0,n.Vec3.scale(t,t,e+(i-e)*(0,n.random)())},i.randomPointBetweenCircleAtFixedAngle=function(t,e,i,r){o(t,r),t.z=0,n.Vec3.scale(t,t,e+(i-e)*(0,n.random)())},i.randomPointBetweenCube=function(t,e,i){for(var r=["x","y","z"],s=(0,n.randomRangeInt)(0,3),a=0;a<3;a++)if(a!==s){var o=2*(0,n.random)()-1;t[r[a]]=o<0?-e[r[a]]+o*(i[r[a]]-e[r[a]]):e[r[a]]+o*(i[r[a]]-e[r[a]])}else t[r[a]]=(0,n.randomRange)(-i[r[a]],i[r[a]])},i.randomPointBetweenSphere=function(t,e,i){c(t),n.Vec3.scale(t,t,e+(i-e)*(0,n.random)())},i.randomPointInCube=function(t,e){n.Vec3.set(t,(0,n.randomRange)(-e.x,e.x),(0,n.randomRange)(-e.y,e.y),(0,n.randomRange)(-e.z,e.z))},i.randomPointInUnitCircle=function(t){l(t),t.z=0,n.Vec3.scale(t,t,(0,n.random)())},i.randomPointInUnitSphere=function(t){c(t),n.Vec3.scale(t,t,(0,n.random)())},i.randomSign=function(){var t=(0,n.randomRange)(-1,1);return 0===t&&t++,(0,r.sign)(t)},i.randomSortArray=function(t){for(var e=0;e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ft(t,e){if(t){if("string"==typeof t)return Vt(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Vt(t,e):void 0}}function Vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);ie){if(this._time>this.duration+e&&!this.loop)return void(this._isEmitting=!1);if(this._emitRateTimeCounter+=this.rateOverTime.evaluate(this._time/this.duration,1)*t,this._emitRateTimeCounter>1&&this._isEmitting){var i=Math.floor(this._emitRateTimeCounter);this._emitRateTimeCounter-=i,this.emit(i,t)}this.node.getWorldPosition(this._curWPos);var n=pt.Vec3.distance(this._curWPos,this._oldWPos);if(pt.Vec3.copy(this._oldWPos,this._curWPos),this._emitRateDistanceCounter+=n*this.rateOverDistance.evaluate(this._time/this.duration,1),this._emitRateDistanceCounter>1&&this._isEmitting){var r=Math.floor(this._emitRateDistanceCounter);this._emitRateDistanceCounter-=r,this.emit(r,t)}for(var s,a=Lt(this.bursts);!(s=a()).done;)s.value.update(this,t)}},a._activateMaterial=function(){},a._resetPosition=function(){this.node.getWorldPosition(this._oldWPos),pt.Vec3.copy(this._curWPos,this._oldWPos)},a.addSubEmitter=function(t){this._subEmitters.push(t)},a.removeSubEmitter=function(t){this._subEmitters.splice(this._subEmitters.indexOf(t),1)},a.addBurst=function(t){this.bursts.push(t)},a.removeBurst=function(t){this.bursts.splice(this.bursts.indexOf(t),1)},a._checkBacth=function(){},r=n,(s=[{key:"capacity",get:function(){return this._capacity},set:function(t){this._capacity=t,this._assembler&&this._assembler.setCapacity(this._capacity)}},{key:"prewarm",get:function(){return this._prewarm},set:function(t){!0===t&&this.loop,this._prewarm=t}},{key:"simulationSpace",get:function(){return this._simulationSpace},set:function(t){t!==this._simulationSpace&&(this._simulationSpace=t,this._assembler._updateMaterialParams(),this._assembler._updateTrailMaterial())}},{key:"materials",get:function(){return this._materials},set:function(t){this._materials=t,this._activateMaterial()}},{key:"shapeModule",get:function(){return this._shapeModule},set:function(t){this._shapeModule=t,this._shapeModule.onInit(this)}},{key:"colorOverLifetimeModule",get:function(){return this._colorOverLifetimeModule},set:function(t){this._colorOverLifetimeModule=t}},{key:"sizeOvertimeModule",get:function(){return this._sizeOvertimeModule},set:function(t){this._sizeOvertimeModule=t}},{key:"velocityOvertimeModule",get:function(){return this._velocityOvertimeModule},set:function(t){this._velocityOvertimeModule=t}},{key:"forceOvertimeModule",get:function(){return this._forceOvertimeModule},set:function(t){this._forceOvertimeModule=t}},{key:"limitVelocityOvertimeModule",get:function(){return this._limitVelocityOvertimeModule},set:function(t){this._limitVelocityOvertimeModule=t}},{key:"rotationOvertimeModule",get:function(){return this._rotationOvertimeModule},set:function(t){this._rotationOvertimeModule=t}},{key:"textureAnimationModule",get:function(){return this._textureAnimationModule},set:function(t){this._textureAnimationModule=t,this._textureAnimationModule.onInit(this)}},{key:"trailModule",get:function(){return this._trailModule},set:function(t){this._trailModule=t,this._trailModule.onInit(this)}},{key:"renderMode",get:function(){return this._renderMode},set:function(t){this._renderMode!==t&&(this._renderMode=t,this._assembler._setVertexAttrib(),this._assembler._updateModel(),this._assembler._updateMaterialParams())}},{key:"velocityScale",get:function(){return this._velocityScale},set:function(t){this._velocityScale=t,this._assembler._updateMaterialParams()}},{key:"lengthScale",get:function(){return this._lengthScale},set:function(t){this._lengthScale=t,this._assembler._updateMaterialParams()}},{key:"mesh",get:function(){return this._mesh},set:function(t){this._mesh=t,this._assembler._updateModel()}},{key:"particleMaterial",get:function(){return this.getMaterial(0)},set:function(t){this.setMaterial(0,t),this._onMaterialModified(0,t)}},{key:"trailMaterial",get:function(){return this.getMaterial(1)},set:function(t){this.setMaterial(1,t),this._onMaterialModified(1,t)}},{key:"isPlaying",get:function(){return this._isPlaying}},{key:"isPaused",get:function(){return this._isPaused}},{key:"isStopped",get:function(){return this._isStopped}},{key:"isEmitting",get:function(){return this._isEmitting}},{key:"time",get:function(){return this._time}}])&&kt(r.prototype,s),n})(Jt)).prototype,"duration",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 5}}),k=Ut(V.prototype,"_capacity",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 100}}),Ut(V.prototype,"capacity",[Xt],Object.getOwnPropertyDescriptor(V.prototype,"capacity"),V.prototype),z=Ut(V.prototype,"loop",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),G=Ut(V.prototype,"playOnAwake",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),U=Ut(V.prototype,"_prewarm",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ut(V.prototype,"prewarm",[o],Object.getOwnPropertyDescriptor(V.prototype,"prewarm"),V.prototype),j=Ut(V.prototype,"_simulationSpace",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Dt.Space.Local}}),Ut(V.prototype,"simulationSpace",[l],Object.getOwnPropertyDescriptor(V.prototype,"simulationSpace"),V.prototype),H=Ut(V.prototype,"simulationSpeed",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),W=Ut(V.prototype,"startDelay",[c],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new gt.default}}),X=Ut(V.prototype,"startLifetime",[h],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new gt.default}}),Y=Ut(V.prototype,"startColor",[u],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new At.default}}),q=Ut(V.prototype,"scaleSpace",[_],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Dt.Space.Local}}),J=Ut(V.prototype,"startSize",[f],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new gt.default}}),Z=Ut(V.prototype,"startSpeed",[d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new gt.default}}),K=Ut(V.prototype,"startRotation",[p],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new gt.default}}),Q=Ut(V.prototype,"gravityModifier",[m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new gt.default}}),$=Ut(V.prototype,"rateOverTime",[y],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new gt.default}}),tt=Ut(V.prototype,"rateOverDistance",[v],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new gt.default}}),et=Ut(V.prototype,"bursts",[g],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Array}}),Ut(V.prototype,"materials",[b],Object.getOwnPropertyDescriptor(V.prototype,"materials"),V.prototype),it=Ut(V.prototype,"_shapeModule",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Mt.default}}),Ut(V.prototype,"shapeModule",[A],Object.getOwnPropertyDescriptor(V.prototype,"shapeModule"),V.prototype),nt=Ut(V.prototype,"_colorOverLifetimeModule",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new vt.default}}),Ut(V.prototype,"colorOverLifetimeModule",[x],Object.getOwnPropertyDescriptor(V.prototype,"colorOverLifetimeModule"),V.prototype),rt=Ut(V.prototype,"_sizeOvertimeModule",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Tt.default}}),Ut(V.prototype,"sizeOvertimeModule",[C],Object.getOwnPropertyDescriptor(V.prototype,"sizeOvertimeModule"),V.prototype),st=Ut(V.prototype,"_velocityOvertimeModule",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new wt.default}}),Ut(V.prototype,"velocityOvertimeModule",[T],Object.getOwnPropertyDescriptor(V.prototype,"velocityOvertimeModule"),V.prototype),at=Ut(V.prototype,"_forceOvertimeModule",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new bt.default}}),Ut(V.prototype,"forceOvertimeModule",[S],Object.getOwnPropertyDescriptor(V.prototype,"forceOvertimeModule"),V.prototype),ot=Ut(V.prototype,"_limitVelocityOvertimeModule",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new xt.default}}),Ut(V.prototype,"limitVelocityOvertimeModule",[w],Object.getOwnPropertyDescriptor(V.prototype,"limitVelocityOvertimeModule"),V.prototype),lt=Ut(V.prototype,"_rotationOvertimeModule",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Ct.default}}),Ut(V.prototype,"rotationOvertimeModule",[E],Object.getOwnPropertyDescriptor(V.prototype,"rotationOvertimeModule"),V.prototype),ct=Ut(V.prototype,"_textureAnimationModule",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new St.default}}),Ut(V.prototype,"textureAnimationModule",[M],Object.getOwnPropertyDescriptor(V.prototype,"textureAnimationModule"),V.prototype),ht=Ut(V.prototype,"_trailModule",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new Pt.default}}),Ut(V.prototype,"trailModule",[D],Object.getOwnPropertyDescriptor(V.prototype,"trailModule"),V.prototype),ut=Ut(V.prototype,"_renderMode",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Dt.RenderMode.Billboard}}),Ut(V.prototype,"renderMode",[B],Object.getOwnPropertyDescriptor(V.prototype,"renderMode"),V.prototype),_t=Ut(V.prototype,"_velocityScale",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Ut(V.prototype,"velocityScale",[P],Object.getOwnPropertyDescriptor(V.prototype,"velocityScale"),V.prototype),ft=Ut(V.prototype,"_lengthScale",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Ut(V.prototype,"lengthScale",[I],Object.getOwnPropertyDescriptor(V.prototype,"lengthScale"),V.prototype),dt=Ut(V.prototype,"_mesh",[Xt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),Ut(V.prototype,"mesh",[R],Object.getOwnPropertyDescriptor(V.prototype,"mesh"),V.prototype),Ut(V.prototype,"particleMaterial",[O],Object.getOwnPropertyDescriptor(V.prototype,"particleMaterial"),V.prototype),Ut(V.prototype,"trailMaterial",[L],Object.getOwnPropertyDescriptor(V.prototype,"trailMaterial"),V.prototype),F=V))||F)||F)||F)||F);i.default=Kt,cc.ParticleSystem3D=Kt,e.exports=i.default}),{"../../assets/material/CCMaterial":124,"../../components/CCRenderComponent":160,"../../mesh/CCMesh":207,"../../platform/CCClassDecorator":240,"../../value-types":339,"../../value-types/utils":346,"./animator/color-overtime":30,"./animator/curve-range":31,"./animator/force-overtime":32,"./animator/gradient-range":33,"./animator/limit-velocity-overtime":35,"./animator/rotation-overtime":36,"./animator/size-overtime":37,"./animator/texture-animation":38,"./animator/velocity-overtime":39,"./burst":40,"./emitter/shape-module":42,"./enum":43,"./particle-general-function":44,"./renderer/trail":49}],46:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=t("../../value-types");i.default=function(t){this.particleSystem=null,this.position=null,this.velocity=null,this.animatedVelocity=null,this.ultimateVelocity=null,this.angularVelocity=null,this.axisOfRotation=null,this.rotation=null,this.startSize=null,this.size=null,this.startColor=null,this.color=cc.Color.WHITE,this.randomSeed=null,this.remainingLifetime=null,this.startLifetime=null,this.emitAccumulator0=null,this.emitAccumulator1=null,this.frameIndex=null,this.particleSystem=t,this.position=new n.Vec3(0,0,0),this.velocity=new n.Vec3(0,0,0),this.animatedVelocity=new n.Vec3(0,0,0),this.ultimateVelocity=new n.Vec3(0,0,0),this.angularVelocity=new n.Vec3(0,0,0),this.axisOfRotation=new n.Vec3(0,0,0),this.rotation=new n.Vec3(0,0,0),this.startSize=new n.Vec3(0,0,0),this.size=new n.Vec3(0,0,0),this.startColor=cc.Color.WHITE.clone(),this.color=cc.Color.WHITE.clone(),this.randomSeed=0,this.remainingLifetime=0,this.startLifetime=0,this.emitAccumulator0=0,this.emitAccumulator1=0,this.frameIndex=0},e.exports=i.default}),{"../../value-types":339}],47:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0;var n=a(t("../../../../renderer/gfx")),r=a(t("../../../../renderer/core/input-assembler")),s=t("../../../mesh/mesh-data");function a(t){return t&&t.__esModule?t:{default:t}}var o=t("../../../renderer"),l=(function(){function t(){this._capacity=0,this._vertFormat=null,this._vertAttrsFloatCount=0,this._mesh=null,this._vertCount=0,this._indexCount=0,this._material=null,this._capacity=0,this._vertFormat=null,this._vertAttrsFloatCount=0,this._mesh=null,this._subDatas=[],this._subMeshes=[]}var e=t.prototype;return e.setCapacity=function(t){var e=this._capacity!==t;this._capacity=t,this._inited&&e&&this._recreateBuffer()},e.setVertexAttributes=function(t,e){this._mesh===t&&this._vertFormat===e||(this._mesh=t,this._vertFormat=e,this._vertAttrsFloatCount=this._vertFormat._bytes/4,this._createParticleData(),this._inited=!0)},e._recreateBuffer=function(){this._createParticleData()},e._createParticleData=function(){this.destroyIAData(),this._vertCount=4,this._indexCount=6;var t=null,e=null,i=this._vertFormat._bytes;if(this._mesh){var a=this._mesh._subDatas[0];this._vertCount=a.vData.byteLength/a.vfm._bytes,this._indexCount=a.iData.byteLength/2,t=new Float32Array(i*this._capacity*this._vertCount/4),e=new Uint16Array(this._capacity*this._indexCount);var l=this._vertFormat.element(n.default.ATTR_TEX_COORD3),c=this._vertFormat.element(n.default.ATTR_NORMAL),h=this._vertFormat.element(n.default.ATTR_TEX_COORD),u=this._vertFormat.element(n.default.ATTR_COLOR1);if(this._mesh.copyAttribute(0,n.default.ATTR_POSITION,t.buffer,i,l.offset),this._mesh.copyAttribute(0,n.default.ATTR_NORMAL,t.buffer,i,c.offset),this._mesh.copyAttribute(0,n.default.ATTR_UV0,t.buffer,i,h.offset),!this._mesh.copyAttribute(0,n.default.ATTR_COLOR,t.buffer,i,u.offset))for(var _=new Uint32Array(t.buffer),f=0;f=this._particleSystem.capacity?null:this._particles.add()},s._setNewParticle=function(){},s._updateParticles=function(t){switch(this._particleSystem.node.getWorldMatrix(v),this._particleSystem.scaleSpace){case c.Space.Local:this._particleSystem.node.getScale(this._node_scale);break;case c.Space.World:this._particleSystem.node.getWorldScale(this._node_scale)}(this._particleSystem.materials[0]?this._particleSystem.particleMaterial:this._defaultMat).setProperty("scale",this._node_scale),this._particleSystem.velocityOvertimeModule.enable&&this._particleSystem.velocityOvertimeModule.update(this._particleSystem._simulationSpace,v),this._particleSystem.forceOvertimeModule.enable&&this._particleSystem.forceOvertimeModule.update(this._particleSystem._simulationSpace,v),this._particleSystem.trailModule.enable&&this._particleSystem.trailModule.update();for(var e=0;e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function L(t,e){if(t){if("string"==typeof t)return F(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?F(t,e):void 0}}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=this.trailElements.length&&(t%=this.trailElements.length),this.trailElements[t])},e.addElement=function(){if(0===this.trailElements.length)return null;if(-1===this.start)return this.start=0,this.end=1,this.trailElements[0];this.start===this.end&&(this.trailElements.splice(this.end,0,{position:cc.v3(),lifetime:0,width:0,velocity:cc.v3(),direction:0,color:cc.color()}),this.start++,this.start%=this.trailElements.length);var t=this.end++;return this.end%=this.trailElements.length,this.trailElements[t]},e.iterateElement=function(t,e,i,n){for(var r=this.start>=this.end?this.end+this.trailElements.length:this.end,s=this.start;s2){var a=i.getElement(i.end-2),o=i.getElement(i.end-3);w.Vec3.subtract(H,o.position,a.position),w.Vec3.subtract(W,n.position,a.position),w.Vec3.subtract(a.velocity,W,H),w.Vec3.equals(cc.Vec3.ZERO,a.velocity)&&w.Vec3.copy(a.velocity,H)}this.colorFromParticle?n.color.set(t.color):n.color.set(this.colorOvertime.evaluate(0,1))}}},n._updateTrailElement=function(t,e,i,n){return e.lifetime+=n,t.colorFromParticle?(e.color.set(i.color),e.color.multiply(t.colorOvertime.evaluate(1-i.remainingLifetime/i.startLifetime,1))):e.color.set(t.colorOvertime.evaluate(1-i.remainingLifetime/i.startLifetime,1)),t.widthFromParticle?e.width=i.size.x*t.widthRatio.evaluate(e.lifetime/t._trailLifetime,1):e.width=t.widthRatio.evaluate(e.lifetime/t._trailLifetime,1),e.lifetime>t._trailLifetime},n.removeParticle=function(t){var e=this._particleTrail.get(t);e&&this._trailSegments&&(e.clear(),this._trailSegments.free(e),this._particleTrail.delete(t))},n.updateTrailBuffer=function(){this.vbOffset=0,this.ibOffset=0;for(var t,e=O(this._particleTrail.keys());!(t=e()).done;){var i=t.value,n=this._particleTrail.get(i);if(-1!==n.start){var r=4*this.vbOffset/this._vertSize,s=n.start>=n.end?n.end+n.trailElements.length:n.end,a=s-n.start,o=1/a,l=n.trailElements[n.start];this._fillVertexBuffer(l,this.colorOverTrail.evaluate(1,1),r,1,0,4);for(var c=n.start+1;c2){var f=n.getElement(n.end-1),d=n.getElement(n.end-2);w.Vec3.subtract(H,d.position,f.position),w.Vec3.subtract(W,G.position,f.position),w.Vec3.normalize(H,H),w.Vec3.normalize(W,W),w.Vec3.subtract(f.velocity,W,H),w.Vec3.normalize(f.velocity,f.velocity),this._checkDirectionReverse(f,d),this.vbOffset-=this._vertSize/4*2,this.ibOffset-=6,this._fillVertexBuffer(f,this.colorOverTrail.evaluate(o,1),r,o,a-1,5),w.Vec3.subtract(G.velocity,G.position,f.position),w.Vec3.normalize(G.velocity,G.velocity),this._checkDirectionReverse(G,f)}this.widthFromParticle?G.width=i.size.x*this.widthRatio.evaluate(0,1):G.width=this.widthRatio.evaluate(0,1),G.color=i.color,w.Vec3.equals(G.velocity,cc.Vec3.ZERO)?this.ibOffset-=3:this._fillVertexBuffer(G,this.colorOverTrail.evaluate(0,1),r,0,a,1)}}this._updateIA(this.ibOffset)},n._fillVertexBuffer=function(t,e,i,n,r,s){this._vbF32[this.vbOffset++]=t.position.x,this._vbF32[this.vbOffset++]=t.position.y,this._vbF32[this.vbOffset++]=t.position.z,this._vbF32[this.vbOffset++]=0,this._vbF32[this.vbOffset++]=t.width,this._vbF32[this.vbOffset++]=n,this._vbF32[this.vbOffset++]=0,this._vbF32[this.vbOffset++]=t.velocity.x,this._vbF32[this.vbOffset++]=t.velocity.y,this._vbF32[this.vbOffset++]=t.velocity.z,X.set(t.color),X.multiply(e),this._vbUint32[this.vbOffset++]=X._val,this._vbF32[this.vbOffset++]=t.position.x,this._vbF32[this.vbOffset++]=t.position.y,this._vbF32[this.vbOffset++]=t.position.z,this._vbF32[this.vbOffset++]=1,this._vbF32[this.vbOffset++]=t.width,this._vbF32[this.vbOffset++]=n,this._vbF32[this.vbOffset++]=1,this._vbF32[this.vbOffset++]=t.velocity.x,this._vbF32[this.vbOffset++]=t.velocity.y,this._vbF32[this.vbOffset++]=t.velocity.z,this._vbUint32[this.vbOffset++]=X._val,1&s&&(this._iBuffer[this.ibOffset++]=i+2*r,this._iBuffer[this.ibOffset++]=i+2*r-1,this._iBuffer[this.ibOffset++]=i+2*r+1),4&s&&(this._iBuffer[this.ibOffset++]=i+2*r,this._iBuffer[this.ibOffset++]=i+2*r+1,this._iBuffer[this.ibOffset++]=i+2*r+2)},n._updateIA=function(t){this._particleSystem&&this._particleSystem._assembler&&this._particleSystem._assembler.updateIA(1,t,!0,!0)},n._checkDirectionReverse=function(t,e){w.Vec3.dot(t.velocity,e.velocity)0&&f++,e>0&&f++);var d=(c+1)*(h+1);u&&(d+=(c+1)*f+c*f);var p=c*h*6;u&&(p+=c*f*3);var m=new Array(p),y=new Array(3*d),v=new Array(3*d),g=new Array(2*d),b=Math.max(t,e),A=new n.default(-b,-l,-b),x=new n.default(b,l,b),C=Math.sqrt(b*b+l*l),T=0,S=0;return (function(){for(var r=[],s=t-e,u=s*s/i*Math.sign(s),f=0;f<=h;f++){for(var d=[],p=f/h,b=p*s+e,A=0;A<=c;++A){var x=A/c,C=x*_,w=Math.sin(C),E=Math.cos(C);y[3*T]=b*w,y[3*T+1]=p*i-l,y[3*T+2]=b*E,n.default.normalize(a,n.default.set(o,w,-u,E)),v[3*T]=a.x,v[3*T+1]=a.y,v[3*T+2]=a.z,g[2*T]=2*(1-x)%1,g[2*T+1]=p,d.push(T),++T}r.push(d)}for(var M=0;M0&&w(!1),t>0&&w(!0)),new r.default(y,v,g,m,A,x,C);function w(i){var n,r,s=i?t:e,a=i?1:-1;n=T;for(var o=1;o<=c;++o)y[3*T]=0,y[3*T+1]=l*a,y[3*T+2]=0,v[3*T]=0,v[3*T+1]=a,v[3*T+2]=0,g[2*T]=.5,g[2*T+1]=.5,++T;r=T;for(var h=0;h<=c;++h){var u=h/c*_,f=Math.cos(u),d=Math.sin(u);y[3*T]=s*d,y[3*T+1]=l*a,y[3*T+2]=s*f,v[3*T]=0,v[3*T+1]=a,v[3*T+2]=0,g[2*T]=.5-.5*d*a,g[2*T+1]=.5+.5*f,++T}for(var p=0;p=l.length)?0:t||0;for(var n=i.sizeX||e,o=i.sizeY||e,c=i.sizeZ||e,h=l[t],u=h.face.length,_=[],f=[],d=[],p=[],m=new a.Vec3(1/0,1/0,1/0),y=new a.Vec3(-1/0,-1/0,-1/0),v=0;vo?o<<16|a:a<<16|o;void 0===n[l]&&(n[l]=0,i.push(a,o))}return i};var n,r=(n=t("../../value-types/vec3"))&&n.__esModule?n:{default:n};function s(t,e,i){t.x=e[i],t.y=e[i+1],t.z=e[i+2]}}),{"../../value-types/vec3":349}],62:[(function(t,e,i){"use strict";i.__esModule=!0,i.default=void 0,i.default=function(t,e,i,n,r,s,a){this.positions=void 0,this.normals=void 0,this.uvs=void 0,this.indices=void 0,this.minPos=void 0,this.maxPos=void 0,this.boundingRadius=void 0,this.positions=t,this.normals=e,this.uvs=i,this.indices=n,this.minPos=r,this.maxPos=s,this.boundingRadius=a},e.exports=i.default}),{}],63:[(function(t,e){"use strict";var i=t("../../../animation/animation-curves"),n=i.DynamicAnimCurve,r=i.quickFindIndex,s=cc.Class({name:"cc.JointMatrixCurve",extends:n,_findFrameIndex:r,sample:function(t,e){var i=this.ratios,n=this._findFrameIndex(i,e);n<-1&&(n=~n-1);for(var r=this.pairs,s=0;so){var y=d[p-1],v=(o-y.frame)/(m.frame-y.frame);y.value.lerp(m.value,v,i[f]);break}}c=cc.mat4(),n.default.fromRTS(c,i.quat,i.position,i.scale),l&&n.default.mul(c,l,c),_._jointMatrix||(_._jointMatrix=[]),i.uniqueBindPose&&(u=cc.mat4(),n.default.mul(u,c,i.uniqueBindPose)),r[i.path]||(r[i.path]=[]),u?r[i.path].push(a(u)):r[i.path].push(c)}var g=i.children;for(var b in g)s(g[b],o,c)}for(var o=0,l=this.duration,c=1/this.sample;o256?64:t>64?32:t>16?16:8,this._jointsData=this._jointsFloat32Data=new Float32Array(i*i*4);var r=cc.Texture2D.PixelFormat.RGBA32F,s=i,a=i;n||(this._jointsData=new Uint8Array(this._jointsFloat32Data.buffer),r=cc.Texture2D.PixelFormat.RGBA8888,s*=4,this._usingRGBA8Texture=!0,cc.warn("SkinnedMeshRenderer ["+this.node.name+"] has too many joints ["+t+"] and device do not support float32 texture, fallback to use RGBA8888 texture, which is much slower."));var o=this._jointsTexture||new cc.Texture2D,l=cc.Texture2D.Filter.NEAREST;o.setFilters(l,l),o.initWithData(this._jointsData,r,s,a),this._jointsTexture=o,this._jointsTextureOptions={format:r,width:o.width,height:o.height,images:[]}}this._updateMaterial()}},_updateMaterial:function(){s.prototype._updateMaterial.call(this);for(var t=this.getMaterials(),e=0;eh.ERROR){var e=function(t){if(cc.game.canvas){if(!i){var e=document.createElement("Div");e.setAttribute("id","logInfoDiv"),e.setAttribute("width","200"),e.setAttribute("height",cc.game.canvas.height);var n=e.style;n.zIndex="99999",n.position="absolute",n.top=n.left="0",(i=document.createElement("textarea")).setAttribute("rows","20"),i.setAttribute("cols","30"),i.setAttribute("disabled","true");var r=i.style;r.backgroundColor="transparent",r.borderBottom="1px solid #cccccc",r.borderTopWidth=r.borderLeftWidth=r.borderRightWidth="0px",r.borderTopStyle=r.borderLeftStyle=r.borderRightStyle="none",r.padding="0px",r.margin=0,e.appendChild(i),cc.game.canvas.parentNode.appendChild(e)}i.value=i.value+t+"\r\n",i.scrollTop=i.scrollHeight}};cc.error=function(){e("ERROR : "+cc.js.formatStr.apply(null,arguments))},cc.assert=function(t,i){!t&&i&&(i=cc.js.formatStr.apply(null,cc.js.shiftArguments.apply(null,arguments)),e("ASSERT: "+i))},t!==h.ERROR_FOR_WEB_PAGE&&(cc.warn=function(){e("WARN : "+cc.js.formatStr.apply(null,arguments))}),t===h.INFO_FOR_WEB_PAGE&&(cc.log=function(){e(cc.js.formatStr.apply(null,arguments))})}else console&&console.log.apply&&(console.error||(console.error=console.log),console.warn||(console.warn=console.log),console.error.bind?cc.error=console.error.bind(console):cc.error=function(){return console.error.apply(console,arguments)},cc.assert=function(t,e){if(!t)throw e&&(e=cc.js.formatStr.apply(null,cc.js.shiftArguments.apply(null,arguments))),new Error(e)});t!==h.ERROR&&(console.warn.bind?cc.warn=console.warn.bind(console):cc.warn=function(){return console.warn.apply(console,arguments)}),t===h.INFO&&(console.log.bind?cc.log=console.log.bind(console):cc.log=function(){return console.log.apply(console,arguments)})}},getError:s("ERROR"),isDisplayStats:function(){return!!cc.profiler&&cc.profiler.isShowingStats()},setDisplayStats:function(t){cc.profiler&&cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS&&(t?cc.profiler.showStats():cc.profiler.hideStats(),cc.game.config.showFPS=!!t)}}}),{"../../DebugInfos":void 0,"./platform/utils":263}],70:[(function(t,e){"use strict";var i=t("./event/event-target"),n=t("./component-scheduler"),r=t("./node-activator"),s=t("./platform/CCObject"),a=t("./CCGame"),o=t("./renderer"),l=t("./event-manager"),c=t("./CCScheduler");cc.Director=function(){i.call(this),this._paused=!1,this._purgeDirectorInNextLoop=!1,this._winSizeInPoints=null,this._scene=null,this._loadingScene="",this._totalFrames=0,this._lastUpdate=0,this._deltaTime=0,this._startTime=0,this._maxParticleDeltaTime=0,this._scheduler=null,this._compScheduler=null,this._nodeActivator=null,this._actionManager=null;var t=this;a.on(a.EVENT_SHOW,(function(){t._lastUpdate=performance.now()})),a.once(a.EVENT_ENGINE_INITED,this.init,this)},cc.Director.prototype={constructor:cc.Director,init:function(){return this._totalFrames=0,this._lastUpdate=performance.now(),this._startTime=this._lastUpdate,this._paused=!1,this._purgeDirectorInNextLoop=!1,this._winSizeInPoints=cc.size(0,0),this._scheduler=new c,cc.ActionManager?(this._actionManager=new cc.ActionManager,this._scheduler.scheduleUpdate(this._actionManager,c.PRIORITY_SYSTEM,!1)):this._actionManager=null,this.sharedInit(),!0},sharedInit:function(){this._compScheduler=new n,this._nodeActivator=new r,l&&l.setEnabled(!0),cc.AnimationManager?(this._animationManager=new cc.AnimationManager,this._scheduler.scheduleUpdate(this._animationManager,c.PRIORITY_SYSTEM,!1)):this._animationManager=null,cc.CollisionManager?(this._collisionManager=new cc.CollisionManager,this._scheduler.scheduleUpdate(this._collisionManager,c.PRIORITY_SYSTEM,!1)):this._collisionManager=null,cc.PhysicsManager?(this._physicsManager=new cc.PhysicsManager,this._scheduler.scheduleUpdate(this._physicsManager,c.PRIORITY_SYSTEM,!1)):this._physicsManager=null,cc.Physics3DManager?(this._physics3DManager=new cc.Physics3DManager,this._scheduler.scheduleUpdate(this._physics3DManager,c.PRIORITY_SYSTEM,!1)):this._physics3DManager=null,cc._widgetManager&&cc._widgetManager.init(this)},calculateDeltaTime:function(t){t||(t=performance.now()),this._deltaTime=t>this._lastUpdate?(t-this._lastUpdate)/1e3:0,this._lastUpdate=t},convertToGL:function(t){var e=a.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-e.clientLeft,s=n.top+window.pageYOffset-e.clientTop,o=i._devicePixelRatio*(t.x-r),l=i._devicePixelRatio*(s+n.height-t.y);return i._isRotated?cc.v2(i._viewportRect.width-l,o):cc.v2(o,l)},convertToUI:function(t){var e=a.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-e.clientLeft,s=n.top+window.pageYOffset-e.clientTop,o=cc.v2(0,0);return i._isRotated?(o.x=r+t.y/i._devicePixelRatio,o.y=s+n.height-(i._viewportRect.width-t.x)/i._devicePixelRatio):(o.x=r+t.x*i._devicePixelRatio,o.y=s+n.height-t.y*i._devicePixelRatio),o},end:function(){this._purgeDirectorInNextLoop=!0},getWinSize:function(){return cc.size(cc.winSize)},getWinSizeInPixels:function(){return cc.size(cc.winSize)},pause:function(){this._paused||(this._paused=!0)},purgeCachedData:function(){cc.assetManager.releaseAll()},purgeDirector:function(){this._scheduler.unscheduleAll(),this._compScheduler.unscheduleAll(),this._nodeActivator.reset(),l&&l.setEnabled(!1),cc.isValid(this._scene)&&this._scene.destroy(),this._scene=null,cc.renderer.clear(),cc.assetManager.builtins.clear(),cc.game.pause(),cc.assetManager.releaseAll()},reset:function(){this.purgeDirector(),l&&l.setEnabled(!0),this._actionManager&&this._scheduler.scheduleUpdate(this._actionManager,cc.Scheduler.PRIORITY_SYSTEM,!1),this._animationManager&&this._scheduler.scheduleUpdate(this._animationManager,cc.Scheduler.PRIORITY_SYSTEM,!1),this._collisionManager&&this._scheduler.scheduleUpdate(this._collisionManager,cc.Scheduler.PRIORITY_SYSTEM,!1),this._physicsManager&&this._scheduler.scheduleUpdate(this._physicsManager,cc.Scheduler.PRIORITY_SYSTEM,!1),cc.game.resume()},runSceneImmediate:function(t,e,i){cc.assertID(t instanceof cc.Scene||t instanceof cc.SceneAsset,1216),t instanceof cc.SceneAsset&&(t=t.scene),t._load();for(var n=Object.keys(a._persistRootNodes).map((function(t){return a._persistRootNodes[t]})),r=0;r2||e<0)&&(t.renderMode=0),"boolean"!=typeof t.registerSystemEvent&&(t.registerSystemEvent=!0),t.showFPS=1!==e&&!!t.showFPS,this.collisionMatrix=t.collisionMatrix||[],this.groupList=t.groupList||[],n._resetDebugSetting(t.debugMode),this.config=t,this._configLoaded=!0},_determineRenderType:function(){var t=this.config,e=parseInt(t.renderMode)||0;this.renderType=this.RENDER_TYPE_CANVAS;var i=!1;if(0===e?cc.sys.capabilities.opengl?(this.renderType=this.RENDER_TYPE_WEBGL,i=!0):cc.sys.capabilities.canvas&&(this.renderType=this.RENDER_TYPE_CANVAS,i=!0):1===e&&cc.sys.capabilities.canvas?(this.renderType=this.RENDER_TYPE_CANVAS,i=!0):2===e&&cc.sys.capabilities.opengl&&(this.renderType=this.RENDER_TYPE_WEBGL,i=!0),!i)throw new Error(n.getError(3820,e))},_initRenderer:function(){if(!this._rendererInitialized){var t,e,i,n,a=this.config.id,o=a instanceof HTMLElement?a:document.querySelector(a)||document.querySelector("#"+a);if("CANVAS"===o.tagName?(t=o.width,e=o.height,this.canvas=i=o,this.container=n=document.createElement("DIV"),i.parentNode&&i.parentNode.insertBefore(n,i)):("DIV"!==o.tagName&&cc.warnID(3819),t=o.clientWidth,e=o.clientHeight,this.canvas=i=document.createElement("CANVAS"),this.container=n=document.createElement("DIV"),o.appendChild(n)),n.setAttribute("id","Cocos2dGameContainer"),n.appendChild(i),this.frame=n.parentNode===document.body?document.documentElement:n.parentNode,(function(t){(" "+t.className+" ").indexOf(" gameCanvas ")>-1||(t.className&&(t.className+=" "),t.className+="gameCanvas")})(i),i.setAttribute("width",t||480),i.setAttribute("height",e||320),i.setAttribute("tabindex",99),this._determineRenderType(),this.renderType===this.RENDER_TYPE_WEBGL){var l={stencil:!0,antialias:cc.macro.ENABLE_WEBGL_ANTIALIAS,alpha:cc.macro.ENABLE_TRANSPARENT_CANVAS};r.initWebGL(i,l),this._renderContext=r.device._gl,!cc.macro.CLEANUP_IMAGE_CACHE&&s&&(s.enabled=!0)}this._renderContext||(this.renderType=this.RENDER_TYPE_CANVAS,r.initCanvas(i),this._renderContext=r.device._ctx),this.canvas.oncontextmenu=function(){if(!cc._isContextMenuEnable)return!1},this._rendererInitialized=!0}},_initEvents:function(){var t,e=window;this.config.registerSystemEvent&&cc.internal.inputManager.registerSystemEvent(this.canvas),void 0!==document.hidden?t="hidden":void 0!==document.mozHidden?t="mozHidden":void 0!==document.msHidden?t="msHidden":void 0!==document.webkitHidden&&(t="webkitHidden");var i=!1;function n(){i||(i=!0,a.emit(a.EVENT_HIDE))}function r(t,e,n,r,s){i&&(i=!1,a.emit(a.EVENT_SHOW,t,e,n,r,s))}if(t)for(var s=["visibilitychange","mozvisibilitychange","msvisibilitychange","webkitvisibilitychange","qbrowserVisibilityChange"],o=0;o-1&&(e.onfocus=r),"onpageshow"in window&&"onpagehide"in window&&(e.addEventListener("pagehide",n),e.addEventListener("pageshow",r),document.addEventListener("pagehide",n),document.addEventListener("pageshow",r)),this.on(a.EVENT_HIDE,(function(){a.pause()})),this.on(a.EVENT_SHOW,(function(){a.resume()}))}};i.call(a),cc.js.addon(a,i.prototype),cc.game=e.exports=a}),{"../audio/CCAudioEngine":21,"../core/renderer/utils/dynamic-atlas/manager":274,"./CCDebug":69,"./event/event-target":186,"./renderer/index.js":271}],72:[(function(t,e){"use strict";var i=t("./value-types"),n=t("./value-types/utils"),r=t("./utils/base-node"),s=t("./utils/prefab-helper"),a=t("./utils/trans-pool").NodeMemPool,o=t("./utils/affine-transform"),l=t("./event-manager"),c=t("./platform/CCMacro"),h=t("./platform/js"),u=(t("./event/event"),t("./event/event-target")),_=t("./renderer/render-flow"),f=cc.Object.Flags.Destroying,d=Math.PI/180,p=!!cc.ActionManager,m=function(){},y=new i.Vec3,v=new i.Quat,g=new i.Vec3,b=new i.Vec3,A=new i.Quat,x=new i.Quat,C=new i.Vec3,T=new i.Vec3,S=new i.Vec3,w=new i.Vec3,E=new i.Vec3,M=new i.Quat,D=new i.Quat,B=new i.Vec3,P=new i.Quat,I=new i.Vec3,R=new i.Quat,O=new i.Vec3,L=new i.Vec3,F=new i.Quat,V=new i.Quat,N=(new i.Quat,cc.mat4()),k=new i.Vec3,z=new h.Pool;z.get=function(){return this._get()||[]};var G=cc.Enum({DEBUG:31}),U=cc.Enum({POSITION:1,SCALE:2,ROTATION:4,SKEW:8,TRS:7,RS:6,TRSS:15,PHYSICS_POSITION:16,PHYSICS_SCALE:32,PHYSICS_ROTATION:64,PHYSICS_TRS:112,PHYSICS_RS:96,ALL_POSITION:17,ALL_SCALE:34,ALL_ROTATION:68,ALL_TRS:119,ALL:65535}),j=cc.Enum({TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:"touchend",TOUCH_CANCEL:"touchcancel",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_UP:"mouseup",MOUSE_WHEEL:"mousewheel",POSITION_CHANGED:"position-changed",ROTATION_CHANGED:"rotation-changed",SCALE_CHANGED:"scale-changed",SIZE_CHANGED:"size-changed",ANCHOR_CHANGED:"anchor-changed",COLOR_CHANGED:"color-changed",CHILD_ADDED:"child-added",CHILD_REMOVED:"child-removed",CHILD_REORDER:"child-reorder",GROUP_CHANGED:"group-changed",SIBLING_ORDER_CHANGED:"sibling-order-changed"}),H=[j.TOUCH_START,j.TOUCH_MOVE,j.TOUCH_END,j.TOUCH_CANCEL],W=[j.MOUSE_DOWN,j.MOUSE_ENTER,j.MOUSE_MOVE,j.MOUSE_LEAVE,j.MOUSE_UP,j.MOUSE_WHEEL],X=!0,Y=function(t){if(0!==t){X&&cc.warn("`cc.Node.skewX/Y` is deprecated since v2.2.1, please use 3D node instead.",""),X=!1}},q=null,J=function(t,e){var i=t.getLocation(),n=this.owner;return!!n._hitTest(i,this)&&(e.type=j.TOUCH_START,e.touch=t,e.bubbles=!0,n.dispatchEvent(e),!0)},Z=function(t,e){var i=this.owner;e.type=j.TOUCH_MOVE,e.touch=t,e.bubbles=!0,i.dispatchEvent(e)},K=function(t,e){var i=t.getLocation(),n=this.owner;n._hitTest(i,this)?e.type=j.TOUCH_END:e.type=j.TOUCH_CANCEL,e.touch=t,e.bubbles=!0,n.dispatchEvent(e)},Q=function(t,e){t.getLocation();var i=this.owner;e.type=j.TOUCH_CANCEL,e.touch=t,e.bubbles=!0,i.dispatchEvent(e)},$=function(t){var e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=j.MOUSE_DOWN,t.bubbles=!0,i.dispatchEvent(t))},tt=function(t){var e=t.getLocation(),i=this.owner;if(i._hitTest(e,this))this._previousIn||(q&&q._mouseListener&&(t.type=j.MOUSE_LEAVE,q.dispatchEvent(t),q._mouseListener._previousIn=!1),q=this.owner,t.type=j.MOUSE_ENTER,i.dispatchEvent(t),this._previousIn=!0),t.type=j.MOUSE_MOVE,t.bubbles=!0,i.dispatchEvent(t);else{if(!this._previousIn)return;t.type=j.MOUSE_LEAVE,i.dispatchEvent(t),this._previousIn=!1,q=null}t.stopPropagation()},et=function(t){var e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=j.MOUSE_UP,t.bubbles=!0,i.dispatchEvent(t),t.stopPropagation())},it=function(t){var e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=j.MOUSE_WHEEL,t.bubbles=!0,i.dispatchEvent(t),t.stopPropagation())};function nt(t,e){if(e){for(var i=0,n=null,r=t;r&&cc.Node.isNode(r);r=r._parent,++i)if(r.getComponent(e)){var s={index:i,node:r};n?n.push(s):n=[s]}return n}return null}function rt(t,e){if(!(t._objFlags&f)){if(t._bubblingListeners)for(var i=0,n=e.length;i=0;--r)if((n=i[r])._capturingListeners&&(e.currentTarget=n,n._capturingListeners.emit(e.type,e,i),e._propagationStopped))return void(i.length=0);if(i.length=0,e.eventPhase=2,e.currentTarget=t,t._capturingListeners&&t._capturingListeners.emit(e.type,e),!e._propagationImmediateStopped&&t._bubblingListeners&&t._bubblingListeners.emit(e.type,e),!e._propagationStopped&&e.bubbles)for(t._getBubblingTargets(e.type,i),e.eventPhase=3,r=0;r>16},set:function(t){t>c.MAX_ZINDEX?(cc.warnID(1636),t=c.MAX_ZINDEX):t0&&(this._renderFlag|=_.FLAG_CHILDREN)},_checkListenerMask:function(){if(this._touchListener){var t=this._touchListener.mask=nt(this,cc.Mask);this._mouseListener&&(this._mouseListener.mask=t)}else this._mouseListener&&(this._mouseListener.mask=nt(this,cc.Mask))},_checknSetupSysEvent:function(t){var e=!1,i=!1;return-1!==H.indexOf(t)?(this._touchListener||(this._touchListener=cc.EventListener.create({event:cc.EventListener.TOUCH_ONE_BY_ONE,swallowTouches:!0,owner:this,mask:nt(this,cc.Mask),onTouchBegan:J,onTouchMoved:Z,onTouchEnded:K,onTouchCancelled:Q}),l.addListener(this._touchListener,this),e=!0),i=!0):-1!==W.indexOf(t)&&(this._mouseListener||(this._mouseListener=cc.EventListener.create({event:cc.EventListener.MOUSE,_previousIn:!1,owner:this,mask:nt(this,cc.Mask),onMouseDown:$,onMouseMove:tt,onMouseUp:et,onMouseScroll:it}),l.addListener(this._mouseListener,this),e=!0),i=!0),e&&!this._activeInHierarchy&&cc.director.getScheduler().schedule((function(){this._activeInHierarchy||l.pauseTarget(this)}),this,0,0,0,!1),i},on:function(t,e,i,n){if(this._checknSetupSysEvent(t))return this._onDispatch(t,e,i,n);switch(t){case j.POSITION_CHANGED:this._eventMask|=1;break;case j.SCALE_CHANGED:this._eventMask|=2;break;case j.ROTATION_CHANGED:this._eventMask|=4;break;case j.SIZE_CHANGED:this._eventMask|=8;break;case j.ANCHOR_CHANGED:this._eventMask|=16;break;case j.COLOR_CHANGED:this._eventMask|=32}return this._bubblingListeners||(this._bubblingListeners=new u),this._bubblingListeners.on(t,e,i)},once:function(t,e,i,n){var r=this,s=null;(s=this._checknSetupSysEvent(t)&&n?this._capturingListeners=this._capturingListeners||new u:this._bubblingListeners=this._bubblingListeners||new u).once(t,e,i),s.once(t,(function(){r.off(t,e,i)}),void 0)},_onDispatch:function(t,e,i,n){if("boolean"==typeof i?(n=i,i=void 0):n=!!n,e){var r=null;return(r=n?this._capturingListeners=this._capturingListeners||new u:this._bubblingListeners=this._bubblingListeners||new u).hasEventListener(t,e,i)||(r.on(t,e,i),i&&i.__eventTargets&&i.__eventTargets.push(this)),e}cc.errorID(6800)},off:function(t,e,i,n){var r=-1!==H.indexOf(t),s=!r&&-1!==W.indexOf(t);if(r||s)this._offDispatch(t,e,i,n),r?this._touchListener&&!rt(this,H)&&(l.removeListener(this._touchListener),this._touchListener=null):s&&this._mouseListener&&!rt(this,W)&&(l.removeListener(this._mouseListener),this._mouseListener=null);else if(this._bubblingListeners&&(this._bubblingListeners.off(t,e,i),!this._bubblingListeners.hasEventListener(t)))switch(t){case j.POSITION_CHANGED:this._eventMask&=-2;break;case j.SCALE_CHANGED:this._eventMask&=-3;break;case j.ROTATION_CHANGED:this._eventMask&=-5;break;case j.SIZE_CHANGED:this._eventMask&=-9;break;case j.ANCHOR_CHANGED:this._eventMask&=-17;break;case j.COLOR_CHANGED:this._eventMask&=-33}},_offDispatch:function(t,e,i,n){if("boolean"==typeof i?(n=i,i=void 0):n=!!n,e){var r=n?this._capturingListeners:this._bubblingListeners;r&&(r.off(t,e,i),i&&i.__eventTargets&&h.array.fastRemove(i.__eventTargets,this))}else this._capturingListeners&&this._capturingListeners.removeAll(t),this._bubblingListeners&&this._bubblingListeners.removeAll(t)},targetOff:function(t){var e=this._bubblingListeners;e&&(e.targetOff(t),1&this._eventMask&&!e.hasEventListener(j.POSITION_CHANGED)&&(this._eventMask&=-2),2&this._eventMask&&!e.hasEventListener(j.SCALE_CHANGED)&&(this._eventMask&=-3),4&this._eventMask&&!e.hasEventListener(j.ROTATION_CHANGED)&&(this._eventMask&=-5),8&this._eventMask&&!e.hasEventListener(j.SIZE_CHANGED)&&(this._eventMask&=-9),16&this._eventMask&&!e.hasEventListener(j.ANCHOR_CHANGED)&&(this._eventMask&=-17),32&this._eventMask&&!e.hasEventListener(j.COLOR_CHANGED)&&(this._eventMask&=-33)),this._capturingListeners&&this._capturingListeners.targetOff(t),t&&t.__eventTargets&&h.array.fastRemove(t.__eventTargets,this),this._touchListener&&!rt(this,H)&&(l.removeListener(this._touchListener),this._touchListener=null),this._mouseListener&&!rt(this,W)&&(l.removeListener(this._mouseListener),this._mouseListener=null)},hasEventListener:function(t){var e=!1;return this._bubblingListeners&&(e=this._bubblingListeners.hasEventListener(t)),!e&&this._capturingListeners&&(e=this._capturingListeners.hasEventListener(t)),e},emit:function(t,e,i,n,r,s){this._bubblingListeners&&this._bubblingListeners.emit(t,e,i,n,r,s)},dispatchEvent:function(t){var e=z.get();st(this,t,e),z.put(e)},pauseSystemEvents:function(t){l.pauseTarget(this,t)},resumeSystemEvents:function(t){l.resumeTarget(this,t)},_hitTest:function(t,e){var n=this._contentSize.width,r=this._contentSize.height,s=O,a=L,o=cc.Camera.findCamera(this);if(o?o.getScreenToWorldPoint(t,s):s.set(t),this._updateWorldMatrix(),!i.Mat4.invert(N,this._worldMatrix))return!1;i.Vec2.transformMat4(a,s,N),a.x+=this._anchorPoint.x*n,a.y+=this._anchorPoint.y*r;var l=!1;if(a.x>=0&&a.y>=0&&a.x<=n&&a.y<=r&&(l=!0,e&&e.mask))for(var c=e.mask,h=this,u=c?c.length:0,_=0,f=0;h&&fd.index){c.length=f;break}}return l},_getCapturingTargets:function(t,e){for(var i=this.parent;i;)i._capturingListeners&&i._capturingListeners.hasEventListener(t)&&e.push(i),i=i.parent},_getBubblingTargets:function(t,e){for(var i=this.parent;i;)i._bubblingListeners&&i._bubblingListeners.hasEventListener(t)&&e.push(i),i=i.parent},runAction:p?function(t){if(this.active){cc.assertID(t,1618);var e=cc.director.getActionManager();return e._suppressDeprecation||(e._suppressDeprecation=!0,cc.warnID(1639)),e.addAction(t,this,!1),t}}:m,pauseAllActions:p?function(){cc.director.getActionManager().pauseTarget(this)}:m,resumeAllActions:p?function(){cc.director.getActionManager().resumeTarget(this)}:m,stopAllActions:p?function(){cc.director.getActionManager().removeAllActionsFromTarget(this)}:m,stopAction:p?function(t){cc.director.getActionManager().removeAction(t)}:m,stopActionByTag:p?function(t){t!==cc.Action.TAG_INVALID?cc.director.getActionManager().removeActionByTag(t,this):cc.logID(1612)}:m,getActionByTag:p?function(t){return t===cc.Action.TAG_INVALID?(cc.logID(1613),null):cc.director.getActionManager().getActionByTag(t,this)}:function(){return null},getNumberOfRunningActions:p?function(){return cc.director.getActionManager().getNumberOfRunningActionsInTarget(this)}:function(){return 0},getPosition:function(t){return t=t||new i.Vec3,i.Trs.toPosition(t,this._trs)},setPosition:function(t,e,i){var n;void 0===e?(n=t.x,e=t.y,i=t.z):n=t;var r=this._trs;void 0===i&&(i=r[2]),(r[0]!==n||r[1]!==e||r[2]!==i)&&(r[0]=n,r[1]=e,r[2]=i,this.setLocalDirty(U.ALL_POSITION),this._renderFlag|=_.FLAG_WORLD_TRANSFORM,1&this._eventMask&&this.emit(j.POSITION_CHANGED))},getScale:function(t){return void 0!==t?i.Trs.toScale(t,this._trs):(cc.errorID(1400,"cc.Node.getScale","cc.Node.scale or cc.Node.getScale(cc.Vec3)"),this._trs[7])},setScale:function(t,e,i){var n;t&&"number"!=typeof t?(n=t.x,e=t.y,i=t.z):void 0!==t&&void 0===e?(n=t,e=t,i=t):n=t;var r=this._trs;void 0===i&&(i=r[9]),r[7]===n&&r[8]===e&&r[9]===i||(r[7]=n,r[8]=e,r[9]=i,this.setLocalDirty(U.ALL_SCALE),this._renderFlag|=_.FLAG_TRANSFORM,2&this._eventMask&&this.emit(j.SCALE_CHANGED))},getRotation:function(t){return t instanceof i.Quat?i.Trs.toRotation(t,this._trs):-this.angle},setRotation:function(t,e,i,n){if("number"==typeof t&&void 0===e)this.angle=-t;else{var r=t;void 0===e&&(r=t.x,e=t.y,i=t.z,n=t.w);var s=this._trs;s[3]===r&&s[4]===e&&s[5]===i&&s[6]===n||(s[3]=r,s[4]=e,s[5]=i,s[6]=n,this.setLocalDirty(U.ALL_ROTATION),4&this._eventMask&&this.emit(j.ROTATION_CHANGED))}},getContentSize:function(){return cc.size(this._contentSize.width,this._contentSize.height)},setContentSize:function(t,e){var i=this._contentSize;if(void 0===e){if((0,n.approx)(t.width,i.width)&&(0,n.approx)(t.height,i.height))return;i.width=t.width,i.height=t.height}else{if((0,n.approx)(t,i.width)&&(0,n.approx)(e,i.height))return;i.width=t,i.height=e}8&this._eventMask&&this.emit(j.SIZE_CHANGED)},getAnchorPoint:function(){return cc.v2(this._anchorPoint)},setAnchorPoint:function(t,e){var i=this._anchorPoint;if(void 0===e){if(t.x===i.x&&t.y===i.y)return;i.x=t.x,i.y=t.y}else{if(t===i.x&&e===i.y)return;i.x=t,i.y=e}this.setLocalDirty(U.ALL_POSITION),16&this._eventMask&&this.emit(j.ANCHOR_CHANGED)},_invTransformPoint:function(t,e){this._parent?this._parent._invTransformPoint(t,e):i.Vec3.copy(t,e);var n=this._trs;return i.Trs.toPosition(g,n),i.Vec3.sub(t,t,g),i.Trs.toRotation(A,n),i.Quat.conjugate(x,A),i.Vec3.transformQuat(t,t,x),i.Trs.toScale(g,n),i.Vec3.inverseSafe(b,g),i.Vec3.mul(t,t,b),t},getWorldPosition:function(t){i.Trs.toPosition(t,this._trs);for(var e,n=this._parent;n;)e=n._trs,i.Trs.toScale(y,e),i.Vec3.mul(t,t,y),i.Trs.toRotation(v,e),i.Vec3.transformQuat(t,t,v),i.Trs.toPosition(y,e),i.Vec3.add(t,t,y),n=n._parent;return t},setWorldPosition:function(t){var e=this._trs;this._parent?this._parent._invTransformPoint(C,t):i.Vec3.copy(C,t),i.Trs.fromPosition(e,C),this.setLocalDirty(U.ALL_POSITION),1&this._eventMask&&this.emit(j.POSITION_CHANGED)},getWorldRotation:function(t){i.Trs.toRotation(F,this._trs),i.Quat.copy(t,F);for(var e=this._parent;e;)i.Trs.toRotation(F,e._trs),i.Quat.mul(t,F,t),e=e._parent;return t},setWorldRotation:function(t){this._parent?(this._parent.getWorldRotation(V),i.Quat.conjugate(V,V),i.Quat.mul(V,V,t)):i.Quat.copy(V,t),i.Trs.fromRotation(this._trs,V),this.setLocalDirty(U.ALL_ROTATION)},getWorldScale:function(t){i.Trs.toScale(T,this._trs),i.Vec3.copy(t,T);for(var e=this._parent;e;)i.Trs.toScale(T,e._trs),i.Vec3.mul(t,t,T),e=e._parent;return t},setWorldScale:function(t){this._parent?(this._parent.getWorldScale(S),i.Vec3.div(S,t,S)):i.Vec3.copy(S,t),i.Trs.fromScale(this._trs,S),this.setLocalDirty(U.ALL_SCALE)},getWorldRT:function(t){var e=w,n=M,r=this._trs;i.Trs.toPosition(e,r),i.Trs.toRotation(n,r);for(var s=this._parent;s;)r=s._trs,i.Trs.toScale(E,r),i.Vec3.mul(e,e,E),i.Trs.toRotation(D,r),i.Vec3.transformQuat(e,e,D),i.Trs.toPosition(E,r),i.Vec3.add(e,e,E),i.Quat.mul(n,D,n),s=s._parent;return i.Mat4.fromRT(t,n,e),t},lookAt:function(t,e){this.getWorldPosition(B),i.Vec3.sub(B,B,t),i.Vec3.normalize(B,B),i.Quat.fromViewUp(P,B,e),this.setWorldRotation(P)},_updateLocalMatrix:ct,_calculWorldMatrix:function(){this._localMatDirty&U.TRSS&&this._updateLocalMatrix();var t=this._parent;t?this._mulMat(this._worldMatrix,t._worldMatrix,this._matrix):i.Mat4.copy(this._worldMatrix,this._matrix),this._worldMatDirty=!1},_mulMat:_t,_updateWorldMatrix:function(){if(this._parent&&this._parent._updateWorldMatrix(),this._worldMatDirty){this._calculWorldMatrix();for(var t=this._children,e=0,i=t.length;e1){for(var n,r,s=1,a=t.length;s0&&(r=t[o-1])._localZOrder>n._localZOrder;o--)t[o]=r;t[o]=n}this.emit(j.CHILD_REORDER,this)}cc.director.__fastOff(cc.Director.EVENT_AFTER_UPDATE,this.sortAllChildren,this)}},_delaySort:function(){this._reorderChildDirty||(this._reorderChildDirty=!0,cc.director.__fastOn(cc.Director.EVENT_AFTER_UPDATE,this.sortAllChildren,this))},_restoreProperties:!1,onRestore:!1},pt=cc.Class(dt),mt=pt.prototype;h.getset(mt,"position",mt.getPosition,mt.setPosition,!1,!0),cc.Node=e.exports=pt}),{"./event-manager":184,"./event/event":187,"./event/event-target":186,"./platform/CCMacro":244,"./platform/js":260,"./renderer/render-flow":272,"./utils/affine-transform":315,"./utils/base-node":316,"./utils/prefab-helper":327,"./utils/trans-pool":333,"./value-types":339,"./value-types/utils":346}],73:[(function(t,e){"use strict";var i=t("./CCNode"),n=t("./renderer/render-flow"),r=(cc.Object.Flags.HideInHierarchy,i._LocalDirtyFlag),s=cc.Class({name:"cc.PrivateNode",extends:i,properties:{x:{get:function(){return this._originPos.x},set:function(t){var e=this._originPos;t!==e.x&&(e.x=t,this._posDirty(!0))},override:!0},y:{get:function(){return this._originPos.y},set:function(t){var e=this._originPos;t!==e.y&&(e.y=t,this._posDirty(!0))},override:!0},zIndex:{get:function(){return cc.macro.MIN_ZINDEX},set:function(){},override:!0},showInEditor:{default:!1,editorOnly:!0,override:!0}},ctor:function(){this._localZOrder=cc.macro.MIN_ZINDEX<<16,this._originPos=cc.v2()},_posDirty:function(t){this.setLocalDirty(r.POSITION),this._renderFlag|=n.FLAG_TRANSFORM,!0===t&&1&this._eventMask&&this.emit(i.EventType.POSITION_CHANGED)},_updateLocalMatrix:function(){if(this._localMatDirty){var t=this.parent;t&&(this._trs[0]=this._originPos.x-(t._anchorPoint.x-.5)*t._contentSize.width,this._trs[1]=this._originPos.y-(t._anchorPoint.y-.5)*t._contentSize.height),this._super()}},getPosition:function(){return new cc.Vec2(this._originPos)},setPosition:function(t,e){void 0===e&&(e=(t=t.x).y);var i=this._originPos;i.x===t&&i.y===e||(i.x=t,i.y=e,this._posDirty(!0))},setParent:function(t){var e=this._parent;this._super(t),e!==t&&(e&&e.off(i.EventType.ANCHOR_CHANGED,this._posDirty,this),t&&t.on(i.EventType.ANCHOR_CHANGED,this._posDirty,this))},_updateOrderOfArrival:function(){}}),a=s.prototype;cc.js.getset(a,"parent",a.getParent,a.setParent),cc.js.getset(a,"position",a.getPosition,a.setPosition),cc.PrivateNode=e.exports=s}),{"./CCNode":72,"./renderer/render-flow":272}],74:[(function(t,e){"use strict";cc.Scene=cc.Class({name:"cc.Scene",extends:t("./CCNode"),properties:{_is3DNode:{default:!0,override:!0},autoReleaseAssets:!1},ctor:function(){this._anchorPoint.x=0,this._anchorPoint.y=0,this._activeInHierarchy=!1,this._inited=!cc.game._isCloning,this.dependAssets=null},destroy:function(){if(cc.Object.prototype.destroy.call(this))for(var t=this._children,e=0;e0,this._repeat=r,this._runForever=this._repeat===cc.macro.REPEAT_FOREVER,!0},u.getInterval=function(){return this._interval},u.setInterval=function(t){this._interval=t},u.update=function(t){-1===this._elapsed?(this._elapsed=0,this._timesExecuted=0):(this._elapsed+=t,this._runForever&&!this._useDelay?this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0):(this._useDelay?this._elapsed>=this._delay&&(this.trigger(),this._elapsed-=this._delay,this._timesExecuted+=1,this._useDelay=!1):this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0,this._timesExecuted+=1),this._callback&&!this._runForever&&this._timesExecuted>this._repeat&&this.cancel()))},u.getCallback=function(){return this._callback},u.trigger=function(){this._target&&this._callback&&(this._lock=!0,this._callback.call(this._target,this._elapsed),this._lock=!1)},u.cancel=function(){this._scheduler.unschedule(this._callback,this._target)};var _=[];h.get=function(){return _.pop()||new h},h.put=function(t){_.length<20&&!t._lock&&(t._scheduler=t._target=t._callback=null,_.push(t))},cc.Scheduler=function(){this._timeScale=1,this._updatesNegList=[],this._updates0List=[],this._updatesPosList=[],this._hashForUpdates=i.createMap(!0),this._hashForTimers=i.createMap(!0),this._currentTarget=null,this._currentTargetSalvaged=!1,this._updateHashLocked=!1,this._arrayForTimers=[]},cc.Scheduler.prototype={constructor:cc.Scheduler,_removeHashElement:function(t){delete this._hashForTimers[t.target._id];for(var e=this._arrayForTimers,i=0,n=e.length;i=s&&n.timerIndex--,void(0===r.length&&(this._currentTarget===n?this._currentTargetSalvaged=!0:this._removeHashElement(n)))}}},unscheduleUpdate:function(t){if(t){var e=t._id;e||(t.__instanceId?(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var i=this._hashForUpdates[e];i&&(this._updateHashLocked?i.entry.markedForDeletion=!0:this._removeUpdateFromHash(i.entry))}},unscheduleAllForTarget:function(t){if(t){var e=t._id;e||(t.__instanceId?(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var i=this._hashForTimers[e];if(i){var n=i.timers;n.indexOf(i.currentTimer)>-1&&!i.currentTimerSalvaged&&(i.currentTimerSalvaged=!0);for(var r=0,s=n.length;r=0;e--)i=r[e],this.unscheduleAllForTarget(i.target);var s=0;if(t<0)for(e=0;e=t&&this.unscheduleUpdate(n.target),s==this._updatesNegList.length&&e++;if(t<=0)for(e=0;e=t&&this.unscheduleUpdate(n.target),s==this._updatesPosList.length&&e++},isScheduled:function(t,e){cc.assertID(t,1508),cc.assertID(e,1509);var i=e._id;i||(e.__instanceId?(cc.warnID(1513),i=e._id=e.__instanceId):cc.errorID(1510));var n=this._hashForTimers[i];if(!n)return!1;if(null==n.timers)return!1;for(var r=n.timers,s=0;s=t&&(r.paused=!0,s.push(r.target));if(t<=0)for(i=0;i=t&&(r.paused=!0,s.push(r.target));return s},resumeTargets:function(t){if(t)for(var e=0;e1?n:n[0]}},cc.AssetManager=O,cc.assetManager=new O,Object.defineProperty(cc,"resources",{get:function(){return I.get(R.RESOURCES)}}),e.exports=cc.assetManager}),{"./builtins":77,"./bundle":78,"./cache":79,"./depend-util":81,"./downloader":88,"./factory":89,"./fetch":90,"./helper":92,"./load":94,"./pack-manager":95,"./parser":96,"./pipeline":97,"./preprocess":98,"./releaseManager":99,"./request-item":100,"./shared":101,"./task":102,"./urlTransformer":103,"./utilities":104}],77:[(function(t,e){"use strict";var i=t("./cache"),n=t("./releaseManager"),r=t("./shared").BuiltinBundleName,s={_assets:new i({material:new i,effect:new i}),_loadBuiltins:function(t,e){var i=t+"s",n=this._assets.get(t);return cc.assetManager.internal.loadDir(i,null,null,(function(t,i){if(t)cc.error(t.message,t.stack);else for(var r=0;re.length)||47===t.charCodeAt(e.length)}return this.paths.forEach((function(n,r){if(r.startsWith(t)&&a(r,t)||!t)for(var o=0,l=n.length;o1){var f=Object.create(null);n.forEach((function(t){f[t._uuid]=t})),r={isCompleted:h,_map:f}}else r=n[0]}i&&i(e,r)}))},getXMLHttpRequest:function(){return new XMLHttpRequest},_parseLoadResArgs:i.parseLoadResArgs,getItem:function(t){return cc.assetManager.assets.has(t)?{content:cc.assetManager.assets.get(t)}:null},loadRes:function(t,e,i,n){var r=this._parseLoadResArgs(e,i,n),s=(e=r.type,r.onProgress),a=r.onComplete,o=cc.path.extname(t);o&&(t=t.slice(0,-o.length)),cc.resources.load(t,e,s,a)},loadResArray:function(t,e,i,n){var r=this._parseLoadResArgs(e,i,n),s=(e=r.type,r.onProgress),a=r.onComplete;t.forEach((function(e,i){var n=cc.path.extname(e);n&&(t[i]=e.slice(0,-n.length))})),cc.resources.load(t,e,s,a)},loadResDir:function(t,e,i,n){var r=this._parseLoadResArgs(e,i,n),s=(e=r.type,r.onProgress),a=r.onComplete;cc.resources.loadDir(t,e,s,(function(i,n){var r=[];i||(r=cc.resources.getDirWithPath(t,e).map((function(t){return t.path}))),a&&a(i,n,r)}))},getRes:function(t,e){return cc.assetManager.assets.has(t)?cc.assetManager.assets.get(t):cc.resources.get(t,e)},getResCount:function(){return cc.assetManager.assets.count},getDependsRecursively:function(t){return t?n.getDepsRecursively("string"==typeof t?t:t._uuid).concat([t._uuid]):[]},get assetLoader(){},get md5Pipe(){return u},get downloader(){return cc.assetManager.downloader},get loader(){return cc.assetManager.parser},addDownloadHandlers:function(t){var e=Object.create(null);for(var i in t){var n=t[i];e["."+i]=function(t,e,i){n({url:t},i)}}cc.assetManager.downloader.register(e)},addLoadHandlers:function(t){var e=Object.create(null);for(var i in t){var n=t[i];e["."+i]=function(t,e,i){n({content:t},i)}}cc.assetManager.parser.register(e)},flowInDeps:function(){},release:function(t){if(Array.isArray(t))for(var e=0;eL._maxInterval?L._maxInterval:cc.director._deltaTime;t-P>1e3*e&&(B=0,P=t)},O=function t(e,i){for(I=!1,R();E.length>0&&D0&&D0&&(s(O,v,g),I=!0),a.apply(this,arguments)}))}R(),D0){var i=n.create({name:t.name+" dependencies",input:l,progress:f,options:s,onProgress:t.onProgress,onError:n.prototype.recycle,onComplete:function(n){n||(t.output.push.apply(t.output,this.output),i.recycle()),r&&u(t),e(n)}});h.async(i)}else r&&u(t),e()}))}}),{"./pack-manager":95,"./shared":101,"./task":102,"./utilities":104}],91:[(function(t,e){"use strict";var i,n=t("../utils/text-utils"),r=null,s="BES bswy:->@123\u4e01\u3041\u1101",a=Object.create(null),o=-1,l=[],c=3e3,h=(i=void 0,function(){if(void 0===i)if(window.FontFace){var t=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),e=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);i=t?parseInt(t[1],10)>42:!e}else i=!1;return i});function u(){for(var t=!0,e=Date.now(),i=l.length-1;i>=0;i--){var a=l[i],h=a.fontFamilyName;if(e-a.startTime>c)cc.warnID(4933,h),a.onComplete(null,h),l.splice(i,1);else{var u=a.refWidth,_="40px "+h;r.font=_,u!==n.safeMeasureText(r,s,_)?(l.splice(i,1),a.onComplete(null,h)):t=!1}}t&&(clearInterval(o),o=-1)}var _={loadFont:function(t,e,i){var f=_._getFontFamily(t);if(a[f])return i(null,f);if(!r){var d=document.createElement("canvas");d.width=100,d.height=100,r=d.getContext("2d")}var p="40px "+f;r.font=p;var m=n.safeMeasureText(r,s,p),y=document.createElement("style");y.type="text/css";var v="";isNaN(f-0)?v+="@font-face { font-family:"+f+"; src:":v+="@font-face { font-family:'"+f+"'; src:",v+="url('"+t+"');",y.textContent=v+"}",document.body.appendChild(y);var g,b,A,x,C,T,S=document.createElement("div"),w=S.style;if(w.fontFamily=f,S.innerHTML=".",w.position="absolute",w.left="-100px",w.top="-100px",document.body.appendChild(S),h())g=Date.now(),b=f,A=i,x=new Promise(function(t,e){(function i(){Date.now()-g>=c?e():document.fonts.load("40px "+b).then((function(e){e.length>=1?t():setTimeout(i,100)}),(function(){e()}))})()}),C=null,T=new Promise(function(t,e){C=setTimeout(e,c)}),Promise.race([T,x]).then((function(){C&&(clearTimeout(C),C=null),A(null,b)}),(function(){cc.warnID(4933,b),A(null,b)}));else{var E={fontFamilyName:f,refWidth:m,onComplete:i,startTime:Date.now()};l.push(E),-1===o&&(o=setInterval(u,100))}a[f]=y},_getFontFamily:function(t){var e=t.lastIndexOf(".ttf");if(-1===e)return t;var i,n=t.lastIndexOf("/");return-1!==(i=-1===n?t.substring(0,e)+"_LABEL":t.substring(n+1,e)+"_LABEL").indexOf(" ")&&(i='"'+i+'"'),i}};e.exports=_}),{"../utils/text-utils":331}],92:[(function(t,e){"use strict";var i,n=t("./shared").bundles,r={decodeUuid:t("../utils/decode-uuid"),getUuidFromURL:(i=/.*[/\\][0-9a-fA-F]{2}[/\\]([0-9a-fA-F-]{8,})/,function(t){var e=t.match(i);return e?e[1]:""}),getUrlWithUuid:function(t,e){(e=e||Object.create(null)).__isNative__=e.isNative,e.ext=e.nativeExt;var i=n.find((function(e){return e.getAssetInfo(t)}));return i&&(e.bundle=i.name),cc.assetManager._transform(t,e)},isScene:function(t){return t&&(t.constructor===cc.SceneAsset||t instanceof cc.Scene)},normalize:function(t){return t&&(46===t.charCodeAt(0)&&47===t.charCodeAt(1)?t=t.slice(2):47===t.charCodeAt(0)&&(t=t.slice(1))),t}};e.exports=r}),{"../utils/decode-uuid":319,"./shared":101}],93:[(function(t){"use strict";t("./deprecated"),t("./CCAssetManager")}),{"./CCAssetManager":76,"./deprecated":82}],94:[(function(t,e){"use strict";var i=t("./pack-manager"),n=t("./pipeline"),r=t("./parser"),s=t("./utilities"),a=s.getDepends,o=s.cache,l=s.gatherAsset,c=s.setProperties,h=s.forEach,u=s.clear,_=s.checkCircleReference,f=t("./shared"),d=f.assets,p=f.files,m=f.parsed,y=f.pipeline,v=t("./task"),g=new n("loadOneAsset",[function(t,e){var n=t.output=t.input,r=n.options,s=n.isNative,a=n.uuid,o=n.file,l=r.reload;if(o||!l&&!s&&d.has(a))return e();i.load(n,t.options,(function(t,i){n.file=i,e(t)}))},function(t,e){var i=t.output=t.input,n=t.progress,s=t.options.__exclude__,a=i.id,o=i.file,l=i.options;if(i.isNative)r.parse(a,o,i.ext,l,(function(r,s){if(r)return e(r);i.content=s,n.canInvoke&&t.dispatch("progress",++n.finish,n.total,i),p.remove(a),m.remove(a),e()}));else{var c=i.uuid;if(c in s){var h=s[c],u=h.finish,f=h.content,y=h.err,v=h.callbacks;n.canInvoke&&t.dispatch("progress",++n.finish,n.total,i),u||_(c,c,s)?(f&&f.addRef&&f.addRef(),i.content=f,e(y)):v.push({done:e,item:i})}else if(!l.reload&&d.has(c)){var g=d.get(c);l.__asyncLoadAssets__||!g.__asyncLoadAssets__?(i.content=g.addRef(),n.canInvoke&&t.dispatch("progress",++n.finish,n.total,i),e()):b(t,g,e,!1)}else r.parse(a,o,"import",l,(function(i,n){if(i)return e(i);n._uuid=c,b(t,n,e,!0)}))}}]);function b(t,e,i,n){var r=t.input,s=t.progress,l=r.uuid,h=r.id,u=r.options,_=r.config,f=u.__asyncLoadAssets__,d=u.cacheAsset,g=[];e.addRef&&e.addRef(),a(l,e,Object.create(null),g,!1,f,_),s.canInvoke&&t.dispatch("progress",++s.finish,s.total+=g.length,r);var b=t.options.__exclude__[l]={content:e,finish:!1,callbacks:[{done:i,item:r}]},A=v.create({input:g,options:t.options,onProgress:t.onProgress,onError:v.prototype.recycle,progress:s,onComplete:function(t){if(e.decRef&&e.decRef(!1),e.__asyncLoadAssets__=f,b.finish=!0,b.err=t,!t){for(var i=Array.isArray(A.output)?A.output:[A.output],r=Object.create(null),s=0,a=i.length;sthis.pipes.length))return this.pipes.splice(e,0,t),this;cc.warnID(4921)},append:function(t){if("function"==typeof t)return this.pipes.push(t),this},remove:function(t){if("number"==typeof t)return this.pipes.splice(t,1),this},sync:function(t){var e=this.pipes;if(t instanceof i&&0!==e.length){null!=t.output&&(t.input=t.output,t.output=null),t._isFinish=!1;for(var n=0,r=e.length;n0&&u(t)>0)){r.remove(t._uuid);for(var n=i.getDeps(t._uuid),s=0,a=n.length;s