>>0)+2891336453,r=277803737*(s>>>(s>>>28)+4^s),n=(r>>>22^r)>>>0;return n/=f};t.exports=function(t,e){switch("number"==typeof t&&(t=[t]),e){case 2:return p(t,!0);case 1:return p(t);default:return c(t)}}},84854(t,e,i){var s=i(72958),r=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],n=Array(4),a=Array(4),o=Array(4),h=Array(4),l=Array(4),u=Array(4),d=function(t,e,i){var s,r,h,l,u=e.noiseMode||0,d=void 0===e.noiseSmoothing?1:e.noiseSmoothing,p=Math.max(1,Math.min(t.length,4)),g=e.noiseCells||[32,32,32,32].slice(0,p);for(s=0;s1&&(o[1]=Math.floor(l/3)%3-1,p>2&&(o[2]=Math.floor(l/9)%3-1,p>3&&(o[3]=Math.floor(l/27)%3-1))),r=c(p,n,o,e,i),h=f(p,o,a,r),u){case 0:h0||e[1]>0)for(j[0]=U.x,j[1]=z.x,j[2]=Y.x,q[0]=U.y,q[1]=z.y,q[2]=Y.y,e[0]>0&&(j[0]=(U.x%e[0]+e[0])%e[0],j[1]=(z.x%e[0]+e[0])%e[0],j[2]=(Y.x%e[0]+e[0])%e[0]),e[1]>0&&(q[0]=(U.y%e[1]+e[1])%e[1],q[1]=(z.y%e[1]+e[1])%e[1],q[2]=(Y.y%e[1]+e[1])%e[1]),s=0;s<3;s++)V[s]=Math.floor(j[s]+.5*q[s]+.5),H[s]=Math.floor(q[s]+.5);else V[0]=n.x,V[1]=B.x,V[2]=k.x,H[0]=n.y,H[1]=B.y,H[2]=k.y;for(V[0]+=a[0],V[1]+=a[0],V[2]+=a[0],H[0]+=a[1],H[1]+=a[1],H[2]+=a[1],s=0;s<3;s++)K[s]=V[s]%289,K[s]<0&&(K[s]+=289);for(s=0;s<3;s++)K[s]=((51*K[s]+2)*K[s]+H[s])%289;for(s=0;s<3;s++)K[s]=(34*K[s]+10)*K[s]%289;for(s=0;s<3;s++)Z[s]=.07482*K[s]+i,Q[s]=Math.cos(Z[s]),J[s]=Math.sin(Z[s]);for($.x=Q[0],$.y=J[0],tt.x=Q[1],tt.y=J[1],et.x=Q[2],et.y=J[2],it[0]=.8-I(X,X),it[1]=.8-I(W,W),it[2]=.8-I(G,G),s=0;s<3;s++)it[s]=Math.max(it[s],0),st[s]=it[s]*it[s],rt[s]=st[s]*st[s];return nt[0]=I($,X),nt[1]=I(tt,W),nt[2]=I(et,G),10.9*(rt[0]*nt[0]+rt[1]*nt[1]+rt[2]*nt[2])},B=[0,0,0],k=[0,0,0],U=[0,0,0],z=[0,0,0],Y=[0,0,0],X=[0,0,0],W=[0,0,0],G=[0,0,0],V=[0,0,0],H=[0,0,0],j=[0,0,0],q=[0,0,0],K=[0,0,0],Z=[0,0,0],Q=[0,0,0],J=[0,0,0],$=[0,0,0],tt=[0,0,0],et=[0,0,0],it=[0,0,0],st=[0,0,0,0],rt=[0,0,0,0],nt=[0,0,0,0],at=[0,0,0,0],ot=[0,0,0,0],ht=[0,0,0,0],lt=[0,0,0,0],ut=[0,0,0,0],dt=[0,0,0,0],ct=[0,0,0,0],ft=[0,0,0,0],pt=[0,0,0,0],gt=[0,0,0,0],mt=[0,0,0,0],vt=[0,0,0,0],yt=[0,0,0,0],xt=[0,0,0,0],Tt=[0,0,0,0],wt=[0,0,0,0],bt=[0,0,0,0],St=[0,0,0,0],Ct=[0,0,0,0],Et=[0,0,0,0],At=[0,0,0,0],_t=[0,0,0,0],Mt=[0,0,0,0],Rt=[0,0,0,0],Pt=[0,0,0,0],Ot=function(t,e){for(var i=0;i<4;i++){var s=t[i]%289;s<0&&(s+=289),e[i]=(34*s+10)*s%289}},Lt=function(t,e,i){var s=B,r=k,n=U,o=z,h=Y,l=X,u=W,d=G,c=V,f=H,p=j,g=q,m=K,v=Z,y=Q,x=J,T=$,w=tt,b=et,S=it,C=st,E=rt,A=nt,_=at,M=ot,R=ht,P=lt,O=ut,L=dt,D=ct,F=ft,I=pt,N=gt,Lt=mt,Dt=vt,Ft=yt,It=xt,Nt=Tt,Bt=wt,kt=bt,Ut=St,zt=Ct,Yt=Et,Xt=At,Wt=_t,Gt=Mt,Vt=Rt,Ht=Pt;s[0]=0*t[0]+1*t[1]+1*t[2],s[1]=1*t[0]+0*t[1]+1*t[2],s[2]=1*t[0]+1*t[1]+0*t[2];for(var jt=0;jt<3;jt++)r[jt]=Math.floor(s[jt]),n[jt]=s[jt]-r[jt];for(o[0]=n[0]>n[1]?0:1,o[1]=n[1]>n[2]?0:1,o[2]=n[0]>n[2]?0:1,h[0]=1-o[0],h[1]=1-o[1],h[2]=1-o[2],l[0]=h[2],l[1]=o[0],l[2]=o[1],u[0]=h[0],u[1]=h[1],u[2]=o[2],jt=0;jt<3;jt++)d[jt]=Math.min(l[jt],u[jt]),c[jt]=Math.max(l[jt],u[jt]);for(jt=0;jt<3;jt++)f[jt]=r[jt]+d[jt],p[jt]=r[jt]+c[jt],g[jt]=r[jt]+1;var qt=r[0],Kt=r[1],Zt=r[2],Qt=f[0],Jt=f[1],$t=f[2],te=p[0],ee=p[1],ie=p[2],se=g[0],re=g[1],ne=g[2];for(m[0]=-.5*qt+.5*Kt+.5*Zt,m[1]=.5*qt-.5*Kt+.5*Zt,m[2]=.5*qt+.5*Kt-.5*Zt,v[0]=-.5*Qt+.5*Jt+.5*$t,v[1]=.5*Qt-.5*Jt+.5*$t,v[2]=.5*Qt+.5*Jt-.5*$t,y[0]=-.5*te+.5*ee+.5*ie,y[1]=.5*te-.5*ee+.5*ie,y[2]=.5*te+.5*ee-.5*ie,x[0]=-.5*se+.5*re+.5*ne,x[1]=.5*se-.5*re+.5*ne,x[2]=.5*se+.5*re-.5*ne,jt=0;jt<3;jt++)T[jt]=t[jt]-m[jt],w[jt]=t[jt]-v[jt],b[jt]=t[jt]-y[jt],S[jt]=t[jt]-x[jt];if(e[0]>0||e[1]>0||e[2]>0){if(C[0]=m[0],C[1]=v[0],C[2]=y[0],C[3]=x[0],E[0]=m[1],E[1]=v[1],E[2]=y[1],E[3]=x[1],A[0]=m[2],A[1]=v[2],A[2]=y[2],A[3]=x[2],e[0]>0)for(jt=0;jt<4;jt++)C[jt]=(C[jt]%e[0]+e[0])%e[0];if(e[1]>0)for(jt=0;jt<4;jt++)E[jt]=(E[jt]%e[1]+e[1])%e[1];if(e[2]>0)for(jt=0;jt<4;jt++)A[jt]=(A[jt]%e[2]+e[2])%e[2];var ae=C[0],oe=E[0],he=A[0],le=C[1],ue=E[1],de=A[1],ce=C[2],fe=E[2],pe=A[2],ge=C[3],me=E[3],ve=A[3];r[0]=Math.floor(0*ae+1*oe+1*he+.5),r[1]=Math.floor(1*ae+0*oe+1*he+.5),r[2]=Math.floor(1*ae+1*oe+0*he+.5),f[0]=Math.floor(0*le+1*ue+1*de+.5),f[1]=Math.floor(1*le+0*ue+1*de+.5),f[2]=Math.floor(1*le+1*ue+0*de+.5),p[0]=Math.floor(0*ce+1*fe+1*pe+.5),p[1]=Math.floor(1*ce+0*fe+1*pe+.5),p[2]=Math.floor(1*ce+1*fe+0*pe+.5),g[0]=Math.floor(0*ge+1*me+1*ve+.5),g[1]=Math.floor(1*ge+0*me+1*ve+.5),g[2]=Math.floor(1*ge+1*me+0*ve+.5)}r[0]+=a[0],r[1]+=a[1],r[2]+=a[2],f[0]+=a[0],f[1]+=a[1],f[2]+=a[2],p[0]+=a[0],p[1]+=a[1],p[2]+=a[2],g[0]+=a[0],g[1]+=a[1],g[2]+=a[2];var ye=st,xe=rt;for(ye[0]=r[2],ye[1]=f[2],ye[2]=p[2],ye[3]=g[2],Ot(ye,xe),xe[0]+=r[1],xe[1]+=f[1],xe[2]+=p[1],xe[3]+=g[1],Ot(xe,ye),ye[0]+=r[0],ye[1]+=f[0],ye[2]+=p[0],ye[3]+=g[0],Ot(ye,_),jt=0;jt<4;jt++)M[jt]=3.883222077*_[jt],R[jt]=.996539792-.006920415*_[jt],P[jt]=.108705628*_[jt],O[jt]=Math.cos(M[jt]),L[jt]=Math.sin(M[jt]),D[jt]=Math.sqrt(Math.max(0,1-R[jt]*R[jt]));if(0!==i)for(jt=0;jt<4;jt++)Lt[jt]=O[jt]*D[jt],Dt[jt]=L[jt]*D[jt],Ft[jt]=R[jt],It[jt]=Math.sin(P[jt]),Nt[jt]=Math.cos(P[jt]),Bt[jt]=L[jt]*It[jt]-O[jt]*Nt[jt],kt[jt]=(1-R[jt])*(Bt[jt]*L[jt])+R[jt]*It[jt],Ut[jt]=(1-R[jt])*(-Bt[jt]*O[jt])+R[jt]*Nt[jt],zt[jt]=-(Dt[jt]*Nt[jt]+Lt[jt]*It[jt]),Yt[jt]=Math.sin(i),Xt[jt]=Math.cos(i),F[jt]=Xt[jt]*Lt[jt]+Yt[jt]*kt[jt],I[jt]=Xt[jt]*Dt[jt]+Yt[jt]*Ut[jt],N[jt]=Xt[jt]*Ft[jt]+Yt[jt]*zt[jt];else for(jt=0;jt<4;jt++)F[jt]=O[jt]*D[jt],I[jt]=L[jt]*D[jt],N[jt]=R[jt];for(jt=0;jt<4;jt++){var Te=0===jt?T[0]:1===jt?w[0]:2===jt?b[0]:S[0],we=0===jt?T[1]:1===jt?w[1]:2===jt?b[1]:S[1],be=0===jt?T[2]:1===jt?w[2]:2===jt?b[2]:S[2],Se=Te*Te+we*we+be*be;Wt[jt]=.5-Se,Wt[jt]<0&&(Wt[jt]=0),Gt[jt]=Wt[jt]*Wt[jt],Vt[jt]=Gt[jt]*Wt[jt]}for(jt=0;jt<4;jt++){var Ce=F[jt],Ee=I[jt],Ae=N[jt],_e=0===jt?T[0]:1===jt?w[0]:2===jt?b[0]:S[0],Me=0===jt?T[1]:1===jt?w[1]:2===jt?b[1]:S[1],Re=0===jt?T[2]:1===jt?w[2]:2===jt?b[2]:S[2];Ht[jt]=Ce*_e+Ee*Me+Ae*Re}var Pe=0;for(jt=0;jt<4;jt++)Pe+=Vt[jt]*Ht[jt];return 39.5*Pe};t.exports=function(t,s){"number"==typeof t&&(t=[t]),s||(s={});for(var h=Math.min(3,t.length);h<2;)t.push(0),h++;var l=s.noiseIterations||1,u=s.noiseWarpIterations||1,d=s.noiseDetailPower||2,c=s.noiseFlowPower||2,f=s.noiseContributionPower||2,p=s.noiseWarpDetailPower||2,g=s.noiseWarpFlowPower||2,m=s.noiseWarpContributionPower||2,v=s.noiseCells||[32,32,32],y=s.noiseOffset||[0,0,0],x=s.noiseWarpAmount||0;if(s.noiseSeed)for(var T=[1,2,3],w=0;w0&&u>0&&h>=2)if(2===h){var b=o(u,2,e,s,p,g,m);i[0]=e[0]+r[0],i[1]=e[1]+r[1];var S=o(u,2,i,s,p,g,m);e[0]+=b*x,e[1]+=S*x}else if(3===h){var C=o(u,3,e,s,p,g,m);i[0]=e[0]+r[0],i[1]=e[1]+r[1],i[2]=e[2]+r[2];var E=o(u,3,i,s,p,g,m);i[0]=e[0]+n[0],i[1]=e[1]+n[1],i[2]=e[2]+n[2];var A=o(u,3,i,s,p,g,m);e[0]+=C*x,e[1]+=E*x,e[2]+=A*x}return o(l,h,e,s,d,c,f)}},78702(t){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},94883(t){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},28915(t){t.exports=function(t,e,i){return(e-t)*i+t}},94908(t){t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},94434(t,e,i){var s=new(i(83419))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,d=-l*r+a*o,c=h*r-n*o,f=e*u+i*d+s*c;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*n)*f,t[3]=d*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*r)*f,t[6]=c*f,t[7]=(-h*e+i*o)*f,t[8]=(n*e-i*r)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=n*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*n,t[3]=a*o-r*l,t[4]=e*l-s*o,t[5]=s*r-e*a,t[6]=r*h-n*o,t[7]=i*o-e*h,t[8]=e*n-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*n-a*h)+i*(-l*r+a*o)+s*(h*r-n*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=t.val,c=d[0],f=d[1],p=d[2],g=d[3],m=d[4],v=d[5],y=d[6],x=d[7],T=d[8];return e[0]=c*i+f*n+p*h,e[1]=c*s+f*a+p*l,e[2]=c*r+f*o+p*u,e[3]=g*i+m*n+v*h,e[4]=g*s+m*a+v*l,e[5]=g*r+m*o+v*u,e[6]=y*i+x*n+T*h,e[7]=y*s+x*a+T*l,e[8]=y*r+x*o+T*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*n,e[1]=l*s+h*a,e[2]=l*r+h*o,e[3]=l*n-h*i,e[4]=l*a-h*s,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,r=t.w,n=e+e,a=i+i,o=s+s,h=e*n,l=e*a,u=e*o,d=i*a,c=i*o,f=s*o,p=r*n,g=r*a,m=r*o,v=this.val;return v[0]=1-(d+f),v[3]=l+m,v[6]=u-g,v[1]=l-m,v[4]=1-(h+f),v[7]=c+p,v[2]=u+g,v[5]=c-p,v[8]=1-(h+d),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],r=e[1],n=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],d=e[8],c=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=s*h-r*o,T=s*l-n*o,w=s*u-a*o,b=r*l-n*h,S=r*u-a*h,C=n*u-a*l,E=d*m-c*g,A=d*v-f*g,_=d*y-p*g,M=c*v-f*m,R=c*y-p*m,P=f*y-p*v,O=x*P-T*R+w*M+b*_-S*A+C*E;return O?(O=1/O,i[0]=(h*P-l*R+u*M)*O,i[1]=(l*_-o*P-u*A)*O,i[2]=(o*R-h*_+u*E)*O,i[3]=(n*R-r*P-a*M)*O,i[4]=(s*P-n*_+a*A)*O,i[5]=(r*_-s*R-a*E)*O,i[6]=(m*C-v*S+y*b)*O,i[7]=(v*w-g*C-y*T)*O,i[8]=(g*S-m*w+y*x)*O,this):null}});t.exports=s},37867(t,e,i){var s=i(83419),r=i(25836),n=1e-6,a=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new a(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,r,n,a,o,h,l,u,d,c,f,p,g){var m=this.val;return m[0]=t,m[1]=e,m[2]=i,m[3]=s,m[4]=r,m[5]=n,m[6]=a,m[7]=o,m[8]=h,m[9]=l,m[10]=u,m[11]=d,m[12]=c,m[13]=f,m[14]=p,m[15]=g,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=o.fromQuat(i).val,r=e.x,n=e.y,a=e.z;return this.setValues(s[0]*r,s[1]*r,s[2]*r,0,s[4]*n,s[5]*n,s[6]*n,0,s[8]*a,s[9]*a,s[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],r=t[6],n=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=s,t[13]=n,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15],v=e*a-i*n,y=e*o-s*n,x=e*h-r*n,T=i*o-s*a,w=i*h-r*a,b=s*h-r*o,S=l*p-u*f,C=l*g-d*f,E=l*m-c*f,A=u*g-d*p,_=u*m-c*p,M=d*m-c*g,R=v*M-y*_+x*A+T*E-w*C+b*S;return R?(R=1/R,this.setValues((a*M-o*_+h*A)*R,(s*_-i*M-r*A)*R,(p*b-g*w+m*T)*R,(d*w-u*b-c*T)*R,(o*E-n*M-h*C)*R,(e*M-s*E+r*C)*R,(g*x-f*b-m*y)*R,(l*b-d*x+c*y)*R,(n*_-a*E+h*S)*R,(i*E-e*_-r*S)*R,(f*w-p*x+m*v)*R,(u*x-l*w-c*v)*R,(a*C-n*A-o*S)*R,(e*A-i*C+s*S)*R,(p*y-f*T-g*v)*R,(l*T-u*y+d*v)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return this.setValues(a*(d*m-c*g)-u*(o*m-h*g)+p*(o*c-h*d),-(i*(d*m-c*g)-u*(s*m-r*g)+p*(s*c-r*d)),i*(o*m-h*g)-a*(s*m-r*g)+p*(s*h-r*o),-(i*(o*c-h*d)-a*(s*c-r*d)+u*(s*h-r*o)),-(n*(d*m-c*g)-l*(o*m-h*g)+f*(o*c-h*d)),e*(d*m-c*g)-l*(s*m-r*g)+f*(s*c-r*d),-(e*(o*m-h*g)-n*(s*m-r*g)+f*(s*h-r*o)),e*(o*c-h*d)-n*(s*c-r*d)+l*(s*h-r*o),n*(u*m-c*p)-l*(a*m-h*p)+f*(a*c-h*u),-(e*(u*m-c*p)-l*(i*m-r*p)+f*(i*c-r*u)),e*(a*m-h*p)-n*(i*m-r*p)+f*(i*h-r*a),-(e*(a*c-h*u)-n*(i*c-r*u)+l*(i*h-r*a)),-(n*(u*g-d*p)-l*(a*g-o*p)+f*(a*d-o*u)),e*(u*g-d*p)-l*(i*g-s*p)+f*(i*d-s*u),-(e*(a*g-o*p)-n*(i*g-s*p)+f*(i*o-s*a)),e*(a*d-o*u)-n*(i*d-s*u)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],d=t[10],c=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return(e*a-i*n)*(d*m-c*g)-(e*o-s*n)*(u*m-c*p)+(e*h-r*n)*(u*g-d*p)+(i*o-s*a)*(l*m-c*f)-(i*h-r*a)*(l*g-d*f)+(s*h-r*o)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],r=e[2],n=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],d=e[9],c=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*a+w*u+b*p,e[1]=x*s+T*o+w*d+b*g,e[2]=x*r+T*h+w*c+b*m,e[3]=x*n+T*l+w*f+b*v,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*a+w*u+b*p,e[5]=x*s+T*o+w*d+b*g,e[6]=x*r+T*h+w*c+b*m,e[7]=x*n+T*l+w*f+b*v,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*a+w*u+b*p,e[9]=x*s+T*o+w*d+b*g,e[10]=x*r+T*h+w*c+b*m,e[11]=x*n+T*l+w*f+b*v,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*a+w*u+b*p,e[13]=x*s+T*o+w*d+b*g,e[14]=x*r+T*h+w*c+b*m,e[15]=x*n+T*l+w*f+b*v,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,r=i[0],n=i[4],a=i[8],o=i[12],h=i[1],l=i[5],u=i[9],d=i[13],c=i[2],f=i[6],p=i[10],g=i[14],m=i[3],v=i[7],y=i[11],x=i[15],T=s[0],w=s[4],b=s[8],S=s[12],C=s[1],E=s[5],A=s[9],_=s[13],M=s[2],R=s[6],P=s[10],O=s[14],L=s[3],D=s[7],F=s[11],I=s[15];return this.setValues(r*T+n*C+a*M+o*L,h*T+l*C+u*M+d*L,c*T+f*C+p*M+g*L,m*T+v*C+y*M+x*L,r*w+n*E+a*R+o*D,h*w+l*E+u*R+d*D,c*w+f*E+p*R+g*D,m*w+v*E+y*R+x*D,r*b+n*A+a*P+o*F,h*b+l*A+u*P+d*F,c*b+f*A+p*P+g*F,m*b+v*A+y*P+x*F,r*S+n*_+a*O+o*I,h*S+l*_+u*O+d*I,c*S+f*_+p*O+g*I,m*S+v*_+y*O+x*I)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),r=1-i,n=t.x,a=t.y,o=t.z,h=r*n,l=r*a;return this.setValues(h*n+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*n,0,h*o-s*a,l*o+s*n,r*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,r=e.y,a=e.z,o=Math.sqrt(s*s+r*r+a*a);if(Math.abs(o)1?void 0!==s?(r=(s-t)/(s-i))<0&&(r=0):r=1:r<0&&(r=0),r}},15746(t,e,i){var s=i(83419),r=i(94434),n=i(29747),a=i(25836),o=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new a(1,0,0),d=new a(0,1,0),c=new a,f=new r,p=new s({initialize:function(t,e,i,s){this.onChangeCallback=n,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=s*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),r+e*(t.z-r),n+e*(t.w-n))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(c.copy(u).cross(t).length().999999?this.set(0,0,0,1):(c.copy(t).cross(e),this._x=c.x,this._y=c.y,this._z=c.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=f.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+r*n+i*o-s*a,i*h+r*a+s*n-e*o,s*h+r*o+e*a-i*n,r*h-e*n-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,r=this.z,n=this.w,a=t.x,h=t.y,l=t.z,u=t.w,d=i*a+s*h+r*l+n*u;d<0&&(d=-d,a=-a,h=-h,l=-l,u=-u);var c=1-e,f=e;if(1-d>o){var p=Math.acos(d),g=Math.sin(p);c=Math.sin((1-e)*p)/g,f=Math.sin(e*p)/g}return this.set(c*i+f*a,c*s+f*h,c*r+f*l,c*n+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s,n=r?1/r:0;return this.set(-t*n,-e*n,-i*n,s*n)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+r*n,i*a+s*n,s*a-i*n,r*a-e*n)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*n,i*a+r*n,s*a+e*n,r*a-i*n)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,r=this.w,n=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*n,i*a-e*n,s*a+r*n,r*a-s*n)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,r=t.z/2,n=Math.cos(i),a=Math.cos(s),o=Math.cos(r),h=Math.sin(i),l=Math.sin(s),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"YXZ":this.set(h*a*o+n*l*u,n*l*o-h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"ZXY":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u+h*l*o,n*a*o-h*l*u,e);break;case"ZYX":this.set(h*a*o-n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o+h*l*u,e);break;case"YZX":this.set(h*a*o+n*l*u,n*l*o+h*a*u,n*a*u-h*l*o,n*a*o-h*l*u,e);break;case"XZY":this.set(h*a*o-n*l*u,n*l*o-h*a*u,n*a*u+h*l*o,n*a*o+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],r=i[4],n=i[8],a=i[1],o=i[5],h=i[9],l=i[2],u=i[6],d=i[10],c=s+o+d;return c>0?(e=.5/Math.sqrt(c+1),this.set((u-h)*e,(n-l)*e,(a-r)*e,.25/e)):s>o&&s>d?(e=2*Math.sqrt(1+s-o-d),this.set(.25*e,(r+a)/e,(n+l)/e,(u-h)/e)):o>d?(e=2*Math.sqrt(1+o-s-d),this.set((r+a)/e,.25*e,(h+u)/e,(n-l)/e)):(e=2*Math.sqrt(1+d-s-o),this.set((n+l)/e,(h+u)/e,.25*e,(a-r)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var n=h[r],a=h[n];e=Math.sqrt(i[3*r+r]-i[3*n+n]-i[3*a+a]+1),l[r]=.5*e,e=.5/e,l[n]=(i[3*n+r]+i[3*r+n])*e,l[a]=(i[3*a+r]+i[3*r+a])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*a+n]-i[3*n+a])*e}return this.onChangeCallback(this),this}});t.exports=p},43396(t,e,i){var s=i(36383);t.exports=function(t){return t*s.RAD_TO_DEG}},74362(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},60706(t){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,r=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=s*e,t}},67421(t){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},36305(t){t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},11520(t){t.exports=function(t,e,i,s){var r=Math.cos(s),n=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*r-o*n+e,t.y=a*n+o*r+i,t}},1163(t){t.exports=function(t,e,i,s,r){var n=s+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},70336(t){t.exports=function(t,e,i,s,r){return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},72678(t,e,i){var s=i(25836),r=i(37867),n=i(15746),a=new r,o=new n,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},2284(t){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},41013(t){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},7602(t){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},54261(t){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},44408(t,e,i){var s=i(26099);t.exports=function(t,e,i,r){void 0===r&&(r=new s);var n=0,a=0;return t>0&&t<=e*i&&(n=t>e-1?t-(a=Math.floor(t/e))*e:t),r.set(n,a)}},85955(t,e,i){var s=i(26099);t.exports=function(t,e,i,r,n,a,o,h){void 0===h&&(h=new s);var l=Math.sin(n),u=Math.cos(n),d=u*a,c=l*a,f=-l*o,p=u*o,g=1/(d*p+f*-c);return h.x=p*g*t+-f*g*e+(r*f-i*p)*g,h.y=d*g*e+-c*g*t+(-r*d+i*c)*g,h}},26099(t,e,i){var s=i(83419),r=i(43855),n=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new n(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},invert:function(){return this.set(this.y,this.x)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)},projectUnit:function(t,e){void 0===e&&(e=new n);var i=this.x*t.x+this.y*t.y;return 0!==i&&(e.x=i*t.x,e.y=i*t.y),e}});n.ZERO=new n,n.RIGHT=new n(1,0),n.LEFT=new n(-1,0),n.UP=new n(0,-1),n.DOWN=new n(0,1),n.ONE=new n(1,1),t.exports=n},25836(t,e,i){var s=new(i(83419))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,r=t.z,n=e.x,a=e.y,o=e.z;return this.x=s*o-r*a,this.y=r*n-i*o,this.z=i*a-s*n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z;return this.x=i*a-s*n,this.y=s*r-e*a,this.z=e*n-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*n,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*n,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*n,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+s*r[6],this.y=e*r[1]+i*r[4]+s*r[7],this.z=e*r[2]+i*r[5]+s*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12],this.y=r[1]*e+r[5]*i+r[9]*s+r[13],this.z=r[2]*e+r[6]*i+r[10]*s+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=e*r[0]+i*r[4]+s*r[8]+r[12],a=e*r[1]+i*r[5]+s*r[9]+r[13],o=e*r[2]+i*r[6]+s*r[10]+r[14],h=e*r[3]+i*r[7]+s*r[11]+r[15];return this.x=n/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,u=o*s+r*i-n*e,d=-r*e-n*i-a*s;return this.x=h*o+d*-r+l*-a-u*-n,this.y=l*o+d*-n+u*-r-h*-a,this.z=u*o+d*-a+h*-n-l*-r,this},project:function(t){var e=this.x,i=this.y,s=this.z,r=t.val,n=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],d=r[6],c=r[7],f=r[8],p=r[9],g=r[10],m=r[11],v=r[12],y=r[13],x=r[14],T=1/(e*h+i*c+s*m+r[15]);return this.x=(e*n+i*l+s*f+v)*T,this.y=(e*a+i*u+s*p+y)*T,this.z=(e*o+i*d+s*g+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,r=t.z,n=t.w,a=this.x-i,o=n-this.y-1-s,h=this.z;return this.x=2*a/r-1,this.y=2*o/n-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},61369(t,e,i){var s=new(i(83419))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,r=t*t+e*e+i*i+s*s;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=s*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,r=this.z,n=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=r+e*(t.z-r),this.w=n+e*(t.w-n),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+s*s+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,r=this.w,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12]*r,this.y=n[1]*e+n[5]*i+n[9]*s+n[13]*r,this.z=n[2]*e+n[6]*i+n[10]*s+n[14]*r,this.w=n[3]*e+n[7]*i+n[11]*s+n[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=o*e+n*s-a*i,l=o*i+a*e-r*s,u=o*s+r*i-n*e,d=-r*e-n*i-a*s;return this.x=h*o+d*-r+l*-a-u*-n,this.y=l*o+d*-n+u*-r-h*-a,this.z=u*o+d*-a+h*-n-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},60417(t){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},15994(t){t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},31040(t){t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},55495(t){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},128(t){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},41273(t){t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},1432(t,e,i){var s=i(36383);t.exports=function(t){return t>Math.PI&&(t-=s.TAU),Math.abs(((t+s.PI_OVER_2)%s.TAU-s.TAU)%s.TAU)}},49127(t,e,i){var s=i(12407);t.exports=function(t,e){return s(e-t)}},52285(t,e,i){var s=i(36383),r=i(12407),n=s.TAU;t.exports=function(t,e){var i=r(e-t);return i>0&&(i-=n),i}},67317(t,e,i){var s=i(86554);t.exports=function(t,e){return s(e-t)}},12407(t){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},53993(t,e,i){var s=i(99472);t.exports=function(){return s(-Math.PI,Math.PI)}},86564(t,e,i){var s=i(99472);t.exports=function(){return s(-180,180)}},90154(t,e,i){var s=i(12407);t.exports=function(t){return s(t+Math.PI)}},48736(t,e,i){var s=i(36383);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.TAU-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e=1?1:1/e*(1+(e*t|0))}},49752(t,e,i){t.exports=i(72251)},75698(t){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},43855(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)e-i}},94977(t){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t1?t[i]-(s(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(r-n,t[n?n-1:0],t[n],t[i1?s(t[i],t[i-1],i-r):s(t[n],t[n+1>i?i:n+1],r-n)}},32112(t){t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},47235(t,e,i){var s=i(7602);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},50178(t,e,i){var s=i(54261);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},38289(t,e,i){t.exports={Bezier:i(89318),CatmullRom:i(77259),CubicBezier:i(36316),Linear:i(28392),QuadraticBezier:i(32112),SmoothStep:i(47235),SmootherStep:i(50178)}},98439(t){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<0&&!(t&t-1)&&e>0&&!(e&e-1)}},81230(t){t.exports=function(t){return t>0&&!(t&t-1)}},49001(t,e,i){t.exports={GetNext:i(98439),IsSize:i(50030),IsValue:i(81230)}},28453(t,e,i){var s=new(i(83419))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},63448(t){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},56583(t){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},77720(t){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},73697(t,e,i){t.exports={Ceil:i(63448),Floor:i(56583),To:i(77720)}},85454(t,e,i){i(63595);var s=i(8054),r=i(79291),n={Actions:i(61061),Animations:i(60421),BlendModes:i(10312),Cache:i(83388),Cameras:i(26638),Core:i(42857),Class:i(83419),Curves:i(25410),Data:i(44965),Display:i(27460),DOM:i(84902),Events:i(93055),Filters:i(11889),Game:i(50127),GameObjects:i(77856),Geom:i(55738),Input:i(14350),Loader:i(57777),Math:i(75508),Physics:i(44563),Plugins:i(18922),Renderer:i(36909),Scale:i(93364),ScaleModes:i(29795),Scene:i(97482),Scenes:i(62194),Structs:i(41392),Textures:i(27458),Tilemaps:i(62501),Time:i(90291),TintModes:i(84322),Tweens:i(43066),Utils:i(91799)};n.Sound=i(23717),n=r(!1,n,s),t.exports=n,i.g.Phaser=n},71289(t,e,i){var s=i(83419),r=i(92209),n=i(88571),a=new s({Extends:n,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Collision,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.body=null}});t.exports=a},86689(t,e,i){var s=i(83419),r=i(39506),n=i(20339),a=i(89774),o=i(66022),h=i(95540),l=i(46975),u=i(72441),d=i(47956),c=i(37277),f=i(44594),p=i(26099),g=i(82248),m=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new g(this.scene,this.config),this.add=new o(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new g(this.scene,this.config),this.add=new o(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,s,r,!0)},collide:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,s,r,!1)},collideTiles:function(t,e,i,s,r){return this.world.collideTiles(t,e,i,s,r)},overlapTiles:function(t,e,i,s,r){return this.world.overlapTiles(t,e,i,s,r)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,r,n){void 0===s&&(s=60);var a=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(a,s),void 0!==r&&void 0!==n&&t.body.maxVelocity.set(r,n),a},accelerateToObject:function(t,e,i,s,r){return this.accelerateTo(t,e.x,e.y,i,s,r)},closest:function(t,e){e||(e=Array.from(this.world.bodies));for(var i=Number.MAX_VALUE,s=null,r=t.x,n=t.y,o=e.length,h=0;hi&&(s=l,i=d)}}return s},moveTo:function(t,e,i,s,r){void 0===s&&(s=60),void 0===r&&(r=0);var a=Math.atan2(i-t.y,e-t.x);return r>0&&(s=n(t.x,t.y,e,i)/(r/1e3)),t.body.velocity.setToPolar(a,s),a},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(r(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,r,n){return d(this.world,t,e,i,s,r,n)},overlapCirc:function(t,e,i,s,r){return u(this.world,t,e,i,s,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",m,"arcadePhysics"),t.exports=m},13759(t,e,i){var s=i(83419),r=i(92209),n=i(68287),a=new s({Extends:n,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Collision,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,s,r){n.call(this,t,e,i,s,r),this.body=null}});t.exports=a},37742(t,e,i){var s=i(83419),r=i(78389),n=i(37747),a=i(63012),o=i(43396),h=i(87841),l=i(37303),u=i(95829),d=i(26099),c=new s({Mixins:[r],initialize:function(t,e){var i=64,s=64,r=void 0!==e;r&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),r||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=r?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new d,this.position=new d(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new d(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new d,this.newVelocity=new d,this.deltaMax=new d,this.acceleration=new d,this.allowDrag=!0,this.drag=new d,this.allowGravity=!0,this.gravity=new d,this.bounce=new d,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new d(1e4,1e4),this.maxSpeed=-1,this.friction=new d(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=n.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new d(1,1),this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=u(!1),this.touching=u(!0),this.wasTouching=u(!0),this.blocked=u(!0),this.syncBounds=!1,this.physicsType=n.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new h,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var r=t.getBounds(this._bounds);this.width=r.width,this.height=r.height,s=!0}else{var n=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===n&&this._sy===a||(this.width=this.sourceWidth*n,this.height=this.sourceHeight*a,this._sx=n,this._sy=a,s=!0)}s&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?u(!0,e):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),u(!0,i),u(!0,s),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){if(t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var i=this.position;this.prev.x=i.x,this.prev.y=i.y,this.prevFrame.x=i.x,this.prevFrame.y=i.y}t&&this.update(e)},update:function(t){var e=this.prev,i=this.position,s=this.velocity;if(e.set(i.x,i.y),!this.moves)return this._dx=i.x-e.x,void(this._dy=i.y-e.y);if(this.directControl){var r=this.autoFrame;s.set((i.x-r.x)/t,(i.y-r.y)/t),this.world.updateMotion(this,t),this._dx=i.x-r.x,this._dy=i.y-r.y}else this.world.updateMotion(this,t),this.newVelocity.set(s.x*t,s.y*t),i.add(this.newVelocity),this._dx=i.x-e.x,this._dy=i.y-e.y;var n=s.x,o=s.y;if(this.updateCenter(),this.angle=Math.atan2(o,n),this.speed=Math.sqrt(n*n+o*o),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var h=this.blocked;this.world.emit(a.WORLD_BOUNDS,this,h.up,h.down,h.left,h.right)}},postUpdate:function(){var t=this.position,e=t.x-this.prevFrame.x,i=t.y-this.prevFrame.y,s=this.gameObject;if(this.moves){var r=this.deltaMax.x,a=this.deltaMax.y;0!==r&&0!==e&&(e<0&&e<-r?e=-r:e>0&&e>r&&(e=r)),0!==a&&0!==i&&(i<0&&i<-a?i=-a:i>0&&i>a&&(i=a)),s&&(s.x+=e,s.y+=i)}e<0?this.facing=n.FACING_LEFT:e>0&&(this.facing=n.FACING_RIGHT),i<0?this.facing=n.FACING_UP:i>0&&(this.facing=n.FACING_DOWN),this.allowRotation&&s&&(s.angle+=this.deltaZ()),this._tx=e,this._ty=i,this.autoFrame.set(t.x,t.y)},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.velocity,i=this.blocked,s=this.customBoundsRectangle,r=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,a=this.worldBounce?-this.worldBounce.y:-this.bounce.y,o=!1;return t.xs.right&&r.right&&(t.x=s.right-this.width,e.x*=n,i.right=!0,o=!0),t.ys.bottom&&r.down&&(t.y=s.bottom-this.height,e.y*=a,i.down=!0,o=!0),o&&(this.blocked.none=!1,this.updateCenter()),o},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){if(void 0===e&&(e=!0),!t||!t.hasTransformComponent)return this;var i=this.world;return this.gameObject&&this.gameObject.body&&(i.disable(this.gameObject),this.gameObject.body=null),t.body&&i.disable(t),this.gameObject=t,t.body=this,this.setSize(),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&s&&s.getCenter){var r=(s.width-t)/2,n=(s.height-e)/2;this.offset.set(r,n)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var s=this.position;i&&i.getTopLeft?i.getTopLeft(s):s.set(t,e),this.prev.copy(s),this.prevFrame.copy(s),this.autoFrame.copy(s),i&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(t){return void 0===t&&(t=!0),this.directControl=t,this},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var r=void 0!==e,n=void 0!==i;return(r||n)&&(this.worldBounce||(this.worldBounce=new d),r&&(this.worldBounce.x=e),n&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setSlideFactor:function(t,e){return this.slideFactor.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e*this.slideFactor.x);var r=this.blocked;i&&(r.left=!0,r.none=!1),s&&(r.right=!0,r.none=!1)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e*this.slideFactor.y);var r=this.blocked;i&&(r.up=!0,r.none=!1),s&&(r.down=!0,r.none=!1)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},79342(t,e,i){var s=new(i(83419))({initialize:function(t,e,i,s,r,n,a){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=r,this.processCallback=n,this.callbackContext=a},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=s},66022(t,e,i){var s=i(71289),r=i(13759),n=i(37742),a=i(83419),o=i(37747),h=i(60758),l=i(72624),u=i(71464),d=new a({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,r){return this.world.addCollider(t,e,i,s,r)},overlap:function(t,e,i,s,r){return this.world.addOverlap(t,e,i,s,r)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},image:function(t,e,i,r){var n=new s(this.scene,t,e,i,r);return this.sys.displayList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticSprite:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.STATIC_BODY),n},sprite:function(t,e,i,s){var n=new r(this.scene,t,e,i,s);return this.sys.displayList.add(n),this.sys.updateList.add(n),this.world.enableBody(n,o.DYNAMIC_BODY),n},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,s){var r=new n(this.world);return r.position.set(t,e),i&&s&&r.setSize(i,s),this.world.add(r,o.DYNAMIC_BODY),r},staticBody:function(t,e,i,s){var r=new l(this.world);return r.position.set(t,e),i&&s&&r.setSize(i,s),this.world.add(r,o.STATIC_BODY),r},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=d},79599(t){t.exports=function(t){var e=0;if(Array.isArray(t))for(var i=0;ie._dx?(n=t.right-e.x)>a&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?n=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxa&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?n=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=n,e.overlapX=n,n}},45170(t,e,i){var s=i(37747);t.exports=function(t,e,i,r){var n=0,a=t.deltaAbsY()+e.deltaAbsY()+r;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(n=t.bottom-e.y)>a&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?n=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dya&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?n=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=n,e.overlapY=n,n}},60758(t,e,i){var s=i(13759),r=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new r({Extends:h,Mixins:[n],initialize:function(t,e,i,r){if(i||r)if(l(i))r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&l(i[0])){var n=this;i.forEach(function(t){t.internalCreateCallback=n.createCallbackHandler,t.internalRemoveCallback=n.removeCallbackHandler,t.classType=o(t,"classType",s)}),r=null}else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,r&&(r.classType=o(r,"classType",s)),this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=2147483647,this.defaults={setCollideWorldBounds:o(r,"collideWorldBounds",!1),setBoundsRectangle:o(r,"customBoundsRectangle",null),setAccelerationX:o(r,"accelerationX",0),setAccelerationY:o(r,"accelerationY",0),setAllowDrag:o(r,"allowDrag",!0),setAllowGravity:o(r,"allowGravity",!0),setAllowRotation:o(r,"allowRotation",!0),setDamping:o(r,"useDamping",!1),setBounceX:o(r,"bounceX",0),setBounceY:o(r,"bounceY",0),setDragX:o(r,"dragX",0),setDragY:o(r,"dragY",0),setEnable:o(r,"enable",!0),setGravityX:o(r,"gravityX",0),setGravityY:o(r,"gravityY",0),setFrictionX:o(r,"frictionX",0),setFrictionY:o(r,"frictionY",0),setMaxSpeed:o(r,"maxSpeed",-1),setMaxVelocityX:o(r,"maxVelocityX",1e4),setMaxVelocityY:o(r,"maxVelocityY",1e4),setVelocityX:o(r,"velocityX",0),setVelocityY:o(r,"velocityY",0),setAngularVelocity:o(r,"angularVelocity",0),setAngularAcceleration:o(r,"angularAcceleration",0),setAngularDrag:o(r,"angularDrag",0),setMass:o(r,"mass",1),setImmovable:o(r,"immovable",!1)},h.call(this,e,i,r),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.DYNAMIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.DYNAMIC_BODY));var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),r=0;r0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(r+o);return o-=h,n=h+(r-=h)*e.bounce.x,a=h+o*i.bounce.x,l&&m?x(0):c&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.x,T=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,d=0===e._dx,g=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),o=T-x*e.bounce.x,r=i.pushable,c=i._dx<0,f=i._dx>0,p=0===i._dx,m=!g,h=x-T*i.bounce.x,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.x=0:g?i.processX(v,h,!0):i.processX(-v,h,!1,!0),e.moves){var s=e.directControl?e.y-e.autoFrame.y:e.y-e.prev.y;i.y+=s*e.friction.y,i._dy=i.y-i.prev.y}},RunImmovableBody2:function(t){if(2===t?e.velocity.x=0:m?e.processX(v,o,!0):e.processX(-v,o,!1,!0),i.moves){var s=i.directControl?i.y-i.autoFrame.y:i.y-i.prev.y;e.y+=s*i.friction.y,e._dy=e.y-e.prev.y}}}},47962(t){var e,i,s,r,n,a,o,h,l,u,d,c,f,p,g,m,v,y=function(){return u&&g&&i.blocked.down?(e.processY(-v,o,!1,!0),1):l&&m&&i.blocked.up?(e.processY(v,o,!0),1):f&&m&&e.blocked.down?(i.processY(-v,h,!1,!0),2):c&&g&&e.blocked.up?(i.processY(v,h,!0),2):0},x=function(t){if(s&&r)v*=.5,0===t||3===t?(e.processY(v,n),i.processY(-v,a)):(e.processY(-v,n),i.processY(v,a));else if(s&&!r)0===t||3===t?e.processY(v,o,!0):e.processY(-v,o,!1,!0);else if(!s&&r)0===t||3===t?i.processY(-v,h,!1,!0):i.processY(v,h,!0);else{var g=.5*v;0===t?p?(e.processY(v,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)):1===t?d?(e.processY(0,null,!1,!0),i.processY(v,0,!0)):u?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,null,!1,!0),i.processY(g,e.velocity.y,!0)):2===t?p?(e.processY(-v,0,!1,!0),i.processY(0,null,!0)):c?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,i.velocity.y,!1,!0),i.processY(g,null,!0)):3===t&&(d?(e.processY(0,null,!0),i.processY(-v,0,!1,!0)):l?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,s=i.velocity.y,r=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),o=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(r+o);return o-=h,n=h+(r-=h)*e.bounce.y,a=h+o*i.bounce.y,l&&m?x(0):c&&g?x(1):u&&g?x(2):!(!f||!m)&&x(3)},Set:function(t,n,a){i=n;var x=(e=t).velocity.y,T=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,d=0===e._dy,g=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),o=T-x*e.bounce.y,r=i.pushable,c=i._dy<0,f=i._dy>0,p=0===i._dy,m=!g,h=x-T*i.bounce.y,v=Math.abs(a),y()},Run:x,RunImmovableBody1:function(t){if(1===t?i.velocity.y=0:g?i.processY(v,h,!0):i.processY(-v,h,!1,!0),e.moves){var s=e.directControl?e.x-e.autoFrame.x:e.x-e.prev.x;i.x+=s*e.friction.x,i._dx=i.x-i.prev.x}},RunImmovableBody2:function(t){if(2===t?e.velocity.y=0:m?e.processY(v,o,!0):e.processY(-v,o,!1,!0),i.moves){var s=i.directControl?i.x-i.autoFrame.x:i.x-i.prev.x;e.x+=s*i.friction.x,e._dx=e.x-e.prev.x}}}},14087(t,e,i){var s=i(64897),r=i(3017);t.exports=function(t,e,i,n,a){void 0===a&&(a=s(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateX||e.customSeparateX)return 0!==a||t.embedded&&e.embedded;var l=r.Set(t,e,a);return o||h?(o?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},89936(t,e,i){var s=i(45170),r=i(47962);t.exports=function(t,e,i,n,a){void 0===a&&(a=s(t,e,i,n));var o=t.immovable,h=e.immovable;if(i||0===a||o&&h||t.customSeparateY||e.customSeparateY)return 0!==a||t.embedded&&e.embedded;var l=r.Set(t,e,a);return o||h?(o?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},95829(t){t.exports=function(t,e){return void 0===e&&(e={}),e.none=t,e.up=!1,e.down=!1,e.left=!1,e.right=!1,t||(e.up=!0,e.down=!0,e.left=!0,e.right=!0),e}},72624(t,e,i){var s=i(87902),r=i(83419),n=i(78389),a=i(37747),o=i(37303),h=i(95829),l=i(26099),u=new r({Mixins:[n],initialize:function(t,e){var i=64,s=64,r=void 0!==e;r&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),r||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=r?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=l.ZERO,this.allowGravity=!1,this.gravity=l.ZERO,this.bounce=l.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(t,e,i){if(void 0===e&&(e=!0),void 0===i&&(i=!0),!t||!t.hasTransformComponent)return this;var s=this.world;return this.gameObject&&this.gameObject.body&&(s.disable(this.gameObject),this.gameObject.body=null),t.body&&s.disable(t),this.gameObject=t,t.body=this,this.setSize(),e&&this.updateFromGameObject(),this.enable=i,this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&s.frame&&(t||(t=s.frame.realWidth),e||(e=s.frame.realHeight)),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s&&s.getCenter){var r=s.displayWidth/2,n=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(r-this.halfWidth,n-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.add(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},71464(t,e,i){var s=i(13759),r=i(83419),n=i(78389),a=i(37747),o=i(95540),h=i(26479),l=i(41212),u=new r({Extends:h,Mixins:[n],initialize:function(t,e,i,r){i||r?l(i)?(r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler,r.createMultipleCallback=this.createMultipleCallbackHandler,r.classType=o(r,"classType",s)):Array.isArray(i)&&l(i[0])?(r=i,i=null,r.forEach(function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",s)},this)):r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,h.call(this,e,i,r),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body&&t.body.physicsType===a.STATIC_BODY||(t.body&&(t.body.destroy(),t.body=null),this.world.enableBody(t,a.STATIC_BODY))},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=Array.from(this.children),e=0;e=s;if(this.fixedStep||(i=.001*e,n=!0,this._elapsed=0),r.forEach(function(t){t.enable&&t.preUpdate(n,i)}),n){this._elapsed-=s,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(Array.from(r)));for(var a=this.colliders.update(),o=0;o=s;)this._elapsed-=s,this.step(i)}},step:function(t){var e=this.bodies;e.forEach(function(e){e.enable&&e.update(t)}),this.useTree&&(this.tree.clear(),this.tree.load(Array.from(e)));for(var i=this.colliders.update(),s=0;s0){var r=this.tree,n=this.staticTree;s.forEach(function(i){i.physicsType===h.DYNAMIC_BODY?(r.remove(i),t.delete(i)):i.physicsType===h.STATIC_BODY&&(n.remove(i),e.delete(i)),i.world=void 0,i.gameObject=void 0}),s.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,s=t.angularAcceleration,r=t.angularDrag,a=t.maxAngular;s?i+=s*e:t.allowDrag&&r&&(p(i-(r*=e),0,.1)?i-=r:g(i+r,0,.1)?i+=r:i=0);var o=(i=n(i,-a,a))-t.angularVelocity;t.angularVelocity+=o,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,s=t.acceleration.x,r=t.drag.x,a=t.maxVelocity.x,o=t.velocity.y,h=t.acceleration.y,l=t.drag.y,u=t.maxVelocity.y,d=t.speed,c=t.maxSpeed,m=t.allowDrag,v=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,o+=(this.gravity.y+t.gravity.y)*e),s?i+=s*e:m&&r&&(v?(i*=r=Math.pow(r,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(i=0)):p(i-(r*=e),0,.01)?i-=r:g(i+r,0,.01)?i+=r:i=0),h?o+=h*e:m&&l&&(v?(o*=l=Math.pow(l,e),d=Math.sqrt(i*i+o*o),f(d,0,.001)&&(o=0)):p(o-(l*=e),0,.01)?o-=l:g(o+l,0,.01)?o+=l:o=0),i=n(i,-a,a),o=n(o,-u,u),t.velocity.set(i,o),c>-1&&t.velocity.length()>c&&(t.velocity.normalize().scale(c),d=c),t.speed=d},separate:function(t,e,i,s,r){var n,a,o=!1,h=!0;if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return o;if(i&&!1===i.call(s,t.gameObject||t,e.gameObject||e))return o;if(t.isCircle||e.isCircle){var l=this.separateCircle(t,e,r);l.result?(o=!0,h=!1):(n=l.x,a=l.y,h=!0)}if(h){var u=!1,d=!1,f=this.OVERLAP_BIAS;r?(u=A(t,e,r,f,n),d=_(t,e,r,f,a)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)C&&(p=l(y,x,C,S)-w):x>E&&(yC&&(p=l(y,x,C,E)-w)),p*=-1}else p=t.halfWidth+e.halfWidth-u(a,o);t.overlapR=p,e.overlapR=p;var A=s(a,o),_=(p+T.EPSILON)*Math.cos(A),M=(p+T.EPSILON)*Math.sin(A),R={overlap:p,result:!1,x:_,y:M};if(i&&(!g||g&&0!==p))return R.result=!0,R;if(!g&&0===p||h&&d||t.customSeparateX||e.customSeparateX)return R.x=void 0,R.y=void 0,R;var P=!t.pushable&&!e.pushable;if(g){var O=a.x-o.x,L=a.y-o.y,D=Math.sqrt(Math.pow(O,2)+Math.pow(L,2)),F=(o.x-a.x)/D||0,I=(o.y-a.y)/D||0,N=2*(c.x*F+c.y*I-f.x*F-f.y*I)/(t.mass+e.mass);!h&&!d&&t.pushable&&e.pushable||(N*=2),!h&&t.pushable&&(c.x=c.x-N/t.mass*F,c.y=c.y-N/t.mass*I,c.multiply(t.bounce)),!d&&e.pushable&&(f.x=f.x+N/e.mass*F,f.y=f.y+N/e.mass*I,f.multiply(e.bounce)),h||d||(_*=.5,M*=.5),(!h||t.pushable||P)&&(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||P)&&(e.x+=_,e.y+=M,e.updateCenter()),R.result=!0}else(!h||t.pushable||P)&&(t.x-=_,t.y-=M,t.updateCenter()),(!d||e.pushable||P)&&(e.x+=_,e.y+=M,e.updateCenter()),R.x=void 0,R.y=void 0;return R},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?u(t.center,e.center)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.left||t.bottom<=e.top||t.left>=e.right||t.top>=e.bottom))},circleBodyIntersects:function(t,e){var i=n(t.center.x,e.left,e.right),s=n(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.collideObjects(t,e,i,s,r,!0)},collide:function(t,e,i,s,r){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=i),this.collideObjects(t,e,i,s,r,!1)},collideObjects:function(t,e,i,s,r,n){var a,o;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=Array.from(t.children)),e&&e.isParent&&void 0===e.physicsType&&(e=Array.from(e.children));var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(a=0;a0},collideHandler:function(t,e,i,s,r,n){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,r,n);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,s,r,n);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,r,n);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,r,n)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,s,r,n);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,r,n);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,r,n)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,s,r,n);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,r,n)}},canCollide:function(t,e){return t&&e&&0!==(t.collisionMask&e.collisionCategory)&&0!==(e.collisionMask&t.collisionCategory)},collideSpriteVsSprite:function(t,e,i,s,r,n){var a=t.isBody?t:t.body,o=e.isBody?e:e.body;return!!this.canCollide(a,o)&&(this.separate(a,o,s,r,n)&&(i&&i.call(r,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,r,n){var a,o,l,u=t.isBody?t:t.body;if(0!==e.getLength()&&u&&u.enable&&!u.checkCollision.none&&this.canCollide(u,e))if(this.useTree||e.physicsType===h.STATIC_BODY){var d=this.treeMinMax;d.minX=u.left,d.minY=u.top,d.maxX=u.right,d.maxY=u.bottom;var c=e.physicsType===h.DYNAMIC_BODY?this.tree.search(d):this.staticTree.search(d);for(o=c.length,a=0;a0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},67013(t){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},40012(t,e,i){var s=i(21329),r=i(53442),n=i(2483);t.exports=function(t,e,i,a,o,h,l){var u=a.left,d=a.top,c=a.right,f=a.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var m=0,v=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()0&&u&&t.checkCollision.right&&h&&t.right>i&&(o=t.right-i)>n&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:s(t,o)),o}},53442(t,e,i){var s=i(67013);t.exports=function(t,e,i,r,n,a){var o=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,d=e.collideDown;return a||(h=!0,l=!0,u=!0,d=!0),t.deltaY()<0&&d&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(o=t.bottom-i)>n&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:s(t,o)),o}},2483(t){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},55173(t,e,i){var s={ProcessTileCallbacks:i(96602),ProcessTileSeparationX:i(36294),ProcessTileSeparationY:i(67013),SeparateTile:i(40012),TileCheckX:i(21329),TileCheckY:i(53442),TileIntersectsBody:i(2483)};t.exports=s},44563(t,e,i){t.exports={Arcade:i(27064),Matter:i(3875)}},68174(t,e,i){var s=i(83419),r=i(26099),n=new s({initialize:function(){this.boundsCenter=new r,this.centerDiff=new r},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,s=t.bounds.max.x-t.bounds.min.x,r=t.bounds.max.y-t.bounds.min.y,n=s*t.centerOfMass.x,a=r*t.centerOfMass.y;return e.set(s/2,r/2),i.set(n-e.x,a-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e+s.x+n.x,i+s.y+n.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e+n.x,i+s.y+n.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e-(s.x-n.x),i+s.y+n.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e+s.x+n.x,i+n.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.centerDiff;return new r(e+s.x,i+s.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e-(s.x-n.x),i+n.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e+s.x+n.x,i-(s.y-n.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e+n.x,i-(s.y-n.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,n=this.centerDiff;return new r(e-(s.x-n.x),i-(s.y-n.y))}return!1}});t.exports=n},19933(t,e,i){var s=i(6790);s.Body=i(22562),s.Composite=i(69351),s.World=i(4372),s.Collision=i(52284),s.Detector=i(81388),s.Pairs=i(99561),s.Pair=i(4506),s.Query=i(73296),s.Resolver=i(66272),s.Constraint=i(48140),s.Common=i(53402),s.Engine=i(48413),s.Events=i(35810),s.Sleeping=i(53614),s.Plugin=i(73832),s.Bodies=i(66280),s.Composites=i(74116),s.Axes=i(66615),s.Bounds=i(15647),s.Svg=i(74058),s.Vector=i(31725),s.Vertices=i(41598),s.World.add=s.Composite.add,s.World.remove=s.Composite.remove,s.World.addComposite=s.Composite.addComposite,s.World.addBody=s.Composite.addBody,s.World.addConstraint=s.Composite.addConstraint,s.World.clear=s.Composite.clear,t.exports=s},28137(t,e,i){var s=i(66280),r=i(83419),n=i(74116),a=i(48140),o=i(74058),h=i(75803),l=i(23181),u=i(34803),d=i(73834),c=i(19496),f=i(85791),p=i(98713),g=i(41598),m=new r({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,r,n){var a=s.rectangle(t,e,i,r,n);return this.world.add(a),a},trapezoid:function(t,e,i,r,n,a){var o=s.trapezoid(t,e,i,r,n,a);return this.world.add(o),o},circle:function(t,e,i,r,n){var a=s.circle(t,e,i,r,n);return this.world.add(a),a},polygon:function(t,e,i,r,n){var a=s.polygon(t,e,i,r,n);return this.world.add(a),a},fromVertices:function(t,e,i,r,n,a,o){"string"==typeof i&&(i=g.fromPath(i));var h=s.fromVertices(t,e,i,r,n,a,o);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,s,r){void 0===r&&(r=!0);var n=c.parseBody(t,e,i,s);return r&&!this.world.has(n)&&this.world.add(n),n},fromSVG:function(t,e,i,r,n,a){void 0===r&&(r=1),void 0===n&&(n={}),void 0===a&&(a=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var s=M.create(t,e),r=[];return C.point(i,s).forEach(function(t){-1===r.indexOf(t)&&r.push(t)}),r},intersectRect:function(t,e,i,s,r,n){void 0===r&&(r=!1),n=this.getMatterBodies(n);var a={min:{x:t,y:e},max:{x:t+i,y:e+s}},o=[];return C.region(n,a,r).forEach(function(t){-1===o.indexOf(t)&&o.push(t)}),o},intersectRay:function(t,e,i,s,r,n){void 0===r&&(r=1),n=this.getMatterBodies(n);for(var a=[],o=C.ray(n,M.create(t,e),M.create(i,s),r),h=0;h0?this.setFromTileCollision(i):this.setFromTileRectangle(i),s=this.body}if(e.flipX||e.flipY){var o={x:e.getCenterX(),y:e.getCenterY()},u=e.flipX?-1:1,d=e.flipY?-1:1;r.scale(s,u,d,o)}},setFromTileRectangle:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,r=e.y+e.height/2,n=s.rectangle(i,r,e.width,e.height,t);return this.setBody(n,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,n=this.tile.getLeft(),a=this.tile.getTop(),h=this.tile.getCollisionGroup(),c=l(h,"objects",[]),f=[],p=0;p1){var C=o(t);C.parts=f,this.setBody(r.create(C),C.addToWorld)}return this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=c},19496(t,e,i){var s=i(66280),r=i(22562),n=i(53402),a=i(95540),o=i(41598),h={parseBody:function(t,e,i,s){void 0===s&&(s={});for(var o=a(i,"fixtures",[]),h=[],l=0;l1?1:0;r0&&r.map(function(t){i=t.bodyA,s=t.bodyB,i.gameObject&&i.gameObject.emit("collide",i,s,t),s.gameObject&&s.gameObject.emit("collide",s,i,t),p.trigger(i,"onCollide",{pair:t}),p.trigger(s,"onCollide",{pair:t}),i.onCollideCallback&&i.onCollideCallback(t),s.onCollideCallback&&s.onCollideCallback(t),i.onCollideWith[s.id]&&i.onCollideWith[s.id](s,t),s.onCollideWith[i.id]&&s.onCollideWith[i.id](i,t)}),t.emit(u.COLLISION_START,e,i,s)}),p.on(e,"collisionActive",function(e){var i,s,r=e.pairs;r.length>0&&r.map(function(t){i=t.bodyA,s=t.bodyB,i.gameObject&&i.gameObject.emit("collideActive",i,s,t),s.gameObject&&s.gameObject.emit("collideActive",s,i,t),p.trigger(i,"onCollideActive",{pair:t}),p.trigger(s,"onCollideActive",{pair:t}),i.onCollideActiveCallback&&i.onCollideActiveCallback(t),s.onCollideActiveCallback&&s.onCollideActiveCallback(t)}),t.emit(u.COLLISION_ACTIVE,e,i,s)}),p.on(e,"collisionEnd",function(e){var i,s,r=e.pairs;r.length>0&&r.map(function(t){i=t.bodyA,s=t.bodyB,i.gameObject&&i.gameObject.emit("collideEnd",i,s,t),s.gameObject&&s.gameObject.emit("collideEnd",s,i,t),p.trigger(i,"onCollideEnd",{pair:t}),p.trigger(s,"onCollideEnd",{pair:t}),i.onCollideEndCallback&&i.onCollideEndCallback(t),s.onCollideEndCallback&&s.onCollideEndCallback(t)}),t.emit(u.COLLISION_END,e,i,s)})},setBounds:function(t,e,i,s,r,n,a,o,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===r&&(r=64),void 0===n&&(n=!0),void 0===a&&(a=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),this.updateWall(n,"left",t-r,e-r,r,s+2*r),this.updateWall(a,"right",t+i,e-r,r,s+2*r),this.updateWall(o,"top",t,e-r,i,r),this.updateWall(h,"bottom",t,e+s,i,r),this},updateWall:function(t,e,i,s,r,n){var a=this.walls[e];t?(a&&m.remove(this.localWorld,a),i+=r/2,s+=n/2,this.walls[e]=this.create(i,s,r,n,{isStatic:!0,friction:0,frictionStatic:0})):(a&&m.remove(this.localWorld,a),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=.001),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,this.localWorld.gravity.scale=i,this},create:function(t,e,i,r,n){var a=s.rectangle(t,e,i,r,n);return m.add(this.localWorld,a),a},add:function(t){return m.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;iMath.max(v._maxFrameDelta,i.maxFrameTime))&&(o=i.frameDelta||v._frameDeltaFallback),i.frameDeltaSmoothing){i.frameDeltaHistory.push(o),i.frameDeltaHistory=i.frameDeltaHistory.slice(-i.frameDeltaHistorySize);var l=i.frameDeltaHistory.slice(0).sort(),u=i.frameDeltaHistory.slice(l.length*v._smoothingLowerBound,l.length*v._smoothingUpperBound);o=v._mean(u)||o}i.frameDeltaSnapping&&(o=1e3/Math.round(1e3/o)),i.frameDelta=o,i.timeLastTick=t,i.timeBuffer+=i.frameDelta,i.timeBuffer=a.clamp(i.timeBuffer,0,i.frameDelta+r*v._timeBufferMargin),i.lastUpdatesDeferred=0;for(var d=i.maxUpdates||Math.ceil(i.maxFrameTime/r),c=a.now();r>0&&i.timeBuffer>=r*v._timeBufferMargin;){h.update(e,r),i.timeBuffer-=r,n+=1;var f=a.now()-s,p=a.now()-c,g=f+v._elapsedNextEstimate*p/n;if(n>=d||g>i.maxFrameTime){i.lastUpdatesDeferred=Math.round(Math.max(0,i.timeBuffer/r-v._timeBufferMargin));break}}}},step:function(t){h.update(this.engine,t)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==o.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return o.allBodies(this.localWorld)},getAllConstraints:function(){return o.allConstraints(this.localWorld)},getAllComposites:function(){return o.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,s=o.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(s,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(s),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(s,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(s,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,s){e.lineStyle(1,i,s);for(var r=a.keys(t.buckets),n=0;n0){var l=h[0].vertex.x,u=h[0].vertex.y;2===r.contactCount&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),o.bodyB===o.supports[0].body||o.bodyA.isStatic?e.lineBetween(l-8*o.normal.x,u-8*o.normal.y,l,u):e.lineBetween(l+8*o.normal.x,u+8*o.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,s){e.lineStyle(1,i,s);for(var r=0;r1?1:0;h1?1:0;o1?1:0;o1&&this.renderConvexHull(g,e,f,y)}}},renderBody:function(t,e,i,s,r,n,a,o){void 0===s&&(s=null),void 0===r&&(r=null),void 0===n&&(n=1),void 0===a&&(a=null),void 0===o&&(o=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,d=t.parts,c=d.length,f=c>1?1:0;f1){var r=t.vertices;e.lineStyle(s,i),e.beginPath(),e.moveTo(r[0].x,r[0].y);for(var n=1;n0&&(e.fillStyle(o),e.fillCircle(u.x,u.y,h),e.fillCircle(d.x,d.y,h)),this},resetCollisionIDs:function(){return r._nextCollidingGroupId=1,r._nextNonCollidingGroupId=-1,r._nextCategory=1,this},shutdown:function(){p.off(this.engine),this.removeAllListeners(),m.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=x},70410(t){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},66968(t){var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i0&&n.rotateAbout(o.position,s,t.position,o.position)}},s.setVelocity=function(t,e){var i=t.deltaTime/s._baseDelta;t.positionPrev.x=t.position.x-e.x*i,t.positionPrev.y=t.position.y-e.y*i,t.velocity.x=(t.position.x-t.positionPrev.x)/i,t.velocity.y=(t.position.y-t.positionPrev.y)/i,t.speed=n.magnitude(t.velocity)},s.getVelocity=function(t){var e=s._baseDelta/t.deltaTime;return{x:(t.position.x-t.positionPrev.x)*e,y:(t.position.y-t.positionPrev.y)*e}},s.getSpeed=function(t){return n.magnitude(s.getVelocity(t))},s.setSpeed=function(t,e){s.setVelocity(t,n.mult(n.normalise(s.getVelocity(t)),e))},s.setAngularVelocity=function(t,e){var i=t.deltaTime/s._baseDelta;t.anglePrev=t.angle-e*i,t.angularVelocity=(t.angle-t.anglePrev)/i,t.angularSpeed=Math.abs(t.angularVelocity)},s.getAngularVelocity=function(t){return(t.angle-t.anglePrev)*s._baseDelta/t.deltaTime},s.getAngularSpeed=function(t){return Math.abs(s.getAngularVelocity(t))},s.setAngularSpeed=function(t,e){s.setAngularVelocity(t,o.sign(s.getAngularVelocity(t))*e)},s.translate=function(t,e,i){s.setPosition(t,n.add(t.position,e),i)},s.rotate=function(t,e,i,r){if(i){var n=Math.cos(e),a=Math.sin(e),o=t.position.x-i.x,h=t.position.y-i.y;s.setPosition(t,{x:i.x+(o*n-h*a),y:i.y+(o*a+h*n)},r),s.setAngle(t,t.angle+e,r)}else s.setAngle(t,t.angle+e,r)},s.scale=function(t,e,i,n){var a=0,o=0;n=n||t.position;for(var u=t.inertia===1/0,d=0;d0&&(a+=c.area,o+=c.inertia),c.position.x=n.x+(c.position.x-n.x)*e,c.position.y=n.y+(c.position.y-n.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=a,t.isStatic||(s.setMass(t,t.density*a),s.setInertia(t,o))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null),u&&s.setInertia(t,1/0)},s.update=function(t,e){var i=(e=(void 0!==e?e:1e3/60)*t.timeScale)*e,a=s._timeCorrection?e/(t.deltaTime||e):1,u=1-t.frictionAir*(e/o._baseDelta),d=(t.position.x-t.positionPrev.x)*a,c=(t.position.y-t.positionPrev.y)*a;t.velocity.x=d*u+t.force.x/t.mass*i,t.velocity.y=c*u+t.force.y/t.mass*i,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.deltaTime=e,t.angularVelocity=(t.angle-t.anglePrev)*u*a+t.torque/t.inertia*i,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=n.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var f=0;f0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(r.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),f>0&&n.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},s.updateVelocities=function(t){var e=s._baseDelta/t.deltaTime,i=t.velocity;i.x=(t.position.x-t.positionPrev.x)*e,i.y=(t.position.y-t.positionPrev.y)*e,t.speed=Math.sqrt(i.x*i.x+i.y*i.y),t.angularVelocity=(t.angle-t.anglePrev)*e,t.angularSpeed=Math.abs(t.angularVelocity)},s.applyForce=function(t,e,i){var s=e.x-t.position.x,r=e.y-t.position.y;t.force.x+=i.x,t.force.y+=i.y,t.torque+=s*i.y-r*i.x},s._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i=0&&(v=-v,y=-y),d.x=v,d.y=y,c.x=-y,c.y=v,f.x=v*g,f.y=y*g,r.depth=g;var x=s._findSupports(t,e,d,1),T=0;if(o.contains(t.vertices,x[0])&&(p[T++]=x[0]),o.contains(t.vertices,x[1])&&(p[T++]=x[1]),T<2){var w=s._findSupports(e,t,d,-1);o.contains(e.vertices,w[0])&&(p[T++]=w[0]),T<2&&o.contains(e.vertices,w[1])&&(p[T++]=w[1])}return 0===T&&(p[T++]=x[0]),r.supportCount=T,r},s._overlapAxes=function(t,e,i,s){var r,n,a,o,h,l,u=e.length,d=i.length,c=e[0].x,f=e[0].y,p=i[0].x,g=i[0].y,m=s.length,v=Number.MAX_VALUE,y=0;for(h=0;hC?C=o:oE?E=o:op)break;if(!(gM.max.y)&&(!v||!T.isStatic&&!T.isSleeping)&&h(c.collisionFilter,T.collisionFilter)){var w=T.parts.length;if(x&&1===w)(A=l(c,T,r))&&(u[d++]=A);else for(var b=w>1?1:0,S=y>1?1:0;SM.max.x||f.max.xM.max.y||(A=l(C,_,r))&&(u[d++]=A)}}}}return u.length!==d&&(u.length=d),u},s.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!==(t.mask&e.category)&&0!==(e.mask&t.category)},s._compareBoundsX=function(t,e){return t.bounds.min.x-e.bounds.min.x}},4506(t,e,i){var s={};t.exports=s;var r=i(43424);s.create=function(t,e){var i=t.bodyA,n=t.bodyB,a={id:s.id(i,n),bodyA:i,bodyB:n,collision:t,contacts:[r.create(),r.create()],contactCount:0,separation:0,isActive:!0,isSensor:i.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return s.update(a,t,e),a},s.update=function(t,e,i){var s=e.supports,r=e.supportCount,n=t.contacts,a=e.parentA,o=e.parentB;t.isActive=!0,t.timeUpdated=i,t.collision=e,t.separation=e.depth,t.inverseMass=a.inverseMass+o.inverseMass,t.friction=a.frictiono.frictionStatic?a.frictionStatic:o.frictionStatic,t.restitution=a.restitution>o.restitution?a.restitution:o.restitution,t.slop=a.slop>o.slop?a.slop:o.slop,t.contactCount=r,e.pair=t;var h=s[0],l=n[0],u=s[1],d=n[1];d.vertex!==h&&l.vertex!==u||(n[1]=l,n[0]=l=d,d=n[1]),l.vertex=h,d.vertex=u},s.setActive=function(t,e,i){e?(t.isActive=!0,t.timeUpdated=i):(t.isActive=!1,t.contactCount=0)},s.id=function(t,e){return t.id=i?d[f++]=n:(l(n,!1,i),n.collision.bodyA.sleepCounter>0&&n.collision.bodyB.sleepCounter>0?d[f++]=n:(g[x++]=n,delete u[n.id]));d.length!==f&&(d.length=f),p.length!==y&&(p.length=y),g.length!==x&&(g.length=x),m.length!==T&&(m.length=T)},s.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},73296(t,e,i){var s={};t.exports=s;var r=i(31725),n=i(52284),a=i(15647),o=i(66280),h=i(41598);s.collides=function(t,e){for(var i=[],s=e.length,r=t.bounds,o=n.collides,h=a.overlaps,l=0;lH?(r=W>0?W:-W,(i=g.friction*(W>0?1:-1)*l)<-r?i=-r:i>r&&(i=r)):(i=W,r=f);var j=N*T-B*x,q=k*T-U*x,K=_/(S+v.inverseInertia*j*j+y.inverseInertia*q*q),Z=(1+g.restitution)*X*K;if(i*=K,X0&&(F.normalImpulse=0),Z=F.normalImpulse-Q}if(W<-d||W>d)F.tangentImpulse=0;else{var J=F.tangentImpulse;F.tangentImpulse+=i,F.tangentImpulse<-r&&(F.tangentImpulse=-r),F.tangentImpulse>r&&(F.tangentImpulse=r),i=F.tangentImpulse-J}var $=x*Z+w*i,tt=T*Z+b*i;v.isStatic||v.isSleeping||(v.positionPrev.x+=$*v.inverseMass,v.positionPrev.y+=tt*v.inverseMass,v.anglePrev+=(N*tt-B*$)*v.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=$*y.inverseMass,y.positionPrev.y-=tt*y.inverseMass,y.anglePrev-=(k*tt-U*$)*y.inverseInertia)}}}}},48140(t,e,i){var s={};t.exports=s;var r=i(41598),n=i(31725),a=i(53614),o=i(15647),h=i(66615),l=i(53402);s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?n.add(e.bodyA.position,e.pointA):e.pointA,s=e.bodyB?n.add(e.bodyB.position,e.pointB):e.pointB,r=n.magnitude(n.sub(i,s));e.length=void 0!==e.length?e.length:r,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var a={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(a.type="pin",a.anchors=!1):e.stiffness<.9&&(a.type="spring"),e.render=l.extend(a,e.render),e},s.preSolveAll=function(t){for(var e=0;e=1||0===t.length?t.stiffness*e:t.stiffness*e*e,x=t.damping*e,T=n.mult(u,v*y),w=(i?i.inverseMass:0)+(r?r.inverseMass:0),b=w+((i?i.inverseInertia:0)+(r?r.inverseInertia:0));if(x>0){var S=n.create();p=n.div(u,d),m=n.sub(r&&n.sub(r.position,r.positionPrev)||S,i&&n.sub(i.position,i.positionPrev)||S),g=n.dot(p,m)}i&&!i.isStatic&&(f=i.inverseMass/w,i.constraintImpulse.x-=T.x*f,i.constraintImpulse.y-=T.y*f,i.position.x-=T.x*f,i.position.y-=T.y*f,x>0&&(i.positionPrev.x-=x*p.x*g*f,i.positionPrev.y-=x*p.y*g*f),c=n.cross(a,T)/b*s._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=c,i.angle-=c),r&&!r.isStatic&&(f=r.inverseMass/w,r.constraintImpulse.x+=T.x*f,r.constraintImpulse.y+=T.y*f,r.position.x+=T.x*f,r.position.y+=T.y*f,x>0&&(r.positionPrev.x+=x*p.x*g*f,r.positionPrev.y+=x*p.y*g*f),c=n.cross(o,T)/b*s._torqueDampen*r.inverseInertia*(1-t.angularStiffness),r.constraintImpulse.angle+=c,r.angle+=c)}}},s.postSolveAll=function(t){for(var e=0;e0&&(d.position.x+=l.x,d.position.y+=l.y),0!==l.angle&&(r.rotate(d.vertices,l.angle,i.position),h.rotate(d.axes,l.angle),u>0&&n.rotateAbout(d.position,l.angle,i.position,d.position)),o.update(d.bounds,d.vertices,i.velocity)}l.angle*=s._warming,l.x*=s._warming,l.y*=s._warming}}},s.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},s.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}},s.currentLength=function(t){var e=(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),i=(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0),s=e-((t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0)),r=i-((t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0));return Math.sqrt(s*s+r*r)}},53402(t,e,i){var s={};t.exports=s,function(){s._baseDelta=1e3/60,s._nextId=0,s._seed=0,s._nowStartTime=+new Date,s._warnedOnce={},s._decomp=null,s.extend=function(t,e){var i,r;"boolean"==typeof e?(i=2,r=e):(i=1,r=!0);for(var n=i;n0;e--){var i=Math.floor(s.random()*(e+1)),r=t[e];t[e]=t[i],t[i]=r}return t},s.choose=function(t){return t[Math.floor(s.random()*t.length)]},s.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},s.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},s.isFunction=function(t){return"function"==typeof t},s.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},s.isString=function(t){return"[object String]"===toString.call(t)},s.clamp=function(t,e,i){return ti?i:t},s.sign=function(t){return t<0?-1:1},s.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-s._nowStartTime},s.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return s._seed=(9301*s._seed+49297)%233280,s._seed/233280};s.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},s.logLevel=1,s.log=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.info=function(){console&&s.logLevel>0&&s.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warn=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");s._warnedOnce[t]||(s.warn(t),s._warnedOnce[t]=!0)},s.deprecated=function(t,e,i){t[e]=s.chain(function(){s.warnOnce("🔅 deprecated 🔅",i)},t[e])},s.nextId=function(){return s._nextId++},s.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;is._deltaMax&&d.warnOnce("Matter.Engine.update: delta argument is recommended to be less than or equal to",s._deltaMax.toFixed(3),"ms."),e=void 0!==e?e:d._baseDelta,e*=m.timeScale,m.timestamp+=e,m.lastDelta=e;var y={timestamp:m.timestamp,delta:e};h.trigger(t,"beforeUpdate",y);var x=l.allBodies(f),T=l.allConstraints(f),w=l.allComposites(f);for(f.isModified&&(a.setBodies(p,x),l.setModified(f,!1,!1,!0)),t.enableSleeping&&r.update(x,e),s._bodiesApplyGravity(x,t.gravity),s.wrap(x,w),s.attractors(x),e>0&&s._bodiesUpdate(x,e),h.trigger(t,"beforeSolve",y),u.preSolveAll(x),i=0;i0&&h.trigger(t,"collisionStart",{pairs:g.collisionStart,timestamp:m.timestamp,delta:e});var S=d.clamp(20/t.positionIterations,0,1);for(n.preSolvePosition(g.list),i=0;i