Файловый менеджер - Редактировать - /home/jogoso94/public_html/jogos/tanks_of_the_galaxy/scripts/c3runtime.js
�азад
// Generated by Construct, the game and app creator :: https://www.construct.net "use strict"; (function(a,b){"object"===typeof exports&&"undefined"!==typeof module?b(exports):"function"===typeof define&&define.amd?define(["exports"],b):(a="undefined"!==typeof globalThis?globalThis:a||self,b(a.glMatrix={}))})(this,function(a){function b(f,h,m){var q=h[0],t=h[1],u=h[2];h=h[3];var v=m[0],x=m[1],z=m[2];m=m[3];f[0]=q*v+u*x;f[1]=t*v+h*x;f[2]=q*z+u*m;f[3]=t*z+h*m;return f}function c(f,h,m){f[0]=h[0]-m[0];f[1]=h[1]-m[1];f[2]=h[2]-m[2];f[3]=h[3]-m[3];return f}function d(f,h,m){var q=h[0],t=h[1],u= h[2],v=h[3],x=h[4];h=h[5];var z=m[0],A=m[1],D=m[2],G=m[3],I=m[4];m=m[5];f[0]=q*z+u*A;f[1]=t*z+v*A;f[2]=q*D+u*G;f[3]=t*D+v*G;f[4]=q*I+u*m+x;f[5]=t*I+v*m+h;return f}function e(f,h,m){f[0]=h[0]-m[0];f[1]=h[1]-m[1];f[2]=h[2]-m[2];f[3]=h[3]-m[3];f[4]=h[4]-m[4];f[5]=h[5]-m[5];return f}function g(){var f=new U(9);U!=Float32Array&&(f[1]=0,f[2]=0,f[3]=0,f[5]=0,f[6]=0,f[7]=0);f[0]=1;f[4]=1;f[8]=1;return f}function k(f,h,m){var q=h[0],t=h[1],u=h[2],v=h[3],x=h[4],z=h[5],A=h[6],D=h[7];h=h[8];var G=m[0],I=m[1], H=m[2],M=m[3],N=m[4],K=m[5],Q=m[6],P=m[7];m=m[8];f[0]=G*q+I*v+H*A;f[1]=G*t+I*x+H*D;f[2]=G*u+I*z+H*h;f[3]=M*q+N*v+K*A;f[4]=M*t+N*x+K*D;f[5]=M*u+N*z+K*h;f[6]=Q*q+P*v+m*A;f[7]=Q*t+P*x+m*D;f[8]=Q*u+P*z+m*h;return f}function l(f,h,m){f[0]=h[0]-m[0];f[1]=h[1]-m[1];f[2]=h[2]-m[2];f[3]=h[3]-m[3];f[4]=h[4]-m[4];f[5]=h[5]-m[5];f[6]=h[6]-m[6];f[7]=h[7]-m[7];f[8]=h[8]-m[8];return f}function n(f){f[0]=1;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=1;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=1;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]= 1;return f}function p(f,h,m){var q=h[0],t=h[1],u=h[2],v=h[3],x=h[4],z=h[5],A=h[6],D=h[7],G=h[8],I=h[9],H=h[10],M=h[11],N=h[12],K=h[13],Q=h[14];h=h[15];var P=m[0],S=m[1],T=m[2],R=m[3];f[0]=P*q+S*x+T*G+R*N;f[1]=P*t+S*z+T*I+R*K;f[2]=P*u+S*A+T*H+R*Q;f[3]=P*v+S*D+T*M+R*h;P=m[4];S=m[5];T=m[6];R=m[7];f[4]=P*q+S*x+T*G+R*N;f[5]=P*t+S*z+T*I+R*K;f[6]=P*u+S*A+T*H+R*Q;f[7]=P*v+S*D+T*M+R*h;P=m[8];S=m[9];T=m[10];R=m[11];f[8]=P*q+S*x+T*G+R*N;f[9]=P*t+S*z+T*I+R*K;f[10]=P*u+S*A+T*H+R*Q;f[11]=P*v+S*D+T*M+R*h;P=m[12]; S=m[13];T=m[14];R=m[15];f[12]=P*q+S*x+T*G+R*N;f[13]=P*t+S*z+T*I+R*K;f[14]=P*u+S*A+T*H+R*Q;f[15]=P*v+S*D+T*M+R*h;return f}function r(f,h,m){var q=h[0],t=h[1],u=h[2],v=h[3],x=q+q,z=t+t,A=u+u;h=q*x;var D=q*z;q*=A;var G=t*z;t*=A;u*=A;x*=v;z*=v;v*=A;f[0]=1-(G+u);f[1]=D+v;f[2]=q-z;f[3]=0;f[4]=D-v;f[5]=1-(h+u);f[6]=t+x;f[7]=0;f[8]=q+z;f[9]=t-x;f[10]=1-(h+G);f[11]=0;f[12]=m[0];f[13]=m[1];f[14]=m[2];f[15]=1;return f}function w(f,h){f[0]=h[12];f[1]=h[13];f[2]=h[14];return f}function y(f,h){var m=h[4],q=h[5], t=h[6],u=h[8],v=h[9],x=h[10];f[0]=Math.hypot(h[0],h[1],h[2]);f[1]=Math.hypot(m,q,t);f[2]=Math.hypot(u,v,x);return f}function B(f,h){var m=new U(3);y(m,h);var q=1/m[0],t=1/m[1],u=1/m[2],v=h[0]*q;m=h[1]*t;var x=h[2]*u,z=h[4]*q,A=h[5]*t,D=h[6]*u;q*=h[8];t*=h[9];h=h[10]*u;u=v+A+h;0<u?(v=2*Math.sqrt(u+1),f[3]=.25*v,f[0]=(D-t)/v,f[1]=(q-x)/v,f[2]=(m-z)/v):v>A&&v>h?(v=2*Math.sqrt(1+v-A-h),f[3]=(D-t)/v,f[0]=.25*v,f[1]=(m+z)/v,f[2]=(q+x)/v):A>h?(v=2*Math.sqrt(1+A-v-h),f[3]=(q-x)/v,f[0]=(m+z)/v,f[1]=.25*v, f[2]=(D+t)/v):(v=2*Math.sqrt(1+h-v-A),f[3]=(m-z)/v,f[0]=(q+x)/v,f[1]=(D+t)/v,f[2]=.25*v);return f}function C(f,h,m,q,t){h=1/Math.tan(h/2);f[0]=h/m;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=h;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[11]=-1;f[12]=0;f[13]=0;f[15]=0;null!=t&&Infinity!==t?(m=1/(q-t),f[10]=(t+q)*m,f[14]=2*t*q*m):(f[10]=-1,f[14]=-2*q);return f}function E(f,h,m,q,t,u,v){var x=1/(h-m),z=1/(q-t),A=1/(u-v);f[0]=-2*x;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=-2*z;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=2*A;f[11]=0;f[12]=(h+m)* x;f[13]=(t+q)*z;f[14]=(v+u)*A;f[15]=1;return f}function F(f,h,m){f[0]=h[0]-m[0];f[1]=h[1]-m[1];f[2]=h[2]-m[2];f[3]=h[3]-m[3];f[4]=h[4]-m[4];f[5]=h[5]-m[5];f[6]=h[6]-m[6];f[7]=h[7]-m[7];f[8]=h[8]-m[8];f[9]=h[9]-m[9];f[10]=h[10]-m[10];f[11]=h[11]-m[11];f[12]=h[12]-m[12];f[13]=h[13]-m[13];f[14]=h[14]-m[14];f[15]=h[15]-m[15];return f}function J(){var f=new U(3);U!=Float32Array&&(f[0]=0,f[1]=0,f[2]=0);return f}function L(f){return Math.hypot(f[0],f[1],f[2])}function O(f,h,m){var q=new U(3);q[0]=f;q[1]= h;q[2]=m;return q}function V(f,h,m){f[0]=h[0]-m[0];f[1]=h[1]-m[1];f[2]=h[2]-m[2];return f}function W(f,h,m){f[0]=h[0]*m[0];f[1]=h[1]*m[1];f[2]=h[2]*m[2];return f}function ca(f,h,m){f[0]=h[0]/m[0];f[1]=h[1]/m[1];f[2]=h[2]/m[2];return f}function la(f,h){return Math.hypot(h[0]-f[0],h[1]-f[1],h[2]-f[2])}function ma(f,h){var m=h[0]-f[0],q=h[1]-f[1];f=h[2]-f[2];return m*m+q*q+f*f}function za(f){var h=f[0],m=f[1];f=f[2];return h*h+m*m+f*f}function Aa(f,h){var m=h[0],q=h[1],t=h[2];m=m*m+q*q+t*t;0<m&&(m=1/ Math.sqrt(m));f[0]=h[0]*m;f[1]=h[1]*m;f[2]=h[2]*m;return f}function oa(f,h){return f[0]*h[0]+f[1]*h[1]+f[2]*h[2]}function pa(f,h,m){var q=h[0],t=h[1];h=h[2];var u=m[0],v=m[1];m=m[2];f[0]=t*m-h*v;f[1]=h*u-q*m;f[2]=q*v-t*u;return f}function Ba(){var f=new U(4);U!=Float32Array&&(f[0]=0,f[1]=0,f[2]=0,f[3]=0);return f}function Ca(f){var h=new U(4);h[0]=f[0];h[1]=f[1];h[2]=f[2];h[3]=f[3];return h}function Da(f,h,m,q){var t=new U(4);t[0]=f;t[1]=h;t[2]=m;t[3]=q;return t}function qa(f,h){f[0]=h[0];f[1]=h[1]; f[2]=h[2];f[3]=h[3];return f}function Ea(f,h,m,q,t){f[0]=h;f[1]=m;f[2]=q;f[3]=t;return f}function Fa(f,h,m){f[0]=h[0]+m[0];f[1]=h[1]+m[1];f[2]=h[2]+m[2];f[3]=h[3]+m[3];return f}function Ga(f,h,m){f[0]=h[0]-m[0];f[1]=h[1]-m[1];f[2]=h[2]-m[2];f[3]=h[3]-m[3];return f}function Ha(f,h,m){f[0]=h[0]*m[0];f[1]=h[1]*m[1];f[2]=h[2]*m[2];f[3]=h[3]*m[3];return f}function Ia(f,h,m){f[0]=h[0]/m[0];f[1]=h[1]/m[1];f[2]=h[2]/m[2];f[3]=h[3]/m[3];return f}function ua(f,h,m){f[0]=h[0]*m;f[1]=h[1]*m;f[2]=h[2]*m;f[3]= h[3]*m;return f}function Ja(f,h){return Math.hypot(h[0]-f[0],h[1]-f[1],h[2]-f[2],h[3]-f[3])}function Ka(f,h){var m=h[0]-f[0],q=h[1]-f[1],t=h[2]-f[2];f=h[3]-f[3];return m*m+q*q+t*t+f*f}function ja(f){return Math.hypot(f[0],f[1],f[2],f[3])}function ia(f){var h=f[0],m=f[1],q=f[2];f=f[3];return h*h+m*m+q*q+f*f}function ra(f,h){var m=h[0],q=h[1],t=h[2];h=h[3];var u=m*m+q*q+t*t+h*h;0<u&&(u=1/Math.sqrt(u));f[0]=m*u;f[1]=q*u;f[2]=t*u;f[3]=h*u;return f}function ka(f,h){return f[0]*h[0]+f[1]*h[1]+f[2]*h[2]+ f[3]*h[3]}function La(f,h,m,q){var t=h[0],u=h[1],v=h[2];h=h[3];f[0]=t+q*(m[0]-t);f[1]=u+q*(m[1]-u);f[2]=v+q*(m[2]-v);f[3]=h+q*(m[3]-h);return f}function Ma(f,h){return f[0]===h[0]&&f[1]===h[1]&&f[2]===h[2]&&f[3]===h[3]}function sa(){var f=new U(4);U!=Float32Array&&(f[0]=0,f[1]=0,f[2]=0);f[3]=1;return f}function Na(f,h,m){m*=.5;var q=Math.sin(m);f[0]=q*h[0];f[1]=q*h[1];f[2]=q*h[2];f[3]=Math.cos(m);return f}function Oa(f,h,m){var q=h[0],t=h[1],u=h[2];h=h[3];var v=m[0],x=m[1],z=m[2];m=m[3];f[0]=q*m+ h*v+t*z-u*x;f[1]=t*m+h*x+u*v-q*z;f[2]=u*m+h*z+q*x-t*v;f[3]=h*m-q*v-t*x-u*z;return f}function Pa(f,h,m){m*=.5;var q=h[0],t=h[1],u=h[2];h=h[3];var v=Math.sin(m);m=Math.cos(m);f[0]=q*m+h*v;f[1]=t*m+u*v;f[2]=u*m-t*v;f[3]=h*m-q*v;return f}function Qa(f,h,m){m*=.5;var q=h[0],t=h[1],u=h[2];h=h[3];var v=Math.sin(m);m=Math.cos(m);f[0]=q*m-u*v;f[1]=t*m+h*v;f[2]=u*m+q*v;f[3]=h*m-t*v;return f}function Ra(f,h,m){m*=.5;var q=h[0],t=h[1],u=h[2];h=h[3];var v=Math.sin(m);m=Math.cos(m);f[0]=q*m+t*v;f[1]=t*m-q*v;f[2]= u*m+h*v;f[3]=h*m-u*v;return f}function Sa(f,h){var m=h[0],q=h[1],t=h[2],u=Math.sqrt(m*m+q*q+t*t);h=Math.exp(h[3]);var v=0<u?h*Math.sin(u)/u:0;f[0]=m*v;f[1]=q*v;f[2]=t*v;f[3]=h*Math.cos(u);return f}function Ta(f,h){var m=h[0],q=h[1],t=h[2];h=h[3];var u=Math.sqrt(m*m+q*q+t*t);u=0<u?Math.atan2(u,h)/u:0;f[0]=m*u;f[1]=q*u;f[2]=t*u;f[3]=.5*Math.log(m*m+q*q+t*t+h*h);return f}function ta(f,h,m,q){var t=h[0],u=h[1],v=h[2];h=h[3];var x=m[0],z=m[1],A=m[2];m=m[3];var D=t*x+u*z+v*A+h*m;0>D&&(D=-D,x=-x,z=-z,A= -A,m=-m);if(1E-6<1-D){var G=Math.acos(D);var I=Math.sin(G);D=Math.sin((1-q)*G)/I;q=Math.sin(q*G)/I}else D=1-q;f[0]=D*t+q*x;f[1]=D*u+q*z;f[2]=D*v+q*A;f[3]=D*h+q*m;return f}function Ua(f,h){var m=h[0]+h[4]+h[8];if(0<m)m=Math.sqrt(m+1),f[3]=.5*m,m=.5/m,f[0]=(h[5]-h[7])*m,f[1]=(h[6]-h[2])*m,f[2]=(h[1]-h[3])*m;else{var q=0;h[4]>h[0]&&(q=1);h[8]>h[3*q+q]&&(q=2);var t=(q+1)%3,u=(q+2)%3;m=Math.sqrt(h[3*q+q]-h[3*t+t]-h[3*u+u]+1);f[q]=.5*m;m=.5/m;f[3]=(h[3*t+u]-h[3*u+t])*m;f[t]=(h[3*t+q]+h[3*q+t])*m;f[u]=(h[3* u+q]+h[3*q+u])*m}return f}function Va(f,h,m){var q=.5*m[0],t=.5*m[1];m=.5*m[2];var u=h[0],v=h[1],x=h[2];h=h[3];f[0]=u;f[1]=v;f[2]=x;f[3]=h;f[4]=q*h+t*x-m*v;f[5]=t*h+m*u-q*x;f[6]=m*h+q*v-t*u;f[7]=-q*u-t*v-m*x;return f}function Wa(f,h){f[0]=h[0];f[1]=h[1];f[2]=h[2];f[3]=h[3];f[4]=h[4];f[5]=h[5];f[6]=h[6];f[7]=h[7];return f}function Xa(f,h,m){var q=h[0],t=h[1],u=h[2],v=h[3],x=m[4],z=m[5],A=m[6],D=m[7],G=h[4],I=h[5],H=h[6];h=h[7];var M=m[0],N=m[1],K=m[2];m=m[3];f[0]=q*m+v*M+t*K-u*N;f[1]=t*m+v*N+u*M-q* K;f[2]=u*m+v*K+q*N-t*M;f[3]=v*m-q*M-t*N-u*K;f[4]=q*D+v*x+t*A-u*z+G*m+h*M+I*K-H*N;f[5]=t*D+v*z+u*x-q*A+I*m+h*N+H*M-G*K;f[6]=u*D+v*A+q*z-t*x+H*m+h*K+G*N-I*M;f[7]=v*D-q*x-t*z-u*A+h*m-G*M-I*N-H*K;return f}function Ya(){var f=new U(2);U!=Float32Array&&(f[0]=0,f[1]=0);return f}function Za(f,h,m){f[0]=h[0]-m[0];f[1]=h[1]-m[1];return f}function $a(f,h,m){f[0]=h[0]*m[0];f[1]=h[1]*m[1];return f}function ab(f,h,m){f[0]=h[0]/m[0];f[1]=h[1]/m[1];return f}function bb(f,h){return Math.hypot(h[0]-f[0],h[1]-f[1])} function cb(f,h){var m=h[0]-f[0];f=h[1]-f[1];return m*m+f*f}function db(f){return Math.hypot(f[0],f[1])}function eb(f){var h=f[0];f=f[1];return h*h+f*f}var U="undefined"!==typeof Float32Array?Float32Array:Array,ha=Math.random,hb=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var f=0,h=arguments.length;h--;)f+=arguments[h]*arguments[h];return Math.sqrt(f)});var ib=Object.freeze({__proto__:null,EPSILON:1E-6,get ARRAY_TYPE(){return U},RANDOM:ha,ANGLE_ORDER:"zyx",setMatrixArrayType:function(f){U= f},toRadian:function(f){return f*hb},equals:function(f,h){return Math.abs(f-h)<=1E-6*Math.max(1,Math.abs(f),Math.abs(h))}}),jb=Object.freeze({__proto__:null,create:function(){var f=new U(4);U!=Float32Array&&(f[1]=0,f[2]=0);f[0]=1;f[3]=1;return f},clone:function(f){var h=new U(4);h[0]=f[0];h[1]=f[1];h[2]=f[2];h[3]=f[3];return h},copy:function(f,h){f[0]=h[0];f[1]=h[1];f[2]=h[2];f[3]=h[3];return f},identity:function(f){f[0]=1;f[1]=0;f[2]=0;f[3]=1;return f},fromValues:function(f,h,m,q){var t=new U(4); t[0]=f;t[1]=h;t[2]=m;t[3]=q;return t},set:function(f,h,m,q,t){f[0]=h;f[1]=m;f[2]=q;f[3]=t;return f},transpose:function(f,h){if(f===h){var m=h[1];f[1]=h[2];f[2]=m}else f[0]=h[0],f[1]=h[2],f[2]=h[1],f[3]=h[3];return f},invert:function(f,h){var m=h[0],q=h[1],t=h[2];h=h[3];var u=m*h-t*q;if(!u)return null;u=1/u;f[0]=h*u;f[1]=-q*u;f[2]=-t*u;f[3]=m*u;return f},adjoint:function(f,h){var m=h[0];f[0]=h[3];f[1]=-h[1];f[2]=-h[2];f[3]=m;return f},determinant:function(f){return f[0]*f[3]-f[2]*f[1]},multiply:b, rotate:function(f,h,m){var q=h[0],t=h[1],u=h[2];h=h[3];var v=Math.sin(m);m=Math.cos(m);f[0]=q*m+u*v;f[1]=t*m+h*v;f[2]=q*-v+u*m;f[3]=t*-v+h*m;return f},scale:function(f,h,m){var q=h[1],t=h[2],u=h[3],v=m[0];m=m[1];f[0]=h[0]*v;f[1]=q*v;f[2]=t*m;f[3]=u*m;return f},fromRotation:function(f,h){var m=Math.sin(h);h=Math.cos(h);f[0]=h;f[1]=m;f[2]=-m;f[3]=h;return f},fromScaling:function(f,h){f[0]=h[0];f[1]=0;f[2]=0;f[3]=h[1];return f},str:function(f){return"mat2("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+")"},frob:function(f){return Math.hypot(f[0], f[1],f[2],f[3])},LDU:function(f,h,m,q){f[2]=q[2]/q[0];m[0]=q[0];m[1]=q[1];m[3]=q[3]-f[2]*m[1];return[f,h,m]},add:function(f,h,m){f[0]=h[0]+m[0];f[1]=h[1]+m[1];f[2]=h[2]+m[2];f[3]=h[3]+m[3];return f},subtract:c,exactEquals:function(f,h){return f[0]===h[0]&&f[1]===h[1]&&f[2]===h[2]&&f[3]===h[3]},equals:function(f,h){var m=f[0],q=f[1],t=f[2];f=f[3];var u=h[0],v=h[1],x=h[2];h=h[3];return Math.abs(m-u)<=1E-6*Math.max(1,Math.abs(m),Math.abs(u))&&Math.abs(q-v)<=1E-6*Math.max(1,Math.abs(q),Math.abs(v))&& Math.abs(t-x)<=1E-6*Math.max(1,Math.abs(t),Math.abs(x))&&Math.abs(f-h)<=1E-6*Math.max(1,Math.abs(f),Math.abs(h))},multiplyScalar:function(f,h,m){f[0]=h[0]*m;f[1]=h[1]*m;f[2]=h[2]*m;f[3]=h[3]*m;return f},multiplyScalarAndAdd:function(f,h,m,q){f[0]=h[0]+m[0]*q;f[1]=h[1]+m[1]*q;f[2]=h[2]+m[2]*q;f[3]=h[3]+m[3]*q;return f},mul:b,sub:c}),kb=Object.freeze({__proto__:null,create:function(){var f=new U(6);U!=Float32Array&&(f[1]=0,f[2]=0,f[4]=0,f[5]=0);f[0]=1;f[3]=1;return f},clone:function(f){var h=new U(6); h[0]=f[0];h[1]=f[1];h[2]=f[2];h[3]=f[3];h[4]=f[4];h[5]=f[5];return h},copy:function(f,h){f[0]=h[0];f[1]=h[1];f[2]=h[2];f[3]=h[3];f[4]=h[4];f[5]=h[5];return f},identity:function(f){f[0]=1;f[1]=0;f[2]=0;f[3]=1;f[4]=0;f[5]=0;return f},fromValues:function(f,h,m,q,t,u){var v=new U(6);v[0]=f;v[1]=h;v[2]=m;v[3]=q;v[4]=t;v[5]=u;return v},set:function(f,h,m,q,t,u,v){f[0]=h;f[1]=m;f[2]=q;f[3]=t;f[4]=u;f[5]=v;return f},invert:function(f,h){var m=h[0],q=h[1],t=h[2],u=h[3],v=h[4];h=h[5];var x=m*u-q*t;if(!x)return null; x=1/x;f[0]=u*x;f[1]=-q*x;f[2]=-t*x;f[3]=m*x;f[4]=(t*h-u*v)*x;f[5]=(q*v-m*h)*x;return f},determinant:function(f){return f[0]*f[3]-f[1]*f[2]},multiply:d,rotate:function(f,h,m){var q=h[0],t=h[1],u=h[2],v=h[3],x=h[4];h=h[5];var z=Math.sin(m);m=Math.cos(m);f[0]=q*m+u*z;f[1]=t*m+v*z;f[2]=q*-z+u*m;f[3]=t*-z+v*m;f[4]=x;f[5]=h;return f},scale:function(f,h,m){var q=h[1],t=h[2],u=h[3],v=h[4],x=h[5],z=m[0];m=m[1];f[0]=h[0]*z;f[1]=q*z;f[2]=t*m;f[3]=u*m;f[4]=v;f[5]=x;return f},translate:function(f,h,m){var q=h[0], t=h[1],u=h[2],v=h[3],x=h[4];h=h[5];var z=m[0];m=m[1];f[0]=q;f[1]=t;f[2]=u;f[3]=v;f[4]=q*z+u*m+x;f[5]=t*z+v*m+h;return f},fromRotation:function(f,h){var m=Math.sin(h);h=Math.cos(h);f[0]=h;f[1]=m;f[2]=-m;f[3]=h;f[4]=0;f[5]=0;return f},fromScaling:function(f,h){f[0]=h[0];f[1]=0;f[2]=0;f[3]=h[1];f[4]=0;f[5]=0;return f},fromTranslation:function(f,h){f[0]=1;f[1]=0;f[2]=0;f[3]=1;f[4]=h[0];f[5]=h[1];return f},str:function(f){return"mat2d("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+", "+f[4]+", "+f[5]+")"},frob:function(f){return Math.hypot(f[0], f[1],f[2],f[3],f[4],f[5],1)},add:function(f,h,m){f[0]=h[0]+m[0];f[1]=h[1]+m[1];f[2]=h[2]+m[2];f[3]=h[3]+m[3];f[4]=h[4]+m[4];f[5]=h[5]+m[5];return f},subtract:e,multiplyScalar:function(f,h,m){f[0]=h[0]*m;f[1]=h[1]*m;f[2]=h[2]*m;f[3]=h[3]*m;f[4]=h[4]*m;f[5]=h[5]*m;return f},multiplyScalarAndAdd:function(f,h,m,q){f[0]=h[0]+m[0]*q;f[1]=h[1]+m[1]*q;f[2]=h[2]+m[2]*q;f[3]=h[3]+m[3]*q;f[4]=h[4]+m[4]*q;f[5]=h[5]+m[5]*q;return f},exactEquals:function(f,h){return f[0]===h[0]&&f[1]===h[1]&&f[2]===h[2]&&f[3]=== h[3]&&f[4]===h[4]&&f[5]===h[5]},equals:function(f,h){var m=f[0],q=f[1],t=f[2],u=f[3],v=f[4];f=f[5];var x=h[0],z=h[1],A=h[2],D=h[3],G=h[4];h=h[5];return Math.abs(m-x)<=1E-6*Math.max(1,Math.abs(m),Math.abs(x))&&Math.abs(q-z)<=1E-6*Math.max(1,Math.abs(q),Math.abs(z))&&Math.abs(t-A)<=1E-6*Math.max(1,Math.abs(t),Math.abs(A))&&Math.abs(u-D)<=1E-6*Math.max(1,Math.abs(u),Math.abs(D))&&Math.abs(v-G)<=1E-6*Math.max(1,Math.abs(v),Math.abs(G))&&Math.abs(f-h)<=1E-6*Math.max(1,Math.abs(f),Math.abs(h))},mul:d,sub:e}), lb=Object.freeze({__proto__:null,create:g,fromMat4:function(f,h){f[0]=h[0];f[1]=h[1];f[2]=h[2];f[3]=h[4];f[4]=h[5];f[5]=h[6];f[6]=h[8];f[7]=h[9];f[8]=h[10];return f},clone:function(f){var h=new U(9);h[0]=f[0];h[1]=f[1];h[2]=f[2];h[3]=f[3];h[4]=f[4];h[5]=f[5];h[6]=f[6];h[7]=f[7];h[8]=f[8];return h},copy:function(f,h){f[0]=h[0];f[1]=h[1];f[2]=h[2];f[3]=h[3];f[4]=h[4];f[5]=h[5];f[6]=h[6];f[7]=h[7];f[8]=h[8];return f},fromValues:function(f,h,m,q,t,u,v,x,z){var A=new U(9);A[0]=f;A[1]=h;A[2]=m;A[3]=q;A[4]= t;A[5]=u;A[6]=v;A[7]=x;A[8]=z;return A},set:function(f,h,m,q,t,u,v,x,z,A){f[0]=h;f[1]=m;f[2]=q;f[3]=t;f[4]=u;f[5]=v;f[6]=x;f[7]=z;f[8]=A;return f},identity:function(f){f[0]=1;f[1]=0;f[2]=0;f[3]=0;f[4]=1;f[5]=0;f[6]=0;f[7]=0;f[8]=1;return f},transpose:function(f,h){if(f===h){var m=h[1],q=h[2],t=h[5];f[1]=h[3];f[2]=h[6];f[3]=m;f[5]=h[7];f[6]=q;f[7]=t}else f[0]=h[0],f[1]=h[3],f[2]=h[6],f[3]=h[1],f[4]=h[4],f[5]=h[7],f[6]=h[2],f[7]=h[5],f[8]=h[8];return f},invert:function(f,h){var m=h[0],q=h[1],t=h[2], u=h[3],v=h[4],x=h[5],z=h[6],A=h[7];h=h[8];var D=h*v-x*A,G=-h*u+x*z,I=A*u-v*z,H=m*D+q*G+t*I;if(!H)return null;H=1/H;f[0]=D*H;f[1]=(-h*q+t*A)*H;f[2]=(x*q-t*v)*H;f[3]=G*H;f[4]=(h*m-t*z)*H;f[5]=(-x*m+t*u)*H;f[6]=I*H;f[7]=(-A*m+q*z)*H;f[8]=(v*m-q*u)*H;return f},adjoint:function(f,h){var m=h[0],q=h[1],t=h[2],u=h[3],v=h[4],x=h[5],z=h[6],A=h[7];h=h[8];f[0]=v*h-x*A;f[1]=t*A-q*h;f[2]=q*x-t*v;f[3]=x*z-u*h;f[4]=m*h-t*z;f[5]=t*u-m*x;f[6]=u*A-v*z;f[7]=q*z-m*A;f[8]=m*v-q*u;return f},determinant:function(f){var h= f[3],m=f[4],q=f[5],t=f[6],u=f[7],v=f[8];return f[0]*(v*m-q*u)+f[1]*(-v*h+q*t)+f[2]*(u*h-m*t)},multiply:k,translate:function(f,h,m){var q=h[0],t=h[1],u=h[2],v=h[3],x=h[4],z=h[5],A=h[6],D=h[7];h=h[8];var G=m[0];m=m[1];f[0]=q;f[1]=t;f[2]=u;f[3]=v;f[4]=x;f[5]=z;f[6]=G*q+m*v+A;f[7]=G*t+m*x+D;f[8]=G*u+m*z+h;return f},rotate:function(f,h,m){var q=h[0],t=h[1],u=h[2],v=h[3],x=h[4],z=h[5],A=h[6],D=h[7];h=h[8];var G=Math.sin(m);m=Math.cos(m);f[0]=m*q+G*v;f[1]=m*t+G*x;f[2]=m*u+G*z;f[3]=m*v-G*q;f[4]=m*x-G*t;f[5]= m*z-G*u;f[6]=A;f[7]=D;f[8]=h;return f},scale:function(f,h,m){var q=m[0];m=m[1];f[0]=q*h[0];f[1]=q*h[1];f[2]=q*h[2];f[3]=m*h[3];f[4]=m*h[4];f[5]=m*h[5];f[6]=h[6];f[7]=h[7];f[8]=h[8];return f},fromTranslation:function(f,h){f[0]=1;f[1]=0;f[2]=0;f[3]=0;f[4]=1;f[5]=0;f[6]=h[0];f[7]=h[1];f[8]=1;return f},fromRotation:function(f,h){var m=Math.sin(h);h=Math.cos(h);f[0]=h;f[1]=m;f[2]=0;f[3]=-m;f[4]=h;f[5]=0;f[6]=0;f[7]=0;f[8]=1;return f},fromScaling:function(f,h){f[0]=h[0];f[1]=0;f[2]=0;f[3]=0;f[4]=h[1];f[5]= 0;f[6]=0;f[7]=0;f[8]=1;return f},fromMat2d:function(f,h){f[0]=h[0];f[1]=h[1];f[2]=0;f[3]=h[2];f[4]=h[3];f[5]=0;f[6]=h[4];f[7]=h[5];f[8]=1;return f},fromQuat:function(f,h){var m=h[0],q=h[1],t=h[2];h=h[3];var u=m+m,v=q+q,x=t+t;m*=u;var z=q*u;q*=v;var A=t*u,D=t*v;t*=x;u*=h;v*=h;h*=x;f[0]=1-q-t;f[3]=z-h;f[6]=A+v;f[1]=z+h;f[4]=1-m-t;f[7]=D-u;f[2]=A-v;f[5]=D+u;f[8]=1-m-q;return f},normalFromMat4:function(f,h){var m=h[0],q=h[1],t=h[2],u=h[3],v=h[4],x=h[5],z=h[6],A=h[7],D=h[8],G=h[9],I=h[10],H=h[11],M=h[12], N=h[13],K=h[14];h=h[15];var Q=m*x-q*v,P=m*z-t*v,S=m*A-u*v,T=q*z-t*x,R=q*A-u*x,X=t*A-u*z,Y=D*N-G*M,Z=D*K-I*M;D=D*h-H*M;var aa=G*K-I*N;G=G*h-H*N;I=I*h-H*K;H=Q*I-P*G+S*aa+T*D-R*Z+X*Y;if(!H)return null;H=1/H;f[0]=(x*I-z*G+A*aa)*H;f[1]=(z*D-v*I-A*Z)*H;f[2]=(v*G-x*D+A*Y)*H;f[3]=(t*G-q*I-u*aa)*H;f[4]=(m*I-t*D+u*Z)*H;f[5]=(q*D-m*G-u*Y)*H;f[6]=(N*X-K*R+h*T)*H;f[7]=(K*S-M*X-h*P)*H;f[8]=(M*R-N*S+h*Q)*H;return f},projection:function(f,h,m){f[0]=2/h;f[1]=0;f[2]=0;f[3]=0;f[4]=-2/m;f[5]=0;f[6]=-1;f[7]=1;f[8]=1; return f},str:function(f){return"mat3("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+", "+f[4]+", "+f[5]+", "+f[6]+", "+f[7]+", "+f[8]+")"},frob:function(f){return Math.hypot(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8])},add:function(f,h,m){f[0]=h[0]+m[0];f[1]=h[1]+m[1];f[2]=h[2]+m[2];f[3]=h[3]+m[3];f[4]=h[4]+m[4];f[5]=h[5]+m[5];f[6]=h[6]+m[6];f[7]=h[7]+m[7];f[8]=h[8]+m[8];return f},subtract:l,multiplyScalar:function(f,h,m){f[0]=h[0]*m;f[1]=h[1]*m;f[2]=h[2]*m;f[3]=h[3]*m;f[4]=h[4]*m;f[5]=h[5]*m;f[6]=h[6]* m;f[7]=h[7]*m;f[8]=h[8]*m;return f},multiplyScalarAndAdd:function(f,h,m,q){f[0]=h[0]+m[0]*q;f[1]=h[1]+m[1]*q;f[2]=h[2]+m[2]*q;f[3]=h[3]+m[3]*q;f[4]=h[4]+m[4]*q;f[5]=h[5]+m[5]*q;f[6]=h[6]+m[6]*q;f[7]=h[7]+m[7]*q;f[8]=h[8]+m[8]*q;return f},exactEquals:function(f,h){return f[0]===h[0]&&f[1]===h[1]&&f[2]===h[2]&&f[3]===h[3]&&f[4]===h[4]&&f[5]===h[5]&&f[6]===h[6]&&f[7]===h[7]&&f[8]===h[8]},equals:function(f,h){var m=f[0],q=f[1],t=f[2],u=f[3],v=f[4],x=f[5],z=f[6],A=f[7];f=f[8];var D=h[0],G=h[1],I=h[2], H=h[3],M=h[4],N=h[5],K=h[6],Q=h[7];h=h[8];return Math.abs(m-D)<=1E-6*Math.max(1,Math.abs(m),Math.abs(D))&&Math.abs(q-G)<=1E-6*Math.max(1,Math.abs(q),Math.abs(G))&&Math.abs(t-I)<=1E-6*Math.max(1,Math.abs(t),Math.abs(I))&&Math.abs(u-H)<=1E-6*Math.max(1,Math.abs(u),Math.abs(H))&&Math.abs(v-M)<=1E-6*Math.max(1,Math.abs(v),Math.abs(M))&&Math.abs(x-N)<=1E-6*Math.max(1,Math.abs(x),Math.abs(N))&&Math.abs(z-K)<=1E-6*Math.max(1,Math.abs(z),Math.abs(K))&&Math.abs(A-Q)<=1E-6*Math.max(1,Math.abs(A),Math.abs(Q))&& Math.abs(f-h)<=1E-6*Math.max(1,Math.abs(f),Math.abs(h))},mul:k,sub:l}),mb=Object.freeze({__proto__:null,create:function(){var f=new U(16);U!=Float32Array&&(f[1]=0,f[2]=0,f[3]=0,f[4]=0,f[6]=0,f[7]=0,f[8]=0,f[9]=0,f[11]=0,f[12]=0,f[13]=0,f[14]=0);f[0]=1;f[5]=1;f[10]=1;f[15]=1;return f},clone:function(f){var h=new U(16);h[0]=f[0];h[1]=f[1];h[2]=f[2];h[3]=f[3];h[4]=f[4];h[5]=f[5];h[6]=f[6];h[7]=f[7];h[8]=f[8];h[9]=f[9];h[10]=f[10];h[11]=f[11];h[12]=f[12];h[13]=f[13];h[14]=f[14];h[15]=f[15];return h}, copy:function(f,h){f[0]=h[0];f[1]=h[1];f[2]=h[2];f[3]=h[3];f[4]=h[4];f[5]=h[5];f[6]=h[6];f[7]=h[7];f[8]=h[8];f[9]=h[9];f[10]=h[10];f[11]=h[11];f[12]=h[12];f[13]=h[13];f[14]=h[14];f[15]=h[15];return f},fromValues:function(f,h,m,q,t,u,v,x,z,A,D,G,I,H,M,N){var K=new U(16);K[0]=f;K[1]=h;K[2]=m;K[3]=q;K[4]=t;K[5]=u;K[6]=v;K[7]=x;K[8]=z;K[9]=A;K[10]=D;K[11]=G;K[12]=I;K[13]=H;K[14]=M;K[15]=N;return K},set:function(f,h,m,q,t,u,v,x,z,A,D,G,I,H,M,N,K){f[0]=h;f[1]=m;f[2]=q;f[3]=t;f[4]=u;f[5]=v;f[6]=x;f[7]=z; f[8]=A;f[9]=D;f[10]=G;f[11]=I;f[12]=H;f[13]=M;f[14]=N;f[15]=K;return f},identity:n,transpose:function(f,h){if(f===h){var m=h[1],q=h[2],t=h[3],u=h[6],v=h[7],x=h[11];f[1]=h[4];f[2]=h[8];f[3]=h[12];f[4]=m;f[6]=h[9];f[7]=h[13];f[8]=q;f[9]=u;f[11]=h[14];f[12]=t;f[13]=v;f[14]=x}else f[0]=h[0],f[1]=h[4],f[2]=h[8],f[3]=h[12],f[4]=h[1],f[5]=h[5],f[6]=h[9],f[7]=h[13],f[8]=h[2],f[9]=h[6],f[10]=h[10],f[11]=h[14],f[12]=h[3],f[13]=h[7],f[14]=h[11],f[15]=h[15];return f},invert:function(f,h){var m=h[0],q=h[1],t= h[2],u=h[3],v=h[4],x=h[5],z=h[6],A=h[7],D=h[8],G=h[9],I=h[10],H=h[11],M=h[12],N=h[13],K=h[14];h=h[15];var Q=m*x-q*v,P=m*z-t*v,S=m*A-u*v,T=q*z-t*x,R=q*A-u*x,X=t*A-u*z,Y=D*N-G*M,Z=D*K-I*M,aa=D*h-H*M,da=G*K-I*N,ea=G*h-H*N,fa=I*h-H*K,ba=Q*fa-P*ea+S*da+T*aa-R*Z+X*Y;if(!ba)return null;ba=1/ba;f[0]=(x*fa-z*ea+A*da)*ba;f[1]=(t*ea-q*fa-u*da)*ba;f[2]=(N*X-K*R+h*T)*ba;f[3]=(I*R-G*X-H*T)*ba;f[4]=(z*aa-v*fa-A*Z)*ba;f[5]=(m*fa-t*aa+u*Z)*ba;f[6]=(K*S-M*X-h*P)*ba;f[7]=(D*X-I*S+H*P)*ba;f[8]=(v*ea-x*aa+A*Y)*ba;f[9]= (q*aa-m*ea-u*Y)*ba;f[10]=(M*R-N*S+h*Q)*ba;f[11]=(G*S-D*R-H*Q)*ba;f[12]=(x*Z-v*da-z*Y)*ba;f[13]=(m*da-q*Z+t*Y)*ba;f[14]=(N*P-M*T-K*Q)*ba;f[15]=(D*T-G*P+I*Q)*ba;return f},adjoint:function(f,h){var m=h[0],q=h[1],t=h[2],u=h[3],v=h[4],x=h[5],z=h[6],A=h[7],D=h[8],G=h[9],I=h[10],H=h[11],M=h[12],N=h[13],K=h[14];h=h[15];var Q=m*x-q*v,P=m*z-t*v,S=m*A-u*v,T=q*z-t*x,R=q*A-u*x,X=t*A-u*z,Y=D*N-G*M,Z=D*K-I*M,aa=D*h-H*M,da=G*K-I*N,ea=G*h-H*N,fa=I*h-H*K;f[0]=x*fa-z*ea+A*da;f[1]=t*ea-q*fa-u*da;f[2]=N*X-K*R+h*T;f[3]= I*R-G*X-H*T;f[4]=z*aa-v*fa-A*Z;f[5]=m*fa-t*aa+u*Z;f[6]=K*S-M*X-h*P;f[7]=D*X-I*S+H*P;f[8]=v*ea-x*aa+A*Y;f[9]=q*aa-m*ea-u*Y;f[10]=M*R-N*S+h*Q;f[11]=G*S-D*R-H*Q;f[12]=x*Z-v*da-z*Y;f[13]=m*da-q*Z+t*Y;f[14]=N*P-M*T-K*Q;f[15]=D*T-G*P+I*Q;return f},determinant:function(f){var h=f[0],m=f[1],q=f[2],t=f[4],u=f[5],v=f[6],x=f[8],z=f[9],A=f[10],D=f[12],G=f[13],I=f[14],H=h*u-m*t,M=h*v-q*t,N=m*v-q*u,K=x*G-z*D,Q=x*I-A*D,P=z*I-A*G;return f[7]*(h*P-m*Q+q*K)-f[3]*(t*P-u*Q+v*K)+f[15]*(x*N-z*M+A*H)-f[11]*(D*N-G*M+I*H)}, multiply:p,translate:function(f,h,m){var q=m[0],t=m[1];m=m[2];if(h===f)f[12]=h[0]*q+h[4]*t+h[8]*m+h[12],f[13]=h[1]*q+h[5]*t+h[9]*m+h[13],f[14]=h[2]*q+h[6]*t+h[10]*m+h[14],f[15]=h[3]*q+h[7]*t+h[11]*m+h[15];else{var u=h[0];var v=h[1];var x=h[2];var z=h[3];var A=h[4];var D=h[5];var G=h[6];var I=h[7];var H=h[8];var M=h[9];var N=h[10];var K=h[11];f[0]=u;f[1]=v;f[2]=x;f[3]=z;f[4]=A;f[5]=D;f[6]=G;f[7]=I;f[8]=H;f[9]=M;f[10]=N;f[11]=K;f[12]=u*q+A*t+H*m+h[12];f[13]=v*q+D*t+M*m+h[13];f[14]=x*q+G*t+N*m+h[14]; f[15]=z*q+I*t+K*m+h[15]}return f},scale:function(f,h,m){var q=m[0],t=m[1];m=m[2];f[0]=h[0]*q;f[1]=h[1]*q;f[2]=h[2]*q;f[3]=h[3]*q;f[4]=h[4]*t;f[5]=h[5]*t;f[6]=h[6]*t;f[7]=h[7]*t;f[8]=h[8]*m;f[9]=h[9]*m;f[10]=h[10]*m;f[11]=h[11]*m;f[12]=h[12];f[13]=h[13];f[14]=h[14];f[15]=h[15];return f},rotate:function(f,h,m,q){var t=q[0],u=q[1];q=q[2];var v=Math.hypot(t,u,q);if(1E-6>v)return null;v=1/v;t*=v;u*=v;q*=v;var x=Math.sin(m);var z=Math.cos(m);var A=1-z;m=h[0];v=h[1];var D=h[2];var G=h[3];var I=h[4];var H= h[5];var M=h[6];var N=h[7];var K=h[8];var Q=h[9];var P=h[10];var S=h[11];var T=t*t*A+z;var R=u*t*A+q*x;var X=q*t*A-u*x;var Y=t*u*A-q*x;var Z=u*u*A+z;var aa=q*u*A+t*x;var da=t*q*A+u*x;t=u*q*A-t*x;u=q*q*A+z;f[0]=m*T+I*R+K*X;f[1]=v*T+H*R+Q*X;f[2]=D*T+M*R+P*X;f[3]=G*T+N*R+S*X;f[4]=m*Y+I*Z+K*aa;f[5]=v*Y+H*Z+Q*aa;f[6]=D*Y+M*Z+P*aa;f[7]=G*Y+N*Z+S*aa;f[8]=m*da+I*t+K*u;f[9]=v*da+H*t+Q*u;f[10]=D*da+M*t+P*u;f[11]=G*da+N*t+S*u;h!==f&&(f[12]=h[12],f[13]=h[13],f[14]=h[14],f[15]=h[15]);return f},rotateX:function(f, h,m){var q=Math.sin(m);m=Math.cos(m);var t=h[4],u=h[5],v=h[6],x=h[7],z=h[8],A=h[9],D=h[10],G=h[11];h!==f&&(f[0]=h[0],f[1]=h[1],f[2]=h[2],f[3]=h[3],f[12]=h[12],f[13]=h[13],f[14]=h[14],f[15]=h[15]);f[4]=t*m+z*q;f[5]=u*m+A*q;f[6]=v*m+D*q;f[7]=x*m+G*q;f[8]=z*m-t*q;f[9]=A*m-u*q;f[10]=D*m-v*q;f[11]=G*m-x*q;return f},rotateY:function(f,h,m){var q=Math.sin(m);m=Math.cos(m);var t=h[0],u=h[1],v=h[2],x=h[3],z=h[8],A=h[9],D=h[10],G=h[11];h!==f&&(f[4]=h[4],f[5]=h[5],f[6]=h[6],f[7]=h[7],f[12]=h[12],f[13]=h[13], f[14]=h[14],f[15]=h[15]);f[0]=t*m-z*q;f[1]=u*m-A*q;f[2]=v*m-D*q;f[3]=x*m-G*q;f[8]=t*q+z*m;f[9]=u*q+A*m;f[10]=v*q+D*m;f[11]=x*q+G*m;return f},rotateZ:function(f,h,m){var q=Math.sin(m);m=Math.cos(m);var t=h[0],u=h[1],v=h[2],x=h[3],z=h[4],A=h[5],D=h[6],G=h[7];h!==f&&(f[8]=h[8],f[9]=h[9],f[10]=h[10],f[11]=h[11],f[12]=h[12],f[13]=h[13],f[14]=h[14],f[15]=h[15]);f[0]=t*m+z*q;f[1]=u*m+A*q;f[2]=v*m+D*q;f[3]=x*m+G*q;f[4]=z*m-t*q;f[5]=A*m-u*q;f[6]=D*m-v*q;f[7]=G*m-x*q;return f},fromTranslation:function(f,h){f[0]= 1;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=1;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=1;f[11]=0;f[12]=h[0];f[13]=h[1];f[14]=h[2];f[15]=1;return f},fromScaling:function(f,h){f[0]=h[0];f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=h[1];f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=h[2];f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f},fromRotation:function(f,h,m){var q=m[0],t=m[1];m=m[2];var u=Math.hypot(q,t,m);if(1E-6>u)return null;u=1/u;q*=u;t*=u;m*=u;u=Math.sin(h);h=Math.cos(h);var v=1-h;f[0]=q*q*v+h;f[1]=t*q*v+m*u;f[2]=m*q*v-t*u;f[3]= 0;f[4]=q*t*v-m*u;f[5]=t*t*v+h;f[6]=m*t*v+q*u;f[7]=0;f[8]=q*m*v+t*u;f[9]=t*m*v-q*u;f[10]=m*m*v+h;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f},fromXRotation:function(f,h){var m=Math.sin(h);h=Math.cos(h);f[0]=1;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=h;f[6]=m;f[7]=0;f[8]=0;f[9]=-m;f[10]=h;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f},fromYRotation:function(f,h){var m=Math.sin(h);h=Math.cos(h);f[0]=h;f[1]=0;f[2]=-m;f[3]=0;f[4]=0;f[5]=1;f[6]=0;f[7]=0;f[8]=m;f[9]=0;f[10]=h;f[11]=0;f[12]=0;f[13]=0;f[14]= 0;f[15]=1;return f},fromZRotation:function(f,h){var m=Math.sin(h);h=Math.cos(h);f[0]=h;f[1]=m;f[2]=0;f[3]=0;f[4]=-m;f[5]=h;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=1;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f},fromRotationTranslation:r,fromQuat2:function(f,h){var m=new U(3),q=-h[0],t=-h[1],u=-h[2],v=h[3],x=h[4],z=h[5],A=h[6],D=h[7],G=q*q+t*t+u*u+v*v;0<G?(m[0]=2*(x*v+D*q+z*u-A*t)/G,m[1]=2*(z*v+D*t+A*q-x*u)/G,m[2]=2*(A*v+D*u+x*t-z*q)/G):(m[0]=2*(x*v+D*q+z*u-A*t),m[1]=2*(z*v+D*t+A*q-x*u),m[2]=2*(A*v+ D*u+x*t-z*q));r(f,h,m);return f},getTranslation:w,getScaling:y,getRotation:B,decompose:function(f,h,m,q){h[0]=q[12];h[1]=q[13];h[2]=q[14];var t=q[0],u=q[1],v=q[2],x=q[4],z=q[5],A=q[6],D=q[8];h=q[9];q=q[10];m[0]=Math.hypot(t,u,v);m[1]=Math.hypot(x,z,A);m[2]=Math.hypot(D,h,q);var G=1/m[0],I=1/m[1],H=1/m[2];m=t*G;u*=I;v*=H;x*=G;z*=I;A*=H;D*=G;h*=I;q*=H;I=m+z+q;0<I?(q=2*Math.sqrt(I+1),f[3]=.25*q,f[0]=(A-h)/q,f[1]=(D-v)/q,f[2]=(u-x)/q):m>z&&m>q?(q=2*Math.sqrt(1+m-z-q),f[3]=(A-h)/q,f[0]=.25*q,f[1]=(u+x)/ q,f[2]=(D+v)/q):z>q?(q=2*Math.sqrt(1+z-m-q),f[3]=(D-v)/q,f[0]=(u+x)/q,f[1]=.25*q,f[2]=(A+h)/q):(q=2*Math.sqrt(1+q-m-z),f[3]=(u-x)/q,f[0]=(D+v)/q,f[1]=(A+h)/q,f[2]=.25*q);return f},fromRotationTranslationScale:function(f,h,m,q){var t=h[0],u=h[1],v=h[2],x=h[3],z=t+t,A=u+u,D=v+v;h=t*z;var G=t*A;t*=D;var I=u*A;u*=D;v*=D;z*=x;A*=x;x*=D;D=q[0];var H=q[1];q=q[2];f[0]=(1-(I+v))*D;f[1]=(G+x)*D;f[2]=(t-A)*D;f[3]=0;f[4]=(G-x)*H;f[5]=(1-(h+v))*H;f[6]=(u+z)*H;f[7]=0;f[8]=(t+A)*q;f[9]=(u-z)*q;f[10]=(1-(h+I))*q; f[11]=0;f[12]=m[0];f[13]=m[1];f[14]=m[2];f[15]=1;return f},fromRotationTranslationScaleOrigin:function(f,h,m,q,t){var u=h[0],v=h[1],x=h[2],z=h[3],A=u+u,D=v+v,G=x+x;h=u*A;var I=u*D,H=u*G;u=v*D;v*=G;var M=x*G;x=z*A;D*=z;var N=z*G,K=q[0],Q=q[1];G=q[2];q=t[0];z=t[1];t=t[2];A=(1-(u+M))*K;var P=(I+N)*K;K*=H-D;I=(I-N)*Q;M=(1-(h+M))*Q;Q*=v+x;H=(H+D)*G;v=(v-x)*G;h=(1-(h+u))*G;f[0]=A;f[1]=P;f[2]=K;f[3]=0;f[4]=I;f[5]=M;f[6]=Q;f[7]=0;f[8]=H;f[9]=v;f[10]=h;f[11]=0;f[12]=m[0]+q-(A*q+I*z+H*t);f[13]=m[1]+z-(P*q+ M*z+v*t);f[14]=m[2]+t-(K*q+Q*z+h*t);f[15]=1;return f},fromQuat:function(f,h){var m=h[0],q=h[1],t=h[2];h=h[3];var u=m+m,v=q+q,x=t+t;m*=u;var z=q*u;q*=v;var A=t*u,D=t*v;t*=x;u*=h;v*=h;h*=x;f[0]=1-q-t;f[1]=z+h;f[2]=A-v;f[3]=0;f[4]=z-h;f[5]=1-m-t;f[6]=D+u;f[7]=0;f[8]=A+v;f[9]=D-u;f[10]=1-m-q;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f},frustum:function(f,h,m,q,t,u,v){var x=1/(m-h),z=1/(t-q),A=1/(u-v);f[0]=2*u*x;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=2*u*z;f[6]=0;f[7]=0;f[8]=(m+h)*x;f[9]=(t+q)*z;f[10]= (v+u)*A;f[11]=-1;f[12]=0;f[13]=0;f[14]=v*u*2*A;f[15]=0;return f},perspectiveNO:C,perspective:C,perspectiveZO:function(f,h,m,q,t){h=1/Math.tan(h/2);f[0]=h/m;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=h;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[11]=-1;f[12]=0;f[13]=0;f[15]=0;null!=t&&Infinity!==t?(m=1/(q-t),f[10]=t*m,f[14]=t*q*m):(f[10]=-1,f[14]=-q);return f},perspectiveFromFieldOfView:function(f,h,m,q){var t=Math.tan(h.upDegrees*Math.PI/180),u=Math.tan(h.downDegrees*Math.PI/180),v=Math.tan(h.leftDegrees*Math.PI/180);h= Math.tan(h.rightDegrees*Math.PI/180);var x=2/(v+h),z=2/(t+u);f[0]=x;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=z;f[6]=0;f[7]=0;f[8]=-((v-h)*x*.5);f[9]=(t-u)*z*.5;f[10]=q/(m-q);f[11]=-1;f[12]=0;f[13]=0;f[14]=q*m/(m-q);f[15]=0;return f},orthoNO:E,ortho:E,orthoZO:function(f,h,m,q,t,u,v){var x=1/(h-m),z=1/(q-t);v=1/(u-v);f[0]=-2*x;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=-2*z;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=v;f[11]=0;f[12]=(h+m)*x;f[13]=(t+q)*z;f[14]=u*v;f[15]=1;return f},lookAt:function(f,h,m,q){var t=h[0],u=h[1];h= h[2];var v=q[0];var x=q[1];var z=q[2];var A=m[0];q=m[1];var D=m[2];if(1E-6>Math.abs(t-A)&&1E-6>Math.abs(u-q)&&1E-6>Math.abs(h-D))return n(f);m=t-A;q=u-q;A=h-D;var G=1/Math.hypot(m,q,A);m*=G;q*=G;A*=G;D=x*A-z*q;z=z*m-v*A;v=v*q-x*m;(G=Math.hypot(D,z,v))?(G=1/G,D*=G,z*=G,v*=G):v=z=D=0;x=q*v-A*z;var I=A*D-m*v;var H=m*z-q*D;(G=Math.hypot(x,I,H))?(G=1/G,x*=G,I*=G,H*=G):H=I=x=0;f[0]=D;f[1]=x;f[2]=m;f[3]=0;f[4]=z;f[5]=I;f[6]=q;f[7]=0;f[8]=v;f[9]=H;f[10]=A;f[11]=0;f[12]=-(D*t+z*u+v*h);f[13]=-(x*t+I*u+H*h); f[14]=-(m*t+q*u+A*h);f[15]=1;return f},targetTo:function(f,h,m,q){var t=h[0],u=h[1];h=h[2];var v=q[0],x=q[1],z=q[2];q=t-m[0];var A=u-m[1];m=h-m[2];var D=q*q+A*A+m*m;0<D&&(D=1/Math.sqrt(D),q*=D,A*=D,m*=D);var G=x*m-z*A;z=z*q-v*m;v=v*A-x*q;D=G*G+z*z+v*v;0<D&&(D=1/Math.sqrt(D),G*=D,z*=D,v*=D);f[0]=G;f[1]=z;f[2]=v;f[3]=0;f[4]=A*v-m*z;f[5]=m*G-q*v;f[6]=q*z-A*G;f[7]=0;f[8]=q;f[9]=A;f[10]=m;f[11]=0;f[12]=t;f[13]=u;f[14]=h;f[15]=1;return f},str:function(f){return"mat4("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+ ", "+f[4]+", "+f[5]+", "+f[6]+", "+f[7]+", "+f[8]+", "+f[9]+", "+f[10]+", "+f[11]+", "+f[12]+", "+f[13]+", "+f[14]+", "+f[15]+")"},frob:function(f){return Math.hypot(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15])},add:function(f,h,m){f[0]=h[0]+m[0];f[1]=h[1]+m[1];f[2]=h[2]+m[2];f[3]=h[3]+m[3];f[4]=h[4]+m[4];f[5]=h[5]+m[5];f[6]=h[6]+m[6];f[7]=h[7]+m[7];f[8]=h[8]+m[8];f[9]=h[9]+m[9];f[10]=h[10]+m[10];f[11]=h[11]+m[11];f[12]=h[12]+m[12];f[13]=h[13]+m[13];f[14]= h[14]+m[14];f[15]=h[15]+m[15];return f},subtract:F,multiplyScalar:function(f,h,m){f[0]=h[0]*m;f[1]=h[1]*m;f[2]=h[2]*m;f[3]=h[3]*m;f[4]=h[4]*m;f[5]=h[5]*m;f[6]=h[6]*m;f[7]=h[7]*m;f[8]=h[8]*m;f[9]=h[9]*m;f[10]=h[10]*m;f[11]=h[11]*m;f[12]=h[12]*m;f[13]=h[13]*m;f[14]=h[14]*m;f[15]=h[15]*m;return f},multiplyScalarAndAdd:function(f,h,m,q){f[0]=h[0]+m[0]*q;f[1]=h[1]+m[1]*q;f[2]=h[2]+m[2]*q;f[3]=h[3]+m[3]*q;f[4]=h[4]+m[4]*q;f[5]=h[5]+m[5]*q;f[6]=h[6]+m[6]*q;f[7]=h[7]+m[7]*q;f[8]=h[8]+m[8]*q;f[9]=h[9]+m[9]* q;f[10]=h[10]+m[10]*q;f[11]=h[11]+m[11]*q;f[12]=h[12]+m[12]*q;f[13]=h[13]+m[13]*q;f[14]=h[14]+m[14]*q;f[15]=h[15]+m[15]*q;return f},exactEquals:function(f,h){return f[0]===h[0]&&f[1]===h[1]&&f[2]===h[2]&&f[3]===h[3]&&f[4]===h[4]&&f[5]===h[5]&&f[6]===h[6]&&f[7]===h[7]&&f[8]===h[8]&&f[9]===h[9]&&f[10]===h[10]&&f[11]===h[11]&&f[12]===h[12]&&f[13]===h[13]&&f[14]===h[14]&&f[15]===h[15]},equals:function(f,h){var m=f[0],q=f[1],t=f[2],u=f[3],v=f[4],x=f[5],z=f[6],A=f[7],D=f[8],G=f[9],I=f[10],H=f[11],M=f[12], N=f[13],K=f[14];f=f[15];var Q=h[0],P=h[1],S=h[2],T=h[3],R=h[4],X=h[5],Y=h[6],Z=h[7],aa=h[8],da=h[9],ea=h[10],fa=h[11],ba=h[12],fb=h[13],gb=h[14];h=h[15];return Math.abs(m-Q)<=1E-6*Math.max(1,Math.abs(m),Math.abs(Q))&&Math.abs(q-P)<=1E-6*Math.max(1,Math.abs(q),Math.abs(P))&&Math.abs(t-S)<=1E-6*Math.max(1,Math.abs(t),Math.abs(S))&&Math.abs(u-T)<=1E-6*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(v-R)<=1E-6*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(x-X)<=1E-6*Math.max(1,Math.abs(x),Math.abs(X))&& Math.abs(z-Y)<=1E-6*Math.max(1,Math.abs(z),Math.abs(Y))&&Math.abs(A-Z)<=1E-6*Math.max(1,Math.abs(A),Math.abs(Z))&&Math.abs(D-aa)<=1E-6*Math.max(1,Math.abs(D),Math.abs(aa))&&Math.abs(G-da)<=1E-6*Math.max(1,Math.abs(G),Math.abs(da))&&Math.abs(I-ea)<=1E-6*Math.max(1,Math.abs(I),Math.abs(ea))&&Math.abs(H-fa)<=1E-6*Math.max(1,Math.abs(H),Math.abs(fa))&&Math.abs(M-ba)<=1E-6*Math.max(1,Math.abs(M),Math.abs(ba))&&Math.abs(N-fb)<=1E-6*Math.max(1,Math.abs(N),Math.abs(fb))&&Math.abs(K-gb)<=1E-6*Math.max(1,Math.abs(K), Math.abs(gb))&&Math.abs(f-h)<=1E-6*Math.max(1,Math.abs(f),Math.abs(h))},mul:p,sub:F}),va=function(){var f=J();return function(h,m,q,t,u,v){m||(m=3);q||(q=0);for(t=t?Math.min(t*m+q,h.length):h.length;q<t;q+=m)f[0]=h[q],f[1]=h[q+1],f[2]=h[q+2],u(f,f,v),h[q]=f[0],h[q+1]=f[1],h[q+2]=f[2];return h}}();va=Object.freeze({__proto__:null,create:J,clone:function(f){var h=new U(3);h[0]=f[0];h[1]=f[1];h[2]=f[2];return h},length:L,fromValues:O,copy:function(f,h){f[0]=h[0];f[1]=h[1];f[2]=h[2];return f},set:function(f, h,m,q){f[0]=h;f[1]=m;f[2]=q;return f},add:function(f,h,m){f[0]=h[0]+m[0];f[1]=h[1]+m[1];f[2]=h[2]+m[2];return f},subtract:V,multiply:W,divide:ca,ceil:function(f,h){f[0]=Math.ceil(h[0]);f[1]=Math.ceil(h[1]);f[2]=Math.ceil(h[2]);return f},floor:function(f,h){f[0]=Math.floor(h[0]);f[1]=Math.floor(h[1]);f[2]=Math.floor(h[2]);return f},min:function(f,h,m){f[0]=Math.min(h[0],m[0]);f[1]=Math.min(h[1],m[1]);f[2]=Math.min(h[2],m[2]);return f},max:function(f,h,m){f[0]=Math.max(h[0],m[0]);f[1]=Math.max(h[1], m[1]);f[2]=Math.max(h[2],m[2]);return f},round:function(f,h){f[0]=Math.round(h[0]);f[1]=Math.round(h[1]);f[2]=Math.round(h[2]);return f},scale:function(f,h,m){f[0]=h[0]*m;f[1]=h[1]*m;f[2]=h[2]*m;return f},scaleAndAdd:function(f,h,m,q){f[0]=h[0]+m[0]*q;f[1]=h[1]+m[1]*q;f[2]=h[2]+m[2]*q;return f},distance:la,squaredDistance:ma,squaredLength:za,negate:function(f,h){f[0]=-h[0];f[1]=-h[1];f[2]=-h[2];return f},inverse:function(f,h){f[0]=1/h[0];f[1]=1/h[1];f[2]=1/h[2];return f},normalize:Aa,dot:oa,cross:pa, lerp:function(f,h,m,q){var t=h[0],u=h[1];h=h[2];f[0]=t+q*(m[0]-t);f[1]=u+q*(m[1]-u);f[2]=h+q*(m[2]-h);return f},slerp:function(f,h,m,q){var t=Math.acos(Math.min(Math.max(oa(h,m),-1),1)),u=Math.sin(t),v=Math.sin((1-q)*t)/u;q=Math.sin(q*t)/u;f[0]=v*h[0]+q*m[0];f[1]=v*h[1]+q*m[1];f[2]=v*h[2]+q*m[2];return f},hermite:function(f,h,m,q,t,u){var v=u*u,x=v*(2*u-3)+1,z=v*(u-2)+u,A=v*(u-1);u=v*(3-2*u);f[0]=h[0]*x+m[0]*z+q[0]*A+t[0]*u;f[1]=h[1]*x+m[1]*z+q[1]*A+t[1]*u;f[2]=h[2]*x+m[2]*z+q[2]*A+t[2]*u;return f}, bezier:function(f,h,m,q,t,u){var v=1-u,x=v*v,z=u*u,A=x*v;x*=3*u;v*=3*z;u*=z;f[0]=h[0]*A+m[0]*x+q[0]*v+t[0]*u;f[1]=h[1]*A+m[1]*x+q[1]*v+t[1]*u;f[2]=h[2]*A+m[2]*x+q[2]*v+t[2]*u;return f},random:function(f,h){h=h||1;var m=2*ha()*Math.PI,q=2*ha()-1,t=Math.sqrt(1-q*q)*h;f[0]=Math.cos(m)*t;f[1]=Math.sin(m)*t;f[2]=q*h;return f},transformMat4:function(f,h,m){var q=h[0],t=h[1];h=h[2];var u=m[3]*q+m[7]*t+m[11]*h+m[15];u=u||1;f[0]=(m[0]*q+m[4]*t+m[8]*h+m[12])/u;f[1]=(m[1]*q+m[5]*t+m[9]*h+m[13])/u;f[2]=(m[2]* q+m[6]*t+m[10]*h+m[14])/u;return f},transformMat3:function(f,h,m){var q=h[0],t=h[1];h=h[2];f[0]=q*m[0]+t*m[3]+h*m[6];f[1]=q*m[1]+t*m[4]+h*m[7];f[2]=q*m[2]+t*m[5]+h*m[8];return f},transformQuat:function(f,h,m){var q=m[0],t=m[1],u=m[2],v=h[0],x=h[1];h=h[2];var z=t*h-u*x,A=u*v-q*h,D=q*x-t*v;m=2*m[3];f[0]=v+z*m+2*(t*D-u*A);f[1]=x+A*m+2*(u*z-q*D);f[2]=h+D*m+2*(q*A-t*z);return f},rotateX:function(f,h,m,q){var t=[],u=[];t[0]=h[0]-m[0];t[1]=h[1]-m[1];t[2]=h[2]-m[2];u[0]=t[0];u[1]=t[1]*Math.cos(q)-t[2]*Math.sin(q); u[2]=t[1]*Math.sin(q)+t[2]*Math.cos(q);f[0]=u[0]+m[0];f[1]=u[1]+m[1];f[2]=u[2]+m[2];return f},rotateY:function(f,h,m,q){var t=[],u=[];t[0]=h[0]-m[0];t[1]=h[1]-m[1];t[2]=h[2]-m[2];u[0]=t[2]*Math.sin(q)+t[0]*Math.cos(q);u[1]=t[1];u[2]=t[2]*Math.cos(q)-t[0]*Math.sin(q);f[0]=u[0]+m[0];f[1]=u[1]+m[1];f[2]=u[2]+m[2];return f},rotateZ:function(f,h,m,q){var t=[],u=[];t[0]=h[0]-m[0];t[1]=h[1]-m[1];t[2]=h[2]-m[2];u[0]=t[0]*Math.cos(q)-t[1]*Math.sin(q);u[1]=t[0]*Math.sin(q)+t[1]*Math.cos(q);u[2]=t[2];f[0]=u[0]+ m[0];f[1]=u[1]+m[1];f[2]=u[2]+m[2];return f},angle:function(f,h){var m=f[0],q=f[1],t=f[2],u=h[0],v=h[1],x=h[2];f=(m=Math.sqrt((m*m+q*q+t*t)*(u*u+v*v+x*x)))&&oa(f,h)/m;return Math.acos(Math.min(Math.max(f,-1),1))},zero:function(f){f[0]=0;f[1]=0;f[2]=0;return f},str:function(f){return"vec3("+f[0]+", "+f[1]+", "+f[2]+")"},exactEquals:function(f,h){return f[0]===h[0]&&f[1]===h[1]&&f[2]===h[2]},equals:function(f,h){var m=f[0],q=f[1];f=f[2];var t=h[0],u=h[1];h=h[2];return Math.abs(m-t)<=1E-6*Math.max(1, Math.abs(m),Math.abs(t))&&Math.abs(q-u)<=1E-6*Math.max(1,Math.abs(q),Math.abs(u))&&Math.abs(f-h)<=1E-6*Math.max(1,Math.abs(f),Math.abs(h))},sub:V,mul:W,div:ca,dist:la,sqrDist:ma,len:L,sqrLen:za,forEach:va});var wa=function(){var f=Ba();return function(h,m,q,t,u,v){m||(m=4);q||(q=0);for(t=t?Math.min(t*m+q,h.length):h.length;q<t;q+=m)f[0]=h[q],f[1]=h[q+1],f[2]=h[q+2],f[3]=h[q+3],u(f,f,v),h[q]=f[0],h[q+1]=f[1],h[q+2]=f[2],h[q+3]=f[3];return h}}();wa=Object.freeze({__proto__:null,create:Ba,clone:Ca,fromValues:Da, copy:qa,set:Ea,add:Fa,subtract:Ga,multiply:Ha,divide:Ia,ceil:function(f,h){f[0]=Math.ceil(h[0]);f[1]=Math.ceil(h[1]);f[2]=Math.ceil(h[2]);f[3]=Math.ceil(h[3]);return f},floor:function(f,h){f[0]=Math.floor(h[0]);f[1]=Math.floor(h[1]);f[2]=Math.floor(h[2]);f[3]=Math.floor(h[3]);return f},min:function(f,h,m){f[0]=Math.min(h[0],m[0]);f[1]=Math.min(h[1],m[1]);f[2]=Math.min(h[2],m[2]);f[3]=Math.min(h[3],m[3]);return f},max:function(f,h,m){f[0]=Math.max(h[0],m[0]);f[1]=Math.max(h[1],m[1]);f[2]=Math.max(h[2], m[2]);f[3]=Math.max(h[3],m[3]);return f},round:function(f,h){f[0]=Math.round(h[0]);f[1]=Math.round(h[1]);f[2]=Math.round(h[2]);f[3]=Math.round(h[3]);return f},scale:ua,scaleAndAdd:function(f,h,m,q){f[0]=h[0]+m[0]*q;f[1]=h[1]+m[1]*q;f[2]=h[2]+m[2]*q;f[3]=h[3]+m[3]*q;return f},distance:Ja,squaredDistance:Ka,length:ja,squaredLength:ia,negate:function(f,h){f[0]=-h[0];f[1]=-h[1];f[2]=-h[2];f[3]=-h[3];return f},inverse:function(f,h){f[0]=1/h[0];f[1]=1/h[1];f[2]=1/h[2];f[3]=1/h[3];return f},normalize:ra, dot:ka,cross:function(f,h,m,q){var t=m[0]*q[1]-m[1]*q[0],u=m[0]*q[2]-m[2]*q[0],v=m[0]*q[3]-m[3]*q[0],x=m[1]*q[2]-m[2]*q[1],z=m[1]*q[3]-m[3]*q[1];m=m[2]*q[3]-m[3]*q[2];q=h[0];var A=h[1],D=h[2];h=h[3];f[0]=A*m-D*z+h*x;f[1]=-(q*m)+D*v-h*u;f[2]=q*z-A*v+h*t;f[3]=-(q*x)+A*u-D*t;return f},lerp:La,random:function(f,h){h=h||1;do{var m=2*ha()-1;var q=2*ha()-1;var t=m*m+q*q}while(1<=t);do{var u=2*ha()-1;var v=2*ha()-1;var x=u*u+v*v}while(1<=x);t=Math.sqrt((1-t)/x);f[0]=h*m;f[1]=h*q;f[2]=h*u*t;f[3]=h*v*t;return f}, transformMat4:function(f,h,m){var q=h[0],t=h[1],u=h[2];h=h[3];f[0]=m[0]*q+m[4]*t+m[8]*u+m[12]*h;f[1]=m[1]*q+m[5]*t+m[9]*u+m[13]*h;f[2]=m[2]*q+m[6]*t+m[10]*u+m[14]*h;f[3]=m[3]*q+m[7]*t+m[11]*u+m[15]*h;return f},transformQuat:function(f,h,m){var q=h[0],t=h[1],u=h[2],v=m[0],x=m[1],z=m[2];m=m[3];var A=m*q+x*u-z*t,D=m*t+z*q-v*u,G=m*u+v*t-x*q;q=-v*q-x*t-z*u;f[0]=A*m+q*-v+D*-z-G*-x;f[1]=D*m+q*-x+G*-v-A*-z;f[2]=G*m+q*-z+A*-x-D*-v;f[3]=h[3];return f},zero:function(f){f[0]=0;f[1]=0;f[2]=0;f[3]=0;return f}, str:function(f){return"vec4("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+")"},exactEquals:Ma,equals:function(f,h){var m=f[0],q=f[1],t=f[2];f=f[3];var u=h[0],v=h[1],x=h[2];h=h[3];return Math.abs(m-u)<=1E-6*Math.max(1,Math.abs(m),Math.abs(u))&&Math.abs(q-v)<=1E-6*Math.max(1,Math.abs(q),Math.abs(v))&&Math.abs(t-x)<=1E-6*Math.max(1,Math.abs(t),Math.abs(x))&&Math.abs(f-h)<=1E-6*Math.max(1,Math.abs(f),Math.abs(h))},sub:Ga,mul:Ha,div:Ia,dist:Ja,sqrDist:Ka,len:ja,sqrLen:ia,forEach:wa});var xa=function(){var f=J(), h=O(1,0,0),m=O(0,1,0);return function(q,t,u){var v=oa(t,u);if(-.999999>v)return pa(f,h,t),1E-6>L(f)&&pa(f,m,t),Aa(f,f),Na(q,f,Math.PI),q;if(.999999<v)return q[0]=0,q[1]=0,q[2]=0,q[3]=1,q;pa(f,t,u);q[0]=f[0];q[1]=f[1];q[2]=f[2];q[3]=1+v;return ra(q,q)}}(),ya=function(){var f=sa(),h=sa();return function(m,q,t,u,v,x){ta(f,q,v,x);ta(h,t,u,x);ta(m,f,h,2*x*(1-x));return m}}(),na=function(){var f=g();return function(h,m,q,t){f[0]=q[0];f[3]=q[1];f[6]=q[2];f[1]=t[0];f[4]=t[1];f[7]=t[2];f[2]=-m[0];f[5]=-m[1]; f[8]=-m[2];return ra(h,Ua(h,f))}}();xa=Object.freeze({__proto__:null,create:sa,identity:function(f){f[0]=0;f[1]=0;f[2]=0;f[3]=1;return f},setAxisAngle:Na,getAxisAngle:function(f,h){var m=2*Math.acos(h[3]),q=Math.sin(m/2);1E-6<q?(f[0]=h[0]/q,f[1]=h[1]/q,f[2]=h[2]/q):(f[0]=1,f[1]=0,f[2]=0);return m},getAngle:function(f,h){f=ka(f,h);return Math.acos(2*f*f-1)},multiply:Oa,rotateX:Pa,rotateY:Qa,rotateZ:Ra,calculateW:function(f,h){var m=h[0],q=h[1];h=h[2];f[0]=m;f[1]=q;f[2]=h;f[3]=Math.sqrt(Math.abs(1- m*m-q*q-h*h));return f},exp:Sa,ln:Ta,pow:function(f,h,m){Ta(f,h);ua(f,f,m);Sa(f,f);return f},slerp:ta,random:function(f){var h=ha(),m=ha(),q=ha(),t=Math.sqrt(1-h);h=Math.sqrt(h);f[0]=t*Math.sin(2*Math.PI*m);f[1]=t*Math.cos(2*Math.PI*m);f[2]=h*Math.sin(2*Math.PI*q);f[3]=h*Math.cos(2*Math.PI*q);return f},invert:function(f,h){var m=h[0],q=h[1],t=h[2];h=h[3];var u=m*m+q*q+t*t+h*h;u=u?1/u:0;f[0]=-m*u;f[1]=-q*u;f[2]=-t*u;f[3]=h*u;return f},conjugate:function(f,h){f[0]=-h[0];f[1]=-h[1];f[2]=-h[2];f[3]=h[3]; return f},fromMat3:Ua,fromEuler:function(f,h,m,q){var t=4<arguments.length&&void 0!==arguments[4]?arguments[4]:"zyx",u=Math.PI/360;h*=u;q*=u;m*=u;u=Math.sin(h);var v=Math.cos(h),x=Math.sin(m),z=Math.cos(m),A=Math.sin(q),D=Math.cos(q);switch(t){case "xyz":f[0]=u*z*D+v*x*A;f[1]=v*x*D-u*z*A;f[2]=v*z*A+u*x*D;f[3]=v*z*D-u*x*A;break;case "xzy":f[0]=u*z*D-v*x*A;f[1]=v*x*D-u*z*A;f[2]=v*z*A+u*x*D;f[3]=v*z*D+u*x*A;break;case "yxz":f[0]=u*z*D+v*x*A;f[1]=v*x*D-u*z*A;f[2]=v*z*A-u*x*D;f[3]=v*z*D+u*x*A;break;case "yzx":f[0]= u*z*D+v*x*A;f[1]=v*x*D+u*z*A;f[2]=v*z*A-u*x*D;f[3]=v*z*D-u*x*A;break;case "zxy":f[0]=u*z*D-v*x*A;f[1]=v*x*D+u*z*A;f[2]=v*z*A+u*x*D;f[3]=v*z*D-u*x*A;break;case "zyx":f[0]=u*z*D-v*x*A;f[1]=v*x*D+u*z*A;f[2]=v*z*A-u*x*D;f[3]=v*z*D+u*x*A;break;default:throw Error("Unknown angle order "+t);}return f},str:function(f){return"quat("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+")"},clone:Ca,fromValues:Da,copy:qa,set:Ea,add:Fa,mul:Oa,scale:ua,dot:ka,lerp:La,length:ja,len:ja,squaredLength:ia,sqrLen:ia,normalize:ra,exactEquals:Ma, equals:function(f,h){return.999999<=Math.abs(ka(f,h))},rotationTo:xa,sqlerp:ya,setAxes:na});ya=Object.freeze({__proto__:null,create:function(){var f=new U(8);U!=Float32Array&&(f[0]=0,f[1]=0,f[2]=0,f[4]=0,f[5]=0,f[6]=0,f[7]=0);f[3]=1;return f},clone:function(f){var h=new U(8);h[0]=f[0];h[1]=f[1];h[2]=f[2];h[3]=f[3];h[4]=f[4];h[5]=f[5];h[6]=f[6];h[7]=f[7];return h},fromValues:function(f,h,m,q,t,u,v,x){var z=new U(8);z[0]=f;z[1]=h;z[2]=m;z[3]=q;z[4]=t;z[5]=u;z[6]=v;z[7]=x;return z},fromRotationTranslationValues:function(f, h,m,q,t,u,v){var x=new U(8);x[0]=f;x[1]=h;x[2]=m;x[3]=q;t*=.5;u*=.5;v*=.5;x[4]=t*q+u*m-v*h;x[5]=u*q+v*f-t*m;x[6]=v*q+t*h-u*f;x[7]=-t*f-u*h-v*m;return x},fromRotationTranslation:Va,fromTranslation:function(f,h){f[0]=0;f[1]=0;f[2]=0;f[3]=1;f[4]=.5*h[0];f[5]=.5*h[1];f[6]=.5*h[2];f[7]=0;return f},fromRotation:function(f,h){f[0]=h[0];f[1]=h[1];f[2]=h[2];f[3]=h[3];f[4]=0;f[5]=0;f[6]=0;f[7]=0;return f},fromMat4:function(f,h){var m=sa();B(m,h);var q=new U(3);w(q,h);Va(f,m,q);return f},copy:Wa,identity:function(f){f[0]= 0;f[1]=0;f[2]=0;f[3]=1;f[4]=0;f[5]=0;f[6]=0;f[7]=0;return f},set:function(f,h,m,q,t,u,v,x,z){f[0]=h;f[1]=m;f[2]=q;f[3]=t;f[4]=u;f[5]=v;f[6]=x;f[7]=z;return f},getReal:qa,getDual:function(f,h){f[0]=h[4];f[1]=h[5];f[2]=h[6];f[3]=h[7];return f},setReal:qa,setDual:function(f,h){f[4]=h[0];f[5]=h[1];f[6]=h[2];f[7]=h[3];return f},getTranslation:function(f,h){var m=h[4],q=h[5],t=h[6],u=h[7],v=-h[0],x=-h[1],z=-h[2];h=h[3];f[0]=2*(m*h+u*v+q*z-t*x);f[1]=2*(q*h+u*x+t*v-m*z);f[2]=2*(t*h+u*z+m*x-q*v);return f}, translate:function(f,h,m){var q=h[0],t=h[1],u=h[2],v=h[3],x=.5*m[0],z=.5*m[1];m=.5*m[2];var A=h[4],D=h[5],G=h[6];h=h[7];f[0]=q;f[1]=t;f[2]=u;f[3]=v;f[4]=v*x+t*m-u*z+A;f[5]=v*z+u*x-q*m+D;f[6]=v*m+q*z-t*x+G;f[7]=-q*x-t*z-u*m+h;return f},rotateX:function(f,h,m){var q=-h[0],t=-h[1],u=-h[2],v=h[3],x=h[4],z=h[5],A=h[6],D=h[7],G=x*v+D*q+z*u-A*t,I=z*v+D*t+A*q-x*u,H=A*v+D*u+x*t-z*q;x=D*v-x*q-z*t-A*u;Pa(f,h,m);q=f[0];t=f[1];u=f[2];v=f[3];f[4]=G*v+x*q+I*u-H*t;f[5]=I*v+x*t+H*q-G*u;f[6]=H*v+x*u+G*t-I*q;f[7]=x* v-G*q-I*t-H*u;return f},rotateY:function(f,h,m){var q=-h[0],t=-h[1],u=-h[2],v=h[3],x=h[4],z=h[5],A=h[6],D=h[7],G=x*v+D*q+z*u-A*t,I=z*v+D*t+A*q-x*u,H=A*v+D*u+x*t-z*q;x=D*v-x*q-z*t-A*u;Qa(f,h,m);q=f[0];t=f[1];u=f[2];v=f[3];f[4]=G*v+x*q+I*u-H*t;f[5]=I*v+x*t+H*q-G*u;f[6]=H*v+x*u+G*t-I*q;f[7]=x*v-G*q-I*t-H*u;return f},rotateZ:function(f,h,m){var q=-h[0],t=-h[1],u=-h[2],v=h[3],x=h[4],z=h[5],A=h[6],D=h[7],G=x*v+D*q+z*u-A*t,I=z*v+D*t+A*q-x*u,H=A*v+D*u+x*t-z*q;x=D*v-x*q-z*t-A*u;Ra(f,h,m);q=f[0];t=f[1];u=f[2]; v=f[3];f[4]=G*v+x*q+I*u-H*t;f[5]=I*v+x*t+H*q-G*u;f[6]=H*v+x*u+G*t-I*q;f[7]=x*v-G*q-I*t-H*u;return f},rotateByQuatAppend:function(f,h,m){var q=m[0],t=m[1],u=m[2];m=m[3];var v=h[0],x=h[1],z=h[2],A=h[3];f[0]=v*m+A*q+x*u-z*t;f[1]=x*m+A*t+z*q-v*u;f[2]=z*m+A*u+v*t-x*q;f[3]=A*m-v*q-x*t-z*u;v=h[4];x=h[5];z=h[6];A=h[7];f[4]=v*m+A*q+x*u-z*t;f[5]=x*m+A*t+z*q-v*u;f[6]=z*m+A*u+v*t-x*q;f[7]=A*m-v*q-x*t-z*u;return f},rotateByQuatPrepend:function(f,h,m){var q=h[0],t=h[1],u=h[2];h=h[3];var v=m[0],x=m[1],z=m[2],A= m[3];f[0]=q*A+h*v+t*z-u*x;f[1]=t*A+h*x+u*v-q*z;f[2]=u*A+h*z+q*x-t*v;f[3]=h*A-q*v-t*x-u*z;v=m[4];x=m[5];z=m[6];A=m[7];f[4]=q*A+h*v+t*z-u*x;f[5]=t*A+h*x+u*v-q*z;f[6]=u*A+h*z+q*x-t*v;f[7]=h*A-q*v-t*x-u*z;return f},rotateAroundAxis:function(f,h,m,q){if(1E-6>Math.abs(q))return Wa(f,h);var t=Math.hypot(m[0],m[1],m[2]);q*=.5;var u=Math.sin(q),v=u*m[0]/t,x=u*m[1]/t;m=u*m[2]/t;q=Math.cos(q);t=h[0];u=h[1];var z=h[2],A=h[3];f[0]=t*q+A*v+u*m-z*x;f[1]=u*q+A*x+z*v-t*m;f[2]=z*q+A*m+t*x-u*v;f[3]=A*q-t*v-u*x-z*m; t=h[4];u=h[5];z=h[6];h=h[7];f[4]=t*q+h*v+u*m-z*x;f[5]=u*q+h*x+z*v-t*m;f[6]=z*q+h*m+t*x-u*v;f[7]=h*q-t*v-u*x-z*m;return f},add:function(f,h,m){f[0]=h[0]+m[0];f[1]=h[1]+m[1];f[2]=h[2]+m[2];f[3]=h[3]+m[3];f[4]=h[4]+m[4];f[5]=h[5]+m[5];f[6]=h[6]+m[6];f[7]=h[7]+m[7];return f},multiply:Xa,mul:Xa,scale:function(f,h,m){f[0]=h[0]*m;f[1]=h[1]*m;f[2]=h[2]*m;f[3]=h[3]*m;f[4]=h[4]*m;f[5]=h[5]*m;f[6]=h[6]*m;f[7]=h[7]*m;return f},dot:ka,lerp:function(f,h,m,q){var t=1-q;0>ka(h,m)&&(q=-q);f[0]=h[0]*t+m[0]*q;f[1]= h[1]*t+m[1]*q;f[2]=h[2]*t+m[2]*q;f[3]=h[3]*t+m[3]*q;f[4]=h[4]*t+m[4]*q;f[5]=h[5]*t+m[5]*q;f[6]=h[6]*t+m[6]*q;f[7]=h[7]*t+m[7]*q;return f},invert:function(f,h){var m=ia(h);f[0]=-h[0]/m;f[1]=-h[1]/m;f[2]=-h[2]/m;f[3]=h[3]/m;f[4]=-h[4]/m;f[5]=-h[5]/m;f[6]=-h[6]/m;f[7]=h[7]/m;return f},conjugate:function(f,h){f[0]=-h[0];f[1]=-h[1];f[2]=-h[2];f[3]=h[3];f[4]=-h[4];f[5]=-h[5];f[6]=-h[6];f[7]=h[7];return f},length:ja,len:ja,squaredLength:ia,sqrLen:ia,normalize:function(f,h){var m=ia(h);if(0<m){m=Math.sqrt(m); var q=h[0]/m,t=h[1]/m,u=h[2]/m,v=h[3]/m,x=h[4],z=h[5],A=h[6];h=h[7];var D=q*x+t*z+u*A+v*h;f[0]=q;f[1]=t;f[2]=u;f[3]=v;f[4]=(x-q*D)/m;f[5]=(z-t*D)/m;f[6]=(A-u*D)/m;f[7]=(h-v*D)/m}return f},str:function(f){return"quat2("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+", "+f[4]+", "+f[5]+", "+f[6]+", "+f[7]+")"},exactEquals:function(f,h){return f[0]===h[0]&&f[1]===h[1]&&f[2]===h[2]&&f[3]===h[3]&&f[4]===h[4]&&f[5]===h[5]&&f[6]===h[6]&&f[7]===h[7]},equals:function(f,h){var m=f[0],q=f[1],t=f[2],u=f[3],v=f[4],x=f[5], z=f[6];f=f[7];var A=h[0],D=h[1],G=h[2],I=h[3],H=h[4],M=h[5],N=h[6];h=h[7];return Math.abs(m-A)<=1E-6*Math.max(1,Math.abs(m),Math.abs(A))&&Math.abs(q-D)<=1E-6*Math.max(1,Math.abs(q),Math.abs(D))&&Math.abs(t-G)<=1E-6*Math.max(1,Math.abs(t),Math.abs(G))&&Math.abs(u-I)<=1E-6*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(v-H)<=1E-6*Math.max(1,Math.abs(v),Math.abs(H))&&Math.abs(x-M)<=1E-6*Math.max(1,Math.abs(x),Math.abs(M))&&Math.abs(z-N)<=1E-6*Math.max(1,Math.abs(z),Math.abs(N))&&Math.abs(f-h)<=1E-6*Math.max(1, Math.abs(f),Math.abs(h))}});na=function(){var f=Ya();return function(h,m,q,t,u,v){m||(m=2);q||(q=0);for(t=t?Math.min(t*m+q,h.length):h.length;q<t;q+=m)f[0]=h[q],f[1]=h[q+1],u(f,f,v),h[q]=f[0],h[q+1]=f[1];return h}}();na=Object.freeze({__proto__:null,create:Ya,clone:function(f){var h=new U(2);h[0]=f[0];h[1]=f[1];return h},fromValues:function(f,h){var m=new U(2);m[0]=f;m[1]=h;return m},copy:function(f,h){f[0]=h[0];f[1]=h[1];return f},set:function(f,h,m){f[0]=h;f[1]=m;return f},add:function(f,h,m){f[0]= h[0]+m[0];f[1]=h[1]+m[1];return f},subtract:Za,multiply:$a,divide:ab,ceil:function(f,h){f[0]=Math.ceil(h[0]);f[1]=Math.ceil(h[1]);return f},floor:function(f,h){f[0]=Math.floor(h[0]);f[1]=Math.floor(h[1]);return f},min:function(f,h,m){f[0]=Math.min(h[0],m[0]);f[1]=Math.min(h[1],m[1]);return f},max:function(f,h,m){f[0]=Math.max(h[0],m[0]);f[1]=Math.max(h[1],m[1]);return f},round:function(f,h){f[0]=Math.round(h[0]);f[1]=Math.round(h[1]);return f},scale:function(f,h,m){f[0]=h[0]*m;f[1]=h[1]*m;return f}, scaleAndAdd:function(f,h,m,q){f[0]=h[0]+m[0]*q;f[1]=h[1]+m[1]*q;return f},distance:bb,squaredDistance:cb,length:db,squaredLength:eb,negate:function(f,h){f[0]=-h[0];f[1]=-h[1];return f},inverse:function(f,h){f[0]=1/h[0];f[1]=1/h[1];return f},normalize:function(f,h){var m=h[0],q=h[1];m=m*m+q*q;0<m&&(m=1/Math.sqrt(m));f[0]=h[0]*m;f[1]=h[1]*m;return f},dot:function(f,h){return f[0]*h[0]+f[1]*h[1]},cross:function(f,h,m){h=h[0]*m[1]-h[1]*m[0];f[0]=f[1]=0;f[2]=h;return f},lerp:function(f,h,m,q){var t=h[0]; h=h[1];f[0]=t+q*(m[0]-t);f[1]=h+q*(m[1]-h);return f},random:function(f,h){h=h||1;var m=2*ha()*Math.PI;f[0]=Math.cos(m)*h;f[1]=Math.sin(m)*h;return f},transformMat2:function(f,h,m){var q=h[0];h=h[1];f[0]=m[0]*q+m[2]*h;f[1]=m[1]*q+m[3]*h;return f},transformMat2d:function(f,h,m){var q=h[0];h=h[1];f[0]=m[0]*q+m[2]*h+m[4];f[1]=m[1]*q+m[3]*h+m[5];return f},transformMat3:function(f,h,m){var q=h[0];h=h[1];f[0]=m[0]*q+m[3]*h+m[6];f[1]=m[1]*q+m[4]*h+m[7];return f},transformMat4:function(f,h,m){var q=h[0];h= h[1];f[0]=m[0]*q+m[4]*h+m[12];f[1]=m[1]*q+m[5]*h+m[13];return f},rotate:function(f,h,m,q){var t=h[0]-m[0];h=h[1]-m[1];var u=Math.sin(q);q=Math.cos(q);f[0]=t*q-h*u+m[0];f[1]=t*u+h*q+m[1];return f},angle:function(f,h){var m=f[0];f=f[1];var q=h[0];h=h[1];var t=Math.sqrt((m*m+f*f)*(q*q+h*h));return Math.acos(Math.min(Math.max(t&&(m*q+f*h)/t,-1),1))},zero:function(f){f[0]=0;f[1]=0;return f},str:function(f){return"vec2("+f[0]+", "+f[1]+")"},exactEquals:function(f,h){return f[0]===h[0]&&f[1]===h[1]},equals:function(f, h){var m=f[0];f=f[1];var q=h[0];h=h[1];return Math.abs(m-q)<=1E-6*Math.max(1,Math.abs(m),Math.abs(q))&&Math.abs(f-h)<=1E-6*Math.max(1,Math.abs(f),Math.abs(h))},len:db,sub:Za,mul:$a,div:ab,dist:bb,sqrDist:cb,sqrLen:eb,forEach:na});a.glMatrix=ib;a.mat2=jb;a.mat2d=kb;a.mat3=lb;a.mat4=mb;a.quat=xa;a.quat2=ya;a.vec2=na;a.vec3=va;a.vec4=wa;Object.defineProperty(a,"__esModule",{value:!0})}); self.GraphemeSplitter=function(){function a(d,e){void 0===e&&(e=0);var g=d.charCodeAt(e);if(55296<=g&&56319>=g&&e<d.length-1){var k=g;d=d.charCodeAt(e+1);return 56320<=d&&57343>=d?1024*(k-55296)+(d-56320)+65536:k}return 56320<=g&&57343>=g&&1<=e?(k=d.charCodeAt(e-1),d=g,55296<=k&&56319>=k?1024*(k-55296)+(d-56320)+65536:d):g}function b(d,e,g){var k=[d].concat(e).concat([g]),l=k[k.length-2],n=k.lastIndexOf(14);if(1<n&&k.slice(1,n).every(function(p){return 3==p})&&-1==[3,13,17].indexOf(d))return 2;d= k.lastIndexOf(4);if(0<d&&k.slice(1,d).every(function(p){return 4==p})&&-1==[12,4].indexOf(l))return 1==k.filter(function(p){return 4==p}).length%2?3:4;if(0==l&&1==g)return 0;if(2==l||0==l||1==l)return 14==g&&e.every(function(p){return 3==p})?2:1;if(2==g||0==g||1==g)return 1;if(6!=l||6!=g&&7!=g&&9!=g&&10!=g)if(9!=l&&7!=l||7!=g&&8!=g)if(10!=l&&8!=l||8!=g){if(3==g||15==g||5==g||12==l)return 0}else return 0;else return 0;else return 0;d=-1!=k.indexOf(3)?k.lastIndexOf(3)-1:k.length-2;return-1!=[13,17].indexOf(k[d])&& k.slice(d+1,-1).every(function(p){return 3==p})&&14==g||15==l&&-1!=[16,17].indexOf(g)?0:-1!=e.indexOf(4)?2:4==l&&4==g?0:1}function c(d){return 1536<=d&&1541>=d||1757==d||1807==d||2274==d||3406==d||69821==d||70082<=d&&70083>=d||72250==d||72326<=d&&72329>=d||73030==d?12:13==d?0:10==d?1:0<=d&&9>=d||11<=d&&12>=d||14<=d&&31>=d||127<=d&&159>=d||173==d||1564==d||6158==d||8203==d||8206<=d&&8207>=d||8232==d||8233==d||8234<=d&&8238>=d||8288<=d&&8292>=d||8293==d||8294<=d&&8303>=d||55296<=d&&57343>=d||65279== d||65520<=d&&65528>=d||65529<=d&&65531>=d||113824<=d&&113827>=d||119155<=d&&119162>=d||917504==d||917505==d||917506<=d&&917535>=d||917632<=d&&917759>=d||918E3<=d&&921599>=d?2:768<=d&&879>=d||1155<=d&&1159>=d||1160<=d&&1161>=d||1425<=d&&1469>=d||1471==d||1473<=d&&1474>=d||1476<=d&&1477>=d||1479==d||1552<=d&&1562>=d||1611<=d&&1631>=d||1648==d||1750<=d&&1756>=d||1759<=d&&1764>=d||1767<=d&&1768>=d||1770<=d&&1773>=d||1809==d||1840<=d&&1866>=d||1958<=d&&1968>=d||2027<=d&&2035>=d||2070<=d&&2073>=d||2075<= d&&2083>=d||2085<=d&&2087>=d||2089<=d&&2093>=d||2137<=d&&2139>=d||2260<=d&&2273>=d||2275<=d&&2306>=d||2362==d||2364==d||2369<=d&&2376>=d||2381==d||2385<=d&&2391>=d||2402<=d&&2403>=d||2433==d||2492==d||2494==d||2497<=d&&2500>=d||2509==d||2519==d||2530<=d&&2531>=d||2561<=d&&2562>=d||2620==d||2625<=d&&2626>=d||2631<=d&&2632>=d||2635<=d&&2637>=d||2641==d||2672<=d&&2673>=d||2677==d||2689<=d&&2690>=d||2748==d||2753<=d&&2757>=d||2759<=d&&2760>=d||2765==d||2786<=d&&2787>=d||2810<=d&&2815>=d||2817==d||2876== d||2878==d||2879==d||2881<=d&&2884>=d||2893==d||2902==d||2903==d||2914<=d&&2915>=d||2946==d||3006==d||3008==d||3021==d||3031==d||3072==d||3134<=d&&3136>=d||3142<=d&&3144>=d||3146<=d&&3149>=d||3157<=d&&3158>=d||3170<=d&&3171>=d||3201==d||3260==d||3263==d||3266==d||3270==d||3276<=d&&3277>=d||3285<=d&&3286>=d||3298<=d&&3299>=d||3328<=d&&3329>=d||3387<=d&&3388>=d||3390==d||3393<=d&&3396>=d||3405==d||3415==d||3426<=d&&3427>=d||3530==d||3535==d||3538<=d&&3540>=d||3542==d||3551==d||3633==d||3636<=d&&3642>= d||3655<=d&&3662>=d||3761==d||3764<=d&&3769>=d||3771<=d&&3772>=d||3784<=d&&3789>=d||3864<=d&&3865>=d||3893==d||3895==d||3897==d||3953<=d&&3966>=d||3968<=d&&3972>=d||3974<=d&&3975>=d||3981<=d&&3991>=d||3993<=d&&4028>=d||4038==d||4141<=d&&4144>=d||4146<=d&&4151>=d||4153<=d&&4154>=d||4157<=d&&4158>=d||4184<=d&&4185>=d||4190<=d&&4192>=d||4209<=d&&4212>=d||4226==d||4229<=d&&4230>=d||4237==d||4253==d||4957<=d&&4959>=d||5906<=d&&5908>=d||5938<=d&&5940>=d||5970<=d&&5971>=d||6002<=d&&6003>=d||6068<=d&&6069>= d||6071<=d&&6077>=d||6086==d||6089<=d&&6099>=d||6109==d||6155<=d&&6157>=d||6277<=d&&6278>=d||6313==d||6432<=d&&6434>=d||6439<=d&&6440>=d||6450==d||6457<=d&&6459>=d||6679<=d&&6680>=d||6683==d||6742==d||6744<=d&&6750>=d||6752==d||6754==d||6757<=d&&6764>=d||6771<=d&&6780>=d||6783==d||6832<=d&&6845>=d||6846==d||6912<=d&&6915>=d||6964==d||6966<=d&&6970>=d||6972==d||6978==d||7019<=d&&7027>=d||7040<=d&&7041>=d||7074<=d&&7077>=d||7080<=d&&7081>=d||7083<=d&&7085>=d||7142==d||7144<=d&&7145>=d||7149==d||7151<= d&&7153>=d||7212<=d&&7219>=d||7222<=d&&7223>=d||7376<=d&&7378>=d||7380<=d&&7392>=d||7394<=d&&7400>=d||7405==d||7412==d||7416<=d&&7417>=d||7616<=d&&7673>=d||7675<=d&&7679>=d||8204==d||8400<=d&&8412>=d||8413<=d&&8416>=d||8417==d||8418<=d&&8420>=d||8421<=d&&8432>=d||11503<=d&&11505>=d||11647==d||11744<=d&&11775>=d||12330<=d&&12333>=d||12334<=d&&12335>=d||12441<=d&&12442>=d||42607==d||42608<=d&&42610>=d||42612<=d&&42621>=d||42654<=d&&42655>=d||42736<=d&&42737>=d||43010==d||43014==d||43019==d||43045<= d&&43046>=d||43204<=d&&43205>=d||43232<=d&&43249>=d||43302<=d&&43309>=d||43335<=d&&43345>=d||43392<=d&&43394>=d||43443==d||43446<=d&&43449>=d||43452==d||43493==d||43561<=d&&43566>=d||43569<=d&&43570>=d||43573<=d&&43574>=d||43587==d||43596==d||43644==d||43696==d||43698<=d&&43700>=d||43703<=d&&43704>=d||43710<=d&&43711>=d||43713==d||43756<=d&&43757>=d||43766==d||44005==d||44008==d||44013==d||64286==d||65024<=d&&65039>=d||65056<=d&&65071>=d||65438<=d&&65439>=d||66045==d||66272==d||66422<=d&&66426>=d|| 68097<=d&&68099>=d||68101<=d&&68102>=d||68108<=d&&68111>=d||68152<=d&&68154>=d||68159==d||68325<=d&&68326>=d||69633==d||69688<=d&&69702>=d||69759<=d&&69761>=d||69811<=d&&69814>=d||69817<=d&&69818>=d||69888<=d&&69890>=d||69927<=d&&69931>=d||69933<=d&&69940>=d||70003==d||70016<=d&&70017>=d||70070<=d&&70078>=d||70090<=d&&70092>=d||70191<=d&&70193>=d||70196==d||70198<=d&&70199>=d||70206==d||70367==d||70371<=d&&70378>=d||70400<=d&&70401>=d||70460==d||70462==d||70464==d||70487==d||70502<=d&&70508>=d||70512<= d&&70516>=d||70712<=d&&70719>=d||70722<=d&&70724>=d||70726==d||70832==d||70835<=d&&70840>=d||70842==d||70845==d||70847<=d&&70848>=d||70850<=d&&70851>=d||71087==d||71090<=d&&71093>=d||71100<=d&&71101>=d||71103<=d&&71104>=d||71132<=d&&71133>=d||71219<=d&&71226>=d||71229==d||71231<=d&&71232>=d||71339==d||71341==d||71344<=d&&71349>=d||71351==d||71453<=d&&71455>=d||71458<=d&&71461>=d||71463<=d&&71467>=d||72193<=d&&72198>=d||72201<=d&&72202>=d||72243<=d&&72248>=d||72251<=d&&72254>=d||72263==d||72273<=d&& 72278>=d||72281<=d&&72283>=d||72330<=d&&72342>=d||72344<=d&&72345>=d||72752<=d&&72758>=d||72760<=d&&72765>=d||72767==d||72850<=d&&72871>=d||72874<=d&&72880>=d||72882<=d&&72883>=d||72885<=d&&72886>=d||73009<=d&&73014>=d||73018==d||73020<=d&&73021>=d||73023<=d&&73029>=d||73031==d||92912<=d&&92916>=d||92976<=d&&92982>=d||94095<=d&&94098>=d||113821<=d&&113822>=d||119141==d||119143<=d&&119145>=d||119150<=d&&119154>=d||119163<=d&&119170>=d||119173<=d&&119179>=d||119210<=d&&119213>=d||119362<=d&&119364>= d||121344<=d&&121398>=d||121403<=d&&121452>=d||121461==d||121476==d||121499<=d&&121503>=d||121505<=d&&121519>=d||122880<=d&&122886>=d||122888<=d&&122904>=d||122907<=d&&122913>=d||122915<=d&&122916>=d||122918<=d&&122922>=d||125136<=d&&125142>=d||125252<=d&&125258>=d||917536<=d&&917631>=d||917760<=d&&917999>=d?3:127462<=d&&127487>=d?4:2307==d||2363==d||2366<=d&&2368>=d||2377<=d&&2380>=d||2382<=d&&2383>=d||2434<=d&&2435>=d||2495<=d&&2496>=d||2503<=d&&2504>=d||2507<=d&&2508>=d||2563==d||2622<=d&&2624>= d||2691==d||2750<=d&&2752>=d||2761==d||2763<=d&&2764>=d||2818<=d&&2819>=d||2880==d||2887<=d&&2888>=d||2891<=d&&2892>=d||3007==d||3009<=d&&3010>=d||3014<=d&&3016>=d||3018<=d&&3020>=d||3073<=d&&3075>=d||3137<=d&&3140>=d||3202<=d&&3203>=d||3262==d||3264<=d&&3265>=d||3267<=d&&3268>=d||3271<=d&&3272>=d||3274<=d&&3275>=d||3330<=d&&3331>=d||3391<=d&&3392>=d||3398<=d&&3400>=d||3402<=d&&3404>=d||3458<=d&&3459>=d||3536<=d&&3537>=d||3544<=d&&3550>=d||3570<=d&&3571>=d||3635==d||3763==d||3902<=d&&3903>=d||3967== d||4145==d||4155<=d&&4156>=d||4182<=d&&4183>=d||4228==d||6070==d||6078<=d&&6085>=d||6087<=d&&6088>=d||6435<=d&&6438>=d||6441<=d&&6443>=d||6448<=d&&6449>=d||6451<=d&&6456>=d||6681<=d&&6682>=d||6741==d||6743==d||6765<=d&&6770>=d||6916==d||6965==d||6971==d||6973<=d&&6977>=d||6979<=d&&6980>=d||7042==d||7073==d||7078<=d&&7079>=d||7082==d||7143==d||7146<=d&&7148>=d||7150==d||7154<=d&&7155>=d||7204<=d&&7211>=d||7220<=d&&7221>=d||7393==d||7410<=d&&7411>=d||7415==d||43043<=d&&43044>=d||43047==d||43136<=d&& 43137>=d||43188<=d&&43203>=d||43346<=d&&43347>=d||43395==d||43444<=d&&43445>=d||43450<=d&&43451>=d||43453<=d&&43456>=d||43567<=d&&43568>=d||43571<=d&&43572>=d||43597==d||43755==d||43758<=d&&43759>=d||43765==d||44003<=d&&44004>=d||44006<=d&&44007>=d||44009<=d&&44010>=d||44012==d||69632==d||69634==d||69762==d||69808<=d&&69810>=d||69815<=d&&69816>=d||69932==d||70018==d||70067<=d&&70069>=d||70079<=d&&70080>=d||70188<=d&&70190>=d||70194<=d&&70195>=d||70197==d||70368<=d&&70370>=d||70402<=d&&70403>=d||70463== d||70465<=d&&70468>=d||70471<=d&&70472>=d||70475<=d&&70477>=d||70498<=d&&70499>=d||70709<=d&&70711>=d||70720<=d&&70721>=d||70725==d||70833<=d&&70834>=d||70841==d||70843<=d&&70844>=d||70846==d||70849==d||71088<=d&&71089>=d||71096<=d&&71099>=d||71102==d||71216<=d&&71218>=d||71227<=d&&71228>=d||71230==d||71340==d||71342<=d&&71343>=d||71350==d||71456<=d&&71457>=d||71462==d||72199<=d&&72200>=d||72249==d||72279<=d&&72280>=d||72343==d||72751==d||72766==d||72873==d||72881==d||72884==d||94033<=d&&94078>=d|| 119142==d||119149==d?5:4352<=d&&4447>=d||43360<=d&&43388>=d?6:4448<=d&&4519>=d||55216<=d&&55238>=d?7:4520<=d&&4607>=d||55243<=d&&55291>=d?8:44032==d||44060==d||44088==d||44116==d||44144==d||44172==d||44200==d||44228==d||44256==d||44284==d||44312==d||44340==d||44368==d||44396==d||44424==d||44452==d||44480==d||44508==d||44536==d||44564==d||44592==d||44620==d||44648==d||44676==d||44704==d||44732==d||44760==d||44788==d||44816==d||44844==d||44872==d||44900==d||44928==d||44956==d||44984==d||45012==d||45040== d||45068==d||45096==d||45124==d||45152==d||45180==d||45208==d||45236==d||45264==d||45292==d||45320==d||45348==d||45376==d||45404==d||45432==d||45460==d||45488==d||45516==d||45544==d||45572==d||45600==d||45628==d||45656==d||45684==d||45712==d||45740==d||45768==d||45796==d||45824==d||45852==d||45880==d||45908==d||45936==d||45964==d||45992==d||46020==d||46048==d||46076==d||46104==d||46132==d||46160==d||46188==d||46216==d||46244==d||46272==d||46300==d||46328==d||46356==d||46384==d||46412==d||46440==d|| 46468==d||46496==d||46524==d||46552==d||46580==d||46608==d||46636==d||46664==d||46692==d||46720==d||46748==d||46776==d||46804==d||46832==d||46860==d||46888==d||46916==d||46944==d||46972==d||47E3==d||47028==d||47056==d||47084==d||47112==d||47140==d||47168==d||47196==d||47224==d||47252==d||47280==d||47308==d||47336==d||47364==d||47392==d||47420==d||47448==d||47476==d||47504==d||47532==d||47560==d||47588==d||47616==d||47644==d||47672==d||47700==d||47728==d||47756==d||47784==d||47812==d||47840==d||47868== d||47896==d||47924==d||47952==d||47980==d||48008==d||48036==d||48064==d||48092==d||48120==d||48148==d||48176==d||48204==d||48232==d||48260==d||48288==d||48316==d||48344==d||48372==d||48400==d||48428==d||48456==d||48484==d||48512==d||48540==d||48568==d||48596==d||48624==d||48652==d||48680==d||48708==d||48736==d||48764==d||48792==d||48820==d||48848==d||48876==d||48904==d||48932==d||48960==d||48988==d||49016==d||49044==d||49072==d||49100==d||49128==d||49156==d||49184==d||49212==d||49240==d||49268==d|| 49296==d||49324==d||49352==d||49380==d||49408==d||49436==d||49464==d||49492==d||49520==d||49548==d||49576==d||49604==d||49632==d||49660==d||49688==d||49716==d||49744==d||49772==d||49800==d||49828==d||49856==d||49884==d||49912==d||49940==d||49968==d||49996==d||50024==d||50052==d||50080==d||50108==d||50136==d||50164==d||50192==d||50220==d||50248==d||50276==d||50304==d||50332==d||50360==d||50388==d||50416==d||50444==d||50472==d||50500==d||50528==d||50556==d||50584==d||50612==d||50640==d||50668==d||50696== d||50724==d||50752==d||50780==d||50808==d||50836==d||50864==d||50892==d||50920==d||50948==d||50976==d||51004==d||51032==d||51060==d||51088==d||51116==d||51144==d||51172==d||51200==d||51228==d||51256==d||51284==d||51312==d||51340==d||51368==d||51396==d||51424==d||51452==d||51480==d||51508==d||51536==d||51564==d||51592==d||51620==d||51648==d||51676==d||51704==d||51732==d||51760==d||51788==d||51816==d||51844==d||51872==d||51900==d||51928==d||51956==d||51984==d||52012==d||52040==d||52068==d||52096==d|| 52124==d||52152==d||52180==d||52208==d||52236==d||52264==d||52292==d||52320==d||52348==d||52376==d||52404==d||52432==d||52460==d||52488==d||52516==d||52544==d||52572==d||52600==d||52628==d||52656==d||52684==d||52712==d||52740==d||52768==d||52796==d||52824==d||52852==d||52880==d||52908==d||52936==d||52964==d||52992==d||53020==d||53048==d||53076==d||53104==d||53132==d||53160==d||53188==d||53216==d||53244==d||53272==d||53300==d||53328==d||53356==d||53384==d||53412==d||53440==d||53468==d||53496==d||53524== d||53552==d||53580==d||53608==d||53636==d||53664==d||53692==d||53720==d||53748==d||53776==d||53804==d||53832==d||53860==d||53888==d||53916==d||53944==d||53972==d||54E3==d||54028==d||54056==d||54084==d||54112==d||54140==d||54168==d||54196==d||54224==d||54252==d||54280==d||54308==d||54336==d||54364==d||54392==d||54420==d||54448==d||54476==d||54504==d||54532==d||54560==d||54588==d||54616==d||54644==d||54672==d||54700==d||54728==d||54756==d||54784==d||54812==d||54840==d||54868==d||54896==d||54924==d|| 54952==d||54980==d||55008==d||55036==d||55064==d||55092==d||55120==d||55148==d||55176==d?9:44033<=d&&44059>=d||44061<=d&&44087>=d||44089<=d&&44115>=d||44117<=d&&44143>=d||44145<=d&&44171>=d||44173<=d&&44199>=d||44201<=d&&44227>=d||44229<=d&&44255>=d||44257<=d&&44283>=d||44285<=d&&44311>=d||44313<=d&&44339>=d||44341<=d&&44367>=d||44369<=d&&44395>=d||44397<=d&&44423>=d||44425<=d&&44451>=d||44453<=d&&44479>=d||44481<=d&&44507>=d||44509<=d&&44535>=d||44537<=d&&44563>=d||44565<=d&&44591>=d||44593<=d&& 44619>=d||44621<=d&&44647>=d||44649<=d&&44675>=d||44677<=d&&44703>=d||44705<=d&&44731>=d||44733<=d&&44759>=d||44761<=d&&44787>=d||44789<=d&&44815>=d||44817<=d&&44843>=d||44845<=d&&44871>=d||44873<=d&&44899>=d||44901<=d&&44927>=d||44929<=d&&44955>=d||44957<=d&&44983>=d||44985<=d&&45011>=d||45013<=d&&45039>=d||45041<=d&&45067>=d||45069<=d&&45095>=d||45097<=d&&45123>=d||45125<=d&&45151>=d||45153<=d&&45179>=d||45181<=d&&45207>=d||45209<=d&&45235>=d||45237<=d&&45263>=d||45265<=d&&45291>=d||45293<=d&&45319>= d||45321<=d&&45347>=d||45349<=d&&45375>=d||45377<=d&&45403>=d||45405<=d&&45431>=d||45433<=d&&45459>=d||45461<=d&&45487>=d||45489<=d&&45515>=d||45517<=d&&45543>=d||45545<=d&&45571>=d||45573<=d&&45599>=d||45601<=d&&45627>=d||45629<=d&&45655>=d||45657<=d&&45683>=d||45685<=d&&45711>=d||45713<=d&&45739>=d||45741<=d&&45767>=d||45769<=d&&45795>=d||45797<=d&&45823>=d||45825<=d&&45851>=d||45853<=d&&45879>=d||45881<=d&&45907>=d||45909<=d&&45935>=d||45937<=d&&45963>=d||45965<=d&&45991>=d||45993<=d&&46019>=d|| 46021<=d&&46047>=d||46049<=d&&46075>=d||46077<=d&&46103>=d||46105<=d&&46131>=d||46133<=d&&46159>=d||46161<=d&&46187>=d||46189<=d&&46215>=d||46217<=d&&46243>=d||46245<=d&&46271>=d||46273<=d&&46299>=d||46301<=d&&46327>=d||46329<=d&&46355>=d||46357<=d&&46383>=d||46385<=d&&46411>=d||46413<=d&&46439>=d||46441<=d&&46467>=d||46469<=d&&46495>=d||46497<=d&&46523>=d||46525<=d&&46551>=d||46553<=d&&46579>=d||46581<=d&&46607>=d||46609<=d&&46635>=d||46637<=d&&46663>=d||46665<=d&&46691>=d||46693<=d&&46719>=d||46721<= d&&46747>=d||46749<=d&&46775>=d||46777<=d&&46803>=d||46805<=d&&46831>=d||46833<=d&&46859>=d||46861<=d&&46887>=d||46889<=d&&46915>=d||46917<=d&&46943>=d||46945<=d&&46971>=d||46973<=d&&46999>=d||47001<=d&&47027>=d||47029<=d&&47055>=d||47057<=d&&47083>=d||47085<=d&&47111>=d||47113<=d&&47139>=d||47141<=d&&47167>=d||47169<=d&&47195>=d||47197<=d&&47223>=d||47225<=d&&47251>=d||47253<=d&&47279>=d||47281<=d&&47307>=d||47309<=d&&47335>=d||47337<=d&&47363>=d||47365<=d&&47391>=d||47393<=d&&47419>=d||47421<=d&& 47447>=d||47449<=d&&47475>=d||47477<=d&&47503>=d||47505<=d&&47531>=d||47533<=d&&47559>=d||47561<=d&&47587>=d||47589<=d&&47615>=d||47617<=d&&47643>=d||47645<=d&&47671>=d||47673<=d&&47699>=d||47701<=d&&47727>=d||47729<=d&&47755>=d||47757<=d&&47783>=d||47785<=d&&47811>=d||47813<=d&&47839>=d||47841<=d&&47867>=d||47869<=d&&47895>=d||47897<=d&&47923>=d||47925<=d&&47951>=d||47953<=d&&47979>=d||47981<=d&&48007>=d||48009<=d&&48035>=d||48037<=d&&48063>=d||48065<=d&&48091>=d||48093<=d&&48119>=d||48121<=d&&48147>= d||48149<=d&&48175>=d||48177<=d&&48203>=d||48205<=d&&48231>=d||48233<=d&&48259>=d||48261<=d&&48287>=d||48289<=d&&48315>=d||48317<=d&&48343>=d||48345<=d&&48371>=d||48373<=d&&48399>=d||48401<=d&&48427>=d||48429<=d&&48455>=d||48457<=d&&48483>=d||48485<=d&&48511>=d||48513<=d&&48539>=d||48541<=d&&48567>=d||48569<=d&&48595>=d||48597<=d&&48623>=d||48625<=d&&48651>=d||48653<=d&&48679>=d||48681<=d&&48707>=d||48709<=d&&48735>=d||48737<=d&&48763>=d||48765<=d&&48791>=d||48793<=d&&48819>=d||48821<=d&&48847>=d|| 48849<=d&&48875>=d||48877<=d&&48903>=d||48905<=d&&48931>=d||48933<=d&&48959>=d||48961<=d&&48987>=d||48989<=d&&49015>=d||49017<=d&&49043>=d||49045<=d&&49071>=d||49073<=d&&49099>=d||49101<=d&&49127>=d||49129<=d&&49155>=d||49157<=d&&49183>=d||49185<=d&&49211>=d||49213<=d&&49239>=d||49241<=d&&49267>=d||49269<=d&&49295>=d||49297<=d&&49323>=d||49325<=d&&49351>=d||49353<=d&&49379>=d||49381<=d&&49407>=d||49409<=d&&49435>=d||49437<=d&&49463>=d||49465<=d&&49491>=d||49493<=d&&49519>=d||49521<=d&&49547>=d||49549<= d&&49575>=d||49577<=d&&49603>=d||49605<=d&&49631>=d||49633<=d&&49659>=d||49661<=d&&49687>=d||49689<=d&&49715>=d||49717<=d&&49743>=d||49745<=d&&49771>=d||49773<=d&&49799>=d||49801<=d&&49827>=d||49829<=d&&49855>=d||49857<=d&&49883>=d||49885<=d&&49911>=d||49913<=d&&49939>=d||49941<=d&&49967>=d||49969<=d&&49995>=d||49997<=d&&50023>=d||50025<=d&&50051>=d||50053<=d&&50079>=d||50081<=d&&50107>=d||50109<=d&&50135>=d||50137<=d&&50163>=d||50165<=d&&50191>=d||50193<=d&&50219>=d||50221<=d&&50247>=d||50249<=d&& 50275>=d||50277<=d&&50303>=d||50305<=d&&50331>=d||50333<=d&&50359>=d||50361<=d&&50387>=d||50389<=d&&50415>=d||50417<=d&&50443>=d||50445<=d&&50471>=d||50473<=d&&50499>=d||50501<=d&&50527>=d||50529<=d&&50555>=d||50557<=d&&50583>=d||50585<=d&&50611>=d||50613<=d&&50639>=d||50641<=d&&50667>=d||50669<=d&&50695>=d||50697<=d&&50723>=d||50725<=d&&50751>=d||50753<=d&&50779>=d||50781<=d&&50807>=d||50809<=d&&50835>=d||50837<=d&&50863>=d||50865<=d&&50891>=d||50893<=d&&50919>=d||50921<=d&&50947>=d||50949<=d&&50975>= d||50977<=d&&51003>=d||51005<=d&&51031>=d||51033<=d&&51059>=d||51061<=d&&51087>=d||51089<=d&&51115>=d||51117<=d&&51143>=d||51145<=d&&51171>=d||51173<=d&&51199>=d||51201<=d&&51227>=d||51229<=d&&51255>=d||51257<=d&&51283>=d||51285<=d&&51311>=d||51313<=d&&51339>=d||51341<=d&&51367>=d||51369<=d&&51395>=d||51397<=d&&51423>=d||51425<=d&&51451>=d||51453<=d&&51479>=d||51481<=d&&51507>=d||51509<=d&&51535>=d||51537<=d&&51563>=d||51565<=d&&51591>=d||51593<=d&&51619>=d||51621<=d&&51647>=d||51649<=d&&51675>=d|| 51677<=d&&51703>=d||51705<=d&&51731>=d||51733<=d&&51759>=d||51761<=d&&51787>=d||51789<=d&&51815>=d||51817<=d&&51843>=d||51845<=d&&51871>=d||51873<=d&&51899>=d||51901<=d&&51927>=d||51929<=d&&51955>=d||51957<=d&&51983>=d||51985<=d&&52011>=d||52013<=d&&52039>=d||52041<=d&&52067>=d||52069<=d&&52095>=d||52097<=d&&52123>=d||52125<=d&&52151>=d||52153<=d&&52179>=d||52181<=d&&52207>=d||52209<=d&&52235>=d||52237<=d&&52263>=d||52265<=d&&52291>=d||52293<=d&&52319>=d||52321<=d&&52347>=d||52349<=d&&52375>=d||52377<= d&&52403>=d||52405<=d&&52431>=d||52433<=d&&52459>=d||52461<=d&&52487>=d||52489<=d&&52515>=d||52517<=d&&52543>=d||52545<=d&&52571>=d||52573<=d&&52599>=d||52601<=d&&52627>=d||52629<=d&&52655>=d||52657<=d&&52683>=d||52685<=d&&52711>=d||52713<=d&&52739>=d||52741<=d&&52767>=d||52769<=d&&52795>=d||52797<=d&&52823>=d||52825<=d&&52851>=d||52853<=d&&52879>=d||52881<=d&&52907>=d||52909<=d&&52935>=d||52937<=d&&52963>=d||52965<=d&&52991>=d||52993<=d&&53019>=d||53021<=d&&53047>=d||53049<=d&&53075>=d||53077<=d&& 53103>=d||53105<=d&&53131>=d||53133<=d&&53159>=d||53161<=d&&53187>=d||53189<=d&&53215>=d||53217<=d&&53243>=d||53245<=d&&53271>=d||53273<=d&&53299>=d||53301<=d&&53327>=d||53329<=d&&53355>=d||53357<=d&&53383>=d||53385<=d&&53411>=d||53413<=d&&53439>=d||53441<=d&&53467>=d||53469<=d&&53495>=d||53497<=d&&53523>=d||53525<=d&&53551>=d||53553<=d&&53579>=d||53581<=d&&53607>=d||53609<=d&&53635>=d||53637<=d&&53663>=d||53665<=d&&53691>=d||53693<=d&&53719>=d||53721<=d&&53747>=d||53749<=d&&53775>=d||53777<=d&&53803>= d||53805<=d&&53831>=d||53833<=d&&53859>=d||53861<=d&&53887>=d||53889<=d&&53915>=d||53917<=d&&53943>=d||53945<=d&&53971>=d||53973<=d&&53999>=d||54001<=d&&54027>=d||54029<=d&&54055>=d||54057<=d&&54083>=d||54085<=d&&54111>=d||54113<=d&&54139>=d||54141<=d&&54167>=d||54169<=d&&54195>=d||54197<=d&&54223>=d||54225<=d&&54251>=d||54253<=d&&54279>=d||54281<=d&&54307>=d||54309<=d&&54335>=d||54337<=d&&54363>=d||54365<=d&&54391>=d||54393<=d&&54419>=d||54421<=d&&54447>=d||54449<=d&&54475>=d||54477<=d&&54503>=d|| 54505<=d&&54531>=d||54533<=d&&54559>=d||54561<=d&&54587>=d||54589<=d&&54615>=d||54617<=d&&54643>=d||54645<=d&&54671>=d||54673<=d&&54699>=d||54701<=d&&54727>=d||54729<=d&&54755>=d||54757<=d&&54783>=d||54785<=d&&54811>=d||54813<=d&&54839>=d||54841<=d&&54867>=d||54869<=d&&54895>=d||54897<=d&&54923>=d||54925<=d&&54951>=d||54953<=d&&54979>=d||54981<=d&&55007>=d||55009<=d&&55035>=d||55037<=d&&55063>=d||55065<=d&&55091>=d||55093<=d&&55119>=d||55121<=d&&55147>=d||55149<=d&&55175>=d||55177<=d&&55203>=d?10: 9757==d||9977==d||9994<=d&&9997>=d||127877==d||127938<=d&&127940>=d||127943==d||127946<=d&&127948>=d||128066<=d&&128067>=d||128070<=d&&128080>=d||128110==d||128112<=d&&128120>=d||128124==d||128129<=d&&128131>=d||128133<=d&&128135>=d||128170==d||128372<=d&&128373>=d||128378==d||128400==d||128405<=d&&128406>=d||128581<=d&&128583>=d||128587<=d&&128591>=d||128675==d||128692<=d&&128694>=d||128704==d||128716==d||129304<=d&&129308>=d||129310<=d&&129311>=d||129318==d||129328<=d&&129337>=d||129341<=d&&129342>= d||129489<=d&&129501>=d?13:127995<=d&&127999>=d?14:8205==d?15:9792==d||9794==d||9877<=d&&9878>=d||9992==d||10084==d||127752==d||127806==d||127859==d||127891==d||127908==d||127912==d||127979==d||127981==d||128139==d||128187<=d&&128188>=d||128295==d||128300==d||128488==d||128640==d||128658==d?16:128102<=d&&128105>=d?17:11}this.nextBreak=function(d,e){void 0===e&&(e=0);if(0>e)return 0;if(e>=d.length-1)return d.length;var g=c(a(d,e)),k=[];for(e+=1;e<d.length;e++){var l=d,n=e-1;if(!(55296<=l.charCodeAt(n)&& 56319>=l.charCodeAt(n)&&56320<=l.charCodeAt(n+1)&&57343>=l.charCodeAt(n+1))){l=c(a(d,e));if(b(g,k,l))return e;k.push(l)}}return d.length};this.splitGraphemes=function(d){for(var e=[],g=0,k;(k=this.nextBreak(d,g))<d.length;)e.push(d.slice(g,k)),g=k;g<d.length&&e.push(d.slice(g));return e};this.iterateGraphemes=function(d){var e=0,g={next:function(){var k;if((k=this.nextBreak(d,e))<d.length){var l=d.slice(e,k);e=k;return{value:l,done:!1}}return e<d.length?(l=d.slice(e),e=d.length,{value:l,done:!1}): {value:void 0,done:!0}}.bind(this)};"undefined"!==typeof Symbol&&Symbol.iterator&&(g[Symbol.iterator]=function(){return g});return g};this.countGraphemes=function(d){for(var e=0,g=0,k;(k=this.nextBreak(d,g))<d.length;)g=k,e++;g<d.length&&e++;return e};return this};"use strict"; function lineInt(a,b,c){var d=[0,0];var e=a[1][1]-a[0][1];var g=a[0][0]-a[1][0];a=e*a[0][0]+g*a[0][1];var k=b[1][1]-b[0][1];var l=b[0][0]-b[1][0];b=k*b[0][0]+l*b[0][1];var n=e*l-k*g;scalar_eq(n,0,c||0)||(d[0]=(l*a-g*b)/n,d[1]=(e*b-k*a)/n);return d}function lineSegmentsIntersect(a,b,c,d){var e=b[0]-a[0];b=b[1]-a[1];var g=d[0]-c[0],k=d[1]-c[1];if(0===g*b-k*e)return!1;d=(e*(c[1]-a[1])+b*(a[0]-c[0]))/(g*b-k*e);a=(g*(a[1]-c[1])+k*(c[0]-a[0]))/(k*e-g*b);return 0<=d&&1>=d&&0<=a&&1>=a} function triangleArea(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(c[0]-a[0])*(b[1]-a[1])}function isLeft(a,b,c){return 0<triangleArea(a,b,c)}function isLeftOn(a,b,c){return 0<=triangleArea(a,b,c)}function isRight(a,b,c){return 0>triangleArea(a,b,c)}function isRightOn(a,b,c){return 0>=triangleArea(a,b,c)}var tmpPoint1$$module$working$266937462$c3runtime=[],tmpPoint2$$module$working$266937462$c3runtime=[]; function collinear(a,b,c,d){if(d){var e=tmpPoint1$$module$working$266937462$c3runtime,g=tmpPoint2$$module$working$266937462$c3runtime;e[0]=b[0]-a[0];e[1]=b[1]-a[1];g[0]=c[0]-b[0];g[1]=c[1]-b[1];return Math.acos((e[0]*g[0]+e[1]*g[1])/(Math.sqrt(e[0]*e[0]+e[1]*e[1])*Math.sqrt(g[0]*g[0]+g[1]*g[1])))<d}return 0===triangleArea(a,b,c)}function sqdist(a,b){var c=b[0]-a[0];a=b[1]-a[1];return c*c+a*a}function polygonAt(a,b){var c=a.length;return a[0>b?b%c+c:b%c]}function polygonClear(a){a.length=0} function polygonAppend(a,b,c,d){for(;c<d;c++)a.push(b[c])}function polygonReverse(a){for(var b=[],c=a.length,d=0;d!==c;d++)b.push(a.pop());for(d=0;d!==c;d++)a[d]=b[d]}function polygonIsReflex(a,b){return isRight(polygonAt(a,b-1),polygonAt(a,b),polygonAt(a,b+1))}var tmpLine1$$module$working$266937462$c3runtime=[],tmpLine2$$module$working$266937462$c3runtime=[]; function polygonCanSee(a,b,c){var d=tmpLine1$$module$working$266937462$c3runtime,e=tmpLine2$$module$working$266937462$c3runtime;if(isLeftOn(polygonAt(a,b+1),polygonAt(a,b),polygonAt(a,c))&&isRightOn(polygonAt(a,b-1),polygonAt(a,b),polygonAt(a,c)))return!1;var g=sqdist(polygonAt(a,b),polygonAt(a,c));for(var k=0;k!==a.length;++k)if((k+1)%a.length!==b&&k!==b&&isLeftOn(polygonAt(a,b),polygonAt(a,c),polygonAt(a,k+1))&&isRightOn(polygonAt(a,b),polygonAt(a,c),polygonAt(a,k))){d[0]=polygonAt(a,b);d[1]=polygonAt(a, c);e[0]=polygonAt(a,k);e[1]=polygonAt(a,k+1);var l=lineInt(d,e);if(sqdist(polygonAt(a,b),l)<g)return!1}return!0}function polygonCanSee2(a,b,c){for(var d=0;d!==a.length;++d)if(d!==b&&d!==c&&(d+1)%a.length!==b&&(d+1)%a.length!==c&&lineSegmentsIntersect(polygonAt(a,b),polygonAt(a,c),polygonAt(a,d),polygonAt(a,d+1)))return!1;return!0} function polygonCopy(a,b,c,d){d=d||[];polygonClear(d);if(b<c)for(var e=b;e<=c;e++)d.push(a[e]);else{for(e=0;e<=c;e++)d.push(a[e]);for(e=b;e<a.length;e++)d.push(a[e])}return d} function polygonGetCutEdges(a){for(var b=[],c,d,e=[],g=Number.MAX_VALUE,k=0;k<a.length;++k)if(polygonIsReflex(a,k))for(var l=0;l<a.length;++l)if(polygonCanSee(a,k,l)){c=polygonGetCutEdges(polygonCopy(a,k,l,e));d=polygonGetCutEdges(polygonCopy(a,l,k,e));for(var n=0;n<d.length;n++)c.push(d[n]);c.length<g&&(b=c,g=c.length,b.push([polygonAt(a,k),polygonAt(a,l)]))}return b} function polygonSlice(a,b){if(0===b.length)return[a];if(b instanceof Array&&b.length&&b[0]instanceof Array&&2===b[0].length&&b[0][0]instanceof Array){a=[a];for(var c=0;c<b.length;c++)for(var d=b[c],e=0;e<a.length;e++){var g=polygonSlice(a[e],d);if(g){a.splice(e,1);a.push(g[0],g[1]);break}}return a}d=b;c=a.indexOf(d[0]);e=a.indexOf(d[1]);return-1!==c&&-1!==e?[polygonCopy(a,c,e),polygonCopy(a,e,c)]:!1} function getIntersectionPoint(a,b,c,d,e){var g=b[1]-a[1];b=a[0]-b[0];a=g*a[0]+b*a[1];var k=d[1]-c[1];d=c[0]-d[0];c=k*c[0]+d*c[1];var l=g*d-k*b;return scalar_eq(l,0,e||0)?[0,0]:[(d*a-b*c)/l,(g*c-k*a)/l]} function polygonQuickDecomp(a,b,c,d,e,g,k){g=g||100;k=k||0;e=e||25;b="undefined"!==typeof b?b:[];c=c||[];d=d||[];var l=[0,0],n=[0,0],p=[0,0],r,w=0,y=0,B=0,C=[],E=[];if(3>a.length)return b;k++;if(k>g)return console.warn("quickDecomp: max level ("+g+") reached."),b;for(var F=0;F<a.length;++F)if(polygonIsReflex(a,F)){c.push(a[F]);var J=r=Number.MAX_VALUE;for(var L=0;L<a.length;++L){if(isLeft(polygonAt(a,F-1),polygonAt(a,F),polygonAt(a,L))&&isRightOn(polygonAt(a,F-1),polygonAt(a,F),polygonAt(a,L-1))&& (p=getIntersectionPoint(polygonAt(a,F-1),polygonAt(a,F),polygonAt(a,L),polygonAt(a,L-1)),isRight(polygonAt(a,F+1),polygonAt(a,F),p))){var O=sqdist(a[F],p);O<r&&(r=O,n=p,y=L)}isLeft(polygonAt(a,F+1),polygonAt(a,F),polygonAt(a,L+1))&&isRightOn(polygonAt(a,F+1),polygonAt(a,F),polygonAt(a,L))&&(p=getIntersectionPoint(polygonAt(a,F+1),polygonAt(a,F),polygonAt(a,L),polygonAt(a,L+1)),isLeft(polygonAt(a,F-1),polygonAt(a,F),p)&&(O=sqdist(a[F],p),O<J&&(J=O,l=p,w=L)))}if(y===(w+1)%a.length)p[0]=(n[0]+l[0])/ 2,p[1]=(n[1]+l[1])/2,d.push(p),F<w?(polygonAppend(C,a,F,w+1),C.push(p),E.push(p),0!==y&&polygonAppend(E,a,y,a.length),polygonAppend(E,a,0,F+1)):(0!==F&&polygonAppend(C,a,F,a.length),polygonAppend(C,a,0,w+1),C.push(p),E.push(p),polygonAppend(E,a,y,F+1));else{y>w&&(w+=a.length);l=Number.MAX_VALUE;if(w<y)return b;for(L=y;L<=w;++L)isLeftOn(polygonAt(a,F-1),polygonAt(a,F),polygonAt(a,L))&&isRightOn(polygonAt(a,F+1),polygonAt(a,F),polygonAt(a,L))&&(O=sqdist(polygonAt(a,F),polygonAt(a,L)),O<l&&polygonCanSee2(a, F,L)&&(l=O,B=L%a.length));F<B?(polygonAppend(C,a,F,B+1),0!==B&&polygonAppend(E,a,B,a.length),polygonAppend(E,a,0,F+1)):(0!==F&&polygonAppend(C,a,F,a.length),polygonAppend(C,a,0,B+1),polygonAppend(E,a,B,F+1))}C.length<E.length?(polygonQuickDecomp(C,b,c,d,e,g,k),polygonQuickDecomp(E,b,c,d,e,g,k)):(polygonQuickDecomp(E,b,c,d,e,g,k),polygonQuickDecomp(C,b,c,d,e,g,k));return b}b.push(a);return b}function scalar_eq(a,b,c){return Math.abs(a-b)<=(c||0)} function points_eq(a,b,c){return scalar_eq(a[0],b[0],c)&&scalar_eq(a[1],b[1],c)} self.polyDecomp={decomp:function(a){var b=polygonGetCutEdges(a);return 0<b.length?polygonSlice(a,b):[a]},quickDecomp:polygonQuickDecomp,isSimple:function(a){var b;for(b=0;b<a.length-1;b++)for(var c=0;c<b-1;c++)if(lineSegmentsIntersect(a[b],a[b+1],a[c],a[c+1]))return!1;for(b=1;b<a.length-2;b++)if(lineSegmentsIntersect(a[0],a[a.length-1],a[b],a[b+1]))return!1;return!0},removeCollinearPoints:function(a,b){for(var c=0,d=a.length-1;3<a.length&&0<=d;--d)collinear(polygonAt(a,d-1),polygonAt(a,d),polygonAt(a, d+1),b)&&(a.splice(d%a.length,1),c++);return c},removeDuplicatePoints:function(a,b){for(var c=a.length-1;1<=c;--c)for(var d=a[c],e=c-1;0<=e;--e)points_eq(d,a[e],b)&&a.splice(c,1)},makeCCW:function(a){for(var b=0,c=1;c<a.length;++c)if(a[c][1]<a[b][1]||a[c][1]===a[b][1]&&a[c][0]>a[b][0])b=c;if(isLeft(polygonAt(a,b-1),polygonAt(a,b),polygonAt(a,b+1)))return!1;polygonReverse(a);return!0}};"use strict";let isReady=!1,hasAppStarted=!1,buildMode="dev"; const C3=self.C3=class{constructor(){throw TypeError("static class can't be instantiated");}static SetReady(){isReady=!0}static IsReady(){return isReady}static SetAppStarted(){hasAppStarted=!0}static HasAppStarted(){return hasAppStarted}static SetBuildMode(a){buildMode=a}static GetBuildMode(){return buildMode}static IsReleaseBuild(){return"final"===buildMode}};C3.isDebug=!1;C3.isDebugDefend=!1;C3.hardwareConcurrency=navigator.hardwareConcurrency||2;self.C3X={};"use strict";const C3$jscomp$2=self.C3; C3$jscomp$2.QueryParser=class{constructor(a){this._queryString=a;this._parameters=new Map;this._Parse()}_Parse(){var a=this._queryString;if(a.startsWith("?")||a.startsWith("#"))a=a.substr(1);a=a.split("&");for(const b of a)this._ParseParameter(b)}_ParseParameter(a){if(a)if(a.includes("=")){var b=a.indexOf("="),c=decodeURIComponent(a.substring(0,b));a=decodeURIComponent(a.substring(b+1));this._parameters.set(c,a)}else this._parameters.set(a,null)}LogAll(){for(const a of this._parameters)console.log("[QueryParser] Parameter '"+ a[0]+"' = "+(null===a[1]?"null":"'"+a[1]+"'"))}Has(a){return this._parameters.has(a)}Get(a){a=this._parameters.get(a);return"undefined"===typeof a?null:a}ClearHash(){history.replaceState("",document.title,location.pathname+location.search)}Reparse(a){this._queryString=a;this._parameters.clear();this._Parse()}};C3$jscomp$2.QueryString=new C3$jscomp$2.QueryParser(location.search);C3$jscomp$2.LocationHashString=new C3$jscomp$2.QueryParser(location.hash); C3$jscomp$2.QueryString.Has("perf")&&(C3$jscomp$2.isPerformanceProfiling=!0);"dev"!==C3$jscomp$2.QueryString.Get("mode")&&C3$jscomp$2.SetBuildMode("final");"use strict";const C3$jscomp$3=self.C3;C3$jscomp$3.Platform={OS:"(unknown)",OSVersion:"(unknown)",Browser:"(unknown)",BrowserVersion:"(unknown)",BrowserVersionNumber:NaN,BrowserEngine:"(unknown)",Context:"browser",IsDesktop:!0,IsMobile:!1,IsAppleOS:!1,IsIpadOS:!1,GetDetailedInfo:async()=>{}}; const windowsNTVerMap=new Map([[5,"2000"],[5.1,"XP"],[5.2,"XP"],[6,"Vista"],[6.1,"7"],[6.2,"8"],[6.3,"8.1"],[10,"10"]]);function GetWindowsNTVersionName(a){const b=parseFloat(a),c=windowsNTVerMap.get(b);return c?c:13<=b?"11":"NT "+a}const uaStr=navigator.userAgent,uaData=navigator.userAgentData; if(uaData&&0<uaData.brands.length){C3$jscomp$3.Platform.OS=uaData.platform;C3$jscomp$3.Platform.IsMobile=uaData.mobile;C3$jscomp$3.Platform.IsDesktop=!C3$jscomp$3.Platform.IsMobile;const a=new Map([["Google Chrome","Chrome"],["Microsoft Edge","Edge"],["Opera","Opera"],["Opera GX","Opera GX"],["Mozilla Firefox","Firefox"],["Apple Safari","Safari"],["NW.js","NW.js"]]),b=new Map([["Chromium","Chromium"],["Gecko","Gecko"],["WebKit","WebKit"]]);function c(e){let g="",k="",l="",n="";for(const p of e)e= a.get(p.brand),!g&&e&&(g=e,k=p.version),e=b.get(p.brand),!l&&e&&(l=e,n=p.version);g||"Chromium"!==l||(C3$jscomp$3.Platform.Browser="Chromium",C3$jscomp$3.Platform.BrowserVersion=n);C3$jscomp$3.Platform.Browser=g||"(unknown)";C3$jscomp$3.Platform.BrowserVersion=k||"(unknown)";C3$jscomp$3.Platform.BrowserEngine=l||"(unknown)"}c(uaData.brands);let d=!1;C3$jscomp$3.Platform.GetDetailedInfo=async()=>{if(!d)try{const e=await navigator.userAgentData.getHighEntropyValues(["platformVersion","fullVersionList"]); c(e.fullVersionList);C3$jscomp$3.Platform.OSVersion="Windows"===C3$jscomp$3.Platform.OS?GetWindowsNTVersionName(e.platformVersion):e.platformVersion;d=!0}catch(e){console.warn("Failed to get detailed user agent information: ",e)}}}else{function a(p,r){p=Array.isArray(p)?p:[p];for(const w of p)if(p=w.exec(uaStr)){r(p);break}}a(/windows\s+nt\s+([\d\.]+)/i,p=>{C3$jscomp$3.Platform.OS="Windows";C3$jscomp$3.Platform.OSVersion=GetWindowsNTVersionName(p[1])});a(/mac\s+os\s+x\s+([\d\._]+)/i,p=>{C3$jscomp$3.Platform.OS= "macOS";C3$jscomp$3.Platform.OSVersion=p[1].replace(/_/g,".")});a(/CrOS/,()=>{C3$jscomp$3.Platform.OS="Chrome OS"});a(/linux|openbsd|freebsd|netbsd/i,()=>{C3$jscomp$3.Platform.OS="Linux"});a(/android/i,()=>{C3$jscomp$3.Platform.OS="Android"});a(/android\s+([\d\.]+)/i,p=>{C3$jscomp$3.Platform.OS="Android";C3$jscomp$3.Platform.OSVersion=p[1]});"(unknown)"===C3$jscomp$3.Platform.OS&&(a(/(iphone|ipod|ipad)/i,p=>{C3$jscomp$3.Platform.OS="iOS"}),a([/iphone\s+os\s+([\d\._]+)/i,/ipad[^)]*os\s+([\d\._]+)/i], p=>{C3$jscomp$3.Platform.OS="iOS";C3$jscomp$3.Platform.OSVersion=p[1].replace(/_/g,".")}));const b=/chrome\//i.test(uaStr),c=/chromium\//i.test(uaStr),d=/edg\//i.test(uaStr),e=/OPR\//.test(uaStr),g=/nwjs/i.test(uaStr),k=/safari\//i.test(uaStr),l=/webkit/i.test(uaStr);d||e||a(/chrome\/([\d\.]+)/i,p=>{C3$jscomp$3.Platform.Browser="Chrome";C3$jscomp$3.Platform.BrowserVersion=p[1];C3$jscomp$3.Platform.BrowserEngine="Chromium"});a(/edg\/([\d\.]+)/i,p=>{C3$jscomp$3.Platform.Browser="Edge";C3$jscomp$3.Platform.BrowserVersion= p[1];C3$jscomp$3.Platform.BrowserEngine="Chromium"});a(/OPR\/([\d\.]+)/,p=>{C3$jscomp$3.Platform.Browser="Opera";C3$jscomp$3.Platform.BrowserVersion=p[1];C3$jscomp$3.Platform.BrowserEngine="Chromium"});a(/chromium\/([\d\.]+)/i,p=>{C3$jscomp$3.Platform.Browser="Chromium";C3$jscomp$3.Platform.BrowserVersion=p[1];C3$jscomp$3.Platform.BrowserEngine="Chromium"});a(/nwjs\/[0-9.]+/i,p=>{C3$jscomp$3.Platform.Browser="NW.js";C3$jscomp$3.Platform.BrowserVersion=p[1];C3$jscomp$3.Platform.BrowserEngine="Chromium"; C3$jscomp$3.Platform.Context="nwjs"});a(/firefox\/([\d\.]+)/i,p=>{C3$jscomp$3.Platform.Browser="Firefox";C3$jscomp$3.Platform.BrowserVersion=p[1];C3$jscomp$3.Platform.BrowserEngine="Gecko"});!k||b||c||d||e||g||(C3$jscomp$3.Platform.Browser="Safari",C3$jscomp$3.Platform.BrowserEngine="WebKit",a(/version\/([\d\.]+)/i,p=>{C3$jscomp$3.Platform.BrowserVersion=p[1]}),a(/crios\/([\d\.]+)/i,p=>{C3$jscomp$3.Platform.Browser="Chrome for iOS";C3$jscomp$3.Platform.BrowserVersion=p[1]}),a(/fxios\/([\d\.]+)/i, p=>{C3$jscomp$3.Platform.Browser="Firefox for iOS";C3$jscomp$3.Platform.BrowserVersion=p[1]}),a(/edgios\/([\d\.]+)/i,p=>{C3$jscomp$3.Platform.Browser="Edge for iOS";C3$jscomp$3.Platform.BrowserVersion=p[1]}));"(unknown)"===C3$jscomp$3.Platform.BrowserEngine&&l&&(C3$jscomp$3.Platform.BrowserEngine="WebKit");"Android"===C3$jscomp$3.Platform.OS&&"Safari"===C3$jscomp$3.Platform.Browser&&(C3$jscomp$3.Platform.Browser="Stock");const n=(new Set(["Windows","macOS","Linux","Chrome OS"])).has(C3$jscomp$3.Platform.OS)|| "nwjs"===C3$jscomp$3.Platform.Context;C3$jscomp$3.Platform.IsDesktop=n;C3$jscomp$3.Platform.IsMobile=!n}"Chrome"===C3$jscomp$3.Platform.Browser&&"browser"===C3$jscomp$3.Platform.Context&&/wv\)/.test(uaStr)&&(C3$jscomp$3.Platform.Context="webview");"nwjs"!==C3$jscomp$3.Platform.Context&&"undefined"!==typeof window&&(window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches||navigator.standalone)&&(C3$jscomp$3.Platform.Context="webapp");C3$jscomp$3.Platform.BrowserVersionNumber=parseFloat(C3$jscomp$3.Platform.BrowserVersion); "macOS"===C3$jscomp$3.Platform.OS&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints&&(C3$jscomp$3.Platform.OS="iOS",C3$jscomp$3.Platform.OSVersion=C3$jscomp$3.Platform.BrowserVersion,C3$jscomp$3.Platform.IsDesktop=!1,C3$jscomp$3.Platform.IsMobile=!0,C3$jscomp$3.Platform.IsIpadOS=!0);C3$jscomp$3.Platform.IsAppleOS="macOS"===C3$jscomp$3.Platform.OS||"iOS"===C3$jscomp$3.Platform.OS;"use strict"; const DATABASE_PROMISE_MAP=new Map,SUPPORTS_GETALL="undefined"!==typeof IDBObjectStore&&"function"===typeof IDBObjectStore.prototype.getAll,SUPPORTS_GETALLKEYS="undefined"!==typeof IDBObjectStore&&"function"===typeof IDBObjectStore.prototype.getAllKeys;function asyncifyRequest(a){return new Promise((b,c)=>{a.onsuccess=()=>b(a.result);a.onerror=()=>c(a.error)})}function asyncifyTransaction(a){return new Promise((b,c)=>{a.oncomplete=()=>b();a.onerror=()=>c(a.error);a.onabort=()=>c(a.error)})} function openReadOnlyTransaction(a,b){return openTransaction(a,b)}function openWriteTransaction(a,b){return openTransaction(a,b,!0)}async function openTransaction(a,b,c=!1,d=!0){const e=await lazyOpenDatabase(a);try{const g=e.transaction(["keyvaluepairs"],c?"readwrite":"readonly");return b(g)}catch(g){if(d&&"InvalidStateError"===g.name)return DATABASE_PROMISE_MAP.delete(a),openTransaction(a,b,c,!1);throw g;}} function lazyOpenDatabase(a){RequireString(a);let b=DATABASE_PROMISE_MAP.get(a);b instanceof Promise||(b=openDatabase$jscomp$1(a),DATABASE_PROMISE_MAP.set(a,b),b.catch(c=>DATABASE_PROMISE_MAP.delete(a)));return b}async function openDatabase$jscomp$1(a){RequireString(a);const b=indexedDB.open(a,2);b.addEventListener("upgradeneeded",c=>{try{c.target.result.createObjectStore("keyvaluepairs")}catch(d){console.error(`Failed to create objectstore for database ${a}`,d)}});return asyncifyRequest(b)} function RequireString(a){if("string"!==typeof a)throw new TypeError("expected string");}function getEntriesFromCursor(a,b){const c=a.objectStore("keyvaluepairs").openCursor();return new Promise(d=>{const e=[];c.onsuccess=g=>{if(g=g.target.result){switch(b){case "entries":e.push([g.key,g.value]);break;case "keys":e.push(g.key);break;case "values":e.push(g.value)}g.continue()}else d(e)}})} class KVStorageContainer{constructor(a){RequireString(a);this.name=a}async ready(){await lazyOpenDatabase(this.name)}set(a,b){RequireString(a);return openWriteTransaction(this.name,async c=>{var d=c.objectStore("keyvaluepairs").put(b,a);d=asyncifyRequest(d);c=asyncifyTransaction(c);await Promise.all([c,d])})}get(a){RequireString(a);return openReadOnlyTransaction(this.name,async b=>{var c=b.objectStore("keyvaluepairs").get(a);c=asyncifyRequest(c);b=asyncifyTransaction(b);[,b]=await Promise.all([b, c]);return b})}delete(a){RequireString(a);return openWriteTransaction(this.name,async b=>{var c=b.objectStore("keyvaluepairs").delete(a);c=asyncifyRequest(c);b=asyncifyTransaction(b);await Promise.all([b,c])})}clear(){return openWriteTransaction(this.name,async a=>{var b=a.objectStore("keyvaluepairs").clear();b=asyncifyRequest(b);a=asyncifyTransaction(a);await Promise.all([a,b])})}keys(){return openReadOnlyTransaction(this.name,async a=>{if(SUPPORTS_GETALLKEYS){var b=a.objectStore("keyvaluepairs").getAllKeys(); b=asyncifyRequest(b)}else b=getEntriesFromCursor(a,"keys");a=asyncifyTransaction(a);[,a]=await Promise.all([a,b]);return a})}values(){return openReadOnlyTransaction(this.name,async a=>{if(SUPPORTS_GETALL){var b=a.objectStore("keyvaluepairs").getAll();b=asyncifyRequest(b)}else b=getEntriesFromCursor(a,"values");a=asyncifyTransaction(a);[,a]=await Promise.all([a,b]);return a})}entries(){return openReadOnlyTransaction(this.name,async a=>{var b=getEntriesFromCursor(a,"entries");a=asyncifyTransaction(a); [,b]=await Promise.all([a,b]);return b})}}self.KVStorageContainer=KVStorageContainer;"use strict";const KVStorageContainer$jscomp$1=self.KVStorageContainer,CRITICAL_ERRORS=[/no available storage method found/i,/an attempt was made to break through the security policy of the user agent/i,/the user denied permission to access the database/i,/a mutation operation was attempted on a database that did not allow mutations/i,/idbfactory\.open\(\) called in an invalid security context/i],memoryStorage=new WeakMap; let isInMemory=!1;"undefined"===typeof indexedDB&&(isInMemory=!0,console.warn("Unable to use local storage because indexedDB is not defined"));function NOT_IMPLEMENTED(a){throw Error(`"${a}" is not implemented`);}function DISALLOW_CALLBACK(a){if("function"===typeof a)throw Error("localforage callback API is not implemented; please use the promise API instead");} function StructuredClone(a){return"object"===typeof a?new Promise(b=>{const {port1:c,port2:d}=new MessageChannel;d.onmessage=e=>b(e.data);c.postMessage(a)}):Promise.resolve(a)} class ForageAdaptor{constructor(a){this._inst=a;memoryStorage.set(this,new Map)}_MaybeSwitchToMemoryFallback(a){if(!isInMemory)for(const b of CRITICAL_ERRORS)if(a&&b.test(a.message)){console.error("Unable to use local storage, reverting to in-memory store: ",a,a.message);isInMemory=!0;break}}async _getItemFallback(a){a=memoryStorage.get(this).get(a);a=await StructuredClone(a);return"undefined"===typeof a?null:a}async _setItemFallback(a,b){b=await StructuredClone(b);memoryStorage.get(this).set(a,b)}_removeItemFallback(a){memoryStorage.get(this).delete(a)}_clearFallback(){memoryStorage.get(this).clear()}_keysFallback(){return Array.from(memoryStorage.get(this).keys())}IsUsingFallback(){return isInMemory}async getItem(a, b){DISALLOW_CALLBACK(b);if(isInMemory)return await this._getItemFallback(a);let c;try{c=await this._inst.get(a)}catch(d){this._MaybeSwitchToMemoryFallback(d);if(isInMemory)return await this._getItemFallback(a);console.error(`Error reading '${a}' from storage, returning null: `,d);return null}return"undefined"===typeof c?null:c}async setItem(a,b,c){DISALLOW_CALLBACK(c);"undefined"===typeof b&&(b=null);if(isInMemory)await this._setItemFallback(a,b);else try{await this._inst.set(a,b)}catch(d){if(this._MaybeSwitchToMemoryFallback(d), isInMemory)await this._setItemFallback(a,b);else throw d;}}async removeItem(a,b){DISALLOW_CALLBACK(b);if(isInMemory)this._removeItemFallback(a);else try{await this._inst.delete(a)}catch(c){this._MaybeSwitchToMemoryFallback(c),isInMemory?this._removeItemFallback(a):console.error(`Error removing '${a}' from storage: `,c)}}async clear(a){DISALLOW_CALLBACK(a);if(isInMemory)this._clearFallback();else try{await this._inst.clear()}catch(b){this._MaybeSwitchToMemoryFallback(b),isInMemory?this._clearFallback(): console.error("Error clearing storage: ",b)}}async keys(a){DISALLOW_CALLBACK(a);if(isInMemory)return this._keysFallback();a=[];try{a=await this._inst.keys()}catch(b){this._MaybeSwitchToMemoryFallback(b);if(isInMemory)return this._keysFallback();console.error("Error getting storage keys: ",b)}return a}ready(a){DISALLOW_CALLBACK(a);return isInMemory?Promise.resolve(!0):this._inst.ready()}createInstance(a){if("object"!==typeof a)throw new TypeError("invalid options object");a=a.name;if("string"!==typeof a)throw new TypeError("invalid store name"); a=new KVStorageContainer$jscomp$1(a);return new ForageAdaptor(a)}length(a){NOT_IMPLEMENTED("localforage.length()")}key(a,b){NOT_IMPLEMENTED("localforage.key()")}iterate(a,b){NOT_IMPLEMENTED("localforage.iterate()")}setDriver(a){NOT_IMPLEMENTED("localforage.setDriver()")}config(a){NOT_IMPLEMENTED("localforage.config()")}defineDriver(a){NOT_IMPLEMENTED("localforage.defineDriver()")}driver(){NOT_IMPLEMENTED("localforage.driver()")}supports(a){NOT_IMPLEMENTED("localforage.supports()")}dropInstance(){NOT_IMPLEMENTED("localforage.dropInstance()")}disableMemoryMode(){isInMemory= !1}}self.localforage=new ForageAdaptor(new KVStorageContainer$jscomp$1("localforage"));"use strict";const C3$jscomp$4=self.C3;C3$jscomp$4.Supports={};C3$jscomp$4.Supports.WebAnimations=(()=>{try{if("Safari"===C3$jscomp$4.Platform.Browser||"undefined"===typeof document)return!1;const a=document.createElement("div");return"undefined"===typeof a.animate?!1:"undefined"!==typeof a.animate([{opacity:"0"},{opacity:"1"}],1E3).reverse}catch(a){return!1}})(); C3$jscomp$4.Supports.DialogElement="undefined"!==typeof HTMLDialogElement;C3$jscomp$4.Supports.RequestIdleCallback=!!self.requestIdleCallback;C3$jscomp$4.Supports.ImageBitmap=!!self.createImageBitmap;C3$jscomp$4.Supports.ImageBitmapOptions=!1;C3$jscomp$4.Supports.ImageBitmapOptionsResize=!1; if(C3$jscomp$4.Supports.ImageBitmap){try{self.createImageBitmap(new ImageData(32,32),{premultiplyAlpha:"none"}).then(()=>{C3$jscomp$4.Supports.ImageBitmapOptions=!0}).catch(()=>{C3$jscomp$4.Supports.ImageBitmapOptions=!1})}catch(a){C3$jscomp$4.Supports.ImageBitmapOptions=!1}try{self.createImageBitmap(new ImageData(32,32),{resizeWidth:10,resizeHeight:10}).then(a=>{C3$jscomp$4.Supports.ImageBitmapOptionsResize=10===a.width&&10===a.height}).catch(()=>{C3$jscomp$4.Supports.ImageBitmapOptionsResize=!1})}catch(a){C3$jscomp$4.Supports.ImageBitmapOptionsResize= !1}}C3$jscomp$4.Supports.ClipboardReadText=!(!navigator.clipboard||!navigator.clipboard.readText||"Firefox"===C3$jscomp$4.Platform.Browser);C3$jscomp$4.Supports.PermissionsQuery=!(!navigator.permissions||!navigator.permissions.query);C3$jscomp$4.Supports.ClipboardPermissionsQuery=!1;C3$jscomp$4.Supports.PermissionsQuery&&navigator.permissions.query({name:"clipboard-read"}).then(()=>{C3$jscomp$4.Supports.ClipboardPermissionsQuery=!0}).catch(()=>{C3$jscomp$4.Supports.ClipboardPermissionsQuery=!1}); C3$jscomp$4.Supports.AsyncClipboardApi=!!(navigator.permissions&&navigator.clipboard&&self.ClipboardItem);C3$jscomp$4.Supports.Proxies="undefined"!==typeof Proxy;C3$jscomp$4.Supports.DownloadAttribute=(()=>"undefined"===typeof document?!1:"undefined"!==typeof document.createElement("a").download)();C3$jscomp$4.Supports.Fetch="function"===typeof fetch;C3$jscomp$4.Supports.PersistentStorage=!!(self.isSecureContext&&"Opera"!==C3$jscomp$4.Platform.Browser&&navigator.storage&&navigator.storage.persist); C3$jscomp$4.Supports.StorageQuotaEstimate=!!(self.isSecureContext&&navigator.storage&&navigator.storage.estimate);C3$jscomp$4.Supports.Fullscreen=(()=>{if("undefined"===typeof document||"iOS"===C3$jscomp$4.Platform.OS)return!1;const a=document.documentElement;return!!(a.requestFullscreen||a.msRequestFullscreen||a.mozRequestFullScreen||a.webkitRequestFullscreen)})();C3$jscomp$4.Supports.ImageDecoder="undefined"!==typeof self.ImageDecoder;C3$jscomp$4.Supports.WebCodecs=!!self.VideoEncoder; C3$jscomp$4.Supports.NativeFileSystemAPI=!!self.showOpenFilePicker;C3$jscomp$4.Supports.QueryLocalFonts=!!self.queryLocalFonts;C3$jscomp$4.Supports.UserActivation=!!navigator.userActivation;C3$jscomp$4.Supports.CanvasToBlobWebP=!1; (async()=>{let a;"undefined"===typeof document?a=new OffscreenCanvas(32,32):(a=document.createElement("canvas"),a.width=32,a.height=32);var b=a.getContext("2d");b.fillStyle="blue";b.fillRect(0,0,32,32);b=null;try{a.toBlob?b=await new Promise(c=>a.toBlob(c,"image/webp",1)):a.convertToBlob&&(b=await a.convertToBlob({type:"image/webp",quality:1})),C3$jscomp$4.Supports.CanvasToBlobWebP=b&&"image/webp"===b.type}catch(c){C3$jscomp$4.Supports.CanvasToBlobWebP=!1}})();"use strict";const C3$jscomp$5=self.C3; if(!String.prototype.trimStart){const a=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*/;String.prototype.trimStart=function(){return this.replace(a,"")}}if(!String.prototype.trimEnd){const a=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*$/;String.prototype.trimEnd=function(){return this.replace(a,"")}} String.prototype.replaceAll||(String.prototype.replaceAll=function(a,b){return this.replace(new RegExp(C3$jscomp$5.EscapeRegex(a),"g"),b)});Array.prototype.values||(Array.prototype.values=function*(){for(const a of this)yield a});if(!Array.prototype.flat){function a(b,c){return b.reduce((d,e)=>{0<c&&Array.isArray(e)?Array.prototype.push.apply(d,a(e,c-1)):d.push(e);return d},[])}Array.prototype.flat=function(b=1){return a(this,b)}} Array.prototype.at||(Array.prototype.at=function(a){a=Math.trunc(a)||0;0>a&&(a+=this.length);if(!(0>a||a>=this.length))return this[a]});String.prototype.at||(String.prototype.at=function(a){a=Math.trunc(a)||0;0>a&&(a+=this.length);if(!(0>a||a>=this.length))return this[a]});RegExp.escape||(RegExp.escape=function(a){return String(a).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")}); navigator.storage&&!navigator.storage.estimate&&navigator.webkitTemporaryStorage&&navigator.webkitTemporaryStorage.queryUsageAndQuota&&(navigator.storage.estimate=function(){return new Promise((a,b)=>navigator.webkitTemporaryStorage.queryUsageAndQuota((c,d)=>a({usage:c,quota:d}),b))});"undefined"===typeof self.isSecureContext&&(self.isSecureContext="https:"===location.protocol);"undefined"===typeof self.globalThis&&(self.globalThis=self);"use strict";const C3$jscomp$6=self.C3; function assertFail(a){let b=C3$jscomp$6.GetCallStack();console.error("Assertion failure: "+a+"\n\nStack trace:\n"+b)}self.assert=function(a,b){a||assertFail(b)};"use strict";const C3$jscomp$7=self.C3,C3X=self.C3X;C3$jscomp$7.IsNumber=function(a){return"number"===typeof a};C3$jscomp$7.IsFiniteNumber=function(a){return C3$jscomp$7.IsNumber(a)&&isFinite(a)};C3$jscomp$7.RequireNumber=function(a){if(!C3$jscomp$7.IsNumber(a))throw new TypeError("expected number");};C3$jscomp$7.RequireOptionalNumber=function(a){C3$jscomp$7.IsNullOrUndefined(a)}; C3$jscomp$7.RequireNumberInRange=function(a,b,c){if(!C3$jscomp$7.IsNumber(a)||isNaN(a)||b>a||c<a)throw new RangeError("number outside of range");};C3$jscomp$7.RequireAllNumber=function(...a){for(let b of a);};C3$jscomp$7.RequireFiniteNumber=function(a){if(!C3$jscomp$7.IsFiniteNumber(a))throw new TypeError("expected finite number");};C3$jscomp$7.RequireOptionalFiniteNumber=function(a){C3$jscomp$7.IsNullOrUndefined(a)};C3$jscomp$7.RequireAllFiniteNumber=function(...a){for(let b of a);}; C3$jscomp$7.IsString=function(a){return"string"===typeof a};C3$jscomp$7.RequireString=function(a){if(!C3$jscomp$7.IsString(a))throw new TypeError("expected string");};C3$jscomp$7.RequireOptionalString=function(a){C3$jscomp$7.IsNullOrUndefined(a)};C3$jscomp$7.RequireAllString=function(...a){for(let b of a);};C3$jscomp$7.IsSimpleObject=function(a){return"object"!==typeof a||null===a?!1:(a=Object.getPrototypeOf(a))?a.constructor===Object:null===a}; C3$jscomp$7.RequireSimpleObject=function(a){if(!C3$jscomp$7.IsSimpleObject(a))throw new TypeError("expected simple object");};C3$jscomp$7.RequireOptionalSimpleObject=function(a){if(!C3$jscomp$7.IsNullOrUndefined(a)&&!C3$jscomp$7.IsSimpleObject(a))throw new TypeError("expected simple object");};C3$jscomp$7.IsObject=function(a){return"object"===typeof a&&null!==a&&!Array.isArray(a)};C3$jscomp$7.RequireObject=function(a){if(!C3$jscomp$7.IsObject(a))throw new TypeError("expected object");}; C3$jscomp$7.RequireOptionalObject=function(a){C3$jscomp$7.IsNullOrUndefined(a)};C3$jscomp$7.RequireAllObject=function(...a){for(let b of a);};C3$jscomp$7.IsFileLike=function(a){return C3$jscomp$7.WeakIsInstanceOf(a,Blob)&&"string"===typeof a.name};C3$jscomp$7.RequireFileLike=function(a){if(!C3$jscomp$7.IsFileLike(a))throw new TypeError("expected file");};C3$jscomp$7.RequireOptionalFileLike=function(a){C3$jscomp$7.IsNullOrUndefined(a)};C3$jscomp$7.IsArray=function(a){return Array.isArray(a)}; C3$jscomp$7.RequireArray=function(a){if(!C3$jscomp$7.IsArray(a))throw new TypeError("expected array");};C3$jscomp$7.RequireOptionalArray=function(a){C3$jscomp$7.IsNullOrUndefined(a)};C3$jscomp$7.RequireAllArray=function(...a){for(let b of a);};C3$jscomp$7.Is2DArray=function(a){return C3$jscomp$7.IsArray(a)?a.length?C3$jscomp$7.IsArray(a[0])?!0:!1:!0:!1}; C3$jscomp$7.Require2DArray=function(a){if(!C3$jscomp$7.Is2DArray(a))throw new TypeError("expected 2d array");for(let b of a)if(!C3$jscomp$7.IsArray(b))throw new TypeError("expected 2d array");};C3$jscomp$7.RequireOptional2DArray=function(a){C3$jscomp$7.IsNullOrUndefined(a)};C3$jscomp$7.IsFunction=function(a){return"function"===typeof a}; C3$jscomp$7.RequireFunction=function(a,b){if(!C3$jscomp$7.IsFunction(a))throw new TypeError("expected function");if(!C3$jscomp$7.IsNullOrUndefined(b)&&a!==b)throw new TypeError("expected same function reference");};C3$jscomp$7.RequireOptionalFunction=function(a){C3$jscomp$7.IsNullOrUndefined(a)};C3$jscomp$7.RequireAllFunction=function(...a){for(let b of a);}; C3$jscomp$7.RequireAnyFunction=function(a,...b){if(!C3$jscomp$7.IsFunction(a))throw new TypeError("expected function");if(!b.length)throw Error("missing comparison functions");for(let c of b)if(!C3$jscomp$7.IsNullOrUndefined(c)&&a===c)return;throw new TypeError("expected same function reference");};C3$jscomp$7.RequireOptionalAllFunction=function(...a){if(!C3$jscomp$7.IsNullOrUndefined(a))for(let b of a);};C3$jscomp$7.IsInstanceOf=function(a,b){return a instanceof b}; C3$jscomp$7.IsInstanceOfAny=function(a,...b){for(let c of b)if(C3$jscomp$7.IsInstanceOf(a,c))return!0;return!1};C3$jscomp$7.RequireInstanceOf=function(a,b){if(!C3$jscomp$7.IsInstanceOf(a,b))throw new TypeError("unexpected type");};C3$jscomp$7.RequireOptionalInstanceOf=function(a,b){C3$jscomp$7.IsNullOrUndefined(a)};C3$jscomp$7.RequireAllInstanceOf=function(a,...b){for(let c of b);}; C3$jscomp$7.RequireAnyInstanceOf=function(a,...b){if(!C3$jscomp$7.IsInstanceOfAny(a,...b))throw new TypeError("unexpected type");};C3$jscomp$7.RequireAnyOptionalInstanceOf=function(a,...b){if(!C3$jscomp$7.IsNullOrUndefined(a)&&!C3$jscomp$7.IsInstanceOfAny(a,...b))throw new TypeError("unexpected type");};C3$jscomp$7.IsArrayOf=function(a,b){for(let c of a)if(!C3$jscomp$7.IsInstanceOf(c,b))return!1;return!0}; C3$jscomp$7.IsArrayOfFiniteNumbers=function(a){for(let b of a)if(!C3$jscomp$7.IsFiniteNumber(b))return!1;return!0};C3$jscomp$7.RequireArrayOf=function(a,b){for(let c of a);};C3$jscomp$7.RequireOptionalArrayOf=function(a,b){if(!C3$jscomp$7.IsNullOrUndefined(a))for(let c of a);};C3$jscomp$7.RequireArrayOfAny=function(a,...b){for(let c of a);};C3$jscomp$7.RequireOptionalArrayOfAny=function(a,...b){if(!C3$jscomp$7.IsNullOrUndefined(a))for(let c of a);}; C3$jscomp$7.IsDOMNode=function(a,b){return C3$jscomp$7.IsNullOrUndefined(a)||!C3$jscomp$7.IsString(a.nodeName)?!1:!b||C3$jscomp$7.equalsNoCase(a.nodeName,b)};C3$jscomp$7.RequireDOMNode=function(a,b){if(C3$jscomp$7.IsNullOrUndefined(a)||!C3$jscomp$7.IsString(a.nodeName))throw new TypeError("expected DOM node");if(b&&!C3$jscomp$7.equalsNoCase(a.nodeName,b))throw new TypeError(`expected DOM '${b}' node`);};C3$jscomp$7.RequireOptionalDOMNode=function(a,b){C3$jscomp$7.IsNullOrUndefined(a)}; C3$jscomp$7.IsHTMLElement=function(a,b){return C3$jscomp$7.IsNullOrUndefined(a)||!C3$jscomp$7.IsString(a.tagName)?!1:!b||C3$jscomp$7.equalsNoCase(a.tagName,b)};C3$jscomp$7.RequireHTMLElement=function(a,b){if(C3$jscomp$7.IsNullOrUndefined(a)||!C3$jscomp$7.IsString(a.tagName))throw new TypeError("expected HTML element");if(b&&!C3$jscomp$7.equalsNoCase(a.tagName,b))throw new TypeError(`expected HTML '${b}' element`);};C3$jscomp$7.RequireOptionalHTMLElement=function(a,b){C3$jscomp$7.IsNullOrUndefined(a)}; C3$jscomp$7.IsDrawable=function(a){return C3$jscomp$7.IsHTMLElement(a,"img")||C3$jscomp$7.IsHTMLElement(a,"canvas")||C3$jscomp$7.IsHTMLElement(a,"video")||"undefined"!==typeof OffscreenCanvas&&a instanceof OffscreenCanvas||"undefined"!==typeof ImageBitmap&&a instanceof ImageBitmap};C3$jscomp$7.RequireDrawable=function(a){if(!C3$jscomp$7.IsDrawable(a))throw new TypeError("expected drawable");};C3$jscomp$7.RequireOptionalDrawable=function(a){C3$jscomp$7.IsNullOrUndefined(a)}; C3$jscomp$7.IsDrawableOrImageData=function(a){return a instanceof ImageData?!0:C3$jscomp$7.IsDrawable(a)};C3$jscomp$7.RequireDrawableOrImageData=function(a){if(!C3$jscomp$7.IsDrawableOrImageData(a))throw new TypeError("expected drawable or image data");};C3$jscomp$7.RequireOptionalDrawableOrImageData=function(a){if(!C3$jscomp$7.IsNullOrUndefined(a)&&!C3$jscomp$7.IsDrawableOrImageData(a))throw new TypeError("expected drawable or image data");}; C3$jscomp$7.IsStringLike=function(a){return"string"===typeof a||C3$jscomp$7.HtmlString&&a instanceof C3$jscomp$7.HtmlString||a instanceof C3$jscomp$7.BBString};C3$jscomp$7.RequireStringLike=function(a){if(!C3$jscomp$7.IsStringLike(a))throw new TypeError("expected string-like");};C3$jscomp$7.RequireOptionalStringLike=function(a){C3$jscomp$7.IsNullOrUndefined(a)};C3$jscomp$7.RequireAllStringLike=function(...a){for(let b of a);}; C3$jscomp$7.RequireOverride=function(){throw Error("must be overridden");};C3$jscomp$7.NotYetImplemented=function(){throw Error("not yet implemented");};C3$jscomp$7.IsDefined=function(a,...b){if("undefined"===typeof a)return!1;for(let c of b){if("undefined"===typeof a[c])return!1;a=a[c]}return!0};C3$jscomp$7.IsNullOrUndefined=function(a){return"undefined"===typeof a||null===a};C3$jscomp$7.AreArrayElementsOfSameType=function(a){let b=a[0].constructor;for(let c of a)if(c.constructor!==b)return!1;return b}; C3$jscomp$7.AreArrayElementsOfType=function(a,b){for(let c of a)if(!(c instanceof b))return!1;return!0};const TypedArray$jscomp$1=Object.getPrototypeOf(Uint8Array);C3$jscomp$7.IsTypedArray=function(a){return C3$jscomp$7.IsInstanceOf(a,TypedArray$jscomp$1)};C3$jscomp$7.RequireTypedArray=function(a){};C3$jscomp$7.WeakRequireTypedArray=function(a){C3$jscomp$7.WeakRequireInstanceOf(a,TypedArray$jscomp$1)}; C3$jscomp$7.WeakRequireAnyInstanceOf=function(a,...b){if(!C3$jscomp$7.WeakIsAnyInstanceOf(a,...b))throw new TypeError("unexpected type");};C3$jscomp$7.WeakIsAnyInstanceOf=function(a,...b){for(const c of b)if(C3$jscomp$7.WeakIsInstanceOf(a,c))return!0;return!1};C3$jscomp$7.WeakRequireInstanceOf=function(a,b){if(!C3$jscomp$7.WeakIsInstanceOf(a,b))throw new TypeError("unexpected type");}; C3$jscomp$7.WeakIsInstanceOf=function(a,b){for(;a=Object.getPrototypeOf(a);)if(a.constructor.name===b.name)return!0;return!1};C3X.RequireNumber=C3$jscomp$7.RequireNumber;C3X.RequireOptionalNumber=C3$jscomp$7.RequireOptionalNumber;C3X.RequireFiniteNumber=C3$jscomp$7.RequireFiniteNumber;C3X.RequireOptionalFiniteNumber=C3$jscomp$7.RequireOptionalFiniteNumber;C3X.RequireString=C3$jscomp$7.RequireString;C3X.RequireOptionalString=C3$jscomp$7.RequireOptionalString;C3X.RequireObject=C3$jscomp$7.RequireObject; C3X.RequireOptionalObject=C3$jscomp$7.RequireOptionalObject;C3X.RequireArray=C3$jscomp$7.RequireArray;C3X.RequireOptionalArray=C3$jscomp$7.RequireOptionalArray;C3X.RequireFunction=C3$jscomp$7.RequireFunction;C3X.RequireOptionalFunction=C3$jscomp$7.RequireOptionalFunction;C3X.RequireInstanceOf=C3$jscomp$7.RequireInstanceOf;C3X.RequireOptionalInstanceOf=C3$jscomp$7.RequireOptionalInstanceOf;C3X.IsNullOrUndefined=C3$jscomp$7.IsNullOrUndefined;"use strict";const C3$jscomp$8=self.C3,logRafIds=new Map; C3$jscomp$8.ColorLog=function(a,b){console.log(`%c${a}`,`font-weight: bold; color:${b}`)};C3$jscomp$8.RafLog=function(a,...b){logRafIds.has(a)||logRafIds.set(a,-1);-1===logRafIds.get(a)&&logRafIds.set(a,requestAnimationFrame(()=>{console.log(`%c${a}`,"font-weight: bold",...b);logRafIds.set(a,-1)}))};let measures;C3$jscomp$8.StartMeasure=function(a){performance.mark(a);measures||(measures=new Map);measures.has(a)||measures.set(a,{current:0,total:0,average:0,calls:1,toString:function(){return`${a} :: current => ${this.current.toPrecision(3)} :: average => ${this.average.toPrecision(3)} :: calls => ${this.calls}`}})}; C3$jscomp$8.EndMeasure=function(a){performance.measure(`measure-${a}`,a);const b=performance.getEntriesByName(`measure-${a}`)[0],c=measures.get(a);c.current=b.duration;c.total+=c.current;c.average=c.total/c.calls;console.log(c.toString());c.calls++;performance.clearMarks(a);performance.clearMeasures(`measure-${a}`)};C3$jscomp$8.GetCallStack=function(){return Error().stack};C3$jscomp$8.Debugger=function(){debugger};C3$jscomp$8.cast=function(a,b){return a&&a instanceof b?a:null}; C3$jscomp$8.getName=function(a){return"undefined"===typeof a?"undefined":null===a?"null":"boolean"===typeof a?"<boolean>":C3$jscomp$8.IsNumber(a)?"<number>":C3$jscomp$8.IsString(a)?"<string>":C3$jscomp$8.IsArray(a)?"<array>":"symbol"===typeof a?"<"+a.toString()+">":C3$jscomp$8.IsFunction(a)?a.name&&"Function"!==a.name?a.name:"<anonymous function>":"object"===typeof a?a.constructor&&a.constructor.name&&"Object"!==a.constructor.name?a.constructor.name:"<anonymous object>":"<unknown>"}; C3$jscomp$8.getType=function(a){return null===a?"null":Array.isArray(a)?"array":typeof a};C3$jscomp$8.range=function*(a,b){if(!isFinite(Math.abs(a-b)))throw Error("Invalid parameters");if(a>b)for(--a;a>=b;a--)yield a;else for(;a<b;a++)yield a};function isValidTypeChange(a,b){a=C3$jscomp$8.getType(a);b=C3$jscomp$8.getType(b);return"null"===a||"null"===b?!0:"undefined"===a||"undefined"===b?!1:a===b}let ctorObjectToProxy=new Map,ctorProxyToObject=new Map,proxyToObject=new WeakMap,releasedObjects=new WeakMap; C3$jscomp$8.DefendHandler={};const VALID_GET_MISSING_KEYS=new Set(["then","splice"]);function logDefendedObjectWarning(a){console.warn("[Defence] "+a+" @",C3$jscomp$8.GetCallStack())} C3$jscomp$8.DefendHandler.get=function(a,b){b in a||"symbol"===typeof b||VALID_GET_MISSING_KEYS.has(b)||logDefendedObjectWarning(`Accessed missing property '${b}' from defended object '${C3$jscomp$8.getName(a)}', returning undefined`);releasedObjects.has(a)&&"symbol"!==typeof b&&!VALID_GET_MISSING_KEYS.has(b)&&logDefendedObjectWarning(`Accessed property '${b}' on a released object '${C3$jscomp$8.getName(a)}'\nObject was originally released at: ${releasedObjects.get(a)})\nCall stack at access: `);return a[b]}; C3$jscomp$8.DefendHandler.set=function(a,b,c){b in a||ctorObjectToProxy.has(a)||logDefendedObjectWarning(`Set non-existent property '${b}' to '${c}' on defended object '${C3$jscomp$8.getName(a)}'`);isValidTypeChange(a[b],c)||ctorObjectToProxy.has(a)||logDefendedObjectWarning(`Set '${C3$jscomp$8.getType(a[b])}' property '${b}' to type '${C3$jscomp$8.getType(c)}' on defended object '${C3$jscomp$8.getName(a)}'`);releasedObjects.has(a)&&logDefendedObjectWarning(`Set property '${b}' on a released object '${C3$jscomp$8.getName(a)}'\nObject was originally released at: ${releasedObjects.get(a)})\nCall stack at access: `); a[b]=c;return!0};C3$jscomp$8.DefendHandler.deleteProperty=function(a,b){throw new ReferenceError(`Cannot delete property '${b}' from defended object '${C3$jscomp$8.getName(a)}'`);};C3$jscomp$8.DefendHandler.defineProperty=function(a,b,c){throw new ReferenceError(`Cannot define property '${b}' on defended object '${C3$jscomp$8.getName(a)}'`);};C3$jscomp$8.DefendHandler.enumerate=function(a){throw new ReferenceError(`Cannot enumerate defended object '${C3$jscomp$8.getName(a)}'`);};let checkRafId=-1; function CheckDefendedObjectsUsedCorrectly(){checkRafId=-1;if(0<ctorObjectToProxy.size||0<ctorProxyToObject.size){let a=[...(new Set([...ctorObjectToProxy.keys()].map(b=>C3$jscomp$8.getName(b))))].join();console.warn(`An object derived from DefendedBase was not protected with debugDefend(). This will disable some checks. See the coding guidelines! Possible affected class names: ${a}`);ctorObjectToProxy.clear();ctorProxyToObject.clear()}} C3$jscomp$8.DefendedBase=class{constructor(){if(C3$jscomp$8.isDebugDefend&&C3$jscomp$8.Supports.Proxies){var a=new.target;a=Object.create(a.prototype);var b=new Proxy(a,C3$jscomp$8.DefendHandler);ctorObjectToProxy.set(a,b);ctorProxyToObject.set(b,a);proxyToObject.set(b,a);-1===checkRafId&&(checkRafId=requestAnimationFrame(CheckDefendedObjectsUsedCorrectly));return b}}}; C3$jscomp$8.debugDefend=function(a){if(C3$jscomp$8.isDebugDefend&&C3$jscomp$8.Supports.Proxies&&a instanceof C3$jscomp$8.DefendedBase){if(!ctorProxyToObject.has(a))return a;let b=ctorProxyToObject.get(a);ctorProxyToObject.delete(a);ctorObjectToProxy.delete(b);return a}return C3$jscomp$8.isDebug?Object.seal(a):a}; C3$jscomp$8.New=function(a,...b){let c;try{c=new a(...b)}catch(d){throw ctorProxyToObject.clear(),ctorObjectToProxy.clear(),d;}C3$jscomp$8.isDebugDefend&&VerifyObjectPropertiesConsistent(a,c);return C3$jscomp$8.debugDefend(c)};C3$jscomp$8.Release=function(a){(a=proxyToObject.get(a))&&releasedObjects.set(a,C3$jscomp$8.GetCallStack())};C3$jscomp$8.WasReleased=function(a){return(a=proxyToObject.get(a))?!!releasedObjects.get(a):!1};let typeProperties=new Map; function getObjectPropertySet(a){let b=new Set;for(let c in a)b.add(c);return b}function VerifyObjectPropertiesConsistent(a,b){b=getObjectPropertySet(b);let c=typeProperties.get(a);if(c){let d=[];for(let e of c.values())b.has(e)?b.delete(e):d.push(e);C3$jscomp$8.appendArray(d,[...b]);d.length&&console.warn(`[Defence] '${C3$jscomp$8.getName(a)}' constructor creates inconsistent properties: ${d.join(", ")}`)}else typeProperties.set(a,b)} C3$jscomp$8.PerfMark=class{constructor(a){this._name="";a&&this.start(a)}start(a){C3$jscomp$8.isPerformanceProfiling&&(this._name=a,performance.mark(this._name+"-Start"))}end(){C3$jscomp$8.isPerformanceProfiling&&(performance.mark(this._name+"-End"),performance.measure(this._name,this._name+"-Start",this._name+"-End"))}next(a){C3$jscomp$8.isPerformanceProfiling&&(this.end(),this._name=a,performance.mark(this._name+"-Start"))}};"use strict"; const C3$jscomp$9=self.C3,TWO_PI=2*Math.PI,D_TO_R=Math.PI/180,R_TO_D=180/Math.PI;C3$jscomp$9.wrap=function(a,b,c){a=Math.floor(a);b=Math.floor(b);c=Math.floor(c);const d=c-b;return 0===d?c:a<b?(a=c-(b-a)%d,a===c?0:a):b+(a-b)%d};C3$jscomp$9.mapToRange=function(a,b,c,d,e){return(a-b)*(e-d)/(c-b)+d};C3$jscomp$9.normalize=function(a,b,c){return 0===b-c?1:(a-b)/(c-b)};C3$jscomp$9.clamp=function(a,b,c){return a<b?b:a>c?c:a};C3$jscomp$9.clampAngle=function(a){a%=TWO_PI;0>a&&(a+=TWO_PI);return a}; C3$jscomp$9.toRadians=function(a){return a*D_TO_R};C3$jscomp$9.toDegrees=function(a){return a*R_TO_D};C3$jscomp$9.distanceTo=function(a,b,c,d){return Math.hypot(c-a,d-b)};C3$jscomp$9.distanceSquared=function(a,b,c,d){a=c-a;b=d-b;return a*a+b*b};C3$jscomp$9.angleTo=function(a,b,c,d){return Math.atan2(d-b,c-a)};C3$jscomp$9.angleDiff=function(a,b){if(a===b)return 0;a=Math.sin(a)*Math.sin(b)+Math.cos(a)*Math.cos(b);return 1<=a?0:-1>=a?Math.PI:Math.acos(a)}; C3$jscomp$9.angleRotate=function(a,b,c){let d=Math.sin(a),e=Math.cos(a),g=Math.sin(b),k=Math.cos(b);return Math.acos(d*g+e*k)>c?0<e*g-d*k?C3$jscomp$9.clampAngle(a+c):C3$jscomp$9.clampAngle(a-c):C3$jscomp$9.clampAngle(b)};C3$jscomp$9.angleClockwise=function(a,b){return 0>=Math.cos(a)*Math.sin(b)-Math.sin(a)*Math.cos(b)}; C3$jscomp$9.angleLerp=function(a,b,c,d=0){let e=C3$jscomp$9.angleDiff(a,b);d*=TWO_PI;return C3$jscomp$9.angleClockwise(b,a)?C3$jscomp$9.clampAngle(a+(e+d)*c):C3$jscomp$9.clampAngle(a-(e+d)*c)};C3$jscomp$9.angleLerpClockwise=function(a,b,c,d=0){const e=C3$jscomp$9.angleDiff(a,b);d*=TWO_PI;return C3$jscomp$9.angleClockwise(b,a)?C3$jscomp$9.clampAngle(a+(e+d)*c):C3$jscomp$9.clampAngle(a+(TWO_PI-e+d)*c)}; C3$jscomp$9.angleLerpAntiClockwise=function(a,b,c,d=0){const e=C3$jscomp$9.angleDiff(a,b);d*=TWO_PI;return C3$jscomp$9.angleClockwise(b,a)?C3$jscomp$9.clampAngle(a-(-TWO_PI+e-d)*c):C3$jscomp$9.clampAngle(a-(e+d)*c)};C3$jscomp$9.angleReflect=function(a,b){const c=C3$jscomp$9.angleDiff(a,b);return C3$jscomp$9.angleClockwise(a,b)?C3$jscomp$9.clampAngle(b-c):C3$jscomp$9.clampAngle(b+c)};C3$jscomp$9.lerp=function(a,b,c){return a+c*(b-a)};C3$jscomp$9.unlerp=function(a,b,c){return a===b?0:(c-a)/(b-a)}; C3$jscomp$9.relerp=function(a,b,c,d,e){return C3$jscomp$9.lerp(d,e,C3$jscomp$9.unlerp(a,b,c))};C3$jscomp$9.qarp=function(a,b,c,d){return C3$jscomp$9.lerp(C3$jscomp$9.lerp(a,b,d),C3$jscomp$9.lerp(b,c,d),d)};C3$jscomp$9.cubic=function(a,b,c,d,e){return C3$jscomp$9.lerp(C3$jscomp$9.qarp(a,b,c,e),C3$jscomp$9.qarp(b,c,d,e),e)};C3$jscomp$9.cosp=function(a,b,c){return(a+b+(a-b)*Math.cos(c*Math.PI))/2};C3$jscomp$9.isPOT=function(a){return 0<a&&0===(a-1&a)}; C3$jscomp$9.nextHighestPowerOfTwo=function(a){--a;for(let b=1;32>b;b<<=1)a|=a>>b;return a+1};C3$jscomp$9.roundToNearestFraction=function(a,b){return Math.round(a*b)/b};C3$jscomp$9.floorToNearestFraction=function(a,b){return Math.floor(a*b)/b};C3$jscomp$9.roundToDp=function(a,b){b=Math.max(Math.floor(b),0);b=Math.pow(10,b);return Math.round(a*b)/b};C3$jscomp$9.toFixed=function(a,b){a=a.toFixed(b);for(b=a.length-1;0<=b&&"0"===a.charAt(b);--b);0<=b&&"."===a.charAt(b)&&--b;return 0>b?a:a.substr(0,b+1)}; C3$jscomp$9.PackRGB=function(a,b,c){return C3$jscomp$9.clamp(a,0,255)|C3$jscomp$9.clamp(b,0,255)<<8|C3$jscomp$9.clamp(c,0,255)<<16};C3$jscomp$9.PackRGBAEx=function(a,b,c,d){a=C3$jscomp$9.clamp(Math.floor(1024*a),-8192,8191);b=C3$jscomp$9.clamp(Math.floor(1024*b),-8192,8191);c=C3$jscomp$9.clamp(Math.floor(1024*c),-8192,8191);d=C3$jscomp$9.clamp(Math.floor(1023*d),0,1023);0>a&&(a+=16384);0>b&&(b+=16384);0>c&&(c+=16384);return-(274877906944*a+16777216*b+1024*c+d)}; C3$jscomp$9.PackRGBEx=function(a,b,c){return C3$jscomp$9.PackRGBAEx(a,b,c,1)};function isNegativeZero(a){return 0===a&&0>1/a}C3$jscomp$9.GetRValue=function(a){if(0<=a)return(a&255)/255;a=Math.floor(-a/274877906944);8191<a&&(a-=16384);return a/1024};C3$jscomp$9.GetGValue=function(a){if(0<=a)return((a&65280)>>8)/255;a=Math.floor(-a%274877906944/16777216);8191<a&&(a-=16384);return a/1024}; C3$jscomp$9.GetBValue=function(a){if(0<=a)return((a&16711680)>>16)/255;a=Math.floor(-a%16777216/1024);8191<a&&(a-=16384);return a/1024};C3$jscomp$9.GetAValue=function(a){return isNegativeZero(a)?0:0<=a?1:Math.floor(-a%1024)/1023};C3$jscomp$9.greatestCommonDivisor=function(a,b){a=Math.floor(a);for(b=Math.floor(b);0!==b;){let c=b;b=a%b;a=c}return a};const COMMON_ASPECT_RATIOS=[[3,2],[4,3],[5,4],[5,3],[6,5],[14,9],[16,9],[16,10],[21,9]]; C3$jscomp$9.getAspectRatio=function(a,b){a=Math.floor(a);b=Math.floor(b);if(a===b)return[1,1];for(var c of COMMON_ASPECT_RATIOS){let d=a/c[0]*c[1];if(1>Math.abs(b-d))return c.slice(0);d=a/c[1]*c[0];if(1>Math.abs(b-d))return[c[1],c[0]]}c=C3$jscomp$9.greatestCommonDivisor(a,b);return[a/c,b/c]}; C3$jscomp$9.segmentsIntersect=function(a,b,c,d,e,g,k,l){var n=Math.min(a,c),p=Math.max(e,k);if(Math.max(a,c)<Math.min(e,k)||n>p)return!1;n=Math.min(b,d);p=Math.max(g,l);if(Math.max(b,d)<Math.min(g,l)||n>p)return!1;n=e-a+k-c;p=g-b+l-d;a=c-a;b=d-b;e=k-e;g=l-g;l=Math.abs(b*e-g*a);return Math.abs(e*p-g*n)>l?!1:Math.abs(a*p-b*n)<=l}; C3$jscomp$9.segmentsIntersectPreCalc=function(a,b,c,d,e,g,k,l,n,p,r,w){const y=Math.max(n,r);if(g<Math.min(n,r)||e>y)return!1;e=Math.max(p,w);if(l<Math.min(p,w)||k>e)return!1;k=n-a+r-c;l=p-b+w-d;a=c-a;b=d-b;n=r-n;p=w-p;w=Math.abs(b*n-p*a);return Math.abs(n*l-p*k)>w?!1:Math.abs(a*l-b*k)<=w}; C3$jscomp$9.segmentIntersectsQuad=function(a,b,c,d,e){const g=Math.min(a,c),k=Math.max(a,c),l=Math.min(b,d),n=Math.max(b,d),p=e.getTlx(),r=e.getTly(),w=e.getTrx(),y=e.getTry(),B=e.getBrx(),C=e.getBry(),E=e.getBlx();e=e.getBly();return C3$jscomp$9.segmentsIntersectPreCalc(a,b,c,d,g,k,l,n,p,r,w,y)||C3$jscomp$9.segmentsIntersectPreCalc(a,b,c,d,g,k,l,n,w,y,B,C)||C3$jscomp$9.segmentsIntersectPreCalc(a,b,c,d,g,k,l,n,B,C,E,e)||C3$jscomp$9.segmentsIntersectPreCalc(a,b,c,d,g,k,l,n,E,e,p,r)}; C3$jscomp$9.segmentIntersectsAnyN=function(a,b,c,d,e){const g=Math.min(a,c),k=Math.max(a,c),l=Math.min(b,d),n=Math.max(b,d);let p=0;for(let r=e.length-4;p<=r;p+=2)if(C3$jscomp$9.segmentsIntersectPreCalc(a,b,c,d,g,k,l,n,e[p],e[p+1],e[p+2],e[p+3]))return!0;return C3$jscomp$9.segmentsIntersectPreCalc(a,b,c,d,g,k,l,n,e[p],e[p+1],e[0],e[1])}; C3$jscomp$9.rayIntersect=function(a,b,c,d,e,g,k,l){c-=a;g=l-g;const n=c*g-(d-b)*(k-e);if(0===n)return 2;d=((b-d)*(k-a)+c*(l-b))/n;return 0<d&&1.000001>d?(g*(k-a)+(e-k)*(l-b))/n:2};C3$jscomp$9.rayIntersectExtended=function(a,b,c,d,e,g,k,l,n){const p=(k-e)*n;n*=l-g;return C3$jscomp$9.rayIntersect(a,b,c,d,e-p,g-n,k+p,l+n)}; C3$jscomp$9.isPointInTriangleInclusive=function(a,b,c,d,e,g,k,l){e-=c;g-=d;k-=c;l-=d;a-=c;c=b-d;b=e*e+g*g;d=e*k+g*l;e=e*a+g*c;g=k*k+l*l;k=k*a+l*c;l=1/(b*g-d*d);g=(g*e-d*k)*l;e=(b*k-d*e)*l;return 0<=g&&0<=e&&1>=g+e};C3$jscomp$9.triangleCartesianToBarycentric=function(a,b,c,d,e,g,k,l){e-=c;g-=d;k-=c;l-=d;a-=c;const n=b-d;b=e*e+g*g;d=e*k+g*l;c=k*k+l*l;e=a*e+n*g;g=a*k+n*l;k=b*c-d*d;l=(c*e-d*g)/k;e=(b*g-d*e)/k;return[1-l-e,l,e]}; C3$jscomp$9.triangleBarycentricToCartesian3d=function(a,b,c,d,e,g,k,l,n,p,r,w){return[a*d+b*k+c*p,a*e+b*l+c*r,a*g+b*n+c*w]};"use strict";const C3$jscomp$10=self.C3;let mainDocument=null,baseHref="";if("undefined"!==typeof document){mainDocument=document;const a=document.querySelector("base");if(baseHref=a&&a.hasAttribute("href")?a.getAttribute("href"):"")baseHref.startsWith("/")&&(baseHref=baseHref.substr(1)),baseHref.endsWith("/")||(baseHref+="/")}C3$jscomp$10.GetBaseHref=function(){return baseHref}; C3$jscomp$10.GetBaseURL=function(){if(!mainDocument)return"";const a=mainDocument.location;return C3$jscomp$10.GetPathFromURL(a.origin+a.pathname)+baseHref};C3$jscomp$10.GetPathFromURL=function(a){if(!a.length||a.endsWith("/")||a.endsWith("\\"))return a;const b=Math.max(a.lastIndexOf("/"),a.lastIndexOf("\\"));return-1===b?"":a.substr(0,b+1)}; C3$jscomp$10.GetFilenameFromURL=function(a){if(!a.length)return a;if(a.endsWith("/")||a.endsWith("\\"))return"";const b=Math.max(a.lastIndexOf("/"),a.lastIndexOf("\\"));return-1===b?a:a.substr(b+1)};C3$jscomp$10.GetFileExtension=function(a){let b=a.lastIndexOf(".");return 1>b?"":a.substr(b)};C3$jscomp$10.SetFileExtension=function(a,b){const c=a.lastIndexOf(".");return-1===c?a+"."+b:a.substr(0,c+1)+b};C3$jscomp$10.GetFileNamePart=function(a){let b=a.lastIndexOf(".");return 1>b?a:a.substr(0,b)}; C3$jscomp$10.NormalizeFileSeparator=function(a){return a.replace(/\\/g,"/")};C3$jscomp$10.IsFileExtension=function(a,b){a=a?C3$jscomp$10.GetFileExtension(a).slice(1):"";return b===a}; C3$jscomp$10.FileNameEquals=function(a,b){let c,d;C3$jscomp$10.IsFileLike(a)&&(c=C3$jscomp$10.GetFileNamePart(a.name));C3$jscomp$10.IsString(a)&&(c=C3$jscomp$10.GetFileNamePart(a));C3$jscomp$10.IsFileLike(b)&&(d=C3$jscomp$10.GetFileNamePart(b.name));C3$jscomp$10.IsString(b)&&(d=C3$jscomp$10.GetFileNamePart(b));return c===d}; C3$jscomp$10.ParseFilePath=function(a){a=C3$jscomp$10.NormalizeFileSeparator(a);let b=/^\w:\//.exec(a);b?(b=b[0],a=a.slice(3),"/"!==a[0]&&(a="/"+a)):b="";a=a.replace(/\/{2,}/g,"/");1<a.length&&"/"===a.slice(-1)&&(a=a.slice(0,-1));var c=a.lastIndexOf("/")+1;let d="",e=a,g="";0<c&&(d=a.slice(0,c),e=a.slice(c));a=e;c=e.lastIndexOf(".");0<c&&(g=e.slice(c),a=e.slice(0,-g.length));return{dir:d,base:e,name:a,root:b,ext:g,full:b+d+e}}; C3$jscomp$10.Wait=function(a,b){return new Promise((c,d)=>{self.setTimeout(c,a,b)})};C3$jscomp$10.swallowException=function(a){try{a()}catch(b){C3$jscomp$10.isDebug&&console.warn("Swallowed exception: ",b)}};C3$jscomp$10.noop=function(){};C3$jscomp$10.equalsNoCase=function(a,b){return"string"!==typeof a||"string"!==typeof b?!1:a===b||a.normalize().toLowerCase()===b.normalize().toLowerCase()}; C3$jscomp$10.equalsCase=function(a,b){return"string"!==typeof a||"string"!==typeof b?!1:a===b?!0:a.normalize()===b.normalize()};C3$jscomp$10.typedArraySet16=function(a,b,c){a[c++]=b[0];a[c++]=b[1];a[c++]=b[2];a[c++]=b[3];a[c++]=b[4];a[c++]=b[5];a[c++]=b[6];a[c++]=b[7];a[c++]=b[8];a[c++]=b[9];a[c++]=b[10];a[c++]=b[11];a[c++]=b[12];a[c++]=b[13];a[c++]=b[14];a[c]=b[15]};C3$jscomp$10.truncateArray=function(a,b){a.length=b}; C3$jscomp$10.clearArray=function(a){a&&0!==a.length&&C3$jscomp$10.truncateArray(a,0)};C3$jscomp$10.clear2DArray=function(a){if(a){for(let b=0;b<a.length;b++)C3$jscomp$10.truncateArray(a[b],0);C3$jscomp$10.truncateArray(a,0)}};C3$jscomp$10.extendArray=function(a,b,c){b|=0;var d=a.length;if(!(b<=d))for(;d<b;++d)a.push(c)};C3$jscomp$10.resizeArray=function(a,b,c){b|=0;const d=a.length;b<d?C3$jscomp$10.truncateArray(a,b):b>d&&C3$jscomp$10.extendArray(a,b,c)}; C3$jscomp$10.shallowAssignArray=function(a,b){C3$jscomp$10.clearArray(a);C3$jscomp$10.appendArray(a,b)};C3$jscomp$10.appendArray=function(a,b){if(1E4>b.length)a.push(...b);else for(let c=0,d=b.length;c<d;++c)a.push(b[c])};C3$jscomp$10.arrayRemove=function(a,b){b=Math.floor(b);if(!(0>b||b>=a.length)){for(var c=a.length-1;b<c;++b)a[b]=a[b+1];C3$jscomp$10.truncateArray(a,c)}};C3$jscomp$10.arrayFindRemove=function(a,b){b=a.indexOf(b);0<=b&&a.splice(b,1)}; C3$jscomp$10.arraysEqual=function(a,b){let c=a.length;if(b.length!==c)return!1;for(let d=0;d<c;++d)if(a[d]!==b[d])return!1;return!0};C3$jscomp$10.arrayFilterOut=function(a,b){let c=[],d=0;for(let e=0,g=a.length;e<g;++e){let k=a[e];b(k)?c.push(k):(a[d]=k,++d)}C3$jscomp$10.truncateArray(a,d);return c};C3$jscomp$10.arrayRemoveAllInSet=function(a,b){const c=a.length;let d=0;for(let e=0,g=a.length;e<g;++e){let k=a[e];b.has(k)||(a[d++]=k)}C3$jscomp$10.truncateArray(a,d);return c-d}; C3$jscomp$10.isArrayIndexInBounds=function(a,b){return a!==Math.floor(a)?!1:0<=a&&a<b.length};C3$jscomp$10.validateArrayIndex=function(a,b){if(!C3$jscomp$10.isArrayIndexInBounds(a,b))throw new RangeError("array index out of bounds");};C3$jscomp$10.cloneArray=function(a){return a.slice()}; C3$jscomp$10.deepCloneArray=function(a,b){let c=[];for(let d of a)if(C3$jscomp$10.IsObject(d)){a=b(d);if(!a)throw Error("missing clone");if(a.constructor!==d.constructor)throw Error("object is not a clone");c.push(a)}else C3$jscomp$10.IsArray(d)?c.push(C3$jscomp$10.deepCloneArray(d,b)):c.push(d);return c};C3$jscomp$10.clone2DArray=function(a){let b=[];for(let c of a)b.push(c.slice());return b};C3$jscomp$10.mergeSets=function(a,b){return new Set([...a,...b])}; C3$jscomp$10.mergeSetsInPlace=function(a,b){for(const c of b)a.add(c);return a};C3$jscomp$10.first=function(a){for(let b of a)return b;return null};C3$jscomp$10.xor=function(a,b){return!a!==!b};C3$jscomp$10.compare=function(a,b,c){switch(b){case 0:return a===c;case 1:return a!==c;case 2:return a<c;case 3:return a<=c;case 4:return a>c;case 5:return a>=c;default:return!1}};C3$jscomp$10.hasAnyOwnProperty=function(a){for(let b in a)if(a.hasOwnProperty(b))return!0;return!1}; C3$jscomp$10.PromiseAllWithProgress=function(a,b){return a.length?new Promise((c,d)=>{const e=[];let g=0,k=!1;for(let l=0,n=a.length;l<n;++l)e.push(void 0),a[l].then(p=>{k||(e[l]=p,++g,g===a.length?c(e):b(g,a.length))}).catch(p=>{k=!0;d(p)})}):Promise.resolve([])};let memoryCallbacks=[];C3$jscomp$10.AddLibraryMemoryCallback=function(a){memoryCallbacks.push(a)};C3$jscomp$10.GetEstimatedLibraryMemoryUsage=function(){let a=0;for(let b of memoryCallbacks){let c=b();a+=c}return Math.floor(a)}; let nextTaskId=1;const activeTaskIds=new Map,taskMessageChannel=new MessageChannel;taskMessageChannel.port2.onmessage=function(a){a=a.data;const b=activeTaskIds.get(a);activeTaskIds.delete(a);b&&b(performance.now())};C3$jscomp$10.RequestUnlimitedAnimationFrame=function(a){const b=nextTaskId++;activeTaskIds.set(b,a);taskMessageChannel.port1.postMessage(b);return b};C3$jscomp$10.CancelUnlimitedAnimationFrame=function(a){activeTaskIds.delete(a)};C3$jscomp$10.PostTask=C3$jscomp$10.RequestUnlimitedAnimationFrame; C3$jscomp$10.WaitForNextTask=function(){return new Promise(a=>C3$jscomp$10.PostTask(a))};const activeRPAFids=new Set;C3$jscomp$10.RequestPostAnimationFrame=function(a){const b=self.requestAnimationFrame(async c=>{await C3$jscomp$10.WaitForNextTask();activeRPAFids.has(b)&&(activeRPAFids.delete(b),a(c))});activeRPAFids.add(b);return b};C3$jscomp$10.CancelPostAnimationFrame=function(a){activeRPAFids.has(a)&&(self.cancelAnimationFrame(a),activeRPAFids.delete(a))};"use strict";const C3$jscomp$11=self.C3; C3$jscomp$11.IsAbsoluteURL=function(a){return/^(?:[a-z\-]+:)?\/\//.test(a)||"data:"===a.substr(0,5)||"blob:"===a.substr(0,5)};C3$jscomp$11.IsRelativeURL=function(a){return!C3$jscomp$11.IsAbsoluteURL(a)};C3$jscomp$11.ThrowIfNotOk=function(a){if(!a.ok)throw Error(`fetch '${a.url}' response returned ${a.status} ${a.statusText}`);};C3$jscomp$11.FetchOk=function(a,b){return fetch(a,b).then(c=>{C3$jscomp$11.ThrowIfNotOk(c);return c})}; C3$jscomp$11.FetchText=function(a){return C3$jscomp$11.FetchOk(a).then(b=>b.text())};C3$jscomp$11.FetchJson=function(a){return C3$jscomp$11.FetchOk(a).then(b=>b.json())};C3$jscomp$11.FetchBlob=function(a){return C3$jscomp$11.FetchOk(a).then(b=>b.blob())};C3$jscomp$11.FetchArrayBuffer=function(a){return C3$jscomp$11.FetchOk(a).then(b=>b.arrayBuffer())};C3$jscomp$11.FetchImage=function(a){return new Promise((b,c)=>{const d=new Image;d.onload=()=>b(d);d.onerror=e=>c(e);d.src=a})}; C3$jscomp$11.BlobToArrayBuffer=function(a){return"function"===typeof a.arrayBuffer?a.arrayBuffer():new Promise((b,c)=>{const d=new FileReader;d.onload=()=>b(d.result);d.onerror=()=>c(d.error);d.readAsArrayBuffer(a)})};C3$jscomp$11.BlobToString=function(a){return"function"===typeof a.text?a.text():new Promise((b,c)=>{const d=new FileReader;d.onload=()=>b(d.result);d.onerror=()=>c(d.error);d.readAsText(a)})};C3$jscomp$11.BlobToJson=function(a){return C3$jscomp$11.BlobToString(a).then(b=>JSON.parse(b))}; C3$jscomp$11.BlobToImage=async function(a,b){a=URL.createObjectURL(a);try{const c=await C3$jscomp$11.FetchImage(a);URL.revokeObjectURL(a);a="";b&&"function"===typeof c.decode&&await c.decode();return c}finally{a&&URL.revokeObjectURL(a)}};C3$jscomp$11.CreateCanvas=function(a,b){if("undefined"!==typeof document&&"function"===typeof document.createElement){const c=document.createElement("canvas");c.width=a;c.height=b;return c}return new OffscreenCanvas(a,b)}; C3$jscomp$11.CanvasToBlob=function(a,b,c){"number"!==typeof c&&(c=1);b=b||"image/png";c=C3$jscomp$11.clamp(c,0,1);if(a.toBlob)return new Promise(d=>a.toBlob(d,b,c));if(a.convertToBlob)return a.convertToBlob({type:b,quality:c});throw Error("could not convert canvas to blob");};C3$jscomp$11.DrawableToBlob=function(a,b,c){const d=C3$jscomp$11.CreateCanvas(a.width,a.height);d.getContext("2d").drawImage(a,0,0);return C3$jscomp$11.CanvasToBlob(d,b,c)}; C3$jscomp$11.ImageDataToBlob=function(a,b,c){if(C3$jscomp$11.Supports.ImageBitmapOptions)return createImageBitmap(a,{premultiplyAlpha:"none"}).then(e=>C3$jscomp$11.DrawableToBlob(e,b,c));if(C3$jscomp$11.Supports.ImageBitmap)return createImageBitmap(a).then(e=>C3$jscomp$11.DrawableToBlob(e,b,c));const d=C3$jscomp$11.CreateCanvas(a.width,a.height);d.getContext("2d").putImageData(a,0,0);return C3$jscomp$11.CanvasToBlob(d,b,c)};C3$jscomp$11.CopySet=function(a,b){a.clear();for(const c of b)a.add(c)}; C3$jscomp$11.MapToObject=function(a){const b=Object.create(null);for(const [c,d]of a.entries())b[c]=d;return b};C3$jscomp$11.ObjectToMap=function(a,b){b.clear();for(const [c,d]of Object.entries(a))b.set(c,d)}; C3$jscomp$11.ToSuperJSON=function ToSuperJSON(a){if("object"===typeof a&&null!==a){if(a instanceof Set)return{_c3type_:"set",data:[...a].map(d=>ToSuperJSON(d))};if(a instanceof Map)return{_c3type_:"map",data:[...a].map(d=>[d[0],ToSuperJSON(d[1])])};const c=Object.create(null);for(const [d,e]of Object.entries(a))c[d]=ToSuperJSON(e);return c}return a}; C3$jscomp$11.FromSuperJSON=function FromSuperJSON(a){if("object"===typeof a&null!==a){if("set"===a._c3type_)return new Set(a.data.map(d=>FromSuperJSON(d)));if("map"===a._c3type_)return new Map(a.data.map(d=>[d[0],FromSuperJSON(d[1])]));const c=Object.create(null);for(const [d,e]of Object.entries(a))c[d]=FromSuperJSON(e);return c}return a};C3$jscomp$11.CSSToCamelCase=function(a){if(a.startsWith("--"))return a;let b="",c=!1;for(const d of a)"-"===d?c=!0:c?(b+=d.toUpperCase(),c=!1):b+=d;return b}; C3$jscomp$11.IsIterator=function(a){return"object"===typeof a&&"function"===typeof a.next};C3$jscomp$11.MakeFilledArray=function(a,b){const c=[];if("function"===typeof b)for(var d=0;d<a;++d)c.push(b());else for(d=0;d<a;++d)c.push(b);return c};"use strict";const C3$jscomp$12=self.C3,HSL_TEST=/([0-9.]+),([0-9.]+)%?,([0-9.]+)%?/i,HSLA_TEST=/([0-9.]+),([0-9.]+)%?,([0-9.]+)%?,([0-9.])/i;function padTwoDigits(a){return 0===a.length?"00":1===a.length?"0"+a:a} function hueToRGB(a,b,c){0>c&&(c+=1);1<c&&--c;return c<1/6?a+6*(b-a)*c:.5>c?b:c<2/3?a+(b-a)*(2/3-c)*6:a} C3$jscomp$12.Color=class{constructor(a,b,c,d){this._a=this._b=this._g=this._r=0;a instanceof C3$jscomp$12.Color?this.set(a):this.setRgba(a||0,b||0,c||0,d||0)}setRgb(a,b,c){this._r=+a;this._g=+b;this._b=+c;this.clamp();return this}setRgba(a,b,c,d){this._r=+a;this._g=+b;this._b=+c;this._a=+d;this.clamp();return this}set(a){this._r=a._r;this._g=a._g;this._b=a._b;this._a=a._a;return this}copy(a){return this.set(a)}add(a){this._r+=a._r;this._g+=a._g;this._b+=a._b;this._a+=a._a;this.clamp()}addRgb(a,b, c,d=0){this._r+=+a;this._g+=+b;this._b+=+c;this._a+=+d;this.clamp()}diff(a){this.setR(Math.max(this._r,a._r)-Math.min(this._r,a._r));this.setG(Math.max(this._g,a._g)-Math.min(this._g,a._g));this.setB(Math.max(this._b,a._b)-Math.min(this._b,a._b));this.setA(Math.max(this._a,a._a)-Math.min(this._a,a._a));this.clamp()}copyRgb(a){this._r=a._r;this._g=a._g;this._b=a._b}setR(a){this._r=C3$jscomp$12.clamp(+a,0,1)}getR(){return this._r}setG(a){this._g=C3$jscomp$12.clamp(+a,0,1)}getG(){return this._g}setB(a){this._b= C3$jscomp$12.clamp(+a,0,1)}getB(){return this._b}setA(a){this._a=C3$jscomp$12.clamp(+a,0,1)}getA(){return this._a}clone(){return C3$jscomp$12.New(C3$jscomp$12.Color,this._r,this._g,this._b,this._a)}toArray(){return[this._r,this._g,this._b,this._a]}toTypedArray(){return new Float64Array(this.toArray())}writeToTypedArray(a,b){a[b++]=this._r;a[b++]=this._g;a[b++]=this._b;a[b]=this._a}writeRGBToTypedArray(a,b){a[b++]=this._r;a[b++]=this._g;a[b]=this._b}equals(a){return this._r===a._r&&this._g===a._g&& this._b===a._b&&this._a===a._a}equalsIgnoringAlpha(a){return this._r===a._r&&this._g===a._g&&this._b===a._b}equalsRgb(a,b,c){return this._r===a&&this._g===b&&this._b===c}equalsRgba(a,b,c,d){return this._r===a&&this._g===b&&this._b===c&&this._a===d}equalsF32Array(a,b){return a[b]===Math.fround(this._r)&&a[b+1]===Math.fround(this._g)&&a[b+2]===Math.fround(this._b)&&a[b+3]===Math.fround(this._a)}equalsRGBF32Array(a,b){return a[b]===Math.fround(this._r)&&a[b+1]===Math.fround(this._g)&&a[b+2]===Math.fround(this._b)}multiply(a){this._r*= a._r;this._g*=a._g;this._b*=a._b;this._a*=a._a}multiplyAlpha(a){this._r*=a;this._g*=a;this._b*=a;this._a*=a}premultiply(){this._r*=this._a;this._g*=this._a;this._b*=this._a;return this}unpremultiply(){this._r/=this._a;this._g/=this._a;this._b/=this._a;return this}clamp(){this._r=C3$jscomp$12.clamp(this._r,0,1);this._g=C3$jscomp$12.clamp(this._g,0,1);this._b=C3$jscomp$12.clamp(this._b,0,1);this._a=C3$jscomp$12.clamp(this._a,0,1);return this}setFromRgbValue(a){this._r=C3$jscomp$12.GetRValue(a);this._g= C3$jscomp$12.GetGValue(a);this._b=C3$jscomp$12.GetBValue(a);this._a=C3$jscomp$12.GetAValue(a)}getCssRgb(a,b,c){a=C3$jscomp$12.IsFiniteNumber(a)?a:this.getR();b=C3$jscomp$12.IsFiniteNumber(b)?b:this.getG();c=C3$jscomp$12.IsFiniteNumber(c)?c:this.getB();return`rgb(${100*a}%, ${100*b}%, ${100*c}%)`}getCssRgba(a,b,c,d){a=C3$jscomp$12.IsFiniteNumber(a)?a:this.getR();b=C3$jscomp$12.IsFiniteNumber(b)?b:this.getG();c=C3$jscomp$12.IsFiniteNumber(c)?c:this.getB();d=C3$jscomp$12.IsFiniteNumber(d)?d:this.getA(); return`rgba(${100*a}%, ${100*b}%, ${100*c}%, ${d})`}toHexString(){const a=Math.round(255*this.getR()),b=Math.round(255*this.getG()),c=Math.round(255*this.getB());return"#"+padTwoDigits(a.toString(16))+padTwoDigits(b.toString(16))+padTwoDigits(c.toString(16))}parseHexString(a){if("string"!==typeof a)return!1;a=a.trim();"#"===a.charAt(0)&&(a=a.substr(1));let b,c;if(3===a.length)b=parseInt(a[0],16)/15,c=parseInt(a[1],16)/15,a=parseInt(a[2],16)/15;else if(6===a.length)b=parseInt(a.substr(0,2),16)/255, c=parseInt(a.substr(2,2),16)/255,a=parseInt(a.substr(4,2),16)/255;else return!1;isFinite(b)&&this.setR(b);isFinite(c)&&this.setG(c);isFinite(a)&&this.setB(a);this.setA(1);return!0}toCommaSeparatedRgb(){const a=Math.round(255*this.getR()),b=Math.round(255*this.getG()),c=Math.round(255*this.getB());return`${a}, ${b}, ${c}`}toRgbArray(){const a=Math.round(255*this.getR()),b=Math.round(255*this.getG()),c=Math.round(255*this.getB());return[a,b,c]}parseCommaSeparatedRgb(a){if("string"!==typeof a)return!1; a=a.replace(/^rgb\(|\)|%/,"");var b=a.split(",");if(3>b.length)return!1;a=parseInt(b[0].trim(),10)/255;const c=parseInt(b[1].trim(),10)/255;b=parseInt(b[2].trim(),10)/255;isFinite(a)&&this.setR(a);isFinite(c)&&this.setG(c);isFinite(b)&&this.setB(b);this.setA(1);return!0}parseCommaSeparatedPercentageRgb(a){if("string"!==typeof a)return!1;a=a.replace(/^rgb\(|\)|%/,"");var b=a.split(",");if(3>b.length)return!1;a=parseInt(b[0].trim(),10)/100;const c=parseInt(b[1].trim(),10)/100;b=parseInt(b[2].trim(), 10)/100;isFinite(a)&&this.setR(a);isFinite(c)&&this.setG(c);isFinite(b)&&this.setB(b);this.setA(1);return!0}parseCommaSeparatedRgba(a){if("string"!==typeof a)return!1;a=a.replace(/^rgba\(|\)|%/,"");var b=a.split(",");if(4>b.length)return!1;a=parseInt(b[0].trim(),10)/255;const c=parseInt(b[1].trim(),10)/255,d=parseInt(b[2].trim(),10)/255;b=parseFloat(b[3].trim());isFinite(a)&&this.setR(a);isFinite(c)&&this.setG(c);isFinite(d)&&this.setB(d);isFinite(b)&&this.setA(b);return!0}parseCommaSeparatedPercentageRgba(a){if("string"!== typeof a)return!1;a=a.replace(/^rgba\(|\)|%/,"");var b=a.split(",");if(4>b.length)return!1;a=parseInt(b[0].trim(),10)/100;const c=parseInt(b[1].trim(),10)/100,d=parseInt(b[2].trim(),10)/100;b=parseFloat(b[3].trim());isFinite(a)&&this.setR(a);isFinite(c)&&this.setG(c);isFinite(d)&&this.setB(d);isFinite(b)&&this.setA(b);return!0}parseString(a){if("string"!==typeof a)return!1;a=a.replace(/\s+/,"");if(a.includes(",")){if(a.startsWith("rgb("))return a.includes("%")?this.parseCommaSeparatedPercentageRgb(a): this.parseCommaSeparatedRgb(a);if(a.startsWith("rgba("))return a.includes("%")?this.parseCommaSeparatedPercentageRgba(a):this.parseCommaSeparatedRgba(a);if(a.startsWith("hsl(")||a.startsWith("hsla("))return this.parseHSLString(a);const b=a.split(",");if(a.includes("%")){if(3===b.length)return this.parseCommaSeparatedPercentageRgb(a);if(4===b.length)return this.parseCommaSeparatedPercentageRgba(a)}else{if(3===b.length)return this.parseCommaSeparatedRgb(a);if(4===b.length)return this.parseCommaSeparatedRgba(a)}return!1}return this.parseHexString(a)}toJSON(){return[this._r, this._g,this._b,this._a]}setFromHSLA(a,b,c,d){a%=360;b=C3$jscomp$12.clamp(b,0,100);c=C3$jscomp$12.clamp(c,0,100);d=C3$jscomp$12.clamp(d,0,1);a/=360;b/=100;c/=100;if(0===b)c=b=a=c;else{const e=.5>c?c*(1+b):c+b-c*b,g=2*c-e;c=hueToRGB(g,e,a+1/3);b=hueToRGB(g,e,a);a=hueToRGB(g,e,a-1/3)}this.setR(c);this.setG(b);this.setB(a);this.setA(d);return this}parseHSLString(a){var b=a.replace(/ |hsl|hsla|\(|\)|;/gi,"");a=HSL_TEST.exec(b);b=HSLA_TEST.exec(b);return a&&4===a.length?(this.setFromHSLA(+a[1],+a[2],+a[3], 1),!0):b&&5===b.length?(this.setFromHSLA(+a[1],+a[2],+a[3],+a[4]),!0):!1}toHSLAString(){var a=this._r;const b=this._g,c=this._b,d=this._a,e=C3$jscomp$12.Color.GetHue(a,b,c),g=C3$jscomp$12.Color.GetSaturation(a,b,c);a=C3$jscomp$12.Color.GetLuminosity(a,b,c);return`hsla(${e}, ${g}%, ${a}%, ${d})`}toHSLAArray(){const a=this._r,b=this._g,c=this._b;return[C3$jscomp$12.Color.GetHue(a,b,c),C3$jscomp$12.Color.GetSaturation(a,b,c),C3$jscomp$12.Color.GetLuminosity(a,b,c),this._a]}setFromJSON(a){!Array.isArray(a)|| 3>a.length||(this._r=a[0],this._g=a[1],this._b=a[2],this._a=4<=a.length?a[3]:1)}set r(a){this.setR(a)}get r(){return this.getR()}set g(a){this.setG(a)}get g(){return this.getG()}set b(a){this.setB(a)}get b(){return this.getB()}set a(a){this.setA(a)}get a(){return this.getA()}setAtIndex(a,b){switch(a){case 0:this.setR(b);break;case 1:this.setG(b);break;case 2:this.setB(b);break;case 3:this.setA(b);break;default:throw new RangeError("invalid color index");}}getAtIndex(a){switch(a){case 0:return this.getR(); case 1:return this.getG();case 2:return this.getB();case 3:return this.getA();default:throw new RangeError("invalid color index");}}static Equals(a,b){let c;if(Array.isArray(a))c=new C3$jscomp$12.Color,c.setFromJSON(a);else if(a instanceof C3$jscomp$12.Color)c=a;else throw Error("unexpected type");if(Array.isArray(b))a=new C3$jscomp$12.Color,a.setFromJSON(b);else if(b instanceof C3$jscomp$12.Color)a=b;else throw Error("unexpected type");return c.equals(a)}static DiffChannel(a,b){return C3$jscomp$12.clamp(Math.max(a, b)-Math.min(a,b),0,1)}static Diff(a,b){const c=new C3$jscomp$12.Color;c.setR(Math.max(a._r,b._r)-Math.min(a._r,b._r));c.setG(Math.max(a._g,b._g)-Math.min(a._g,b._g));c.setB(Math.max(a._b,b._b)-Math.min(a._b,b._b));c.setA(Math.max(a._a,b._a)-Math.min(a._a,b._a));return c}static DiffNoAlpha(a,b){const c=new C3$jscomp$12.Color(0,0,0,1);c.setR(Math.max(a._r,b._r)-Math.min(a._r,b._r));c.setG(Math.max(a._g,b._g)-Math.min(a._g,b._g));c.setB(Math.max(a._b,b._b)-Math.min(a._b,b._b));return c}static GetHue(a, b,c){const d=Math.max(a,b,c),e=Math.min(a,b,c);if(d===e)return 0;let g=0;switch(d){case a:g=(b-c)/(d-e)+(b<c?6:0);break;case b:g=(c-a)/(d-e)+2;break;case c:g=(a-b)/(d-e)+4}return Math.round(g/6*360)}static GetSaturation(a,b,c){const d=Math.max(a,b,c);a=Math.min(a,b,c);if(d===a)return 0;b=d-a;return Math.round(100*(.5<(d+a)/2?b/(2-d-a):b/(d+a)))}static GetLuminosity(a,b,c){const d=Math.max(a,b,c);return d?Math.round((d+Math.min(a,b,c))/2*100):0}}; C3$jscomp$12.Color.White=Object.freeze(C3$jscomp$12.New(C3$jscomp$12.Color,1,1,1,1));C3$jscomp$12.Color.Black=Object.freeze(C3$jscomp$12.New(C3$jscomp$12.Color,0,0,0,1));C3$jscomp$12.Color.TransparentBlack=Object.freeze(C3$jscomp$12.New(C3$jscomp$12.Color,0,0,0,0));"use strict";const C3$jscomp$13=self.C3; C3$jscomp$13.Vector2=class{constructor(a,b){this._y=this._x=0;a instanceof C3$jscomp$13.Vector2?this.copy(a):this.set(a||0,b||0)}set(a,b){this._x=+a;this._y=+b}copy(a){this._x=a._x;this._y=a._y}equals(a){return this._x===a._x&&this._y===a._y}equalsValues(a,b){return this._x===a&&this._y===b}equalsF32Array(a,b){return a[b]===Math.fround(this._x)&&a[b+1]===Math.fround(this._y)}setX(a){this._x=+a}getX(){return this._x}setY(a){this._y=+a}getY(){return this._y}toArray(){return[this._x,this._y]}toTypedArray(){return new Float64Array(this.toArray())}writeToTypedArray(a, b){a[b++]=this._x;a[b]=this._y}offset(a,b){this._x+=+a;this._y+=+b}scale(a,b){this._x*=a;this._y*=b}divide(a,b){this._x/=a;this._y/=b}round(){this._x=Math.round(this._x);this._y=Math.round(this._y)}floor(){this._x=Math.floor(this._x);this._y=Math.floor(this._y)}ceil(){this._x=Math.ceil(this._x);this._y=Math.ceil(this._y)}angle(){return C3$jscomp$13.angleTo(0,0,this._x,this._y)}lengthSquared(){return this._x*this._x+this._y*this._y}length(){return Math.hypot(this._x,this._y)}rotatePrecalc(a,b){const c= this._x*b-this._y*a;this._y=this._y*b+this._x*a;this._x=c}rotate(a){0!==a&&this.rotatePrecalc(Math.sin(a),Math.cos(a))}rotateAbout(a,b,c){0===a||b===this._x&&c===this._y||(this._x-=b,this._y-=c,this.rotatePrecalc(Math.sin(a),Math.cos(a)),this._x+=+b,this._y+=+c)}move(a,b){0!==b&&(this._x+=Math.cos(a)*b,this._y+=Math.sin(a)*b)}normalize(){const a=this.length();0!==a&&1!==a&&(this._x/=a,this._y/=a)}clamp(a,b){this._x=C3$jscomp$13.clamp(this._x,a,b);this._y=C3$jscomp$13.clamp(this._y,a,b)}};"use strict"; const C3$jscomp$14=self.C3; C3$jscomp$14.Rect=class{constructor(a,b,c,d){this._bottom=this._right=this._top=this._left=0;a instanceof C3$jscomp$14.Rect?this.copy(a):this.set(a||0,b||0,c||0,d||0)}set(a,b,c,d){this._left=+a;this._top=+b;this._right=+c;this._bottom=+d}setWH(a,b,c,d){a=+a;b=+b;this._left=a;this._top=b;this._right=a+ +c;this._bottom=b+ +d}copy(a){this._left=+a._left;this._top=+a._top;this._right=+a._right;this._bottom=+a._bottom}clone(){return new C3$jscomp$14.Rect(this._left,this._top,this._right,this._bottom)}static Merge(a, b){const c=new C3$jscomp$14.Rect;c.setLeft(Math.min(a._left,b._left));c.setTop(Math.min(a._top,b._top));c.setRight(Math.max(a._right,b._right));c.setBottom(Math.max(a._bottom,b._bottom));return c}static FromObject(a){return new C3$jscomp$14.Rect(a.left,a.top,a.right,a.bottom)}equals(a){return this._left===a._left&&this._top===a._top&&this._right===a._right&&this._bottom===a._bottom}equalsWH(a,b,c,d){return this._left===a&&this._top===b&&this.width()===c&&this.height()===d}equalsF32Array(a,b){return a[b]=== Math.fround(this._left)&&a[b+1]===Math.fround(this._top)&&a[b+2]===Math.fround(this._right)&&a[b+3]===Math.fround(this._bottom)}setLeft(a){this._left=+a}getLeft(){return this._left}setTop(a){this._top=+a}getTop(){return this._top}setRight(a){this._right=+a}getRight(){return this._right}setBottom(a){this._bottom=+a}getBottom(){return this._bottom}toArray(){return[this._left,this._top,this._right,this._bottom]}toTypedArray(){return new Float64Array(this.toArray())}toDOMRect(){return new DOMRect(this._left, this._top,this.width(),this.height())}writeToTypedArray(a,b){a[b++]=this._left;a[b++]=this._top;a[b++]=this._right;a[b]=this._bottom}writeAsQuadToTypedArray(a,b){a[b++]=this._left;a[b++]=this._top;a[b++]=this._right;a[b++]=this._top;a[b++]=this._right;a[b++]=this._bottom;a[b++]=this._left;a[b]=this._bottom}writeAsQuadToTypedArray3D(a,b,c){a[b++]=this._left;a[b++]=this._top;a[b++]=c;a[b++]=this._right;a[b++]=this._top;a[b++]=c;a[b++]=this._right;a[b++]=this._bottom;a[b++]=c;a[b++]=this._left;a[b++]= this._bottom;a[b]=c}width(){return this._right-this._left}height(){return this._bottom-this._top}midX(){return(this._left+this._right)/2}midY(){return(this._top+this._bottom)/2}offset(a,b){a=+a;b=+b;this._left+=a;this._top+=b;this._right+=a;this._bottom+=b}offsetLeft(a){this._left+=+a}offsetTop(a){this._top+=+a}offsetRight(a){this._right+=+a}offsetBottom(a){this._bottom+=+a}toSquare(a){if("x"!==a)throw Error("invalid axis, only 'x' supported");this._bottom=this._top<this._bottom?this._left<this._right? this._top+this.width():this._top-this.width():this._left<this._right?this._top-this.width():this._top+this.width()}inflate(a,b){a=+a;b=+b;this._left-=a;this._top-=b;this._right+=a;this._bottom+=b}deflate(a,b){a=+a;b=+b;this._left+=a;this._top+=b;this._right-=a;this._bottom-=b}multiply(a,b){this._left*=a;this._top*=b;this._right*=a;this._bottom*=b}divide(a,b){this._left/=a;this._top/=b;this._right/=a;this._bottom/=b}mirrorAround(a){this._left=+a-this._left;this._right=+a-this._right}flipAround(a){this._top= +a-this._top;this._bottom=+a-this._bottom}rotate90DegreesAround(a,b){const c=this.width(),d=this.height(),e=this.getLeft()+c*a,g=this.getTop()+d*b;this.setWH(e-d*b,g-c*a,d,c)}swapLeftRight(){const a=this._left;this._left=this._right;this._right=a}swapTopBottom(){const a=this._top;this._top=this._bottom;this._bottom=a}shuntY(a){const b=this._top;this._top=+a-this._bottom;this._bottom=+a-b}round(){this._left=Math.round(this._left);this._top=Math.round(this._top);this._right=Math.round(this._right); this._bottom=Math.round(this._bottom)}roundInner(){this._left=Math.ceil(this._left);this._top=Math.ceil(this._top);this._right=Math.floor(this._right);this._bottom=Math.floor(this._bottom)}roundOuter(){this._left=Math.floor(this._left);this._top=Math.floor(this._top);this._right=Math.ceil(this._right);this._bottom=Math.ceil(this._bottom)}floor(){this._left=Math.floor(this._left);this._top=Math.floor(this._top);this._right=Math.floor(this._right);this._bottom=Math.floor(this._bottom)}ceil(){this._left= Math.ceil(this._left);this._top=Math.ceil(this._top);this._right=Math.ceil(this._right);this._bottom=Math.ceil(this._bottom)}clamp(a,b,c,d){this._left<a&&(this._left=+a);this._top<b&&(this._top=+b);this._right>c&&(this._right=+c);this._bottom>d&&(this._bottom=+d)}clampFlipped(a,b,c,d){this._left<a&&(this._left=+a);this._top>b&&(this._top=+b);this._right>c&&(this._right=+c);this._bottom<d&&(this._bottom=+d)}normalize(){this._left>this._right&&this.swapLeftRight();this._top>this._bottom&&this.swapTopBottom()}intersectsRect(a){return!(a._right< this._left||a._bottom<this._top||a._left>this._right||a._top>this._bottom)}intersectsRectOffset(a,b,c){return!(a._right+b<this._left||a._bottom+c<this._top||a._left+b>this._right||a._top+c>this._bottom)}containsPoint(a,b){return a>=this._left&&a<=this._right&&b>=this._top&&b<=this._bottom}containsRect(a){return a._left>=this._left&&a._top>=this._top&&a._right<=this._right&&a._bottom<=this._bottom}expandToContain(a){a._left<this._left&&(this._left=+a._left);a._top<this._top&&(this._top=+a._top);a._right> this._right&&(this._right=+a._right);a._bottom>this._bottom&&(this._bottom=+a._bottom)}lerpInto(a){this._left=C3$jscomp$14.lerp(a._left,a._right,this._left);this._top=C3$jscomp$14.lerp(a._top,a._bottom,this._top);this._right=C3$jscomp$14.lerp(a._left,a._right,this._right);this._bottom=C3$jscomp$14.lerp(a._top,a._bottom,this._bottom)}};"use strict";const C3$jscomp$15=self.C3; C3$jscomp$15.Quad=class{constructor(a,b,c,d,e,g,k,l){this._bly=this._blx=this._bry=this._brx=this._try=this._trx=this._tly=this._tlx=0;a instanceof C3$jscomp$15.Quad?this.copy(a):this.set(a||0,b||0,c||0,d||0,e||0,g||0,k||0,l||0)}set(a,b,c,d,e,g,k,l){this._tlx=+a;this._tly=+b;this._trx=+c;this._try=+d;this._brx=+e;this._bry=+g;this._blx=+k;this._bly=+l}setRect(a,b,c,d){this.set(a,b,c,b,c,d,a,d)}copy(a){this._tlx=a._tlx;this._tly=a._tly;this._trx=a._trx;this._try=a._try;this._brx=a._brx;this._bry=a._bry; this._blx=a._blx;this._bly=a._bly}equals(a){return this._tlx===a._tlx&&this._tly===a._tly&&this._trx===a._trx&&this._try===a._try&&this._brx===a._brx&&this._bry===a._bry&&this._blx===a._blx&&this._bly===a._bly}setTlx(a){this._tlx=+a}getTlx(){return this._tlx}setTly(a){this._tly=+a}getTly(){return this._tly}setTrx(a){this._trx=+a}getTrx(){return this._trx}setTry(a){this._try=+a}getTry(){return this._try}setBrx(a){this._brx=+a}getBrx(){return this._brx}setBry(a){this._bry=+a}getBry(){return this._bry}setBlx(a){this._blx= +a}getBlx(){return this._blx}setBly(a){this._bly=+a}getBly(){return this._bly}toDOMQuad(){return new DOMQuad(new DOMPoint(this._tlx,this._tly),new DOMPoint(this._trx,this._try),new DOMPoint(this._brx,this._bry),new DOMPoint(this._blx,this._bly))}toArray(){return[this._tlx,this._tly,this._trx,this._try,this._brx,this._bry,this._blx,this._bly]}toTypedArray(){return new Float64Array(this.toArray())}writeToTypedArray(a,b){a[b++]=this._tlx;a[b++]=this._tly;a[b++]=this._trx;a[b++]=this._try;a[b++]=this._brx; a[b++]=this._bry;a[b++]=this._blx;a[b]=this._bly}writeToTypedArray3D(a,b,c){a[b++]=this._tlx;a[b++]=this._tly;a[b++]=c;a[b++]=this._trx;a[b++]=this._try;a[b++]=c;a[b++]=this._brx;a[b++]=this._bry;a[b++]=c;a[b++]=this._blx;a[b++]=this._bly;a[b]=c}offset(a,b){a=+a;b=+b;this._tlx+=a;this._tly+=b;this._trx+=a;this._try+=b;this._brx+=a;this._bry+=b;this._blx+=a;this._bly+=b}round(){this._tlx=Math.round(this._tlx);this._tly=Math.round(this._tly);this._trx=Math.round(this._trx);this._try=Math.round(this._try); this._brx=Math.round(this._brx);this._bry=Math.round(this._bry);this._blx=Math.round(this._blx);this._bly=Math.round(this._bly)}floor(){this._tlx=Math.floor(this._tlx);this._tly=Math.floor(this._tly);this._trx=Math.floor(this._trx);this._try=Math.floor(this._try);this._brx=Math.floor(this._brx);this._bry=Math.floor(this._bry);this._blx=Math.floor(this._blx);this._bly=Math.floor(this._bly)}ceil(){this._tlx=Math.ceil(this._tlx);this._tly=Math.ceil(this._tly);this._trx=Math.ceil(this._trx);this._try= Math.ceil(this._try);this._brx=Math.ceil(this._brx);this._bry=Math.ceil(this._bry);this._blx=Math.ceil(this._blx);this._bly=Math.ceil(this._bly)}setFromRect(a){this._tlx=a._left;this._tly=a._top;this._trx=a._right;this._try=a._top;this._brx=a._right;this._bry=a._bottom;this._blx=a._left;this._bly=a._bottom}setFromRotatedRect(a,b){0===b?this.setFromRect(a):this.setFromRotatedRectPrecalc(a,Math.sin(b),Math.cos(b))}setFromRotatedRectPrecalc(a,b,c){const d=a._left*b,e=a._top*b,g=a._right*b;b*=a._bottom; const k=a._left*c,l=a._top*c,n=a._right*c;a=a._bottom*c;this._tlx=k-e;this._tly=l+d;this._trx=n-e;this._try=l+g;this._brx=n-b;this._bry=a+g;this._blx=k-b;this._bly=a+d}getBoundingBox(a){a.set(Math.min(this._tlx,this._trx,this._brx,this._blx),Math.min(this._tly,this._try,this._bry,this._bly),Math.max(this._tlx,this._trx,this._brx,this._blx),Math.max(this._tly,this._try,this._bry,this._bly))}containsPoint(a,b){var c=this._trx-this._tlx,d=this._try-this._tly;const e=this._brx-this._tlx,g=this._bry-this._tly; a-=this._tlx;b-=this._tly;var k=c*c+d*d;let l=c*e+d*g;d=c*a+d*b;const n=e*e+g*g,p=e*a+g*b;let r=1/(k*n-l*l);c=(n*d-l*p)*r;k=(k*p-l*d)*r;if(0<=c&&0<k&&1>c+k)return!0;c=this._blx-this._tlx;d=this._bly-this._tly;k=c*c+d*d;l=c*e+d*g;d=c*a+d*b;r=1/(k*n-l*l);c=(n*d-l*p)*r;k=(k*p-l*d)*r;return 0<=c&&0<k&&1>c+k}midX(){return(this._tlx+this._trx+this._brx+this._blx)/4}midY(){return(this._tly+this._try+this._bry+this._bly)/4}intersectsSegment(a,b,c,d){return this.containsPoint(a,b)||this.containsPoint(c,d)? !0:C3$jscomp$15.segmentIntersectsQuad(a,b,c,d,this)}intersectsQuad(a){var b=a.midX(),c=a.midY();if(this.containsPoint(b,c))return!0;b=this.midX();c=this.midY();if(a.containsPoint(b,c))return!0;b=this._tlx;c=this._tly;const d=this._trx,e=this._try,g=this._brx,k=this._bry,l=this._blx,n=this._bly;return C3$jscomp$15.segmentIntersectsQuad(b,c,d,e,a)||C3$jscomp$15.segmentIntersectsQuad(d,e,g,k,a)||C3$jscomp$15.segmentIntersectsQuad(g,k,l,n,a)||C3$jscomp$15.segmentIntersectsQuad(l,n,b,c,a)}rotatePointsAnticlockwise(){const a= this._tlx,b=this._tly;this._tlx=this._trx;this._tly=this._try;this._trx=this._brx;this._try=this._bry;this._brx=this._blx;this._bry=this._bly;this._blx=a;this._bly=b}mirror(){this._swap(0,2);this._swap(1,3);this._swap(6,4);this._swap(7,5)}flip(){this._swap(0,6);this._swap(1,7);this._swap(2,4);this._swap(3,5)}diag(){this._swap(2,6);this._swap(3,7)}_swap(a,b){const c=this._getAtIndex(a);this._setAtIndex(a,this._getAtIndex(b));this._setAtIndex(b,c)}_getAtIndex(a){switch(a){case 0:return this._tlx;case 1:return this._tly; case 2:return this._trx;case 3:return this._try;case 4:return this._brx;case 5:return this._bry;case 6:return this._blx;case 7:return this._bly;default:throw new RangeError("invalid quad point index");}}_setAtIndex(a,b){b=+b;switch(a){case 0:this._tlx=b;break;case 1:this._tly=b;break;case 2:this._trx=b;break;case 3:this._try=b;break;case 4:this._brx=b;break;case 5:this._bry=b;break;case 6:this._blx=b;break;case 7:this._bly=b;break;default:throw new RangeError("invalid quad point index");}}};"use strict"; const C3$jscomp$16=self.C3,DEFAULT_POLY_POINTS=[0,0,1,0,1,1,0,1],tempQuad=C3$jscomp$16.New(C3$jscomp$16.Quad); C3$jscomp$16.CollisionPoly=class extends C3$jscomp$16.DefendedBase{constructor(a,b=!0){super();a||(a=DEFAULT_POLY_POINTS);this._ptsArr=Float64Array.from(a);this._bbox=new C3$jscomp$16.Rect;this._isBboxChanged=!0;this._enabled=b}Release(){}pointsArr(){return this._ptsArr}pointCount(){return this._ptsArr.length/2}setPoints(a){this._ptsArr.length===a.length?this._ptsArr.set(a):this._ptsArr=Float64Array.from(a);this._isBboxChanged=!0}setDefaultPoints(){this.setPoints(DEFAULT_POLY_POINTS)}copy(a){this.setPoints(a._ptsArr)}setBboxChanged(){this._isBboxChanged= !0}_updateBbox(){if(this._isBboxChanged){var a=this._ptsArr,b=a[0],c=a[1],d=b,e=c;for(let g=0,k=a.length;g<k;g+=2){const l=a[g],n=a[g+1];l<b&&(b=l);l>d&&(d=l);n<c&&(c=n);n>e&&(e=n)}this._bbox.set(b,c,d,e);this._isBboxChanged=!1}}setFromRect(a,b,c){let d=this._ptsArr;8!==d.length&&(this._ptsArr=d=new Float64Array(8));d[0]=a.getLeft()-b;d[1]=a.getTop()-c;d[2]=a.getRight()-b;d[3]=a.getTop()-c;d[4]=a.getRight()-b;d[5]=a.getBottom()-c;d[6]=a.getLeft()-b;d[7]=a.getBottom()-c;this._bbox.copy(a);0===b&&0=== c||this._bbox.offset(-b,-c);this._isBboxChanged=!1}setFromQuad(a,b,c){tempQuad.copy(a);tempQuad.offset(b,c);this.setPoints(tempQuad.toArray());this._isBboxChanged=!0}transform(a,b,c){let d=0,e=1;0!==c&&(d=Math.sin(c),e=Math.cos(c));this.transformPrecalc(a,b,d,e)}transformPrecalc(a,b,c,d){const e=this._ptsArr;for(let g=0,k=e.length;g<k;g+=2){const l=g+1,n=e[g]*a,p=e[l]*b;e[g]=n*d-p*c;e[l]=p*d+n*c}this._isBboxChanged=!0}offset(a,b){const c=this._ptsArr;for(let d=0,e=c.length;d<e;d+=2)c[d]+=a,c[d+1]+= b}containsPoint(a,b){const c=this._ptsArr;if(a===c[0]&&b===c[1])return!0;this._updateBbox();var d=this._bbox;const e=d.getLeft()-110,g=d.getTop()-101,k=d.getRight()+131;d=d.getBottom()+120;let l,n,p,r,w,y,B,C;e<a?(l=e,p=a):(l=a,p=e);g<b?(n=g,r=b):(n=b,r=g);k<a?(w=k,B=a):(w=a,B=k);d<b?(y=d,C=b):(y=b,C=d);let E=0,F=0;for(let L=0,O=c.length;L<O;L+=2){var J=(L+2)%O;const V=c[L],W=c[L+1],ca=c[J];J=c[J+1];C3$jscomp$16.segmentsIntersectPreCalc(e,g,a,b,l,p,n,r,V,W,ca,J)&&++E;C3$jscomp$16.segmentsIntersectPreCalc(k, d,a,b,w,B,y,C,V,W,ca,J)&&++F}return 1===E%2||1===F%2}intersectsPoly(a,b,c){const d=a._ptsArr,e=this._ptsArr;if(this.containsPoint(d[0]+b,d[1]+c)||a.containsPoint(e[0]-b,e[1]-c))return!0;for(let k=0,l=e.length;k<l;k+=2){var g=(k+2)%l;a=e[k];const n=e[k+1],p=e[g];g=e[g+1];let r,w,y,B;a<p?(r=a,y=p):(r=p,y=a);n<g?(w=n,B=g):(w=g,B=n);for(let C=0,E=d.length;C<E;C+=2){const F=(C+2)%E;if(C3$jscomp$16.segmentsIntersectPreCalc(a,n,p,g,r,y,w,B,d[C]+b,d[C+1]+c,d[F]+b,d[F+1]+c))return!0}}return!1}intersectsSegment(a, b,c,d,e,g){if(this.containsPoint(c-a,d-b)||this.containsPoint(e-a,g-b))return!0;let k,l,n,p;c<e?(k=c,n=e):(k=e,n=c);d<g?(l=d,p=g):(l=g,p=d);const r=this._ptsArr;for(let w=0,y=r.length;w<y;w+=2){const B=(w+2)%y;if(C3$jscomp$16.segmentsIntersectPreCalc(c,d,e,g,k,n,l,p,r[w]+a,r[w+1]+b,r[B]+a,r[B+1]+b))return!0}return!1}mirror(a){const b=this._ptsArr;for(let c=0,d=b.length;c<d;c+=2)b[c]=2*a-b[c];this._isBboxChanged=!0}flip(a){const b=this._ptsArr;for(let c=0,d=b.length;c<d;c+=2){const e=c+1;b[e]=2*a- b[e]}this._isBboxChanged=!0}diag(){const a=this._ptsArr;for(let b=0,c=a.length;b<c;b+=2){const d=b+1,e=a[b];a[b]=a[d];a[d]=e}this._isBboxChanged=!0}GetMidX(){const a=this._ptsArr;let b=0;for(let c=0,d=a.length;c<d;c+=2)b+=a[c];return b/this.pointCount()}GetMidY(){const a=this._ptsArr;let b=0;for(let c=0,d=a.length;c<d;c+=2)b+=a[c+1];return b/this.pointCount()}GetPointsArray(){return this._ptsArr}GetPointCount(){return this.pointCount()}IsEnabled(){return this._enabled}};"use strict"; const C3$jscomp$17=self.C3; C3$jscomp$17.PairMap=class extends C3$jscomp$17.DefendedBase{constructor(a){super();this._firstMap=new Map;if(a)for(const [b,c,d]of a)this.Set(b,c,d)}Release(){this.Clear();this._firstMap=null}Clear(){const a=this._firstMap;for(const b of a.values())b.clear();a.clear()}Set(a,b,c){const d=this._firstMap;let e=d.get(a);e||(e=new Map,d.set(a,e));e.set(b,c)}Get(a,b){return(a=this._firstMap.get(a))?a.get(b):a}Has(a,b){return(a=this._firstMap.get(a))?a.has(b):!1}Delete(a,b){const c=this._firstMap,d=c.get(a); if(!d)return!1;(b=d.delete(b))&&0===d.size&&c.delete(a);return b}DeleteEither(a){const b=this._firstMap,c=b.get(a);c&&(c.clear(),b.delete(a));for(const [d,e]of b.entries())e.delete(a)&&0===e.size&&b.delete(d)}GetSize(){let a=0;for(const b of this._firstMap.values())a+=b.size;return a}*values(){for(const a of this._firstMap.values())yield*a.values()}*keyPairs(){for(const [a,b]of this._firstMap.entries())for(const c of b.keys())yield[a,c]}*entries(){for(const [a,b]of this._firstMap.entries())for(const [c, d]of b.entries())yield[a,c,d]}};"use strict";const C3$jscomp$18=self.C3; C3$jscomp$18.ArraySet=class extends C3$jscomp$18.DefendedBase{constructor(){super();this._set=new Set;this._arr=[];this._needToRebuildArray=!1}Release(){this.Clear()}Clear(){this._set.clear();C3$jscomp$18.clearArray(this._arr);this._needToRebuildArray=!1}Add(a){this._set.has(a)||(this._set.add(a),this._needToRebuildArray||this._arr.push(a))}Has(a){return this._set.has(a)}Delete(a){this._set.delete(a)&&(this._needToRebuildArray=!0)}GetSize(){return this._set.size}IsEmpty(){return 0===this._set.size}GetArray(){this._needToRebuildArray&& (this._RebuildArray(),this._needToRebuildArray=!1);return this._arr}_RebuildArray(){const a=this._arr;C3$jscomp$18.clearArray(a);for(const b of this._set)a.push(b)}};"use strict";const C3$jscomp$19=self.C3,EASE_MAP=new Map,PREDEFINED_EASE_MAP=new Map,CUSTOM_EASE_EDITOR_MAP=new Map,CUSTOM_EASE_RUNTIME_MAP=new Map,PRIVATE_EASE_MAP=new Map,BUILT_IN_TRANSITION_MAP=new Map,ALIAS_MAP=new Map;ALIAS_MAP.set("linear","noease");ALIAS_MAP.set("default","noease"); const EASE_TRANSLATION_KEYS="default noease easeinquad easeoutquad easeinoutquad easeincubic easeoutcubic easeinoutcubic easeinquart easeoutquart easeinoutquart easeinquint easeoutquint easeinoutquint easeinsine easeoutsine easeinoutsine easeinexpo easeoutexpo easeinoutexpo easeincirc easeoutcirc easeinoutcirc easeinelastic easeoutelastic easeinoutelastic easeinback easeoutback easeinoutback easeinbounce easeoutbounce easeinoutbounce".split(" "),SHORT_EASE_TRANSLATION_KEYS="default noease quad cubic quart quint sine expo circ elastic back bounce".split(" "), EASE_API2INTERNAL_NAMES=new Map([["linear","noease"],["in-sine","easeinsine"],["out-sine","easeoutsine"],["in-out-sine","easeinoutsine"],["in-elastic","easeinelastic"],["out-elastic","easeoutelastic"],["in-out-elastic","easeinoutelastic"],["in-back","easeinback"],["out-back","easeoutback"],["in-out-back","easeinoutback"],["in-bounce","easeinbounce"],["out-bounce","easeoutbounce"],["in-out-bounce","easeinoutbounce"],["in-cubic","easeincubic"],["out-cubic","easeoutcubic"],["in-out-cubic","easeinoutcubic"], ["in-quadratic","easeinquad"],["out-quadratic","easeoutquad"],["in-out-quadratic","easeinoutquad"],["in-quartic","easeinquart"],["out-quartic","easeoutquart"],["in-out-quartic","easeinoutquart"],["in-quintic","easeinquint"],["out-quintic","easeoutquint"],["in-out-quintic","easeinoutquint"],["in-circular","easeincirc"],["out-circular","easeoutcirc"],["in-out-circular","easeinoutcirc"],["in-exponential","easeinexpo"],["out-exponential","easeoutexpo"],["in-out-exponential","easeinoutexpo"]]); self.Ease=class a{constructor(){}static InheritEase(){return"default"}static DefaultEase(){return"noease"}static ToInternal(b){return EASE_API2INTERNAL_NAMES.get(b)}static GetEditorEaseNames(b,...c){this._CreateEaseMap();b?(CUSTOM_EASE_EDITOR_MAP.has(b)||CUSTOM_EASE_EDITOR_MAP.set(b,new Map),b=CUSTOM_EASE_EDITOR_MAP.get(b)):b=CUSTOM_EASE_RUNTIME_MAP;b=[...b.keys()];b.sort();return[...PREDEFINED_EASE_MAP.keys()].concat(b).filter(d=>!c.includes(d))}static GetRuntimeEaseNames(){this._CreateEaseMap(); const b=[...CUSTOM_EASE_RUNTIME_MAP.keys()];b.sort();return[...PREDEFINED_EASE_MAP.keys()].concat(b)}static GetCustomRuntimeEaseNames(){this._CreateEaseMap();const b=[...CUSTOM_EASE_RUNTIME_MAP.keys()];b.sort();return b}static IsPredefinedTranslatedName(b){for(const c of EASE_TRANSLATION_KEYS)if(self.lang(`ui.bars.timeline.eases.${c}`)===b)return!0;for(const c of SHORT_EASE_TRANSLATION_KEYS)if(self.lang(`ui.bars.timeline.short-eases.${c}`)===b)return!0}static IsNamePredefined(b){this._CreateEaseMap(); return[...PREDEFINED_EASE_MAP.keys()].includes(b)}static _GetEase(b){const c=ALIAS_MAP.get(b);if(c)return EASE_MAP.get(c);if(a.IsNamePredefined(b))return EASE_MAP.get(b);if(PRIVATE_EASE_MAP.has(b))return PRIVATE_EASE_MAP.get(b)}static GetBuiltInTransition(b){this._CreateEaseMap();return BUILT_IN_TRANSITION_MAP.get(b)}static GetEditorEase(b,c){this._CreateEaseMap();const d=a._GetEase(b);if(d)return d;if(!c)throw Error("missing ease function");return CUSTOM_EASE_EDITOR_MAP.get(c).get(b)}static HasEditorEase(b, c){this._CreateEaseMap();return a._GetEase(b)?!0:!!CUSTOM_EASE_EDITOR_MAP.get(c).get(b)}static GetRuntimeEase(b){this._CreateEaseMap();const c=a._GetEase(b);return c?c:CUSTOM_EASE_RUNTIME_MAP.get(b)}static GetEaseFromIndex(b){this._CreateEaseMap();return this.GetRuntimeEaseNames()[b]}static GetIndexForEase(b,c){this._CreateEaseMap();return this.GetEditorEaseNames(c).indexOf(b)}static GetIndexForEaseAtRuntime(b){return this.GetIndexForEase(b)}static _CreateEaseMap(){0===EASE_MAP.size&&(this._AddPredifinedEase("default", ()=>{}),this._AddPredifinedEase("noease",[{x:0,y:0,sax:.336,say:0,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.336,eay:0,se:!1,ee:!0}],!0),this._AddPredifinedEase("easeinsine",[{x:0,y:0,sax:.485,say:0,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.038,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeoutsine",[{x:0,y:0,sax:.038,say:0,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.485,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinoutsine",[{x:0,y:0,sax:.336,say:0,eax:0,eay:0, se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.336,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinelastic",[{x:0,y:0,sax:.018,say:0,eax:0,eay:0,se:!0,ee:!1},{x:.116,y:.002,sax:.025,say:0,eax:-.025,eay:0,se:!0,ee:!0},{x:.266,y:-.005,sax:.024,say:0,eax:-.021,eay:0,se:!0,ee:!0},{x:.416,y:.016,sax:.024,say:0,eax:-.026,eay:0,se:!0,ee:!0},{x:.566,y:-.045,sax:.061,say:0,eax:-.025,eay:0,se:!0,ee:!0},{x:.716,y:.132,sax:.072,say:-.004,eax:-.045,eay:0,se:!0,ee:!0},{x:.866,y:-.373,sax:.06,say:0,eax:-.049,eay:-.002, se:!0,ee:!0},{x:1,y:1,sax:0,say:0,eax:-.038,eay:-.263,se:!1,ee:!0}]),this._AddPredifinedEase("easeoutelastic",[{x:0,y:0,sax:.038,say:.263,eax:0,eay:0,se:!0,ee:!1},{x:.136,y:1.373,sax:.049,say:.002,eax:-.06,eay:0,se:!0,ee:!0},{x:.286,y:.868,sax:.045,say:0,eax:-.072,eay:.004,se:!0,ee:!0},{x:.436,y:1.045,sax:.025,say:0,eax:-.061,eay:0,se:!0,ee:!0},{x:.586,y:.984,sax:.026,say:0,eax:-.024,eay:0,se:!0,ee:!0},{x:.736,y:1.005,sax:.021,say:0,eax:-.024,eay:0,se:!0,ee:!0},{x:.886,y:.998,sax:.025,say:0,eax:-.025, eay:0,se:!0,ee:!0},{x:1,y:1,sax:0,say:0,eax:-.018,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinoutelastic",[{x:0,y:0,sax:.025,say:0,eax:0,eay:0,se:!0,ee:!1},{x:.067,y:.001,sax:.025,say:0,eax:-.025,eay:0,se:!0,ee:!0},{x:.18,y:-.005,sax:.025,say:0,eax:-.025,eay:0,se:!0,ee:!0},{x:.292,y:.025,sax:.053,say:0,eax:-.025,eay:0,se:!0,ee:!0},{x:.405,y:-.118,sax:.069,say:0,eax:-.027,eay:0,se:!0,ee:!0},{x:.597,y:1.118,sax:.027,say:0,eax:-.069,eay:0,se:!0,ee:!0},{x:.71,y:.975,sax:.025,say:0,eax:-.053,eay:0, se:!0,ee:!0},{x:.822,y:1.005,sax:.025,say:0,eax:-.025,eay:0,se:!0,ee:!0},{x:.935,y:.999,sax:.025,say:0,eax:-.025,eay:0,se:!0,ee:!0},{x:1,y:1,sax:0,say:0,eax:-.025,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinback",[{x:0,y:0,sax:.35,say:0,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.34,eay:-1.579,se:!1,ee:!0}]),this._AddPredifinedEase("easeoutback",[{x:0,y:0,sax:.34,say:1.579,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.35,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinoutback", [{x:0,y:0,sax:.035,say:0,eax:0,eay:0,se:!0,ee:!1},{x:.242,y:-.1,sax:.258,say:0,eax:-.025,eay:0,se:!0,ee:!0},{x:.76,y:1.1,sax:.025,say:0,eax:-.26,eay:0,se:!0,ee:!0},{x:1,y:1,sax:0,say:0,eax:-.035,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinbounce",[{x:0,y:0,sax:.033,say:.025,eax:0,eay:0,se:!0,ee:!1},{x:.092,y:0,sax:.026,say:.078,eax:-.033,eay:.025,se:!0,ee:!0},{x:.274,y:0,sax:.097,say:.319,eax:-.026,eay:.078,se:!0,ee:!0},{x:.637,y:0,sax:.105,say:.625,eax:-.097,eay:.319,se:!0,ee:!0},{x:1,y:1, sax:0,say:0,eax:-.125,eay:-.004,se:!1,ee:!0}]),this._AddPredifinedEase("easeoutbounce",[{x:0,y:0,sax:.125,say:.004,eax:0,eay:0,se:!0,ee:!1},{x:.365,y:1,sax:.097,say:-.319,eax:-.105,eay:-.625,se:!0,ee:!0},{x:.728,y:1,sax:.026,say:-.078,eax:-.097,eay:-.319,se:!0,ee:!0},{x:.91,y:1,sax:.033,say:-.025,eax:-.026,eay:-.078,se:!0,ee:!0},{x:1,y:1,sax:0,say:0,eax:-.033,eay:-.025,se:!1,ee:!0}]),this._AddPredifinedEase("easeinoutbounce",[{x:0,y:0,sax:.01,say:.006,eax:0,eay:0,se:!0,ee:!1},{x:.046,y:0,sax:.021, say:.038,eax:-.01,eay:.006,se:!0,ee:!0},{x:.137,y:0,sax:.059,say:.158,eax:-.021,eay:.038,se:!0,ee:!0},{x:.319,y:0,sax:.117,say:.744,eax:-.059,eay:.158,se:!0,ee:!0},{x:.683,y:1,sax:.059,say:-.158,eax:-.117,eay:-.744,se:!0,ee:!0},{x:.865,y:1,sax:.021,say:-.038,eax:-.059,eay:-.158,se:!0,ee:!0},{x:.956,y:1,sax:.01,say:-.006,eax:-.021,eay:-.038,se:!0,ee:!0},{x:1,y:1,sax:0,say:0,eax:-.01,eay:-.006,se:!1,ee:!0}]),this._AddPredifinedEase("easeincubic",[{x:0,y:0,sax:.75,say:0,eax:0,eay:0,se:!0,ee:!1},{x:1, y:1,sax:0,say:0,eax:-.138,eay:-.321,se:!1,ee:!0}]),this._AddPredifinedEase("easeoutcubic",[{x:0,y:0,sax:.138,say:.321,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.75,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinoutcubic",[{x:0,y:0,sax:.285,say:0,eax:0,eay:0,se:!0,ee:!1},{x:.5,y:.5,sax:.081,say:.272,eax:-.081,eay:-.272,se:!0,ee:!0},{x:1,y:1,sax:0,say:0,eax:-.285,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinquad",[{x:0,y:0,sax:.4,say:0,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0, eax:-.178,eay:-.392,se:!1,ee:!0}]),this._AddPredifinedEase("easeoutquad",[{x:0,y:0,sax:.178,say:.392,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.4,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinoutquad",[{x:0,y:0,sax:.25,say:0,eax:0,eay:0,se:!0,ee:!1},{x:.5,y:.5,sax:.03,say:.065,eax:-.03,eay:-.065,se:!0,ee:!0},{x:1,y:1,sax:0,say:0,eax:-.25,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinquart",[{x:0,y:0,sax:.264,say:.079,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.329,eay:-1.287, se:!1,ee:!0}]),this._AddPredifinedEase("easeoutquart",[{x:0,y:0,sax:.329,say:1.287,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.264,eay:-.079,se:!1,ee:!0}]),this._AddPredifinedEase("easeinoutquart",[{x:0,y:0,sax:.765,say:.03,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.765,eay:-.03,se:!1,ee:!0}]),this._AddPredifinedEase("easeinquint",[{x:0,y:0,sax:.6,say:0,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.2,eay:-1,se:!1,ee:!0}]),this._AddPredifinedEase("easeoutquint",[{x:0,y:0,sax:.2, say:1,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.6,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinoutquint",[{eax:0,eay:0,ee:!1,sax:.84,say:0,se:!0,x:0,y:0},{eax:-.84,eay:0,ee:!0,sax:0,say:0,se:!1,x:1,y:1}]),this._AddPredifinedEase("easeincirc",[{x:0,y:0,sax:.25,say:0,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.024,eay:-.808,se:!1,ee:!0}]),this._AddPredifinedEase("easeoutcirc",[{x:0,y:0,sax:.024,say:.808,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.25,eay:0,se:!1,ee:!0}]), this._AddPredifinedEase("easeinoutcirc",[{x:0,y:0,sax:.125,say:0,eax:0,eay:0,se:!0,ee:!1},{x:.5,y:.5,sax:.02,say:.428,eax:-.02,eay:-.428,se:!0,ee:!0},{x:1,y:1,sax:0,say:0,eax:-.125,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinexpo",[{x:0,y:0,sax:.66,say:0,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.14,eay:-1,se:!1,ee:!0}]),this._AddPredifinedEase("easeoutexpo",[{x:0,y:0,sax:.14,say:1,eax:0,eay:0,se:!0,ee:!1},{x:1,y:1,sax:0,say:0,eax:-.66,eay:0,se:!1,ee:!0}]),this._AddPredifinedEase("easeinoutexpo", [{eax:0,eay:0,ee:!1,sax:.345,say:0,se:!0,x:0,y:0},{eax:-.06,eay:-.5,ee:!0,sax:.06,say:.5,se:!0,x:.5,y:.5},{eax:-.335,eay:0,ee:!0,sax:0,say:0,se:!1,x:1,y:1}]),this._AddPrivateCustomEase("cubicbezier",this.EaseCubicBezier),this._AddPrivateCustomEase("spline",this.EaseSpline))}static _AddPredifinedEase(b,c,d=!1){if("function"===typeof c)a._AddEase(b,c,"predefined");else if(C3$jscomp$19.IsArray(c))if(self.BuiltInTransition){const e=C3$jscomp$19.New(self.BuiltInTransition,b,d);e.SetFromJson(c);a._AddEase(b, (g,k,l,n)=>e.Interpolate(g,k,l,n),"predefined");BUILT_IN_TRANSITION_MAP.set(b,e)}else{const e=C3$jscomp$19.New(C3$jscomp$19.Transition,[b,c.map(g=>[g.x,g.y,g.sax,g.say,g.eax,g.eay,g.se,g.ee])],!1);e.MakeLinear(d);a._AddEase(b,(g,k,l,n)=>e.Interpolate(g,k,l,n),"predefined")}else throw Error("unexpected arguments");}static _AddPrivateCustomEase(b,c){a._AddEase(b,c,"private")}static AddCustomEase(b,c,d){this._CreateEaseMap();a._AddEase(b,c,"custom",d)}static RemoveCustomEase(b,c){this.IsNamePredefined(b)|| [...PRIVATE_EASE_MAP.keys()].includes(b)||(c=CUSTOM_EASE_EDITOR_MAP.get(c))&&c.delete(b)}static _AddEase(b,c,d,e){switch(d){case "predefined":EASE_MAP.set(b,c);PREDEFINED_EASE_MAP.set(b,c);break;case "custom":e?(CUSTOM_EASE_EDITOR_MAP.has(e)||CUSTOM_EASE_EDITOR_MAP.set(e,new Map),CUSTOM_EASE_EDITOR_MAP.get(e).set(b,c)):CUSTOM_EASE_RUNTIME_MAP.set(b,c);break;case "private":EASE_MAP.set(b,c);PRIVATE_EASE_MAP.set(b,c);break;default:throw Error("unexpected ease mode");}}static NoEase(b,c,d,e){return d* b/e+c}static EaseInQuad(b,c,d,e){return d*(b/=e)*b+c}static EaseOutQuad(b,c,d,e){return-d*(b/=e)*(b-2)+c}static EaseInOutQuad(b,c,d,e){return 1>(b/=e/2)?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c}static EaseInCubic(b,c,d,e){return d*(b/=e)*b*b+c}static EaseOutCubic(b,c,d,e){return d*((b=b/e-1)*b*b+1)+c}static EaseInOutCubic(b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c}static EaseInQuart(b,c,d,e){return d*(b/=e)*b*b*b+c}static EaseOutQuart(b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c}static EaseInOutQuart(b, c,d,e){return 1>(b/=e/2)?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c}static EaseInQuint(b,c,d,e){return d*(b/=e)*b*b*b*b+c}static EaseOutQuint(b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c}static EaseInOutQuint(b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c}static EaseInSine(b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c}static EaseOutSine(b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c}static EaseInOutSine(b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c}static EaseInExpo(b,c,d,e){return 0=== b?c:d*Math.pow(2,10*(b/e-1))+c}static EaseOutExpo(b,c,d,e){return b===e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c}static EaseInOutExpo(b,c,d,e){return 0===b?c:b===e?c+d:1>(b/=e/2)?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c}static EaseInCirc(b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c}static EaseOutCirc(b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c}static EaseInOutCirc(b,c,d,e){return 1>(b/=e/2)?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c}static EaseInElastic(b,c,d,e){let g= 0,k=d;if(0===b)return c;if(1===(b/=e))return c+d;g||(g=.3*e);k<Math.abs(d)?(k=d,d=g/4):d=g/(2*Math.PI)*Math.asin(d/k);return-(k*Math.pow(2,10*--b)*Math.sin(2*(b*e-d)*Math.PI/g))+c}static EaseOutElastic(b,c,d,e){let g,k=0,l=d;if(0===b)return c;if(1===(b/=e))return c+d;k||(k=.3*e);l<Math.abs(d)?(l=d,g=k/4):g=k/(2*Math.PI)*Math.asin(d/l);return l*Math.pow(2,-10*b)*Math.sin(2*(b*e-g)*Math.PI/k)+d+c}static EaseInOutElastic(b,c,d,e){let g,k=0,l=d;if(0===b)return c;if(2===(b/=e/2))return c+d;k||(k=.3*e* 1.5);l<Math.abs(d)?(l=d,g=k/4):g=k/(2*Math.PI)*Math.asin(d/l);return 1>b?-.5*l*Math.pow(2,10*--b)*Math.sin(2*(b*e-g)*Math.PI/k)+c:l*Math.pow(2,-10*--b)*Math.sin(2*(b*e-g)*Math.PI/k)*.5+d+c}static EaseInBack(b,c,d,e,g){void 0===g&&(g=1.70158);return d*(b/=e)*b*((g+1)*b-g)+c}static EaseOutBack(b,c,d,e,g){void 0===g&&(g=1.70158);return d*((b=b/e-1)*b*((g+1)*b+g)+1)+c}static EaseInOutBack(b,c,d,e,g){void 0===g&&(g=1.70158);return 1>(b/=e/2)?d/2*b*b*(((g*=1.525)+1)*b-g)+c:d/2*((b-=2)*b*(((g*=1.525)+1)* b+g)+2)+c}static EaseInBounce(b,c,d,e){return d-a.EaseOutBounce(e-b,0,d,e)+c}static EaseOutBounce(b,c,d,e){return(b/=e)<1/2.75?7.5625*d*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c}static EaseInOutBounce(b,c,d,e){return b<e/2?.5*a.EaseInBounce(2*b,0,d,e)+c:.5*a.EaseOutBounce(2*b-e,0,d,e)+.5*d+c}static EaseCubicBezier(b,c,d,e,g){return c+3*b*(d-c)+3*b**2*(c+e-2*d)+b**3*(g-c+3*d-3*e)}static EaseSpline(b,c,d,e,g, k,l,n,p,r){if(e===g&&k===l)return b;b=get_t_for_x(b,c,e,k,n,r);c=a$jscomp$282(d,g,l,p);e=b$jscomp$151(d,g,l,p);d=c$jscomp$42(d,g,l,p);return calc_bezier(b,c,e,d)}static GetBezierSamples(b,c,d,e){const g=[],k=a$jscomp$282(b,c,d,e),l=b$jscomp$151(b,c,d,e);b=c$jscomp$42(b,c,d,e);for(c=0;11>c;++c)d=calc_bezier(c*SAMPLE_STEP,k,l,b),g.push(d);return g}}; const SAMPLE_STEP=.1,a$jscomp$282=(a,b,c,d)=>d-3*c+3*b-a,b$jscomp$151=(a,b,c,d)=>3*c-6*b+3*a,c$jscomp$42=(a,b,c,d)=>3*(b-a),calc_bezier=(a,b,c,d)=>((b*a+c)*a+d)*a,get_slope=(a,b,c,d)=>3*b*a*a+2*c*a+d,get_t_for_x=(a,b,c,d,e,g)=>{if(1==a)return 1;for(var k=0,l=1,n=g[l];10!=l&&n<=a;)l++,n=g[l],k+=SAMPLE_STEP;l--;n=g[l];g=k+(a-n)/(g[l+1]-n)*SAMPLE_STEP;l=a$jscomp$282(b,c,d,e);n=b$jscomp$151(b,c,d,e);b=c$jscomp$42(b,c,d,e);c=get_slope(g,l,n,b);if(0!==c)if(.01<=c)for(k=0;4>k;++k)c=calc_bezier(g,l,n,b)- a,d=get_slope(g,l,n,b),g-=c/d;else{c=k;k+=SAMPLE_STEP;d=0;let p;do g=c+(k-c)/2,e=calc_bezier(g,l,n,b)-a,0<e?k=g:c=g,e=1E-7<Math.abs(e),p=10>++d;while(e&&p)}return g};"use strict";const C3$jscomp$20=self.C3;function RequireStringOrNumber(a){C3$jscomp$20.IsString(a)} C3$jscomp$20.ProbabilityTable=class{constructor(a){this._items=[];this._name=a||"";this._totalWeight=0}Release(){this.Clear();this._items=null}GetName(){return this._name}Clear(){C3$jscomp$20.clear2DArray(this._items);this._totalWeight=0}GetTotalWeight(){return this._totalWeight}Sample(a=Math.random()*this.GetTotalWeight()){let b=0;for(const [c,d]of this._items)if(b+=c,a<b)return d;return 0}AddItem(a,b){RequireStringOrNumber(b);this._totalWeight+=a;this._items.push([a,b])}RemoveItem(a,b){RequireStringOrNumber(b); const c=0===a;for(let d=0;d<this._items.length;d++){const e=this._items[d],g=e[1]===b;if((c||e[0]===a)&&g){this._items.splice(d,1);this._totalWeight-=e[0];break}}}asJSON(){return JSON.stringify(this._items)}static fromJSON(a){const b=new C3$jscomp$20.ProbabilityTable;a=JSON.parse(a);for(const c of a)b.AddItem(c[0],c[1]);return b}};"use strict";let nextId=0; self.C3.ScreenReaderText=class{constructor(a,b){this._runtime=a;this._text=b;this._id=nextId++;this._runtime.PostComponentMessageToDOM("runtime","screen-reader-text",{type:"create",id:this._id,text:this._text})}Release(){this._runtime.PostComponentMessageToDOM("runtime","screen-reader-text",{type:"release",id:this._id});this._runtime=null;this._text="";this._id=-1}SetText(a){this._text!==a&&(this._text=a,this._runtime.PostComponentMessageToDOM("runtime","screen-reader-text",{type:"update",id:this._id, text:this._text}))}};"use strict";self.C3.Event=class{constructor(a,b){this.type=a;this.cancelable=!!b;this.isAsync=this.propagationStopped=this.defaultPrevented=!1}preventDefault(){if(!this.cancelable)throw Error(`event '${this.type}' is not cancelable`);this.defaultPrevented=!0}stopPropagation(){if(!this.cancelable)throw Error(`event '${this.type}' cannot be stopped`);if(this.isAsync)throw Error(`cannot stop async event '${this.type}' propagation`);this.propagationStopped=!0}};"use strict"; const C3$jscomp$23=self.C3; C3$jscomp$23.Event.Handler=class extends C3$jscomp$23.DefendedBase{constructor(a){super();this._type=a;this._captureListeners=[];this._captureListenersSet=new Set;this._listeners=[];this._listenersSet=new Set;this._fireDepth=0;this._queueModifyListeners=[]}Release(){0<this._fireDepth||(C3$jscomp$23.clearArray(this._captureListeners),this._captureListenersSet.clear(),C3$jscomp$23.clearArray(this._listeners),this._listenersSet.clear(),C3$jscomp$23.clearArray(this._queueModifyListeners),C3$jscomp$23.Release(this))}_AddListener(a, b){this._IsFiring()?this._queueModifyListeners.push({op:"add",func:a,capture:b}):b?this._captureListenersSet.has(a)||(this._captureListeners.push(a),this._captureListenersSet.add(a)):this._listenersSet.has(a)||(this._listeners.push(a),this._listenersSet.add(a))}_RemoveListener(a,b){this._IsFiring()?this._queueModifyListeners.push({op:"remove",func:a,capture:b}):b?this._captureListenersSet.has(a)&&(this._captureListenersSet.delete(a),C3$jscomp$23.arrayFindRemove(this._captureListeners,a)):this._listenersSet.has(a)&& (this._listenersSet.delete(a),C3$jscomp$23.arrayFindRemove(this._listeners,a))}_IsEmpty(){return!this._captureListeners.length&&!this._listeners.length}_IsFiring(){return 0<this._fireDepth}_ProcessQueuedListeners(){const a=new Set,b=new Set;for(const c of this._queueModifyListeners)if("add"===c.op)this._AddListener(c.func,c.capture),c.capture?b.delete(c.func):a.delete(c.func);else if("remove"===c.op)c.capture?(this._captureListenersSet.delete(c.func),b.add(c.func)):(this._listenersSet.delete(c.func), a.add(c.func));else throw Error("invalid op");C3$jscomp$23.arrayRemoveAllInSet(this._listeners,a);C3$jscomp$23.arrayRemoveAllInSet(this._captureListeners,b);C3$jscomp$23.clearArray(this._queueModifyListeners)}_FireCancellable(a){this._IncreaseFireDepth();let b=!1;for(let c=0,d=this._captureListeners.length;c<d;++c)if(this._captureListeners[c](a),a.propagationStopped){b=!0;break}if(!b)for(let c=0,d=this._listeners.length;c<d&&(this._listeners[c](a),!a.propagationStopped);++c);this._DecreaseFireDepth(); return!a.defaultPrevented}_FireNonCancellable(a){this._IncreaseFireDepth();for(let b=0,c=this._captureListeners.length;b<c;++b)this._captureListeners[b](a);for(let b=0,c=this._listeners.length;b<c;++b)this._listeners[b](a);this._DecreaseFireDepth();return!0}_IncreaseFireDepth(){this._fireDepth++}_DecreaseFireDepth(){this._fireDepth--;0===this._fireDepth&&0<this._queueModifyListeners.length&&this._ProcessQueuedListeners()}SetDelayRemoveEventsEnabled(a){a?this._IncreaseFireDepth():this._DecreaseFireDepth()}_FireAsync(a){let b= [];for(let c=0,d=this._captureListeners.length;c<d;++c){let e=this._captureListeners[c];b.push(C3$jscomp$23.Asyncify(()=>e(a)))}for(let c=0,d=this._listeners.length;c<d;++c){let e=this._listeners[c];b.push(C3$jscomp$23.Asyncify(()=>e(a)))}return Promise.all(b).then(()=>!a.defaultPrevented)}_FireAndWait_AsyncOptional(a){const b=[];this._IncreaseFireDepth();for(let d=0,e=this._captureListeners.length;d<e;++d){var c=this._captureListeners[d](a);c instanceof Promise&&b.push(c)}for(let d=0,e=this._listeners.length;d< e;++d)c=this._listeners[d](a),c instanceof Promise&&b.push(c);this._DecreaseFireDepth();return b.length?Promise.all(b).then(()=>!a.defaultPrevented):!a.defaultPrevented}async _FireAndWaitAsync(a){return await this._FireAndWait_AsyncOptional(a)}async _FireAndWaitAsyncSequential(a){this._IncreaseFireDepth();for(let c=0,d=this._captureListeners.length;c<d;++c){var b=this._captureListeners[c](a);b instanceof Promise&&await b}for(let c=0,d=this._listeners.length;c<d;++c)b=this._listeners[c](a),b instanceof Promise&&await b;this._DecreaseFireDepth();return!a.defaultPrevented}*_FireAsGenerator(a){this._IncreaseFireDepth();for(let c=0,d=this._captureListeners.length;c<d;++c){var b=this._captureListeners[c](a);C3$jscomp$23.IsIterator(b)&&(yield*b)}for(let c=0,d=this._listeners.length;c<d;++c)b=this._listeners[c](a),C3$jscomp$23.IsIterator(b)&&(yield*b);this._DecreaseFireDepth()}};"use strict";const C3$jscomp$24=self.C3; C3$jscomp$24.Event.Dispatcher=class extends C3$jscomp$24.DefendedBase{constructor(){super();this._eventHandlers=new Map;this._dispatcherWasReleased=!1}Release(){if(this._dispatcherWasReleased)throw Error("already released");this.ClearEvents();this._dispatcherWasReleased=!0;C3$jscomp$24.Release(this)}WasReleased(){return this._dispatcherWasReleased}ClearEvents(){for(let a of this._eventHandlers.values())a.Release();this._eventHandlers.clear()}_GetHandlerByType(a,b){let c=this._eventHandlers.get(a); return c?c:b?(c=C3$jscomp$24.New(C3$jscomp$24.Event.Handler,a),this._eventHandlers.set(a,c),c):null}HasAnyHandlerFor(a){return this._eventHandlers.has(a)}addEventListener(a,b,c){this._GetHandlerByType(a,!0)._AddListener(b,!!c)}removeEventListener(a,b,c){let d=this._GetHandlerByType(a,!1);d&&(d._RemoveListener(b,!!c),d._IsEmpty()&&this._eventHandlers.delete(a))}dispatchEvent(a){const b=this._GetHandlerByType(a.type,!1);return b?a.cancelable?b._FireCancellable(a):b._FireNonCancellable(a):!0}dispatchEventAsync(a){const b= this._GetHandlerByType(a.type,!1);if(!b)return Promise.resolve(!0);a.isAsync=!0;return b._FireAsync(a)}async dispatchEventAndClearAsync(a){const b=this._GetHandlerByType(a.type,!1);if(!b)return!0;this._eventHandlers.delete(a.type);a.isAsync=!0;a=await b._FireAsync(a);b.Release();return a}async dispatchEventAndWaitAsync(a){const b=this._GetHandlerByType(a.type,!1);return b?await b._FireAndWaitAsync(a):!0}dispatchEventAndWait_AsyncOptional(a){const b=this._GetHandlerByType(a.type,!1);return b?b._FireAndWait_AsyncOptional(a): !0}async dispatchEventAndWaitAsyncSequential(a){const b=this._GetHandlerByType(a.type,!1);return b?await b._FireAndWaitAsyncSequential(a):!0}dispatchGeneratorEvent(a){const b=this._GetHandlerByType(a.type,!1);if(!b)return null;if(a.cancelable)throw Error("not supported");return b._FireAsGenerator(a)}SetDelayRemoveEventsEnabled(a){for(const b of this._eventHandlers.values())b.SetDelayRemoveEventsEnabled(a)}};"use strict";const C3$jscomp$25=self.C3,SUPPORTS_RIC="undefined"!==typeof requestIdleCallback; let workQueue=[],callbackId=-1,highThroughputMode=0;function SetNewCallback(a){callbackId=SUPPORTS_RIC&&0===highThroughputMode?requestIdleCallback(DoAsyncifiedWork,{timeout:35}):setTimeout(DoAsyncifiedWork,0<highThroughputMode?1:a)} function DoAsyncifiedWork(a){callbackId=-1;if(workQueue.length){var b=performance.now(),c=0;do{DoNextAsyncifiedJob(workQueue.shift());var d=performance.now();++c;var e=(d-b)/c*1.1}while(workQueue.length&&(SUPPORTS_RIC&&0===highThroughputMode&&"undefined"!==typeof a?e<a.timeRemaining():12>d-b+e));-1===callbackId&&workQueue.length&&SetNewCallback(Math.max(16-(d-b),4))}}function DoNextAsyncifiedJob(a){let b;try{b=a.func()}catch(c){a.reject(c);return}a.resolve(b)}let asyncifyDisabled=C3$jscomp$25.QueryString.Has("disable-asyncify"); asyncifyDisabled&&console.warn("[Asyncify] Asyncify has been disabled due to disable-asyncify in the query string. Some work will now be done synchronously.");C3$jscomp$25.Asyncify=function(a){let b=null;C3$jscomp$25.isDebug&&(b=C3$jscomp$25.GetCallStack());return new Promise((c,d)=>{workQueue.push({func:a,resolve:c,reject:d,stack:b});asyncifyDisabled?DoNextAsyncifiedJob(workQueue.pop()):-1===callbackId&&SetNewCallback(16)})}; C3$jscomp$25.Asyncify.SetHighThroughputMode=function(a){if(a)++highThroughputMode;else if(--highThroughputMode,0>highThroughputMode)throw Error("already turned off high throughput mode");};"use strict";const C3$jscomp$26=self.C3;let cachedNowTime=-1;function ClearTimeCache(){cachedNowTime=-1}C3$jscomp$26.FastGetDateNow=function(){-1===cachedNowTime&&(cachedNowTime=Date.now(),self.setTimeout(ClearTimeCache,16));return cachedNowTime};let timerId=-1,nextDeadline=-1,activeIdleTimeouts=new Set; function CheckActiveIdleTimeouts(){nextDeadline=timerId=-1;let a=Date.now();for(let b of activeIdleTimeouts)if(b._CheckTimeout(a)){let c=b._GetDeadline();if(-1===nextDeadline||c<nextDeadline)nextDeadline=c}else activeIdleTimeouts.delete(b);-1!==nextDeadline&&(timerId=self.setTimeout(CheckActiveIdleTimeouts,Math.max(nextDeadline-a+100,1E3)))} C3$jscomp$26.IdleTimeout=class{constructor(a,b){this._callback=a;this._timeout=1E3*b;this._deadline=0;this._isActive=!1}Reset(){let a=C3$jscomp$26.FastGetDateNow();this._deadline=a+this._timeout;this._isActive||(activeIdleTimeouts.add(this),this._isActive=!0);-1===timerId?(nextDeadline=this._deadline,timerId=self.setTimeout(CheckActiveIdleTimeouts,this._timeout+100)):this._deadline<nextDeadline&&nextDeadline>a+1E3&&(self.clearTimeout(timerId),nextDeadline=this._deadline,timerId=self.setTimeout(CheckActiveIdleTimeouts, this._timeout+100))}_CheckTimeout(a){return a>=this._deadline?this._callback()?(this._deadline=a+this._timeout,!0):this._isActive=!1:!0}_GetDeadline(){return this._deadline}Cancel(){this._isActive&&(activeIdleTimeouts.delete(this),this._isActive=!1,0===activeIdleTimeouts.size&&-1!==timerId&&(self.clearTimeout(timerId),nextDeadline=timerId=-1))}Release(){this.Cancel();this._callback=null}};"use strict";const C3$jscomp$27=self.C3; C3$jscomp$27.Disposable=class a{constructor(b){this._disposed=!1;this._disposeAction=b}Dispose(){this._disposed||(this._disposed=!0,this._disposeAction&&(this._disposeAction(),this._disposeAction=null))}IsDisposed(){return this._disposed}Release(){this.Dispose()}static Release(b){return new a(()=>b.Release())}static From(b,c,d,e,g){if("undefined"===typeof e||null===e)e=!1;else if("boolean"!==typeof e&&"object"!==typeof e)throw new TypeError("invalid event listener options");g&&(d=d.bind(g));if(c.includes(" ")){c= c.split(" ");g=new C3$jscomp$27.CompositeDisposable;for(let k of c)b.addEventListener(k,d,e),g.Add(C3$jscomp$27.New(C3$jscomp$27.Disposable,()=>b.removeEventListener(k,d,e)));return g}b.addEventListener(c,d,e);return C3$jscomp$27.New(C3$jscomp$27.Disposable,()=>b.removeEventListener(c,d,e))}};C3$jscomp$27.StubDisposable=class extends C3$jscomp$27.Disposable{SetAction(a){this._disposeAction=a}}; C3$jscomp$27.CompositeDisposable=class extends C3$jscomp$27.Disposable{constructor(...a){super();this._disposables=new Set;for(let b of a)this.Add(b)}Add(...a){if(this._disposed)throw Error("already disposed");for(let b of a)this._disposables.add(b)}Remove(a){if(this._disposed)throw Error("already disposed");this._disposables.delete(a)}RemoveAll(){if(this._disposed)throw Error("already disposed");if(this._disposables){for(let a of this._disposables)a.Dispose();this._disposables.clear()}}IsDisposed(){return this._disposed}Dispose(){if(this._disposed)throw Error("already disposed"); this._disposed=!0;for(let a of this._disposables)a.Dispose();this._disposables.clear();this._disposables=null}Release(){this.Dispose()}};"use strict";const C3$jscomp$28=self.C3; C3$jscomp$28.KahanSum=class extends C3$jscomp$28.DefendedBase{constructor(){super();this._sum=this._t=this._y=this._c=0}Add(a){this._y=+a-this._c;this._t=this._sum+this._y;this._c=this._t-this._sum-this._y;this._sum=this._t}Subtract(a){this._sum-=+a}Get(){return this._sum}Reset(){this._sum=this._t=this._y=this._c=0}Set(a){this._t=this._y=this._c=0;this._sum=+a}Copy(a){this._c=a._c;this._y=a._y;this._t=a._t;this._sum=a._sum}Release(){}};"use strict"; const C3$jscomp$29=self.C3,js_cols={RBnode:function(a){this.tree=a;this.left=this.right=this.tree.sentinel;this.parent=null;this.color=!1;this.key=null},RedBlackSet:function(a){this.size=0;this.sentinel=new js_cols.RBnode(this);this.sentinel.color=!1;this.root=this.sentinel;this.root.parent=this.sentinel;this.compare=a||this.default_compare}};js_cols.RedBlackSet.prototype.default_compare=function(a,b){return a<b?-1:b<a?1:0}; js_cols.RedBlackSet.prototype.clone=function(){var a=new js_cols.RedBlackSet(this.compare);a.insertAll(this);return a};js_cols.RedBlackSet.prototype.clear=function(){this.size=0;this.sentinel=new js_cols.RBnode(this);this.sentinel.color=!1;this.root=this.sentinel;this.root.parent=this.sentinel}; js_cols.RedBlackSet.prototype.leftRotate=function(a){var b=a.right;a.right=b.left;b.left!=this.sentinel&&(b.left.parent=a);b.parent=a.parent;a.parent==this.sentinel?this.root=b:a==a.parent.left?a.parent.left=b:a.parent.right=b;b.left=a;a.parent=b};js_cols.RedBlackSet.prototype.rightRotate=function(a){var b=a.left;a.left=b.right;b.right!=this.sentinel&&(b.right.parent=a);b.parent=a.parent;a.parent==this.sentinel?this.root=b:a==a.parent.right?a.parent.right=b:a.parent.left=b;b.right=a;a.parent=b}; js_cols.RedBlackSet.prototype.insert=function(a){if(this.contains(a))this.get_(a).key=a;else{var b=new js_cols.RBnode(this);b.key=a;a=this.sentinel;for(var c=this.root;c!=this.sentinel;)a=c,c=0>this.compare(b.key,c.key)?c.left:c.right;b.parent=a;a==this.sentinel?this.root=b:0>this.compare(b.key,a.key)?a.left=b:a.right=b;b.left=this.sentinel;b.right=this.sentinel;b.color=!0;this.insertFixup(b);this.size++}}; js_cols.RedBlackSet.prototype.insertFixup=function(a){for(;a!=this.sentinel&&a!=this.root&&1==a.parent.color;)if(a.parent==a.parent.parent.left){var b=a.parent.parent.right;1==b.color?(a.parent.color=!1,b.color=!1,a.parent.parent.color=!0,a=a.parent.parent):(a==a.parent.right&&(a=a.parent,this.leftRotate(a)),a.parent.color=!1,a.parent.parent.color=!0,a.parent.parent!=this.sentinel&&this.rightRotate(a.parent.parent))}else b=a.parent.parent.left,1==b.color?(a.parent.color=!1,b.color=!1,a.parent.parent.color= !0,a=a.parent.parent):(a==a.parent.left&&(a=a.parent,this.rightRotate(a)),a.parent.color=!1,a.parent.parent.color=!0,a.parent.parent!=this.sentinel&&this.leftRotate(a.parent.parent));this.root.color=!1}; js_cols.RedBlackSet.prototype.delete_=function(a){var b=a.left==this.sentinel||a.right==this.sentinel?a:this.successor_(a);var c=b.left!=this.sentinel?b.left:b.right;c.parent=b.parent;b.parent==this.sentinel?this.root=c:b==b.parent.left?b.parent.left=c:b.parent.right=c;b!=a&&(a.key=b.key);0==b.color&&this.deleteFixup(c);this.size--}; js_cols.RedBlackSet.prototype.deleteFixup=function(a){for(;a!=this.root&&0==a.color;)if(a==a.parent.left){var b=a.parent.right;1==b.color&&(b.color=!1,a.parent.color=!0,this.leftRotate(a.parent),b=a.parent.right);0==b.left.color&&0==b.right.color?(b.color=!0,a=a.parent):(0==b.right.color&&(b.left.color=!1,b.color=!0,this.rightRotate(b),b=a.parent.right),b.color=a.parent.color,a.parent.color=!1,b.right.color=!1,this.leftRotate(a.parent),a=this.root)}else b=a.parent.left,1==b.color&&(b.color=!1,a.parent.color= !0,this.rightRotate(a.parent),b=a.parent.left),0==b.right.color&&0==b.left.color?(b.color=!0,a=a.parent):(0==b.left.color&&(b.right.color=!1,b.color=!0,this.leftRotate(b),b=a.parent.left),b.color=a.parent.color,a.parent.color=!1,b.left.color=!1,this.rightRotate(a.parent),a=this.root);a.color=!1};js_cols.RedBlackSet.prototype.remove=function(a){a=this.get_(a);if(a!=this.sentinel){var b=a.key;this.delete_(a);return b}return null};js_cols.RedBlackSet.prototype.removeSwapped=function(a,b){this.remove(b)}; js_cols.RedBlackSet.prototype.min=function(a){for(;a.left!=this.sentinel;)a=a.left;return a};js_cols.RedBlackSet.prototype.max=function(a){for(;a.right!=this.sentinel;)a=a.right;return a};js_cols.RedBlackSet.prototype.successor_=function(a){if(a.right!=this.sentinel)return this.min(a.right);for(var b=a.parent;b!=this.sentinel&&a==b.right;)a=b,b=b.parent;return b}; js_cols.RedBlackSet.prototype.predeccessor_=function(a){if(a.left!=this.sentinel)return this.max(a.left);for(var b=a.parent;b!=this.sentinel&&a==b.left;)a=b,b=b.parent;return b};js_cols.RedBlackSet.prototype.successor=function(a){if(0<this.size){a=this.get_(a);if(a==this.sentinel)return null;if(a.right!=this.sentinel)return this.min(a.right).key;for(var b=a.parent;b!=this.sentinel&&a==b.right;)a=b,b=b.parent;return b!=this.sentinel?b.key:null}return null}; js_cols.RedBlackSet.prototype.predecessor=function(a){if(0<this.size){a=this.get_(a);if(a==this.sentinel)return null;if(a.left!=this.sentinel)return this.max(a.left).key;for(var b=a.parent;b!=this.sentinel&&a==b.left;)a=b,b=b.parent;return b!=this.sentinel?b.key:null}return null};js_cols.RedBlackSet.prototype.getMin=function(){return this.min(this.root).key};js_cols.RedBlackSet.prototype.getMax=function(){return this.max(this.root).key}; js_cols.RedBlackSet.prototype.get_=function(a){for(var b=this.root;b!=this.sentinel&&0!=this.compare(b.key,a);)b=0>this.compare(a,b.key)?b.left:b.right;return b};js_cols.RedBlackSet.prototype.contains=function(a){return null!=this.get_(a).key};js_cols.RedBlackSet.prototype.getValues=function(){var a=[];this.forEach(function(b){a.push(b)});return a}; js_cols.RedBlackSet.prototype.insertAll=function(a){if("array"==js_cols.typeOf(a))for(var b=0;b<a.length;b++)this.insert(a[b]);else if("function"==js_cols.typeOf(a.forEach))a.forEach(this.insert,this);else if("function"==js_cols.typeOf(a.getValues))for(a=a.getValues(),b=0;b<a.length;b++)this.insert(a[b]);else if("object"==js_cols.typeOf(a))for(b in a)this.insert(a[b])}; js_cols.RedBlackSet.prototype.removeAll=function(a){if("array"==js_cols.typeOf(a))for(var b=0;b<a.length;b++)this.remove(a[b]);else if("function"==js_cols.typeOf(a.forEach))a.forEach(this.removeSwapped,this);else if("function"==js_cols.typeOf(a.getValues))for(a=a.getValues(),b=0;b<a.length;b++)this.remove(a[b]);else if("object"==js_cols.typeOf(a))for(b in a)this.remove(a[b])}; js_cols.RedBlackSet.prototype.containsAll=function(a){if("array"==js_cols.typeOf(a)){for(var b=0;b<a.length;b++)if(!this.contains(a[b]))return!1;return!0}if("function"==js_cols.typeOf(a.forEach))return a.every(this.contains,this);if("function"==js_cols.typeOf(a.getValues)){a=a.getValues();for(b=0;b<a.length;b++)if(!this.contains(a[b]))return!1;return!0}if("object"==js_cols.typeOf(a)){for(b in a)if(!this.contains(a[b]))return!1;return!0}}; js_cols.RedBlackSet.prototype.range=function(a,b){var c=[];this.traverseFromTo(function(d){c.push(d)},a,b);return c};js_cols.RedBlackSet.prototype.traverse=function(a,b){if(!this.isEmpty())for(var c=this.min(this.root);c!=this.sentinel&&!a.call(b,c.key,this);)c=this.successor_(c)};js_cols.RedBlackSet.prototype.traverseFrom=function(a,b,c){if(!this.isEmpty())for(b=this.get_(b);b!=this.sentinel&&!a.call(c,b.key,this);)b=this.successor_(b)}; js_cols.RedBlackSet.prototype.traverseTo=function(a,b,c){if(!this.isEmpty()){var d=this.min(this.root);for(b=this.get_(b);d!=b&&!a.call(c,d.key,this);)d=this.successor_(d)}};js_cols.RedBlackSet.prototype.traverseFromTo=function(a,b,c,d){if(!this.isEmpty())for(b=this.get_(b),c=this.get_(c);b!=c&&!a.call(d,b.key,this);)b=this.successor_(b)};js_cols.RedBlackSet.prototype.traverseBackwards=function(a,b){if(!this.isEmpty())for(var c=this.max(this.root);c!=this.sentinel&&!a.call(b,c.key,this);)c=this.predeccessor_(c)}; js_cols.RedBlackSet.prototype.forEach=function(a,b){if(!this.isEmpty())for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))a.call(b,c.key,c.key,this)};js_cols.RedBlackSet.prototype.some=function(a,b){if(this.isEmpty())return!1;for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))if(a.call(b,c.key,c.key,this))return!0;return!1}; js_cols.RedBlackSet.prototype.every=function(a,b){if(this.isEmpty())return!1;for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))if(!a.call(b,c.key,c.key,this))return!1;return!0};js_cols.RedBlackSet.prototype.map=function(a,b){var c=[];if(this.isEmpty())return c;for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))c.push(a.call(b,d.key,d.key,this));return c}; js_cols.RedBlackSet.prototype.filter=function(a,b){var c=[];if(this.isEmpty())return c;for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))a.call(b,d.key,d.key,this)&&c.push(d.key);return c};js_cols.RedBlackSet.prototype.getCount=function(){return this.size};js_cols.RedBlackSet.prototype.isEmpty=function(){return 0==this.size}; js_cols.RedBlackSet.prototype.isSubsetOf=function(a){var b=js_cols.getCount(a);if(this.getCount()>b)return!1;b=0;if(this.isEmpty())return!0;for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))js_cols.contains.call(a,a,c.key)&&b++;return b==this.getCount()}; js_cols.RedBlackSet.prototype.intersection=function(a){var b=new js_cols.RedBlackSet(this.compare);if(this.isEmpty())return b;for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))a.contains.call(a,c.key,c.key,this)&&b.insert(c.key);return b}; C3$jscomp$29.RedBlackSet=class extends C3$jscomp$29.DefendedBase{constructor(a){super();this._rbSet=new js_cols.RedBlackSet(a);this._enableQueue=!1;this._queueInsert=new Set;this._queueRemove=new Set}Add(a){this._enableQueue?this._rbSet.contains(a)?this._queueRemove.delete(a):this._queueInsert.add(a):this._rbSet.insert(a)}Remove(a){this._enableQueue?this._rbSet.contains(a)?this._queueRemove.add(a):this._queueInsert.delete(a):this._rbSet.remove(a)}Has(a){return this._enableQueue?this._queueInsert.has(a)? !0:!this._queueRemove.has(a)&&this._rbSet.contains(a):this._rbSet.contains(a)}Clear(){this._rbSet.clear();this._queueInsert.clear();this._queueRemove.clear()}toArray(){if(this._enableQueue)throw Error("cannot be used in queueing mode");return this._rbSet.getValues()}GetSize(){return this._rbSet.getCount()+this._queueInsert.size-this._queueRemove.size}IsEmpty(){return 0===this.GetSize()}Front(){if(this.IsEmpty())throw Error("empty set");if(this._enableQueue)throw Error("cannot be used in queueing mode"); const a=this._rbSet;return a.min(a.root).key}Shift(){if(this.IsEmpty())throw Error("empty set");if(this._enableQueue)throw Error("cannot be used in queueing mode");const a=this.Front();this.Remove(a);return a}SetQueueingEnabled(a){a=!!a;if(this._enableQueue!==a&&(this._enableQueue=a,!a)){for(const b of this._queueRemove)this._rbSet.remove(b);this._queueRemove.clear();for(const b of this._queueInsert)this._rbSet.insert(b);this._queueInsert.clear()}}ForEach(a){this._rbSet.forEach(a)}*values(){if(!this.IsEmpty()){var a= this._rbSet;for(let b=a.min(a.root);b!=a.sentinel;b=a.successor_(b))yield b.key}}[Symbol.iterator](){return this.values()}};"use strict";const C3$jscomp$30=self.C3; C3$jscomp$30.PromiseThrottle=class{constructor(a=C3$jscomp$30.hardwareConcurrency){this._maxParallel=a;this._queue=[];this._activeCount=0}Add(a){return new Promise((b,c)=>{this._queue.push({func:a,resolve:b,reject:c});this._MaybeStartNext()})}_FindInQueue(a){for(let b=0,c=this._queue.length;b<c;++b)if(this._queue[b].func===a)return b;return-1}RemoveAndResolve(a,b){a=this._FindInQueue(a);if(-1===a)throw Error("cannot find promise to resolve");this._queue[a].resolve(b);this._queue.splice(a,1)}RemoveAndReject(a, b){a=this._FindInQueue(a);if(-1===a)throw Error("cannot find promise to reject");this._queue[a].reject(b);this._queue.splice(a,1)}async _MaybeStartNext(){if(this._queue.length&&!(this._activeCount>=this._maxParallel)){this._activeCount++;var a=this._queue.shift();try{const b=await a.func();a.resolve(b)}catch(b){a.reject(b)}this._activeCount--;this._MaybeStartNext()}}static async Batch(a,b){const c=[];let d=!1;const e=async k=>{for(;(k=b.pop())&&!d;)try{c.push(await k())}catch(l){throw d=!0,l;}},g= [];for(;a--;)g.push(e());await Promise.all(g);return c}};"use strict";const C3$jscomp$31=self.C3; C3$jscomp$31.RateLimiter=class{constructor(a,b,c){this._callback=a;this._interval=b;this._intervalOnBattery=c||2*b;this._timerId=-1;this._lastCallTime=-Infinity;this._timerCallFunc=()=>this._OnTimer();this._canRunImmediate=this._ignoreReset=!1;this._callbackArguments=null}SetCanRunImmediate(a){this._canRunImmediate=!!a}_GetInterval(){return"undefined"!==typeof C3$jscomp$31.Battery&&C3$jscomp$31.Battery.IsOnBatteryPower()?this._intervalOnBattery:this._interval}Call(...a){if(-1===this._timerId){this._callbackArguments= a;a=C3$jscomp$31.FastGetDateNow();var b=a-this._lastCallTime,c=this._GetInterval();b>=c&&this._canRunImmediate?(this._lastCallTime=a,this._RunCallback()):this._timerId=self.setTimeout(this._timerCallFunc,Math.max(c-b,4))}}_RunCallback(){this._ignoreReset=!0;const a=this._callbackArguments;this._callbackArguments=null;a?this._callback(...a):this._callback();this._ignoreReset=!1}Reset(){this._ignoreReset||(this._CancelTimer(),this._callbackArguments=null,this._lastCallTime=C3$jscomp$31.FastGetDateNow())}_OnTimer(){this._timerId= -1;this._lastCallTime=C3$jscomp$31.FastGetDateNow();this._RunCallback()}_CancelTimer(){-1!==this._timerId&&(self.clearTimeout(this._timerId),this._timerId=-1)}Release(){this._CancelTimer();this._timerCallFunc=this._callbackArguments=this._callback=null}};"use strict";const C3$jscomp$32=self.C3; C3$jscomp$32.SVGRasterManager=class{constructor(){this._images=new Map;this._allowNpotSurfaces=!1;this._redrawCallback=this._releaseResultCallback=this._rasterAtSizeCallback=this._getBaseSizeCallback=null}SetNpotSurfaceAllowed(a){this._allowNpotSurfaces=!!a}IsNpotSurfaceAllowed(){return this._allowNpotSurfaces}SetGetBaseSizeCallback(a){this._getBaseSizeCallback=a}GetBaseSize(a){if(!this._getBaseSizeCallback)throw Error("no get base size callback set");return this._getBaseSizeCallback(a)}SetRasterAtSizeCallback(a){this._rasterAtSizeCallback= a}RasterAtSize(a,b,c,d,e,g){if(!this._rasterAtSizeCallback)throw Error("no raster at size callback set");return this._rasterAtSizeCallback(a,b,c,d,e,g)}SetReleaseResultCallback(a){this._releaseResultCallback=a}ReleaseResult(a){if(!this._releaseResultCallback)throw Error("no release result callback set");this._releaseResultCallback(a)}SetRedrawCallback(a){this._redrawCallback=a}Redraw(){if(!this._redrawCallback)throw Error("no redraw callback set");this._redrawCallback()}AddImage(a){let b=this._images.get(a); b||(b=C3$jscomp$32.New(C3$jscomp$32.SVGRasterImage,this,a),this._images.set(a,b));b.IncReference();return b}_RemoveImage(a){this._images.delete(a.GetDataSource())}OnTexturesChanged(){for(const a of this._images.values())a.ReleaseRasterizedResult(),a.ForceRasterAgain()}};"use strict";const C3$jscomp$33=self.C3; C3$jscomp$33.SVGRasterImage=class{constructor(a,b){this._manager=a;this._dataSource=b;this._baseHeight=this._baseWidth=this._refCount=0;this._getBaseSizePromise=this._manager.GetBaseSize(b).then(c=>{this._manager&&(this._baseWidth=c[0],this._baseHeight=c[1],this._manager.Redraw())}).catch(c=>{console.error("[SVG] Error loading SVG: ",c);this._hadError=!0;this._manager&&this._manager.Redraw()});this._rasterImageHeight=this._rasterImageWidth=this._rasterSurfaceHeight=this._rasterSurfaceWidth=0;this._isRasterizing= !1;this._rasterizedResult=null;this._hadError=this._forceRaster=!1}Release(){if(0>=this._refCount)throw Error("already released");this._refCount--;0===this._refCount&&this._Release()}ReleaseRasterizedResult(){this._rasterizedResult&&(this._manager.ReleaseResult(this._rasterizedResult),this._rasterizedResult=null)}_Release(){this.ReleaseRasterizedResult();this._manager._RemoveImage(this);this._manager=null}GetDataSource(){return this._dataSource}IncReference(){this._refCount++}HasReferences(){return 0< this._refCount}GetRasterizedResult(){return this._rasterizedResult}ForceRasterAgain(){this._forceRaster=!0}async StartRasterForSize(a,b,c){if(0!==b&&0!==c&&!this._hadError&&!this._isRasterizing){var d=C3$jscomp$33.nextHighestPowerOfTwo(Math.ceil(b)),e=C3$jscomp$33.nextHighestPowerOfTwo(Math.ceil(c)),g=Math.max(d,e);4096<g&&(g=4096/g,b*=g,c*=g,d=Math.min(Math.ceil(d*g),4096),e=Math.min(Math.ceil(e*g),4096));b<d&&c<e&&(c=b/c,d/e>c?(b=e*c,c=e):(b=d,c=d/c));this._manager.IsNpotSurfaceAllowed()&&(d=Math.ceil(b), e=Math.ceil(c));d<=this._rasterSurfaceWidth&&e<=this._rasterSurfaceHeight&&!this._forceRaster||(this._isRasterizing=!0,this._rasterSurfaceWidth=d,this._rasterSurfaceHeight=e,a=await this._manager.RasterAtSize(this._dataSource,a,this._rasterSurfaceWidth,this._rasterSurfaceHeight,b,c),this._manager&&(this.ReleaseRasterizedResult(),this._rasterizedResult=a,this._rasterImageWidth=b,this._rasterImageHeight=c,this._forceRaster=this._isRasterizing=!1,this._manager.Redraw()))}}WhenBaseSizeReady(){return this._getBaseSizePromise}GetBaseWidth(){return this._baseWidth}GetBaseHeight(){return this._baseHeight}GetRasterWidth(){return this._rasterImageWidth}GetRasterHeight(){return this._rasterImageHeight}HadError(){return this._hadError}}; "use strict";const C3$jscomp$34=self.C3;C3$jscomp$34.UTF8_BOM="\ufeff";const NUMERIC_CHARS=new Set([..."0123456789"]);C3$jscomp$34.IsNumericChar=function(a){return NUMERIC_CHARS.has(a)};const WHITESPACE_CHARS=new Set([..." \t\n\r\u00a0\u0085\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000"]);C3$jscomp$34.IsWhitespaceChar=function(a){return WHITESPACE_CHARS.has(a)};C3$jscomp$34.FilterWhitespace=function(a){return[...a].filter(b=>!C3$jscomp$34.IsWhitespaceChar(b)).join("")}; C3$jscomp$34.IsStringAllWhitespace=function(a){for(const b of a)if(!C3$jscomp$34.IsWhitespaceChar(b))return!1;return!0};C3$jscomp$34.IsCharArrayAllWhitespace=function(a){for(const b of a)if(!C3$jscomp$34.IsWhitespaceChar(b))return!1;return!0};C3$jscomp$34.IsUnprintableChar=function(a){return 1===a.length&&32>a.charCodeAt(0)};C3$jscomp$34.FilterUnprintableChars=function(a){return[...a].filter(b=>!C3$jscomp$34.IsUnprintableChar(b)).join("")};const NUMERIC_STRING_CHARS=new Set([..."0123456789.+-e"]); C3$jscomp$34.IsStringNumber=function(a){a=a.trim();if(!a.length)return!1;let b=a.charAt(0);if("-"!==b&&!NUMERIC_CHARS.has(b))return!1;for(let c of a)if(!NUMERIC_STRING_CHARS.has(c))return!1;return!0};C3$jscomp$34.RemoveTrailingDigits=function(a){let b=a.length;for(;0<b;){let c=a.charAt(b-1);if(!C3$jscomp$34.IsNumericChar(c))break;--b}return a.substr(0,b)}; C3$jscomp$34.IncrementNumberAtEndOf=function(a){let b=C3$jscomp$34.RemoveTrailingDigits(a);a=(a=a.substr(b.length))?(parseInt(a,10)+1).toString():"2";return b+a};const HTML_ENTITY_MAP=new Map([["&","&"],["<","<"],[">",">"],['"',"""],["'","'"]]);function lookupHtmlEntity(a){return HTML_ENTITY_MAP.get(a)}const HTML_ENTITY_REGEX=/[&<>"']/g;C3$jscomp$34.EscapeHTML=function(a){return a.replace(HTML_ENTITY_REGEX,lookupHtmlEntity)}; C3$jscomp$34.EscapeJS=function(a){a=C3$jscomp$34.ReplaceAll(a,"\\","\\\\");a=C3$jscomp$34.ReplaceAll(a,'"','\\"');a=C3$jscomp$34.ReplaceAll(a,"\t","\\t");a=C3$jscomp$34.ReplaceAll(a,"\r","");return C3$jscomp$34.ReplaceAll(a,"\n","\\n")};C3$jscomp$34.EscapeXML=function(a){a=C3$jscomp$34.ReplaceAll(a,"&","&");a=C3$jscomp$34.ReplaceAll(a,"<","<");a=C3$jscomp$34.ReplaceAll(a,">",">");return C3$jscomp$34.ReplaceAll(a,'"',""")};const ESCAPE_REGEX=/[-[\]{}()*+?.,\\^$|#\s]/g; C3$jscomp$34.EscapeRegex=function(a){return a.replace(ESCAPE_REGEX,"\\$&")};C3$jscomp$34.CountCharsInString=function(a,b){let c=0;for(const d of a)d===b&&++c;return c};C3$jscomp$34.FindAll=function(a,b,c=!1){if(!b)return[];c||(a=a.toLowerCase(),b=b.toLowerCase());c=b.length;var d=0;let e=[];for(;-1<(d=a.indexOf(b,d));)e.push(d),d+=c;return e};C3$jscomp$34.ReplaceAll=function(a,b,c){return a.replaceAll(b,()=>c)}; C3$jscomp$34.ReplaceAllCaseInsensitive=function(a,b,c){return a.replace(new RegExp(C3$jscomp$34.EscapeRegex(b),"gi"),()=>c)};C3$jscomp$34.SetElementContent=function(a,b){"string"===typeof b?a.textContent=b:b.isPlainText()?a.textContent=b.toString():(a.innerHTML=b.toHTML(),b instanceof C3$jscomp$34.BBString&&b.attachLinkHandlers(a))}; C3$jscomp$34.StringLikeEquals=function(a,b){return a instanceof C3$jscomp$34.HtmlString||a instanceof C3$jscomp$34.BBString?a.equals(b):b instanceof C3$jscomp$34.HtmlString||b instanceof C3$jscomp$34.BBString?b.equals(a):a===b};C3$jscomp$34.StringSubstitute=function(a,...b){let c=a;for(let d=0,e=b.length;d<e;++d){const g=`{${d}}`;if(!a.includes(g))throw Error(`missing placeholder '${g}' in string substitution`);c=c.replace(g,b[d].toString())}return c}; C3$jscomp$34.StringSubstituteAllowMissing=function(a,...b){let c=a,d=-1,e=-1;for(let g=0,k=b.length;g<k;++g){const l=`{${g}}`;a.includes(l)?(e=g,c=c.replace(l,b[g].toString())):-1===d&&(d=g)}if(0<=d&&0<=e&&d<e)throw Error(`missing placeholder '${d}' in string substitution`);return c};C3$jscomp$34.StringSubstituteMap=function(a,b){for(let [c,d]of Object.entries(b))a=a.replaceAll(c,d.toString());return a};C3$jscomp$34.SortAZ=function(a,b){return a>b?1:a<b?-1:0}; C3$jscomp$34.SortAZCaseInsensitive=function(a,b){a=a.toLowerCase();b=b.toLowerCase();return a>b?1:a<b?-1:0};let intlSegmenter=null,graphemeSplitter=null;self.Intl&&self.Intl.Segmenter?intlSegmenter=new self.Intl.Segmenter:graphemeSplitter=new self.GraphemeSplitter;C3$jscomp$34.SplitGraphemes=function(a){if(intlSegmenter){const b=[];for(const c of intlSegmenter.segment(a))b.push(c.segment);return b}return graphemeSplitter.splitGraphemes(a)}; C3$jscomp$34.IterateGraphemes=function*(a){if(intlSegmenter)for(const b of intlSegmenter.segment(a))yield b.segment;else yield*graphemeSplitter.iterateGraphemes(a)};C3$jscomp$34.CountGraphemes=function(a){if(intlSegmenter){let b=0;for(const c of intlSegmenter.segment(a))++b;return b}return graphemeSplitter.countGraphemes(a)};const MEGABYTE=1048576,GIGABYTE=1024*MEGABYTE,TERABYTE=1024*GIGABYTE; C3$jscomp$34.FormatDataSize=function(a,b){b="common."+(b?"dataRates":"dataSizes")+".";const c=self.langSub;if(1024>a)return c(b+"bytes",a);if(a<MEGABYTE)return a/=1024,a=10>a?Math.round(10*a)/10:Math.round(a),c(b+"kilobytes",a);if(a<GIGABYTE)return a/=MEGABYTE,a=10>a?Math.round(10*a)/10:Math.round(a),c(b+"megabytes",a);if(a<TERABYTE)return a/=GIGABYTE,a=10>a?Math.round(10*a)/10:Math.round(a),c(b+"gigabytes",a);a/=TERABYTE;a=10>a?Math.round(10*a)/10:Math.round(a);return c(b+"terabytes",a)}; const DEFAULT_FORMATTIME_OPTS={approximate:!1,days:!0,hours:!0,minutes:!0,seconds:!0}; C3$jscomp$34.FormatTime=function(a,b){b=Object.assign({},DEFAULT_FORMATTIME_OPTS,b);C3$jscomp$34.Lang.PushContext("common.time");const c=[],d=self.lang,e=self.langPluralSub;if(b.days){var g=Math.floor(a/86400);0<g&&(a-=86400*g,c.push(e(".days",null,g)))}b.hours&&(g=Math.floor(a/3600),0<g||c.length)&&(a-=3600*g,c.push(e(".hours",null,g)));b.minutes&&(g=Math.floor(a/60),0<g||c.length||!b.seconds)&&(a-=60*g,c.push(e(".minutes",null,g)));b.seconds&&c.push(e(".seconds",null,Math.floor(a%60)));a=(b.approximate? d(".approx-prefix"):"")+c.join(d(".separator"));C3$jscomp$34.Lang.PopContext();return a};C3$jscomp$34.ZeroPad=function(a,b){let c=0>a?"-":"";a=Math.abs(a);a=a.toString();b-=a.length;for(let d=0;d<b;++d)c+="0";return c+a};C3$jscomp$34.StringToTitleCase=function(a){return a.toLowerCase().replace(/\b\w/g,b=>b.toUpperCase())}; C3$jscomp$34.CompareVersionStrings=function(a,b){a=a.split(".").map(c=>c.trim());b=b.split(".").map(c=>c.trim());C3$jscomp$34.resizeArray(a,4,"0");C3$jscomp$34.resizeArray(b,4,"0");a=a.map(c=>parseInt(c,10));b=b.map(c=>parseInt(c,10));for(let c=0;4>c;++c){const d=a[c]-b[c];if(0!==d)return 0>d?-1:1}return 0};C3$jscomp$34.CreateGUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const b=Math.floor(16*Math.random());return("x"===a?b:b&3|8).toString(16)})}; C3$jscomp$34.StringHammingDistance=function(a,b){if(a.length!==b.length)throw Error("strings must be same length");let c=0;for(let d=0,e=a.length;d<e;++d)a.charAt(d)!==b.charAt(d)&&++c;return c}; C3$jscomp$34.StringLevenshteinDistance=function(a,b){if(0===a.length)return b.length;if(0===b.length)return a.length;let c,d,e,g;if(a.length>b.length){var k=a;a=b;b=k}g=Array(a.length+1);for(k=0;k<=a.length;k++)g[k]=k;for(k=1;k<=b.length;k++){d=k;for(c=1;c<=a.length;c++)e=b[k-1]===a[c-1]?g[c-1]:Math.min(g[c-1]+1,Math.min(d+1,g[c]+1)),g[c-1]=d,d=e;g[a.length]=d}return g[a.length]};"use strict"; const C3$jscomp$35=self.C3,BB_CODE_MAP=new Map([["b","strong"],["i","em"],["s","s"],["u","u"],["sub","sub"],["sup","sup"],["small","small"],["mark","mark"],["code","code"],["a1","a"],["a2","a"],["a3","a"],["a4","a"],["a5","a"],["a6","a"],["a7","a"],["a8","a"],["a9","a"],["tip1","abbr"],["tip2","abbr"],["tip3","abbr"],["tip4","abbr"],["tip5","abbr"],["tip6","abbr"],["tip7","abbr"],["tip8","abbr"],["tip9","abbr"],["bad",["span","bbCodeBad"]],["good",["span","bbCodeGood"]],["info",["span","bbCodeInfo"]], ["h1",["span","bbCodeH1"]],["h2",["span","bbCodeH2"]],["h3",["span","bbCodeH3"]],["h4",["span","bbCodeH4"]],["item",["span","bbCodeItem"]]]),SELF_CLOSING_TAGS=new Set(["icon"]),BBREGEX=/\[(\/?)([a-zA-Z0-9]+)\]/g,CUSTOM_BBREGEX=/\[(\/?)([^\[\n]*?)\]/g;let linkActions=null,tipList=null,classIndex=0; function bbToHtmlReplacerFunc(a,b,c){var d=BB_CODE_MAP.get(c);if(d){if("string"===typeof d){if("a"===d&&0===linkActions.length||"abbr"===d&&0===tipList.length)return a;if("a"!==d||b){if("abbr"!==d||b)return"<"+b+d+">";b=parseInt(c.substring(3),10)-1;if(0>b||b>=tipList.length)throw Error("invalid bbcode tip substitution");b=tipList[b];d="";"string"===typeof b?d=b:"function"===typeof b&&(d=b());if("string"!==typeof d)throw new TypeError("invalid bbcode tip");return`<abbr title="${C3$jscomp$35.ReplaceAll(d, '"',""")}">`}b=parseInt(c.substring(1),10)-1;if(0>b||b>=linkActions.length)throw Error("invalid bbcode link substitution");d=linkActions[b];if("string"===typeof d)return`<a href="${linkActions[b]}">`;if("function"===typeof d)return`<a class="bblink${b}">`;throw new TypeError("invalid bbcode link action");}if(Array.isArray(d))return a=d[0],d=d[1],b?"</"+a+">":`<${a} class="${d}">`}else return"class"===c?b?"</span>":`<span class="bbclass${classIndex++}">`:a}const LINEBREAK_REGEX=/\n/g; C3$jscomp$35.BBString=class{constructor(a,b){this._bbstr=b&&b.noEscape?a:C3$jscomp$35.EscapeHTML(a);this._htmlstr="";this._convertLineBreaks=!1;this._linkActions=[];this._tipList=[];if(b){this._convertLineBreaks=!!b.convertLineBreaks;if(b.links){if(9<b.links.length)throw Error("too many links");this._linkActions=b.links}if(b.tips){if(9<b.tips.length)throw Error("too many tips");this._tipList=b.tips}}this._hasAnyBBtags=this._bbstr.includes("[");this._needsLineBreakConversion=this._convertLineBreaks&& this._bbstr.includes("\n");this._isPlain=!this._hasAnyBBtags&&!this._needsLineBreakConversion&&!this._bbstr.includes("&");this._hasParsedFragments=!1;this._fragments=[]}toString(){return this._bbstr}valueOf(){return this._bbstr}isPlainText(){return this._isPlain}toPlainText(){return this._hasAnyBBtags?this._bbstr.replace(BBREGEX,""):this._bbstr}toHTML(){if(this._isPlain)return this._bbstr;if(!this._htmlstr&&this._bbstr){let a=this._bbstr;this._hasAnyBBtags&&(classIndex=0,linkActions=this._linkActions, tipList=this._tipList,a=a.replace(BBREGEX,bbToHtmlReplacerFunc),tipList=linkActions=null);this._needsLineBreakConversion&&(a=a.replace(LINEBREAK_REGEX,"<br>"));this._htmlstr=a}return this._htmlstr}attachLinkHandlers(a){if(this._linkActions.length)for(let b=0,c=this._linkActions.length;b<c;++b){const d=this._linkActions[b];if("function"!==typeof d)continue;const e=a.querySelector(".bblink"+b);if(!e)throw Error("unable to attach BBString link handler");e.onclick=d}}equals(a){return a instanceof C3$jscomp$35.HtmlString? this.toHTML()===a.toHTML():a instanceof C3$jscomp$35.BBString?this._bbstr===a._bbstr:this._bbstr===a}toFragmentList(){if(this._hasParsedFragments)return this._fragments;const a=[],b=this._bbstr,c=[];let d=CUSTOM_BBREGEX.lastIndex=0;for(var e=null;null!==(e=CUSTOM_BBREGEX.exec(b));){var g=e.index;if(0<g&&"\\"===b.charAt(g-1))continue;var k=e[0],l=e[1];e=e[2];const n=b.substring(d,g);d=g+k.length;n&&a.push({text:n,styles:c.slice(0)});if(e)if(l)for(e=e.toLowerCase(),g=c.length-1;0<=g;--g){if(c[g].tag=== e){c.splice(g,1);break}}else if(g=e,k=null,l=e.indexOf("="),-1!==l?(g=e.substring(0,l).toLowerCase(),k=e.substring(l+1)):g=g.toLowerCase(),SELF_CLOSING_TAGS.has(g))if("icon"===g)a.push({icon:k,styles:c.slice(0)});else throw Error(`unknown self-closing tag ${g}`);else c.push({tag:g,param:k})}d<b.length&&a.push({text:b.substring(d),styles:c.slice(0)});for(const n of a)n.text&&(n.text=this._ProcessBBCodeEscapeSequences(n.text));this._fragments=a.map(n=>n.icon?C3$jscomp$35.New(C3$jscomp$35.IconFragment, {icon:n.icon,styles:n.styles}):C3$jscomp$35.New(C3$jscomp$35.TextFragment,{chArr:C3$jscomp$35.SplitGraphemes(n.text),styles:n.styles}));this._hasParsedFragments=!0;return this._fragments}_ProcessBBCodeEscapeSequences(a){a=C3$jscomp$35.ReplaceAll(a,"\\[","[");return C3$jscomp$35.ReplaceAll(a,"\\\\","\\")}static StripTags(a){return C3$jscomp$35.New(C3$jscomp$35.BBString,a,{noEscape:!0}).toPlainText()}static StripAnyTags(a){return a.replace(CUSTOM_BBREGEX,"")}};"use strict";const C3$jscomp$36=self.C3; function IsWordBreakWhiteSpace(a){return"\u00a0"===a||"\u202f"===a?!1:C3$jscomp$36.IsWhitespaceChar(a)}function WordBreakTrimEnd(a){for(;0<a.length&&IsWordBreakWhiteSpace(a.at(-1));)a.pop()}function IsNewline(a){return"\n"===a||"\r\n"===a} C3$jscomp$36.WordWrap=class{constructor(){this._lines=[];this._iconSet=null}GetLines(){return this._lines}GetLineCount(){return this._lines.length}SetIconSet(a){this._iconSet=a}_MeasureLine(a,b){let c=0,d=0,e=0,g=0,k=0;for(const l of a)-1===l.GetWidth()&&(a=b(l),l.SetHeight(a.height),l.SetFontBoundingBoxAscent(a.fontBoundingBoxAscent||0),l.SetFontBoundingBoxDescent(a.fontBoundingBoxDescent||0),l.SetTopToAlphabeticDistance(a.topToAlphabeticDistance||0),l.IsText()?l.SetWidth(a.width):l.IsIcon()&&l.CalculateWidthFromHeight(this._iconSet)), c+=l.GetWidth(),d=Math.max(d,l.GetHeight()),e=Math.max(e,l.GetFontBoundingBoxAscent()),g=Math.max(g,l.GetFontBoundingBoxDescent()),k=Math.max(k,l.GetTopToAlphabeticDistance());return{width:c,height:d,fontBoundingBoxAscent:e,fontBoundingBoxDescent:g,topToAlphabeticDistance:k}}_AddLine(a,b,c,d,e,g){this._lines.push(C3$jscomp$36.New(C3$jscomp$36.WordWrap.Line,{fragments:a,width:b,height:c,fontBoundingBoxAscent:d,fontBoundingBoxDescent:e,topToAlphabeticDistance:g}))}WordWrap(a,b,c,d,e){"string"===typeof a&& (a=[C3$jscomp$36.New(C3$jscomp$36.TextFragment,{chArr:C3$jscomp$36.SplitGraphemes(a)})]);C3$jscomp$36.clearArray(this._lines);if(!(!a.length||1===a.length&&a[0].IsText()&&a[0].IsEmpty()||2>c)){if(1===a.length){const g=a[0];if(g.IsText()&&100>=g.GetLength()&&!g.HasNewLine()){let {width:k,height:l,fontBoundingBoxAscent:n,fontBoundingBoxDescent:p,topToAlphabeticDistance:r}=b(g);k+=e;g.SetWidth(k);g.SetHeight(l);g.SetFontBoundingBoxAscent(n||0);g.SetFontBoundingBoxDescent(p||0);g.SetTopToAlphabeticDistance(r|| 0);if(k<=c){this._AddLine([g],k,l,n,p,r);return}}}if("word"===d)d=this._TokeniseWords(a);else{d=[];for(const g of a)g.IsText()?(a=g.GetCharacterArray(),C3$jscomp$36.appendArray(d,a.map(k=>[C3$jscomp$36.New(C3$jscomp$36.TextFragment,{chArr:[k],styles:g.GetStyles()})]))):d.push([g])}this._WrapText(d,b,c,e)}}_TokeniseWords(a){const b=[];var c=[],d=!1;for(const g of a)if(a=g.GetStyles(),g.IsIcon())0<c.length&&b.push(c),b.push([g]),c=[];else for(const k of g.GetCharacterArray())if(IsNewline(k))0<c.length&& b.push(c),c=C3$jscomp$36.New(C3$jscomp$36.TextFragment,{chArr:["\n"],styles:a}),b.push([c]),c=[];else if(0===c.length)d=C3$jscomp$36.New(C3$jscomp$36.TextFragment,{chArr:[k],styles:a}),c.push(d),d=IsWordBreakWhiteSpace(k);else{var e=IsWordBreakWhiteSpace(k);e===d?(e=c.at(-1),e.GetStyles()===a?e._AppendChar(k):(e=C3$jscomp$36.New(C3$jscomp$36.TextFragment,{chArr:[k],styles:a}),c.push(e))):(b.push(c),c=[],d=C3$jscomp$36.New(C3$jscomp$36.TextFragment,{chArr:[k],styles:a}),c.push(d),d=e)}0<c.length&& b.push(c);return b}_CopyLine(a){return a.map(b=>b._Clone())}_AddWordToLine(a,b){var c=a.length?a.at(-1):null;let d=0;c&&c.IsText()&&b[0].IsText()&&b[0].GetStyles()===c.GetStyles()&&(c._Append(b[0].GetCharacterArray()),d=1);for(c=b.length;d<c;++d)a.push(b[d]._Clone())}_WrapText(a,b,c,d){let e=[],g=0;var k=0;let l=0,n=0;var p=0;for(const r of a){if(1===r.length&&r[0].IsText()&&1===r[0].GetLength()&&IsNewline(r[0].GetCharacterArray()[0])){0===k&&(k=C3$jscomp$36.New(C3$jscomp$36.TextFragment,{chArr:[" "], styles:r[0].GetStyles()}),p=b(k),k=p.height,l=p.fontBoundingBoxAscent||0,n=p.fontBoundingBoxDescent||0,p=p.topToAlphabeticDistance||0);this._AddLine(e,g,k,l,n,p);e=[];p=n=l=k=g=0;continue}a=this._CopyLine(e);this._AddWordToLine(a,r);const w=this._MeasureLine(a,b),y=w.width;y>=c?(0<e.length&&this._AddLine(e,g,k,l,n,p),e=[],r[0].IsText()&&C3$jscomp$36.IsCharArrayAllWhitespace(r[0].GetCharacterArray())?p=n=l=k=g=0:(this._AddWordToLine(e,r),p=this._MeasureLine(e,b),g=p.width,k=p.height,l=p.fontBoundingBoxAscent, n=p.fontBoundingBoxDescent,p=p.topToAlphabeticDistance)):(e=a,g=y,k=w.height,l=w.fontBoundingBoxAscent,n=w.fontBoundingBoxDescent,p=w.topToAlphabeticDistance)}0<e.length&&this._AddLine(e,g,k,l,n,p);this._TrimLinesTrailingWhitespace(b,d)}_TrimLinesTrailingWhitespace(a,b){for(const e of this._lines){const g=e._GetFragmentsArray();if(!g.length)continue;let k=g.at(-1);if(k.IsText()){var c=k.GetCharacterArray(),d=c.slice(0);WordBreakTrimEnd(d);0===d.length?(e.OffsetWidth(-k.GetWidth()),g.pop()):d.length< c.length&&(k.SetCharacterArray(d),c=a(k).width,d=k.GetWidth()-c,k.SetWidth(c),e.OffsetWidth(-d));0!==b&&0<g.length&&(k=g.at(-1),k.OffsetWidth(b),e.OffsetWidth(b))}}}Clear(){C3$jscomp$36.clearArray(this._lines)}GetMaxLineWidth(){return this._lines.reduce((a,b)=>Math.max(a,b.GetWidth()),0)}GetTotalLineHeight(){return this._lines.reduce((a,b)=>a+b.GetHeight(),0)}};"use strict"; self.C3.WordWrap.Line=class{constructor(a){this._fragments=a.fragments||[];this._width=a.width||-1;this._height=a.height||-1;this._fontBoundingBoxAscent=a.fontBoundingBoxAscent||-1;this._fontBoundingBoxDescent=a.fontBoundingBoxDescent||-1;this._topToAlphabeticDistance=a.topToAlphabeticDistance||-1;this._posY=this._posX=0}fragments(){return this._fragments.values()}_GetFragmentsArray(){return this._fragments}OffsetWidth(a){this._width+=a}GetWidth(){return this._width}GetHeight(){return this._height}GetFoundBoundingBoxAscent(){return this._fontBoundingBoxAscent}GetFontBoundingBoxDescent(){return this._fontBoundingBoxDescent}GetTopToAlphabeticDistance(){return this._topToAlphabeticDistance}SetPosX(a){this._posX= a}GetPosX(){return this._posX}SetPosY(a){this._posY=a}GetPosY(){return this._posY}};"use strict"; self.C3.FragmentBase=class{constructor(a){this._styles=a.styles||[];this._width=a.width||-1;this._height=a.height||-1;this._fontBoundingBoxAscent=a.fontBoundingBoxAscent||-1;this._fontBoundingBoxDescent=a.fontBoundingBoxDescent||-1;this._topToAlphabeticDistance=a.topToAlphabeticDistance||-1;this._posY=this._posX=0}IsText(){return!1}IsIcon(){return!1}GetStyles(){return this._styles}GetStyleTag(a){const b=this._styles;for(let c=b.length-1;0<=c;--c){const d=b[c];if(d.tag===a)return d}return null}HasStyleTag(a){return!!this.GetStyleTag(a)}GetStyleMap(){const a= new Map;for(const b of this._styles)a.set(b.tag,b.param);return a}OffsetWidth(a){this._width+=a}SetWidth(a){this._width=a}GetWidth(){return this._width}SetHeight(a){this._height=a}GetHeight(){return this._height}SetFontBoundingBoxAscent(a){this._fontBoundingBoxAscent=a}GetFontBoundingBoxAscent(){return this._fontBoundingBoxAscent}SetFontBoundingBoxDescent(a){this._fontBoundingBoxDescent=a}GetFontBoundingBoxDescent(){return this._fontBoundingBoxDescent}SetTopToAlphabeticDistance(a){this._topToAlphabeticDistance= a}GetTopToAlphabeticDistance(){return this._topToAlphabeticDistance}SetPosX(a){this._posX=a}GetPosX(){return this._posX}SetPosY(a){this._posY=a}GetPosY(){return this._posY}};"use strict";const C3$jscomp$39=self.C3; C3$jscomp$39.TextFragment=class extends C3$jscomp$39.FragmentBase{constructor(a){super(a);this._chArr=a.chArr}IsText(){return!0}_Append(a){C3$jscomp$39.appendArray(this._chArr,a);this._topToAlphabeticDistance=this._fontBoundingBoxDescent=this._fontBoundingBoxAscent=this._height=this._width=-1}_AppendChar(a){this._chArr.push(a)}_Clone(){return C3$jscomp$39.New(C3$jscomp$39.TextFragment,{chArr:this._chArr.slice(0),styles:this._styles,width:this._width,height:this._height,fontBoundingBoxAscent:this._fontBoundingBoxAscent, fontBoundingBoxDescent:this._fontBoundingBoxDescent,topToAlphabeticDistance:this._topToAlphabeticDistance})}GetCharacterArray(){return this._chArr}SetCharacterArray(a){this._chArr=a}GetLength(){return this._chArr.length}IsEmpty(){return 0===this._chArr.length}HasNewLine(){return this._chArr.includes("\n")}};"use strict";const C3$jscomp$40=self.C3; C3$jscomp$40.IconFragment=class extends C3$jscomp$40.FragmentBase{constructor(a){super(a);this._icon=a.icon}IsIcon(){return!0}GetIconParameter(){return this._icon}_Clone(){return C3$jscomp$40.New(C3$jscomp$40.IconFragment,{icon:this._icon,styles:this._styles,width:this._width,height:this._height,fontBoundingBoxAscent:this._fontBoundingBoxAscent,fontBoundingBoxDescent:this._fontBoundingBoxDescent,topToAlphabeticDistance:this._topToAlphabeticDistance})}GetTextIcon(a){if(!a)return null;let b=Number(this._icon); return String(b)===this._icon?(b=Math.floor(b),a.GetTextIconByIndex(b)):a.GetTextIconByTag(this._icon)}CalculateWidthFromHeight(a){this._width=(a=this.GetTextIcon(a))?this._height*a.GetWidth()/a.GetHeight():0}GetDrawable(a){return(a=this.GetTextIcon(a))?a.GetDrawable():null}GetLength(){return 1}};"use strict";const C3$jscomp$41=self.C3; C3$jscomp$41.TextIconManager=class{constructor(a){this._iconSets=new Map;this._getIconSetMetaCallback=a.getIconSetMeta;this._getIconSetContentCallback=a.getIconSetContent}Release(){for(const a of this._iconSets.values())a.Release();this._iconSets.clear()}GetIconSet(a){var b=this._iconSets.get(a);if(b)return b;b=this._getIconSetMetaCallback(a);b=C3$jscomp$41.New(C3$jscomp$41.TextIconSet,this,{source:a,iconMeta:b});this._iconSets.set(a,b);return b}HasIconSet(a){return this._iconSets.has(a)}DeleteIconSet(a){const b= this._iconSets.get(a);b&&b.Release();this._iconSets.delete(a)}async _GetIconSetContent(a){return await this._getIconSetContentCallback(a)}};"use strict";const C3$jscomp$42=self.C3; C3$jscomp$42.TextIconSet=class{constructor(a,b){this._textIconManager=a;this._source=b.source;this._iconsArray=[];this._iconsByTag=new Map;this._isLoading=this._hasStartedLoad=!1;this._loadPromise=null;a=b.iconMeta.icons;for(let c=0,d=a.length;c<d;++c){b=a[c];const e=C3$jscomp$42.New(C3$jscomp$42.TextIcon,this,{index:c,tag:b.tag,source:b.source,width:b.width,height:b.height});this._iconsArray.push(e);b.tag&&this._iconsByTag.set(b.tag.toLowerCase(),e)}}Release(){for(const a of this._iconsArray)a.Release(); C3$jscomp$42.clearArray(this._iconsArray);this._iconsByTag.clear();this._source=this._textIconManager=null}HasLoaded(){return this._hasStartedLoad}IsLoading(){return this._isLoading}LoadContent(){this._loadPromise||(this._loadPromise=this._DoLoadContent());return this._loadPromise}async _DoLoadContent(){if(!this._hasStartedLoad){this._isLoading=this._hasStartedLoad=!0;var a=await this._textIconManager._GetIconSetContent(this._source);if(this._textIconManager){a=a.icons;for(let b=0,c=Math.min(a.length, this._iconsArray.length);b<c;++b)this._iconsArray[b]._SetDrawable(a[b].drawable);this._isLoading=!1}}}GetTextIconByIndex(a){a=Math.floor(a);return 0>a||a>=this._iconsArray.length?null:this._iconsArray[a]}GetTextIconByTag(a){return this._iconsByTag.get(a.toLowerCase())||null}};"use strict"; self.C3.TextIcon=class{constructor(a,b){this._textIconSet=a;this._source=b.source||null;this._index=b.index;this._tag=b.tag;this._width=b.width;this._height=b.height;this._drawable=null}Release(){this._height=this._width=0;this._textIconSet=null}GetSource(){return this._source}GetWidth(){return this._width}GetHeight(){return this._height}_SetDrawable(a){this._drawable=a}GetDrawable(){return this._drawable}};"use strict"; const C3$jscomp$44=self.C3,glMatrix=self.glMatrix,vec3$jscomp$1=glMatrix.vec3,vec4$jscomp$1=glMatrix.vec4,mat4$jscomp$1=glMatrix.mat4,tempVec3a=vec3$jscomp$1.create(),tempVec3b=vec3$jscomp$1.create(),tempVec3c=vec3$jscomp$1.create(),tempVec4=vec4$jscomp$1.create(),tempMat4=mat4$jscomp$1.create(),neartl=vec3$jscomp$1.create(),neartr=vec3$jscomp$1.create(),nearbl=vec3$jscomp$1.create(),nearbr=vec3$jscomp$1.create(),fartl=vec3$jscomp$1.create(),fartr=vec3$jscomp$1.create(),farbl=vec3$jscomp$1.create(), farbr=vec3$jscomp$1.create(),unitViewport=vec4$jscomp$1.fromValues(0,0,1,1); C3$jscomp$44.Gfx={Project(a,b,c,d,e,g,k){const l=d[0]*a+d[4]*b+d[8]*c+d[12],n=d[1]*a+d[5]*b+d[9]*c+d[13],p=d[2]*a+d[6]*b+d[10]*c+d[14];d=d[3]*a+d[7]*b+d[11]*c+d[15];a=e[0]*l+e[4]*n+e[8]*p+e[12]*d;b=e[1]*l+e[5]*n+e[9]*p+e[13]*d;c=e[2]*l+e[6]*n+e[10]*p+e[14]*d;e=e[3]*l+e[7]*n+e[11]*p+e[15]*d;if(0===e)return!1;e=1/e;k[0]=(a*e*.5+.5)*g[2]+g[0];k[1]=(b*e*.5+.5)*g[3]+g[1];k[2]=.5*(1+c*e);return!0},Unproject(a,b,c,d,e,g,k){mat4$jscomp$1.multiply(tempMat4,e,d);if(null===mat4$jscomp$1.invert(tempMat4,tempMat4))return!1; tempVec4[0]=(a-g[0])/g[2]*2-1;tempVec4[1]=(b-g[1])/g[3]*2-1;tempVec4[2]=2*c-1;tempVec4[3]=1;vec4$jscomp$1.transformMat4(tempVec4,tempVec4,tempMat4);if(0===tempVec4[3])return!1;tempVec4[3]=1/tempVec4[3];k[0]=tempVec4[0]*tempVec4[3];k[1]=tempVec4[1]*tempVec4[3];k[2]=tempVec4[2]*tempVec4[3];return!0},UnprojectScreenToWorldZ(a,b,c,d,e,g,k){if(!C3$jscomp$44.Gfx.Unproject(a,b,0,d,e,g,tempVec3a)||!C3$jscomp$44.Gfx.Unproject(a,b,1,d,e,g,tempVec3b))return!1;vec3$jscomp$1.subtract(tempVec3b,tempVec3b,tempVec3a); vec3$jscomp$1.set(tempVec3c,0,0,1);a=-c;b=vec3$jscomp$1.dot(tempVec3c,tempVec3b);c=0;if(0===b){if(0!==vec3$jscomp$1.dot(tempVec3c,tempVec3a)+a)return!1}else if(c=-(vec3$jscomp$1.dot(tempVec3a,tempVec3c)+a)/b,0>c)return!1;vec3$jscomp$1.scaleAndAdd(k,tempVec3a,tempVec3b,c);return!0}}; function PlaneFromPoints(a,b,c,d){vec3$jscomp$1.subtract(tempVec3a,c,b);vec3$jscomp$1.subtract(tempVec3b,a,b);vec3$jscomp$1.cross(tempVec3c,tempVec3a,tempVec3b);vec3$jscomp$1.normalize(tempVec3c,tempVec3c);d.set(tempVec3c[0],tempVec3c[1],tempVec3c[2],vec3$jscomp$1.dot(a,tempVec3c))}function IsInFrontOfPlane(a,b,c,d,e,g,k){const l=k.x,n=k.y,p=k.z,r=k.w,w=k.xF,y=k.yF;k=k.zF;const B=1-w,C=1-y,E=1-k;return l*a*w+l*d*B+n*b*y+n*e*C+p*c*k+p*g*E>=r?!0:l*d*w+l*a*B+n*e*y+n*b*C+p*g*k+p*c*E>r} function IsPointInFrontOfPlane(a,b,c,d){return d.x*a+d.y*b+d.z*c>=d.w}class Plane{constructor(){this.zF=this.yF=this.xF=this.w=this.z=this.y=this.x=NaN}set(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;this.xF=0<a?1:0;this.yF=0<b?1:0;this.zF=0<c?1:0}} C3$jscomp$44.Gfx.ViewFrustum=class{constructor(){this._leftP=new Plane;this._topP=new Plane;this._rightP=new Plane;this._bottomP=new Plane;this._nearP=new Plane;this._farP=new Plane}CalculatePlanes(a,b){C3$jscomp$44.Gfx.Unproject(0,1,0,a,b,unitViewport,neartl);C3$jscomp$44.Gfx.Unproject(1,1,0,a,b,unitViewport,neartr);C3$jscomp$44.Gfx.Unproject(0,0,0,a,b,unitViewport,nearbl);C3$jscomp$44.Gfx.Unproject(1,0,0,a,b,unitViewport,nearbr);C3$jscomp$44.Gfx.Unproject(0,1,1,a,b,unitViewport,fartl);C3$jscomp$44.Gfx.Unproject(1, 1,1,a,b,unitViewport,fartr);C3$jscomp$44.Gfx.Unproject(0,0,1,a,b,unitViewport,farbl);C3$jscomp$44.Gfx.Unproject(1,0,1,a,b,unitViewport,farbr);PlaneFromPoints(nearbl,neartl,fartl,this._leftP);PlaneFromPoints(neartl,neartr,fartr,this._topP);PlaneFromPoints(neartr,nearbr,farbr,this._rightP);PlaneFromPoints(nearbr,nearbl,farbl,this._bottomP);PlaneFromPoints(farbl,fartl,fartr,this._farP);PlaneFromPoints(nearbr,neartr,neartl,this._nearP)}ContainsAABB(a,b,c,d,e,g){return IsInFrontOfPlane(a,b,c,d,e,g,this._leftP)&& IsInFrontOfPlane(a,b,c,d,e,g,this._topP)&&IsInFrontOfPlane(a,b,c,d,e,g,this._rightP)&&IsInFrontOfPlane(a,b,c,d,e,g,this._bottomP)&&IsInFrontOfPlane(a,b,c,d,e,g,this._nearP)&&IsInFrontOfPlane(a,b,c,d,e,g,this._farP)}IsBehindNearPlane(a,b,c){return!IsPointInFrontOfPlane(a,b,c,this._nearP)}};"use strict"; const C3$jscomp$45=self.C3,glMatrix$jscomp$1=self.glMatrix,vec3$jscomp$2=glMatrix$jscomp$1.vec3,vec4$jscomp$2=glMatrix$jscomp$1.vec4,mat4$jscomp$2=glMatrix$jscomp$1.mat4,tempMat4$jscomp$1=mat4$jscomp$2.create(),tmpVec3a=vec3$jscomp$2.fromValues(0,0,0),tmpVec3b=vec3$jscomp$2.fromValues(0,0,0),tmpVec3c=vec3$jscomp$2.fromValues(0,0,0),defaultUpVector=vec3$jscomp$2.fromValues(0,1,0);vec4$jscomp$2.fromValues(0,0,0,0); const tmpQuad=new C3$jscomp$45.Quad,tmpRect=new C3$jscomp$45.Rect,defaultTexCoordsQuad=new C3$jscomp$45.Quad(0,0,1,0,1,1,0,1),DEFAULT_RENDERERBASE_OPTS={nearZ:1,farZ:1E4}; C3$jscomp$45.Gfx.RendererBase=class{constructor(a){a=Object.assign({},DEFAULT_RENDERERBASE_OPTS,a);this._height=this._width=0;this._fovY=C3$jscomp$45.toRadians(45);this._tan_fovY_2=Math.tan(this._fovY/2);this._matP=mat4$jscomp$2.create();this._matMV=mat4$jscomp$2.create();this._zAxisScale=!1;this._nearZ=a.nearZ;this._farZ=a.farZ;this._allShaderPrograms=[];this._shaderProgramsByName=new Map;this._spSmoothLineFill=this._spSmoothEllipseOutline=this._spSmoothEllipseFill=this._spHardEllipseOutline=this._spHardEllipseFill= this._spPenumbraFill=this._spLinearGradientFill=this._spColorFill=this._spTileRandomization=this._spTilemapFill=this._spPoints=this._spTextureFill=null;this._stateGroups=new Map;this._currentStateGroup=null;this._blendModeTable=[];this._namedBlendModeMap=new Map;this._currentZ=this._baseZ=0;this._lineWidth=1;this._lineWidthStack=[this._lineWidth];this._lineCap=1;this._lineCapStack=[this._lineCap];this._lineOffset=.5;this._lineOffsetStack=[this._lineOffset];this._frameNumber=0;this._enableMipmaps= !0;this._hasMajorPerformanceCaveat=!1}FillIndexBufferData(a){let b=0,c=a.length,d=0;for(;b<c;)a[b++]=d,a[b++]=d+1,a[b++]=d+2,a[b++]=d,a[b++]=d+2,a[b++]=d+3,d+=4}_ClearState(){this._currentZ=this._baseZ=0;this._spSmoothLineFill=this._spSmoothEllipseOutline=this._spSmoothEllipseFill=this._spHardEllipseOutline=this._spHardEllipseFill=this._spPenumbraFill=this._spLinearGradientFill=this._spColorFill=this._spTileRandomization=this._spTilemapFill=this._spPoints=this._spTextureFill=null;this._ClearAllShaderPrograms()}InitState(){this._ClearState(); this._currentStateGroup=null}OnDeviceOrContextLost(){for(const a of this._allShaderPrograms)a.Release();this._ClearState()}GetWidth(){return this._width}GetHeight(){return this._height}GetDefaultCameraZ(a){return this.IsZAxisScaleNormalized()?100:a/(2*this._GetTanFovYDiv2())}GetZAxisScaleFactor(a){return this.IsZAxisScaleNormalized()?a/(2*this._GetTanFovYDiv2())/this.GetDefaultCameraZ(a):1}SetNearZ(a){this._nearZ=a}GetNearZ(){return this._nearZ}SetFarZ(a){this._farZ=a}GetFarZ(){return this._farZ}SetFovY(a){this._fovY= a;this._tan_fovY_2=Math.tan(this._fovY/2)}GetFovY(){return this._fovY}_GetTanFovYDiv2(){return this._tan_fovY_2}SetZAxisScaleNormalized(){this._zAxisScale=!1}SetZAxisScaleRegular(){this._zAxisScale=!0}IsZAxisScaleNormalized(){return!this._zAxisScale}IsZAxisScaleRegular(){return this._zAxisScale}CalculatePerspectiveMatrix(a,b,c=.5,d=.5){const e=this.GetNearZ(),g=this.GetFarZ();var k=this.GetFovY();if(.5===c&&.5===d)this.IsWebGPU()?mat4$jscomp$2.perspectiveZO(a,k,b,e,g):mat4$jscomp$2.perspective(a, k,b,e,g);else{c=1-c;k=2*c-2;c*=2;const l=2*d-2;d*=2;const n=this._GetTanFovYDiv2()*e;b*=n;mat4$jscomp$2.frustum(a,k*b,c*b,l*n,d*n,e,g)}}CalculateOrthographicMatrix(a,b,c,d=1){var e=self.devicePixelRatio;const g=2*this.GetDefaultCameraZ(c)*e*this._GetTanFovYDiv2()/c;b=b*g/(2*e*d);c=c*g/(2*e*d);d=-b;e=-c;this.IsWebGPU()?mat4$jscomp$2.orthoZO(a,d,b,e,c,this.GetNearZ(),this.GetFarZ()):mat4$jscomp$2.ortho(a,d,b,e,c,this.GetNearZ(),this.GetFarZ())}CalculateLookAtModelView(a,b,c,d,e,g=1){let k=1;this.IsZAxisScaleNormalized()&& (k=200*this._GetTanFovYDiv2()/e);vec3$jscomp$2.set(tmpVec3c,k,-k,1);vec3$jscomp$2.multiply(tmpVec3a,b,tmpVec3c);vec3$jscomp$2.multiply(tmpVec3b,c,tmpVec3c);mat4$jscomp$2.lookAt(a,tmpVec3a,tmpVec3b,d||defaultUpVector);tmpVec3c[2]=g;mat4$jscomp$2.scale(a,a,tmpVec3c)}CalculateLookAtModelView2(a,b,c,d,e,g,k,l){vec3$jscomp$2.set(tmpVec3a,a,b,c);vec3$jscomp$2.set(tmpVec3b,d,e,g);this.CalculateLookAtModelView(tempMat4$jscomp$1,tmpVec3a,tmpVec3b,defaultUpVector,k,l);return tempMat4$jscomp$1}_AddShaderProgram(a){this._allShaderPrograms.push(a); this._shaderProgramsByName.set(a.GetName(),a)}_RemoveShaderProgram(a){const b=this._allShaderPrograms.indexOf(a);-1!==b&&this._allShaderPrograms.splice(b,1);this._shaderProgramsByName.delete(a.GetName())}_ClearAllShaderPrograms(){C3$jscomp$45.clearArray(this._allShaderPrograms);this._shaderProgramsByName.clear()}GetShaderProgramByName(a){return this._shaderProgramsByName.get(a)||null}GetTextureFillShaderProgram(){return this._spTextureFill}SetTextureFillMode(){this.SetProgram(this._spTextureFill)}GetPointsRenderingProgram(){return this._spPoints}SetPointsRenderingProgram(){this.SetProgram(this._spPoints)}SetTilemapFillMode(){this.SetProgram(this._spTilemapFill)}SetTileRandomizationMode(){this.SetProgram(this._spTileRandomization)}SetColorFillMode(){this.SetProgram(this._spColorFill)}SetLinearGradientFillMode(){this.SetProgram(this._spLinearGradientFill)}SetPenumbraFillMode(){this.SetProgram(this._spPenumbraFill)}SetHardEllipseFillMode(){this.SetProgram(this._spHardEllipseFill)}SetHardEllipseOutlineMode(){this.SetProgram(this._spHardEllipseOutline)}SetSmoothEllipseFillMode(){this.SetProgram(this._spSmoothEllipseFill)}SetSmoothEllipseOutlineMode(){this.SetProgram(this._spSmoothEllipseOutline)}SetSmoothLineFillMode(){this.SetProgram(this._spSmoothLineFill)}_SetCurrentStateGroup(a){this._currentStateGroup= a}GetCurrentStateGroup(){return this._currentStateGroup}AcquireStateGroup(a,b,c,d){const e=C3$jscomp$45.Gfx.StateGroup.MakeKey(a,b,c,d);let g=this._stateGroups.get(e);g||(g=C3$jscomp$45.New(C3$jscomp$45.Gfx.StateGroup,this,a,b,c,d),this._stateGroups.set(e,g));g.AddRef();return g}ReleaseStateGroup(a){a.DecRef();0===a._GetRefCount()&&(this._currentStateGroup===a&&(this._currentStateGroup=null),this._stateGroups.delete(a.GetKey()),a.Release())}_InitBlendModeData(a){C3$jscomp$45.clearArray(this._blendModeTable); this._namedBlendModeMap.clear();let b=0;for(const c of a){a=c[0];const d=c[1],e=c[2];this._blendModeTable.push([d,e]);this._namedBlendModeMap.set(a,{number:b,srcBlend:d,destBlend:e});b++}}_GetBlendByIndex(a){return this._blendModeTable[a]}GetSrcBlendByIndex(a){return this._GetBlendByIndex(a)[0]}GetDestBlendByIndex(a){return this._GetBlendByIndex(a)[1]}GetNamedBlend(a){a=this._namedBlendModeMap.get(a);if("undefined"===typeof a)throw Error("invalid blend name");return a}NamedBlendToNumber(a){a=this._namedBlendModeMap.get(a); if("undefined"===typeof a)throw Error("invalid blend name");return a.number}SetBaseZ(a){this._baseZ=a}GetBaseZ(){return this._baseZ}SetCurrentZ(a){this._currentZ=a;this._currentStateGroup=null}GetCurrentZ(){return this._currentZ}Line(a,b,c,d){var e=C3$jscomp$45.angleTo(a,b,c,d),g=.5*this._lineWidth;const k=Math.sin(e)*g;e=Math.cos(e)*g;g=this._lineCap;2===g?this.LinePreCalc_LineCap2(a,b,0,c,d,0,k,e):1===g?this.LinePreCalc_LineCap1(a,b,0,c,d,0,k,e):this.LinePreCalc_LineCap0(a,b,0,c,d,0,k,e)}Line3D(a, b,c,d,e,g){var k=C3$jscomp$45.angleTo(a,b,d,e),l=.5*this._lineWidth;const n=Math.sin(k)*l;k=Math.cos(k)*l;l=this._lineCap;2===l?this.LinePreCalc_LineCap2(a,b,c,d,e,g,n,k):1===l?this.LinePreCalc_LineCap1(a,b,c,d,e,g,n,k):this.LinePreCalc_LineCap0(a,b,c,d,e,g,n,k)}LinePreCalc_LineCap2(a,b,c,d,e,g,k,l){var n=this._lineOffset;a=a+n-l;b=b+n-k;d=d+n+l;e=e+n+k;n=2*l;const p=2*k;this.Quad3D2(a+k,b-l,c,d+k,e-l,g,d-k-n,e+l-p,g,a-k+n,b+l+p,c,defaultTexCoordsQuad)}LinePreCalc_LineCap1(a,b,c,d,e,g,k,l){const n= this._lineOffset;a=a+n-l;b=b+n-k;d=d+n+l;e=e+n+k;this.Quad3D2(a+k,b-l,c,d+k,e-l,g,d-k,e+l,g,a-k,b+l,c,defaultTexCoordsQuad)}LinePreCalc_LineCap0(a,b,c,d,e,g,k,l){const n=this._lineOffset;a+=n;b+=n;d+=n;e+=n;this.Quad3D2(a+k,b-l,c,d+k,e-l,g,d-k,e+l,g,a-k,b+l,c,defaultTexCoordsQuad)}TexturedLine(a,b,c,d,e,g){var k=C3$jscomp$45.angleTo(a,b,c,d),l=.5*this._lineWidth;const n=Math.sin(k)*l;k=Math.cos(k)*l;l=this._lineCap;2===l?this.TexturedLinePreCalc_LineCap2(a,b,c,d,n,k,e,g):1===l?this.TexturedLinePreCalc_LineCap1(a, b,c,d,n,k,e,g):this.TexturedLinePreCalc_LineCap0(a,b,c,d,n,k,e,g)}TexturedLinePreCalc_LineCap2(a,b,c,d,e,g,k,l){var n=this._lineOffset;a=a+n-g;b=b+n-e;c=c+n+g;d=d+n+e;n=2*g;const p=2*e;tmpQuad.set(a+e,b-g,c+e,d-g,c-e-n,d+g-p,a-e+n,b+g+p);tmpRect.set(k,0,l,0);this.Quad3(tmpQuad,tmpRect)}TexturedLinePreCalc_LineCap1(a,b,c,d,e,g,k,l){const n=this._lineOffset;a=a+n-g;b=b+n-e;c=c+n+g;d=d+n+e;tmpQuad.set(a+e,b-g,c+e,d-g,c-e,d+g,a-e,b+g);tmpRect.set(k,0,l,0);this.Quad3(tmpQuad,tmpRect)}TexturedLinePreCalc_LineCap0(a, b,c,d,e,g,k,l){const n=this._lineOffset;a+=n;b+=n;c+=n;d+=n;tmpQuad.set(a+e,b-g,c+e,d-g,c-e,d+g,a-e,b+g);tmpRect.set(k,0,l,0);this.Quad3(tmpQuad,tmpRect)}LineRect(a,b,c,d){const e=.5*this._lineWidth,g=this._lineCap;2===g?this._LineRectPreCalc_LineCap2(a,b,c,d,e):1===g?this._LineRectPreCalc_LineCap1(a,b,c,d,e):this._LineRectPreCalc_LineCap0(a,b,c,d,e)}_LineRectPreCalc_LineCap2(a,b,c,d,e){this.LinePreCalc_LineCap2(a,b,0,c,b,0,0,e);this.LinePreCalc_LineCap2(c,b,0,c,d,0,e,0);this.LinePreCalc_LineCap2(c, d,0,a,d,0,0,-e);this.LinePreCalc_LineCap2(a,d,0,a,b,0,-e,0)}_LineRectPreCalc_LineCap1(a,b,c,d,e){this.LinePreCalc_LineCap1(a,b,0,c,b,0,0,e);this.LinePreCalc_LineCap1(c,b,0,c,d,0,e,0);this.LinePreCalc_LineCap1(c,d,0,a,d,0,0,-e);this.LinePreCalc_LineCap1(a,d,0,a,b,0,-e,0)}_LineRectPreCalc_LineCap0(a,b,c,d,e){this.LinePreCalc_LineCap0(a,b,0,c,b,0,0,e);this.LinePreCalc_LineCap0(c,b,0,c,d,0,e,0);this.LinePreCalc_LineCap0(c,d,0,a,d,0,0,-e);this.LinePreCalc_LineCap0(a,d,0,a,b,0,-e,0)}LineRect2(a){this.LineRect(a.getLeft(), a.getTop(),a.getRight(),a.getBottom())}LineQuad(a){var b=C3$jscomp$45.angleTo(a.getTlx(),a.getTly(),a.getTrx(),a.getTry()),c=.5*this._lineWidth;const d=Math.sin(b)*c;b=Math.cos(b)*c;c=this._lineCap;2===c?this._LineQuadPreCalc_LineCap2(a,d,b):1===c?this._LineQuadPreCalc_LineCap1(a,d,b):this._LineQuadPreCalc_LineCap0(a,d,b)}_LineQuadPreCalc_LineCap2(a,b,c){this.LinePreCalc_LineCap2(a.getTlx(),a.getTly(),0,a.getTrx(),a.getTry(),0,b,c);this.LinePreCalc_LineCap2(a.getTrx(),a.getTry(),0,a.getBrx(),a.getBry(), 0,c,-b);this.LinePreCalc_LineCap2(a.getBrx(),a.getBry(),0,a.getBlx(),a.getBly(),0,-b,-c);this.LinePreCalc_LineCap2(a.getBlx(),a.getBly(),0,a.getTlx(),a.getTly(),0,-c,b)}_LineQuadPreCalc_LineCap1(a,b,c){this.LinePreCalc_LineCap1(a.getTlx(),a.getTly(),0,a.getTrx(),a.getTry(),0,b,c);this.LinePreCalc_LineCap1(a.getTrx(),a.getTry(),0,a.getBrx(),a.getBry(),0,c,-b);this.LinePreCalc_LineCap1(a.getBrx(),a.getBry(),0,a.getBlx(),a.getBly(),0,-b,-c);this.LinePreCalc_LineCap1(a.getBlx(),a.getBly(),0,a.getTlx(), a.getTly(),0,-c,b)}_LineQuadPreCalc_LineCap0(a,b,c){this.LinePreCalc_LineCap0(a.getTlx(),a.getTly(),0,a.getTrx(),a.getTry(),0,b,c);this.LinePreCalc_LineCap0(a.getTrx(),a.getTry(),0,a.getBrx(),a.getBry(),0,c,-b);this.LinePreCalc_LineCap0(a.getBrx(),a.getBry(),0,a.getBlx(),a.getBly(),0,-b,-c);this.LinePreCalc_LineCap0(a.getBlx(),a.getBly(),0,a.getTlx(),a.getTly(),0,-c,b)}SetLineWidth(a){this._lineWidth=a;this._lineWidthStack[this._lineWidthStack.length-1]=a}GetLineWidth(){return this._lineWidth}PushLineWidth(a){if(100<= this._lineWidthStack.length)throw Error("pushed too many line widths - check push/pop pairs");this._lineWidthStack.push(a);this._lineWidth=a}PopLineWidth(){if(1>=this._lineWidthStack.length)throw Error("cannot pop last line width - check push/pop pairs");this._lineWidthStack.pop();this._lineWidth=this._lineWidthStack.at(-1)}SetLineCapButt(){this._lineCap=0;this._lineCapStack[this._lineCapStack.length-1]=0}SetLineCapSquare(){this._lineCap=1;this._lineCapStack[this._lineCapStack.length-1]=0}SetLineCapZag(){this._lineCap= 2;this._lineCapStack[this._lineCapStack.length-1]=0}PushLineCap(a){if("butt"===a)this.PushLineCapButt();else if("square"===a)this.PushLineCapSquare();else if("zag"===a)this.PushLineCapZag();else throw Error("invalid line cap");}PushLineCapButt(){if(100<=this._lineCapStack.length)throw Error("pushed too many line caps - check push/pop pairs");this._lineCapStack.push(0);this._lineCap=0}PushLineCapSquare(){if(100<=this._lineCapStack.length)throw Error("pushed too many line caps - check push/pop pairs"); this._lineCapStack.push(1);this._lineCap=1}PushLineCapZag(){if(100<=this._lineCapStack.length)throw Error("pushed too many line caps - check push/pop pairs");this._lineCapStack.push(2);this._lineCap=2}PopLineCap(){if(1>=this._lineCapStack.length)throw Error("cannot pop last line cap - check push/pop pairs");this._lineCapStack.pop();this._lineCap=this._lineCapStack.at(-1)}SetLineOffset(a){this._lineOffset=a;this._lineOffsetStack[this._lineOffsetStack.length-1]=a}GetLineOffset(){return this._lineOffset}PushLineOffset(a){if(100<= this._lineOffsetStack.length)throw Error("pushed too many line offsets - check push/pop pairs");this._lineOffsetStack.push(a);this._lineOffset=a}PopLineOffset(){if(1>=this._lineOffsetStack.length)throw Error("cannot pop last line offset - check push/pop pairs");this._lineOffsetStack.pop();this._lineOffset=this._lineOffsetStack.at(-1)}ConvexPoly(a){var b=a.length/2;if(3>b)throw Error("need at least 3 points");b-=2;const c=b-1,d=a[0],e=a[1];for(let g=0;g<b;g+=2){const k=2*g,l=a[k+2],n=a[k+3],p=a[k+ 4],r=a[k+5];g===c?this.Quad2(d,e,l,n,p,r,p,r):this.Quad2(d,e,l,n,p,r,a[k+6],a[k+7])}}GetNumVertexComponents(){return 3}Finish(){this.EndBatch(!0);this._frameNumber++}GetFrameNumber(){return this._frameNumber}IncrementFrameNumber(){this._frameNumber++}SetMipmapsEnabled(a){this._enableMipmaps=!!a}AreMipmapsEnabled(){return this._enableMipmaps}SetHasMajorPerformanceCaveat(a){this._hasMajorPerformanceCaveat=!!a}HasMajorPerformanceCaveat(){return this._hasMajorPerformanceCaveat}IsWebGL(){return!1}IsWebGPU(){return!1}}; "use strict"; self.C3.Gfx.ShaderProgramBase=class{constructor(a,b){this._name=b.name;this._renderer=a;this._extendBoxHorizontal=b.extendBoxHorizontal||0;this._extendBoxVertical=b.extendBoxVertical||0;this._crossSampling=!!b.crossSampling;this._mustPreDraw=!!b.mustPreDraw;this._preservesOpaqueness=!!b.preservesOpaqueness;this._animated=!!b.animated;this._blendsBackground=!!b.blendsBackground;this._usesDepth=!!b.usesDepth;this._usesAnySrcRectOrPixelSize=!1;this._needsPostDrawOrExtendBox=this._crossSampling||this._blendsBackground|| 0!==this._extendBoxHorizontal||0!==this._extendBoxVertical}Release(){this._renderer=null}GetRenderer(){return this._renderer}GetName(){return this._name}ExtendsBox(){return 0!==this._extendBoxHorizontal||0!==this._extendBoxVertical}GetBoxExtendHorizontal(){return this._extendBoxHorizontal}GetBoxExtendVertical(){return this._extendBoxVertical}UsesCrossSampling(){return this._crossSampling}MustPreDraw(){return this._mustPreDraw}PreservesOpaqueness(){return this._preservesOpaqueness}IsAnimated(){return this._animated}BlendsBackground(){return this._blendsBackground}UsesDepth(){return this._usesDepth}UsesAnySrcRectOrPixelSize(){return this._usesAnySrcRectOrPixelSize}NeedsPostDrawOrExtendsBox(){return this._needsPostDrawOrExtendBox}UsesIsSrcTexRotated(){return!1}}; "use strict";const C3$jscomp$47=self.C3; C3$jscomp$47.Gfx.StateGroup=class{constructor(a,b,c,d,e){this._renderer=a;this._refCount=0;this._shaderProgram=null;this._shaderProgramName="";this._blendMode=c;this._color=C3$jscomp$47.New(C3$jscomp$47.Color);this._color.set(d);this._zElevation=e;"string"===typeof b?this._shaderProgramName=b:(this._shaderProgram=b,this._shaderProgramName=this._shaderProgram.GetName())}Release(){if(0<this._refCount)throw Error("releasing state group still in use");this._shaderProgram=this._renderer=null;this._shaderProgramName= ""}Apply(){const a=this._renderer;a.SetProgram(this._shaderProgram);a.SetBlendMode(this._blendMode);a.SetColor(this._color);a.SetCurrentZ(this._zElevation);a._SetCurrentStateGroup(this)}GetKey(){return C3$jscomp$47.Gfx.StateGroup.MakeKey(this._shaderProgramName,this._blendMode,this._color,this._zElevation)}AddRef(){++this._refCount}DecRef(){--this._refCount}_GetRefCount(){return this._refCount}OnContextLost(){this._shaderProgram=null}OnContextRestored(a){this._shaderProgram=a.GetShaderProgramByName(this._shaderProgramName); if(!this._shaderProgram)throw Error("failed to restore shader program");}static MakeKey(a,b,c,d){return("string"===typeof a?a:a.GetName())+","+b+","+c.getR()+","+c.getG()+","+c.getB()+","+c.getA()+","+d}};"use strict";const C3$jscomp$48=self.C3,tempQuadTex=C3$jscomp$48.New(C3$jscomp$48.Quad);function interpolateQuad(a,b,c){const d=c.getTlx(),e=c.getTly(),g=c.getTrx()-d,k=c.getTry()-e,l=c.getBlx()-d;c=c.getBly()-e;return[d+g*a+l*b,e+k*a+c*b]} C3$jscomp$48.Gfx.MeshPoint=class{constructor(a,b,c){this._mesh=a;this._col=b;this._row=c;this._v=this._u=this._zElevation=this._y=this._x=0}_Init(a,b,c,d){this._x=a;this._y=b;this._u=c;this._v=d}GetX(){return this._x}SetX(a){this._x!==a&&(this._x=a,this._mesh._SetPointsChanged())}GetY(){return this._y}SetY(a){this._y!==a&&(this._y=a,this._mesh._SetPointsChanged())}GetZElevation(){return this._zElevation}SetZElevation(a){this._zElevation!==a&&(this._zElevation=Math.max(a,0),this._mesh._SetPointsChanged())}GetU(){return this._u}SetU(a){this._u= a}GetV(){return this._v}SetV(a){this._v=a}_Interpolate_TexRect(a,b,c){[this._x,this._y]=interpolateQuad(a._x,a._y,b);this._zElevation=a._zElevation;this._u=C3$jscomp$48.lerp(c.getLeft(),c.getRight(),a._u);this._v=C3$jscomp$48.lerp(c.getTop(),c.getBottom(),a._v)}_Interpolate_TexQuad(a,b,c){[this._x,this._y]=interpolateQuad(a._x,a._y,b);this._zElevation=a._zElevation;[this._u,this._v]=interpolateQuad(a._u,a._v,c)}SaveToJson(){return{x:this.GetX(),y:this.GetY(),z:this.GetZElevation(),u:this.GetU(),v:this.GetV()}}LoadFromJson(a){this.SetX(a.x); this.SetY(a.y);a.hasOwnProperty("z")&&this.SetZElevation(a.z);this.SetU(a.u);this.SetV(a.v)}GetMesh(){return this._mesh}GetColumn(){return this._col}GetRow(){return this._row}}; C3$jscomp$48.Gfx.Mesh=class{constructor(a,b,c){if(2>a||2>b)throw Error("invalid mesh size");this._hsize=a;this._vsize=b;this._owner=c||null;this._pts=[];this._minY=this._minX=0;this._maxY=this._maxX=1;this._maxZ=0;this._pointsChanged=!1;c=a-1;const d=b-1;for(let e=0;e<b;++e){const g=[];for(let k=0;k<a;++k){const l=C3$jscomp$48.New(C3$jscomp$48.Gfx.MeshPoint,this,k,e),n=k/c,p=e/d;l._Init(n,p,n,p);g.push(l)}this._pts.push(g)}}Release(){C3$jscomp$48.clearArray(this._pts)}GetHSize(){return this._hsize}GetVSize(){return this._vsize}GetOwner(){return this._owner}_GetPoints(){return this._pts}_SetPointsChanged(){this._pointsChanged= !0}_MaybeComputeBounds(){if(this._pointsChanged){var a=Infinity,b=Infinity,c=-Infinity,d=-Infinity,e=0;for(const g of this._pts)for(const k of g){const l=k.GetX(),n=k.GetY();a=Math.min(a,l);b=Math.min(b,n);c=Math.max(c,l);d=Math.max(d,n);e=Math.max(e,k.GetZElevation())}this._minX=a;this._minY=b;this._maxX=c;this._maxY=d;this._maxZ=e;this._pointsChanged=!1}}GetMinX(){this._MaybeComputeBounds();return this._minX}GetMinY(){this._MaybeComputeBounds();return this._minY}GetMaxX(){this._MaybeComputeBounds(); return this._maxX}GetMaxY(){this._MaybeComputeBounds();return this._maxY}GetMaxZ(){this._MaybeComputeBounds();return this._maxZ}HasAnyZElevation(){return 0<this.GetMaxZ()}GetMeshPointAt(a,b){a=Math.floor(a);b=Math.floor(b);return 0>a||a>=this._hsize||0>b||b>=this._vsize?null:this._pts[b][a]}CalculateTransformedMesh(a,b,c){const d=c instanceof C3$jscomp$48.Rect;if(a.GetHSize()!==this.GetHSize()||a.GetVSize()!==this.GetVSize())throw Error("source mesh wrong size");a=a._pts;const e=this._pts;for(let g= 0,k=e.length;g<k;++g){const l=a[g],n=e[g];for(let p=0,r=n.length;p<r;++p){const w=l[p],y=n[p];d?y._Interpolate_TexRect(w,b,c):y._Interpolate_TexQuad(w,b,c)}}}Draw(a){const b=this._pts;let c=b[0];for(let d=1,e=b.length;d<e;++d){const g=b[d];let k=c[0],l=g[0];for(let n=1,p=g.length;n<p;++n){const r=c[n],w=g[n];tempQuadTex.set(k.GetU(),k.GetV(),r.GetU(),r.GetV(),w.GetU(),w.GetV(),l.GetU(),l.GetV());a.Quad3D2(k.GetX(),k.GetY(),k.GetZElevation(),r.GetX(),r.GetY(),r.GetZElevation(),w.GetX(),w.GetY(),w.GetZElevation(), l.GetX(),l.GetY(),l.GetZElevation(),tempQuadTex);k=r;l=w}c=g}}Outline(a,b){b||(b=(e,g,k)=>[e,g,k]);const c=this._pts;let d=c[0];for(let e=1,g=c.length;e<g;++e){const k=c[e];let l=d[0],n=k[0];for(let p=1,r=k.length;p<r;++p){const w=d[p],y=k[p],[B,C,E]=b(l.GetX(),l.GetY(),l.GetZElevation()),[F,J,L]=b(w.GetX(),w.GetY(),w.GetZElevation()),[O,V,W]=b(y.GetX(),y.GetY(),y.GetZElevation()),[ca,la,ma]=b(n.GetX(),n.GetY(),n.GetZElevation());a.Line3D(B,C,E,F,J,L);a.Line3D(B,C,E,O,V,W);a.Line3D(B,C,E,ca,la,ma); p===r-1&&a.Line3D(F,J,L,O,V,W);e===g-1&&a.Line3D(ca,la,ma,O,V,W);l=w;n=y}d=k}}InsertPolyMeshVertices(a){a=a.pointsArr();const b=[],c=this.GetHSize()-1,d=this.GetVSize()-1,e=1/c,g=1/d,k=c-1,l=d-1;let n=a[0],p=a[1],r=C3$jscomp$48.clamp(Math.floor(n*c),0,k),w=C3$jscomp$48.clamp(Math.floor(p*d),0,l),y=0,B=0,C=0;var E=-1;const F=()=>{n=C3$jscomp$48.clamp(C3$jscomp$48.lerp(n,y,C),0,1);p=C3$jscomp$48.clamp(C3$jscomp$48.lerp(p,B,C),0,1);b.push(n,p)};for(let J=0,L=a.length;J<L;J+=2)for(n=a[J],p=a[J+1],b.push(n, p),r=C3$jscomp$48.clamp(Math.floor(n*c),0,k),w=C3$jscomp$48.clamp(Math.floor(p*d),0,l),E=(J+2)%L,y=a[E],B=a[E+1],E=-1;;){if(1E6<b.length)throw Error("Too many mesh poly points");const O=r*e,V=w*g,W=(r+1)*e,ca=(w+1)*g;C3$jscomp$48.isPointInTriangleInclusive(n,p,O,V,W,V,W,ca);if(0!==E&&(C=C3$jscomp$48.rayIntersectExtended(n,p,y,B,O,V,W,ca,-.001),0<=C&&.99999999>=C)){F();E=0;continue}if(0<w&&2!==E&&(C=C3$jscomp$48.rayIntersectExtended(n,p,y,B,O,V,W,V,.001),0<=C&&.99999999>=C)){F();w--;E=4;continue}if(r< k&&3!==E&&(C=C3$jscomp$48.rayIntersectExtended(n,p,y,B,W,V,W,ca,.001),0<=C&&.99999999>=C)){F();r++;E=1;continue}if(0<r&&1!==E&&(C=C3$jscomp$48.rayIntersectExtended(n,p,y,B,O,V,O,ca,.001),0<=C&&.99999999>=C)){F();r--;E=3;continue}if(w<l&&4!==E&&(C=C3$jscomp$48.rayIntersectExtended(n,p,y,B,O,ca,W,ca,.001),0<=C&&.99999999>=C)){F();w++;E=2;continue}break}return C3$jscomp$48.New(C3$jscomp$48.CollisionPoly,b)}TransformCollisionPoly(a,b){a=this._TransformPolyPoints(a);this._SimplifyPoly(a);b.setPoints(a)}_TransformPolyPoints(a){const b= [];a=a.pointsArr();for(let c=0,d=a.length;c<d;c+=2){const [e,g]=this.TransformPoint(a[c],a[c+1]);b.push(e,g)}return b}TransformPoint(a,b){var c=this.GetHSize()-1,d=this.GetVSize()-1,e=1/c,g=1/d;c=C3$jscomp$48.clamp(Math.floor(a*c),0,c-1);const k=C3$jscomp$48.clamp(Math.floor(b*d),0,d-1);d=c*e;const l=k*g,n=(c+1)*e,p=(k+1)*g,r=this.GetMeshPointAt(c,k),w=this.GetMeshPointAt(c+1,k+1),y=C3$jscomp$48.isPointInTriangleInclusive(a,b,d,l,n,l,n,p);e=y?d+e:d;g=y?l:l+g;c=this.GetMeshPointAt(c+(y?1:0),k+(y?0: 1));const [B,C,E]=C3$jscomp$48.triangleCartesianToBarycentric(a,b,d,l,e,g,n,p);return C3$jscomp$48.triangleBarycentricToCartesian3d(B,C,E,r.GetX(),r.GetY(),r.GetZElevation(),c.GetX(),c.GetY(),c.GetZElevation(),w.GetX(),w.GetY(),w.GetZElevation())}_SimplifyPoly(a){const b=[];let c=a[0],d=a[1],e=c-a.at(-2),g=d-a.at(-1);for(let l=0,n=a.length;l<n;l+=2){var k=(l+2)%n;const p=a[k];k=a[k+1];const r=p-c,w=k-d,y=1E-7>Math.abs(w)&&1E-7>Math.abs(g)&&Math.sign(r)===Math.sign(e);(!(1E-7>Math.abs(r)&&1E-7>Math.abs(e)&& Math.sign(w)===Math.sign(g)||y)&&.001<Math.abs(r/e-w/g)||0==r&&0===w)&&b.push(c,d);c=p;d=k;e=r;g=w}6<=b.length&&b.length<a.length&&C3$jscomp$48.shallowAssignArray(a,b)}SaveToJson(){return{cols:this.GetHSize(),rows:this.GetVSize(),points:this._pts.map(a=>a.map(b=>b.SaveToJson()))}}LoadFromJson(a){const b=this.GetHSize(),c=this.GetVSize();if(a.cols!==b||a.rows!==c)throw Error("mesh data wrong size");a=a.points;for(let d=0;d<c;++d){const e=a[d];for(let g=0;g<b;++g)this.GetMeshPointAt(g,d).LoadFromJson(e[g])}}}; "use strict";const C3$jscomp$49=self.C3,VALID_PIXEL_FORMATS=new Set(["rgba8","rgb8","rgba4","rgb5_a1","rgb565"]),VALID_SAMPLINGS=new Set(["nearest","bilinear","trilinear"]),VALID_MIPMAP_QUALITIES=new Set(["default","low","high"]),VALID_WRAP_MODES=new Set(["clamp-to-edge","repeat","mirror-repeat"]); function GetFormatSpecifiers(a,b){let c,d;switch(a){case "rgba8":a=b.RGBA8;d=c=b.RGBA;b=b.UNSIGNED_BYTE;break;case "rgb8":a=b.RGB8;d=c=b.RGB;b=b.UNSIGNED_BYTE;break;case "rgba4":a=b.RGBA4;d=c=b.RGBA;b=b.UNSIGNED_SHORT_4_4_4_4;break;case "rgb5_a1":a=b.RGB5_A1;d=c=b.RGBA;b=b.UNSIGNED_SHORT_5_5_5_1;break;case "rgb565":a=b.RGB565;d=c=b.RGB;b=b.UNSIGNED_SHORT_5_6_5;break;default:throw Error("invalid pixel format");}return{sizedinternalformat:a,internalformat:c,format:d,type:b}} const CREATEFROM_DEFAULT_OPTIONS={wrapX:"clamp-to-edge",wrapY:"clamp-to-edge",sampling:"trilinear",anisotropy:0,pixelFormat:"rgba8",mipMap:!0,mipMapQuality:"default",premultiplyAlpha:!0,isSvg:!1,width:-1,height:-1},UPDATE_DEFAULT_OPTIONS={premultiplyAlpha:!0,flipY:!1},allTextures=new Set; C3$jscomp$49.Gfx.WebGLRendererTexture=class{constructor(a){this._renderer=a;this._texture=null;this._height=this._width=0;this._isStatic=!0;this._wrapY=this._wrapX="clamp-to-edge";this._sampling="trilinear";this._anisotropy=0;this._pixelFormat="rgba8";this._isMipMapped=!1;this._mipMapQuality="default";this._refCount=0}_CreateStatic(a,b){if(!("undefined"!==typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&& a instanceof ImageBitmap||"undefined"!==typeof OffscreenCanvas&&a instanceof OffscreenCanvas||a instanceof ImageData||a instanceof ArrayBuffer)&&null!==a)throw Error("invalid texture source");b=Object.assign({},CREATEFROM_DEFAULT_OPTIONS,b);if(this._texture)throw Error("already created texture");this._wrapX=b.wrapX;this._wrapY=b.wrapY;this._sampling=b.sampling;this._anisotropy=b.anisotropy;this._pixelFormat=b.pixelFormat;this._isMipMapped=!!b.mipMap&&this._renderer.AreMipmapsEnabled();this._mipMapQuality= b.mipMapQuality;if(!VALID_WRAP_MODES.has(this._wrapX)||!VALID_WRAP_MODES.has(this._wrapY))throw Error("invalid wrap mode");if(!VALID_SAMPLINGS.has(this._sampling))throw Error("invalid sampling");if(!VALID_PIXEL_FORMATS.has(this._pixelFormat))throw Error("invalid pixel format");if(!VALID_MIPMAP_QUALITIES.has(this._mipMapQuality))throw Error("invalid mipmap quality");this._isStatic=!0;if(a instanceof ArrayBuffer||null===a||b.isSvg){if(this._width=b.width,this._height=b.height,a instanceof ArrayBuffer&& a.byteLength!==this._width*this._height*4)throw Error("ArrayBuffer wrong size");}else this._width=a.width,this._height=a.height;if(0>=this._width||0>=this._height)throw Error("invalid texture data size");if(b.isSvg){var c=C3$jscomp$49.CreateCanvas(this._width,this._height);c.getContext("2d").drawImage(a,0,0,this._width,this._height);a=c}var d=C3$jscomp$49.isPOT(this._width)&&C3$jscomp$49.isPOT(this._height);c=this._renderer.GetMaxTextureSize();if(this._width>c||this._height>c)throw Error("texture data exceeds maximum texture size"); c=this._renderer.GetContext();var e=this._renderer.GetWebGLVersionNumber();this._texture=c.createTexture();c.bindTexture(c.TEXTURE_2D,this._texture);c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha);c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!1);b=GetFormatSpecifiers(this._pixelFormat,c);if(this._renderer.SupportsNPOTTextures()||d||!this._IsTiled())2<=e?(c.texStorage2D(c.TEXTURE_2D,this._isMipMapped?Math.floor(Math.log2(Math.max(this._width,this._height))+1):1,b.sizedinternalformat,this._width, this._height),a instanceof ArrayBuffer?c.texSubImage2D(c.TEXTURE_2D,0,0,0,this._width,this._height,b.format,b.type,new Uint8Array(a)):null!==a&&c.texSubImage2D(c.TEXTURE_2D,0,0,0,b.format,b.type,a)):a instanceof ArrayBuffer?c.texImage2D(c.TEXTURE_2D,0,b.internalformat,this._width,this._height,0,b.format,b.type,new Uint8Array(a)):null===a?c.texImage2D(c.TEXTURE_2D,0,b.internalformat,this._width,this._height,0,b.format,b.type,null):c.texImage2D(c.TEXTURE_2D,0,b.internalformat,b.format,b.type,a);else{if(null=== a)throw Error("cannot pass null data when creating a NPOT tiled texture without NPOT support");a instanceof ArrayBuffer&&(a=new ImageData(new Uint8ClampedArray(a),this._width,this._height));a instanceof ImageData&&(d=C3$jscomp$49.CreateCanvas(this._width,this._height),d.getContext("2d").putImageData(a,0,0),a=d);d=C3$jscomp$49.CreateCanvas(C3$jscomp$49.nextHighestPowerOfTwo(this._width),C3$jscomp$49.nextHighestPowerOfTwo(this._height));e=d.getContext("2d");e.imageSmoothingEnabled="nearest"!==this._sampling; e.drawImage(a,0,0,this._width,this._height,0,0,d.width,d.height);c.texImage2D(c.TEXTURE_2D,0,b.internalformat,b.format,b.type,d)}null!==a&&this._SetTextureParameters(c);c.bindTexture(c.TEXTURE_2D,null);this._renderer._ResetLastTexture();this._refCount=1;allTextures.add(this)}_CreateDynamic(a,b,c){c=Object.assign({},CREATEFROM_DEFAULT_OPTIONS,c);if(this._texture)throw Error("already created texture");this._wrapX=c.wrapX;this._wrapY=c.wrapY;this._sampling=c.sampling;this._pixelFormat=c.pixelFormat; this._isMipMapped=!!c.mipMap&&this._renderer.AreMipmapsEnabled();this._mipMapQuality=c.mipMapQuality;if(!VALID_WRAP_MODES.has(this._wrapX)||!VALID_WRAP_MODES.has(this._wrapY))throw Error("invalid wrap mode");if(!VALID_SAMPLINGS.has(this._sampling))throw Error("invalid sampling");if(!VALID_PIXEL_FORMATS.has(this._pixelFormat))throw Error("invalid pixel format");if(!VALID_MIPMAP_QUALITIES.has(this._mipMapQuality))throw Error("invalid mipmap quality");this._isStatic=!1;this._width=Math.floor(a);this._height= Math.floor(b);a=C3$jscomp$49.isPOT(this._width)&&C3$jscomp$49.isPOT(this._height);b=this._renderer.GetMaxTextureSize();if(0>=this._width||0>=this._height)throw Error("invalid texture size");if(this._width>b||this._height>b)throw Error("texture exceeds maximum texture size");if(!this._renderer.SupportsNPOTTextures()&&this._IsTiled()&&!a)throw Error("non-power-of-two tiled textures not supported");a=this._renderer.GetContext();b=this._renderer.GetWebGLVersionNumber();this._texture=a.createTexture(); a.bindTexture(a.TEXTURE_2D,this._texture);a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,c.premultiplyAlpha);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1);c=GetFormatSpecifiers(this._pixelFormat,a);a.texImage2D(a.TEXTURE_2D,0,2<=b?c.sizedinternalformat:c.internalformat,this._width,this._height,0,c.format,c.type,null);this._SetTextureParameters(a);a.bindTexture(a.TEXTURE_2D,null);this._renderer._ResetLastTexture();this._refCount=1;allTextures.add(this)}_GetMipMapHint(a){if("default"===this._mipMapQuality)return this._isStatic? a.NICEST:a.FASTEST;if("low"===this._mipMapQuality)return a.FASTEST;if("high"===this._mipMapQuality)return a.NICEST;throw Error("invalid mipmap quality");}_IsTiled(){return"clamp-to-edge"!==this._wrapX||"clamp-to-edge"!==this._wrapY}_GetTextureWrapMode(a,b){if("clamp-to-edge"===b)return a.CLAMP_TO_EDGE;if("repeat"===b)return a.REPEAT;if("mirror-repeat"===b)return a.MIRRORED_REPEAT;throw Error("invalid wrap mode");}_SetTextureParameters(a){var b=C3$jscomp$49.isPOT(this._width)&&C3$jscomp$49.isPOT(this._height); a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,this._GetTextureWrapMode(a,this._wrapX));a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,this._GetTextureWrapMode(a,this._wrapY));"nearest"===this._sampling?(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST),this._isMipMapped=!1):(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),(b||this._renderer.SupportsNPOTTextures())&&this._isMipMapped?(a.hint(a.GENERATE_MIPMAP_HINT,this._GetMipMapHint(a)), a.generateMipmap(a.TEXTURE_2D),b="trilinear"===this._sampling&&!this._renderer.HasMajorPerformanceCaveat(),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,b?a.LINEAR_MIPMAP_LINEAR:a.LINEAR_MIPMAP_NEAREST)):(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),this._isMipMapped=!1));(b=this._renderer._GetAnisotropicExtension())&&0<this._anisotropy&&"nearest"!==this._sampling&&a.texParameterf(a.TEXTURE_2D,b.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(this._anisotropy,this._renderer._GetMaxAnisotropy()))}_Update(a, b){if(!("undefined"!==typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!==typeof HTMLVideoElement&&a instanceof HTMLVideoElement||"undefined"!==typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&a instanceof ImageBitmap||"undefined"!==typeof OffscreenCanvas&&a instanceof OffscreenCanvas||a instanceof ImageData))throw Error("invalid texture source");if(!this._texture||0>=this._refCount)throw Error("texture not created");if(this._isStatic)throw Error("cannot update static texture"); b=Object.assign({},UPDATE_DEFAULT_OPTIONS,b);const c=a.width||a.videoWidth,d=a.height||a.videoHeight;var e=this._renderer.GetWebGLVersionNumber();const g=this._renderer.GetContext();g.bindTexture(g.TEXTURE_2D,this._texture);g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha);g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!!b.flipY);b=GetFormatSpecifiers(this._pixelFormat,g);e=2<=e?b.sizedinternalformat:b.internalformat;try{if(this._width===c&&this._height===d){const k=C3$jscomp$49.isPOT(this._width)&& C3$jscomp$49.isPOT(this._height);g.texSubImage2D(g.TEXTURE_2D,0,0,0,b.format,b.type,a);(k||this._renderer.SupportsNPOTTextures())&&this._isMipMapped&&(g.hint(g.GENERATE_MIPMAP_HINT,this._GetMipMapHint(g)),g.generateMipmap(g.TEXTURE_2D))}else{this._width=c;this._height=d;const k=C3$jscomp$49.isPOT(this._width)&&C3$jscomp$49.isPOT(this._height);if(!this._renderer.SupportsNPOTTextures()&&this._IsTiled()&&!k)throw Error("non-power-of-two tiled textures not supported");g.texImage2D(g.TEXTURE_2D,0,e,b.format, b.type,a);(k||this._renderer.SupportsNPOTTextures())&&this._isMipMapped&&(g.hint(g.GENERATE_MIPMAP_HINT,this._GetMipMapHint(g)),g.generateMipmap(g.TEXTURE_2D))}}catch(k){console.error("Error updating WebGL texture: ",k)}g.bindTexture(g.TEXTURE_2D,null);this._renderer._ResetLastTexture()}_Delete(){if(0<this._refCount)throw Error("texture still has references");if(!this._texture)throw Error("already deleted texture");allTextures.delete(this);this._renderer.GetContext().deleteTexture(this._texture); this._texture=null}IsValid(){return!!this._texture}_GetTexture(){return this._texture}GetRenderer(){return this._renderer}AddReference(){this._refCount++}SubtractReference(){if(0>=this._refCount)throw Error("no more references");this._refCount--}GetReferenceCount(){return this._refCount}GetWidth(){return this._width}GetHeight(){return this._height}IsStatic(){return this._isStatic}GetEstimatedMemoryUsage(){let a=this._width*this._height;switch(this._pixelFormat){case "rgba8":a*=4;break;case "rgb8":a*= 3;break;case "rgba4":case "rgb5_a1":case "rgb565":a*=2}this._isMipMapped&&(a+=Math.floor(a/3));return a}static OnContextLost(){allTextures.clear()}static allTextures(){return allTextures.values()}};"use strict"; const C3$jscomp$50=self.C3,glMatrix$jscomp$2=self.glMatrix,mat4$jscomp$3=glMatrix$jscomp$2.mat4,VALID_SAMPLINGS$jscomp$1=new Set(["nearest","bilinear","trilinear"]),DEFAULT_RENDERTARGET_OPTIONS={sampling:"trilinear",alpha:!0,depth:!1,isSampled:!0,isDefaultSize:!0,multisampling:0},allRenderTargets=new Set; C3$jscomp$50.Gfx.WebGLRenderTarget=class{constructor(a){this._renderer=a;this._renderBuffer=this._texture=this._frameBufferNoDepth=this._frameBuffer=null;this._height=this._width=0;this._isDefaultSize=!0;this._sampling="trilinear";this._alpha=!0;this._depth=!1;this._isSampled=!0;this._multisampling=0;this._projectionMatrix=mat4$jscomp$3.create();this._lastFarZ=this._lastNearZ=this._lastFov=0}_Create(a,b,c){c=Object.assign({},DEFAULT_RENDERTARGET_OPTIONS,c);const d=this._renderer.GetWebGLVersionNumber(); if(this._texture||this._renderBuffer)throw Error("already created render target");this._sampling=c.sampling;this._alpha=!!c.alpha;this._depth=!!c.depth;this._isSampled=!!c.isSampled;this._isDefaultSize=!!c.isDefaultSize;this._multisampling=c.multisampling;if(!VALID_SAMPLINGS$jscomp$1.has(this._sampling))throw Error("invalid sampling");if(0<this._multisampling&&(2>d||this._isSampled))throw Error("invalid use of multisampling");2>d&&(this._isSampled=!0);this._width=a;this._height=b;if(0>=this._width|| 0>=this._height)throw Error("invalid render target size");this._CalculateProjection();a=this._renderer.GetContext();this._frameBuffer=a.createFramebuffer();this._depth&&(this._frameBufferNoDepth=a.createFramebuffer());this._isSampled?(this._texture=this._renderer.CreateDynamicTexture(this._width,this._height,{sampling:this._sampling,pixelFormat:this._alpha?"rgba8":"rgb8",mipMap:!1}),b=this._texture._GetTexture(),a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER, a.COLOR_ATTACHMENT0,a.TEXTURE_2D,b,0),this._depth&&(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBufferNoDepth),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,b,0))):(this._renderBuffer=a.createRenderbuffer(),a.bindRenderbuffer(a.RENDERBUFFER,this._renderBuffer),b=this._alpha?a.RGBA8:a.RGB8,0<this._multisampling&&((c=a.getInternalformatParameter(a.RENDERBUFFER,b,a.SAMPLES))&&c[0]?(c=c[0],this._multisampling>c&&(this._multisampling=c)):this._multisampling=0),0===this._multisampling? a.renderbufferStorage(a.RENDERBUFFER,b,this._width,this._height):a.renderbufferStorageMultisample(a.RENDERBUFFER,this._multisampling,b,this._width,this._height),a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,this._renderBuffer),this._depth&&(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBufferNoDepth),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,this._renderBuffer)),a.bindRenderbuffer(a.RENDERBUFFER, null));b=this._renderer._GetDepthBuffer();this._depth&&b&&(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),this._renderer._CanSampleDepth()?a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,b,0):a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,b));a.bindFramebuffer(a.FRAMEBUFFER,null);allRenderTargets.add(this)}_Resize(a,b){if(this._width!==a||this._height!==b)this._width=a,this._height=b,this._CalculateProjection(),a=this._renderer.GetContext(), a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),this._texture?this._texture._Update(new ImageData(this._width,this._height)):(a.bindRenderbuffer(a.RENDERBUFFER,this._renderBuffer),a.renderbufferStorage(a.RENDERBUFFER,this._alpha?a.RGBA8:a.RGB8,this._width,this._height),a.bindRenderbuffer(a.RENDERBUFFER,null)),b=this._renderer._GetDepthBuffer(),this._depth&&b&&(this._renderer._CanSampleDepth()?a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,b,0):a.framebufferRenderbuffer(a.FRAMEBUFFER, a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,b)),a.bindFramebuffer(a.FRAMEBUFFER,null)}_Delete(){if(!this._texture&&!this._renderBuffer)throw Error("already deleted render target");allRenderTargets.delete(this);var a=this._renderer.GetContext();this._texture?(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,null,0),this._depth&&(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBufferNoDepth),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0, a.TEXTURE_2D,null,0)),this._renderer.DeleteTexture(this._texture),this._texture=null):this._renderBuffer&&(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,null),this._depth&&(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBufferNoDepth),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,null)),a.deleteRenderbuffer(this._renderBuffer),this._renderBuffer=null);a.bindFramebuffer(a.FRAMEBUFFER,null);2<=this._renderer.GetWebGLVersionNumber()&& (a.bindFramebuffer(a.READ_FRAMEBUFFER,null),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,null));a.deleteFramebuffer(this._frameBuffer);this._depth&&a.deleteFramebuffer(this._frameBufferNoDepth);a=this._renderer.GetBatchState();a.currentFramebuffer=null;this._frameBuffer=a.currentFramebufferNoDepth=null}_CalculateProjection(){this._renderer.CalculatePerspectiveMatrix(this._projectionMatrix,this._width/this._height);this._lastFov=this._renderer.GetFovY();this._lastNearZ=this._renderer.GetNearZ();this._lastFarZ= this._renderer.GetFarZ()}_GetFramebuffer(){return this._frameBuffer}_GetFramebufferNoDepth(){return this._frameBufferNoDepth}GetRenderer(){return this._renderer}GetTexture(){return this._texture}GetProjectionMatrix(){this._renderer.GetFovY()===this._lastFov&&this._renderer.GetNearZ()===this._lastNearZ&&this._renderer.GetFarZ()===this._lastFarZ||this._CalculateProjection();return this._projectionMatrix}IsLinearSampling(){return"nearest"!==this._sampling}HasAlpha(){return this._alpha}IsSampled(){return this._isSampled}HasDepthBuffer(){return this._depth}GetWidth(){return this._width}GetHeight(){return this._height}IsDefaultSize(){return this._isDefaultSize}GetMultisampling(){return this._multisampling}GetOptions(){const a= {sampling:this._sampling,alpha:this._alpha,isSampled:this._isSampled};this._isDefaultSize||(a.width=this._width,a.height=this._height);return a}IsCompatibleWithOptions(a){a=Object.assign({},DEFAULT_RENDERTARGET_OPTIONS,a);return"nearest"!==a.sampling!==this.IsLinearSampling()||!!a.alpha!==this.HasAlpha()||!!a.depth!==this.HasDepthBuffer()||2<=this._renderer.GetWebGLVersionNumber()&&!!a.isSampled!==this.IsSampled()?!1:"number"===typeof a.width||"number"===typeof a.height?!this.IsDefaultSize()&&this.GetWidth()=== a.width&&this.GetHeight()===a.height:this.IsDefaultSize()}_GetWebGLTexture(){return this._texture?this._texture._GetTexture():null}GetEstimatedMemoryUsage(){return this._texture?this._texture.GetEstimatedMemoryUsage():this._width*this._height*(this._alpha?4:3)}static async DebugReadPixelsToBlob(a,b){a=await a.ReadBackRenderTargetToImageData(b,!0);return await C3$jscomp$50.ImageDataToBlob(a)}static OnContextLost(){allRenderTargets.clear()}static allRenderTargets(){return allRenderTargets.values()}static ResizeAll(a, b){for(const c of allRenderTargets)c.IsDefaultSize()&&c._Resize(a,b)}};"use strict";const C3$jscomp$51=self.C3,RESERVED_UNIFORM_NAMES=new Set("aPos aTex aPoints matP matMV samplerFront samplerBack samplerDepth destStart destEnd srcStart srcEnd srcOriginStart srcOriginEnd pixelSize seconds devicePixelRatio layerScale layerAngle layoutStart layoutEnd color color2_ pointTexStart pointTexEnd zElevation tileSize tileSpacing outlineThickness zNear zFar".split(" ")); C3$jscomp$51.Gfx.WebGLShaderProgram=class extends C3$jscomp$51.Gfx.ShaderProgramBase{static async Compile(a,b){const c=a.GetContext();var d=b.src;const e=b.vertexSrc,g=b.name;b=c.createShader(c.FRAGMENT_SHADER);c.shaderSource(b,d);c.compileShader(b);d=c.createShader(c.VERTEX_SHADER);c.shaderSource(d,e);c.compileShader(d);const k=c.createProgram();c.attachShader(k,b);c.attachShader(k,d);c.bindAttribLocation(k,0,"aPos");c.bindAttribLocation(k,1,"aTex");c.bindAttribLocation(k,2,"aPoints");c.linkProgram(k); const l=a._GetParallelShaderCompileExtension();l?await a._WaitForObjectReady(()=>c.getProgramParameter(k,l.COMPLETION_STATUS_KHR)):await C3$jscomp$51.Wait(5);if(!c.getShaderParameter(b,c.COMPILE_STATUS))throw a=c.getShaderInfoLog(b),c.deleteShader(b),c.deleteShader(d),c.deleteProgram(k),Error("Error compiling fragment shader: "+a);if(!c.getShaderParameter(d,c.COMPILE_STATUS))throw a=c.getShaderInfoLog(d),c.deleteShader(b),c.deleteShader(d),c.deleteProgram(k),Error("Error compiling vertex shader: "+ a);if(!c.getProgramParameter(k,c.LINK_STATUS))throw a=c.getProgramInfoLog(k),c.deleteShader(b),c.deleteShader(d),c.deleteProgram(k),Error("Error linking shader program: "+a);(a=C3$jscomp$51.FilterUnprintableChars(c.getProgramInfoLog(k)||"").trim())&&!C3$jscomp$51.IsStringAllWhitespace(a)&&console.info(`[WebGL] Shader program '${g}' compilation log: `,a);c.deleteShader(b);c.deleteShader(d);return k}static async Create(a,b){const c=await C3$jscomp$51.Gfx.WebGLShaderProgram.Compile(a,b);return new C3$jscomp$51.Gfx.WebGLShaderProgram(a, c,b)}constructor(a,b,c){super(a,c);const d=a.GetContext();var e=a.GetBatchState();a.EndBatch();d.useProgram(b);this._gl=d;this._shaderProgram=b;this._isDeviceTransform="<default-device-transform>"===c.name;const g=d.getAttribLocation(b,"aPos"),k=d.getAttribLocation(b,"aTex");this._locAPoints=d.getAttribLocation(b,"aPoints");-1!==g&&(d.bindBuffer(d.ARRAY_BUFFER,a._vertexBuffer),d.vertexAttribPointer(g,a.GetNumVertexComponents(),d.FLOAT,!1,0,0),d.enableVertexAttribArray(g));-1!==k&&(d.bindBuffer(d.ARRAY_BUFFER, a._texcoordBuffer),d.vertexAttribPointer(k,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(k));-1!==this._locAPoints&&(d.bindBuffer(d.ARRAY_BUFFER,a._pointBuffer),d.vertexAttribPointer(this._locAPoints,4,d.FLOAT,!1,0,0),d.enableVertexAttribArray(this._locAPoints));d.bindBuffer(d.ARRAY_BUFFER,null);this._uMatP=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"matP","mat4");this._uMatMV=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"matMV","mat4");this._uColor=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"color", "vec4");this._uSamplerFront=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"samplerFront","sampler");this._uPointTexStart=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"pointTexStart","vec2");this._uPointTexEnd=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"pointTexEnd","vec2");this._uZElevation=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"zElevation","float");this._uTileSize=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"tileSize","vec2");this._uTileSpacing=new C3$jscomp$51.Gfx.WebGLShaderUniform(this, "tileSpacing","vec2");this._uColor2=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"color2_","vec4");this._uOutlineThickness=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"outlineThickness","float");this._uSamplerBack=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"samplerBack","sampler");this._uSamplerDepth=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"samplerDepth","sampler");this._uDestStart=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"destStart","vec2");this._uDestEnd=new C3$jscomp$51.Gfx.WebGLShaderUniform(this, "destEnd","vec2");this._uSrcStart=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"srcStart","vec2");this._uSrcEnd=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"srcEnd","vec2");this._uSrcOriginStart=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"srcOriginStart","vec2");this._uSrcOriginEnd=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"srcOriginEnd","vec2");this._uPixelSize=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"pixelSize","vec2");this._uSeconds=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"seconds", "float");this._uDevicePixelRatio=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"devicePixelRatio","float");this._uLayerScale=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"layerScale","float");this._uLayerAngle=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"layerAngle","float");this._uLayoutStart=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"layoutStart","vec2");this._uLayoutEnd=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"layoutEnd","vec2");this._uZNear=new C3$jscomp$51.Gfx.WebGLShaderUniform(this, "zNear","float");this._uZFar=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,"zFar","float");this._hasAnyOptionalUniforms=!!(this._uPixelSize.IsUsed()||this._uSeconds.IsUsed()||this._uSamplerBack.IsUsed()||this._uDestStart.IsUsed()||this._uDestEnd.IsUsed()||this._uSrcStart.IsUsed()||this._uSrcEnd.IsUsed()||this._uSrcOriginStart.IsUsed()||this._uSrcOriginEnd.IsUsed()||this._uDevicePixelRatio.IsUsed()||this._uLayerScale.IsUsed()||this._uLayerAngle.IsUsed()||this._uLayoutStart.IsUsed()||this._uLayoutEnd.IsUsed()); b=c.parameters||[];this._uCustomParameters=[];this._usesAnySrcRectOrPixelSize=this._uPixelSize.IsUsed()||this._uSrcStart.IsUsed()||this._uSrcEnd.IsUsed()||this._uSrcOriginStart.IsUsed()||this._uSrcOriginEnd.IsUsed();this._hasCurrentMatMV=this._hasCurrentMatP=!1;this._uColor.Init4f(1,1,1,1);this._uColor2.Init4f(1,1,1,1);this._uSamplerFront.Init1i(0);this._uSamplerBack.Init1i(1);this._uSamplerDepth.Init1i(2);this._uPointTexStart.Init2f(0,0);this._uPointTexEnd.Init2f(1,1);this._uZElevation.Init1f(0); this._uTileSize.Init2f(0,0);this._uTileSpacing.Init2f(0,0);this._uDestStart.Init2f(0,0);this._uDestEnd.Init2f(1,1);this._uSrcStart.Init2f(0,0);this._uSrcEnd.Init2f(0,0);this._uSrcOriginStart.Init2f(0,0);this._uSrcOriginEnd.Init2f(0,0);this._uPixelSize.Init2f(0,0);this._uDevicePixelRatio.Init1f(1);this._uZNear.Init1f(a.GetNearZ());this._uZFar.Init1f(a.GetFarZ());this._uLayerScale.Init1f(1);this._uLayerAngle.Init1f(0);this._uSeconds.Init1f(0);this._uLayoutStart.Init2f(0,0);this._uLayoutEnd.Init2f(0, 0);this._uOutlineThickness.Init1f(1);for(const l of b)a=l[2],b=new C3$jscomp$51.Gfx.WebGLShaderUniform(this,l[0],a),"color"===a?b.Init3f(0,0,0):b.Init1f(0),this._uCustomParameters.push(b);this._isDeviceTransform?this._UpdateDeviceTransformUniforms(e.currentMatP):(this.UpdateMatP(e.currentMatP,!0),this.UpdateMatMV(e.currentMV,!0));e=e.currentShader;d.useProgram(e?e._shaderProgram:null)}Release(){this._gl.deleteProgram(this._shaderProgram);this._shaderProgram=null;this._renderer._RemoveShaderProgram(this); this._gl=null;super.Release()}GetWebGLContext(){return this._gl}GetShaderProgram(){return this._shaderProgram}GetParameterCount(){return this._uCustomParameters.length}GetParameterType(a){return 0>a||a>=this._uCustomParameters.length?null:this._uCustomParameters[a].GetType()}AreCustomParametersAlreadySetInBatch(a){for(let b=0,c=a.length;b<c;++b)if(!this._uCustomParameters[b].IsSetToCustomInBatch(a[b]))return!1;return!0}SetCustomParametersInBatch(a){for(let b=0,c=a.length;b<c;++b)this._uCustomParameters[b].SetBatchValueCustom(a[b])}AreOptionalUniformsAlreadySetInBatch(a, b,c,d,e,g,k,l,n,p){return this._uSamplerBack.IsUsed()||this._uPixelSize.IsUsed()&&!this._uPixelSize.IsSetTo2InBatch(e,g)||this._uDestStart.IsUsed()&&!this._uDestStart.IsSetTo2InBatch(a.getLeft(),a.getTop())||this._uDestEnd.IsUsed()&&!this._uDestEnd.IsSetTo2InBatch(a.getRight(),a.getBottom())||this._uDevicePixelRatio.IsUsed()&&!this._uDevicePixelRatio.IsSetTo1InBatch(k)||this._uLayerScale.IsUsed()&&!this._uLayerScale.IsSetTo1InBatch(l)||this._uLayerAngle.IsUsed()&&!this._uLayerAngle.IsSetTo1InBatch(n)|| this._uSrcStart.IsUsed()&&!this._uSrcStart.IsSetTo2InBatch(b.getLeft(),b.getTop())||this._uSrcEnd.IsUsed()&&!this._uSrcEnd.IsSetTo2InBatch(b.getRight(),b.getBottom())||this._uSrcOriginStart.IsUsed()&&!this._uSrcOriginStart.IsSetTo2InBatch(c.getLeft(),c.getTop())||this._uSrcOriginEnd.IsUsed()&&!this._uSrcOriginEnd.IsSetTo2InBatch(c.getRight(),c.getBottom())||this._uLayoutStart.IsUsed()&&!this._uLayoutStart.IsSetTo2InBatch(d.getLeft(),d.getTop())||this._uLayoutEnd.IsUsed()&&!this._uLayoutEnd.IsSetTo2InBatch(d.getTop(), d.getBottom())||this._uSeconds.IsUsed()&&!this._uSeconds.IsSetTo1InBatch(p)?!1:!0}SetOptionalUniformsInBatch(a,b,c,d,e,g,k,l,n,p){this._uSamplerBack.IsUsed()||(this._uPixelSize.IsUsed()&&this._uPixelSize.SetBatch2(e,g),this._uDestStart.IsUsed()&&this._uDestStart.SetBatch2(a.getLeft(),a.getTop()),this._uDestEnd.IsUsed()&&this._uDestEnd.SetBatch2(a.getRight(),a.getBottom()),this._uDevicePixelRatio.IsUsed()&&this._uDevicePixelRatio.SetBatch1(k),this._uLayerScale.IsUsed()&&this._uLayerScale.SetBatch1(l), this._uLayerAngle.IsUsed()&&this._uLayerAngle.SetBatch1(n),this._uSrcStart.IsUsed()&&this._uSrcStart.SetBatch2(b.getLeft(),b.getTop()),this._uSrcEnd.IsUsed()&&this._uSrcEnd.SetBatch2(b.getRight(),b.getBottom()),this._uSrcOriginStart.IsUsed()&&this._uSrcOriginStart.SetBatch2(c.getLeft(),c.getTop()),this._uSrcOriginEnd.IsUsed()&&this._uSrcOriginEnd.SetBatch2(c.getRight(),c.getBottom()),this._uLayoutStart.IsUsed()&&this._uLayoutStart.SetBatch2(d.getLeft(),d.getTop()),this._uLayoutEnd.IsUsed()&&this._uLayoutEnd.SetBatch2(d.getTop(), d.getBottom()),this._uSeconds.IsUsed()&&this._uSeconds.SetBatch1(p))}UpdateMatP(a,b){this._hasCurrentMatP&&!b||this._isDeviceTransform||(this._uMatP.IsUsed()&&this._uMatP.UpdateMatrix4fv(a),this._hasCurrentMatP=!0)}SetMatPStale(){this._hasCurrentMatP=!1}UpdateMatMV(a,b){this._hasCurrentMatMV&&!b||this._isDeviceTransform||(this._uMatMV.IsUsed()&&this._uMatMV.UpdateMatrix4fv(a),this._hasCurrentMatMV=!0)}SetMatMVStale(){this._hasCurrentMatMV=!1}_UpdateDeviceTransformUniforms(a){if(!this._isDeviceTransform)throw Error("not device transform shader"); this._uMatP.UpdateMatrix4fv(a);a=this._renderer;const b=a.GetWidth()/2,c=a.GetHeight()/2;a=a.CalculateLookAtModelView2(b,c,a.GetDefaultCameraZ(a.GetHeight()),b,c,0,a.GetHeight());this._uMatMV.UpdateMatrix4fv(a)}UpdateColor(a){this._uColor.IsUsed()&&this._uColor.Update4f(a[0],a[1],a[2],a[3])}static GetReservedUniformNames(){return RESERVED_UNIFORM_NAMES}static GetDefaultVertexShaderSource(a){a=a?"highmedp":"mediump";return["#ifdef GL_FRAGMENT_PRECISION_HIGH\n#define highmedp highp\n#else\n#define highmedp mediump\n#endif\nattribute highp vec3 aPos;", `attribute ${a} vec2 aTex;`,`varying ${a} vec2 vTex;`,"uniform highp mat4 matP;\nuniform highp mat4 matMV;\nvoid main(void) {\n\tgl_Position = matP * matMV * vec4(aPos, 1.0);\n\tvTex = aTex;\n}"].join("\n")}static GetDefaultVertexShaderSource_WebGL2(a){a=a?"highp":"mediump";return["#version 300 es\nin highp vec3 aPos;",`in ${a} vec2 aTex;`,`out ${a} vec2 vTex;`,"uniform highp mat4 matP;\nuniform highp mat4 matMV;\nvoid main(void) {\n\tgl_Position = matP * matMV * vec4(aPos, 1.0);\n\tvTex = aTex;\n}"].join("\n")}static GetTextureFillFragmentShaderSource_WebGL1_NoFragDepth(){return"varying mediump vec2 vTex;\nuniform lowp vec4 color;\nuniform lowp sampler2D samplerFront;\nvoid main(void) {\n\tgl_FragColor = texture2D(samplerFront, vTex) * color;\n}"}static GetTextureFillFragmentShaderSource_WebGL1_FragDepthEXT(){return"#extension GL_EXT_frag_depth : enable\nvarying mediump vec2 vTex;\nuniform lowp vec4 color;\nuniform lowp sampler2D samplerFront;\nvoid main(void) {\n\tgl_FragColor = texture2D(samplerFront, vTex) * color;\n\tgl_FragDepthEXT = (gl_FragColor.a == 0.0 ? 1.0 : gl_FragCoord.z);\n}"}static GetTextureFillFragmentShaderSource_WebGL2(){return"#version 300 es\nin mediump vec2 vTex;\nout lowp vec4 outColor;\nuniform lowp vec4 color;\nuniform lowp sampler2D samplerFront;\nvoid main(void) {\n\toutColor = texture(samplerFront, vTex) * color;\n\tgl_FragDepth = (outColor.a == 0.0 ? 1.0 : gl_FragCoord.z);\n}"}static GetTilemapFragmentShaderSource_WebGL1_NoFragDepth(){return"#ifdef GL_FRAGMENT_PRECISION_HIGH\n#define highmedp highp\n#else\n#define highmedp mediump\n#endif\nvarying highmedp vec2 vTex;\nuniform lowp vec4 color;\nuniform lowp sampler2D samplerFront;\nuniform highmedp vec2 srcStart;\nuniform highmedp vec2 pixelSize;\nuniform highmedp vec2 tileSize;\nuniform highmedp vec2 tileSpacing;\nvoid main(void) {\n\thighmedp vec2 tile = floor(vTex);\n\thighmedp vec2 tex = fract(vTex);\n\thighmedp vec2 tileOrigin = srcStart + tile * (tileSize + tileSpacing);\n\thighmedp vec2 lowerBound = tileOrigin + pixelSize / 2.0;\n\thighmedp vec2 upperBound = tileOrigin + tileSize - pixelSize / 2.0;\n\tgl_FragColor = texture2D(samplerFront, clamp(tex, lowerBound, upperBound), -16.0) * color;\n}"}static GetTilemapFragmentShaderSource_WebGL1_FragDepthEXT(){return"#extension GL_EXT_frag_depth : enable\n#ifdef GL_FRAGMENT_PRECISION_HIGH\n#define highmedp highp\n#else\n#define highmedp mediump\n#endif\nvarying highmedp vec2 vTex;\nuniform lowp vec4 color;\nuniform lowp sampler2D samplerFront;\nuniform highmedp vec2 srcStart;\nuniform highmedp vec2 pixelSize;\nuniform highmedp vec2 tileSize;\nuniform highmedp vec2 tileSpacing;\nvoid main(void) {\n\thighmedp vec2 tile = floor(vTex);\n\thighmedp vec2 tex = fract(vTex);\n\thighmedp vec2 tileOrigin = srcStart + tile * (tileSize + tileSpacing);\n\thighmedp vec2 lowerBound = tileOrigin + pixelSize / 2.0;\n\thighmedp vec2 upperBound = tileOrigin + tileSize - pixelSize / 2.0;\n\tgl_FragColor = texture2D(samplerFront, clamp(tex, lowerBound, upperBound), -16.0) * color;\n\tgl_FragDepthEXT = (gl_FragColor.a == 0.0 ? 1.0 : gl_FragCoord.z);\n}"}static GetTilemapFragmentShaderSource_WebGL2(){return"#version 300 es\nin highp vec2 vTex;\nout lowp vec4 outColor;\nuniform lowp vec4 color;\nuniform lowp sampler2D samplerFront;\nuniform highp vec2 srcStart;\nuniform highp vec2 pixelSize;\nuniform highp vec2 tileSize;\nuniform highp vec2 tileSpacing;\nvoid main(void) {\n\thighp vec2 tile = floor(vTex);\n\thighp vec2 tex = fract(vTex);\n\thighp vec2 tileOrigin = srcStart + tile * (tileSize + tileSpacing);\n\thighp vec2 lowerBound = tileOrigin + pixelSize / 2.0;\n\thighp vec2 upperBound = tileOrigin + tileSize - pixelSize / 2.0;\n\toutColor = texture(samplerFront, clamp(tex, lowerBound, upperBound), -16.0) * color;\n\tgl_FragDepth = (outColor.a == 0.0 ? 1.0 : gl_FragCoord.z);\n}"}static GetTileRandomizationFragmentShaderSource(a, b,c){let d="";2<=a?d="#version 300 es\n":(b&&(d="#extension GL_EXT_frag_depth : enable\n"),c&&(d+="#extension GL_EXT_shader_texture_lod : enable\n#extension GL_OES_standard_derivatives : enable\n"));return d+` #ifdef GL_FRAGMENT_PRECISION_HIGH #define highmedp highp #else #define highmedp mediump #endif precision highmedp float; ${2<=a?"in":"varying"} vec2 vTex; ${2<=a?"out lowp vec4 outColor;":""} uniform lowp vec4 color; uniform lowp sampler2D samplerFront; uniform vec2 pixelSize; uniform vec2 tileSize; uniform vec2 tileSpacing; uniform float outlineThickness; const float PI = 3.1415926; lowp vec4 cospVec4(lowp vec4 a, lowp vec4 b, float x) { return (a + b + (a - b) * cos(x * PI)) / 2.0; } vec3 randVec3(vec2 seed) { return vec3(fract(sin(dot(seed.xy + vec2(0.1, 0.1), vec2(12.9898,78.233))) * 43758.5453), fract(sin(dot(seed.yx + vec2(0.1, 0.1), vec2(12.9898,-78.233))) * 43758.5453), fract(sin(dot(seed.xy + vec2(0.1, 0.1), vec2(-12.9898,-78.233))) * 43758.5453)); } lowp vec4 sampleTile(vec2 tile, vec2 uv, vec2 ddx, vec2 ddy) { vec2 posRandom = tileSize; float angleRandom = outlineThickness; vec3 rand = (randVec3(floor(tile + 0.5)) - 0.5) * 2.0; float angle = angleRandom * rand.z * PI; float sin_a = sin(angle); float cos_a = cos(angle); float aspect = pixelSize.x / pixelSize.y; vec2 mid = tile + vec2(0.5, 0.5); vec2 dp = uv - mid; dp.x /= aspect; vec2 r = vec2(dp.x * cos_a - dp.y * sin_a, dp.y * cos_a + dp.x * sin_a); r.x *= aspect; vec2 p = mid + r + (posRandom * rand.xy / 2.0); ${2<=a?"return textureGrad(samplerFront, p, ddx, ddy);":""} ${2>a&&c?"return texture2DGradEXT(samplerFront, p, ddx, ddy);":""} ${2>a&&!c?"return texture2D(samplerFront, p);":""} } void main(void) { ${2>a?"lowp vec4 outColor;":""} float blendMarginX = tileSpacing.x; float blendMarginY = tileSpacing.y; vec2 tile = floor(vTex); vec2 tex = fract(vTex); vec2 ddx = ${2<=a||c?"dFdx(vTex)":"vec2(0.0, 0.0)"}; vec2 ddy = ${2<=a||c?"dFdy(vTex)":"vec2(0.0, 0.0)"}; vec4 curTile = sampleTile(tile, vTex, ddx, ddy); bool inLeftMargin = (tex.x < blendMarginX); bool inRightMargin = (tex.x > 1.0 - blendMarginX); bool inTopMargin = (tex.y < blendMarginY); bool inBottomMargin = (tex.y > 1.0 - blendMarginY); if (inLeftMargin) { lowp vec4 leftTile = sampleTile(tile + vec2(-1.0, 0.0), vTex, ddx, ddy); float leftMix = (tex.x / (blendMarginX * 2.0)) + 0.5; lowp vec4 leftMixedTile = cospVec4(leftTile, curTile, leftMix); if (inTopMargin) { lowp vec4 topTile = sampleTile(tile + vec2(0.0, -1.0), vTex, ddx, ddy); lowp vec4 topLeftTile = sampleTile(tile + vec2(-1.0, -1.0), vTex, ddx, ddy); lowp vec4 topLeftMixedTile = cospVec4(topLeftTile, topTile, leftMix); outColor = cospVec4(topLeftMixedTile, leftMixedTile, (tex.y / (blendMarginY * 2.0)) + 0.5); } else if (inBottomMargin) { lowp vec4 bottomTile = sampleTile(tile + vec2(0.0, 1.0), vTex, ddx, ddy); lowp vec4 bottomLeftTile = sampleTile(tile + vec2(-1.0, 1.0), vTex, ddx, ddy); lowp vec4 bottomLeftMixedTile = cospVec4(bottomLeftTile, bottomTile, leftMix); outColor = cospVec4(leftMixedTile, bottomLeftMixedTile, (tex.y - (1.0 - blendMarginY)) / (blendMarginY * 2.0)); } else { outColor = leftMixedTile; } } else if (inRightMargin) { lowp vec4 rightTile = sampleTile(tile + vec2(1.0, 0.0), vTex, ddx, ddy); float rightMix = (tex.x - (1.0 - blendMarginX)) / (blendMarginX * 2.0); lowp vec4 rightMixedTile = cospVec4(curTile, rightTile, rightMix); if (inTopMargin) { lowp vec4 topTile = sampleTile(tile + vec2(0.0, -1.0), vTex, ddx, ddy); lowp vec4 topRightTile = sampleTile(tile + vec2(1.0, -1.0), vTex, ddx, ddy); lowp vec4 topRightMixedTile = cospVec4(topTile, topRightTile, rightMix); outColor = cospVec4(topRightMixedTile, rightMixedTile, (tex.y / (blendMarginY * 2.0)) + 0.5); } else if (inBottomMargin) { lowp vec4 bottomTile = sampleTile(tile + vec2(0.0, 1.0), vTex, ddx, ddy); lowp vec4 bottomRightTile = sampleTile(tile + vec2(1.0, 1.0), vTex, ddx, ddy); lowp vec4 bottomRightMixedTile = cospVec4(bottomTile, bottomRightTile, rightMix); outColor = cospVec4(rightMixedTile, bottomRightMixedTile, (tex.y - (1.0 - blendMarginY)) / (blendMarginY * 2.0)); } else { outColor = rightMixedTile; } } else if (inTopMargin) { lowp vec4 topTile = sampleTile(tile + vec2(0.0, -1.0), vTex, ddx, ddy); outColor = cospVec4(topTile, curTile, (tex.y / (blendMarginY * 2.0)) + 0.5); } else if (inBottomMargin) { lowp vec4 bottomTile = sampleTile(tile + vec2(0.0, 1.0), vTex, ddx, ddy); outColor = cospVec4(curTile, bottomTile, (tex.y - (1.0 - blendMarginY)) / (blendMarginY * 2.0)); } else { outColor = curTile; } outColor *= color; ${2>a?"gl_FragColor = outColor;":""} ${2<=a?"gl_FragDepth = (outColor.a == 0.0 ? 1.0 : gl_FragCoord.z);":""} ${2>a&&b?"gl_FragDepthEXT = (outColor.a == 0.0 ? 1.0 : gl_FragCoord.z);":""} } `}static GetPointVertexShaderSource_WebGL1(){return"attribute vec4 aPoints;\nvarying float pointOpacity;\nuniform float zElevation;\nuniform mat4 matP;\nuniform mat4 matMV;\nvoid main(void) {\n\tgl_Position = matP * matMV * vec4(aPoints.xy, zElevation, 1.0);\n\tgl_PointSize = aPoints.z;\n\tpointOpacity = aPoints.w;\n}"}static GetPointVertexShaderSource_WebGL2(){return"#version 300 es\nin vec4 aPoints;\nout float pointOpacity;\nuniform float zElevation;\nuniform mat4 matP;\nuniform mat4 matMV;\nvoid main(void) {\n\tgl_Position = matP * matMV * vec4(aPoints.xy, zElevation, 1.0);\n\tgl_PointSize = aPoints.z;\n\tpointOpacity = aPoints.w;\n}"}static GetPointFragmentShaderSource_WebGL1_NoFragDepth(){return"uniform lowp sampler2D samplerFront;\nvarying lowp float pointOpacity;\nuniform mediump vec2 pointTexStart;\nuniform mediump vec2 pointTexEnd;\nuniform lowp vec4 color;\nvoid main(void) {\n\tmediump vec2 pointTexMin = min(pointTexStart, pointTexEnd);\n\tmediump vec2 pointTexMax = max(pointTexStart, pointTexEnd);\n\tmediump vec2 pointCoord = (pointTexEnd.x > pointTexStart.x ? gl_PointCoord : vec2(1.0 - gl_PointCoord.y, gl_PointCoord.x));\n\tgl_FragColor = texture2D(samplerFront, mix(pointTexMin, pointTexMax, pointCoord)) * color * pointOpacity;\n}"}static GetPointFragmentShaderSource_WebGL1_FragDepthEXT(){return"#extension GL_EXT_frag_depth : enable\nuniform lowp sampler2D samplerFront;\nvarying lowp float pointOpacity;\nuniform mediump vec2 pointTexStart;\nuniform mediump vec2 pointTexEnd;\nuniform lowp vec4 color;\nvoid main(void) {\n\tmediump vec2 pointTexMin = min(pointTexStart, pointTexEnd);\n\tmediump vec2 pointTexMax = max(pointTexStart, pointTexEnd);\n\tmediump vec2 pointCoord = (pointTexEnd.x > pointTexStart.x ? gl_PointCoord : vec2(1.0 - gl_PointCoord.y, gl_PointCoord.x));\n\tgl_FragColor = texture2D(samplerFront, mix(pointTexMin, pointTexMax, pointCoord)) * color * pointOpacity;\n\tgl_FragDepthEXT = (gl_FragColor.a == 0.0 ? 1.0 : gl_FragCoord.z);\n}"}static GetPointFragmentShaderSource_WebGL2(){return"#version 300 es\nuniform lowp sampler2D samplerFront;\nin lowp float pointOpacity;\nuniform mediump vec2 pointTexStart;\nuniform mediump vec2 pointTexEnd;\nuniform lowp vec4 color;\nout lowp vec4 outColor;\nvoid main(void) {\n\tmediump vec2 pointTexMin = min(pointTexStart, pointTexEnd);\n\tmediump vec2 pointTexMax = max(pointTexStart, pointTexEnd);\n\tmediump vec2 pointCoord = (pointTexEnd.x > pointTexStart.x ? gl_PointCoord : vec2(1.0 - gl_PointCoord.y, gl_PointCoord.x));\n\toutColor = texture(samplerFront, mix(pointTexMin, pointTexMax, pointCoord)) * color * pointOpacity;\n\tgl_FragDepth = (outColor.a == 0.0 ? 1.0 : gl_FragCoord.z);\n}"}static GetColorFillFragmentShaderSource(){return"uniform lowp vec4 color;\nvoid main(void) {\n\tgl_FragColor = color;\n}"}static GetLinearGradientFillFragmentShaderSource(){return"precision lowp float;\nvarying mediump vec2 vTex;\nuniform vec4 color;\nuniform vec4 color2_;\nvec3 fromLinear(vec3 linearRGB)\n{\n\tbvec3 cutoff = lessThan(linearRGB, vec3(0.0031308));\n\tvec3 higher = vec3(1.055) * pow(abs(linearRGB), vec3(1.0/2.4)) - vec3(0.055);\n\tvec3 lower = linearRGB * vec3(12.92);\n\treturn mix(higher, lower, vec3(cutoff));\n}\nvec3 toLinear(vec3 sRGB)\n{\n\tbvec3 cutoff = lessThan(sRGB, vec3(0.04045));\n\tvec3 higher = pow(abs((sRGB + vec3(0.055))/vec3(1.055)), vec3(2.4));\n\tvec3 lower = sRGB/vec3(12.92);\n\treturn mix(higher, lower, vec3(cutoff));\n}\nvoid main(void) {\n\tvec3 linearGrad = mix(toLinear(color.rgb), toLinear(color2_.rgb), vTex.x);\n\tfloat a = mix(color.a, color2_.a, vTex.x);\n\tgl_FragColor = vec4(fromLinear(linearGrad) * a, a);\n}"}static GetPenumbraFillFragmentShaderSource(){return"#ifdef GL_FRAGMENT_PRECISION_HIGH\n#define highmedp highp\n#else\n#define highmedp mediump\n#endif\nprecision lowp float;\nvarying highmedp vec2 vTex;\nuniform vec4 color;\nvoid main(void) {\n\thighmedp float grad = vTex.x / (1.0 - vTex.y);\n\tgl_FragColor = color * (1.0 - (cos(grad * 3.141592653589793) + 1.0) / 2.0);\n}"}static GetSmoothLineFillFragmentShaderSource(){return"varying mediump vec2 vTex;\nuniform lowp vec4 color;\nvoid main(void) {\n\tlowp float f = 1.0 - abs(vTex.y - 0.5) * 2.0;\n\tgl_FragColor = color * f;\n}"}static GetHardEllipseFillFragmentShaderSource(){return"varying mediump vec2 vTex;\nuniform lowp vec4 color;\nvoid main(void) {\n\tmediump vec2 diff = vTex - vec2(0.5, 0.5);\n\tmediump vec2 diffSq = diff * diff;\n\tmediump float f = step(diffSq.x + diffSq.y, 0.25);\n\tgl_FragColor = color * f;\n}"}static GetHardEllipseOutlineFragmentShaderSource(){return"varying mediump vec2 vTex;\nuniform lowp vec4 color;\nuniform mediump vec2 pixelSize;\nuniform mediump float outlineThickness;\nvoid main(void) {\n\tmediump vec2 diff = vTex - vec2(0.5, 0.5);\n\tmediump vec2 diffSq = diff * diff;\n\tmediump float distSq = diffSq.x + diffSq.y;\n\tmediump vec2 norm = normalize(diff);\n\tmediump vec2 halfNorm = norm * 0.5;\n\tmediump float innerF = step(distSq, 0.25);\n\tmediump vec2 innerEdge = halfNorm - pixelSize * norm * outlineThickness;\n\tmediump vec2 innerEdgeSq = innerEdge * innerEdge;\n\tmediump float outerF = step(innerEdgeSq.x + innerEdgeSq.y, distSq);\n\tgl_FragColor = color * innerF * outerF;\n}"}static GetSmoothEllipseFillFragmentShaderSource(){return"varying mediump vec2 vTex;\nuniform lowp vec4 color;\nuniform mediump vec2 pixelSize;\nvoid main(void) {\n\tmediump vec2 diff = vTex - vec2(0.5, 0.5);\n\tmediump vec2 diffSq = diff * diff;\n\tmediump vec2 norm = normalize(diff);\n\tmediump vec2 halfNorm = norm * 0.5;\n\tmediump vec2 halfNormSq = halfNorm * halfNorm;\n\tmediump vec2 innerEdge = halfNorm - pixelSize * norm;\n\tmediump vec2 innerEdgeSq = innerEdge * innerEdge;\n\tmediump float f = smoothstep(halfNormSq.x + halfNormSq.y, innerEdgeSq.x + innerEdgeSq.y, diffSq.x + diffSq.y);\n\tgl_FragColor = color * f;\n}"}static GetSmoothEllipseOutlineFragmentShaderSource(){return"varying mediump vec2 vTex;\nuniform lowp vec4 color;\nuniform mediump vec2 pixelSize;\nuniform mediump float outlineThickness;\nvoid main(void) {\n\tmediump vec2 diff = vTex - vec2(0.5, 0.5);\n\tmediump vec2 diffSq = diff * diff;\n\tmediump float distSq = diffSq.x + diffSq.y;\n\tmediump vec2 norm = normalize(diff);\n\tmediump vec2 halfNorm = norm * 0.5;\n\tmediump vec2 halfNormSq = halfNorm * halfNorm;\n\tmediump vec2 pxNorm = pixelSize * norm;\n\tmediump vec2 innerEdge1 = halfNorm - pxNorm;\n\tmediump vec2 innerEdge1Sq = innerEdge1 * innerEdge1;\n\tmediump float innerF = smoothstep(halfNormSq.x + halfNormSq.y, innerEdge1Sq.x + innerEdge1Sq.y, distSq);\n\tmediump vec2 innerEdge2 = halfNorm - pxNorm * outlineThickness;\n\tmediump vec2 innerEdge2Sq = innerEdge2 * innerEdge2;\n\tmediump vec2 innerEdge3 = halfNorm - pxNorm * (outlineThickness + 1.0);\n\tmediump vec2 innerEdge3Sq = innerEdge3 * innerEdge3;\n\tmediump float outerF = smoothstep(innerEdge3Sq.x + innerEdge3Sq.y, innerEdge2Sq.x + innerEdge2Sq.y, distSq);\n\tgl_FragColor = color * innerF * outerF;\n}"}}; "use strict";const C3$jscomp$52=self.C3,mat4$jscomp$5=self.glMatrix.mat4,TYPE_SIZES=new Map([["float",1],["percent",1],["sampler",1],["vec2",2],["vec3",3],["color",3],["vec4",4],["mat4",16]]); C3$jscomp$52.Gfx.WebGLShaderUniform=class{constructor(a,b,c){if(!TYPE_SIZES.has(c))throw Error("invalid uniform type");this._owner=a;this._gl=this._owner.GetWebGLContext();this._name=b;this._type=c;this._isColorType="color"===this._type;this._location=this._gl.getUniformLocation(this._owner.GetShaderProgram(),b);this._isUsed=!!this._location;a=TYPE_SIZES.get(c);this._lastValue=new Float32Array(a);this._lastBatchValue=new Float32Array(a)}Release(){this._location=this._gl=this._owner=null}IsUsed(){return this._isUsed}GetType(){return this._type}IsColorType(){return this._isColorType}Init1f(a){this.IsUsed()&& (this._lastValue[0]=a,this._lastBatchValue.set(this._lastValue),this._gl.uniform1f(this._location,a))}Init1i(a){this.IsUsed()&&(this._lastValue[0]=a,this._lastBatchValue.set(this._lastValue),this._gl.uniform1i(this._location,a))}Init2f(a,b){this.IsUsed()&&(this._lastValue[0]=a,this._lastValue[1]=b,this._lastBatchValue.set(this._lastValue),this._gl.uniform2f(this._location,a,b))}Init3f(a,b,c){this.IsUsed()&&(this._lastValue[0]=a,this._lastValue[1]=b,this._lastValue[2]=c,this._lastBatchValue.set(this._lastValue), this._gl.uniform3f(this._location,a,b,c))}Init4f(a,b,c,d){this.IsUsed()&&(this._lastValue[0]=a,this._lastValue[1]=b,this._lastValue[2]=c,this._lastValue[3]=d,this._lastBatchValue.set(this._lastValue),this._gl.uniform4f(this._location,a,b,c,d))}Update1f(a){a=Math.fround(a);const b=this._lastValue;b[0]!==a&&(b[0]=a,this._gl.uniform1f(this._location,a))}Update1i(a){const b=this._lastValue;b[0]!==a&&(b[0]=a,this._gl.uniform1i(this._location,a))}Update2f(a,b){a=Math.fround(a);b=Math.fround(b);const c= this._lastValue;if(c[0]!==a||c[1]!==b)c[0]=a,c[1]=b,this._gl.uniform2f(this._location,a,b)}Update3f(a,b,c){a=Math.fround(a);b=Math.fround(b);c=Math.fround(c);const d=this._lastValue;if(d[0]!==a||d[1]!==b||d[2]!==c)d[0]=a,d[1]=b,d[2]=c,this._gl.uniform3f(this._location,a,b,c)}Update4f(a,b,c,d){a=Math.fround(a);b=Math.fround(b);c=Math.fround(c);d=Math.fround(d);const e=this._lastValue;if(e[0]!==a||e[1]!==b||e[2]!==c||e[3]!==d)e[0]=a,e[1]=b,e[2]=c,e[3]=d,this._gl.uniform4f(this._location,a,b,c,d)}UpdateMatrix4fv(a){const b= this._lastValue;mat4$jscomp$5.exactEquals(b,a)||(C3$jscomp$52.typedArraySet16(b,a,0),this._gl.uniformMatrix4fv(this._location,!1,a))}IsSetToCustomInBatch(a){const b=this._lastBatchValue;return this.IsColorType()?b[0]===Math.fround(a.getR())&&b[1]===Math.fround(a.getG())&&b[2]===Math.fround(a.getB()):b[0]===Math.fround(a)}SetBatchValueCustom(a){const b=this._lastBatchValue;this.IsColorType()?(b[0]=a.getR(),b[1]=a.getG(),b[2]=a.getB()):b[0]=a}IsSetTo1InBatch(a){return this._lastBatchValue[0]===Math.fround(a)}IsSetTo2InBatch(a, b){const c=this._lastBatchValue;return c[0]===Math.fround(a)&&c[1]===Math.fround(b)}SetBatch1(a){this._lastBatchValue[0]=a}SetBatch2(a,b){const c=this._lastBatchValue;c[0]=a;c[1]=b}};"use strict";const C3$jscomp$53=self.C3,glMatrix$jscomp$5=self.glMatrix,vec4$jscomp$3=glMatrix$jscomp$5.vec4,mat4$jscomp$6=glMatrix$jscomp$5.mat4; C3$jscomp$53.Gfx.BatchState=class{constructor(a){this.renderer=a;this.currentMV=mat4$jscomp$6.create();this.currentMatP=mat4$jscomp$6.create();this.currentFramebufferNoDepth=this.currentFramebuffer=null;this.isDepthSamplingEnabled=!1;this.currentColor=vec4$jscomp$3.fromValues(1,1,1,1);this.currentShader=null;this.pointTexCoords=new C3$jscomp$53.Rect;this.clearColor=C3$jscomp$53.New(C3$jscomp$53.Color,0,0,0,0)}}; C3$jscomp$53.Gfx.WebGLBatchJob=class{constructor(a){const b=new ArrayBuffer(96);this._type=0;this._batchState=a;this._gl=a.renderer.GetContext();this._indexCount=this._startIndex=0;this._texParam=null;this._mat4param=new Float32Array(b,0,16);this._colorParam=new Float32Array(b,64,4);this._srcOriginRect=new Float32Array(b,80,4);this._shaderParams=[]}InitQuad(a,b){this._type=1;this._startIndex=a;this._indexCount=b}DoQuad(){const a=this._gl;a.drawElements(a.TRIANGLES,this._indexCount,a.UNSIGNED_SHORT, this._startIndex)}InitSetTexture(a){this._type=2;this._texParam=a}DoSetTexture(){const a=this._gl,b=this._texParam;a.bindTexture(a.TEXTURE_2D,b?b._GetTexture():null)}InitSetColor(a){this._type=3;a.writeToTypedArray(this._colorParam,0)}DoSetColor(){const a=this._colorParam,b=this._batchState;vec4$jscomp$3.copy(b.currentColor,a);b.currentShader.UpdateColor(a)}InitSetGradientColor(a){this._type=21;a.writeToTypedArray(this._colorParam,0)}DoSetGradientColor(){const a=this._colorParam,b=this._batchState.currentShader; b._uColor2.IsUsed()&&b._uColor2.Update4f(a[0],a[1],a[2],a[3])}InitSetBlend(a,b){this._type=4;this._startIndex=a;this._indexCount=b}DoSetBlend(){this._gl.blendFunc(this._startIndex,this._indexCount)}InitSetViewport(a,b,c,d){this._type=5;const e=this._colorParam;e[0]=a;e[1]=b;e[2]=c;e[3]=d}DoSetViewport(){const a=this._colorParam;this._gl.viewport(a[0],a[1],a[2],a[3])}InitSetProjection(a){this._type=6;mat4$jscomp$6.copy(this._mat4param,a)}DoSetProjection(){const a=this._batchState,b=a.renderer._allShaderPrograms, c=a.currentShader,d=this._mat4param;for(let e=0,g=b.length;e<g;++e){const k=b[e];k===c?k.UpdateMatP(d,!0):k.SetMatPStale()}mat4$jscomp$6.copy(a.currentMatP,d)}InitSetModelView(a){this._type=7;mat4$jscomp$6.copy(this._mat4param,a)}DoSetModelView(){const a=this._batchState,b=a.renderer._allShaderPrograms,c=a.currentShader,d=this._mat4param;for(let e=0,g=b.length;e<g;++e){const k=b[e];k===c?k.UpdateMatMV(d,!0):k.SetMatMVStale()}mat4$jscomp$6.copy(a.currentMV,d)}InitSetRenderTarget(a){this._type=8;this._texParam= a}DoSetRenderTarget(){const a=this._gl,b=this._texParam,c=this._batchState;b?(c.currentFramebuffer=b._GetFramebuffer(),c.currentFramebufferNoDepth=b._GetFramebufferNoDepth(),c.isDepthSamplingEnabled&&c.currentFramebufferNoDepth?a.bindFramebuffer(a.FRAMEBUFFER,c.currentFramebufferNoDepth):a.bindFramebuffer(a.FRAMEBUFFER,c.currentFramebuffer)):(c.currentFramebuffer=null,c.currentFramebufferNoDepth=null,a.bindFramebuffer(a.FRAMEBUFFER,null))}InitClearSurface(a){this._type=9;a.writeToTypedArray(this._mat4param, 0)}InitClearSurface2(a,b,c,d){this._type=9;const e=this._mat4param;e[0]=a;e[1]=b;e[2]=c;e[3]=d}DoClearSurface(){const a=this._gl;var b=this._mat4param;const c=this._batchState.clearColor,d=b[0],e=b[1],g=b[2];b=b[3];c.equalsRgba(d,e,g,b)||(a.clearColor(d,e,g,b),c.setRgba(d,e,g,b));a.clear(a.COLOR_BUFFER_BIT)}InitSetPointTexCoords(a){this._type=15;a.writeToTypedArray(this._mat4param,0)}DoSetPointTextureCoords(){const a=this._mat4param;this._batchState.pointTexCoords.set(a[0],a[1],a[2],a[3])}InitPoints(a, b){this._type=10;this._startIndex=a;this._indexCount=1;this._mat4param[0]=b}DoPoints(){const a=this._gl,b=this._batchState,c=b.renderer._spPoints;a.useProgram(c._shaderProgram);c.UpdateMatP(b.currentMatP,!1);c.UpdateMatMV(b.currentMV,!1);var d=b.pointTexCoords;c._uPointTexStart.IsUsed()&&c._uPointTexStart.Update2f(d.getLeft(),d.getTop());c._uPointTexEnd.IsUsed()&&c._uPointTexEnd.Update2f(d.getRight(),d.getBottom());d=this._mat4param[0];c._uZElevation.IsUsed()&&c._uZElevation.Update1f(d);c._uColor.IsUsed()&& (d=b.currentColor,c._uColor.Update4f(d[0],d[1],d[2],d[3]));a.drawArrays(a.POINTS,this._startIndex/4,this._indexCount);a.useProgram(b.currentShader._shaderProgram)}InitSetProgram(a){this._type=11;this._texParam=a}DoSetProgram(){var a=this._gl;const b=this._batchState,c=this._texParam;b.currentShader=c;a.useProgram(c._shaderProgram);c.UpdateMatP(b.currentMatP,!1);c.UpdateMatMV(b.currentMV,!1);c._uColor.IsUsed()&&(a=b.currentColor,c._uColor.Update4f(a[0],a[1],a[2],a[3]))}InitSetProgramParameters(){this._type= 12}DoSetProgramParameters(){const a=this._batchState.currentShader,b=this._gl,c=this._mat4param,d=this._colorParam,e=this._srcOriginRect;if(a._uSamplerBack.IsUsed()){const g=this._batchState.renderer,k=this._texParam;g._lastTexture1!==k&&(b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k?k._GetTexture():null),g._lastTexture1=k,b.activeTexture(b.TEXTURE0))}a._uPixelSize.IsUsed()&&a._uPixelSize.Update2f(c[0],c[1]);a._uDestStart.IsUsed()&&a._uDestStart.Update2f(c[2],c[3]);a._uDestEnd.IsUsed()&& a._uDestEnd.Update2f(c[4],c[5]);a._uDevicePixelRatio.IsUsed()&&a._uDevicePixelRatio.Update1f(this._indexCount);a._uLayerScale.IsUsed()&&a._uLayerScale.Update1f(c[6]);a._uLayerAngle.IsUsed()&&a._uLayerAngle.Update1f(c[7]);a._uSrcStart.IsUsed()&&a._uSrcStart.Update2f(c[12],c[13]);a._uSrcEnd.IsUsed()&&a._uSrcEnd.Update2f(c[14],c[15]);a._uSrcOriginStart.IsUsed()&&a._uSrcOriginStart.Update2f(e[0],e[1]);a._uSrcOriginEnd.IsUsed()&&a._uSrcOriginEnd.Update2f(e[2],e[3]);a._uLayoutStart.IsUsed()&&a._uLayoutStart.Update2f(d[0], d[1]);a._uLayoutEnd.IsUsed()&&a._uLayoutEnd.Update2f(d[2],d[3]);a._uSeconds.IsUsed()&&a._uSeconds.Update1f(this._startIndex)}InitSetProgramCustomParameters(){this._type=13}DoSetProgramCustomParameters(){const a=this._batchState.currentShader._uCustomParameters,b=this._shaderParams;for(let c=0,d=a.length;c<d;++c){const e=a[c],g=b[c];e.IsColorType()?e.Update3f(g.getR(),g.getG(),g.getB()):e.Update1f(g)}}InitInvalidateFramebuffer(a){this._type=14;this._texParam=a}DoInvalidateFramebuffer(){const a=this._gl, b=this._texParam,c=this._batchState.currentFramebuffer;b!==c&&a.bindFramebuffer(a.FRAMEBUFFER,b);a.invalidateFramebuffer(a.FRAMEBUFFER,[a.COLOR_ATTACHMENT0]);b!==c&&a.bindFramebuffer(a.FRAMEBUFFER,c)}InitBlitFramebuffer(a,b,c){this._type=17;const d=this._mat4param,e=this._batchState.renderer;d[0]=a.GetWidth();d[1]=a.GetHeight();d[2]=b?b.GetWidth():e.GetWidth();d[3]=b?b.GetHeight():e.GetHeight();d[4]=a.IsLinearSampling()?1:0;d[5]="stretch"===c;c=this._shaderParams;C3$jscomp$53.clearArray(c);c.push(a._GetFramebuffer()); c.push(b?b._GetFramebuffer():null)}DoBlitFramebuffer(){var a=this._mat4param,b=this._shaderParams;const c=this._gl;var d=a[0],e=a[1],g=a[2];const k=a[3],l=0!==a[4];a=0!==a[5];const n=b[1];c.bindFramebuffer(c.READ_FRAMEBUFFER,b[0]);c.bindFramebuffer(c.DRAW_FRAMEBUFFER,n);a?c.blitFramebuffer(0,0,d,e,0,0,g,k,c.COLOR_BUFFER_BIT,l?c.LINEAR:c.NEAREST):(b=Math.min(d,g),d=Math.min(e,k),g=Math.max(e-k,0),e=Math.max(k-e,0),c.blitFramebuffer(0,g,b,d+g,0,e,b,d+e,c.COLOR_BUFFER_BIT,c.NEAREST))}InitStartQuery(a){this._type= 18;this._texParam=a}DoStartQuery(){this._texParam.BeginTimeElapsed();this._texParam=null}InitEndQuery(a){this._type=19;this._texParam=a}DoEndQuery(){this._texParam.EndTimeElapsed();this._texParam=null}InitSetEllipseParams(a,b,c){this._type=20;const d=this._mat4param;d[0]=a;d[1]=b;d[2]=c}DoSetEllipseParams(){const a=this._batchState.currentShader,b=this._mat4param;a._uPixelSize.IsUsed()&&a._uPixelSize.Update2f(b[0],b[1]);a._uOutlineThickness.IsUsed()&&a._uOutlineThickness.Update1f(b[2])}InitSetTilemapInfo(a, b,c,d,e,g,k){this._type=16;const l=this._mat4param;a.writeToTypedArray(l,0);l[4]=1/b;l[5]=1/c;l[6]=d/b;l[7]=e/c;l[8]=g/b;l[9]=k/c}DoSetTilemapInfo(){const a=this._batchState.currentShader,b=this._mat4param;a._uSrcStart.IsUsed()&&a._uSrcStart.Update2f(b[0],b[1]);a._uPixelSize.IsUsed()&&a._uPixelSize.Update2f(b[4],b[5]);a._uTileSize.IsUsed()&&a._uTileSize.Update2f(b[6],b[7]);a._uTileSpacing.IsUsed()&&a._uTileSpacing.Update2f(b[8],b[9])}InitSetTileRandomizationInfo(a,b,c,d,e,g,k){this._type=29;const l= this._mat4param;l[0]=1/a;l[1]=1/b;l[2]=c;l[3]=d;l[4]=e;l[5]=g;l[6]=k}DoSetTileRandomizationInfo(){const a=this._batchState.currentShader,b=this._mat4param;a._uPixelSize.IsUsed()&&a._uPixelSize.Update2f(b[0],b[1]);a._uTileSize.IsUsed()&&a._uTileSize.Update2f(b[2],b[3]);a._uOutlineThickness.IsUsed()&&a._uOutlineThickness.Update1f(b[4]);a._uTileSpacing.IsUsed()&&a._uTileSpacing.Update2f(b[5],b[6])}InitClearDepth(a){this._type=22;this._startIndex=a?1:0}DoClearDepth(){const a=this._gl,b=0!==this._startIndex; b||a.depthMask(!0);a.clear(a.DEPTH_BUFFER_BIT);b||a.depthMask(!1)}InitSetDepthEnabled(a){this._type=23;this._startIndex=a?1:0}DoSetDepthEnabled(){const a=this._gl;0===this._startIndex?(a.disable(a.DEPTH_TEST),a.depthMask(!1)):(a.enable(a.DEPTH_TEST),a.depthMask(!0))}InitSetDepthSamplingEnabled(a){this._type=24;this._startIndex=a?1:0}DoSetDepthSamplingEnabled(){const a=this._gl,b=this._batchState,c=b.renderer,d=0!==this._startIndex;b.isDepthSamplingEnabled=d;a.activeTexture(a.TEXTURE2);d?(b.currentFramebufferNoDepth&& a.bindFramebuffer(a.FRAMEBUFFER,b.currentFramebufferNoDepth),a.bindTexture(a.TEXTURE_2D,c._GetDepthBuffer())):(a.bindTexture(a.TEXTURE_2D,null),b.currentFramebufferNoDepth&&a.bindFramebuffer(a.FRAMEBUFFER,b.currentFramebuffer));a.activeTexture(a.TEXTURE0)}InitCoplanarStartStencilPass(){this._type=25}DoCoplanarStartStencilPass(){const a=this._gl;a.clear(a.STENCIL_BUFFER_BIT);a.enable(a.STENCIL_TEST);a.stencilFunc(a.ALWAYS,1,1);a.stencilOp(a.KEEP,a.KEEP,a.REPLACE);a.colorMask(!1,!1,!1,!1)}InitCoplanarStartColorPass(){this._type= 26}DoCoplanarStartColorPass(){const a=this._gl;a.colorMask(!0,!0,!0,!0);a.stencilFunc(a.EQUAL,1,1);a.stencilOp(a.KEEP,a.KEEP,a.KEEP)}InitCoplanarRestore(){this._type=27}DoCoplanarRestore(){const a=this._gl;a.disable(a.STENCIL_TEST)}InitSetScissor(a,b,c,d,e){this._type=28;this._startIndex=a?1:0;a=this._mat4param;a[0]=b;a[1]=c;a[2]=d;a[3]=e}DoSetScissor(){const a=this._gl,b=this._mat4param;1===this._startIndex?(a.enable(a.SCISSOR_TEST),a.scissor(b[0],b[1],b[2],b[3])):a.disable(a.SCISSOR_TEST)}Run(){switch(this._type){case 1:this.DoQuad(); break;case 2:this.DoSetTexture();break;case 3:this.DoSetColor();break;case 4:this.DoSetBlend();break;case 5:this.DoSetViewport();break;case 6:this.DoSetProjection();break;case 7:this.DoSetModelView();break;case 8:this.DoSetRenderTarget();break;case 9:this.DoClearSurface();break;case 10:this.DoPoints();break;case 11:this.DoSetProgram();break;case 12:this.DoSetProgramParameters();break;case 13:this.DoSetProgramCustomParameters();break;case 14:this.DoInvalidateFramebuffer();break;case 15:this.DoSetPointTextureCoords(); break;case 16:this.DoSetTilemapInfo();break;case 17:this.DoBlitFramebuffer();break;case 18:this.DoStartQuery();break;case 19:this.DoEndQuery();break;case 20:this.DoSetEllipseParams();break;case 21:this.DoSetGradientColor();break;case 22:this.DoClearDepth();break;case 23:this.DoSetDepthEnabled();break;case 24:this.DoSetDepthSamplingEnabled();break;case 25:this.DoCoplanarStartStencilPass();break;case 26:this.DoCoplanarStartColorPass();break;case 27:this.DoCoplanarRestore();break;case 28:this.DoSetScissor(); break;case 29:this.DoSetTileRandomizationInfo()}}};"use strict"; const C3$jscomp$54=self.C3,GENERIC_FONT_FAMILIES=new Set("serif sans-serif monospace cursive fantasy system-ui ui-serif ui-sans-serif ui-monospace ui-rounded math emoji fangsong".split(" ")),DEFAULT_OPTS={timeout:60},tempColor=new C3$jscomp$54.Color(0,0,0,1),VALID_HORIZ_ALIGNMENTS=new Set(["left","center","right"]),VALID_VERT_ALIGNMENTS=new Set(["top","center","bottom"]),VALID_WORD_WRAP_MODES=new Set(["word","character"]),allRendererTexts=new Set; C3$jscomp$54.FontManager&&C3$jscomp$54.FontManager.addEventListener("fontload",a=>{a=a.font.GetName();for(const b of allRendererTexts)(b.IsBBCodeEnabled()||C3$jscomp$54.equalsNoCase(b.GetFontName(),a))&&b._SetTextChanged()});function fillOrStrokeText(a,b,c,d,e,g){b?"Gecko"===C3$jscomp$54.Platform.BrowserEngine?a.strokeText(c,d,e,g):a.strokeText(c,d,e):"Gecko"===C3$jscomp$54.Platform.BrowserEngine?a.fillText(c,d,e,g):a.fillText(c,d,e)} function fillOrStrokeRect(a,b,c,d,e,g){b?a.strokeRect(c,d,e,g):a.fillRect(c,d,e,g)}function ptToPx(a){return 4/3*a}function getOffsetParam(a,b){a=a.trim();const c=parseFloat(a);return isFinite(c)?a.endsWith("%")?b*c/100:c:0}let didCheckFoundBoundingBoxSupport=!1,supportsFontBoundingBoxMeasurements=!1; C3$jscomp$54.Gfx.RendererText=class{constructor(a,b){b=Object.assign({},DEFAULT_OPTS,b);this._renderer=a;this._fontName="Arial";this._fontSize=16;this._fontSizeScale=1;this._lineHeight=0;this._isItalic=this._isBold=!1;this._colorStr="black";this._isBBcodeEnabled=!1;this._iconSet=null;this._iconSmoothing=!0;this.onloadfont=null;this._alreadyLoadedFonts=new Set;this._horizontalAlign="left";this._verticalAlign="top";this._text="";this._bbString=null;this._wrappedText=C3$jscomp$54.New(C3$jscomp$54.WordWrap); this._wrapMode="word";this._textChanged=!1;this._drawMaxCharCount=-1;this._height=this._width=this._cssHeight=this._cssWidth=this._drawCharCount=0;this._zoom=1;this._changed=!1;this._measureContextTop=this._measureContext=this._textContext=this._textCanvas=null;this._lastCanvasHeight=this._lastCanvasWidth=-1;this._lastTextCanvasFillStyle=this._lastMeasureCanvasFont=this._lastTextCanvasFont="";this._lastTextCanvasLineWidth=this._lastTextCanvasOpacity=1;this._measureTextCallback=c=>this._MeasureText(c); this._texture=null;this._rcTex=new C3$jscomp$54.Rect;this._scaleFactor=1;this._textureTimeout=new C3$jscomp$54.IdleTimeout(()=>{this.ReleaseTexture();this._SetTextCanvasSize(8,8)},b.timeout);this.ontextureupdate=null;this._wasReleased=!1;allRendererTexts.add(this)}Release(){this.onloadfont=null;this._alreadyLoadedFonts.clear();this._measureTextCallback=this._measureContextTop=this._measureContext=this._textContext=this._textCanvas=this._bbString=this._iconSet=null;this._textureTimeout.Release();this.ontextureupdate= null;this.ReleaseTexture();this._wrappedText.Clear();this._renderer=this._wrappedText=null;this._wasReleased=!0;allRendererTexts.delete(this)}_SetChanged(){this._changed=!0}_SetTextChanged(){this._SetChanged();this._wrappedText.Clear();this._textChanged=!0}SetBBCodeEnabled(a){a=!!a;this._isBBcodeEnabled!==a&&(a=(this._isBBcodeEnabled=a)?"alphabetic":"top",this._textContext&&(this._textContext.textBaseline=a),this._measureContext&&(this._measureContext.textBaseline=a),this._SetTextChanged())}IsBBCodeEnabled(){return this._isBBcodeEnabled}SetIconSet(a){this._iconSet!== a&&(this._iconSet=a,this._wrappedText.SetIconSet(a),this._iconSet&&this._iconSet.IsLoading()&&this._iconSet.LoadContent().then(()=>this._SetChanged()),this._SetTextChanged())}SetIconSmoothing(a){this._iconSmoothing=!!a;this._SetChanged()}SetFontName(a){a||(a="serif");this._fontName!==a&&(this._fontName=a,this._SetTextChanged())}GetFontName(){return this._fontName}SetFontSize(a){.1>a&&(a=.1);this._fontSize!==a&&(this._fontSize=a,this._SetTextChanged())}SetFontSizeScale(a){this._fontSizeScale!==a&& (this._fontSizeScale=a,this._SetTextChanged())}SetLineHeight(a){this._lineHeight!==a&&(this._lineHeight=a,this._SetChanged())}SetBold(a){a=!!a;this._isBold!==a&&(this._isBold=a,this._SetTextChanged())}SetItalic(a){a=!!a;this._isItalic!==a&&(this._isItalic=a,this._SetTextChanged())}SetDrawMaxCharacterCount(a){a=Math.floor(a);this._drawMaxCharCount!==a&&(this._drawMaxCharCount=a,this._SetChanged())}GetDrawMaxCharacterCount(){return this._drawMaxCharCount}_GetFontString(a,b){let c=[];(this._isBold|| b.HasStyleTag("b"))&&c.push("bold");(this._isItalic||b.HasStyleTag("i"))&&c.push("italic");var d=b.GetStyleTag("size");d=(d?parseFloat(d.param):this._fontSize)*this._fontSizeScale;a?c.push(d+"pt"):c.push(d*this.GetDrawScale()+"pt");a=this._fontName;(b=b.GetStyleTag("font"))&&b.param&&(a=b.param,this.onloadfont&&!this._alreadyLoadedFonts.has(a)&&(this.onloadfont(a),this._alreadyLoadedFonts.add(a)));a&&(GENERIC_FONT_FAMILIES.has(a)?c.push(a):c.push('"'+a+'"'));return c.join(" ")}SetColor(a){a instanceof C3$jscomp$54.Color&&(a=a.getCssRgb());this._colorStr!==a&&(this._colorStr=a,this._SetChanged())}SetColorRgb(a,b,c){tempColor.setRgb(a,b,c);this.SetColor(tempColor)}SetHorizontalAlignment(a){if(!VALID_HORIZ_ALIGNMENTS.has(a))throw Error("invalid horizontal alignment");this._horizontalAlign!==a&&(this._horizontalAlign=a,this._SetChanged())}SetVerticalAlignment(a){if(!VALID_VERT_ALIGNMENTS.has(a))throw Error("invalid vertical alignment");this._verticalAlign!==a&&(this._verticalAlign=a,this._SetChanged())}SetWordWrapMode(a){if(!VALID_WORD_WRAP_MODES.has(a))throw Error("invalid word wrap mode"); this._wrapMode!==a&&(this._wrapMode=a,this._SetTextChanged())}SetText(a){this._text!==a&&(this._text=a,this._SetTextChanged())}GetDrawScale(){return this._scaleFactor*this._zoom*self.devicePixelRatio}SetSize(a,b,c){"undefined"===typeof c&&(c=1);if(!(0>=a||0>=a||this._cssWidth===a&&this._cssHeight===b&&this._zoom===c)){var d=this._cssWidth;this._cssWidth=a;this._cssHeight=b;this._zoom=c;a=self.devicePixelRatio;this._width=this._cssWidth*this._zoom*a;this._height=this._cssHeight*this._zoom*a;a=Math.max(this._width, this._height);b=Math.min(this._renderer.GetMaxTextureSize(),4096);c=1;a>b&&(c=b/a,this._width=Math.min(this._width*c,b),this._height=Math.min(this._height*c,b));this._scaleFactor=c;this._cssWidth!==d?this._SetTextChanged():this._SetChanged()}}GetWidth(){return this._width}GetHeight(){return this._height}GetZoom(){return this._zoom}GetTextWidth(){this._MaybeWrapText();return this._wrappedText.GetMaxLineWidth()}GetTextHeight(){this._MaybeWrapText();return this._wrappedText.GetTotalLineHeight()+this._wrappedText.GetLineCount()* (this._lineHeight+4)-this._lineHeight}GetLengthInGraphemes(){this._MaybeWrapText();let a=0;for(const b of this._wrappedText.GetLines())for(const c of b.fragments())a+=c.GetLength();return a}GetTexture(){this._textureTimeout.Reset();this._MaybeUpdate();return this._texture}HitTestFragment(a,b){this._MaybeUpdate();const c=this.GetDrawScale();var d=this._wrappedText.GetLines();for(const e of d)if(d=e.GetFontBoundingBoxDescent()*c,b>=e.GetPosY()-e.GetHeight()*c+d&&b<e.GetPosY()+d)for(const g of e.fragments())if(a>= g.GetPosX()&&a<g.GetPosX()+g.GetWidth()*c)return g;return null}*fragmentsWithTag(a){this._MaybeUpdate();var b=this._wrappedText.GetLines();for(const c of b)for(const d of c.fragments())(b=d.GetStyleTag("tag"))&&C3$jscomp$54.equalsNoCase(b.param,a)&&(yield d)}FindFragmentWithTag(a,b){for(const c of this.fragmentsWithTag(a)){if(0===b)return c;--b}return null}CountFragmentsWithTag(a){let b=0;for(const c of this.fragmentsWithTag(a))++b;return b}_MaybeUpdate(){this._texture&&!this._changed&&!this._textChanged|| this._wasReleased||0>=this._width||0>=this._height||(this._changed=!1,this._DoUpdate())}_DoUpdate(){this._wasReleased||(this._SetTextCanvasSize(Math.max(C3$jscomp$54.nextHighestPowerOfTwo(Math.ceil(this._width)),128),Math.max(C3$jscomp$54.nextHighestPowerOfTwo(Math.ceil(this._height)),64)),this._MaybeWrapText(),this._DrawTextToCanvas(),this._UpdateTexture(),this._textureTimeout.Reset())}_SetTextCanvasSize(a,b){this._textCanvas||(this._textCanvas=C3$jscomp$54.CreateCanvas(16,16));let c=!1;if(this._lastCanvasWidth!== a||this._lastCanvasHeight!==b)this._lastCanvasWidth=a,this._lastCanvasHeight=b,this._textCanvas.width=a,this._textCanvas.height=b,c=!0;this._textContext||(this._textContext=this._textCanvas.getContext("2d"),c=!0);c?(this._textContext.textBaseline=this._isBBcodeEnabled?"alphabetic":"top",this._textContext.font=this._lastTextCanvasFont,this._textContext.fillStyle=this._lastTextCanvasFillStyle,this._textContext.strokeStyle=this._lastTextCanvasFillStyle,this._textContext.globalAlpha=this._lastTextCanvasOpacity, this._textContext.lineWidth=this._lastTextCanvasLineWidth):this._textContext.clearRect(0,0,a,b)}_MaybeCreateMeasureContext(){this._measureContext||(this._measureContext=C3$jscomp$54.CreateCanvas(16,16).getContext("2d"),this._measureContextTop=C3$jscomp$54.CreateCanvas(16,16).getContext("2d"),this._measureContext.textBaseline=this._isBBcodeEnabled?"alphabetic":"top",this._measureContextTop.textBaseline="top")}_SetMeasureFontString(a){this._lastMeasureCanvasFont!==a&&(this._lastMeasureCanvasFont=a, this._measureContext.font=a,this._measureContextTop.font=a)}_SupportsFontBoundingBoxMeasurements(){if(!didCheckFoundBoundingBoxSupport){didCheckFoundBoundingBoxSupport=!0;this._MaybeCreateMeasureContext();const a=this._measureContext.measureText("test");supportsFontBoundingBoxMeasurements="number"===typeof a.fontBoundingBoxAscent&&"number"===typeof a.fontBoundingBoxDescent}return supportsFontBoundingBoxMeasurements}_MaybeWrapText(){this._textChanged&&(this._MaybeCreateMeasureContext(),!this._isBBcodeEnabled|| this._bbString&&this._bbString.toString()===this._text||(this._bbString=new C3$jscomp$54.BBString(this._text,{noEscape:!0})),this._wrappedText.WordWrap(this._isBBcodeEnabled?this._bbString.toFragmentList():this._text,this._measureTextCallback,this._cssWidth,this._wrapMode,0),this._textChanged=!1)}_MeasureText(a){var b=a.IsText()?a.GetCharacterArray().join(""):" ";this._SetMeasureFontString(this._GetFontString(!0,a));a=a.GetStyleTag("size");a=(a?parseFloat(a.param):this._fontSize)*this._fontSizeScale; const c=this._measureContext.measureText(b);let d=0;this._isBBcodeEnabled&&this._SupportsFontBoundingBoxMeasurements()&&(b=this._measureContextTop.measureText(b),d=c.fontBoundingBoxAscent-b.fontBoundingBoxAscent);return{width:c.width,height:ptToPx(a),fontBoundingBoxAscent:c.fontBoundingBoxAscent||0,fontBoundingBoxDescent:c.fontBoundingBoxDescent||0,topToAlphabeticDistance:d}}_SetDrawFontString(a){this._lastTextCanvasFont!==a&&(this._lastTextCanvasFont=a,this._textContext.font=a)}_SetDrawCanvasColor(a){this._lastTextCanvasFillStyle!== a&&(this._lastTextCanvasFillStyle=a,this._textContext.fillStyle=a,this._textContext.strokeStyle=a)}_SetDrawCanvasOpacity(a){this._lastTextCanvasOpacity!==a&&(this._lastTextCanvasOpacity=a,this._textContext.globalAlpha=a)}_SetDrawCanvasLineWith(a){this._lastTextCanvasLineWidth!==a&&(this._lastTextCanvasLineWidth=a,this._textContext.lineWidth=a)}_DrawTextToCanvas(){this._textContext.imageSmoothingEnabled=this._iconSmoothing;this._drawCharCount=0;const a=this.GetDrawScale(),b=(4+this._lineHeight)*a; var c=0;const d=this._wrappedText.GetLines();if(0!==d.length){var e=this._isBBcodeEnabled&&this._SupportsFontBoundingBoxMeasurements(),g=d[0].GetHeight()*a;"center"===this._verticalAlign?(c=d.reduce((k,l)=>k+l.GetHeight()*a+b,0)-b,c=Math.max(this._height/2-c/2,0),e&&(g=d[0].GetTopToAlphabeticDistance()*a)):"bottom"===this._verticalAlign&&(c=d.reduce((k,l)=>k+l.GetHeight()*a+b,0)-this._lineHeight*a,e=e?d.at(-1).GetFontBoundingBoxDescent()*a:0,c=this._height-c-e-2);for(let k=0,l=d.length;k<l;++k){e= d[k];const n=e.GetHeight()*a,p=c;if(this._isBBcodeEnabled){if(c+=0===k?g:n,0<k&&c>this._height-4*a)break}else if(0<k&&c>=this._height-n)break;0<=p&&this._DrawTextLine(e,c,a);this._isBBcodeEnabled||(c+=n);c+=b}}}_DrawTextLine(a,b,c){let d=0;"center"===this._horizontalAlign?d=(this._width-a.GetWidth()*c)/2:"right"===this._horizontalAlign&&(d=this._width-a.GetWidth()*c);a.SetPosX(d);a.SetPosY(b);for(const e of a.fragments())this._DrawFragment(e,d,b,c,a.GetHeight()),d+=e.GetWidth()*c}_DrawFragment(a, b,c,d,e){var g=a.GetStyleTag("offsetx");b+=g?getOffsetParam(g.param,a.GetHeight())*d:0;g=a.GetStyleTag("offsety");c+=g?getOffsetParam(g.param,a.GetHeight())*d:0;a.IsIcon()&&(g=a.GetStyleTag("iconoffsety"),c+=g?getOffsetParam(g.param,a.GetHeight())*d:.2*a.GetHeight()*d);a.SetPosX(b);a.SetPosY(c);g=this._textContext;const k=e/16;e=a.GetWidth()*d;const l=a.GetHeight()*d,n=a.GetHeight()/16;var p=(4+this._lineHeight)*d,r=a.IsText()?a.GetCharacterArray():null;if(-1!==this._drawMaxCharCount){if(this._drawCharCount>= this._drawMaxCharCount)return;a.IsText()&&this._drawCharCount+r.length>this._drawMaxCharCount&&(r=r.slice(0,this._drawMaxCharCount-this._drawCharCount),e=this._MeasureText(a).width*d);this._drawCharCount+=a.GetLength()}var w=a.GetStyleTag("background");const y=a.HasStyleTag("u"),B=a.HasStyleTag("s");if((!a.IsText()||!C3$jscomp$54.IsCharArrayAllWhitespace(r)||w||y||B)&&!a.HasStyleTag("hide")){w&&(this._SetDrawCanvasColor(w.param),g.fillRect(b,c-l,e,l+p));p=a.GetStyleTag("color");this._SetDrawCanvasColor(p? p.param:this._colorStr);w=a.GetStyleTag("opacity");this._SetDrawCanvasOpacity(w?parseFloat(w.param)/100:1);w=(w=a.GetStyleTag("linethickness"))?parseFloat(w.param):1;var C=a.HasStyleTag("stroke");C&&this._SetDrawCanvasLineWith(.5*n*w*this.GetDrawScale());if(a.IsText()){if(r=r.join(""),this._SetDrawFontString(this._GetFontString(!1,a)),fillOrStrokeText(g,C,r,b,c,e),!C&&(this._SetDrawCanvasLineWith(.5*n*w*this.GetDrawScale()),a=a.GetStyleTag("outline")))this._SetDrawCanvasColor(a.param),fillOrStrokeText(g, !0,r,b,c,e)}else a.IsIcon()&&0<a.GetWidth()&&(a=a.GetDrawable(this._iconSet))&&g.drawImage(a,b,c-l,e,l);this._SetDrawCanvasColor(p?p.param:this._colorStr);y&&fillOrStrokeRect(g,C,b,c+d*k,e,d*k*w);B&&(d*=n,g.fillRect(b,c-l/4+d/2-d*w/2,e,d*w))}}_UpdateTexture(){if(!this._renderer.IsContextLost()&&(this._texture||(this._texture=this._renderer.CreateDynamicTexture(this._textCanvas.width,this._textCanvas.height,{mipMap:!0,mipMapQuality:"high"})),this._renderer.UpdateTexture(this._textCanvas,this._texture), this._rcTex.set(0,0,this._width/this._texture.GetWidth(),this._height/this._texture.GetHeight()),this.ontextureupdate))this.ontextureupdate()}GetTexRect(){return this._rcTex}ReleaseTexture(){this._texture&&(this._renderer.IsContextLost()||this._renderer.DeleteTexture(this._texture),this._texture=null)}static OnContextLost(){for(const a of allRendererTexts)a.ReleaseTexture()}static GetAll(){return allRendererTexts.values()}};"use strict";const C3$jscomp$55=self.C3; class WebGLRealTimeElapsedQuery{constructor(a){this._gl=a.GetContext();this._version=a.GetWebGLVersionNumber();this._timerExt=a._GetDisjointTimerQueryExtension();this._query=null;this._hasResult=this._isActive=!1;this._result=0;this._query=1===this._version?this._timerExt.createQueryEXT():this._gl.createQuery()}Release(){this._DeleteQueryObject();this._timerExt=this._gl=null;this._hasResult=!1}_DeleteQueryObject(){this._query&&(1===this._version?this._timerExt.deleteQueryEXT(this._query):this._gl.deleteQuery(this._query), this._query=null)}BeginTimeElapsed(){if(this._isActive)throw Error("query already active");1===this._version?this._timerExt.beginQueryEXT(this._timerExt.TIME_ELAPSED_EXT,this._query):this._gl.beginQuery(this._timerExt.TIME_ELAPSED_EXT,this._query);this._isActive=!0}EndTimeElapsed(){if(!this._isActive)throw Error("query not active");1===this._version?this._timerExt.endQueryEXT(this._timerExt.TIME_ELAPSED_EXT):this._gl.endQuery(this._timerExt.TIME_ELAPSED_EXT);this._isActive=!1}CheckForResult(){if(this._query&& !this._hasResult&&!this._isActive){var a=1===this._version?this._timerExt.getQueryObjectEXT(this._query,this._timerExt.QUERY_RESULT_AVAILABLE_EXT):this._gl.getQueryParameter(this._query,this._gl.QUERY_RESULT_AVAILABLE);var b=this._gl.getParameter(this._timerExt.GPU_DISJOINT_EXT);a&&!b&&(this._result=1===this._version?this._timerExt.getQueryObjectEXT(this._query,this._timerExt.QUERY_RESULT_EXT):this._gl.getQueryParameter(this._query,this._gl.QUERY_RESULT),this._result/=1E9,this._hasResult=!0);(a|| b)&&this._DeleteQueryObject()}}HasResult(){return this._hasResult}GetResult(){if(!this._hasResult)throw Error("no result available");return this._result}} C3$jscomp$55.Gfx.WebGLTimeElapsedQuery=class{constructor(a){this._renderer=a;this._frameNumber=a.GetFrameNumber();this._isActive=!1;this._parentQuery=null;this._isNested=!1;this._realQuery=null;this._queries=[]}Release(){for(const a of this._queries)a instanceof WebGLRealTimeElapsedQuery&&a.Release();C3$jscomp$55.clearArray(this._queries);this._renderer=this._realQuery=this._parentQuery=null}BeginTimeElapsed(){if(this._isActive)throw Error("query already active");const a=this._renderer._GetTimeQueryStack(); 0<a.length?(this._isNested=!0,this._parentQuery=a.at(-1),this._parentQuery._EndReal(),this._parentQuery._queries.push(this)):(this._isNested=!1,this._parentQuery=null);this._isActive=!0;a.push(this);this._StartReal()}EndTimeElapsed(){if(!this._isActive)throw Error("query not active");if(this._renderer._GetTimeQueryStack().pop()!==this)throw Error("can only end most nested query");this._isActive=!1;this._EndReal();this._parentQuery&&(this._parentQuery._StartReal(),this._parentQuery=null)}_StartReal(){this._realQuery= C3$jscomp$55.New(WebGLRealTimeElapsedQuery,this._renderer);this._queries.push(this._realQuery);this._realQuery.BeginTimeElapsed()}_EndReal(){this._realQuery.EndTimeElapsed();this._realQuery=null}CheckForResult(){for(const a of this._queries)a.CheckForResult()}IsNested(){return this._isNested}HasResult(){return this._queries.every(a=>a.HasResult())}GetResult(){return this._queries.reduce((a,b)=>a+b.GetResult(),0)}GetFrameNumber(){return this._frameNumber}};"use strict";const C3$jscomp$56=self.C3; C3$jscomp$56.Gfx.WebGLQueryResultBuffer=class{constructor(a,b=1E3){this._renderer=a;this._maxQueries=b;this._buffer=[];this._renderer._AddQueryResultBuffer(this)}Release(){this.Clear();this._renderer._RemoveQueryResultBuffer(this);this._renderer=null}Clear(){for(const a of this._buffer)a.Release();C3$jscomp$56.clearArray(this._buffer)}AddTimeElapsedQuery(){const a=new C3$jscomp$56.Gfx.WebGLTimeElapsedQuery(this._renderer);this._buffer.push(a);this._buffer.length>this._maxQueries&&this._buffer.shift().Release(); return a}CheckForResults(a){for(const b of this._buffer){if(b.GetFrameNumber()>=a)break;if(b.IsNested())break;b.CheckForResult()}}GetFrameRangeResultSum(a,b){if(b<=a)return NaN;let c=0;for(const d of this._buffer){if(d.GetFrameNumber()>=b)break;if(!(d.GetFrameNumber()<a))if(d.HasResult())c+=d.GetResult();else return NaN}return c}DeleteAllBeforeFrameNumber(a){for(let b=0,c=this._buffer.length;b<c;++b){const d=this._buffer[b];if(d.GetFrameNumber()<a)d.Release();else{0<b&&this._buffer.splice(0,b);break}}}}; "use strict"; const C3$jscomp$57=self.C3,glMatrix$jscomp$6=self.glMatrix,vec4$jscomp$4=glMatrix$jscomp$6.vec4,mat4$jscomp$7=glMatrix$jscomp$6.mat4,DEFAULT_WEBGLRENDERER_OPTS={powerPreference:"default",enableGpuProfiling:!0,alpha:!1,lowLatency:!1,depth:!1,canSampleDepth:!1,maxWebGLVersion:2,failIfMajorPerformanceCaveat:!1},VALID_POWER_PREFERENCES=new Set(["default","low-power","high-performance"]),MAX_INDICES=12E3,LAST_POINT=7996,defaultTexCoordsQuad$jscomp$1=new C3$jscomp$57.Quad(0,0,1,0,1,1,0,1),tmpProjection= mat4$jscomp$7.create(),tmpModelView=mat4$jscomp$7.create(),tmpQuad$jscomp$1=new C3$jscomp$57.Quad,tmpRect$jscomp$1=new C3$jscomp$57.Rect;let loseContextExtension=null;C3$jscomp$57.isDebug&&(self.debug_lose_webgl_context=function(){loseContextExtension?loseContextExtension.loseContext():console.warn("WEBGL_lose_context not supported")},self.debug_restore_webgl_context=function(){loseContextExtension?loseContextExtension.restoreContext():console.warn("WEBGL_lose_context not supported")}); const pendingPolls=new Set;let pollRafId=-1;function CheckPendingPolls(){pollRafId=-1;for(const a of pendingPolls)a.checkFunc()&&(a.resolve(),pendingPolls.delete(a));0<pendingPolls.size&&(pollRafId=self.requestAnimationFrame(CheckPendingPolls))} C3$jscomp$57.Gfx.WebGLRenderer=class extends C3$jscomp$57.Gfx.RendererBase{constructor(a,b){super(b);b=Object.assign({},DEFAULT_WEBGLRENDERER_OPTS,b);if(!VALID_POWER_PREFERENCES.has(b.powerPreference))throw Error("invalid power preference");const c={alpha:!!b.alpha,depth:!1,antialias:!1,powerPreference:b.powerPreference,failIfMajorPerformanceCaveat:!!b.failIfMajorPerformanceCaveat};b.lowLatency&&(c.desynchronized=!0,c.preserveDrawingBuffer=!0);let d=null,e=0;2<=b.maxWebGLVersion&&(d=a.getContext("webgl2", c),e=2);d||(d=a.getContext("webgl",c),e=1);if(!d)throw Error("renderer-unavailable (could not get WebGL context)");this._gl=d;this._attribs=d.getContextAttributes();b.lowLatency&&!this._attribs.desynchronized&&console.info("[WebGLRenderer] Low-latency mode specified but is not supported here");this._versionString=d.getParameter(d.VERSION);this._version=e;this._viewport=vec4$jscomp$4.create();this._didChangeTransform=!1;this._bbProjectionMatrix=mat4$jscomp$7.create();this._usesDepthBuffer=!!b.depth; this._canSampleDepth=!(!b.depth||!b.canSampleDepth);this._isDepthEnabled=this._usesDepthBuffer;this._isDepthSamplingEnabled=!1;this._depthBuffer=null;this._isAutoSizeDepthBuffer=!0;this._depthBufferHeight=this._depthBufferWidth=0;this._pointBuffer=this._indexBuffer=this._texcoordBuffer=this._vertexBuffer=null;this._vertexData=new Float32Array(8E3*this.GetNumVertexComponents());this._indexData=new Uint16Array(MAX_INDICES);this._texcoordData=new Float32Array(16E3);this._pointData=new Float32Array(32E3); this._lastVertexPtr=this._pointPtr=this._texPtr=this._vertexPtr=0;this._spDeviceTransformTextureFill=this._lastProgram=null;this._batch=[];this._topOfBatch=this._batchPtr=0;this._currentRenderTarget=null;this._lastPointZ=0;this._batchState=C3$jscomp$57.New(C3$jscomp$57.Gfx.BatchState,this);this._lastColor=C3$jscomp$57.New(C3$jscomp$57.Color,1,1,1,1);this._lastTexture1=this._lastTexture0=null;this._lastDestBlend=this._lastSrcBlend=0;this._lastPointTexCoords=new C3$jscomp$57.Rect;this._lastScissorRect= C3$jscomp$57.New(C3$jscomp$57.Rect,0,0,-1,-1);this._maxTextureSize=-1;this._highpPrecision=this._maxPointSize=this._minPointSize=0;this._unmaskedRenderer=this._unmaskedVendor="(unavailable)";this._extensions=[];this._isInitialisingAfterContextRestored=!1;this._textureLodExt=this._stdDerivativesExt=this._fragDepthExt=this._depthTextureExt=this._anisotropicExt=this._parallelShaderCompileExt=null;this._maxAnisotropy=0;this._isGpuProfilingEnabled=!!b.enableGpuProfiling;this._timerExt=null;this._allQueryResultBuffers= new Set;this._timeQueryStack=[];this.FillIndexBufferData(this._indexData)}IsWebGL(){return!0}async InitState(){super.InitState();var a=this._gl,b=this.GetNumVertexComponents();this._lastColor.setRgba(1,1,1,1);this._lastTexture1=this._lastTexture0=null;this._pointPtr=this._vertexPtr=0;this._lastVertexPtr=8E3*b-4*b;C3$jscomp$57.clearArray(this._batch);this._topOfBatch=this._batchPtr=0;this._currentRenderTarget=this._lastProgram=null;this._lastPointTexCoords.set(0,0,1,1);this._lastPointZ=0;b=this._batchState; b.currentShader=null;b.currentFramebuffer=null;b.currentFramebufferNoDepth=null;vec4$jscomp$4.set(b.currentColor,1,1,1,1);b.clearColor.setRgba(0,0,0,0);b.pointTexCoords.set(0,0,1,1);a.clearColor(0,0,0,0);a.clear(a.COLOR_BUFFER_BIT);a.enable(a.BLEND);a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA);this._lastSrcBlend=a.ONE;this._lastDestBlend=a.ONE_MINUS_SRC_ALPHA;this._InitBlendModes(a);a.disable(a.CULL_FACE);a.disable(a.STENCIL_TEST);a.disable(a.DITHER);this._usesDepthBuffer?(a.enable(a.DEPTH_TEST),a.depthMask(!0), a.depthFunc(a.LEQUAL)):(a.disable(a.DEPTH_TEST),a.depthMask(!1));this._isDepthEnabled=this._usesDepthBuffer;this._isDepthSamplingEnabled=!1;this._pointBuffer=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,this._pointBuffer);a.bufferData(a.ARRAY_BUFFER,this._pointData.byteLength,a.DYNAMIC_DRAW);this._vertexBuffer=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,this._vertexBuffer);a.bufferData(a.ARRAY_BUFFER,this._vertexData.byteLength,a.DYNAMIC_DRAW);this._texcoordBuffer=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER, this._texcoordBuffer);a.bufferData(a.ARRAY_BUFFER,this._texcoordData.byteLength,a.DYNAMIC_DRAW);this._indexBuffer=a.createBuffer();a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this._indexBuffer);a.bufferData(a.ELEMENT_ARRAY_BUFFER,this._indexData,a.STATIC_DRAW);a.activeTexture(a.TEXTURE0);a.bindTexture(a.TEXTURE_2D,null);this._maxTextureSize=a.getParameter(a.MAX_TEXTURE_SIZE);b=a.getParameter(a.ALIASED_POINT_SIZE_RANGE);this._minPointSize=b[0];this._maxPointSize=b[1];b=a.getShaderPrecisionFormat(a.VERTEX_SHADER, a.HIGH_FLOAT);var c=a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT);this._highpPrecision=b&&c?Math.min(b.precision,c.precision):0;2048<this._maxPointSize&&(this._maxPointSize=2048);this._extensions=a.getSupportedExtensions();if(b=a.getExtension("WEBGL_debug_renderer_info"))this._unmaskedVendor=a.getParameter(b.UNMASKED_VENDOR_WEBGL),this._unmaskedRenderer=a.getParameter(b.UNMASKED_RENDERER_WEBGL);this._parallelShaderCompileExt=a.getExtension("KHR_parallel_shader_compile");C3$jscomp$57.isDebug&& (loseContextExtension=a.getExtension("WEBGL_lose_context"));if(this._isGpuProfilingEnabled)if(1===this.GetWebGLVersionNumber()){if("Chromium"!==C3$jscomp$57.Platform.BrowserEngine||81<=C3$jscomp$57.Platform.BrowserVersionNumber||"undefined"!==typeof document)this._timerExt=a.getExtension("EXT_disjoint_timer_query")}else this._timerExt=a.getExtension("EXT_disjoint_timer_query_webgl2")||a.getExtension("EXT_disjoint_timer_query");this._maxAnisotropy=(this._anisotropicExt=a.getExtension("EXT_texture_filter_anisotropic"))? a.getParameter(this._anisotropicExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0;if(2>this.GetWebGLVersionNumber()&&this._usesDepthBuffer&&this._canSampleDepth&&(this._depthTextureExt=a.getExtension("WEBGL_depth_texture"),!this._depthTextureExt))throw Error("no depth texture support");2>this.GetWebGLVersionNumber()&&(this._fragDepthExt=a.getExtension("EXT_frag_depth"),this._stdDerivativesExt=a.getExtension("OES_standard_derivatives"),this._textureLodExt=a.getExtension("EXT_shader_texture_lod"));a=C3$jscomp$57.Gfx.WebGLShaderProgram; b=a.GetDefaultVertexShaderSource(!1);c=a.GetTextureFillFragmentShaderSource_WebGL1_NoFragDepth();let d=b,e=a.GetPointFragmentShaderSource_WebGL1_NoFragDepth(),g=a.GetPointVertexShaderSource_WebGL1(),k=a.GetTilemapFragmentShaderSource_WebGL1_NoFragDepth(),l=a.GetDefaultVertexShaderSource(!0);var n=!1;this._usesDepthBuffer&&("Safari"!==C3$jscomp$57.Platform.Browser||15.5<=C3$jscomp$57.Platform.BrowserVersionNumber)&&(2>this.GetWebGLVersionNumber()?this._fragDepthExt&&(c=a.GetTextureFillFragmentShaderSource_WebGL1_FragDepthEXT(), e=a.GetPointFragmentShaderSource_WebGL1_FragDepthEXT(),k=a.GetTilemapFragmentShaderSource_WebGL1_FragDepthEXT(),n=!0):(d=a.GetDefaultVertexShaderSource_WebGL2(),c=a.GetTextureFillFragmentShaderSource_WebGL2(),e=a.GetPointFragmentShaderSource_WebGL2(),g=a.GetPointVertexShaderSource_WebGL2(),k=a.GetTilemapFragmentShaderSource_WebGL2(),l=a.GetDefaultVertexShaderSource_WebGL2(!0)));n=a.GetTileRandomizationFragmentShaderSource(this.GetWebGLVersionNumber(),n,this._stdDerivativesExt&&this._textureLodExt); const p=2<=this.GetWebGLVersionNumber()?a.GetDefaultVertexShaderSource_WebGL2():b;a=[[c,d,"<default>"],[c,d,"<default-device-transform>"],[e,g,"<point>"],[a.GetColorFillFragmentShaderSource(),b,"<fill>"],[a.GetLinearGradientFillFragmentShaderSource(),b,"<lineargradient>"],[a.GetPenumbraFillFragmentShaderSource(),b,"<penumbra>"],[a.GetHardEllipseFillFragmentShaderSource(),b,"<hardellipse>"],[a.GetHardEllipseOutlineFragmentShaderSource(),b,"<hardellipseoutline>"],[a.GetSmoothEllipseFillFragmentShaderSource(), b,"<smoothellipse>"],[a.GetSmoothEllipseOutlineFragmentShaderSource(),b,"<smoothellipseoutline>"],[a.GetSmoothLineFillFragmentShaderSource(),b,"<smoothline>"],[k,l,"<tilemap>"],[n,p,"<tilerandomization>"]];a=await Promise.all(a.map(r=>this.CreateShaderProgram({src:r[0],vertexSrc:r[1],name:r[2]})));this._spTextureFill=a[0];this._spDeviceTransformTextureFill=a[1];this._spPoints=a[2];this._spColorFill=a[3];this._spLinearGradientFill=a[4];this._spPenumbraFill=a[5];this._spHardEllipseFill=a[6];this._spHardEllipseOutline= a[7];this._spSmoothEllipseFill=a[8];this._spSmoothEllipseOutline=a[9];this._spSmoothLineFill=a[10];this._spTilemapFill=a[11];this._spTileRandomization=a[12];this.SetTextureFillMode()}async CreateShaderProgram(a){a=await C3$jscomp$57.Gfx.WebGLShaderProgram.Create(this,a);this._AddShaderProgram(a);return a}ResetLastProgram(){this._lastProgram=null}SetSize(a,b,c){if(this._width!==a||this._height!==b||c){this.EndBatch();c=this._gl;var d=this._batchState;this._width=a;this._height=b;this._SetViewport(0, 0,a,b);this.CalculatePerspectiveMatrix(this._bbProjectionMatrix,a/b);this.SetProjectionMatrix(this._bbProjectionMatrix);this._spDeviceTransformTextureFill&&(c.useProgram(this._spDeviceTransformTextureFill.GetShaderProgram()),this._spDeviceTransformTextureFill._UpdateDeviceTransformUniforms(this._matP),this._lastProgram=this._spDeviceTransformTextureFill,this._batchState.currentShader=this._spDeviceTransformTextureFill);c.bindTexture(c.TEXTURE_2D,null);c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D, null);c.activeTexture(c.TEXTURE0);this._lastTexture1=this._lastTexture0=null;this._usesDepthBuffer&&this._isAutoSizeDepthBuffer&&this._SetDepthBufferSize(this._width,this._height);this._currentRenderTarget&&this._currentRenderTarget._Resize(this._width,this._height);c.bindFramebuffer(c.FRAMEBUFFER,null);this._currentRenderTarget=null;d.currentFramebuffer=null;d.currentFramebufferNoDepth=null}}_SetDepthBufferSize(a,b){const c=this._gl;this._depthBuffer&&this._depthBufferWidth===a&&this._depthBufferHeight=== b||(this._canSampleDepth?(this._depthBuffer&&c.deleteTexture(this._depthBuffer),this._depthBuffer=c.createTexture(),c.bindTexture(c.TEXTURE_2D,this._depthBuffer),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),2<=this.GetWebGLVersionNumber()?c.texImage2D(c.TEXTURE_2D,0,c.DEPTH24_STENCIL8,a,b,0,c.DEPTH_STENCIL, c.UNSIGNED_INT_24_8,null):this._depthTextureExt&&c.texImage2D(c.TEXTURE_2D,0,c.DEPTH_STENCIL,a,b,0,c.DEPTH_STENCIL,this._depthTextureExt.UNSIGNED_INT_24_8_WEBGL,null),c.bindTexture(c.TEXTURE_2D,null)):(this._depthBuffer&&c.deleteRenderbuffer(this._depthBuffer),this._depthBuffer=c.createRenderbuffer(),c.bindRenderbuffer(c.RENDERBUFFER,this._depthBuffer),c.renderbufferStorage(c.RENDERBUFFER,2<=this._version?c.DEPTH24_STENCIL8:c.DEPTH_STENCIL,a,b),c.bindRenderbuffer(c.RENDERBUFFER,null)),this._depthBufferWidth= a,this._depthBufferHeight=b)}SetFixedSizeDepthBuffer(a,b){this._usesDepthBuffer&&(this._isAutoSizeDepthBuffer=!1,this._SetDepthBufferSize(a,b))}SetAutoSizeDepthBuffer(){this._usesDepthBuffer&&(this._isAutoSizeDepthBuffer=!0,this._SetDepthBufferSize(this._width,this._height))}_SetViewport(a,b,c,d){const e=this._viewport;if(e[0]!==a||e[1]!==b||e[2]!==c||e[3]!==d)this.PushBatch().InitSetViewport(a,b,c,d),vec4$jscomp$4.set(e,a,b,c,d),this._topOfBatch=0}SetFovY(a){super.SetFovY(a);this.CalculatePerspectiveMatrix(this._bbProjectionMatrix, this._width/this._height)}SetNearZ(a){super.SetNearZ(a);this.CalculatePerspectiveMatrix(this._bbProjectionMatrix,this._width/this._height)}SetFarZ(a){super.SetFarZ(a);this.CalculatePerspectiveMatrix(this._bbProjectionMatrix,this._width/this._height)}SetProjectionMatrix(a){mat4$jscomp$7.exactEquals(this._matP,a)||(this.PushBatch().InitSetProjection(a),mat4$jscomp$7.copy(this._matP,a),this._topOfBatch=0,this._didChangeTransform=!0)}SetDefaultRenderTargetProjectionState(){let a,b;var c=this._currentRenderTarget; null===c?(a=this._bbProjectionMatrix,b=this.GetWidth(),c=this.GetHeight()):(a=c.GetProjectionMatrix(),b=c.GetWidth(),c=c.GetHeight());this.SetProjectionMatrix(a);this._SetViewport(0,0,b,c)}SetModelViewMatrix(a){mat4$jscomp$7.exactEquals(this._matMV,a)||(this.PushBatch().InitSetModelView(a),mat4$jscomp$7.copy(this._matMV,a),this._topOfBatch=0,this._didChangeTransform=!0)}ResetDidChangeTransformFlag(){this._didChangeTransform=!1}DidChangeTransform(){return this._didChangeTransform}GetBatchState(){return this._batchState}PushBatch(){const a= this._batch;this._batchPtr===a.length&&a.push(new C3$jscomp$57.Gfx.WebGLBatchJob(this._batchState));return a[this._batchPtr++]}EndBatch(){0===this._batchPtr||this.IsContextLost()||(this._WriteBuffers(),this._ExecuteBatch(),this._topOfBatch=this._pointPtr=this._texPtr=this._vertexPtr=this._batchPtr=0)}_WriteBuffers(){const a=this._gl;0<this._pointPtr&&(a.bindBuffer(a.ARRAY_BUFFER,this._pointBuffer),a.bufferSubData(a.ARRAY_BUFFER,0,this._pointData.subarray(0,this._pointPtr)));0<this._vertexPtr&&(a.bindBuffer(a.ARRAY_BUFFER, this._vertexBuffer),a.bufferSubData(a.ARRAY_BUFFER,0,this._vertexData.subarray(0,this._vertexPtr)),a.bindBuffer(a.ARRAY_BUFFER,this._texcoordBuffer),a.bufferSubData(a.ARRAY_BUFFER,0,this._texcoordData.subarray(0,this._texPtr)))}_ExecuteBatch(){const a=this._batch;for(let b=0,c=this._batchPtr;b<c;++b)a[b].Run()}GetOpacity(){return this._lastColor.getA()}SetColorRgba(a,b,c,d){const e=this._lastColor;e.equalsRgba(a,b,c,d)||(e.setRgba(a,b,c,d),this.PushBatch().InitSetColor(e),this._topOfBatch=0,this._currentStateGroup= null)}SetOpacity(a){const b=this._lastColor;b.getA()!==a&&(b.setA(a),this.PushBatch().InitSetColor(b),this._topOfBatch=0,this._currentStateGroup=null)}SetColor(a){const b=this._lastColor;b.equals(a)||(b.set(a),this.PushBatch().InitSetColor(b),this._topOfBatch=0,this._currentStateGroup=null)}ResetColor(){this.SetColorRgba(1,1,1,1)}GetColor(){return this._lastColor}SetTexture(a){a!==this._lastTexture0&&(this.PushBatch().InitSetTexture(a),this._lastTexture0=a,this._topOfBatch=0)}_ResetLastTexture(){this._lastTexture0= null}SetBlendMode(a){a=this._GetBlendByIndex(a);this._SetBlend(a[0],a[1])}SetNamedBlendMode(a){a=this.GetNamedBlend(a);this._SetBlend(a.srcBlend,a.destBlend)}_SetBlend(a,b){if(a!==this._lastSrcBlend||b!==this._lastDestBlend)this.PushBatch().InitSetBlend(a,b),this._lastSrcBlend=a,this._lastDestBlend=b,this._topOfBatch=0,this._currentStateGroup=null}IsPremultipliedAlphaBlend(){return this._lastSrcBlend===this._gl.ONE&&this._lastDestBlend===this._gl.ONE_MINUS_SRC_ALPHA}SetAlphaBlend(){this._SetBlend(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA)}SetNoPremultiplyAlphaBlend(){this._SetBlend(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA)}SetCopyBlend(){this._SetBlend(this._gl.ONE,this._gl.ZERO)}Rect(a){this.Rect2(a.getLeft(),a.getTop(),a.getRight(),a.getBottom())}Rect2(a,b,c,d){this.Quad2(a,b,c,b,c,d,a,d)}_ExtendQuadBatch(){let a=this._vertexPtr;a>=this._lastVertexPtr&&(this.EndBatch(),a=0);1===this._topOfBatch?this._batch[this._batchPtr-1]._indexCount+=6:(this.PushBatch().InitQuad(a,6),this._topOfBatch=1)}_WriteQuadToVertexBuffer(a){a.writeToTypedArray3D(this._vertexData, this._vertexPtr,this._baseZ+this._currentZ);this._vertexPtr+=12}Quad(a){this._ExtendQuadBatch();this._WriteQuadToVertexBuffer(a);defaultTexCoordsQuad$jscomp$1.writeToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad2(a,b,c,d,e,g,k,l){this._ExtendQuadBatch();const n=this._vertexData;let p=this._vertexPtr;const r=this._baseZ+this._currentZ;n[p++]=a;n[p++]=b;n[p++]=r;n[p++]=c;n[p++]=d;n[p++]=r;n[p++]=e;n[p++]=g;n[p++]=r;n[p++]=k;n[p++]=l;n[p++]=r;this._vertexPtr=p;defaultTexCoordsQuad$jscomp$1.writeToTypedArray(this._texcoordData, this._texPtr);this._texPtr+=8}Quad3(a,b){this._ExtendQuadBatch();this._WriteQuadToVertexBuffer(a);b.writeAsQuadToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad4(a,b){this._ExtendQuadBatch();this._WriteQuadToVertexBuffer(a);b.writeToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad3D(a,b,c,d,e,g,k,l,n,p,r,w,y){this._ExtendQuadBatch();const B=this._vertexData;let C=this._vertexPtr;const E=this._baseZ+this._currentZ;B[C++]=a;B[C++]=b;B[C++]=E+c;B[C++]=d;B[C++]=e;B[C++]= E+g;B[C++]=k;B[C++]=l;B[C++]=E+n;B[C++]=p;B[C++]=r;B[C++]=E+w;this._vertexPtr=C;y.writeAsQuadToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad3D2(a,b,c,d,e,g,k,l,n,p,r,w,y){this._ExtendQuadBatch();const B=this._vertexData;let C=this._vertexPtr;const E=this._baseZ+this._currentZ;B[C++]=a;B[C++]=b;B[C++]=E+c;B[C++]=d;B[C++]=e;B[C++]=E+g;B[C++]=k;B[C++]=l;B[C++]=E+n;B[C++]=p;B[C++]=r;B[C++]=E+w;this._vertexPtr=C;y.writeToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}FullscreenQuad(a, b){mat4$jscomp$7.copy(tmpProjection,this._matP);mat4$jscomp$7.copy(tmpModelView,this._matMV);this.SetDefaultRenderTargetProjectionState();const [c,d]=this.GetRenderTargetSize(this._currentRenderTarget);var e=this.CalculateLookAtModelView2(0,0,this.GetDefaultCameraZ(d),0,0,0,d);this.SetModelViewMatrix(e);if("crop"===a&&this._currentRenderTarget&&b){a=this._width/2;e=this._height/2;const l=b.GetWidth();b=b.GetHeight();var g=this._currentRenderTarget.GetWidth(),k=this._currentRenderTarget.GetHeight(); g=Math.min(g,l);const n=Math.min(k,b),p=Math.max(b-k,0);k=Math.max(k-b,0);tmpRect$jscomp$1.set(-a,e-k,-a+g,e-n-k);tmpQuad$jscomp$1.setFromRect(tmpRect$jscomp$1);tmpRect$jscomp$1.set(0,p,g,n+p);tmpRect$jscomp$1.divide(l,b);this.Quad3(tmpQuad$jscomp$1,tmpRect$jscomp$1)}else a=c/2,e=d/2,this.Rect2(-a,e,a,-e);this.SetProjectionMatrix(tmpProjection);this.SetModelViewMatrix(tmpModelView)}StartRenderingPoints(a){this._lastPointTexCoords.equals(a)||(this._lastPointTexCoords.copy(a),this.PushBatch().InitSetPointTexCoords(a), this._topOfBatch=0)}FinishRenderingPoints(){}Point(a,b,c,d){this._pointPtr>=LAST_POINT&&this.EndBatch();let e=this._pointPtr;var g=this._baseZ+this._currentZ;2===this._topOfBatch&&this._lastPointZ===g?this._batch[this._batchPtr-1]._indexCount++:(this.PushBatch().InitPoints(e,g),this._topOfBatch=2,this._lastPointZ=g);g=this._pointData;g[e++]=a;g[e++]=b;g[e++]=c;g[e++]=d;this._pointPtr=e}SetProgram(a){this._lastProgram!==a&&(this.PushBatch().InitSetProgram(a),this._lastProgram=a,this._topOfBatch=0, this._currentStateGroup=null)}SetDeviceTransformTextureFillMode(){this.SetProgram(this._spDeviceTransformTextureFill)}SetGradientColor(a){this.PushBatch().InitSetGradientColor(a);this._topOfBatch=0}SetEllipseParams(a,b,c=1){this.PushBatch().InitSetEllipseParams(a,b,c);this._topOfBatch=0}SetTilemapInfo(a,b,c,d,e,g,k){if(this._lastProgram!==this._spTilemapFill)throw Error("must set tilemap fill mode first");this.PushBatch().InitSetTilemapInfo(a,b,c,d,e,g,k);this._topOfBatch=0}SetTileRandomizationInfo(a, b,c,d,e,g,k){if(this._lastProgram!==this._spTileRandomization)throw Error("must set tile randomization mode first");this.PushBatch().InitSetTileRandomizationInfo(a,b,c,d,e,g,k);this._topOfBatch=0}SetProgramParameters(a,b,c,d,e,g,k,l,n,p,r){const w=this._lastProgram;r%=10800;if(w._hasAnyOptionalUniforms&&!w.AreOptionalUniformsAlreadySetInBatch(b,c,d,e,g,k,l,n,p,r)){var y=this.PushBatch();y.InitSetProgramParameters();w.SetOptionalUniformsInBatch(b,c,d,e,g,k,l,n,p,r);var B=y._mat4param;B[0]=g;B[1]=k; b.writeToTypedArray(B,2);B[6]=n;B[7]=p;c.writeToTypedArray(B,12);b=y._colorParam;e.writeToTypedArray(b,0);e=b[1];b[1]=b[3];b[3]=e;d.writeToTypedArray(y._srcOriginRect,0);y._startIndex=r;y._indexCount=l;w._uSamplerBack.IsUsed()?y._texParam=a?a.GetTexture():null:y._texParam=null;this._topOfBatch=0}}SetProgramCustomParameters(a){const b=this._lastProgram;if(0!==a.length&&!b.AreCustomParametersAlreadySetInBatch(a)){var c=this.PushBatch();c.InitSetProgramCustomParameters();b.SetCustomParametersInBatch(a); C3$jscomp$57.shallowAssignArray(c._shaderParams,a);this._topOfBatch=0}}ClearRgba(a,b,c,d){this.PushBatch().InitClearSurface2(a,b,c,d);this._topOfBatch=0}Clear(a){this.PushBatch().InitClearSurface(a);this._topOfBatch=0}Start(){}Finish(){super.Finish();this._gl.flush()}ClearDepth(){this._usesDepthBuffer&&this._currentRenderTarget&&this._currentRenderTarget.HasDepthBuffer()&&(this.PushBatch().InitClearDepth(this._isDepthEnabled),this._topOfBatch=0)}SetDepthEnabled(a){a=!!a;this._isDepthEnabled!==a&& this._usesDepthBuffer&&(this._isDepthEnabled=a,this.PushBatch().InitSetDepthEnabled(a),this._topOfBatch=0)}IsDepthEnabled(){return this._isDepthEnabled}_GetDepthBuffer(){return this._depthBuffer}_CanSampleDepth(){return this._canSampleDepth}SetDepthSamplingEnabled(a){a=!!a;if(this._canSampleDepth&&this._isDepthSamplingEnabled!==a){if(a&&this.IsDepthEnabled())throw Error("depth still enabled");this._isDepthSamplingEnabled=a;this.PushBatch().InitSetDepthSamplingEnabled(a);this._topOfBatch=0}}SetScissorRect(a, b,c,d,e=0){a=Math.floor(a);b=Math.floor(b);c=Math.floor(c);d=Math.floor(d);this._lastScissorRect.equalsWH(a,b,c,d)||(this._lastScissorRect.setWH(a,b,c,d),b=(e||this.GetRenderTargetSize(this.GetRenderTarget())[1])-b-d,this.PushBatch().InitSetScissor(!0,a,b,c,d),this._topOfBatch=0)}RemoveScissorRect(){-1!==this._lastScissorRect.getRight()&&(this._lastScissorRect.set(0,0,-1,-1),this.PushBatch().InitSetScissor(!1,0,0,0,0),this._topOfBatch=0)}CheckForQueryResults(){for(const a of this._allQueryResultBuffers)a.CheckForResults(this._frameNumber)}IsContextLost(){return!this._gl|| this._gl.isContextLost()||this._isInitialisingAfterContextRestored}OnContextLost(){super.OnDeviceOrContextLost();C3$jscomp$57.Gfx.WebGLRendererTexture.OnContextLost();C3$jscomp$57.Gfx.WebGLRenderTarget.OnContextLost();C3$jscomp$57.Gfx.RendererText.OnContextLost();for(const a of this._allQueryResultBuffers)a.Clear();this._extensions=[];this._textureLodExt=this._stdDerivativesExt=this._fragDepthExt=this._depthTextureExt=this._anisotropicExt=this._parallelShaderCompileExt=this._timerExt=null;this._maxAnisotropy= 0;this._unmaskedRenderer=this._unmaskedVendor="(unavailable)";this._depthBuffer=this._spDeviceTransformTextureFill=this._lastProgram=null;for(const a of this._stateGroups.values())a.OnContextLost()}async OnContextRestored(){this._isInitialisingAfterContextRestored=!0;await this.InitState();this._isInitialisingAfterContextRestored=!1;for(const a of this._stateGroups.values())a.OnContextRestored(this);this.SetSize(this._width,this._height,!0)}CreateStaticTexture(a,b){if(this.IsContextLost())throw Error("context lost"); this.EndBatch();const c=C3$jscomp$57.New(C3$jscomp$57.Gfx.WebGLRendererTexture,this);c._CreateStatic(a,b);return c}async CreateStaticTextureAsync(a,b){if(this.IsContextLost())throw Error("context lost");b=Object.assign({},b);if(!C3$jscomp$57.Supports.ImageBitmapOptions||"Safari"===C3$jscomp$57.Platform.Browser&&a instanceof ImageData&&"undefined"!==typeof Image){if(a instanceof Blob){if("undefined"===typeof Image)throw Error("texture upload variant not supported in worker");a=await C3$jscomp$57.BlobToImage(a)}return await C3$jscomp$57.Asyncify(()=> this.CreateStaticTexture(a,b))}let c=await createImageBitmap(a,{premultiplyAlpha:"premultiply"});const d=b.wrapX&&"clamp-to-edge"!==b.wrapX||b.wrapY&&"clamp-to-edge"!==b.wrapY,e=C3$jscomp$57.isPOT(c.width)&&C3$jscomp$57.isPOT(c.height);this.SupportsNPOTTextures()||e||!d?b.premultiplyAlpha=!1:C3$jscomp$57.Supports.ImageBitmapOptionsResize?(c=await createImageBitmap(a,{premultiplyAlpha:"premultiply",resizeWidth:C3$jscomp$57.nextHighestPowerOfTwo(c.width),resizeHeight:C3$jscomp$57.nextHighestPowerOfTwo(c.height)}), b.premultiplyAlpha=!1):c=await createImageBitmap(a,{premultiplyAlpha:"none"});return await C3$jscomp$57.Asyncify(()=>this.CreateStaticTexture(c,b))}CreateDynamicTexture(a,b,c){this.EndBatch();const d=C3$jscomp$57.New(C3$jscomp$57.Gfx.WebGLRendererTexture,this);d._CreateDynamic(a,b,c);return d}UpdateTexture(a,b,c){this.EndBatch();b._Update(a,c)}DeleteTexture(a){a&&(a.SubtractReference(),0<a.GetReferenceCount()||(this.EndBatch(),a===this._lastTexture0&&(this._gl.bindTexture(this._gl.TEXTURE_2D,null), this._lastTexture0=null),a===this._lastTexture1&&(this._gl.activeTexture(this._gl.TEXTURE1),this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._gl.activeTexture(this._gl.TEXTURE0),this._lastTexture1=null),a._Delete()))}CreateRenderTarget(a){let b=this._width,c=this._height,d=!0;a&&("number"===typeof a.width&&(b=a.width,d=!1),"number"===typeof a.height&&(c=a.height,d=!1));if(0>=b||0>=c)throw Error("invalid size");this.EndBatch();const e=C3$jscomp$57.New(C3$jscomp$57.Gfx.WebGLRenderTarget,this);e._Create(b, c,Object.assign({isDefaultSize:d},a));this._currentRenderTarget=null;this._batchState.currentFramebuffer=null;this._batchState.currentFramebufferNoDepth=null;return e}SetRenderTarget(a,b=!0){a!==this._currentRenderTarget&&(a&&a.IsDefaultSize()&&a._Resize(this._width,this._height),this.PushBatch().InitSetRenderTarget(a),this._currentRenderTarget=a,this._topOfBatch=0,b&&this.SetDefaultRenderTargetProjectionState())}GetRenderTarget(){return this._currentRenderTarget}GetRenderTargetSize(a){return a?[a.GetWidth(), a.GetHeight()]:[this._width,this._height]}CopyRenderTarget(a,b="stretch"){2>this._version||this._currentRenderTarget&&0<this._currentRenderTarget.GetMultisampling()?(this.SetCopyBlend(),this.ResetColor(),this.DrawRenderTarget(a,b)):(this.PushBatch().InitBlitFramebuffer(a,this._currentRenderTarget,b),this._topOfBatch=0)}DrawRenderTarget(a,b="stretch"){a=a.GetTexture();if(!a)throw Error("not a texture-backed render target");this.SetTexture(a);this.FullscreenQuad(b,a)}InvalidateRenderTarget(a){2>this._version|| (this.PushBatch().InitInvalidateFramebuffer(a._GetFramebuffer()),this._topOfBatch=0)}DeleteRenderTarget(a){this.SetRenderTarget(null);this.EndBatch();const b=a.GetTexture();b===this._lastTexture0&&(this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._lastTexture0=null);b===this._lastTexture1&&(this._gl.activeTexture(this._gl.TEXTURE1),this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._gl.activeTexture(this._gl.TEXTURE0),this._lastTexture1=null);a._Delete()}async ReadBackRenderTargetToImageData(a, b,c){this.EndBatch();const d=this._currentRenderTarget;if(a){var e=a.GetWidth();var g=a.GetHeight();var k=a._GetFramebuffer()}else e=this.GetWidth(),g=this.GetHeight(),k=null;let l=a=0;var n=e,p=g;c&&(a=C3$jscomp$57.clamp(Math.floor(c.getLeft()),0,e-1),l=C3$jscomp$57.clamp(Math.floor(c.getTop()),0,g-1),n=c.width(),n=0===n?e-a:C3$jscomp$57.clamp(Math.floor(n),0,e-a),p=c.height(),p=0===p?g-l:C3$jscomp$57.clamp(Math.floor(p),0,g-l),l=g-(l+p));const r=this._gl;r.bindFramebuffer(r.FRAMEBUFFER,k);g=()=> {r.bindFramebuffer(r.FRAMEBUFFER,null);this._currentRenderTarget=null;this._batchState.currentFramebuffer=null;this._batchState.currentFramebufferNoDepth=null;this.SetRenderTarget(d)};if(!b&&2<=this.GetWebGLVersionNumber()){r.bindFramebuffer(r.READ_FRAMEBUFFER,k);k=r.createBuffer();c=n*p*4;e=r.PIXEL_PACK_BUFFER;r.bindBuffer(e,k);r.bufferData(e,c,r.STREAM_READ);r.readPixels(a,l,n,p,r.RGBA,r.UNSIGNED_BYTE,0);r.bindFramebuffer(r.READ_FRAMEBUFFER,null);r.bindBuffer(e,null);g();const w=r.fenceSync(r.SYNC_GPU_COMMANDS_COMPLETE, 0);await this._WaitForObjectReady(()=>r.getSyncParameter(w,r.SYNC_STATUS)===r.SIGNALED);r.deleteSync(w);b=new ImageData(n,p);r.bindBuffer(e,k);r.getBufferSubData(e,0,new Uint8Array(b.data.buffer),0,c);r.bindBuffer(e,null);r.deleteBuffer(k)}else b=new ImageData(n,p),r.readPixels(a,l,n,p,r.RGBA,r.UNSIGNED_BYTE,new Uint8Array(b.data.buffer)),g();return b}CoplanarStartStencilPass(){this.SetDepthEnabled(!0);this.PushBatch().InitCoplanarStartStencilPass();this._topOfBatch=0}CoplanarStartColorPass(){this.SetDepthEnabled(!1); this.PushBatch().InitCoplanarStartColorPass();this._topOfBatch=0}CoplanarRestoreStandardRendering(){this.SetDepthEnabled(!0);this.PushBatch().InitCoplanarRestore();this._topOfBatch=0}StartQuery(a){this.SupportsGPUProfiling()&&(this.PushBatch().InitStartQuery(a),this._topOfBatch=0)}EndQuery(a){this.SupportsGPUProfiling()&&(this.PushBatch().InitEndQuery(a),this._topOfBatch=0)}_WaitForObjectReady(a){const b=new Promise(c=>pendingPolls.add({resolve:c,checkFunc:a}));-1===pollRafId&&(pollRafId=self.requestAnimationFrame(CheckPendingPolls)); return b}IsDesynchronized(){return!!this._attribs.desynchronized}GetEstimatedBackBufferMemoryUsage(){return this._width*this._height*(this._attribs.alpha?4:3)}GetEstimatedRenderBufferMemoryUsage(){let a=0;for(const b of C3$jscomp$57.Gfx.WebGLRenderTarget.allRenderTargets())b.GetTexture()||(a+=b.GetEstimatedMemoryUsage());return a}GetEstimatedTextureMemoryUsage(){let a=0;for(const b of C3$jscomp$57.Gfx.WebGLRendererTexture.allTextures())a+=b.GetEstimatedMemoryUsage();return a}GetEstimatedTotalMemoryUsage(){return this.GetEstimatedBackBufferMemoryUsage()+ this.GetEstimatedRenderBufferMemoryUsage()+this.GetEstimatedTextureMemoryUsage()}GetWebGLVersionString(){return this._versionString}GetWebGLVersionNumber(){return this._version}GetDisplayName(){return"webgl"+this.GetWebGLVersionNumber()}SupportsNPOTTextures(){return 2<=this.GetWebGLVersionNumber()}GetMaxTextureSize(){return this._maxTextureSize}GetMinPointSize(){return this._minPointSize}GetMaxPointSize(){return this._maxPointSize}SupportsHighP(){return 0!==this._highpPrecision}GetHighPPrecision(){return this._highpPrecision}GetUnmaskedVendor(){return this._unmaskedVendor}GetUnmaskedRenderer(){return this._unmaskedRenderer}GetWebGLExtensionsAnalyticsString(){if(2<= this.GetWebGLVersionNumber())return"webgl2";const a=[];this._fragDepthExt&&a.push("EXT_frag_depth");this._stdDerivativesExt&&a.push("OES_standard_derivatives");this._textureLodExt&&a.push("EXT_shader_texture_lod");return 0<a.length?"webgl1:"+a.join(","):"webgl1:none"}GetExtensions(){return this._extensions}SupportsGPUProfiling(){return!!this._timerExt}_GetDisjointTimerQueryExtension(){return this._timerExt}_GetParallelShaderCompileExtension(){return this._parallelShaderCompileExt}_GetAnisotropicExtension(){return this._anisotropicExt}_GetMaxAnisotropy(){return this._maxAnisotropy}_AddQueryResultBuffer(a){this._allQueryResultBuffers.add(a)}_RemoveQueryResultBuffer(a){this._allQueryResultBuffers.delete(a)}_GetTimeQueryStack(){return this._timeQueryStack}GetContext(){return this._gl}_InitBlendModes(a){this._InitBlendModeData([["normal", a.ONE,a.ONE_MINUS_SRC_ALPHA],["additive",a.ONE,a.ONE],["xor",a.ONE,a.ONE_MINUS_SRC_ALPHA],["copy",a.ONE,a.ZERO],["destination-over",a.ONE_MINUS_DST_ALPHA,a.ONE],["source-in",a.DST_ALPHA,a.ZERO],["destination-in",a.ZERO,a.SRC_ALPHA],["source-out",a.ONE_MINUS_DST_ALPHA,a.ZERO],["destination-out",a.ZERO,a.ONE_MINUS_SRC_ALPHA],["source-atop",a.DST_ALPHA,a.ONE_MINUS_SRC_ALPHA],["destination-atop",a.ONE_MINUS_DST_ALPHA,a.SRC_ALPHA]])}CreateRendererText(){return C3$jscomp$57.New(C3$jscomp$57.Gfx.RendererText, this)}CreateWebGLText(){return this.CreateRendererText()}};"use strict";const DEFAULT_CTOR_OPTS={getDrawSize:null,getRenderTarget:null,releaseRenderTarget:null,getTime:null,redraw:null}; self.C3.Gfx.EffectChainManager=class{constructor(a){a=Object.assign({},DEFAULT_CTOR_OPTS,a);this._cbGetDrawSize=a.getDrawSize;this._cbGetRenderTarget=a.getRenderTarget;this._cbReleaseRenderTarget=a.releaseRenderTarget;this._cbGetTime=a.getTime;this._cbRedraw=a.redraw;this._webgpuBackTexture=null;this._allEffectChains=new Set}_AddEffectChain(a){this._allEffectChains.add(a)}_RemoveEffectChain(a){this._allEffectChains.delete(a)}OnContextLost(){this._webgpuBackTexture=null;for(const a of this._allEffectChains)a.OnContextLost()}GetDrawSize(a){return this._cbGetDrawSize? this._cbGetDrawSize(a):[a.GetWidth(),a.GetHeight()]}GetRenderTarget(a){return this._cbGetRenderTarget(a)}ReleaseRenderTarget(a,b){this._cbReleaseRenderTarget(a,b)}GetTime(){return this._cbGetTime()}Redraw(a){this._cbRedraw(a)}_GetWebGPUBackTexture(a,b,c){!this._webgpuBackTexture||this._webgpuBackTexture.GetWidth()===b&&this._webgpuBackTexture.GetHeight()===c||(a.DeleteTexture(this._webgpuBackTexture),this._webgpuBackTexture=null);null===this._webgpuBackTexture&&(this._webgpuBackTexture=a.CreateStaticTexture(null, {width:b,height:c,sampling:"nearest",mipMap:!1}));return this._webgpuBackTexture}};"use strict"; const C3$jscomp$59=self.C3,mat4$jscomp$8=self.glMatrix.mat4,tempRect=C3$jscomp$59.New(C3$jscomp$59.Rect),tempRect2=C3$jscomp$59.New(C3$jscomp$59.Rect),tempRect3=C3$jscomp$59.New(C3$jscomp$59.Rect),tempRect4=C3$jscomp$59.New(C3$jscomp$59.Rect),tempMat4a=mat4$jscomp$8.create(),tempMat4b$jscomp$1=mat4$jscomp$8.create(),DEFAULT_CTOR_OPTS$jscomp$1={drawContent:null,getSourceTextureInfo:null,getShaderParameters:null,invalidateRenderTargets:!1},DEFAULT_BUILDSTEPS_OPTS={indexMap:null,forcePreDraw:!1,forcePostDraw:!1, is3D:!1,isSourceTextureRotated:!1,isRotatedOrNegativeSizeInstance:!1,useFullSurface:!1}; C3$jscomp$59.Gfx.EffectChain=class{constructor(a,b){b=Object.assign({},DEFAULT_CTOR_OPTS$jscomp$1,b);this._manager=a;this._cbDrawContent=b.drawContent;this._cbGetSourceTextureInfo=b.getSourceTextureInfo;this._cbGetShaderParameters=b.getShaderParameters;this._cbDrawContentHook=null;this._shaderProgramList=[];this._shaderProgramIndices=[];this._steps=[];this._needsRebuild=!1;this._blendMode=0;this._isSourceTextureRotated=this._useFullSurface=this._canUseFastPath=this._depthEnabledAtStart=this._didChangeTransform= this._useCopyTextureBackgroundSampling=this._isAnyIsSrcTexRotated=this._isAnyShaderCrossSampling=this._isAnyShaderBackgroundBlending=this._isAnyShaderDepthSampling=this._isAnyShaderAnimated=!1;this._numTempSurfacesRequired=0;this._renderTargets=[null,null,null];this._invalidateRenderTargets=!!b.invalidateRenderTargets;this._drawHeight=this._drawWidth=this._boxExtendVertical=this._boxExtendHorizontal=0;this._contextObject=this._contentObject=null;this._layoutRect=C3$jscomp$59.New(C3$jscomp$59.Rect); this._drawSurfaceRect=C3$jscomp$59.New(C3$jscomp$59.Rect);this._rcTexOriginal=C3$jscomp$59.New(C3$jscomp$59.Rect);this._rcTexBounce=C3$jscomp$59.New(C3$jscomp$59.Rect);this._rcTexDest=C3$jscomp$59.New(C3$jscomp$59.Rect);this._layerScale=this._devicePixelRatio=1;this._time=this._layerAngle=0;this._backTex=this._destRenderTarget=null;this._compositOffY=this._compositOffX=0;this._updateOwnProjection=!1;this._projectionMatrix=mat4$jscomp$8.create();this._modelViewMatrix=mat4$jscomp$8.create();this._manager._AddEffectChain(this)}Release(){this._manager._RemoveEffectChain(this); C3$jscomp$59.clearArray(this._steps);C3$jscomp$59.clearArray(this._shaderProgramList);C3$jscomp$59.clearArray(this._shaderProgramIndices);this._cbGetShaderParameters=this._cbGetSourceTextureInfo=this._cbDrawContent=this._contextObject=this._contentObject=null}OnContextLost(){this._needsRebuild=!0;C3$jscomp$59.clearArray(this._steps);C3$jscomp$59.clearArray(this._shaderProgramList);C3$jscomp$59.clearArray(this._shaderProgramIndices)}NeedsRebuild(){return this._needsRebuild}BuildSteps(a,b){b=Object.assign({}, DEFAULT_BUILDSTEPS_OPTS,b);C3$jscomp$59.clearArray(this._steps);this._boxExtendVertical=this._boxExtendHorizontal=0;this._useCopyTextureBackgroundSampling=this._isAnyIsSrcTexRotated=this._isAnyShaderCrossSampling=this._isAnyShaderBackgroundBlending=this._isAnyShaderDepthSampling=this._isAnyShaderAnimated=!1;this._numTempSurfacesRequired=0;this._isSourceTextureRotated=!!b.isSourceTextureRotated;this._useFullSurface=!!b.useFullSurface;this._needsRebuild=!1;C3$jscomp$59.shallowAssignArray(this._shaderProgramList, a);if(0!==a.length){if(b.indexMap){if(b.indexMap.length!==a.length)throw Error("incorrect indexMap length");C3$jscomp$59.shallowAssignArray(this._shaderProgramIndices,b.indexMap)}else{C3$jscomp$59.clearArray(this._shaderProgramIndices);for(let e=0,g=a.length;e<g;++e)this._shaderProgramIndices.push(e)}for(var c of a)this._boxExtendHorizontal+=c.GetBoxExtendHorizontal(),this._boxExtendVertical+=c.GetBoxExtendVertical(),c.IsAnimated()&&(this._isAnyShaderAnimated=!0),c.UsesDepth()&&(this._isAnyShaderDepthSampling= !0),c.BlendsBackground()&&(this._isAnyShaderBackgroundBlending=!0),c.UsesCrossSampling()&&(this._isAnyShaderCrossSampling=!0),c.UsesIsSrcTexRotated()&&(this._isAnyIsSrcTexRotated=!0);this._useCopyTextureBackgroundSampling=this._ShouldUseCopyTextureBackgroundSampling(a[0].GetRenderer());c=this._ShouldPreDraw(a[0],b);b=this._ShouldPostDraw(a.at(-1),b);if(1!==a.length||c||b){this._canUseFastPath=!1;var d=0;c&&(this._numTempSurfacesRequired=1,this._steps.push(C3$jscomp$59.New(C3$jscomp$59.Gfx.EffectChain.Step.PreDraw, this,-1,1)),d=1);for(let e=0,g=a.length;e<g;++e)0!==e||c?(a=1===d?2:1,e!==g-1||b||(a=0),this._numTempSurfacesRequired=Math.max(this._numTempSurfacesRequired,a),this._steps.push(C3$jscomp$59.New(C3$jscomp$59.Gfx.EffectChain.Step.Bounce,this,d,a,e)),d=a):(this._numTempSurfacesRequired=1,this._steps.push(C3$jscomp$59.New(C3$jscomp$59.Gfx.EffectChain.Step.FirstBounce,this,-1,1,e)),d=1);b&&this._steps.push(C3$jscomp$59.New(C3$jscomp$59.Gfx.EffectChain.Step.PostDraw,this,d,0))}else this._canUseFastPath= !0}}_ShouldPreDraw(a,b){return b.forcePreDraw||a.MustPreDraw()||b.is3D||a.UsesDepth()&&!this._useFullSurface||0!==this._boxExtendHorizontal||0!==this._boxExtendVertical?!0:a.GetRenderer().IsWebGL()?a.BlendsBackground()&&(b.isRotatedOrNegativeSizeInstance||b.isSourceTextureRotated)||a.UsesAnySrcRectOrPixelSize()&&b.isSourceTextureRotated:!1}_ShouldPostDraw(a,b){return b.forcePostDraw?!0:a.GetRenderer().IsWebGL()?a.BlendsBackground()||a.UsesCrossSampling():(a.BlendsBackground()||a.UsesCrossSampling())&& this._UseRenderTargetBackgroundSampling()}_ShouldUseCopyTextureBackgroundSampling(a){return a.IsWebGPU()&&this._isAnyShaderBackgroundBlending&&!this._isAnyShaderCrossSampling}Render(a,b,c){a.IsWebGPU()&&null===b&&(b=a.GetBackbufferRenderTarget());this._destRenderTarget=b;this._contentObject=c.contentObject||null;this._contextObject=c.contextObject||null;this._blendMode=c.blendMode||0;this._devicePixelRatio=c.devicePixelRatio||1;this._layerScale=c.layerScale||1;this._layerAngle=c.layerAngle||0;this._time= "number"===typeof c.time?c.time:this._manager.GetTime();this._didChangeTransform=!1;a.ResetDidChangeTransformFlag();this._isAnyShaderAnimated&&this._Redraw();let d=!1;this._UseCopyTextureBackgroundSampling()&&(this._CalculateDrawSizeAndRectangles(a,c),d=!0,this._backTex=this._manager._GetWebGPUBackTexture(a,this._drawWidth,this._drawHeight),tempRect.copy(this._drawSurfaceRect),tempRect.roundOuter(),a.CopyTextureToTexture(this._destRenderTarget.GetTexture(),this._backTex,tempRect.getLeft(),tempRect.getTop(), tempRect.width(),tempRect.height()));if(this._canUseFastPath)this._Render_FastPath(a,c);else{d||this._CalculateDrawSizeAndRectangles(a,c);a.ResetColor();a.SetBaseZ(0);a.SetCurrentZ(0);this._cbDrawContentHook=c.drawContentHook||null;this._compositOffX=c.compositOffX||0;this._compositOffY=c.compositOffY||0;this._updateOwnProjection=!!c.updateOwnProjection;this._OnBeforeStartEffectChain(a);this._renderTargets[0]=b;this._renderTargets[1]=1<=this._numTempSurfacesRequired?this._GetRenderTarget():null;this._renderTargets[2]= 2===this._numTempSurfacesRequired?this._GetRenderTarget():null;for(const e of this._steps)b=this._GetRenderTargetForId(e.GetSrcTargetId()),c=this._GetRenderTargetForId(e.GetDestTargetId()),a.IsWebGPU()?e.Run_WebGPU(a,b,c):e.Run_WebGL(a,b,c);this._renderTargets[1]&&this._ReleaseRenderTarget(this._renderTargets[1]);this._renderTargets[2]&&this._ReleaseRenderTarget(this._renderTargets[2]);this._renderTargets.fill(null);this._OnAfterEndEffectChain(a);this._cbDrawContentHook=this._contextObject=this._contentObject= this._backTex=this._destRenderTarget=null}}_CalculateDrawSizeAndRectangles(a,b){const [c,d]=this._manager.GetDrawSize(a);this._SetDrawSize(a,c,d);this._CalculateRectangles(b)}_SetDrawSize(a,b,c){if(0>=b||0>=c)throw Error("invalid draw size");this._drawWidth===b&&this._drawHeight===c||this._CalculateDeviceTransformMatrices(a,b,c,0,0,this._projectionMatrix,this._modelViewMatrix);this._drawWidth=b;this._drawHeight=c}_CalculateDeviceTransformMatrices(a,b,c,d,e,g,k){d=b/2+d;e=c/2+e;a.CalculatePerspectiveMatrix(g, b/c);a=a.CalculateLookAtModelView2(d,e,a.GetDefaultCameraZ(c),d,e,0,c);mat4$jscomp$8.copy(k,a)}_CalculateRectangles(a){this._layoutRect.copy(a.layoutRect);a.drawSurfaceRect?this._drawSurfaceRect.copy(a.drawSurfaceRect):this._drawSurfaceRect.set(0,0,this._drawWidth,this._drawHeight);this._rcTexOriginal.copy(this._drawSurfaceRect);this._rcTexOriginal.divide(this._drawWidth,this._drawHeight);a=this._layerScale*this._devicePixelRatio;this._drawSurfaceRect.inflate(this._boxExtendHorizontal*a,this._boxExtendVertical* a);this._rcTexDest.copy(this._drawSurfaceRect);this._rcTexDest.divide(this._drawWidth,this._drawHeight);this._drawSurfaceRect.clamp(0,0,this._drawWidth,this._drawHeight);this._rcTexBounce.copy(this._drawSurfaceRect);this._rcTexBounce.divide(this._drawWidth,this._drawHeight)}_OnBeforeStartEffectChain(a){this._depthEnabledAtStart=a.IsDepthEnabled();if(this._useFullSurface)a.SetDepthEnabled(!1),this._isAnyShaderDepthSampling&&a.SetDepthSamplingEnabled(!0);else{tempRect.copy(this._drawSurfaceRect);if(a.IsWebGL()){const b= this._layerScale*this._devicePixelRatio;tempRect.inflate(Math.max(this._boxExtendHorizontal,1)*b,Math.max(this._boxExtendVertical,1)*b);tempRect.roundOuter();tempRect.clamp(0,0,this._drawWidth,this._drawHeight)}else tempRect.roundOuter();a.SetScissorRect(tempRect.getLeft(),tempRect.getTop(),tempRect.width(),tempRect.height(),this._drawHeight)}}_OnAfterEffectChainDrawContent(a){a.ResetColor();this._useFullSurface||(a.SetDepthEnabled(!1),this._isAnyShaderDepthSampling&&a.SetDepthSamplingEnabled(!0)); a.IsWebGPU()&&a.SetNormalizedCoordsProgramVariant(!0)}_OnAfterEndEffectChain(a){a.SetDepthSamplingEnabled(!1);a.SetDepthEnabled(this._depthEnabledAtStart);this._useFullSurface||a.RemoveScissorRect();a.IsWebGPU()&&a.SetNormalizedCoordsProgramVariant(!1);this._didChangeTransform=a.DidChangeTransform()}_ClampRcTexDest(){this._rcTexDest.clamp(0,0,1,1)}_GetRenderTargetForId(a){return 0>a?null:this._renderTargets[a]}_GetRenderTarget(){return this._manager.GetRenderTarget(this)}_GetDestRenderTarget(){return this._destRenderTarget}_ReleaseRenderTarget(a){this._manager.ReleaseRenderTarget(a, this)}_GetShaderProgramAt(a){return this._shaderProgramList[a]}_DrawContent(a){this._cbDrawContentHook?this._cbDrawContentHook(this,a,()=>this._cbDrawContent(a,this)):this._cbDrawContent(a,this);this._canUseFastPath||this._OnAfterEffectChainDrawContent(a)}_IsRenderTargetSameSizeAndOffset(a){if(this._useFullSurface)return!0;if(0!==this._compositOffX||0!==this._compositOffY)return!1;const [b,c]=a.GetRenderTargetSize(a.GetRenderTarget());return b!==this._drawWidth||c!==this._drawHeight?!1:!0}_SetDeviceTransform(a, b){let c=this._projectionMatrix,d=this._modelViewMatrix;if(b&&!this._IsRenderTargetSameSizeAndOffset(a)){c=tempMat4a;d=tempMat4b$jscomp$1;const [e,g]=a.GetRenderTargetSize(a.GetRenderTarget());this._CalculateDeviceTransformMatrices(a,e,g,this._compositOffX,this._compositOffY,c,d);this._useFullSurface||a.RemoveScissorRect()}a.SetProjectionMatrix(c);a.SetModelViewMatrix(d)}_Redraw(){this._manager.Redraw(this)}_GetShaderParameters(a,b){return this._cbGetShaderParameters(this._shaderProgramIndices[a], b)}_SetProgramParameters(a,b){let c=this._rcTexDest,d=this._rcTexBounce,e=this._rcTexOriginal;a.IsWebGL()&&(tempRect2.copy(c),tempRect2.flipAround(1),c=tempRect2,tempRect3.copy(d),tempRect3.flipAround(1),d=tempRect3,tempRect4.copy(e),tempRect4.flipAround(1),e=tempRect4);this._DoSetProgramParameters(a,b,d,e,c,1/this._drawWidth,1/this._drawHeight)}_SetFirstBounceProgramParameters(a,b){let c=this._rcTexBounce,d=this._rcTexOriginal,e=1/this._drawWidth,g=1/this._drawHeight;if(this._cbGetSourceTextureInfo){let {srcTexRect:l, srcWidth:n,srcHeight:p}=this._cbGetSourceTextureInfo(this._contentObject);l||(tempRect.set(0,0,0,0),l=tempRect);n||(n=this._drawWidth);p||(p=this._drawHeight);d=c=l;e=1/n;g=1/p}else a.IsWebGL()&&(tempRect3.copy(c),tempRect3.flipAround(1),c=tempRect3,tempRect4.copy(d),tempRect4.flipAround(1),d=tempRect4);let k=this._rcTexDest;a.IsWebGL()&&(k=tempRect2,k.copy(this._rcTexDest),k.flipAround(1));this._DoSetProgramParameters(a,b,c,d,k,e,g);a.IsWebGPU()&&this._isAnyIsSrcTexRotated&&a.SetProgramParameter_IsSrcTexRotated(this._isSourceTextureRotated)}_GetBackTex(a){return this._isAnyShaderBackgroundBlending? a.IsWebGPU()?this._UseCopyTextureBackgroundSampling()?this._backTex:this._destRenderTarget.GetTexture():this._destRenderTarget:null}_DoSetProgramParameters(a,b,c,d,e,g,k){a.SetProgramParameters(this._GetBackTex(a),e,c,d,this._layoutRect,g,k,this._devicePixelRatio,this._layerScale,this._layerAngle,this._time);a.SetProgramCustomParameters(this._GetShaderParameters(b,a))}_Render_FastPath(a,b){var c=this._shaderProgramList[0];const d=a.IsDepthEnabled(),e=c.UsesDepth();e&&(a.SetDepthEnabled(!1),a.SetDepthSamplingEnabled(!0), this._rcTexDest.set(0,0,1,1),this._rcTexOriginal.set(0,0,1,1));a.SetProgram(c);a.SetBlendMode(this._blendMode);a.SetRenderTarget(this._destRenderTarget);let g;this._rcTexOriginal.set(0,0,1,1);if(c.UsesAnySrcRectOrPixelSize()&&this._cbGetSourceTextureInfo){const {srcTexRect:k,srcWidth:l,srcHeight:n}=this._cbGetSourceTextureInfo(this._contentObject);k&&this._rcTexOriginal.copy(k);c=Number.isFinite(l)?1/l:0;g=Number.isFinite(n)?1/n:0}else{const [k,l]=this._manager.GetDrawSize(a);c=1/k;g=1/l}b.layoutRect? this._layoutRect.copy(b.layoutRect):this._layoutRect.set(0,0,0,0);a.SetProgramParameters(this._GetBackTex(a),this._rcTexDest,this._rcTexOriginal,this._rcTexOriginal,this._layoutRect,c,g,this._devicePixelRatio,this._layerScale,this._layerAngle,this._time);a.SetProgramCustomParameters(this._GetShaderParameters(0,a));a.IsWebGPU()&&this._isAnyIsSrcTexRotated&&a.SetProgramParameter_IsSrcTexRotated(this._isSourceTextureRotated);a.SetBaseZ(0);this._DrawContent(a);e&&(a.SetDepthSamplingEnabled(!1),a.SetDepthEnabled(d))}_UseCopyTextureBackgroundSampling(){return this._useCopyTextureBackgroundSampling}_UseRenderTargetBackgroundSampling(){return!this._useCopyTextureBackgroundSampling}IsAnyShaderBackgroundBlending(){return this._isAnyShaderBackgroundBlending}CanSkipCalculatingDrawSurfaceRect(){return!this._canUseFastPath|| this._UseCopyTextureBackgroundSampling()?!1:!0}UseFullSurface(){return this._useFullSurface}GetContentObject(){return this._contentObject}GetContextObject(){return this._contextObject}_GetBlendMode(){return this._blendMode}_UpdateOwnProjection(){return this._updateOwnProjection}DidChangeTransform(){return this._didChangeTransform}_GetDrawSurfaceRect(){return this._drawSurfaceRect}_GetRcTexBounce(){return this._rcTexBounce}_ShouldInvalidateRenderTargets(){return this._invalidateRenderTargets}async DebugLogRenderTargetContents(a, b,c){}};"use strict";self.C3.Gfx.EffectChain.Step=class{constructor(a,b,c,d=-1){this._effectChain=a;this._srcTargetId=b;this._destTargetId=c;this._index=d}GetEffectChain(){return this._effectChain}GetSrcTargetId(){return this._srcTargetId}GetDestTargetId(){return this._destTargetId}GetIndex(){return this._index}GetShaderProgram(){return this.GetEffectChain()._GetShaderProgramAt(this.GetIndex())}Run_WebGL(a,b,c){}Run_WebGPU(a,b,c){}};"use strict";const C3$jscomp$61=self.C3; C3$jscomp$61.Gfx.EffectChain.Step.PreDraw=class extends C3$jscomp$61.Gfx.EffectChain.Step{constructor(a,b,c,d){super(a,b,c,d)}Run_WebGL(a,b,c){b=this.GetEffectChain();a.SetAlphaBlend();a.SetTextureFillMode();a.SetRenderTarget(c,b._UpdateOwnProjection());a.ClearRgba(0,0,0,0);b._DrawContent(a);b._ClampRcTexDest()}Run_WebGPU(a,b,c){b=this.GetEffectChain();a.SetAlphaBlend();a.SetTextureFillMode();a.SetRenderTarget(c,!1);a.ClearRgba(0,0,0,0);b._DrawContent(a);b._ClampRcTexDest()}};"use strict"; const C3$jscomp$62=self.C3,tempRect$jscomp$1=C3$jscomp$62.New(C3$jscomp$62.Rect),tempQuad$jscomp$1=C3$jscomp$62.New(C3$jscomp$62.Quad); C3$jscomp$62.Gfx.EffectChain.Step.PostDraw=class extends C3$jscomp$62.Gfx.EffectChain.Step{constructor(a,b,c,d){super(a,b,c,d)}Run_WebGL(a,b,c){const d=this.GetEffectChain();a.SetTextureFillMode();a.SetRenderTarget(c);d._SetDeviceTransform(a,!0);a.SetBlendMode(d._GetBlendMode());a.SetTexture(b.GetTexture());tempQuad$jscomp$1.setFromRect(d._GetDrawSurfaceRect());tempRect$jscomp$1.copy(d._GetRcTexBounce());tempRect$jscomp$1.flipAround(1);a.Quad3(tempQuad$jscomp$1,tempRect$jscomp$1);d._ShouldInvalidateRenderTargets()&& a.InvalidateRenderTarget(b)}Run_WebGPU(a,b,c){const d=this.GetEffectChain();a.SetTextureFillMode();a.SetRenderTarget(c,!1);d._IsRenderTargetSameSizeAndOffset(a)?tempQuad$jscomp$1.setFromRect(d._GetRcTexBounce()):(a.SetNormalizedCoordsProgramVariant(!1),d._SetDeviceTransform(a,!0),tempQuad$jscomp$1.setFromRect(d._GetDrawSurfaceRect()));a.SetBackTexture(null);a.SetBlendMode(d._GetBlendMode());a.SetTexture(b.GetTexture());d.UseFullSurface()?a.FullscreenQuad():a.Quad3(tempQuad$jscomp$1,d._GetRcTexBounce())}}; "use strict";const C3$jscomp$63=self.C3; C3$jscomp$63.Gfx.EffectChain.Step.FirstBounce=class extends C3$jscomp$63.Gfx.EffectChain.Step{constructor(a,b,c,d){super(a,b,c,d)}Run_WebGL(a,b,c){b=this.GetEffectChain();a.SetRenderTarget(c,b._UpdateOwnProjection());a.ClearRgba(0,0,0,0);a.SetCopyBlend();a.SetProgram(this.GetShaderProgram());b._SetFirstBounceProgramParameters(a,this.GetIndex());b._DrawContent(a);b._ClampRcTexDest()}Run_WebGPU(a,b,c){b=this.GetEffectChain();a.SetRenderTarget(c,!1);a.ClearRgba(0,0,0,0);a.SetCopyBlend();a.SetProgram(this.GetShaderProgram()); b._SetFirstBounceProgramParameters(a,this.GetIndex());b._DrawContent(a);b._ClampRcTexDest()}};"use strict";const C3$jscomp$64=self.C3,tempRect$jscomp$2=C3$jscomp$64.New(C3$jscomp$64.Rect),tempQuad$jscomp$2=C3$jscomp$64.New(C3$jscomp$64.Quad); C3$jscomp$64.Gfx.EffectChain.Step.Bounce=class extends C3$jscomp$64.Gfx.EffectChain.Step{constructor(a,b,c,d){super(a,b,c,d)}Run_WebGL(a,b,c){const d=this.GetEffectChain();a.SetRenderTarget(c);(c=0===this.GetDestTargetId())?a.SetBlendMode(d._GetBlendMode()):(a.ClearRgba(0,0,0,0),a.SetCopyBlend());a.SetProgram(this.GetShaderProgram());d._SetProgramParameters(a,this.GetIndex());a.SetTexture(b.GetTexture());d._SetDeviceTransform(a,c);tempQuad$jscomp$2.setFromRect(d._GetDrawSurfaceRect());tempRect$jscomp$2.copy(d._GetRcTexBounce()); tempRect$jscomp$2.flipAround(1);a.Quad3(tempQuad$jscomp$2,tempRect$jscomp$2);d._ShouldInvalidateRenderTargets()&&a.InvalidateRenderTarget(b)}Run_WebGPU(a,b,c){const d=this.GetEffectChain();a.SetRenderTarget(c,!1);0===this.GetDestTargetId()?(a.SetBlendMode(d._GetBlendMode()),a.SetBackTexture(null),d._IsRenderTargetSameSizeAndOffset(a)?tempQuad$jscomp$2.setFromRect(d._GetRcTexBounce()):(a.SetNormalizedCoordsProgramVariant(!1),d._SetDeviceTransform(a,!0),tempQuad$jscomp$2.setFromRect(d._GetDrawSurfaceRect()))): (a.ClearRgba(0,0,0,0),a.SetCopyBlend(),tempQuad$jscomp$2.setFromRect(d._GetRcTexBounce()));a.SetProgram(this.GetShaderProgram());d._SetProgramParameters(a,this.GetIndex());a.SetTexture(b.GetTexture());d.UseFullSurface()?a.FullscreenQuad():a.Quad3(tempQuad$jscomp$2,d._GetRcTexBounce())}};"use strict";const C3$jscomp$65=self.C3,C3X$jscomp$1=self.C3X;let runtime$jscomp$1=null;const keysDownByKey=new Set;function SortZOrderList(a,b){const c=a[0]-b[0];return 0!==c?c:a[1]-b[1]} const tempZOrderList=[],tempInstances=[];let didWarnInAlertPolyfill=!1; self.IRuntime=class{constructor(a,b){runtime$jscomp$1=a;Object.defineProperties(this,{assets:{value:runtime$jscomp$1.GetAssetManager().GetIAssetManager(),writable:!1},objects:{value:b,writable:!1},globalVars:{value:{},writable:!1},projectName:{value:runtime$jscomp$1.GetProjectName(),writable:!1},projectVersion:{value:runtime$jscomp$1.GetProjectVersion(),writable:!1},storage:{value:new self.IStorage(runtime$jscomp$1),writable:!1},isInWorker:{value:runtime$jscomp$1.IsInWorker(),writable:!1},viewportWidth:{value:runtime$jscomp$1.GetOriginalViewportWidth(), writable:!1},viewportHeight:{value:runtime$jscomp$1.GetOriginalViewportHeight(),writable:!1}});runtime$jscomp$1.UserScriptDispatcher().addEventListener("keydown",c=>{keysDownByKey.has(c.key)?c.stopPropagation():keysDownByKey.add(c.key)});runtime$jscomp$1.UserScriptDispatcher().addEventListener("keyup",c=>keysDownByKey.delete(c.key));runtime$jscomp$1.Dispatcher().addEventListener("window-blur",()=>keysDownByKey.clear());runtime$jscomp$1.IsInWorker()&&(self.alert=c=>{didWarnInAlertPolyfill||(didWarnInAlertPolyfill= !0,console.warn("[Construct] alert() was called from a Web Worker, because the project 'Use worker' setting is enabled. This method is not normally available in a Web Worker. Construct has implemented the alert for you, but note that other features may be missing in worker mode. You may wish to disable 'Use worker', or use a more convenient function like console.log(). For more information please refer to the scripting section of the manual."));return this.alert(c)})}_InitGlobalVars(a){Object.defineProperties(this.globalVars, a)}addEventListener(a,b){runtime$jscomp$1.UserScriptDispatcher().addEventListener(a,b)}removeEventListener(a,b){runtime$jscomp$1.UserScriptDispatcher().removeEventListener(a,b)}callFunction(a,...b){C3X$jscomp$1.RequireString(a);const c=runtime$jscomp$1.GetEventSheetManager(),d=c.GetFunctionBlockByName(a);if(!d)throw Error(`cannot find function name '${a}'`);if(!d.IsEnabled())return d.GetDefaultReturnValue();if(b.length<d.GetFunctionParameterCount())throw Error(`not enough function parameters passed for '${a}' (${b.length} passed, ${d.GetFunctionParameterCount()} expected)`); a=d.GetEventBlock();let e=a.GetSolModifiersIncludingParents();const g=c.GetCurrentEvent();if(g){e=e.slice(0);const k=new Set(e);for(const l of g.GetSolModifiersIncludingParents())k.has(l)||(e.push(l),k.add(l));for(const l of c.GetDynamicSolModifiersSet())k.has(l)||(e.push(l),k.add(l))}return a.RunAsExpressionFunctionCall(e,d.IsCopyPicked(),d.GetReturnType(),d.GetDefaultReturnValue(),...b)}setReturnValue(a){const b=runtime$jscomp$1.GetEventStack().GetCurrentExpFuncStackFrame();if(!b)throw Error("not in a function which returns a value"); switch(b.GetFunctionReturnType()){case 1:"number"===typeof a&&b.SetFunctionReturnValue(a);break;case 2:"string"===typeof a&&b.SetFunctionReturnValue(a);break;case 3:"number"!==typeof a&&"string"!==typeof a||b.SetFunctionReturnValue(a)}}getViewportSize(){return[runtime$jscomp$1.GetOriginalViewportWidth(),runtime$jscomp$1.GetOriginalViewportHeight()]}get dt(){return runtime$jscomp$1.GetDt()}get dtRaw(){return runtime$jscomp$1.GetDtRaw()}get gameTime(){return runtime$jscomp$1.GetGameTime()}get wallTime(){return runtime$jscomp$1.GetWallTime()}get timeScale(){return runtime$jscomp$1.GetTimeScale()}set timeScale(a){C3X$jscomp$1.RequireFiniteNumber(a); runtime$jscomp$1.SetTimeScale(a)}get fps(){return runtime$jscomp$1.GetFPS()}get cpuUtilisation(){return runtime$jscomp$1.GetMainThreadTime()}get gpuUtilisation(){return runtime$jscomp$1.GetGPUUtilisation()}random(){return runtime$jscomp$1.Random()}get layout(){return runtime$jscomp$1.GetMainRunningLayout().GetILayout()}getLayout(a){const b=runtime$jscomp$1.GetLayoutManager();if("number"===typeof a||"string"===typeof a)a=b.GetLayout(a);else throw new TypeError("expected string or number");if(!a)throw Error("invalid layout"); return a.GetILayout()}getAllLayouts(){return runtime$jscomp$1.GetLayoutManager().GetAllLayouts().map(a=>a.GetILayout())}goToLayout(a){const b=runtime$jscomp$1.GetLayoutManager();if("number"===typeof a||"string"===typeof a)a=b.GetLayout(a);else throw new TypeError("expected string or number");if(!a)throw Error("invalid layout");b.IsPendingChangeMainLayout()||b.ChangeMainLayout(a)}get keyboard(){const a=runtime$jscomp$1._GetCommonScriptInterfaces().keyboard;if(!a)throw Error("runtime.keyboard used but Keyboard object missing - add it to your project first"); return a}get mouse(){const a=runtime$jscomp$1._GetCommonScriptInterfaces().mouse;if(!a)throw Error("runtime.mouse used but Mouse object missing - add it to your project first");return a}get touch(){const a=runtime$jscomp$1._GetCommonScriptInterfaces().touch;if(!a)throw Error("runtime.touch used but Touch object missing - add it to your project first");return a}invokeDownload(a,b){C3X$jscomp$1.RequireString(a);C3X$jscomp$1.RequireString(b);runtime$jscomp$1.InvokeDownload(a,b)}getInstanceByUid(a){C3X$jscomp$1.RequireFiniteNumber(a); return(a=runtime$jscomp$1.GetInstanceByUID(a))?a.GetInterfaceClass():null}sortZOrder(a,b){C3X$jscomp$1.RequireFunction(b);const c=runtime$jscomp$1.GetCurrentLayout();for(var d of a){a=runtime$jscomp$1._UnwrapIWorldInstance(d);var e=a.GetWorldInfo();tempZOrderList.push([e.GetLayer().GetIndex(),e.GetZIndex()]);tempInstances.push(a)}if(0!==tempZOrderList.length){tempZOrderList.sort(SortZOrderList);tempInstances.sort((g,k)=>b(g.GetInterfaceClass(),k.GetInterfaceClass()));d=!1;for(let g=0,k=tempZOrderList.length;g< k;++g){a=tempInstances[g];e=c.GetLayerByIndex(tempZOrderList[g][0]);const l=tempZOrderList[g][1],n=e._GetInstances();n[l]!==a&&(n[l]=a,a.GetWorldInfo()._SetLayer(e,!0),e.SetZIndicesChanged(),d=!0)}d&&runtime$jscomp$1.UpdateRender();C3$jscomp$65.clearArray(tempZOrderList);C3$jscomp$65.clearArray(tempInstances)}}async createWorker(a,b){var c=new MessageChannel;const d=c.port1;c=c.port2;await runtime$jscomp$1.PostComponentMessageToDOMAsync("runtime","script-create-worker",{url:a,opts:b,port2:c},[c]); return d}alert(a){return runtime$jscomp$1.PostComponentMessageToDOMAsync("runtime","alert",{message:a+(runtime$jscomp$1.IsInWorker()?" [via Web Worker]":"")})}};"use strict";const C3$jscomp$66=self.C3;let assetManager=null; self.IAssetManager=class{constructor(a){assetManager=a;Object.defineProperties(this,{isWebMOpusSupported:{value:assetManager.IsAudioFormatSupported("audio/webm; codecs=opus"),writable:!1}})}fetchText(a){return assetManager.FetchText(a)}fetchJson(a){return assetManager.FetchJson(a)}fetchBlob(a){return assetManager.FetchBlob(a)}fetchArrayBuffer(a){return assetManager.FetchArrayBuffer(a)}getProjectFileUrl(a){return assetManager.GetProjectFileUrl(a)}getMediaFileUrl(a){"flat"===assetManager.GetFileStructure()&& C3$jscomp$66.IsRelativeURL(a)&&(a=a.toLowerCase());return assetManager.GetMediaFileUrl(a)}get mediaFolder(){return assetManager.GetMediaSubfolder()}async decodeWebMOpus(a,b){if(this.isWebMOpusSupported)throw Error("decodeWebMOpus(): not supported because WebM Opus is supported by the platform");b=await assetManager.GetRuntime()._WasmDecodeWebMOpus(b);b=new Float32Array(b);a=a.createBuffer(1,b.length,48E3);a.getChannelData(0).set(b);return a}loadScripts(...a){return assetManager.LoadScripts(...a)}compileWebAssembly(a){return assetManager.CompileWebAssembly(a)}loadStyleSheet(a){return assetManager.LoadStyleSheet(a)}}; "use strict";const C3X$jscomp$3=self.C3X;self.IStorage=class{constructor(a){this._storage=a._GetProjectStorage()}getItem(a){C3X$jscomp$3.RequireString(a);return this._storage.getItem(a)}setItem(a,b){C3X$jscomp$3.RequireString(a);return this._storage.setItem(a,b)}removeItem(a){C3X$jscomp$3.RequireString(a);return this._storage.removeItem(a)}clear(){return this._storage.clear()}keys(){return this._storage.keys()}};"use strict";const C3$jscomp$68=self.C3,C3X$jscomp$4=self.C3X,map$jscomp$2=new WeakMap; self.IObjectClass=class{constructor(a){map$jscomp$2.set(this,a);Object.defineProperties(this,{name:{value:a.GetName(),writable:!1}});a.GetRuntime()._MapScriptInterface(this,a)}addEventListener(a,b){C3X$jscomp$4.RequireString(a);C3X$jscomp$4.RequireFunction(b);map$jscomp$2.get(this).UserScriptDispatcher().addEventListener(a,b)}removeEventListener(a,b){C3X$jscomp$4.RequireString(a);C3X$jscomp$4.RequireFunction(b);map$jscomp$2.get(this).UserScriptDispatcher().removeEventListener(a,b)}getAllInstances(){return[...this.instances()]}getFirstInstance(){return C3$jscomp$68.first(this.instances())}getPickedInstances(){return[...this.pickedInstances()]}getFirstPickedInstance(){return C3$jscomp$68.first(this.pickedInstances())}*instances(){for(const a of map$jscomp$2.get(this).instancesIncludingPendingCreate())yield a.GetInterfaceClass()}*pickedInstances(){for(const a of map$jscomp$2.get(this).GetCurrentSol().GetInstances())yield a.GetInterfaceClass()}setInstanceClass(a){C3X$jscomp$4.RequireFunction(a); if(0<map$jscomp$2.get(this).GetInstanceCount())throw Error("setInstanceClass() called too late, because instances have already been created - call in runOnStartup");map$jscomp$2.get(this)._SetUserScriptInstanceClass(a)}createInstance(a,b,c,d,e){C3X$jscomp$4.RequireNumber(b);C3X$jscomp$4.RequireNumber(c);if("number"!==typeof a&&"string"!==typeof a)throw new TypeError("invalid layer parameter");const g=map$jscomp$2.get(this),k=g.GetRuntime();a=k.GetMainRunningLayout().GetLayer(a);if(!a)throw Error("invalid layer"); b=k.CreateInstance(g,a,b,c,d,e);d&&a.SortAndAddInstancesByZIndex(b);d=k.GetEventSheetManager();d.BlockFlushingInstances(!0);b._TriggerOnCreatedOnSelfAndRelated();d.BlockFlushingInstances(!1);d.IsInEventEngine()||k.GetLayoutManager().IsEndingLayout()||k.FlushPendingInstances();return b.GetInterfaceClass()}};"use strict";const C3X$jscomp$5=self.C3X,map$jscomp$3=new WeakMap,VALID_WHERE_STRINGS=["above","below","top-sublayer","bottom-sublayer"]; self.ILayout=class{constructor(a){map$jscomp$3.set(this,a);const b=[],c=a.GetEffectList(),d=c.GetAllEffectTypes().length;for(let e=0;e<d;++e)b.push(new self.IEffectInstance(c,e));Object.defineProperties(this,{name:{value:a.GetName(),writable:!1},index:{value:a.GetIndex(),writable:!1},effects:{value:b,writable:!1}})}addEventListener(a,b){C3X$jscomp$5.RequireString(a);C3X$jscomp$5.RequireFunction(b);map$jscomp$3.get(this).UserScriptDispatcher().addEventListener(a,b)}removeEventListener(a,b){C3X$jscomp$5.RequireString(a); C3X$jscomp$5.RequireFunction(b);map$jscomp$3.get(this).UserScriptDispatcher().removeEventListener(a,b)}get width(){return map$jscomp$3.get(this).GetWidth()}set width(a){C3X$jscomp$5.RequireFiniteNumber(a);map$jscomp$3.get(this).SetWidth(a)}get height(){return map$jscomp$3.get(this).GetHeight()}set height(a){C3X$jscomp$5.RequireFiniteNumber(a);map$jscomp$3.get(this).SetHeight(a)}setSize(a,b){C3X$jscomp$5.RequireFiniteNumber(a);C3X$jscomp$5.RequireFiniteNumber(b);const c=map$jscomp$3.get(this);c.SetWidth(a); c.SetHeight(b)}getSize(){const a=map$jscomp$3.get(this);return[a.GetWidth(),a.GetHeight()]}set scale(a){C3X$jscomp$5.RequireFiniteNumber(a);map$jscomp$3.get(this).SetScale(a)}get scale(){return map$jscomp$3.get(this).GetScale()}set angle(a){C3X$jscomp$5.RequireFiniteNumber(a);map$jscomp$3.get(this).SetAngle(a)}get angle(){return map$jscomp$3.get(this).GetAngle()}set scrollX(a){C3X$jscomp$5.RequireNumber(a);map$jscomp$3.get(this).SetScrollX(a)}get scrollX(){return map$jscomp$3.get(this).GetScrollX()}set scrollY(a){C3X$jscomp$5.RequireNumber(a); map$jscomp$3.get(this).SetScrollY(a)}get scrollY(){return map$jscomp$3.get(this).GetScrollY()}scrollTo(a,b){C3X$jscomp$5.RequireNumber(a);C3X$jscomp$5.RequireNumber(b);const c=map$jscomp$3.get(this);c.SetScrollX(a);c.SetScrollY(b)}getScrollPosition(){const a=map$jscomp$3.get(this);return[a.GetScrollX(),a.GetScrollY()]}getLayer(a){const b=map$jscomp$3.get(this);if("number"===typeof a||"string"===typeof a)a=b.GetLayer(a);else throw new TypeError("expected string or number");return a?a.GetILayer():null}getAllLayers(){return map$jscomp$3.get(this).GetLayers().map(a=> a.GetILayer())}*allLayers(){for(const a of map$jscomp$3.get(this).allLayers())yield a.GetILayer()}addLayer(a,b,c){const d=self.ILayer;C3X$jscomp$5.RequireString(a);C3X$jscomp$5.RequireInstanceOf(b,d);b=d._Unwrap(b);if(!b)throw Error("invalid layer");c=VALID_WHERE_STRINGS.indexOf(c);if(0>c)throw Error("invalid location");map$jscomp$3.get(this).AddLayer(a,b,c)}moveLayer(a,b,c){const d=self.ILayer;C3X$jscomp$5.RequireInstanceOf(a,d);C3X$jscomp$5.RequireInstanceOf(b,d);a=d._Unwrap(a);b=d._Unwrap(b);if(!a|| !b)throw Error("invalid layer");c=VALID_WHERE_STRINGS.indexOf(c);if(0>c)throw Error("invalid location");map$jscomp$3.get(this).MoveLayer(a,b,c)}removeLayer(a){const b=self.ILayer;C3X$jscomp$5.RequireInstanceOf(a,b);a=b._Unwrap(a);if(!a)throw Error("invalid layer");map$jscomp$3.get(this).RemoveLayer(a)}removeAllDynamicLayers(){map$jscomp$3.get(this).RemoveAllDynamicLayers()}setVanishingPoint(a,b){C3X$jscomp$5.RequireFiniteNumber(a);C3X$jscomp$5.RequireFiniteNumber(b);map$jscomp$3.get(this).SetVanishingPointXY(a, b)}getVanishingPoint(){return map$jscomp$3.get(this)._GetVanishingPoint()}set projection(a){C3X$jscomp$5.RequireString(a);const b=map$jscomp$3.get(this);if("perspective"===a)b.SetPerspectiveProjection();else if("orthographic"===a)b.SetOrthographicProjection();else throw Error("invalid projection");}get projection(){return map$jscomp$3.get(this).IsOrthographicProjection()?"orthographic":"perspective"}};"use strict"; const C3$jscomp$70=self.C3,C3X$jscomp$6=self.C3X,map$jscomp$4=new WeakMap,BLEND_MODE_TO_INDEX=new Map([["normal",0],["additive",1],["copy",3],["destination-over",4],["source-in",5],["destination-in",6],["source-out",7],["destination-out",8],["source-atop",9],["destination-atop",10]]),INDEX_TO_BLEND_MODE=new Map([...BLEND_MODE_TO_INDEX.entries()].map(a=>[a[1],a[0]])),tempColor$jscomp$1=C3$jscomp$70.New(C3$jscomp$70.Color); self.ILayer=class{constructor(a){map$jscomp$4.set(this,a);const b=[],c=a.GetEffectList(),d=c.GetAllEffectTypes().length;for(let e=0;e<d;++e)b.push(new self.IEffectInstance(c,e));Object.defineProperties(this,{name:{value:a.GetName(),writable:!1},layout:{value:a.GetLayout().GetILayout(),writable:!1},effects:{value:b,writable:!1}})}static _Unwrap(a){return map$jscomp$4.get(a)}get parentLayer(){const a=map$jscomp$4.get(this).GetParentLayer();return a?a.GetILayer():null}*parentLayers(){for(const a of map$jscomp$4.get(this).parentLayers())yield a.GetILayer()}*subLayers(){for(const a of map$jscomp$4.get(this).GetSubLayers())yield a.GetILayer()}*allSubLayers(){for(const a of map$jscomp$4.get(this).GetSubLayers())for(const b of a.selfAndAllSubLayers())yield b.GetILayer()}get index(){return map$jscomp$4.get(this).GetIndex()}get isVisible(){return map$jscomp$4.get(this)._IsVisibleFlagSet()}set isVisible(a){map$jscomp$4.get(this).SetVisible(a)}get isSelfAndParentsVisible(){return map$jscomp$4.get(this).IsVisible()}get isInteractive(){return map$jscomp$4.get(this).IsInteractive()}set isInteractive(a){map$jscomp$4.get(this).SetInteractive(a)}get isSelfAndParentsInteractive(){return map$jscomp$4.get(this).IsSelfAndParentsInteractive()}get opacity(){return map$jscomp$4.get(this).GetOpacity()}set opacity(a){a= C3$jscomp$70.clamp(+a,0,1);isNaN(a)||map$jscomp$4.get(this).SetOpacity(a)}set scale(a){C3X$jscomp$6.RequireFiniteNumber(a);map$jscomp$4.get(this).SetOwnScale(a)}get scale(){return map$jscomp$4.get(this).GetOwnScale()}set scaleRate(a){C3X$jscomp$6.RequireFiniteNumber(a);map$jscomp$4.get(this).SetScaleRate(a)}get scaleRate(){return map$jscomp$4.get(this).GetScaleRate()}set angle(a){C3X$jscomp$6.RequireFiniteNumber(a);map$jscomp$4.get(this).SetAngle(a)}get angle(){return map$jscomp$4.get(this).GetOwnAngle()}set parallaxX(a){C3X$jscomp$6.RequireFiniteNumber(a); map$jscomp$4.get(this).SetParallaxX(a)}get parallaxX(){return map$jscomp$4.get(this).GetParallaxX()}set parallaxY(a){C3X$jscomp$6.RequireFiniteNumber(a);map$jscomp$4.get(this).SetParallaxY(a)}get parallaxY(){return map$jscomp$4.get(this).GetParallaxY()}set zElevation(a){C3X$jscomp$6.RequireFiniteNumber(a);map$jscomp$4.get(this).SetZElevation(a)}get zElevation(){return map$jscomp$4.get(this).GetZElevation()}set isTransparent(a){map$jscomp$4.get(this).SetTransparent(a)}get isTransparent(){return map$jscomp$4.get(this).IsTransparent()}set isForceOwnTexture(a){map$jscomp$4.get(this).SetForceOwnTexture(a)}get isForceOwnTexture(){return map$jscomp$4.get(this).IsForceOwnTexture()}set blendMode(a){C3X$jscomp$6.RequireString(a); a=BLEND_MODE_TO_INDEX.get(a);if("number"!==typeof a)throw Error("invalid blend mode");map$jscomp$4.get(this).SetBlendMode(a)}get blendMode(){return INDEX_TO_BLEND_MODE.get(map$jscomp$4.get(this).GetBlendMode())}set backgroundColor(a){C3X$jscomp$6.RequireArray(a);if(3>a.length)throw Error("expected 3 elements");tempColor$jscomp$1.setRgb(a[0],a[1],a[2]);a=map$jscomp$4.get(this);const b=a.GetBackgroundColor();b.equalsIgnoringAlpha(tempColor$jscomp$1)||(b.copyRgb(tempColor$jscomp$1),a.GetRuntime().UpdateRender())}get backgroundColor(){const a= map$jscomp$4.get(this).GetBackgroundColor();return[a.getR(),a.getG(),a.getB()]}set scrollX(a){C3X$jscomp$6.RequireNumber(a);const b=map$jscomp$4.get(this);b.SetOwnScrollPositionEnabled(!0);b.SetScrollX(a)}get scrollX(){return map$jscomp$4.get(this).GetScrollX()}set scrollY(a){C3X$jscomp$6.RequireNumber(a);const b=map$jscomp$4.get(this);b.SetOwnScrollPositionEnabled(!0);b.SetScrollY(a)}get scrollY(){return map$jscomp$4.get(this).GetScrollY()}scrollTo(a,b){C3X$jscomp$6.RequireNumber(a);C3X$jscomp$6.RequireNumber(b); const c=map$jscomp$4.get(this);c.SetOwnScrollPositionEnabled(!0);c.SetScrollX(a);c.SetScrollY(b)}getScrollPosition(){const a=map$jscomp$4.get(this);return[a.GetScrollX(),a.GetScrollY()]}restoreScrollPosition(){map$jscomp$4.get(this).SetOwnScrollPositionEnabled(!1)}getViewport(){return map$jscomp$4.get(this).GetViewport().toDOMRect()}cssPxToLayer(a,b,c=0){C3X$jscomp$6.RequireNumber(a);C3X$jscomp$6.RequireNumber(b);C3X$jscomp$6.RequireNumber(c);const d=map$jscomp$4.get(this),e=d.GetRuntime();return d.CanvasCssToLayer(a- e.GetCanvasClientX(),b-e.GetCanvasClientY(),c)}layerToCssPx(a,b,c=0){C3X$jscomp$6.RequireNumber(a);C3X$jscomp$6.RequireNumber(b);C3X$jscomp$6.RequireNumber(c);const d=map$jscomp$4.get(this),e=d.GetRuntime(),[g,k]=d.LayerToCanvasCss(a,b,c);return[g+e.GetCanvasClientX(),k+e.GetCanvasClientY()]}};"use strict";const C3$jscomp$71=self.C3,C3X$jscomp$7=self.C3X,map$jscomp$5=new WeakMap,dispatchers=new WeakMap; function GetDispatcher(a){let b=dispatchers.get(a);if(b)return b;b=C3$jscomp$71.New(C3$jscomp$71.Event.Dispatcher);dispatchers.set(a,b);return b}let initInst=null; self.IInstance=class{constructor(){map$jscomp$5.set(this,initInst);const a={runtime:{value:initInst.GetRuntime().GetIRuntime(),writable:!1},objectType:{value:initInst.GetObjectClass().GetIObjectClass(),writable:!1},uid:{value:initInst.GetUID(),writable:!1}};initInst._GetInstVarsScriptDescriptor(a);initInst._GetBehaviorsScriptDescriptor(a);Object.defineProperties(this,a);initInst.GetRuntime()._MapScriptInterface(this,initInst)}static _Init(a){initInst=a}static _GetInitInst(){return initInst}_Release(){const a= dispatchers.get(this);a&&(a.Release(),dispatchers.delete(this));map$jscomp$5.delete(this)}addEventListener(a,b,c){C3X$jscomp$7.RequireString(a);C3X$jscomp$7.RequireFunction(b);GetDispatcher(this).addEventListener(a,b,c)}removeEventListener(a,b,c){C3X$jscomp$7.RequireString(a);C3X$jscomp$7.RequireFunction(b);GetDispatcher(this).removeEventListener(a,b,c)}dispatchEvent(a){GetDispatcher(this).dispatchEvent(a)}destroy(){const a=map$jscomp$5.get(this),b=a.GetRuntime();b.DestroyInstance(a);b.GetEventSheetManager().IsInEventEngine()|| b.GetLayoutManager().IsEndingLayout()||b.FlushPendingInstances()}getOtherContainerInstances(){const a=map$jscomp$5.get(this).GetSiblings();return a?a.map(b=>b.GetInterfaceClass()):[]}*otherContainerInstances(){const a=map$jscomp$5.get(this);if(a.IsInContainer())for(const b of a.siblings())yield b.GetInterfaceClass()}get templateName(){return map$jscomp$5.get(this).GetTemplateName()}set timeScale(a){C3X$jscomp$7.RequireFiniteNumber(a);map$jscomp$5.get(this).SetTimeScale(a)}get timeScale(){return map$jscomp$5.get(this).GetActiveTimeScale()}restoreTimeScale(){map$jscomp$5.get(this).RestoreTimeScale()}}; "use strict";const C3$jscomp$72=self.C3,C3X$jscomp$8=self.C3X,IInstance$jscomp$1=self.IInstance,ILayer$jscomp$4=self.ILayer,map$jscomp$6=new WeakMap,BLEND_MODE_TO_INDEX$jscomp$1=new Map([["normal",0],["additive",1],["copy",3],["destination-over",4],["source-in",5],["destination-in",6],["source-out",7],["destination-out",8],["source-atop",9],["destination-atop",10]]),INDEX_TO_BLEND_MODE$jscomp$1=new Map([...BLEND_MODE_TO_INDEX$jscomp$1.entries()].map(a=>[a[1],a[0]])),tempColor$jscomp$2=C3$jscomp$72.New(C3$jscomp$72.Color); self.IWorldInstance=class a extends IInstance$jscomp$1{constructor(){super();var b=IInstance$jscomp$1._GetInitInst();map$jscomp$6.set(this,b);const c=[];var d=b.GetWorldInfo();if(b=d.GetInstanceEffectList()){d=d.GetObjectClass().GetEffectList().GetAllEffectTypes().length;for(let e=0;e<d;++e)c.push(new self.IEffectInstance(b,e))}Object.defineProperties(this,{effects:{value:c,writable:!1}})}get layout(){return map$jscomp$6.get(this).GetWorldInfo().GetLayout().GetILayout()}get layer(){return map$jscomp$6.get(this).GetWorldInfo().GetLayer().GetILayer()}get x(){return map$jscomp$6.get(this).GetWorldInfo().GetX()}set x(b){b= +b;const c=map$jscomp$6.get(this).GetWorldInfo();isNaN(b)||c.GetX()===b||(c.SetX(b),c.SetBboxChanged())}get y(){return map$jscomp$6.get(this).GetWorldInfo().GetY()}set y(b){b=+b;const c=map$jscomp$6.get(this).GetWorldInfo();isNaN(b)||c.GetY()===b||(c.SetY(b),c.SetBboxChanged())}setPosition(b,c){b=+b;c=+c;const d=map$jscomp$6.get(this).GetWorldInfo();isNaN(b)||isNaN(c)||d.GetX()===b&&d.GetY()===c||(d.SetXY(b,c),d.SetBboxChanged())}getPosition(){const b=map$jscomp$6.get(this).GetWorldInfo();return[b.GetX(), b.GetY()]}offsetPosition(b,c){b=+b;c=+c;if(!(isNaN(b)||isNaN(c)||0===b&&0===c)){var d=map$jscomp$6.get(this).GetWorldInfo();d.OffsetXY(b,c);d.SetBboxChanged()}}get zElevation(){return map$jscomp$6.get(this).GetWorldInfo().GetZElevation()}set zElevation(b){b=+b;const c=map$jscomp$6.get(this),d=c.GetWorldInfo();isNaN(b)||d.GetZElevation()===b||(d.SetZElevation(b),c.GetRuntime().UpdateRender())}get totalZElevation(){return map$jscomp$6.get(this).GetWorldInfo().GetTotalZElevation()}get width(){return map$jscomp$6.get(this).GetWorldInfo().GetWidth()}set width(b){b= +b;const c=map$jscomp$6.get(this).GetWorldInfo();isNaN(b)||c.GetWidth()===b||(c.SetWidth(b),c.SetBboxChanged())}get height(){return map$jscomp$6.get(this).GetWorldInfo().GetHeight()}set height(b){b=+b;const c=map$jscomp$6.get(this).GetWorldInfo();isNaN(b)||c.GetHeight()===b||(c.SetHeight(b),c.SetBboxChanged())}setSize(b,c){b=+b;c=+c;const d=map$jscomp$6.get(this).GetWorldInfo();isNaN(b)||isNaN(c)||d.GetWidth()===b&&d.GetHeight()===c||(d.SetSize(b,c),d.SetBboxChanged())}getSize(){const b=map$jscomp$6.get(this).GetWorldInfo(); return[b.GetWidth(),b.GetHeight()]}get angle(){return map$jscomp$6.get(this).GetWorldInfo().GetAngle()}set angle(b){b=C3$jscomp$72.clampAngle(+b);const c=map$jscomp$6.get(this).GetWorldInfo();isNaN(b)||c.GetAngle()===b||(c.SetAngle(b),c.SetBboxChanged())}get angleDegrees(){return C3$jscomp$72.toDegrees(this.angle)}set angleDegrees(b){this.angle=C3$jscomp$72.toRadians(b)}getBoundingBox(){return map$jscomp$6.get(this).GetWorldInfo().GetBoundingBox().toDOMRect()}getBoundingQuad(){return map$jscomp$6.get(this).GetWorldInfo().GetBoundingQuad().toDOMQuad()}get isVisible(){return map$jscomp$6.get(this).GetWorldInfo().IsVisible()}set isVisible(b){b= !!b;const c=map$jscomp$6.get(this),d=c.GetWorldInfo();d.IsVisible()!==b&&(d.SetVisible(b),c.GetRuntime().UpdateRender())}get opacity(){return map$jscomp$6.get(this).GetWorldInfo().GetOpacity()}set opacity(b){b=C3$jscomp$72.clamp(+b,0,1);const c=map$jscomp$6.get(this),d=c.GetWorldInfo();isNaN(b)||d.GetOpacity()===b||(d.SetOpacity(b),c.GetRuntime().UpdateRender())}set colorRgb(b){C3X$jscomp$8.RequireArray(b);if(3>b.length)throw Error("expected 3 elements");tempColor$jscomp$2.setRgb(b[0],b[1],b[2]); b=map$jscomp$6.get(this);const c=b.GetWorldInfo();c.GetUnpremultipliedColor().equalsIgnoringAlpha(tempColor$jscomp$2)||(c.SetUnpremultipliedColor(tempColor$jscomp$2),b.GetRuntime().UpdateRender())}get colorRgb(){const b=map$jscomp$6.get(this).GetWorldInfo().GetUnpremultipliedColor();return[b.getR(),b.getG(),b.getB()]}set blendMode(b){C3X$jscomp$8.RequireString(b);b=BLEND_MODE_TO_INDEX$jscomp$1.get(b);if("number"!==typeof b)throw Error("invalid blend mode");const c=map$jscomp$6.get(this);c.GetWorldInfo().SetBlendMode(b); c.GetRuntime().UpdateRender()}get blendMode(){return INDEX_TO_BLEND_MODE$jscomp$1.get(map$jscomp$6.get(this).GetWorldInfo().GetBlendMode())}moveToTop(){map$jscomp$6.get(this).GetWorldInfo().ZOrderMoveToTop()}moveToBottom(){map$jscomp$6.get(this).GetWorldInfo().ZOrderMoveToBottom()}moveToLayer(b){C3X$jscomp$8.RequireInstanceOf(b,ILayer$jscomp$4);b=ILayer$jscomp$4._Unwrap(b);if(!b)throw Error("invalid layer");map$jscomp$6.get(this).GetWorldInfo().ZOrderMoveToLayer(b)}moveAdjacentToInstance(b,c){C3X$jscomp$8.RequireInstanceOf(b, a);map$jscomp$6.get(this).GetWorldInfo().ZOrderMoveAdjacentToInstance(map$jscomp$6.get(b),c)}get zIndex(){return map$jscomp$6.get(this).GetWorldInfo().GetZIndex()}get isCollisionEnabled(){return map$jscomp$6.get(this).GetWorldInfo().IsCollisionEnabled()}set isCollisionEnabled(b){map$jscomp$6.get(this).GetWorldInfo().SetCollisionEnabled(!!b)}containsPoint(b,c){C3X$jscomp$8.RequireNumber(b);C3X$jscomp$8.RequireNumber(c);return map$jscomp$6.get(this).GetWorldInfo().ContainsPoint(+b,+c)}testOverlap(b){C3X$jscomp$8.RequireInstanceOf(b, a);const c=map$jscomp$6.get(this);b=map$jscomp$6.get(b);return c.GetRuntime().GetCollisionEngine().TestOverlap(c,b)}testOverlapSolid(){var b=map$jscomp$6.get(this);return(b=b.GetRuntime().GetCollisionEngine().TestOverlapSolid(b))?b.GetInterfaceClass():null}getParent(){const b=map$jscomp$6.get(this).GetParent();return b?b.GetInterfaceClass():null}getTopParent(){const b=map$jscomp$6.get(this).GetTopParent();return b?b.GetInterfaceClass():null}*parents(){for(const b of map$jscomp$6.get(this).parents())yield b.GetInterfaceClass()}getChildCount(){return map$jscomp$6.get(this).GetChildCount()}getChildAt(b){return(b= map$jscomp$6.get(this).GetChildAt(b))?b.GetInterfaceClass():null}*children(){for(const b of map$jscomp$6.get(this).children())yield b.GetInterfaceClass()}*allChildren(){for(const b of map$jscomp$6.get(this).allChildren())yield b.GetInterfaceClass()}addChild(b,c){C3X$jscomp$8.RequireInstanceOf(b,a);C3X$jscomp$8.RequireOptionalObject(c);c||(c={});const d=map$jscomp$6.get(this);b=map$jscomp$6.get(b);d.AddChild(b,c)}removeChild(b){C3X$jscomp$8.RequireInstanceOf(b,a);const c=map$jscomp$6.get(this);b=map$jscomp$6.get(b); c.RemoveChild(b)}removeFromParent(){const b=map$jscomp$6.get(this);b.HasParent()&&b.GetParent().RemoveChild(b)}createMesh(b,c){C3X$jscomp$8.RequireFiniteNumber(b);C3X$jscomp$8.RequireFiniteNumber(c);map$jscomp$6.get(this).GetWorldInfo().CreateMesh(b,c)}releaseMesh(){const b=map$jscomp$6.get(this).GetWorldInfo();b.ReleaseMesh();b.SetBboxChanged()}setMeshPoint(b,c,d){C3X$jscomp$8.RequireFiniteNumber(b);C3X$jscomp$8.RequireFiniteNumber(c);C3X$jscomp$8.RequireObject(d);const e=map$jscomp$6.get(this).GetWorldInfo(); e.SetMeshPoint(b,c,d)&&e.SetBboxChanged()}getMeshSize(){var b=map$jscomp$6.get(this).GetWorldInfo();if(!b.HasMesh())return[0,0];b=b.GetSourceMesh();return[b.GetHSize(),b.GetVSize()]}};"use strict";const C3X$jscomp$9=self.C3X,map$jscomp$7=new WeakMap; self.IDOMInstance=class extends self.IWorldInstance{constructor(){super();map$jscomp$7.set(this,self.IInstance._GetInitInst())}getElement(){return map$jscomp$7.get(this).GetSdkInstance()._GetElementInDOMMode()}focus(){map$jscomp$7.get(this).GetSdkInstance().FocusElement()}blur(){map$jscomp$7.get(this).GetSdkInstance().BlurElement()}setCssStyle(a,b){C3X$jscomp$9.RequireString(a);map$jscomp$7.get(this).GetSdkInstance().SetElementCSSStyle(a,b)}};"use strict"; const C3$jscomp$74=self.C3,C3X$jscomp$10=self.C3X,map$jscomp$8=new WeakMap,dispatchers$jscomp$1=new WeakMap;function GetDispatcher$jscomp$1(a){let b=dispatchers$jscomp$1.get(a);if(b)return b;b=C3$jscomp$74.New(C3$jscomp$74.Event.Dispatcher);dispatchers$jscomp$1.set(a,b);return b}let initBehInst=null; self.IBehaviorInstance=class{constructor(){map$jscomp$8.set(this,initBehInst);const a={runtime:{value:initBehInst.GetRuntime().GetIRuntime(),writable:!1},behavior:{value:initBehInst.GetBehavior().GetIBehavior(),writable:!1}};Object.defineProperties(this,a)}static _Init(a){initBehInst=a}static _GetInitInst(){return initBehInst}get instance(){return map$jscomp$8.get(this).GetObjectInstance().GetInterfaceClass()}_Release(){const a=dispatchers$jscomp$1.get(this);a&&(a.Release(),dispatchers$jscomp$1.delete(this)); map$jscomp$8.delete(this)}addEventListener(a,b,c){C3X$jscomp$10.RequireString(a);C3X$jscomp$10.RequireFunction(b);GetDispatcher$jscomp$1(this).addEventListener(a,b,c)}removeEventListener(a,b,c){C3X$jscomp$10.RequireString(a);C3X$jscomp$10.RequireFunction(b);GetDispatcher$jscomp$1(this).removeEventListener(a,b,c)}dispatchEvent(a){GetDispatcher$jscomp$1(this).dispatchEvent(a)}};"use strict";const map$jscomp$9=new WeakMap; self.IBehavior=class{constructor(a){map$jscomp$9.set(this,a);a={runtime:{value:a.GetRuntime().GetIRuntime(),writable:!1}};Object.defineProperties(this,a)}getAllInstances(){return map$jscomp$9.get(this).GetInstances().map(a=>a.GetInterfaceClass())}};"use strict";const C3$jscomp$76=self.C3,C3X$jscomp$12=self.C3X,map$jscomp$10=new WeakMap,tempColor$jscomp$3=C3$jscomp$76.New(C3$jscomp$76.Color); self.IEffectInstance=class{constructor(a,b){map$jscomp$10.set(this,a);Object.defineProperties(this,{index:{value:b,writable:!1}})}get name(){return map$jscomp$10.get(this).GetAllEffectTypes()[this.index].GetName()}get isActive(){return map$jscomp$10.get(this).IsEffectIndexActive(this.index)}set isActive(a){a=!!a;const b=map$jscomp$10.get(this);b.IsEffectIndexActive(this.index)!==a&&(b.SetEffectIndexActive(this.index,a),b.UpdateActiveEffects(),b.GetRuntime().UpdateRender())}setParameter(a,b){C3X$jscomp$12.RequireFiniteNumber(a); a=Math.floor(+a);const c=map$jscomp$10.get(this),d=c.GetEffectParameter(this.index,a);if(null===d)throw new RangeError("invalid index");if(d instanceof C3$jscomp$76.Color){if(!Array.isArray(b)||3>b.length)throw new TypeError("expected array with 3 elements");tempColor$jscomp$3.setRgb(b[0],b[1],b[2]);b=tempColor$jscomp$3}else if("number"!==typeof b)throw new TypeError("expected number");c.SetEffectParameter(this.index,a,b)&&c.IsEffectIndexActive(this.index)&&c.GetRuntime().UpdateRender()}getParameter(a){C3X$jscomp$12.RequireFiniteNumber(a); a=Math.floor(+a);a=map$jscomp$10.get(this).GetEffectParameter(this.index,a);if(null===a)throw new RangeError("invalid index");return a instanceof C3$jscomp$76.Color?[a.getR(),a.getG(),a.getB()]:a}};"use strict";const map$jscomp$11=new WeakMap; self.IAnimation=class{constructor(a){map$jscomp$11.set(this,a);Object.defineProperties(this,{name:{value:a.GetName(),writable:!1},speed:{value:a.GetSpeed(),writable:!1},isLooping:{value:a.IsLooping(),writable:!1},repeatCount:{value:a.GetRepeatCount(),writable:!1},repeatTo:{value:a.GetRepeatTo(),writable:!1},isPingPong:{value:a.IsPingPong(),writable:!1},frameCount:{value:a.GetFrameCount(),writable:!1}})}getFrames(){return map$jscomp$11.get(this).GetFrames().map(a=>a.GetIAnimationFrame())}*frames(){for(const a of map$jscomp$11.get(this).GetFrames())yield a.GetIAnimationFrame()}}; "use strict";const map$jscomp$12=new WeakMap;self.IImageInfo=class{constructor(a){map$jscomp$12.set(this,a)}get width(){return map$jscomp$12.get(this).GetWidth()}get height(){return map$jscomp$12.get(this).GetHeight()}getSize(){const a=map$jscomp$12.get(this);return[a.GetWidth(),a.GetHeight()]}};"use strict";const C3X$jscomp$15=self.C3X,map$jscomp$13=new WeakMap; self.IAnimationFrame=class extends self.IImageInfo{constructor(a){super(a.GetImageInfo());map$jscomp$13.set(this,a);Object.defineProperties(this,{duration:{value:a.GetDuration(),writable:!1},originX:{value:a.GetOriginX(),writable:!1},originY:{value:a.GetOriginY(),writable:!1}})}getOrigin(){const a=map$jscomp$13.get(this);return[a.GetOriginX(),a.GetOriginY()]}getImagePointCount(){return map$jscomp$13.get(this).GetImagePointCount()}getImagePointX(a){return this.getImagePoint(a)[0]}getImagePointY(a){return this.getImagePoint(a)[1]}getImagePoint(a){const b= map$jscomp$13.get(this);if("number"===typeof a)a=b.GetImagePointByIndex(Math.floor(a));else if("string"===typeof a)a=b.GetImagePointByName(a);else throw new TypeError("expected string or number");return a?[a.GetX(),a.GetY()]:this.getOrigin()}getPolyPointCount(){const a=map$jscomp$13.get(this).GetCollisionPoly();return a?a.pointCount():0}getPolyPointX(a){return this.getPolyPoint(a)[0]}getPolyPointY(a){return this.getPolyPoint(a)[1]}getPolyPoint(a){C3X$jscomp$15.RequireFiniteNumber(a);a=Math.floor(a); var b=map$jscomp$13.get(this).GetCollisionPoly();if(!b||0>a||a>=b.pointCount())return[0,0];b=b.pointsArr();return[b[2*a],b[2*a+1]]}};"use strict";const C3X$jscomp$16=self.C3X,map$jscomp$14=new WeakMap;function GetTimelineState(a){a=map$jscomp$14.get(a);if(a.IsReleased())throw Error("timeline/tween was released and is no longer valid");return a} self.ITimelineState=class{constructor(a){map$jscomp$14.set(this,a)}pause(){GetTimelineState(this).Stop()}resume(){GetTimelineState(this).Resume()}hasTags(a){return GetTimelineState(this).HasTags(a)}set time(a){C3X$jscomp$16.RequireFiniteNumber(a);GetTimelineState(this).SetTime(a)}get time(){return GetTimelineState(this).GetTime()}set totalTime(a){C3X$jscomp$16.RequireFiniteNumber(a);GetTimelineState(this).SetTotalTime(a)}get totalTime(){return GetTimelineState(this).GetTotalTime()}set isLooping(a){GetTimelineState(this).SetLoop(!!a)}get isLooping(){return GetTimelineState(this).GetLoop()}set isPingPong(a){GetTimelineState(this).SetPingPong(!!a)}get isPingPong(){return GetTimelineState(this).GetPingPong()}set playbackRate(a){C3X$jscomp$16.RequireFiniteNumber(a); GetTimelineState(this).SetPlaybackRate(a)}get playbackRate(){return GetTimelineState(this).GetPlaybackRate()}get progress(){const a=GetTimelineState(this);return a.GetTime()/a.GetTotalTime()}get tags(){return GetTimelineState(this).GetTags()}get finished(){return GetTimelineState(this).GetPlayPromise()}get isPlaying(){return GetTimelineState(this).IsPlaying()}get isPaused(){return GetTimelineState(this).IsPaused()}get isReleased(){return map$jscomp$14.get(this).IsReleased()}};"use strict"; const C3X$jscomp$17=self.C3X,map$jscomp$15=new WeakMap,behInstMap=new WeakMap;let easeToIndexFunc=null;function GetTweenState(a){a=map$jscomp$15.get(a);if(a.IsReleased())throw Error("timeline/tween was released and is no longer valid");return a} self.ITweenState=class extends self.ITimelineState{constructor(a,b,c){super(a);easeToIndexFunc||(easeToIndexFunc=c.easeToIndexFunc);map$jscomp$15.set(this,a);b&&behInstMap.set(this,b)}stop(){const a=GetTweenState(this);behInstMap.get(this).ReleaseTween(a)}setEase(a){C3X$jscomp$17.RequireString(a);a=self.Ease.GetEaseFromIndex(easeToIndexFunc(a));GetTweenState(this).SetEase(a)}get instance(){const a=GetTweenState(this).GetInstance();return a?a.GetInterfaceClass():null}get isDestroyOnComplete(){return GetTweenState(this).GetDestroyInstanceOnComplete()}set isDestroyOnComplete(a){GetTweenState(this).SetDestroyInstanceOnComplete(!!a)}get value(){const a= GetTweenState(this);if("value"!==a.GetId())throw Error("not a value tween");return a.GetPropertyTrack("value").GetSourceAdapterValue()}};"use strict";const C3$jscomp$82=self.C3,VALID_LOAD_POLICIES=new Set(["local","remote"]),EXT_TO_TYPE=new Map([["mp4","video/mp4"],["webm","video/webm"],["m4a","audio/mp4"],["mp3","audio/mpeg"],["js","application/javascript"],["wasm","application/wasm"],["svg","image/svg+xml"],["html","text/html"]]); function GetTypeFromFileExtension(a){if(!a)return"";a=a.split(".");if(2>a.length)return"";a=a.at(-1).toLowerCase();return EXT_TO_TYPE.get(a)||""}function AddScript(a){return new Promise((b,c)=>{const d=document.createElement("script");d.onload=b;d.onerror=c;d.async=!1;d.type="module";d.src=a;document.head.appendChild(d)})} C3$jscomp$82.AssetManager=class extends C3$jscomp$82.DefendedBase{constructor(a,b){super();var c=b.exportType;this._runtime=a;this._fileStructure="folders";this._localUrlBlobs=new Map;this._localBlobUrlCache=new Map;this._localBlobSWUrls=new Map;this._isCordova="cordova"===c;this._isiOSCordova=!!b.isiOSCordova;this._isFileProtocol=!!b.isFileProtocol;this._swClientId=b.swClientId;this._supportedAudioFormats=b.supportedAudioFormats||{};this._audioFiles=new Map;this._preloadSounds=!1;this._iconsSubfolder= this._fontsSubfolder=this._mediaSubfolder="";this._defaultLoadPolicy="html5"===c||"scirra-arcade"===c||"instant-games"===c?"remote":"local";this._allAssets=[];this._assetsByUrl=new Map;this._webFonts=[];this._loadPromises=[];this._hasFinishedInitialLoad=!1;this._lastLoadProgress=this._assetSizeLoaded=this._totalAssetSizeToLoad=0;this._hasHadErrorLoading=!1;this._loadingRateLimiter=C3$jscomp$82.New(C3$jscomp$82.RateLimiter,()=>this._FireLoadingProgressEvent(),50);this._promiseThrottle=new C3$jscomp$82.PromiseThrottle(Math.max(C3$jscomp$82.hardwareConcurrency, 8));if(a=b.previewImageBlobs){(c=b.previewProjectFileBlobs)&&Object.assign(a,c);(c=b.projectData)&&(a["data.json"]=c);for(const [d,e]of Object.entries(a))this._localUrlBlobs.set(d,e)}if(b=b.previewProjectFileSWUrls)for(const [d,e]of Object.entries(b))this._localBlobSWUrls.set(d,e);this._iAssetManager=new self.IAssetManager(this)}Release(){this._localUrlBlobs.clear();for(const a of this._localBlobUrlCache.values())a.startsWith("blob:")&&URL.revokeObjectURL(a);this._localBlobUrlCache.clear();for(const a of this._allAssets)a.Release(); C3$jscomp$82.clearArray(this._allAssets);this._assetsByUrl.clear();C3$jscomp$82.clearArray(this._loadPromises);this._runtime=null}GetRuntime(){return this._runtime}_SetFileStructure(a){this._fileStructure=a;if("flat"===a){a=new Map;for(const [b,c]of this._localUrlBlobs.entries())a.set(b.toLowerCase(),c);this._localUrlBlobs=a}}GetFileStructure(){return this._fileStructure}_SetMediaSubfolder(a){this._mediaSubfolder=a}GetMediaSubfolder(){return this._mediaSubfolder}_SetFontsSubfolder(a){this._fontsSubfolder= a}GetFontsSubfolder(){return this._fontsSubfolder}_SetIconsSubfolder(a){this._iconsSubfolder=a}GetIconsSubfolder(){return this._iconsSubfolder}IsFileProtocol(){return this._isFileProtocol}_HasLocalUrlBlob(a){"flat"===this._fileStructure&&(a=a.toLowerCase());return this._localUrlBlobs.has(a)}_GetLocalUrlBlob(a){"flat"===this._fileStructure&&(a=a.toLowerCase());return this._localUrlBlobs.get(a)||null}GetLocalUrlAsBlobUrl(a){"flat"===this._fileStructure&&(a=a.toLowerCase());if(!this._HasLocalUrlBlob(a))return a; var b=this._localBlobUrlCache.get(a);b||(b=this._GetLocalUrlBlob(a),b=URL.createObjectURL(b),this._localBlobUrlCache.set(a,b));return b}FetchBlob(a,b){b=b||this._defaultLoadPolicy;const c=this._GetLocalUrlBlob(a);return c?Promise.resolve(c):C3$jscomp$82.IsRelativeURL(a)?("flat"===this._fileStructure&&(a=a.toLowerCase()),this._isCordova&&this._isFileProtocol?this.CordovaFetchLocalFileAsBlob(a):"local"===b?this._promiseThrottle.Add(()=>C3$jscomp$82.FetchBlob(a)):C3$jscomp$82.FetchBlob(a)):C3$jscomp$82.FetchBlob(a)}FetchArrayBuffer(a){const b= this._GetLocalUrlBlob(a);return b?C3$jscomp$82.BlobToArrayBuffer(b):C3$jscomp$82.IsRelativeURL(a)?("flat"===this._fileStructure&&(a=a.toLowerCase()),this._isCordova&&this._isFileProtocol?this.CordovaFetchLocalFileAsArrayBuffer(a):"local"===this._defaultLoadPolicy?this._promiseThrottle.Add(()=>C3$jscomp$82.FetchArrayBuffer(a)):C3$jscomp$82.FetchArrayBuffer(a)):C3$jscomp$82.FetchArrayBuffer(a)}FetchText(a){const b=this._GetLocalUrlBlob(a);return b?C3$jscomp$82.BlobToString(b):C3$jscomp$82.IsRelativeURL(a)? ("flat"===this._fileStructure&&(a=a.toLowerCase()),this._isCordova&&this._isFileProtocol?this.CordovaFetchLocalFileAsText(a):"local"===this._defaultLoadPolicy?this._promiseThrottle.Add(()=>C3$jscomp$82.FetchText(a)):C3$jscomp$82.FetchText(a)):C3$jscomp$82.FetchText(a)}async FetchJson(a){a=await this.FetchText(a);return JSON.parse(a)}_CordovaFetchLocalFileAs(a,b){"flat"===this._fileStructure&&(a=a.toLowerCase());return this._runtime.PostComponentMessageToDOMAsync("runtime","cordova-fetch-local-file", {filename:a,as:b})}CordovaFetchLocalFileAsText(a){return this._CordovaFetchLocalFileAs(a,"text")}async CordovaFetchLocalFileAsBlob(a){const b=await this._CordovaFetchLocalFileAs(a,"buffer");a=GetTypeFromFileExtension(a);return new Blob([b],{type:a})}async CordovaFetchLocalFileAsBlobURL(a){"flat"===this._fileStructure&&(a=a.toLowerCase());var b=this._localBlobUrlCache.get(a);if(b)return b;b=await this.CordovaFetchLocalFileAsBlob(a);b=URL.createObjectURL(b);this._localBlobUrlCache.set(a,b);return b}CordovaFetchLocalFileAsArrayBuffer(a){return this._CordovaFetchLocalFileAs(a, "buffer")}GetMediaFileUrl(a){"flat"===this._fileStructure&&(a=a.toLowerCase());a=this._mediaSubfolder+a;return this._HasLocalUrlBlob(a)?this.GetLocalUrlAsBlobUrl(a):a}GetProjectFileUrl(a){if(C3$jscomp$82.IsAbsoluteURL(a))return Promise.resolve(a);if(this._HasLocalUrlBlob(a))return Promise.resolve(this.GetLocalUrlAsBlobUrl(a));if(this._isCordova&&this._isFileProtocol)return this.CordovaFetchLocalFileAsBlobURL(a);"flat"===this._fileStructure&&(a=a.toLowerCase());return Promise.resolve(a)}GetProjectFileIframeUrl(a){if(C3$jscomp$82.IsAbsoluteURL(a))return Promise.resolve(a); var b=a.indexOf("?"),c=-1===b?"":a.substr(b);b=-1===b?a:a.substr(0,b);if(this._HasLocalUrlBlob(b))return a=this._localBlobSWUrls.get(b)||this.GetLocalUrlAsBlobUrl(b),!a.startsWith("blob:")&&this._swClientId&&(a=new URL(a),c=new URLSearchParams(c),c.set("__c3_client_id",this._swClientId),a.search=c.toString(),a=a.toString()),Promise.resolve(a);if(this._isCordova&&this._isFileProtocol)return this.CordovaFetchLocalFileAsBlobURL(b);"flat"===this._fileStructure&&(a=a.toLowerCase());return Promise.resolve(a)}LoadProjectFileUrl(a){return this.GetProjectFileUrl(a)}LoadImage(a){if(a.loadPolicy&& !VALID_LOAD_POLICIES.has(a.loadPolicy))throw Error("invalid load policy");let b=this._assetsByUrl.get(a.url);if(b)return b;b=C3$jscomp$82.New(C3$jscomp$82.ImageAsset,this,{url:a.url,size:a.size||0,loadPolicy:a.loadPolicy||this._defaultLoadPolicy});this._allAssets.push(b);this._assetsByUrl.set(b.GetURL(),b);this._hasFinishedInitialLoad||(this._totalAssetSizeToLoad+=b.GetSize(),this._loadPromises.push(b.Load().then(()=>this._AddLoadedSize(b.GetSize()))));return b}async WaitForAllToLoad(){try{await Promise.all(this._loadPromises), this._lastLoadProgress=1}catch(a){console.error("Error loading: ",a),this._hasHadErrorLoading=!0,this._FireLoadingProgressEvent()}}SetInitialLoadFinished(){this._hasFinishedInitialLoad=!0}HasHadErrorLoading(){return this._hasHadErrorLoading}_AddLoadedSize(a){this._assetSizeLoaded+=a;this._loadingRateLimiter.Call()}_FireLoadingProgressEvent(){const a=C3$jscomp$82.New(C3$jscomp$82.Event,"loadingprogress");this._lastLoadProgress=C3$jscomp$82.clamp(this._assetSizeLoaded/this._totalAssetSizeToLoad,0,1); a.progress=this._lastLoadProgress;this._runtime.Dispatcher().dispatchEvent(a)}GetLoadProgress(){return this._lastLoadProgress}_SetWebFonts(a){C3$jscomp$82.shallowAssignArray(this._webFonts,a);this._webFonts.length&&this._loadPromises.push(this._LoadWebFonts())}async _LoadWebFonts(){const a=[],b=[];for(const [c,d,e]of this._webFonts)this._totalAssetSizeToLoad+=e,a.push(this._LoadWebFont(c,d,b).then(()=>this._AddLoadedSize(e)));await Promise.all(a);this._runtime.IsInWorker()&&0<b.length&&await this._runtime.PostComponentMessageToDOMAsync("runtime", "load-webfonts",{webfonts:b})}async _LoadWebFont(a,b,c){try{const d=await this.GetProjectFileUrl(b),e=new FontFace(a,`url('${d}')`);this._runtime.IsInWorker()?self.fonts.add(e):document.fonts.add(e);await e.load();this._runtime.IsInWorker()&&c.push({name:a,url:d})}catch(d){console.warn(`[C3 runtime] Failed to load web font '${a}': `,d)}}IsAudioFormatSupported(a){return!!this._supportedAudioFormats[a]}_SetAudioFiles(a,b){this._preloadSounds=!!b;for(const [c,d,e]of a)this._audioFiles.set(c,{fileName:c, formats:d.map(g=>({type:g[0],fileExtension:g[1],fullName:c+g[1],fileSize:g[2]})),isMusic:e})}GetPreferredAudioFile(a){"flat"===this._fileStructure&&(a=a.toLowerCase());a=this._audioFiles.get(a);if(!a)return null;let b=null;for(const c of a.formats)if(b||"audio/webm; codecs=opus"!==c.type||(b=c),this.IsAudioFormatSupported(c.type))return c;return b}GetProjectAudioFileUrl(a){return(a=this.GetPreferredAudioFile(a))?{url:this.GetMediaFileUrl(a.fullName),type:a.type}:null}GetAudioToPreload(){if(this._preloadSounds){const a= [];for(const b of this._audioFiles.values()){if(b.isMusic)continue;const c=this.GetPreferredAudioFile(b.fileName);c&&a.push({originalUrl:b.fileName,url:this.GetMediaFileUrl(c.fullName),type:c.type,fileSize:c.fileSize})}return a}return[]}GetIAssetManager(){return this._iAssetManager}async LoadScripts(...a){const b=await Promise.all(a.map(c=>this.GetProjectFileUrl(c)));this._runtime.IsInWorker()?1===a.length?(a=a[0],await self.c3_import((C3$jscomp$82.IsRelativeURL(a)?"./":"")+a)):(a=a.map(c=>`import "${C3$jscomp$82.IsRelativeURL(c)? "./":""}${c}";`).join("\n"),a=URL.createObjectURL(new Blob([a],{type:"application/javascript"})),await self.c3_import(a)):await Promise.all(b.map(c=>AddScript(c)))}async CompileWebAssembly(a){if(WebAssembly.compileStreaming)return a=await this.GetProjectFileUrl(a),await WebAssembly.compileStreaming(fetch(a));a=await C3$jscomp$82.FetchArrayBuffer(a);return await WebAssembly.compile(a)}async LoadStyleSheet(a){a=await this.GetProjectFileUrl(a);return await this._runtime.PostComponentMessageToDOMAsync("runtime", "add-stylesheet",{url:a})}};"use strict";const C3$jscomp$83=self.C3; C3$jscomp$83.Asset=class extends C3$jscomp$83.DefendedBase{constructor(a,b){super();this._assetManager=a;this._runtime=a.GetRuntime();this._url=b.url||"";this._size=b.size;this._loadPolicy=b.loadPolicy;this._blob=b.blob||null;this._isLoaded=!!this._blob;this._loadPromise=null}Release(){this._blob=this._runtime=this._assetManager=this._loadPromise=null}GetURL(){return this._url}GetSize(){return this._size}Load(){return"local"===this._loadPolicy||this._blob?(this._isLoaded=!0,Promise.resolve()):this._loadPromise? this._loadPromise:this._loadPromise=this._assetManager.FetchBlob(this._url,this._loadPolicy).then(a=>{this._isLoaded=!0;this._loadPromise=null;return this._blob=a}).catch(a=>console.error("Error loading resource: ",a))}IsLoaded(){return this._isLoaded}GetBlob(){return this._blob?Promise.resolve(this._blob):this._loadPromise?this._loadPromise:this._assetManager.FetchBlob(this._url,this._loadPolicy)}};"use strict"; const C3$jscomp$84=self.C3,promiseThrottle=new C3$jscomp$84.PromiseThrottle,allImageAssets=new Set; C3$jscomp$84.ImageAsset=class extends C3$jscomp$84.Asset{constructor(a,b){super(a,b);this._webglTexture=this._texturePromise=null;this._refCount=0;this._imageHeight=this._imageWidth=-1;allImageAssets.add(this)}Release(){this.ReleaseTexture();if(0!==this._refCount)throw Error("released image asset which still has texture references");this._texturePromise=null;allImageAssets.delete(this);super.Release()}static OnRendererContextLost(){for(const a of allImageAssets)a._texturePromise=null,a._webglTexture= null,a._refCount=0}LoadStaticTexture(a,b){b=b||{};this._refCount++;if(this._webglTexture)return Promise.resolve(this._webglTexture);if(this._texturePromise)return this._texturePromise;b.anisotropy=this._runtime.GetCanvasManager().GetTextureAnisotropy();return this._texturePromise=this.GetBlob().then(c=>promiseThrottle.Add(()=>a.CreateStaticTextureAsync(c,b).then(d=>{this._texturePromise=null;if(0===this._refCount)return a.DeleteTexture(d),null;this._webglTexture=d;this._imageWidth=d.GetWidth();this._imageHeight= d.GetHeight();return this._webglTexture}))).catch(c=>{console.error("Failed to load texture: ",c);throw c;})}ReleaseTexture(){if(0>=this._refCount)throw Error("texture released too many times");this._refCount--;0===this._refCount&&this._webglTexture&&(this._webglTexture.GetRenderer().DeleteTexture(this._webglTexture),this._webglTexture=null)}GetTexture(){return this._webglTexture}GetWidth(){return this._imageWidth}GetHeight(){return this._imageHeight}async LoadToDrawable(){const a=await this.GetBlob(); return C3$jscomp$84.Supports.ImageBitmap?await createImageBitmap(a):await C3$jscomp$84.BlobToImage(a)}};"use strict";const C3$jscomp$85=self.C3;function SortByInstLastCachedZIndex(a,b){return a.GetWorldInfo()._GetLastCachedZIndex()-b.GetWorldInfo()._GetLastCachedZIndex()} C3$jscomp$85.RenderCell=class extends C3$jscomp$85.DefendedBase{constructor(a,b,c){super();this._grid=a;this._x=b;this._y=c;this._instances=[];this._isSorted=!0;this._pendingRemoval=new Set;this._isAnyPendingRemoval=!1}Release(){C3$jscomp$85.clearArray(this._instances);this._pendingRemoval.clear();this._grid=null}Reset(){C3$jscomp$85.clearArray(this._instances);this._isSorted=!0;this._pendingRemoval.clear();this._isAnyPendingRemoval=!1}SetChanged(){this._isSorted=!1}IsEmpty(){if(!this._instances.length)return!0; if(this._instances.length>this._pendingRemoval.size)return!1;this._FlushPending();return!0}Insert(a){this._pendingRemoval.has(a)?(this._pendingRemoval.delete(a),0===this._pendingRemoval.size&&(this._isAnyPendingRemoval=!1)):(this._instances.push(a),this._isSorted=1===this._instances.length)}Remove(a){this._pendingRemoval.add(a);this._isAnyPendingRemoval=!0;50<=this._pendingRemoval.size&&this._FlushPending()}_FlushPending(){this._isAnyPendingRemoval&&(this._instances.length===this._pendingRemoval.size? this.Reset():(C3$jscomp$85.arrayRemoveAllInSet(this._instances,this._pendingRemoval),this._pendingRemoval.clear(),this._isAnyPendingRemoval=!1))}_EnsureSorted(){this._isSorted||(this._instances.sort(SortByInstLastCachedZIndex),this._isSorted=!0)}Dump(a){this._FlushPending();this._EnsureSorted();this._instances.length&&a.push(this._instances)}};"use strict";const C3$jscomp$86=self.C3; C3$jscomp$86.RenderGrid=class extends C3$jscomp$86.DefendedBase{constructor(a,b){super();this._cellWidth=a;this._cellHeight=b;this._cells=C3$jscomp$86.New(C3$jscomp$86.PairMap)}Release(){this._cells.Release();this._cells=null}GetCell(a,b,c){let d=this._cells.Get(a,b);return d?d:c?(d=C3$jscomp$86.New(C3$jscomp$86.RenderCell,this,a,b),this._cells.Set(a,b,d),d):null}XToCell(a){return Math.floor(a/this._cellWidth)}YToCell(a){return Math.floor(a/this._cellHeight)}Update(a,b,c){if(b)for(let d=b.getLeft(), e=b.getRight();d<=e;++d)for(let g=b.getTop(),k=b.getBottom();g<=k;++g){if(c&&c.containsPoint(d,g))continue;const l=this.GetCell(d,g,!1);l&&(l.Remove(a),l.IsEmpty()&&this._cells.Delete(d,g))}if(c)for(let d=c.getLeft(),e=c.getRight();d<=e;++d)for(let g=c.getTop(),k=c.getBottom();g<=k;++g)b&&b.containsPoint(d,g)||this.GetCell(d,g,!0).Insert(a)}QueryRange(a,b){let c=this.XToCell(a.getLeft());const d=this.YToCell(a.getTop()),e=this.XToCell(a.getRight());for(a=this.YToCell(a.getBottom());c<=e;++c)for(let g= d;g<=a;++g){const k=this.GetCell(c,g,!1);k&&k.Dump(b)}}MarkRangeChanged(a){let b=a.getLeft();const c=a.getTop(),d=a.getRight();for(a=a.getBottom();b<=d;++b)for(let e=c;e<=a;++e){const g=this.GetCell(b,e,!1);g&&g.SetChanged()}}};"use strict";const C3$jscomp$87=self.C3,tmpRect$jscomp$2=new C3$jscomp$87.Rect,tmpQuad$jscomp$2=new C3$jscomp$87.Quad,renderCellArr=[];new C3$jscomp$87.Rect;new C3$jscomp$87.Rect; const glMatrix$jscomp$8=self.glMatrix,vec3$jscomp$6=glMatrix$jscomp$8.vec3,vec4$jscomp$5=glMatrix$jscomp$8.vec4,mat4$jscomp$9=glMatrix$jscomp$8.mat4,tempMat4$jscomp$4=mat4$jscomp$9.create(),tempVec3=vec3$jscomp$6.create(),tempVec4$jscomp$1=vec4$jscomp$5.create(),camVector=vec3$jscomp$6.create(),lookVector=vec3$jscomp$6.create(),upVector=vec3$jscomp$6.create(),tempVec2=C3$jscomp$87.New(C3$jscomp$87.Vector2);C3$jscomp$87.New(C3$jscomp$87.Rect); function SortByInstLastCachedZIndex$jscomp$1(a,b){return a.GetWorldInfo()._GetLastCachedZIndex()-b.GetWorldInfo()._GetLastCachedZIndex()}function SortByInstZElevation(a,b){return a.GetWorldInfo().GetZElevation()-b.GetWorldInfo().GetZElevation()} const tempInstanceList1=[],tempInstanceList2=[],tempInstancesByCameraDist=[],DEFAULT_LAYER_OPTIONS={name:"",sid:-1,isDynamic:!1,isVisible:!0,isInteractive:!0,backgroundColor:[1,1,1,1],isTransparent:!0,parallax:[1,1],opacity:1,isForceOwnTexture:!1,renderAs3d:!1,useCameraDistanceDrawOrder:!1,useRenderCells:!1,scaleRate:1,blendMode:0,zElevation:0,initialInstancesData:[],effectListData:[],subLayersData:[]}; C3$jscomp$87.Layer=class extends C3$jscomp$87.DefendedBase{constructor(a,b,c){super();c=Object.assign({},DEFAULT_LAYER_OPTIONS,c);this._layout=a;this._runtime=a.GetRuntime();this._parentLayer=b;this._name=c.name;this._index=-1;this._sid=c.sid;this._isDynamic=!!c.isDynamic;this._isVisible=!!c.isVisible;this._isInteractive=!!c.isInteractive;this._backgroundColor=C3$jscomp$87.New(C3$jscomp$87.Color);this._backgroundColor.setFromJSON(c.backgroundColor);this._isTransparent=!!c.isTransparent;this._parallaxX= c.parallax[0];this._parallaxY=c.parallax[1];this._color=C3$jscomp$87.New(C3$jscomp$87.Color,1,1,1,c.opacity);this._premultipliedColor=C3$jscomp$87.New(C3$jscomp$87.Color);this._isForceOwnTexture=!!c.isForceOwnTexture;this._renderAs3d=!!c.renderAs3d;this._useCameraDistanceDrawOrder=!!c.useCameraDistanceDrawOrder;this._useRenderCells=!!c.useRenderCells;this._scaleRate=c.scaleRate;this._blendMode=c.blendMode;this._curRenderTarget=null;this._scale=1;this._zElevation=c.zElevation;this._scrollY=this._scrollX= this._angle=0;this._hasOwnScrollPosition=!1;this._viewport=C3$jscomp$87.New(C3$jscomp$87.Rect);this._viewportZ0=C3$jscomp$87.New(C3$jscomp$87.Rect);this._viewport3D=C3$jscomp$87.New(C3$jscomp$87.Rect);this._isViewportChanged=!0;this._projectionMatrix=mat4$jscomp$9.create();this._isProjectionMatrixChanged=!0;this._modelViewMatrix=mat4$jscomp$9.create();this._isMVMatrixChanged=!0;this._viewFrustum=C3$jscomp$87.New(C3$jscomp$87.Gfx.ViewFrustum);this._isViewFrustumChanged=!0;this._startupInitialInstances= [];this._initialInstancesData=c.initialInstancesData;this._initialInstances=[];this._createdGlobalUids=[];this._initialUIDsToInstanceData=new Map;this._instances=[];this._anyInstanceZElevated=this._zIndicesUpToDate=!1;const d=this._runtime.GetCanvasManager();this._effectList=C3$jscomp$87.New(C3$jscomp$87.EffectList,this,c.effectListData);this._effectChain=C3$jscomp$87.New(C3$jscomp$87.Gfx.EffectChain,d.GetEffectChainManager(),{drawContent:(e,g)=>{g=g.GetContentObject();const k=g.GetRenderTarget(); e.SetColor(g.GetPremultipliedColor());e.DrawRenderTarget(k);e.InvalidateRenderTarget(k);d.ReleaseAdditionalRenderTarget(k)},getShaderParameters:e=>this.GetEffectList()._GetEffectChainShaderParametersForIndex(e)});this._wasDefaultColor=this._needsRebuildEffectChainSteps=!0;this._renderGrid=null;this._lastRenderList=[];this._isRenderListUpToDate=!1;this._lastRenderCells=C3$jscomp$87.New(C3$jscomp$87.Rect,0,0,-1,-1);this._curRenderCells=C3$jscomp$87.New(C3$jscomp$87.Rect,0,0,-1,-1);this._iLayer=new self.ILayer(this); this._UpdatePremultipliedColor();this.UsesRenderCells()&&(this._renderGrid=C3$jscomp$87.New(C3$jscomp$87.RenderGrid,this._runtime.GetOriginalViewportWidth(),this._runtime.GetOriginalViewportHeight()));this._subLayers=c.subLayersData.map(e=>C3$jscomp$87.Layer.CreateFromExportData(this._layout,this,e))}_InitInitialInstances(){for(const a of this._initialInstancesData){const b=this._runtime.GetObjectClassByIndex(a[1]);this._layout._AddInitialObjectClass(b);b.GetDefaultInstanceData()||(b.SetDefaultInstanceData(a), b._SetDefaultLayerIndex(this._index));this._initialInstances.push(a);this._initialUIDsToInstanceData.set(a[2],a)}C3$jscomp$87.shallowAssignArray(this._startupInitialInstances,this._initialInstances);this._initialInstancesData=null}static CreateFromExportData(a,b,c){return C3$jscomp$87.New(C3$jscomp$87.Layer,a,b,{name:c[0],sid:c[2],isVisible:c[3],isInteractive:c[13],backgroundColor:c[4].map(d=>d/255),isTransparent:c[5],parallax:[c[6],c[7]],opacity:c[8],isForceOwnTexture:c[9],renderAs3d:c[17],useCameraDistanceDrawOrder:c[18], useRenderCells:c[10],scaleRate:c[11],blendMode:c[12],zElevation:c[16],initialInstancesData:c[14],effectListData:c[15],subLayersData:c[19]})}Release(){for(const a of this._subLayers)a.Release();C3$jscomp$87.clearArray(this._subLayers);for(const a of this._instances)this._runtime.DestroyInstance(a);C3$jscomp$87.clearArray(this._instances);this._runtime=this._layout=this._parentLayer=this._iLayer=null}GetInitialInstanceData(a){return this._initialUIDsToInstanceData.get(a)}CreateInitialInstances(a){const b= this._layout.IsFirstVisit();let c=0;const d=this._initialInstances;for(let g=0,k=d.length;g<k;++g){var e=d[g];const l=this._runtime.GetObjectClassByIndex(e[1]);let n=!0;if(!l.HasPersistBehavior()||b)e=this._runtime.CreateInstanceFromData(e,this,!0),a.push(e),l.IsGlobal()&&(n=!1,this._createdGlobalUids.push(e.GetUID()));n&&(d[c]=d[g],++c)}C3$jscomp$87.truncateArray(d,c);this._runtime.FlushPendingInstances();this.SetZIndicesChanged()}_AddInstance(a,b){if(!a.GetPlugin().IsWorldType())throw Error("instance is not of world type"); const c=a.GetWorldInfo();if(c.GetLayer()!==this)throw Error("instance added to wrong layer");this._instances.push(a);0!==c.GetZElevation()&&(this._anyInstanceZElevated=!0);b&&this.UsesRenderCells()&&a.GetWorldInfo().SetBboxChanged();this.SetZIndicesChanged()}_MaybeAddInstance(a){this._instances.includes(a)||(this._instances.push(a),0!==a.GetWorldInfo().GetZElevation()&&(this._anyInstanceZElevated=!0),this.SetZIndicesChanged())}_PrependInstance(a,b){const c=a.GetWorldInfo();if(c.GetLayer()!==this)throw Error("instance added to wrong layer"); this._instances.unshift(a);0!==c.GetZElevation()&&(this._anyInstanceZElevated=!0);this.SetZIndicesChanged();b&&this.UsesRenderCells()&&a.GetWorldInfo().SetBboxChanged()}_RemoveInstance(a,b){const c=this._instances.indexOf(a);0>c||(b&&this.UsesRenderCells()&&a.GetWorldInfo()._RemoveFromRenderCells(),this._instances.splice(c,1),this.SetZIndicesChanged(),this._MaybeResetAnyInstanceZElevatedFlag())}_SetAnyInstanceZElevated(){this._anyInstanceZElevated=!0}_MaybeResetAnyInstanceZElevatedFlag(){0===this._instances.length&& (this._anyInstanceZElevated=!1)}_SortInstancesByLastCachedZIndex(a){if(a){a=new Set;for(var b of this._instances){var c=b.GetWorldInfo()._GetLastCachedZIndex();0<=c&&a.add(c)}b=-1;for(const d of this._instances)if(c=d.GetWorldInfo(),!(0<=c._GetLastCachedZIndex())){for(++b;a.has(b);)++b;c._SetZIndex(b)}}this._instances.sort(SortByInstLastCachedZIndex$jscomp$1)}_Start(){}_End(){for(const a of this._instances)a.GetObjectClass().IsGlobal()||this._runtime.DestroyInstance(a);this._runtime.FlushPendingInstances(); C3$jscomp$87.clearArray(this._instances);this._anyInstanceZElevated=!1;this.SetZIndicesChanged()}RecreateInitialObjects(a,b,c,d,e){const g=this._runtime.GetEventSheetManager(),k=this._runtime.GetAllObjectClasses(),l=a.IsFamily(),n=[];for(const w of this._initialInstances){var p=w[0];if(b.containsPoint(p[0],p[1])){p=k[w[1]];if(p!==a)if(l){if(!a.FamilyHasMember(p))continue}else continue;p=this;var r=this._runtime.GetCurrentLayout();this.GetLayout()!==r&&((p=r.GetLayerByName(this.GetName()))||(p=r.GetLayerByIndex(this.GetIndex()))); r=this._runtime.CreateInstanceFromData(w,p,!1,void 0,void 0,!1,e);p.SortAndAddInstancesByZIndex(r);p=r.GetWorldInfo();p.OffsetXY(c,d);p.SetBboxChanged();g.BlockFlushingInstances(!0);r._TriggerOnCreatedOnSelfAndRelated();g.BlockFlushingInstances(!1);n.push(r)}}return n}GetInstanceCount(){return this._instances.length}GetLayout(){return this._layout}GetName(){return this._name}_SetIndex(a){this._index=a}GetIndex(){return this._index}_GetSiblingIndex(){const a=this.GetParentLayer();return a?a.GetSubLayers().indexOf(this): this.GetLayout()._GetRootLayers().indexOf(this)}GetSID(){return this._sid}GetRuntime(){return this._runtime}IsDynamic(){return this._isDynamic}HasAnyDynamicParentLayer(){for(const a of this.parentLayers())if(a.IsDynamic())return!0;return!1}GetDevicePixelRatio(){return this._runtime.GetDevicePixelRatio()}GetEffectList(){return this._effectList}GetEffectChain(){this._MaybeRebuildEffectChainSteps();return this._effectChain}_MaybeRebuildEffectChainSteps(){const a=this.HasDefaultColor();if(this._needsRebuildEffectChainSteps|| a!==this._wasDefaultColor||this._effectChain.NeedsRebuild()){var b=this.GetEffectList().GetActiveEffectTypes();this._effectChain.BuildSteps(b.map(c=>c.GetShaderProgram()),{indexMap:b.map(c=>c.GetIndex()),forcePreDraw:!a,useFullSurface:!0});this._needsRebuildEffectChainSteps=!1;this._wasDefaultColor=a}}UpdateActiveEffects(){this.GetEffectList().UpdateActiveEffects();this._needsRebuildEffectChainSteps=!0}UsesRenderCells(){return this._useRenderCells&&!this._useCameraDistanceDrawOrder}GetRenderGrid(){return this._renderGrid}SetRenderListStale(){this._isRenderListUpToDate= !1}IsVisible(){for(const a of this.selfAndParentLayers())if(!a._IsVisibleFlagSet())return!1;return!0}_IsVisibleFlagSet(){return this._isVisible}SetVisible(a){a=!!a;this._isVisible!==a&&(this._isVisible=a,this._runtime.UpdateRender())}SetInteractive(a){this._isInteractive=!!a}IsInteractive(){return this._isInteractive}IsSelfAndParentsInteractive(){for(const a of this.selfAndParentLayers())if(!a.IsInteractive())return!1;return!0}SetOwnScrollPositionEnabled(a){a=!!a;if(this._hasOwnScrollPosition!==a){if(this._hasOwnScrollPosition= a)a=this.GetLayout(),this._scrollX=a.GetScrollX(),this._scrollY=a.GetScrollY();this._SetMVMatrixChanged();this._runtime.UpdateRender()}}IsOwnScrollPositionEnabled(){return this._hasOwnScrollPosition}SetScrollX(a){var b=this.GetLayout();const c=b.GetScrollLeftBound();b=b.GetScrollRightBound();a>b&&(a=b);a<c&&(a=c);this._scrollX!==a&&(this._scrollX=a,this.IsOwnScrollPositionEnabled()&&(this._SetMVMatrixChanged(),this._runtime.UpdateRender()))}SetScrollY(a){var b=this.GetLayout();const c=b.GetScrollTopBound(); b=b.GetScrollBottomBound();a>b&&(a=b);a<c&&(a=c);this._scrollY!==a&&(this._scrollY=a,this.IsOwnScrollPositionEnabled()&&(this._SetMVMatrixChanged(),this._runtime.UpdateRender()))}GetScrollX(){return this.IsOwnScrollPositionEnabled()?this._scrollX:this.GetLayout().GetScrollX()}GetScrollY(){return this.IsOwnScrollPositionEnabled()?this._scrollY:this.GetLayout().GetScrollY()}GetViewport(){this._MaybeUpdateViewport();return this._viewport}_GetViewportZ0(){this._MaybeUpdateViewport();return this._viewportZ0}GetViewport3D(){this._MaybeUpdateViewport(); return this._viewport3D}_GetVanishingPoint(){const a=this.GetLayout();return[a.GetVanishingPointX(),a.GetVanishingPointY()]}GetDefaultCameraZ(a){return this._runtime.GetDefaultCameraZ(a)}GetViewportForZ(a,b){var c=this._GetViewportZ0();if(0===a)b.copy(c);else{let k=c.midX(),l=c.midY();var d=this.Get2DScaleFactorToZ(a);const n=c.width()/d;c=c.height()/d;const [p,r]=this._GetVanishingPoint();if(.5!==p||.5!==r){const w=this.GetCameraZ();var e=this._runtime,g=this.GetDefaultCameraZ()/w;d=(p-.5)*e.GetViewportWidth()/ g;e=(r-.5)*e.GetViewportHeight()/g;g=this.GetAngle();0!==g&&(tempVec2.set(d,e),tempVec2.rotate(g),d=tempVec2.getX(),e=tempVec2.getY());a=C3$jscomp$87.unlerp(w,0,a);k+=C3$jscomp$87.lerp(d,0,a);l+=C3$jscomp$87.lerp(e,0,a)}b.set(k-n/2,l-c/2,k+n/2,l+c/2)}}GetOpacity(){return this._color.getA()}SetOpacity(a){a=C3$jscomp$87.clamp(a,0,1);this._color.getA()!==a&&(this._color.setA(a),this._UpdatePremultipliedColor(),this._runtime.UpdateRender())}_UpdatePremultipliedColor(){this._premultipliedColor.copy(this._color); this._premultipliedColor.premultiply()}GetPremultipliedColor(){return this._premultipliedColor}HasDefaultColor(){return this._color.equalsRgba(1,1,1,1)}GetScaleRate(){return this._scaleRate}SetScaleRate(a){this._scaleRate!==a&&(this._scaleRate=a,this._SetMVMatrixChanged(),this._runtime.UpdateRender())}GetParallaxX(){return this._parallaxX}GetParallaxY(){return this._parallaxY}SetParallax(a,b){if(this._parallaxX!==a||this._parallaxY!==b)if(this._parallaxX=a,this._parallaxY=b,this._SetMVMatrixChanged(), this._runtime.UpdateRender(),1!==this._parallaxX||1!==this._parallaxY)for(const c of this._instances)c.GetObjectClass()._SetAnyInstanceParallaxed(!0)}SetParallaxX(a){this.SetParallax(a,this.GetParallaxY())}SetParallaxY(a){this.SetParallax(this.GetParallaxX(),a)}SetZElevation(a){this._zElevation!==a&&(this._zElevation=a,this._runtime.UpdateRender())}GetZElevation(){return this._zElevation}SetAngle(a){a=C3$jscomp$87.clampAngle(a);this._angle!==a&&(this._angle=a,this._SetMVMatrixChanged(),this._runtime.UpdateRender())}GetAngle(){return C3$jscomp$87.clampAngle(this._layout.GetAngle()+ this._angle)}GetOwnAngle(){return this._angle}HasInstances(){return 0<this._instances.length}_GetInstances(){return this._instances}_GetInstancesInDrawOrder(){return this.RendersIn3DMode()&&this._useCameraDistanceDrawOrder?(C3$jscomp$87.shallowAssignArray(tempInstancesByCameraDist,this._GetInstances()),tempInstancesByCameraDist.sort((a,b)=>this._SortInstancesByCameraDistance(a,b)),tempInstancesByCameraDist):this._GetInstances()}_AppendAllInstancesIncludingSubLayersInDrawOrder(a){C3$jscomp$87.appendArray(a, this._GetInstancesInDrawOrder());for(const b of this._subLayers)b.IsVisible()&&0<b.GetOpacity()&&b._AppendAllInstancesIncludingSubLayersInDrawOrder(a)}_SortInstancesByCameraDistance(a,b){var c=this.GetLayout().Get3DCameraPosition(),d=c[0],e=c[1];c=c[2];var g=a.GetWorldInfo();const k=b.GetWorldInfo();b=g.GetX()-d;a=g.GetY()-e;g=g.GetZElevation()-c;d=k.GetX()-d;e=k.GetY()-e;c=k.GetZElevation()-c;return d*d+e*e+c*c-(b*b+a*a+g*g)}GetBackgroundColor(){return this._backgroundColor}IsTransparent(){return this._isTransparent}SetTransparent(a){a= !!a;this._isTransparent!==a&&(this._isTransparent=a,this._runtime.UpdateRender())}IsForceOwnTexture(){return this._isForceOwnTexture}SetForceOwnTexture(a){a=!!a;this._isForceOwnTexture!==a&&(this._isForceOwnTexture=a,this._runtime.UpdateRender())}RendersIn2DMode(){return!this.GetRuntime().Uses3DFeatures()||!this._renderAs3d}RendersIn3DMode(){return!this.RendersIn2DMode()}Has3DCamera(){return this.RendersIn3DMode()&&this.GetLayout().Is3DCameraEnabled()}SelfAndAllSubLayersHave3DCamera(){if(!this.Has3DCamera())return!1; for(const a of this._subLayers)if(!a.SelfAndAllSubLayersHave3DCamera())return!1;return!0}SetBlendMode(a){this._blendMode!==a&&(this._blendMode=a,this._runtime.UpdateRender())}GetBlendMode(){return this._blendMode}IsRootLayer(){return!this._parentLayer}GetParentLayer(){return this._parentLayer}GetSubLayers(){return this._subLayers}HasAnySubLayers(){return 0<this._subLayers.length}_AddSubLayer(a,b=!0){b?this._subLayers.push(a):this._subLayers.unshift(a)}_InsertSubLayer(a,b,c){b=this._subLayers.indexOf(b); c&&++b;this._subLayers.splice(b,0,a)}_RemoveSubLayer(a){a=this._subLayers.indexOf(a);this._subLayers.splice(a,1)}HasAnyVisibleSubLayer(){for(const a of this._subLayers)if(a.ShouldDraw())return!0;return!1}*selfAndAllSubLayers(){for(const a of this._subLayers)yield*a.selfAndAllSubLayers();yield this}*parentLayers(){let a=this.GetParentLayer();for(;a;)yield a,a=a.GetParentLayer()}*selfAndParentLayers(){yield this;yield*this.parentLayers()}IsTransformCompatibleWith(a){return this===a||this._parallaxX=== a._parallaxX&&this._parallaxY===a._parallaxY&&this._scale===a._scale&&this._scaleRate===a._scaleRate&&this._angle===a._angle&&this.GetScrollX()===a.GetScrollX()&&this.GetScrollY()===a.GetScrollY()}SaveTransform(){return{parallaxX:this.GetParallaxX(),parallaxY:this.GetParallaxY(),scale:this.GetOwnScale(),scaleRate:this.GetScaleRate(),angle:this.GetOwnAngle(),hasOwnScroll:this.IsOwnScrollPositionEnabled(),scrollX:this.GetScrollX(),scrollY:this.GetScrollY()}}RestoreTransform(a){this.SetParallax(a.parallaxX, a.parallaxY);this.SetOwnScale(a.scale);this.SetScaleRate(a.scaleRate);this.SetAngle(a.angle);this.SetOwnScrollPositionEnabled(a.hasOwnScroll);this.SetScrollX(a.scrollX);this.SetScrollY(a.scrollY);this._MaybeUpdateViewport()}_RemoveAllInstancesInSet(a){0!==a.size&&0<C3$jscomp$87.arrayRemoveAllInSet(this._instances,a)&&(this._MaybeResetAnyInstanceZElevatedFlag(),this.SetZIndicesChanged())}SetZIndicesChanged(){this._isRenderListUpToDate=this._zIndicesUpToDate=!1}_UpdateZIndices(){if(!this._zIndicesUpToDate){this._instances.sort(SortByInstZElevation); if(this.UsesRenderCells())for(let a=0,b=this._instances.length;a<b;++a){const c=this._instances[a].GetWorldInfo();c._SetZIndex(a);this._renderGrid.MarkRangeChanged(c.GetRenderCellRange())}else for(let a=0,b=this._instances.length;a<b;++a)this._instances[a].GetWorldInfo()._SetZIndex(a);this._zIndicesUpToDate=!0}}MoveInstanceAdjacent(a,b,c){var d=a.GetWorldInfo();b=b.GetWorldInfo();if(d.GetLayer()!==this||b.GetLayer()!==this)throw Error("can't arrange Z order unless both objects on this layer");d=d.GetZIndex(); b=b.GetZIndex();if(d===b+(c?1:-1))return!1;C3$jscomp$87.arrayRemove(this._instances,d);d<b&&b--;c&&b++;b===this._instances.length?this._instances.push(a):this._instances.splice(b,0,a);this.SetZIndicesChanged();return!0}_MergeSortedZArrays(a,b){const c=[];let d=0,e=0,g=a.length,k=b.length;for(;d<g&&e<k;){const l=a[d],n=b[e];l.GetWorldInfo()._GetLastCachedZIndex()<n.GetWorldInfo()._GetLastCachedZIndex()?(c.push(l),++d):(c.push(n),++e)}for(;d<g;++d)c.push(a[d]);for(;e<k;++e)c.push(b[e]);return c}_MergeAllSortedZArrays_pass(a){const b= [],c=a.length;for(let d=0;d<c-1;d+=2)b.push(this._MergeSortedZArrays(a[d],a[d+1]));1===c%2&&b.push(a[c-1]);return b}_MergeAllSortedZArrays(a){for(;1<a.length;)a=this._MergeAllSortedZArrays_pass(a);return a[0]}_GetRenderCellInstancesToDraw(){this._UpdateZIndices();C3$jscomp$87.clearArray(renderCellArr);this._renderGrid.QueryRange(this.GetViewport(),renderCellArr);return renderCellArr.length?1===renderCellArr.length?renderCellArr[0]:this._MergeAllSortedZArrays(renderCellArr):[]}ShouldDraw(){return this.IsVisible()&& 0<this.GetOpacity()&&this._DrawsAnyContentInSelfOrSubLayers()}_DrawsAnyContentInSelfOrSubLayers(){if(this.HasInstances()||!this.IsTransparent())return!0;for(const a of this._subLayers)if(a._DrawsAnyContentInSelfOrSubLayers())return!0;return!1}UsesOwnTexture(){return this.IsForceOwnTexture()||!this.HasDefaultColor()||0!==this.GetBlendMode()||this._effectList.HasAnyActiveEffect()}SelfOrAnySubLayerUsesOwnTexture(){if(this.UsesOwnTexture())return!0;for(const a of this._subLayers)if(a.SelfOrAnySubLayerUsesOwnTexture())return!0; return!1}GetRenderTarget(){return this._curRenderTarget}Get2DScaleFactorToZ(a){if(this._layout.IsOrthographicProjection())return 1;const b=this.GetCameraZ();return b/(b-a)}GetCameraZ(a){return this.GetDefaultCameraZ(a)/this.GetNormalScale()}_SetMVMatrixChanged(){this._isViewportChanged=this._isViewFrustumChanged=this._isMVMatrixChanged=!0}_GetModelViewMatrix(a){this._isMVMatrixChanged&&(this._CalculateModelViewMatrix(a,this._modelViewMatrix,0,0,null),this._isMVMatrixChanged=!1);return this._modelViewMatrix}GetCameraPosition(){if(this.Has3DCamera()){const a= this.GetLayout().Get3DCameraPosition();return[a[0],a[1],a[2]]}return this._Get2DCameraPosition()}_Get2DCameraPosition(a=0,b=0,c=0){var d=this._runtime,e=this.GetLayout(),g=d.GetParallaxXOrigin(),k=d.GetParallaxYOrigin();g=(this.GetScrollX()-g)*this._parallaxX+g;k=(this.GetScrollY()-k)*this._parallaxY+k;d.IsPixelRoundingEnabled()&&(g=Math.round(g),k=Math.round(k));a=g+a;b=k+b;e=e.IsOrthographicProjection()?this.GetDefaultCameraZ(c):this.GetCameraZ(c);const [l,n]=this._GetVanishingPoint();if(.5!==l|| .5!==n)k=this.GetDefaultCameraZ(c)/e,c=(l-.5)*d.GetViewportWidth()/k,d=(n-.5)*d.GetViewportHeight()/k,k=this.GetAngle(),0!==k&&(tempVec2.set(c,d),tempVec2.rotate(k),c=tempVec2.getX(),d=tempVec2.getY()),a+=c,b+=d;return[a,b,e]}_CalculateModelViewMatrix(a,b,c,d,e){const g=this._runtime;var k=this.GetLayout();if(this.Has3DCamera()){vec3$jscomp$6.copy(camVector,k.Get3DCameraPosition());vec3$jscomp$6.copy(lookVector,k.Get3DCameraLookAt());vec3$jscomp$6.copy(upVector,k.Get3DCameraUpVector());c=g.GetParallaxXOrigin(); d=g.GetParallaxYOrigin();k=lookVector[0]-camVector[0];const l=lookVector[1]-camVector[1],n=lookVector[2]-camVector[2];camVector[0]=(camVector[0]-c)*this._parallaxX+c;camVector[1]=(camVector[1]-d)*this._parallaxY+d;camVector[2]*=Math.max(this._parallaxX,this._parallaxY);lookVector[0]=camVector[0]+k;lookVector[1]=camVector[1]+l;lookVector[2]=camVector[2]+n}else{const [l,n,p]=this._Get2DCameraPosition(c,d,e);vec3$jscomp$6.set(camVector,l,n,p);vec3$jscomp$6.set(lookVector,l,n,p-100);c=this.GetAngle(); 0===c?vec3$jscomp$6.set(upVector,0,1,0):vec3$jscomp$6.set(upVector,Math.sin(c),Math.cos(c),0)}a.CalculateLookAtModelView(b,camVector,lookVector,upVector,e||g.GetViewportHeight())}_SetProjectionMatrixChanged(){this._isViewportChanged=this._isViewFrustumChanged=this._isProjectionMatrixChanged=!0}_GetProjectionMatrix(a){this._isProjectionMatrixChanged&&(this._CalculateProjectionMatrix(a),this._isProjectionMatrixChanged=!1);return this._projectionMatrix}_CalculateProjectionMatrix(a){var b=this._runtime.GetCanvasManager(); const [c,d]=this._GetVanishingPoint();if(this._layout.IsOrthographicProjection())a.CalculateOrthographicMatrix(this._projectionMatrix,b.GetDrawWidth(),b.GetDrawHeight());else if(.5===c&&.5===d)mat4$jscomp$9.copy(this._projectionMatrix,b.GetDefaultProjectionMatrix());else{const e=b.GetDrawWidth();b=b.GetDrawHeight();a.CalculatePerspectiveMatrix(this._projectionMatrix,e/b,c,d)}}_SetTransform(a,b=!0,c=0,d=0,e=0){b&&a.SetProjectionMatrix(this._GetProjectionMatrix(a));0===c&&0===d&&0===e?b=this._GetModelViewMatrix(a): (this._CalculateModelViewMatrix(a,tempMat4$jscomp$4,c,d,e),b=tempMat4$jscomp$4);a.SetModelViewMatrix(b)}PrepareForDraw(a){this._SetTransform(a);a.SetBaseZ(this.GetZElevation())}Draw(a,b,c){var d=this._runtime.GetCanvasManager();const e=this.UsesOwnTexture();var g=null;let k=null;if(this._runtime.IsGPUProfiling())if(a.IsWebGL()){const l=d.GetLayerTimingsBuffer(this);l&&(k=l.AddTimeElapsedQuery(),a.StartQuery(k))}else a.IsWebGPU()&&a.WriteTimestamp(2*(this.GetIndex()+1));e?(g={sampling:this._runtime.GetSampling(), isSampled:!0,canReadPixels:a.IsWebGPU()?this._runtime.UsesAnyBackgroundBlending():!1},"low"===d.GetCurrentFullscreenScalingQuality()&&(g.width=d.GetDrawWidth(),g.height=d.GetDrawHeight()),this._curRenderTarget=g=this._runtime.GetAdditionalRenderTarget(g),a.SetRenderTarget(g),this.IsTransparent()&&a.ClearRgba(0,0,0,0)):(this._curRenderTarget=b,a.SetRenderTarget(b));this.IsTransparent()||a.Clear(this._backgroundColor);this._layout._DrawLayerList(a,this._curRenderTarget,this._subLayers,e&&this.IsTransparent()); this._SetTransform(a);a.SetBaseZ(this.GetZElevation());a.SetDepthEnabled(this.RendersIn3DMode());this.GetNormalScale()>Number.EPSILON&&(this._UpdateZIndices(),d=this.UsesRenderCells()&&0===this.GetZElevation()&&!this._anyInstanceZElevated,this.Has3DCamera()?this._DrawInstances_3DCamera(a):d?this._DrawInstances_RenderCells(a):this._DrawInstances(a,this._GetInstancesInDrawOrder()));a.SetBaseZ(0);a.SetCurrentZ(0);e&&(a.SetDepthEnabled(!1),this._DrawLayerOwnTextureToRenderTarget(a,g,b,c));k&&a.EndQuery(k); this._runtime.IsGPUProfiling()&&a.IsWebGPU()&&a.WriteTimestamp(2*(this.GetIndex()+1)+1);this._curRenderTarget=null}_DrawInstances(a,b){const c=this.GetViewport(),d=this._curRenderTarget,e=this.GetLayout().IsOrthographicProjection(),g=this.GetLayout().HasVanishingPointOutsideViewport();let k=null;for(let l=0,n=b.length;l<n;++l){const p=b[l];if(p===k)continue;k=p;const r=p.GetWorldInfo();r.IsVisible()&&r.IsInViewport(c,g,e)&&this._DrawInstanceMaybeWithEffects(p,r,a,d)}}_DrawInstances_3DCamera(a){const b= this._curRenderTarget,c=this._GetViewFrustum(),d=this._GetInstancesInDrawOrder();for(let l=0,n=d.length;l<n;){var e=d[l],g=e.GetWorldInfo();if(!g.IsVisible()||!g.IsInViewport3D(c)){++l;continue}(!e.RendersToOwnZPlane()||0<g.GetDepth())&&tempInstanceList2.push(e);var k=e.GetWorldInfo().GetTotalZElevation();tempInstanceList1.push(e);let p=l+1;for(;p<n;++p){const r=d[p],w=r.GetWorldInfo();if(w.IsVisible()&&w.IsInViewport3D(c)){if(w.GetTotalZElevation()!==k)break;r.RendersToOwnZPlane()?(0<w.GetDepth()&& tempInstanceList2.push(r),tempInstanceList1.push(r)):tempInstanceList2.push(r)}}if(1!==tempInstanceList1.length||tempInstanceList1[0].MustMitigateZFighting()){this._DrawCoplanarInstances_3DCamera(a,tempInstanceList1);for(let r=0,w=tempInstanceList2.length;r<w;++r)e=tempInstanceList2[r],g=e.GetWorldInfo(),g._SetDrawNonBackFacesOnly(!0),this._DrawInstanceMaybeWithEffects(e,g,a,b),g._SetDrawNonBackFacesOnly(!1)}else{this._DrawInstanceMaybeWithEffects(e,g,a,b);for(let r=0,w=tempInstanceList2.length;r< w;++r)g=tempInstanceList2[r],g!==e&&(k=g.GetWorldInfo(),k.GetLayer()._DrawInstanceMaybeWithEffects(g,k,a,b))}l=p;C3$jscomp$87.clearArray(tempInstanceList1);C3$jscomp$87.clearArray(tempInstanceList2)}}_DrawCoplanarInstances_3DCamera(a,b){const c=this._curRenderTarget;a.CoplanarStartStencilPass();for(let g=0,k=b.length;g<k;++g){var d=b[g],e=d.GetWorldInfo();e._SetDrawBackFaceOnly(!0);this._DrawInstance(d,e,a)}a.CoplanarStartColorPass();for(let g=0,k=b.length;g<k;++g)d=b[g],e=d.GetWorldInfo(),this._DrawInstanceMaybeWithEffects(d, e,a,c),e._SetDrawBackFaceOnly(!1);a.CoplanarRestoreStandardRendering()}_DrawInstances_RenderCells(a){var b=this._renderGrid;const c=this._curRenderCells,d=this._lastRenderCells,e=this.GetViewport();c.set(b.XToCell(e.getLeft()),b.YToCell(e.getTop()),b.XToCell(e.getRight()),b.YToCell(e.getBottom()));this._isRenderListUpToDate&&c.equals(d)?b=this._lastRenderList:(b=this._GetRenderCellInstancesToDraw(),this._isRenderListUpToDate=!0,d.copy(c));this._DrawInstances(a,b);b!==this._lastRenderList&&C3$jscomp$87.shallowAssignArray(this._lastRenderList, b)}_DrawInstanceMaybeWithEffects(a,b,c,d){b.HasAnyActiveEffect()?this._DrawInstanceWithEffectsAndRestore(a,b,c,d):this._DrawInstance(a,b,c)}_DrawInstance(a,b,c){b=b.GetRendererStateGroup();c.GetCurrentStateGroup()!==b&&b.Apply();a.Draw(c)}_DrawInstanceWithEffectsAndRestore(a,b,c,d){this._DrawInstanceWithEffects(a,b,c,d,null)&&this._SetTransform(c)}_DrawInstanceWithEffects(a,b,c,d,e){const g=b.GetInstanceEffectList().GetEffectChain();g.Render(c,d,{contentObject:a,blendMode:b.GetBlendMode(),devicePixelRatio:this._runtime.GetEffectDevicePixelRatioParam(), time:a.GetInstanceGameTime(),layerScale:this._runtime.GetEffectLayerScaleParam()*this.GetNormalScale(),layerAngle:this.GetAngle(),layoutRect:b.GetBoundingBox(),drawSurfaceRect:g.CanSkipCalculatingDrawSurfaceRect()?null:this._InstanceBoxToDrawSurface(b),drawContentHook:e&&e.drawContentHook,compositOffX:e&&e.compositOffX,compositOffY:e&&e.compositOffY,updateOwnProjection:e&&e.updateOwnProjection});c.SetBaseZ(this.GetZElevation());return g.DidChangeTransform()}_DrawLayerOwnTextureToRenderTarget(a,b, c,d){const e=this._effectList.GetActiveEffectTypes(),g=this._runtime;0===e.length?(a.SetRenderTarget(c),a.SetTextureFillMode(),d&&0===this._blendMode&&this.HasDefaultColor()?a.CopyRenderTarget(b):(a.SetBlendMode(this._blendMode),a.SetColor(this._premultipliedColor),a.DrawRenderTarget(b)),a.InvalidateRenderTarget(b),g.ReleaseAdditionalRenderTarget(b)):this.GetEffectChain().Render(a,c,{contentObject:this,blendMode:this.GetBlendMode(),devicePixelRatio:g.GetEffectDevicePixelRatioParam(),layerScale:g.GetEffectLayerScaleParam()* this.GetNormalScale(),layerAngle:this.GetAngle(),layoutRect:this.GetViewport(),drawSurfaceRect:null,invalidateRenderTargets:!0})}GetOwnScale(){return this._scale}SetOwnScale(a){this._scale!==a&&(this._scale=a,this._layout.BoundScrolling(),this._SetMVMatrixChanged(),this._runtime.UpdateRender())}GetRenderScale(){return this.GetNormalScale()*this._runtime.GetRenderScale()}GetDisplayScale(){return this.GetNormalScale()*this._runtime.GetDisplayScale()}GetNormalScale(){return(this._scale*this._layout.GetScale()- 1)*this._scaleRate+1}_MaybeUpdateViewport(){if(this._isViewportChanged){this._isViewportChanged=!1;var a=this._runtime.GetParallaxXOrigin(),b=this._runtime.GetParallaxYOrigin(),c=(this.GetScrollX()-a)*this._parallaxX+a,d=(this.GetScrollY()-b)*this._parallaxY+b;a=this.GetNormalScale();b=this._runtime.GetViewportWidth()/a;a=this._runtime.GetViewportHeight()/a;c-=b/2;var e=d-a/2;this._runtime.IsPixelRoundingEnabled()&&(c=Math.round(c),e=Math.round(e));d=this._viewportZ0;d.set(c,e,c+b,e+a);b=this.GetAngle(); 0!==b&&(tmpRect$jscomp$2.copy(d),tmpRect$jscomp$2.offset(-d.midX(),-d.midY()),tmpQuad$jscomp$2.setFromRotatedRect(tmpRect$jscomp$2,b),tmpQuad$jscomp$2.getBoundingBox(tmpRect$jscomp$2),tmpRect$jscomp$2.offset(d.midX(),d.midY()),d.copy(tmpRect$jscomp$2));b=this._zElevation;this.GetViewportForZ(b,this._viewport);this.Has3DCamera()?this.CalculateViewport3D(b,this._viewport3D):this._viewport3D.copy(this._viewport)}}CalculateViewport3D(a,b){var c=this._runtime.GetCanvasManager(),d=c.GetCssWidth();c=c.GetCssHeight(); const [e,g]=this.CanvasCssToLayer(0,0,a),[k,l]=this.CanvasCssToLayer(d,0,a),[n,p]=this.CanvasCssToLayer(d,c,a),[r,w]=this.CanvasCssToLayer(0,c,a);a=Math.min(e,k,n,r);d=Math.min(g,l,p,w);c=Math.max(e,k,n,r);let y=Math.max(g,l,p,w);isFinite(a)||(a=-Infinity);isFinite(d)||(d=-Infinity);isFinite(c)||(c=Infinity);isFinite(y)||(y=Infinity);b.set(a,d,c,y)}CanvasCssToLayer(a,b,c=0){return this._CanvasToLayer(a,b,c,this.GetDisplayScale())}DrawSurfaceToLayer(a,b,c=0){return this._CanvasToLayer(a,b,c,this.GetRenderScale()* this.GetDevicePixelRatio())}_CanvasToLayer(a,b,c,d){var e=this._runtime,g=e.GetRenderer();const k=this.GetNormalScale(),l=e.GetViewportWidth()/k;e=e.GetViewportHeight()/k;vec4$jscomp$5.set(tempVec4$jscomp$1,0,0,l,e);a/=d;b=tempVec4$jscomp$1[3]-b/d;d=this._GetProjectionMatrix(g);g=this._GetModelViewMatrix(g);return C3$jscomp$87.Gfx.UnprojectScreenToWorldZ(a,b,c,g,d,tempVec4$jscomp$1,tempVec3)?[tempVec3[0],tempVec3[1]]:[NaN,NaN]}CanvasCssToLayer_DefaultTransform(a,b){const c=this._scale,d=this._scaleRate, e=this._parallaxX,g=this._parallaxY,k=this._angle;this._parallaxY=this._parallaxX=this._scaleRate=this._scale=1;this._angle=0;this._SetMVMatrixChanged();a=this.CanvasCssToLayer(a,b);this._scale=c;this._scaleRate=d;this._parallaxX=e;this._parallaxY=g;this._angle=k;this._SetMVMatrixChanged();return a}LayerToCanvasCss(a,b,c=0){return this._LayerToCanvas(a,b,c,this.GetDisplayScale())}LayerToDrawSurface(a,b,c=0){return this._LayerToCanvas(a,b,c,this.GetRenderScale()*this.GetDevicePixelRatio())}_LayerToCanvas(a, b,c,d){var e=this._runtime,g=e.GetRenderer();const k=this.GetNormalScale();var l=e.GetViewportWidth()/k;e=e.GetViewportHeight()/k;vec4$jscomp$5.set(tempVec4$jscomp$1,0,0,l,e);l=this._GetProjectionMatrix(g);g=this._GetModelViewMatrix(g);return C3$jscomp$87.Gfx.Project(a,b,c,g,l,tempVec4$jscomp$1,tempVec3)?[tempVec3[0]*d,(tempVec4$jscomp$1[3]-tempVec3[1])*d]:[NaN,NaN]}_GetLayerToDrawSurfaceScale(a,b){a*=this.GetRenderScale()*this.GetDevicePixelRatio();0!==b&&(a*=this.Get2DScaleFactorToZ(b));return a}_InstanceBoxToDrawSurface(a){var b= a.GetBoundingBox(),c=a.GetTotalZElevation();a=a.GetDepth();const d=c+a,e=b.getLeft(),g=b.getTop(),k=b.getRight();b=b.getBottom();if(this.Has3DCamera()){if(this._IsPointBehindNearPlane(e,g,c)||this._IsPointBehindNearPlane(k,g,c)||this._IsPointBehindNearPlane(k,b,c)||this._IsPointBehindNearPlane(e,b,c)||0<a&&(this._IsPointBehindNearPlane(e,g,d)||this._IsPointBehindNearPlane(k,g,d)||this._IsPointBehindNearPlane(k,b,d)||this._IsPointBehindNearPlane(e,b,d)))return null}else if(d>=this.GetCameraZ())return null; let [l,n]=this.LayerToDrawSurface(e,g,c),[p,r]=this.LayerToDrawSurface(k,b,c);if(0!==this.GetAngle()||0<a||this.Has3DCamera()){const [w,y]=this.LayerToDrawSurface(k,g,c),[B,C]=this.LayerToDrawSurface(e,b,c);if(0<a){const [E,F]=this.LayerToDrawSurface(e,g,d),[J,L]=this.LayerToDrawSurface(k,g,d),[O,V]=this.LayerToDrawSurface(k,b,d),[W,ca]=this.LayerToDrawSurface(e,b,d);c=Math.min(l,p,w,B,E,J,O,W);p=Math.max(l,p,w,B,E,J,O,W);l=c;c=Math.min(n,r,y,C,F,L,V,ca);r=Math.max(n,r,y,C,F,L,V,ca);n=c}else c=Math.min(l, p,w,B),p=Math.max(l,p,w,B),l=c,c=Math.min(n,r,y,C),r=Math.max(n,r,y,C),n=c}tmpRect$jscomp$2.set(l,n,p,r);return tmpRect$jscomp$2}_GetViewFrustum(){this._isViewFrustumChanged&&(this._UpdateViewFrustum(),this._isViewFrustumChanged=!1);return this._viewFrustum}_UpdateViewFrustum(){var a=this._runtime.GetRenderer();const b=this._GetProjectionMatrix(a);a=this._GetModelViewMatrix(a);this._viewFrustum.CalculatePlanes(a,b)}_IsPointBehindNearPlane(a,b,c){return this._GetViewFrustum().IsBehindNearPlane(a,b, c)}_SaveToJson(){return{d:this.IsDynamic(),s:this.GetOwnScale(),a:this.GetOwnAngle(),v:this._IsVisibleFlagSet(),i:this.IsInteractive(),bc:this._backgroundColor.toJSON(),t:this.IsTransparent(),sx:this._scrollX,sy:this._scrollY,hosp:this._hasOwnScrollPosition,px:this.GetParallaxX(),py:this.GetParallaxY(),c:this._color.toJSON(),sr:this.GetScaleRate(),fx:this._effectList.SaveToJson(),cg:this._createdGlobalUids}}_LoadFromJson(a){this._isDynamic=!!a.d;this._scale=a.s;this._angle=a.a;this._isVisible=!!a.v; this._isInteractive=a.hasOwnProperty("i")?a.i:!0;this._backgroundColor.setFromJSON(a.bc);this._isTransparent=!!a.t;a.hasOwnProperty("sx")&&(this._scrollX=a.sx);a.hasOwnProperty("sy")&&(this._scrollY=a.sy);a.hasOwnProperty("hosp")&&(this._hasOwnScrollPosition=!!a.hosp);this._parallaxX=a.px;this._parallaxY=a.py;this._color.setFromJSON(a.c);this._UpdatePremultipliedColor();this._scaleRate=a.sr;C3$jscomp$87.shallowAssignArray(this._createdGlobalUids,a.cg);C3$jscomp$87.shallowAssignArray(this._initialInstances, this._startupInitialInstances);const b=new Set(this._createdGlobalUids);let c=0;for(let d=0,e=this._initialInstances.length;d<e;++d)b.has(this._initialInstances[d][2])||(this._initialInstances[c]=this._initialInstances[d],++c);C3$jscomp$87.truncateArray(this._initialInstances,c);this._effectList.LoadFromJson(a.fx);this._needsRebuildEffectChainSteps=!0}_LoadFromJsonAfterInstances(){this._SortInstancesByLastCachedZIndex(!1);this.SetZIndicesChanged();this._SetMVMatrixChanged();this._SetProjectionMatrixChanged()}GetILayer(){return this._iLayer}SortAndAddInstancesByZIndex(a, b=!1){if(this._instances.includes(a))b&&this._instances.sort((e,g)=>{e=e.GetWorldInfo().GetSceneGraphZIndex();g=g.GetWorldInfo().GetSceneGraphZIndex();return e-g});else if(a.HasChildren()){var c=[...a.allChildren()];c.push(a);c.sort((e,g)=>{e=e.GetWorldInfo().GetSceneGraphZIndex();g=g.GetWorldInfo().GetSceneGraphZIndex();return e-g});for(var d of c)if(d.IsInContainer())for(const e of d.siblings())c.includes(e)||(a=[...e.allChildren()],a.push(e),a.sort((g,k)=>{g=g.GetWorldInfo().GetSceneGraphZIndex(); k=k.GetWorldInfo().GetSceneGraphZIndex();return g-k}),a&&a.length&&c.splice(c.length,0,...a));for(const e of c)e.GetPlugin().IsWorldType()&&this._AddInstance(e,!0)}else if(a.GetPlugin().IsWorldType()&&this._AddInstance(a,!0),a.IsInContainer())for(c of a.siblings())if(d=[...c.allChildren()],d.push(c),d.sort((e,g)=>{e=e.GetWorldInfo().GetSceneGraphZIndex();g=g.GetWorldInfo().GetSceneGraphZIndex();return e-g}),d&&d.length)for(const e of d)e.GetPlugin().IsWorldType()&&this._AddInstance(e,!0)}};"use strict"; const C3$jscomp$88=self.C3,C3Debugger=self.C3Debugger;C3$jscomp$88.New(C3$jscomp$88.Rect);C3$jscomp$88.New(C3$jscomp$88.Rect);const tempLayoutRect=C3$jscomp$88.New(C3$jscomp$88.Rect),tempColor$jscomp$4=C3$jscomp$88.New(C3$jscomp$88.Color),vec3$jscomp$7=self.glMatrix.vec3,tempRender3dList=[],tempInstanceList1$jscomp$1=[],tempInstanceList2$jscomp$1=[],tempInstanceList3=[];function vec3EqualsXYZ(a,b,c,d){return a[0]===Math.fround(b)&&a[1]===Math.fround(c)&&a[2]===Math.fround(d)} let lastLayerPreparedForDrawing=null;function MaybePrepareLayerDraw(a,b){lastLayerPreparedForDrawing!==a&&(a.PrepareForDraw(b),lastLayerPreparedForDrawing=a)} C3$jscomp$88.Layout=class extends C3$jscomp$88.DefendedBase{constructor(a,b,c){super();this._layoutManager=a;this._runtime=a.GetRuntime();this._name=c[0];this._originalWidth=c[1];this._originalHeight=c[2];this._width=c[1];this._height=c[2];this._isUnboundedScrolling=!!c[3];this._isOrthographicProjection=!!c[4];this._vanishingPointX=c[5];this._vanishingPointY=c[6];this._eventSheetName=c[7];this._eventSheet=null;this._sid=c[8];this._index=b;this._scrollY=this._scrollX=0;this._scale=1;this._angle=0; this._initialObjectClasses=new Set;this._textureLoadedTypes=new Set;this._textureLoadPendingPromises=new Set;this._createdInstances=[];this._createdPersistedInstances=[];this._createdPersistedInstancesToDataMap=new Map;this._createdPersistedIndexToInstanceMap=new Map;this._initialNonWorld=[];this._is3dCameraEnabled=!1;this._cam3dposition=vec3$jscomp$7.create();this._cam3dlook=vec3$jscomp$7.create();this._cam3dup=vec3$jscomp$7.create();this._rootLayers=[];this._allLayersFlat=[];this._layersByName= new Map;this._layersBySid=new Map;const d=this._runtime.GetCanvasManager();this._effectList=C3$jscomp$88.New(C3$jscomp$88.EffectList,this,c[11]);this._effectChain=C3$jscomp$88.New(C3$jscomp$88.Gfx.EffectChain,d.GetEffectChainManager(),{drawContent:(e,g)=>{g=g.GetContentObject().GetRenderTarget();e.ResetColor();e.DrawRenderTarget(g);e.InvalidateRenderTarget(g);d.ReleaseAdditionalRenderTarget(g)},getShaderParameters:e=>this.GetEffectList()._GetEffectChainShaderParametersForIndex(e)});this._needsRebuildEffectChainSteps= !0;this._wasFullScreenQualityLow=!1;this._curRenderTarget=null;this._persistData={};this._persistedIntances=new Map;this._isFirstVisit=!0;this._iLayout=new self.ILayout(this);this._userScriptDispatcher=C3$jscomp$88.New(C3$jscomp$88.Event.Dispatcher);for(const e of c[9])this._rootLayers.push(C3$jscomp$88.Layer.CreateFromExportData(this,null,e));this._ReindexLayers();for(const e of this.allLayers())e._InitInitialInstances();for(const e of c[10]){a=this._runtime.GetObjectClassByIndex(e[1]);if(!a)throw Error("missing nonworld object class"); a.GetDefaultInstanceData()||a.SetDefaultInstanceData(e);this._initialNonWorld.push(e);this._AddInitialObjectClass(a)}}Release(){for(const a of this._allLayersFlat)a.Release();C3$jscomp$88.clearArray(this._allLayersFlat);this._textureLoadPendingPromises.clear();this._runtime=this._layoutManager=this._eventSheet=null}GetRuntime(){return this._runtime}GetName(){return this._name}GetSID(){return this._sid}GetIndex(){return this._index}GetEffectList(){return this._effectList}GetEffectChain(){this._MaybeRebuildEffectChainSteps(); return this._effectChain}_MaybeRebuildEffectChainSteps(){const a="low"===this._runtime.GetCanvasManager().GetCurrentFullscreenScalingQuality();if(this._needsRebuildEffectChainSteps||this._wasFullScreenQualityLow!==a||this._effectChain.NeedsRebuild()){var b=this.GetEffectList().GetActiveEffectTypes();this._effectChain.BuildSteps(b.map(c=>c.GetShaderProgram()),{indexMap:b.map(c=>c.GetIndex()),forcePostDraw:a,useFullSurface:!0});this._needsRebuildEffectChainSteps=!1;this._wasFullScreenQualityLow=a}}UpdateActiveEffects(){this.GetEffectList().UpdateActiveEffects(); this._needsRebuildEffectChainSteps=!0}GetMinLayerScale(){let a=this._allLayersFlat[0].GetNormalScale();for(let b=1,c=this._allLayersFlat.length;b<c;++b){const d=this._allLayersFlat[b];if(0!==d.GetParallaxX()||0!==d.GetParallaxY())a=Math.min(a,d.GetNormalScale())}return a}_GetScrollBoundMarginHorizontal(){return.5*this._runtime.GetViewportWidth()/this.GetMinLayerScale()}_GetScrollBoundMarginVertical(){return.5*this._runtime.GetViewportHeight()/this.GetMinLayerScale()}GetScrollLeftBound(){return this.IsUnboundedScrolling()? -Infinity:this._GetScrollBoundMarginHorizontal()}GetScrollRightBound(){return this.IsUnboundedScrolling()?Infinity:this.GetWidth()-this._GetScrollBoundMarginHorizontal()}GetScrollTopBound(){return this.IsUnboundedScrolling()?-Infinity:this._GetScrollBoundMarginVertical()}GetScrollBottomBound(){return this.IsUnboundedScrolling()?Infinity:this.GetHeight()-this._GetScrollBoundMarginVertical()}SetScrollX(a){const b=this.GetScrollLeftBound(),c=this.GetScrollRightBound();a>c&&(a=c);a<b&&(a=b);this._scrollX!== a&&(this._scrollX=a,this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}GetScrollX(){return this._scrollX}SetScrollY(a){const b=this.GetScrollTopBound(),c=this.GetScrollBottomBound();a>c&&(a=c);a<b&&(a=b);this._scrollY!==a&&(this._scrollY=a,this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}GetScrollY(){return this._scrollY}IsUnboundedScrolling(){return this._isUnboundedScrolling}BoundScrolling(){this.SetScrollX(this.GetScrollX());this.SetScrollY(this.GetScrollY());for(const a of this._allLayersFlat)a.IsOwnScrollPositionEnabled()&& (a.SetScrollX(a.GetScrollX()),a.SetScrollY(a.GetScrollY()))}SetVanishingPointXY(a,b){if(this._vanishingPointX!==a||this._vanishingPointY!==b)this._vanishingPointX=a,this._vanishingPointY=b,this.IsPerspectiveProjection()&&(this._SetAllLayersProjectionChanged(),this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}GetVanishingPointX(){return this.IsOrthographicProjection()?.5:this._vanishingPointX}GetVanishingPointY(){return this.IsOrthographicProjection()?.5:this._vanishingPointY}HasVanishingPointOutsideViewport(){const a= this.GetVanishingPointX(),b=this.GetVanishingPointY();return 0>a||1<a||0>b||1<b}SetPerspectiveProjection(){this._isOrthographicProjection&&(this._isOrthographicProjection=!1,this._SetAllLayersProjectionChanged(),this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}SetOrthographicProjection(){this._isOrthographicProjection||(this._isOrthographicProjection=!0,this._SetAllLayersProjectionChanged(),this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}IsOrthographicProjection(){return this._isOrthographicProjection}IsPerspectiveProjection(){return!this.IsOrthographicProjection()}Set3DCameraEnabled(a){a= !!a;this._is3dCameraEnabled!==a&&(this._is3dCameraEnabled=a,this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}Is3DCameraEnabled(){return this._is3dCameraEnabled}Set3DCameraOrientation(a,b,c,d,e,g,k,l,n){vec3EqualsXYZ(this._cam3dposition,a,b,c)&&vec3EqualsXYZ(this._cam3dlook,d,e,g)&&vec3EqualsXYZ(this._cam3dup,k,l,n)||(vec3$jscomp$7.set(this._cam3dposition,a,b,c),vec3$jscomp$7.set(this._cam3dlook,d,e,g),vec3$jscomp$7.set(this._cam3dup,k,l,n),this.Set3DCameraChanged())}Set3DCameraChanged(){this._SetAllLayersMVChanged(); this._runtime.UpdateRender()}Get3DCameraPosition(){return this._cam3dposition}Get3DCameraLookAt(){return this._cam3dlook}Get3DCameraUpVector(){return this._cam3dup}GetScale(){return this._scale}SetScale(a){this._scale!==a&&(this._scale=a,this._SetAllLayersMVChanged(),this.BoundScrolling(),this._runtime.UpdateRender())}SetAngle(a){a=C3$jscomp$88.clampAngle(a);this._angle!==a&&(this._angle=a,this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}GetAngle(){return this._angle}GetWidth(){return this._width}SetWidth(a){!isFinite(a)|| 1>a||(this._width=a)}GetHeight(){return this._height}SetHeight(a){!isFinite(a)||1>a||(this._height=a)}GetEventSheet(){return this._eventSheet}_GetRootLayers(){return this._rootLayers}*allLayers(){for(const a of this._rootLayers)yield*a.selfAndAllSubLayers()}GetLayers(){return this._allLayersFlat}GetLayerCount(){return this._allLayersFlat.length}GetLayer(a){return"number"===typeof a?this.GetLayerByIndex(a):this.GetLayerByName(a.toString())}GetLayerByIndex(a){a=C3$jscomp$88.clamp(Math.floor(a),0,this._allLayersFlat.length- 1);return this._allLayersFlat[a]}GetLayerByName(a){return this._layersByName.get(a.toLowerCase())||null}HasLayerByName(a){return!!this.GetLayerByName(a)}GetLayerBySID(a){return this._layersBySid.get(a)||null}_SetAllLayersProjectionChanged(){for(const a of this._allLayersFlat)a._SetProjectionMatrixChanged()}_SetAllLayersMVChanged(){for(const a of this._allLayersFlat)a._SetMVMatrixChanged()}AddLayer(a,b,c){if(this.HasLayerByName(a))throw Error(`layer name '${a}' already in use`);if(!b&&2>c)throw Error("invalid insert position"); const d=2<=c?b:b.GetParentLayer();a=C3$jscomp$88.New(C3$jscomp$88.Layer,this,d,{name:a,sid:Math.floor(1E15*Math.random()),isDynamic:!0});this._InsertLayer(a,b,c);this._ReindexLayers()}MoveLayer(a,b,c){if(!b&&2>c)throw Error("invalid insert position");this._RemoveLayer(a);this._InsertLayer(a,b,c);this._ReindexLayers()}RemoveLayer(a){this._RemoveLayer(a);a.Release();this._ReindexLayers()}RemoveAllDynamicLayers(){const a=new Set;for(const b of this.allLayers())b.IsDynamic()&&!b.HasAnyDynamicParentLayer()&& a.add(b);for(const b of a)this._RemoveLayer(b),b.Release();this._ReindexLayers()}_InsertLayer(a,b,c){if(2<=c)b?b._AddSubLayer(a,2===c):2===c?this._rootLayers.push(a):this._rootLayers.unshift(a);else{const d=b.GetParentLayer();d?d._InsertSubLayer(a,b,0===c):(b=this._rootLayers.indexOf(b),0===c&&++b,this._rootLayers.splice(b,0,a))}}_RemoveLayer(a){const b=a.GetParentLayer();b?b._RemoveSubLayer(a):1<this._rootLayers.length&&(a=this._rootLayers.indexOf(a),this._rootLayers.splice(a,1))}_ReindexLayers(){this._allLayersFlat= [...this.allLayers()];this._layersByName.clear();this._layersBySid.clear();for(let a=0,b=this._allLayersFlat.length;a<b;++a){const c=this._allLayersFlat[a];c._SetIndex(a);this._layersByName.set(c.GetName().toLowerCase(),c);this._layersBySid.set(c.GetSID(),c)}}SaveTransform(){return{scrollX:this.GetScrollX(),scrollY:this.GetScrollY(),scale:this.GetScale(),angle:this.GetAngle(),vpX:this.GetVanishingPointX(),vpY:this.GetVanishingPointY()}}RestoreTransform(a){this.SetScrollX(a.scrollX);this.SetScrollY(a.scrollY); this.SetScale(a.scale);this.SetAngle(a.angle);this.SetVanishingPointXY(a.vpX,a.vpY)}GetLayoutBackgroundColor(){let a=this._rootLayers.filter(b=>b.ShouldDraw())[0];for(;a;){if(!a.IsTransparent())return tempColor$jscomp$4.copyRgb(a.GetBackgroundColor()),tempColor$jscomp$4.setA(1),tempColor$jscomp$4;if(a.UsesOwnTexture())return tempColor$jscomp$4.setRgba(0,0,0,0),tempColor$jscomp$4;a=a.GetSubLayers().filter(b=>b.ShouldDraw())[0]}tempColor$jscomp$4.setRgba(0,0,0,0);return tempColor$jscomp$4}IsFirstVisit(){return this._isFirstVisit}_GetInitialObjectClasses(){return[...this._initialObjectClasses]}_AddInitialObjectClass(a){if(a.IsInContainer())for(const b of a.GetContainer().GetObjectTypes())this._initialObjectClasses.add(b); else this._initialObjectClasses.add(a)}_GetTextureLoadedObjectTypes(){return[...this._textureLoadedTypes]}_Load(a,b){if(a===this||!b)return Promise.resolve();a&&(C3$jscomp$88.CopySet(this._textureLoadedTypes,a._textureLoadedTypes),a._textureLoadedTypes.clear());a=[];for(const c of this._initialObjectClasses)this._textureLoadedTypes.has(c)||(a.push(c.LoadTextures(b)),this._textureLoadedTypes.add(c));return Promise.all(a)}async MaybeLoadTexturesFor(a){if(a.IsFamily())throw Error("cannot load textures for family"); var b=this._runtime.GetRenderer();!b||b.IsContextLost()||this._textureLoadedTypes.has(a)||(this._textureLoadedTypes.add(a),b=a.LoadTextures(b),this._AddPendingTextureLoadPromise(b),await b,a.OnDynamicTextureLoadComplete(),this._runtime.UpdateRender())}_AddPendingTextureLoadPromise(a){this._textureLoadPendingPromises.add(a);a.then(()=>this._textureLoadPendingPromises.delete(a)).catch(()=>this._textureLoadPendingPromises.delete(a))}WaitForPendingTextureLoadsToComplete(){return Promise.all([...this._textureLoadPendingPromises])}MaybeUnloadTexturesFor(a){if(a.IsFamily()|| 0<a.GetInstanceCount())throw Error("cannot unload textures");const b=this._runtime.GetRenderer();b&&this._textureLoadedTypes.has(a)&&(this._textureLoadedTypes.delete(a),a.ReleaseTextures(b))}_Unload(a,b){if(a!==this&&b)for(const c of this._textureLoadedTypes)c.IsGlobal()||a._initialObjectClasses.has(c)||(c.ReleaseTextures(),this._textureLoadedTypes.delete(c))}_OnRendererContextLost(){this._textureLoadedTypes.clear()}async _StartRunning(a){const b=this._runtime,c=this._layoutManager,d=b.GetEventSheetManager(); this._eventSheetName&&(this._eventSheet=d.GetEventSheetByName(this._eventSheetName),this._eventSheet._UpdateDeepIncludes());c._SetMainRunningLayout(this);this._width=this._originalWidth;this._height=this._originalHeight;this._scrollX=b.GetOriginalViewportWidth()/2;this._scrollY=b.GetOriginalViewportHeight()/2;this.BoundScrolling();this._SetAllLayersProjectionChanged();this._SetAllLayersMVChanged();this._MoveGlobalObjectsToThisLayout(a);this._runtime.SetUsingCreatePromises(!0);this._CreateInitialInstances(); this._isFirstVisit||this._CreatePersistedInstances();this._CreateAndLinkContainerInstances(this._createdInstances);this._CreateAndLinkContainerInstances(this._createdPersistedInstances);this._CreateInitialNonWorldInstances();c.ClearPendingChangeLayout();b.FlushPendingInstances();this._runtime.SetUsingCreatePromises(!1);var e=this._runtime.GetCreatePromises();await Promise.all(e);C3$jscomp$88.clearArray(e);if(!b.IsLoadingState()){for(const g of this._createdInstances)g.SetupInitialSceneGraphConnections(); for(const g of this._createdPersistedInstances)g.SetupPersistedSceneGraphConnections(this._createdPersistedInstancesToDataMap,this._createdPersistedIndexToInstanceMap);for(const [g,k]of Object.entries(this._persistData))(e=this._runtime.GetObjectClassBySID(parseInt(g,10)))&&!e.IsFamily()&&e.HasPersistBehavior()&&C3$jscomp$88.clearArray(k);for(const g of this._createdInstances)g._TriggerOnCreated();for(const g of this._createdPersistedInstances)g._TriggerOnCreated()}C3$jscomp$88.clearArray(this._createdInstances); C3$jscomp$88.clearArray(this._createdPersistedInstances);this._createdPersistedInstancesToDataMap.clear();this._createdPersistedIndexToInstanceMap.clear();await Promise.all([...this._initialObjectClasses].map(g=>g.PreloadTexturesWithInstances(this._runtime.GetRenderer())));a&&(b.Dispatcher().dispatchEvent(new C3$jscomp$88.Event("beforefirstlayoutstart")),await b.DispatchUserScriptEventAsyncWait(new C3$jscomp$88.Event("beforeprojectstart")));b.Dispatcher().dispatchEvent(new C3$jscomp$88.Event("beforelayoutstart")); await this.DispatchUserScriptEventAsyncWait(new C3$jscomp$88.Event("beforelayoutstart"));b.IsLoadingState()||await b.TriggerAsync(C3$jscomp$88.Plugins.System.Cnds.OnLayoutStart,null,null);b.Dispatcher().dispatchEvent(new C3$jscomp$88.Event("afterlayoutstart"));await this.DispatchUserScriptEventAsyncWait(new C3$jscomp$88.Event("afterlayoutstart"));a&&(b.Dispatcher().dispatchEvent(new C3$jscomp$88.Event("afterfirstlayoutstart")),await b.DispatchUserScriptEventAsyncWait(new C3$jscomp$88.Event("afterprojectstart"))); d._RunQueuedTriggers(c);await this.WaitForPendingTextureLoadsToComplete();this._isFirstVisit=!1}_MoveGlobalObjectsToThisLayout(a){for(const c of this._runtime.GetAllObjectClasses())if(!c.IsFamily()&&c.IsWorldType())for(const d of c.GetInstances()){const e=d.GetWorldInfo();var b=e.GetLayer();b=C3$jscomp$88.clamp(b.GetIndex(),0,this._allLayersFlat.length-1);b=this._allLayersFlat[b];e._SetLayer(b,!0);b._MaybeAddInstance(d)}if(!a)for(const c of this._allLayersFlat)c._SortInstancesByLastCachedZIndex(!1)}_CreateInitialInstances(){for(const a of this._allLayersFlat)a.CreateInitialInstances(this._createdInstances), a._Start()}_CreatePersistedInstances(){let a=!1;for(const [c,d]of Object.entries(this._persistData)){const e=this._runtime.GetObjectClassBySID(parseInt(c,10));if(e&&!e.IsFamily()&&e.HasPersistBehavior())for(const g of d){var b=null;if(e.IsWorldType()&&(b=g.hasOwnProperty("instJson")?this.GetLayerBySID(g.instJson.w.l):this.GetLayerBySID(g.w.l),!b))continue;b=this._runtime.CreateInstanceFromData(e,b,!1,0,0,!0);g.hasOwnProperty("instJson")?b.LoadFromJson(g.instJson):b.LoadFromJson(g);a=!0;this._createdPersistedInstances.push(b); g.hasOwnProperty("instJson")&&(this._createdPersistedInstancesToDataMap.set(b,g),this._createdPersistedIndexToInstanceMap.set(g.index,b))}}for(const c of this._allLayersFlat)c._SortInstancesByLastCachedZIndex(!0),c.SetZIndicesChanged();a&&(this._runtime.FlushPendingInstances(),this._runtime._RefreshUidMap())}_CreateAndLinkContainerInstances(a){for(const c of a){if(!c.IsInContainer())continue;const d=c.GetWorldInfo(),e=c.GetIID();for(const g of c.GetObjectClass().GetContainer().objectTypes())if(g!== c.GetObjectClass()){var b=g.GetInstances();b.length>e?c._AddSibling(b[e]):(b=d?this._runtime.CreateInstanceFromData(g,d.GetLayer(),!0,d.GetX(),d.GetY(),!0):this._runtime.CreateInstanceFromData(g,null,!0,0,0,!0),this._runtime.FlushPendingInstances(),g._UpdateIIDs(),c._AddSibling(b),a.push(b))}}}_CreateInitialNonWorldInstances(){for(const a of this._initialNonWorld)this._runtime.GetObjectClassByIndex(a[1]).IsInContainer()||this._runtime.CreateInstanceFromData(a,null,!0)}_CreateGlobalNonWorlds(){const a= [],b=this._initialNonWorld;let c=0;for(let d=0,e=b.length;d<e;++d){const g=b[d],k=this._runtime.GetObjectClassByIndex(g[1]);k.IsGlobal()?k.IsInContainer()&&k.GetContainer().HasAnyWorldType()||a.push(this._runtime.CreateInstanceFromData(g,null,!0)):(b[c]=g,++c)}C3$jscomp$88.truncateArray(b,c);this._runtime.FlushPendingInstances();this._CreateAndLinkContainerInstances(a)}RecreateInitialObjects(a,b,c,d,e,g){if(c)return c.RecreateInitialObjects(a,b,d,e,g);c=[];for(const k of this._allLayersFlat)c.push(k.RecreateInitialObjects(a, b,d,e,g));return c.flat()}async _StopRunning(){const a=this._layoutManager;this._runtime.IsLoadingState()||(await this.DispatchUserScriptEventAsyncWait(new C3$jscomp$88.Event("beforelayoutend")),await this._runtime.TriggerAsync(C3$jscomp$88.Plugins.System.Cnds.OnLayoutEnd,null,null),await this.DispatchUserScriptEventAsyncWait(new C3$jscomp$88.Event("afterlayoutend")));a.SetIsEndingLayout(!0);this._runtime.GetEventSheetManager().ClearAllScheduledWaits();this._isFirstVisit||this._SavePersistData(); for(const b of this._allLayersFlat)b._End();for(const b of this._runtime.GetAllObjectClasses())if(!(b.IsGlobal()||b.IsWorldType()||b.GetPlugin().IsSingleGlobal()||b.IsFamily())){for(const c of b.GetInstances())this._runtime.DestroyInstance(c);this._runtime.FlushPendingInstances()}a.SetIsEndingLayout(!1);a.GetMainRunningLayout()===this&&a._SetMainRunningLayout(null)}_SaveInstanceToPersist(a,b){var c=a.GetObjectClass().GetSID().toString();this._persistData.hasOwnProperty(c)||(this._persistData[c]=[]); c=this._persistData[c];b={index:b,instJson:a.SaveToJson(),sceneGraphJson:{children:[]}};c.push(b);this._persistedIntances.set(a,b)}_SaveSceneGraphInfoToPersist(a){const b=this._persistedIntances.get(a);for(const c of a.GetChildren())(a=this._persistedIntances.get(c))&&b.sceneGraphJson.children.push({index:a.index,flags:C3$jscomp$88.SceneGraphInfo._GetFlagsNumber(c.GetWorldInfo())})}_SavePersistData(){this._persistedIntances.clear();var a=0;for(const b of this._allLayersFlat){b._UpdateZIndices();for(const c of b._GetInstances()){const d= c.GetObjectClass();!d.IsGlobal()&&d.HasPersistBehavior()&&(this._SaveInstanceToPersist(c,a),a++)}}for(const b of this._allLayersFlat)for(const c of b._GetInstances())a=c.GetObjectClass(),!a.IsGlobal()&&a.HasPersistBehavior()&&this._SaveSceneGraphInfoToPersist(c);this._persistedIntances.clear()}ResetPersistData(){this._persistData={};this._isFirstVisit=!0}GetRenderTarget(){return this._curRenderTarget}UsesOwnTexture(){const a=this._runtime,b=a.GetRenderer().IsWebGL();return"low"===a.GetCanvasManager().GetCurrentFullscreenScalingQuality()|| b&&a.UsesAnyBackgroundBlending()||"low-latency"===a.GetCompositingMode()||this._effectList.HasAnyActiveEffect()||b&&a.Uses3DFeatures()}Draw(a){const b=this._runtime.GetCanvasManager(),c=this.UsesOwnTexture();if(c){"low-latency"!==this._runtime.GetCompositingMode()&&(a.SetRenderTarget(null),a.ClearRgba(0,0,0,0));const d={sampling:this._runtime.GetSampling(),isSampled:a.IsWebGPU()||this._runtime.UsesAnyBackgroundBlending()||this._effectList.HasAnyActiveEffect(),canReadPixels:a.IsWebGPU()?this._runtime.UsesAnyBackgroundBlending(): !1};"low"===b.GetCurrentFullscreenScalingQuality()&&(d.width=b.GetDrawWidth(),d.height=b.GetDrawHeight());this._curRenderTarget=this._runtime.GetAdditionalRenderTarget(d)}else this._curRenderTarget=null;a.SetRenderTarget(this._curRenderTarget);a.Clear(this.GetLayoutBackgroundColor());this._runtime.Uses3DFeatures()&&a.ClearDepth();this._DrawLayerList(a,this._curRenderTarget,this._rootLayers,!0);c&&(a.SetDepthEnabled(!1),this._DrawLayoutOwnTextureToRenderTarget(a,this._curRenderTarget));this._curRenderTarget= null}_DrawLayerList(a,b,c,d){c=c.filter(e=>e.ShouldDraw());for(let e=0,g=c.length;e<g;){const k=c[e];if(k.SelfAndAllSubLayersHave3DCamera()&&!k.SelfOrAnySubLayerUsesOwnTexture()){tempRender3dList.push(k);for(let l=e+1;l<g;++l){const n=c[l];if(n.SelfAndAllSubLayersHave3DCamera()&&!n.SelfOrAnySubLayerUsesOwnTexture())tempRender3dList.push(c[l]);else break}if(2<=tempRender3dList.length||1===tempRender3dList.length&&tempRender3dList[0].HasAnyVisibleSubLayer()){this._Draw3DLayers(a,b,tempRender3dList); e+=tempRender3dList.length;C3$jscomp$88.clearArray(tempRender3dList);continue}C3$jscomp$88.clearArray(tempRender3dList)}k.Draw(a,b,d&&0===e);++e}}_DrawLayoutOwnTextureToRenderTarget(a,b){const c=this._effectList.GetActiveEffectTypes(),d=this._runtime;0===c.length?(a.SetRenderTarget(null),a.SetTextureFillMode(),a.CopyRenderTarget(b),a.InvalidateRenderTarget(b),d.ReleaseAdditionalRenderTarget(b)):(tempLayoutRect.set(0,0,d.GetViewportWidth(),d.GetViewportHeight()),this.GetEffectChain().Render(a,null, {contentObject:this,blendMode:3,devicePixelRatio:this._runtime.GetEffectDevicePixelRatioParam(),layerScale:this._runtime.GetEffectLayerScaleParam()*this.GetScale(),layerAngle:this.GetAngle(),layoutRect:tempLayoutRect,drawSurfaceRect:null,invalidateRenderTargets:!0}))}_Draw3DLayers(a,b,c){c[0].IsTransparent()||(tempColor$jscomp$4.copyRgb(c[0].GetBackgroundColor()),tempColor$jscomp$4.setA(1),a.Clear(tempColor$jscomp$4));var d=this._runtime.GetCanvasManager();a.SetDepthEnabled(!0);for(var e of c)e._UpdateZIndices(), e._AppendAllInstancesIncludingSubLayersInDrawOrder(tempInstanceList1$jscomp$1);c=c[0];e=null;if(this._runtime.IsGPUProfiling())if(a.IsWebGL()){if(d=d.GetLayerTimingsBuffer(c))e=d.AddTimeElapsedQuery(),a.StartQuery(e)}else a.IsWebGPU()&&a.WriteTimestamp(2*(c.GetIndex()+1));for(let p=0,r=tempInstanceList1$jscomp$1.length;p<r;){var g=tempInstanceList1$jscomp$1[p],k=g.GetWorldInfo(),l=k.GetLayer();if(k.IsVisible()&&k.IsInViewport3D(l._GetViewFrustum())){(!g.RendersToOwnZPlane()||0<k.GetDepth())&&tempInstanceList3.push(g); var n=g.GetWorldInfo().GetTotalZElevation();tempInstanceList2$jscomp$1.push(g);for(d=p+1;d<r;++d){const w=tempInstanceList1$jscomp$1[d],y=w.GetWorldInfo();if(y.IsVisible()&&y.IsInViewport3D(y.GetLayer()._GetViewFrustum())){if(y.GetTotalZElevation()!==n)break;w.RendersToOwnZPlane()?(0<y.GetDepth()&&tempInstanceList3.push(w),tempInstanceList2$jscomp$1.push(w)):tempInstanceList3.push(w)}}if(1!==tempInstanceList2$jscomp$1.length||tempInstanceList2$jscomp$1[0].MustMitigateZFighting()){this._Draw3DLayersCoplanarInstances(a, b,tempInstanceList2$jscomp$1);for(let w=0,y=tempInstanceList3.length;w<y;++w)g=tempInstanceList3[w],k=g.GetWorldInfo(),l=k.GetLayer(),k._SetDrawNonBackFacesOnly(!0),MaybePrepareLayerDraw(l,a),l._DrawInstanceMaybeWithEffects(g,k,a,b),k._SetDrawNonBackFacesOnly(!1)}else{MaybePrepareLayerDraw(l,a);l._DrawInstanceMaybeWithEffects(g,k,a,b);for(let w=0,y=tempInstanceList3.length;w<y;++w)k=tempInstanceList3[w],k!==g&&(l=k.GetWorldInfo(),n=l.GetLayer(),MaybePrepareLayerDraw(n,a),n._DrawInstanceMaybeWithEffects(k, l,a,b))}p=d;C3$jscomp$88.clearArray(tempInstanceList2$jscomp$1);C3$jscomp$88.clearArray(tempInstanceList3)}else++p}e&&a.EndQuery(e);this._runtime.IsGPUProfiling()&&a.IsWebGPU()&&a.WriteTimestamp(2*(c.GetIndex()+1)+1);C3$jscomp$88.clearArray(tempInstanceList1$jscomp$1);lastLayerPreparedForDrawing=null}_Draw3DLayersCoplanarInstances(a,b,c){a.CoplanarStartStencilPass();for(let k=0,l=c.length;k<l;++k){var d=c[k],e=d.GetWorldInfo(),g=e.GetLayer();e._SetDrawBackFaceOnly(!0);MaybePrepareLayerDraw(g,a);g._DrawInstance(d, e,a)}a.CoplanarStartColorPass();for(let k=0,l=c.length;k<l;++k)d=c[k],e=d.GetWorldInfo(),g=e.GetLayer(),MaybePrepareLayerDraw(g,a),g._DrawInstanceMaybeWithEffects(d,e,a,b),e._SetDrawBackFaceOnly(!1);a.CoplanarRestoreStandardRendering()}_SaveToJson(){const a={sx:this.GetScrollX(),sy:this.GetScrollY(),s:this.GetScale(),a:this.GetAngle(),w:this.GetWidth(),h:this.GetHeight(),ortho:this.IsOrthographicProjection(),vpX:this.GetVanishingPointX(),vpY:this.GetVanishingPointY(),fv:this._isFirstVisit,persist:this._persistData, fx:this._effectList.SaveToJson(),layers:{},dynamicLayers:[]};for(const b of this._allLayersFlat)if(b.IsDynamic()){const c=b.GetParentLayer();a.dynamicLayers.push({sid:b.GetSID(),name:b.GetName(),parentSid:c?c.GetSID():null,siblingIndex:b._GetSiblingIndex(),data:b._SaveToJson()})}else a.layers[b.GetSID().toString()]=b._SaveToJson();return a}_LoadFromJson(a){this._scrollX=a.sx;this._scrollY=a.sy;this._scale=a.s;this._angle=a.a;this._width=a.w;this._height=a.h;this._isOrthographicProjection=!!a.ortho; a.hasOwnProperty("vpX")&&(this._vanishingPointX=a.vpX);a.hasOwnProperty("vpY")&&(this._vanishingPointY=a.vpY);this._isFirstVisit=!!a.fv;this._persistData=a.persist;this._effectList.LoadFromJson(a.fx);this._needsRebuildEffectChainSteps=!0;for(const [l,n]of Object.entries(a.layers)){var b=parseInt(l,10);(b=this.GetLayerBySID(b))&&b._LoadFromJson(n)}if(a.hasOwnProperty("dynamicLayers")){this.RemoveAllDynamicLayers();this._runtime.FlushPendingInstances();b=new Map;a=a.dynamicLayers;for(var c=a.length- 1;0<=c;--c){var d=a[c],e=d.sid,g=d.name,k=d.parentSid;const l=d.siblingIndex;d=d.data;this._ReindexLayers();if(this.HasLayerByName(g)||this.GetLayerBySID(e))continue;let n;if(null===k)n=null,k=this._rootLayers;else{n=this.GetLayerBySID(k);if(!n)continue;k=n.GetSubLayers()}e=C3$jscomp$88.New(C3$jscomp$88.Layer,this,n,{name:g,sid:e,isDynamic:!0});k.push(e);g=b.get(k);g||(g=[],b.set(k,g));g.push({layer:e,siblingIndex:l});e._LoadFromJson(d)}for(const [l,n]of b){n.sort((p,r)=>p.siblingIndex-r.siblingIndex); for(const p of n)b=p.layer,a=p.siblingIndex,c=l.indexOf(b),l.splice(c,1),l.splice(a,0,b)}}this._ReindexLayers();this._SetAllLayersProjectionChanged();this._SetAllLayersMVChanged()}GetILayout(){return this._iLayout}UserScriptDispatcher(){return this._userScriptDispatcher}DispatchUserScriptEvent(a){a.layout=this.GetILayout();var b=this._runtime;(b=b.IsDebug()&&!b.GetEventSheetManager().IsInEventEngine())&&C3Debugger.StartMeasuringScriptTime();this._userScriptDispatcher.dispatchEvent(a);b&&C3Debugger.AddScriptTime()}DispatchUserScriptEventAsyncWait(a){a.layout= this.GetILayout();return this._userScriptDispatcher.dispatchEventAndWaitAsync(a)}};"use strict";const C3$jscomp$89=self.C3; C3$jscomp$89.LayoutManager=class extends C3$jscomp$89.DefendedBase{constructor(a){super();this._runtime=a;this._allLayouts=[];this._layoutsByName=new Map;this._layoutsBySid=new Map;this._mainRunningLayout=null;this._runningSubLayouts=[];this._firstLayout=null;this._isEndingLayout=0;this._pendingChangeLayout=null}Release(){this._pendingChangeLayout=this._firstLayout=this._mainRunningLayout=this._runtime=null;C3$jscomp$89.clearArray(this._allLayouts);this._layoutsByName.clear();this._layoutsBySid.clear(); C3$jscomp$89.clearArray(this._runningSubLayouts)}Create(a){a=C3$jscomp$89.New(C3$jscomp$89.Layout,this,this._allLayouts.length,a);this._allLayouts.push(a);this._layoutsByName.set(a.GetName().toLowerCase(),a);this._layoutsBySid.set(a.GetSID(),a)}GetRuntime(){return this._runtime}SetFirstLayout(a){this._firstLayout=a}GetFirstLayout(){if(this._firstLayout)return this._firstLayout;if(this._allLayouts.length)return this._allLayouts[0];throw Error("no first layout");}GetLayoutByName(a){return this._layoutsByName.get(a.toLowerCase())|| null}GetLayoutBySID(a){return this._layoutsBySid.get(a)||null}GetLayoutByIndex(a){a=C3$jscomp$89.clamp(Math.floor(a),0,this._allLayouts.length-1);return this._allLayouts[a]}GetLayout(a){return"number"===typeof a?this.GetLayoutByIndex(a):this.GetLayoutByName(a.toString())}GetAllLayouts(){return this._allLayouts}_SetMainRunningLayout(a){this._mainRunningLayout=a}GetMainRunningLayout(){return this._mainRunningLayout}_AddRunningSubLayout(a){if(this._runningSubLayouts.includes(a))throw Error("layout already running"); this._runningSubLayouts.push(a)}_RemoveRunningSubLayout(a){a=this._runningSubLayouts.indexOf(a);if(-1===a)throw Error("layout not running");this._runningSubLayouts.splice(a,1)}*runningLayouts(){this._mainRunningLayout&&(yield this._mainRunningLayout);this._runningSubLayouts.length&&(yield*this._runningSubLayouts)}IsLayoutRunning(a){return this._mainRunningLayout===a||this._runningSubLayouts.includes(a)}SetIsEndingLayout(a){if(a)this._isEndingLayout++;else{if(0>=this._isEndingLayout)throw Error("already unset"); this._isEndingLayout--}}IsEndingLayout(){return 0<this._isEndingLayout}ChangeMainLayout(a){this._pendingChangeLayout=a}ClearPendingChangeLayout(){this._pendingChangeLayout=null}IsPendingChangeMainLayout(){return!!this._pendingChangeLayout}GetPendingChangeMainLayout(){return this._pendingChangeLayout}SetAllLayerProjectionChanged(){const a=this.GetMainRunningLayout();a&&a._SetAllLayersProjectionChanged()}SetAllLayerMVChanged(){const a=this.GetMainRunningLayout();a&&a._SetAllLayersMVChanged()}};"use strict"; const C3$jscomp$90=self.C3,NAMES_REGEXP=RegExp("<(.+?)>","g"); C3$jscomp$90.TimelineManager=class extends C3$jscomp$90.DefendedBase{constructor(a){super();this._runtime=a;this._timelineDataManager=C3$jscomp$90.New(C3$jscomp$90.TimelineDataManager);this._pluginInstance=null;this._timelines=[];this._timelinesByName=new Map;this._objectClassToTimelineMap=new Map;this._timelinesCreatedByTemplate=new Map;this._scheduledTimelines=[];this._playingTimelines=[];this._markedForRemovalTimelines=[];this._isTickingTimelines=this._changingLayout=this._hasRuntimeListeners= !1;this._tickFunc=()=>this._OnTick();this._tick2Func=()=>this._OnTick2();this._beforeLayoutChange=()=>this._OnBeforeChangeLayout();this._layoutChange=()=>this._OnAfterChangeLayout();this._instanceDestroy=b=>this._OnInstanceDestroy(b.instance);this._beforeLoad=b=>this._OnBeforeLoad();this._afterLoad=b=>this._OnAfterLoad();this._afterLayoutStart=b=>this._OnAfterLayoutStart();this._destroyedWhileLoadingState=[];this._renderChange=0}Release(){this.RemoveRuntimeListeners();this._afterLoad=this._instanceDestroy= this._layoutChange=this._beforeLayoutChange=this._tick2Func=this._tickFunc=null;for(const a of this._timelines)a.Stop(),a.Release();C3$jscomp$90.clearArray(this._timelines);this._timelines=null;this._timelineDataManager.Release();this._timelineDataManager=null;C3$jscomp$90.clearArray(this._scheduledTimelines);this._scheduledTimelines=null;C3$jscomp$90.clearArray(this._playingTimelines);this._playingTimelines=null;C3$jscomp$90.clearArray(this._markedForRemovalTimelines);this._markedForRemovalTimelines= null;this._timelinesByName.clear();this._timelinesByName=null;this._objectClassToTimelineMap.clear();this._objectClassToTimelineMap=null;this._timelinesCreatedByTemplate.clear();this._timelinesCreatedByTemplate=null;C3$jscomp$90.clearArray(this._destroyedWhileLoadingState);this._runtime=this._destroyedWhileLoadingState=null}AddRuntimeListeners(){const a=this._runtime.Dispatcher();a.addEventListener("pretick",this._tickFunc);a.addEventListener("tick2",this._tick2Func);a.addEventListener("beforelayoutchange", this._beforeLayoutChange);a.addEventListener("layoutchange",this._layoutChange);a.addEventListener("instancedestroy",this._instanceDestroy);a.addEventListener("beforeload",this._beforeLoad);a.addEventListener("afterload",this._afterLoad);a.addEventListener("afterlayoutstart",this._afterLayoutStart)}RemoveRuntimeListeners(){const a=this._runtime.Dispatcher();a.removeEventListener("pretick",this._tickFunc);a.removeEventListener("tick2",this._tick2Func);a.removeEventListener("beforelayoutchange",this._beforeLayoutChange); a.removeEventListener("layoutchange",this._layoutChange);a.removeEventListener("instancedestroy",this._instanceDestroy);a.removeEventListener("beforeload",this._beforeLoad);a.removeEventListener("afterload",this._afterLoad);a.removeEventListener("afterlayoutstart",this._afterLayoutStart)}Create(a){this._timelineDataManager.Add(a);a=C3$jscomp$90.TimelineState.CreateInitial(a,this);this.Add(a);this.SetTimelineObjectClassesToMap(a);this._timelinesCreatedByTemplate.set(a.GetName(),0)}CreateFromTemplate(a){var b= this.GetTimelineDataManager();a=a.GetTemplateName();b=b.Get(a);b=C3$jscomp$90.TimelineState.CreateFromTemplate(`${a}:${this._timelinesCreatedByTemplate.get(a)}`,b,this);this._IncreaseTemplateTimelinesCount(a);this.Add(b);return b}_IncreaseTemplateTimelinesCount(a){this._timelinesCreatedByTemplate.set(a,this._timelinesCreatedByTemplate.get(a)+1)}_SetCreatedTemplateTimelinesCount(){for(const a of this._timelines){if(a.IsTemplate())continue;const b=a.GetTemplateName();this._IncreaseTemplateTimelinesCount(b)}}_ClearCreatedTemplateTimelinesCount(){for(const a of this._timelinesCreatedByTemplate.keys())this._timelinesCreatedByTemplate.set(a, 0)}Add(a){this._timelines.push(a);this._timelinesByName.set(a.GetName().toLowerCase(),a)}Remove(a){a.Removed();a.IsTemplate()||(C3$jscomp$90.arrayFindRemove(this._timelines,a),C3$jscomp$90.arrayFindRemove(this._scheduledTimelines,a),C3$jscomp$90.arrayFindRemove(this._playingTimelines,a),C3$jscomp$90.arrayFindRemove(this._markedForRemovalTimelines,a),this._timelinesByName.delete(a.GetName().toLowerCase()),this.RemoveTimelineFromObjectClassMap(a),a.IsReleased()||a.Release())}Trigger(a){this._runtime.Trigger(a, this._pluginInstance,null)}GetRuntime(){return this._runtime}GetTimelineDataManager(){return this._timelineDataManager}SetPluginInstance(a){this._pluginInstance=a}GetPluginInstance(){return this._pluginInstance}*GetTimelines(){for(const a of this._timelines)yield a}*GetPlayingTimelines(){for(const a of this._playingTimelines)yield a}SetTimelineObjectClassToMap(a,b){this._objectClassToTimelineMap.has(a)||this._objectClassToTimelineMap.set(a,new Set);this._objectClassToTimelineMap.get(a).add(b)}SetTimelineObjectClassesToMap(a){for(const b of a.GetObjectClasses())this.SetTimelineObjectClassToMap(b, a)}RemoveTimelineFromObjectClassMap(a){for(const [b,c]of this._objectClassToTimelineMap.entries())c.has(a)&&(c.delete(a),0===c.size&&this._objectClassToTimelineMap.delete(b))}GetTimelinesForObjectClass(a){if(this._objectClassToTimelineMap.has(a))return this._objectClassToTimelineMap.get(a)}GetTimelineOfTemplateForInstances(a,b){if(b)for(const c of this._timelines)if(b.every(d=>c.HasTrackInstance(d.instance,d.trackId))&&c.GetName().includes(a.GetName()))return c}GetTimelineByName(a){return this._timelinesByName.get(a.toLowerCase())|| null}GetScheduledOrPlayingTimelineByName(a){for(const b of this._scheduledTimelines)if(b.GetName()===a)return b;for(const b of this._playingTimelines)if(b.GetName()===a)return b;return null}*GetTimelinesByName(a){if(NAMES_REGEXP.test(a)){NAMES_REGEXP.lastIndex=0;let c;var b=new Set;do if(c=NAMES_REGEXP.exec(a)){const d=c[1].split(",");for(const e of d)b.add(e)}while(c);for(const d of b.values())(a=this.GetTimelineByName(d))&&(yield a);b.clear()}else(b=this.GetTimelineByName(a))&&(yield b)}*GetTimelinesByTags(a){for(const b of this._timelines)b.HasTags(a)&& (yield b)}AddScheduledTimeline(a){this._scheduledTimelines.includes(a)||this._scheduledTimelines.push(a);this._MaybeEnableRuntimeListeners()}RemovePlayingTimeline(a){C3$jscomp$90.arrayFindRemove(this._playingTimelines,a);this._MaybeDisableRuntimeListeners()}ScheduleTimeline(a){this._playingTimelines.includes(a)?(a.SetPlaying(!0),a.SetScheduled(!1),a.SetMarkedForRemoval(!1)):(a.SetPlaying(!1),a.SetScheduled(!0),a.SetMarkedForRemoval(!1),this._scheduledTimelines.includes(a)||this._scheduledTimelines.push(a)); this._MaybeEnableRuntimeListeners()}DeScheduleTimeline(a){a.SetPlaying(!1);a.SetScheduled(!1);a.ResolvePlayPromise();C3$jscomp$90.arrayFindRemove(this._scheduledTimelines,a);this._MaybeDisableRuntimeListeners()}CompleteTimeline(a){a.SetPlaying(!1);a.SetScheduled(!1);this._playingTimelines.includes(a)&&(a.SetMarkedForRemoval(!0),this._markedForRemovalTimelines.push(a),C3$jscomp$90.arrayFindRemove(this._playingTimelines,a))}CompleteTimelineBeforeChangeOfLayout(a){a.SetPlaying(!1);a.SetScheduled(!1); a.SetMarkedForRemoval(!1);a.SetPlaybackRate(1);C3$jscomp$90.arrayFindRemove(this._playingTimelines,a)}CompleteTimelineAndResolve(a){this.CompleteTimeline(a);a.ResolvePlayPromise()}_OnTick(){if(!this.GetRuntime().IsLoadingState()&&this._hasRuntimeListeners&&!this._changingLayout){for(this._isTickingTimelines=!0;this._scheduledTimelines.length;){var a=this._scheduledTimelines.pop();a.SetInitialState();0!==a.GetRenderChange()&&(this._renderChange=1);this._playingTimelines.push(a)}a=this._runtime._GetDtFast(); var b=this._runtime.GetDt1(),c=this._runtime.GetTimeScale();for(let d=this._playingTimelines.length-1;0<=d;d--){const e=this._playingTimelines[d];e&&e.Tick(a,c,b)}this._isTickingTimelines=!1;0!==this._renderChange&&this.GetRuntime().UpdateRender()}}_OnTick2(){if(!this.GetRuntime().IsLoadingState()&&this._hasRuntimeListeners&&!this._changingLayout){var a;for(let b=0,c=this._markedForRemovalTimelines.length;b<c;b++){const d=this._markedForRemovalTimelines[b];a||(a=new Set);d.Removed();this._MaybeExecuteTimelineFinishTriggers(d); a.add(d)}if(a){C3$jscomp$90.arrayRemoveAllInSet(this._markedForRemovalTimelines,a);this._renderChange=0;for(let b=0,c=this._playingTimelines.length;b<c;b++)if(0!==this._playingTimelines[b].GetRenderChange()){this._renderChange=1;break}}this._MaybeDisableRuntimeListeners()}}_MaybeExecuteTimelineFinishTriggers(a){a.IsReleased()||a.HasValidTracks()&&a.IsComplete()&&a.InitialStateSet()&&a.FinishTriggers()}_MaybeEnableRuntimeListeners(){this._hasRuntimeListeners||(this._hasRuntimeListeners=!0)}_MaybeDisableRuntimeListeners(){this._markedForRemovalTimelines.length|| this._playingTimelines.length||this._scheduledTimelines.length||this._isTickingTimelines||(this._hasRuntimeListeners=!1)}_OnBeforeChangeLayout(){for(this._changingLayout=!0;this._scheduledTimelines.length;)this.DeScheduleTimeline(this._scheduledTimelines.pop());const a=new Set;for(const b of this._playingTimelines)b._OnBeforeChangeLayout()&&(b.Removed(),a.add(b));C3$jscomp$90.arrayRemoveAllInSet(this._playingTimelines,a);a.clear();for(const b of this._markedForRemovalTimelines)b._OnBeforeChangeLayout()&& (b.Removed(),a.add(b));C3$jscomp$90.arrayRemoveAllInSet(this._markedForRemovalTimelines,a);this._MaybeDisableRuntimeListeners();for(const b of this._timelines)b.CleanCaches()}_OnAfterChangeLayout(){this._changingLayout=!1}_OnInstanceDestroy(a){var b=a.GetObjectClass();if(b=this.GetTimelinesForObjectClass(b))if(this._runtime.IsLoadingState())this._destroyedWhileLoadingState.push(a);else for(const c of b)c.IsTemplate()||(c.IsReleased()?this.Remove(c):c.HasValidTracks()||(this._MaybeExecuteTimelineFinishTriggers(c), this.Remove(c)))}_OnBeforeLoad(){for(const a of this._scheduledTimelines.map(b=>b))this._MaybeExecuteTimelineFinishTriggers(a),this.Remove(a);for(const a of this._playingTimelines.map(b=>b))this._MaybeExecuteTimelineFinishTriggers(a),this.Remove(a)}_OnAfterLoad(){for(const a of this._destroyedWhileLoadingState)this._OnInstanceDestroy(a);C3$jscomp$90.clearArray(this._destroyedWhileLoadingState)}_OnAfterLayoutStart(){const a=this._runtime.GetLayoutManager().GetMainRunningLayout();if(a)for(const b of this._timelines){const c= b.GetStartOnLayout();c&&a.GetName()===c&&this.ScheduleTimeline(b)}}_SaveToJson(){return{timelinesJson:this._SaveTimelinesToJson(),scheduledTimelinesJson:this._SaveScheduledTimelinesToJson(),playingTimelinesJson:this._SavePlayingTimelinesToJson(),markedForRemovalTimelinesJson:this._SaveMarkedForRemovalTimelinesToJson(),hasRuntimeListeners:this._hasRuntimeListeners,changingLayout:this._changingLayout,isTickingTimelines:this._isTickingTimelines}}_LoadFromJson(a){a&&(this._ClearCreatedTemplateTimelinesCount(), this._LoadTimelinesFromJson(a.timelinesJson),this._LoadScheduledTimelinesFromJson(a.scheduledTimelinesJson),this._LoadPlayingTimelinesFromJson(a.playingTimelinesJson),this._LoadMarkedForRemovalTimelinesFromJson(a.markedForRemovalTimelinesJson),this._hasRuntimeListeners=!a.hasRuntimeListeners,this._changingLayout=!!a.changingLayout,this._isTickingTimelines=!!a.isTickingTimelines,this._SetCreatedTemplateTimelinesCount(),this._MaybeEnableRuntimeListeners(),this._MaybeDisableRuntimeListeners())}_SaveTimelinesToJson(){return this._timelines.map(a=> a._SaveToJson())}_LoadTimelinesFromJson(a){for(const b of a){a=this.GetTimelineByName(b.name);if(!a){a=this._GetTemplateNameFromJson(b);if(!a)continue;a=this.GetTimelineByName(a);a=this.CreateFromTemplate(a)}a._LoadFromJson(b);a.HasTracks()||this.Remove(a)}}_GetTemplateNameFromJson(a){return(a=a.name.split(":"))&&2===a.length?a[0]:null}_SaveScheduledTimelinesToJson(){return this._SaveTimelines(this._scheduledTimelines)}_LoadScheduledTimelinesFromJson(a){this._LoadTimelines(a,this._scheduledTimelines)}_SavePlayingTimelinesToJson(){return this._SaveTimelines(this._playingTimelines)}_LoadPlayingTimelinesFromJson(a){this._LoadTimelines(a, this._playingTimelines)}_SaveMarkedForRemovalTimelinesToJson(){return this._SaveTimelines(this._markedForRemovalTimelines)}_LoadMarkedForRemovalTimelinesFromJson(a){this._LoadTimelines(a,this._markedForRemovalTimelines)}_IsTimelineInJson(a,b){if(!b)return!1;for(const c of b)if(c===a.GetName())return!0;return!1}_SaveTimelines(a){return a.map(b=>b.GetName())}_LoadTimelines(a,b){var c=new Set;for(const d of b)this._IsTimelineInJson(d,a)||c.add(d);C3$jscomp$90.arrayRemoveAllInSet(b,c);if(a){c=d=>e=>e.GetName()=== d;for(const d of a)(a=this.GetTimelineByName(d))&&(b.find(c(d))||b.push(a))}}};"use strict";const C3$jscomp$91=self.C3,TANGENT_RESULT=[0,0],MAP_RESULT=[0,0],PROJECTION_RESULT=[0,0,0,0,0]; C3$jscomp$91.TimelineInfo=class{constructor(a,b){this._initialized=!1;this._timeline=a;this._segments=[];if(b=b?this._timeline.GetTrackById(b):C3$jscomp$91.first(this._timeline.GetTracks()))if(a=b.GetPropertyTrack("offsetX"),b=b.GetPropertyTrack("offsetY"),a&&b){this._xTrack=a;this._yTrack=b;a=a.GetPropertyKeyframeDataItemArrayIncludingDisabled();b=b.GetPropertyKeyframeDataItemArrayIncludingDisabled();for(let c=1,d=Math.min(a.length,b.length);c<d;++c){const e=a[c];e.GetNext();const g=e.GetPrevious(), k=b[c];k.GetNext();const l=k.GetPrevious();g&&"cubic-bezier"===g.GetPathMode()&&l&&"cubic-bezier"===l.GetPathMode()?this._segments.push(C3$jscomp$91.New(C3$jscomp$91.TimelineCubicBezierSegmentInfo,g,l,e,k,this._segments.length)):(g&&"line"===g.GetPathMode()&&l&&l.GetPathMode(),this._segments.push(C3$jscomp$91.New(C3$jscomp$91.TimelineLineSegmentInfo,e,k,this._segments.length)))}this._initialized=!0}}Release(){for(const a of this._segments)a.Release();C3$jscomp$91.clearArray(this._segments);this._yTrack= this._xTrack=this._timeline=this._segments=null}WasInitialized(){return this._initialized}segments(){return this._segments}SetOrigin(a){const b="relative"===this._xTrack.GetResultMode()?a.GetX():0;a="relative"===this._yTrack.GetResultMode()?a.GetY():0;for(const c of this._segments)c.SetOrigin(b,a)}Project(a,b,c){c&&c.tRange&&(C3$jscomp$91.IsFiniteNumber(c.tRange[0])||(c.tRange[0]=0),C3$jscomp$91.IsFiniteNumber(c.tRange[1])||(c.tRange[1]=1));const d=[];for(const e of this._segments)if("cubic-bezier"=== e.GetType()){const g=e.Project(a,b,c?c.tRange:null);g[4]=e.GetIndex();d.push(JSON.parse(JSON.stringify(g)))}d.sort((e,g)=>e[3]-g[3]);return d[0]}Tangent(a,b){return this._segments[b].Tangent(a)}TangentAngle(a,b,c,d){return this._segments[d].TangentAngle(a,b,c)}}; C3$jscomp$91.TimelineCubicBezierSegmentInfo=class{constructor(a,b,c,d,e){this._index=e;e=a.GetAddOn("cubic-bezier");const g=c.GetAddOn("cubic-bezier"),k=b.GetAddOn("cubic-bezier"),l=d.GetAddOn("cubic-bezier");this._aX=a.GetValueWithResultMode();this._aY=b.GetValueWithResultMode();this._bX=a.GetValueWithResultMode()+e.GetStartAnchor();this._bY=b.GetValueWithResultMode()+k.GetStartAnchor();this._cX=c.GetValueWithResultMode()+g.GetEndAnchor();this._cY=d.GetValueWithResultMode()+l.GetEndAnchor();this._dX= c.GetValueWithResultMode();this._dY=d.GetValueWithResultMode();this._initialized=!1;this._len=100;this._arcLengths=Array(this._len+1);this._length=this._arcLengths[0]=0;this._lut=[];this._CalculateLength()}Release(){C3$jscomp$91.clearArray(this._arcLengths);this._arcLengths=null;C3$jscomp$91.clearArray(this._lut);this._lut=null}GetType(){return"cubic-bezier"}GetIndex(){return this._index}GetStepCount(){return Math.floor(this._length/30)}GetStepIncrement(){return 1/this.GetStepCount()}SetOrigin(a, b){this._originX=a;this._originY=b;this._arcLengths=Array(this._len+1);this._arcLengths[0]=0;this._CalculateLength()}Map(a){if(!this._initialized)return NaN;a=this._Map(a);MAP_RESULT[0]=this._X(a);MAP_RESULT[1]=this._Y(a);return MAP_RESULT}Project(a,b,c){const d=this._GenerateLUT(100);c=this._FindClosestFromLUT(a,b,d,c);a=this._RefineProjection(a,b,d,c);PROJECTION_RESULT[0]=a.x;PROJECTION_RESULT[1]=a.y;PROJECTION_RESULT[2]=a.t;PROJECTION_RESULT[3]=a.distance;return PROJECTION_RESULT}Tangent(a){var b= 1-a,c=b*b;b=2*b*a;const d=a*a;a=3*c*(this._bX+this._originX-(this._aX+this._originX))+3*b*(this._cX+this._originX-(this._bX+this._originX))+3*d*(this._dX+this._originX-(this._cX+this._originX));c=3*c*(this._bY+this._originY-(this._aY+this._originY))+3*b*(this._cY+this._originY-(this._bY+this._originY))+3*d*(this._dY+this._originY-(this._cY+this._originY));b=Math.hypot(a,c);TANGENT_RESULT[0]=a/b;TANGENT_RESULT[1]=c/b;return TANGENT_RESULT}TangentAngle(a,b,c){c=this.Tangent(c);return C3$jscomp$91.angleTo(a, b,a+c[0],b+c[1])}_Map(a){if(this._initialized){a*=this._arcLengths[this._len];for(var b=0,c=this._len,d=0;b<c;)d=b+((c-b)/2|0),this._arcLengths[d]<a?b=d+1:c=d;this._arcLengths[d]>a&&d--;b=this._arcLengths[d];return b===a?d/this._len:(d+(a-b)/(this._arcLengths[d+1]-b))/this._len}}_X(a){return this._initialized?self.Ease.GetRuntimeEase("cubicbezier")(a,this._aX+this._originX,this._bX+this._originX,this._cX+this._originX,this._dX+this._originX):NaN}_Y(a){return this._initialized?self.Ease.GetRuntimeEase("cubicbezier")(a, this._aY+this._originY,this._bY+this._originY,this._cY+this._originY,this._dY+this._originY):NaN}_GenerateLUT(a){a=a||100;if(this._lut.length===a)return this._lut;this._lut=[];a++;for(let b=0;b<a;b++){const c=b/(a-1),d=this._X(c),e=this._Y(c);this._lut.push({x:d,y:e,t:c,distance:0})}return this._lut}_FindClosestFromLUT(a,b,c,d=null,e=Number.MAX_SAFE_INTEGER){let g=0;c.forEach((k,l)=>{k.t=l/(c.length-1);k.distance=C3$jscomp$91.distanceTo(a,b,k.x,k.y);d&&C3$jscomp$91.IsArray(d)&&C3$jscomp$91.IsFiniteNumber(d[0])&& C3$jscomp$91.IsFiniteNumber(d[1])?k.t>=d[0]&&k.t<=d[1]&&k.distance<e&&(e=k.distance,g=l):k.distance<e&&(e=k.distance,g=l)});return g}_RefineProjection(a,b,c,d,e=0,g=1){let k=c[d],l=1,n=Number.MAX_SAFE_INTEGER;do{var p=0===d?0:d-1;let r=d===c.length-1?c.length-1:d+1,w=c[p].t,y=[],B=(c[r].t-w)/4;if(.001>B)break;y.push(c[p]);for(p=1;3>=p;p++){const C=w+p*B,E=this._X(C),F=this._Y(C),J=Math.abs(C3$jscomp$91.distanceTo(E,F,a,b)-e);J<n&&(n=J,k={x:E,y:F,t:C,distance:J},d=p);y.push({x:E,y:F,t:C,distance:J})}y.push(c[r]); c=y}while(25>l++);e&&n>g&&(k=null);return k}_CalculateLength(){this._initialized=!0;let a=this._X(0),b=this._Y(0),c=0;for(let d=1;d<=this._len;d++){const e=this._X(.01*d),g=this._Y(.01*d);c+=Math.hypot(a-e,b-g);this._arcLengths[d]=c;a=e;b=g}this._length=c}}; C3$jscomp$91.TimelineLineSegmentInfo=class{constructor(a,b,c){this._index=c;this._targetX=a.GetValueWithResultMode();this._targetY=b.GetValueWithResultMode();this._originY=this._originX=0}Release(){}GetType(){return"line"}GetIndex(){return this._index}SetOrigin(a,b){this._originX=a;this._originY=b}GetX(){return this._targetX+this._originX}GetY(){return this._targetY+this._originY}};"use strict";const C3$jscomp$92=self.C3; C3$jscomp$92.TimelineState=class extends C3$jscomp$92.DefendedBase{constructor(a,b,c){super();this._runtime=c.GetRuntime();this._timelineManager=c;this._timelineDataItem=b;this._name=a;this._tracks=[];this._tracksLength=0;this._beforeAndAfterTracks=null;this._beforeAndAfterTracksLength=0;this.CreateTrackStates();this._playResolve=this._playPromise=null;this._playheadTime=0;this._playbackRate=1;this._pingPongState=0;this._currentRepeatCount=1;this._initialStateSet=this._isScheduled=this._isPlaying= !1;this._complete=!0;this._markedForRemoval=this._released=!1;this._completedTick=-1;this._firstTick=this._finishedTriggers=this._isTemplate=this._implicitPause=!1;this._lastDelta=NaN;this._tags=[""];this._stringTags="";this._tagsChanged=!1;this._hasNestedContent=this._renderChange=0;this._iTimelineState=null}static CreateInitial(a,b){var c=b.GetTimelineDataManager();const d=c.GetNameId();c=c.Get(a[d]);a=C3$jscomp$92.New(C3$jscomp$92.TimelineState,a[d],c,b);a.SetIsTemplate(!0);return a}static CreateFromTemplate(a, b,c){return C3$jscomp$92.New(C3$jscomp$92.TimelineState,a,b,c)}Release(){if(!this.IsReleased()){var a=this._runtime.Dispatcher();this._timelineManager.DeScheduleTimeline(this);this._timelineManager.CompleteTimelineAndResolve(this);for(const b of this._tracks)b.Release();C3$jscomp$92.clearArray(this._tracks);this._timelineDataItem=this._timelineManager=this._runtime=this._tracks=null;this._released=!0;this._playResolve=this._playPromise=null;this.FireReleaseEvent(a)}}FireReleaseEvent(a){const b=C3$jscomp$92.New(C3$jscomp$92.Event, "timelinestatereleased");b.timelineState=this;a.dispatchEvent(b)}GetType(){return 0}CreateTrackStates(){for(const a of this._timelineDataItem.GetTrackData().trackDataItems())this._tracksLength=this._tracks.push(C3$jscomp$92.TrackState.Create(this,a))}GetTimelineManager(){return this._timelineManager}GetRuntime(){return this._runtime}GetTracks(){return this._tracks}GetSimilarPropertyTracks(a,b,c,d){if(this._hasNestedContent){var e;for(let k=0;k<this._tracks.length;k++){var g=this._tracks[k];a===g.GetInstance()&& (g=g.GetPropertyTrack(c))&&b.constructor===g.GetSourceAdapter().constructor&&g.GetResultMode()===d.GetResultMode()&&(e||(e=[]),e.push(g))}return e}}HasTracks(){return!!this._tracks.length}GetTrackById(a){for(const b of this._tracks)if(C3$jscomp$92.equalsNoCase(b.GetId(),a))return b;return null}GetTrackByName(a){for(const b of this._tracks)if(!b.IsInstanceTrack()&&C3$jscomp$92.equalsNoCase(b.GetName(),a))return b;return null}SetName(a){this._name=a}GetName(){return this._name}GetTimelineDataItem(){return this._timelineDataItem}GetTemplateName(){return this._timelineDataItem.GetName()}GetTotalTime(){return this._timelineDataItem.GetTotalTime()}SetTotalTime(a){this._timelineDataItem.SetTotalTime(a)}GetStep(){return this._timelineDataItem.GetStep()}SetStep(a){this._timelineDataItem.SetStep(a)}GetInterpolationMode(){return this._timelineDataItem.GetInterpolationMode()}SetInterpolationMode(a){this._timelineDataItem.SetInterpolationMode(a)}GetResultMode(){return this._timelineDataItem.GetResultMode()}SetResultMode(a){this._timelineDataItem.GetResultMode(a)}SetEase(a){for(const b of this.GetTracks())b.SetEase(a)}GetLoop(){return this._timelineDataItem.GetLoop()}SetLoop(a){return this._timelineDataItem.SetLoop(a)}GetPingPong(){return this._timelineDataItem.GetPingPong()}SetPingPong(a){return this._timelineDataItem.SetPingPong(a)}GetRepeatCount(){return this._timelineDataItem.GetRepeatCount()}SetRepeatCount(a){return this._timelineDataItem.SetRepeatCount(a)}SetPlaybackRate(a){return this._playbackRate= a}GetPlaybackRate(){return this._playbackRate}GetStartOnLayout(){return this._timelineDataItem.GetStartOnLayout()}GetTransformWithSceneGraph(){return this._timelineDataItem.GetTransformWithSceneGraph()}GetUseSystemTimescale(){return this._timelineDataItem.GetUseSystemTimescale()}IsForwardPlayBack(){return this.IsPlaying()?0<this._playbackRate:!0}GetPlayPromise(){return this._playPromise?this._playPromise:this._playPromise=new Promise(a=>{this._playResolve=a})}ResolvePlayPromise(){this._playPromise&& (this._playResolve(),this._playResolve=this._playPromise=null)}SetTags(a){this._tags=C3$jscomp$92.TimelineState._GetTagArray(a);this._tagsChanged=!0}GetTags(){return this._tags}GetStringTags(){this._tagsChanged&&(this._stringTags=this._tags.join(" "));this._tagsChanged=!1;return this._stringTags}HasTags(a){return this._tags&&this._tags.length?(a=C3$jscomp$92.TimelineState._GetTagArray(a))&&a.length?a.every(C3$jscomp$92.TimelineState._HasTag,this):!1:!1}OnStarted(){C3$jscomp$92.Plugins.Timeline&&this.constructor=== C3$jscomp$92.TimelineState&&(C3$jscomp$92.Plugins.Timeline.Cnds.PushTriggerTimeline(this),this._timelineManager.Trigger(C3$jscomp$92.Plugins.Timeline.Cnds.OnTimelineStarted),this._timelineManager.Trigger(C3$jscomp$92.Plugins.Timeline.Cnds.OnTimelineStartedByName),this._timelineManager.Trigger(C3$jscomp$92.Plugins.Timeline.Cnds.OnTimelineStartedByTags),this._timelineManager.Trigger(C3$jscomp$92.Plugins.Timeline.Cnds.OnAnyTimelineStarted),C3$jscomp$92.Plugins.Timeline.Cnds.PopTriggerTimeline())}OnCompleted(){this._completedTick= this._runtime.GetTickCount()}FinishTriggers(){this._finishedTriggers||(this._finishedTriggers=!0,C3$jscomp$92.Plugins.Timeline&&this.constructor===C3$jscomp$92.TimelineState&&(C3$jscomp$92.Plugins.Timeline.Cnds.PushTriggerTimeline(this),this._timelineManager.Trigger(C3$jscomp$92.Plugins.Timeline.Cnds.OnTimelineFinished),this._timelineManager.Trigger(C3$jscomp$92.Plugins.Timeline.Cnds.OnTimelineFinishedByName),this._timelineManager.Trigger(C3$jscomp$92.Plugins.Timeline.Cnds.OnTimelineFinishedByTags), this._timelineManager.Trigger(C3$jscomp$92.Plugins.Timeline.Cnds.OnAnyTimelineFinished),C3$jscomp$92.Plugins.Timeline.Cnds.PopTriggerTimeline()))}SetPlaying(a){this._isPlaying=a}IsCompletedTick(){return this._completedTick===this._runtime.GetTickCount()}IsPlaying(a=!1){return this.IsCompletedTick()||this.IsScheduled()&&!a?!0:this._isPlaying}_IsPlaying(){return this.IsPlaying(!0)}IsPaused(){return this._IsPaused()}_IsPaused(){return this.IsReleased()||this.IsScheduled()||this._IsPlaying()||this.IsComplete()? !1:!0}SetScheduled(a){this._isScheduled=a}IsScheduled(){return this._isScheduled}SetComplete(a){this._complete=a;a=this.GetTime();if(0>=a||a>=this.GetTotalTime())this._complete=!0}IsComplete(){return this._complete}IsReleased(){return this._released}SetMarkedForRemoval(a){this._markedForRemoval=a}IsMarkedForRemoval(){return this._markedForRemoval}SetImplicitPause(a){this._implicitPause=a}IsImplicitPause(){return this._implicitPause}SetIsTemplate(a){this._isTemplate=!!a}IsTemplate(){return this._isTemplate}InitialStateSet(){return this._initialStateSet}GetTime(){return this._playheadTime}SetTime(a){const b= this.GetTime();this._SetTime(a);this.SetComplete(!1);this.IsComplete()||this.SetImplicitPause(!0);if(this._IsPlaying()||this.IsScheduled()||!this._initialStateSet)this._IsPlaying()||this.IsScheduled()||this._initialStateSet?this._IsPlaying()?this.Stop():this.IsScheduled()&&(this._timelineManager.DeScheduleTimeline(this),this.SetInitialStateFromSetTime()):this.SetInitialStateFromSetTime();this._SetUpdateStateBefore();this._Interpolate(this.GetTime(),!1,!0,!0,b);this._SetUpdateStateAfter();this._renderChange&& this.GetRuntime().UpdateRender();this._OnSetTime()}_SetTime(a){C3$jscomp$92.IsFiniteNumber(a)||(a=this.GetTotalTime());0>a?this._playheadTime=0:a>=this.GetTotalTime()?this._playheadTime=this.GetTotalTime():this._playheadTime=a}_SetTimeAndReset(a){C3$jscomp$92.IsFiniteNumber(a)||(a=this.GetTotalTime());0>a?this._playheadTime=0:a>=this.GetTotalTime()?this._playheadTime=this.GetTotalTime():this._playheadTime=a;for(const b of this._tracks)b.SetResetState()}_OnSetTime(){C3$jscomp$92.Plugins.Timeline&& this.constructor===C3$jscomp$92.TimelineState&&(C3$jscomp$92.Plugins.Timeline.Cnds.PushTriggerTimeline(this),this._timelineManager.Trigger(C3$jscomp$92.Plugins.Timeline.Cnds.OnTimeSet),this._timelineManager.Trigger(C3$jscomp$92.Plugins.Timeline.Cnds.OnTimeSetByName),this._timelineManager.Trigger(C3$jscomp$92.Plugins.Timeline.Cnds.OnTimeSetByTags),C3$jscomp$92.Plugins.Timeline.Cnds.PopTriggerTimeline())}_CanResume(){if(!this.GetLoop())if(this.GetPingPong()&&1===this._pingPongState)if(this.IsForwardPlayBack()){if(this.GetTime()>= this.GetTotalTime())return!1}else{if(0>=this.GetTime())return!1}else if(!this.GetLoop()&&!this.GetPingPong())if(this.IsForwardPlayBack()){if(this.GetTime()>=this.GetTotalTime())return!1}else if(0>=this.GetTime())return!1;return!0}Resume(){this.IsReleased()||this._CanResume()&&this.Play(!0)}Play(a=!1){return this.IsReleased()||this.IsScheduled()?!1:this._IsPlaying()&&this.IsCompletedTick()?this._SchedulePlayingTimeline():this._IsPlaying()||!this.IsComplete()&&!a&&!this.IsImplicitPause()?!1:this._ScheduleStoppedTimeline()}_SchedulePlayingTimeline(){this.SetImplicitPause(!1); this._timelineManager.RemovePlayingTimeline(this);this._timelineManager.ScheduleTimeline(this);this.GetPlayPromise();return!0}_ScheduleStoppedTimeline(){this.SetImplicitPause(!1);this._timelineManager.ScheduleTimeline(this);this.GetPlayPromise();return!0}Stop(a=!1){this.IsReleased()||(this.SetComplete(a),this._timelineManager.CompleteTimeline(this),this.IsComplete()&&this.ResolvePlayPromise())}Reset(a=!0,b=!1){if(!this.IsReleased()){if(!this._IsPlaying()&&this.IsScheduled())return this._timelineManager.DeScheduleTimeline(this); if(!this.IsComplete()){this.Stop(!0);this.IsForwardPlayBack()?this._SetTime(0):this._SetTime(this.GetTotalTime());var c=this.GetTime();this._SetUpdateStateBefore();b?this._InterpolateBeforeChangeLayout(c):this._Interpolate(c,!1,!1,!0);a&&this._OnSetTime();this._SetUpdateStateAfter();this._renderChange&&a&&this.GetRuntime().UpdateRender()}}}ResetBeforeChangeLayout(){this.Reset(!1,!0)}_InterpolateBeforeChangeLayout(a){this._Interpolate(a,!1,!1,!0,NaN,!1,!0)}_OnBeforeChangeLayout(){if(this.IsReleased())return!0; if(!this.GetRuntime().IsLoadingState()&&this.HasValidGlobalTracks())return!1;this._timelineManager.CompleteTimelineBeforeChangeOfLayout(this);this.GetRuntime().IsLoadingState()||this.ResetBeforeChangeLayout();return!0}SetInitialStateFromSetTime(){this.SetInitialState(!0)}SetInitialState(a){if(!this.IsMarkedForRemoval()){if(a){this._finishedTriggers=!1;this._firstTick=this._initialStateSet=!0;this._SetUpdateStateBefore();for(const b of this._tracks)b.SetInitialState()}else if(this.SetPlaying(!0),this.SetScheduled(!1), this.OnStarted(),this.IsComplete()){this._completedTick=-1;0!==this._pingPongState&&(this._playbackRate=Math.abs(this._playbackRate));this._pingPongState=0;this._currentRepeatCount=1;this._finishedTriggers=this._complete=!1;this._firstTick=this._initialStateSet=!0;this.IsForwardPlayBack()?this._SetTime(0):this._SetTime(this.GetTotalTime());this._SetUpdateStateBefore();for(const b of this._tracks)b.SetInitialState()}else{this._firstTick=!0;this._finishedTriggers=!1;this._SetUpdateStateBefore();for(const b of this._tracks)b.SetResumeState()}this._SetUpdateStateAfter()}}GetRenderChange(){return this._renderChange}_SetUpdateStateBefore(){this._hasNestedContent= 0;for(const a of this._tracks)a.IsNested()&&(this._hasNestedContent=1)}_SetUpdateStateAfter(){this._renderChange=0;for(const a of this._tracks)a._SetUpdateState(),0===this._renderChange&&1===a.GetRenderChange()&&(this._renderChange=1),this._beforeAndAfterTracks||1!==a.GetNeedsBeforeAndAfter()||(this._beforeAndAfterTracks||(this._beforeAndAfterTracks=[]),this._beforeAndAfterTracksLength=this._beforeAndAfterTracks.push(a))}Tick(a,b,c){if(this.GetUseSystemTimescale()){if(0===a&&0===this._lastDelta)return; this._lastDelta=a}else{if(0===c&&0===this._lastDelta)return;a=this._lastDelta=c;b=1}c=this._playheadTime;b=c+a*b*this._playbackRate;a=this._timelineDataItem._totalTime;this._playheadTime=0>b?0:b>=a?a:b;var d=!1;b=!1;var e=this.GetLoop(),g=this.GetPingPong();e||g?e&&!g?0<this._playbackRate?this._playheadTime>=a&&(this._SetTimeAndReset(0),b=!0):0>=this._playheadTime&&(this._SetTimeAndReset(a),b=!0):!e&&g?0<this._playbackRate?this._playheadTime>=a&&(this._SetTime(a),this.SetPlaybackRate(-1*this.GetPlaybackRate()), b=!0,1===this._pingPongState?this._currentRepeatCount<this.GetRepeatCount()?(this._currentRepeatCount++,this._pingPongState=0):d=!0:0===this._pingPongState&&(this._pingPongState=1)):0>=this._playheadTime&&(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,1===this._pingPongState?this._currentRepeatCount<this.GetRepeatCount()?(this._currentRepeatCount++,this._pingPongState=0):d=!0:0===this._pingPongState&&(this._pingPongState=1)):e&&g&&(0<this._playbackRate?this._playheadTime>= a&&(this._SetTime(a),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,this._pingPongState++,C3$jscomp$92.wrap(this._pingPongState,0,2)):0>=this._playheadTime&&(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,this._pingPongState++,C3$jscomp$92.wrap(this._pingPongState,0,2))):0<this._playbackRate?this._playheadTime>=a&&(this._currentRepeatCount<this.GetRepeatCount()?(this._currentRepeatCount++,this._SetTimeAndReset(0),b=!0):(this._SetTime(a),d=!0)):0>=this._playheadTime&&(this._currentRepeatCount< this.GetRepeatCount()?(this._currentRepeatCount++,this._SetTimeAndReset(a),b=!0):(this._SetTime(0),d=!0));e=this._tracksLength;if(d){for(d=0;d<e;d++)this._tracks[d].SetEndState();this.Stop(!0);this.OnCompleted()}else{g=this._beforeAndAfterTracksLength;for(d=0;d<g;d++)this._beforeAndAfterTracks[d].BeforeInterpolate();if(1===this._hasNestedContent)for(d=0;d<e;d++){const k=this._tracks[d],l=k.GetStartOffset(),n=c-l;0>this._playheadTime-l&&0<n?(this._playheadTime=0>l?0:l>=a?a:l,k.Interpolate(l,!0,!1, b,this._firstTick,!1)):k.Interpolate(this._playheadTime,!0,!1,b,this._firstTick,!1)}else for(d=0;d<e;d++)this._tracks[d].Interpolate(this._playheadTime,!0,!1,b,this._firstTick,!1);for(d=0;d<g;d++)this._beforeAndAfterTracks[d].AfterInterpolate();this._firstTick&&(this._firstTick=!1)}}_Interpolate(a,b=!1,c=!1,d=!1,e=NaN,g=!1,k=!1){for(var l of this._tracks)l.BeforeInterpolate();for(const n of this._tracks){l=a;if("number"===typeof e&&!isNaN(e)){const p=this.GetTime()-n.GetStartOffset(),r=e-n.GetStartOffset(); 0>p&&0<r&&(l=n.GetStartOffset(),this._SetTime(l))}n.Interpolate(l,b,c,d,this._firstTick,k)}for(const n of this._tracks)n.AfterInterpolate();this._firstTick&&g&&(this._firstTick=!1)}AddTrack(){var a=this._timelineDataItem.GetTrackData().AddEmptyTrackDataItem();a=C3$jscomp$92.TrackState.Create(this,a);this._tracksLength=this._tracks.push(a);return a}Removed(){if(!this.IsReleased())for(const a of this._tracks)a.TimelineRemoved()}CleanCaches(){for(const a of this._tracks)a.CleanCaches()}ClearTrackInstances(){for(const a of this._tracks)a.ClearInstance()}SetTrackInstance(a, b){if(b)for(const c of this._tracks)if(c.IsInstanceTrack()){if(a){if(c.GetId()!==a)continue}else if(c.HasInstance())continue;c.SetInstance(b);this._timelineManager.SetTimelineObjectClassToMap(b.GetObjectClass(),this);break}}HasTrackInstance(a,b){for(const c of this._tracks)if(c.IsInstanceTrack())if(b){if(b===c.GetId()&&a===c.GetInstance())return!0}else if(a===c.GetInstance())return!0;return!1}HasValidTracks(){return this._tracks.some(a=>a.IsInstanceTrack()?a.CanInstanceBeValid():!0)}HasValidGlobalTracks(){return this._tracks.some(a=> a.IsInstanceTrack()?a.CanInstanceBeValid()?(a=a.GetObjectClass())?a.IsGlobal():!1:!1:!1)}GetPropertyTrack(a){for(const b of this.GetTracks())for(const c of b.GetPropertyTracks())if(c.GetPropertyName()===a)return c}GetTrackFromInstance(a){for(const b of this._tracks)if(a===b.GetInstance())return b;return null}GetKeyframeWithTags(a){a=a?a.split(" "):[];a=[...(new Set(a.map(b=>b.toLowerCase().trim()))).values()];for(const b of this.GetTracks())for(const c of b.GetKeyframeDataItems())if(a.every(d=>c.HasTag(d)))return c}GetObjectClasses(){const a= [];for(const b of this.GetTracks())a.push(b.GetObjectClass());return a.filter(b=>b)}_SaveToJson(){return{tracksJson:this._SaveTracksToJson(),name:this._name,playheadTime:this.GetTime(),playbackRate:this._playbackRate,pingPongState:this._pingPongState,currentRepeatCount:this._currentRepeatCount,isPlaying:this._isPlaying,isScheduled:this._isScheduled,initialStateSet:this._initialStateSet,finishedTriggers:this._finishedTriggers,complete:this._complete,released:this._released,markedForRemoval:this._markedForRemoval, completedTick:this._completedTick,implicitPause:this._implicitPause,isTemplate:this._isTemplate,tags:this._tags.join(" "),stringTags:this._stringTags,tagsChanged:this._tagsChanged,firstTick:this._firstTick}}_LoadFromJson(a){a&&(this._LoadTracksFromJson(a.tracksJson),this._name=a.name,this._playheadTime=a.playheadTime,this._playbackRate=a.playbackRate,this._pingPongState=a.pingPongState,this._currentRepeatCount=a.currentRepeatCount,this._isPlaying=!!a.isPlaying,this._isScheduled=!!a.isScheduled,this._initialStateSet= !!a.initialStateSet,this._finishedTriggers=a.hasOwnProperty("finishedTriggers")?!!a.finishedTriggers:!1,this._complete=!!a.complete,this._released=!!a.released,this._markedForRemoval=!!a.markedForRemoval,this._completedTick=a.completedTick,this._implicitPause=!!a.implicitPause,this._isTemplate=!!a.isTemplate,this._tags=a.tags.split(" "),this._stringTags=a.stringTags,this._tagsChanged=!!a.tagsChanged,this._firstTick=!!a.firstTick)}_SaveTracksToJson(){return this._tracks.map(a=>a._SaveToJson())}_LoadTracksFromJson(a){this.ClearTrackInstances(); a.forEach((b,c)=>{this._tracks[c]._LoadFromJson(b)});this._tracks.filter(b=>b.CanInstanceBeValid())}static _HasTag(a){const b=this.GetTags();return""===a?1===b.length&&""===b[0]:b.map(c=>c.toLowerCase()).includes(a.toLowerCase())}static _GetTagArray(a){if(C3$jscomp$92.IsArray(a))return a.slice(0);if(C3$jscomp$92.IsString(a))return a.split(" ");throw Error("invalid tags");}GetITimelineState(){this._iTimelineState||(this._iTimelineState=C3$jscomp$92.New(self.ITimelineState,this));return this._iTimelineState}}; "use strict";const C3$jscomp$93=self.C3; C3$jscomp$93.TrackState=class extends C3$jscomp$93.DefendedBase{constructor(a,b){super();this._timeline=a;this._trackDataItem=b;this._trackData=b.GetTrackData();this._objectClassIndex=this._instanceUid=NaN;this._worldInfo=this._instance=null;this._isNested=0<b.GetStartOffset();this._endStateOfNestedSet=this._initialStateOfNestedSet=!1;this._lastKeyframeDataItem=null;this._keyframeDataItems=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemArray();this._propertyTracks=[];this.CreatePropertyTrackStates(); this._needsBeforeAndAfter=this._renderChange=this._worldInfoChange=0}static Create(a,b){return C3$jscomp$93.New(C3$jscomp$93.TrackState,a,b)}Release(){this._keyframeDataItems=null;for(const a of this._propertyTracks)a.Release();C3$jscomp$93.clearArray(this._propertyTracks);this._lastKeyframeDataItem=this._trackDataItem=this._worldInfo=this._instance=this._timeline=this._propertyTracks=null}CreatePropertyTrackStates(){for(const a of this._trackDataItem.GetPropertyTrackData().propertyTrackDataItems())this._propertyTracks.push(C3$jscomp$93.PropertyTrackState.Create(this, a))}TimelineRemoved(){for(const a of this._propertyTracks)a.TimelineRemoved()}CleanCaches(){for(const a of this._propertyTracks)a.CleanCaches();this._worldInfo=this._instance=null}GetTimeline(){return this._timeline}GetRuntime(){return this._timeline.GetRuntime()}GetKeyframeDataItems(){return this._keyframeDataItems?this._keyframeDataItems:this._keyframeDataItems=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemArray()}GetPropertyTracks(){return this._propertyTracks}GetPropertyTrack(a){for(let b= 0;b<this._propertyTracks.length;b++){const c=this._propertyTracks[b];if(c.GetPropertyName()===a)return c}}MaybeGetInstance(){this._instance||this.GetInstance()}IsInstanceValid(){return this._instance?!this._instance.IsDestroyed():!1}CanInstanceBeValid(){if(!this.IsInstanceTrack())return!1;var a=this.GetInstanceUID();return(a=this.GetRuntime().GetInstanceByUID(a))?!a.IsDestroyed():!1}GetObjectClass(){if(this.IsInstanceTrack()){var a=this.GetObjectClassIndex();if(-1!==a)return this.GetRuntime().GetObjectClassByIndex(a)}}ClearInstance(){this._instance= null;this._instanceUid=-1;this._worldInfo=null;this._objectClassIndex=-1}HasInstance(){return!!this._instance}GetInstance(){if(this._instance&&this.IsInstanceValid())return this._instance;const a=this.GetInstanceUID();return this._instance=this.GetRuntime().GetInstanceByUID(a)}SetInstance(a){if(this._instance!==a){this.CleanCaches();this._instance=a;this._objectClassIndex=a.GetObjectClass().GetIndex();this._instanceUid=a.GetUID();this._worldInfo=a.GetWorldInfo();for(const g of this.propertyTrackItems()){const k= g.sourceAdapter;switch(g.propertyTrack.GetSourceAdapterId()){case "instance-variable":k.GetEditorIndex();var b=a.GetObjectClass(),c=b.GetInstanceVariableIndexByName(g.name),d=b.GetInstanceVariableName(c);b=b.GetInstanceVariableType(c);d===g.name&&b===g.type&&k.UpdateInstanceVariableIndex(c);break;case "behavior":var e=g.behaviorType;c=this.GetObjectClass();d=a.GetObjectClass();b=k.GetBehaviorType(d);e&&b&&(e=e.GetName(),c.GetBehaviorIndexByName(e),d.GetBehaviorIndexByName(e),k.GetEditorIndex(),k.UpdateBehaviorTypeSid(b.GetSID()))}}}}*propertyTrackItems(){for(const c of this._propertyTracks){var a= c.GetSourceAdapter(),b=this.GetObjectClass();const d={propertyTrack:c,sourceAdapter:a};switch(c.GetSourceAdapterId()){case "world-instance":d.property=c.GetPropertyName();break;case "instance-variable":a=a.GetEditorIndex();d.name=b.GetInstanceVariableName(a);d.type=b.GetInstanceVariableType(a);break;case "effect":b=b.GetEffectList();a=a.GetEffectType(b);d.effectType=a;break;case "behavior":a=a.GetBehaviorType(b);d.behaviorType=a;break;case "plugin":d.plugin=b.GetPlugin()}yield d}}GetWorldInfo(){if(this._worldInfo&& this.IsInstanceValid())return this._worldInfo;const a=this.GetInstance();a&&(this._worldInfo=a.GetWorldInfo());return this._worldInfo}GetTrackDataItem(){return this._trackDataItem}GetInstanceUID(){return this._instanceUid?this._instanceUid:this._trackDataItem.GetInstanceUID()}SetInstanceUID(a){this._trackDataItem.SetInstanceUID(a)}GetInterpolationMode(){return this._trackDataItem.GetInterpolationMode()}SetInterpolationMode(a){this._trackDataItem.SetInterpolationMode(a)}GetResultMode(){return this._trackDataItem.GetResultMode()}GetId(){return this._trackDataItem.GetId()}GetStartOffset(){return this._trackDataItem.GetStartOffset()}GetLocalTotalTime(){return this._trackDataItem.GetLocalTotalTime()}SetLocalTotalTime(a){this._trackDataItem.SetLocalTotalTime(a)}SetResultMode(a){this._trackDataItem.SetResultMode(a)}SetEase(a){for(const b of this.GetKeyframeDataItems())b.SetEase(a); for(const b of this.GetPropertyTracks())b.SetEase(a)}GetEnable(){return this._trackDataItem.GetEnable()}SetEnable(a){this._trackDataItem.SetEnable(a)}GetObjectClassIndex(){return isNaN(this._objectClassIndex)?this._trackDataItem.GetObjectClassIndex():this._objectClassIndex}SetObjectClassIndex(a){this._trackDataItem.SetObjectClassIndex(a)}SetOriginalWidth(a){this._trackDataItem.SetOriginalWidth(a)}GetOriginalWidth(){const a=this.GetInstance();return a&&a.GetSdkInstance().IsOriginalSizeKnown()?a.GetSdkInstance().GetOriginalWidth(): this._trackDataItem.GetOriginalWidth()}SetOriginalHeight(a){this._trackDataItem.SetOriginalHeight(a)}GetOriginalHeight(){const a=this.GetInstance();return a&&a.GetSdkInstance().IsOriginalSizeKnown()?a.GetSdkInstance().GetOriginalHeight():this._trackDataItem.GetOriginalHeight()}GetType(){return this._trackDataItem.GetType()}GetName(){return this._trackDataItem.GetName()}IsInstanceTrack(){return 0===this.GetType()}IsValueTrack(){return 1===this.GetType()}IsAudioTrack(){return 2===this.GetType()}GetWorldInfoChange(){return this._worldInfoChange}GetRenderChange(){return this._renderChange}GetNeedsBeforeAndAfter(){return this._needsBeforeAndAfter}IsNested(){return this._isNested}SetResetState(){for(const a of this._propertyTracks)a.SetResetState()}SetInitialState(){this.MaybeGetInstance(); if(this.IsInstanceValid()||!this.IsInstanceTrack()){var a=this.GetTimeline().IsForwardPlayBack()?0:this.GetLocalTotalTime();for(const b of this._propertyTracks)b.SetInitialState(a),0===this._worldInfoChange&&1===b.GetWorldInfoChange()&&(this._worldInfoChange=1),0===this._renderChange&&1===b.GetRenderChange()&&(this._renderChange=1);this._needsBeforeAndAfter=0;this._propertyTracks.some(b=>b.GetNeedsBeforeAndAfter())&&(this._needsBeforeAndAfter=1);this._lastKeyframeDataItem=this._GetLastKeyFrameBeforeTime(a); this._endStateOfNestedSet=this._initialStateOfNestedSet=!1;this.Interpolate(a);this.OnKeyframeReached(this._GetLastKeyFrameBeforeTime(a))}}SetResumeState(){this.MaybeGetInstance();if(this.IsInstanceValid()||!this.IsInstanceTrack()){this._timeline.IsForwardPlayBack();var a=this._timeline.GetTime()-this.GetStartOffset();this._lastKeyframeDataItem=this._GetLastKeyFrameBeforeTime(a);for(const b of this._propertyTracks)b.SetResumeState(a)}}SetEndState(){if(!(this.GetTimeline().IsComplete()||(this.MaybeGetInstance(), !this.IsInstanceValid()&&this.IsInstanceTrack()||this._isNested))){const a=this._timeline.GetTime(),b=this.GetStartOffset()+this.GetLocalTotalTime();a>=b?this.Interpolate(this.GetLocalTotalTime(),!0,!1,!0,!1,!1,!0):0>=a&&this.Interpolate(0,!0,!1,!0,!1,!1,!0)}}_SetUpdateState(){for(let a=0,b=this._propertyTracks.length;a<b;a++){const c=this._propertyTracks[a];c._SetUpdateState();0===this._worldInfoChange&&1===c.GetWorldInfoChange()&&(this._worldInfoChange=1);0===this._renderChange&&1===c.GetRenderChange()&& (this._renderChange=1)}}BeforeInterpolate(){const a=this._propertyTracks.length;for(let b=0;b<a;b++)this._propertyTracks[b].BeforeInterpolate()}Interpolate(a,b=!1,c=!1,d=!1,e=!1,g=!1,k=!1){this._instance||this.GetInstance();const l=this._instance&&!this._instance.IsDestroyed(),n=0===this._trackDataItem._type;if(!(!l&&n||g&&n&&this.GetObjectClass().IsGlobal()||(a-=this.GetStartOffset(),0>a))){this.MaybeSetInitialStateOfNestedTrack(a,b);this.MaybeTriggerKeyframeReachedConditions(a,b,e);for(let p=0, r=this._propertyTracks.length;p<r;p++)this._propertyTracks[p].Interpolate(a,c,d,k);this.MaybeSetEndStateOfNestedTrack(a,b);0!==this._worldInfoChange&&(this._worldInfo||(this._worldInfo=this._instance.GetWorldInfo()),this._worldInfo&&this._worldInfo.SetBboxChanged())}}AfterInterpolate(){const a=this._propertyTracks.length;for(let b=0;b<a;b++)this._propertyTracks[b].AfterInterpolate()}MaybeSetInitialStateOfNestedTrack(a,b){if(b&&this._isNested&&!this._initialStateOfNestedSet){if(this.GetTimeline().IsForwardPlayBack()){if(0> a)return}else if(a>this.GetLocalTotalTime())return;for(const c of this._propertyTracks)c.SetInitialState();this._initialStateOfNestedSet=!0}}MaybeSetEndStateOfNestedTrack(a,b){if(b&&this._isNested&&!this._endStateOfNestedSet)if(this.GetTimeline().IsForwardPlayBack()){if(a>=this.GetLocalTotalTime()){for(const c of this._propertyTracks)c.Interpolate(this.GetLocalTotalTime(),!1,!0);this._endStateOfNestedSet=!0}}else if(0>=a){for(const c of this._propertyTracks)c.Interpolate(0,!1,!0);this._endStateOfNestedSet= !0}}MaybeTriggerKeyframeReachedConditions(a,b,c){if(!c&&b&&C3$jscomp$93.Plugins.Timeline){b=this.GetTimeline();c=this._lastKeyframeDataItem.GetNext();var d=this._lastKeyframeDataItem.GetTime(),e=c?c.GetTime():b.GetTotalTime();if(a<=d||a>=e)this._lastKeyframeDataItem=this._trackData.GetFirstKeyFrameDataItemLowerOrEqualThan(a,this._trackDataItem),b.IsForwardPlayBack()?c&&this.OnKeyframeReached(this._lastKeyframeDataItem):(a=this._lastKeyframeDataItem.GetNext())&&this.OnKeyframeReached(a)}}_GetLastKeyFrameBeforeTime(a){const b= this._trackData.GetKeyFrameDataItemAtTime(a,this._trackDataItem);return b?b:this._trackData.GetFirstKeyFrameDataItemLowerOrEqualThan(a,this._trackDataItem)}OnKeyframeReached(a){const b=this.GetTimeline(),c=b.GetTimelineManager();C3$jscomp$93.Plugins.Timeline.Cnds.PushTriggerTimeline(b);C3$jscomp$93.Plugins.Timeline.Cnds.PushTriggerKeyframe(a);c.Trigger(C3$jscomp$93.Plugins.Timeline.Cnds.OnAnyKeyframeReached);c.Trigger(C3$jscomp$93.Plugins.Timeline.Cnds.OnKeyframeReached);C3$jscomp$93.Plugins.Timeline.Cnds.PopTriggerTimeline(b); C3$jscomp$93.Plugins.Timeline.Cnds.PopTriggerKeyframe(a)}AddKeyframe(){return this._trackDataItem.GetKeyframeData().AddEmptyKeyframeDataItem()}AddPropertyTrack(){var a=this._trackDataItem.GetPropertyTrackData().AddEmptyPropertyTrackDataItem();a=C3$jscomp$93.PropertyTrackState.Create(this,a);this._propertyTracks.push(a);return a}DeleteKeyframes(a){this._trackDataItem.GetKeyframeData().DeleteKeyframeDataItems(a)}DeletePropertyKeyframes(a){for(const b of this._propertyTracks)b.DeletePropertyKeyframes(a)}SaveState(){for(const a of this._propertyTracks)a.SaveState()}CompareInitialStateWithCurrent(){this.MaybeGetInstance(); if(this.IsInstanceValid()||!this.IsInstanceTrack())for(const a of this._propertyTracks)a.CompareInitialStateWithCurrent()}CompareSaveStateWithCurrent(){this.MaybeGetInstance();if(this.IsInstanceValid()||!this.IsInstanceTrack()){var a=!1;for(const b of this._propertyTracks){const c=b.CompareSaveStateWithCurrent();!a&&c&&(a=!0)}a&&(a=this.AddKeyframe(),a.SetTime(this.GetTimeline().GetTime()),a.SetEase("noease"),a.SetEnable(!0),a.SetTags(""))}}_SaveToJson(){var a=this.GetInstance();a=a?a.GetUID():this.GetInstanceUID(); return{propertyTracksJson:this._SavePropertyTracksToJson(),lastKeyframeDataItemJson:this._SaveLastKeyframeDataItemToJson(),initialStateOfNestedSet:this._initialStateOfNestedSet,endStateOfNestedSet:this._endStateOfNestedSet,instanceUid:a}}_LoadFromJson(a){if(a){this._LoadPropertyTracksFromJson(a.propertyTracksJson);this._LoadLastKeyframeDataItemFromJson(a.lastKeyframeDataItemJson);this._LoadInstanceFromJson(a.instanceUid);this._initialStateOfNestedSet=!1;a.hasOwnProperty.initialStateOfNestedSet&&(this._initialStateOfNestedSet= a.initialStateOfNestedSet);this._endStateOfNestedSet=!1;a.hasOwnProperty.endStateOfNestedSet&&(this._endStateOfNestedSet=a.endStateOfNestedSet);for(const b of this._propertyTracks)0===this._worldInfoChange&&1===b.GetWorldInfoChange()&&(this._worldInfoChange=1),0===this._renderChange&&1===b.GetRenderChange()&&(this._renderChange=1);this._needsBeforeAndAfter=0;this._propertyTracks.some(b=>b.GetNeedsBeforeAndAfter())&&(this._needsBeforeAndAfter=1)}}_SaveLastKeyframeDataItemToJson(){return this._trackDataItem.GetKeyframeData().GetKeyframeDataItemIndex(this._lastKeyframeDataItem)}_SavePropertyTracksToJson(){return this._propertyTracks.map(a=> a._SaveToJson())}_LoadPropertyTracksFromJson(a){a.forEach((b,c)=>{this._propertyTracks[c]._LoadFromJson(b)})}_LoadInstanceFromJson(a){C3$jscomp$93.IsFiniteNumber(a)&&(a=this.GetRuntime().GetInstanceByUID(a))&&this.GetTimeline().SetTrackInstance(this._trackDataItem.GetId(),a)}_LoadLastKeyframeDataItemFromJson(a){this._lastKeyframeDataItem=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemFromIndex(a)}};"use strict";const C3$jscomp$94=self.C3; C3$jscomp$94.PropertyTrackState=class extends C3$jscomp$94.DefendedBase{constructor(a,b){super();this._track=a;this._propertyTrackDataItem=b;this._propertyTrackData=b.GetPropertyTrackData();this._needsBeforeAndAfter=this._renderChange=this._worldInfoChange=0;this._sourceAdapter=this.GetSourceAdapter();this._propertyKeyframeDataItems=this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();this._absoluteValueObject=this._lastPropertyKeyframeDataItem=null}static Create(a, b){return C3$jscomp$94.New(C3$jscomp$94.PropertyTrackState,a,b)}Release(){this._track=null;this._sourceAdapter&&(this._sourceAdapter.Release(),this._sourceAdapter=null);this._propertyTrackData=this._propertyTrackDataItem=this._propertyKeyframeDataItems=null}GetWorldInfoChange(){return this._worldInfoChange}GetRenderChange(){return this._renderChange}GetNeedsBeforeAndAfter(){return this._needsBeforeAndAfter}HasAbsoluteValueObject(){return!!this._absoluteValueObject}SetAbsoluteValueObject(a){this._absoluteValueObject= a}GetAbsoluteValueObject(){return this._absoluteValueObject}GetTrack(){return this._track}GetPropertyTrackDataItem(){return this._propertyTrackDataItem}GetPropertyTrackData(){return this._propertyTrackData}GetTimeline(){return this._track.GetTimeline()}GetRuntime(){return this._track.GetRuntime()}GetInstance(){return this._track.GetInstance()}GetSourceAdapter(){if(this._sourceAdapter)return this._sourceAdapter;let a;switch(this._propertyTrackDataItem.GetSourceAdapterId()){case "behavior":a=new C3$jscomp$94.PropertyTrackState.BehaviorSourceAdapter(this); break;case "effect":a=new C3$jscomp$94.PropertyTrackState.EffectSourceAdapter(this);this._renderChange=1;break;case "instance-variable":a=new C3$jscomp$94.PropertyTrackState.InstanceVariableSourceAdapter(this);break;case "plugin":a=new C3$jscomp$94.PropertyTrackState.PluginSourceAdapter(this);this._renderChange=1;break;case "world-instance":a=new C3$jscomp$94.PropertyTrackState.PropertySourceAdapter(this);this._worldInfoChange=this._renderChange=1;break;case "value":a=new C3$jscomp$94.PropertyTrackState.ValueSourceAdapter(this); break;case "audio":a=new C3$jscomp$94.PropertyTrackState.AudioSourceAdapter(this)}return this._sourceAdapter=a}GetSourceAdapterId(){return this._propertyTrackDataItem.GetSourceAdapterId()}SetSourceAdapterId(a){this._propertyTrackDataItem.SetSourceAdapterId(a)}GetSourceAdapterArgs(){return this._propertyTrackDataItem.GetSourceAdapterArguments()}SetSourceAdapterArgs(a){this._propertyTrackDataItem.SetSourceAdapterArguments(a)}GetSourceAdapterValue(){return this.GetSourceAdapter().GetValue()}GetPropertyName(){return this._propertyTrackDataItem.GetProperty()}SetPropertyName(a){this._propertyTrackDataItem.SetProperty(a)}GetPropertyType(){return this._propertyTrackDataItem.GetType()}SetPropertyType(a){this._propertyTrackDataItem.SetType(a)}GetPropertyKeyframeType(){return this.GetPropertyTrackData().GetFirstPropertyKeyframeDataItem(this._propertyTrackDataItem).GetType()}GetMin(){return this._propertyTrackDataItem.GetMin()}SetMin(a){this._propertyTrackDataItem.SetMin(a)}GetMax(){return this._propertyTrackDataItem.GetMax()}SetMax(a){this._propertyTrackDataItem.SetMax(a)}GetEnable(){return this._propertyTrackDataItem.GetEnable()}SetEnable(a){this._propertyTrackDataItem.SetEnable(a)}GetInterpolationMode(){return this._propertyTrackDataItem.GetInterpolationMode()}SetInterpolationMode(a){this._propertyTrackDataItem.SetInterpolationMode(a)}GetResultMode(){return this._propertyTrackDataItem.GetResultMode()}SetResultMode(a){this._propertyTrackDataItem.SetResultMode(a)}SetEase(a){for(const b of this.GetPropertyKeyframeDataItems())b.SetEase(a)}CanHavePropertyKeyframes(){return this._propertyTrackDataItem.CanHavePropertyKeyframes()}GetPropertyKeyframeDataItems(){return this._propertyKeyframeDataItems? this._propertyKeyframeDataItems:this._propertyKeyframeDataItems=this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray()}GetPropertyKeyframeDataItemArrayIncludingDisabled(){return this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArrayIncludingDisabled()}GetPropertyKeyFrameDataItemAtTime(a){return this._propertyTrackData.GetPropertyKeyFrameDataItemAtTime(a,this._propertyTrackDataItem)}GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a){return this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a, this._propertyTrackDataItem)}GetPropertyKeyframeDataItemPairForTime(a){let b=this._propertyTrackData.GetPropertyKeyFrameDataItemAtTime(a,this._propertyTrackDataItem);b?a=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherThan(a,this._propertyTrackDataItem):(b=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem),a=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(a,this._propertyTrackDataItem));return{start:b,end:a}}*GetPropertyKeyframeValues(){for(const a of this.GetPropertyKeyframeDataItems())yield a.GetValueWithResultMode()}*GetPropertyKeyframeTimes(){for(const a of this.GetPropertyKeyframeDataItems())yield a.GetTime()}TimelineRemoved(){this.GetSourceAdapter().TimelineRemoved()}CleanCaches(){this.GetSourceAdapter().CleanCaches()}GetCurrentState(){return this.GetSourceAdapter().GetCurrentState()}SetResetState(){this.GetSourceAdapter().SetResetState()}SetInitialState(a){this.GetSourceAdapter().SetInitialState(); this._lastPropertyKeyframeDataItem=this._GetLastPropertyKeyFrameBeforeTime(a);this._SetUpdateState()}SetResumeState(a){this.GetSourceAdapter().SetResumeState();this._lastPropertyKeyframeDataItem=this._GetLastPropertyKeyFrameBeforeTime(a)}_SetUpdateState(){var a=this.GetTrack();this._needsBeforeAndAfter=0;if(a.IsInstanceTrack()){var b=this.GetTimeline();a=a.GetInstance();const c=this.GetSourceAdapter(),d=this.GetPropertyName();c.MayNeedBeforeAndAfterInterpolate()?(b=b.GetSimilarPropertyTracks(a,c, d,this))&&b.length&&(this._needsBeforeAndAfter=1):this._needsBeforeAndAfter=0}}_GetLastPropertyKeyFrameBeforeTime(a){const b=this.GetTimeline(),c=this._propertyTrackData.GetPropertyKeyFrameDataItemAtTime(a,this._propertyTrackDataItem);return c?c:b.IsForwardPlayBack()?this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem):this._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(a,this._propertyTrackDataItem)}BeforeInterpolate(){this._sourceAdapter.BeforeInterpolate()}Interpolate(a, b=!1,c=!1,d=!1){let e,g=!1;if(b)var k=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem);else{if(this._lastPropertyKeyframeDataItem){var l=this.GetTimeline();const n=this._lastPropertyKeyframeDataItem.GetNext();k=this._lastPropertyKeyframeDataItem.GetTime();l=n?n.GetTime():l.GetTotalTime();if(a<=k||a>=l)this._lastPropertyKeyframeDataItem=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem),g=!0}else this._lastPropertyKeyframeDataItem= this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem),g=!0;k=this._lastPropertyKeyframeDataItem}k&&(e=k.GetNext());this._sourceAdapter.Interpolate(a,k,e,b,c,d,g)}GetInterpolatedValue(a){if(this._lastPropertyKeyframeDataItem){var b=this.GetTimeline();const d=this._lastPropertyKeyframeDataItem.GetNext();var c=this._lastPropertyKeyframeDataItem.GetTime();b=d?d.GetTime():b.GetTotalTime();if(a<=c||a>=b)this._lastPropertyKeyframeDataItem=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a, this._propertyTrackDataItem)}else this._lastPropertyKeyframeDataItem=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem);c=this._lastPropertyKeyframeDataItem;b=c.GetNext();return this._sourceAdapter.GetInterpolatedValue(a,c,b)}GetInterpolatedValueFast(a,b,c){return this._sourceAdapter.GetInterpolatedValue(a,b,c)}AfterInterpolate(){this._sourceAdapter.AfterInterpolate()}static GetStartPropertyKeyframeForTime(a,b){const c=b.GetPropertyTrackDataItem(); return b._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,c)}static GetEndPropertyKeyframeForTime(a,b){const c=b.GetPropertyTrackDataItem();return b._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(a,c)}AddPropertyKeyframe(){const a=this._propertyTrackDataItem.GetPropertyKeyframeData().AddEmptyPropertyKeyframeDataItem();this._lastPropertyKeyframeDataItem=null;return a}DeletePropertyKeyframes(a){this._lastPropertyKeyframeDataItem=null;this._propertyTrackDataItem.GetPropertyKeyframeData().DeletePropertyKeyframeDataItems(a)}SaveState(){this.GetSourceAdapter().SaveState()}CompareInitialStateWithCurrent(){if(this.GetSourceAdapter().CompareInitialStateWithCurrent()){const a= this._propertyTrackData.GetFirstPropertyKeyframeDataItem(this._propertyTrackDataItem),b=this.GetSourceAdapter().GetCurrentState();a.SetAbsoluteValue(b)}}CompareSaveStateWithCurrent(){const a=this.GetSourceAdapter().CompareSaveStateWithCurrent();a&&this.AddPropertyKeyframeAtCurrentTime();this.GetSourceAdapter().ClearSaveState();return a}AddPropertyKeyframeAtCurrentTime(){const a=this.GetTimeline().GetTime(),b=this.GetSourceAdapter(),c=C3$jscomp$94.PropertyTrackState.GetStartPropertyKeyframeForTime(a, this),d=this.AddPropertyKeyframe();d.SetType(c.GetType());d.SetTime(a);d.SetEase(c.GetEase());d.SetEnable(!0);d.SetValue(b.GetValueAtTime());d.SetAbsoluteValue(b.GetCurrentState())}_SaveToJson(){return{sourceAdapterJson:this.GetSourceAdapter()._SaveToJson()}}_LoadFromJson(a){a&&this.GetSourceAdapter()._LoadFromJson(a.sourceAdapterJson)}};"use strict";const NS=self.C3.PropertyTrackState; NS.PropertySourceAdapter=class{constructor(a){this._propertyTrack=a;this._propertyAdapter=null;this.GetPropertyAdapter()}Release(){this._propertyAdapter&&(this._propertyAdapter.Release(),this._propertyAdapter=null);this._propertyTrack=null}MayNeedBeforeAndAfterInterpolate(){return this._propertyAdapter.MayNeedBeforeAndAfterInterpolate()}GetPropertyTrack(){return this._propertyTrack}TimelineRemoved(){this._propertyAdapter&&this._propertyAdapter.TimelineRemoved()}CleanCaches(){this._propertyAdapter&& this._propertyAdapter.CleanCaches()}GetPropertyAdapter(){return this._propertyAdapter?this._propertyAdapter:this._propertyAdapter=this._CreatePropertyAdapter()}GetEditorIndex(){}GetIndex(){return this.GetEditorIndex()}GetTarget(){}SetResetState(){this.GetPropertyAdapter().SetResetState()}SetInitialState(){this.GetPropertyAdapter().SetInitialState()}SetResumeState(){this.GetPropertyAdapter().SetResumeState()}BeforeInterpolate(){this._propertyAdapter.BeforeChangeProperty()}Interpolate(a,b,c,d,e,g,k){let l; switch(this._propertyTrack.GetPropertyKeyframeType()){case "numeric":l=NS.NumericTypeAdapter.Interpolate(a,b,c,this._propertyTrack);break;case "angle":l=NS.AngleTypeAdapter.Interpolate(a,b,c,this._propertyTrack);break;case "boolean":l=NS.BooleanTypeAdapter.Interpolate(a,b,c,this._propertyTrack);break;case "color":l=NS.ColorTypeAdapter.Interpolate(a,b,c,this._propertyTrack);break;case "text":l=NS.TextTypeAdapter.Interpolate(a,b,c,this._propertyTrack)}this._propertyAdapter.ChangeProperty(a,l,b,c,d, e,g,k)}GetInterpolatedValue(a,b,c){switch(this._propertyTrack.GetPropertyKeyframeType()){case "numeric":return NS.NumericTypeAdapter.Interpolate(a,b,c,this._propertyTrack);case "angle":return NS.AngleTypeAdapter.Interpolate(a,b,c,this._propertyTrack);case "boolean":return NS.BooleanTypeAdapter.Interpolate(a,b,c,this._propertyTrack);case "color":return NS.ColorTypeAdapter.Interpolate(a,b,c,this._propertyTrack);case "text":return NS.TextTypeAdapter.Interpolate(a,b,c,this._propertyTrack)}}AfterInterpolate(){this._propertyAdapter.AfterChangeProperty()}SaveState(){this.GetPropertyAdapter().SetSaveState()}ClearSaveState(){this.GetPropertyAdapter().ClearSaveState()}GetCurrentState(){return this.GetPropertyAdapter().GetCurrentState()}CompareInitialStateWithCurrent(){return this.GetPropertyAdapter().CompareInitialStateWithCurrent()}CompareSaveStateWithCurrent(){return this.GetPropertyAdapter().CompareSaveStateWithCurrent()}GetValueAtTime(){const a= this._propertyTrack,b=a.GetTrack().GetTimeline().GetTime(),c=NS.GetStartPropertyKeyframeForTime(b,a),d=c.GetNext();switch(a.GetPropertyKeyframeType()){case "numeric":return NS.NumericTypeAdapter.Interpolate(b,c,d,a);case "angle":return NS.AngleTypeAdapter.Interpolate(b,c,d,a);case "boolean":return NS.BooleanTypeAdapter.Interpolate(b,c,d,a);case "color":return NS.ColorTypeAdapter.Interpolate(b,c,d,a);case "text":return NS.TextTypeAdapter.Interpolate(b,c,d,a)}}_CreatePropertyAdapter(){const a=this._propertyTrack; switch(a.CanHavePropertyKeyframes()?a.GetPropertyKeyframeType():""){case "combo":case "boolean":case "text":case "string":return new NS.PropertyInterpolationAdapter.NoInterpolationAdapter(this);case "numeric":case "number":case "angle":return"combo"===this._propertyTrack.GetPropertyType()?new NS.PropertyInterpolationAdapter.NoInterpolationAdapter(this):new NS.PropertyInterpolationAdapter.NumericInterpolationAdapter(this);case "color":case "offsetColor":return new NS.PropertyInterpolationAdapter.ColorInterpolationAdapter(this); default:return new NS.PropertyInterpolationAdapter.NumericInterpolationAdapter(this)}}_SaveToJson(){return{propertyAdapterJson:this.GetPropertyAdapter()._SaveToJson()}}_LoadFromJson(a){a&&this.GetPropertyAdapter()._LoadFromJson(a.propertyAdapterJson)}};"use strict";const C3$jscomp$96=self.C3; class InstanceVariableSourceAdapter extends C3$jscomp$96.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a);this._updatedIndex=NaN}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]}GetIndex(){return this._updatedIndex?this._updatedIndex:super.GetIndex()}GetTarget(){return this._propertyTrack.GetTrack().GetInstance()}UpdateInstanceVariableIndex(a){this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]!==a&&(this._updatedIndex= a)}Interpolate(a,b,c,d,e,g,k){this.GetPropertyAdapter().CanChange(b.GetValue())&&super.Interpolate(a,b,c,d,e,g,k)}GetInterpolatedValue(a,b,c){if(this.GetPropertyAdapter().CanChange(b.GetValue()))return super.GetInterpolatedValue(a,b,c)}_SaveToJson(){return Object.assign(super._SaveToJson(),{index:this._updatedIndex})}_LoadFromJson(a){a&&(super._LoadFromJson(a),this._updatedIndex=a.index)}}C3$jscomp$96.PropertyTrackState.InstanceVariableSourceAdapter=InstanceVariableSourceAdapter;"use strict"; const C3$jscomp$97=self.C3; class BehaviorSourceAdapter extends C3$jscomp$97.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a);this._sid=NaN}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[1]}GetTarget(){var a=this._propertyTrack.GetPropertyTrackDataItem(),b=this._propertyTrack.GetTrack();a=this._sid?this._sid:a.GetSourceAdapterArguments()[0];b=b.GetInstance();a=b.GetBehaviorIndexBySID(a);return b.GetBehaviorInstances()[a].GetSdkInstance()}GetBehaviorType(a){const b=this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[2]; return a.GetBehaviorTypeByName(b)}UpdateBehaviorTypeSid(a){this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]!==a&&(this._sid=a)}Interpolate(a,b,c,d,e,g,k){const l=this._propertyTrack.GetTrack().GetInstance();this.GetBehaviorType(l.GetObjectClass())&&super.Interpolate(a,b,c,d,e,g,k)}GetInterpolatedValue(a,b,c){const d=this._propertyTrack.GetTrack().GetInstance();if(this.GetBehaviorType(d.GetObjectClass()))return super.GetInterpolatedValue(a,b,c)}_SaveToJson(){return Object.assign(super._SaveToJson(), {sid:this._sid})}_LoadFromJson(a){a&&(super._LoadFromJson(a),this._sid=a.sid)}}C3$jscomp$97.PropertyTrackState.BehaviorSourceAdapter=BehaviorSourceAdapter;"use strict";const C3$jscomp$98=self.C3; class EffectSourceAdapter extends C3$jscomp$98.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a)}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[1]}GetTarget(){const a=this._propertyTrack.GetTrack().GetWorldInfo().GetInstanceEffectList();var b=a.GetEffectList();b=this.GetEffectType(b).GetIndex();return a.IsEffectIndexActive(b)?a.GetEffectParametersForIndex(b):null}GetEffectType(a){const b=this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]; return a.GetEffectTypeByName(b)}Interpolate(a,b,c,d,e,g,k){this._IsEffectActive()&&super.Interpolate(a,b,c,d,e,g,k)}GetInterpolatedValue(a,b,c){if(this._IsEffectActive())return super.GetInterpolatedValue(a,b,c)}_IsEffectActive(){const a=this._propertyTrack.GetTrack().GetWorldInfo().GetInstanceEffectList();var b=a.GetEffectList();if(b=this.GetEffectType(b))return b=b.GetIndex(),a.IsEffectIndexActive(b)}}C3$jscomp$98.PropertyTrackState.EffectSourceAdapter=EffectSourceAdapter;"use strict"; const C3$jscomp$99=self.C3; class PluginSourceAdapter extends C3$jscomp$99.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a)}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]}GetTarget(){return this._propertyTrack.GetTrack().GetInstance().GetSdkInstance()}Interpolate(a,b,c,d,e,g,k){var l=this._propertyTrack.GetTrack();const n=l.GetObjectClass().GetPlugin();l=l.GetInstance().GetObjectClass().GetPlugin();n===l&&super.Interpolate(a,b,c,d,e,g,k)}GetInterpolatedValue(a, b,c){var d=this._propertyTrack.GetTrack();const e=d.GetObjectClass().GetPlugin();d=d.GetInstance().GetObjectClass().GetPlugin();if(e===d)return super.GetInterpolatedValue(a,b,c)}GetOptionalCallbacks(){const a=this._propertyTrack.GetTrack().GetObjectClass().GetPlugin();if(C3$jscomp$99.Plugins.Sprite&&a instanceof C3$jscomp$99.Plugins.Sprite&&("initial-frame"===this._propertyTrack.GetPropertyName()||"initial-animation"===this._propertyTrack.GetPropertyName()))switch(this._propertyTrack.GetResultMode()){case "relative":return null; case "absolute":return null}}}C3$jscomp$99.PropertyTrackState.PluginSourceAdapter=PluginSourceAdapter;"use strict";const C3$jscomp$100=self.C3; class ValueSourceAdapter extends C3$jscomp$100.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a);this._value=0;this._init=!1}MayNeedBeforeAndAfterInterpolate(){return!1}SetInitialState(){const a=this._propertyTrack.GetPropertyTrackData();let b=this._propertyTrack.GetPropertyTrackDataItem();b=a.GetFirstPropertyKeyframeDataItem(b);this._value=b.GetValueWithResultMode()}SetResumeState(){}GetValue(){this._init||this._propertyTrack.Interpolate(0);return this._value}Interpolate(a,b,c,d,e, g,k){this._value=C3$jscomp$100.PropertyTrackState.NumericTypeAdapter.Interpolate(a,b,c,this._propertyTrack);this._init=!0}SaveState(){}ClearSaveState(){}GetCurrentState(){return this._value}CompareInitialStateWithCurrent(){return!1}CompareSaveStateWithCurrent(){return!1}_SaveToJson(){return{value:this._value,init:this._init}}_LoadFromJson(a){a&&(this._value=a.value,this._init=a.hasOwnProperty("init")?a.init:!0)}}C3$jscomp$100.PropertyTrackState.ValueSourceAdapter=ValueSourceAdapter;"use strict"; const C3$jscomp$101=self.C3; class AudioSourceAdapter extends C3$jscomp$101.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a);this._audioPlaybackStarted=!1;this._expressions=this._actions=this._sdkInstance=null;this._timeline=this._propertyTrack.GetTimeline();this._track=this._propertyTrack.GetTrack();this._sourceAdapterArgs=this._propertyTrack.GetSourceAdapterArgs();this._fileArgs=this._sourceAdapterArgs[0];this._startOffsetTime=this._sourceAdapterArgs[1];this._audioTag=this._sourceAdapterArgs[3]?this._sourceAdapterArgs[3]: Math.random().toString(36).slice(2);this._volume=this._pauseVolume=this._pauseTime=NaN;this._audioSource=null;this._Initialize()}Release(){super.Release();this._audioSource=this._fileArgs=this._sourceAdapterArgs=this._track=this._timeline=this._expressions=this._actions=this._sdkInstance=null}_Initialize(){if(self.C3.Plugins.Audio){var a=this._propertyTrack.GetRuntime().GetObjectClassByName("audio");a&&(this._sdkInstance=a.GetSingleGlobalInstance().GetSdkInstance());this._actions=self.C3.Plugins.Audio.Acts; this._expressions=self.C3.Plugins.Audio.Exps}}_MaybeSetAudioSource(){if(!this._audioSource){var a=this._propertyTrack.GetTrack().GetPropertyTrack("audioSource");a&&(this._audioSource=a.GetSourceAdapter())}}_GetPauseVolume(){const a=this._propertyTrack.GetTrack().GetPropertyTrack("volume");return a?a.GetSourceAdapter()._pauseVolume:this._pauseVolume}TimelineRemoved(){super.TimelineRemoved();this._audioPlaybackStarted=!1;this._sdkInstance&&(this._expressions&&(this._pauseTime=this._expressions.PlaybackTime.call(this._sdkInstance, this._audioTag),this._pauseVolume=this._expressions.Volume.call(this._sdkInstance,this._audioTag)),this._actions&&this._actions.Stop.call(this._sdkInstance,this._audioTag))}GetAudioTag(){return this._audioTag}GetVolume(){return this._volume}SetVolume(a){this._volume=a}SetInitialState(){super.SetInitialState();this._pauseTime=NaN;this._audioPlaybackStarted=!1}SetResumeState(){super.SetResumeState();const a=this._propertyTrack.GetTimeline().GetTime();this._pauseTime=a-this._startOffsetTime;switch(this._propertyTrack.GetPropertyName()){case "volume":this._pauseVolume= this._propertyTrack.GetInterpolatedValue(a)}this._audioPlaybackStarted=!1}Interpolate(a,b,c,d,e,g,k){if(this._sdkInstance)switch(this._propertyTrack.GetPropertyName()){case "audioSource":if(!this._timeline.IsForwardPlayBack())break;if(d){this._actions&&this._actions.Stop.call(this._sdkInstance,this._audioTag);break}if(a<this._startOffsetTime){this._audioPlaybackStarted=!1;break}b=this._expressions.PlaybackRate.call(this._sdkInstance,this._audioTag);c=this._timeline.GetPlaybackRate();c!==b&&this._actions.SetPlaybackRate.call(this._sdkInstance, this._audioTag,c);if(this._audioPlaybackStarted)break;if(!this._propertyTrack.GetTimeline().IsPlaying())break;this._audioPlaybackStarted=!0;isNaN(this._pauseTime)?(b=self.performance.now(),c=a-this._startOffsetTime,"suspended"===this._sdkInstance.GetAudioContextState()?this._audioPlaybackStarted=!1:(a=self.performance.now(),a=c+(a-b)/1E3,this._actions&&(b=this.GetVolume(),isNaN(b)?(this.SetVolume(0),b=0):this.SetVolume(b),this._actions.PlayFromTimeline.call(this._sdkInstance,this._fileArgs,b,this._audioTag, a)))):(a=this._pauseTime,this._pauseTime=NaN,b=this._GetPauseVolume(),this._pauseVolume=NaN,"suspended"===this._sdkInstance.GetAudioContextState()?this._audioPlaybackStarted=!1:this._actions&&(this.SetVolume(b),this._actions.PlayFromTimeline.call(this._sdkInstance,this._fileArgs,b,this._audioTag,a)));break;case "volume":this._MaybeSetAudioSource(),super.Interpolate(a,b,c,d,e,g,k)}}GetInterpolatedValue(a,b,c){if(this._sdkInstance)switch(this._propertyTrack.GetPropertyName()){case "volume":return this._MaybeSetAudioSource(), super.GetInterpolatedValue(a,b,c)}}Getter(a,b){return this._audioSource?this._audioSource.GetVolume():0}Setter(a,b,c,d){this._audioSource&&this._audioSource.SetVolume(this.Getter()+b);this._actions&&this._audioSource&&this._actions.SetVolume.call(this._sdkInstance,this._audioSource.GetAudioTag(),this._audioSource.GetVolume())}AbsoluteSetter(a,b,c){this._audioSource&&this._audioSource.SetVolume(b);this._actions&&this._audioSource&&this._actions.SetVolume.call(this._sdkInstance,this._audioSource.GetAudioTag(), this._audioSource.GetVolume())}DoesRounding(){return!0}_SaveToJson(){return{audioPlaybackStarted:this._audioPlaybackStarted,audioTag:this._audioTag,pauseTime:this._pauseTime,pauseVolume:this._pauseVolume,volume:this._volume}}_LoadFromJson(a){a&&(this._audioPlaybackStarted=a.audioPlaybackStarted,this._audioTag=a.audioTag,this._pauseTime=a.pauseTime,this._pauseVolume=a.pauseVolume,this._volume=a.volume,this._Initialize())}}C3$jscomp$101.PropertyTrackState.AudioSourceAdapter=AudioSourceAdapter;"use strict"; self.C3.PropertyTrackState.PropertyInterpolationAdapter=class{constructor(a){this._sourceAdapter=a;this._propertyTrack=a.GetPropertyTrack();this._worldInfo=this._propertyTrack.GetTrack().GetWorldInfo();this._property=this._propertyTrack.GetPropertyName();this._firstAbsoluteUpdate=!1;this._target=this._saveState=null}Release(){this._target=this._saveState=this._worldInfo=this._propertyTrack=this._sourceAdapter=null}MayNeedBeforeAndAfterInterpolate(){return!1}TimelineRemoved(){}CleanCaches(){this._target= this._saveState=this._worldInfo=null}GetSourceAdapter(){return this._sourceAdapter}GetPropertyTrack(){return this._propertyTrack}GetWorldInfo(){return this._worldInfo?this._worldInfo:this._worldInfo=this._propertyTrack.GetTrack().GetWorldInfo()}SetFirstAbsoluteUpdate(a){this._firstAbsoluteUpdate=!!a}GetFirstAbsoluteUpdate(){return this._firstAbsoluteUpdate}SetResetState(){}SetInitialState(){}SetResumeState(){}SetSaveState(){this._saveState=this.GetCurrentState()}ClearSaveState(){this._saveState=null}GetCurrentState(){}CompareInitialStateWithCurrent(){}CompareSaveStateWithCurrent(){}CanChange(a){return typeof this._Getter()=== typeof a}BeforeChangeProperty(){}ChangeProperty(a,b,c,d,e,g,k,l){}AfterChangeProperty(){}_FirstKeyframeGetter(){return this._PickTimelinePlaybackMode(()=>{const a=this._propertyTrack.GetPropertyTrackDataItem();return this._propertyTrack.GetPropertyTrackData().GetFirstPropertyKeyframeDataItem(a)},()=>{const a=this._propertyTrack.GetPropertyTrackDataItem();return this._propertyTrack.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(a)}).GetAbsoluteValue()}_CurrentKeyframeGetter(){const a=this._propertyTrack.GetTimeline().GetTime()- this._propertyTrack.GetTrack().GetStartOffset();return this._PickTimelinePlaybackMode(()=>{const b=this._propertyTrack.GetPropertyTrackDataItem();return this._propertyTrack.GetPropertyTrackData().GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,b)},()=>{const b=this._propertyTrack.GetPropertyTrackDataItem(),c=this._propertyTrack.GetPropertyTrackData(),d=c.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(a,b);return d?d:c.GetLastPropertyKeyframeDataItem(b)}).GetAbsoluteValue()}_PickTimelinePlaybackMode(a, b){return this._propertyTrack.GetTimeline().IsForwardPlayBack()?a():b()}_PickResultMode(a,b){return"relative"===this._propertyTrack.GetResultMode()?a():b()}_PickFirstAbsoluteUpdate(a,b){return this.GetFirstAbsoluteUpdate()?(this.SetFirstAbsoluteUpdate(!1),a()):b()}_GetAbsoluteInitialValue(a){}_GetIndex(){return this._sourceAdapter.GetIndex()}_GetTarget(){return this._target?this._target:this._target=this._sourceAdapter.GetTarget()}_PickSource(a,b,c,d,e,g){switch(this._propertyTrack.GetSourceAdapterId()){case "behavior":return a(); case "effect":return b();case "instance-variable":return c();case "plugin":return d();case "world-instance":return e();case "audio":return g()}}_SaveToJson(){return{firstAbsoluteUpdate:this._firstAbsoluteUpdate,saveState:this._saveState}}_LoadFromJson(a){a&&(this._firstAbsoluteUpdate=a.firstAbsoluteUpdate,this._saveState=a.saveState)}_GetPropertyKeyframeStubs(a,b=!1){const c=[];for(const d of a){a=d.GetTrack().GetStartOffset();for(const e of d.GetPropertyKeyframeDataItems())b&&0===e.GetTime()?c.push({time:a+ e.GetTime(),value:e.GetAbsoluteValue()}):b||c.push({time:a+e.GetTime(),value:e.GetAbsoluteValue()})}return c.sort((d,e)=>d.time-e.time)}_GetLastPropertyKeyframeStub(a,b,c){return this._GetPropertyKeyframeStubLowerThanPlayhead(b,c)}_GetPropertyKeyframeStubLowerThanPlayhead(a,b){for(let c=b.length-1;0<=c;c--)if(b[c].time<=a)return b[c];return null}};"use strict";const C3$jscomp$103=self.C3,TMP_COLORS_MAP=new Map,TMP_COLOR=[0,0,0]; class ColorInterpolationAdapter extends C3$jscomp$103.PropertyTrackState.PropertyInterpolationAdapter{constructor(a){super(a)}SetResetState(){}SetInitialState(){}SetResumeState(){}GetCurrentState(){const a=this._propertyTrack.GetSourceAdapterId(),b=this._GetTarget(),c=this._GetIndex();switch(a){case "behavior":return this._ToColorArray(b.GetPropertyValueByIndex(c));case "effect":return this._ToColorArray(b[c]);case "plugin":return this._ToColorArray(b.GetPropertyValueByIndex(c));case "world-instance":return this._ToColorArray(this._Getter())}}CompareInitialStateWithCurrent(){const a= this._FirstKeyframeGetter();return!this._CompareColors(a,this._Getter())}CompareSaveStateWithCurrent(){return C3$jscomp$103.IsNullOrUndefined(this._saveState)?!1:!this._CompareColors(this._saveState,this._Getter())}_CompareColors(a,b){a=this._GetColorFromArray(a);b=this._GetColorFromArray(b);return a.equalsIgnoringAlpha(b)}_FirstKeyframeGetter(){const a=super._FirstKeyframeGetter();return this._GetColorFromArray(a)}_CurrentKeyframeGetter(){const a=super._CurrentKeyframeGetter();return this._GetColorFromArray(a)}_GetAbsoluteInitialValue(a){}_ToColorArray(a){return C3$jscomp$103.IsInstanceOf(a, C3$jscomp$103.Color)?a.toArray().slice(0,3):a.slice(0,3)}_GetColorFromArray(a){return C3$jscomp$103.IsInstanceOf(a,C3$jscomp$103.Color)?a:new C3$jscomp$103.Color(a[0],a[1],a[2],1)}CanChange(a){return!0}MayNeedBeforeAndAfterInterpolate(){return!0}BeforeChangeProperty(){var a=this._propertyTrack.GetTimeline(),b=this._propertyTrack.GetInstance();const c=this._propertyTrack.GetSourceAdapter();(a=a.GetSimilarPropertyTracks(b,c,this._property,this._propertyTrack))&&1<a.length&&(TMP_COLORS_MAP.has(b)||TMP_COLORS_MAP.set(b, new Map),b=TMP_COLORS_MAP.get(b),a=this._propertyTrack.GetSourceAdapterId(),b.has(a)||b.set(a,new Map),b=b.get(a),b.has(this._property)||b.set(this._property,{used:!1,color:new C3$jscomp$103.Color(0,0,0,1)}))}_GetTmpColor(a,b,c){a=TMP_COLORS_MAP.get(a).get(b).get(c);a.used=!0;return a.color}ChangeProperty(a,b,c,d,e,g,k,l){e=this._propertyTrack.GetTimeline();d=this._propertyTrack.GetTrack();a=this._propertyTrack.GetInstance();g=this._propertyTrack.GetSourceAdapter();c=this._propertyTrack.GetSourceAdapterId(); if((g=e.GetSimilarPropertyTracks(a,g,this._property,this._propertyTrack))&&1<g.length){if(g=this._GetPropertyKeyframeStubs(g,!0),e=this._GetLastPropertyKeyframeStub(e,e.GetTime(),g))d=d.GetStartOffset(),g=e.time-d,0===g?this._GetTmpColor(a,c,this._property).addRgb(b[0],b[1],b[2]):0>g||(e=b[0],d=b[1],b=b[2],g=this._propertyTrack.Interpolate(g,!1,!0),e=C3$jscomp$103.Color.DiffChannel(e,g[0]),d=C3$jscomp$103.Color.DiffChannel(d,g[1]),b=C3$jscomp$103.Color.DiffChannel(b,g[2]),this._GetTmpColor(a,c,this._property).addRgb(e, d,b))}else this._Setter(b[0],b[1],b[2])}AfterChangeProperty(){const a=this._propertyTrack.GetInstance();if(TMP_COLORS_MAP.has(a)){var b=TMP_COLORS_MAP.get(a),c=this._propertyTrack.GetSourceAdapterId();if(b.has(c)){var d=b.get(c);if(d.has(this._property)){var e=d.get(this._property),g=e.color;e.used&&this._Setter(g.getR(),g.getG(),g.getB());0===d.size&&b.delete(c);0===b.size&&TMP_COLORS_MAP.delete(a)}}}}_Getter(){const a=this._propertyTrack.GetSourceAdapterId(),b=this._GetTarget(),c=this._GetIndex(); switch(a){case "behavior":return this._GetColorFromArray(b.GetPropertyValueByIndex(c));case "effect":return b[c].clone();case "plugin":return this._GetColorFromArray(b.GetPropertyValueByIndex(c));case "world-instance":return this.GetWorldInfo().GetUnpremultipliedColor().clone()}}_Setter(a,b,c){const d=this._propertyTrack.GetSourceAdapterId(),e=this._GetTarget(),g=this._GetIndex();switch(d){case "behavior":TMP_COLOR[0]=a;TMP_COLOR[1]=b;TMP_COLOR[2]=c;e.SetPropertyValueByIndex(g,TMP_COLOR);break;case "effect":e[g].setRgb(a, b,c);break;case "plugin":TMP_COLOR[0]=a;TMP_COLOR[1]=b;TMP_COLOR[2]=c;e.SetPropertyValueByIndex(g,TMP_COLOR);break;case "world-instance":this.GetWorldInfo().SetUnpremultipliedColorRGB(a,b,c)}}_SaveToJson(){}_LoadFromJson(a){}}C3$jscomp$103.PropertyTrackState.PropertyInterpolationAdapter.ColorInterpolationAdapter=ColorInterpolationAdapter;"use strict";const C3$jscomp$104=self.C3,NS$jscomp$1=C3$jscomp$104.PropertyTrackState; class NoInterpolationAdapter extends C3$jscomp$104.PropertyTrackState.PropertyInterpolationAdapter{constructor(a){super(a)}SetResetState(){}SetInitialState(){}SetResumeState(){}GetCurrentState(){return this._Getter()}CompareInitialStateWithCurrent(){return this._FirstKeyframeGetter()!==this.GetCurrentState()}CompareSaveStateWithCurrent(){return C3$jscomp$104.IsNullOrUndefined(this._saveState)?!1:this._saveState!==this.GetCurrentState()}MayNeedBeforeAndAfterInterpolate(){return!1}ChangeProperty(a, b,c,d,e,g,k,l){c=this._propertyTrack;g=c.GetTrack();d=c.GetSourceAdapterId();e=c.GetTimeline();k=g.GetInstance();l=c.GetSourceAdapter();(k=e.GetSimilarPropertyTracks(k,l,this._property,c))&&1<k.length&&(k=this._GetPropertyKeyframeStubs(k),a+=g.GetStartOffset(),a=this._GetLastPropertyKeyframeStub(e,a,k))&&(b=a.value);switch(c.GetPropertyKeyframeType()){case "numeric":if(!NS$jscomp$1.NumericTypeAdapter.WillChange(this._GetIndex(),this._GetTarget(),b,d))return;break;case "angle":if(!NS$jscomp$1.AngleTypeAdapter.WillChange(this._GetIndex(), this._GetTarget(),b,d))return;break;case "boolean":if(!NS$jscomp$1.BooleanTypeAdapter.WillChange(this._GetIndex(),this._GetTarget(),b,d))return;break;case "color":if(!NS$jscomp$1.ColorTypeAdapter.WillChange(this._GetIndex(),this._GetTarget(),b,d))return;break;case "text":if(!NS$jscomp$1.TextTypeAdapter.WillChange(this._GetIndex(),this._GetTarget(),b,d))return}this._Setter(b)}_Getter(){const a=this._propertyTrack.GetSourceAdapterId(),b=this._GetTarget(),c=this._GetIndex();switch(a){case "behavior":return b.GetPropertyValueByIndex(c); case "effect":return b[c];case "instance-variable":return b.GetInstanceVariableValue(c);case "plugin":return b.GetPropertyValueByIndex(c)}}_Setter(a){const b=this._propertyTrack.GetSourceAdapterId(),c=this._GetTarget(),d=this._GetIndex();switch(b){case "behavior":c.SetPropertyValueByIndex(d,a);break;case "effect":c[d]=a;break;case "instance-variable":c.SetInstanceVariableValue(d,a);break;case "plugin":c.SetPropertyValueByIndex(d,a)}}} C3$jscomp$104.PropertyTrackState.PropertyInterpolationAdapter.NoInterpolationAdapter=NoInterpolationAdapter;"use strict";const C3$jscomp$105=self.C3,INSTANCE_FUNC_MAP=new Map,add$jscomp$1=(a,b,c,d,e,g=!1,k=null,l=null)=>{INSTANCE_FUNC_MAP.set(a,{setter:b,absolute_setter:c,getter:d,round:e,fRound:g,init:k,reset:l})};add$jscomp$1("offsetX",(a,b,c,d)=>{"relative"===d._propertyTrack.GetResultMode()?a.OffsetX(b,c.GetTimeline().GetTransformWithSceneGraph()):a.OffsetX(b)},(a,b)=>a.SetX(b),a=>a.GetX(),!0); add$jscomp$1("offsetY",(a,b,c,d)=>{"relative"===d._propertyTrack.GetResultMode()?a.OffsetY(b,c.GetTimeline().GetTransformWithSceneGraph()):a.OffsetY(b)},(a,b)=>a.SetY(b),a=>a.GetY(),!0); add$jscomp$1("offsetWidth",(a,b,c,d,e)=>{if(0!==b){var g="relative"===d._propertyTrack.GetResultMode(),k=1===d._typeAdapter.GetType();if((g||k)&&a.HasParent()&&a.GetTransformWithParentWidth()){if(isNaN(d._absoluteToFactor)){g=[];for(k=a.GetParent();k;)g.push(k),k=k.GetParent();g.reverse();k=(w,y)=>{if(y=y.GetTimeline().GetTrackFromInstance(w.GetInstance()))return y.GetOriginalWidth();y=w.GetInstance().GetSdkInstance();return y.IsOriginalSizeKnown()?y.GetOriginalWidth():w._GetSceneGraphInfo()._GetStartWidth()}; const p=(w,y,B)=>{w=y.GetTimeline().GetTrackFromInstance(w.GetInstance());if(!w)return 0;B=w.GetPropertyTrack(B);if(!B)return 0;B=B.GetPropertyTrackDataItem().GetPropertyKeyframeData();return B?(B=B.GetLastPropertyKeyframeDataItem())?B.GetValue():0:0};let r=g[0];var l=r._GetSceneGraphInfo()._GetStartWidth(),n=r._GetSceneGraphInfo().GetStartScaleX();l=l*n+p(r,c,"offsetWidth");l+=k(r,c)*p(r,c,"offsetScaleX");for(n=1;n<g.length;n++)r=g[n],l*=r._GetSceneGraphInfo().GetStartScaleX(),l+=p(r,c,"offsetWidth"), l+=k(r,c)*p(r,c,"offsetScaleX");d._absoluteToFactor=0===l?Number.EPSILON:l}e||a.OffsetWidth(b/d._absoluteToFactor,!0)}else a.OffsetWidth(b)}},(a,b)=>a.SetWidth(b),a=>a.GetWidth(),!0); add$jscomp$1("offsetHeight",(a,b,c,d,e)=>{if(0!==b){var g="relative"===d._propertyTrack.GetResultMode(),k=1===d._typeAdapter.GetType();if((g||k)&&a.HasParent()&&a.GetTransformWithParentHeight()){if(isNaN(d._absoluteToFactor)){g=[];for(k=a.GetParent();k;)g.push(k),k=k.GetParent();g.reverse();k=(w,y)=>{if(y=y.GetTimeline().GetTrackFromInstance(w.GetInstance()))return y.GetOriginalHeight();y=w.GetInstance().GetSdkInstance();return y.IsOriginalSizeKnown()?y.GetOriginalHeight():w._GetSceneGraphInfo()._GetStartHeight()}; const p=(w,y,B)=>{w=y.GetTimeline().GetTrackFromInstance(w.GetInstance());if(!w)return 0;B=w.GetPropertyTrack(B);if(!B)return 0;B=B.GetPropertyTrackDataItem().GetPropertyKeyframeData();return B?(B=B.GetLastPropertyKeyframeDataItem())?B.GetValue():0:0};let r=g[0];var l=r._GetSceneGraphInfo()._GetStartHeight(),n=r._GetSceneGraphInfo().GetStartScaleY();l=l*n+p(r,c,"offsetHeight");l+=k(r,c)*p(r,c,"offsetScaleY");for(n=1;n<g.length;n++)r=g[n],l*=r._GetSceneGraphInfo().GetStartScaleY(),l+=p(r,c),l+=k(r, c)*p(r,c,"offsetScaleY");d._absoluteToFactor=0===l?Number.EPSILON:l}e||a.OffsetHeight(b/d._absoluteToFactor,!0)}else a.OffsetHeight(b)}},(a,b)=>a.SetHeight(b),a=>a.GetHeight(),!0);add$jscomp$1("offsetAngle",(a,b)=>a.OffsetAngle(b),(a,b)=>a.SetAngle(b),a=>a.GetAngle(),!1,!0); add$jscomp$1("offsetOpacity",(a,b,c,d,e)=>{b/=d._opacityFactor?d._opacityFactor:1;c=a.GetOpacity()+b;0===d._clampAccumulator?(1<c?d._clampAccumulator+=c-1:0>c&&(d._clampAccumulator+=c),a.OffsetOpacity(b)):(a=a.GetOpacity()+b,0<b&&0<d._clampAccumulator?1<a&&(d._clampAccumulator+=a-1):0<b&&0>d._clampAccumulator?(d._clampAccumulator+=b,0<d._clampAccumulator&&(d._clampAccumulator=0)):0>b&&0<d._clampAccumulator?(d._clampAccumulator+=b,0>d._clampAccumulator&&(d._clampAccumulator=0)):0>b&&0>d._clampAccumulator&& 0>a&&(d._clampAccumulator+=a))},(a,b)=>{a.SetOpacity(b)},a=>a.GetOpacity(),!1,!0,(a,b,c)=>{a._clampAccumulator=0;switch(a._propertyTrack.GetResultMode()){case "relative":a._propertyTrack.GetPropertyTrackData();var d=a._propertyTrack.GetPropertyTrackDataItem().GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray(),e=a.GetWorldInfo().GetOpacity(),g=e;for(var k of d)g=k.GetTime(),g=a._propertyTrack.GetInterpolatedValue(g),g=e+g,g=C3$jscomp$105.clamp(g,0,1);a._totalForewardOpacityDelta=e-g;a._totalForewardOpacityDelta= Math.round(100*(a._totalForewardOpacityDelta+Number.EPSILON))/100;g=e;for(e=d.length-1;0<=e;e--)k=d[e].GetTime(),k=a._propertyTrack.GetInterpolatedValue(k),g-=k,g=C3$jscomp$105.clamp(g,0,1);a._totalBackwardOpacityDelta=g;a._totalBackwardOpacityDelta=Math.round(100*(a._totalBackwardOpacityDelta+Number.EPSILON))/100}d="relative"===a._propertyTrack.GetResultMode();g=1===a._typeAdapter.GetType();if((d||g)&&b.HasParent()&&b.GetTransformWithParentOpacity()){d=[];for(b=b.GetParent();b;)d.push(b),b=b.GetParent(); d.reverse();b=(l,n,p)=>{l=n.GetTimeline().GetTrackFromInstance(l.GetInstance());if(!l)return 0;p=l.GetPropertyTrack(p);if(!p)return 0;p=p.GetPropertyTrackDataItem().GetPropertyKeyframeData();return p?(p=p.GetLastPropertyKeyframeDataItem())?p.GetValue():0:0};g=d[0]._GetSceneGraphInfo().GetStartOpacity();g+=b(d[0],c,"offsetOpacity");for(e=1;e<d.length;e++)g+=b(d[e],c,"offsetOpacity");a._opacityFactor=0===g?1:g}},a=>{switch(a._propertyTrack.GetResultMode()){case "relative":a._clampAccumulator=0;const b= a.GetWorldInfo();let c=b.GetOpacity();c=Math.round(100*(c+Number.EPSILON))/100;a._propertyTrack.GetTimeline().IsForwardPlayBack()?(b.SetOpacity(c+a._totalForewardOpacityDelta),a._lastValue=0):(b.SetOpacity(c-a._totalBackwardOpacityDelta),a._lastValue=a.GetSourceAdapter().GetValueAtTime())}});add$jscomp$1("offsetOriginX",(a,b)=>a.OffsetOriginX(b),(a,b)=>a.SetOriginX(b),a=>a.GetOriginX(),!1);add$jscomp$1("offsetOriginY",(a,b)=>a.OffsetOriginY(b),(a,b)=>a.SetOriginY(b),a=>a.GetOriginY(),!1); add$jscomp$1("offsetZElevation",(a,b)=>a.OffsetZElevation(b),(a,b)=>a.SetZElevation(b),a=>a.GetZElevation(),!0); add$jscomp$1("offsetScaleX",(a,b,c,d)=>{if(0!==b){var e=0>a.GetWidth()?-1:1;"relative"===d._propertyTrack.GetResultMode()&&a.HasParent()&&a.GetTransformWithParentWidth()?(b*=c.GetOriginalWidth()*e,isNaN(d._absoluteToFactor)&&INSTANCE_FUNC_MAP.get("offsetWidth").setter(a,1,c,d,!0),a.OffsetWidth(b/d._absoluteToFactor,!0)):a.OffsetWidth(c.GetOriginalWidth()*e*b)}},(a,b,c)=>{a.SetWidth(c.GetOriginalWidth()*b)},(a,b)=>{const c=0>a.GetWidth()?-1:1;if(a.GetTransformWithParentWidth()){var d=a.GetParent(), e=b.GetTimeline().GetTrackFromInstance(d.GetInstance());e?d=d.GetWidth()/e.GetOriginalWidth():(e=d.GetInstance().GetSdkInstance(),d=e.IsOriginalSizeKnown()?d.GetWidth()/e.GetOriginalWidth():1);return a.GetWidth()*c/(b.GetOriginalWidth()*d)}return a.GetWidth()*c/b.GetOriginalWidth()},!1); add$jscomp$1("offsetScaleY",(a,b,c,d)=>{if(0!==b){var e=0>a.GetHeight()?-1:1;"relative"===d._propertyTrack.GetResultMode()&&a.HasParent()&&a.GetTransformWithParentHeight()?(b*=c.GetOriginalHeight()*e,isNaN(d._absoluteToFactor)&&INSTANCE_FUNC_MAP.get("offsetHeight").setter(a,1,c,d,!0),a.OffsetHeight(b/d._absoluteToFactor,!0)):a.OffsetHeight(c.GetOriginalHeight()*e*b)}},(a,b,c)=>{a.SetHeight(c.GetOriginalHeight()*b)},(a,b)=>{const c=0>a.GetHeight()?-1:1;if(a.GetTransformWithParentHeight()){var d=a.GetParent(), e=b.GetTimeline().GetTrackFromInstance(d.GetInstance());e?d=d.GetHeight()/e.GetOriginalHeight():(e=d.GetInstance().GetSdkInstance(),d=e.IsOriginalSizeKnown()?d.GetHeight()/e.GetOriginalHeight():1);return a.GetHeight()*c/(b.GetOriginalHeight()*d)}return a.GetHeight()*c/b.GetOriginalHeight()},!1); class NumericInterpolationAdapter extends C3$jscomp$105.PropertyTrackState.PropertyInterpolationAdapter{constructor(a){super(a);this._totalBackwardOpacityDelta=this._totalForewardOpacityDelta=this._clampAccumulator=this._lastValue=0;this._absoluteToFactor=this._opacityFactor=NaN;this._source_adapter_absolute_setter=this._source_adapter_setter=this._source_adapter_getter=this._init_action=this._reset_action=this._instance_absolute_setter=this._instance_setter=this._instance_getter=null;this._fRound= this._round=!1;C3$jscomp$105.IsInstanceOf(this._propertyTrack.GetTimeline(),C3$jscomp$105.TweenState)?this._typeAdapter=new C3$jscomp$105.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTween(this):this._typeAdapter=new C3$jscomp$105.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTimeline(this);const b=this._propertyTrack.GetPropertyName();switch(this._propertyTrack.GetSourceAdapterId()){case "world-instance":a=INSTANCE_FUNC_MAP.get(b); this._instance_getter=a.getter;this._instance_setter=a.setter;this._instance_absolute_setter=a.absolute_setter;this._round=a.round;this._fRound=a.fRound;this._init_action=a.init;this._reset_action=a.reset;break;case "audio":this._source_adapter_getter=a.Getter,this._source_adapter_setter=a.Setter,this._source_adapter_absolute_setter=a.AbsoluteSetter,this._round=!!a.DoesRounding(),this._fRound=!1}}Release(){this._instance_absolute_setter=this._instance_setter=this._instance_getter=this._typeAdapter= null;this._absoluteToFactor=NaN;super.Release()}MayNeedBeforeAndAfterInterpolate(){return this._typeAdapter.MayNeedBeforeAndAfterInterpolate()}GetLastValue(){return this._lastValue}SetLastValue(a){this._lastValue=a}SetResetState(){this._reset_action&&this._reset_action(this)}SetInitialState(){var a=this._typeAdapter.SetInitialState();"number"===typeof a&&(this._lastValue=a);if(this._init_action){a=this.GetWorldInfo();const b=this._propertyTrack.GetTrack();this._init_action(this,a,b)}}SetResumeState(){const a= this._typeAdapter.SetResumeState();"number"===typeof a&&(this._lastValue=a)}GetCurrentState(){return this._Getter()}CompareInitialStateWithCurrent(){return this._FirstKeyframeGetter()!==this.GetCurrentState()}CompareSaveStateWithCurrent(){return C3$jscomp$105.IsNullOrUndefined(this._saveState)?!1:this._saveState!==this.GetCurrentState()}BeforeChangeProperty(){this._typeAdapter.BeforeChangeProperty()}ChangeProperty(a,b,c,d,e,g,k,l){return this._typeAdapter.ChangeProperty(a,b,c,d,e,g,k,l)}AfterChangeProperty(){this._typeAdapter.AfterChangeProperty()}_Getter(){const a= this._GetTarget(),b=this._GetIndex(),c=this.GetWorldInfo(),d=this._propertyTrack.GetTrack();switch(this._propertyTrack.GetSourceAdapterId()){case "behavior":return a.GetPropertyValueByIndex(b);case "effect":return a[b];case "instance-variable":return a.GetInstanceVariableValue(b);case "plugin":return a.GetPropertyValueByIndex(b);case "world-instance":return this._instance_getter(c,d);case "audio":return this._source_adapter_getter.call(this.GetSourceAdapter(),c,d)}}_Setter(a,b,c){b=this._GetTarget(); c=this._GetIndex();const d=this.GetWorldInfo(),e=this._propertyTrack.GetTrack();switch(this._propertyTrack.GetSourceAdapterId()){case "behavior":b.OffsetPropertyValueByIndex(c,a);break;case "effect":b[c]+=a;break;case "instance-variable":b.SetInstanceVariableOffset(c,a);break;case "plugin":b.OffsetPropertyValueByIndex(c,a,this.GetSourceAdapter().GetOptionalCallbacks());break;case "world-instance":this._instance_setter(d,a,e,this);break;case "audio":this._source_adapter_setter.call(this.GetSourceAdapter(), d,a,e,this)}}_SetterAbsolute(a,b,c){var d=this._propertyTrack.GetInterpolationMode();d="default"===d?"continuous":d;if("discrete"!==d||b){if("discrete"===d&&c&&(b=this._propertyTrack.GetTimeline().GetTime(),!this._propertyTrack.GetPropertyKeyFrameDataItemAtTime(b)))return;b=this._GetTarget();c=this._GetIndex();d=this.GetWorldInfo();var e=this._propertyTrack.GetTrack();switch(this._propertyTrack.GetSourceAdapterId()){case "behavior":b.SetPropertyValueByIndex(c,a);break;case "effect":b[c]=a;break;case "instance-variable":b.SetInstanceVariableValue(c, a);break;case "plugin":b.SetPropertyValueByIndex(c,a,this.GetSourceAdapter().GetOptionalCallbacks());break;case "world-instance":this._instance_absolute_setter(d,a,e);break;case "audio":this._source_adapter_absolute_setter.call(this.GetSourceAdapter(),d,a,e)}}}_MaybeEnsureValue(a,b,c,d,e,g,k,l){this._typeAdapter._MaybeEnsureValue(a,b,c,d,e,g,k,l)}_AddDelta(a,b,c,d,e){switch(this._propertyTrack.GetPropertyType()){case "angle":a=C3$jscomp$105.toDegrees(a)}d=(a.toString().split(".")[1]||"").length;a= this._Getter();if(0===d)if(this._round)d=Math.round(a);else if(this._fRound)switch(this._propertyTrack.GetPropertyType()){case "angle":d=C3$jscomp$105.toRadians(Math.round(C3$jscomp$105.toDegrees(a)));break;default:d=Math.round(100*(a+Number.EPSILON))/100}else d=a;else d=this._round?Number(C3$jscomp$105.toFixed(a,d)):a;this._Setter(d-a,b,c)}_SaveToJson(){return Object.assign(super._SaveToJson(),{v:this._lastValue,a:this._clampAccumulator,fod:this._totalForewardOpacityDelta,bod:this._totalBackwardOpacityDelta})}_LoadFromJson(a){a&& (super._LoadFromJson(a),this._lastValue=a.v,this._clampAccumulator=a.a,this._totalForewardOpacityDelta=C3$jscomp$105.IsFiniteNumber(a.fod)?a.fod:0,this._totalBackwardOpacityDelta=C3$jscomp$105.IsFiniteNumber(a.bod)?a.bod:0)}}C3$jscomp$105.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapter=NumericInterpolationAdapter;"use strict"; class AbsoluteValueObject{constructor(a){this._used=!1;this._value=0;this._endState=this._propertyKeyframeReached=!1;this._propertyTracks=a;for(let b=0,c=this._propertyTracks.length;b<c;b++)this._propertyTracks[b].SetAbsoluteValueObject(this)}GetPropertyTracks(){return this._propertyTracks}SetUsed(){this._used=!0}GetUsed(){return this._used}SetValue(a){this._value=a}GetValue(){return this._value}SetPropertyKeyframeReached(a){this._propertyKeyframeReached=a}GetPropertyKeyframeReached(){return this._propertyKeyframeReached}SetEndState(a){this._endState= a}GetEndState(){return this._endState}Reset(){this._used=!1;this._value=0;this._endState=this._propertyKeyframeReached=!1}} class NumericInterpolationAdapterForTimeline{constructor(a){this._numericInterpolationAdapter=a}Release(){this._numericInterpolationAdapter=null}GetType(){return 0}SetInitialState(){const a=this._numericInterpolationAdapter;this._numericInterpolationAdapter.GetPropertyTrack();return a._PickResultMode(()=>a._PickTimelinePlaybackMode(()=>0,()=>a.GetSourceAdapter().GetValueAtTime()),()=>{})}SetResumeState(){}MayNeedBeforeAndAfterInterpolate(){switch(this._numericInterpolationAdapter.GetPropertyTrack().GetResultMode()){case "relative":return!1; case "absolute":return!0}}BeforeChangeProperty(){var a=this._numericInterpolationAdapter.GetPropertyTrack();const b=a.GetPropertyName();switch(a.GetResultMode()){case "absolute":if(a.HasAbsoluteValueObject())a.GetAbsoluteValueObject().Reset();else{const c=a.GetTimeline(),d=a.GetInstance(),e=a.GetSourceAdapter();(a=c.GetSimilarPropertyTracks(d,e,b,a))&&1<a.length&&new AbsoluteValueObject(a)}}}ChangeProperty(a,b,c,d,e,g,k,l){var n=this._numericInterpolationAdapter,p=this._numericInterpolationAdapter.GetPropertyTrack(); switch(p.GetResultMode()){case "relative":k=n.GetLastValue();n._Setter(b-k,c,d);g&&this._MaybeEnsureValue(a,c,d,e,k,b);n.SetLastValue(b);break;case "absolute":if(d=p.GetTimeline(),c=p.GetTrack(),p.GetInstance(),p.GetSourceAdapter(),p.HasAbsoluteValueObject()){if(a=p.GetAbsoluteValueObject(),e=a.GetPropertyTracks(),e=n._GetPropertyKeyframeStubs(e,!0),n=n._GetLastPropertyKeyframeStub(d,d.GetTime(),e))c=c.GetStartOffset(),n=n.time-c,0===n?(a.SetEndState(k),a.SetPropertyKeyframeReached(l),a.SetUsed(), a.SetValue(a.GetValue()+b)):0>n||(p=p.GetInterpolatedValue(n),a.SetEndState(k),a.SetPropertyKeyframeReached(l),a.SetUsed(),a.SetValue(a.GetValue()+(b-p)))}else n._SetterAbsolute(b,l,k)}}AfterChangeProperty(){const a=this._numericInterpolationAdapter;var b=this._numericInterpolationAdapter.GetPropertyTrack();switch(b.GetResultMode()){case "absolute":b.HasAbsoluteValueObject()&&(b=b.GetAbsoluteValueObject(),b.GetUsed()&&a._SetterAbsolute(b.GetValue(),b.GetPropertyKeyframeReached(),b.GetEndState()))}}_MaybeEnsureValue(a, b,c,d,e,g){const k=this._numericInterpolationAdapter;d||(b&&a===b.GetTime()?k._AddDelta(b.GetValueWithResultMode(),b,c):c&&a===c.GetTime()?k._AddDelta(c.GetValueWithResultMode(),b,c):0===g-e&&k._AddDelta(b.GetValueWithResultMode(),b,c))}}self.C3.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTimeline=NumericInterpolationAdapterForTimeline;"use strict"; class NumericInterpolationAdapterForTween{constructor(a){this._numericInterpolationAdapter=a}Release(){this._numericInterpolationAdapter=null}GetType(){return 1}SetInitialState(){const a=this._numericInterpolationAdapter;a.SetFirstAbsoluteUpdate(!0);return this._GetAbsoluteInitialValue(a._FirstKeyframeGetter())}SetResumeState(){const a=this._numericInterpolationAdapter;if(a._FirstKeyframeGetter()!==a._CurrentKeyframeGetter())return a.SetFirstAbsoluteUpdate(!0),this._GetAbsoluteInitialValue(a._CurrentKeyframeGetter())}MayNeedBeforeAndAfterInterpolate(){return!1}BeforeChangeProperty(){}ChangeProperty(a, b,c,d,e,g,k,l){l=this._numericInterpolationAdapter;const n=l.GetLastValue();switch(l.GetPropertyTrack().GetResultMode()){case "relative":l._Setter(b-n,c,d);g&&this._MaybeEnsureValue(a,c,d,e,n,b,!1,k);break;case "absolute":l.GetFirstAbsoluteUpdate()?(l.SetFirstAbsoluteUpdate(!1),l._Setter(n,c,d)):0===a&&0===l.GetPropertyTrack().GetTimeline().GetTotalTime()?l._SetterAbsolute(b,!0,!1):(l._Setter(b-n,c,d),g&&this._MaybeEnsureValue(a,c,d,e,n,b,this._ForceEndValue(),k))}l.SetLastValue(b)}AfterChangeProperty(){}_GetAbsoluteInitialValue(a){return a- this._numericInterpolationAdapter.GetCurrentState()}_ForceEndValue(){var a=this._numericInterpolationAdapter;const b=a.GetWorldInfo().GetInstance();a=a.GetPropertyTrack().GetRuntime().GetTimelineManager();let c=0;for(const d of a.GetPlayingTimelines())0===d.GetType()?d.HasTrackInstance(b)&&c++:1===d.GetType()&&d.GetInstance()===b&&c++;return 1>=c}_MaybeEnsureValue(a,b,c,d,e,g,k,l){const n=this._numericInterpolationAdapter;d?b&&a===b.GetTime()?n._AddDelta(b.GetValueWithResultMode(),b,c,k,l):c&&a=== c.GetTime()?n._AddDelta(c.GetValueWithResultMode(),b,c,k,l):c||n._AddDelta(b.GetValueWithResultMode(),b,c,k,l):b&&a===b.GetTime()?n._AddDelta(b.GetValueWithResultMode(),b,c,k,l):c&&a===c.GetTime()?n._AddDelta(c.GetValueWithResultMode(),b,c,k,l):0===g-e&&n._AddDelta(b.GetValueWithResultMode(),b,c,k,l)}}self.C3.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTween=NumericInterpolationAdapterForTween;"use strict";const C3$jscomp$108=self.C3,Ease$jscomp$1=self.Ease; C3$jscomp$108.PropertyTrackState.NumericTypeAdapter=class{constructor(){}static WillChange(a,b,c,d){let e;switch(d){case "behavior":e=b.GetPropertyValueByIndex(a);break;case "effect":e=b[a];break;case "instance-variable":e=b.GetInstanceVariableValue(a);break;case "plugin":e=b.GetPropertyValueByIndex(a)}return e===c?!1:!0}static Interpolate(a,b,c,d){if(!c)return b=d.GetPropertyTrackDataItem(),b=d.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(b),b.GetValueWithResultMode();var e=d.GetInterpolationMode(); "default"===e&&(e="continuous");"combo"===d.GetPropertyType()&&(e="discrete");if("discrete"===e)return b.GetValueWithResultMode();if("continuous"===e||"step"===e){"step"===e&&(e=d.GetTimeline().GetStep(),0!==e&&(e=1/e,a=Math.floor(a*e)/e));e=b.GetValueWithResultMode();const g=c.GetValueWithResultMode(),k=b.GetAddOn("cubic-bezier"),l=c.GetAddOn("cubic-bezier"),n=k&&k.GetStartEnable()&&l&&l.GetEndEnable();if(!n&&e===g)return e;const p=b.GetTime();c=c.GetTime();a=C3$jscomp$108.normalize(a,p,c);b=b.GetEase(); n?(c-=p,b=Ease$jscomp$1.GetRuntimeEase(b)(c*a,0,1,c),b=Ease$jscomp$1.GetRuntimeEase("cubicbezier")(b,e,e+k.GetStartAnchor(),g+l.GetEndAnchor(),g)):b=Ease$jscomp$1.GetRuntimeEase(b)((c-p)*a,e,g-e,c-p);return"integer"===d.GetPropertyType()?Math.floor(b):b}}};"use strict";const C3$jscomp$109=self.C3; C3$jscomp$109.PropertyTrackState.AngleTypeAdapter=class{constructor(){}static WillChange(a,b,c,d){let e;switch(d){case "behavior":e=b.GetPropertyValueByIndex(a);break;case "effect":e=b[a];break;case "instance-variable":e=b.GetInstanceVariableValue(a);break;case "plugin":e=b.GetPropertyValueByIndex(a)}return e===c?!1:!0}static Interpolate(a,b,c,d){if(!c)return b=d.GetPropertyTrackDataItem(),b=d.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(b),b.GetValueWithResultMode();var e=d.GetInterpolationMode(); "default"===e&&(e="continuous");"combo"===d.GetPropertyType()&&(e="discrete");if("discrete"===e)return b.GetValueWithResultMode();if("continuous"===e||"step"===e){"step"===e&&(d=d.GetTimeline().GetStep(),0!==d&&(d=1/d,a=Math.floor(a*d)/d));const g=b.GetTime(),k=c.GetTime();d=b.GetValueWithResultMode();c=c.GetValueWithResultMode();if(e=b.GetAddOn("angle")){const l=e.GetRevolutions();if(d===c&&0===l)return d;a=C3$jscomp$109.normalize(a,g,k);b=self.Ease.GetRuntimeEase(b.GetEase())(a,0,1,1);switch(e.GetDirection()){case "closest":return C3$jscomp$109.angleLerp(d, c,b,l);case "clockwise":return C3$jscomp$109.angleLerpClockwise(d,c,b,l);case "anti-clockwise":return C3$jscomp$109.angleLerpAntiClockwise(d,c,b,l)}}else{if(d===c)return d;a=C3$jscomp$109.normalize(a,g,k);b=self.Ease.GetRuntimeEase(b.GetEase());return C3$jscomp$109.angleLerp(d,c,b(a,0,1,1))}}}};"use strict"; self.C3.PropertyTrackState.BooleanTypeAdapter=class{constructor(){}static WillChange(a,b,c,d){let e;switch(d){case "behavior":e=b.GetPropertyValueByIndex(a);break;case "effect":e=b[a];break;case "instance-variable":e=b.GetInstanceVariableValue(a);break;case "plugin":e=b.GetPropertyValueByIndex(a)}return!!e===!!c?!1:!0}static Interpolate(a,b,c,d){return c?b.GetValueWithResultMode()?1:0:(a=d.GetPropertyTrackDataItem(),a=d.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(a),a.GetValueWithResultMode()? 1:0)}};"use strict";const C3$jscomp$111=self.C3,TEMP_COLOR_ARRAY=[0,0,0],TEMP_COLOR_ARRAY_2=[0,0,0],TEMP_COLOR_ARRAY_3=[0,0,0]; C3$jscomp$111.PropertyTrackState.ColorTypeAdapter=class{constructor(){}static WillChange(a,b,c,d){let e;switch(d){case "behavior":e=b.GetPropertyValueByIndex(a);break;case "effect":e=b[a];break;case "instance-variable":e=b.GetInstanceVariableValue(a);break;case "plugin":e=b.GetPropertyValueByIndex(a)}Array.isArray(c)?(TEMP_COLOR_ARRAY[0]=c[0],TEMP_COLOR_ARRAY[1]=c[1],TEMP_COLOR_ARRAY[2]=c[2]):(TEMP_COLOR_ARRAY_3.parseCommaSeparatedRgb(c),TEMP_COLOR_ARRAY[0]=Math.floor(255*TEMP_COLOR_ARRAY_3.getR()), TEMP_COLOR_ARRAY[1]=Math.floor(255*TEMP_COLOR_ARRAY_3.getG()),TEMP_COLOR_ARRAY[2]=Math.floor(255*TEMP_COLOR_ARRAY_3.getB()));Array.isArray(e)?(TEMP_COLOR_ARRAY_2[0]=e[0],TEMP_COLOR_ARRAY_2[1]=e[1],TEMP_COLOR_ARRAY_2[2]=e[2]):(TEMP_COLOR_ARRAY_3.parseCommaSeparatedRgb(e),TEMP_COLOR_ARRAY_2[0]=Math.floor(255*TEMP_COLOR_ARRAY_3.getR()),TEMP_COLOR_ARRAY_2[1]=Math.floor(255*TEMP_COLOR_ARRAY_3.getG()),TEMP_COLOR_ARRAY_2[2]=Math.floor(255*TEMP_COLOR_ARRAY_3.getB()));return TEMP_COLOR_ARRAY[0]!==TEMP_COLOR_ARRAY_2[0]|| TEMP_COLOR_ARRAY[1]!==TEMP_COLOR_ARRAY_2[1]||TEMP_COLOR_ARRAY[2]!==TEMP_COLOR_ARRAY_2[2]?!0:!1}static Interpolate(a,b,c,d){if(!c){var e=d.GetPropertyTrackDataItem();e=d.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(e);d=e.GetValueWithResultMode();TEMP_COLOR_ARRAY[0]=d[0];TEMP_COLOR_ARRAY[1]=d[1];TEMP_COLOR_ARRAY[2]=d[2];return TEMP_COLOR_ARRAY}e=d.GetInterpolationMode();"default"===e&&(e="continuous");if("discrete"===e)return d=b.GetValueWithResultMode(),TEMP_COLOR_ARRAY[0]=d[0],TEMP_COLOR_ARRAY[1]= d[1],TEMP_COLOR_ARRAY[2]=d[2],TEMP_COLOR_ARRAY;if("continuous"===e||"step"===e){"step"===e&&(d=d.GetTimeline().GetStep(),0!==d&&(d=1/d,a=Math.floor(a*d)/d));d=b.GetTime();e=c.GetTime();var g=b.GetValueWithResultMode(),k=c.GetValueWithResultMode();a=C3$jscomp$111.normalize(a,d,e);var l=b.GetEase();b=g[0];c=g[1];g=g[2];const n=k[0],p=k[1];k=k[2];l=self.Ease.GetRuntimeEase(l);d=e-d;e=d*a;TEMP_COLOR_ARRAY[0]=b===n?b:l(e,b,n-b,d);TEMP_COLOR_ARRAY[1]=c===p?c:l(e,c,p-c,d);TEMP_COLOR_ARRAY[2]=g===k?g:l(e, g,k-g,d);return TEMP_COLOR_ARRAY}}};"use strict"; self.C3.PropertyTrackState.TextTypeAdapter=class{constructor(){}static WillChange(a,b,c,d){let e;switch(d){case "behavior":e=b.GetPropertyValueByIndex(a);break;case "effect":e=b[a];break;case "instance-variable":e=b.GetInstanceVariableValue(a);break;case "plugin":e=b.GetPropertyValueByIndex(a)}return e===c?!1:!0}static Interpolate(a,b,c,d){return c?b.GetValueWithResultMode():(a=d.GetPropertyTrackDataItem(),a=d.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(a),a.GetValueWithResultMode())}}; "use strict";const C3$jscomp$113=self.C3; C3$jscomp$113.TimelineDataManager=class{constructor(){this._timelineDataItems=new Map}Release(){for(const a of this._timelineDataItems.values())a.Release();this._timelineDataItems.clear();this._timelineDataItems=null}Add(a){a=new C3$jscomp$113.TimelineDataItem(a);const b=a.GetName();this._timelineDataItems.set(b,a)}Get(a){return this._timelineDataItems.get(a)}GetNameId(){return 0}static _CreateDataItems(a,b,c,d){if(b)for(const e of b)C3$jscomp$113.TimelineDataManager._CreateDataItem("create",e,a, c,d)}static _CreateDataItemsIncludingDisabled(a,b,c,d){if(b)for(const e of b)C3$jscomp$113.TimelineDataManager._CreateDataItem("create-including-disabled",e,a,c,d)}static _LoadDataItemsFromJson(a,b,c,d){a.length?b.forEach((e,g)=>{a[g]._LoadFromJson(e)}):b.forEach(e=>{C3$jscomp$113.TimelineDataManager._CreateDataItem("load",e,a,c,d)})}static _CreateDataItem(a,b,c,d,e){let g;if("function"===typeof d)switch(a){case "load":g=new d(null,e);break;case "create":g=new d(b,e);break;case "create-including-disabled":g= new d(b,e)}else if("object"===typeof d)switch(d=d.map.get(b[d.prop]),a){case "load":g=new d(null,e);break;case "create":g=new d(b,e);break;case "create-including-disabled":g=new d(b,e)}switch(a){case "load":g._LoadFromJson(b);c.push(g);break;case "create":if("function"===typeof g.GetEnable&&!g.GetEnable())return g.Release();c.push(g);break;case "create-including-disabled":c.push(g)}}};"use strict";const C3$jscomp$114=self.C3; C3$jscomp$114.TimelineDataItem=class{constructor(a){this._name="";this._totalTime=NaN;this._step=0;this._resultMode=this._interpolationMode="default";this._pingPong=this._loop=!1;this._repeatCount=1;this._trackData=null;this._startOnLayout="";this._transformWithSceneGraph=!1;this._useSystemTimescale=!0;a&&(this._name=a[0],this._totalTime=a[1],this._step=a[2],this._interpolationMode=a[3],this._resultMode=a[4],this._loop=!!a[6],this._pingPong=!!a[7],this._repeatCount=a[8],this._startOnLayout=a[9],this._transformWithSceneGraph= !!a[10],this._useSystemTimescale=!!a[11],this._trackData=new C3$jscomp$114.TrackData(a[5],this))}Release(){this._trackData.Release();this._trackData=null}GetTrackData(){this._trackData||(this._trackData=new C3$jscomp$114.TrackData(null,this));return this._trackData}GetName(){return this._name}SetName(a){this._name=a}GetTotalTime(){return this._totalTime}SetTotalTime(a){this._totalTime=a}GetStep(){return this._step}SetStep(a){this._step=a}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(a){this._interpolationMode= a}GetResultMode(){return this._resultMode}SetResultMode(a){this._resultMode=a}GetLoop(){return this._loop}SetLoop(a){this._loop=a}GetPingPong(){return this._pingPong}SetPingPong(a){this._pingPong=a}GetRepeatCount(){return this._repeatCount}SetRepeatCount(a){this._repeatCount=a}GetStartOnLayout(){return this._startOnLayout}GetTransformWithSceneGraph(){return this._transformWithSceneGraph}GetUseSystemTimescale(){return this._useSystemTimescale}_SaveToJson(){return{trackDataJson:this._trackData._SaveToJson(), name:this._name,totalTime:this._totalTime,step:this._step,interpolationMode:this._interpolationMode,resultMode:this._resultMode,loop:this._loop,pingPong:this._pingPong,repeatCount:this._repeatCount,startOnLayout:this._startOnLayout,transformWithSceneGraph:!!this._transformWithSceneGraph,useSystemTimescale:this._useSystemTimescale}}_LoadFromJson(a){a&&(this.GetTrackData()._LoadFromJson(a.trackDataJson),this._name=a.name,this._totalTime=a.totalTime,this._step=a.step,this._interpolationMode=a.interpolationMode, this._resultMode=a.resultMode,this._loop=a.loop,this._pingPong=a.pingPong,this._repeatCount=a.repeatCount,this._startOnLayout=a.startOnLayout,this._transformWithSceneGraph=!!a.transformWithSceneGraph,this._useSystemTimescale=!!a.useSystemTimescale)}};"use strict";const C3$jscomp$115=self.C3; class TrackDataItem{constructor(a,b){this._trackData=b;this._additionalInstanceData=this._instanceData=null;this._objectClassIndex=this._instanceUid=NaN;this._resultMode=this._interpolationMode="default";this._enabled=!1;this._propertyTrackData=this._keyframeData=null;this._id="";this._nestedData=null;this._startOffset=0;this._localTotalTime=this._trackData.GetTimelineDataItem().GetTotalTime();this._type=0;this._name="";a&&(a[0]&&(this._instanceData=a[0],this._instanceUid=a[0][2],this._objectClassIndex= a[0][1]),this._interpolationMode=a[1],this._resultMode=a[2],this._enabled=!!a[3],a[6]&&(this._id=a[6]),a[7]&&(this._nestedData=a[7],this._startOffset=a[7][0],this._localTotalTime=a[7][1]),a[8]&&(this._additionalInstanceData=a[8]),a[8]&&(this._additionalInstanceData=a[8]),a[9]&&(this._type=a[9]),a[10]&&(this._name=a[10]),this._keyframeData=new C3$jscomp$115.KeyframeData(a[4],this),this._propertyTrackData=new C3$jscomp$115.PropertyTrackData(a[5],this))}Release(){this._trackData=this._instanceData=null; this._keyframeData&&(this._keyframeData.Release(),this._keyframeData=null);this._propertyTrackData&&(this._propertyTrackData.Release(),this._propertyTrackData=null);this._nestedData=null}GetTrackData(){return this._trackData}GetKeyframeData(){this._keyframeData||(this._keyframeData=new C3$jscomp$115.KeyframeData(null,this));return this._keyframeData}GetPropertyTrackData(){this._propertyTrackData||(this._propertyTrackData=new C3$jscomp$115.PropertyTrackData(null,this));return this._propertyTrackData}GetInstanceData(){return this._instanceData}GetObjectClassIndex(){return this._objectClassIndex}SetObjectClassIndex(a){this._objectClassIndex= a}GetInstanceUID(){return this._instanceUid}SetInstanceUID(a){this._instanceUid=a}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(a){this._interpolationMode=a}GetResultMode(){return this._resultMode}SetResultMode(a){this._resultMode=a}GetEnable(){return this._enabled}SetEnable(a){this._enabled=!!a}GetId(){return this._id}GetStartOffset(){return this._startOffset}GetLocalTotalTime(){return this._localTotalTime}SetLocalTotalTime(a){this._localTotalTime=a}GetOriginalWidth(){return this._additionalInstanceData[0]}SetOriginalWidth(a){this._additionalInstanceData|| (this._additionalInstanceData=[]);this._additionalInstanceData[0]=a}GetOriginalHeight(){this._additionalInstanceData||(this._additionalInstanceData=[]);return this._additionalInstanceData[1]}SetOriginalHeight(a){this._additionalInstanceData||(this._additionalInstanceData=[]);this._additionalInstanceData[1]=a}GetType(){return this._type}GetName(){return this._name}_SaveToJson(){return{keyframeDataJson:this._keyframeData._SaveToJson(),propertyTrackDataJson:this._propertyTrackData._SaveToJson(),instanceData:this._instanceData, additionalInstanceData:this._additionalInstanceData,instanceUid:this._instanceUid,objectClassIndex:this._objectClassIndex,interpolationMode:this._interpolationMode,resultMode:this._resultMode,enabled:this._enabled,id:this._id,nestedData:this._nestedData,type:this._type,name:this._name}}_LoadFromJson(a){a&&(this._instanceData=a.instanceData,this._instanceUid=a.instanceUid,this._objectClassIndex=a.objectClassIndex,this._interpolationMode=a.interpolationMode,this._resultMode=a.resultMode,this._enabled= a.enabled,this._id=a.id,this._type=a.type?a.type:0,this._name=a.name?a.name:"",this._localTotalTime=this._trackData.GetTimelineDataItem().GetTotalTime(),a.nestedData&&(this._nestedData=a.nestedData,this._startOffset=this._nestedData[0],this._localTotalTime=this._nestedData[1]),a.additionalInstanceData&&(this._additionalInstanceData=a.additionalInstanceData),this.GetKeyframeData()._LoadFromJson(a.keyframeDataJson),this.GetPropertyTrackData()._LoadFromJson(a.propertyTrackDataJson))}} C3$jscomp$115.TrackData=class{constructor(a,b){this._timelineDataItem=b;this._trackDataItems=[];C3$jscomp$115.TimelineDataManager._CreateDataItems(this._trackDataItems,a,TrackDataItem,this)}Release(){this._timelineDataItem=null;for(const a of this._trackDataItems)a.Release();C3$jscomp$115.clearArray(this._trackDataItems);this._trackDataItems=null}GetTimelineDataItem(){return this._timelineDataItem}AddEmptyTrackDataItem(){const a=new TrackDataItem(null,this);this._trackDataItems.push(a);return a}GetFirstKeyframeDataItem(a){return a.GetKeyframeData().GetKeyframeDataItemArray()[0]}GetLastKeyframeDataItem(a){return a.GetKeyframeData().GetKeyframeDataItemArray().at(-1)}GetKeyFrameDataItemAtTime(a, b){b=b.GetKeyframeData().GetKeyframeDataItemArray();const c=b.length;for(let d=0;d<c;d++){const e=b[d];if(e.GetTime()===a)return e}}GetFirstKeyFrameDataItemHigherThan(a,b){b=b.GetKeyframeData().GetKeyframeDataItemArray();const c=b.length;for(let d=0;d<c;d++){const e=b[d];if(e.GetTime()>a)return e}}GetFirstKeyFrameDataItemHigherOrEqualThan(a,b){b=b.GetKeyframeData().GetKeyframeDataItemArray();const c=b.length;for(let d=0;d<c;d++){const e=b[d];if(e.GetTime()>=a)return e}}GetFirstKeyFrameDataItemLowerOrEqualThan(a, b){b=b.GetKeyframeData().GetKeyframeDataItemArray();for(let c=b.length-1;0<=c;c--){const d=b[c];if(d.GetTime()<=a)return d}}*trackDataItems(){for(const a of this._trackDataItems)yield a}_SaveToJson(){return{trackDataItemsJson:this._trackDataItems.map(a=>a._SaveToJson())}}_LoadFromJson(a){a&&C3$jscomp$115.TimelineDataManager._LoadDataItemsFromJson(this._trackDataItems,a.trackDataItemsJson,TrackDataItem,this)}};"use strict";const C3$jscomp$116=self.C3; class PropertyTrackDataItem{constructor(a,b){this._propertyTrackData=b;this._sourceAdapterId="";this._type=this._property=this._sourceAdapterArguments=null;this._max=this._min=NaN;this._resultMode=this._interpolationMode="default";this._enabled=!1;this._propertyKeyframeData=null;this._canHavePropertyKeyframes=!0;a&&(this._sourceAdapterId=a[0][0],this._sourceAdapterArguments=a[0].slice(1),this._property=a[1],this._type=a[2],this._min=a[3],this._max=a[4],this._interpolationMode=a[5],this._resultMode= a[6],this._enabled=!!a[7],this._propertyKeyframeData=new C3$jscomp$116.PropertyKeyframeData(a[8],this),this._canHavePropertyKeyframes=a[9])}Release(){this._propertyKeyframeData.Release();this._sourceAdapterArguments=this._propertyTrackData=this._propertyKeyframeData=null}GetPropertyTrackData(){return this._propertyTrackData}GetPropertyKeyframeData(){this._propertyKeyframeData||(this._propertyKeyframeData=new C3$jscomp$116.PropertyKeyframeData(null,this));return this._propertyKeyframeData}GetSourceAdapterId(){return this._sourceAdapterId}SetSourceAdapterId(a){this._sourceAdapterId= a}GetSourceAdapterArguments(){return this._sourceAdapterArguments}SetSourceAdapterArguments(a){this._sourceAdapterArguments=a}GetProperty(){return this._property}SetProperty(a){this._property=a}GetType(){return this._type}SetType(a){this._type=a}GetMin(){return this._min}SetMin(a){this._min=a}GetMax(){return this._max}SetMax(a){this._max=a}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(a){this._interpolationMode=a}GetResultMode(){return this._resultMode}SetResultMode(a){this._resultMode= a}GetEnable(){return this._enabled}SetEnable(a){this._enabled=!!a}CanHavePropertyKeyframes(){return!!this._canHavePropertyKeyframes}_SaveToJson(){return{propertyKeyframeDataJson:this._propertyKeyframeData._SaveToJson(),sourceAdapterId:this._sourceAdapterId,sourceAdapterArguments:this._sourceAdapterArguments,property:this._property,type:this._type,min:this._min,max:this._max,interpolationMode:this._interpolationMode,resultMode:this._resultMode,enabled:this._enabled,canHavePropertyKeyframes:this._canHavePropertyKeyframes}}_LoadFromJson(a){a&& (this._sourceAdapterId=a.sourceAdapterId,this._sourceAdapterArguments=a.sourceAdapterArguments,this._property=a.property,this._type=a.type,this._min=a.min,this._max=a.max,this._interpolationMode=a.interpolationMode,this._resultMode=a.resultMode,this._enabled=a.enabled,this._canHavePropertyKeyframes=a.canHavePropertyKeyframes,this.GetPropertyKeyframeData()._LoadFromJson(a.propertyKeyframeDataJson))}} C3$jscomp$116.PropertyTrackData=class{constructor(a,b){this._trackDataItem=b;this._propertyTrackDataItems=[];C3$jscomp$116.TimelineDataManager._CreateDataItems(this._propertyTrackDataItems,a,PropertyTrackDataItem,this)}Release(){this._trackDataItem=null;for(const a of this._propertyTrackDataItems)a.Release();C3$jscomp$116.clearArray(this._propertyTrackDataItems);this._propertyTrackDataItems=null}GetTrackDataItem(){return this._trackDataItem}AddEmptyPropertyTrackDataItem(){const a=new PropertyTrackDataItem(null, this);this._propertyTrackDataItems.push(a);return a}GetFirstPropertyKeyframeDataItem(a){return a.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray()[0]}GetLastPropertyKeyframeDataItem(a){return a.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray().at(-1)}GetPropertyKeyFrameDataItemAtTime(a,b){b=b.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();const c=b.length;for(let d=0;d<c;d++){const e=b[d];if(e.GetTime()===a)return e}}GetFirstPropertyKeyFrameDataItemHigherThan(a, b){b=b.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();const c=b.length;for(let d=0;d<c;d++){const e=b[d];if(e.GetTime()>a)return e}}GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(a,b){b=b.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();const c=b.length;for(let d=0;d<c;d++){const e=b[d];if(e.GetTime()>=a)return e}}GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,b){b=b.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();for(let c=b.length-1;0<=c;c--){const d= b[c];if(d.GetTime()<=a)return d}}*propertyTrackDataItems(){for(const a of this._propertyTrackDataItems)yield a}_SaveToJson(){return{propertyTrackDataItemsJson:this._propertyTrackDataItems.map(a=>a._SaveToJson())}}_LoadFromJson(a){a&&C3$jscomp$116.TimelineDataManager._LoadDataItemsFromJson(this._propertyTrackDataItems,a.propertyTrackDataItemsJson,PropertyTrackDataItem,this)}};"use strict";const C3$jscomp$117=self.C3; class KeyframeDataItem{constructor(a,b){this._keyframeData=b;this._time=-1;this._ease="noease";this._enable=!1;this._lowerTags=this._tags=null;a&&(this._time=a[0],this._ease=a[1],this._enable=!!a[2],this._tags=(a=a[3])?a.split(" "):[],this._lowerTags=new Set(this._tags.map(c=>c.toLowerCase())),this._next=null)}Release(){this._keyframeData=null;C3$jscomp$117.clearArray(this._tags);this._tags=null;this._lowerTags.clear();this._next=this._lowerTags=null}GetKeyframeData(){return this._keyframeData}GetNext(){return this._next}SetNext(a){this._next= a}GetTime(){return this._time}SetTime(a){this._time=a;this._keyframeData._LinkKeyframeDataItems()}GetEase(){return this._ease}SetEase(a){this._ease=a}GetEnable(){return this._enable}SetEnable(a){this._enable=!!a}GetTags(){return this._tags}SetTags(a){this._tags=a?a.split(" "):[];this._lowerTags=new Set(this._tags.map(b=>b.toLowerCase()))}GetLowerTags(){return this._lowerTags}HasTag(a){return this._lowerTags.has(a.toLowerCase())}_SaveToJson(){return{time:this._time,ease:this._ease,enable:this._enable, tags:this._tags}}_LoadFromJson(a){a&&(this._time=a.time,this._ease=a.ease,this._enable=a.enable,this._tags=a.tags,this._lowerTags=new Set(this._tags.map(b=>b.toLowerCase())))}} C3$jscomp$117.KeyframeData=class{constructor(a,b){this._trackDataItem=b;this._keyframeDataItems=[];C3$jscomp$117.TimelineDataManager._CreateDataItems(this._keyframeDataItems,a,KeyframeDataItem,this);this._LinkKeyframeDataItems()}Release(){this._trackDataItem=null;for(const a of this._keyframeDataItems)a.Release();C3$jscomp$117.clearArray(this._keyframeDataItems);this._keyframeDataItems=null}_LinkKeyframeDataItems(){this._keyframeDataItems.sort((a,b)=>a.GetTime()-b.GetTime());for(let a=0;a<this._keyframeDataItems.length;a++)this._keyframeDataItems[a].SetNext(this._keyframeDataItems[a+ 1])}GetTrackDataItem(){return this._trackDataItem}GetKeyframeDataItemCount(){return this._keyframeDataItems.length}GetKeyframeDataItemArray(){return this._keyframeDataItems}AddEmptyKeyframeDataItem(){const a=new KeyframeDataItem(null,this);this._keyframeDataItems.push(a);this._LinkKeyframeDataItems();return a}DeleteKeyframeDataItems(a){for(const b of this._keyframeDataItems){if(!a(b))continue;const c=this._keyframeDataItems.indexOf(b);-1!==c&&(b.Release(),this._keyframeDataItems.splice(c,1))}this.SortKeyframeDataItems(); this._LinkKeyframeDataItems()}SortKeyframeDataItems(){this._keyframeDataItems.sort((a,b)=>a.GetTime()-b.GetTime())}GetKeyframeDataItemIndex(a){return this._keyframeDataItems.indexOf(a)}GetKeyframeDataItemFromIndex(a){return this._keyframeDataItems[a]}*keyframeDataItems(){for(const a of this._keyframeDataItems)yield a}*keyframeDataItemsReverse(){for(let a=this._keyframeDataItems.length-1;0<=a;a--)yield this._keyframeDataItems[a]}_SaveToJson(){return{keyframeDataItemsJson:this._keyframeDataItems.map(a=> a._SaveToJson())}}_LoadFromJson(a){a&&(C3$jscomp$117.TimelineDataManager._LoadDataItemsFromJson(this._keyframeDataItems,a.keyframeDataItemsJson,KeyframeDataItem,this),this._LinkKeyframeDataItems())}};"use strict";const C3$jscomp$118=self.C3; class PropertyKeyframeDataItem{constructor(a,b){this._propertyKeyframeData=b;this._aValue=this._value=null;this._type="";this._time=NaN;this._ease="noease";this._enable=!1;this._addonData=null;this._addonInstance=void 0;this._pathMode="line";a&&(this._value=a[0][0],this._aValue=a[0][1],this._type=a[0][2],this._time=a[1],this._ease=a[2],this._enable=!!a[3],this._pathMode=a[5],this._addonData=null,a[4]&&(this._addonData=new C3$jscomp$118.AddonData(a[4],this)),this._prev=this._next=null)}Release(){this._propertyKeyframeData= null;this._addonData&&(this._addonData.Release(),this._addonData=null);this._prev=this._next=null}GetAddonData(){return this._addonData}SetNext(a){this._next=a}GetNext(){return this._next}SetPrevious(a){this._prev=a}GetPrevious(){return this._prev}GetValue(){return this._value}SetValue(a){"color"===this._type&&C3$jscomp$118.IsFiniteNumber(a)?(this._value[0]=C3$jscomp$118.GetRValue(a),this._value[1]=C3$jscomp$118.GetGValue(a),this._value[2]=C3$jscomp$118.GetBValue(a)):this._value=a}GetAbsoluteValue(){return this._aValue}SetAbsoluteValue(a){"color"=== this._type&&C3$jscomp$118.IsFiniteNumber(a)?(this._aValue[0]=C3$jscomp$118.GetRValue(a),this._aValue[1]=C3$jscomp$118.GetGValue(a),this._aValue[2]=C3$jscomp$118.GetBValue(a)):this._aValue=a}GetValueWithResultMode(){const a=this._propertyKeyframeData.GetPropertyTrackDataItem().GetResultMode();if("relative"===a)return this.GetValue();if("absolute"===a)return this.GetAbsoluteValue()}GetType(){return this._type}SetType(a){this._type=a}GetTime(){return this._time}SetTime(a){this._time=a;this._propertyKeyframeData._LinkPropertyKeyframeDataItems()}GetEase(){return this._ease}SetEase(a){this._ease= a}GetEnable(){return this._enable}SetEnable(a){this._enable=!!a}GetPathMode(){return this._pathMode}GetAddOn(a){if(this._addonData){if(this._addonInstance||null===this._addonInstance)return this._addonInstance;var b=this._addonData.GetAddDataItemArray();if(!b)return this._addonInstance=null;var c=b.length;for(let d=0;d<c;d++){const e=b[d];if(e.GetId()===a)return this._addonInstance=e}return this._addonInstance=null}}_SaveToJson(){const a=this._addonData;return{addonDataJson:a?a._SaveToJson():a,value:this._value, aValue:this._aValue,type:this._type,time:this._time,ease:this._ease,enable:this._enable}}_LoadFromJson(a){a&&(a.addonDataJson&&this._addonData._SetFromJson(a.addonDataJson),this._value=a.value,this._aValue=a.aValue,this._type=a.type,this._time=a.time,this._ease=a.ease,this._enable=a.enable)}} C3$jscomp$118.PropertyKeyframeData=class{constructor(a,b){this._propertyTrackDataItem=b;this._propertyKeyframeDataItems=[];this._propertyKeyframeDataItemsIncludingDisabled=[];C3$jscomp$118.TimelineDataManager._CreateDataItems(this._propertyKeyframeDataItems,a,PropertyKeyframeDataItem,this);C3$jscomp$118.TimelineDataManager._CreateDataItemsIncludingDisabled(this._propertyKeyframeDataItemsIncludingDisabled,a,PropertyKeyframeDataItem,this);this._LinkPropertyKeyframeDataItems()}Release(){this._propertyTrackDataItem= null;for(const a of this._propertyKeyframeDataItems)a.Release();C3$jscomp$118.clearArray(this._propertyKeyframeDataItems);this._propertyKeyframeDataItems=null;for(const a of this._propertyKeyframeDataItemsIncludingDisabled)a.Release();C3$jscomp$118.clearArray(this._propertyKeyframeDataItemsIncludingDisabled);this._propertyKeyframeDataItemsIncludingDisabled=null}_LinkPropertyKeyframeDataItems(){let a=this._propertyKeyframeDataItems;a.sort((d,e)=>d.GetTime()-e.GetTime());for(var b=0;b<a.length;b++){var c= a[b];b+1<a.length&&c.SetNext(a[b+1]);0<=b-1&&c.SetPrevious(a[b-1])}a=this._propertyKeyframeDataItemsIncludingDisabled;a.sort((d,e)=>d.GetTime()-e.GetTime());for(b=0;b<a.length;b++)c=a[b],b+1<a.length&&c.SetNext(a[b+1]),0<=b-1&&c.SetPrevious(a[b-1])}AddEmptyPropertyKeyframeDataItem(){const a=new PropertyKeyframeDataItem(null,this);this._propertyKeyframeDataItems.push(a);this._LinkPropertyKeyframeDataItems();return a}DeletePropertyKeyframeDataItems(a){for(const b of this._propertyKeyframeDataItems){if(!a(b))continue; const c=this._propertyKeyframeDataItems.indexOf(b);-1!==c&&(b.Release(),this._propertyKeyframeDataItems.splice(c,1))}this.SortPropertyKeyFrameDataItems();this._LinkPropertyKeyframeDataItems()}SortPropertyKeyFrameDataItems(){this._propertyKeyframeDataItems.sort((a,b)=>a.GetTime()-b.GetTime())}GetPropertyTrackDataItem(){return this._propertyTrackDataItem}GetPropertyKeyframeDataItemCount(){return this._propertyKeyframeDataItems.length}GetLastPropertyKeyframeDataItem(){return this._propertyKeyframeDataItems[this._propertyKeyframeDataItems.length- 1]}GetPropertyKeyframeDataItemArray(){return this._propertyKeyframeDataItems}GetPropertyKeyframeDataItemArrayIncludingDisabled(){return this._propertyKeyframeDataItemsIncludingDisabled}*propertyKeyframeDataItems(){for(const a of this._propertyKeyframeDataItems)yield a}*propertyKeyframeDataItemsReverse(){for(let a=this._propertyKeyframeDataItems.length-1;0<=a;a--)yield this._propertyKeyframeDataItems[a]}_SaveToJson(){const a=this._propertyKeyframeDataItemsIncludingDisabled;return{propertyKeyframeDataItemsJson:this._propertyKeyframeDataItems.map(b=> b._SaveToJson()),propertyKeyframeDataItemsIncludingDisabledJson:a.map(b=>b._SaveToJson())}}_LoadFromJson(a){a&&(C3$jscomp$118.TimelineDataManager._LoadDataItemsFromJson(this._propertyKeyframeDataItems,a.propertyKeyframeDataItemsJson,PropertyKeyframeDataItem,this),C3$jscomp$118.TimelineDataManager._LoadDataItemsFromJson(this._propertyKeyframeDataItemsIncludingDisabled,a.propertyKeyframeDataItemsIncludingDisabledJson,PropertyKeyframeDataItem,this),this._LinkPropertyKeyframeDataItems())}};"use strict"; const C3$jscomp$119=self.C3;class AddonDataItem{constructor(a,b){this._addonData=b;this._id=a[0];this._data=a[1]}Release(){this._data=this._addonData=null}GetAddonData(){return this._addonData}GetId(){return this._id}_SaveToJson(){return{id:this._id,data:this._data}}_LoadFromJson(a){a&&(this._id=a.id,this._data=a.data)}} class AddonDataCubicBezierItem extends AddonDataItem{constructor(a,b){super(a,b);this._startAnchor=this._data[0];this._startEnable=!!this._data[1];this._endAnchor=this._data[2];this._endEnable=!!this._data[3]}Release(){super.Release()}GetStartAnchor(){return this._startAnchor}GetStartEnable(){return this._startEnable}GetEndAnchor(){return this._endAnchor}GetEndEnable(){return this._endEnable}_SaveToJson(){return Object.assign(super._SaveToJson(),{startAnchor:this._startAnchor,startEnable:!!this._startEnable, endAnchor:this._endAnchor,endEnable:!!this._endEnable})}_LoadFromJson(a){a&&(super._LoadFromJson(a),this._startAnchor=a.startAnchor,this._startEnable=!!a.startEnable,this._endAnchor=a.endAnchor,this._endEnable=!!a.endEnable)}} class AddonDataAngleItem extends AddonDataItem{constructor(a,b){super(a,b);this._direction=this._data[0];this._revolutions=this._data[1]}Release(){super.Release()}GetDirection(){return this._direction}GetRevolutions(){return this._revolutions}_SaveToJson(){return Object.assign(super._SaveToJson(),{direction:this._direction,revolutions:this._revolutions})}_LoadFromJson(a){a&&(super._LoadFromJson(a),this._direction=a.direction,this._revolutions=a.revolutions)}} C3$jscomp$119.AddonData=class{constructor(a,b){this._propertyKeyframeDataItem=b;this._addonDataItems=[];C3$jscomp$119.TimelineDataManager._CreateDataItems(this._addonDataItems,a,{prop:0,map:new Map([["cubic-bezier",AddonDataCubicBezierItem],["angle",AddonDataAngleItem]])},this)}Release(){this._propertyKeyframeDataItem=null;for(const a of this._addonDataItems)a.Release();C3$jscomp$119.clearArray(this._addonDataItems);this._addonDataItems=null}GetPropertyKeyframeDataItem(){return this._propertyKeyframeDataItem}GetAddDataItemArray(){return this._addonDataItems}*addonDataItems(){for(const a of this._addonDataItems)yield a}_SaveToJson(){return{addonDataItemsJson:this._addonDataItems.map(a=> a._SaveToJson())}}_LoadFromJson(a){a&&C3$jscomp$119.TimelineDataManager._LoadDataItemsFromJson(this._addonDataItems,a.addonDataItemsJson,{prop:"id",map:new Map([["cubic-bezier",AddonDataCubicBezierItem],["angle",AddonDataAngleItem]])},this)}};"use strict";const C3$jscomp$120=self.C3;let createdTweens=0; C3$jscomp$120.TweenState=class extends C3$jscomp$120.TimelineState{constructor(a,b){super(`tween-${createdTweens++}`,a,b);this._id="";this._destroyInstanceOnComplete=!1;this._initialValueMode="start-value";this._iTweenState=this._track=this._on_started_callbacks=this._on_completed_callbacks=this._instance=null}FireReleaseEvent(a){const b=C3$jscomp$120.New(C3$jscomp$120.Event,"tweenstatereleased");b.tweenState=this;a.dispatchEvent(b)}GetType(){return 1}CreateTrackStates(){for(const a of this._timelineDataItem.GetTrackData().trackDataItems())this._tracks.push(C3$jscomp$120.TweenTrackState.Create(this, a));this._track=this._tracks[0]}AddTrack(){var a=this._timelineDataItem.GetTrackData().AddEmptyTrackDataItem();a=C3$jscomp$120.TweenTrackState.Create(this,a);this._tracks.push(a);this._track=this._tracks[0];return a}GetPropertyTrack(a){return this._track.GetPropertyTracks()[0]}SetPropertyType(a){this._propertyType=a}GetInstance(){var a=this.GetTracks();if(a&&a.length&&(this._track=a=a[0])){var b=a.GetInstance();return a.IsInstanceValid()?b:void 0}}AddStartedCallback(a){this._on_started_callbacks|| (this._on_started_callbacks=[]);this._on_started_callbacks.push(a)}AddCompletedCallback(a){this._on_completed_callbacks||(this._on_completed_callbacks=[]);this._on_completed_callbacks.push(a)}RemoveStartedCallback(a){this._on_started_callbacks&&(a=this._on_started_callbacks.indexOf(a),-1!==a&&this._on_started_callbacks.splice(a,1))}RemoveCompletedCallback(a){this._on_completed_callbacks&&(a=this._on_completed_callbacks.indexOf(a),-1!==a&&this._on_completed_callbacks.splice(a,1))}SetStartValue(a,b){for(const d of this._tracks)for(const e of d._propertyTracks){if(e.GetPropertyName()!== b)continue;var c=e.GetPropertyTrackData();const g=e.GetPropertyTrackDataItem();c=c.GetFirstPropertyKeyframeDataItem(g);c.SetValue(a);c.SetAbsoluteValue(a)}}_GetPropertyTrackState(a){for(const b of this._tracks)for(const c of b._propertyTracks)if(c.GetPropertyName()===a)return c}BeforeSetEndValues(a){for(const d of a)a=this._GetPropertyTrackState(d),this.SetStartValue(a.GetCurrentState(),d);if(this.IsForwardPlayBack()){var b=this.GetTotalTime()-this.GetTime();this.SetTotalTime(b);for(var c of this._tracks)c.SetLocalTotalTime(b); this._SetTime(0)}else{c=this.GetTime();this.SetTotalTime(c);for(b of this._tracks)b.SetLocalTotalTime(c);this._SetTime(c)}this.SetInitialStateFromSetTime()}SetEndValue(a,b){var c=this._GetPropertyTrackState(b);b=c.GetPropertyTrackData();c=c.GetPropertyTrackDataItem();b=b.GetLastPropertyKeyframeDataItem(c);b.SetTime(this.GetTotalTime());b.SetValue(a);b.SetAbsoluteValue(a)}SetId(a){this._id=a}GetId(){return this._id}SetInitialValueMode(a){this._initialValueMode=a}GetInitialValueMode(){return this._initialValueMode}SetDestroyInstanceOnComplete(a){this._destroyInstanceOnComplete= a}GetDestroyInstanceOnComplete(){return this._destroyInstanceOnComplete}OnStarted(){if(this._on_started_callbacks)for(const a of this._on_started_callbacks)a(this);if(!this.IsComplete())for(const a of this._tracks)a.CompareSaveStateWithCurrent()}OnCompleted(){this._completedTick=this._runtime.GetTickCount()}FinishTriggers(){if(!this._finishedTriggers&&(this._finishedTriggers=!0,this._on_completed_callbacks))for(const a of this._on_completed_callbacks)a(this)}SetTime(a){this._DeleteIntermediateKeyframes(); super.SetTime(a)}_SetTimeAndReset(a){C3$jscomp$120.IsFiniteNumber(a)||(a=this.GetTotalTime());0>a?this._playheadTime=0:a>=this.GetTotalTime()?this._playheadTime=this.GetTotalTime():this._playheadTime=a;this._track.SetResetState()}SetInitialState(a){if(!this.InitialStateSet()&&"current-state"===this.GetInitialValueMode())for(const b of this._tracks)b.CompareInitialStateWithCurrent();super.SetInitialState(a)}Stop(a=!1){super.Stop(a);if(!this.IsComplete())for(const b of this._tracks)b.SaveState()}Reset(a= !0,b=!1){this._DeleteIntermediateKeyframes();super.Reset(a,b)}_DeleteIntermediateKeyframes(){for(const a of this._tracks){const b=c=>{c=c.GetTime();const d=this.GetTotalTime();return 0!==c&&c!==d};a.DeleteKeyframes(b);a.DeletePropertyKeyframes(b)}}_OnBeforeChangeLayout(){if(this.IsReleased())return!0;const a=this.GetInstance();if(a&&a.GetObjectClass().IsGlobal())return!1;this._timelineManager.CompleteTimelineBeforeChangeOfLayout(this);this.ResetBeforeChangeLayout();return!0}Tick(a,b,c){this._instance|| (this._instance=this.GetInstance());if(!this._instance||this._instance.IsDestroyed())this.Stop(!0),this.OnCompleted();else if(b=this._instance.GetTimeScale(),-1!==b&&(a=c*b),0!==a||0!==this._lastDelta){this._lastDelta=a;c=this._playheadTime+a*this._playbackRate;a=this._timelineDataItem._totalTime;this._playheadTime=0>c?0:c>=a?a:c;b=c=!1;var d=this.GetLoop(),e=this.GetPingPong();d||e?d&&!e?0<this._playbackRate?this._playheadTime>=a&&(this._SetTimeAndReset(0),b=!0):0>=this._playheadTime&&(this._SetTimeAndReset(a), b=!0):!d&&e?0<this._playbackRate?this._playheadTime>=a&&(this._SetTime(a),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,1===this._pingPongState?this._currentRepeatCount<this.GetRepeatCount()?(this._currentRepeatCount++,this._pingPongState=0):c=!0:0===this._pingPongState&&(this._pingPongState=1)):0>=this._playheadTime&&(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,1===this._pingPongState?this._currentRepeatCount<this.GetRepeatCount()?(this._currentRepeatCount++,this._pingPongState= 0):c=!0:0===this._pingPongState&&(this._pingPongState=1)):d&&e&&(0<this._playbackRate?this._playheadTime>=a&&(this._SetTime(a),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,this._pingPongState++,C3$jscomp$120.wrap(this._pingPongState,0,2)):0>=this._playheadTime&&(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,this._pingPongState++,C3$jscomp$120.wrap(this._pingPongState,0,2))):0<this._playbackRate?this._playheadTime>=a&&(this._currentRepeatCount<this.GetRepeatCount()? (this._currentRepeatCount++,this._SetTimeAndReset(0),b=!0):(this._SetTime(a),c=!0)):0>=this._playheadTime&&(this._currentRepeatCount<this.GetRepeatCount()?(this._currentRepeatCount++,this._SetTimeAndReset(a),b=!0):(this._SetTime(0),c=!0));c?(this._track.SetEndState(),this.Stop(!0),this.OnCompleted()):(this._track.Interpolate(this._playheadTime,!0,!1,b,this._firstTick,!1),this._firstTick&&(this._firstTick=!1))}}_SaveToJson(){const a=super._SaveToJson(),b=this.GetTimelineDataItem();return Object.assign(a, {tweenDataItemJson:b._SaveToJson(),id:this._id,destroyInstanceOnComplete:this._destroyInstanceOnComplete,initialValueMode:this._initialValueMode})}_LoadFromJson(a){a&&(this.GetTimelineDataItem()._LoadFromJson(a.tweenDataItemJson),super._LoadFromJson(a),this._id=a.id,this._destroyInstanceOnComplete=a.destroyInstanceOnComplete,this._initialValueMode=a.initialValueMode)}static IsPlaying(a){return a.IsPlaying()}static IsPaused(a){return a.IsPaused()}static Build(a){var b=a.runtime.GetTimelineManager(), c=new C3$jscomp$120.TimelineDataItem;if(a.json){c._LoadFromJson(a.json.tweenDataItemJson);var d=new C3$jscomp$120.TweenState(c,b);d._LoadFromJson(a.json);return d}b=new C3$jscomp$120.TweenState(c,b);C3$jscomp$120.IsArray(a.propertyTracksConfig)||(a.propertyTracksConfig=[a.propertyTracksConfig]);b.SetId(a.id);b.SetTags(a.tags);b.SetInitialValueMode(a.initialValueMode);b.SetDestroyInstanceOnComplete(a.releaseOnComplete);b.SetLoop(a.loop);b.SetPingPong(a.pingPong);b.SetTotalTime(a.time);b.SetStep(0); b.SetInterpolationMode("default");b.SetResultMode(a.propertyTracksConfig[0].resultMode);b.SetRepeatCount(a.repeatCount);c=b.AddTrack();c.SetInstanceUID(a.instance.GetUID());c.SetInterpolationMode("default");c.SetResultMode(a.propertyTracksConfig[0].resultMode);c.SetEnable(!0);c.SetObjectClassIndex(a.instance.GetObjectClass().GetIndex());var e=a.instance.GetSdkInstance(),g=e.IsOriginalSizeKnown()?e.GetOriginalWidth():a.instance.GetWorldInfo().GetWidth();e=e.IsOriginalSizeKnown()?e.GetOriginalHeight(): a.instance.GetWorldInfo().GetHeight();c.SetOriginalWidth(g);c.SetOriginalHeight(e);g=c.AddKeyframe();g.SetTime(0);g.SetEase("noease");g.SetEnable(!0);g.SetTags("");g=c.AddKeyframe();g.SetTime(a.time);g.SetEase("noease");g.SetEnable(!0);g.SetTags("");for(d of a.propertyTracksConfig)g=c.AddPropertyTrack(),g.SetSourceAdapterId(d.sourceId),g.SetSourceAdapterArgs(d.sourceArgs),g.SetPropertyName(d.property),g.SetPropertyType(d.type),g.SetMin(NaN),g.SetMax(NaN),g.SetInterpolationMode("default"),g.SetResultMode(d.resultMode), g.SetEnable(!0),e=g.AddPropertyKeyframe(),e.SetType(d.valueType),e.SetTime(0),e.SetEase(d.ease),e.SetEnable(!0),e.SetValue(d.startValue),e.SetAbsoluteValue(d.startValue),e=g.AddPropertyKeyframe(),e.SetType(d.valueType),e.SetTime(a.time),e.SetEase(d.ease),e.SetEnable(!0),e.SetValue(d.endValue),e.SetAbsoluteValue(d.endValue),g.GetSourceAdapter();return b}GetITweenState(a,b){this._iTweenState||(this._iTweenState=C3$jscomp$120.New(self.ITweenState,this,a,b));return this._iTweenState}};"use strict"; const C3$jscomp$121=self.C3; C3$jscomp$121.TweenTrackState=class extends C3$jscomp$121.TrackState{constructor(a,b){super(a,b);this._secondPropertyTrack=this._firstPropertyTrack=null}static Create(a,b){return C3$jscomp$121.New(C3$jscomp$121.TweenTrackState,a,b)}_CachePropertyTracks(){1===this._propertyTracks.length?this._firstPropertyTrack=this._propertyTracks[0]:(this._firstPropertyTrack=this._propertyTracks[0],this._secondPropertyTrack=this._propertyTracks[1])}CreatePropertyTrackStates(){for(const a of this._trackDataItem.GetPropertyTrackData().propertyTrackDataItems())this._propertyTracks.push(C3$jscomp$121.TweenPropertyTrackState.Create(this,a)); this._CachePropertyTracks()}AddPropertyTrack(){var a=this._trackDataItem.GetPropertyTrackData().AddEmptyPropertyTrackDataItem();a=C3$jscomp$121.TweenPropertyTrackState.Create(this,a);this._propertyTracks.push(a);this._CachePropertyTracks();return a}SetInitialState(){this.MaybeGetInstance();if(this.IsInstanceValid()||!this.IsInstanceTrack()){var a=this.GetTimeline().IsForwardPlayBack()?0:this.GetLocalTotalTime();for(const b of this._propertyTracks)b.SetInitialState(a),0===this._worldInfoChange&&1=== b.GetWorldInfoChange()&&(this._worldInfoChange=1),0===this._renderChange&&1===b.GetRenderChange()&&(this._renderChange=1);this._needsBeforeAndAfter=0;this._propertyTracks.some(b=>b.GetNeedsBeforeAndAfter())&&(this._needsBeforeAndAfter=1);this._lastKeyframeDataItem=this._GetLastKeyFrameBeforeTime(a);this._endStateOfNestedSet=this._initialStateOfNestedSet=!1;this.Interpolate(a)}}BeforeInterpolate(){}Interpolate(a,b,c=!1,d=!1,e,g=!1,k=!1){this._instance||this.GetInstance();if(this._instance){if(this._instance.IsDestroyed()|| g&&this.GetObjectClass().IsGlobal())return!1;this._secondPropertyTrack?(this._firstPropertyTrack.Interpolate(a,c,d,k),this._secondPropertyTrack.Interpolate(a,c,d,k)):this._firstPropertyTrack.Interpolate(a,c,d,k);0!==this._firstPropertyTrack.GetWorldInfoChange()&&(this._worldInfo||(this._worldInfo=this._instance.GetWorldInfo()),this._worldInfo&&this._worldInfo.SetBboxChanged())}}AfterInterpolate(){}_LoadFromJson(a){super._LoadFromJson(a);this._CachePropertyTracks()}};"use strict"; const C3$jscomp$122=self.C3; C3$jscomp$122.TweenPropertyTrackState=class extends C3$jscomp$122.PropertyTrackState{constructor(a,b){super(a,b);this._basic=!1}static Create(a,b){return C3$jscomp$122.New(C3$jscomp$122.TweenPropertyTrackState,a,b)}Interpolate(a,b=!1,c=!1,d=!1){if(this._basic){var e=this._propertyKeyframeDataItems[0];var g=this._propertyKeyframeDataItems[1]}else{if(b)e=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem);else{if(this._lastPropertyKeyframeDataItem){g=this.GetTimeline(); const k=this._lastPropertyKeyframeDataItem.GetNext();e=this._lastPropertyKeyframeDataItem.GetTime();g=k?k.GetTime():g.GetTotalTime();if(a<=e||a>=g)this._lastPropertyKeyframeDataItem=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem)}else this._lastPropertyKeyframeDataItem=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem);e=this._lastPropertyKeyframeDataItem}g=e.GetNext()}this._sourceAdapter.Interpolate(a, e,g,b,c,d)}AddPropertyKeyframe(){const a=this._propertyTrackDataItem.GetPropertyKeyframeData().AddEmptyPropertyKeyframeDataItem();this._lastPropertyKeyframeDataItem=null;this._basic=2>=this.GetPropertyKeyframeDataItems().length;return a}DeletePropertyKeyframes(a){this._lastPropertyKeyframeDataItem=null;this._propertyTrackDataItem.GetPropertyKeyframeData().DeletePropertyKeyframeDataItems(a);this._basic=2>=this.GetPropertyKeyframeDataItems().length}_SaveToJson(){return{sourceAdapterJson:this.GetSourceAdapter()._SaveToJson(), basic:this._basic}}_LoadFromJson(a){a&&(this.GetSourceAdapter()._LoadFromJson(a.sourceAdapterJson),this._basic=a.basic)}};"use strict";const C3$jscomp$123=self.C3,Ease$jscomp$2=self.Ease; C3$jscomp$123.Transition=class extends C3$jscomp$123.DefendedBase{constructor(a,b=!0){super();this._name=a[0];this._linear=!1;this._transitionKeyframes=[];for(var c of a[1])a=C3$jscomp$123.TransitionKeyframe.Create(this,c),this._transitionKeyframes.push(a);for(c=0;c<this._transitionKeyframes.length;c++)this._transitionKeyframes[c].SetNext(this._transitionKeyframes[c+1]);this._precalculatedSamples=new Map;this._transitionKeyframeCache=new Map;this._PreCalcSamples();b&&Ease$jscomp$2.AddCustomEase(this._name, (d,e,g,k)=>this.Interpolate(d,e,g,k))}static Create(a){return C3$jscomp$123.New(C3$jscomp$123.Transition,a)}Release(){for(const a of this._transitionKeyframes)a.Release();C3$jscomp$123.clearArray(this._transitionKeyframes);this._transitionKeyframes=null;this._precalculatedSamples.clear();this._precalculatedSamples=null;this._transitionKeyframeCache.clear();this._transitionKeyframeCache=null}MakeLinear(a){this._linear=!!a}GetTransitionKeyFrameAt(a){const b=this._transitionKeyframeCache.get(a);if(b)return b; for(const c of this._transitionKeyframes)if(c.GetValueX()===a)return this._transitionKeyframeCache.set(a,c),c}GetFirstTransitionKeyFrameHigherThan(a){for(const b of this._transitionKeyframes)if(b.GetValueX()>a)return b}GetFirstTransitionKeyFrameHigherOrEqualThan(a){for(const b of this._transitionKeyframes)if(b.GetValueX()>=a)return b}GetFirstTransitionKeyFrameLowerThan(a){for(let b=this._transitionKeyframes.length-1;0<=b;b--){const c=this._transitionKeyframes[b];if(c.GetValueX()<a)return c}}GetFirstTransitionKeyFrameLowerOrEqualThan(a){for(let b= this._transitionKeyframes.length-1;0<=b;b--){const c=this._transitionKeyframes[b];if(c.GetValueX()<=a)return c}}Interpolate(a,b,c,d){var e=a/d;if(this._linear)return 0===d?b+c:Ease$jscomp$2.NoEase(a,b,c,d);0===d&&(e=1);a=this.GetFirstTransitionKeyFrameLowerOrEqualThan(e);d=a.GetNext();d||(a=this.GetFirstTransitionKeyFrameLowerThan(e),d=a.GetNext());var g=d.GetValueX()-a.GetValueX();e=C3$jscomp$123.mapToRange(e,a.GetValueX(),d.GetValueX(),0,g);g=a.GetValueX();const k=a.GetValueY(),l=a.GetValueX()+ a.GetStartAnchorX(),n=a.GetValueY()+a.GetStartAnchorY(),p=d.GetValueX()+d.GetEndAnchorX(),r=d.GetValueY()+d.GetEndAnchorY(),w=d.GetValueX();d=d.GetValueY();d=Ease$jscomp$2.GetRuntimeEase("spline")(e,g,k,l,n,p,r,w,d,this._precalculatedSamples.get(a));d+=a.GetValueY();return(1-d)*b+d*(b+c)}_PreCalcSamples(){this._precalculatedSamples.clear();for(let c=0;c<this._transitionKeyframes.length-1;c++){var a=this._transitionKeyframes[c];if(!a.GetStartEnable())continue;var b=this._transitionKeyframes[c+1];const d= a.GetValueX(),e=a.GetValueX()+a.GetStartAnchorX(),g=b.GetValueX()+b.GetEndAnchorX();b=b.GetValueX();this._precalculatedSamples.set(a,Ease$jscomp$2.GetBezierSamples(d,e,g,b))}}};"use strict";const C3$jscomp$124=self.C3; C3$jscomp$124.TransitionKeyframe=class extends C3$jscomp$124.DefendedBase{constructor(a,b){super();this._transition=a;this._valueX=b[0];this._valueY=b[1];this._startAnchorX=b[2];this._startAnchorY=b[3];this._endAnchorX=b[4];this._endAnchorY=b[5];this._startEnable=b[6];this._endEnable=b[7];this._next=null}Release(){this._transition=null}static Create(a,b){return C3$jscomp$124.New(C3$jscomp$124.TransitionKeyframe,a,b)}SetNext(a){this._next=a}GetNext(){return this._next}GetValueX(){return this._valueX}GetValueY(){return this._valueY}GetStartAnchorX(){return this._startAnchorX}GetStartAnchorY(){return this._startAnchorY}GetEndAnchorX(){return this._endAnchorX}GetEndAnchorY(){return this._endAnchorY}GetStartEnable(){return this._startEnable}GetEndEnable(){return this._endEnable}}; "use strict";const C3$jscomp$125=self.C3;C3$jscomp$125.TransitionManager=class extends C3$jscomp$125.DefendedBase{constructor(a){super();this._runtime=a;this._transitions=[]}Release(){for(const a of this._transitions)a.Release();C3$jscomp$125.clearArray(this._transitions);this._transitions=null}Create(a){this._transitions.push(C3$jscomp$125.Transition.Create(a))}};"use strict";const C3$jscomp$126=self.C3; C3$jscomp$126.TemplateManager=class extends C3$jscomp$126.DefendedBase{constructor(a){super();this._runtime=a;this._instanceToTemplateNameMap=this._templateDataMap=null;this._instanceDestroy=b=>this._OnInstanceDestroy(b.instance)}Release(){this.RemoveRuntimeListeners();if(this._templateDataMap){for(const a of this._templateDataMap.values())a.clear();this._templateDataMap.clear()}this._runtime=this._templateDataMap=null}Create(a){this._templateDataMap||(this._templateDataMap=new Map);if(a){var b=a[0][16][0], c=a[1];this._templateDataMap.has(c)||this._templateDataMap.set(c,new Map);this._templateDataMap.get(c).set(b,a)}}AddRuntimeListeners(){const a=this._runtime.Dispatcher();a&&a.addEventListener("instancedestroy",this._instanceDestroy)}RemoveRuntimeListeners(){const a=this._runtime.Dispatcher();a&&a.removeEventListener("instancedestroy",this._instanceDestroy)}HasTemplates(){return this._templateDataMap?0!==this._templateDataMap.size:!1}GetTemplateData(a,b){a=a instanceof C3$jscomp$126.ObjectClass?a.GetIndex(): a;if(this._templateDataMap.has(a)&&(b=this._templateDataMap.get(a).get(b)))return JSON.parse(JSON.stringify(b))}MapInstanceToTemplateName(a,b){this._instanceToTemplateNameMap||(this._instanceToTemplateNameMap=new WeakMap);this._instanceToTemplateNameMap.has(a)||this._instanceToTemplateNameMap.set(a,b)}GetInstanceTemplateName(a){return this._instanceToTemplateNameMap?(a=this._instanceToTemplateNameMap.get(a))?a:"":""}_OnInstanceDestroy(a){this._instanceToTemplateNameMap&&this._instanceToTemplateNameMap.has(a)&& this._instanceToTemplateNameMap.delete(a)}};"use strict";const C3$jscomp$127=self.C3; C3$jscomp$127.SolStack=class extends C3$jscomp$127.DefendedBase{constructor(a){super();this._objectClass=a;this._stack=[];this._stack.push(C3$jscomp$127.New(C3$jscomp$127.Sol,this));this._index=0;this._current=this._stack[0]}Release(){for(const a of this._stack)a.Release();C3$jscomp$127.clearArray(this._stack);this._objectClass=this._current=null}GetObjectClass(){return this._objectClass}GetCurrentSol(){return this._current}GetOneBelowCurrentSol(){return this._stack[this._index-1]}Clear(){this.GetCurrentSol().Clear()}PushClean(){var a= this._stack,b=++this._index;b===a.length?(b=C3$jscomp$127.New(C3$jscomp$127.Sol,this),a.push(b),this._current=b):(a=a[b],a.Reset(),this._current=a)}PushCopy(){const a=this._stack,b=++this._index;b===a.length&&a.push(C3$jscomp$127.New(C3$jscomp$127.Sol,this));const c=a[b];c.Copy(a[b-1]);this._current=c}Pop(){this._current=this._stack[--this._index]}RemoveInstances(a){const b=this._stack;for(let c=0,d=b.length;c<d;++c)b[c].RemoveInstances(a)}};"use strict";const C3$jscomp$128=self.C3; C3$jscomp$128.Sol=class extends C3$jscomp$128.DefendedBase{constructor(a){super();this._stack=a;this._objectClass=this._stack.GetObjectClass();this._eventStack=this._objectClass.GetRuntime().GetEventStack();this._selectAll=!0;this._instances=[];this._elseInstances=[]}Release(){this.ClearArrays();this._eventStack=this._objectClass=this._stack=null}ClearArrays(){C3$jscomp$128.clearArray(this._instances);C3$jscomp$128.clearArray(this._elseInstances)}GetObjectClass(){return this._objectClass}IsSelectAll(){return this._selectAll}HasAnyInstances(){return this._selectAll? !!this._objectClass.GetInstanceCount():!!this._instances.length}GetInstances(){return this._selectAll?this._objectClass.GetInstances():this._instances}HasAnyElseInstances(){return!!this._elseInstances.length}GetElseInstances(){return this._elseInstances}GetExpressionInstances(){const a=this.GetInstances();return a.length?a:this._elseInstances}Reset(){this._selectAll=!0;C3$jscomp$128.clearArray(this._elseInstances)}Clear(){this._selectAll=!0}Copy(a){a.IsSelectAll()?this.Reset():(this._selectAll=!1, C3$jscomp$128.shallowAssignArray(this._instances,a._instances),C3$jscomp$128.clearArray(this._elseInstances))}_PushInstance(a){this._instances.push(a)}_PushElseInstance(a){this._elseInstances.push(a)}_SetSelectAll(a){this._selectAll=!!a}_GetOwnInstances(){return this._instances}_GetOwnElseInstances(){return this._elseInstances}SetSinglePicked(a){this._selectAll=!1;C3$jscomp$128.clearArray(this._instances);this._instances.push(a)}SetArrayPicked(a){this._selectAll=!1;C3$jscomp$128.shallowAssignArray(this._instances, a)}SetSetPicked(a){this._selectAll=!1;C3$jscomp$128.clearArray(this._instances);for(const b of a)this._instances.push(b)}AddElseInstances(a,b){for(const c of b)a.has(c)||this._elseInstances.push(c)}TransferElseInstancesToOwn(a){for(const b of a)this._instances.push(b);C3$jscomp$128.arrayRemoveAllInSet(this._elseInstances,a)}ClearElseInstances(){C3$jscomp$128.clearArray(this._elseInstances)}PickOne(a){a&&(this._eventStack.GetCurrentStackFrame().GetCurrentEvent().IsOrBlock()?(this.IsSelectAll()&&(C3$jscomp$128.clearArray(this._instances), C3$jscomp$128.shallowAssignArray(this._elseInstances,a.GetObjectClass().GetInstances()),this._selectAll=!1),a=this._elseInstances.indexOf(a),-1!==a&&(this._instances.push(this._elseInstances[a]),this._elseInstances.splice(a,1))):this.SetSinglePicked(a))}RemoveInstances(a){C3$jscomp$128.arrayRemoveAllInSet(this._instances,a);C3$jscomp$128.arrayRemoveAllInSet(this._elseInstances,a)}};"use strict";const C3$jscomp$129=self.C3; C3$jscomp$129.EventStack=class extends C3$jscomp$129.DefendedBase{constructor(a){super();this._eventSheetManager=a;this._runtime=this._eventSheetManager.GetRuntime();this._stack=[];this._stack.push(C3$jscomp$129.New(C3$jscomp$129.EventStackFrame,this,null));this._index=0;this._expFuncStack=[]}Release(){for(const a of this._stack)a.Release();C3$jscomp$129.clearArray(this._stack);C3$jscomp$129.clearArray(this._expFuncStack);this._runtime=this._eventSheetManager=null}GetEventSheetManager(){return this._eventSheetManager}GetRuntime(){return this._runtime}GetCurrentStackFrame(){return this._stack[this._index]}GetAllStackFrames(){return this._stack}GetCurrentStackFrameIndex(){return this._index}Push(a){var b= this._stack;const c=++this._index;if(c===b.length)return a=C3$jscomp$129.New(C3$jscomp$129.EventStackFrame,this,a),b.push(a),a;b=b[c];b.Reset(a);return b}Pop(){--this._index}PushExpFunc(a){this._expFuncStack.push(a)}PopExpFunc(){this._expFuncStack.pop()}GetCurrentExpFuncStackFrame(){const a=this._expFuncStack;return 0===a.length?null:a.at(-1)}};"use strict";const C3$jscomp$130=self.C3; C3$jscomp$130.EventStackFrame=class extends C3$jscomp$130.DefendedBase{constructor(a,b){super();this._stack=a;this._runtime=this._stack.GetRuntime();this._currentEvent=b;this._actIndex=this._cndIndex=0;this._elseBranchRan=this._lastEventTrue=!1;this._expressionObjectClass=null;this._functionReturnValue=this._functionReturnType=0;this._dynamicSolModifiers=null}Release(){this.Reset(null);this._runtime=this._stack=null}Reset(a){this._currentEvent=a;this._actIndex=this._cndIndex=0;this._elseBranchRan= this._lastEventTrue=!1;this._dynamicSolModifiers=null}_Restore(a,b){this._currentEvent=a;this._cndIndex=0;this._actIndex=b}ResetQuick(){this._actIndex=this._cndIndex=0}GetCurrentEvent(){return this._currentEvent}SetCurrentEvent(a){this._currentEvent=a}GetConditionIndex(){return this._cndIndex}SetConditionIndex(a){this._cndIndex=a}GetActionIndex(){return this._actIndex}SetActionIndex(a){this._actIndex=a}SetLastEventTrue(a){this._lastEventTrue=!!a}GetLastEventTrue(){return this._lastEventTrue}SetElseBranchRan(a){this._elseBranchRan= !!a}GetElseBranchRan(){return this._elseBranchRan}SetExpressionObjectClass(a){this._expressionObjectClass=a}GetExpressionObjectClass(){return this._expressionObjectClass}InitCallFunctionExpression(a,b){this._functionReturnType=a;this._functionReturnValue=b}GetFunctionReturnType(){return this._functionReturnType}SetFunctionReturnValue(a){this._functionReturnValue=a}GetFunctionReturnValue(){return this._functionReturnValue}IsSolModifierAfterCnds(){const a=this._currentEvent;return a.IsSolWriterAfterCnds()? !0:this._cndIndex<a.GetConditionCount()-1?!!a.GetSolModifiers().length:!1}SetDynamicSolModifiers(a){this._dynamicSolModifiers=a}GetDynamicSolModifiers(){return this._dynamicSolModifiers}};"use strict";const C3$jscomp$131=self.C3; C3$jscomp$131.LocalVarStack=class extends C3$jscomp$131.DefendedBase{constructor(a){super();this._eventSheetManager=a;this._runtime=this._eventSheetManager.GetRuntime();this._stack=[];this._index=-1;this._current=null;this._initialValues=[]}Release(){C3$jscomp$131.clearArray(this._stack);this._runtime=this._eventSheetManager=null}_SetInitialValues(a){this._initialValues=a;a=this._initialValues.slice(0);this._stack.push(a);this._index=0;this._current=a}GetEventSheetManager(){return this._eventSheetManager}GetRuntime(){return this._runtime}GetCurrent(){return this._current}Push(){const a= ++this._index,b=this._stack;a===b.length?b.push(this._initialValues.slice(0)):C3$jscomp$131.shallowAssignArray(b[a],this._initialValues);this._current=b[a]}Pop(){this._current=this._stack[--this._index]}};"use strict";const C3$jscomp$132=self.C3; C3$jscomp$132.LoopStack=class extends C3$jscomp$132.DefendedBase{constructor(a){super();this._eventSheetManager=a;this._runtime=this._eventSheetManager.GetRuntime();this._stack=[];this._index=-1}Release(){C3$jscomp$132.clearArray(this._stack);this._runtime=this._eventSheetManager=null}GetEventSheetManager(){return this._eventSheetManager}GetRuntime(){return this._runtime}IsInLoop(){return 0<=this._index}GetCurrent(){return this._stack[this._index]}Push(){++this._index;if(this._index===this._stack.length){var a= C3$jscomp$132.New(C3$jscomp$132.Loop,this);this._stack.push(a);return a}a=this._stack[this._index];a.Reset();return a}Pop(){--this._index}FindByName(a){const b=this._stack;for(let c=this._index;0<=c;--c){const d=b[c];if(d.GetName()===a)return d}return null}_GetStack(){return this._stack.slice(0,this._index+1)}};"use strict";const C3$jscomp$133=self.C3; C3$jscomp$133.Loop=class extends C3$jscomp$133.DefendedBase{constructor(a){super();this._loopStack=a;this._name="";this._index=0;this._isStopped=!1;this._end=NaN}Reset(){this._name="";this._index=0;this._isStopped=!1;this._end=NaN}SetName(a){this._name=a}GetName(){return this._name}SetIndex(a){this._index=a}GetIndex(){return this._index}Stop(){this._isStopped=!0}IsStopped(){return this._isStopped}SetEnd(a){this._end=a}GetEnd(){return this._end}};"use strict";const C3$jscomp$134=self.C3; C3$jscomp$134.ArrayStack=class extends C3$jscomp$134.DefendedBase{constructor(){super();this._stack=[];this._index=-1}Release(){C3$jscomp$134.clearArray(this._stack)}GetCurrent(){return this._stack[this._index]}Push(){++this._index;if(this._index===this._stack.length){const a=[];this._stack.push(a);return a}return this._stack[this._index]}Pop(){--this._index}};"use strict";const C3$jscomp$135=self.C3;function SortSolArray(a,b){return a.GetIndex()-b.GetIndex()} function IsSolArrayIdentical(a,b){for(let c=0,d=a.length;c<d;++c)if(a[c]!==b[c])return!1;return!0} C3$jscomp$135.EventSheetManager=class extends C3$jscomp$135.DefendedBase{constructor(a){super();this._runtime=a;this._allSheets=[];this._sheetsByName=new Map;this._allGroups=[];this._groupsByName=new Map;this._blocksBySid=new Map;this._cndsBySid=new Map;this._actsBySid=new Map;this._allUniqueSolModifiers=new Map;this._eventVarsBySid=new Map;this._nextLocalVarIndex=0;this._allGlobalVars=[];this._allLocalVars=[];this._localVarInitialValues=[];this._functionBlocksByName=new Map;this._customActionBlocksMap= new Map;this._eventStack=C3$jscomp$135.New(C3$jscomp$135.EventStack,this);this._localVarStack=C3$jscomp$135.New(C3$jscomp$135.LocalVarStack,this);this._loopStack=C3$jscomp$135.New(C3$jscomp$135.LoopStack,this);this._triggersToPostInit=[];this._queuedTriggers=[];this._queuedDebugTriggers=[];this._blockFlushingDepth=this._executingTriggerDepth=this._runningEventsDepth=0;this._scheduledWaits=[];this._asyncActionPromises=[];self.c3_callFunction=(b,c)=>this._InvokeFunctionFromJS(b,c)}Release(){this.ClearAllScheduledWaits(); this._eventStack.Release();this._eventStack=null;this._localVarStack.Release();this._localVarStack=null;C3$jscomp$135.clearArray(this._queuedTriggers);C3$jscomp$135.clearArray(this._queuedDebugTriggers);this._runtime=null;C3$jscomp$135.clearArray(this._allSheets);this._sheetsByName.clear()}Create(a){a=C3$jscomp$135.New(C3$jscomp$135.EventSheet,this,a);this._allSheets.push(a);this._sheetsByName.set(a.GetName().toLowerCase(),a)}_AddTriggerToPostInit(a){this._triggersToPostInit.push(a)}_PostInit(){for(const a of this._customActionBlocksMap.values())a._CheckOverrideState(); for(const a of this._functionBlocksByName.values())a._PostInit();for(const a of this._customActionBlocksMap.values())a._PostInit();for(const a of this._allSheets)a._PostInit();for(const a of this._allSheets)a._UpdateDeepIncludes();for(const a of this._triggersToPostInit)a._PostInit(!1);C3$jscomp$135.clearArray(this._triggersToPostInit);this._localVarStack._SetInitialValues(this._localVarInitialValues)}GetRuntime(){return this._runtime}GetEventSheetByName(a){return this._sheetsByName.get(a.toLowerCase())|| null}_RegisterGroup(a){this._allGroups.push(a);this._groupsByName.set(a.GetGroupName(),a)}_RegisterEventBlock(a){this._blocksBySid.set(a.GetSID(),a)}_RegisterCondition(a){this._cndsBySid.set(a.GetSID(),a)}_RegisterAction(a){this._actsBySid.set(a.GetSID(),a)}_RegisterFunctionBlock(a){switch(a.GetFunctionType()){case 0:this._functionBlocksByName.set(a.GetFunctionName().toLowerCase(),a);break;case 1:this._customActionBlocksMap.set(a.GetFunctionName().toLowerCase(),a)}}_RegisterEventVariable(a){this._eventVarsBySid.set(a.GetSID(), a);a.IsGlobal()?this._allGlobalVars.push(a):this._allLocalVars.push(a)}_DeduplicateSolModifierList(a){2<=a.length&&a.sort(SortSolArray);let b=this._allUniqueSolModifiers.get(a.length);b||(b=[],this._allUniqueSolModifiers.set(a.length,b));for(let c=0,d=b.length;c<d;++c){const e=b[c];if(IsSolArrayIdentical(a,e))return e}b.push(a);return a}_GetNextLocalVarIndex(a){this._localVarInitialValues.push(a.GetInitialValue());return this._nextLocalVarIndex++}GetEventStack(){return this._eventStack}GetCurrentEventStackFrame(){return this.GetEventStack().GetCurrentStackFrame()}GetCurrentEvent(){return this.GetCurrentEventStackFrame().GetCurrentEvent()}GetCurrentCondition(){const a= this.GetCurrentEventStackFrame();return a.GetCurrentEvent().GetConditionAt(a.GetConditionIndex())}GetCurrentAction(){const a=this.GetCurrentEventStackFrame();return a.GetCurrentEvent().GetActionAt(a.GetActionIndex())}GetLocalVarStack(){return this._localVarStack}GetLoopStack(){return this._loopStack}GetAllLocalVariablesInScope(a){const b=[];for(a=a.GetScopeParent();a;)C3$jscomp$135.appendArray(b,a._GetAllLocalVariablesInScope()),a=a.GetScopeParent();return b}_GetLocalVariablesScriptInterface(a){const b= {};for(const c of this.GetAllLocalVariablesInScope(a))b[c.GetJsPropName()]=c._GetScriptInterfaceDescriptor();return Object.create(Object.prototype,b)}GetEventVariableBySID(a){return this._eventVarsBySid.get(a)||null}GetEventBlockBySID(a){return this._blocksBySid.get(a)||null}GetConditionBySID(a){return this._cndsBySid.get(a)||null}GetActionBySID(a){return this._actsBySid.get(a)||null}GetFunctionBlockByName(a){return this._functionBlocksByName.get(a.toLowerCase())||null}GetCustomActionBlockByName(a, b){let c=this._customActionBlocksMap.get((a.GetName()+"."+b).toLowerCase());if(c)return c;if(!a.IsFamily())for(const d of a.GetFamilies())if(c=this._customActionBlocksMap.get((d.GetName()+"."+b).toLowerCase()))return c;return null}GetAllGlobalVariables(){return this._allGlobalVars}GetAllLocalVariables(){return this._allLocalVars}ResetAllGlobalsToInitialValue(){for(const a of this._allGlobalVars)a.ResetToInitialValue()}GetEventGroupByName(a){return this._groupsByName.get(a.toLowerCase())||null}GetEventGroupBySID(a){return(a= this._blocksBySid.get(a))&&a.IsGroup()?a:null}GetAllGroups(){return this._allGroups}ResetAllGroupsInitialActivation(){for(const a of this._allGroups)a.ResetInitialActivation()}_ResetAllHasRunFlags(){for(const a of this._allSheets)a._ResetHasRunFlag()}RunEvents(a){this._ResetAllHasRunFlags();this._runningEventsDepth++;for(const b of a.runningLayouts())if(a=b.GetEventSheet())this._runtime.PushCurrentLayout(b),a.Run(),this._runtime.PopCurrentLayout();this._runningEventsDepth--}async DebugRunEvents(a){this._ResetAllHasRunFlags(); this._runningEventsDepth++;for(const b of this._DebugRunEventsGen(a))await this._runtime.DebugBreak(b);this._runningEventsDepth--}*_DebugRunEventsGen(a){for(const b of a.runningLayouts())if(a=b.GetEventSheet())this._runtime.PushCurrentLayout(b),yield*a.DebugRun(),this._runtime.PopCurrentLayout()}_Trigger(a,b,c,d){let e=!1;if(!a.GetMainRunningLayout())return this.QueueTrigger(b,c,d);this._executingTriggerDepth++;for(const g of a.runningLayouts())if(a=g.GetEventSheet()){this._runtime.PushCurrentLayout(g); for(const k of a.deepIncludes()){const l=k._Trigger(b,c,d);e=e||l}a=a._Trigger(b,c,d);e=e||a;this._runtime.PopCurrentLayout()}this._executingTriggerDepth--;return e}*_DebugTrigger(a,b,c,d){let e=!1;if(!a.GetMainRunningLayout())return this.QueueTrigger(b,c,d);this._executingTriggerDepth++;for(const g of a.runningLayouts())if(a=g.GetEventSheet()){this._runtime.PushCurrentLayout(g);for(const k of a.deepIncludes()){const l=yield*k._DebugTrigger(b,c,d);e=e||l}a=yield*a._DebugTrigger(b,c,d);e=e||a;this._runtime.PopCurrentLayout()}this._executingTriggerDepth--; return e}QueueTrigger(a,b,c){this._queuedTriggers.push([a,b,c]);return!1}QueueDebugTrigger(a,b,c){let d=null;const e=new Promise(g=>d=g);this._queuedDebugTriggers.push([a,b,c,d]);return e}*_RunQueuedDebugTriggersGen(){if(this._runtime.HitBreakpoint())throw Error("should not be in breakpoint");const a=this._runtime.GetLayoutManager();for(;this._queuedDebugTriggers.length;){const [b,c,d,e]=this._queuedDebugTriggers.shift(),g=yield*this._DebugTrigger(a,b,c,d);e(g)}}async RunQueuedDebugTriggersAsync(){for(const a of this._RunQueuedDebugTriggersGen())await this._runtime.DebugBreak(a)}_FastTrigger(a, b,c,d){let e=!1;var g=a.GetMainRunningLayout();if(a=g.GetEventSheet()){this._executingTriggerDepth++;this._runtime.PushCurrentLayout(g);g=a.deepIncludes();for(let k=0,l=g.length;k<l;++k){const n=g[k]._FastTrigger(b,c,d);e=e||n}b=a._FastTrigger(b,c,d);e=e||b;this._runtime.PopCurrentLayout();this._executingTriggerDepth--;return e}}*_DebugFastTrigger(a,b,c,d){let e=!1;var g=a.GetMainRunningLayout();if(a=g.GetEventSheet()){this._executingTriggerDepth++;this._runtime.PushCurrentLayout(g);g=a.deepIncludes(); for(let k=0,l=g.length;k<l;++k){const n=yield*g[k]._DebugFastTrigger(b,c,d);e=e||n}b=yield*a._DebugFastTrigger(b,c,d);e=e||b;this._runtime.PopCurrentLayout();this._executingTriggerDepth--;return e}}GetTriggerDepth(){return this._executingTriggerDepth}IsInTrigger(){return 0<this.GetTriggerDepth()}_IncTriggerDepth(){return++this._executingTriggerDepth}_DecTriggerDepth(){--this._executingTriggerDepth}IsRunningEvents(){return 0<this._runningEventsDepth}IsInEventEngine(){return this.IsRunningEvents()|| this.IsInTrigger()}_RunQueuedTriggers(a){for(const [b,c,d]of this._queuedTriggers)this._Trigger(a,b,c,d);C3$jscomp$135.clearArray(this._queuedTriggers)}BlockFlushingInstances(a){a?this._blockFlushingDepth++:this._blockFlushingDepth--}IsFlushingBlocked(){return 0<this._blockFlushingDepth}ClearSol(a){for(let b=0,c=a.length;b<c;++b)a[b].GetSolStack().Clear()}PushCleanSol(a){for(let b=0,c=a.length;b<c;++b)a[b].GetSolStack().PushClean()}PushCopySol(a){for(let b=0,c=a.length;b<c;++b)a[b].GetSolStack().PushCopy()}PopSol(a){for(let b= 0,c=a.length;b<c;++b)a[b].GetSolStack().Pop()}GetDynamicSolModifiersSet(a){const b=new Set,c=this._eventStack.GetAllStackFrames(),d=this._eventStack.GetCurrentStackFrameIndex();for(let e=0;e<=d;++e){const g=c[e].GetDynamicSolModifiers();if(g)for(const k of g)a&&a.has(k)||b.add(k)}return b}PushCleanSolDynamic(a){a=new Set([...a]);a=this.GetDynamicSolModifiersSet(a);if(0<a.size){for(const b of a)b.GetSolStack().PushClean();return[...a]}return null}AddScheduledWait(){const a=C3$jscomp$135.New(C3$jscomp$135.ScheduledWait, this);this._scheduledWaits.push(a);return a}scheduledWaits(){return this._scheduledWaits}RunScheduledWaits(){if(this._scheduledWaits.length){var a=this.GetCurrentEventStackFrame(),b=!1;this._runningEventsDepth++;for(let c=0,d=this._scheduledWaits.length;c<d;++c){const e=this._scheduledWaits[c];e._ShouldRun()&&e._Run(a);e.ShouldRelease()&&(b=!0)}b&&(this._FilterScheduledWaitsToRelease(),a.Reset(null));this._runningEventsDepth--}}async DebugRunScheduledWaits(){if(this._scheduledWaits.length){var a= this.GetCurrentEventStackFrame(),b=!1;this._runningEventsDepth++;for(let c=0,d=this._scheduledWaits.length;c<d;++c){const e=this._scheduledWaits[c];e._ShouldRun()&&await e._DebugRun(a);e.ShouldRelease()&&(b=!0)}b&&(this._FilterScheduledWaitsToRelease(),a.Reset(null));this._runningEventsDepth--}}_FilterScheduledWaitsToRelease(){const a=C3$jscomp$135.arrayFilterOut(this._scheduledWaits,b=>b.ShouldRelease());for(const b of a)b.Release()}ClearAllScheduledWaits(){for(const a of this._scheduledWaits)a.Release(); C3$jscomp$135.clearArray(this._scheduledWaits)}RemoveInstancesFromScheduledWaits(a){for(const b of this._scheduledWaits)b.RemoveInstances(a)}AddAsyncActionPromise(a){this._asyncActionPromises.push(a)}ClearAsyncActionPromises(){C3$jscomp$135.clearArray(this._asyncActionPromises)}GetPromiseForAllAsyncActions(){const a=Promise.all(this._asyncActionPromises);this._asyncActionPromises=[];return a}_SaveToJson(){return{groups:this._SaveGroupsToJson(),cnds:this._SaveCndsToJson(),acts:this._SaveActsToJson(), vars:this._SaveVarsToJson(),waits:this._SaveScheduledWaitsToJson()}}_LoadFromJson(a){this._LoadGroupsFromJson(a.groups);this._LoadCndsFromJson(a.cnds);this._LoadActsFromJson(a.acts);this._LoadVarsFromJson(a.vars);this._LoadScheduledWaitsFromJson(a.waits)}_SaveGroupsToJson(){const a={};for(const b of this.GetAllGroups())a[b.GetSID().toString()]=b.IsGroupActive();return a}_LoadGroupsFromJson(a){for(const [b,c]of Object.entries(a))a=parseInt(b,10),(a=this.GetEventGroupBySID(a))&&a.SetGroupActive(c)}_SaveCndsToJson(){const a= {};for(const [b,c]of this._cndsBySid){const d=c._SaveToJson();d&&(a[b.toString()]=d)}return a}_LoadCndsFromJson(a){const b=new Map;for(const [c,d]of Object.entries(a))b.set(parseInt(c,10),d);for(const [c,d]of this._cndsBySid)d._LoadFromJson(b.get(c)||null)}_SaveActsToJson(){const a={};for(const [b,c]of this._actsBySid){const d=c._SaveToJson();d&&(a[b.toString()]=d)}return a}_LoadActsFromJson(a){const b=new Map;for(const [c,d]of Object.entries(a))b.set(parseInt(c,10),d);for(const [c,d]of this._actsBySid)d._LoadFromJson(b.get(c)|| null)}_SaveVarsToJson(){const a={};for(const [b,c]of this._eventVarsBySid)c.IsConstant()||!c.IsGlobal()&&!c.IsStatic()||(a[b.toString()]=c.GetValue());return a}_LoadVarsFromJson(a){for(const [b,c]of Object.entries(a))a=parseInt(b,10),(a=this.GetEventVariableBySID(a))&&a.SetValue(c)}_SaveScheduledWaitsToJson(){return this._scheduledWaits.filter(a=>!a.IsPromise()).map(a=>a._SaveToJson())}_LoadScheduledWaitsFromJson(a){this.ClearAllScheduledWaits();for(const b of a)(a=C3$jscomp$135.ScheduledWait._CreateFromJson(this, b))&&this._scheduledWaits.push(a)}_GetPerfRecords(){return[...this._runtime.GetLayoutManager().runningLayouts()].map(a=>a.GetEventSheet()).filter(a=>a).map(a=>a._GetPerfRecord())}FindFirstFunctionBlockParent(a){for(;a;)if(a=a.GetScopeParent(),a instanceof C3$jscomp$135.FunctionBlock)return a;return null}_InvokeFunctionFromJS(a,b){Array.isArray(b)||(b=[]);a=this.GetFunctionBlockByName(a.toLowerCase());if(!a)return null;if(!a.IsEnabled())return a.GetDefaultReturnValue();var c=a.GetFunctionParameters(); if(b.length<c.length){b=b.slice(0);do b.push(c[b.length].GetInitialValue());while(b.length<c.length)}c=a.GetEventBlock();return c.RunAsExpressionFunctionCall(c.GetSolModifiersIncludingParents(),!1,a.GetReturnType(),a.GetDefaultReturnValue(),...b)}};"use strict";const C3$jscomp$136=self.C3; C3$jscomp$136.EventSheet=class extends C3$jscomp$136.DefendedBase{constructor(a,b){super();this._eventSheetManager=a;this._runtime=a.GetRuntime();this._name=b[0];this._events=[];this._triggers=new Map;this._fastTriggers=new Map;this._eventsByDisplayNumber=new Map;this._hasRun=!1;this._shallowIncludes=[];this._deepIncludes=[];this._alreadyIncludedSheets=new Set;for(const c of b[1])this._CreateEvent(c,null,this._events);this._perfRecord=this._runtime.IsDebug()?{type:"sheet",name:this._name,totalTimeCounter:0, children:[]}:null}Release(){this._runtime=this._eventSheetManager=null}_CreateEvent(a,b,c){switch(a[0]){case 0:case 3:this._CreateEventBlock(a,b,c);break;case 1:this._CreateEventVariable(a,b,c);break;case 2:this._CreateInclude(a,b,c);break;case 4:this._CreateFunctionBlock(a,b);break;case 5:this._CreateScriptBlock(a,b,c);break;case 6:this._CreateCustomACEBlock(a,b);break;default:throw Error("invalid event type");}}_CreateEventBlock(a,b,c){a=C3$jscomp$136.EventBlock.Create(this,b,a);if(a.IsOrBlock()){c.push(a); c=a.GetConditions();for(let d=0,e=c.length;d<e;++d)c[d].IsTrigger()&&this._InitTrigger(a,d)}else a.IsTrigger()?this._InitTrigger(a,0):c.push(a)}_CreateFunctionBlock(a,b){a=C3$jscomp$136.FunctionBlock.CreateFunctionBlock(this,b,a);this._eventSheetManager._RegisterFunctionBlock(a)}_CreateCustomACEBlock(a,b){a=C3$jscomp$136.FunctionBlock.CreateCustomACEBlock(this,b,a);this._eventSheetManager._RegisterFunctionBlock(a)}_CreateEventVariable(a,b,c){a=C3$jscomp$136.EventVariable.Create(this,b,a);c.push(a)}_CreateInclude(a, b,c){a=C3$jscomp$136.EventInclude.Create(this,b,a);c.push(a)}_CreateScriptBlock(a,b,c){a=C3$jscomp$136.EventScript.Create(this,b,a);c.push(a)}_InitTrigger(a,b){a.IsOrBlock()||this._eventSheetManager._AddTriggerToPostInit(a);var c=a.GetConditionAt(b),d=c._GetFunc(),e=c.GetObjectClass();if(c.IsFastTrigger()){var g=this._fastTriggers.get(e);g||(g=new Map,this._fastTriggers.set(e,g));c=c.GetFastTriggerValue().toLowerCase();e=g.get(d);e||(e=new Map,g.set(d,e));d=e.get(c);d||(d=[],e.set(c,d));d.push([a, b])}else g=this._triggers.get(e),g||(g={methodMap:new Map,behaviors:new Map},this._triggers.set(e,g)),(e=c.GetBehaviorType())?(c=g.behaviors.get(e),c||(c=new Map,g.behaviors.set(e,c))):c=g.methodMap,g=c.get(d),g||(g=[],c.set(d,g)),g.push([a,b])}_PostInit(){const a=this._events;for(let b=0,c=a.length;b<c;++b){const d=b<c-1&&a[b+1]instanceof C3$jscomp$136.EventBlock&&a[b+1].IsElseBlock();a[b]._PostInit(d)}}_AddShallowInclude(a){this._shallowIncludes.push(a)}_UpdateDeepIncludes(){C3$jscomp$136.clearArray(this._deepIncludes); this._AddDeepIncludes(this);this._alreadyIncludedSheets.clear()}_AddDeepIncludes(a){const b=a._deepIncludes,c=a._alreadyIncludedSheets;for(const d of this._shallowIncludes){const e=d.GetIncludeSheet();d.IsActive()&&a!==e&&!c.has(e)&&(c.add(e),e._AddDeepIncludes(a),b.push(e))}}deepIncludes(){return this._deepIncludes}GetEventSheetManager(){return this._eventSheetManager}GetRuntime(){return this._runtime}GetName(){return this._name}_RegisterEventByDisplayNumber(a,b){this._eventsByDisplayNumber.set(b, a)}_GetEventByDisplayNumber(a){return this._eventsByDisplayNumber.get(a)||null}_ResetHasRunFlag(){this._hasRun=!1}Run(){if(!this._hasRun){var a=this._runtime,b=a.IsCPUProfiling(),c=b?performance.now():0;this._hasRun=!0;var d=this.GetEventSheetManager(),e=d.GetCurrentEventStackFrame();for(const g of this._events)g.Run(e),d.ClearSol(g.GetSolModifiers()),d.ClearAsyncActionPromises(),a.FlushPendingInstances();e.Reset(null);b&&(this._perfRecord.totalTimeCounter+=performance.now()-c)}}*DebugRun(){if(!this._hasRun){this._hasRun= !0;var a=this._runtime,b=this.GetEventSheetManager(),c=b.GetCurrentEventStackFrame();for(const d of this._events)yield*d.DebugRun(c),b.ClearSol(d.GetSolModifiers()),b.ClearAsyncActionPromises(),a.FlushPendingInstances();c.Reset(null)}}_Trigger(a,b,c){if(b){const d=b.GetObjectClass();this._TriggerForClass(a,b,d,c);for(const e of d.GetFamilies())this._TriggerForClass(a,b,e,c)}else return this._TriggerForClass(a,b,null,null)}_TriggerForClass(a,b,c,d){c=this._triggers.get(c);if(!c)return!1;d=d?c.behaviors.get(d): c.methodMap;if(!d)return!1;d=d.get(a);if(!d)return!1;a=!1;for(const [e,g]of d)d=this._ExecuteTrigger(b,e,g),a=a||d;return a}*_DebugTrigger(a,b,c){if(b){const d=b.GetObjectClass();yield*this._DebugTriggerForClass(a,b,d,c);for(const e of d.GetFamilies())yield*this._DebugTriggerForClass(a,b,e,c)}else return yield*this._DebugTriggerForClass(a,b,null,null)}*_DebugTriggerForClass(a,b,c,d){c=this._triggers.get(c);if(!c)return!1;d=d?c.behaviors.get(d):c.methodMap;if(!d)return!1;d=d.get(a);if(!d)return!1; a=!1;for(const [e,g]of d)d=e.DebugCanRunFast()?this._ExecuteTrigger(b,e,g):yield*this._DebugExecuteTrigger(b,e,g),a=a||d;return a}_FastTrigger(a,b,c){b=b.GetObjectClass();b=this._fastTriggers.get(b);if(!b)return!1;a=b.get(a);if(!a)return!1;c=a.get(c);if(!c)return!1;a=!1;for(let d=0,e=c.length;d<e;++d)b=c[d],b=this._ExecuteTrigger(null,b[0],b[1]),a=a||b;return a}*_DebugFastTrigger(a,b,c){b=b.GetObjectClass();b=this._fastTriggers.get(b);if(!b)return!1;a=b.get(a);if(!a)return!1;c=a.get(c);if(!c)return!1; a=!1;for(let e=0,g=c.length;e<g;++e){var d=c[e];b=d[0];d=d[1];b=b.DebugCanRunFast()?this._ExecuteTrigger(null,b,d):yield*this._DebugExecuteTrigger(null,b,d);a=a||b}return a}_ExecuteTrigger(a,b,c){const d=this._runtime,e=this._eventSheetManager,g=e.GetCurrentEvent(),k=e.GetEventStack(),l=e.GetTriggerDepth();let n=!1;g&&e.PushCleanSol(g.GetSolModifiersIncludingParents());e.PushCleanSol(b.GetSolModifiersIncludingParents());const p=1<l;p&&e.GetLocalVarStack().Push();const r=k.Push(b);a&&(b.GetConditions()[c].GetObjectClass().GetCurrentSol().SetSinglePicked(a), a.IsInContainer()&&a.SetSiblingsSinglePicked());a=!0;if(b.GetParent()){const w=b.GetTriggerParents();for(let y=0,B=w.length;y<B;++y)if(!w[y].RunPreTrigger(r)){a=!1;break}}a&&(b.IsOrBlock()?b.RunOrBlockTrigger(r,c):b.Run(r),n=r.GetLastEventTrue());k.Pop();p&&e.GetLocalVarStack().Pop();e.PopSol(b.GetSolModifiersIncludingParents());g&&e.PopSol(g.GetSolModifiersIncludingParents());g||1!==l||(e.ClearAsyncActionPromises(),e.IsFlushingBlocked()||d.FlushPendingInstances());return n}*_DebugExecuteTrigger(a, b,c){const d=this._runtime,e=this._eventSheetManager,g=e.GetCurrentEvent(),k=e.GetEventStack(),l=e.GetTriggerDepth();let n=!1;g&&e.PushCleanSol(g.GetSolModifiersIncludingParents());e.PushCleanSol(b.GetSolModifiersIncludingParents());const p=1<l;p&&e.GetLocalVarStack().Push();const r=k.Push(b);a&&(b.GetConditions()[c].GetObjectClass().GetCurrentSol().SetSinglePicked(a),a.IsInContainer()&&a.SetSiblingsSinglePicked());a=!0;if(b.GetParent()){const w=b.GetTriggerParents();for(let y=0,B=w.length;y<B;++y)if(!(yield*w[y].DebugRunPreTrigger(r))){a= !1;break}}a&&(b.IsOrBlock()?yield*b.DebugRunOrBlockTrigger(r,c):yield*b.DebugRun(r),n=r.GetLastEventTrue());k.Pop();p&&e.GetLocalVarStack().Pop();e.PopSol(b.GetSolModifiersIncludingParents());g&&e.PopSol(g.GetSolModifiersIncludingParents());g||1!==l||(e.ClearAsyncActionPromises(),e.IsFlushingBlocked()||d.FlushPendingInstances());return n}_GetPerfRecord(){return this._perfRecord}};"use strict";const C3$jscomp$137=self.C3,EMPTY_ARRAY=[];function NoActions(a,b){return!0} function*DebugNoActions(a,b){return!0} C3$jscomp$137.EventBlock=class extends C3$jscomp$137.DefendedBase{constructor(a,b,c){super();this._eventSheet=a;this._runtime=a.GetRuntime();this._parent=b;this._scopeParent=null;this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._solModifiers=[];this._solModifiersIncludingParents=[];this._hasElseBlock=this._isTopLevelGroup=this._isSolWriterAfterCnds=this._hasGotSolModifiersIncludingParents=!1;this._isOrBlock=!!c[2];this._isElseBlock=!1;this._triggerParents=null;this._conditions= [];this._actions=[];this._subEvents=[];this._RunActions=NoActions;this._DebugRunActions=DebugNoActions;this._isInitiallyActive=this._isGroup=!1;this._groupName="";this._isGroupActive=!1;this._perfRecord=this._containedIncludes=null;this._sid=c[4];this._displayNumber=c[5];this._eventSheet._RegisterEventByDisplayNumber(this,this._displayNumber);this._debugData=this._runtime.IsDebug()?{isBreakpoint:c[3][0],isBreakable:c[3][1],canRunAllConditionsFast:!1,canRunAllActionsFast:!1,canRunAllSubEventsFast:!1, canRunSelfFast:!1}:null;this.GetEventSheetManager()._RegisterEventBlock(this);3===c[0]&&this._InitGroup(c[1]);a=0;for(var d of c[6])b=C3$jscomp$137.Condition.Create(this,d,a++),this._conditions.push(b),this._AddSolModifier(b.GetObjectClass());a=0;for(const e of c[7])d=C3$jscomp$137.Action.Create(this,e,a++),this._actions.push(d);if(9===c.length){c=c[8];for(const e of c)this._eventSheet._CreateEvent(e,this,this._subEvents)}this._conditions.length&&(this._isElseBlock=null===this._conditions[0].GetObjectClass()&& this._conditions[0]._GetFunc()===C3$jscomp$137.Plugins.System.Cnds.Else);0===this._conditions.length&&(this._conditions=EMPTY_ARRAY);0===this._actions.length&&(this._actions=EMPTY_ARRAY);0===this._subEvents.length&&(this._subEvents=EMPTY_ARRAY)}static Create(a,b,c){return C3$jscomp$137.New(C3$jscomp$137.EventBlock,a,b,c)}_InitGroup(a){this._isGroup=!0;this._isGroupActive=this._isInitiallyActive=!!a[0];this._groupName=a[1].toLowerCase();this._containedIncludes=[];this.GetEventSheetManager()._RegisterGroup(this); this._runtime.IsDebug()&&(this._perfRecord={type:"group",name:a[1],totalTimeCounter:0,children:[]})}_AddContainedInclude(a){this._containedIncludes.push(a)}_AddContainerSolModifierToList(a,b){for(const c of a.GetContainer().objectTypes())b.includes(c)||b.push(c)}_AddSolModifierToList(a,b){if(a)if(b.includes(a)||b.push(a),a.IsFamily())for(const c of a.GetFamilyMembers())c.IsInContainer()&&this._AddContainerSolModifierToList(c,b);else a.IsInContainer()&&this._AddContainerSolModifierToList(a,b)}_AddSolModifier(a){this._AddSolModifierToList(a, this._solModifiers)}_AddParentSolModifier(a){this._AddSolModifierToList(a,this._solModifiersIncludingParents)}SetAllSolModifiers(){this._solModifiers=this._runtime.GetAllObjectClasses()}_PostInit(a){this._hasElseBlock=!!a;this._IdentifyTopLevelGroup();this._IdentifyTriggerParents();for(const c of this._conditions)c._PostInit();if(0<this._actions.length){a=!1;for(var b of this._actions)b._PostInit(),b.HasReturnType()&&(a=!0);a?(this._RunActions=this._RunActions_ReturnValue,this._DebugRunActions=this._DebugRunActions_ReturnValue): (this._RunActions=this._RunActions_Fast,this._DebugRunActions=this._DebugRunActions_Fast)}b=this._subEvents;for(let c=0,d=b.length;c<d;++c)a=c<d-1&&b[c+1]instanceof C3$jscomp$137.EventBlock&&b[c+1].IsElseBlock(),b[c]._PostInit(a);this._debugData&&this._UpdateCanRunFast();this._perfRecord&&this._GetPerfRecordParent()._GetPerfRecord().children.push(this._perfRecord)}_GetPerfRecord(){return this._perfRecord}_GetPerfRecordParent(){let a=this.GetParent();for(;a;){if(a.IsGroup())return a;a=a.GetParent()}return this._eventSheet}_UpdateCanRunFast(){const a= this._debugData;a.canRunAllConditionsFast=this._conditions.every(b=>b.DebugCanRunFast());a.canRunAllActionsFast=this._actions.every(b=>b.DebugCanRunFast());a.canRunAllSubEventsFast=this._subEvents.every(b=>b.DebugCanRunFast());a.canRunSelfFast=a.canRunAllConditionsFast&&a.canRunAllActionsFast&&a.canRunAllSubEventsFast}_UpdateCanRunFastRecursive(){let a=this;do a._UpdateCanRunFast(),a=a.GetParent();while(a)}_IdentifyTopLevelGroup(){if(this.IsGroup()){var a=this.GetParent();for(this._isTopLevelGroup= !0;a;){if(!a.IsGroup()){this._isTopLevelGroup=!1;break}a=a.GetParent()}}}_IdentifySolModifiersIncludingParents(){var a=this._runtime.GetAllObjectClasses();if(this._solModifiers===a)this._solModifiersIncludingParents=a;else{this._solModifiersIncludingParents=C3$jscomp$137.cloneArray(this._solModifiers);for(a=this.GetParent();a;){for(var b of a._solModifiers)this._AddParentSolModifier(b);a=a.GetParent()}b=this.GetEventSheetManager();this._solModifiers=b._DeduplicateSolModifierList(this._solModifiers); this._solModifiersIncludingParents=b._DeduplicateSolModifierList(this._solModifiersIncludingParents)}}_IdentifyTriggerParents(){if(this.HasAnyTriggeredCondition()){this._triggerParents=[];for(var a=this.GetParent();a;)this._triggerParents.push(a),a=a.GetParent();this._triggerParents.reverse()}}SetSolWriterAfterCnds(){this._isSolWriterAfterCnds=!0;this._parent&&this._parent.SetSolWriterAfterCnds()}IsSolWriterAfterCnds(){return this._isSolWriterAfterCnds}GetSolModifiers(){return this._solModifiers}GetSolModifiersIncludingParents(){this._hasGotSolModifiersIncludingParents|| (this._hasGotSolModifiersIncludingParents=!0,this._IdentifySolModifiersIncludingParents());return this._solModifiersIncludingParents}HasSolModifier(a){return this._solModifiers.includes(a)}GetTriggerParents(){return this._triggerParents}GetEventSheet(){return this._eventSheet}GetEventSheetManager(){return this._eventSheet.GetEventSheetManager()}GetRuntime(){return this._runtime}GetParent(){return this._parent}_SetScopeParent(a){this._scopeParent=a}GetScopeParent(){return this._scopeParent||this._parent}GetDisplayNumber(){return this._displayNumber}IsDebugBreakable(){return this._debugData&& this._debugData.isBreakable}IsDebugBreakpoint(){return this.IsDebugBreakable()&&this._debugData.isBreakpoint}_SetDebugBreakpoint(a){this._debugData.isBreakpoint=!!a;this._UpdateCanRunFastRecursive()}IsGroup(){return this._isGroup}IsTopLevelGroup(){return this._isTopLevelGroup}IsElseBlock(){return this._isElseBlock}HasElseBlock(){return this._hasElseBlock}GetGroupName(){return this._groupName}IsGroupActive(){return this._isGroupActive}ResetInitialActivation(){this.SetGroupActive(this._isInitiallyActive)}SetGroupActive(a){a= !!a;if(!this._isGroup)throw Error("not a group");if(this._isGroupActive!==a){this._isGroupActive=a;for(const b of this._containedIncludes)b.UpdateActive();this._containedIncludes.length&&(a=this._runtime.GetCurrentLayout().GetEventSheet())&&a._UpdateDeepIncludes()}}GetSID(){return this._sid}IsOrBlock(){return this._isOrBlock}IsTrigger(){return this._conditions.length&&this._conditions[0].IsTrigger()}IsForFunctionBlock(){return this._scopeParent&&this._scopeParent instanceof C3$jscomp$137.FunctionBlock}HasAnyTriggeredCondition(){return this.IsForFunctionBlock()|| this._conditions.some(a=>a.IsTrigger())}GetConditions(){return this._conditions}GetConditionCount(){return this._conditions.length}GetConditionAt(a){a=Math.floor(a);if(0>a||a>=this._conditions.length)throw new RangeError("invalid condition index");return this._conditions[a]}GetConditionByDebugIndex(a){return this.GetConditionAt(a)}IsFirstConditionOfType(a){let b=a.GetIndex();if(0===b)return!0;--b;for(a=a.GetObjectClass();0<=b;--b){const c=this._conditions[b];if(c.GetObjectClass()===a||c.IsSystemCondition()&& c.GetFirstObjectParameterObjectClass()===a)return!1}return!0}GetActions(){return this._actions}GetActionCount(){return this._actions.length}GetActionAt(a){a=Math.floor(a);if(0>a||a>=this._actions.length)throw new RangeError("invalid action index");return this._actions[a]}GetActionByDebugIndex(a){a=Math.floor(a);const b=this._actions.find(c=>c.GetDebugIndex()===a);if(!b)throw new RangeError("invalid action debug index");return b}_HasActionIndex(a){a=Math.floor(a);return 0<=a&&a<this._actions.length}GetSubEvents(){return this._subEvents}_GetAllLocalVariablesInScope(){return this._subEvents.filter(a=> a instanceof C3$jscomp$137.EventVariable)}RunPreTrigger(a){a.SetCurrentEvent(this);const b=this._conditions;let c=0===b.length;for(let d=0,e=b.length;d<e;++d){const g=b[d];a.SetConditionIndex(d);if(g.IsLooping())throw Error("trigger cannot be used as sub-event to a loop");if(g.Run())c=!0;else if(!this._isOrBlock)return!1}return this._isOrBlock?c:!0}RunOrBlockTrigger(a,b){a.SetCurrentEvent(this);this._conditions[b].Run()&&(this._RunActions(a,0)&&this._RunSubEvents(a),a.SetLastEventTrue(!0))}*DebugRunPreTrigger(a){a.SetCurrentEvent(this); const b=this._conditions;let c=0===b.length;for(let d=0,e=b.length;d<e;++d){const g=b[d];a.SetConditionIndex(d);if(g.IsLooping())throw Error("trigger cannot be used as sub-event to a loop");if(g.DebugCanRunFast()?g.Run():yield*g.DebugRun())c=!0;else if(!this._isOrBlock)return!1}return this._isOrBlock?c:!0}*DebugRunOrBlockTrigger(a,b){a.SetCurrentEvent(this);b=this._conditions[b];if(b.DebugCanRunFast()?b.Run():yield*b.DebugRun())(this.DebugCanRunActionsFast()?this._RunActions(a,0):yield*this._DebugRunActions(a, 0))&&(this.DebugCanRunSubEventsFast()?this._RunSubEvents():yield*this._DebugRunSubEvents()),a.SetLastEventTrue(!0)}Run(a){a.SetCurrentEvent(this);this._isElseBlock||a.SetElseBranchRan(!1);this._isOrBlock?this._RunOrBlock(a):this._RunAndBlock(a)}*DebugRun(a){if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;a.SetCurrentEvent(this);this._isElseBlock||a.SetElseBranchRan(!1);this._isOrBlock?yield*this._DebugRunOrBlock(a):yield*this._DebugRunAndBlock(a)}_RunOrBlock(a){const b=this._conditions; let c=0===b.length;for(let e=0,g=b.length;e<g;++e){var d=b[e];d.IsTrigger()||(a.SetConditionIndex(e),d=d.Run(),c=c||d)}a.SetLastEventTrue(c);c&&(this._RunActions(a,0)&&this._RunSubEvents(a),this._hasElseBlock&&a.SetElseBranchRan(!0))}*_DebugRunOrBlock(a){const b=this._conditions;let c=0===b.length;for(let e=0,g=b.length;e<g;++e){var d=b[e];d.IsTrigger()||(a.SetConditionIndex(e),d=d.DebugCanRunFast()?d.Run():yield*d.DebugRun(),c=c||d)}a.SetLastEventTrue(c);c&&((this.DebugCanRunActionsFast()?this._RunActions(a, 0):yield*this._DebugRunActions(a,0))&&(this.DebugCanRunSubEventsFast()?this._RunSubEvents():yield*this._DebugRunSubEvents()),this._hasElseBlock&&a.SetElseBranchRan(!0))}_RunAndBlock(a){const b=this._conditions;for(let c=0,d=b.length;c<d;++c){const e=b[c];a.SetConditionIndex(c);if(!e.Run()){a.SetLastEventTrue(!1);return}}a.SetLastEventTrue(!0);this._RunActions(a,0)&&this._RunSubEvents(a);a.GetLastEventTrue()&&this._hasElseBlock&&a.SetElseBranchRan(!0)}*_DebugRunAndBlock(a){const b=this._conditions; for(let c=0,d=b.length;c<d;++c){const e=b[c];a.SetConditionIndex(c);if(e.DebugCanRunFast()?!e.Run():!(yield*e.DebugRun())){a.SetLastEventTrue(!1);return}}a.SetLastEventTrue(!0);(this.DebugCanRunActionsFast()?this._RunActions(a,0):yield*this._DebugRunActions(a,0))&&(this.DebugCanRunSubEventsFast()?this._RunSubEvents():yield*this._DebugRunSubEvents());a.GetLastEventTrue()&&this._hasElseBlock&&a.SetElseBranchRan(!0)}_RunActions_Fast(a,b){const c=this._actions;for(let d=b,e=c.length;d<e;++d)b=c[d],a.SetActionIndex(d), b.Run();return!0}*_DebugRunActions_Fast(a,b){const c=this._actions;for(let d=b,e=c.length;d<e;++d)b=c[d],a.SetActionIndex(d),b.DebugCanRunFast()?b.Run():yield*b.DebugRun();return!0}_RunActions_ReturnValue(a,b){const c=this.GetEventSheetManager(),d=this._actions;for(let e=b,g=d.length;e<g;++e){b=d[e];a.SetActionIndex(e);const k=b.Run();if(b.CanBailOut()&&!0===k)return!1;b.IsAsync()&&k instanceof Promise&&c.AddAsyncActionPromise(k)}return!0}*_DebugRunActions_ReturnValue(a,b){const c=this.GetEventSheetManager(), d=this._actions;for(let e=b,g=d.length;e<g;++e){b=d[e];a.SetActionIndex(e);let k;k=b.DebugCanRunFast()?b.Run():yield*b.DebugRun();if(b.CanBailOut()&&!0===k)return!1;b.IsAsync()&&k instanceof Promise&&c.AddAsyncActionPromise(k)}return!0}_ResumeActionsAndSubEvents(a){this._RunActions(a,a.GetActionIndex())&&this._RunSubEvents()}*_DebugResumeActionsAndSubEvents(a){if(yield*this._DebugRunActions(a,a.GetActionIndex()))yield*this._DebugRunSubEvents()}_RunSubEvents(){if(this._subEvents.length){var a=this.IsGroup()&& this._runtime.IsCPUProfiling(),b=a?performance.now():0,c=this._eventStack,d=c.Push(this);this._isSolWriterAfterCnds?this._RunSubEvents_SolWriterAfterCnds(d):this._RunSubEvents_Fast(d);c.Pop();a&&(this._perfRecord.totalTimeCounter+=performance.now()-b)}}_RunSubEvents_SolWriterAfterCnds(a){const b=this._isGroup,c=this._isTopLevelGroup,d=this.GetEventSheetManager(),e=this._subEvents;for(let g=0,k=e.length,l=k-1;g<k;++g){const n=e[g],p=n.GetSolModifiers(),r=!c||!b&&g<l;r&&d.PushCopySol(p);n.Run(a);r? d.PopSol(p):d.ClearSol(p)}}_RunSubEvents_Fast(a){const b=this._subEvents;for(let c=0,d=b.length;c<d;++c)b[c].Run(a)}*_DebugRunSubEvents(){if(this._subEvents.length){var a=this._eventStack,b=a.Push(this);this._isSolWriterAfterCnds?yield*this._DebugRunSubEvents_SolWriterAfterCnds(b):yield*this._DebugRunSubEvents_Fast(b);a.Pop()}}*_DebugRunSubEvents_SolWriterAfterCnds(a){const b=this._isGroup,c=this._isTopLevelGroup,d=this.GetEventSheetManager(),e=this._subEvents;for(let g=0,k=e.length,l=k-1;g<k;++g){const n= e[g],p=n.GetSolModifiers(),r=!c||!b&&g<l;r&&d.PushCopySol(p);yield*n.DebugRun(a);r?d.PopSol(p):d.ClearSol(p)}}*_DebugRunSubEvents_Fast(a){const b=this._subEvents;for(let c=0,d=b.length;c<d;++c)yield*b[c].DebugRun(a)}Retrigger(a,b){b.ResetQuick();const c=this._conditions;if(!this.IsOrBlock())for(let d=a.GetConditionIndex()+1,e=c.length;d<e;++d)if(a=c[d],b.SetConditionIndex(d),!a.Run())return!1;this._RunActions(b,0)&&this._RunSubEvents(b);return!0}*DebugRetrigger(a,b){b.ResetQuick();const c=this._conditions; if(!this.IsOrBlock())for(let d=a.GetConditionIndex()+1,e=c.length;d<e;++d)if(a=c[d],b.SetConditionIndex(d),a.DebugCanRunFast()?!a.Run():!(yield*a.DebugRun()))return!1;(this.DebugCanRunActionsFast()?this._RunActions(b,0):yield*this._DebugRunActions(b,0))&&(this.DebugCanRunSubEventsFast()?this._RunSubEvents():yield*this._DebugRunSubEvents());return!0}DebugCanRunFast(){return!this.IsDebugBreakpoint()&&!this._runtime.DebugBreakNext()&&this._debugData.canRunSelfFast}DebugCanRunActionsFast(){return!this._runtime.DebugBreakNext()&& this._debugData.canRunAllActionsFast}DebugCanRunSubEventsFast(){return!this._runtime.DebugBreakNext()&&this._debugData.canRunAllSubEventsFast}_CheckParentsOKToRun(a){if(this.GetParent()){const b=this.GetTriggerParents();for(let c=0,d=b.length;c<d;++c)if(!b[c].RunPreTrigger(a))return!1}return!0}*_DebugCheckParentsOKToRun(a){if(this.GetParent()){const b=this.GetTriggerParents();for(let c=0,d=b.length;c<d;++c)if(!(yield*b[c].DebugRunPreTrigger(a)))return!1}return!0}_EvaluateFunctionCallParameters(a, b,c){0<b.length?c?(b=b.map(d=>d.Get(0)),a.GetLocalVarStack().Push(),this._scopeParent.SetFunctionParameters(b)):this._scopeParent.EvaluateFunctionParameters(b):c&&a.GetLocalVarStack().Push()}RunAsFunctionCall(a,b,c,d){let e,g;const k=0<a.length;let l=null;const n=this._eventStack,p=this._runtime.GetEventSheetManager(),r=1<p._IncTriggerDepth();this._EvaluateFunctionCallParameters(p,b,r);k&&(c?p.PushCopySol(a):p.PushCleanSol(a));if(null!==d){if(d.copyFromObjectClass){b=c?d.copyFromObjectClass.GetCurrentSol(): d.copyFromObjectClass.GetSolStack().GetOneBelowCurrentSol();const w=d.copyToObjectClass.GetCurrentSol();w.SetArrayPicked(b.GetInstances());w.ClearElseInstances();c||d.copyToObjectClass.ApplySolToContainer()}else d.pickObjectClass&&(b=d.pickObjectClass.GetCurrentSol(),b.SetArrayPicked(d.pickInstances),b.ClearElseInstances());d.pushCleanSolDynamic&&(l=p.PushCleanSolDynamic(a))}d=n.Push(this);c&&d.SetDynamicSolModifiers(a);this._CheckParentsOKToRun(d)&&(d.SetCurrentEvent(this),(c=this._scopeParent.IsAsync())&& ([g,e]=this._scopeParent.StartAsyncFunctionCall()),this._RunAndBlock(d),c&&this._scopeParent.MaybeFinishAsyncFunctionCall(g));n.Pop();r&&p.GetLocalVarStack().Pop();null!==l&&p.PopSol(l);k&&p.PopSol(a);p._DecTriggerDepth();return e}*DebugRunAsFunctionCall(a,b,c,d){let e,g;if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;const k=0<a.length;let l=null;const n=this._eventStack,p=this._runtime.GetEventSheetManager(),r=1<p._IncTriggerDepth();this._EvaluateFunctionCallParameters(p, b,r);k&&(c?p.PushCopySol(a):p.PushCleanSol(a));if(null!==d){if(d.copyFromObjectClass){b=c?d.copyFromObjectClass.GetCurrentSol():d.copyFromObjectClass.GetSolStack().GetOneBelowCurrentSol();const w=d.copyToObjectClass.GetCurrentSol();w.SetArrayPicked(b.GetInstances());w.ClearElseInstances();c||d.copyToObjectClass.ApplySolToContainer()}else d.pickObjectClass&&(b=d.pickObjectClass.GetCurrentSol(),b.SetArrayPicked(d.pickInstances),b.ClearElseInstances());d.pushCleanSolDynamic&&(l=p.PushCleanSolDynamic(a))}d= n.Push(this);c&&d.SetDynamicSolModifiers(a);if(yield*this._DebugCheckParentsOKToRun(d))d.SetCurrentEvent(this),(c=this._scopeParent.IsAsync())&&([g,e]=this._scopeParent.StartAsyncFunctionCall()),yield*this._DebugRunAndBlock(d),c&&this._scopeParent.MaybeFinishAsyncFunctionCall(g);n.Pop();r&&p.GetLocalVarStack().Pop();null!==l&&p.PopSol(l);k&&p.PopSol(a);p._DecTriggerDepth();return e}RunAsMappedFunctionCall(a,b){const c=this.GetSolModifiersIncludingParents(),d=0<c.length,e=this._eventStack,g=this._runtime.GetEventSheetManager(), k=1<g._IncTriggerDepth();k&&g.GetLocalVarStack().Push();this._scopeParent.SetFunctionParameters(a);d&&(b?g.PushCopySol(c):g.PushCleanSol(c));a=e.Push(this);this._CheckParentsOKToRun(a)&&(a.SetCurrentEvent(this),this._RunAndBlock(a));e.Pop();k&&g.GetLocalVarStack().Pop();d&&g.PopSol(c);g._DecTriggerDepth()}*DebugRunAsMappedFunctionCall(a,b){if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;const c=this.GetSolModifiersIncludingParents(),d=0<c.length,e=this._eventStack,g=this._runtime.GetEventSheetManager(), k=1<g._IncTriggerDepth();k&&g.GetLocalVarStack().Push();this._scopeParent.SetFunctionParameters(a);d&&(b?g.PushCopySol(c):g.PushCleanSol(c));a=e.Push(this);if(yield*this._DebugCheckParentsOKToRun(a))a.SetCurrentEvent(this),yield*this._DebugRunAndBlock(a);e.Pop();k&&g.GetLocalVarStack().Pop();d&&g.PopSol(c);g._DecTriggerDepth()}RunAsExpressionFunctionCall(a,b,c,d,...e){let g,k;const l=0<a.length,n=this._runtime,p=this._eventStack,r=n.GetEventSheetManager(),w=1<r._IncTriggerDepth();w&&r.GetLocalVarStack().Push(); 0<e.length&&this._scopeParent.SetFunctionParameters(e);l&&(b?r.PushCopySol(a):r.PushCleanSol(a));b=p.Push(this);b.InitCallFunctionExpression(c,d);p.PushExpFunc(b);n.SetDebuggingEnabled(!1);this._CheckParentsOKToRun(b)&&(b.SetCurrentEvent(this),(c=this._scopeParent.IsAsync())&&([k,g]=this._scopeParent.StartAsyncFunctionCall()),this._RunAndBlock(b),c&&this._scopeParent.MaybeFinishAsyncFunctionCall(k));n.SetDebuggingEnabled(!0);p.Pop();p.PopExpFunc();w&&r.GetLocalVarStack().Pop();l&&r.PopSol(a);r._DecTriggerDepth(); return g||b.GetFunctionReturnValue()}};"use strict";const C3$jscomp$138=self.C3,EMPTY_SOL_MODIFIERS=[];let hadUserScriptException=!1; C3$jscomp$138.EventScript=class extends C3$jscomp$138.DefendedBase{constructor(a,b,c){super();const d=a.GetRuntime(),e=a.GetEventSheetManager();this._eventSheet=a;this._eventSheetManager=e;this._runtime=a.GetRuntime();this._parent=b;this._func=d.GetObjectReference(c[1]);this._displayNumber=c[2];this._eventSheet._RegisterEventByDisplayNumber(this,this._displayNumber);this._debugData=d.IsDebug()?{isBreakpoint:c[3][0],isBreakable:c[3][1]}:null}static Create(a,b,c){return C3$jscomp$138.New(C3$jscomp$138.EventScript, a,b,c)}_PostInit(){const a=this._func,b=this._runtime.GetEventSheetManager()._GetLocalVariablesScriptInterface(this);this._func=a.bind(null,this._runtime.GetIRuntime(),b)}GetParent(){return this._parent}GetScopeParent(){return this._parent}GetEventSheet(){return this._eventSheet}GetDisplayNumber(){return this._displayNumber}IsDebugBreakable(){return this._debugData&&this._debugData.isBreakable}IsDebugBreakpoint(){return this.IsDebugBreakable()&&this._debugData.isBreakpoint}_SetDebugBreakpoint(a){this._debugData.isBreakpoint= !!a}IsElseBlock(){return!1}GetSolModifiers(){return EMPTY_SOL_MODIFIERS}GetSolModifiersIncludingParents(){return this._parent?this._parent.GetSolModifiersIncludingParents():EMPTY_SOL_MODIFIERS}Run(a){a.SetCurrentEvent(this);this._eventSheetManager.AddAsyncActionPromise(this._RunUserScript())}async _RunUserScript(){try{await this._func()}catch(a){console.error(`Unhandled exception running script %c${this.GetEventSheet().GetName()}, event ${this.GetDisplayNumber()}:`,"font-size: 1.2em; font-weight: bold;", a),self.C3Debugger&&self.C3Debugger._SetLastErrorScript(this),hadUserScriptException||(console.info("%cTip:%c run this to highlight in Construct the last script that had an error: %cgoToLastErrorScript()","font-weight: bold; text-decoration: underline","","font-weight: bold"),hadUserScriptException=!0)}}*DebugRun(a){a.SetCurrentEvent(this);if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;this.Run(a)}DebugCanRunFast(){return!this.IsDebugBreakpoint()&&!this._runtime.DebugBreakNext()}static HadUserScriptException(){return hadUserScriptException}static SetHadUserScriptException(){hadUserScriptException= !0}};"use strict";const C3$jscomp$139=self.C3; C3$jscomp$139.FunctionBlock=class extends C3$jscomp$139.DefendedBase{constructor(a,b,c){super();this._eventSheet=a;this._runtime=a.GetRuntime();this._parent=b;this._functionType=0;this._functionName="";this._returnType=0;this._functionParameters=[];this._isEnabled=!0;this._aceName="";this._objectClass=null;this._hasOverrides=!1;this._innerLocalVariables=[];this._isAsync=this._isCopyPicked=!1;this._nextAsyncId=0;this._currentAsyncId=-1;this._asyncMap=new Map;this._eventBlock=C3$jscomp$139.EventBlock.Create(a, b,c);this._eventBlock._SetScopeParent(this)}InitFunctionBlock(a){this._functionType=0;this._functionName=a[0];this._returnType=a[1];this._functionParameters=a[2].map(b=>C3$jscomp$139.EventVariable.Create(this._eventSheet,this,b));this._isEnabled=a[3];this._isAsync=a[4];this._isCopyPicked=a[5]}InitCustomACEBlock(a){this._functionType=1;this._aceName=a[1];this._objectClass=this._runtime.GetObjectClassByIndex(a[2]);this._eventBlock._AddSolModifier(this._objectClass);this._functionName=this._objectClass.GetName()+ "."+this._aceName;this._returnType=a[3];this._functionParameters=a[4].map(b=>C3$jscomp$139.EventVariable.Create(this._eventSheet,this,b));this._isEnabled=a[5];this._isAsync=a[6];this._isCopyPicked=a[7];this._objectClass.AddCustomAction(this)}static CreateFunctionBlock(a,b,c){a=C3$jscomp$139.New(C3$jscomp$139.FunctionBlock,a,b,c);a.InitFunctionBlock(c[1]);return a}static CreateCustomACEBlock(a,b,c){a=C3$jscomp$139.New(C3$jscomp$139.FunctionBlock,a,b,c);a.InitCustomACEBlock(c[1]);return a}_CheckOverrideState(){if(this._objectClass&& this._objectClass.IsFamily())for(const a of this._objectClass.GetFamilyMembers())if(a.HasOwnCustomActionByName(this._aceName)){this._hasOverrides=!0;break}}_PostInit(){for(const a of this._functionParameters)a._PostInit();this._eventBlock._PostInit(!1)}GetFunctionType(){return this._functionType}_GetAllLocalVariablesInScope(){return this._functionParameters}GetFunctionParameters(){return this._functionParameters}GetFunctionParameterCount(){return this._functionParameters.length}_RegisterLocalVariable(a){this._innerLocalVariables.push(a)}_GetAllInnerLocalVariables(){return this._innerLocalVariables}EvaluateFunctionParameters(a){const b= this._functionParameters;for(let c=0,d=b.length;c<d;++c)b[c].SetValue(a[c].Get(0))}SetFunctionParameters(a){const b=this._functionParameters;for(let c=0,d=b.length;c<d;++c)b[c].SetValue(a[c])}CaptureFunctionParameters(){return this._functionParameters.map(a=>a.GetValue())}GetParent(){return this._parent}GetScopeParent(){return this._parent}GetFunctionName(){return this._functionName}GetACEName(){return this._aceName}HasCustomACEOverrides(){return this._hasOverrides}GetReturnType(){return this._returnType}GetObjectClass(){return this._objectClass}IsEnabled(){return this._isEnabled}GetDefaultReturnValue(){switch(this._returnType){case 0:return null; case 2:return"";default:return 0}}GetEventBlock(){return this._eventBlock}IsCopyPicked(){return this._isCopyPicked}IsAsync(){return this._isAsync}StartAsyncFunctionCall(){const a=this._nextAsyncId++;this._currentAsyncId=a;let b;const c=new Promise(d=>b=d);this._asyncMap.set(a,{resolve:b,pauseCount:0});return[a,c]}MaybeFinishAsyncFunctionCall(a){const b=this._asyncMap.get(a);0===b.pauseCount&&(b.resolve(),this._asyncMap.delete(a));this._currentAsyncId=-1}PauseCurrentAsyncFunction(){this._asyncMap.get(this._currentAsyncId).pauseCount++; return this._currentAsyncId}ResumeAsyncFunction(a){this._currentAsyncId=a;this._asyncMap.get(a).pauseCount--}RunAsFamilyCustomActionWithOverrides(a,b){var c=new Map,d=[];for(const e of this._objectClass.GetCurrentSol().GetInstances()){const g=e.GetObjectClass();if(g.HasOwnCustomActionByName(this._aceName)){const k=c.get(g);Array.isArray(k)?k.push(e):c.set(g,[e])}else d.push(e)}0<d.length&&this._eventBlock.RunAsFunctionCall(a,b,this._isCopyPicked,{pickObjectClass:this._objectClass,pickInstances:d}); if(0<c.size)for(const [e,g]of c)c=e.GetOwnCustomActionByName(this._aceName).GetEventBlock(),d=[...(new Set([...a,...c.GetSolModifiers()]))],c.RunAsFunctionCall(d,b,this._isCopyPicked,{pickObjectClass:e,pickInstances:g})}*DebugRunAsFamilyCustomActionWithOverrides(a,b){var c=new Map,d=[];for(const e of this._objectClass.GetCurrentSol().GetInstances()){const g=e.GetObjectClass();if(g.HasOwnCustomActionByName(this._aceName)){const k=c.get(g);Array.isArray(k)?k.push(e):c.set(g,[e])}else d.push(e)}0<d.length&& (yield*this._eventBlock.DebugRunAsFunctionCall(a,b,this._isCopyPicked,{pickObjectClass:this._objectClass,pickInstances:d}));if(0<c.size)for(const [e,g]of c)c=e.GetOwnCustomActionByName(this._aceName).GetEventBlock(),d=[...(new Set([...a,...c.GetSolModifiers()]))],yield*c.DebugRunAsFunctionCall(d,b,this._isCopyPicked,{pickObjectClass:e,pickInstances:g})}};"use strict";const C3$jscomp$140=self.C3,EMPTY_SOL_MODIFIERS$jscomp$1=[]; C3$jscomp$140.EventVariable=class extends C3$jscomp$140.DefendedBase{constructor(a,b,c){super();const d=a.GetEventSheetManager();this._eventSheet=a;this._eventSheetManager=d;this._runtime=a.GetRuntime();this._parent=b;this._localVarStack=d.GetLocalVarStack();this._name=c[1];this._type=c[2];this._initialValue=c[3];this._isStatic=!!c[4];this._isConstant=!!c[5];this._isFunctionParameter=b instanceof C3$jscomp$140.FunctionBlock;this._sid=c[6];this._jsPropName=this._runtime.GetJsPropName(c[8]);this._scriptSetter= e=>this.SetValue(e);this._scriptGetter=()=>this.GetValue();this._hasSingleValue=!this._parent||this._isStatic||this._isConstant;this._value=this._initialValue;this._localIndex=-1;this.IsBoolean()&&(this._value=this._value?1:0);!this.IsLocal()||this.IsStatic()||this.IsConstant()||(this._localIndex=d._GetNextLocalVarIndex(this));d._RegisterEventVariable(this)}static Create(a,b,c){return C3$jscomp$140.New(C3$jscomp$140.EventVariable,a,b,c)}_PostInit(){if(this.IsLocal()&&!this.IsStatic()&&!this.IsConstant()&& !this.IsFunctionParameter()){const a=this._eventSheetManager.FindFirstFunctionBlockParent(this);a&&a._RegisterLocalVariable(this)}}GetName(){return this._name}GetJsPropName(){return this._jsPropName}GetParent(){return this._parent}GetScopeParent(){return this.GetParent()}IsGlobal(){return!this.GetParent()}IsLocal(){return!this.IsGlobal()}IsFunctionParameter(){return this._isFunctionParameter}IsStatic(){return this._isStatic}IsConstant(){return this._isConstant}IsNumber(){return 0===this._type}IsString(){return 1=== this._type}IsBoolean(){return 2===this._type}IsElseBlock(){return!1}GetSID(){return this._sid}GetInitialValue(){return this._initialValue}GetSolModifiers(){return EMPTY_SOL_MODIFIERS$jscomp$1}Run(a){!this.IsLocal()||this.IsStatic()||this.IsConstant()||this.SetValue(this.GetInitialValue())}DebugCanRunFast(){return!0}*DebugRun(a){this.Run(a)}SetValue(a){this.IsNumber()?"number"!==typeof a&&(a=parseFloat(a)):this.IsString()?"string"!==typeof a&&(a=a.toString()):this.IsBoolean()&&(a=a?1:0);this._hasSingleValue? this._value=a:this._localVarStack.GetCurrent()[this._localIndex]=a}GetValue(){return this._hasSingleValue?this._value:this._localVarStack.GetCurrent()[this._localIndex]}GetTypedValue(){let a=this.GetValue();this.IsBoolean()&&(a=!!a);return a}ResetToInitialValue(){this._value=this._initialValue}_GetScriptInterfaceDescriptor(){return{configurable:!1,enumerable:!0,get:this._scriptGetter,set:this._scriptSetter}}};"use strict";const C3$jscomp$141=self.C3,EMPTY_SOL_MODIFIERS$jscomp$2=[]; C3$jscomp$141.EventInclude=class extends C3$jscomp$141.DefendedBase{constructor(a,b,c){super();const d=a.GetEventSheetManager();this._eventSheet=a;this._eventSheetManager=d;this._runtime=a.GetRuntime();this._parent=b;this._includeSheet=null;this._includeSheetName=c[1];this._isActive=!0}static Create(a,b,c){return C3$jscomp$141.New(C3$jscomp$141.EventInclude,a,b,c)}_PostInit(){this._includeSheet=this._eventSheetManager.GetEventSheetByName(this._includeSheetName);this._eventSheet._AddShallowInclude(this); let a=this.GetParent();for(;a;)a instanceof C3$jscomp$141.EventBlock&&a.IsGroup()&&a._AddContainedInclude(this),a=a.GetParent();this.UpdateActive();this._runtime.IsDebug()&&this._eventSheet._GetPerfRecord().children.push(this._includeSheet._GetPerfRecord())}GetParent(){return this._parent}GetSolModifiers(){return EMPTY_SOL_MODIFIERS$jscomp$2}GetIncludeSheet(){return this._includeSheet}Run(a){a=!!this.GetParent();const b=this._runtime.GetAllObjectClasses();a&&this._eventSheetManager.PushCleanSol(b); this._includeSheet.Run();a&&this._eventSheetManager.PopSol(b)}*DebugRun(a){a=!!this.GetParent();const b=this._runtime.GetAllObjectClasses();a&&this._eventSheetManager.PushCleanSol(b);yield*this._includeSheet.DebugRun();a&&this._eventSheetManager.PopSol(b)}DebugCanRunFast(){return!1}IsActive(){return this._isActive}UpdateActive(){let a=this.GetParent();for(;a;){if(a instanceof C3$jscomp$141.EventBlock&&a.IsGroup()&&!a.IsGroupActive()){this._isActive=!1;return}a=a.GetParent()}this._isActive=!0}};"use strict"; const C3$jscomp$142=self.C3;C3$jscomp$142.ExpNode=class extends C3$jscomp$142.DefendedBase{constructor(a){super();this._owner=a;this._runtime=a.GetRuntime()}_PostInit(){}static CreateNode(a,b){return C3$jscomp$142.New([BehaviorExpressionNode,ObjectExpressionNode,InstVarExpressionNode,EventVarExpNode,SystemExpressionExpNode,CallFunctionExpressionExpNode][b[0]],a,b)}}; class SystemExpressionExpNode extends C3$jscomp$142.ExpNode{constructor(a,b){super(a);this._systemPlugin=this._runtime.GetSystemPlugin();this._func=this._runtime.GetObjectReference(b[1]);this._func!==C3$jscomp$142.Plugins.System.Exps.random&&this._func!==C3$jscomp$142.Plugins.System.Exps.choose||this._owner.SetVariesPerInstance()}GetBoundMethod(){return this._systemPlugin._GetBoundACEMethod(this._func,this._systemPlugin)}} class CallFunctionExpressionExpNode extends C3$jscomp$142.ExpNode{constructor(a,b){super(a);this._functionBlock=null;this._functionName=b[1];this._owner.SetVariesPerInstance()}_PostInit(){const a=this._runtime.GetEventSheetManager();this._functionBlock=a.GetFunctionBlockByName(this._functionName);this._functionName=null;const b=this._owner.GetEventBlock(),c=this._functionBlock.GetEventBlock();this._combinedSolModifiers=[...(new Set([...b.GetSolModifiersIncludingParents(),...c.GetSolModifiersIncludingParents()]))]; this._combinedSolModifiers=a._DeduplicateSolModifierList(this._combinedSolModifiers)}GetBoundMethod(){const a=this._functionBlock;if(a.IsEnabled()){const c=a.GetEventBlock();return C3$jscomp$142.EventBlock.prototype.RunAsExpressionFunctionCall.bind(c,this._combinedSolModifiers,a.IsCopyPicked(),a.GetReturnType(),a.GetDefaultReturnValue())}const b=a.GetDefaultReturnValue();return()=>b}}function WrapIndex(a,b){if(a>=b)return a%b;0>a&&(a<=-b&&(a%=b),0>a&&(a+=b));return a} class ObjectExpressionNode extends C3$jscomp$142.ExpNode{constructor(a,b){super(a);this._objectClass=this._runtime.GetObjectClassByIndex(b[1]);this._func=this._runtime.GetObjectReference(b[2]);this._returnsString=!!b[3];this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._owner._MaybeVaryFor(this._objectClass)}GetBoundMethod(){return this._objectClass.GetPlugin()._GetBoundACEMethod(this._func,this._objectClass.GetSingleGlobalInstance().GetSdkInstance())}ExpObject(...a){const b= this._objectClass,c=b.GetCurrentSol().GetExpressionInstances();var d=c.length;if(0===d)return this._returnsString?"":0;d=WrapIndex(this._owner.GetSolIndex(),d);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(b);return this._func.apply(c[d].GetSdkInstance(),a)}ExpObject_InstExpr(a,...b){const c=this._objectClass,d=c.GetInstances(),e=d.length;if(0===e)return this._returnsString?"":0;a=WrapIndex(a,e);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(c);return this._func.apply(d[a].GetSdkInstance(), b)}} class InstVarExpressionNode extends C3$jscomp$142.ExpNode{constructor(a,b){super(a);this._objectClass=this._runtime.GetObjectClassByIndex(b[1]);this._varIndex=b[3];this._returnsString=!!b[2];this._owner._MaybeVaryFor(this._objectClass)}ExpInstVar(){const a=this._objectClass.GetCurrentSol().GetExpressionInstances();var b=a.length;if(0===b)return this._returnsString?"":0;b=WrapIndex(this._owner.GetSolIndex(),b);return a[b]._GetInstanceVariableValueUnchecked(this._varIndex)}ExpInstVar_Family(){var a=this._objectClass, b=a.GetCurrentSol().GetExpressionInstances(),c=b.length;if(0===c)return this._returnsString?"":0;c=WrapIndex(this._owner.GetSolIndex(),c);b=b[c];a=b.GetObjectClass().GetFamilyInstanceVariableOffset(a.GetFamilyIndex());return b._GetInstanceVariableValueUnchecked(this._varIndex+a)}ExpInstVar_InstExpr(a){const b=this._objectClass;var c=b.GetInstances();const d=c.length;if(0===d)return this._returnsString?"":0;a=WrapIndex(a,d);c=c[a];a=0;b.IsFamily()&&(a=c.GetObjectClass().GetFamilyInstanceVariableOffset(b.GetFamilyIndex())); return c._GetInstanceVariableValueUnchecked(this._varIndex+a)}} class BehaviorExpressionNode extends C3$jscomp$142.ExpNode{constructor(a,b){super(a);this._objectClass=this._runtime.GetObjectClassByIndex(b[1]);this._behaviorType=this._objectClass.GetBehaviorTypeByName(b[2]);this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(b[2]);this._func=this._runtime.GetObjectReference(b[3]);this._returnsString=!!b[4];this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._owner._MaybeVaryFor(this._objectClass)}ExpBehavior(...a){const b=this._objectClass; var c=b.GetCurrentSol().GetExpressionInstances(),d=c.length;if(0===d)return this._returnsString?"":0;d=WrapIndex(this._owner.GetSolIndex(),d);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(b);c=c[d];d=0;b.IsFamily()&&(d=c.GetObjectClass().GetFamilyBehaviorOffset(b.GetFamilyIndex()));return this._func.apply(c.GetBehaviorInstances()[this._behaviorIndex+d].GetSdkInstance(),a)}ExpBehavior_InstExpr(a,...b){const c=this._objectClass;var d=c.GetInstances();const e=d.length;if(0===e)return this._returnsString? "":0;a=WrapIndex(a,e);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(c);d=d[a];a=0;c.IsFamily()&&(a=d.GetObjectClass().GetFamilyBehaviorOffset(c.GetFamilyIndex()));return this._func.apply(d.GetBehaviorInstances()[this._behaviorIndex+a].GetSdkInstance(),b)}} class EventVarExpNode extends C3$jscomp$142.ExpNode{constructor(a,b){super(a);this._eventVar=null;this._eventVarSid=b[1]}_PostInit(){this._eventVar=this._runtime.GetEventSheetManager().GetEventVariableBySID(this._eventVarSid)}GetVar(){return this._eventVar}}"use strict";const C3$jscomp$143=self.C3; C3$jscomp$143.Parameter=class extends C3$jscomp$143.DefendedBase{constructor(a,b,c){super();this._owner=a;this._index=c;this._type=b;this.Get=null;this._isConstant=this._variesPerInstance=!1}static Create(a,b,c){const d=b[0];return C3$jscomp$143.New([ExpressionParameter,StringExpressionParameter,FileParameter,ComboParameter,ObjectParameter,LayerExpressionParameter,LayoutParameter,ExpressionParameter,ComboParameter,ComboParameter,InstVarParameter,EventVarParameter,FileParameter,VariadicParameter,StringExpressionParameter, TimelineParameter,BooleanParameter,FunctionParameter,EaseParameter,TilemapBrushParameter,TemplateExpressionParameter][d],a,d,c,b)}_PostInit(){}SetVariesPerInstance(){this._variesPerInstance=!0}_MaybeVaryFor(a){this._variesPerInstance||!a||a.GetPlugin().IsSingleGlobal()||(this._variesPerInstance=!0)}VariesPerInstance(){return this._variesPerInstance}GetIndex(){return this._index}GetRuntime(){return this._owner.GetRuntime()}GetEventBlock(){return this._owner.GetEventBlock()}IsConstant(){return this._isConstant}IsObjectParameter(){return 4=== this._type}};function GetExpressionFunc(a){a=self.C3_ExpressionFuncs[a];if(!a)throw Error("invalid expression number");return a} class ExpressionParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._solIndex=0;a=d[1];this._expressionNumber=a[0];this._numberedNodes=[];this._expressionFunc=null;for(let e=1,g=a.length;e<g;++e)this._numberedNodes.push(C3$jscomp$143.ExpNode.CreateNode(this,a[e]));this._numberedNodes.length?this.Get=this.GetExpression:(this.Get=GetExpressionFunc(this._expressionNumber),this._isConstant=!0)}_GetNode(a){if(0>a||a>=this._numberedNodes.length)throw new RangeError("invalid numbered node"); return this._numberedNodes[a]}_PostInit(){for(var a of this._numberedNodes)a._PostInit();a=GetExpressionFunc(this._expressionNumber);this._expressionFunc=this._numberedNodes.length?a(this):a}GetSolIndex(){return this._solIndex}GetExpression(a){this._solIndex=a;return this._expressionFunc()}} class StringExpressionParameter extends ExpressionParameter{constructor(a,b,c,d){super(a,b,c,d);this.Get=this.GetStringExpression;14===b&&(this.GetEventBlock().SetAllSolModifiers(),this._owner instanceof C3$jscomp$143.Action&&this.GetEventBlock().SetSolWriterAfterCnds())}GetStringExpression(a){this._solIndex=a;a=this._expressionFunc();return"string"===typeof a?a:""}_GetFastTriggerValue(){return GetExpressionFunc(this._expressionNumber)()}} class LayerExpressionParameter extends ExpressionParameter{constructor(a,b,c,d){super(a,b,c,d);this.Get=this.GetLayer;this._isConstant=!1}GetLayer(a){this._solIndex=a;a=this._expressionFunc();return this.GetRuntime().GetCurrentLayout().GetLayer(a)}}class ComboParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._combo=d[1];this.Get=this.GetCombo;this._isConstant=!0}GetCombo(){return this._combo}} class BooleanParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._bool=d[1];this.Get=this.GetBoolean;this._isConstant=!0}GetBoolean(){return this._bool}} class ObjectParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._objectClass=this.GetRuntime().GetObjectClassByIndex(d[1]);this.Get=this.GetObjectClass;a=this.GetEventBlock();a._AddSolModifier(this._objectClass);this._owner instanceof C3$jscomp$143.Action?a.SetSolWriterAfterCnds():a.GetParent()&&a.GetParent().SetSolWriterAfterCnds();this._isConstant=!0}GetObjectClass(){return this._objectClass}} class LayoutParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._layout=this.GetRuntime().GetLayoutManager().GetLayoutByName(d[1]);this.Get=this.GetLayout;this._isConstant=!0}GetLayout(){return this._layout}}class TimelineParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._timeline=this.GetRuntime().GetTimelineManager().GetTimelineByName(d[1]);this.Get=this.GetTimeline;this._isConstant=!0}GetTimeline(){return this._timeline}} class FileParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._fileInfo=d[1];this.Get=this.GetFile;this._isConstant=!0}GetFile(){return this._fileInfo}} class InstVarParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._instVarIndex=d[1];a=this._owner.GetObjectClass();this._owner instanceof C3$jscomp$143.Condition&&this._owner.IsStatic()?(this.Get=this.GetInstanceVariable,this._isConstant=!0):a&&a.IsFamily()?(this.Get=this.GetFamilyInstanceVariable,this.SetVariesPerInstance()):(this.Get=this.GetInstanceVariable,this._isConstant=!0)}GetInstanceVariable(){return this._instVarIndex}GetFamilyInstanceVariable(a){a=a||0;const b= this._owner.GetObjectClass();var c=b.GetCurrentSol();const d=c.GetInstances();if(d.length)a=d[a%d.length].GetObjectClass();else if(c.HasAnyElseInstances())c=c.GetElseInstances(),a=c[a%c.length].GetObjectClass();else if(0<b.GetInstanceCount())c=b.GetInstances(),a=c[a%c.length].GetObjectClass();else return 0;return this._instVarIndex+a.GetFamilyInstanceVariableOffset(b.GetFamilyIndex())}} class EventVarParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._eventVarSid=d[1];this._eventVar=null;this.Get=this.GetEventVariable;this._isConstant=!0}_PostInit(){this._eventVar=this.GetRuntime().GetEventSheetManager().GetEventVariableBySID(this._eventVarSid)}GetEventVariable(){return this._eventVar}} class FunctionParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._functionBlockName=d[1];this._functionBlock=null;this.Get=this.GetFunction;this._isConstant=!0}_PostInit(){this._functionBlock=this.GetRuntime().GetEventSheetManager().GetFunctionBlockByName(this._functionBlockName);this._functionBlockName=null}GetFunction(){return this._functionBlock}} class VariadicParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._subParams=[];this._variadicRet=[];this._isConstant=!0;for(let e=1,g=d.length;e<g;++e)a=C3$jscomp$143.Parameter.Create(this._owner,d[e],0),this._subParams.push(a),this._variadicRet.push(0),a.IsConstant()||(this._isConstant=!1);this.Get=this.GetVariadic}_PostInit(){for(const a of this._subParams)a._PostInit()}GetVariadic(){const a=this._subParams,b=this._variadicRet;for(let c=0,d=a.length;c<d;++c)b[c]=a[c].Get(0); return b}}class EaseParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._easeIndex=d[1];this.Get=this.GetEase;this._isConstant=!0}GetEase(){return this._easeIndex}}class TilemapBrushParameter extends C3$jscomp$143.Parameter{constructor(a,b,c,d){super(a,b,c);this._brushIndex=d[1];this.Get=this.GetTilemapBrush;this._isConstant=!0}GetTilemapBrush(){return this._brushIndex}} class TemplateExpressionParameter extends ExpressionParameter{constructor(a,b,c,d){super(a,b,c,d);this.Get=this.GetTemplateName;this._isConstant=!1}GetTemplateName(){return this._expressionFunc()}}"use strict";const C3$jscomp$144=self.C3;function EvalParams(a,b){for(let c=0,d=a.length;c<d;++c)b[c]=a[c].Get(0)}const EMPTY_PARAMS_ARRAY=[],noop$jscomp$1=function(){}; C3$jscomp$144.Condition=class extends C3$jscomp$144.DefendedBase{constructor(a,b,c){super();this._eventBlock=a;this._runtime=a.GetRuntime();this._index=c;this._func=this._runtime.GetObjectReference(b[1]);this._isTrigger=0<b[3];this._isFastTrigger=2===b[3];this._isLooping=!!b[4];this._isInverted=!!b[5];this._isStatic=!!b[6];this._sid=b[7];this._isInOrBlock=this._eventBlock.IsOrBlock();this._behaviorType=this._objectClass=null;this._behaviorIndex=-1;this._systemPlugin=null;this.DebugRun=this.Run=noop$jscomp$1; this._parameters=[];this._results=[];this._anyParamVariesPerInstance=!1;this._unsavedData=this._savedData=null;this._debugData=this._runtime.IsDebug()?{isBreakpoint:b[8][0],canDebug:b[8][1]}:null;-1===b[0]?this._systemPlugin=this._runtime.GetSystemPlugin():(this._objectClass=this._runtime.GetObjectClassByIndex(b[0]),b[2]&&(this._behaviorType=this._objectClass.GetBehaviorTypeByName(b[2]),this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(b[2])),this._eventBlock.GetParent()&&this._eventBlock.GetParent().SetSolWriterAfterCnds()); if(10===b.length){a=b[9];for(let d of a)this._parameters.push(C3$jscomp$144.Parameter.Create(this,d,this._parameters.length)),this._results.push(0)}0===this._parameters.length&&(this._results=this._parameters=EMPTY_PARAMS_ARRAY);this._eventBlock.GetEventSheetManager()._RegisterCondition(this)}static Create(a,b,c){return C3$jscomp$144.New(C3$jscomp$144.Condition,a,b,c)}_PostInit(){for(const a of this._parameters)a._PostInit(),a.VariesPerInstance()&&(this._anyParamVariesPerInstance=!0);this._isFastTrigger? (this.Run=this._RunFastTrigger,this.DebugRun=this._DebugRunFastTrigger):this._systemPlugin?(this._SetSystemRunMethod(),this.DebugRun=this._DebugRunSystem):this._objectClass.GetPlugin().IsSingleGlobal()?(this._SetSingleGlobalRunMethod(),this.DebugRun=this._DebugRunSingleGlobal):this._isStatic?(this.Run=this._RunStatic,this.DebugRun=this._DebugRunStatic):(this.Run=this._RunObject,this.DebugRun=this._DebugRunObject)}_SetSystemRunMethod(){this._SetRunMethodForBoundFunc(this._systemPlugin,this._systemPlugin, this._RunSystem)}_SetSingleGlobalRunMethod(){const a=this._objectClass.GetPlugin(),b=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();this._SetRunMethodForBoundFunc(a,b,this._RunSingleGlobal)}_SetRunMethodForBoundFunc(a,b,c){const d=this._func,e=this._isInverted,g=this._parameters;if(0===g.length){const k=a._GetBoundACEMethod(d,b);this.Run=e?function(){return C3$jscomp$144.xor(k(),e)}:k}else if(1===g.length){const k=g[0];if(!e&&k.IsConstant())this.Run=a._GetBoundACEMethod_1param(d,b,k.Get(0)); else{const l=a._GetBoundACEMethod(d,b);this.Run=function(){return C3$jscomp$144.xor(l(k.Get(0)),e)}}}else if(2===g.length){const k=g[0],l=g[1];if(!e&&k.IsConstant()&&l.IsConstant())this.Run=a._GetBoundACEMethod_2params(d,b,k.Get(0),l.Get(0));else{const n=a._GetBoundACEMethod(d,b);this.Run=function(){return C3$jscomp$144.xor(n(k.Get(0),l.Get(0)),e)}}}else if(3===g.length){const k=g[0],l=g[1],n=g[2];if(!e&&k.IsConstant()&&l.IsConstant()&&n.IsConstant())this.Run=a._GetBoundACEMethod_3params(d,b,k.Get(0), l.Get(0),n.Get(0));else{const p=a._GetBoundACEMethod(d,b);this.Run=function(){return C3$jscomp$144.xor(p(k.Get(0),l.Get(0),n.Get(0)),e)}}}else this.Run=c}GetSID(){return this._sid}_GetFunc(){return this._func}GetObjectClass(){return this._objectClass}GetBehaviorType(){return this._behaviorType}GetEventBlock(){return this._eventBlock}GetRuntime(){return this._runtime}GetIndex(){return this._index}GetDebugIndex(){return this.GetIndex()}IsTrigger(){return this._isTrigger}IsFastTrigger(){return this._isFastTrigger}IsInverted(){return this._isInverted}IsLooping(){return this._isLooping}IsStatic(){return this._isStatic}IsBreakpoint(){return this._debugData.isBreakpoint}IsSystemCondition(){return!!this._systemPlugin}GetFirstObjectParameterObjectClass(){for(const a of this._parameters)if(a.IsObjectParameter())return a.GetObjectClass(); return null}_SetBreakpoint(a){this._debugData.isBreakpoint=!!a;this._eventBlock._UpdateCanRunFastRecursive()}_DebugReturnsGenerator(){return this._debugData.canDebug}DebugCanRunFast(){return!this.IsBreakpoint()&&!this._runtime.DebugBreakNext()&&!this._DebugReturnsGenerator()}GetSavedDataMap(){this._savedData||(this._savedData=new Map);return this._savedData}GetUnsavedDataMap(){this._unsavedData||(this._unsavedData=new Map);return this._unsavedData}_RunSystem(){const a=this._results;EvalParams(this._parameters, a);return C3$jscomp$144.xor(this._func.apply(this._systemPlugin,a),this._isInverted)}*_DebugRunSystem(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var a=this._results;EvalParams(this._parameters,a);a=this._func.apply(this._systemPlugin,a);C3$jscomp$144.IsIterator(a)&&(a=yield*a);return C3$jscomp$144.xor(a,this._isInverted)}return this.Run()}_RunSingleGlobal(){const a=this._results;EvalParams(this._parameters,a);const b=this._objectClass.GetSingleGlobalInstance().GetSdkInstance(); return C3$jscomp$144.xor(this._func.apply(b,a),this._isInverted)}*_DebugRunSingleGlobal(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var a=this._results;EvalParams(this._parameters,a);const b=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();a=this._func.apply(b,a);C3$jscomp$144.IsIterator(a)&&(a=yield*a);return C3$jscomp$144.xor(a,this._isInverted)}return this.Run()}_RunFastTrigger(){return!0}*_DebugRunFastTrigger(){if(this.IsBreakpoint()|| this._runtime.DebugBreakNext())yield this;return!0}_RunStatic(){var a=this._results;EvalParams(this._parameters,a);a=this._func.apply(this._behaviorType||this._objectClass,a);this._objectClass.ApplySolToContainer();return a}*_DebugRunStatic(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var a=this._results;EvalParams(this._parameters,a);a=this._func.apply(this._behaviorType||this._objectClass,a);C3$jscomp$144.IsIterator(a)&&(a=yield*a);this._objectClass.ApplySolToContainer(); return a}return this.Run()}_RunObject(){const a=this._parameters,b=this._results,c=this._objectClass.GetCurrentSol();for(let d=0,e=a.length;d<e;++d){const g=a[d];g.VariesPerInstance()||(b[d]=g.Get(0))}return c.IsSelectAll()?this._RunObject_FirstFilter(c):this._RunObject_NextFilter(c)}*_DebugRunObject(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;return this._RunObject()}_EvaluateVaryingParameters(a){const b=this._parameters,c=this._results;for(let d=0,e=b.length;d<e;++d){const g= b[d];g.VariesPerInstance()&&(c[d]=g.Get(a))}}_RunObject_FirstFilter(a){const b=this._objectClass,c=b.IsFamily(),d=b.GetFamilyIndex(),e=this._behaviorIndex,g=0<=e,k=b.GetInstances(),l=this._anyParamVariesPerInstance,n=this._results,p=this._func,r=this._isInverted,w=this._isInOrBlock&&!this._isTrigger;a.ClearArrays();for(let B=0,C=k.length;B<C;++B){const E=k[B];l&&this._EvaluateVaryingParameters(B);var y=void 0;g?(y=c?E.GetObjectClass().GetFamilyBehaviorOffset(d):0,y=p.apply(E.GetBehaviorInstances()[e+ y].GetSdkInstance(),n)):y=p.apply(E.GetSdkInstance(),n);C3$jscomp$144.xor(y,r)?a._PushInstance(E):w&&a._PushElseInstance(E)}b.FinishCondition(!0);a._SetSelectAll(!1);b.ApplySolToContainer();return a.HasAnyInstances()}_RunObject_NextFilter(a){const b=this._objectClass;var c=b.IsFamily();const d=b.GetFamilyIndex(),e=b.IsInContainer(),g=this._behaviorIndex,k=0<=g,l=this._anyParamVariesPerInstance,n=this._results,p=this._func,r=this._isInverted,w=this._isInOrBlock&&!this._isTrigger,y=a._GetOwnInstances(), B=a._GetOwnElseInstances(),C=w&&!this._eventBlock.IsFirstConditionOfType(this),E=C?B:y;let F=0,J=!1;for(let O=0,V=E.length;O<V;++O){const W=E[O];l&&this._EvaluateVaryingParameters(O);var L=void 0;k?(L=c?W.GetObjectClass().GetFamilyBehaviorOffset(d):0,L=p.apply(W.GetBehaviorInstances()[g+L].GetSdkInstance(),n)):L=p.apply(W.GetSdkInstance(),n);C3$jscomp$144.xor(L,r)?(J=!0,C?(y.push(W),e&&W._PushSiblingsToSolInstances()):(E[F]=W,e&&W._SetSiblingsToSolInstancesIndex(F),++F)):C?(E[F]=W,e&&W._SetSiblingsToSolElseInstancesIndex(F), ++F):w&&(B.push(W),e&&W._PushSiblingsToSolElseInstances())}C3$jscomp$144.truncateArray(E,F);e&&b._TruncateContainerSols(C,F);c=J;C&&!J&&(J=this._OrBlockCheckInstances(y));b.FinishCondition(c||w);return w?J:a.HasAnyInstances()}_OrBlockCheckInstances(a){var b=this._objectClass;const c=b.IsFamily();b=b.GetFamilyIndex();const d=this._anyParamVariesPerInstance,e=this._behaviorIndex,g=0<=e,k=this._results,l=this._func,n=this._isInverted;for(let r=0,w=a.length;r<w;++r){var p=a[r];d&&this._EvaluateVaryingParameters(r); if(g){const y=c?p.GetObjectClass().GetFamilyBehaviorOffset(b):0;p=l.apply(p.GetBehaviorInstances()[e+y].GetSdkInstance(),k)}else p=l.apply(p.GetSdkInstance(),k);if(C3$jscomp$144.xor(p,n))return!0}return!1}ReevaluateParameter(a,b){return this._parameters[a].Get(b)}GetFastTriggerValue(){const a=this._parameters;if(!a.length)throw Error("no parameters");return a[0]._GetFastTriggerValue()}_SaveToJson(){if(!this._savedData||!this._savedData.size)return null;const a={};for(const [b,c]of this._savedData.entries()){let d= c;"collmemory"===b&&(d=[...c.entries()].map(e=>[e[0].GetUID(),e[1].GetUID(),e[2]]));a[b]=d}return{ex:a}}_LoadFromJson(a){this._savedData&&(this._savedData.clear(),this._savedData=null);if(a){var b=this._runtime,c=a.ex;if(c){a=this.GetSavedDataMap();a.clear();for(const [d,e]of Object.entries(c))c=e,"collmemory"===d&&(c=C3$jscomp$144.New(C3$jscomp$144.PairMap,e.map(g=>[b.GetInstanceByUID(g[0]),b.GetInstanceByUID(g[1]),g[2]]).filter(g=>g[0]&&g[1]))),a.set(d,c)}}}};"use strict";const C3$jscomp$145=self.C3; function EvalParams$jscomp$1(a,b){for(let c=0,d=a.length;c<d;++c)b[c]=a[c].Get(0)}const EMPTY_PARAMS_ARRAY$jscomp$1=[],noop$jscomp$2=function(){},noopGenerator=function*(){}; C3$jscomp$145.Action=class extends C3$jscomp$145.DefendedBase{constructor(a,b,c){super();this._eventBlock=a;this._runtime=a=a.GetRuntime();this._index=c;this._sid=4<=b.length?b[3]:-1;this._actionType=5<=b.length?b[4]&255:0;this._flags=5<=b.length?b[4]>>8:0;this._behaviorType=this._objectClass=this._func=null;this._behaviorIndex=-1;this._systemPlugin=null;this._callFunctionName="";this._callEventBlock=this._callCustomAceObjectClass=null;this.DebugRun=this.Run=noop$jscomp$2;this._parameters=[];this._results= [];this._anyParamVariesPerInstance=!1;this._unsavedData=this._savedData=null;const d=(c=-3===b[0])?b[2]:b[5];this._debugData=a.IsDebug()||c?{isBreakpoint:d[0],canDebug:d[1],index:d[2]}:null;-1===b[0]?(this._systemPlugin=a.GetSystemPlugin(),this._func=a.GetObjectReference(b[1])):-2===b[0]?this._callFunctionName=b[1]:c?(this._func=a.GetObjectReference(b[1]),this.Run=this.RunUserScript,this.DebugRun=this.DebugRunUserScript,this._actionType=1):(this._objectClass=a.GetObjectClassByIndex(b[0]),this._flags& 4?(this._callFunctionName=b[1],this._callCustomAceObjectClass=a.GetObjectClassByIndex(b[2])):(b[2]&&(this._behaviorType=this._objectClass.GetBehaviorTypeByName(b[2]),this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(b[2])),this._func=a.GetObjectReference(b[1])));if(7===b.length){b=b[6];for(const e of b)this._parameters.push(C3$jscomp$145.Parameter.Create(this,e,this._parameters.length)),this._results.push(0)}0===this._parameters.length&&(this._results=this._parameters=EMPTY_PARAMS_ARRAY$jscomp$1); this.CanPickAnyObjectClass()&&(this._eventBlock.SetAllSolModifiers(),this._eventBlock.SetSolWriterAfterCnds());this._eventBlock.GetEventSheetManager()._RegisterAction(this)}static Create(a,b,c){return C3$jscomp$145.New(C3$jscomp$145.Action,a,b,c)}_PostInit(){for(var a of this._parameters)a._PostInit(),a.VariesPerInstance()&&(this._anyParamVariesPerInstance=!0);if(this._systemPlugin)this._SetSystemRunMethod(),this.DebugRun=this._DebugRunSystem;else if(this._callFunctionName)this._flags&4?this._SetCallCustomActionRunMethod(): this._SetCallFunctionRunMethod(),this._callFunctionName="",this._callCustomAceObjectClass=null;else if(this.Run===this.RunUserScript){a=this._func;const b=this._runtime.GetEventSheetManager()._GetLocalVariablesScriptInterface(this._eventBlock);this._func=a.bind(null,this._runtime.GetIRuntime(),b)}else this._behaviorType?this.IsAsync()?(this.Run=this._RunBehavior_Async,this.DebugRun=this._DebugRunBehavior_Async):(this.Run=this._RunBehavior,this.DebugRun=this._DebugRunBehavior):this._objectClass.GetPlugin().IsSingleGlobal()? (this._SetSingleGlobalRunMethod(),this.DebugRun=this._DebugRunSingleGlobal):this.IsAsync()?(this.Run=this._RunObject_Async,this.DebugRun=this._DebugRunObject_Async):this.CallBeforeAfterHooks()?(this.Run=this._RunObject_BeforeAfterHooks,this.DebugRun=this._DebugRunObject_BeforeAfterHooks):this._parameters.length?this._parameters.every(b=>b.VariesPerInstance())?(this.Run=this._RunObject_AllParamsVary,this.DebugRun=this._DebugRunObject_AllParamsVary):this._anyParamVariesPerInstance?(this.Run=this._RunObject_SomeParamsVary, this.DebugRun=this._DebugRunObject_SomeParamsVary):this._parameters.every(b=>b.IsConstant())?(EvalParams$jscomp$1(this._parameters,this._results),this.Run=this._RunObject_ParamsConst,this.DebugRun=this._DebugRunObject_ParamsConst):(this.Run=this._RunObject_ParamsDontVary,this.DebugRun=this._DebugRunObject_ParamsDontVary):(this.Run=this._RunObject_ParamsConst,this.DebugRun=this._DebugRunObject_ParamsConst)}_SetSystemRunMethod(){this._SetRunMethodForBoundFunc(this._systemPlugin,this._systemPlugin,this._RunSystem)}_SetSingleGlobalRunMethod(){const a= this._objectClass.GetPlugin(),b=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();this._SetRunMethodForBoundFunc(a,b,this._RunSingleGlobal)}_SetCallFunctionRunMethod(){const a=this._eventBlock.GetEventSheetManager(),b=a.GetFunctionBlockByName(this._callFunctionName);if(b.IsEnabled()){const c=0!==(this._flags&2);this._callEventBlock=b.GetEventBlock();let d=[...(new Set([...this._eventBlock.GetSolModifiersIncludingParents(),...this._callEventBlock.GetSolModifiersIncludingParents()]))];d= a._DeduplicateSolModifierList(d);const e=!b.IsCopyPicked()&&this._HasCopyPickedParent()?{pushCleanSolDynamic:!0}:null;this.Run=C3$jscomp$145.EventBlock.prototype.RunAsFunctionCall.bind(this._callEventBlock,d,this._parameters,c,e);if(this._runtime.IsDebug()){const g=this;this.DebugRun=function*(){if(g.IsBreakpoint()||g._runtime.DebugBreakNext())yield g;return yield*g._callEventBlock.DebugRunAsFunctionCall(d,g._parameters,c,e)}}else this.DebugRun=noopGenerator}else this.Run=noop$jscomp$2,this.DebugRun= noopGenerator}_SetCallCustomActionRunMethod(){var a=this._eventBlock.GetEventSheetManager();const b=a.GetCustomActionBlockByName(this._callCustomAceObjectClass,this._callFunctionName);if(b.IsEnabled()){const c=0!==(this._flags&2);this._callEventBlock=b.GetEventBlock();let d=[...(new Set([...this._eventBlock.GetSolModifiersIncludingParents(),...this._callEventBlock.GetSolModifiersIncludingParents(),this._objectClass,b.GetObjectClass()]))];d=a._DeduplicateSolModifierList(d);a=!this._objectClass.IsFamily()&& !b.GetObjectClass().IsFamily();const e=!this._objectClass.IsFamily()&&b.GetObjectClass().IsFamily(),g=this._objectClass.IsFamily();let k=null;!b.IsCopyPicked()&&this._HasCopyPickedParent()&&(k=k||{},k.pushCleanSolDynamic=!0);if(e||!c)k=k||{},k.copyFromObjectClass=this._objectClass,k.copyToObjectClass=b.GetObjectClass();a||e||g&&!b.HasCustomACEOverrides()?this.Run=C3$jscomp$145.EventBlock.prototype.RunAsFunctionCall.bind(this._callEventBlock,d,this._parameters,c,k):g&&(this.Run=C3$jscomp$145.FunctionBlock.prototype.RunAsFamilyCustomActionWithOverrides.bind(b, d,this._parameters));if(this._runtime.IsDebug()){const l=this;a||e||g&&!b.HasCustomACEOverrides()?this.DebugRun=function*(){if(l.IsBreakpoint()||l._runtime.DebugBreakNext())yield l;return yield*l._callEventBlock.DebugRunAsFunctionCall(d,l._parameters,c,k)}:g&&(this.DebugRun=function*(){if(l.IsBreakpoint()||l._runtime.DebugBreakNext())yield l;return yield*b.DebugRunAsFamilyCustomActionWithOverrides(d,l._parameters)})}else this.DebugRun=noopGenerator}else this.Run=noop$jscomp$2,this.DebugRun=noopGenerator}_SetRunMethodForBoundFunc(a, b,c){const d=this._func,e=this._parameters;if(0===e.length)this.Run=a._GetBoundACEMethod(d,b);else if(1===e.length){const g=e[0];if(g.IsConstant())this.Run=a._GetBoundACEMethod_1param(d,b,g.Get(0));else{const k=a._GetBoundACEMethod(d,b);this.Run=function(){return k(g.Get(0))}}}else if(2===e.length){const g=e[0],k=e[1];if(g.IsConstant()&&k.IsConstant())this.Run=a._GetBoundACEMethod_2params(d,b,g.Get(0),k.Get(0));else{const l=a._GetBoundACEMethod(d,b);this.Run=function(){return l(g.Get(0),k.Get(0))}}}else if(3=== e.length){const g=e[0],k=e[1],l=e[2];if(g.IsConstant()&&k.IsConstant()&&l.IsConstant())this.Run=a._GetBoundACEMethod_3params(d,b,g.Get(0),k.Get(0),l.Get(0));else{const n=a._GetBoundACEMethod(d,b);this.Run=function(){return n(g.Get(0),k.Get(0),l.Get(0))}}}else this.Run=c}GetSID(){return this._sid}IsAsync(){return 1===this._actionType}CanBailOut(){return 2===this._actionType}CallBeforeAfterHooks(){return 3===this._actionType}CanPickAnyObjectClass(){return 0!==(this._flags&1)}HasReturnType(){return this.IsAsync()|| this.CanBailOut()}GetObjectClass(){return this._objectClass}GetEventBlock(){return this._eventBlock}_HasCopyPickedParent(){let a=this._eventBlock;do{if(a instanceof C3$jscomp$145.FunctionBlock&&a.IsCopyPicked())return!0;a=a.GetScopeParent()}while(a);return!1}GetRuntime(){return this._runtime}GetIndex(){return this._index}GetDebugIndex(){return this._debugData.index}IsBreakpoint(){return this._debugData.isBreakpoint}_SetBreakpoint(a){this._debugData.isBreakpoint=!!a;this._eventBlock._UpdateCanRunFastRecursive()}_DebugReturnsGenerator(){return this._debugData.canDebug}DebugCanRunFast(){return!this.IsBreakpoint()&& !this._runtime.DebugBreakNext()&&!this._DebugReturnsGenerator()}GetSavedDataMap(){this._savedData||(this._savedData=new Map);return this._savedData}GetUnsavedDataMap(){this._unsavedData||(this._unsavedData=new Map);return this._unsavedData}_RunSystem(){const a=this._results;EvalParams$jscomp$1(this._parameters,a);return this._func.apply(this._systemPlugin,a)}*_DebugRunSystem(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const a=this._results; EvalParams$jscomp$1(this._parameters,a);return yield*this._func.apply(this._systemPlugin,a)}return this.Run()}_RunSingleGlobal(){const a=this._results;EvalParams$jscomp$1(this._parameters,a);return this._func.apply(this._objectClass.GetSingleGlobalInstance().GetSdkInstance(),a)}*_DebugRunSingleGlobal(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const a=this._results;EvalParams$jscomp$1(this._parameters,a);return yield*this._func.apply(this._objectClass.GetSingleGlobalInstance().GetSdkInstance(), a)}return this.Run()}_RunObject_ParamsConst(){const a=this._results,b=this._objectClass.GetCurrentSol().GetInstances();for(let c=0,d=b.length;c<d;++c)this._func.apply(b[c].GetSdkInstance(),a)}*_DebugRunObject_ParamsConst(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const a=this._results,b=this._objectClass.GetCurrentSol().GetInstances();for(let c=0,d=b.length;c<d;++c)yield*this._func.apply(b[c].GetSdkInstance(),a)}else this._RunObject_ParamsConst()}_RunObject_ParamsDontVary(){const a= this._results;EvalParams$jscomp$1(this._parameters,a);const b=this._objectClass.GetCurrentSol().GetInstances();for(let c=0,d=b.length;c<d;++c)this._func.apply(b[c].GetSdkInstance(),a)}*_DebugRunObject_ParamsDontVary(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const a=this._results;EvalParams$jscomp$1(this._parameters,a);const b=this._objectClass.GetCurrentSol().GetInstances();for(let c=0,d=b.length;c<d;++c)yield*this._func.apply(b[c].GetSdkInstance(), a)}else this._RunObject_ParamsDontVary()}_RunObject_AllParamsVary(){const a=this._parameters,b=this._results,c=this._func,d=this._objectClass.GetCurrentSol().GetInstances();for(let e=0,g=d.length;e<g;++e){const k=d[e];for(let l=0,n=a.length;l<n;++l)b[l]=a[l].Get(e);c.apply(k.GetSdkInstance(),b)}}*_DebugRunObject_AllParamsVary(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const a=this._parameters,b=this._results,c=this._func,d=this._objectClass.GetCurrentSol().GetInstances(); for(let e=0,g=d.length;e<g;++e){const k=d[e];for(let l=0,n=a.length;l<n;++l)b[l]=a[l].Get(e);yield*c.apply(k.GetSdkInstance(),b)}}else this._RunObject_AllParamsVary()}_RunObject_SomeParamsVary(){const a=this._parameters,b=this._results,c=this._func,d=this._objectClass.GetCurrentSol().GetInstances();for(let g=0,k=a.length;g<k;++g){var e=a[g];e.VariesPerInstance()||(b[g]=e.Get(0))}for(let g=0,k=d.length;g<k;++g){e=d[g];for(let l=0,n=a.length;l<n;++l){const p=a[l];p.VariesPerInstance()&&(b[l]=p.Get(g))}c.apply(e.GetSdkInstance(), b)}}*_DebugRunObject_SomeParamsVary(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const b=this._parameters,c=this._results,d=this._func,e=this._objectClass.GetCurrentSol().GetInstances();for(let g=0,k=b.length;g<k;++g){var a=b[g];a.VariesPerInstance()||(c[g]=a.Get(0))}for(let g=0,k=e.length;g<k;++g){a=e[g];for(let l=0,n=b.length;l<n;++l){const p=b[l];p.VariesPerInstance()&&(c[l]=p.Get(g))}yield*d.apply(a.GetSdkInstance(),c)}}else this._RunObject_SomeParamsVary()}_RunObject_BeforeAfterHooks(){const a= this._parameters,b=this._results,c=this._func;var d=this._objectClass;const e=d.GetSdkType();d=d.GetCurrentSol().GetInstances();e.BeforeRunAction(c);for(let g=0,k=d.length;g<k;++g){const l=d[g];for(let n=0,p=a.length;n<p;++n)b[n]=a[n].Get(g);c.apply(l.GetSdkInstance(),b)}e.AfterRunAction(c)}*_DebugRunObject_BeforeAfterHooks(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const b=this._parameters,c=this._results,d=this._func;var a=this._objectClass; const e=a.GetSdkType();a=a.GetCurrentSol().GetInstances();e.BeforeRunAction(d);for(let g=0,k=a.length;g<k;++g){const l=a[g];for(let n=0,p=b.length;n<p;++n)c[n]=b[n].Get(g);yield*d.apply(l.GetSdkInstance(),c)}e.AfterRunAction(d)}else this._RunObject_BeforeAfterHooks()}_RunBehavior(){var a=this._objectClass;const b=a.IsFamily(),c=a.GetFamilyIndex(),d=this._parameters,e=this._anyParamVariesPerInstance,g=this._results,k=this._func,l=this._behaviorIndex;a=a.GetCurrentSol().GetInstances();for(let r=0,w= d.length;r<w;++r){var n=d[r];n.VariesPerInstance()||(g[r]=n.Get(0))}for(let r=0,w=a.length;r<w;++r){n=a[r];if(e)for(let y=0,B=d.length;y<B;++y){var p=d[y];p.VariesPerInstance()&&(g[y]=p.Get(r))}p=b?n.GetObjectClass().GetFamilyBehaviorOffset(c):0;k.apply(n.GetBehaviorInstances()[l+p].GetSdkInstance(),g)}}*_DebugRunBehavior(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var a=this._objectClass;const d=a.IsFamily(),e=a.GetFamilyIndex(),g=this._parameters, k=this._anyParamVariesPerInstance,l=this._results,n=this._func,p=this._behaviorIndex;a=a.GetCurrentSol().GetInstances();for(let r=0,w=g.length;r<w;++r){var b=g[r];b.VariesPerInstance()||(l[r]=b.Get(0))}for(let r=0,w=a.length;r<w;++r){b=a[r];if(k)for(let y=0,B=g.length;y<B;++y){var c=g[y];c.VariesPerInstance()&&(l[y]=c.Get(r))}c=d?b.GetObjectClass().GetFamilyBehaviorOffset(e):0;yield*n.apply(b.GetBehaviorInstances()[p+c].GetSdkInstance(),l)}}else this._RunBehavior()}_RunObject_Async(){const a=this._parameters, b=this._results,c=this._func,d=this._objectClass.GetCurrentSol().GetInstances(),e=[];for(let g=0,k=d.length;g<k;++g){const l=d[g];for(let n=0,p=a.length;n<p;++n)b[n]=a[n].Get(g);e.push(c.apply(l.GetSdkInstance(),b))}return Promise.all(e)}*_DebugRunObject_Async(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const a=this._parameters,b=this._results,c=this._func,d=this._objectClass.GetCurrentSol().GetInstances(),e=[];for(let g=0,k=d.length;g<k;++g){const l= d[g];for(let n=0,p=a.length;n<p;++n)b[n]=a[n].Get(g);e.push(yield*c.apply(l.GetSdkInstance(),b))}return Promise.all(e)}return this._RunObject_Async()}_RunBehavior_Async(){var a=this._objectClass;const b=a.IsFamily(),c=a.GetFamilyIndex(),d=this._parameters,e=this._results,g=this._func,k=this._behaviorIndex;a=a.GetCurrentSol().GetInstances();const l=[];for(let n=0,p=a.length;n<p;++n){const r=a[n];for(let y=0,B=d.length;y<B;++y)e[y]=d[y].Get(n);const w=b?r.GetObjectClass().GetFamilyBehaviorOffset(c): 0;l.push(g.apply(r.GetBehaviorInstances()[k+w].GetSdkInstance(),e))}return Promise.all(l)}*_DebugRunBehavior_Async(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var a=this._objectClass;const b=a.IsFamily(),c=a.GetFamilyIndex(),d=this._parameters,e=this._results,g=this._func,k=this._behaviorIndex;a=a.GetCurrentSol().GetInstances();const l=[];for(let n=0,p=a.length;n<p;++n){const r=a[n];for(let y=0,B=d.length;y<B;++y)e[y]=d[y].Get(n);const w=b? r.GetObjectClass().GetFamilyBehaviorOffset(c):0;l.push(yield*g.apply(r.GetBehaviorInstances()[k+w].GetSdkInstance(),e))}return Promise.all(l)}return this._RunBehavior_Async()}async RunUserScript(){try{await this._func()}catch(a){console.error(`Unhandled exception running script %c${this._eventBlock.GetEventSheet().GetName()}, event ${this._eventBlock.GetDisplayNumber()}, action ${this.GetDebugIndex()+1}:`,"font-size: 1.2em; font-weight: bold;",a),self.C3Debugger&&self.C3Debugger._SetLastErrorScript(this), C3$jscomp$145.EventScript.HadUserScriptException()||(console.info("%cTip:%c run this to highlight in Construct the last script that had an error: %cgoToLastErrorScript()","font-weight: bold; text-decoration: underline","","font-weight: bold"),C3$jscomp$145.EventScript.SetHadUserScriptException())}}*DebugRunUserScript(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;return this.RunUserScript()}_SaveToJson(){return this._savedData&&this._savedData.size?{ex:C3$jscomp$145.ToSuperJSON(this._savedData)}: null}_LoadFromJson(a){this._savedData&&(this._savedData.clear(),this._savedData=null);a&&(a=a.ex)&&(this._savedData=C3$jscomp$145.FromSuperJSON(a))}};"use strict";const C3$jscomp$146=self.C3,tempColor$jscomp$5=new C3$jscomp$146.Color;function CompareX(a,b){return C3$jscomp$146.compare(this.GetWorldInfo().GetX(),a,b)}function CompareY(a,b){return C3$jscomp$146.compare(this.GetWorldInfo().GetY(),a,b)}function IsOnScreen(){return this.GetWorldInfo().IsInViewport2()} function IsOutsideLayout(){var a=this.GetWorldInfo();const b=a.GetLayout();a=a.GetBoundingBox();return 0>a.getRight()||0>a.getBottom()||a.getLeft()>b.GetWidth()||a.getTop()>b.GetHeight()} function PickDistance(a,b,c){const d=this.GetCurrentSol(),e=d.GetInstances();if(!e.length)return!1;let g=e[0];var k=g.GetWorldInfo();let l=g,n=C3$jscomp$146.distanceSquared(k.GetX(),k.GetY(),b,c);for(let p=1,r=e.length;p<r;++p)if(g=e[p],k=g.GetWorldInfo(),k=C3$jscomp$146.distanceSquared(k.GetX(),k.GetY(),b,c),0===a&&k<n||1===a&&k>n)n=k,l=g;d.PickOne(l);return!0}function SetX(a){const b=this.GetWorldInfo();b.GetX()!==a&&(b.SetX(a),b.SetBboxChanged())} function SetY(a){const b=this.GetWorldInfo();b.GetY()!==a&&(b.SetY(a),b.SetBboxChanged())}function SetPos(a,b){const c=this.GetWorldInfo();c.EqualsXY(a,b)||(c.SetXY(a,b),c.SetBboxChanged())}function SetPosToObject(a,b){if(a&&(a=a.GetPairedInstance(this._inst))){var [c,d]=a.GetImagePoint(b);b=this.GetWorldInfo();if(b.GetX()!==c||b.GetY()!==d)b.SetXY(c,d),b.SetBboxChanged()}} function MoveForward(a){if(0!==a){var b=this.GetWorldInfo();b.OffsetXY(b.GetCosAngle()*a,b.GetSinAngle()*a);b.SetBboxChanged()}}function MoveAtAngle(a,b){if(0!==b){var c=this.GetWorldInfo();a=C3$jscomp$146.toRadians(a);c.OffsetXY(Math.cos(a)*b,Math.sin(a)*b);c.SetBboxChanged()}}function GetX(){return this.GetWorldInfo().GetX()}function GetY(){return this.GetWorldInfo().GetY()}function GetDt(){return this._runtime.GetDt(this._inst)} function CompareWidth(a,b){return C3$jscomp$146.compare(this.GetWorldInfo().GetWidth(),a,b)}function CompareHeight(a,b){return C3$jscomp$146.compare(this.GetWorldInfo().GetHeight(),a,b)}function SetWidth(a){const b=this.GetWorldInfo();b.GetWidth()!==a&&(b.SetWidth(a),b.SetBboxChanged())}function SetHeight(a){const b=this.GetWorldInfo();b.GetHeight()!==a&&(b.SetHeight(a),b.SetBboxChanged())} function SetSize(a,b){const c=this.GetWorldInfo();if(c.GetWidth()!==a||c.GetHeight()!==b)c.SetSize(a,b),c.SetBboxChanged()}function GetWidth(){return this.GetWorldInfo().GetWidth()}function GetHeight(){return this.GetWorldInfo().GetHeight()}function GetBboxLeft(){return this.GetWorldInfo().GetBoundingBox().getLeft()}function GetBboxTop(){return this.GetWorldInfo().GetBoundingBox().getTop()}function GetBboxRight(){return this.GetWorldInfo().GetBoundingBox().getRight()} function GetBboxBottom(){return this.GetWorldInfo().GetBoundingBox().getBottom()}function GetBboxMidX(){const a=this.GetWorldInfo().GetBoundingBox();return(a.getLeft()+a.getRight())/2}function GetBboxMidY(){const a=this.GetWorldInfo().GetBoundingBox();return(a.getTop()+a.getBottom())/2}function IsAngleWithin(a,b){return C3$jscomp$146.angleDiff(this.GetWorldInfo().GetAngle(),C3$jscomp$146.toRadians(b))<=C3$jscomp$146.toRadians(a)} function IsAngleClockwiseFrom(a){return C3$jscomp$146.angleClockwise(this.GetWorldInfo().GetAngle(),C3$jscomp$146.toRadians(a))}function IsBetweenAngles(a,b){a=C3$jscomp$146.toRadians(a);b=C3$jscomp$146.toRadians(b);const c=this.GetWorldInfo().GetAngle();return C3$jscomp$146.angleClockwise(b,a)?C3$jscomp$146.angleClockwise(c,a)&&!C3$jscomp$146.angleClockwise(c,b):!(!C3$jscomp$146.angleClockwise(c,a)&&C3$jscomp$146.angleClockwise(c,b))} function SetAngle(a){const b=this.GetWorldInfo();a=C3$jscomp$146.clampAngle(C3$jscomp$146.toRadians(a));isNaN(a)||b.GetAngle()===a||(b.SetAngle(a),b.SetBboxChanged())}function RotateClockwise(a){if(!isNaN(a)&&0!==a){var b=this.GetWorldInfo();b.SetAngle(b.GetAngle()+C3$jscomp$146.toRadians(a));b.SetBboxChanged()}}function RotateCounterclockwise(a){if(!isNaN(a)&&0!==a){var b=this.GetWorldInfo();b.SetAngle(b.GetAngle()-C3$jscomp$146.toRadians(a));b.SetBboxChanged()}} function RotateTowardAngle(a,b){const c=this.GetWorldInfo(),d=c.GetAngle();a=C3$jscomp$146.angleRotate(d,C3$jscomp$146.toRadians(b),C3$jscomp$146.toRadians(a));isNaN(a)||d===a||(c.SetAngle(a),c.SetBboxChanged())}function RotateTowardPosition(a,b,c){const d=this.GetWorldInfo(),e=d.GetAngle();b-=d.GetX();c-=d.GetY();a=C3$jscomp$146.angleRotate(e,Math.atan2(c,b),C3$jscomp$146.toRadians(a));isNaN(a)||e===a||(d.SetAngle(a),d.SetBboxChanged())} function SetTowardPosition(a,b){const c=this.GetWorldInfo(),d=c.GetAngle();a-=c.GetX();b-=c.GetY();b=Math.atan2(b,a);isNaN(b)||d===b||(c.SetAngle(b),c.SetBboxChanged())}function GetAngle(){return C3$jscomp$146.toDegrees(this.GetWorldInfo().GetAngle())}function CompareOpacity(a,b){return C3$jscomp$146.compare(C3$jscomp$146.roundToDp(100*this.GetWorldInfo().GetOpacity(),6),a,b)}function IsVisible(){return this.GetWorldInfo().IsVisible()} function SetVisible(a){const b=this.GetWorldInfo();a=2===a?!b.IsVisible():0!==a;b.IsVisible()!==a&&(b.SetVisible(a),this._runtime.UpdateRender())}function SetOpacity(a){a=C3$jscomp$146.clamp(a/100,0,1);const b=this.GetWorldInfo();if(b.GetTransformWithParentOpacity()){if(b._GetSceneGraphInfo().GetOwnOpacity()===a)return}else if(b.GetOpacity()===a)return;b.SetOpacity(a);this._runtime.UpdateRender()} function SetDefaultColor(a){tempColor$jscomp$5.setFromRgbValue(a);a=this.GetWorldInfo();a.GetUnpremultipliedColor().equalsIgnoringAlpha(tempColor$jscomp$5)||(a.SetUnpremultipliedColor(tempColor$jscomp$5),this._runtime.UpdateRender())}function GetColor(){const a=this.GetWorldInfo().GetUnpremultipliedColor();return C3$jscomp$146.PackRGBAEx(a.getR(),a.getG(),a.getB(),a.getA())}function GetOpacity(){return C3$jscomp$146.roundToDp(100*this.GetWorldInfo().GetOpacity(),6)} function IsOnLayer(a){return a?this.GetWorldInfo().GetLayer()===a:!1}function PickTopBottom(a){const b=this.GetCurrentSol(),c=b.GetInstances();if(!c.length)return!1;let d=c[0];for(let e=1,g=c.length;e<g;++e){const k=c[e],l=k.GetWorldInfo(),n=d.GetWorldInfo(),p=l.GetLayer().GetIndex(),r=n.GetLayer().GetIndex();if(0===a){if(p>r||p===r&&l.GetZIndex()>n.GetZIndex())d=k}else if(p<r||p===r&&l.GetZIndex()<n.GetZIndex())d=k}b.PickOne(d);return!0} function CompareZElevation(a,b,c){const d=this.GetWorldInfo();a=0===a?d.GetZElevation():d.GetTotalZElevation();return C3$jscomp$146.compare(a,b,c)}function MoveToTop(){this.GetWorldInfo().ZOrderMoveToTop()}function MoveToBottom(){this.GetWorldInfo().ZOrderMoveToBottom()}function MoveToLayer(a){a&&this.GetWorldInfo().ZOrderMoveToLayer(a)}function ZMoveToObject(a,b){a=0===a;b&&(b=b.GetFirstPicked(this.GetInstance()))&&this.GetWorldInfo().ZOrderMoveAdjacentToInstance(b,a)} function SetZElevation(a){const b=this.GetWorldInfo();b.GetZElevation()!==a&&(b.SetZElevation(a),this._runtime.UpdateRender())}function LayerNumber(){return this.GetWorldInfo().GetLayer().GetIndex()}function LayerName(){return this.GetWorldInfo().GetLayer().GetName()}function ZIndex(){return this.GetWorldInfo().GetZIndex()}function ZElevation(){return this.GetWorldInfo().GetZElevation()}function TotalZElevation(){return this.GetWorldInfo().GetTotalZElevation()} function IsEffectEnabled(a){if(a=this.GetObjectClass().GetEffectList().GetEffectTypeByName(a))return a=a.GetIndex(),this.GetWorldInfo().GetInstanceEffectList().IsEffectIndexActive(a)}function SetEffectEnabled(a,b){if(b=this.GetObjectClass().GetEffectList().GetEffectTypeByName(b)){b=b.GetIndex();a=1===a;var c=this.GetWorldInfo().GetInstanceEffectList();c.IsEffectIndexActive(b)!==a&&(c.SetEffectIndexActive(b,a),c.UpdateActiveEffects(),this._runtime.UpdateRender())}} function SetEffectParam(a,b,c){if(a=this.GetObjectClass().GetEffectList().GetEffectTypeByName(a)){b=Math.floor(b);var d=a.GetShaderProgram().GetParameterType(b);d&&("color"===d?(tempColor$jscomp$5.setFromRgbValue(c),c=tempColor$jscomp$5):"percent"===d&&(c/=100),a=a.GetIndex(),d=this.GetWorldInfo().GetInstanceEffectList(),d.SetEffectParameter(a,b,c)&&d.IsEffectIndexActive(a)&&this._runtime.UpdateRender())}} const tempRect$jscomp$4=C3$jscomp$146.New(C3$jscomp$146.Rect),tempCandidates1=[],tempCandidates2=[];let needsCollisionFinish=!1,rPickType=null,rPickFromElseInstances=!1;const rToPick=new Set;function CollMemory_Add(a,b,c,d){const e=b.GetUID(),g=c.GetUID();e<g?a.Set(b,c,d):a.Set(c,b,d)}function CollMemory_Remove(a,b,c){const d=b.GetUID(),e=c.GetUID();d<e?a.Delete(b,c):a.Delete(c,b)}function CollMemory_RemoveInstance(a,b){a.DeleteEither(b)} function CollMemory_Get(a,b,c){const d=b.GetUID(),e=c.GetUID();return d<e?a.Get(b,c):a.Get(c,b)} function DoOverlapCondition(a,b,c,d){if(!b)return!1;a=a.GetInstance();const e=0!==c||0!==d,g=a.GetWorldInfo(),k=a.GetRuntime(),l=k.GetCollisionEngine();var n=k.GetCurrentCondition();const p=n.GetEventBlock().IsOrBlock();var r=n.GetObjectClass();n=n.IsInverted();const w=b.GetCurrentSol();r=r!==b;rPickType=b;needsCollisionFinish=r&&!n;rPickFromElseInstances=!1;let y=0,B=0,C=!1;w.IsSelectAll()?(tempRect$jscomp$4.copy(g.GetBoundingBox()),tempRect$jscomp$4.offset(c,d),l.GetCollisionCandidates(g.GetLayer(), b,tempRect$jscomp$4,tempCandidates2),b=tempCandidates2):p?k.IsCurrentConditionFirst()&&!w._GetOwnElseInstances().length&&w._GetOwnInstances().length?b=w._GetOwnInstances():(b=w._GetOwnElseInstances(),rPickFromElseInstances=!0):b=w._GetOwnInstances();e&&(y=g.GetX(),B=g.GetY(),g.OffsetXY(c,d),g.SetBboxChanged());for(const E of b)if(l.TestOverlap(a,E)){C=!0;if(n)break;r&&rToPick.add(E)}e&&(g.SetXY(y,B),g.SetBboxChanged());C3$jscomp$146.clearArray(tempCandidates2);return C} function FinishCollisionConditionPicking(a){a=a.GetRuntime().GetCurrentEvent().IsOrBlock();const b=rPickType.GetCurrentSol(),c=b._GetOwnInstances(),d=b._GetOwnElseInstances();b.IsSelectAll()?(b.SetSetPicked(rToPick),a&&(C3$jscomp$146.clearArray(d),b.AddElseInstances(rToPick,rPickType.GetInstances()))):a?rPickFromElseInstances?b.TransferElseInstancesToOwn(rToPick):(b.AddElseInstances(rToPick,c),b.SetSetPicked(rToPick)):b.SetSetPicked(rToPick);rPickType.ApplySolToContainer()} function FinishCollisionCondition(a,b){needsCollisionFinish&&(b&&FinishCollisionConditionPicking(a),rToPick.clear(),rPickType=null,needsCollisionFinish=!1)} function OnCollision(a){if(this._runtime.IsDebugging())return DebugOnCollision.call(this,a);if(!a)return!1;var b=this._runtime;const c=b.GetCollisionEngine(),d=b.GetEventSheetManager(),e=d.GetEventStack();var g=d.GetCurrentCondition();const k=g.GetObjectClass();var l=g.GetSavedDataMap(),n=g.GetUnsavedDataMap();g=e.GetCurrentStackFrame();const p=b.GetTickCount(),r=p-1,w=g.GetCurrentEvent(),y=e.Push(w);let B=l.get("collmemory");B||(B=C3$jscomp$146.New(C3$jscomp$146.PairMap),l.set("collmemory",B));n.get("collisionCreatedDestroyCallback")|| (n.set("collisionCreatedDestroyCallback",!0),b.Dispatcher().addEventListener("instancedestroy",J=>CollMemory_RemoveInstance(B,J.instance)));l=k.GetCurrentSol();b=a.GetCurrentSol();l=l.GetInstances();n=null;for(let J=0;J<l.length;++J){const L=l[J];b.IsSelectAll()?(c.GetCollisionCandidates(L.GetWorldInfo().GetLayer(),a,L.GetWorldInfo().GetBoundingBox(),tempCandidates1),n=tempCandidates1,c.AddRegisteredCollisionCandidates(L,a,n)):n=b.GetInstances();for(let O=0;O<n.length;++O){const V=n[O];if(c.TestOverlap(L, V)||c.CheckRegisteredCollision(L,V)){var C=CollMemory_Get(B,L,V),E=!1,F=-2;"number"===typeof C&&(E=!0,F=C);C=!E||F<r;CollMemory_Add(B,L,V,p);C&&(C=w.GetSolModifiers(),d.PushCopySol(C),F=k.GetCurrentSol(),E=a.GetCurrentSol(),F._SetSelectAll(!1),E._SetSelectAll(!1),k===a?(E=F._GetOwnInstances(),C3$jscomp$146.clearArray(E),E.push(L),E.push(V),k.ApplySolToContainer()):(F=F._GetOwnInstances(),E=E._GetOwnInstances(),C3$jscomp$146.clearArray(F),C3$jscomp$146.clearArray(E),F.push(L),E.push(V),k.ApplySolToContainer(), a.ApplySolToContainer()),w.Retrigger(g,y),d.PopSol(C))}else CollMemory_Remove(B,L,V)}C3$jscomp$146.clearArray(tempCandidates1)}e.Pop();return!1} function*DebugOnCollision(a){if(!a)return!1;var b=this._runtime;const c=b.GetCollisionEngine(),d=b.GetEventSheetManager(),e=d.GetEventStack();var g=d.GetCurrentCondition();const k=g.GetObjectClass();var l=g.GetSavedDataMap(),n=g.GetUnsavedDataMap();g=e.GetCurrentStackFrame();const p=b.GetTickCount(),r=p-1,w=g.GetCurrentEvent(),y=e.Push(w);let B=l.get("collmemory");B||(B=C3$jscomp$146.New(C3$jscomp$146.PairMap),l.set("collmemory",B));n.get("collisionCreatedDestroyCallback")||(n.set("collisionCreatedDestroyCallback", !0),b.Dispatcher().addEventListener("instancedestroy",J=>CollMemory_RemoveInstance(B,J.instance)));l=k.GetCurrentSol();b=a.GetCurrentSol();l=l.GetInstances();n=null;for(let J=0;J<l.length;++J){const L=l[J];b.IsSelectAll()?(c.GetCollisionCandidates(L.GetWorldInfo().GetLayer(),a,L.GetWorldInfo().GetBoundingBox(),tempCandidates1),n=tempCandidates1,c.AddRegisteredCollisionCandidates(L,a,n)):n=b.GetInstances();for(let O=0;O<n.length;++O){const V=n[O];if(c.TestOverlap(L,V)||c.CheckRegisteredCollision(L, V)){var C=CollMemory_Get(B,L,V),E=!1,F=-2;"number"===typeof C&&(E=!0,F=C);C=!E||F<r;CollMemory_Add(B,L,V,p);C&&(C=w.GetSolModifiers(),d.PushCopySol(C),F=k.GetCurrentSol(),E=a.GetCurrentSol(),F._SetSelectAll(!1),E._SetSelectAll(!1),k===a?(E=F._GetOwnInstances(),C3$jscomp$146.clearArray(E),E.push(L),E.push(V),k.ApplySolToContainer()):(F=F._GetOwnInstances(),E=E._GetOwnInstances(),C3$jscomp$146.clearArray(F),C3$jscomp$146.clearArray(E),F.push(L),E.push(V),k.ApplySolToContainer(),a.ApplySolToContainer()), yield*w.DebugRetrigger(g,y),d.PopSol(C))}else CollMemory_Remove(B,L,V)}C3$jscomp$146.clearArray(tempCandidates1)}e.Pop();return!1}function IsOverlapping(a){return DoOverlapCondition(this,a,0,0)}function IsOverlappingOffset(a,b,c){return DoOverlapCondition(this,a,b,c)}function HasParent(){return this.GetWorldInfo().HasParent()}function HasChildren(){return this.GetWorldInfo().HasChildren()} function PickParent(a,b){const c=this.GetCurrentSol().GetInstances();if(0===c.length)return!1;const d=a.GetCurrentSol();var e=d.GetInstances();if(d.IsSelectAll()){var g=[...this._runtime.instancesPendingCreateForObjectClass(a)];0<g.length&&(e=e.concat(g))}if(0===e.length)return!1;e=new Set(e);g=new Set;for(let l=0,n=c.length;l<n;++l){var k=c[l];if(1===b)for(const p of k.parents())p.BelongsToObjectClass(a)&&e.has(p)&&g.add(p);else{if(0===b){if(k=k.GetParent(),null===k)continue}else k=k.GetTopParent(); k.BelongsToObjectClass(a)&&e.has(k)&&g.add(k)}}if(0===g.size)return!1;d.SetSetPicked(g);a.ApplySolToContainer();return!0} function PickChildren(a,b){const c=this.GetCurrentSol().GetInstances();if(0===c.length)return!1;const d=a.GetCurrentSol();var e=d.GetInstances();if(d.IsSelectAll()){var g=[...this._runtime.instancesPendingCreateForObjectClass(a)];0<g.length&&(e=e.concat(g))}if(0===e.length)return!1;e=new Set(e);g=new Set;for(let k=0,l=c.length;k<l;++k){const n=c[k];2===b&&!n.HasChildren()&&n.BelongsToObjectClass(a)&&e.has(n)&&g.add(n);for(const p of 0===b?n.children():n.allChildren())2===b&&p.HasChildren()||p.BelongsToObjectClass(a)&& e.has(p)&&g.add(p)}if(0===g.size)return!1;d.SetSetPicked(g);a.ApplySolToContainer();return!0} function PickNthChild(a,b){const c=this.GetCurrentSol().GetInstances();if(0===c.length)return!1;const d=a.GetCurrentSol();var e=d.GetInstances();if(d.IsSelectAll()){var g=[...this._runtime.instancesPendingCreateForObjectClass(a)];0<g.length&&(e=e.concat(g))}if(0===e.length)return!1;e=new Set(e);g=[];for(let k=0,l=c.length;k<l;++k){const n=c[k].GetChildAt(b);null!==n&&n.BelongsToObjectClass(a)&&e.has(n)&&g.push(n)}if(0===g.length)return!1;d.SetArrayPicked(g);a.ApplySolToContainer();return!0} function CompareChildCount(a,b,c){switch(a){default:return C3$jscomp$146.compare(this._inst.GetChildCount(),b,c);case 1:return C3$jscomp$146.compare(this._inst.GetAllChildCount(),b,c)}} function AddChild(a,b,c,d,e,g,k,l,n,p){const r=this._inst,w=this._runtime.GetCurrentAction().GetObjectClass();for(const y of a.allCorrespondingInstances(r,w)){if(!y.GetPlugin().SupportsSceneGraph())break;r.AddChild(y,{transformX:b,transformY:c,transformWidth:d,transformHeight:e,transformAngle:g,transformOpacity:k,transformZElevation:l,transformVisibility:n,destroyWithParent:p})}} function RemoveChild(a){const b=this._inst,c=this._runtime.GetCurrentAction().GetObjectClass();for(const d of a.allCorrespondingInstances(b,c))b.RemoveChild(d)}function RemoveFromParent(){this._inst.HasParent()&&this._inst.GetParent().RemoveChild(this._inst)}function ChildCount(){return this._inst.GetChildCount()}function AllChildCount(){return this._inst.GetAllChildCount()} function SetMeshSize(a,b){a=Math.floor(a);b=Math.floor(b);const c=this.GetWorldInfo();2>a||2>b||!isFinite(a)||!isFinite(b)?(c.ReleaseMesh(),c.SetBboxChanged()):c.CreateMesh(a,b)}function SetMeshPoint(a,b,c,d,e,g,k,l){const n=this.GetWorldInfo();n.SetMeshPoint(a,b,{mode:0===c?"absolute":"relative",x:d,y:e,zElevation:g,u:k,v:l})&&n.SetBboxChanged()}function MeshColumns(){const a=this.GetWorldInfo();return a.HasMesh()?a.GetSourceMesh().GetHSize():0} function MeshRows(){const a=this.GetWorldInfo();return a.HasMesh()?a.GetSourceMesh().GetVSize():0}function SetElementVisible(a){const b=this.GetWorldInfo();a=2===a?!b.IsVisible():0!==a;b.IsVisible()!==a&&b.SetVisible(a)}function SetElementCSSStyle(a,b){this.SetElementCSSStyle(a,b)}function SetElementAttribute(a,b){this.SetElementAttribute(a,""+b)}function RemoveElementAttribute(a){this.RemoveElementAttribute(a)}function SetElementFocus(){this.FocusElement()} function SetElementBlur(){this.BlurElement()}function IsElementFocused(){return this.IsElementFocused()}function SetElementEnabled(a){this._SetEnabled(0!==a)}function IsElementEnabled(){return this._IsEnabled()}function CompareInstanceVar(a,b,c){return C3$jscomp$146.compare(this.GetInstance().GetInstanceVariableValue(a),b,c)}function IsBoolInstanceVarSet(a){return!!this.GetInstance().GetInstanceVariableValue(a)}function TemplateName(){return this.GetInstance().GetTemplateName()} function PickInstVarHiLow(a,b){const c=this.GetCurrentSol(),d=c.GetInstances();if(!d.length)return!1;const e=this.IsFamily();let g=null,k=0;for(let n=0,p=d.length;n<p;++n){const r=d[n];var l=e?r.GetObjectClass().GetFamilyInstanceVariableOffset(this.GetFamilyIndex()):0;l=r.GetInstanceVariableValue(l+b);if(null===g||0===a&&l<k||1===a&&l>k)k=l,g=r}c.PickOne(g);return!0}function PickByUID(a){return this._runtime.GetCurrentCondition().IsInverted()?PickByUID_Inverted(this,a):PickByUID_Normal(this,a)} function PickByUID_Normal(a,b){b=a.GetRuntime().GetInstanceByUID(b);if(!b)return!1;const c=a.GetCurrentSol();if(!c.IsSelectAll()&&!c._GetOwnInstances().includes(b))return!1;if(a.IsFamily()){if(b.GetObjectClass().BelongsToFamily(a))return c.PickOne(b),a.ApplySolToContainer(),!0}else if(b.GetObjectClass()===a)return c.PickOne(b),a.ApplySolToContainer(),!0;return!1} function PickByUID_Inverted(a,b){const c=a.GetCurrentSol();if(c.IsSelectAll()){c._SetSelectAll(!1);c.ClearArrays();var d=a.GetInstances();for(let g=0,k=d.length;g<k;++g){var e=d[g];e.GetUID()===b?c._PushElseInstance(e):c._PushInstance(e)}a.ApplySolToContainer();return!!c._GetOwnInstances().length}d=c._GetOwnInstances();e=0;for(let g=0,k=d.length;g<k;++g){const l=d[g];d[e]=l;l.GetUID()===b?c._PushElseInstance(l):++e}C3$jscomp$146.truncateArray(d,e);a.ApplySolToContainer();return!!d.length} function Destroy(){this._runtime.DestroyInstance(this._inst)}function OnCreated(){return!0}function OnDestroyed(){return!0}function SetInstanceVar(a,b){this.GetInstance().SetInstanceVariableValue(a,b)}function AddInstanceVar(a,b){const c=this.GetInstance(),d=c.GetInstanceVariableValue(a);"number"===typeof d&&"number"!==typeof b?b=parseFloat(b):"string"===typeof d&&"string"!==typeof b&&(b=b.toString());c.SetInstanceVariableValue(a,d+b)} function SubInstanceVar(a,b){const c=this.GetInstance(),d=c.GetInstanceVariableValue(a);"number"===typeof d&&("number"!==typeof b&&(b=parseFloat(b)),c.SetInstanceVariableValue(a,d-b))}function SetBoolInstanceVar(a,b){this.GetInstance().SetInstanceVariableValue(a,b?1:0)}function ToggleBoolInstanceVar(a){const b=this.GetInstance();b.SetInstanceVariableValue(a,0===b.GetInstanceVariableValue(a)?1:0)} function LoadFromJsonString(a){try{var b=JSON.parse(a)}catch(c){console.error("Failed to load from JSON string: ",c);return}a=this.GetInstance();a._OnBeforeLoad("state");a.LoadFromJson(b,"state");b=C3$jscomp$146.New(C3$jscomp$146.Event,"afterloadinstance");b.instance=a;this._runtime.Dispatcher().dispatchEvent(b)}function AsJSON(){return JSON.stringify(this.GetInstance().SaveToJson("state"))}function ObjectTypeName(){return this.GetInstance().GetObjectClass().GetName()} function Count(){const a=this._runtime.GetCurrentEventStackFrame().GetExpressionObjectClass();let b=a.GetInstanceCount();for(const c of this._runtime.instancesPendingCreateForObjectClass(a))++b;return b}function PickedCount(){return this._runtime.GetCurrentEventStackFrame().GetExpressionObjectClass().GetCurrentSol().GetInstances().length}function GetIID(){return this._inst.GetIID()}function GetUID(){return this._inst.GetUID()} C3$jscomp$146.AddCommonACEs=function(a,b){const c=a[1],d=a[4],e=a[5],g=a[6],k=a[7],l=a[8],n=a[10],p=a[11],r=a[12],w=a[13],y=a[14],B=a[15],C=a[16],E=b.Cnds,F=b.Acts,J=b.Exps;a[3]&&(E.CompareX=CompareX,E.CompareY=CompareY,E.IsOnScreen=IsOnScreen,E.IsOutsideLayout=IsOutsideLayout,E.PickDistance=PickDistance,F.SetX=SetX,F.SetY=SetY,F.SetPos=SetPos,F.SetPosToObject=SetPosToObject,F.MoveForward=MoveForward,F.MoveAtAngle=MoveAtAngle,J.X=GetX,J.Y=GetY,J.dt=GetDt);d&&(E.CompareWidth=CompareWidth,E.CompareHeight= CompareHeight,F.SetWidth=SetWidth,F.SetHeight=SetHeight,F.SetSize=SetSize,J.Width=GetWidth,J.Height=GetHeight,J.BBoxLeft=GetBboxLeft,J.BBoxTop=GetBboxTop,J.BBoxRight=GetBboxRight,J.BBoxBottom=GetBboxBottom,J.BBoxMidX=GetBboxMidX,J.BBoxMidY=GetBboxMidY);e&&(E.AngleWithin=IsAngleWithin,E.IsClockwiseFrom=IsAngleClockwiseFrom,E.IsBetweenAngles=IsBetweenAngles,F.SetAngle=SetAngle,F.RotateClockwise=RotateClockwise,F.RotateCounterclockwise=RotateCounterclockwise,F.RotateTowardAngle=RotateTowardAngle,F.RotateTowardPosition= RotateTowardPosition,F.SetTowardPosition=SetTowardPosition,J.Angle=GetAngle);g&&(E.IsVisible=IsVisible,E.CompareOpacity=CompareOpacity,F.SetVisible=SetVisible,F.SetOpacity=SetOpacity,F.SetDefaultColor=SetDefaultColor,J.Opacity=GetOpacity,J.ColorValue=GetColor);k&&(E.IsOnLayer=IsOnLayer,E.PickTopBottom=PickTopBottom,E.CompareZElevation=CompareZElevation,F.MoveToTop=MoveToTop,F.MoveToBottom=MoveToBottom,F.MoveToLayer=MoveToLayer,F.ZMoveToObject=ZMoveToObject,F.SetZElevation=SetZElevation,J.LayerNumber= LayerNumber,J.LayerName=LayerName,J.ZIndex=ZIndex,J.ZElevation=ZElevation,J.TotalZElevation=TotalZElevation);l&&(E.IsEffectEnabled=IsEffectEnabled,F.SetEffectEnabled=SetEffectEnabled,F.SetEffectParam=SetEffectParam);w&&(E.HasParent=HasParent,E.HasChildren=HasChildren,E.PickParent=PickParent,E.PickChildren=PickChildren,E.PickNthChild=PickNthChild,E.CompareChildCount=CompareChildCount,F.AddChild=AddChild,F.RemoveChild=RemoveChild,F.RemoveFromParent=RemoveFromParent,J.ChildCount=ChildCount,J.AllChildCount= AllChildCount);y&&(F.SetMeshSize=SetMeshSize,F.SetMeshPoint=SetMeshPoint,J.MeshColumns=MeshColumns,J.MeshRows=MeshRows);n&&(E.IsVisible=IsVisible,F.SetVisible=SetElementVisible,F.SetCSSStyle=SetElementCSSStyle,F.SetElemAttribute=SetElementAttribute,F.RemoveElemAttribute=RemoveElementAttribute);p&&(E.IsFocused=IsElementFocused,F.SetFocus=SetElementFocus,F.SetBlur=SetElementBlur);r&&(E.IsEnabled=IsElementEnabled,F.SetEnabled=SetElementEnabled);B&&(E.OnCollision=OnCollision,E.IsOverlapping=IsOverlapping, E.IsOverlappingOffset=IsOverlappingOffset,b.FinishCollisionCondition=FinishCollisionCondition);c||(E.CompareInstanceVar=CompareInstanceVar,E.IsBoolInstanceVarSet=IsBoolInstanceVarSet,E.PickInstVarHiLow=PickInstVarHiLow,E.PickByUID=PickByUID,F.SetInstanceVar=SetInstanceVar,F.AddInstanceVar=AddInstanceVar,F.SubInstanceVar=SubInstanceVar,F.SetBoolInstanceVar=SetBoolInstanceVar,F.ToggleBoolInstanceVar=ToggleBoolInstanceVar,E.OnCreated=OnCreated,E.OnDestroyed=OnDestroyed,F.Destroy=Destroy,F.LoadFromJsonString|| (F.LoadFromJsonString=LoadFromJsonString),J.AsJSON||(J.AsJSON=AsJSON),J.Count=Count,J.PickedCount=PickedCount,J.IID=GetIID,J.UID=GetUID,J.ObjectTypeName=ObjectTypeName);C&&(J.TemplateName=TemplateName)};"use strict";const C3$jscomp$147=self.C3; C3$jscomp$147.ScheduledWait=class extends C3$jscomp$147.DefendedBase{constructor(a){super();this._eventSheetManager=a;this._type="";this._time=-1;this._signalTag="";this._isSignalled=!1;this._event=null;this._actIndex=0;this._solModifiers=[];this._dynamicSolModifiers=null;this._sols=new Map;this._callingFunctionBlock=null;this._asyncId=-1;this._functionInnerLocalVars=this._functionParameters=null;this._shouldRelease=!1}Release(){this._type="";this._time=-1;this._signalTag="";this._functionInnerLocalVars= this._functionParameters=this._callingFunctionBlock=this._event=null;this._asyncId=-1;C3$jscomp$147.clearArray(this._solModifiers);this._dynamicSolModifiers&&(this._dynamicSolModifiers.clear(),this._dynamicSolModifiers=null);for(const a of this._sols.values())a.Release();this._sols.clear()}_Init(){var a=this._eventSheetManager,b=a.GetRuntime().GetAllObjectClasses(),c=a.GetCurrentEventStackFrame();this._event=c.GetCurrentEvent();this._actIndex=c.GetActionIndex()+1;if(c=a.FindFirstFunctionBlockParent(this._event))this._callingFunctionBlock= c,this._functionParameters=c.CaptureFunctionParameters(),this._functionInnerLocalVars=c._GetAllInnerLocalVariables().map(d=>d.GetValue()),c.IsAsync()&&(this._asyncId=c.PauseCurrentAsyncFunction());for(const d of b)if(b=d.GetCurrentSol(),!b.IsSelectAll()||this._event.HasSolModifier(d))this._solModifiers.push(d),this._sols.set(d,C3$jscomp$147.New(C3$jscomp$147.SolState,b));a=a.GetDynamicSolModifiersSet();this._dynamicSolModifiers=0<a.size?a:null}InitTimer(a){this._type="timer";this._Init();this._time= this._eventSheetManager.GetRuntime().GetGameTime()+a}InitSignal(a){this._type="signal";this._Init();this._signalTag=a.toLowerCase()}InitPromise(a){this._type="promise";this._Init();a.then(()=>this.SetSignalled()).catch(b=>{console.warn("[C3 runtime] Promise rejected in 'Wait for previous actions to complete': ",b);this.SetSignalled()})}IsTimer(){return"timer"===this._type}IsSignal(){return"signal"===this._type}IsPromise(){return"promise"===this._type}GetSignalTag(){return this._signalTag}IsSignalled(){return this._isSignalled}SetSignalled(){this._isSignalled= !0}_ShouldRun(){return this.IsTimer()?this._time<=this._eventSheetManager.GetRuntime().GetGameTime():this.IsSignalled()}_RestoreState(a){a._Restore(this._event,this._actIndex);for(const [b,c]of this._sols.entries()){const d=b.GetCurrentSol();c._Restore(d)}this._dynamicSolModifiers&&a.SetDynamicSolModifiers([...this._dynamicSolModifiers]);if(a=this._callingFunctionBlock)a.SetFunctionParameters(this._functionParameters),a._GetAllInnerLocalVariables().map((b,c)=>b.SetValue(this._functionInnerLocalVars[c])), a.IsAsync()&&a.ResumeAsyncFunction(this._asyncId)}_Run(a){this._RestoreState(a);this._event._ResumeActionsAndSubEvents(a);this._callingFunctionBlock&&this._callingFunctionBlock.IsAsync()&&this._callingFunctionBlock.MaybeFinishAsyncFunctionCall(this._asyncId);this._eventSheetManager.ClearSol(this._solModifiers);this._shouldRelease=!0}async _DebugRun(a){this._RestoreState(a);for(const b of this._event._DebugResumeActionsAndSubEvents(a))await this._eventSheetManager.GetRuntime().DebugBreak(b);this._callingFunctionBlock&& this._callingFunctionBlock.IsAsync()&&this._callingFunctionBlock.MaybeFinishAsyncFunctionCall(this._asyncId);this._eventSheetManager.ClearSol(this._solModifiers);this._shouldRelease=!0}ShouldRelease(){return this._shouldRelease}RemoveInstances(a){for(const b of this._sols.values())b.RemoveInstances(a)}_SaveToJson(){const a={},b={t:this._time,st:this._signalTag,s:this._isSignalled,ev:this._event.GetSID(),sm:this._solModifiers.map(c=>c.GetSID()),dsm:this._dynamicSolModifiers?[...this._dynamicSolModifiers].map(c=> c.GetSID()):null,sols:a};this._event._HasActionIndex(this._actIndex)&&(b.act=this._event.GetActionAt(this._actIndex).GetSID());for(const [c,d]of this._sols)a[c.GetSID().toString()]=d._SaveToJson();return b}static _CreateFromJson(a,b){const c=a.GetRuntime();var d=a.GetEventBlockBySID(b.ev);if(!d)return null;let e=0;if(b.hasOwnProperty("act")){var g=a.GetActionBySID(b.act);if(!g)return null;e=g.GetIndex()}g=C3$jscomp$147.New(C3$jscomp$147.ScheduledWait,a);g._time=b.t;g._type=-1===g._time?"signal":"timer"; g._signalTag=b.st;g._isSignalled=b.s;g._event=d;g._actIndex=e;for(var k of b.sm)(d=c.GetObjectClassBySID(k))&&g._solModifiers.push(d);if(Array.isArray(b.dsm))for(var l of b.dsm)if(k=c.GetObjectClassBySID(l))g._dynamicSolModifiers||(g._dynamicSolModifiers=new Set),g._dynamicSolModifiers.add(k);for(const [n,p]of Object.entries(b.sols))if(b=parseInt(n,10),b=c.GetObjectClassBySID(b))l=C3$jscomp$147.New(C3$jscomp$147.SolState,null),l._LoadFromJson(a,p),g._sols.set(b,l);return g}};"use strict"; const C3$jscomp$148=self.C3; C3$jscomp$148.SolState=class extends C3$jscomp$148.DefendedBase{constructor(a){super();this._objectClass=null;this._isSelectAll=!0;this._instances=[];a&&(this._objectClass=a.GetObjectClass(),this._isSelectAll=a.IsSelectAll(),C3$jscomp$148.shallowAssignArray(this._instances,a._GetOwnInstances()))}Release(){this._objectClass=null;C3$jscomp$148.clearArray(this._instances)}_Restore(a){a._SetSelectAll(this._isSelectAll);C3$jscomp$148.shallowAssignArray(a._GetOwnInstances(),this._instances)}RemoveInstances(a){C3$jscomp$148.arrayRemoveAllInSet(this._instances, a)}_SaveToJson(){return{sa:this._isSelectAll,insts:this._instances.map(a=>a.GetUID())}}_LoadFromJson(a,b){a=a.GetRuntime();this._isSelectAll=!!b.sa;C3$jscomp$148.clearArray(this._instances);for(const c of b.insts)(b=a.GetInstanceByUID(c))&&this._instances.push(b)}};"use strict";const C3$jscomp$149=self.C3;function GetNextParamMap(a,b){let c=a.get(b);c||(c=new Map,a.set(b,c));return c} C3$jscomp$149.SDKPluginBase=class extends C3$jscomp$149.DefendedBase{constructor(a){super();this._runtime=a.runtime;this._isSingleGlobal=!!a.isSingleGlobal;this._isWorldType=!!a.isWorld;this._isRotatable=!!a.isRotatable;this._mustPredraw=!!a.mustPredraw;this._hasEffects=!!a.hasEffects;this._supportsSceneGraph=!!a.supportsSceneGraph;this._supportsMesh=!!a.supportsMesh;this._singleGlobalObjectClass=null;this._boundACEMethodCache=new Map;this._boundACEMethodCache_1param=new Map;this._boundACEMethodCache_2params= new Map;this._boundACEMethodCache_3params=new Map}Release(){this._runtime=null}GetRuntime(){return this._runtime}OnCreate(){}IsSingleGlobal(){return this._isSingleGlobal}IsWorldType(){return this._isWorldType}IsRotatable(){return this._isRotatable}MustPreDraw(){return this._mustPredraw}HasEffects(){return this._hasEffects}SupportsSceneGraph(){return this._supportsSceneGraph}SupportsMesh(){return this._supportsMesh}_GetBoundACEMethod(a,b){if(!b)throw Error("missing 'this' binding");let c=this._boundACEMethodCache.get(a); if(c)return c;c=a.bind(b);this._boundACEMethodCache.set(a,c);return c}_GetBoundACEMethod_1param(a,b,c){if(!b)throw Error("missing 'this' binding");const d=GetNextParamMap(this._boundACEMethodCache_1param,a);let e=d.get(c);if(e)return e;e=a.bind(b,c);d.set(c,e);return e}_GetBoundACEMethod_2params(a,b,c,d){if(!b)throw Error("missing 'this' binding");var e=GetNextParamMap(this._boundACEMethodCache_2params,a);e=GetNextParamMap(e,c);let g=e.get(d);if(g)return g;g=a.bind(b,c,d);e.set(d,g);return g}_GetBoundACEMethod_3params(a, b,c,d,e){if(!b)throw Error("missing 'this' binding");var g=GetNextParamMap(this._boundACEMethodCache_3params,a);g=GetNextParamMap(g,c);g=GetNextParamMap(g,d);let k=g.get(e);if(k)return k;k=a.bind(b,c,d,e);g.set(e,k);return k}_SetSingleGlobalObjectClass(a){if(!this.IsSingleGlobal())throw Error("must be single-global plugin");this._singleGlobalObjectClass=a}GetSingleGlobalObjectClass(){if(!this.IsSingleGlobal())throw Error("must be single-global plugin");return this._singleGlobalObjectClass}GetSingleGlobalInstance(){if(!this.IsSingleGlobal())throw Error("must be single-global plugin"); return this._singleGlobalObjectClass.GetSingleGlobalInstance()}};"use strict";const C3$jscomp$150=self.C3; C3$jscomp$150.SDKDOMPluginBase=class extends C3$jscomp$150.SDKPluginBase{constructor(a,b){super(a);this._domComponentId=b;this._nextElementId=0;this._instMap=new Map;this.AddElementMessageHandler("elem-focused",c=>c._OnElemFocused());this.AddElementMessageHandler("elem-blurred",c=>{c&&c._OnElemBlurred()})}Release(){super.Release()}_AddElement(a){const b=this._nextElementId++;this._instMap.set(b,a);return b}_RemoveElement(a){this._instMap.delete(a)}AddElementMessageHandler(a,b){this._runtime.AddDOMComponentMessageHandler(this._domComponentId, a,c=>{const d=this._instMap.get(c.elementId);b(d,c)})}};"use strict";const C3$jscomp$151=self.C3; C3$jscomp$151.SDKTypeBase=class extends C3$jscomp$151.DefendedBase{constructor(a){super();this._objectClass=a;this._runtime=a.GetRuntime();this._plugin=a.GetPlugin()}Release(){this._plugin=this._runtime=this._objectClass=null}GetObjectClass(){return this._objectClass}GetRuntime(){return this._runtime}GetPlugin(){return this._plugin}GetImageInfo(){return this._objectClass.GetImageInfo()}OnCreate(){}FinishCondition(a){}BeforeRunAction(a){}AfterRunAction(a){}LoadTextures(a){}ReleaseTextures(){}OnDynamicTextureLoadComplete(){}PreloadTexturesWithInstances(a){}LoadTilemapData(){}GetScriptInterfaceClass(){return null}DispatchScriptEvent(a,b, c){a=C3$jscomp$151.New(C3$jscomp$151.Event,a,b);a.objectClass=this;c&&Object.assign(a,c);this.GetObjectClass().DispatchUserScriptEvent(a)}};"use strict";const C3$jscomp$152=self.C3; C3$jscomp$152.SDKInstanceBase=class extends C3$jscomp$152.DefendedBase{constructor(a,b){super();this._inst=a;this._domComponentId=b;this._runtime=a.GetRuntime();this._objectClass=this._inst.GetObjectClass();this._sdkType=this._objectClass.GetSdkType();this._tick2Func=this._tickFunc=null;this._isTicking2=this._isTicking=!1;this._disposables=null;this._wasReleased=!1}Release(){this._wasReleased=!0;this._StopTicking();this._StopTicking2();this._tick2Func=this._tickFunc=null;this._disposables&&(this._disposables.Release(), this._disposables=null);this._sdkType=this._objectClass=this._runtime=this._inst=null}WasReleased(){return this._wasReleased}GetInstance(){return this._inst}GetRuntime(){return this._runtime}GetObjectClass(){return this._objectClass}GetPlugin(){return this._sdkType.GetPlugin()}GetSdkType(){return this._sdkType}GetScriptInterface(){return this._inst.GetInterfaceClass()}Trigger(a){return this._runtime.Trigger(a,this._inst,null)}DebugTrigger(a){return this._runtime.DebugTrigger(a,this._inst,null)}TriggerAsync(a){return this._runtime.TriggerAsync(a, this._inst,null)}FastTrigger(a,b){return this._runtime.FastTrigger(a,this._inst,b)}DebugFastTrigger(a,b){return this._runtime.DebugFastTrigger(a,this._inst,b)}ScheduleTriggers(a){return this._runtime.ScheduleTriggers(a)}AddDOMMessageHandler(a,b){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,a,b)}AddDOMMessageHandlers(a){for(const [b,c]of a)this.AddDOMMessageHandler(b,c)}PostToDOM(a,b){this._runtime.PostComponentMessageToDOM(this._domComponentId,a,b)}PostToDOMAsync(a,b){return this._runtime.PostComponentMessageToDOMAsync(this._domComponentId, a,b)}_PostToDOMMaybeSync(a,b){if(this._runtime.IsInWorker())this.PostToDOM(a,b);else return window.c3_runtimeInterface._OnMessageFromRuntime({type:"event",component:this._domComponentId,handler:a,data:b,responseId:null})}Tick(){}Tick2(){}_StartTicking(){this._isTicking||(this._tickFunc||(this._tickFunc=()=>this.Tick()),this._runtime.Dispatcher().addEventListener("tick",this._tickFunc),this._isTicking=!0)}_StopTicking(){this._isTicking&&(this._runtime.Dispatcher().removeEventListener("tick",this._tickFunc), this._isTicking=!1)}IsTicking(){return this._isTicking}_StartTicking2(){this._isTicking2||(this._tick2Func||(this._tick2Func=()=>this.Tick2()),this._runtime.Dispatcher().addEventListener("tick2",this._tick2Func),this._isTicking2=!0)}_StopTicking2(){this._isTicking2&&(this._runtime.Dispatcher().removeEventListener("tick2",this._tick2Func),this._isTicking2=!1)}IsTicking2(){return this._isTicking2}GetDebuggerProperties(){return[]}SaveToJson(){return null}LoadFromJson(a){}GetPropertyValueByIndex(a){}SetPropertyValueByIndex(a, b){}OffsetPropertyValueByIndex(a,b,c){if(0!==b){var d=this.GetPropertyValueByIndex(a);if("number"!==typeof d)throw Error("expected number");this.SetPropertyValueByIndex(a,d+b,c)}}SetPropertyColorOffsetValueByIndex(a,b,c,d){}CallAction(a,...b){a.call(this,...b)}CallExpression(a,...b){return a.call(this,...b)}GetScriptInterfaceClass(){return null}DispatchScriptEvent(a,b,c){if(this._inst.HasScriptInterface()){var d=this.GetScriptInterface();a=C3$jscomp$152.New(C3$jscomp$152.Event,a,b);a.instance=d;c&& Object.assign(a,c);d.dispatchEvent(a)}}};"use strict";const C3$jscomp$153=self.C3; C3$jscomp$153.SDKWorldInstanceBase=class extends C3$jscomp$153.SDKInstanceBase{constructor(a,b){super(a,b);this._worldInfo=a.GetWorldInfo();this._renderercontextrestored_handler=this._renderercontextlost_handler=null}Release(){if(this._renderercontextlost_handler){const a=this._runtime.Dispatcher();a.removeEventListener("renderercontextlost",this._renderercontextlost_handler);a.removeEventListener("renderercontextrestored",this._renderercontextrestored_handler);this._renderercontextrestored_handler= this._renderercontextlost_handler=null}this._worldInfo=null;super.Release()}HandleWebGLContextLoss(){this.HandleRendererContextLoss()}OnWebGLContextLost(){}OnWebGLContextRestored(){}HandleRendererContextLoss(){if(!this._renderercontextlost_handler){this._renderercontextlost_handler=()=>this.OnRendererContextLost();this._renderercontextrestored_handler=()=>this.OnRendererContextRestored();var a=this._runtime.Dispatcher();a.addEventListener("rendererontextlost",this._renderercontextlost_handler);a.addEventListener("renderercontextrestored", this._renderercontextrestored_handler)}}OnRendererContextLost(){this.OnWebGLContextLost()}OnRendererContextRestored(){this.OnWebGLContextRestored()}GetWorldInfo(){return this._worldInfo}IsOriginalSizeKnown(){return!1}GetOriginalWidth(){if(!this.IsOriginalSizeKnown())throw Error("original size not known");const a=this.GetCurrentImageInfo();if(a)return a.GetWidth()}GetOriginalHeight(){if(!this.IsOriginalSizeKnown())throw Error("original size not known");const a=this.GetCurrentImageInfo();if(a)return a.GetHeight()}GetCurrentImageInfo(){return null}GetCurrentSurfaceSize(){var a= this.GetCurrentImageInfo();return a&&(a=a.GetTexture())?[a.GetWidth(),a.GetHeight()]:[100,100]}GetCurrentTexRect(){const a=this.GetCurrentImageInfo();return a?a.GetTexRect():null}GetCurrentTexQuad(){const a=this.GetCurrentImageInfo();return a?a.GetTexQuad():null}IsCurrentTexRotated(){const a=this.GetCurrentImageInfo();return a?a.IsRotated():!1}GetImagePoint(a){a=this._inst.GetWorldInfo();return[a.GetX(),a.GetY(),a.GetTotalZElevation()]}LoadTilemapData(a,b,c){}TestPointOverlapTile(a,b){}RendersToOwnZPlane(){return!0}}; "use strict";const C3$jscomp$154=self.C3,tempRect$jscomp$5=C3$jscomp$154.New(C3$jscomp$154.Rect); C3$jscomp$154.SDKDOMInstanceBase=class extends C3$jscomp$154.SDKWorldInstanceBase{constructor(a,b){super(a,b);this._elementId=this.GetPlugin()._AddElement(this);this._isElementShowing=!0;this._autoFontSize=this._elemHasFocus=!1;this._autoFontSizeOffset=-.2;this._lastRect=C3$jscomp$154.New(C3$jscomp$154.Rect,0,0,-1,-1);a=this._runtime.GetCanvasManager();this._lastWindowWidth=a.GetLastWidth();this._lastWindowHeight=a.GetLastHeight();this._isPendingUpdateState=!1;this._StartTicking()}Release(){this.GetPlugin()._RemoveElement(this._elementId); this.PostToDOMElement("destroy");this._elementId=-1;super.Release()}_GetElementInDOMMode(){if(this._runtime.IsInWorker())throw Error("not valid in worker mode");return this._PostToDOMElementMaybeSync("get-element")}PostToDOMElement(a,b){b||(b={});b.elementId=this._elementId;this.PostToDOM(a,b)}_PostToDOMElementMaybeSync(a,b){b||(b={});b.elementId=this._elementId;return this._PostToDOMMaybeSync(a,b)}PostToDOMElementAsync(a,b){b||(b={});b.elementId=this._elementId;return this.PostToDOMAsync(a,b)}CreateElement(a){a|| (a={});const b=this.GetWorldInfo().IsVisible();a.elementId=this._elementId;a.isVisible=b;Object.assign(a,this.GetElementState());this._isElementShowing=!!a.isVisible;this._PostToDOMMaybeSync("create",a);this._UpdatePosition(!0)}SetElementVisible(a){a=!!a;this._isElementShowing!==a&&(this._isElementShowing=a,this.PostToDOMElement("set-visible",{isVisible:a}))}Tick(){this._UpdatePosition(!1)}_ShouldPreserveElement(){const a=this._runtime.GetCanvasManager().GetFullscreenMode();return"Android"===C3$jscomp$154.Platform.OS&& ("scale-inner"===a||"scale-outer"===a||"crop"===a)}_UpdatePosition(a){var b=this.GetWorldInfo();const c=b.GetLayer();var d=b.GetBoundingBox();let [e,g]=c.LayerToCanvasCss(d.getLeft(),d.getTop()),[k,l]=c.LayerToCanvasCss(d.getRight(),d.getBottom());d=this._runtime.GetCanvasManager();var n=d.GetCssWidth();const p=d.GetCssHeight();if(b.IsVisible()&&c.IsVisible()){if(!this._ShouldPreserveElement()){if(0>=k||0>=l||e>=n||g>=p){this.SetElementVisible(!1);return}1>e&&(e=1);1>g&&(g=1);k>=n&&(k=n-1);l>=p&& (l=p-1)}tempRect$jscomp$5.set(e,g,k,l);b=d.GetLastWidth();n=d.GetLastHeight();!a&&tempRect$jscomp$5.equals(this._lastRect)&&this._lastWindowWidth===b&&this._lastWindowHeight===n?this.SetElementVisible(!0):(this._lastRect.copy(tempRect$jscomp$5),this._lastWindowWidth=b,this._lastWindowHeight=n,this.SetElementVisible(!0),a=null,this._autoFontSize&&(a=c.GetDisplayScale()+this._autoFontSizeOffset),this.PostToDOMElement("update-position",{left:Math.round(this._lastRect.getLeft())+d.GetCanvasClientX(), top:Math.round(this._lastRect.getTop())+d.GetCanvasClientY(),width:Math.round(this._lastRect.width()),height:Math.round(this._lastRect.height()),fontSize:a}))}else this.SetElementVisible(!1)}FocusElement(){this._PostToDOMElementMaybeSync("focus",{focus:!0})}BlurElement(){this._PostToDOMElementMaybeSync("focus",{focus:!1})}_OnElemFocused(){this._elemHasFocus=!0}_OnElemBlurred(){this._elemHasFocus=!1}IsElementFocused(){return this._elemHasFocus}SetElementCSSStyle(a,b){this.PostToDOMElement("set-css-style", {prop:C3$jscomp$154.CSSToCamelCase(a),val:b})}SetElementAttribute(a,b){this.PostToDOMElement("set-attribute",{name:a,val:b})}RemoveElementAttribute(a){this.PostToDOMElement("remove-attribute",{name:a})}UpdateElementState(){this._isPendingUpdateState||(this._isPendingUpdateState=!0,Promise.resolve().then(()=>{this._isPendingUpdateState=!1;this.PostToDOMElement("update-state",this.GetElementState())}))}GetElementState(){}GetElementId(){return this._elementId}};"use strict"; const C3$jscomp$155=self.C3,IBehavior$jscomp$1=self.IBehavior; C3$jscomp$155.SDKBehaviorBase=class extends C3$jscomp$155.DefendedBase{constructor(a){super();this._runtime=a.runtime;this._myObjectClasses=C3$jscomp$155.New(C3$jscomp$155.ArraySet);this._myInstances=C3$jscomp$155.New(C3$jscomp$155.ArraySet);this._iBehavior=null;this._scriptInterfaceClass=a.scriptInterfaceClass||null}Release(){this._myInstances.Release();this._myObjectClasses.Release();this._runtime=null}GetRuntime(){return this._runtime}OnCreate(){}_AddObjectClass(a){this._myObjectClasses.Add(a)}GetObjectClasses(){return this._myObjectClasses.GetArray()}_AddInstance(a){this._myInstances.Add(a)}_RemoveInstance(a){this._myInstances.Delete(a)}GetInstances(){return this._myInstances.GetArray()}GetIBehavior(){if(null===this._iBehavior){const a= this._scriptInterfaceClass;if(a){if(this._iBehavior=new a(this),!(this._iBehavior instanceof IBehavior$jscomp$1))throw new TypeError("script interface class must derive from IBehavior");}else this._iBehavior=new IBehavior$jscomp$1(this)}return this._iBehavior}};"use strict";const C3$jscomp$156=self.C3; C3$jscomp$156.SDKBehaviorTypeBase=class extends C3$jscomp$156.DefendedBase{constructor(a){super();this._runtime=a.GetRuntime();this._behaviorType=a;this._objectClass=a.GetObjectClass();this._behavior=a.GetBehavior();this._behavior._AddObjectClass(this._objectClass)}Release(){this._behavior=this._objectClass=this._behaviorType=this._runtime=null}OnCreate(){}GetBehaviorType(){return this._behaviorType}GetObjectClass(){return this._objectClass}GetRuntime(){return this._runtime}GetBehavior(){return this._behavior}}; "use strict";const C3$jscomp$157=self.C3; C3$jscomp$157.SDKBehaviorInstanceBase=class extends C3$jscomp$157.DefendedBase{constructor(a,b){super();this._behInst=a;this._domComponentId=b;this._inst=a.GetObjectInstance();this._runtime=a.GetRuntime();this._behaviorType=a.GetBehaviorType();this._sdkType=this._behaviorType.GetSdkType();this._isPostTicking=this._isTicking2=this._isTicking=!1;this._disposables=null}Release(){this._StopTicking();this._StopTicking2();this._StopPostTicking();this._disposables&&(this._disposables.Release(),this._disposables= null);this._sdkType=this._behaviorType=this._runtime=this._inst=this._behInst=null}GetBehavior(){return this._behaviorType.GetBehavior()}GetBehaviorInstance(){return this._behInst}GetObjectInstance(){return this._inst}GetObjectClass(){return this._inst.GetObjectClass()}GetWorldInfo(){return this._inst.GetWorldInfo()}GetRuntime(){return this._runtime}GetBehaviorType(){return this._behaviorType}GetSdkType(){return this._sdkType}GetScriptInterface(){return this._behInst.GetScriptInterface()}Trigger(a){return this._runtime.Trigger(a, this._inst,this._behaviorType)}DebugTrigger(a){return this._runtime.DebugTrigger(a,this._inst,this._behaviorType)}TriggerAsync(a){return this._runtime.TriggerAsync(a,this._inst,this._behaviorType)}PostCreate(){}Tick(){}Tick2(){}PostTick(){}_StartTicking(){this._isTicking||(this._runtime._AddBehInstToTick(this),this._isTicking=!0)}_StopTicking(){this._isTicking&&(this._runtime._RemoveBehInstToTick(this),this._isTicking=!1)}IsTicking(){return this._isTicking}_StartTicking2(){this._isTicking2||(this._runtime._AddBehInstToTick2(this), this._isTicking2=!0)}_StopTicking2(){this._isTicking2&&(this._runtime._RemoveBehInstToTick2(this),this._isTicking2=!1)}IsTicking2(){return this._isTicking2}_StartPostTicking(){this._isPostTicking||(this._runtime._AddBehInstToPostTick(this),this._isPostTicking=!0)}_StopPostTicking(){this._isPostTicking&&(this._runtime._RemoveBehInstToPostTick(this),this._isPostTicking=!1)}IsPostTicking(){return this._isPostTicking}GetDebuggerProperties(){return[]}AddDOMMessageHandler(a,b){this._runtime.AddDOMComponentMessageHandler(this._domComponentId, a,b)}OnSpriteFrameChanged(a,b){}SaveToJson(){return null}LoadFromJson(a){}GetPropertyValueByIndex(a){}SetPropertyValueByIndex(a,b){}OffsetPropertyValueByIndex(a,b){if(0!==b){var c=this.GetPropertyValueByIndex(a);if("number"!==typeof c)throw Error("expected number");this.SetPropertyValueByIndex(a,c+b)}}SetPropertyColorOffsetValueByIndex(a,b,c,d){}CallAction(a,...b){a.call(this,...b)}CallExpression(a,...b){return a.call(this,...b)}GetScriptInterfaceClass(){return null}DispatchScriptEvent(a,b,c){if(this._behInst.HasScriptInterface()){var d= this.GetScriptInterface();a=C3$jscomp$157.New(C3$jscomp$157.Event,a,b);a.behaviorInstance=d;a.instance=d.instance;c&&Object.assign(a,c);d.dispatchEvent(a)}}};"use strict";const C3$jscomp$158=self.C3;C3$jscomp$158.Plugins={};C3$jscomp$158.Behaviors={}; C3$jscomp$158.PluginManager=class extends C3$jscomp$158.DefendedBase{constructor(a){super();this._runtime=a;this._allPlugins=[];this._pluginsByCtor=new Map;this._systemPlugin=null;this._allBehaviors=[];this._behaviorsByCtor=new Map;this._jumpthruBehavior=this._solidBehavior=null}CreatePlugin(a){const b=this._runtime.GetObjectReference(a[0]);if(!b)throw Error("missing plugin");C3$jscomp$158.AddCommonACEs(a,b);a=C3$jscomp$158.New(b,{runtime:this._runtime,isSingleGlobal:a[1],isWorld:a[2],isRotatable:a[5], hasEffects:a[8],mustPredraw:a[9],supportsSceneGraph:a[13],supportsMesh:a[14]});a.OnCreate();this._allPlugins.push(a);this._pluginsByCtor.set(b,a)}CreateSystemPlugin(){this._systemPlugin=C3$jscomp$158.New(C3$jscomp$158.Plugins.System,{runtime:this._runtime,isSingleGlobal:!0});this._systemPlugin.OnCreate()}CreateBehavior(a){a=this._runtime.GetObjectReference(a[1]);if(!a)throw Error("missing behavior");const b=C3$jscomp$158.New(a,{runtime:this._runtime});b.OnCreate();this._allBehaviors.push(b);this._behaviorsByCtor.set(a, b);!this._solidBehavior&&C3$jscomp$158.Behaviors.solid&&b instanceof C3$jscomp$158.Behaviors.solid?this._solidBehavior=b:!this._jumpthruBehavior&&C3$jscomp$158.Behaviors.jumpthru&&b instanceof C3$jscomp$158.Behaviors.jumpthru&&(this._jumpthruBehavior=b)}GetPluginByConstructorFunction(a){return this._pluginsByCtor.get(a)||null}HasBehaviorByConstructorFunction(a){return this._behaviorsByCtor.has(a)}GetBehaviorByConstructorFunction(a){return this._behaviorsByCtor.get(a)||null}GetSystemPlugin(){return this._systemPlugin}GetSolidBehavior(){return this._solidBehavior}GetJumpthruBehavior(){return this._jumpthruBehavior}}; "use strict";const C3$jscomp$159=self.C3,allImageInfos=new Set; C3$jscomp$159.ImageInfo=class extends C3$jscomp$159.DefendedBase{constructor(){super();this._generation=0;this._url="";this._height=this._width=this._offsetY=this._offsetX=this._size=0;this._hasMetaData=this._isRotated=!1;this._imageAsset=null;this._textureState="";this._rcTex=C3$jscomp$159.New(C3$jscomp$159.Rect);this._quadTex=C3$jscomp$159.New(C3$jscomp$159.Quad);this._blobUrl="";this._iImageInfo=new self.IImageInfo(this);allImageInfos.add(this)}Release(){this.ReleaseTexture();this._imageAsset= null;allImageInfos.delete(this);this.ReleaseBlobURL()}static OnRendererContextLost(){for(const a of allImageInfos)a._textureState="",a._rcTex.set(0,0,0,0),a._quadTex.setFromRect(a._rcTex)}LoadData(a){this._url=a[0];this._size=a[1];this._offsetX=a[2];this._offsetY=a[3];this._width=a[4];this._height=a[5];this._isRotated=a[6];this._hasMetaData=!0}LoadDynamicAsset(a,b){if(this._imageAsset)throw Error("already loaded asset");this._url=b;const c={};C3$jscomp$159.IsAbsoluteURL(b)&&(c.loadPolicy="remote"); this.LoadAsset(a,c);return this._imageAsset.Load()}async LoadDynamicBlobAsset(a,b){if(this._imageAsset)throw Error("already loaded asset");this._url="";this._size=b.size;this._imageAsset=C3$jscomp$159.New(C3$jscomp$159.ImageAsset,a.GetAssetManager(),{blob:b,size:this._size,loadPolicy:"local"})}ReplaceWith(a){if(a===this)throw Error("cannot replace with self");this._generation++;this.ReleaseTexture();this._url=a._url;this._size=a._size;this._offsetX=a._offsetX;this._offsetY=a._offsetY;this._width= a._width;this._height=a._height;this._isRotated=a._isRotated;this._hasMetaData=a._hasMetaData;this._imageAsset=a._imageAsset;this._textureState=a._textureState;this._rcTex=a._rcTex;this._quadTex=a._quadTex;this.ReleaseBlobURL()}GetURL(){return this._url}GetSize(){return this._size}GetOffsetX(){return this._offsetX}GetOffsetY(){return this._offsetY}IsRotated(){return this._isRotated}GetWidth(){return this._width}GetHeight(){return this._height}GetSheetWidth(){return this._imageAsset.GetWidth()}GetSheetHeight(){return this._imageAsset.GetHeight()}LoadAsset(a, b){if(this._imageAsset)throw Error("already got asset");b=Object.assign({},b,{url:this.GetURL(),size:this.GetSize()});this._imageAsset=a.LoadImage(b)}IsLoaded(){return this._imageAsset&&this._imageAsset.IsLoaded()}async LoadStaticTexture(a,b){if(!this._imageAsset)throw Error("no asset");if(this._textureState)throw Error("already loaded texture");const c=this._generation;this._textureState="loading";a=await this._imageAsset.LoadStaticTexture(a,b);if(this._generation!==c)return null;if(!a)return this._textureState= "",null;this._textureState="loaded";this._hasMetaData||(this._width=a.GetWidth(),this._height=a.GetHeight(),this._hasMetaData=!0);this._rcTex.set(this._offsetX,this._offsetY,this._offsetX+(this._isRotated?this._height:this._width),this._offsetY+(this._isRotated?this._width:this._height));this._rcTex.divide(a.GetWidth(),a.GetHeight());this._quadTex.setFromRect(this._rcTex);this._isRotated&&this._quadTex.rotatePointsAnticlockwise();return a}ReleaseTexture(){this._textureState&&(this._imageAsset&&this._imageAsset.ReleaseTexture(), this._textureState="",this._rcTex.set(0,0,0,0),this._quadTex.setFromRect(this._rcTex))}GetTexture(){return this._imageAsset?this._imageAsset.GetTexture():null}GetTexRect(){return this._rcTex}GetTexQuad(){return this._quadTex}GetIImageInfo(){return this._iImageInfo}GetImageAsset(){return this._imageAsset}async ExtractImageToCanvas(a){a||(a=await this._imageAsset.LoadToDrawable());const b=C3$jscomp$159.CreateCanvas(this._width,this._height),c=b.getContext("2d");this._isRotated?(c.rotate(Math.PI/-2), c.translate(-this._height,0),c.drawImage(a,this._offsetX,this._offsetY,this._height,this._width,0,0,this._height,this._width)):c.drawImage(a,this._offsetX,this._offsetY,this._width,this._height,0,0,this._width,this._height);return b}async ExtractImageToBlobURL(a){if(this._blobUrl)return this._blobUrl;a=await this.ExtractImageToCanvas(a);a=await C3$jscomp$159.CanvasToBlob(a);return this._blobUrl=URL.createObjectURL(a)}ReleaseBlobURL(){this._blobUrl&&(URL.revokeObjectURL(this._blobUrl),this._blobUrl= "")}};"use strict";const C3$jscomp$160=self.C3; C3$jscomp$160.AnimationInfo=class extends C3$jscomp$160.DefendedBase{constructor(a){super();this._name=a[0];this._speed=a[1];this._isLooping=!!a[2];this._repeatCount=a[3];this._repeatTo=a[4];this._isPingPong=!!a[5];this._sid=a[6];this._frames=a[7].map(b=>C3$jscomp$160.New(C3$jscomp$160.AnimationFrameInfo,b));this._iAnimation=new self.IAnimation(this)}Release(){for(const a of this._frames)a.Release();C3$jscomp$160.clearArray(this._frames)}LoadAllAssets(a){for(const b of this._frames)b.GetImageInfo().LoadAsset(a)}LoadAllTextures(a,b){return Promise.all(this._frames.map(c=> c.GetImageInfo().LoadStaticTexture(a,b)))}ReleaseAllTextures(){for(const a of this._frames)a.GetImageInfo().ReleaseTexture()}GetName(){return this._name}GetSID(){return this._sid}GetFrameCount(){return this._frames.length}GetFrames(){return this._frames}GetFrameAt(a){a=Math.floor(a);if(0>a||a>=this._frames.length)throw new RangeError("invalid frame");return this._frames[a]}GetSpeed(){return this._speed}IsLooping(){return this._isLooping}GetRepeatCount(){return this._repeatCount}GetRepeatTo(){return this._repeatTo}IsPingPong(){return this._isPingPong}GetIAnimation(){return this._iAnimation}}; "use strict";const C3$jscomp$161=self.C3; C3$jscomp$161.AnimationFrameInfo=class extends C3$jscomp$161.DefendedBase{constructor(a){super();this._imageInfo=C3$jscomp$161.New(C3$jscomp$161.ImageInfo);this._imageInfo.LoadData(a);this._duration=a[7];this._origin=C3$jscomp$161.New(C3$jscomp$161.Vector2,a[8],a[9]);this._imagePoints=a[10].map(c=>C3$jscomp$161.New(C3$jscomp$161.ImagePoint,this,c));this._imagePointsByName=new Map;for(var b of this._imagePoints)this._imagePointsByName.set(b.GetName().toLowerCase(),b);this._collisionPoly=null;b=a[11]; 6<=b.length&&(this._collisionPoly=C3$jscomp$161.New(C3$jscomp$161.CollisionPoly,b));this._tag=a[12]?a[12]:"";this._iAnimationFrame=new self.IAnimationFrame(this)}Release(){this._collisionPoly&&(this._collisionPoly.Release(),this._collisionPoly=null);this._imageInfo.Release();this._imageInfo=null}GetImageInfo(){return this._imageInfo}GetDuration(){return this._duration}GetOriginX(){return this._origin.getX()}GetOriginY(){return this._origin.getY()}GetCollisionPoly(){return this._collisionPoly}GetImagePointByName(a){return this._imagePointsByName.get(a.toLowerCase())|| null}GetImagePointByIndex(a){a=Math.floor(a);return 0>a||a>=this._imagePoints.length?null:this._imagePoints[a]}GetImagePointCount(){return this._imagePoints.length}GetTag(){return this._tag}GetIAnimationFrame(){return this._iAnimationFrame}};"use strict";const C3$jscomp$162=self.C3;C3$jscomp$162.ImagePoint=class extends C3$jscomp$162.DefendedBase{constructor(a,b){super();this._afi=a;this._name=b[0];this._pos=C3$jscomp$162.New(C3$jscomp$162.Vector2,b[1],b[2])}Release(){}GetName(){return this._name}GetX(){return this._pos.getX()}GetY(){return this._pos.getY()}GetVec2(){return this._pos}}; "use strict";const C3$jscomp$163=self.C3,C3Debugger$jscomp$1=self.C3Debugger,IObjectClass$jscomp$1=self.IObjectClass; C3$jscomp$163.ObjectClass=class extends C3$jscomp$163.DefendedBase{constructor(a,b,c){super();const d=a.GetObjectReference(c[1]);this._runtime=a;this._plugin=a.GetPluginManager().GetPluginByConstructorFunction(d);this._sdkType=null;this._instSdkCtor=d.Instance;this._index=b;this._sid=c[11];this._name=c[0];this._jsPropName=this._runtime.GetJsPropName(c[14]);this._isGlobal=!!c[9];this._isFamily=!!c[2];this._isOnLoaderLayout=!!c[10];this._instVars=c[3].map(e=>({sid:e[0],type:e[1],name:e[2],jsPropName:a.GetJsPropName(e[3])})); this._behaviorsCount=c[4];this._effectsCount=c[5];this._isWorldType=this._plugin.IsWorldType();this._effectList=null;this._collisionGrid=C3$jscomp$163.New(C3$jscomp$163.SparseGrid,a.GetOriginalViewportWidth(),a.GetOriginalViewportHeight());this._anyCollisionCellChanged=!0;this._anyInstanceParallaxed=!1;this._familyMembersSet=this._familyMembers=null;this._familyIndex=-1;this._familyEffectMap=this._familyBehaviorMap=this._familyInstVarMap=this._familiesSet=this._families=null;this._isInContainer=!1; this._container=null;this._behaviorTypes=c[8].map(e=>C3$jscomp$163.BehaviorType.Create(this,e));this._behaviorTypesIncludingInherited=[];this._behaviorsByName=new Map;this._behaviorNameToIndex=new Map;this._usedBehaviorCtors=new Set;this._customActionMap=new Map;this._solStack=C3$jscomp$163.New(C3$jscomp$163.SolStack,this);this._defaultInstanceData=null;this._defaultLayerIndex=0;this._isContained=!1;this._animationsBySid=this._animationsByName=this._animations=this._imageInfo=this._container=null; this._textureRefCount=0;this._savedData=new Map;this._unsavedData=new Map;this._instances=[];this._iidsStale=!0;this._plugin.HasEffects()&&(this._effectList=C3$jscomp$163.New(C3$jscomp$163.EffectList,this,c[12]));c[6]&&(this._imageInfo=C3$jscomp$163.New(C3$jscomp$163.ImageInfo),this._imageInfo.LoadData(c[6]));if(c[7]){this._animations=c[7].map(e=>C3$jscomp$163.New(C3$jscomp$163.AnimationInfo,e));this._animationsByName=new Map;this._animationsBySid=new Map;for(const e of this._animations)this._animationsByName.set(e.GetName().toLowerCase(), e),this._animationsBySid.set(e.GetSID(),e)}this._isFamily?(this._familyMembers=[],this._familyMembersSet=new Set,this._familyIndex=this._runtime._GetNextFamilyIndex()):(this._families=[],this._familiesSet=new Set,this._familyInstVarMap=[],this._familyBehaviorMap=[],this._familyEffectMap=[]);this._sdkType=C3$jscomp$163.New(d.Type,this,c[15]);this._instanceUserScriptClass=this._iObjectClass=null;this._userScriptDispatcher=C3$jscomp$163.New(C3$jscomp$163.Event.Dispatcher);if(b=this._sdkType.GetScriptInterfaceClass()){if(this._iObjectClass= new b(this),!(this._iObjectClass instanceof IObjectClass$jscomp$1))throw new TypeError("script interface class must derive from IObjectClass");}else this._iObjectClass=new IObjectClass$jscomp$1(this);c[13]&&(b=c[13])&&this._sdkType.LoadTilemapData(b[0],b[1],b[2]);this._runtime.UsesLoaderLayout()&&!this._isFamily&&!this._isOnLoaderLayout&&this._isWorldType||this.OnCreate();this._plugin.IsSingleGlobal()&&(this._plugin._SetSingleGlobalObjectClass(this),this._CreateSingleGlobalInstance(c));this._loadInstancesJson= null}static Create(a,b,c){return C3$jscomp$163.New(C3$jscomp$163.ObjectClass,a,b,c)}Release(){this._imageInfo&&(this._imageInfo.Release(),this._imageInfo=null);if(this._animations){for(const a of this._animations)a.Release();C3$jscomp$163.clearArray(this._animations);this._animationsByName.clear();this._animationsBySid.clear()}this._loadInstancesJson=null;this._solStack.Release();this._solStack=null;this._savedData.clear();this._unsavedData.clear();this._runtime=this._container=null}_LoadFamily(a){for(let b= 1,c=a.length;b<c;++b){const d=this._runtime.GetObjectClassByIndex(a[b]);this._familyMembers.push(d);this._familyMembersSet.add(d);d._families.push(this);d._familiesSet.add(this)}}_SetContainer(a){this._isInContainer=!0;this._container=a}IsInContainer(){return this._isInContainer}GetContainer(){return this._container}_OnAfterCreate(){var a=0;if(!this._isFamily)for(var b of this._families)for(var c of b.GetBehaviorTypes()){const g=c.GetName().toLowerCase();this._behaviorsByName.set(g,c);this._behaviorNameToIndex.set(g, a);this._behaviorTypesIncludingInherited.push(c);++a}for(var d of this.GetBehaviorTypes())b=d.GetName().toLowerCase(),this._behaviorsByName.set(b,d),this._behaviorNameToIndex.set(b,a),this._behaviorTypesIncludingInherited.push(d),++a;for(var e of this._behaviorTypesIncludingInherited)this._usedBehaviorCtors.add(e.GetBehavior().constructor);if(!this._isFamily&&this._families.length){a=this._runtime.GetFamilyCount();C3$jscomp$163.extendArray(this._familyInstVarMap,a,0);C3$jscomp$163.extendArray(this._familyBehaviorMap, a,0);C3$jscomp$163.extendArray(this._familyEffectMap,a,0);a=[];b=e=d=0;for(const g of this._families)if(c=g.GetFamilyIndex(),this._familyInstVarMap[c]=d,d+=g.GetInstanceVariablesCount(),this._familyBehaviorMap[c]=e,e+=g.GetBehaviorTypesCount(),this._familyEffectMap[c]=b,b+=g.GetEffectTypesCount(),(c=g.GetEffectList())&&this._effectList)for(const k of c.GetAllEffectTypes())a.push(k.Clone(this._effectList));this._effectList&&this._effectList.PrependEffectTypes(a)}}_CreateSingleGlobalInstance(a){const b= this._runtime._GetNewUID(),c=C3$jscomp$163.New(C3$jscomp$163.Instance,{runtime:this._runtime,objectType:this,uid:b});c._CreateSdkInstance(a[16],[]);this._runtime._MapInstanceByUID(b,c);this._instances.push(c)}GetSdkType(){return this._sdkType}IsOnLoaderLayout(){return this._isOnLoaderLayout}OnCreate(){this._isFamily||this._sdkType.OnCreate()}HasLoadedTextures(){return 0<this._textureRefCount}LoadTextures(a){if(this._isFamily)return Promise.resolve();this._textureRefCount++;return 1===this._textureRefCount? this._sdkType.LoadTextures(a)||Promise.resolve():Promise.resolve()}ReleaseTextures(){if(!this._isFamily){this._textureRefCount--;if(0>this._textureRefCount)throw Error("released textures too many times");0===this._textureRefCount&&this._sdkType.ReleaseTextures()}}OnDynamicTextureLoadComplete(){if(this._isFamily)throw Error("not applicable to family");this._sdkType.OnDynamicTextureLoadComplete()}PreloadTexturesWithInstances(a){return this._isFamily?Promise.resolve():this._sdkType.PreloadTexturesWithInstances(a)}GetRuntime(){return this._runtime}GetPlugin(){return this._plugin}GetInstanceSdkCtor(){return this._instSdkCtor}GetName(){return this._name}GetJsPropName(){return this._jsPropName}GetIndex(){return this._index}GetSID(){return this._sid}IsFamily(){return this._isFamily}IsGlobal(){return this._isGlobal}IsWorldType(){return this._isWorldType}GetFamilyIndex(){return this._familyIndex}GetBehaviorTypes(){return this._behaviorTypes}GetBehaviorTypesCount(){return this._behaviorsCount}UsesBehaviorByCtor(a){return a&& this._usedBehaviorCtors.has(a)}GetInstanceVariablesCount(){return this._instVars.length}GetInstanceVariableSIDs(){return this._instVars.map(a=>a.sid)}GetInstanceVariableIndexBySID(a){return this._instVars.findIndex(b=>b.sid===a)}GetInstanceVariableIndexByName(a){return this._instVars.findIndex(b=>b.name===a)}_GetAllInstanceVariableNames(){return this._instVars.map(a=>a.name)}_GetAllInstanceVariableJsPropNames(){return this._instVars.map(a=>a.jsPropName)}GetInstanceVariableType(a){a=Math.floor(a); if(0>a||a>=this._instVars.length)throw new RangeError("invalid instance variable index");return this._instVars[a].type}GetInstanceVariableName(a){a=Math.floor(a);if(0>a||a>=this._instVars.length)throw new RangeError("invalid instance variable index");return this._instVars[a].name}GetEffectTypesCount(){return this._effectsCount}GetBehaviorTypesIncludingInherited(){return this._behaviorTypesIncludingInherited}GetBehaviorTypeByName(a){return this._behaviorsByName.get(a.toLowerCase())||null}GetBehaviorIndexByName(a){a= this._behaviorNameToIndex.get(a.toLowerCase());return"undefined"===typeof a?-1:a}GetEffectList(){return this._effectList}HasEffects(){return this._plugin.HasEffects()}UsesEffects(){return this._effectList&&this._effectList.HasAnyEffectType()}GetSolStack(){return this._solStack}GetCurrentSol(){return this._solStack.GetCurrentSol()}GetImageInfo(){return this._imageInfo}SetDefaultInstanceData(a){this._defaultInstanceData=a}GetDefaultInstanceData(){return this._defaultInstanceData}_SetDefaultLayerIndex(a){this._defaultLayerIndex= a}GetDefaultLayerIndex(){return this._defaultLayerIndex}GetAnimations(){return this._animations}GetAnimationCount(){return this._animations.length}GetFamilies(){return this._families}BelongsToFamily(a){return this._familiesSet.has(a)}GetFamilyMembers(){return this._familyMembers}FamilyHasMember(a){return this._familyMembersSet.has(a)}GetFamilyBehaviorOffset(a){return this._familyBehaviorMap[a]}GetFamilyInstanceVariableOffset(a){return this._familyInstVarMap[a]}AddCustomAction(a){this._customActionMap.set(a.GetACEName().toLowerCase(), a)}HasOwnCustomActionByName(a){return!!this.GetOwnCustomActionByName(a)}GetOwnCustomActionByName(a){return(a=this._customActionMap.get(a.toLowerCase()))&&a.IsEnabled()?a:null}GetAnimationByName(a){if(!this._animations)throw Error("no animations");return this._animationsByName.get(a.toLowerCase())||null}GetAnimationBySID(a){if(!this._animations)throw Error("no animations");return this._animationsBySid.get(a)||null}GetFirstAnimationFrame(){if(!this._animations)throw Error("no animations");return this._animations[0].GetFrameAt(0)}GetDefaultInstanceSize(){if(this._animations){const a= this.GetFirstAnimationFrame().GetImageInfo();return[a.GetWidth(),a.GetHeight()]}return this._imageInfo?[this._imageInfo.GetWidth(),this._imageInfo.GetHeight()]:[100,100]}GetSingleGlobalInstance(){if(!this._plugin.IsSingleGlobal())throw Error("not a single-global plugin");return this._instances[0]}GetInstances(){return this._instances}*instances(){yield*this._instances}*instancesIncludingPendingCreate(){yield*this._instances;yield*this._runtime.instancesPendingCreateForObjectClass(this)}GetInstanceCount(){return this._instances.length}_AddInstance(a){this._instances.push(a)}_SetIIDsStale(){this._iidsStale= !0}_UpdateIIDs(){if(this._iidsStale&&!this._isFamily){var a=this._instances,b=0;for(let c=a.length;b<c;++b)a[b]._SetIID(b);a=this._runtime._GetInstancesPendingCreate();for(const c of a)c.GetObjectClass()===this&&c._SetIID(b++);this._iidsStale=!1}}GetInstanceByIID(a){var b=this._instances;if(a<b.length)return b[a];a-=b.length;b=this._runtime._GetInstancesPendingCreate();for(const c of b)if(c.GetObjectClass()===this){if(0===a)return c;--a}return null}GetFirstPicked(a){if(a&&a.IsInContainer()&&a.GetObjectClass()!== this)for(const b of a.siblings())if(b.GetObjectClass()===this)return b;a=this.GetCurrentSol().GetInstances();return a.length?a[0]:null}GetPairedInstance(a){const b=this.GetCurrentSol().GetInstances();return 0<b.length?b[a.GetIID()%b.length]:null}*allCorrespondingInstances(a,b){const c=this.GetCurrentSol().GetInstances();var d=c.length;const e=b.GetCurrentSol(),g=b.GetCurrentSol().GetInstances(),k=g.length;var l=a.GetIID();if(b.IsFamily()||!e.IsSelectAll())l=g.indexOf(a);a=Math.ceil(d/k);d%=k;0=== d||l<d?(l*=a,d=a):(l=d*a+(l-d)*(a-1),d=a-1);for(let n=l,p=l+d;n<p;++n)yield c[n]}FinishCondition(a){this._sdkType.FinishCondition(a)}ApplySolToContainer(){if(this._isInContainer&&!this._isFamily){this._UpdateIIDs();var a=this.GetCurrentSol(),b=a._GetOwnInstances(),c=a.IsSelectAll(),d=this._runtime.GetCurrentEventStackFrame();d=d&&d.GetCurrentEvent()&&d.GetCurrentEvent().IsOrBlock();for(const k of this._container.objectTypes())if(k!==this){k._UpdateIIDs();var e=k.GetCurrentSol();e._SetSelectAll(c); if(!c){var g=e._GetOwnInstances();C3$jscomp$163.clearArray(g);for(const l of b)g.push(k.GetInstanceByIID(l.GetIID()));if(d){g=a._GetOwnElseInstances();e=e._GetOwnElseInstances();C3$jscomp$163.clearArray(e);for(const l of g)e.push(k.GetInstanceByIID(l.GetIID()))}}}}}_TruncateContainerSols(a,b){for(const c of this.GetContainer().objectTypes()){const d=c.GetCurrentSol();a?C3$jscomp$163.truncateArray(d._GetOwnElseInstances(),b):C3$jscomp$163.truncateArray(d._GetOwnInstances(),b)}}_GetCollisionCellGrid(){return this._collisionGrid}_SetAnyCollisionCellChanged(a){this._anyCollisionCellChanged= !!a}_SetAnyInstanceParallaxed(a){this._anyInstanceParallaxed=!!a}IsAnyInstanceParallaxed(){return this._anyInstanceParallaxed}_UpdateAllCollisionCells(){if(this._anyCollisionCellChanged&&this._isWorldType){for(const a of this._instances)a.GetWorldInfo()._UpdateCollisionCell();for(const a of this._runtime._GetInstancesPendingCreate())a.GetObjectClass()===this&&a.GetWorldInfo()._UpdateCollisionCell();this._anyCollisionCellChanged=!1}}GetSavedDataMap(){this._savedData||(this._savedData=new Map);return this._savedData}GetUnsavedDataMap(){this._unsavedData|| (this._unsavedData=new Map);return this._unsavedData}HasSolidBehavior(){return this.UsesBehaviorByCtor(C3$jscomp$163.Behaviors.solid)}HasJumpthruBehavior(){return this.UsesBehaviorByCtor(C3$jscomp$163.Behaviors.jumpthru)}HasNoSaveBehavior(){return this.UsesBehaviorByCtor(C3$jscomp$163.Behaviors.NoSave)}HasPersistBehavior(){return this.UsesBehaviorByCtor(C3$jscomp$163.Behaviors.Persist)}_SaveToJson(){const a={instances:this._instances.map(b=>b.SaveToJson())};this._savedData&&this._savedData.size&& (a.ex=C3$jscomp$163.ToSuperJSON(this._savedData));return a}_LoadFromJson(a){this._savedData&&(this._savedData.clear(),this._savedData=null);var b=a.ex;b&&(this._savedData=C3$jscomp$163.FromSuperJSON(b));b=this._instances;a=a.instances;for(let c=0,d=Math.min(b.length,a.length);c<d;++c)b[c].LoadFromJson(a[c]);for(let c=a.length,d=b.length;c<d;++c)this._runtime.DestroyInstance(b[c]);for(let c=b.length,d=a.length;c<d;++c){b=a[c];let e=null;if(this.IsWorldType()&&(e=this._runtime.GetMainRunningLayout().GetLayerBySID(b.w.l), !e))continue;this._runtime.CreateInstanceFromData(this._defaultInstanceData||this,e,!1,0,0,!0).LoadFromJson(b)}this._loadInstancesJson=a;this._SetIIDsStale()}_GetLoadInstancesJson(){return this._loadInstancesJson}_ClearLoadInstancesJson(){this._loadInstancesJson=null}_SetupSceneGraphConnectionsOnChangeOfLayout(){for(let a=0,b=this._instances;a<b;++a)this._instances[a]._SetupSceneGraphConnectionsOnChangeOfLayout()}GetIObjectClass(){return this._iObjectClass}UserScriptDispatcher(){return this._userScriptDispatcher}_GetUserScriptInstanceClass(){return this._instanceUserScriptClass}_SetUserScriptInstanceClass(a){this._instanceUserScriptClass= a}DispatchUserScriptEvent(a){var b=this._runtime;(b=b.IsDebug()&&!b.GetEventSheetManager().IsInEventEngine())&&C3Debugger$jscomp$1.StartMeasuringScriptTime();this._userScriptDispatcher.dispatchEvent(a);b&&C3Debugger$jscomp$1.AddScriptTime()}};"use strict";const C3$jscomp$164=self.C3; C3$jscomp$164.Container=class extends C3$jscomp$164.DefendedBase{constructor(a,b){super();this._runtime=a;this._objectTypes=b;for(const c of this._objectTypes)c._SetContainer(this)}Release(){this._runtime=null}GetRuntime(){return this._runtime}GetObjectTypes(){return this._objectTypes}objectTypes(){return this._objectTypes}HasAnyWorldType(){return this._objectTypes.some(a=>a.IsWorldType())}};"use strict"; const C3$jscomp$165=self.C3,C3Debugger$jscomp$2=self.C3Debugger,IInstance$jscomp$2=self.IInstance,EMPTY_ARRAY$jscomp$1=[];let nextPuid=0;const savedDataMaps=new WeakMap,unsavedDataMaps=new WeakMap,FLAG_DESTROYED=1,FLAG_TILEMAP=2,FLAG_MUST_PREDRAW=4,FLAG_SOLID_ENABLED=8,FLAG_JUMPTHRU_ENABLED=16,FLAG_MUST_MITIGATE_Z_FIGHTING=32,FLAG_IS_DRAWING_WITH_EFFECTS=64; C3$jscomp$165.Instance=class extends C3$jscomp$165.DefendedBase{constructor(a){super();this._runtime=a.runtime;this._objectType=a.objectType;this._iScriptInterface=this._sdkInst=this._worldInfo=null;this._iid=0;this._uid=a.uid;this._puid=nextPuid++;this._flags=0;this._behaviorInstances=this._instVarValues=EMPTY_ARRAY$jscomp$1;var b=this._objectType.GetBehaviorTypesIncludingInherited();0<b.length&&(this._behaviorInstances=b.map((c,d)=>C3$jscomp$165.New(C3$jscomp$165.BehaviorInstance,{runtime:this._runtime, behaviorType:c,instance:this,index:d})));this._siblings=this._objectType.IsInContainer()?[]:null;this._timeScale=-1;this._dispatcher=null;b=this.GetPlugin();b.MustPreDraw()&&(this._flags|=FLAG_MUST_PREDRAW);if(b.IsWorldType())if(this._worldInfo=C3$jscomp$165.New(C3$jscomp$165.WorldInfo,this,a.layer),a.worldData)this._worldInfo.Init(a.worldData);else{this._worldInfo.InitNoData();const [c,d]=this._objectType.GetDefaultInstanceSize();this._worldInfo.SetSize(c,d);this.GetObjectClass().UsesEffects()&& this._worldInfo.GetInstanceEffectList().LoadDefaultEffectParameters()}a.instVarData?this._LoadInstanceVariableData(a.instVarData):this._LoadDefaultInstanceVariables()}Release(){this._iScriptInterface&&(this._iScriptInterface._Release(),this._iScriptInterface=null);if(0<this._behaviorInstances.length){for(var a of this._behaviorInstances)a.Release();C3$jscomp$165.clearArray(this._behaviorInstances)}this._sdkInst.Release();this._sdkInst=null;if(a=savedDataMaps.get(this))a.clear(),savedDataMaps.delete(this); if(a=unsavedDataMaps.get(this))a.clear(),unsavedDataMaps.delete(this);this._siblings&&C3$jscomp$165.clearArray(this._siblings);this._dispatcher&&(this._dispatcher.Release(),this._dispatcher=null);this._objectType=this._runtime=null;0<this._instVarValues.length&&C3$jscomp$165.clearArray(this._instVarValues);this._worldInfo&&(this._worldInfo.Release(),this._worldInfo=null)}_LoadInstanceVariableData(a){0<a.length&&(this._instVarValues=[],C3$jscomp$165.shallowAssignArray(this._instVarValues,a))}_LoadDefaultInstanceVariables(){const a= this._objectType.GetInstanceVariablesCount();if(0!==a){this._instVarValues=[];var b=[0,0,""];for(let c=0;c<a;++c)this._instVarValues.push(b[this._objectType.GetInstanceVariableType(c)])}}_CreateSdkInstance(a,b){if(this._sdkInst)throw Error("already got sdk instance");for(let c=0,d=this._behaviorInstances.length;c<d;++c)this._behaviorInstances[c]._CreateSdkInstance(b?b[c]:null);this._sdkInst=C3$jscomp$165.New(this._objectType.GetInstanceSdkCtor(),this,a);if(!(this._sdkInst instanceof C3$jscomp$165.SDKInstanceBase))throw Error("sdk type must derive from SDKInstanceBase"); !this.GetPlugin().IsWorldType()&&this._objectType._GetUserScriptInstanceClass()&&this.GetInterfaceClass();for(let c=0,d=this._behaviorInstances.length;c<d;++c)this._behaviorInstances[c].PostCreate()}GetSdkInstance(){return this._sdkInst}GetWorldInfo(){return this._worldInfo}GetRuntime(){return this._runtime}GetTimeScale(){return this._timeScale}GetActiveTimeScale(){const a=this._timeScale;return-1===a?this.GetRuntime().GetTimeScale():a}SetTimeScale(a){a=+a;if(0>a||!isFinite(a))a=0;this._timeScale= a;this.GetObjectClass().UsesEffects()&&this._runtime._SetTrackingInstanceTime(this,!0)}RestoreTimeScale(){this._timeScale=-1;this.GetObjectClass().UsesEffects()&&this._runtime._SetTrackingInstanceTime(this,!1)}GetInstanceGameTime(){return this._runtime._GetInstanceGameTime(this)}Dispatcher(){this._dispatcher||(this._dispatcher=C3$jscomp$165.New(C3$jscomp$165.Event.Dispatcher));return this._dispatcher}Draw(a){this._sdkInst.Draw(a)}OnCreate(a){this._sdkInst.OnCreate(a)}_SetHasTilemap(){this._flags|= FLAG_TILEMAP}HasTilemap(){return 0!==(this._flags&FLAG_TILEMAP)}_MarkDestroyed(){this._flags|=FLAG_DESTROYED}IsDestroyed(){return 0!==(this._flags&FLAG_DESTROYED)}MustPreDraw(){return 0!==(this._flags&FLAG_MUST_PREDRAW)}SetMustMitigateZFighting(){this._flags|=FLAG_MUST_MITIGATE_Z_FIGHTING}MustMitigateZFighting(){return 0!==(this._flags&FLAG_MUST_MITIGATE_Z_FIGHTING)}_IsSolidEnabled(){return 0!==(this._flags&FLAG_SOLID_ENABLED)}_SetSolidEnabled(a){this._flags=a?this._flags|FLAG_SOLID_ENABLED:this._flags& ~FLAG_SOLID_ENABLED}_IsJumpthruEnabled(){return 0!==(this._flags&FLAG_JUMPTHRU_ENABLED)}_SetJumpthruEnabled(a){this._flags=a?this._flags|FLAG_JUMPTHRU_ENABLED:this._flags&~FLAG_JUMPTHRU_ENABLED}_IsDrawingWithEffects(){return 0!==(this._flags&FLAG_IS_DRAWING_WITH_EFFECTS)}_SetIsDrawingWithEffects(a){this._flags=a?this._flags|FLAG_IS_DRAWING_WITH_EFFECTS:this._flags&~FLAG_IS_DRAWING_WITH_EFFECTS}SetFlag(a,b){a<<=16;this._flags=b?this._flags|a:this._flags&~a}GetFlag(a){return 0!==(this._flags&a<<16)}GetCurrentImageInfo(){return this._sdkInst.GetCurrentImageInfo()}GetCurrentSurfaceSize(){return this._sdkInst.GetCurrentSurfaceSize()}GetCurrentTexRect(){return this._sdkInst.GetCurrentTexRect()}GetCurrentTexQuad(){return this._sdkInst.GetCurrentTexQuad()}IsCurrentTexRotated(){return this._sdkInst.IsCurrentTexRotated()}GetImagePoint(a){return this._sdkInst.GetImagePoint(a)}GetObjectClass(){return this._objectType}RendersToOwnZPlane(){return this._sdkInst.RendersToOwnZPlane()}BelongsToObjectClass(a){return a.IsFamily()? a.FamilyHasMember(this.GetObjectClass()):this.GetObjectClass()===a}CollectInstancesToPick(a,b,c){const d=(e,g)=>{g=g||e.GetObjectClass();const k=a.get(g);k?k.add(e):a.set(g,new Set([e]))};d(this,b);if(this.IsInContainer())for(const e of this.siblings())d(e);if(c)for(const e of this.allChildren())d(e)}VerifySupportsSceneGraph(){if(!this.GetPlugin().SupportsSceneGraph())throw Error("object does not support scene graph");}HasParent(){return null!==this.GetParent()}GetParent(){var a=this.GetWorldInfo(); return a?(a=a.GetParent())?a.GetInstance():null:null}GetTopParent(){var a=this.GetWorldInfo();return a?(a=a.GetTopParent())?a.GetInstance():null:null}*parents(){const a=this.GetWorldInfo();if(a)for(const b of a.parents())yield b.GetInstance()}HasChild(a){if(!a)return!1;for(const b of this.children())if(b===a)return!0;return!1}HasChildren(){const a=this.GetWorldInfo();return a?a.HasChildren():!1}GetChildrenOfObjectClass(a){const b=this.GetWorldInfo();if(!b)return[];const c=a.GetName();return b.GetChildren().map(d=> d.GetInstance()).filter(d=>d.GetObjectClass().GetName()===c)}GetChildren(){const a=this.GetWorldInfo();return a?a.GetChildren().map(b=>b.GetInstance()):[]}*children(){const a=this.GetWorldInfo();if(a)for(const b of a.children())yield b.GetInstance()}*allChildren(){const a=this.GetWorldInfo();if(a)for(const b of a.allChildren())yield b.GetInstance()}GetChildCount(){const a=this.GetWorldInfo();return a?a.GetChildCount():0}GetParentCount(){return[...this.parents()].length}GetAllChildCount(){const a= this.GetWorldInfo();return a?a.GetAllChildCount():0}GetChildAt(a){const b=this.GetWorldInfo();return b?(a=b.GetChildAt(a))?a.GetInstance():null:null}AddChild(a,b){this.VerifySupportsSceneGraph();a.VerifySupportsSceneGraph();this.GetWorldInfo().AddChild(a.GetWorldInfo(),b||{})}RemoveChild(a){const b=this.GetWorldInfo();b&&b.RemoveChild(a.GetWorldInfo())}GetDestroyWithParent(){const a=this.GetWorldInfo();return a?a.GetDestroyWithParent():!1}SetupInitialSceneGraphConnections(){var a=this.GetWorldInfo(); if(a&&(a=a.GetSceneGraphChildrenExportData()))for(const b of a)if(a=this._runtime.GetInstanceByUID(b[2])){const c=b[3];this.AddChild(a,{transformX:!!(c>>0&1),transformY:!!(c>>1&1),transformWidth:!!(c>>2&1),transformHeight:!!(c>>3&1),transformAngle:!!(c>>4&1),destroyWithParent:!!(c>>5&1),transformZElevation:!!(c>>6&1),transformOpacity:!!(c>>7&1),transformVisibility:!!(c>>8&1)})}}SetupPersistedSceneGraphConnections(a,b){if(a=a.get(this))for(const c of a.sceneGraphJson.children){a=b.get(c.index);if(!a)continue; const d=c.flags;this.AddChild(a,{transformX:!!(d>>0&1),transformY:!!(d>>1&1),transformWidth:!!(d>>2&1),transformHeight:!!(d>>3&1),transformAngle:!!(d>>4&1),destroyWithParent:!!(d>>5&1),transformZElevation:!!(d>>6&1),transformOpacity:!!(d>>7&1),transformVisibility:!!(d>>8&1)})}}GetTemplateName(){const a=this._runtime.GetTemplateManager();return a?a.GetInstanceTemplateName(this):""}IsInContainer(){return null!==this._siblings}_AddSibling(a){this._siblings.push(a)}GetSiblings(){return this._siblings}HasSibling(a){return!!this.GetSibling(a)}GetSibling(a){const b= this.siblings();if(null===b||0===b.length)return!1;for(const c of b)if(c.GetObjectClass()===a)return c;return null}siblings(){return this._siblings}SetSiblingsSinglePicked(){for(const a of this.siblings())a.GetObjectClass().GetCurrentSol().SetSinglePicked(a)}_PushSiblingsToSolInstances(){for(const a of this.siblings())a.GetObjectClass().GetCurrentSol()._PushInstance(a)}_SetSiblingsToSolInstancesIndex(a){for(const b of this.siblings())b.GetObjectClass().GetCurrentSol()._GetOwnInstances()[a]=b}_PushSiblingsToSolElseInstances(){for(const a of this.siblings())a.GetObjectClass().GetCurrentSol()._PushElseInstance(a)}_SetSiblingsToSolElseInstancesIndex(a){for(const b of this.siblings())b.GetObjectClass().GetCurrentSol()._GetOwnElseInstances()[a]= b}GetPlugin(){return this._objectType.GetPlugin()}_SetIID(a){this._iid=a}GetIID(){this._objectType._UpdateIIDs();return this._iid}GetUID(){return this._uid}GetPUID(){return this._puid}GetBehaviorInstances(){return this._behaviorInstances}GetBehaviorInstanceFromCtor(a){if(!a)return null;for(const b of this._behaviorInstances)if(b.GetBehavior()instanceof a)return b;return null}GetBehaviorSdkInstanceFromCtor(a){return a?(a=this.GetBehaviorInstanceFromCtor(a))?a.GetSdkInstance():null:null}GetBehaviorIndexBySID(a){const b= this._behaviorInstances;for(let c=0,d=b.length;c<d;++c)if(b[c].GetBehaviorType().GetSID()===a)return c;return-1}GetAllInstanceVariableValues(){return this._instVarValues}_GetAllInstanceVariableNames(){return this._objectType._GetAllInstanceVariableNames()}GetInstanceVariableCount(){return this._instVarValues.length}GetInstanceVariableValue(a){a|=0;const b=this._instVarValues;if(0>a||a>=b.length)throw new RangeError("invalid instance variable");return b[a]}_GetInstanceVariableValueUnchecked(a){return this._instVarValues[a]}_GetInstanceVariableTypedValue(a){const b= this._instVarValues[a];return 0===this._objectType.GetInstanceVariableType(a)?!!b:b}SetInstanceVariableValue(a,b){a|=0;const c=this._instVarValues;if(0>a||a>=c.length)throw new RangeError("invalid instance variable");switch(this._objectType.GetInstanceVariableType(a)){case 0:c[a]=b?1:0;break;case 1:c[a]="number"===typeof b?b:parseFloat(b);break;case 2:c[a]="string"===typeof b?b:b.toString();break;default:throw Error("unknown instance variable type");}}SetInstanceVariableOffset(a,b){if(0!==b){a|=0; var c=this._instVarValues;if(0>a||a>=c.length)throw new RangeError("invalid instance variable");var d=c[a];if("number"===typeof d)c[a]="number"===typeof b?c[a]+b:c[a]+parseFloat(b);else{if("boolean"===typeof d)throw Error("can not set offset of boolean variable");if("string"===typeof d)throw Error("can not set offset of string variable");throw Error("unknown instance variable type");}}}GetSavedDataMap(){let a=savedDataMaps.get(this);if(a)return a;a=new Map;savedDataMaps.set(this,a);return a}GetUnsavedDataMap(){let a= unsavedDataMaps.get(this);if(a)return a;a=new Map;unsavedDataMaps.set(this,a);return a}_HasAnyCreateDestroyHandler(a){const b=this.GetObjectClass();if(b.UserScriptDispatcher().HasAnyHandlerFor(a))return!0;for(const c of b.GetFamilies())if(c.UserScriptDispatcher().HasAnyHandlerFor(a))return!0;return this._runtime.UserScriptDispatcher().HasAnyHandlerFor(a)?!0:!1}_TriggerOnCreatedOnSelfAndRelated(){const a=new Set;a.add(this);const b=this.GetWorldInfo();if(b&&b.HasChildren())for(const c of this.allChildren())if(a.add(c), c.IsInContainer())for(const d of c.siblings())a.add(d);if(this.IsInContainer())for(const c of this.siblings())a.add(c);for(const c of a.values())c._TriggerOnCreated()}_TriggerOnCreated(){this._objectType._GetUserScriptInstanceClass()&&this.GetInterfaceClass();if(this._HasAnyCreateDestroyHandler("instancecreate")){const a=this.GetObjectClass(),b=new C3$jscomp$165.Event("instancecreate");b.instance=this.GetInterfaceClass();a.DispatchUserScriptEvent(b);for(const c of a.GetFamilies())c.DispatchUserScriptEvent(b); this._runtime.DispatchUserScriptEvent(b)}this._runtime.Trigger(this.GetPlugin().constructor.Cnds.OnCreated,this,null)}_TriggerOnDestroyed(){this._runtime.Trigger(this.GetPlugin().constructor.Cnds.OnDestroyed,this,null)}_FireDestroyedScriptEvents(a){if(this._iScriptInterface){var b=new C3$jscomp$165.Event("destroy");b.isEndingLayout=a;this.DispatchUserScriptEvent(b)}if(this._HasAnyCreateDestroyHandler("instancedestroy")){b=this.GetObjectClass();var c=new C3$jscomp$165.Event("instancedestroy");c.instance= this.GetInterfaceClass();c.isEndingLayout=a;b.DispatchUserScriptEvent(c);for(const d of b.GetFamilies())d.DispatchUserScriptEvent(c);this._runtime.DispatchUserScriptEvent(c)}}_GetDebuggerProperties(){return this._sdkInst.GetDebuggerProperties()}SaveToJson(a="full"){const b={};"full"===a?b.uid=this.GetUID():b.c3=!0;if("visual-state"!==a){var c=savedDataMaps.get(this);c&&c.size&&(b.ex=C3$jscomp$165.ToSuperJSON(c));-1!==this.GetTimeScale()&&(b.mts=this.GetTimeScale());if(0<this._objectType.GetInstanceVariablesCount()){c= {};var d=this._objectType.GetInstanceVariableSIDs();for(let e=0,g=this._instVarValues.length;e<g;++e)c[d[e].toString()]=this._instVarValues[e];b.ivs=c}if(this._behaviorInstances.length){c={};for(const e of this._behaviorInstances)(d=e.SaveToJson())&&(c[e.GetBehaviorType().GetSID().toString()]=d);b.behs=c}}this._worldInfo&&(b.w=this._worldInfo._SaveToJson(a));(a=this._sdkInst.SaveToJson())&&(b.data=a);return b}_OnBeforeLoad(a="full"){this._worldInfo&&this._worldInfo._OnBeforeLoad(a)}_SetupSceneGraphConnectionsOnChangeOfLayout(){this.GetPlugin().IsWorldType()&& this._worldInfo._SetupSceneGraphConnectionsOnChangeOfLayout()}LoadFromJson(a,b="full"){if("full"===b)this._uid=a.uid;else if(!a.c3)return;if("visual-state"!==b){var c=savedDataMaps.get(this);c&&(c.clear(),savedDataMaps.delete(this));if(c=a.ex)c=C3$jscomp$165.FromSuperJSON(c),savedDataMaps.set(this,c);this._timeScale=a.hasOwnProperty("mts")?a.mts:-1;if(c=a.ivs)for(const [g,k]of Object.entries(c))if(c=parseInt(g,10),c=this._objectType.GetInstanceVariableIndexBySID(c),!(0>c||c>=this._instVarValues.length)){var d= k;null===d&&(d=NaN);this._instVarValues[c]=d}}if(this.GetPlugin().IsWorldType()){c=a.w;var e=c.l;this._worldInfo.GetLayer().GetSID()!==e&&(d=this._worldInfo.GetLayer(),(e=d.GetLayout().GetLayerBySID(e))?(this._worldInfo._SetLayer(e),d._RemoveInstance(this,!0),e._AddInstance(this,!0),e.SetZIndicesChanged(),this._worldInfo.SetBboxChanged()):"full"===b&&this._runtime.DestroyInstance(this));this._worldInfo._LoadFromJson(c,b)}if("visual-state"!==b&&(c=a.behs))for(const [g,k]of Object.entries(c))c=parseInt(g, 10),c=this.GetBehaviorIndexBySID(c),0>c||c>=this._behaviorInstances.length||this._behaviorInstances[c].LoadFromJson(k);(a=a.data)&&this._sdkInst.LoadFromJson(a,b)}GetInterfaceClass(){return this._iScriptInterface||this._InitUserScriptInterface()}HasScriptInterface(){return!!this._iScriptInterface}_InitUserScriptInterface(){var a=this._worldInfo?self.IWorldInstance:IInstance$jscomp$2;const b=this._sdkInst.GetScriptInterfaceClass(),c=this._objectType._GetUserScriptInstanceClass(),d=c||b||a;IInstance$jscomp$2._Init(this); this._iScriptInterface=new d;IInstance$jscomp$2._Init(null);if(b&&!(this._iScriptInterface instanceof a))throw new TypeError(`script interface class '${b.name}' does not extend the right base class '${a.name}'`);if(c&&(a=b||a,!(this._iScriptInterface instanceof a)))throw new TypeError(`setInstanceClass(): class '${c.name}' does not extend the right base class '${a.name}'`);return this._iScriptInterface}_GetInstVarsScriptDescriptor(a){if(0!==this._instVarValues.length){var b={},c=this._objectType._GetAllInstanceVariableJsPropNames(); for(let d=0,e=c.length;d<e;++d)b[c[d]]={configurable:!1,enumerable:!0,get:C3$jscomp$165.Instance.prototype._GetInstanceVariableTypedValue.bind(this,d),set:C3$jscomp$165.Instance.prototype.SetInstanceVariableValue.bind(this,d)};b=Object.create(Object.prototype,b);a.instVars={value:b,writable:!1}}}_GetBehaviorsScriptDescriptor(a){var b=this._behaviorInstances;if(0!==b.length){var c={};for(const d of b)c[d.GetBehaviorType().GetJsPropName()]={value:d.GetScriptInterface(),writable:!1};b=Object.create(Object.prototype, c);a.behaviors={value:b,writable:!1}}}DispatchUserScriptEvent(a){if(this.HasScriptInterface()){var b=this.GetInterfaceClass();a.instance=b;var c=this._runtime;(c=c.IsDebug()&&!c.GetEventSheetManager().IsInEventEngine())&&C3Debugger$jscomp$2.StartMeasuringScriptTime();b.dispatchEvent(a);c&&C3Debugger$jscomp$2.AddScriptTime()}}};"use strict";const C3$jscomp$166=self.C3; C3$jscomp$166.SceneGraphInfo=class extends C3$jscomp$166.DefendedBase{constructor(a){super();this._owner=a;this._parent=null;this._children=[];this._startWidth=a.GetWidth();this._startHeight=a.GetHeight();this._startScaleY=this._startScaleX=1;this._parentStartAngle=0;this._ownOpacity=1;this._startOpacity=a.GetOpacity();this._tmpSceneGraphChildrenIndexes=this._tmpSceneGraphChildren=null}Release(){this._tmpSceneGraphChildrenIndexes=this._tmpSceneGraphChildren=this._parent=null;C3$jscomp$166.clearArray(this._children)}SetParent(a){this._startOpacity= this._ownOpacity=this._owner.GetOpacity();this._parentStartAngle=(this._parent=a)?a.GetAngle():0}GetParent(){return this._parent}HasChildren(){return 0<this._children.length}GetChildren(){return this._children}_MaybeSortChildren(){this.HasChildren()&&this._tmpSceneGraphChildrenIndexes&&1!==this._children.length&&this._children.sort((a,b)=>{a=this._tmpSceneGraphChildrenIndexes.get(a.GetInstance());b=this._tmpSceneGraphChildrenIndexes.get(b.GetInstance());return C3$jscomp$166.IsFiniteNumber(a)&&C3$jscomp$166.IsFiniteNumber(b)? a-b:0})}GetStartScaleX(){return this._startScaleX}SetStartScaleX(a){this._startScaleX=a}GetStartScaleY(){return this._startScaleY}SetStartScaleY(a){this._startScaleY=a}GetStartOpacity(){return this._startOpacity}GetOwnOpacity(){return this._ownOpacity}SetOwnOpacity(a){this._ownOpacity=a}_GetStartWidth(){return 0===this._startWidth?Number.EPSILON:this._startWidth}_GetStartHeight(){return 0===this._startHeight?Number.EPSILON:this._startHeight}GetParentScaleX(){if(this._owner.GetTransformWithParentWidth()){var a= this._parent;let b=a.GetWidth(),c=a._GetSceneGraphInfo()._GetStartWidth();0===b&&(b=Number.EPSILON);return c===Number.EPSILON&&b===Number.EPSILON?1:c===Number.EPSILON&&b!==Number.EPSILON&&(a=a.GetInstance().GetSdkInstance(),a.IsOriginalSizeKnown())?1+b/a.GetOriginalWidth():b/c}return 1}GetParentScaleY(){if(this._owner.GetTransformWithParentHeight()){var a=this._parent;let b=a.GetHeight(),c=a._GetSceneGraphInfo()._GetStartHeight();0===b&&(b=Number.EPSILON);return c===Number.EPSILON&&b===Number.EPSILON? 1:c===Number.EPSILON&&b!==Number.EPSILON&&(a=a.GetInstance().GetSdkInstance(),a.IsOriginalSizeKnown())?1+b/a.GetOriginalHeight():b/c}return 1}GetParentStartAngle(){return this._parentStartAngle}_SaveToJson(a){return{sw:this._startWidth,sh:this._startHeight,sx:this._startScaleX,sy:this._startScaleY,psa:this._parentStartAngle,oo:this._ownOpacity,so:this._startOpacity,p:this._GetParentJson(a),c:this._GetChildrenJson(a)}}_GetFlagsString(a){let b="";a.GetTransformWithParentX()&&(b+="x");a.GetTransformWithParentY()&& (b+="y");a.GetTransformWithParentWidth()&&(b+="w");a.GetTransformWithParentHeight()&&(b+="h");a.GetTransformWithParentAngle()&&(b+="a");a.GetTransformWithParentZElevation()&&(b+="z");a.GetDestroyWithParent()&&(b+="d");a.GetTransformWithParentOpacity()&&(b+="o");a.GetTransformWithParentVisibility()&&(b+="v");return b}_GetParentJson(a){return this._parent&&this._parent.GetInstance()&&!this._parent.GetInstance().IsDestroyed()?this._GetInstanceJson(this._parent,this._owner,a):null}_GetChildrenJson(a){return this._children.map(b=> this._GetInstanceJson(b,b,a))}_GetInstanceJson(a,b,c){a=a.GetInstance();const d={};d.uid=a.GetUID();d.f=this._GetFlagsString(b);d.offsets=b._SaveSceneGraphPropertiesToJson();d.data=C3$jscomp$166.SceneGraphInfo.GetSceneGraphInstanceDataFromInstance(a);d.oci=a.GetObjectClass().GetIndex();"state"===c?(d.inst=a.SaveToJson(),d.instIndex=NaN):(d.instIndex=a.GetObjectClass().GetInstances().indexOf(a),d.inst=null);return d}_LoadFromJson(a){this._startWidth=a.sw;this._startHeight=a.sh;this._startScaleX=a.sx; this._startScaleY=a.sy;this._parentStartAngle=a.psa;this._ownOpacity=a.oo;this._startOpacity=a.so}_SetTmpSceneGraphChildren(a,b){this._tmpSceneGraphChildren=a;this._tmpSceneGraphChildrenIndexes=b}_OnAfterLoad(a,b){const c=this._owner,d=c.GetRuntime(),e=new Set;if(a.p&&!this._parent){var g=d.GetInstanceByUID(a.p.uid);if(g){var k=g.GetWorldInfo();g.HasChild(this._owner.GetInstance())?this._parent=k:(g.AddChild(this._owner.GetInstance(),this._GetFlagsObj(a.p.f)),e.has(this._owner)||this._owner._LoadSceneGraphPropertiesFromJson(a.p.offsets), e.add(this._owner),g.GetWorldInfo()._GetSceneGraphInfo()._MaybeSortChildren())}else C3$jscomp$166.IsFiniteNumber(a.p.oci)&&(g=d.GetObjectClassByIndex(a.p.oci),d.GetSystemPlugin(),g=d.CreateInstance(g,c.GetLayer(),0,0,!0))&&(k=this._GetInstanceData(a.p,d),g.LoadFromJson(k),g.GetWorldInfo().GetLayer().SortAndAddInstancesByZIndex(g),g.AddChild(c.GetInstance(),this._GetFlagsObj(a.p.f)),g.GetWorldInfo()._GetSceneGraphInfo()._MaybeSortChildren())}g=[];for(var l of a.c)(k=d.GetInstanceByUID(l.uid))&&g.push(k); l=0;for(const r of a.c){if(k=d.GetInstanceByUID(r.uid)){if(this._tmpSceneGraphChildren&&this._tmpSceneGraphChildren[l]){var n=this._tmpSceneGraphChildren[l];if(n.GetObjectClass()!==k.GetObjectClass()){l++;continue}if(n.IsDestroyed()){l++;continue}k=a.c[l];this._AddAndSetChildInstance(n.GetWorldInfo(),k,e,!1);l++;continue}var p=k.GetObjectClass();n=this._GetInstancesOfObjectClassCount(g,p);p=c.GetInstance().GetChildrenOfObjectClass(p).length;if(n===p){if(k=c.GetInstance().GetChildAt(l).GetWorldInfo())e.has(k)|| k._LoadSceneGraphPropertiesFromJson(r.offsets),e.add(k);l++;continue}if(k.HasParent()){k=this._CreateNewChildInstance(r,b);this._AddAndSetChildInstance(k,r,e);l++;continue}this._AddAndSetChildInstance(k.GetWorldInfo(),r,e)}else k=this._CreateNewChildInstance(r,b),this._AddAndSetChildInstance(k,r,e);l++}}_GetFlagsObj(a){const b={};b.transformX=a.includes("x");b.transformY=a.includes("y");b.transformWidth=a.includes("w");b.transformHeight=a.includes("h");b.transformAngle=a.includes("a");b.transformZElevation= a.includes("z");b.destroyWithParent=a.includes("d");b.transformOpacity=a.includes("o");b.transformVisibility=a.includes("v");return b}_CreateNewChildInstance(a,b){if(C3$jscomp$166.IsFiniteNumber(a.oci)){var c=this._owner;b=c.GetRuntime();if(a.data)c=b.CreateInstanceFromData(a.data,c.GetLayer(),!1,0,0,!1,!0);else{const d=b.GetObjectClassByIndex(a.oci);c=b.CreateInstance(d,c.GetLayer(),0,0,!0)}if(c)return a=this._GetInstanceData(a,b),c.LoadFromJson(a),a=c.GetWorldInfo(),a.GetLayer().SortAndAddInstancesByZIndex(c, !0),a}}_AddAndSetChildInstance(a,b,c,d=!0){this._owner.AddChild(a,this._GetFlagsObj(b.f));d&&(c.has(a)||a._LoadSceneGraphPropertiesFromJson(b.offsets),c.add(a));this._MaybeSortChildren()}_GetInstancesOfObjectClassCount(a,b){return a.filter(c=>c.GetObjectClass().GetName()===b.GetName()).length}_GetInstanceData(a,b){if(C3$jscomp$166.IsFiniteNumber(a.instIndex))return b.GetObjectClassByIndex(a.oci)._GetLoadInstancesJson()[a.instIndex];if(C3$jscomp$166.IsString(a.inst))return JSON.parse(a.inst);if(a.inst)return a.inst}static GetSceneGraphInstanceDataFromInstance(a){let b= a.GetWorldInfo().GetLayer().GetInitialInstanceData(a.GetUID());if(!b)return null;b=JSON.parse(JSON.stringify(b));const c=[];for(const d of[...a.GetChildren()]){const e=d.GetWorldInfo();c.push([e.GetLayout().GetSID(),e.GetLayer().GetIndex(),d.GetUID(),C3$jscomp$166.SceneGraphInfo._GetFlagsNumber(e),d.GetObjectClass().IsInContainer()?1:0,e.GetZIndex(),C3$jscomp$166.SceneGraphInfo.GetSceneGraphInstanceDataFromInstance(d)])}C3$jscomp$166.IsArray(b[0][14])?b[0][14][1]=c:(b[0][14]=[],b[0][14][0]=C3$jscomp$166.SceneGraphInfo._GetDefaultFlagsNumber(), b[0][14][1]=c,b[0][14][2]=a.GetWorldInfo().GetZIndex());return b}static _GetFlagsNumber(a){let b;b=0|Number(a.GetTransformWithParentVisibility())<<8;b|=Number(a.GetTransformWithParentOpacity())<<7;b|=Number(a.GetTransformWithParentZElevation())<<6;b|=Number(a.GetDestroyWithParent())<<5;b|=Number(a.GetTransformWithParentAngle())<<4;b|=Number(a.GetTransformWithParentHeight())<<3;b|=Number(a.GetTransformWithParentWidth())<<2;b|=Number(a.GetTransformWithParentY())<<1;return b|=Number(a.GetTransformWithParentX())<< 0}static _GetDefaultFlagsNumber(a){return 511}};"use strict"; const C3$jscomp$167=self.C3,tempRect$jscomp$6=C3$jscomp$167.New(C3$jscomp$167.Rect),tempQuad$jscomp$3=C3$jscomp$167.New(C3$jscomp$167.Quad),bboxChangeEvent=C3$jscomp$167.New(C3$jscomp$167.Event,"bboxchange",!1),tempColor$jscomp$6=C3$jscomp$167.New(C3$jscomp$167.Color,0,0,0,0),tempCollisionPoly=C3$jscomp$167.New(C3$jscomp$167.CollisionPoly),DEFAULT_COLOR=C3$jscomp$167.New(C3$jscomp$167.Color,1,1,1,1),DEFAULT_RENDER_CELLS=C3$jscomp$167.New(C3$jscomp$167.Rect,0,0,-1,-1),DEFAULT_COLLISION_CELLS=C3$jscomp$167.New(C3$jscomp$167.Rect, 0,0,-1,-1),VALID_SET_MESH_POINT_MODES=new Set(["absolute","relative"]),EMPTY_ARRAY$jscomp$2=[];let enableUpdateRendererStateGroup=!0; const FLAG_IS_VISIBLE=1,FLAG_BBOX_CHANGED=2,FLAG_ENABLE_BBOX_CHANGED_EVENT=4,FLAG_COLLISION_ENABLED=8,FLAG_COLLISION_CELL_CHANGED=16,FLAG_SOLID_FILTER_INCLUSIVE=32,FLAG_HAS_ANY_ACTIVE_EFFECT=64,FLAG_IS_ROTATABLE=128,FLAG_DESTROYED$jscomp$1=256,FLAG_DESTROY_WITH_PARENT=512,FLAG_TRANSFORM_WITH_PARENT_X=1024,FLAG_TRANSFORM_WITH_PARENT_Y=2048,FLAG_TRANSFORM_WITH_PARENT_W=4096,FLAG_TRANSFORM_WITH_PARENT_H=8192,FLAG_TRANSFORM_WITH_PARENT_A=16384,FLAG_TRANSFORM_WITH_PARENT_Z_ELEVATION=32768,FLAG_TRANSFORM_WITH_PARENT_OPACITY= 4194304,FLAG_TRANSFORM_WITH_PARENT_VISIBILITY=8388608,MASK_ALL_SCENE_GRAPH_FLAGS=FLAG_DESTROY_WITH_PARENT|FLAG_TRANSFORM_WITH_PARENT_X|FLAG_TRANSFORM_WITH_PARENT_Y|FLAG_TRANSFORM_WITH_PARENT_W|FLAG_TRANSFORM_WITH_PARENT_H|FLAG_TRANSFORM_WITH_PARENT_A|FLAG_TRANSFORM_WITH_PARENT_Z_ELEVATION|FLAG_TRANSFORM_WITH_PARENT_OPACITY|FLAG_TRANSFORM_WITH_PARENT_VISIBILITY,FLAG_MESH_CHANGED=65536,FLAG_PHYSICS_BODY_CHANGED=131072,FLAG_SIN_COS_ANGLE_CHANGED=262144,FLAG_USE_POINTS_SHADER_PROGRAM=524288,FLAG_DRAW_BACK_FACE_ONLY= 1048576,FLAG_DRAW_NON_BACK_FACES_ONLY=2097152,FLAG_BLEND_MODE_MASK=2080374784,sceneGraphExportDataMap=new WeakMap,sceneGraphZIndexMap=new WeakMap,needsSceneGraphAfterLoad=new WeakMap; C3$jscomp$167.WorldInfo=class extends C3$jscomp$167.DefendedBase{constructor(a,b){super();this._inst=a;this._objectClass=a.GetObjectClass();this._runtime=a.GetRuntime();this._layer=b;this._zIndex=-1;this._flags=FLAG_IS_VISIBLE|FLAG_BBOX_CHANGED|FLAG_COLLISION_ENABLED|FLAG_COLLISION_CELL_CHANGED|FLAG_MESH_CHANGED|FLAG_PHYSICS_BODY_CHANGED;this._objectClass.GetPlugin().IsRotatable()&&(this._flags|=FLAG_IS_ROTATABLE);this._oy=this._ox=this._cosA=this._sinA=this._a=this._depth=this._h=this._w=this._zElevation= this._y=this._x=NaN;this._boundingBox=C3$jscomp$167.New(C3$jscomp$167.Rect);this._boundingQuad=C3$jscomp$167.New(C3$jscomp$167.Quad);this._collisionCells=DEFAULT_COLLISION_CELLS;this._renderCells=DEFAULT_RENDER_CELLS;this._solidFilterTags=this._transformedPolyInfo=this._sourceCollisionPoly=null;this._colorPremultiplied=this._color=DEFAULT_COLOR;this._instanceEffectList=this._stateGroup=null;this._inst.GetObjectClass().UsesEffects()&&(this._instanceEffectList=C3$jscomp$167.New(C3$jscomp$167.InstanceEffectList, this._inst,this));this._meshInfo=this._after_load_instance=this._after_load=this._tmpSceneGraphChildrenIndexes=this._tmpSceneGraphChildren=this._sceneGraphInfo=null}_MarkDestroyed(){this._flags|=FLAG_DESTROYED$jscomp$1}Release(){this._stateGroup&&(this._runtime.GetRenderer().ReleaseStateGroup(this._stateGroup),this._stateGroup=null);this._sourceCollisionPoly=null;this._transformedPolyInfo&&(this._transformedPolyInfo.poly.Release(),this._transformedPolyInfo=null);this._solidFilterTags&&(this._solidFilterTags.clear(), this._solidFilterTags=null);this.ReleaseMesh();this._instanceEffectList&&this._instanceEffectList.Release();this.HasParent()&&this.GetParent().RemoveChild(this);if(this.HasChildren()){const a=[...this.GetChildren()];for(const b of a)this.RemoveChild(b)}this._ReleaseSceneGraphInfo();this._ReleaseTmpSceneGraphInfo();sceneGraphExportDataMap.delete(this);sceneGraphZIndexMap.delete(this);this._after_load&&(this.GetRuntime().Dispatcher().removeEventListener("afterload",this._after_load),this._after_load= null);this._after_load_instance&&(this.GetRuntime().Dispatcher().removeEventListener("afterloadinstance",this._after_load_instance),this._after_load_instance=null);this._layer=this._runtime=this._objectClass=this._inst=null}Init(a){enableUpdateRendererStateGroup=!1;this.SetXY(a[0],a[1]);this.SetZElevation(a[2]);this.SetSize(a[3],a[4]);this._depth=0;this.IsRotatable()?this.SetAngle(a[6]):this._a=0;tempColor$jscomp$6.setFromJSON(a[7]);this._SetColor(tempColor$jscomp$6);this.SetOriginX(a[8]);this.SetOriginY(a[9]); this.SetBlendMode(a[10]);this._instanceEffectList&&this._instanceEffectList._LoadEffectParameters(a[12]);a[14]&&sceneGraphExportDataMap.set(this,{childrenData:a[14][1],zIndexData:a[14][2]});if(a[15]){var b=a[15];this.CreateMesh(b[0],b[1]);var c=this.GetSourceMesh();b=b[2];for(let g=0,k=b.length;g<k;++g){var d=b[g];for(let l=0,n=d.length;l<n;++l){var e=d[l];const p=c.GetMeshPointAt(l,g);p.SetX(e[0]);p.SetY(e[1]);p.SetZElevation(e[2]);p.SetU(e[3]);p.SetV(e[4])}}}a[16]&&(c=a[16][0],a=a[16][1],b=!!a, d=!b,e=this._runtime.GetTemplateManager(),b&&e&&e.MapInstanceToTemplateName(this.GetInstance(),a),d&&e&&e.MapInstanceToTemplateName(this.GetInstance(),c));enableUpdateRendererStateGroup=!0;this._UpdateRendererStateGroup()}InitNoData(){this._sinA=this._a=this._depth=this._h=this._w=this._zElevation=this._y=this._x=0;this._cosA=1;this._oy=this._ox=0;this._UpdateRendererStateGroup()}GetRuntime(){return this._runtime}GetObjectClass(){return this._objectClass}GetInstance(){return this._inst}_GetParentOffsetAngle(){return this.GetTransformWithParentAngle()? this._MaybeReflectAngleForMirrorFlip(this.GetParent()._GetAngleNoReflect()-this._sceneGraphInfo.GetParentStartAngle()):0}SetX(a){a=+a;if(this.GetTransformWithParentX()){const b=this._sceneGraphInfo;a-=this.GetX();const c=-this._GetParentOffsetAngle();0===c?this._x+=a/b.GetParentScaleX():(this._x+=Math.cos(c)*a/b.GetParentScaleX(),this.GetTransformWithParentY()&&(this._y+=Math.sin(c)*a/b.GetParentScaleY()))}else this._x=a}OffsetX(a,b=!1){a=+a;b?this._x+=a:this.GetTransformWithParentX()?this.SetX(this.GetX()+ a):this._x+=a}GetX(){if(this.GetTransformWithParentX()){let a=this._x;const b=this._sceneGraphInfo,c=this.GetParent(),d=this._GetParentOffsetAngle();0===d?a*=b.GetParentScaleX():(a=a*b.GetParentScaleX()*Math.cos(d),this.GetTransformWithParentY()&&(a-=this._y*b.GetParentScaleY()*Math.sin(d)));return c.GetX()+a}return this._x}SetY(a){a=+a;if(this.GetTransformWithParentY()){const b=this._sceneGraphInfo;a-=this.GetY();const c=-this._GetParentOffsetAngle();0===c?this._y+=a/b.GetParentScaleY():(this.GetTransformWithParentX()&& (this._x-=Math.sin(c)*a/b.GetParentScaleX()),this._y+=Math.cos(c)*a/b.GetParentScaleY())}else this._y=a}OffsetY(a,b=!1){a=+a;b?this._y+=a:this.GetTransformWithParentY()?this.SetY(this.GetY()+a):this._y+=a}GetY(){if(this.GetTransformWithParentY()){let a=this._y;const b=this._sceneGraphInfo,c=this.GetParent(),d=this._GetParentOffsetAngle();0===d?a*=b.GetParentScaleY():(a=a*b.GetParentScaleY()*Math.cos(d),this.GetTransformWithParentX()&&(a+=this._x*b.GetParentScaleX()*Math.sin(d)));return c.GetY()+a}return this._y}SetXY(a, b){a=+a;b=+b;if(this.GetTransformWithParentXOrY()){const d=this.GetTransformWithParentX(),e=this.GetTransformWithParentY(),g=this._sceneGraphInfo,k=a-this.GetX(),l=b-this.GetY();var c=-this._GetParentOffsetAngle();if(0===c)this._x=d?this._x+k/g.GetParentScaleX():a,this._y=e?this._y+l/g.GetParentScaleY():b;else{const n=Math.sin(c);c=Math.cos(c);this._x=d?e?this._x+(c*k-n*l)/g.GetParentScaleX():this._x+c*k/g.GetParentScaleX():a;this._y=e?d?this._y+(n*k+c*l)/g.GetParentScaleY():this._y+c*l/g.GetParentScaleY(): b}}else this._x=a,this._y=b}OffsetXY(a,b){a=+a;b=+b;this.GetTransformWithParentXOrY()?this.SetXY(this.GetX()+a,this.GetY()+b):(this._x+=a,this._y+=b)}EqualsXY(a,b){return this.GetX()===a&&this.GetY()===b}SetZElevation(a){a=+a;this.GetTransformWithParentZElevation()&&(a-=this.GetParent().GetZElevation());this._zElevation!==a&&(this._zElevation=a,this._UpdateZElevation(),a=this.GetLayer(),0!==this._zElevation&&a._SetAnyInstanceZElevated(),a.SetZIndicesChanged())}_UpdateZElevation(){this._UpdateRendererStateGroup(); if(this.HasChildren()){const a=this.GetChildren();for(let b=0,c=a.length;b<c;b++){const d=a[b];d.GetTransformWithParentZElevation()&&d._UpdateZElevation()}}}OffsetZElevation(a){this.SetZElevation(this.GetZElevation()+a)}GetZElevation(){return this.GetTransformWithParentZElevation()?this.GetParent().GetZElevation()+this._zElevation:this._zElevation}GetTotalZElevation(){return this.GetLayer().GetZElevation()+this.GetZElevation()}SetWidth(a){a=+a;if(this.GetTransformWithParentWidth()){const b=this.GetWidth(); this._w=0===b?Number.EPSILON:a/b*this._w}else this._w=a;this._MarkSinCosAngleChanged()}OffsetWidth(a,b){a=+a;b?this._w+=a:this.GetTransformWithParentWidth()?this.SetWidth(this.GetWidth()+a):this._w+=a;this._MarkSinCosAngleChanged()}GetWidth(){if(this.GetTransformWithParentWidth()){const a=this.GetParent(),b=a.GetWidth();return a._GetSceneGraphInfo()._GetStartWidth()===Number.EPSILON?(this._GetSceneGraphInfo()._GetStartWidth()+b)*this._w:b*this._w}return this._w}SetHeight(a){a=+a;if(this.GetTransformWithParentHeight()){const b= this.GetHeight();this._h=0===b?Number.EPSILON:a/b*this._h}else this._h=a;this._MarkSinCosAngleChanged()}OffsetHeight(a,b){a=+a;b?this._h+=a:this.GetTransformWithParentHeight()?this.SetHeight(this.GetHeight()+a):this._h+=a;this._MarkSinCosAngleChanged()}GetHeight(){if(this.GetTransformWithParentHeight()){const a=this.GetParent(),b=a.GetHeight();return a._GetSceneGraphInfo()._GetStartHeight()===Number.EPSILON?(this._GetSceneGraphInfo()._GetStartHeight()+b)*this._h:b*this._h}return this._h}SetSize(a, b){a=+a;b=+b;if(this.GetTransformWithParentWidth()){const c=this.GetWidth();this._w=0===c?Number.EPSILON:a/c*this._w}else this._w=a;this.GetTransformWithParentHeight()?(a=this.GetHeight(),this._h=0===a?Number.EPSILON:b/a*this._h):this._h=b;this._MarkSinCosAngleChanged()}GetDepth(){return this._depth}SetDepth(a){if(0>a)throw new RangeError("invalid depth");this._depth=a}GetSceneGraphScale(){if(this.HasParent()){const a=this._sceneGraphInfo;return Math.min(a.GetParentScaleX(),a.GetParentScaleY())}return 1}IsRotatable(){return 0!== (this._flags&FLAG_IS_ROTATABLE)}SetAngle(a){a=+a;this.IsRotatable()&&(this.GetTransformWithParentAngle()&&(a-=this.GetParent().GetAngle()),a=C3$jscomp$167.clampAngle(a),this._a!==a&&(this._a=a,this._MarkSinCosAngleChanged()))}OffsetAngle(a){a=+a;0!==a&&this.IsRotatable()&&(this._a=C3$jscomp$167.clampAngle(this._a+a),this._MarkSinCosAngleChanged())}_MarkSinCosAngleChanged(){this._flags|=FLAG_SIN_COS_ANGLE_CHANGED;if(this.HasChildren()){const a=this.GetChildren();for(let b=0,c=a.length;b<c;b++)a[b]._MarkSinCosAngleChanged()}}GetAngle(){return this.GetTransformWithParentAngle()&& this.IsRotatable()?this._MaybeReflectAngleForMirrorFlip(C3$jscomp$167.clampAngle(this.GetParent()._GetAngleNoReflect()+this._a)):this._a}_GetAngleNoReflect(){return this.GetTransformWithParentAngle()&&this.IsRotatable()?C3$jscomp$167.clampAngle(this.GetParent()._GetAngleNoReflect()+this._a):this._a}_MaybeReflectAngleForMirrorFlip(a){this.GetTransformWithParentWidth()&&0>this.GetTopParent().GetWidth()&&(a=C3$jscomp$167.clampAngle(C3$jscomp$167.angleReflect(a,this.GetTopParent().GetAngle()+Math.PI))); this.GetTransformWithParentHeight()&&0>this.GetTopParent().GetHeight()&&(a=C3$jscomp$167.angleReflect(a,this.GetTopParent().GetAngle()));return a}_MaybeUpdateSinCosAngle(){const a=this._flags;if(0!==(a&FLAG_SIN_COS_ANGLE_CHANGED)){var b=this.GetAngle();this._sinA=Math.sin(b);this._cosA=Math.cos(b);this._flags=a&~FLAG_SIN_COS_ANGLE_CHANGED}}GetSinAngle(){this._MaybeUpdateSinCosAngle();return this._sinA}GetCosAngle(){this._MaybeUpdateSinCosAngle();return this._cosA}SetOriginX(a){this._ox=+a}OffsetOriginX(a){this._ox+= +a}GetOriginX(){return this._ox}SetOriginY(a){this._oy=+a}OffsetOriginY(a){this._oy+=+a}GetOriginY(){return this._oy}_SetColor(a){this._color.equals(a)||(this._color===DEFAULT_COLOR?(this._color=C3$jscomp$167.New(C3$jscomp$167.Color,a),this._colorPremultiplied=C3$jscomp$167.New(C3$jscomp$167.Color,a),this._colorPremultiplied.premultiply()):a.equalsRgba(1,1,1,1)?this._colorPremultiplied=this._color=DEFAULT_COLOR:(this._color.set(a),this._colorPremultiplied.set(a),this._colorPremultiplied.premultiply()), this._UpdateRendererStateGroup())}SetOpacity(a){a=C3$jscomp$167.clamp(+a,0,1);if(this.GetTransformWithParentOpacity()){if(this._GetSceneGraphInfo().GetOwnOpacity()===a)return;this._GetSceneGraphInfo().SetOwnOpacity(a);a=this.GetOpacity()}else if(this._color.a===a)return;this._SetColorWithOpacity(a)}_SetOpacityOfChildren(){if(this.HasChildren()){var a=this.GetChildren();for(let b=0,c=a.length;b<c;b++){const d=a[b];d._SetColorWithOpacity(d.GetOpacity())}}}_SetColorWithOpacity(a){tempColor$jscomp$6.copyRgb(this._color); tempColor$jscomp$6.a=a;this._SetColor(tempColor$jscomp$6);this._SetOpacityOfChildren()}OffsetOpacity(a){this.GetTransformWithParentOpacity()?this.SetOpacity(this._GetSceneGraphInfo().GetOwnOpacity()+a):this.SetOpacity(this.GetOpacity()+a)}GetOpacity(){return this.GetTransformWithParentOpacity()?this.GetParent().GetOpacity()*this._GetSceneGraphInfo().GetOwnOpacity():this._color.a}SetUnpremultipliedColor(a){this._color.equalsIgnoringAlpha(a)||(tempColor$jscomp$6.copyRgb(a),tempColor$jscomp$6.a=this.GetOpacity(), this._SetColor(tempColor$jscomp$6))}SetUnpremultipliedColorRGB(a,b,c){tempColor$jscomp$6.setRgb(a,b,c);this.SetUnpremultipliedColor(tempColor$jscomp$6)}OffsetUnpremultipliedColorRGB(a,b,c){if(0!==a||0!==b||0!==c)tempColor$jscomp$6.copyRgb(this._color),tempColor$jscomp$6.r+=a,tempColor$jscomp$6.g+=b,tempColor$jscomp$6.b+=c,this.SetUnpremultipliedColor(tempColor$jscomp$6)}GetUnpremultipliedColor(){return this._color}GetPremultipliedColor(){return this._colorPremultiplied}GetDestroyWithParent(){return 0!== (this._flags&FLAG_DESTROY_WITH_PARENT)}SetDestroyWithParent(a){this._SetFlag(FLAG_DESTROY_WITH_PARENT,a)}GetTransformWithParentX(){return 0!==(this._flags&FLAG_TRANSFORM_WITH_PARENT_X)}SetTransformWithParentX(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_X,a)}GetTransformWithParentY(){return 0!==(this._flags&FLAG_TRANSFORM_WITH_PARENT_Y)}GetTransformWithParentXOrY(){return 0!==(this._flags&(FLAG_TRANSFORM_WITH_PARENT_X|FLAG_TRANSFORM_WITH_PARENT_Y))}SetTransformWithParentY(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_Y, a)}GetTransformWithParentWidth(){return 0!==(this._flags&FLAG_TRANSFORM_WITH_PARENT_W)}SetTransformWithParentWidth(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_W,a)}GetTransformWithParentHeight(){return 0!==(this._flags&FLAG_TRANSFORM_WITH_PARENT_H)}SetTransformWithParentHeight(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_H,a)}GetTransformWithParentAngle(){return 0!==(this._flags&FLAG_TRANSFORM_WITH_PARENT_A)}SetTransformWithParentAngle(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_A,a)}GetTransformWithParentZElevation(){return 0!== (this._flags&FLAG_TRANSFORM_WITH_PARENT_Z_ELEVATION)}SetTransformWithParentZElevation(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_Z_ELEVATION,a)}GetTransformWithParentOpacity(){return 0!==(this._flags&FLAG_TRANSFORM_WITH_PARENT_OPACITY)}SetTransformWithParentOpacity(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_OPACITY,a)}GetTransformWithParentVisibility(){return 0!==(this._flags&FLAG_TRANSFORM_WITH_PARENT_VISIBILITY)}SetTransformWithParentVisibility(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_VISIBILITY, a)}_ClearAllSceneGraphFlags(){this._flags&=~MASK_ALL_SCENE_GRAPH_FLAGS}AddChild(a,b){if(a!==this&&!a.HasParent()&&!this._HasChildRecursive(a)&&!this._HasAnyParent(a)){var c=a.GetX(),d=a.GetY(),e=a.GetWidth(),g=a.GetHeight(),k=a.GetAngle(),l=a.GetZElevation(),n=a.GetOpacity();a._SetParent(this);a.SetTransformWithParentX(b.transformX);a.SetTransformWithParentY(b.transformY);a.SetTransformWithParentWidth(b.transformWidth);a.SetTransformWithParentHeight(b.transformHeight);a.SetTransformWithParentAngle(b.transformAngle); a.SetTransformWithParentZElevation(b.transformZElevation);a.SetTransformWithParentOpacity(b.transformOpacity);a.SetTransformWithParentVisibility(b.transformVisibility);a.SetDestroyWithParent(b.destroyWithParent);b.transformX&&(a._x=c-this.GetX(),b.transformWidth&&(a._x/=this.GetWidth()/this._sceneGraphInfo._GetStartWidth()));b.transformY&&(a._y=d-this.GetY(),b.transformHeight&&(a._y/=this.GetHeight()/this._sceneGraphInfo._GetStartHeight()));b.transformWidth&&(c=this.GetWidth(),0===c||c===Number.EPSILON? (a._w=1,a._sceneGraphInfo.SetStartScaleX(1)):(a._w=e/this.GetWidth(),a._sceneGraphInfo.SetStartScaleX(a._w)));b.transformHeight&&(e=this.GetHeight(),0===e||e===Number.EPSILON?(a._h=1,a._sceneGraphInfo.SetStartScaleY(1)):(a._h=g/this.GetHeight(),a._sceneGraphInfo.SetStartScaleY(a._h)));b.transformAngle&&(a._a=k-this.GetAngle());b.transformZElevation&&(a._zElevation=l-this.GetZElevation());b.transformOpacity&&a._sceneGraphInfo.SetOwnOpacity(n);b.transformVisibility&&a.SetVisible(this.IsVisible());this._AddChildToSceneGraphInfo(a); this.SetBboxChanged();this._SetOpacityOfChildren()}}RemoveChild(a){if(a.GetParent()===this){var b=a.GetX(),c=a.GetY(),d=a.GetWidth(),e=a.GetHeight(),g=a.GetAngle(),k=a.GetZElevation(),l=a.GetOpacity();a._SetParent(null);a._ClearAllSceneGraphFlags();a.SetXY(b,c);a.SetSize(d,e);a.SetAngle(g);a.SetZElevation(k);a.SetOpacity(l);this._RemoveChildFromSceneGraphInfo(a);this.SetBboxChanged()}}_ResetAllSceneGraphState(){this._BuildTmpSceneGraphChildren();var a=[...this.children()];for(const b of a)this.RemoveChild(b); (a=this.GetParent())&&a.RemoveChild(this);this._ClearAllSceneGraphFlags()}_BuildTmpSceneGraphChildren(){if(!this._tmpSceneGraphChildren){var a=[...this.children()];a.length&&(this._tmpSceneGraphChildren=[],this._tmpSceneGraphChildrenIndexes=new WeakMap);var b=0;for(const c of a)a=c.GetInstance(),this._tmpSceneGraphChildren.push(a),this._tmpSceneGraphChildrenIndexes.set(a,b),b++}(b=this.GetParent())&&b._BuildTmpSceneGraphChildren()}_ReleaseTmpSceneGraphInfo(){this._tmpSceneGraphChildren&&(this._tmpSceneGraphChildren.length= 0);this._tmpSceneGraphChildrenIndexes=this._tmpSceneGraphChildren=null;needsSceneGraphAfterLoad.delete(this);const a=this.GetParent();a&&!needsSceneGraphAfterLoad.has(a)&&a._ReleaseTmpSceneGraphInfo()}HasParent(){return null!==this.GetParent()}GetParent(){const a=this._sceneGraphInfo;return null!==a?a.GetParent():null}GetTopParent(){let a=this;for(;a.HasParent();)a=a.GetParent();return a}*parents(){let a=this.GetParent();for(;a;)yield a,a=a.GetParent()}HasChild(a){return this.GetChildren().includes(a)}HasChildren(){const a= this._sceneGraphInfo;return null!==a?a.HasChildren():!1}GetChildren(){const a=this._sceneGraphInfo;return null!==a?a.GetChildren():EMPTY_ARRAY$jscomp$2}children(){return this.GetChildren()}*allChildren(){for(const a of this.children())yield a,yield*a.allChildren()}GetChildCount(){return this.GetChildren().length}GetAllChildCount(){return[...this.allChildren()].length}GetChildAt(a){const b=this.GetChildren();a=Math.floor(+a);return 0>a||a>=b.length?null:b[a]}_CreateSceneGraphInfo(a){this._sceneGraphInfo|| (this._sceneGraphInfo=C3$jscomp$167.New(C3$jscomp$167.SceneGraphInfo,this));a&&this._sceneGraphInfo.SetParent(a)}_GetSceneGraphInfo(){return this._sceneGraphInfo}_ReleaseSceneGraphInfo(){this._sceneGraphInfo&&(this._sceneGraphInfo.Release(),this._sceneGraphInfo=null)}_SetParent(a){a?(a._CreateSceneGraphInfo(null),this._CreateSceneGraphInfo(a)):(this._sceneGraphInfo&&this._sceneGraphInfo.SetParent(null),this.HasChildren()||this._ReleaseSceneGraphInfo())}_HasAnyParent(a){if(!this.HasParent())return!1; const b=this.GetParent();return b===a?!0:b._HasAnyParent(a)}_HasChildRecursive(a){if(this.HasChild(a))return!0;for(const b of this.GetChildren())if(b._HasChildRecursive(a))return!0;return!1}_AddChildToSceneGraphInfo(a){this._sceneGraphInfo.GetChildren().push(a)}_RemoveChildFromSceneGraphInfo(a){const b=this._sceneGraphInfo.GetChildren(),c=b.indexOf(a);-1!==c&&b.splice(c,1);0!==b.length||this.HasParent()||this._ReleaseSceneGraphInfo();a.HasChildren()||a._ReleaseSceneGraphInfo()}GetSceneGraphChildrenExportData(){const a= sceneGraphExportDataMap.get(this);return a?a.childrenData:null}GetSceneGraphZIndexExportData(){const a=sceneGraphExportDataMap.get(this);return a?a.zIndexData:NaN}GetSceneGraphZIndex(){const a=sceneGraphZIndexMap.get(this);return C3$jscomp$167.IsFiniteNumber(a)?a:NaN}SetSceneGraphZIndex(a){sceneGraphZIndexMap.set(this,a)}SetUsePointsShaderProgram(){this._SetFlag(FLAG_USE_POINTS_SHADER_PROGRAM,!0);this._UpdateRendererStateGroup()}_UpdateRendererStateGroup(){if(enableUpdateRendererStateGroup){var a= this._runtime.GetRenderer();this._stateGroup&&a.ReleaseStateGroup(this._stateGroup);var b=0!==(this._flags&FLAG_USE_POINTS_SHADER_PROGRAM)?a.GetPointsRenderingProgram()||"<point>":a.GetTextureFillShaderProgram()||"<default>";this._stateGroup=a.AcquireStateGroup(b,this.GetBlendMode(),this._colorPremultiplied,this.GetZElevation())}}GetRendererStateGroup(){return this._stateGroup}HasDefaultColor(){return this._color===DEFAULT_COLOR}SetBlendMode(a){a|=0;if(0>a||31<a)throw new RangeError("invalid blend mode"); this.GetBlendMode()!==a&&(this._flags=this._flags&~FLAG_BLEND_MODE_MASK|a<<26,this._UpdateRendererStateGroup())}GetBlendMode(){return(this._flags&FLAG_BLEND_MODE_MASK)>>26}_SetLayer(a,b){(b=b&&this._layer!==a)&&this._RemoveFromRenderCells();this._layer=a;b&&this._UpdateRenderCell();0!==this.GetZElevation()&&this._layer._SetAnyInstanceZElevated()}GetLayer(){return this._layer}GetLayout(){return this.GetLayer().GetLayout()}_SetZIndex(a){this._zIndex=a|0}GetZIndex(){this._layer._UpdateZIndices();return this._zIndex}_GetLastCachedZIndex(){return this._zIndex}_SetFlag(a, b){this._flags=b?this._flags|a:this._flags&~a}IsVisible(){return 0!==(this._flags&FLAG_IS_VISIBLE)}SetVisible(a){this._SetFlag(FLAG_IS_VISIBLE,a);if(this.HasChildren())for(const b of this.GetChildren())b.GetTransformWithParentVisibility()&&b.SetVisible(a)}IsCollisionEnabled(){return 0!==(this._flags&FLAG_COLLISION_ENABLED)}SetCollisionEnabled(a){a=!!a;this.IsCollisionEnabled()!==a&&(this._SetFlag(FLAG_COLLISION_ENABLED,a),a?this.SetBboxChanged():this._RemoveFromCollisionCells())}SetSolidCollisionFilter(a, b){this._SetFlag(FLAG_SOLID_FILTER_INCLUSIVE,a);this._solidFilterTags&&this._solidFilterTags.clear();if(b.trim()){this._solidFilterTags||(this._solidFilterTags=new Set);for(const c of b.split(" "))c&&this._solidFilterTags.add(c.toLowerCase())}else this._solidFilterTags=null}IsSolidCollisionAllowed(a){const b=0!==(this._flags&FLAG_SOLID_FILTER_INCLUSIVE),c=this._solidFilterTags;if(!a||!c)return!b;for(const d of c)if(a.has(d))return b;return!b}SetBboxChanged(){this._flags=this._flags|FLAG_BBOX_CHANGED| FLAG_COLLISION_CELL_CHANGED|FLAG_MESH_CHANGED;this._objectClass._SetAnyCollisionCellChanged(!0);this._runtime.UpdateRender();this._layer.UsesRenderCells()&&(this.CalculateBbox(this._boundingBox,this._boundingQuad,!0),this._flags&=~FLAG_BBOX_CHANGED,this._UpdateRenderCell());0!==(this._flags&FLAG_ENABLE_BBOX_CHANGED_EVENT)&&this._inst.Dispatcher().dispatchEvent(bboxChangeEvent);if(null!==this._sceneGraphInfo){const a=this._sceneGraphInfo.GetChildren();for(let b=0,c=a.length;b<c;++b)a[b].SetBboxChanged()}}CalculateBbox(a, b,c){const d=this.GetX(),e=this.GetY(),g=this.GetWidth(),k=this.GetHeight(),l=this.GetAngle();a.setWH(d-this._ox*g,e-this._oy*k,g,k);c&&this.HasMesh()&&this._ExpandBboxForMesh(a);0===l?b.setFromRect(a):(a.offset(-d,-e),b.setFromRotatedRectPrecalc(a,this.GetSinAngle(),this.GetCosAngle()),b.offset(d,e),b.getBoundingBox(a));a.normalize()}_UpdateBbox(){const a=this._flags;0!==(a&FLAG_BBOX_CHANGED)&&(this.CalculateBbox(this._boundingBox,this._boundingQuad,!0),this._flags=a&~FLAG_BBOX_CHANGED)}GetBoundingBox(){this._UpdateBbox(); return this._boundingBox}GetBoundingQuad(){this._UpdateBbox();return this._boundingQuad}PixelRoundQuad(a){var b=this.GetX(),c=this.GetY();b=Math.round(b)-b;c=Math.round(c)-c;if(0===b&&0===c)return a;tempQuad$jscomp$3.copy(a);tempQuad$jscomp$3.offset(b,c);return tempQuad$jscomp$3}OverwriteBoundingBox(a){this._boundingBox.copy(a);this._boundingQuad.setFromRect(this._boundingBox);this._flags&=~FLAG_BBOX_CHANGED;this._UpdateCollisionCell();this._UpdateRenderCell()}SetBboxChangeEventEnabled(a){this._SetFlag(FLAG_ENABLE_BBOX_CHANGED_EVENT, a)}IsBboxChangeEventEnabled(){return 0!==(this._flags&FLAG_ENABLE_BBOX_CHANGED_EVENT)}IsInViewport(a,b,c){return b&&0!==this.GetDepth()?this.IsInViewport3D(this.GetLayer()._GetViewFrustum()):0===this.GetZElevation()||c?a.intersectsRect(this.GetBoundingBox()):this._IsInViewport_ZElevated()}_IsInViewport_ZElevated(){const a=this.GetLayer(),b=this.GetTotalZElevation();if(b>=a.GetCameraZ())return!1;a.GetViewportForZ(b,tempRect$jscomp$6);return tempRect$jscomp$6.intersectsRect(this.GetBoundingBox())}IsInViewport3D(a){var b= this.GetBoundingBox();const c=b.getLeft(),d=b.getRight(),e=b.getTop();b=b.getBottom();const g=this.GetTotalZElevation(),k=g+this.GetDepth();return a.ContainsAABB(c,e,g,d,b,k)}IsInViewport2(){const a=this.GetLayer();if(a.Has3DCamera())return this.IsInViewport3D(a._GetViewFrustum());const b=a.GetLayout();return this.IsInViewport(a.GetViewport(),b.HasVanishingPointOutsideViewport(),b.IsOrthographicProjection())}_SetDrawBackFaceOnly(a){this._SetFlag(FLAG_DRAW_BACK_FACE_ONLY,a)}_SetDrawNonBackFacesOnly(a){this._SetFlag(FLAG_DRAW_NON_BACK_FACES_ONLY, a)}IsDrawBackFaceOnly(){return 0!==(this._flags&FLAG_DRAW_BACK_FACE_ONLY)}IsDrawNonBackFacesOnly(){return 0!==(this._flags&FLAG_DRAW_NON_BACK_FACES_ONLY)}SetSourceCollisionPoly(a){this._sourceCollisionPoly=a;this._DiscardTransformedCollisionPoly();this.HasMesh()&&(this._meshInfo.meshPoly=null)}GetSourceCollisionPoly(){return this._sourceCollisionPoly}HasOwnCollisionPoly(){return null!==this._sourceCollisionPoly||this.HasMesh()}GetTransformedCollisionPoly(){return this._GetCustomTransformedCollisionPolyPrecalc(this.GetWidth(), this.GetHeight(),this.GetAngle(),this.GetSinAngle(),this.GetCosAngle())}GetCustomTransformedCollisionPoly(a,b,c){let d=0,e=1;0!==c&&(d=Math.sin(c),e=Math.cos(c));return this._GetCustomTransformedCollisionPolyPrecalc(a,b,c,d,e)}_GetCustomTransformedCollisionPolyPrecalc(a,b,c,d,e){let g=this._transformedPolyInfo;null===g&&(this._transformedPolyInfo=g={poly:C3$jscomp$167.New(C3$jscomp$167.CollisionPoly),width:NaN,height:NaN,angle:NaN});const k=g.poly;if(g.width===a&&g.height===b&&g.angle===c)return k; const l=this._sourceCollisionPoly;if(this.HasMesh()){const n=this.GetOriginX(),p=this.GetOriginY(),r=this.GetSourceMesh();let w=this._meshInfo.meshPoly;w||(l?(tempCollisionPoly.copy(l),tempCollisionPoly.offset(n,p)):tempCollisionPoly.setDefaultPoints(),w=r.InsertPolyMeshVertices(tempCollisionPoly),this._meshInfo.meshPoly=w);r.TransformCollisionPoly(w,k);k.offset(-n,-p);k.transformPrecalc(a,b,d,e)}else l?(k.copy(l),k.transformPrecalc(a,b,d,e)):k.setFromQuad(this.GetBoundingQuad(),-this.GetX(),-this.GetY()); g.width=a;g.height=b;g.angle=c;return k}_DiscardTransformedCollisionPoly(){this.SetPhysicsBodyChanged(!0);const a=this._transformedPolyInfo;null!==a&&(a.width=NaN)}CreateMesh(a,b){a=Math.floor(a);b=Math.floor(b);if(!this.GetInstance().GetPlugin().SupportsMesh())throw Error("object does not support mesh");this.ReleaseMesh();this._meshInfo={sourceMesh:C3$jscomp$167.New(C3$jscomp$167.Gfx.Mesh,a,b),transformedMesh:C3$jscomp$167.New(C3$jscomp$167.Gfx.Mesh,a,b),meshPoly:null}}HasMesh(){return null!==this._meshInfo}GetSourceMesh(){if(!this.HasMesh())throw Error("no mesh"); return this._meshInfo.sourceMesh}GetTransformedMesh(){if(!this.HasMesh())throw Error("no mesh");return this._meshInfo.transformedMesh}SetMeshChanged(a){this._SetFlag(FLAG_MESH_CHANGED,a)}IsMeshChanged(){return 0!==(this._flags&FLAG_MESH_CHANGED)}SetPhysicsBodyChanged(a){this._SetFlag(FLAG_PHYSICS_BODY_CHANGED,a)}IsPhysicsBodyChanged(){return 0!==(this._flags&FLAG_PHYSICS_BODY_CHANGED)}_ExpandBboxForMesh(a){const b=this._meshInfo.sourceMesh,c=Math.min(b.GetMinX(),0),d=Math.min(b.GetMinY(),0),e=Math.max(b.GetMaxX(), 1),g=Math.max(b.GetMaxY(),1),k=a.width(),l=a.height();a.offsetLeft(c*k);a.offsetTop(d*l);a.offsetRight((e-1)*k);a.offsetBottom((g-1)*l);this._depth=b.GetMaxZ()}ReleaseMesh(){this._meshInfo&&(this._meshInfo.sourceMesh.Release(),this._meshInfo.transformedMesh.Release(),this._meshInfo=null,this._DiscardTransformedCollisionPoly())}SetMeshPoint(a,b,c){a=Math.floor(a);b=Math.floor(b);var d=c.mode||"absolute";if(!VALID_SET_MESH_POINT_MODES.has(d))throw Error("invalid mode");d="relative"===d;let e=c.x,g= c.y;const k=c.zElevation;let l="number"===typeof c.u?c.u:d?0:-1;c="number"===typeof c.v?c.v:d?0:-1;if(!this.HasMesh())return!1;const n=this.GetSourceMesh(),p=n.GetMeshPointAt(a,b);if(null===p)return!1;let r=!1;"number"===typeof k&&p.GetZElevation()!==k&&(p.SetZElevation(k),r=!0);d&&(e+=a/(n.GetHSize()-1),g+=b/(n.GetVSize()-1));-1!==l||d?(d&&(l+=a/(n.GetHSize()-1)),l=C3$jscomp$167.clamp(l,0,1)):l=p.GetU();-1!==c||d?(d&&(c+=b/(n.GetVSize()-1)),c=C3$jscomp$167.clamp(c,0,1)):c=p.GetV();if(p.GetX()=== e&&p.GetY()===g&&p.GetU()===l&&p.GetV()===c)return r;p.SetX(e);p.SetY(g);p.SetU(l);p.SetV(c);this._DiscardTransformedCollisionPoly();return!0}HasTilemap(){return this._inst.HasTilemap()}ContainsPoint(a,b){return this.GetBoundingBox().containsPoint(a,b)&&this.GetBoundingQuad().containsPoint(a,b)?this.HasTilemap()?this._inst.GetSdkInstance().TestPointOverlapTile(a,b):this.HasOwnCollisionPoly()?this.GetTransformedCollisionPoly().containsPoint(a-this.GetX(),b-this.GetY()):!0:!1}_IsCollisionCellChanged(){return 0!== (this._flags&FLAG_COLLISION_CELL_CHANGED)}_UpdateCollisionCell(){if(this._IsCollisionCellChanged()&&this.IsCollisionEnabled()&&0===(this._flags&FLAG_DESTROYED$jscomp$1)){var a=this.GetBoundingBox(),b=this._objectClass._GetCollisionCellGrid(),c=this._collisionCells;tempRect$jscomp$6.set(b.XToCell(a.getLeft()),b.YToCell(a.getTop()),b.XToCell(a.getRight()),b.YToCell(a.getBottom()));c.equals(tempRect$jscomp$6)||(a=this._inst,c===DEFAULT_COLLISION_CELLS?(b.Update(a,null,tempRect$jscomp$6),this._collisionCells= C3$jscomp$167.New(C3$jscomp$167.Rect,tempRect$jscomp$6)):(b.Update(a,c,tempRect$jscomp$6),c.copy(tempRect$jscomp$6)),this._flags&=~FLAG_COLLISION_CELL_CHANGED)}}_RemoveFromCollisionCells(){const a=this._collisionCells;a!==DEFAULT_COLLISION_CELLS&&(this._objectClass._GetCollisionCellGrid().Update(this._inst,a,null),this._collisionCells=DEFAULT_COLLISION_CELLS)}_UpdateRenderCell(){const a=this.GetLayer();if(a.UsesRenderCells()&&0===(this._flags&FLAG_DESTROYED$jscomp$1)){var b=a.GetRenderGrid(),c=this.GetBoundingBox(), d=this._renderCells;tempRect$jscomp$6.set(b.XToCell(c.getLeft()),b.YToCell(c.getTop()),b.XToCell(c.getRight()),b.YToCell(c.getBottom()));d.equals(tempRect$jscomp$6)||(c=this._inst,d===DEFAULT_RENDER_CELLS?(b.Update(c,null,tempRect$jscomp$6),this._renderCells=C3$jscomp$167.New(C3$jscomp$167.Rect,tempRect$jscomp$6)):(b.Update(c,d,tempRect$jscomp$6),d.copy(tempRect$jscomp$6)),a.SetRenderListStale())}}_RemoveFromRenderCells(){const a=this._renderCells;a!==DEFAULT_RENDER_CELLS&&(this.GetLayer().GetRenderGrid().Update(this._inst, a,null),this._renderCells=DEFAULT_RENDER_CELLS)}GetRenderCellRange(){return this._renderCells}ZOrderMoveToTop(){const a=this._inst,b=this._layer,c=b._GetInstances();c.length&&c.at(-1)===a||(b._RemoveInstance(a,!1),b._AddInstance(a,!1),this._runtime.UpdateRender())}ZOrderMoveToBottom(){const a=this._inst,b=this._layer,c=b._GetInstances();c.length&&c[0]===a||(b._RemoveInstance(a,!1),b._PrependInstance(a,!1),this._runtime.UpdateRender())}ZOrderMoveToLayer(a){const b=this._inst,c=this._layer;if(c.GetLayout()!== a.GetLayout())throw Error("layer from different layout");a!==c&&(c._RemoveInstance(b,!0),this._SetLayer(a),a._AddInstance(b,!0),this._runtime.UpdateRender())}ZOrderMoveAdjacentToInstance(a,b){const c=this._inst;let d=!1;const e=this._layer;if(a.GetUID()!==c.GetUID()){var g=a.GetWorldInfo();if(!g)throw Error("expected world instance");g=g.GetLayer();e.GetIndex()!==g.GetIndex()&&(e._RemoveInstance(c,!0),this._SetLayer(g),g._AddInstance(c,!0),d=!0);a=g.MoveInstanceAdjacent(c,a,!!b);(d||a)&&this._runtime.UpdateRender()}}GetInstanceEffectList(){return this._instanceEffectList}_SetHasAnyActiveEffect(a){this._SetFlag(FLAG_HAS_ANY_ACTIVE_EFFECT, a)}HasAnyActiveEffect(){return 0!==(this._flags&FLAG_HAS_ANY_ACTIVE_EFFECT)}_SaveToJson(a){const b={x:this.GetX(),y:this.GetY(),w:this.GetWidth(),h:this.GetHeight(),l:this.GetLayer().GetSID(),zi:this.GetZIndex()};0!==this.GetZElevation()&&(b.ze=this.GetZElevation());0!==this.GetAngle()&&(b.a=this.GetAngle());this.HasDefaultColor()||(b.c=this._color.toJSON());.5!==this.GetOriginX()&&(b.oX=this.GetOriginX());.5!==this.GetOriginY()&&(b.oY=this.GetOriginY());0!==this.GetBlendMode()&&(b.bm=this.GetBlendMode()); this.IsVisible()||(b.v=this.IsVisible());this.IsCollisionEnabled()||(b.ce=this.IsCollisionEnabled());this.IsBboxChangeEventEnabled()&&(b.be=this.IsBboxChangeEventEnabled());this._instanceEffectList&&(b.fx=this._instanceEffectList._SaveToJson());const c=0!==(this._flags&FLAG_SOLID_FILTER_INCLUSIVE);c&&(b.sfi=c);this._solidFilterTags&&(b.sft=[...this._solidFilterTags].join(" "));this._sceneGraphInfo&&"visual-state"!==a&&(b.sgi=this._sceneGraphInfo._SaveToJson(a),sceneGraphExportDataMap.has(this)&&(b.sgcd= sceneGraphExportDataMap.get(this).childrenData,b.sgzid=sceneGraphExportDataMap.get(this).zIndexData));this.HasMesh()&&(b.mesh=this.GetSourceMesh().SaveToJson());return b}_SaveSceneGraphPropertiesToJson(){return{x:this._x,y:this._y,z:this._zElevation,w:this._w,h:this._h,a:this._a}}_LoadSceneGraphPropertiesFromJson(a){a&&(this._x=a.x,this._y=a.y,this._zElevation=a.z,this._w=a.w,this._h=a.h,this._a=a.a,this._MarkSinCosAngleChanged(),this.SetBboxChanged())}_SetupSceneGraphConnectionsOnChangeOfLayout(){this._ReleaseTmpSceneGraphInfo(); this._ResetAllSceneGraphState();this._CreateSceneGraphInfo(null);this._sceneGraphInfo&&this._sceneGraphInfo._SetTmpSceneGraphChildren(this._tmpSceneGraphChildren,this._tmpSceneGraphChildrenIndexes)}_OnBeforeLoad(a){"visual-state"!==a&&this._ResetAllSceneGraphState()}_LoadFromJson(a,b){enableUpdateRendererStateGroup=!1;this.SetX(a.x);this.SetY(a.y);this.SetWidth(a.w);this.SetHeight(a.h);this._SetZIndex(a.zi);this.SetZElevation(a.hasOwnProperty("ze")?a.ze:0);this.SetAngle(a.hasOwnProperty("a")?a.a: 0);a.hasOwnProperty("c")?tempColor$jscomp$6.setFromJSON(a.c):a.hasOwnProperty("o")?(tempColor$jscomp$6.copyRgb(this._color),tempColor$jscomp$6.a=a.o):tempColor$jscomp$6.setRgba(1,1,1,1);this._SetColor(tempColor$jscomp$6);this.SetOriginX(a.hasOwnProperty("oX")?a.oX:.5);this.SetOriginY(a.hasOwnProperty("oY")?a.oY:.5);this.SetBlendMode(a.hasOwnProperty("bm")?a.bm:0);this.SetVisible(a.hasOwnProperty("v")?a.v:!0);this.SetCollisionEnabled(a.hasOwnProperty("ce")?a.ce:!0);this.SetBboxChangeEventEnabled(a.hasOwnProperty("be")? a.be:!1);this.SetSolidCollisionFilter(a.hasOwnProperty("sfi")?a.sfi:!1,a.hasOwnProperty("sft")?a.sft:"");this._instanceEffectList&&a.hasOwnProperty("fx")&&this._instanceEffectList._LoadFromJson(a.fx);if(!a.hasOwnProperty("sgi")&&"visual-state"!==b&&this._tmpSceneGraphChildren)for(const c of this._tmpSceneGraphChildren)c.IsDestroyed()||this._runtime.DestroyInstance(c);if(a.hasOwnProperty("sgi")&&"visual-state"!==b){this._CreateSceneGraphInfo(null);const c=this._sceneGraphInfo,d=a.sgi;c._LoadFromJson(d); c._SetTmpSceneGraphChildren(this._tmpSceneGraphChildren,this._tmpSceneGraphChildrenIndexes);needsSceneGraphAfterLoad.set(this,!0);const e=this.GetRuntime().Dispatcher();this._after_load&&e.removeEventListener("afterload",this._after_load);this._after_load_instance&&e.removeEventListener("afterloadinstance",this._after_load_instance);this._after_load_instance=this._after_load=null;this._after_load=(g,k)=>{this._after_load&&e.removeEventListener("afterload",this._after_load);this._after_load_instance&& e.removeEventListener("afterloadinstance",this._after_load_instance);this._after_load=this._after_load_instance=null;0===(this._flags&FLAG_DESTROYED$jscomp$1)&&(c._OnAfterLoad(d,k),c._SetTmpSceneGraphChildren(null,null),this._ReleaseTmpSceneGraphInfo(),this.SetBboxChanged())};this._after_load_instance=g=>{g.instance===this.GetInstance()&&this._after_load(g,{ignoreMissingInstances:!0})};e.addEventListener("afterload",this._after_load);e.addEventListener("afterloadinstance",this._after_load_instance); a.sgcd&&C3$jscomp$167.IsFiniteNumber(a.sgzid)&&sceneGraphExportDataMap.set(this,{childrenData:a.sgcd,zIndexData:a.sgzid})}a.hasOwnProperty("mesh")?(a=a.mesh,this.CreateMesh(a.cols,a.rows),this.GetSourceMesh().LoadFromJson(a)):this.ReleaseMesh();this.SetBboxChanged();enableUpdateRendererStateGroup=!0;this._UpdateRendererStateGroup()}};"use strict";const C3$jscomp$168=self.C3; C3$jscomp$168.BehaviorType=class extends C3$jscomp$168.DefendedBase{constructor(a,b){super();const c=a.GetRuntime(),d=c.GetPluginManager(),e=c.GetObjectReference(b[1]);d.HasBehaviorByConstructorFunction(e)||d.CreateBehavior(b);this._runtime=c;this._objectClass=a;this._behavior=d.GetBehaviorByConstructorFunction(e);this._sdkType=null;this._instSdkCtor=e.Instance;this._sid=b[2];this._name=b[0];this._jsPropName=this._runtime.GetJsPropName(b[3]);this._sdkType=C3$jscomp$168.New(e.Type,this);this.OnCreate()}static Create(a, b){return C3$jscomp$168.New(C3$jscomp$168.BehaviorType,a,b)}Release(){this._behavior=this._runtime=null;this._sdkType.Release();this._instSdkCtor=this._sdkType=null}GetSdkType(){return this._sdkType}OnCreate(){this._sdkType.OnCreate()}GetRuntime(){return this._runtime}GetObjectClass(){return this._objectClass}GetBehavior(){return this._behavior}GetInstanceSdkCtor(){return this._instSdkCtor}GetName(){return this._name}GetSID(){return this._sid}GetJsPropName(){return this._jsPropName}};"use strict"; const C3$jscomp$169=self.C3,IBehaviorInstance$jscomp$1=self.IBehaviorInstance; C3$jscomp$169.BehaviorInstance=class extends C3$jscomp$169.DefendedBase{constructor(a){super();this._runtime=a.runtime;this._behaviorType=a.behaviorType;this._behavior=this._behaviorType.GetBehavior();this._inst=a.instance;this._index=a.index;this._iScriptInterface=this._sdkInst=null;this._behavior._AddInstance(this._inst)}Release(){this._iScriptInterface&&(this._iScriptInterface._Release(),this._iScriptInterface=null);this._behavior._RemoveInstance(this._inst);this._sdkInst.Release();this._inst= this._behavior=this._behaviorType=this._runtime=this._sdkInst=null}_CreateSdkInstance(a){if(this._sdkInst)throw Error("already got sdk instance");this._sdkInst=C3$jscomp$169.New(this._behaviorType.GetInstanceSdkCtor(),this,a)}GetSdkInstance(){return this._sdkInst}GetObjectInstance(){return this._inst}GetRuntime(){return this._runtime}GetBehaviorType(){return this._behaviorType}GetBehavior(){return this._behavior}_GetIndex(){return this._index}PostCreate(){this._sdkInst.PostCreate()}OnSpriteFrameChanged(a, b){this._sdkInst.OnSpriteFrameChanged(a,b)}_GetDebuggerProperties(){return this._sdkInst.GetDebuggerProperties()}SaveToJson(){return this._sdkInst.SaveToJson()}LoadFromJson(a){return this._sdkInst.LoadFromJson(a)}static SortByTickSequence(a,b){var c=a.GetObjectInstance(),d=b.GetObjectInstance();const e=c.GetObjectClass().GetIndex(),g=d.GetObjectClass().GetIndex();if(e!==g)return e-g;c=c.GetPUID();d=d.GetPUID();return c!==d?c-d:a.GetBehaviorInstance()._GetIndex()-b.GetBehaviorInstance()._GetIndex()}_InitScriptInterface(){const a= this._sdkInst.GetScriptInterfaceClass(),b=a||IBehaviorInstance$jscomp$1;IBehaviorInstance$jscomp$1._Init(this);this._iScriptInterface=new b;IBehaviorInstance$jscomp$1._Init(null);if(a&&!(this._iScriptInterface instanceof IBehaviorInstance$jscomp$1))throw new TypeError(`script interface class '${a.name}' does not extend the right base class '${IBehaviorInstance$jscomp$1.name}'`);return this._iScriptInterface}GetScriptInterface(){return this._iScriptInterface||this._InitScriptInterface()}HasScriptInterface(){return!!this._iScriptInterface}}; "use strict";const C3$jscomp$170=self.C3; C3$jscomp$170.EffectList=class extends C3$jscomp$170.DefendedBase{constructor(a,b){super();this._owner=a;this._allEffectTypes=[];this._activeEffectTypes=[];this._effectTypesByName=new Map;this._effectParams=[];this._effectParamBuffers=[];this._allInstanceEffectLists=new Set;this._preservesOpaqueness=!0;for(const c of b)a=C3$jscomp$170.New(C3$jscomp$170.EffectType,this,c,this._allEffectTypes.length),this._allEffectTypes.push(a),this._effectTypesByName.set(a.GetName().toLowerCase(),a),3<=c.length&& this._effectParams.push(this._LoadSingleEffectParameters(a,c[2]));this.GetRuntime()._AddEffectList(this)}Release(){for(const a of this._effectParamBuffers)a.Release();C3$jscomp$170.clearArray(this._effectParamBuffers);C3$jscomp$170.clearArray(this._allEffectTypes);C3$jscomp$170.clearArray(this._activeEffectTypes);this._effectTypesByName.clear();C3$jscomp$170.clearArray(this._effectParams);this._owner=null}_AddInstanceEffectList(a){this._allInstanceEffectLists.add(a)}_RemoveInstanceEffectList(a){this._allInstanceEffectLists.delete(a)}_InitRenderer(a){a.IsWebGPU()&& (this._effectParamBuffers=this._allEffectTypes.map(b=>{b=b.GetShaderProgram();return 0<b.GetCustomParametersByteSize()?C3$jscomp$170.New(C3$jscomp$170.Gfx.WebGPUEffectCustomParamsBuffer,b):null}),this._UpdateAllEffectParamBuffers());for(const b of this._allInstanceEffectLists)b._InitRenderer(a)}PrependEffectTypes(a){if(a.length){this._allEffectTypes=a.concat(this._allEffectTypes);for(const b of a)this._effectTypesByName.set(b.GetName().toLowerCase(),b);for(let b=0,c=this._allEffectTypes.length;b< c;++b)this._allEffectTypes[b]._SetIndex(b)}}_LoadSingleEffectParameters(a,b){a.SetActive(b[0]);a=b.slice(1);for(let c=0,d=a.length;c<d;++c)if(b=a[c],Array.isArray(b)){const e=C3$jscomp$170.New(C3$jscomp$170.Color);e.setFromJSON(b);a[c]=e}return a}GetOwner(){return this._owner}GetRuntime(){return this._owner.GetRuntime()}UpdateActiveEffects(){C3$jscomp$170.clearArray(this._activeEffectTypes);let a=!0;for(const b of this._allEffectTypes)b.IsActive()&&(this._activeEffectTypes.push(b),b.GetShaderProgram().PreservesOpaqueness()|| (a=!1));this._preservesOpaqueness=a}GetAllEffectTypes(){return this._allEffectTypes}HasAnyEffectType(){return 0<this._allEffectTypes.length}GetEffectTypeByName(a){return this._effectTypesByName.get(a.toLowerCase())||null}GetEffectTypeByIndex(a){a=Math.floor(+a);if(0>a||a>=this._allEffectTypes.length)throw new RangeError("invalid effect type index");return this._allEffectTypes[a]}IsEffectIndexActive(a){return this.GetEffectTypeByIndex(a).IsActive()}SetEffectIndexActive(a,b){this.GetEffectTypeByIndex(a).SetActive(b)}GetActiveEffectTypes(){return this._activeEffectTypes}HasAnyActiveEffect(){return 0< this._activeEffectTypes.length}PreservesOpaqueness(){return this._preservesOpaqueness}GetEffectParametersForIndex(a){return this._effectParams[a]}_GetEffectChainShaderParametersForIndex(a){return a<this._effectParamBuffers.length?this._effectParamBuffers[a]:this._effectParams[a]}GetEffectParameter(a,b){if(0>a||a>=this._effectParams.length)return null;a=this._effectParams[a];return 0>b||b>=a.length?null:a[b]}SetEffectParameter(a,b,c){if(0>a||a>=this._effectParams.length)return!1;const d=this._effectParams[a]; if(0>b||b>=d.length)return!1;const e=d[b];if(e instanceof C3$jscomp$170.Color){if(e.equalsIgnoringAlpha(c))return!1;e.copyRgb(c)}else{if(e===c)return!1;d[b]=c}a<this._effectParamBuffers.length&&this._effectParamBuffers[a].SetParameterValue(b,c);return!0}_UpdateAllEffectParamBuffers(){const a=this._effectParams,b=this._effectParamBuffers;for(let c=0,d=Math.min(a.length,b.length);c<d;++c){const e=b[c],g=a[c];for(let k=0,l=g.length;k<l;++k)e.SetParameterValue(k,g[k])}}static SaveFxParamToJson(a){return a&& a instanceof C3$jscomp$170.Color?{t:"color",v:a.toJSON()}:a}static LoadFxParamFromJson(a){if(null===a)return NaN;if("object"===typeof a){if("color"===a.t){const b=C3$jscomp$170.New(C3$jscomp$170.Color);b.setFromJSON(a.v);return b}throw Error("invalid effect parameter type");}return a}static SaveFxParamsToJson(a){return a.map(C3$jscomp$170.EffectList.SaveFxParamToJson)}static LoadFxParamsFromJson(a){return a.map(C3$jscomp$170.EffectList.LoadFxParamFromJson)}SaveToJson(){return this._allEffectTypes.map(a=> ({name:a.GetName(),active:a.IsActive(),params:C3$jscomp$170.EffectList.SaveFxParamsToJson(this._effectParams[a.GetIndex()])}))}LoadFromJson(a){for(const b of a)if(a=this.GetEffectTypeByName(b.name))a.SetActive(b.active),this._effectParams[a.GetIndex()]=C3$jscomp$170.EffectList.LoadFxParamsFromJson(b.params);this.UpdateActiveEffects();this._UpdateAllEffectParamBuffers()}};"use strict";const C3$jscomp$171=self.C3; C3$jscomp$171.EffectType=class extends C3$jscomp$171.DefendedBase{constructor(a,b,c){super();this._effectList=a;this._id=b[0];this._name=b[1];this._index=c;this._shaderProgram=null;this._isActive=!0}Release(){this._shaderProgram=this._effectList=null}Clone(a){a=C3$jscomp$171.New(C3$jscomp$171.EffectType,a,[this._id,this._name],-1);a._shaderProgram=this._shaderProgram;a._isActive=this._isActive;return a}_InitRenderer(a){a=a.GetShaderProgramByName(this._id);if(!a)throw Error("failed to find shader program '"+ this._id+"'");this._shaderProgram=a}GetEffectList(){return this._effectList}GetName(){return this._name}_SetIndex(a){this._index=a}GetIndex(){return this._index}GetOwner(){return this._effectList.GetOwner()}GetRuntime(){return this._effectList.GetRuntime()}SetActive(a){this._isActive=!!a}IsActive(){return this._isActive}GetShaderProgram(){return this._shaderProgram}GetDefaultParameterValues(){const a=[];for(let b=0,c=this._shaderProgram.GetParameterCount();b<c;++b){const d=this._shaderProgram.GetParameterType(b); if("float"===d||"percent"===d)a.push(0);else if("color"===d)a.push(C3$jscomp$171.New(C3$jscomp$171.Color,1,1,1,1));else throw new TypeError("unknown effect parameter type");}return a}};"use strict";const C3$jscomp$172=self.C3; C3$jscomp$172.InstanceEffectList=class extends C3$jscomp$172.DefendedBase{constructor(a,b){super();this._inst=a;this._wi=b;this._effectList=a.GetObjectClass().GetEffectList();this._wasDefaultColor=this._needsRebuildSteps=!0;this._wasTexRotated=this._wasRotatedOrNegativeSize=this._was3D=!1;this._effectChain=C3$jscomp$172.New(C3$jscomp$172.Gfx.EffectChain,a.GetRuntime().GetCanvasManager().GetEffectChainManager(),{drawContent:(c,d)=>{d=d.GetContentObject();const e=d.GetWorldInfo();c.SetColor(e.GetPremultipliedColor()); c.SetCurrentZ(e.GetTotalZElevation());d.Draw(c);c.SetCurrentZ(0)},getSourceTextureInfo:c=>{const d=c.GetCurrentTexRect(),[e,g]=c.GetCurrentSurfaceSize();return{srcTexRect:d,srcWidth:e,srcHeight:g}},getShaderParameters:c=>this._GetEffectChainShaderParametersForIndex(c)});this._activeEffectFlags=[];this._activeEffectTypes=[];this._preservesOpaqueness=!0;this._effectParams=[];this._effectParamBuffers=[];this._InitRenderer(a.GetRuntime().GetRenderer());for(let c=0,d=this._effectList.GetAllEffectTypes().length;c< d;++c)this._activeEffectFlags.push(!0);this.UpdateActiveEffects();this._effectList._AddInstanceEffectList(this)}Release(){this._effectList._RemoveInstanceEffectList(this);for(const a of this._effectParamBuffers)a&&a.Release();C3$jscomp$172.clearArray(this._effectParamBuffers);this._effectChain.Release();this._effectChain=null;C3$jscomp$172.clearArray(this._activeEffectFlags);C3$jscomp$172.clearArray(this._activeEffectTypes);C3$jscomp$172.clearArray(this._effectParams);this._effectList=this._inst= null}_InitRenderer(a){a.IsWebGPU()&&(this._effectParamBuffers=this._effectList.GetAllEffectTypes().map(b=>{b=b.GetShaderProgram();return 0<b.GetCustomParametersByteSize()?C3$jscomp$172.New(C3$jscomp$172.Gfx.WebGPUEffectCustomParamsBuffer,b):null}))}_LoadEffectParameters(a){let b=0;for(const c of a)this._effectParams.push(this._LoadSingleEffectParameters(b,c)),++b;this._UpdateAllEffectParamBuffers();this.UpdateActiveEffects()}_LoadSingleEffectParameters(a,b){this._activeEffectFlags[a]=b[0];a=b.slice(1); for(let c=0,d=a.length;c<d;++c)if(b=a[c],Array.isArray(b)){const e=C3$jscomp$172.New(C3$jscomp$172.Color);e.setFromJSON(b);a[c]=e}return a}LoadDefaultEffectParameters(){for(const a of this._effectList.GetAllEffectTypes())this._effectParams.push(a.GetDefaultParameterValues());this._UpdateAllEffectParamBuffers()}GetOwner(){return this._owner}GetEffectList(){return this._effectList}GetEffectChain(){this._MaybeRebuildEffectChainSteps();return this._effectChain}GetRuntime(){return this._inst.GetRuntime()}UpdateActiveEffects(){C3$jscomp$172.clearArray(this._activeEffectTypes); const a=this._wi,b=this._effectList.GetAllEffectTypes(),c=this._activeEffectTypes,d=this._activeEffectFlags;let e=!0;for(let g=0,k=b.length;g<k;++g)if(d[g]){const l=b[g];c.push(l);l.GetShaderProgram().PreservesOpaqueness()||(e=!1)}this._preservesOpaqueness=e;a._SetHasAnyActiveEffect(!!c.length);this._needsRebuildSteps=!0}_MaybeRebuildEffectChainSteps(){const a=this._inst;var b=this._wi;const c=b.HasDefaultColor(),d=0<b.GetDepth();b=0!==b.GetAngle()||0>b.GetWidth()||0>b.GetHeight();const e=a.IsCurrentTexRotated(); if(this._needsRebuildSteps||c!==this._wasDefaultColor||d!==this._was3D||b!==this._wasRotatedOrNegativeSize||e!==this._wasTexRotated||this._effectChain.NeedsRebuild())this._effectChain.BuildSteps(this._activeEffectTypes.map(g=>g.GetShaderProgram()),{indexMap:this._activeEffectTypes.map(g=>g.GetIndex()),forcePreDraw:!c||a.MustPreDraw(),is3D:d,isSourceTextureRotated:e,isRotatedOrNegativeSizeInstance:b}),this._needsRebuildSteps=!1,this._wasDefaultColor=c,this._was3D=d,this._wasRotatedOrNegativeSize=b, this._wasTexRotated=e}GetActiveEffectTypes(){return this._activeEffectTypes}GetEffectParametersForIndex(a){return this._effectParams[a]}_GetEffectChainShaderParametersForIndex(a){return a<this._effectParamBuffers.length?this._effectParamBuffers[a]:this._effectParams[a]}GetEffectParameter(a,b){if(0>a||a>=this._effectParams.length)return null;a=this._effectParams[a];return 0>b||b>=a.length?null:a[b]}SetEffectParameter(a,b,c){if(0>a||a>=this._effectParams.length)return!1;const d=this._effectParams[a]; if(0>b||b>=d.length)return!1;const e=d[b];if(e instanceof C3$jscomp$172.Color){if(e.equalsIgnoringAlpha(c))return!1;e.copyRgb(c)}else{if(e===c)return!1;d[b]=c}a<this._effectParamBuffers.length&&this._effectParamBuffers[a].SetParameterValue(b,c);return!0}_UpdateAllEffectParamBuffers(){const a=this._effectParams,b=this._effectParamBuffers;for(let c=0,d=b.length;c<d;++c){const e=b[c],g=a[c];for(let k=0,l=g.length;k<l;++k)e.SetParameterValue(k,g[k])}}PreservesOpaqueness(){return this._preservesOpaqueness}HasAnyActiveBackgroundBlendingEffect(){return this._activeEffectTypes.some(a=> a.GetShaderProgram().BlendsBackground())}IsEffectIndexActive(a){return this._activeEffectFlags[a]}SetEffectIndexActive(a,b){this._activeEffectFlags[a]=!!b}GetAllEffectTypes(){return this._effectList.GetAllEffectTypes()}_SaveToJson(){return this._effectList.GetAllEffectTypes().map(a=>({name:a.GetName(),active:this._activeEffectFlags[a.GetIndex()],params:C3$jscomp$172.EffectList.SaveFxParamsToJson(this._effectParams[a.GetIndex()])}))}_LoadFromJson(a){for(const b of a)if(a=this._effectList.GetEffectTypeByName(b.name))this._activeEffectFlags[a.GetIndex()]= b.active,this._effectParams[a.GetIndex()]=C3$jscomp$172.EffectList.LoadFxParamsFromJson(b.params);this.UpdateActiveEffects();this._UpdateAllEffectParamBuffers()}};"use strict"; const C3$jscomp$173=self.C3,tempCandidates=[],tileCollRectCandidates=[],tempJumpthruRet=[],tempPolyA=C3$jscomp$173.New(C3$jscomp$173.CollisionPoly),tempPolyB=C3$jscomp$173.New(C3$jscomp$173.CollisionPoly),tempQuad$jscomp$4=C3$jscomp$173.New(C3$jscomp$173.Quad),tempRect$jscomp$7=C3$jscomp$173.New(C3$jscomp$173.Rect),tempRect2$jscomp$1=C3$jscomp$173.New(C3$jscomp$173.Rect);let tempPolyC=null,tempRect3$jscomp$1=null,tempQuadB=null; C3$jscomp$173.CollisionEngine=class extends C3$jscomp$173.DefendedBase{constructor(a){super();this._runtime=a;this._registeredCollisions=[];this._polyCheckSec=this._polyCheckCount=this._collisionCheckSec=this._collisionCheckCount=0}Release(){this._runtime=null}_Update1sStats(){this._collisionCheckSec=this._collisionCheckCount;this._collisionCheckCount=0;this._polyCheckSec=this._polyCheckCount;this._polyCheckCount=0}Get1secCollisionChecks(){return this._collisionCheckSec}Get1secPolyChecks(){return this._polyCheckSec}RegisterCollision(a, b){const c=a.GetWorldInfo(),d=b.GetWorldInfo();c&&d&&c.IsCollisionEnabled()&&d.IsCollisionEnabled()&&this._registeredCollisions.push([a,b])}AddRegisteredCollisionCandidates(a,b,c){for(const [d,e]of this._registeredCollisions){let g;if(a===d)g=e;else if(a===e)g=d;else continue;g.BelongsToObjectClass(b)&&(c.includes(g)||c.push(g))}}CheckRegisteredCollision(a,b){if(!this._registeredCollisions.length)return!1;for(const [c,d]of this._registeredCollisions)if(a===c&&b===d||a===d&&b===c)return!0;return!1}ClearRegisteredCollisions(){C3$jscomp$173.clearArray(this._registeredCollisions)}TestOverlap(a, b){if(!a||!b||a===b)return!1;a=a.GetWorldInfo();b=b.GetWorldInfo();if(!a.IsCollisionEnabled()||!b.IsCollisionEnabled())return!1;this._collisionCheckCount++;const c=a.GetLayer(),d=b.GetLayer();return c.IsTransformCompatibleWith(d)?this._TestOverlap_SameLayers(a,b):this._TestOverlap_DifferentLayers(a,b)}_TestOverlap_SameLayers(a,b){if(!a.GetBoundingBox().intersectsRect(b.GetBoundingBox()))return!1;this._polyCheckCount++;if(!a.GetBoundingQuad().intersectsQuad(b.GetBoundingQuad())||a.HasTilemap()&&b.HasTilemap())return!1; if(a.HasTilemap())return this.TestTilemapOverlap(a,b);if(b.HasTilemap())return this.TestTilemapOverlap(b,a);if(!a.HasOwnCollisionPoly()&&!b.HasOwnCollisionPoly())return!0;const c=a.GetTransformedCollisionPoly(),d=b.GetTransformedCollisionPoly();return c.intersectsPoly(d,b.GetX()-a.GetX(),b.GetY()-a.GetY())}_TestOverlap_DifferentLayers(a,b){var c=a.HasTilemap(),d=b.HasTilemap();if(c&&!d)return this.TestTilemapOverlapDifferentLayers(a,b);if(d&&!c)return this.TestTilemapOverlapDifferentLayers(b,a);if(d|| c)return!1;d=a.GetLayer();c=b.GetLayer();tempPolyA.copy(a.GetTransformedCollisionPoly());tempPolyB.copy(b.GetTransformedCollisionPoly());var e=tempPolyA.pointsArr();for(let g=0,k=e.length;g<k;g+=2){const l=g+1,n=e[l],[p,r]=d.LayerToCanvasCss(e[g]+a.GetX(),n+a.GetY());e[g]=p;e[l]=r}a=tempPolyB.pointsArr();for(let g=0,k=a.length;g<k;g+=2){d=g+1;e=a[d];const [l,n]=c.LayerToCanvasCss(a[g]+b.GetX(),e+b.GetY());a[g]=l;a[d]=n}tempPolyA.setBboxChanged();tempPolyB.setBboxChanged();this._polyCheckCount++;return tempPolyA.intersectsPoly(tempPolyB, 0,0)}TestTilemapOverlapDifferentLayers(a,b){var c=a.GetLayer(),d=b.GetLayer();tempPolyC||(tempPolyC=C3$jscomp$173.New(C3$jscomp$173.CollisionPoly));tempRect3$jscomp$1||(tempRect3$jscomp$1=C3$jscomp$173.New(C3$jscomp$173.Rect));tempQuadB||(tempQuadB=C3$jscomp$173.New(C3$jscomp$173.Quad));var e=b.GetX(),g=b.GetY();const [k,l]=d.LayerToCanvasCss(e,g),[n,p]=c.CanvasCssToLayer(k,l);c=n-e;g=p-g;tempRect3$jscomp$1.copy(b.GetBoundingBox());tempRect3$jscomp$1.offset(c,g);if(!a.GetBoundingBox().intersectsRect(tempRect3$jscomp$1))return!1; tempQuadB.copy(b.GetBoundingQuad());tempQuadB.offset(c,g);this._polyCheckCount++;if(!a.GetBoundingQuad().intersectsQuad(tempQuadB))return!1;tempPolyC.copy(b.GetTransformedCollisionPoly());d=tempPolyC.pointsArr();for(let r=0,w=d.length;r<w;r+=2)e=r+1,d[r]+=c,d[e]+=g;tempPolyC.setBboxChanged();return this.TestTilemapOverlap(a,b,n,p,tempPolyC,tempRect3$jscomp$1,tempQuadB)}TestTilemapOverlap(a,b,c,d,e,g,k){g=void 0!==g?g:b.GetBoundingBox();const l=a.GetX(),n=a.GetY();var p=a.GetInstance().GetSdkInstance(); c=void 0!==c?c:b.GetX();d=void 0!==d?d:b.GetY();a=b.HasOwnCollisionPoly();k=void 0!==k?k:b.GetBoundingQuad();p.GetCollisionRectCandidates(g,tileCollRectCandidates);for(let y=0,B=tileCollRectCandidates.length;y<B;++y){var r=tileCollRectCandidates[y];p=r.GetRect();this._collisionCheckCount++;if(g.intersectsRectOffset(p,l,n)&&(tempQuad$jscomp$4.setFromRect(p),tempQuad$jscomp$4.offset(l,n),tempQuad$jscomp$4.intersectsQuad(k)))if(a){var w=void 0!==e?e:b.GetTransformedCollisionPoly();let C=c,E=d;void 0!== e&&(C=b.GetX(),E=b.GetY());if(r=r.GetPoly()){if(this._polyCheckCount++,r.intersectsPoly(w,C-(l+p.getLeft()),E-(n+p.getTop())))return C3$jscomp$173.clearArray(tileCollRectCandidates),!0}else if(tempPolyA.setFromQuad(tempQuad$jscomp$4,0,0),tempPolyA.intersectsPoly(w,C,E))return C3$jscomp$173.clearArray(tileCollRectCandidates),!0}else if(w=r.GetPoly()){if(tempPolyA.setFromQuad(k,0,0),w.intersectsPoly(tempPolyA,-(l+p.getLeft()),-(n+p.getTop())))return C3$jscomp$173.clearArray(tileCollRectCandidates), !0}else return C3$jscomp$173.clearArray(tileCollRectCandidates),!0}C3$jscomp$173.clearArray(tileCollRectCandidates);return!1}TestAndSelectCanvasPointOverlap(a,b,c,d){const e=a.GetCurrentSol();var g=this._runtime.GetCurrentEvent();if(!g)throw Error("cannot call outside event");g=g.IsOrBlock();const k=new Map,l=y=>{let B=k.get(y);"undefined"===typeof B&&(B=y.IsSelfAndParentsInteractive(),k.set(y,B));return B};if(e.IsSelectAll()){d||(e._SetSelectAll(!1),C3$jscomp$173.clearArray(e._GetOwnInstances())); g&&C3$jscomp$173.clearArray(e._GetOwnElseInstances());for(var n of a.GetInstances()){var p=n.GetWorldInfo(),r=p.GetLayer(),w=!1;if(l(r)&&p.IsInViewport2()){const [y,B]=r.CanvasCssToLayer(b,c,p.GetTotalZElevation());w=p.ContainsPoint(y,B)}if(w){if(d)return!1;e._PushInstance(n)}else g&&e._PushElseInstance(n)}}else{p=!1;g?this._runtime.IsCurrentConditionFirst()&&!e._GetOwnElseInstances().length&&e._GetOwnInstances().length?n=e._GetOwnInstances():(n=e._GetOwnElseInstances(),p=!0):n=e._GetOwnInstances(); r=0;for(let y=0,B=n.length;y<B;++y){w=n[y];const C=w.GetWorldInfo(),E=C.GetLayer();let F=!1;if(l(E)&&C.IsInViewport2()){const [J,L]=E.CanvasCssToLayer(b,c,C.GetTotalZElevation());F=C.ContainsPoint(J,L)}if(F){if(d)return!1;p?e._PushInstance(w):n[r++]=w}else p?n[r++]=w:g&&e._PushElseInstance(w)}d||(n.length=r)}a.ApplySolToContainer();k.clear();return d?!0:e.HasAnyInstances()}GetCollisionCandidates(a,b,c,d){a=a?1!==a.GetParallaxX()||1!==a.GetParallaxY():!1;if(b.IsFamily())for(const e of b.GetFamilyMembers())a|| e.IsAnyInstanceParallaxed()?C3$jscomp$173.appendArray(d,e.GetInstances()):(e._UpdateAllCollisionCells(),e._GetCollisionCellGrid().QueryRange(c,d));else a||b.IsAnyInstanceParallaxed()?C3$jscomp$173.appendArray(d,b.GetInstances()):(b._UpdateAllCollisionCells(),b._GetCollisionCellGrid().QueryRange(c,d))}GetObjectClassesCollisionCandidates(a,b,c,d){for(const e of b)this.GetCollisionCandidates(a,e,c,d)}GetSolidCollisionCandidates(a,b,c){const d=this._runtime.GetSolidBehavior();d&&this.GetObjectClassesCollisionCandidates(a, d.GetObjectClasses(),b,c)}GetJumpthruCollisionCandidates(a,b,c){const d=this._runtime.GetJumpthruBehavior();d&&this.GetObjectClassesCollisionCandidates(a,d.GetObjectClasses(),b,c)}IsSolidCollisionAllowed(a,b){return a._IsSolidEnabled()&&(!b||b.GetWorldInfo().IsSolidCollisionAllowed(a.GetSavedDataMap().get("solidTags")))}TestOverlapSolid(a){const b=a.GetWorldInfo();this.GetSolidCollisionCandidates(b.GetLayer(),b.GetBoundingBox(),tempCandidates);for(const c of tempCandidates)if(this.IsSolidCollisionAllowed(c, a)&&this.TestOverlap(a,c))return C3$jscomp$173.clearArray(tempCandidates),c;C3$jscomp$173.clearArray(tempCandidates);return null}TestRectOverlapSolid(a,b){this.GetSolidCollisionCandidates(null,a,tempCandidates);for(const c of tempCandidates)if(this.IsSolidCollisionAllowed(c,b)&&this.TestRectOverlap(a,c))return C3$jscomp$173.clearArray(tempCandidates),c;C3$jscomp$173.clearArray(tempCandidates);return null}TestOverlapJumpthru(a,b){let c=null;b&&(c=tempJumpthruRet,C3$jscomp$173.clearArray(c));const d= a.GetWorldInfo();this.GetJumpthruCollisionCandidates(d.GetLayer(),d.GetBoundingBox(),tempCandidates);for(const e of tempCandidates)if(e._IsJumpthruEnabled()&&this.TestOverlap(a,e))if(b)c.push(e);else return C3$jscomp$173.clearArray(tempCandidates),e;C3$jscomp$173.clearArray(tempCandidates);return c}PushOut(a,b,c,d,e){d=d||50;const g=a.GetWorldInfo(),k=g.GetX(),l=g.GetY();for(let n=0;n<d;++n)if(g.SetXY(k+b*n,l+c*n),g.SetBboxChanged(),!this.TestOverlap(a,e))return!0;g.SetXY(k,l);g.SetBboxChanged(); return!1}PushOutSolid(a,b,c,d,e,g){d=d||50;const k=a.GetWorldInfo(),l=k.GetX(),n=k.GetY();let p=null,r=null;for(let w=0;w<d;++w)if(k.SetXY(l+b*w,n+c*w),k.SetBboxChanged(),!this.TestOverlap(a,p))if(p=this.TestOverlapSolid(a))r=p;else if(e&&(p=g?this.TestOverlap(a,g)?g:null:this.TestOverlapJumpthru(a))&&(r=p),!p)return r&&this.PushInFractional(a,b,c,r,16,!0),!0;k.SetXY(l,n);k.SetBboxChanged();return!1}PushOutSolidAxis(a,b,c,d){d=d||50;const e=a.GetWorldInfo(),g=e.GetX(),k=e.GetY();let l=null,n=null; for(let p=0;p<d;++p)for(let r=0;2>r;++r){const w=2*r-1;e.SetXY(g+b*p*w,k+c*p*w);e.SetBboxChanged();if(!this.TestOverlap(a,l))if(l=this.TestOverlapSolid(a))n=l;else return n&&this.PushInFractional(a,b*w,c*w,n,16,!0),!0}e.SetXY(g,k);e.SetBboxChanged();return!1}PushInFractional(a,b,c,d,e,g){let k=2,l=!1;var n=!1;const p=a.GetWorldInfo();let r=p.GetX(),w=p.GetY();for(;k<=e;)n=1/k,k*=2,p.OffsetXY(b*n*(l?1:-1),c*n*(l?1:-1)),p.SetBboxChanged(),this.TestOverlap(a,d)||g&&this.TestOverlapSolid(a)?n=l=!0:(n= l=!1,r=p.GetX(),w=p.GetY());n&&(p.SetXY(r,w),p.SetBboxChanged())}PushOutSolidNearest(a,b=100){let c=0;const d=a.GetWorldInfo(),e=d.GetX(),g=d.GetY();let k=0,l=this.TestOverlapSolid(a);if(!l)return!0;for(;c<=b;){let n=0,p=0;switch(k){case 0:n=0;p=-1;c++;break;case 1:n=1;p=-1;break;case 2:n=1;p=0;break;case 3:p=n=1;break;case 4:n=0;p=1;break;case 5:n=-1;p=1;break;case 6:n=-1;p=0;break;case 7:p=n=-1}k=(k+1)%8;d.SetXY(Math.floor(e+n*c),Math.floor(g+p*c));d.SetBboxChanged();if(!this.TestOverlap(a,l)&& (l=this.TestOverlapSolid(a),!l))return!0}d.SetXY(e,g);d.SetBboxChanged();return!1}CalculateBounceAngle(a,b,c,d){const e=a.GetWorldInfo(),g=e.GetX(),k=e.GetY(),l=Math.max(10,C3$jscomp$173.distanceTo(b,c,g,k));var n=C3$jscomp$173.angleTo(b,c,g,k),p=d||this.TestOverlapSolid(a);if(!p)return C3$jscomp$173.clampAngle(n+Math.PI);let r=p;var w=0,y=0;const B=C3$jscomp$173.toRadians(5);let C;for(C=1;36>C;++C){const E=n-C*B;e.SetXY(b+Math.cos(E)*l,c+Math.sin(E)*l);e.SetBboxChanged();if(!this.TestOverlap(a,r)&& (r=d?null:this.TestOverlapSolid(a),!r)){w=E;break}}36===C&&(w=C3$jscomp$173.clampAngle(n+Math.PI));r=p;for(C=1;36>C;++C)if(p=n+C*B,e.SetXY(b+Math.cos(p)*l,c+Math.sin(p)*l),e.SetBboxChanged(),!this.TestOverlap(a,r)&&(r=d?null:this.TestOverlapSolid(a),!r)){y=p;break}36===C&&(y=C3$jscomp$173.clampAngle(n+Math.PI));e.SetXY(g,k);e.SetBboxChanged();if(y===w)return y;a=C3$jscomp$173.angleDiff(y,w)/2;a=C3$jscomp$173.angleClockwise(y,w)?C3$jscomp$173.clampAngle(w+a+Math.PI):C3$jscomp$173.clampAngle(y+a);w= Math.cos(n);n=Math.sin(n);y=Math.cos(a);a=Math.sin(a);b=w*y+n*a;return C3$jscomp$173.angleTo(0,0,w-2*b*y,n-2*b*a)}TestSegmentOverlap(a,b,c,d,e){if(!e)return!1;const g=e.GetWorldInfo();if(!g.IsCollisionEnabled())return!1;this._collisionCheckCount++;tempRect$jscomp$7.set(Math.min(a,c),Math.min(b,d),Math.max(a,c),Math.max(b,d));if(!g.GetBoundingBox().intersectsRect(tempRect$jscomp$7))return!1;if(e.HasTilemap())return this._TestSegmentOverlapTilemap(a,b,c,d,e,g);this._polyCheckCount++;return g.GetBoundingQuad().intersectsSegment(a, b,c,d)?g.HasOwnCollisionPoly()?g.GetTransformedCollisionPoly().intersectsSegment(g.GetX(),g.GetY(),a,b,c,d):!0:!1}_TestSegmentOverlapTilemap(a,b,c,d,e,g){const k=g.GetX();g=g.GetY();e=e.GetSdkInstance();tempRect2$jscomp$1.set(a,b,c,d);tempRect2$jscomp$1.normalize();e.GetCollisionRectCandidates(tempRect2$jscomp$1,tileCollRectCandidates);for(let n=0,p=tileCollRectCandidates.length;n<p;++n){var l=tileCollRectCandidates[n];e=l.GetRect();this._collisionCheckCount++;if(tempRect$jscomp$7.intersectsRectOffset(e, k,g)&&(tempQuad$jscomp$4.setFromRect(e),tempQuad$jscomp$4.offset(k,g),tempQuad$jscomp$4.intersectsSegment(a,b,c,d)))if(l=l.GetPoly()){if(this._polyCheckCount++,l.intersectsSegment(k+e.getLeft(),g+e.getTop(),a,b,c,d))return C3$jscomp$173.clearArray(tileCollRectCandidates),!0}else return C3$jscomp$173.clearArray(tileCollRectCandidates),!0}C3$jscomp$173.clearArray(tileCollRectCandidates);return!1}TestRectOverlap(a,b){if(!b)return!1;const c=b.GetWorldInfo();if(!c.IsCollisionEnabled())return!1;this._collisionCheckCount++; if(!c.GetBoundingBox().intersectsRect(a))return!1;if(b.HasTilemap())return this._TestRectOverlapTilemap(a,b,c);this._polyCheckCount++;tempQuad$jscomp$4.setFromRect(a);if(!c.GetBoundingQuad().intersectsQuad(tempQuad$jscomp$4))return!1;if(!c.HasOwnCollisionPoly())return!0;tempPolyA.setFromRect(a,c.GetX(),c.GetY());a=c.GetTransformedCollisionPoly();return tempPolyA.intersectsPoly(a,0,0)}_TestRectOverlapTilemap(a,b,c){const d=c.GetX();c=c.GetY();b.GetSdkInstance().GetCollisionRectCandidates(a,tileCollRectCandidates); for(let g=0,k=tileCollRectCandidates.length;g<k;++g){var e=tileCollRectCandidates[g];b=e.GetRect();this._collisionCheckCount++;if(a.intersectsRectOffset(b,d,c))if(e=e.GetPoly()){if(this._polyCheckCount++,tempPolyA.setFromRect(a,0,0),e.intersectsPoly(tempPolyA,-(d+b.getLeft()),-(c+b.getTop())))return C3$jscomp$173.clearArray(tileCollRectCandidates),!0}else return C3$jscomp$173.clearArray(tileCollRectCandidates),!0}C3$jscomp$173.clearArray(tileCollRectCandidates);return!1}TestRayIntersectsInstance(a, b){if(a){var c=a.GetWorldInfo();c.IsCollisionEnabled()&&(this._collisionCheckCount++,c.GetBoundingBox().intersectsRect(b.rect)&&(a.HasTilemap()?this._TestRayIntersectsTilemap(a,c,b):(this._polyCheckCount++,c.HasOwnCollisionPoly()?b.TestInstancePoly(a,c.GetX(),c.GetY(),c.GetTransformedCollisionPoly()):b.TestInstanceQuad(a,c.GetBoundingQuad()))))}}_TestRayIntersectsTilemap(a,b,c){const d=b.GetX(),e=b.GetY();a.GetSdkInstance().GetCollisionRectCandidates(c.rect,tileCollRectCandidates);for(let k=0,l=tileCollRectCandidates.length;k< l;k++){var g=tileCollRectCandidates[k];const n=g.GetRect();this._collisionCheckCount++;c.rect.intersectsRectOffset(n,d,e)&&(g=g.GetPoly(),this._polyCheckCount++,g?c.TestInstancePoly(a,d+n.getLeft(),e+n.getTop(),g):c.TestInstanceRect(a,b.GetX(),b.GetY(),n))}C3$jscomp$173.clearArray(tileCollRectCandidates)}};"use strict";const C3$jscomp$174=self.C3; C3$jscomp$174.SparseGrid=class extends C3$jscomp$174.DefendedBase{constructor(a,b){super();this._cellWidth=a;this._cellHeight=b;this._cells=C3$jscomp$174.New(C3$jscomp$174.PairMap)}Release(){this._cells.Release();this._cells=null}GetCell(a,b,c){let d=this._cells.Get(a,b);return d?d:c?(d=C3$jscomp$174.New(C3$jscomp$174.GridCell,this,a,b),this._cells.Set(a,b,d),d):null}XToCell(a){a=Math.floor(a/this._cellWidth);return isFinite(a)?a:0}YToCell(a){a=Math.floor(a/this._cellHeight);return isFinite(a)?a: 0}Update(a,b,c){if(b)for(let d=b.getLeft(),e=b.getRight();d<=e;++d)for(let g=b.getTop(),k=b.getBottom();g<=k;++g){if(c&&c.containsPoint(d,g))continue;const l=this.GetCell(d,g,!1);l&&(l.Remove(a),l.IsEmpty()&&this._cells.Delete(d,g))}if(c)for(let d=c.getLeft(),e=c.getRight();d<=e;++d)for(let g=c.getTop(),k=c.getBottom();g<=k;++g)b&&b.containsPoint(d,g)||this.GetCell(d,g,!0).Insert(a)}QueryRange(a,b){let c=this.XToCell(a.getLeft());const d=this.YToCell(a.getTop()),e=this.XToCell(a.getRight());a=this.YToCell(a.getBottom()); if(isFinite(e)&&isFinite(a))for(;c<=e;++c)for(let g=d;g<=a;++g){const k=this.GetCell(c,g,!1);k&&k.Dump(b)}}};"use strict";const C3$jscomp$175=self.C3; C3$jscomp$175.GridCell=class extends C3$jscomp$175.DefendedBase{constructor(a,b,c){super();this._grid=a;this._x=b;this._y=c;this._instances=C3$jscomp$175.New(C3$jscomp$175.ArraySet)}Release(){this._instances.Release();this._grid=this._instances=null}IsEmpty(){return this._instances.IsEmpty()}Insert(a){this._instances.Add(a)}Remove(a){this._instances.Delete(a)}Dump(a){C3$jscomp$175.appendArray(a,this._instances.GetArray())}};"use strict";const C3$jscomp$176=self.C3; C3$jscomp$176.Ray=class{constructor(){this.dy=this.dx=this.y2=this.x2=this.y1=this.x1=0;this.rect=new C3$jscomp$176.Rect;this.hitFraction=2;this.hitUid=null;this.distance=this.hitY=this.hitX=this.hitNormalDy=this.hitNormalDx=this.hitNormal=0;this.normalX=1;this.normalY=0;this.reflectionX=1;this.reflectionY=0}DidCollide(){return 1.000001>this.hitFraction}Reset(){this.hitFraction=2}Set(a,b,c,d){this.x1=a;this.y1=b;this.x2=c;this.y2=d;this.dx=c-a;this.dy=d-b;this.rect.set(a,b,c,d);this.rect.normalize(); this.hitFraction=2;this.hitUid=null;this.distance=this.hitY=this.hitX=this.hitNormalDy=this.hitNormalDx=this.hitNormal=0;this.normalX=1;this.normalY=0;this.reflectionX=1;this.reflectionY=0;return this}Complete(){if(!1!==this.DidCollide()){var a=this.dx*this.hitFraction,b=this.dy*this.hitFraction,c=Math.hypot(a,b);a/=c;b/=c;this.distance=c-1E-6;this.hitX=this.x1+a*this.distance;this.hitY=this.y1+b*this.distance;this.hitNormal=Math.atan2(this.hitNormalDy,this.hitNormalDx)+Math.PI/2;this.normalX=Math.cos(this.hitNormal); this.normalY=Math.sin(this.hitNormal);c=a*this.normalX+b*this.normalY;this.reflectionX=a-2*this.normalX*c;this.reflectionY=b-2*this.normalY*c;0<c&&(this.hitNormal=C3$jscomp$176.clampAngle(this.hitNormal+Math.PI),this.normalX=-this.normalX,this.normalY=-this.normalY)}}TestInstanceSegment(a,b,c,d,e){const g=C3$jscomp$176.rayIntersect(this.x1,this.y1,this.x2,this.y2,b,c,d,e);0<=g&&g<this.hitFraction&&(this.hitFraction=g,this.hitUid=a.GetUID(),this.hitNormalDx=b-d,this.hitNormalDy=c-e)}TestInstanceRect(a, b,c,d){const e=b+d.getLeft();b+=d.getRight();const g=c+d.getTop();c+=d.getBottom();this.TestInstanceSegment(a,e,g,b,g);this.TestInstanceSegment(a,b,g,b,c);this.TestInstanceSegment(a,b,c,e,c);this.TestInstanceSegment(a,e,c,e,g)}TestInstanceQuad(a,b){const c=b.getTlx(),d=b.getTly(),e=b.getTrx(),g=b.getTry(),k=b.getBrx(),l=b.getBry(),n=b.getBlx();b=b.getBly();this.TestInstanceSegment(a,c,d,e,g);this.TestInstanceSegment(a,e,g,k,l);this.TestInstanceSegment(a,k,l,n,b);this.TestInstanceSegment(a,n,b,c,d)}TestInstancePoly(a, b,c,d){d=d.pointsArr();for(let e=0,g=d.length;e<g;e+=2){const k=(e+2)%g;this.TestInstanceSegment(a,d[e]+b,d[e+1]+c,d[k]+b,d[k+1]+c)}}};"use strict"; const C3$jscomp$177=self.C3,VALID_FULLSCREEN_MODES=new Set("off crop scale-inner scale-outer letterbox-scale letterbox-integer-scale".split(" ")),VALID_FULLSCREEN_SCALING_QUALITIES=new Set(["high","low"]),glMatrix$jscomp$11=self.glMatrix,mat4$jscomp$10=glMatrix$jscomp$11.mat4,tempProjection=mat4$jscomp$10.create(),tempQuad$jscomp$5=C3$jscomp$177.New(C3$jscomp$177.Quad),tempRect$jscomp$8=C3$jscomp$177.New(C3$jscomp$177.Rect); C3$jscomp$177.CanvasManager=class extends C3$jscomp$177.DefendedBase{constructor(a){super();this._runtime=a;this._canvas=null;this._isWebGPUEnabled=!1;this._webgpuRenderer=this._webglRenderer=null;this._gpuPreference="high-performance";this._isLimitedToWebGL1=!1;this._canvasCssOffsetY=this._canvasCssOffsetX=this._canvasDeviceHeight=this._canvasDeviceWidth=this._canvasCssHeight=this._canvasCssWidth=this._windowInnerHeight=this._windowInnerWidth=0;this._zAxisScale="normalized";this._fieldOfView=0;this._zNear= 1;this._zFar=1E4;this._enableMipmaps=!0;this._drawHeight=this._drawWidth=this._textureAnisotropy=0;this._documentFullscreenMode=this._fullscreenMode="letterbox-scale";this._deviceTransformOffY=this._deviceTransformOffX=0;this._defaultProjectionMatrix=mat4$jscomp$10.create();this._fullscreenScalingQuality=this._wantFullscreenScalingQuality="high";this._isDocumentFullscreen=!1;this._availableAdditionalRenderTargets=[];this._usedAdditionalRenderTargets=new Set;this._shaderData=self.C3_Shaders;this._effectChainManager= C3$jscomp$177.New(C3$jscomp$177.Gfx.EffectChainManager,{getDrawSize:()=>[this.GetDrawWidth(),this.GetDrawHeight()],getRenderTarget:()=>this.GetEffectCompositorRenderTarget(),releaseRenderTarget:b=>this.ReleaseEffectCompositorRenderTarget(b),getTime:()=>this.GetRuntime().GetGameTime(),redraw:()=>this.GetRuntime().UpdateRender()});this._gpuTimeEndFrame=this._gpuTimeStartFrame=0;this._gpuLastUtilisation=NaN;this._gpuFrameTimingsBuffer=null;this._layersGpuProfile=new Map;this._gpuCurUtilisation=NaN;this._webgpuFrameTimings= new Map;this._snapshotFormat="";this._snapshotQuality=1;this._snapshotArea=C3$jscomp$177.New(C3$jscomp$177.Rect);this._snapshotUrl="";this._snapshotResolve=this._snapshotPromise=null;this._loaderStartTime=this._isPastingToDrawingCanvas=0;this._rafId=-1;this._loadingProgress=0;this._loadingprogress_handler=b=>this._loadingProgress=b.progress;this._percentText=null;this._splashTextures={logo:null,powered:null,website:null};this._splashFadeOutStartTime=this._splashFadeInFinishTime=this._splashFrameNumber= 0;this._splashState="fade-in";this._splashDoneResolve=null;this._splashDonePromise=new Promise(b=>this._splashDoneResolve=b)}_SetGPUPowerPreference(a){this._gpuPreference=a}_SetWebGPUEnabled(a){this._isWebGPUEnabled=!!a}_SetZAxisScale(a){this._zAxisScale=a}_SetFieldOfView(a){this._fieldOfView=a}_SetZDistances(a,b){this._zNear=a;this._zFar=b}_SetLimitedToWebGL1(a){this._isLimitedToWebGL1=!!a}async CreateCanvas(a){this._canvas=a.canvas;this._runtime.AddDOMComponentMessageHandler("runtime","window-resize", d=>this._OnWindowResize(d));this._runtime.AddDOMComponentMessageHandler("runtime","fullscreenchange",d=>this._OnFullscreenChange(d));this._runtime.AddDOMComponentMessageHandler("runtime","fullscreenerror",d=>this._OnFullscreenError(d));this._canvas.addEventListener("webglcontextlost",d=>this._OnWebGLContextLost(d));this._canvas.addEventListener("webglcontextrestored",d=>this._OnWebGLContextRestored(d));this._isDocumentFullscreen=!!a.isFullscreen;var b=navigator.gpu&&this._isWebGPUEnabled;let c=!1; if(b)try{await this._InitWebGPUContext(!0)}catch(d){this._MaybeLogRendererError("WebGPU",d),this._webgpuRenderer=null}if(!this.GetRenderer())try{await this._InitWebGLContext(!0)}catch(d){this._MaybeLogRendererError("WebGL",d),this._webglRenderer=null}this.GetRenderer()||(c=!0);if(!this.GetRenderer()&&b)try{await this._InitWebGPUContext(!1)}catch(d){this._MaybeLogRendererError("WebGPU",d),this._webgpuRenderer=null}if(!this.GetRenderer())try{await this._InitWebGLContext(!1)}catch(d){this._MaybeLogRendererError("WebGL", d),this._webglRenderer=null}b=this.GetRenderer();if(!b)throw Error("failed to acquire a renderer - check WebGL or WebGPU is supported");b.SetHasMajorPerformanceCaveat(c);this._webgpuRenderer&&(this._webgpuRenderer.ondevicelost=()=>this._OnWebGPUDeviceLost(),this._webgpuRenderer.ondevicerestored=()=>this._OnWebGPUDeviceRestored());"normalized"===this._zAxisScale?b.SetZAxisScaleNormalized():(b.SetZAxisScaleRegular(),b.SetFovY(this._fieldOfView));this.SetSize(a.windowInnerWidth,a.windowInnerHeight,!0); await this._InitRenderer()}_MaybeLogRendererError(a,b){b&&"string"===typeof b.message&&b.message.startsWith("renderer-unavailable")||console.error(`Error creating ${a} renderer: `,b)}async _InitWebGPUContext(a){a={powerPreference:this._gpuPreference,depth:this._runtime.Uses3DFeatures(),failIfMajorPerformanceCaveat:a,usesBackgroundBlending:this._runtime.UsesAnyBackgroundBlending(),canSampleBackbuffer:this._runtime.UsesAnyCrossSampling(),canSampleDepth:this._runtime.UsesAnyDepthSampling(),nearZ:this._zNear, farZ:this._zFar};this._webgpuRenderer=C3$jscomp$177.New(C3$jscomp$177.Gfx.WebGPURenderer);await this._webgpuRenderer.Create(this._canvas,a)}async _InitWebGLContext(a){a={powerPreference:this._gpuPreference,enableGpuProfiling:!0,depth:this._runtime.Uses3DFeatures(),canSampleDepth:this._runtime.UsesAnyDepthSampling(),failIfMajorPerformanceCaveat:a,nearZ:this._zNear,farZ:this._zFar};this._isLimitedToWebGL1&&(a.maxWebGLVersion=1);"Android"===C3$jscomp$177.Platform.OS&&"Chromium"===C3$jscomp$177.Platform.BrowserEngine&& 75>C3$jscomp$177.Platform.BrowserVersionNumber&&(console.warn("[Construct] Disabling WebGL 2 because this device appears to be affected by crbug.com/934823. Install software updates to avoid this."),a.maxWebGLVersion=1);"standard"===this._runtime.GetCompositingMode()?a.alpha=!0:(a.alpha=!1,a.lowLatency=!0);this._webglRenderer=C3$jscomp$177.New(C3$jscomp$177.Gfx.WebGLRenderer,this._canvas,a);await this._webglRenderer.InitState()}async _InitWebGPU(){if(this._shaderData){const a=[];for(const [b,c]of Object.entries(this._shaderData)){c.src= c.wgsl;const d=C3$jscomp$177.Gfx.WebGPUShaderProgram.GetDefaultVertexShaderSource();a.push(this._webgpuRenderer.CreateShaderProgram(Object.assign({vertexSrc:d,name:b},c)))}await Promise.all(a)}}async _InitWebGL(){if(this._shaderData){const a=[];for(const [b,c]of Object.entries(this._shaderData)){let d;if(c.glslWebGL2&&2<=this._webglRenderer.GetWebGLVersionNumber())c.src=c.glslWebGL2,d=C3$jscomp$177.Gfx.WebGLShaderProgram.GetDefaultVertexShaderSource_WebGL2();else{if(!c.glsl)throw Error(`shader '${b}' does not support WebGL 1`); c.src=c.glsl;d=C3$jscomp$177.Gfx.WebGLShaderProgram.GetDefaultVertexShaderSource()}a.push(this._webglRenderer.CreateShaderProgram(Object.assign({vertexSrc:d,name:b},c)))}await Promise.all(a);this._webglRenderer.ResetLastProgram();this._webglRenderer.SetTextureFillMode()}this._webglRenderer.SupportsGPUProfiling()&&(this._gpuFrameTimingsBuffer=C3$jscomp$177.New(C3$jscomp$177.Gfx.WebGLQueryResultBuffer,this._webglRenderer))}async _InitRenderer(){this._webgpuRenderer?await this._InitWebGPU():this._webglRenderer&& await this._InitWebGL();const a=this.GetRenderer();a.SetMipmapsEnabled(this._enableMipmaps);a.SupportsGPUProfiling()&&(this._gpuLastUtilisation=0);for(const b of this._runtime._GetAllEffectLists()){for(const c of b.GetAllEffectTypes())c._InitRenderer(a);b._InitRenderer(a);b.UpdateActiveEffects()}}Release(){this._canvas=this._webglRenderer=this._runtime=null}_OnWindowResize(a){const b=this._runtime;if(!b.IsExportToVideo()){var c=a.devicePixelRatio;b.IsInWorker()&&(self.devicePixelRatio=c);b._SetDevicePixelRatio(c); this._isDocumentFullscreen=!!a.isFullscreen;this.SetSize(a.innerWidth,a.innerHeight);b.UpdateRender();c=new C3$jscomp$177.Event("window-resize");c.data=a;b.Dispatcher().dispatchEventAndWaitAsyncSequential(c);a=new C3$jscomp$177.Event("resize");a.cssWidth=this.GetCssWidth();a.cssHeight=this.GetCssHeight();a.deviceWidth=this.GetDeviceWidth();a.deviceHeight=this.GetDeviceHeight();b.DispatchUserScriptEvent(a);b.IsDebug()&&(b.HitBreakpoint()||self.C3Debugger.IsDebuggerPaused())&&b.Render()}}_OnFullscreenChange(a){this._isDocumentFullscreen= !!a.isFullscreen;this.SetSize(a.innerWidth,a.innerHeight,!0);this._runtime.UpdateRender()}_OnFullscreenError(a){this._isDocumentFullscreen=!!a.isFullscreen;this.SetSize(a.innerWidth,a.innerHeight,!0);this._runtime.UpdateRender()}SetSize(a,b,c=!1){a=Math.floor(a);b=Math.floor(b);if(0>=a||0>=b)throw Error("invalid size");if(this._windowInnerWidth!==a||this._windowInnerHeight!==b||c){this._windowInnerWidth=a;this._windowInnerHeight=b;c=this.GetCurrentFullscreenMode();"letterbox-scale"===c?this._CalculateLetterboxScale(a, b):"letterbox-integer-scale"===c?this._CalculateLetterboxIntegerScale(a,b):"off"===c?this._CalculateFixedSizeCanvas(a,b):this._CalculateFullsizeCanvas(a,b);this._UpdateFullscreenScalingQuality(c);this._canvas.width=this._canvasDeviceWidth;this._canvas.height=this._canvasDeviceHeight;this._runtime.PostComponentMessageToDOM("canvas","update-size",{marginLeft:this._canvasCssOffsetX,marginTop:this._canvasCssOffsetY,styleWidth:this._canvasCssWidth,styleHeight:this._canvasCssHeight,displayScale:this.GetDisplayScale()}); a=this.GetRenderer();a.SetSize(this._canvasDeviceWidth,this._canvasDeviceHeight,!0);for(var d of this._availableAdditionalRenderTargets)a.DeleteRenderTarget(d);C3$jscomp$177.clearArray(this._availableAdditionalRenderTargets);a.CalculatePerspectiveMatrix(this._defaultProjectionMatrix,this.GetDrawWidth()/this.GetDrawHeight());d=this._runtime.GetLayoutManager();d.SetAllLayerProjectionChanged();d.SetAllLayerMVChanged()}}GetDefaultProjectionMatrix(){return this._defaultProjectionMatrix}_CalculateLetterboxScale(a, b){const c=this._runtime.GetDevicePixelRatio(),d=this._runtime.GetOriginalViewportWidth(),e=this._runtime.GetOriginalViewportHeight(),g=d/e;a/b>g?(this._canvasCssWidth=Math.round(b*g),this._canvasCssHeight=b,this._canvasCssOffsetX=Math.floor((a-this._canvasCssWidth)/2),this._canvasCssOffsetY=0):(this._canvasCssWidth=a,this._canvasCssHeight=Math.round(a/g),this._canvasCssOffsetX=0,this._canvasCssOffsetY=Math.floor((b-this._canvasCssHeight)/2));this._canvasDeviceWidth=Math.round(this._canvasCssWidth* c);this._canvasDeviceHeight=Math.round(this._canvasCssHeight*c);this._runtime.SetViewportSize(d,e)}_CalculateLetterboxIntegerScale(a,b){const c=this._runtime.GetDevicePixelRatio();1!==c&&(a+=1,b+=1);const d=this._runtime.GetOriginalViewportWidth(),e=this._runtime.GetOriginalViewportHeight();var g=d/e;g=a/b>g?b*g*c/d:a/g*c/e;1<g?g=Math.floor(g):1>g&&(g=1/Math.ceil(1/g));this._canvasDeviceWidth=Math.round(d*g);this._canvasDeviceHeight=Math.round(e*g);this._canvasCssWidth=this._canvasDeviceWidth/c;this._canvasCssHeight= this._canvasDeviceHeight/c;this._canvasCssOffsetX=Math.max(Math.floor((a-this._canvasCssWidth)/2),0);this._canvasCssOffsetY=Math.max(Math.floor((b-this._canvasCssHeight)/2),0);this._runtime.SetViewportSize(d,e)}_CalculateFullsizeCanvas(a,b){const c=this._runtime.GetDevicePixelRatio();this._canvasCssWidth=a;this._canvasCssHeight=b;this._canvasDeviceWidth=Math.round(this._canvasCssWidth*c);this._canvasDeviceHeight=Math.round(this._canvasCssHeight*c);this._canvasCssOffsetY=this._canvasCssOffsetX=0;a= this.GetDisplayScale();this._runtime.SetViewportSize(this._canvasCssWidth/a,this._canvasCssHeight/a)}_CalculateFixedSizeCanvas(a,b){const c=this._runtime.GetDevicePixelRatio();this._canvasCssWidth=this._runtime.GetViewportWidth();this._canvasCssHeight=this._runtime.GetViewportHeight();this._canvasDeviceWidth=Math.round(this._canvasCssWidth*c);this._canvasDeviceHeight=Math.round(this._canvasCssHeight*c);this.IsDocumentFullscreen()?(this._canvasCssOffsetX=Math.floor((a-this._canvasCssWidth)/2),this._canvasCssOffsetY= Math.floor((b-this._canvasCssHeight)/2)):this._canvasCssOffsetY=this._canvasCssOffsetX=0;this._runtime.SetViewportSize(this._runtime.GetViewportWidth(),this._runtime.GetViewportHeight())}_UpdateFullscreenScalingQuality(a){if("high"===this._wantFullscreenScalingQuality)this._drawWidth=this._canvasDeviceWidth,this._drawHeight=this._canvasDeviceHeight,this._fullscreenScalingQuality="high";else{let c;if("off"===this.GetCurrentFullscreenMode()){var b=this._runtime.GetViewportWidth();c=this._runtime.GetViewportHeight()}else b= this._runtime.GetOriginalViewportWidth(),c=this._runtime.GetOriginalViewportHeight();this._canvasDeviceWidth<b||this._canvasDeviceHeight<c?(this._drawWidth=this._canvasDeviceWidth,this._drawHeight=this._canvasDeviceHeight,this._fullscreenScalingQuality="high"):(this._drawWidth=b,this._drawHeight=c,this._fullscreenScalingQuality="low","scale-inner"===a?(a=b/c,b=this._windowInnerWidth/this._windowInnerHeight,b<a?this._drawWidth=this._drawHeight*b:b>a&&(this._drawHeight=this._drawWidth/b)):"scale-outer"=== a&&(a=b/c,b=this._windowInnerWidth/this._windowInnerHeight,b>a?this._drawWidth=this._drawHeight*b:b<a&&(this._drawHeight=this._drawWidth/b)))}}GetRuntime(){return this._runtime}GetCanvas(){return this._canvas}GetEffectChainManager(){return this._effectChainManager}IsDocumentFullscreen(){return this._isDocumentFullscreen}SetFullscreenMode(a){if(!VALID_FULLSCREEN_MODES.has(a))throw Error("invalid fullscreen mode");this._fullscreenMode=a;a=this._runtime.GetLayoutManager();a.SetAllLayerProjectionChanged(); a.SetAllLayerMVChanged()}GetFullscreenMode(){return this._fullscreenMode}SetDocumentFullscreenMode(a){if(!VALID_FULLSCREEN_MODES.has(a))throw Error("invalid fullscreen mode");this._documentFullscreenMode=a;a=this._runtime.GetLayoutManager();a.SetAllLayerProjectionChanged();a.SetAllLayerMVChanged()}GetDocumentFullscreenMode(){return this._documentFullscreenMode}GetCurrentFullscreenMode(){return this.IsDocumentFullscreen()?this.GetDocumentFullscreenMode():this.GetFullscreenMode()}SetFullscreenScalingQuality(a){if(!VALID_FULLSCREEN_SCALING_QUALITIES.has(a))throw Error("invalid fullscreen scaling quality"); this._wantFullscreenScalingQuality=a;this._runtime.GetLayoutManager().SetAllLayerProjectionChanged()}GetSetFullscreenScalingQuality(){return this._wantFullscreenScalingQuality}GetCurrentFullscreenScalingQuality(){return this._fullscreenScalingQuality}static _FullscreenModeNumberToString(a){switch(a){case 0:return"off";case 1:return"crop";case 2:return"scale-inner";case 3:return"scale-outer";case 4:return"letterbox-scale";case 5:return"letterbox-integer-scale";default:throw Error("invalid fullscreen mode"); }}GetLastWidth(){return this._windowInnerWidth}GetLastHeight(){return this._windowInnerHeight}GetDrawWidth(){return this._drawWidth}GetDrawHeight(){return this._drawHeight}SetMipmapsEnabled(a){this._enableMipmaps=!!a}_SetTextureAnisotropy(a){this._textureAnisotropy=a}GetTextureAnisotropy(){return this._textureAnisotropy}IsRendererContextLost(){return this.GetRenderer().IsContextLost()}_OnWebGLContextLost(a){console.log("[Construct] WebGL context lost");a.preventDefault();this._availableAdditionalRenderTargets= [];this._usedAdditionalRenderTargets.clear();this._effectChainManager.OnContextLost();this._webglRenderer.OnContextLost();this._runtime._OnRendererContextLost()}_OnWebGPUDeviceLost(){console.log("[Construct] WebGPU device lost");this._availableAdditionalRenderTargets=[];this._usedAdditionalRenderTargets.clear();this._effectChainManager.OnContextLost();this._runtime._OnRendererContextLost()}async _OnWebGLContextRestored(a){await this._webglRenderer.OnContextRestored();await this._InitRenderer();await this._runtime._OnRendererContextRestored(); console.log("[Construct] WebGL context restored")}async _OnWebGPUDeviceRestored(){await this._InitRenderer();await this._runtime._OnRendererContextRestored();console.log("[Construct] WebGPU device restored")}GetWebGLRenderer(){return this._webglRenderer}GetWebGPURenderer(){return this._webgpuRenderer}GetRenderer(){return this._webgpuRenderer||this._webglRenderer}GetRenderScale(){return"low"===this._fullscreenScalingQuality?1/this._runtime.GetDevicePixelRatio():this.GetDisplayScale()}GetDisplayScale(){const a= this.GetCurrentFullscreenMode();if("off"===a||"crop"===a)return 1;const b=this._runtime.GetOriginalViewportWidth(),c=this._runtime.GetOriginalViewportHeight(),d=b/c,e=this._canvasDeviceWidth/this._canvasDeviceHeight;return"scale-inner"!==a&&e>d||"scale-inner"===a&&e<d?this._canvasCssHeight/c:this._canvasCssWidth/b}GetEffectLayerScaleParam(){return"low"===this.GetCurrentFullscreenScalingQuality()?1:this.GetDisplayScale()}GetEffectDevicePixelRatioParam(){return"low"===this.GetCurrentFullscreenScalingQuality()? 1:this._runtime.GetDevicePixelRatio()}SetDeviceTransformOffset(a,b){this._deviceTransformOffX=a;this._deviceTransformOffY=b}SetDeviceTransform(a,b,c,d=!0){b=b||this._drawWidth;c=c||this._drawHeight;const e=b/2+this._deviceTransformOffX,g=c/2+this._deviceTransformOffY;if(d){d=this.GetDefaultProjectionMatrix();if(b!==this._drawWidth||c!==this._drawHeight)a.CalculatePerspectiveMatrix(tempProjection,b/c),d=tempProjection;a.SetProjectionMatrix(d)}b=a.CalculateLookAtModelView2(e,g,a.GetDefaultCameraZ(c), e,g,0,c);a.SetModelViewMatrix(b)}SetCssTransform(a,b=!0){var c=this.GetCssWidth();const d=this.GetCssHeight();c/=2;const e=d/2;b&&a.SetProjectionMatrix(this.GetDefaultProjectionMatrix());b=a.CalculateLookAtModelView2(c,e,a.GetDefaultCameraZ(d),c,e,0,d);a.SetModelViewMatrix(b)}GetDeviceWidth(){return this._canvasDeviceWidth}GetDeviceHeight(){return this._canvasDeviceHeight}GetCssWidth(){return this._canvasCssWidth}GetCssHeight(){return this._canvasCssHeight}GetCanvasClientX(){return this._canvasCssOffsetX}GetCanvasClientY(){return this._canvasCssOffsetY}GetAdditionalRenderTarget(a){a.depth= this._runtime.Uses3DFeatures();const b=this._availableAdditionalRenderTargets,c=b.findIndex(e=>e.IsCompatibleWithOptions(a));let d;-1!==c?(d=b[c],b.splice(c,1)):d=this.GetRenderer().CreateRenderTarget(a);this._usedAdditionalRenderTargets.add(d);return d}ReleaseAdditionalRenderTarget(a){if(!this._usedAdditionalRenderTargets.has(a))throw Error("render target not in use");this._usedAdditionalRenderTargets.delete(a);this._availableAdditionalRenderTargets.push(a)}GetEffectCompositorRenderTarget(){const a= {sampling:this._runtime.GetSampling()};"low"===this.GetCurrentFullscreenScalingQuality()&&(a.width=this.GetDrawWidth(),a.height=this.GetDrawHeight());return this.GetAdditionalRenderTarget(a)}ReleaseEffectCompositorRenderTarget(a){this.ReleaseAdditionalRenderTarget(a)}*activeLayersGpuProfiles(){for(const a of this._runtime.GetLayoutManager().runningLayouts())for(const b of a.GetLayers()){const c=this._layersGpuProfile.get(b);c&&(yield c)}}GetLayerTimingsBuffer(a){if(!this.GetRenderer().SupportsGPUProfiling())return null; let b=this._layersGpuProfile.get(a);b||(b={name:a.GetName(),timingsBuffer:C3$jscomp$177.New(C3$jscomp$177.Gfx.WebGLQueryResultBuffer,this._webglRenderer),curUtilisation:0,lastUtilisation:0},this._layersGpuProfile.set(a,b));return b.timingsBuffer}_Update1sFrameRange(){const a=this.GetRenderer();if(a.SupportsGPUProfiling()&&0===this._gpuTimeEndFrame){this._gpuTimeEndFrame=a.GetFrameNumber();this._gpuCurUtilisation=NaN;for(const b of this.activeLayersGpuProfiles())b.curUtilisation=NaN}}_UpdateTick(){this._webglRenderer&& this._webglRenderer.SupportsGPUProfiling()&&this._UpdateTick_WebGL();this._webgpuRenderer&&this._webgpuRenderer.SupportsGPUProfiling()&&this._UpdateTick_WebGPU()}_UpdateTick_WebGL(){if(isNaN(this._gpuCurUtilisation)&&(this._gpuCurUtilisation=this._gpuFrameTimingsBuffer.GetFrameRangeResultSum(this._gpuTimeStartFrame,this._gpuTimeEndFrame),!isNaN(this._gpuCurUtilisation))){if(this._runtime.IsDebug())for(const a of this.activeLayersGpuProfiles())if(a.curUtilisation=a.timingsBuffer.GetFrameRangeResultSum(this._gpuTimeStartFrame, this._gpuTimeEndFrame),isNaN(a.curUtilisation))return;this._gpuFrameTimingsBuffer.DeleteAllBeforeFrameNumber(this._gpuTimeEndFrame);this._gpuLastUtilisation=Math.min(this._gpuCurUtilisation,1);if(this._runtime.IsDebug()){for(const a of this.activeLayersGpuProfiles())a.timingsBuffer.DeleteAllBeforeFrameNumber(this._gpuTimeEndFrame),a.lastUtilisation=Math.min(a.curUtilisation,1);self.C3Debugger.UpdateGPUProfile(this._gpuLastUtilisation,[...this.activeLayersGpuProfiles()])}this._gpuTimeStartFrame=this._gpuTimeEndFrame; this._gpuTimeEndFrame=0}}GetGPUFrameTimingsBuffer(){return this._gpuFrameTimingsBuffer}_UpdateTick_WebGPU(){if(0!==this._gpuTimeEndFrame){for(var a=this._gpuTimeStartFrame;a<this._gpuTimeEndFrame;++a){var b=this._webgpuFrameTimings.get(a);if(b&&!b.HasResult())return}b=this._runtime.GetMainRunningLayout();a=C3$jscomp$177.MakeFilledArray(b.GetLayerCount()+1,0);for(var c=this._gpuTimeStartFrame;c<this._gpuTimeEndFrame;++c){var d=this._webgpuFrameTimings.get(c);if(d){d=d.GetResult();for(let e=0,g=Math.min(a.length, d.length/2);e<g;++e){const k=d[2*e],l=d[2*e+1];a[e]=0===Number(k)||0===Number(l)?NaN:a[e]+Number(l-k)/1E9}}}this._gpuLastUtilisation=C3$jscomp$177.clamp(a[0],0,1);if(this._runtime.IsDebug()){c=[];b=b.GetLayers();for(let e=0,g=Math.min(b.length,a.length-1);e<g;++e)c.push({name:b[e].GetName(),lastUtilisation:C3$jscomp$177.clamp(a[e+1],0,1)});self.C3Debugger.UpdateGPUProfile(this._gpuLastUtilisation,c)}for(a=this._gpuTimeStartFrame;a<this._gpuTimeEndFrame;++a)this._webgpuFrameTimings.delete(a);this._gpuTimeStartFrame= this._gpuTimeEndFrame;this._gpuTimeEndFrame=0}}_AddWebGPUFrameTiming(a){this._webgpuFrameTimings.set(this._webgpuRenderer.GetFrameNumber(),a)}GetGPUUtilisation(){return this._gpuLastUtilisation}SnapshotCanvas(a,b,c,d,e,g){this._snapshotFormat=a;this._snapshotQuality=b;this._snapshotArea.setWH(c,d,e,g);return this._snapshotPromise?this._snapshotPromise:this._snapshotPromise=new Promise(k=>{this._snapshotResolve=k})}_MaybeTakeSnapshot(){if(this._snapshotFormat){var a=this._canvas,b=this._snapshotArea, c=C3$jscomp$177.clamp(Math.floor(b.getLeft()),0,a.width),d=C3$jscomp$177.clamp(Math.floor(b.getTop()),0,a.height),e=b.width();e=0===e?a.width-c:C3$jscomp$177.clamp(Math.floor(e),0,a.width-c);b=b.height();b=0===b?a.height-d:C3$jscomp$177.clamp(Math.floor(b),0,a.height-d);(0!==c||0!==d||e!==a.width||b!==a.height)&&0<e&&0<b&&(a=C3$jscomp$177.CreateCanvas(e,b),a.getContext("2d").drawImage(this._canvas,c,d,e,b,0,0,e,b));C3$jscomp$177.CanvasToBlob(a,this._snapshotFormat,this._snapshotQuality).then(g=>{this._snapshotUrl&& URL.revokeObjectURL(this._snapshotUrl);this._snapshotUrl=URL.createObjectURL(g);this._snapshotPromise=null;this._snapshotResolve(this._snapshotUrl)});this._snapshotFormat="";this._snapshotQuality=1}}GetCanvasSnapshotUrl(){return this._snapshotUrl}SetIsPastingToDrawingCanvas(a){a?this._isPastingToDrawingCanvas++:this._isPastingToDrawingCanvas--}IsPastingToDrawingCanvas(){return 0<this._isPastingToDrawingCanvas}InitLoadingScreen(a){const b=this.GetRenderer();2===a?(this._percentText=C3$jscomp$177.New(C3$jscomp$177.Gfx.RendererText, this.GetRenderer()),this._percentText.SetFontName("Arial"),this._percentText.SetFontSize(16),this._percentText.SetHorizontalAlignment("center"),this._percentText.SetVerticalAlignment("center"),this._percentText.SetSize(300,200)):0===a?(a=this._runtime.GetLoadingLogoAsset())&&a.LoadStaticTexture(b).catch(c=>console.warn("[C3 runtime] Failed to create texture for loading logo: ",c)):4===a&&(this._LoadSvgSplashImage("splash-images/splash-logo.svg").then(c=>{"done"===this._splashState?b.DeleteTexture(c): this._splashTextures.logo=c}).catch(c=>console.warn("Failed to load splash image: ",c)),this._LoadBitmapSplashImage("splash-images/splash-poweredby-512.png").then(c=>{"done"===this._splashState?b.DeleteTexture(c):this._splashTextures.powered=c}).catch(c=>console.warn("Failed to load splash image: ",c)),this._LoadBitmapSplashImage("splash-images/splash-website-512.png").then(c=>{"done"===this._splashState?b.DeleteTexture(c):this._splashTextures.website=c}).catch(c=>console.warn("Failed to load splash image: ", c)))}async _LoadSvgSplashImage(a){a=(new URL(a,this._runtime.GetRuntimeBaseURL())).toString();a=await C3$jscomp$177.FetchBlob(a);a=await this._runtime.RasterSvgImage(a,2048,2048);return await this.GetRenderer().CreateStaticTextureAsync(a,{mipMapQuality:"high"})}async _LoadBitmapSplashImage(a){a=(new URL(a,this._runtime.GetRuntimeBaseURL())).toString();a=await C3$jscomp$177.FetchBlob(a);return await this.GetRenderer().CreateStaticTextureAsync(a,{mipMapQuality:"high"})}HideCordovaSplashScreen(){this._runtime.PostComponentMessageToDOM("runtime", "hide-cordova-splash")}StartLoadingScreen(){this._loaderStartTime=Date.now();this._runtime.Dispatcher().addEventListener("loadingprogress",this._loadingprogress_handler);this._rafId=requestAnimationFrame(()=>this._DrawLoadingScreen());3!==this._runtime.GetLoaderStyle()&&this.HideCordovaSplashScreen()}async EndLoadingScreen(){const a=this.GetRenderer();this._loadingProgress=1;const b=this._runtime.GetLoaderStyle();4===b&&await this._splashDonePromise;this._splashDonePromise=this._splashDoneResolve= null;-1!==this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=-1);this._runtime.Dispatcher().removeEventListener("loadingprogress",this._loadingprogress_handler);this._loadingprogress_handler=null;this._percentText&&(this._percentText.Release(),this._percentText=null);this._runtime.ReleaseLoadingLogoAsset();a.Start();this._splashTextures.logo&&(a.DeleteTexture(this._splashTextures.logo),this._splashTextures.logo=null);this._splashTextures.powered&&(a.DeleteTexture(this._splashTextures.powered), this._splashTextures.powered=null);this._splashTextures.website&&(a.DeleteTexture(this._splashTextures.website),this._splashTextures.website=null);a.ClearRgba(0,0,0,0);a.Finish();this._splashState="done";this._gpuTimeStartFrame=a.GetFrameNumber();3===b&&this.HideCordovaSplashScreen()}_DrawLoadingScreen(){if(-1!==this._rafId){var a=this.GetRenderer();a.Start();this._rafId=-1;var b=this._runtime.GetAssetManager().HasHadErrorLoading(),c=this._runtime.GetLoaderStyle();3!==c&&(this.SetCssTransform(a), a.ClearRgba(0,0,0,0),a.ResetColor(),a.SetTextureFillMode(),a.SetTexture(null));if(0===c)this._DrawProgressBarAndLogoLoadingScreen(b);else if(1===c)this._DrawProgressBarLoadingScreen(b,120,0);else if(2===c)this._DrawPercentTextLoadingScreen(b);else if(3===c)C3$jscomp$177.noop();else if(4===c)this._DrawSplashLoadingScreen(b);else throw Error("invalid loader style");a.Finish();this._rafId=requestAnimationFrame(()=>this._DrawLoadingScreen())}}_DrawPercentTextLoadingScreen(a){a?this._percentText.SetColorRgb(1, 0,0):this._percentText.SetColorRgb(.6,.6,.6);this._percentText.SetText(Math.round(100*this._loadingProgress)+"%");a=this._canvasCssWidth/2;const b=this._canvasCssHeight/2;tempQuad$jscomp$5.setRect(a-150,b-100,a+150,b+100);a=this.GetRenderer();a.SetTexture(this._percentText.GetTexture());a.Quad3(tempQuad$jscomp$5,this._percentText.GetTexRect())}_DrawProgressBarLoadingScreen(a,b,c){const d=this.GetRenderer();d.SetColorFillMode();a?d.SetColorRgba(1,0,0,1):d.SetColorRgba(.118,.565,1,1);a=this._canvasCssWidth/ 2;const e=this._canvasCssHeight/2,g=b/2;tempRect$jscomp$8.setWH(a-g,e-4+c,Math.floor(b*this._loadingProgress),8);d.Rect(tempRect$jscomp$8);tempRect$jscomp$8.setWH(a-g,e-4+c,b,8);tempRect$jscomp$8.offset(-.5,-.5);tempRect$jscomp$8.inflate(.5,.5);d.SetColorRgba(0,0,0,1);d.LineRect2(tempRect$jscomp$8);tempRect$jscomp$8.inflate(1,1);d.SetColorRgba(1,1,1,1);d.LineRect2(tempRect$jscomp$8)}_DrawProgressBarAndLogoLoadingScreen(a){const b=this.GetRenderer();var c=this._runtime.GetLoadingLogoAsset();if(c)if(c= c.GetTexture()){var d=c.GetWidth(),e=c.GetHeight(),g=this._canvasCssWidth/2,k=this._canvasCssHeight/2,l=d/2;e/=2;tempQuad$jscomp$5.setRect(g-l,k-e,g+l,k+e);b.SetTexture(c);b.Quad(tempQuad$jscomp$5);this._DrawProgressBarLoadingScreen(a,d,e+16)}else this._DrawProgressBarLoadingScreen(a,120,0);else this._DrawProgressBarLoadingScreen(a,120,0)}_DrawSplashLoadingScreen(a){const b=this.GetRenderer(),c=this._splashTextures.logo,d=this._splashTextures.powered,e=this._splashTextures.website,g=Date.now();0=== this._splashFrameNumber&&(this._loaderStartTime=g);const k=this._runtime.IsPreview()||this._runtime.IsFBInstantAvailable()&&!this._runtime.IsCordova(),l=k?0:200,n=k?0:3E3;let p=1;"fade-in"===this._splashState?p=Math.min((g-this._loaderStartTime)/300,1):"fade-out"===this._splashState&&(p=Math.max(1-(g-this._splashFadeOutStartTime)/300,0));b.SetColorFillMode();b.SetColorRgba(.231*p,.251*p,.271*p,p);tempRect$jscomp$8.set(0,0,this._canvasCssWidth,this._canvasCssHeight);b.Rect(tempRect$jscomp$8);const r= Math.ceil(this._canvasCssWidth),w=Math.ceil(this._canvasCssHeight);let y;256<this._canvasCssHeight?(b.SetColorRgba(.302*p,.334*p,.365*p,p),y=Math.max(.005*w,2),tempRect$jscomp$8.setWH(0,.8*w-y/2,r,y),b.Rect(tempRect$jscomp$8),a?b.SetColorRgba(p,0,0,p):b.SetColorRgba(.161*p,.953*p,.816*p,p),a=r*this._loadingProgress,tempRect$jscomp$8.setWH(.5*r-a/2,.8*w-y/2,a,y),b.Rect(tempRect$jscomp$8),b.SetColorRgba(p,p,p,p),b.SetTextureFillMode(),d&&(a=1.5*C3$jscomp$177.clamp(.22*w,105,.6*r),y=a/8,tempRect$jscomp$8.setWH(.5* r-a/2,.2*w-y/2,a,y),b.SetTexture(d),b.Rect(tempRect$jscomp$8)),c&&(y=a=Math.min(.395*w,.95*r),tempRect$jscomp$8.setWH(.5*r-a/2,.485*w-y/2,a,y),b.SetTexture(c),b.Rect(tempRect$jscomp$8)),e&&(a=1.5*C3$jscomp$177.clamp(.22*w,105,.6*r),y=a/8,tempRect$jscomp$8.setWH(.5*r-a/2,.868*w-y/2,a,y),b.SetTexture(e),b.Rect(tempRect$jscomp$8))):(b.SetColorRgba(.302*p,.334*p,.365*p,p),y=Math.max(.005*w,2),tempRect$jscomp$8.setWH(0,.85*w-y/2,r,y),b.Rect(tempRect$jscomp$8),a?b.SetColorRgba(p,0,0,p):b.SetColorRgba(.161* p,.953*p,.816*p,p),a=r*this._loadingProgress,tempRect$jscomp$8.setWH(.5*r-a/2,.85*w-y/2,a,y),b.Rect(tempRect$jscomp$8),b.SetColorRgba(p,p,p,p),b.SetTextureFillMode(),c&&(y=a=.55*w,tempRect$jscomp$8.setWH(.5*r-a/2,.45*w-y/2,a,y),b.SetTexture(c),b.Rect(tempRect$jscomp$8)));this._splashFrameNumber++;"fade-in"===this._splashState&&300<=g-this._loaderStartTime&&2<=this._splashFrameNumber&&(this._splashState="wait",this._splashFadeInFinishTime=g);"wait"===this._splashState&&g-this._splashFadeInFinishTime>= n&&1<=this._loadingProgress&&(this._splashState="fade-out",this._splashFadeOutStartTime=g);("fade-out"===this._splashState&&g-this._splashFadeOutStartTime>=300+l||k&&1<=this._loadingProgress&&500>g-this._loaderStartTime)&&this._splashDoneResolve()}};"use strict";const C3$jscomp$178=self.C3,C3Debugger$jscomp$3=self.C3Debugger,DEFAULT_RUNTIME_OPTS={messagePort:null,runtimeBaseUrl:"",headless:!1,hasDom:!0,isInWorker:!1,useAudio:!0,projectData:"",exportType:""};let ife=!0; C3$jscomp$178.Runtime=class extends C3$jscomp$178.DefendedBase{constructor(a){a=Object.assign({},DEFAULT_RUNTIME_OPTS,a);super();this._messagePort=a.messagePort;this._runtimeBaseUrl=a.runtimeBaseUrl;this._previewUrl=a.previewUrl;this._isHeadless=!!a.headless;this._hasDom=!!a.hasDom;this._isInWorker=!!a.isInWorker;ife=a.ife;this._useAudio=!!a.useAudio;this._exportType=a.exportType;this._isiOSCordova=!!a.isiOSCordova;this._isiOSWebView=!!a.isiOSWebView;this._isFBInstantAvailable=!!a.isFBInstantAvailable; this._opusWasmScriptUrl=a.opusWasmScriptUrl;this._opusWasmBinaryUrl=a.opusWasmBinaryUrl;this._isDebugging=this._breakpointsEnabled=this._isDebug=!("preview"!==this._exportType||!a.isDebug);this._debuggingDisabled=0;this._additionalLoadPromises=[];this._additionalCreatePromises=[];this._isUsingCreatePromises=!1;this._appId=this._projectUniqueId=this._projectVersion=this._projectName="";this._originalViewportHeight=this._originalViewportWidth=0;this._devicePixelRatio=self.devicePixelRatio;this._loaderStyle= this._viewportHeight=this._viewportWidth=this._parallaxYorigin=this._parallaxXorigin=0;this._usesLoaderLayout=!1;this._isLoading=!0;this._usesAnyDepthSampling=this._usesAnyCrossSampling=this._usesAnyBackgroundBlending=!1;this._loadingLogoAsset=null;this._assetManager=C3$jscomp$178.New(C3$jscomp$178.AssetManager,this,a);this._layoutManager=C3$jscomp$178.New(C3$jscomp$178.LayoutManager,this);this._eventSheetManager=C3$jscomp$178.New(C3$jscomp$178.EventSheetManager,this);this._pluginManager=C3$jscomp$178.New(C3$jscomp$178.PluginManager, this);this._collisionEngine=C3$jscomp$178.New(C3$jscomp$178.CollisionEngine,this);this._timelineManager=C3$jscomp$178.New(C3$jscomp$178.TimelineManager,this);this._transitionManager=C3$jscomp$178.New(C3$jscomp$178.TransitionManager,this);this._templateManager=C3$jscomp$178.New(C3$jscomp$178.TemplateManager,this);this._textIconManager=C3$jscomp$178.New(C3$jscomp$178.TextIconManager,{getIconSetMeta:b=>this._GetTextIconSetMeta(b),getIconSetContent:b=>this._GetTextIconSetContent(b)});this._allObjectClasses= [];this._objectClassesByName=new Map;this._objectClassesBySid=new Map;this._familyCount=0;this._allContainers=[];this._allEffectLists=[];this._currentLayoutStack=[];this._instancesPendingCreate=[];this._instancesPendingDestroy=new Map;this._isFlushingPendingInstances=this._hasPendingInstances=!1;this._nextUid=this._objectCount=0;this._instancesByUid=new Map;this._instancesToReleaseAtEndOfTick=new Set;this._instancesToReleaseAffectedObjectClasses=new Set;this._objectReferenceTable=[];this._jsPropNameTable= [];this._canvasManager=null;this._uses3dFeatures=!1;this._framerateMode="vsync";this._compositingMode="standard";this._sampling="trilinear";this._isPixelRoundingEnabled=!1;this._needRender=!0;this._isPausedOnBlur=this._pauseOnBlur=!1;this._exportToVideo=null;this._tickCallbacks={normal:b=>{this._ruafId=this._rafId=-1;this.Tick(b)},tickOnly:b=>{this._ruafId=-1;this.Tick(b,!1,"skip-render")},renderOnly:()=>{this._rafId=-1;this.Render()}};this._ruafId=this._rafId=-1;this._tickCountNoSave=this._tickCount= 0;this._hasStartedTicking=this._isInTick=this._hasStarted=!1;this._isLayoutFirstTick=!0;this._suspendCount=0;this._scheduleTriggersThrottle=new C3$jscomp$178.PromiseThrottle(1);this._randomNumberCallback=()=>Math.random();this._dt=this._dt1=this._dtRaw=this._lastTickTime=this._startTime=0;this._timeScale=1;this._minimumFramerate=30;this._gameTime=C3$jscomp$178.New(C3$jscomp$178.KahanSum);this._gameTimeRaw=C3$jscomp$178.New(C3$jscomp$178.KahanSum);this._wallTime=C3$jscomp$178.New(C3$jscomp$178.KahanSum); this._instanceTimes=new Map;this._fpsFrameCount=-1;this._mainThreadTime=this._mainThreadTimeCounter=this._fps=this._fpsLastTime=0;this._isLoadingState=!1;this._loadFromSlotName=this._saveToSlotName="";this._loadFromJson=null;this._lastSaveJson="";this._savegamesStorage=this._projectStorage=null;this._dispatcher=C3$jscomp$178.New(C3$jscomp$178.Event.Dispatcher);this._domEventHandlers=new Map;this._pendingResponsePromises=new Map;this._nextDomResponseId=0;this._isReadyToHandleEvents=this._didRequestDeviceMotionEvent= this._didRequestDeviceOrientationEvent=!1;this._waitingToHandleEvents=[];this._eventObjects={pretick:C3$jscomp$178.New(C3$jscomp$178.Event,"pretick",!1),tick:C3$jscomp$178.New(C3$jscomp$178.Event,"tick",!1),tick2:C3$jscomp$178.New(C3$jscomp$178.Event,"tick2",!1),instancedestroy:C3$jscomp$178.New(C3$jscomp$178.Event,"instancedestroy",!1),beforelayoutchange:C3$jscomp$178.New(C3$jscomp$178.Event,"beforelayoutchange",!1),layoutchange:C3$jscomp$178.New(C3$jscomp$178.Event,"layoutchange",!1)};this._eventObjects.instancedestroy.instance= null;this._userScriptDispatcher=C3$jscomp$178.New(C3$jscomp$178.Event.Dispatcher);this._userScriptEventObjects=null;this._behInstsToTick=C3$jscomp$178.New(C3$jscomp$178.RedBlackSet,C3$jscomp$178.BehaviorInstance.SortByTickSequence);this._behInstsToPostTick=C3$jscomp$178.New(C3$jscomp$178.RedBlackSet,C3$jscomp$178.BehaviorInstance.SortByTickSequence);this._behInstsToTick2=C3$jscomp$178.New(C3$jscomp$178.RedBlackSet,C3$jscomp$178.BehaviorInstance.SortByTickSequence);this._jobScheduler=C3$jscomp$178.New(C3$jscomp$178.JobSchedulerRuntime, this,a.jobScheduler);a.canvas&&(this._canvasManager=C3$jscomp$178.New(C3$jscomp$178.CanvasManager,this));this._messagePort.onmessage=b=>this._OnMessageFromDOM(b.data);this.AddDOMComponentMessageHandler("runtime","visibilitychange",b=>this._OnVisibilityChange(b));this.AddDOMComponentMessageHandler("runtime","opus-decode",b=>this._WasmDecodeWebMOpus(b.arrayBuffer));this.AddDOMComponentMessageHandler("runtime","get-remote-preview-status-info",()=>this._GetRemotePreviewStatusInfo());this.AddDOMComponentMessageHandler("runtime", "js-invoke-function",b=>this._InvokeFunctionFromJS(b));this.AddDOMComponentMessageHandler("runtime","go-to-last-error-script",self.goToLastErrorScript);this.AddDOMComponentMessageHandler("runtime","offline-audio-render-completed",b=>this._OnOfflineAudioRenderCompleted(b));this._dispatcher.addEventListener("window-blur",b=>this._OnWindowBlur(b));this._dispatcher.addEventListener("window-focus",()=>this._OnWindowFocus());this._timelineManager.AddRuntimeListeners();this._templateManager.AddRuntimeListeners(); this._iRuntime=null;this._interfaceMap=new WeakMap;this._commonScriptInterfaces={keyboard:null,mouse:null,touch:null}}static Create(a){return C3$jscomp$178.New(C3$jscomp$178.Runtime,a)}Release(){C3$jscomp$178.clearArray(this._allObjectClasses);this._objectClassesByName.clear();this._objectClassesBySid.clear();this._layoutManager.Release();this._layoutManager=null;this._eventSheetManager.Release();this._eventSheetManager=null;this._pluginManager.Release();this._pluginManager=null;this._assetManager.Release(); this._assetManager=null;this._collisionEngine.Release();this._collisionEngine=null;this._timelineManager.Release();this._timelineManager=null;this._transitionManager.Release();this._transitionManager=null;this._templateManager.Release();this._templateManager=null;this._textIconManager.Release();this._textIconManager=null;this._canvasManager&&(this._canvasManager.Release(),this._canvasManager=null);this._dispatcher.Release();this._tickEvent=this._dispatcher=null}_OnMessageFromDOM(a){const b=a.type; if("event"===b)this._OnEventFromDOM(a);else if("result"===b)this._OnResultFromDOM(a);else throw Error(`unknown message '${b}'`);}_OnEventFromDOM(a){if(this._isReadyToHandleEvents){var b=a.component,c=a.handler,d=a.data,e=a.dispatchOpts,g=!(!e||!e.dispatchRuntimeEvent);e=!(!e||!e.dispatchUserScriptEvent);var k=a.responseId;if("runtime"===b&&(g&&(a=new C3$jscomp$178.Event(c),a.data=d,this._dispatcher.dispatchEventAndWaitAsyncSequential(a)),e)){a=new C3$jscomp$178.Event(c,!0);for(const [l,n]of Object.entries(d))a[l]= n;this.DispatchUserScriptEvent(a)}if(a=this._domEventHandlers.get(b))if(a=a.get(c)){g=null;try{g=a(d)}catch(l){console.error(`Exception in '${b}' handler '${c}':`,l);null!==k&&this._PostResultToDOM(k,!1,""+l);return}null!==k&&(g&&g.then?g.then(l=>this._PostResultToDOM(k,!0,l)).catch(l=>{console.error(`Rejection from '${b}' handler '${c}':`,l);this._PostResultToDOM(k,!1,""+l)}):this._PostResultToDOM(k,!0,g))}else g||e||console.warn(`[Runtime] No DOM handler '${c}' for component '${b}'`);else g||e|| console.warn(`[Runtime] No DOM event handlers for component '${b}'`)}else this._waitingToHandleEvents.push(a)}_PostResultToDOM(a,b,c){this._messagePort.postMessage({type:"result",responseId:a,isOk:b,result:c})}_OnResultFromDOM(a){const b=a.responseId,c=a.isOk;a=a.result;const d=this._pendingResponsePromises.get(b);c?d.resolve(a):d.reject(a);this._pendingResponsePromises.delete(b)}AddDOMComponentMessageHandler(a,b,c){let d=this._domEventHandlers.get(a);d||(d=new Map,this._domEventHandlers.set(a,d)); if(d.has(b))throw Error(`[Runtime] Component '${a}' already has handler '${b}'`);d.set(b,c)}PostComponentMessageToDOM(a,b,c,d){this._messagePort.postMessage({type:"event",component:a,handler:b,data:c,responseId:null},d)}PostComponentMessageToDOMAsync(a,b,c,d){const e=this._nextDomResponseId++,g=new Promise((k,l)=>{this._pendingResponsePromises.set(e,{resolve:k,reject:l})});this._messagePort.postMessage({type:"event",component:a,handler:b,data:c,responseId:e},d);return g}PostToDebugger(a){if(!this.IsDebug())throw Error("not in debug mode"); this.PostComponentMessageToDOM("runtime","post-to-debugger",a)}async Init(a){this.IsDebug()?await C3Debugger$jscomp$3.Init(this):self.C3Debugger&&self.C3Debugger.InitPreview(this);var [b]=await Promise.all([this._assetManager.FetchJson("data.json"),this._MaybeLoadOpusDecoder(),this._jobScheduler.Init()]);await this._LoadDataJson(b);await this._InitialiseCanvas(a);this.IsPreview()||console.info("Made with Construct, the game and app creator :: https://www.construct.net");this.GetWebGLRenderer()?(b= this.GetWebGLRenderer(),console.info(`[C3 runtime] Hosted in ${this.IsInWorker()?"worker":"DOM"}, rendering with WebGL ${b.GetWebGLVersionNumber()} [${b.GetUnmaskedRenderer()}] (${b.IsDesynchronized()?"desynchronized":"standard"} compositing)`)):this.GetWebGPURenderer()&&console.info(`[C3 runtime] Hosted in ${this.IsInWorker()?"worker":"DOM"}, rendering with experimental WebGPU [${this.GetWebGPURenderer().GetBasicAdapterInfoString()}]`);this.GetRenderer().HasMajorPerformanceCaveat()&&console.warn("[C3 runtime] The renderer indicates a major performance caveat. Software rendering may be in use. This can result in significantly degraded performance."); this._isReadyToHandleEvents=!0;for(const c of this._waitingToHandleEvents)this._OnEventFromDOM(c);C3$jscomp$178.clearArray(this._waitingToHandleEvents);this._canvasManager&&this._canvasManager.StartLoadingScreen();for(const c of a.runOnStartupFunctions)this._additionalLoadPromises.push(this._RunOnStartupFunction(c));await Promise.all([this._assetManager.WaitForAllToLoad(),...this._additionalLoadPromises]);C3$jscomp$178.clearArray(this._additionalLoadPromises);if(this._assetManager.HasHadErrorLoading())this._canvasManager&& this._canvasManager.HideCordovaSplashScreen();else return this._canvasManager&&await this._canvasManager.EndLoadingScreen(),await this._dispatcher.dispatchEventAndWaitAsync(new C3$jscomp$178.Event("beforeruntimestart")),await this.Start(),this._messagePort.postMessage({type:"runtime-ready"}),this}async _RunOnStartupFunction(a){try{await a(this._iRuntime)}catch(b){console.error("[C3 runtime] Error in runOnStartup function: ",b)}}async _LoadDataJson(a){a=a.project;this._projectName=a[0];this._projectVersion= a[16];this._projectUniqueId=a[31];this._appId=a[38];var b=a[39]||"loading-logo.png";this._isPixelRoundingEnabled=!!a[9];this._originalViewportWidth=this._viewportWidth=a[10];this._originalViewportHeight=this._viewportHeight=a[11];this._parallaxXorigin=this._originalViewportWidth/2;this._parallaxYorigin=this._originalViewportHeight/2;this._compositingMode=a[36];this._framerateMode=a[37];"low-latency"===this._compositingMode&&this.IsAndroidWebView()&&77>=C3$jscomp$178.Platform.BrowserVersionNumber&& (console.warn("[C3 runtime] Desynchronized (low-latency) compositing is enabled, but is disabled in the Android WebView <=77 due to crbug.com/1008842. Reverting to synchronized (standard) compositing."),this._compositingMode="standard");this._uses3dFeatures=!!a[40];this._sampling=a[14];this._usesAnyBackgroundBlending=a[15];this._usesAnyCrossSampling=a[42];this._usesAnyDepthSampling=a[17];this._usesLoaderLayout=!!a[18];this._loaderStyle=a[19];this._nextUid=a[21];this._pauseOnBlur=a[22];const c=this._assetManager; c._SetFileStructure(a[45]);c._SetAudioFiles(a[7],a[25]);c._SetMediaSubfolder(a[8]);c._SetFontsSubfolder(a[32]);c._SetIconsSubfolder(a[28]);c._SetWebFonts(a[29]);if(0===this._loaderStyle){let l="";this.IsPreview()?c._HasLocalUrlBlob(b)&&(l=c.GetLocalUrlAsBlobUrl(b)):l="flat"===c.GetFileStructure()?c.GetIconsSubfolder()+b:b;l&&(this._loadingLogoAsset=c.LoadImage({url:l}))}this._canvasManager&&(this._canvasManager.SetFullscreenMode(C3$jscomp$178.CanvasManager._FullscreenModeNumberToString(a[12])),this._canvasManager.SetFullscreenScalingQuality(a[23]? "high":"low"),this._canvasManager.SetMipmapsEnabled(0!==a[24]),this._canvasManager._SetGPUPowerPreference(a[34]),this._canvasManager._SetTextureAnisotropy(a[41]),this._canvasManager._SetWebGPUEnabled(a[13]),this._canvasManager._SetZAxisScale(a[30]),this._canvasManager._SetZDistances(a[46],a[47]),this._canvasManager._SetFieldOfView(a[26]),this._canvasManager._SetLimitedToWebGL1(a[48]));(b=a[43])&&await this._LoadExportToVideoData(b);this._pluginManager.CreateSystemPlugin();this._objectReferenceTable= self.C3_GetObjectRefTable();for(var d of a[2])this._pluginManager.CreatePlugin(d);this._objectReferenceTable=self.C3_GetObjectRefTable();this._LoadJsPropNameTable();for(var e of a[3])d=C3$jscomp$178.ObjectClass.Create(this,this._allObjectClasses.length,e),this._allObjectClasses.push(d),this._objectClassesByName.set(d.GetName().toLowerCase(),d),this._objectClassesBySid.set(d.GetSID(),d);for(const l of a[4])this._allObjectClasses[l[0]]._LoadFamily(l);for(var g of a[27])e=g.map(l=>this._allObjectClasses[l]), this._allContainers.push(C3$jscomp$178.New(C3$jscomp$178.Container,this,e));for(const l of this._allObjectClasses)l._OnAfterCreate();for(const l of a[5])this._layoutManager.Create(l);(g=a[1])&&(g=this._layoutManager.GetLayoutByName(g))&&this._layoutManager.SetFirstLayout(g);for(var k of a[33])this._timelineManager.Create(k);for(const l of a[35])this._transitionManager.Create(l);for(const l of a[44])this._templateManager.Create(l);this._templateManager.HasTemplates()||(this._templateManager.Release(), this._templateManager=null);this._InitScriptInterfaces();for(const l of a[6])this._eventSheetManager.Create(l);this._eventSheetManager._PostInit();this._InitGlobalVariableScriptInterface();C3$jscomp$178.clearArray(this._objectReferenceTable);this.FlushPendingInstances();k="any";a=a[20];1===a?k="portrait":2===a&&(k="landscape");this.PostComponentMessageToDOM("runtime","set-target-orientation",{targetOrientation:k})}async _LoadExportToVideoData(a){const b=a.format;"image-sequence"===b?this._exportToVideo= new self.C3ExportToImageSequence(this,a):"image-sequence-gif"===b?this._exportToVideo=new self.C3ExportToGIF(this,a):"webm"===b?this._exportToVideo=new self.C3ExportToWebMVideo(this,a):"mp4"===b&&(this._exportToVideo=new self.C3ExportToMP4Video(this,a));this._framerateMode="unlimited-frame";this._canvasManager.SetFullscreenMode("off");this._devicePixelRatio=1;self.devicePixelRatio=1;await this.PostComponentMessageToDOMAsync("runtime","set-exporting-to-video",{message:this._exportToVideo.GetExportingMessageForPercent(0), duration:this._exportToVideo.GetDuration()})}GetLoaderStyle(){return this._loaderStyle}IsExportToVideo(){return null!==this._exportToVideo}GetExportVideoDuration(){return this._exportToVideo.GetDuration()}GetExportVideoFramerate(){return this._exportToVideo.GetFramerate()}_InitExportToVideo(){return this._exportToVideo.Init({width:this._canvasManager.GetDeviceWidth(),height:this._canvasManager.GetDeviceHeight()})}_ExportToVideoAddFrame(){const a=this._tickCount/this.GetExportVideoFramerate();return this._exportToVideo.AddFrame(this._canvasManager.GetCanvas(), a)}_ExportToVideoAddKeyframe(){this._exportToVideo&&this._exportToVideo.AddKeyframe()}_OnOfflineAudioRenderCompleted(a){this._exportToVideo.OnOfflineAudioRenderCompleted(a)}_ExportToVideoFinish(){return this._exportToVideo.Finish()}IsFBInstantAvailable(){return this._isFBInstantAvailable}IsLoading(){return this._isLoading}AddLoadPromise(a){this._additionalLoadPromises.push(a)}SetUsingCreatePromises(a){this._isUsingCreatePromises=!!a}AddCreatePromise(a){this._isUsingCreatePromises&&this._additionalCreatePromises.push(a)}GetCreatePromises(){return this._additionalCreatePromises}_GetNextFamilyIndex(){return this._familyCount++}GetFamilyCount(){return this._familyCount}_AddEffectList(a){this._allEffectLists.push(a)}_GetAllEffectLists(){return this._allEffectLists}async _InitialiseCanvas(a){this._canvasManager&& (await this._canvasManager.CreateCanvas(a),this._canvasManager.InitLoadingScreen(this._loaderStyle))}async _MaybeLoadOpusDecoder(){if(!this._assetManager.IsAudioFormatSupported("audio/webm; codecs=opus")){var a=null;try{a=this.IsiOSCordova()&&this._assetManager.IsFileProtocol()?await this._assetManager.CordovaFetchLocalFileAsArrayBuffer(this._opusWasmBinaryUrl):await this._assetManager.FetchArrayBuffer(this._opusWasmBinaryUrl)}catch(b){console.info("Failed to fetch Opus decoder WASM; assuming project has no Opus audio.", b);return}a?this.AddJobWorkerBuffer(a,"opus-decoder-wasm"):this.AddJobWorkerBlob(null,"opus-decoder-wasm");await this.AddJobWorkerScripts([this._opusWasmScriptUrl])}}async _WasmDecodeWebMOpus(a){return await this.AddJob("OpusDecode",{arrayBuffer:a},[a])}async Start(){this._hasStarted=!0;this._startTime=Date.now();if(this._usesLoaderLayout){for(var a of this._allObjectClasses)a.IsFamily()||a.IsOnLoaderLayout()||!a.IsWorldType()||a.OnCreate();this._assetManager.WaitForAllToLoad().then(()=>{this._isLoading= !1;this._OnLoadFinished()})}else this._isLoading=!1;this._assetManager.SetInitialLoadFinished();this.IsDebug()&&C3Debugger$jscomp$3.RuntimeInit(ife);for(const b of this._layoutManager.GetAllLayouts())b._CreateGlobalNonWorlds();this.IsExportToVideo()&&await this._InitExportToVideo();a=this._layoutManager.GetFirstLayout();await a._Load(null,this.GetRenderer());await a._StartRunning(!0);this._fpsLastTime=performance.now();this._usesLoaderLayout||this._OnLoadFinished();(await this.PostComponentMessageToDOMAsync("runtime", "before-start-ticking")).isSuspended&&!this.IsExportToVideo()?this._suspendCount++:this.Tick()}_OnLoadFinished(){this.Trigger(C3$jscomp$178.Plugins.System.Cnds.OnLoadFinished,null,null);this.PostComponentMessageToDOM("runtime","register-sw")}GetObjectReference(a){a=Math.floor(a);const b=this._objectReferenceTable;if(0>a||a>=b.length)throw Error("invalid object reference");return b[a]}_LoadJsPropNameTable(){for(const a of self.C3_JsPropNameTable){const b=C3$jscomp$178.first(Object.keys(a));this._jsPropNameTable.push(b)}}GetJsPropName(a){a= Math.floor(a);const b=this._jsPropNameTable;if(0>a||a>=b.length)throw Error("invalid prop reference");return b[a]}HasDOM(){return this._hasDom}IsHeadless(){return this._isHeadless}IsInWorker(){return this._isInWorker}GetRuntimeBaseURL(){return this._runtimeBaseUrl}GetPreviewURL(){return this._previewUrl}GetEventSheetManager(){return this._eventSheetManager}GetEventStack(){return this._eventSheetManager.GetEventStack()}GetCurrentEventStackFrame(){return this._eventSheetManager.GetCurrentEventStackFrame()}GetCurrentEvent(){return this._eventSheetManager.GetCurrentEvent()}GetCurrentCondition(){return this._eventSheetManager.GetCurrentCondition()}IsCurrentConditionFirst(){return 0=== this.GetCurrentEventStackFrame().GetConditionIndex()}GetCurrentAction(){return this._eventSheetManager.GetCurrentAction()}GetPluginManager(){return this._pluginManager}GetSystemPlugin(){return this._pluginManager.GetSystemPlugin()}GetObjectClassByIndex(a){a=Math.floor(a);if(0>a||a>=this._allObjectClasses.length)throw new RangeError("invalid index");return this._allObjectClasses[a]}GetObjectClassByName(a){return this._objectClassesByName.get(a.toLowerCase())||null}GetObjectClassBySID(a){return this._objectClassesBySid.get(a)|| null}GetSingleGlobalObjectClassByCtor(a){return(a=this._pluginManager.GetPluginByConstructorFunction(a))?a.GetSingleGlobalObjectClass():null}GetAllObjectClasses(){return this._allObjectClasses}*allInstances(){for(const a of this._allObjectClasses)a.IsFamily()||(yield*a.instances())}Dispatcher(){return this._dispatcher}UserScriptDispatcher(){return this._userScriptDispatcher}DispatchUserScriptEvent(a){a.runtime=this.GetIRuntime();const b=this.IsDebug()&&!this._eventSheetManager.IsInEventEngine();b&& C3Debugger$jscomp$3.StartMeasuringScriptTime();this._userScriptDispatcher.dispatchEvent(a);b&&C3Debugger$jscomp$3.AddScriptTime()}DispatchUserScriptEventAsyncWait(a){a.runtime=this.GetIRuntime();return this._userScriptDispatcher.dispatchEventAndWaitAsync(a)}GetOriginalViewportWidth(){return this._originalViewportWidth}GetOriginalViewportHeight(){return this._originalViewportHeight}SetOriginalViewportSize(a,b){if(this._originalViewportWidth!==a||this._originalViewportHeight!==b)this._originalViewportWidth= a,this._originalViewportHeight=b,a=this.GetLayoutManager(),a.SetAllLayerProjectionChanged(),a.SetAllLayerMVChanged()}GetViewportWidth(){return this._viewportWidth}GetViewportHeight(){return this._viewportHeight}SetViewportSize(a,b){if(this._viewportWidth!==a||this._viewportHeight!==b)this._viewportWidth=a,this._viewportHeight=b,a=this.GetLayoutManager(),a.SetAllLayerProjectionChanged(),a.SetAllLayerMVChanged()}_SetDevicePixelRatio(a){this.IsExportToVideo()||(this._devicePixelRatio=a)}GetDevicePixelRatio(){return this._devicePixelRatio}GetParallaxXOrigin(){return this._parallaxXorigin}GetParallaxYOrigin(){return this._parallaxYorigin}GetCanvasManager(){return this._canvasManager}GetDrawWidth(){return this._canvasManager? this._canvasManager.GetDrawWidth():this._viewportWidth}GetDrawHeight(){return this._canvasManager?this._canvasManager.GetDrawHeight():this._viewportHeight}GetRenderScale(){return this._canvasManager?this._canvasManager.GetRenderScale():1}GetDisplayScale(){return this._canvasManager?this._canvasManager.GetDisplayScale():1}GetEffectLayerScaleParam(){return this._canvasManager?this._canvasManager.GetEffectLayerScaleParam():1}GetEffectDevicePixelRatioParam(){return this._canvasManager?this._canvasManager.GetEffectDevicePixelRatioParam(): 1}GetCanvasClientX(){return this._canvasManager?this._canvasManager.GetCanvasClientX():0}GetCanvasClientY(){return this._canvasManager?this._canvasManager.GetCanvasClientY():0}GetCanvasCssWidth(){return this._canvasManager?this._canvasManager.GetCssWidth():0}GetCanvasCssHeight(){return this._canvasManager?this._canvasManager.GetCssHeight():0}GetFullscreenMode(){return this._canvasManager?this._canvasManager.GetFullscreenMode():"off"}GetAdditionalRenderTarget(a){return this._canvasManager?this._canvasManager.GetAdditionalRenderTarget(a): null}ReleaseAdditionalRenderTarget(a){this._canvasManager&&this._canvasManager.ReleaseAdditionalRenderTarget(a)}UsesAnyBackgroundBlending(){return this._usesAnyBackgroundBlending}UsesAnyCrossSampling(){return this._usesAnyCrossSampling}UsesAnyDepthSampling(){return this._usesAnyDepthSampling}GetGPUUtilisation(){return this._canvasManager?this._canvasManager.GetGPUUtilisation():NaN}IsLinearSampling(){return"nearest"!==this.GetSampling()}GetFramerateMode(){return this._framerateMode}GetCompositingMode(){return this._compositingMode}GetSampling(){return this._sampling}UsesLoaderLayout(){return this._usesLoaderLayout}GetLoadingLogoAsset(){return this._loadingLogoAsset}ReleaseLoadingLogoAsset(){this._loadingLogoAsset&& (this._loadingLogoAsset.Release(),this._loadingLogoAsset=null)}GetLayoutManager(){return this._layoutManager}GetMainRunningLayout(){return this._layoutManager.GetMainRunningLayout()}GetTimelineManager(){return this._timelineManager}GetTransitionManager(){return this._transitionManager}GetTemplateManager(){return this._templateManager}GetAssetManager(){return this._assetManager}LoadImage(a){return this._assetManager.LoadImage(a)}CreateInstance(a,b,c,d,e,g){if(g&&this._templateManager){const k=this._templateManager.GetTemplateData(a, g);if(k)return a=this.CreateInstanceFromData(k,b,!1,c,d,!1,e,void 0,e),this._templateManager.MapInstanceToTemplateName(a,g),a}return this.CreateInstanceFromData(a,b,!1,c,d,!1,e,void 0,e)}CreateInstanceFromData(a,b,c,d,e,g,k,l,n){var p=null;let r=null;if(a instanceof C3$jscomp$178.ObjectClass){r=a;if(r.IsFamily()){a=r.GetFamilyMembers();var w=Math.floor(this.Random()*a.length);r=a[w]}p=r.GetDefaultInstanceData()}else p=a,r=this.GetObjectClassByIndex(p[1]);var y=r.GetPlugin().IsWorldType();if(this._isLoading&& y&&!r.IsOnLoaderLayout())return null;const B=b;y||(b=null);var C=c&&!g&&p&&!this._instancesByUid.has(p[2])?p[2]:this._nextUid++;w=p?p[0]:null;a=C3$jscomp$178.New(C3$jscomp$178.Instance,{runtime:this,objectType:r,layer:b,worldData:w,instVarData:p?p[3]:null,uid:C});this._instancesByUid.set(C,a);C=null;y&&(C=a.GetWorldInfo(),"undefined"!==typeof d&&"undefined"!==typeof e&&(C.SetX(d),C.SetY(e)),r._SetAnyCollisionCellChanged(!0));b&&(n||b._AddInstance(a,!0),1===b.GetParallaxX()&&1===b.GetParallaxY()|| r._SetAnyInstanceParallaxed(!0),b.GetLayout().MaybeLoadTexturesFor(r));this._objectCount++;let E=!0;if(l){var F=l.GetObjectClass();F.IsInContainer()&&r.IsInContainer()&&(l=r.GetContainer(),F=F.GetContainer(),l===F&&(E=!1))}if(r.IsInContainer()&&!c&&!g&&E){for(var J of r.GetContainer().objectTypes())J!==r&&(l=this.CreateInstanceFromData(J,B,!1,C?C.GetX():d,C?C.GetY():e,!0,!1,void 0,n),a._AddSibling(l));for(var L of a.siblings()){L._AddSibling(a);for(const O of a.siblings())L!==O&&L._AddSibling(O)}}y&& !c&&k&&this._CreateChildInstancesFromData(a,w,C,b,d,e,n);if(r.IsInContainer()&&!c&&!g&&k)for(const O of a.siblings())if(c=O.GetWorldInfo())J=O.GetPlugin(),L=O.GetObjectClass().GetDefaultInstanceData()[0],J.IsWorldType()?this._CreateChildInstancesFromData(O,L,c,b,c.GetX(),c.GetY(),n):this._CreateChildInstancesFromData(O,L,c,b,void 0,void 0,n);!g&&k&&("undefined"===typeof d&&(d=w[0]),"undefined"===typeof e&&(e=w[1]),b=C.GetTopParent(),d=d-C.GetX()+b.GetX(),e=e-C.GetY()+b.GetY(),b.SetXY(d,e));r._SetIIDsStale(); e=p?C3$jscomp$178.cloneArray(p[5]):null;p=p?p[4].map(O=>C3$jscomp$178.cloneArray(O)):null;(y=y&&w&&w[13])&&a._SetHasTilemap();a._CreateSdkInstance(e,p);y&&(w=w[13],a.GetSdkInstance().LoadTilemapData(w[2],w[0],w[1]));this._instancesPendingCreate.push(a);this._hasPendingInstances=!0;this.IsDebug()&&C3Debugger$jscomp$3.InstanceCreated(a);return a}_CreateChildInstancesFromData(a,b,c,d,e,g,k){var l=c.GetSceneGraphZIndexExportData(),n=c.GetSceneGraphChildrenExportData();a.GetWorldInfo().SetSceneGraphZIndex(l); if(n){"undefined"===typeof e&&(e=b[0]);"undefined"===typeof g&&(g=b[1]);l=new Set;c=b[0];b=b[1];for(const C of n){var p=C[0],r=C[1],w=C[2];n=C[3];var y=!!C[4];const E=C[5];var B=C[6];r=B?B:this._layoutManager.GetLayoutBySID(p).GetLayer(r).GetInitialInstanceData(w);p=this.GetObjectClassByIndex(r[1]);w=a.HasSibling(p);B=l.has(p);w&&!B&&y?(y=a.GetSibling(p),w=e+r[0][0]-c,r=g+r[0][1]-b,y.GetWorldInfo().SetXY(w,r),y.GetWorldInfo().SetSceneGraphZIndex(E),a.AddChild(y,{transformX:!!(n>>0&1),transformY:!!(n>> 1&1),transformWidth:!!(n>>2&1),transformHeight:!!(n>>3&1),transformAngle:!!(n>>4&1),destroyWithParent:!!(n>>5&1),transformZElevation:!!(n>>6&1),transformOpacity:!!(n>>7&1),transformVisibility:!!(n>>8&1)}),l.add(p)):(y=this.CreateInstanceFromData(r,d,!1,e+r[0][0]-c,g+r[0][1]-b,!1,!0,a,k),y.GetWorldInfo().SetSceneGraphZIndex(E),a.AddChild(y,{transformX:!!(n>>0&1),transformY:!!(n>>1&1),transformWidth:!!(n>>2&1),transformHeight:!!(n>>3&1),transformAngle:!!(n>>4&1),destroyWithParent:!!(n>>5&1),transformZElevation:!!(n>> 6&1),transformOpacity:!!(n>>7&1),transformVisibility:!!(n>>8&1)}))}}}DestroyInstance(a){if(!this._instancesToReleaseAtEndOfTick.has(a)){var b=a.GetObjectClass(),c=this._instancesPendingDestroy.get(b);if(c){if(c.has(a))return;c.add(a)}else c=new Set,c.add(a),this._instancesPendingDestroy.set(b,c);this.IsDebug()&&C3Debugger$jscomp$3.InstanceDestroyed(a);a._MarkDestroyed();this._hasPendingInstances=!0;if(a.IsInContainer())for(const d of a.siblings())this.DestroyInstance(d);for(const d of a.children())d.GetDestroyWithParent()&& this.DestroyInstance(d);this._layoutManager.IsEndingLayout()||this._isLoadingState||(b=this.GetEventSheetManager(),b.BlockFlushingInstances(!0),a._TriggerOnDestroyed(),b.BlockFlushingInstances(!1));a._FireDestroyedScriptEvents(this._layoutManager.IsEndingLayout())}}FlushPendingInstances(){this._hasPendingInstances&&(this._isFlushingPendingInstances=!0,this._FlushInstancesPendingCreate(),this._FlushInstancesPendingDestroy(),this._hasPendingInstances=this._isFlushingPendingInstances=!1,this.UpdateRender())}_FlushInstancesPendingCreate(){for(const a of this._instancesPendingCreate){const b= a.GetObjectClass();b._AddInstance(a);for(const c of b.GetFamilies())c._AddInstance(a),c._SetIIDsStale()}C3$jscomp$178.clearArray(this._instancesPendingCreate)}_FlushInstancesPendingDestroy(){this._dispatcher.SetDelayRemoveEventsEnabled(!0);for(const [a,b]of this._instancesPendingDestroy.entries())this._FlushInstancesPendingDestroyForObjectClass(a,b),b.clear();this._instancesPendingDestroy.clear();this._dispatcher.SetDelayRemoveEventsEnabled(!1)}_FlushInstancesPendingDestroyForObjectClass(a,b){for(const d of b){var c= this._eventObjects.instancedestroy;c.instance=d;this._dispatcher.dispatchEvent(c);this._instancesByUid.delete(d.GetUID());this._instanceTimes.delete(d);if(c=d.GetWorldInfo())c._RemoveFromCollisionCells(),c._RemoveFromRenderCells(),c._MarkDestroyed();this._instancesToReleaseAtEndOfTick.add(d);this._objectCount--}C3$jscomp$178.arrayRemoveAllInSet(a.GetInstances(),b);a._SetIIDsStale();this._instancesToReleaseAffectedObjectClasses.add(a);0===a.GetInstances().length&&a._SetAnyInstanceParallaxed(!1);for(const d of a.GetFamilies())C3$jscomp$178.arrayRemoveAllInSet(d.GetInstances(), b),d._SetIIDsStale(),this._instancesToReleaseAffectedObjectClasses.add(d);if(a.GetPlugin().IsWorldType()){a=new Set([...b].map(d=>d.GetWorldInfo().GetLayer()));for(const d of a)d._RemoveAllInstancesInSet(b)}}_GetInstancesPendingCreate(){return this._instancesPendingCreate}*instancesPendingCreateForObjectClass(a){for(const b of this._GetInstancesPendingCreate())a.IsFamily()?b.GetObjectClass().BelongsToFamily(a)&&(yield b):b.GetObjectClass()===a&&(yield b)}_GetNewUID(){return this._nextUid++}_MapInstanceByUID(a, b){this._instancesByUid.set(a,b)}_OnRendererContextLost(){this._dispatcher.dispatchEvent(C3$jscomp$178.New(C3$jscomp$178.Event,"renderercontextlost"));this.SetSuspended(!0);for(var a of this._allObjectClasses)!a.IsFamily()&&a.HasLoadedTextures()&&a.ReleaseTextures();(a=this.GetMainRunningLayout())&&a._OnRendererContextLost();C3$jscomp$178.ImageInfo.OnRendererContextLost();C3$jscomp$178.ImageAsset.OnRendererContextLost()}async _OnRendererContextRestored(){await this.GetMainRunningLayout()._Load(null, this.GetRenderer());this._dispatcher.dispatchEvent(C3$jscomp$178.New(C3$jscomp$178.Event,"renderercontextrestored"));this.SetSuspended(!1);this.UpdateRender()}_OnVisibilityChange(a){this.SetSuspended(a.hidden)}_OnWindowBlur(a){this.IsPreview()&&this._pauseOnBlur&&!C3$jscomp$178.Platform.IsMobile&&!a.data.parentHasFocus&&(this.SetSuspended(!0),this._isPausedOnBlur=!0)}_OnWindowFocus(){this._isPausedOnBlur&&(this.SetSuspended(!1),this._isPausedOnBlur=!1)}_RequestAnimationFrame(){const a=this._tickCallbacks; "vsync"===this._framerateMode?-1===this._rafId&&(this._rafId=self.requestAnimationFrame(a.normal)):"unlimited-tick"===this._framerateMode?(-1===this._ruafId&&(this._ruafId=C3$jscomp$178.RequestUnlimitedAnimationFrame(a.tickOnly)),-1===this._rafId&&(this._rafId=self.requestAnimationFrame(a.renderOnly))):-1===this._ruafId&&(this._ruafId=C3$jscomp$178.RequestUnlimitedAnimationFrame(a.normal))}_CancelAnimationFrame(){-1!==this._rafId&&(self.cancelAnimationFrame(this._rafId),this._rafId=-1);-1!==this._ruafId&& (C3$jscomp$178.CancelUnlimitedAnimationFrame(this._ruafId),this._ruafId=-1)}IsSuspended(){return 0<this._suspendCount}SetSuspended(a){if(!this.IsExportToVideo()){var b=this.IsSuspended();this._suspendCount+=a?1:-1;0>this._suspendCount&&(this._suspendCount=0);a=this.IsSuspended();!b&&a?(console.log("[Construct] Suspending"),this._CancelAnimationFrame(),this._dispatcher.dispatchEvent(C3$jscomp$178.New(C3$jscomp$178.Event,"suspend")),this.Trigger(C3$jscomp$178.Plugins.System.Cnds.OnSuspend,null,null)): b&&!a&&(console.log("[Construct] Resuming"),this._fpsLastTime=this._lastTickTime=b=performance.now(),this._mainThreadTimeCounter=this._mainThreadTime=this._fps=this._fpsFrameCount=0,this._dispatcher.dispatchEvent(C3$jscomp$178.New(C3$jscomp$178.Event,"resume")),this.Trigger(C3$jscomp$178.Plugins.System.Cnds.OnResume,null,null),this.HitBreakpoint()||this.Tick(b))}}_AddBehInstToTick(a){this._behInstsToTick.Add(a)}_AddBehInstToPostTick(a){this._behInstsToPostTick.Add(a)}_AddBehInstToTick2(a){this._behInstsToTick2.Add(a)}_RemoveBehInstToTick(a){this._behInstsToTick.Remove(a)}_RemoveBehInstToPostTick(a){this._behInstsToPostTick.Remove(a)}_RemoveBehInstToTick2(a){this._behInstsToTick2.Remove(a)}_BehaviorTick(){this._behInstsToTick.SetQueueingEnabled(!0); for(const a of this._behInstsToTick)a.Tick();this._behInstsToTick.SetQueueingEnabled(!1)}_BehaviorPostTick(){this._behInstsToPostTick.SetQueueingEnabled(!0);for(const a of this._behInstsToPostTick)a.PostTick();this._behInstsToPostTick.SetQueueingEnabled(!1)}_BehaviorTick2(){this._behInstsToTick2.SetQueueingEnabled(!0);for(const a of this._behInstsToTick2)a.Tick2();this._behInstsToTick2.SetQueueingEnabled(!1)}*_DebugBehaviorTick(){this._behInstsToTick.SetQueueingEnabled(!0);for(const a of this._behInstsToTick){const b= a.Tick();C3$jscomp$178.IsIterator(b)&&(yield*b)}this._behInstsToTick.SetQueueingEnabled(!1)}*_DebugBehaviorPostTick(){this._behInstsToPostTick.SetQueueingEnabled(!0);for(const a of this._behInstsToPostTick){const b=a.PostTick();C3$jscomp$178.IsIterator(b)&&(yield*b)}this._behInstsToPostTick.SetQueueingEnabled(!1)}*_DebugBehaviorTick2(){this._behInstsToTick2.SetQueueingEnabled(!0);for(const a of this._behInstsToTick2){const b=a.Tick2();C3$jscomp$178.IsIterator(b)&&(yield*b)}this._behInstsToTick2.SetQueueingEnabled(!1)}async Tick(a, b,c){this._hasStartedTicking=!0;const d="background-wake"===c;c="background-wake"!==c&&"skip-render"!==c;if(this._hasStarted&&(!this.IsSuspended()||b||d)){b=performance.now();this._isInTick=!0;this._MeasureDt(a||0);a=this.Step_BeforePreTick();this.IsDebugging()&&await a;a=this._dispatcher.dispatchEventAndWait_AsyncOptional(this._eventObjects.pretick);a instanceof Promise&&await a;a=this.Step_AfterPreTick();this.IsDebugging()&&await a;this._NeedsHandleSaveOrLoad()&&await this._HandleSaveOrLoad();this.GetLayoutManager().IsPendingChangeMainLayout()&& await this._MaybeChangeLayout();a=this.Step_RunEventsEtc();this.IsDebugging()&&await a;c&&this.Render();if(this.IsExportToVideo()&&(await this._ExportToVideoAddFrame(),this.GetGameTime()>=this.GetExportVideoDuration())){this._ExportToVideoFinish();return}this.IsSuspended()||d||this._RequestAnimationFrame();this._tickCount++;this._tickCountNoSave++;this._isInTick=!1;this._mainThreadTimeCounter+=performance.now()-b}}async Step_BeforePreTick(){const a=this._eventSheetManager,b=this.IsDebug();this.FlushPendingInstances(); a.BlockFlushingInstances(!0);this.PushCurrentLayout(this.GetMainRunningLayout());b&&C3Debugger$jscomp$3.StartMeasuringTime();this.IsDebugging()?await a.DebugRunScheduledWaits():a.RunScheduledWaits();b&&C3Debugger$jscomp$3.AddEventsTime();this.PopCurrentLayout();a.BlockFlushingInstances(!1);this.FlushPendingInstances();a.BlockFlushingInstances(!0)}async Step_AfterPreTick(){const a=this.IsDebug(),b=this.IsDebugging(),c=this._dispatcher,d=this._eventObjects,e=this._userScriptEventObjects;a&&C3Debugger$jscomp$3.StartMeasuringTime(); b?await this.DebugIterateAndBreak(this._DebugBehaviorTick()):this._BehaviorTick();b?await this.DebugIterateAndBreak(this._DebugBehaviorPostTick()):this._BehaviorPostTick();a&&C3Debugger$jscomp$3.AddBehaviorTickTime();a&&C3Debugger$jscomp$3.StartMeasuringTime();b?await this.DebugFireGeneratorEventAndBreak(d.tick):c.dispatchEvent(d.tick);a&&C3Debugger$jscomp$3.AddPluginTickTime();this._eventSheetManager.BlockFlushingInstances(!1);this.DispatchUserScriptEvent(e.tick)}async Step_RunEventsEtc(){const a= this._eventSheetManager,b=this._dispatcher,c=this._eventObjects,d=this.IsDebug(),e=this.IsDebugging();d&&C3Debugger$jscomp$3.StartMeasuringTime();e?await a.DebugRunEvents(this._layoutManager):a.RunEvents(this._layoutManager);d&&C3Debugger$jscomp$3.AddEventsTime();this._collisionEngine.ClearRegisteredCollisions();this._ReleaseInstancesAtEndOfTick();this._isLayoutFirstTick=!1;a.BlockFlushingInstances(!0);d&&C3Debugger$jscomp$3.StartMeasuringTime();e?await this.DebugIterateAndBreak(this._DebugBehaviorTick2()): this._BehaviorTick2();d&&C3Debugger$jscomp$3.AddBehaviorTickTime();d&&C3Debugger$jscomp$3.StartMeasuringTime();e?await this.DebugFireGeneratorEventAndBreak(c.tick2):b.dispatchEvent(c.tick2);d&&C3Debugger$jscomp$3.AddPluginTickTime();a.BlockFlushingInstances(!1);e&&await a.RunQueuedDebugTriggersAsync()}_ReleaseInstancesAtEndOfTick(){if(0!==this._instancesToReleaseAtEndOfTick.size){var a=this._dispatcher;a.SetDelayRemoveEventsEnabled(!0);for(const b of this._instancesToReleaseAffectedObjectClasses)b.GetSolStack().RemoveInstances(this._instancesToReleaseAtEndOfTick); this._instancesToReleaseAffectedObjectClasses.clear();this._eventSheetManager.RemoveInstancesFromScheduledWaits(this._instancesToReleaseAtEndOfTick);for(const b of this._instancesToReleaseAtEndOfTick)b.Release();this._instancesToReleaseAtEndOfTick.clear();a.SetDelayRemoveEventsEnabled(!1)}}async _MaybeChangeLayout(){const a=this.GetLayoutManager();let b=0;for(;a.IsPendingChangeMainLayout()&&10>b++;)await this._DoChangeLayout(a.GetPendingChangeMainLayout())}_MeasureDt(a){let b=0;this.IsExportToVideo()? this._dt1=this._dtRaw=b=1/this.GetExportVideoFramerate():0!==this._lastTickTime&&(b=Math.max(a-this._lastTickTime,0)/1E3,.5<b&&(b=0),this._dtRaw=b,this._dt1=Math.min(b,1/this._minimumFramerate));this._lastTickTime=a;this._dt=this._dt1*this._timeScale;this._gameTime.Add(this._dt);this._gameTimeRaw.Add(b*this._timeScale);this._wallTime.Add(this._dt1);for(const [c,d]of this._instanceTimes)d.Add(this._dt1*c.GetTimeScale());this._canvasManager&&this._canvasManager._UpdateTick();1E3<=a-this._fpsLastTime&& (this._fpsLastTime+=1E3,1E3<=a-this._fpsLastTime&&(this._fpsLastTime=a),this._fps=this._fpsFrameCount,this._fpsFrameCount=0,this._mainThreadTime=Math.min(this._mainThreadTimeCounter/1E3,1),this._mainThreadTimeCounter=0,this._canvasManager&&this._canvasManager._Update1sFrameRange(),this._collisionEngine._Update1sStats(),this.IsDebug()&&C3Debugger$jscomp$3.Update1sPerfStats());this._fpsFrameCount++}_SetTrackingInstanceTime(a,b){b?this._instanceTimes.has(a)||(b=C3$jscomp$178.New(C3$jscomp$178.KahanSum), b.Copy(this._gameTime),this._instanceTimes.set(a,b)):this._instanceTimes.delete(a)}_GetInstanceGameTime(a){return(a=this._instanceTimes.get(a))?a.Get():this.GetGameTime()}async _DoChangeLayout(a){const b=this._dispatcher,c=this.GetLayoutManager().GetMainRunningLayout();await c._StopRunning();c._Unload(a,this.GetRenderer());c===a&&this._eventSheetManager.ClearAllScheduledWaits();this._collisionEngine.ClearRegisteredCollisions();this._ReleaseInstancesAtEndOfTick();b.dispatchEvent(this._eventObjects.beforelayoutchange); C3$jscomp$178.Asyncify.SetHighThroughputMode(!0);await a._Load(c,this.GetRenderer());C3$jscomp$178.Asyncify.SetHighThroughputMode(!1);await a._StartRunning(!1);b.dispatchEvent(this._eventObjects.layoutchange);this.UpdateRender();this._isLayoutFirstTick=!0;this.FlushPendingInstances();this._ExportToVideoAddKeyframe()}UpdateRender(){this._needRender=!0}GetWebGLRenderer(){return this._canvasManager?this._canvasManager.GetWebGLRenderer():null}GetWebGPURenderer(){return this._canvasManager?this._canvasManager.GetWebGPURenderer(): null}GetRenderer(){return this._canvasManager?this._canvasManager.GetRenderer():null}Render(){const a=this._canvasManager;if(a&&!a.IsRendererContextLost()){var b=this.GetRenderer(),c=b.SupportsGPUProfiling(),d=c&&b.IsWebGL();c=c&&b.IsWebGPU();d&&b.CheckForQueryResults();if(this._needRender||this.IsExportToVideo()){var e=this._layoutManager.GetMainRunningLayout();b.Start();var g=this.IsDebug();g&&C3Debugger$jscomp$3.StartMeasuringTime();this._needRender=!1;var k=null;d&&(k=a.GetGPUFrameTimingsBuffer().AddTimeElapsedQuery(), b.StartQuery(k));d=null;c&&(d=b.StartFrameTiming(2*(1+e.GetLayerCount())),b.WriteTimestamp(0));this.Uses3DFeatures()&&"low"===a.GetCurrentFullscreenScalingQuality()?b.SetFixedSizeDepthBuffer(a.GetDrawWidth(),a.GetDrawHeight()):b.SetAutoSizeDepthBuffer();this._Render(this.GetRenderer(),e);k&&b.EndQuery(k);c&&(b.WriteTimestamp(1),this._canvasManager._AddWebGPUFrameTiming(d));b.Finish();g&&(C3Debugger$jscomp$3.AddDrawCallsTime(),C3Debugger$jscomp$3.UpdateInspectHighlight());a&&a._MaybeTakeSnapshot()}else b.IncrementFrameNumber()}}_Render(a, b){a.SetTextureFillMode();a.SetAlphaBlend();a.SetColorRgba(1,1,1,1);a.SetRenderTarget(null);a.SetTexture(null);a.SetDepthEnabled(this.Uses3DFeatures());b.Draw(a)}Trigger(a,b,c){if(!this._hasStarted)return!1;var d=!this._isInTick&&!this._eventSheetManager.IsInTrigger();let e=0;d&&(e=performance.now());const g=this.IsDebug();g&&this.SetDebuggingEnabled(!1);a=this._eventSheetManager._Trigger(this._layoutManager,a,b,c);d&&(d=performance.now()-e,this._mainThreadTimeCounter+=d,g&&C3Debugger$jscomp$3.AddTriggersTime(d)); g&&this.SetDebuggingEnabled(!0);return a}DebugTrigger(a,b,c){if(!this.IsDebug())return this.Trigger(a,b,c);if(this.HitBreakpoint())throw Error("called DebugTrigger() while stopped on breakpoint");if(!this._isInTick&&!this._eventSheetManager.IsInTrigger())throw Error("called DebugTrigger() outside of event code - use TriggerAsync() instead");return this._eventSheetManager._DebugTrigger(this._layoutManager,a,b,c)}async TriggerAsync(a,b,c){if(!this.IsDebugging())return this.Trigger(a,b,c);if(!this._hasStarted)return!1; if(this.HitBreakpoint())return this._eventSheetManager.QueueDebugTrigger(a,b,c);if(!this.GetMainRunningLayout())return this._eventSheetManager.QueueTrigger(a,b,c);const d=performance.now();a=this._eventSheetManager._DebugTrigger(this._layoutManager,a,b,c);for(b=a.next();!b.done;)await this.DebugBreak(b.value),b=a.next();this.IsSuspended()||this._eventSheetManager.IsInTrigger()||(await this._eventSheetManager.RunQueuedDebugTriggersAsync(),this._hasStartedTicking&&!this._isInTick&&this._RequestAnimationFrame()); this._mainThreadTimeCounter+=performance.now()-d;return b.value}FastTrigger(a,b,c){const d=this.IsDebug();d&&this.SetDebuggingEnabled(!1);a=this._eventSheetManager._FastTrigger(this._layoutManager,a,b,c);d&&this.SetDebuggingEnabled(!0);return a}DebugFastTrigger(a,b,c){return this._eventSheetManager._DebugFastTrigger(this._layoutManager,a,b,c)}ScheduleTriggers(a){return this._scheduleTriggersThrottle.Add(a)}PushCurrentLayout(a){this._currentLayoutStack.push(a)}PopCurrentLayout(){if(!this._currentLayoutStack.length)throw Error("layout stack empty"); this._currentLayoutStack.pop()}GetCurrentLayout(){return this._currentLayoutStack.length?this._currentLayoutStack.at(-1):this.GetMainRunningLayout()}GetDt(a){return a&&-1!==a.GetTimeScale()?this._dt1*a.GetTimeScale():this._dt}_GetDtFast(){return this._dt}GetDt1(){return this._dt1}GetDtRaw(){return this._dtRaw}GetTimeScale(){return this._timeScale}SetTimeScale(a){if(isNaN(a)||0>a)a=0;this._timeScale=a}SetMinimumFramerate(a){this._minimumFramerate=C3$jscomp$178.clamp(a,1,120)}GetMinimumFramerate(){return this._minimumFramerate}GetFPS(){return this._fps}GetMainThreadTime(){return this._mainThreadTime}GetStartTime(){return this._startTime}GetGameTime(){return this._gameTime.Get()}GetGameTimeRaw(){return this._gameTimeRaw.Get()}GetWallTime(){return this._wallTime.Get()}GetTickCount(){return this._tickCount}GetTickCountNoSave(){return this._tickCountNoSave}GetObjectCount(){return this._objectCount}GetProjectName(){return this._projectName}GetProjectVersion(){return this._projectVersion}GetProjectUniqueId(){return this._projectUniqueId}GetAppId(){return this._appId}GetInstanceByUID(a){if(this._isLoadingState)throw Error("cannot call while loading state - wait until afterload event"); return this._instancesByUid.get(a)||null}_RefreshUidMap(){this._instancesByUid.clear();for(const a of this._allObjectClasses)if(!a.IsFamily())for(const b of a.GetInstances())this._instancesByUid.set(b.GetUID(),b)}IsPreview(){return"preview"===this._exportType}IsDebug(){return this._isDebug}GetExportType(){return this._exportType}IsCordova(){return"cordova"===this._exportType}IsAndroidWebView(){return"Android"===C3$jscomp$178.Platform.OS&&("cordova"===this._exportType||"playable-ad"===this._exportType|| "instant-games"===this._exportType)}IsiOSCordova(){return this._isiOSCordova}IsiOSWebView(){return this._isiOSWebView}GetCollisionEngine(){return this._collisionEngine}GetSolidBehavior(){return this._pluginManager.GetSolidBehavior()}GetJumpthruBehavior(){return this._pluginManager.GetJumpthruBehavior()}Uses3DFeatures(){return this._uses3dFeatures}GetZScaleFactor(){return this.GetRenderer().GetZAxisScaleFactor(this.GetViewportHeight())}GetDefaultCameraZ(a){return this.GetRenderer().GetDefaultCameraZ(a|| this.GetViewportHeight())}IsLayoutFirstTick(){return this._isLayoutFirstTick}SetPixelRoundingEnabled(a){a=!!a;this._isPixelRoundingEnabled!==a&&(this._isPixelRoundingEnabled=a,this.GetLayoutManager().SetAllLayerMVChanged(),this.UpdateRender())}IsPixelRoundingEnabled(){return this._isPixelRoundingEnabled}GetTextIconSet(a){a=this._textIconManager.GetIconSet(a);a.HasLoaded()||a.LoadContent().then(()=>this.UpdateRender());return a}_GetTextIconSetMeta(a){const b=[];for(const c of a.GetAnimations())for(const d of c.GetFrames())a= d.GetImageInfo(),b.push({source:d,width:a.GetWidth(),height:a.GetHeight(),tag:d.GetTag()});return{icons:b}}async _GetTextIconSetContent(a){const b=C3$jscomp$178.New(C3$jscomp$178.PromiseThrottle);var c=[];const d=new Map;for(const e of a.GetAnimations())for(const g of e.GetFrames()){const k=g.GetImageInfo().GetImageAsset();d.has(k)||(d.set(k,null),c.push(b.Add(async()=>{const l=await k.LoadToDrawable();d.set(k,l)})))}await Promise.all(c);c=[];for(const e of a.GetAnimations())for(const g of e.GetFrames())c.push(b.Add(async()=> {var k=g.GetImageInfo();const l=d.get(k.GetImageAsset());k=await k.ExtractImageToCanvas(l);return{drawable:await createImageBitmap(k)}}));a=await Promise.all(c);for(const e of d.values())e instanceof ImageBitmap&&e.close&&e.close();return{icons:a}}SaveToSlot(a){this._saveToSlotName=a}LoadFromSlot(a){this._loadFromSlotName=a}LoadFromJsonString(a){this._loadFromJson=a}GetLastSaveJsonString(){return this._lastSaveJson}_NeedsHandleSaveOrLoad(){return!(!this._saveToSlotName&&!this._loadFromSlotName&&null=== this._loadFromJson)}async _HandleSaveOrLoad(){this._saveToSlotName&&(this.FlushPendingInstances(),await this._DoSaveToSlot(this._saveToSlotName),this._ClearSaveOrLoad());this._loadFromSlotName&&(await this._DoLoadFromSlot(this._loadFromSlotName),this._ClearSaveOrLoad(),this.IsDebug()&&C3Debugger$jscomp$3.StepIfPausedInDebugger());if(null!==this._loadFromJson){this.FlushPendingInstances();try{await this._DoLoadFromJsonString(this._loadFromJson),this._lastSaveJson=this._loadFromJson,await this.TriggerAsync(C3$jscomp$178.Plugins.System.Cnds.OnLoadComplete, null),this._lastSaveJson=""}catch(a){console.error("[Construct] Failed to load state from JSON string: ",a),await this.TriggerAsync(C3$jscomp$178.Plugins.System.Cnds.OnLoadFailed,null)}this._ClearSaveOrLoad()}}_ClearSaveOrLoad(){this._loadFromSlotName=this._saveToSlotName="";this._loadFromJson=null}_GetProjectStorage(){this._projectStorage||(this._projectStorage=localforage.createInstance({name:"c3-localstorage-"+this.GetProjectUniqueId(),description:this.GetProjectName()}));return this._projectStorage}_GetSavegamesStorage(){this._savegamesStorage|| (this._savegamesStorage=localforage.createInstance({name:"c3-savegames-"+this.GetProjectUniqueId(),description:this.GetProjectName()}));return this._savegamesStorage}async _DoSaveToSlot(a){const b=await this._SaveToJsonString();try{await this._GetSavegamesStorage().setItem(a,b),console.log("[Construct] Saved state to storage ("+b.length+" chars)"),this._lastSaveJson=b,await this.TriggerAsync(C3$jscomp$178.Plugins.System.Cnds.OnSaveComplete,null),this._lastSaveJson=""}catch(c){console.error("[Construct] Failed to save state to storage: ", c),await this.TriggerAsync(C3$jscomp$178.Plugins.System.Cnds.OnSaveFailed,null)}}async _DoLoadFromSlot(a){try{const b=await this._GetSavegamesStorage().getItem(a);if(!b)throw Error("empty slot");console.log("[Construct] Loaded state from storage ("+b.length+" chars)");await this._DoLoadFromJsonString(b);this._lastSaveJson=b;await this.TriggerAsync(C3$jscomp$178.Plugins.System.Cnds.OnLoadComplete,null);this._lastSaveJson=""}catch(b){console.error("[Construct] Failed to load state from storage: ",b), await this.TriggerAsync(C3$jscomp$178.Plugins.System.Cnds.OnLoadFailed,null)}}async _SaveToJsonString(){const a={c3save:!0,version:1,rt:{time:this.GetGameTime(),timeRaw:this.GetGameTimeRaw(),walltime:this.GetWallTime(),timescale:this.GetTimeScale(),tickcount:this.GetTickCount(),next_uid:this._nextUid,running_layout:this.GetMainRunningLayout().GetSID(),start_time_offset:Date.now()-this._startTime},types:{},layouts:{},events:this._eventSheetManager._SaveToJson(),timelines:this._timelineManager._SaveToJson(), user_script_data:null};for(var b of this._allObjectClasses)b.IsFamily()||b.HasNoSaveBehavior()||(a.types[b.GetSID().toString()]=b._SaveToJson());for(const c of this._layoutManager.GetAllLayouts())a.layouts[c.GetSID().toString()]=c._SaveToJson();b=this._CreateUserScriptEvent("save");b.saveData=null;await this.DispatchUserScriptEventAsyncWait(b);a.user_script_data=b.saveData;return JSON.stringify(a)}IsLoadingState(){return this._isLoadingState}async _DoLoadFromJsonString(a){var b=this.GetLayoutManager(); a=JSON.parse(a);if(a.c2save)throw Error("C2 saves are incompatible with C3 runtime");if(!a.c3save)throw Error("not valid C3 save data");if(1<a.version)throw Error("C3 save data from future version");this._dispatcher.dispatchEvent(C3$jscomp$178.New(C3$jscomp$178.Event,"beforeload"));for(var c of this.allInstances())c.GetObjectClass().HasNoSaveBehavior()||c._OnBeforeLoad();c=a.rt;this._gameTime.Set(c.time);c.hasOwnProperty("timeRaw")&&this._gameTimeRaw.Set(c.timeRaw);this._wallTime.Set(c.walltime); this._timeScale=c.timescale;this._tickCount=c.tickcount;this._startTime=Date.now()-c.start_time_offset;var d=c.running_layout;this._isLoadingState=!0;var e=!1;if(d!==this.GetMainRunningLayout().GetSID())if(e=b.GetLayoutBySID(d))await this._DoChangeLayout(e),e=!0;else return;for(const [l,n]of Object.entries(a.layouts))d=parseInt(l,10),(d=b.GetLayoutBySID(d))&&d._LoadFromJson(n);for(const [l,n]of Object.entries(a.types))d=parseInt(l,10),d=this.GetObjectClassBySID(d),!d||d.IsFamily()||d.HasNoSaveBehavior()|| d._LoadFromJson(n);for(var g of this._layoutManager.GetAllLayouts())for(const l of g.allLayers())l._LoadFromJsonAfterInstances();this.FlushPendingInstances();this._RefreshUidMap();this._isLoadingState=!1;if(e){for(const l of this.allInstances())l.SetupInitialSceneGraphConnections();for(const [l,n]of Object.entries(a.types))g=parseInt(l,10),g=this.GetObjectClassBySID(g),!g||g.IsFamily()||g.HasNoSaveBehavior()||g._SetupSceneGraphConnectionsOnChangeOfLayout(n)}this._nextUid=c.next_uid;this._eventSheetManager._LoadFromJson(a.events); for(const l of this._allObjectClasses)if(!l.IsFamily()&&l.IsInContainer())for(const n of l.GetInstances()){c=n.GetIID();for(const p of l.GetContainer().objectTypes())if(p!==l){g=p.GetInstances();if(0>c||c>=g.length)throw Error("missing sibling instance");n._AddSibling(g[c])}}this._timelineManager._LoadFromJson(a.timelines);b.SetAllLayerProjectionChanged();b.SetAllLayerMVChanged();this._dispatcher.dispatchEvent(C3$jscomp$178.New(C3$jscomp$178.Event,"afterload"));for(var [k]of Object.entries(a.types))b= parseInt(k,10),(b=this.GetObjectClassBySID(b))&&b._ClearLoadInstancesJson();k=this._CreateUserScriptEvent("load");k.saveData=a.user_script_data;await this.DispatchUserScriptEventAsyncWait(k);this.UpdateRender()}async AddJobWorkerScripts(a){a=await Promise.all(a.map(async b=>{const c=C3$jscomp$178.IsAbsoluteURL(b)&&(new URL(b)).origin!==location.origin,d=this.IsCordova()&&this._assetManager.IsFileProtocol();return c||d||this.IsPreview()||"playable-ad"===this.GetExportType()?(b=await this._assetManager.FetchBlob(b), URL.createObjectURL(b)):C3$jscomp$178.IsRelativeURL(b)?(new URL(b,this._runtimeBaseUrl)).toString():b}));this._jobScheduler.ImportScriptsToJobWorkers(a)}AddJobWorkerBlob(a,b){this._jobScheduler.SendBlobToJobWorkers(a,b)}AddJobWorkerBuffer(a,b){this._jobScheduler.SendBufferToJobWorkers(a,b)}AddJob(a,b,c,d){return this._jobScheduler.AddJob(a,b,c,null,null,d)}BroadcastJob(a,b,c,d){return this._jobScheduler.BroadcastJob(a,b,c,d)}GetMaxNumJobWorkers(){return this._jobScheduler.GetMaxNumWorkers()}InvokeDownload(a, b){this.PostComponentMessageToDOM("runtime","invoke-download",{url:a,filename:b})}async RasterSvgImage(a,b,c,d,e,g){d=d||b;e=e||c;if(this.IsInWorker())return(await this.PostComponentMessageToDOMAsync("runtime","raster-svg-image",{blob:a,imageWidth:b,imageHeight:c,surfaceWidth:d,surfaceHeight:e,imageBitmapOpts:g})).imageBitmap;a=await self.C3_RasterSvgImageBlob(a,b,c,d,e);return g?await self.createImageBitmap(a,g):a}async GetSvgImageSize(a){return this.IsInWorker()?await this.PostComponentMessageToDOMAsync("runtime", "get-svg-image-size",{blob:a}):await self.C3_GetSvgImageSize(a)}RequestDeviceOrientationEvent(){this._didRequestDeviceOrientationEvent||(this._didRequestDeviceOrientationEvent=!0,this.PostComponentMessageToDOM("runtime","enable-device-orientation"))}RequestDeviceMotionEvent(){this._didRequestDeviceMotionEvent||(this._didRequestDeviceMotionEvent=!0,this.PostComponentMessageToDOM("runtime","enable-device-motion"))}Random(){return this._randomNumberCallback()}SetRandomNumberGeneratorCallback(a){this._randomNumberCallback= a}_GetRemotePreviewStatusInfo(){const a=this.GetRenderer();return{fps:this.GetFPS(),cpu:this.GetMainThreadTime(),gpu:this.GetGPUUtilisation(),layout:this.GetMainRunningLayout()?this.GetMainRunningLayout().GetName():"",renderer:a.IsWebGL()?a.GetUnmaskedRenderer():a.GetBasicAdapterInfoString()}}HitBreakpoint(){return this.IsDebug()?C3Debugger$jscomp$3.HitBreakpoint():!1}DebugBreak(a){return this.IsDebugging()?C3Debugger$jscomp$3.DebugBreak(a):Promise.resolve()}DebugBreakNext(){return this.IsDebugging()? C3Debugger$jscomp$3.BreakNext():!1}SetDebugBreakpointsEnabled(a){this._breakpointsEnabled=!!a;this._UpdateDebuggingFlag()}AreDebugBreakpointsEnabled(){return this._breakpointsEnabled}IsDebugging(){return this._isDebugging}SetDebuggingEnabled(a){a?this._debuggingDisabled--:this._debuggingDisabled++;this._UpdateDebuggingFlag()}_UpdateDebuggingFlag(){this._isDebugging=this.IsDebug()&&this._breakpointsEnabled&&0===this._debuggingDisabled}IsCPUProfiling(){return this.IsDebug()&&C3Debugger$jscomp$3.IsCPUProfiling()}IsGPUProfiling(){return this.IsDebug()&& this.GetRenderer().SupportsGPUProfiling()&&C3Debugger$jscomp$3.IsGPUProfiling()}async DebugIterateAndBreak(a){if(a)for(const b of a)await this.DebugBreak(b)}DebugFireGeneratorEventAndBreak(a){return this.DebugIterateAndBreak(this._dispatcher.dispatchGeneratorEvent(a))}_InvokeFunctionFromJS(a){return this._eventSheetManager._InvokeFunctionFromJS(a.name,a.params)}GetIRuntime(){return this._iRuntime}_CreateUserScriptEvent(a){a=C3$jscomp$178.New(C3$jscomp$178.Event,a,!1);a.runtime=this._iRuntime;return a}_InitScriptInterfaces(){var a= {};for(const b of this._allObjectClasses)a[b.GetJsPropName()]={value:b.GetIObjectClass(),enumerable:!0,writable:!1};a=Object.create(Object.prototype,a);this._iRuntime=new self.IRuntime(this,a);this._userScriptEventObjects={tick:this._CreateUserScriptEvent("tick")}}_InitGlobalVariableScriptInterface(){const a={};for(const b of this.GetEventSheetManager().GetAllGlobalVariables())a[b.GetJsPropName()]=b._GetScriptInterfaceDescriptor();this._iRuntime._InitGlobalVars(a)}_GetCommonScriptInterfaces(){return this._commonScriptInterfaces}_MapScriptInterface(a, b){this._interfaceMap.set(a,b)}_UnwrapScriptInterface(a){return this._interfaceMap.get(a)}_UnwrapIObjectClass(a){if(!(a instanceof self.IObjectClass))throw new TypeError("expected IObjectClass");a=this._UnwrapScriptInterface(a);if(!(a&&a instanceof C3$jscomp$178.ObjectClass))throw Error("invalid IObjectClass");return a}_UnwrapIWorldInstance(a){if(!(a instanceof self.IWorldInstance))throw new TypeError("expected IWorldInstance");a=this._UnwrapScriptInterface(a);if(!(a&&a instanceof C3$jscomp$178.Instance))throw Error("invalid IInstance"); return a}};self.C3_CreateRuntime=C3$jscomp$178.Runtime.Create;self.C3_InitRuntime=(a,b)=>a.Init(b);"use strict";const C3$jscomp$179=self.C3; C3$jscomp$179.JobSchedulerRuntime=class extends C3$jscomp$179.DefendedBase{constructor(a,b){super();this._runtime=a;this._jobPromises=new Map;this._nextJobId=0;this._inputPort=b.inputPort;b.outputPort.onmessage=c=>this._OnJobWorkerMessage(c);this._maxNumWorkers=b.maxNumWorkers;this._jobWorkerCount=1;this._hadErrorCreatingWorker=this._isCreatingWorker=!1}async Init(){}GetMaxNumWorkers(){return this._maxNumWorkers}ImportScriptsToJobWorkers(a){this._inputPort.postMessage({type:"_import_scripts",scripts:a})}SendBlobToJobWorkers(a, b){this._inputPort.postMessage({type:"_send_blob",blob:a,id:b})}SendBufferToJobWorkers(a,b){this._inputPort.postMessage({type:"_send_buffer",buffer:a,id:b},[a])}AddJob(a,b,c,d,e,g){c||(c=[]);if("number"===typeof g&&(g=Math.floor(g),0>=g))throw Error("invalid maxWorkerNum");const k=this._nextJobId++;a={type:a,isBroadcast:!1,maxWorkerNum:g,jobId:k,params:b,transferables:c};b=new Promise((l,n)=>{this._jobPromises.set(k,{resolve:l,progress:d,reject:n,cancelled:!1,maxWorkerNum:g})});e&&e.SetAction(()=> this._CancelJob(k));this._inputPort.postMessage(a,c);this._MaybeCreateExtraWorker();return b}BroadcastJob(a,b,c,d){c||(c=[]);if("number"===typeof d&&(d=Math.floor(d),0>=d))throw Error("invalid maxWorkerNum");const e=this._nextJobId++;this._inputPort.postMessage({type:a,isBroadcast:!0,maxWorkerNum:d,jobId:e,params:b,transferables:c},c)}_CancelJob(a){const b=this._jobPromises.get(a);b&&(b.cancelled=!0,b.resolve=null,b.progress=null,b.reject=null,this._inputPort.postMessage({type:"_cancel",jobId:a}))}_OnJobWorkerMessage(a){a= a.data;const b=a.type,c=a.jobId;switch(b){case "result":this._OnJobResult(c,a.result);break;case "progress":this._OnJobProgress(c,a.progress);break;case "error":this._OnJobError(c,a.error);break;case "ready":this._OnJobWorkerReady();break;default:throw Error(`unknown message from worker '${b}'`);}}_OnJobResult(a,b){const c=this._jobPromises.get(a);if(!c)throw Error("invalid job ID");c.cancelled||c.resolve(b);this._jobPromises.delete(a)}_OnJobProgress(a,b){a=this._jobPromises.get(a);if(!a)throw Error("invalid job ID"); !a.cancelled&&a.progress&&a.progress(b)}_OnJobError(a,b){const c=this._jobPromises.get(a);if(!c)throw Error("invalid job ID");c.cancelled||c.reject(b);this._jobPromises.delete(a)}_OnJobWorkerReady(){this._isCreatingWorker&&(this._isCreatingWorker=!1,this._jobWorkerCount++,this._jobWorkerCount<this._maxNumWorkers?this._MaybeCreateExtraWorker():this._inputPort.postMessage({type:"_no_more_workers"}))}_GetWorkerCountNeededForPendingJobs(){let a=0;const b=[...this._jobPromises.values()].sort((c,d)=>(c.maxWorkerNum|| Infinity)-(d.maxWorkerNum||Infinity));for(const c of b)a<(c.maxWorkerNum||Infinity)&&a++;return a}async _MaybeCreateExtraWorker(){if(!(this._jobWorkerCount>=this._maxNumWorkers||this._isCreatingWorker||this._hadErrorCreatingWorker||this._GetWorkerCountNeededForPendingJobs()<=this._jobWorkerCount))try{this._isCreatingWorker=!0,(await this._runtime.PostComponentMessageToDOMAsync("runtime","create-job-worker")).outputPort.onmessage=a=>this._OnJobWorkerMessage(a)}catch(a){this._hadErrorCreatingWorker= !0,this._isCreatingWorker=!1,console.error(`[Construct] Failed to create job worker; stopping creating any more (created ${this._jobWorkerCount} so far)`,a)}}};self.C3_Shaders={}; self.C3_Shaders.hsladjust={glsl:"varying mediump vec2 vTex;\nuniform lowp sampler2D samplerFront;\nprecision mediump float;\nuniform float huerotate;\nuniform float satadjust;\nuniform float lumadjust;\nvec3 rgb_to_hsl(vec3 color)\n{\nvec3 hsl = vec3(0.0, 0.0, 0.0);\nfloat fmin = min(min(color.r, color.g), color.b);\nfloat fmax = max(max(color.r, color.g), color.b);\nfloat delta = fmax - fmin;\nhsl.z = (fmax + fmin) / 2.0;\nif (delta == 0.0)\n{\nhsl.x = 0.0;\nhsl.y = 0.0;\n}\nelse\n{\nif (hsl.z < 0.5)\nhsl.y = delta / (fmax + fmin);\nelse\nhsl.y = delta / (2.0 - fmax - fmin);\nfloat dR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;\nfloat dG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;\nfloat dB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;\nif (color.r == fmax)\nhsl.x = dB - dG;\nelse if (color.g == fmax)\nhsl.x = (1.0 / 3.0) + dR - dB;\nelse if (color.b == fmax)\nhsl.x = (2.0 / 3.0) + dG - dR;\nif (hsl.x < 0.0)\nhsl.x += 1.0;\nelse if (hsl.x > 1.0)\nhsl.x -= 1.0;\n}\nreturn hsl;\n}\nfloat hue_to_rgb(float f1, float f2, float hue)\n{\nif (hue < 0.0)\nhue += 1.0;\nelse if (hue > 1.0)\nhue -= 1.0;\nfloat ret;\nif ((6.0 * hue) < 1.0)\nret = f1 + (f2 - f1) * 6.0 * hue;\nelse if ((2.0 * hue) < 1.0)\nret = f2;\nelse if ((3.0 * hue) < 2.0)\nret = f1 + (f2 - f1) * ((2.0 / 3.0) - hue) * 6.0;\nelse\nret = f1;\nreturn ret;\n}\nvec3 hsl_to_rgb(vec3 hsl)\n{\nvec3 rgb = vec3(hsl.z);\nif (hsl.y != 0.0)\n{\nfloat f2;\nif (hsl.z < 0.5)\nf2 = hsl.z * (1.0 + hsl.y);\nelse\nf2 = (hsl.z + hsl.y) - (hsl.y * hsl.z);\nfloat f1 = 2.0 * hsl.z - f2;\nrgb.r = hue_to_rgb(f1, f2, hsl.x + (1.0 / 3.0));\nrgb.g = hue_to_rgb(f1, f2, hsl.x);\nrgb.b = hue_to_rgb(f1, f2, hsl.x - (1.0 / 3.0));\n}\nreturn rgb;\n}\nvoid main(void)\n{\nvec4 front = texture2D(samplerFront, vTex);\nvec3 rgb = rgb_to_hsl(front.rgb) + vec3((huerotate > 0.5 ? huerotate - 1.0 : huerotate), 0, (lumadjust - 1.0) * front.a);\nrgb.y *= satadjust;\nrgb = hsl_to_rgb(rgb);\ngl_FragColor = vec4(rgb, front.a);\n}",glslWebGL2:"", wgsl:"%%SAMPLERFRONT_BINDING%% var samplerFront : sampler;\n%%TEXTUREFRONT_BINDING%% var textureFront : texture_2d<f32>;\nstruct ShaderParams {\nhuerotate : f32,\nsatadjust : f32,\nlumadjust : f32\n};\n%%SHADERPARAMS_BINDING%% var<uniform> shaderParams : ShaderParams;\n%%C3_UTILITY_FUNCTIONS%%\n%%FRAGMENTINPUT_STRUCT%%\n%%FRAGMENTOUTPUT_STRUCT%%\n@fragment\nfn main(input : FragmentInput) -> FragmentOutput\n{\nvar front : vec4<f32> = textureSample(textureFront, samplerFront, input.fragUV);\nvar huerotate : f32 = shaderParams.huerotate;\nif (huerotate > 0.5)\n{\nhuerotate = huerotate - 1.0;\n}\nvar rgb : vec3<f32> = c3_RGBtoHSL(front.rgb) + vec3<f32>(huerotate, 0.0, (shaderParams.lumadjust - 1.0) * front.a);\nrgb.y = rgb.y * shaderParams.satadjust;\nrgb = c3_HSLtoRGB(rgb);\nvar output : FragmentOutput;\noutput.color = vec4<f32>(rgb, front.a);\nreturn output;\n}", blendsBackground:!1,usesDepth:!1,extendBoxHorizontal:0,extendBoxVertical:0,crossSampling:!1,mustPreDraw:!1,preservesOpaqueness:!0,animated:!1,parameters:[["huerotate",0,"percent"],["satadjust",0,"percent"],["lumadjust",0,"percent"]]}; self.C3_Shaders.tint={glsl:"varying mediump vec2 vTex;\nuniform lowp sampler2D samplerFront;\nuniform lowp vec3 tintColor;\nvoid main(void)\n{\nlowp vec4 front = texture2D(samplerFront, vTex);\ngl_FragColor = front * vec4(tintColor.r, tintColor.g, tintColor.b, 1.0);\n}",glslWebGL2:"",wgsl:"%%SAMPLERFRONT_BINDING%% var samplerFront : sampler;\n%%TEXTUREFRONT_BINDING%% var textureFront : texture_2d<f32>;\nstruct ShaderParams {\ntintColor : vec3<f32>\n};\n%%SHADERPARAMS_BINDING%% var<uniform> shaderParams : ShaderParams;\n%%FRAGMENTINPUT_STRUCT%%\n%%FRAGMENTOUTPUT_STRUCT%%\n@fragment\nfn main(input : FragmentInput) -> FragmentOutput {\nvar front : vec4<f32> = textureSample(textureFront, samplerFront, input.fragUV);\nvar output : FragmentOutput;\noutput.color = front * vec4<f32>(shaderParams.tintColor, 1.0);\nreturn output;\n}", blendsBackground:!1,usesDepth:!1,extendBoxHorizontal:0,extendBoxVertical:0,crossSampling:!1,mustPreDraw:!1,preservesOpaqueness:!0,animated:!1,parameters:[["tintColor",0,"color"]]}; self.C3_Shaders.overlay={glsl:"precision mediump float;\nvarying mediump vec2 vTex;\nuniform lowp sampler2D samplerFront;\nuniform mediump vec2 srcStart;\nuniform mediump vec2 srcEnd;\nuniform lowp sampler2D samplerBack;\nuniform mediump vec2 destStart;\nuniform mediump vec2 destEnd;\nvoid main(void)\n{\nlowp vec4 front = texture2D(samplerFront, vTex);\nmediump vec2 tex = (vTex - srcStart) / (srcEnd - srcStart);\nlowp vec4 back = texture2D(samplerBack, mix(destStart, destEnd, tex));\nfront.r = back.r < 0.5 ? 2.0 * back.r * front.r : 2.0 * (front.r + back.r * front.a - back.r * front.r) - front.a;\nfront.g = back.g < 0.5 ? 2.0 * back.g * front.g : 2.0 * (front.g + back.g * front.a - back.g * front.g) - front.a;\nfront.b = back.b < 0.5 ? 2.0 * back.b * front.b : 2.0 * (front.b + back.b * front.a - back.b * front.b) - front.a;\nfront *= back.a;\ngl_FragColor = front;\n}",glslWebGL2:"", wgsl:"%%SAMPLERFRONT_BINDING%% var samplerFront : sampler;\n%%TEXTUREFRONT_BINDING%% var textureFront : texture_2d<f32>;\n%%SAMPLERBACK_BINDING%% var samplerBack : sampler;\n%%TEXTUREBACK_BINDING%% var textureBack : texture_2d<f32>;\n%%FRAGMENTINPUT_STRUCT%%\n%%FRAGMENTOUTPUT_STRUCT%%\n@fragment\nfn main(input : FragmentInput) -> FragmentOutput\n{\nvar front : vec4<f32> = textureSample(textureFront, samplerFront, input.fragUV);\nvar back : vec4<f32> = textureSample(textureBack, samplerBack, c3_getBackUV(input.fragPos.xy, textureBack));\nvar rgb : vec3<f32> = select(\n2.0 * (front.rgb + back.rgb * front.a - back.rgb * front.rgb) - front.a,\n2.0 * back.rgb * front.rgb,\nback.rgb < vec3<f32>(0.5)\n);\nvar output : FragmentOutput;\noutput.color = vec4<f32>(rgb, front.a) * back.a;\nreturn output;\n}", blendsBackground:!0,usesDepth:!1,extendBoxHorizontal:0,extendBoxVertical:0,crossSampling:!1,mustPreDraw:!1,preservesOpaqueness:!1,animated:!1,parameters:[]};"use strict";const C3$jscomp$180=self.C3;let cacheRegex=null,lastRegex="",lastFlags="",regexMatches=[],lastMatchesStr="",lastMatchesRegex="",lastMatchesFlags="";const forEachStack=C3$jscomp$180.New(C3$jscomp$180.ArrayStack); function ForEachOrdered_SortInstances(a,b){a=a[1];b=b[1];if("number"===typeof a&&"number"===typeof b)return a-b;a=""+a;b=""+b;return a<b?-1:a>b?1:0} C3$jscomp$180.Plugins.System=class extends C3$jscomp$180.SDKPluginBase{constructor(a){super(a);this._loopStack=this._runtime.GetEventSheetManager().GetLoopStack();this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._imagesLoadingComplete=this._imagesLoadingTotal=0;this._functionMaps=new Map;this._signalTags=[]}Release(){super.Release()}UpdateRender(){this._runtime.UpdateRender()}Trigger(a){this._runtime.Trigger(a,null,null)}GetRegex(a,b){cacheRegex&&a===lastRegex&&b===lastFlags|| (cacheRegex=new RegExp(a,b),lastRegex=a,lastFlags=b);cacheRegex.lastIndex=0;return cacheRegex}GetRegexMatches(a,b,c){if(a===lastMatchesStr&&b===lastMatchesRegex&&c===lastMatchesFlags)return regexMatches;const d=this.GetRegex(b,c);regexMatches=a.match(d);lastMatchesStr=a;lastMatchesRegex=b;lastMatchesFlags=c;return regexMatches}async _LoadTexturesForObjectClasses(a,b){if(b.length){this._imagesLoadingTotal+=b.length;var c=[];for(const d of b)c.push(a.MaybeLoadTexturesFor(d));await C3$jscomp$180.PromiseAllWithProgress(c, ()=>{this._imagesLoadingComplete++});this._imagesLoadingComplete++;this._imagesLoadingComplete===this._imagesLoadingTotal&&(this._imagesLoadingTotal=this._imagesLoadingComplete=0,this._runtime.Trigger(C3$jscomp$180.Plugins.System.Cnds.OnImageLoadingComplete,null,null))}}_UnloadTexturesForObjectClasses(a,b){for(const c of b)0===c.GetInstanceCount()&&a.MaybeUnloadTexturesFor(c)}_GetForEachStack(){return forEachStack}_Repeat(a){var b=this._runtime.GetEventSheetManager();const c=b.GetEventStack(),d=c.GetCurrentStackFrame(), e=d.GetCurrentEvent(),g=e.GetSolModifiers();var k=d.IsSolModifierAfterCnds();const l=c.Push(e),n=b.GetLoopStack(),p=n.Push();p.SetEnd(a);if(k)for(k=0;k<a&&!p.IsStopped();++k)b.PushCopySol(g),p.SetIndex(k),e.Retrigger(d,l),b.PopSol(g);else for(b=0;b<a&&!p.IsStopped();++b)p.SetIndex(b),e.Retrigger(d,l);c.Pop();n.Pop();return!1}*_DebugRepeat(a){var b=this._runtime.GetEventSheetManager();const c=b.GetEventStack(),d=c.GetCurrentStackFrame(),e=d.GetCurrentEvent(),g=e.GetSolModifiers();var k=d.IsSolModifierAfterCnds(); const l=c.Push(e),n=b.GetLoopStack(),p=n.Push();p.SetEnd(a);if(k)for(k=0;k<a&&!p.IsStopped();++k)b.PushCopySol(g),p.SetIndex(k),yield*e.DebugRetrigger(d,l),b.PopSol(g);else for(b=0;b<a&&!p.IsStopped();++b)p.SetIndex(b),yield*e.DebugRetrigger(d,l);c.Pop();n.Pop();return!1}_While(){var a=this._runtime.GetEventSheetManager();const b=a.GetEventStack(),c=b.GetCurrentStackFrame(),d=c.GetCurrentEvent(),e=d.GetSolModifiers();var g=c.IsSolModifierAfterCnds();const k=b.Push(d),l=a.GetLoopStack(),n=l.Push(); if(g)for(g=0;!n.IsStopped();++g)a.PushCopySol(e),n.SetIndex(g),d.Retrigger(c,k)||n.Stop(),a.PopSol(e);else for(a=0;!n.IsStopped();++a)n.SetIndex(a),d.Retrigger(c,k)||n.Stop();b.Pop();l.Pop();return!1}*_DebugWhile(){var a=this._runtime.GetEventSheetManager();const b=a.GetEventStack(),c=b.GetCurrentStackFrame(),d=c.GetCurrentEvent(),e=d.GetSolModifiers();var g=c.IsSolModifierAfterCnds();const k=b.Push(d),l=a.GetLoopStack(),n=l.Push();if(g)for(g=0;!n.IsStopped();++g)a.PushCopySol(e),n.SetIndex(g),(yield*d.DebugRetrigger(c, k))||n.Stop(),a.PopSol(e);else for(a=0;!n.IsStopped();++a)n.SetIndex(a),(yield*d.DebugRetrigger(c,k))||n.Stop();b.Pop();l.Pop();return!1}_For(a,b,c){var d=this._runtime.GetEventSheetManager();const e=d.GetEventStack(),g=e.GetCurrentStackFrame(),k=g.GetCurrentEvent(),l=k.GetSolModifiers(),n=g.IsSolModifierAfterCnds(),p=e.Push(k),r=d.GetLoopStack(),w=r.Push();w.SetName(a);w.SetEnd(c);if(c<b)if(n)for(a=b;a>=c&&!w.IsStopped();--a)d.PushCopySol(l),w.SetIndex(a),k.Retrigger(g,p),d.PopSol(l);else for(d= b;d>=c&&!w.IsStopped();--d)w.SetIndex(d),k.Retrigger(g,p);else if(n)for(a=b;a<=c&&!w.IsStopped();++a)d.PushCopySol(l),w.SetIndex(a),k.Retrigger(g,p),d.PopSol(l);else for(d=b;d<=c&&!w.IsStopped();++d)w.SetIndex(d),k.Retrigger(g,p);e.Pop();r.Pop();return!1}*_DebugFor(a,b,c){var d=this._runtime.GetEventSheetManager();const e=d.GetEventStack(),g=e.GetCurrentStackFrame(),k=g.GetCurrentEvent(),l=k.GetSolModifiers(),n=g.IsSolModifierAfterCnds(),p=e.Push(k),r=d.GetLoopStack(),w=r.Push();w.SetName(a);w.SetEnd(c); if(c<b)if(n)for(a=b;a>=c&&!w.IsStopped();--a)d.PushCopySol(l),w.SetIndex(a),yield*k.DebugRetrigger(g,p),d.PopSol(l);else for(d=b;d>=c&&!w.IsStopped();--d)w.SetIndex(d),yield*k.DebugRetrigger(g,p);else if(n)for(a=b;a<=c&&!w.IsStopped();++a)d.PushCopySol(l),w.SetIndex(a),yield*k.DebugRetrigger(g,p),d.PopSol(l);else for(d=b;d<=c&&!w.IsStopped();++d)w.SetIndex(d),yield*k.DebugRetrigger(g,p);e.Pop();r.Pop();return!1}_ForEach(a){var b=this._runtime.GetEventSheetManager();const c=b.GetEventStack(),d=c.GetCurrentStackFrame(), e=d.GetCurrentEvent(),g=e.GetSolModifiers();var k=d.IsSolModifierAfterCnds();const l=c.Push(e),n=b.GetLoopStack(),p=n.Push(),r=a.IsInContainer(),w=a.GetCurrentSol(),y=forEachStack.Push();C3$jscomp$180.shallowAssignArray(y,w.GetInstances());p.SetEnd(y.length);if(k)for(let B=0,C=y.length;B<C&&!p.IsStopped();++B)b.PushCopySol(g),k=y[B],a.GetCurrentSol().SetSinglePicked(k),r&&k.SetSiblingsSinglePicked(),p.SetIndex(B),e.Retrigger(d,l),b.PopSol(g);else{w._SetSelectAll(!1);a=w._GetOwnInstances();C3$jscomp$180.clearArray(a); a.push(null);for(let B=0,C=y.length;B<C&&!p.IsStopped();++B)b=y[B],a[0]=b,r&&b.SetSiblingsSinglePicked(),p.SetIndex(B),e.Retrigger(d,l)}c.Pop();n.Pop();C3$jscomp$180.clearArray(y);forEachStack.Pop();return!1}*_DebugForEach(a){var b=this._runtime.GetEventSheetManager();const c=b.GetEventStack(),d=c.GetCurrentStackFrame(),e=d.GetCurrentEvent(),g=e.GetSolModifiers();var k=d.IsSolModifierAfterCnds();const l=c.Push(e),n=b.GetLoopStack(),p=n.Push(),r=a.IsInContainer(),w=a.GetCurrentSol(),y=forEachStack.Push(); C3$jscomp$180.shallowAssignArray(y,w.GetInstances());p.SetEnd(y.length);if(k)for(let B=0,C=y.length;B<C&&!p.IsStopped();++B)b.PushCopySol(g),k=y[B],a.GetCurrentSol().SetSinglePicked(k),r&&k.SetSiblingsSinglePicked(),p.SetIndex(B),yield*e.DebugRetrigger(d,l),b.PopSol(g);else{w._SetSelectAll(!1);a=w._GetOwnInstances();C3$jscomp$180.clearArray(a);a.push(null);for(let B=0,C=y.length;B<C&&!p.IsStopped();++B)b=y[B],a[0]=b,r&&b.SetSiblingsSinglePicked(),p.SetIndex(B),yield*e.DebugRetrigger(d,l)}c.Pop(); n.Pop();C3$jscomp$180.clearArray(y);forEachStack.Pop();return!1}_ForEachOrdered(a,b){var c=this._runtime.GetEventSheetManager();const d=c.GetEventStack(),e=c.GetCurrentCondition(),g=d.GetCurrentStackFrame(),k=g.GetCurrentEvent(),l=k.GetSolModifiers(),n=g.IsSolModifierAfterCnds(),p=d.Push(k),r=c.GetLoopStack(),w=r.Push(),y=a.IsInContainer(),B=a.GetCurrentSol(),C=forEachStack.Push();C3$jscomp$180.clearArray(C);const E=B.GetInstances();w.SetEnd(E.length);for(let F=0,J=E.length;F<J;++F)C.push([E[F],e.ReevaluateParameter(1, F)]);C.sort(ForEachOrdered_SortInstances);1===b&&C.reverse();if(n)for(let F=0,J=C.length;F<J&&!w.IsStopped();++F)c.PushCopySol(l),b=C[F][0],a.GetCurrentSol().SetSinglePicked(b),y&&b.SetSiblingsSinglePicked(),w.SetIndex(F),k.Retrigger(g,p),c.PopSol(l);else{B._SetSelectAll(!1);a=B._GetOwnInstances();C3$jscomp$180.clearArray(a);a.push(null);for(let F=0,J=C.length;F<J&&!w.IsStopped();++F)c=C[F][0],a[0]=c,y&&c.SetSiblingsSinglePicked(),w.SetIndex(F),k.Retrigger(g,p)}d.Pop();r.Pop();C3$jscomp$180.clearArray(C); forEachStack.Pop();return!1}*_DebugForEachOrdered(a,b){var c=this._runtime.GetEventSheetManager();const d=c.GetEventStack(),e=c.GetCurrentCondition(),g=d.GetCurrentStackFrame(),k=g.GetCurrentEvent(),l=k.GetSolModifiers(),n=g.IsSolModifierAfterCnds(),p=d.Push(k),r=c.GetLoopStack(),w=r.Push(),y=a.IsInContainer(),B=a.GetCurrentSol(),C=forEachStack.Push();C3$jscomp$180.clearArray(C);const E=B.GetInstances();w.SetEnd(E.length);for(let F=0,J=E.length;F<J;++F)C.push([E[F],e.ReevaluateParameter(1,F)]);C.sort(ForEachOrdered_SortInstances); 1===b&&C.reverse();if(n)for(let F=0,J=C.length;F<J&&!w.IsStopped();++F)c.PushCopySol(l),b=C[F][0],a.GetCurrentSol().SetSinglePicked(b),y&&b.SetSiblingsSinglePicked(),w.SetIndex(F),yield*k.DebugRetrigger(g,p),c.PopSol(l);else{B._SetSelectAll(!1);a=B._GetOwnInstances();C3$jscomp$180.clearArray(a);a.push(null);for(let F=0,J=C.length;F<J&&!w.IsStopped();++F)c=C[F][0],a[0]=c,y&&c.SetSiblingsSinglePicked(),w.SetIndex(F),yield*k.DebugRetrigger(g,p)}d.Pop();r.Pop();C3$jscomp$180.clearArray(C);forEachStack.Pop(); return!1}_GetFunctionMap(a,b){let c=this._functionMaps.get(a);if(c)return c;if(!b)return null;c={defaultFunc:null,strMap:new Map};this._functionMaps.set(a,c);return c}_DoCallMappedFunction(a,b,c,d,e){b.GetEventBlock().RunAsMappedFunctionCall(c,b.IsCopyPicked());d&&a.PopSol(e)}*_DebugDoCallMappedFunction(a,b,c,d,e){yield*b.GetEventBlock().DebugRunAsMappedFunctionCall(c,b.IsCopyPicked());d&&a.PopSol(e)}};const C3$jscomp$181=self.C3; C3$jscomp$181.Plugins.System.Type=class extends C3$jscomp$181.DefendedBase{constructor(a){super();this._objectClass=a;this._runtime=a.GetRuntime();this._plugin=a.GetPlugin()}OnCreate(){}Release(){this._plugin=this._runtime=this._objectClass=null}};const C3$jscomp$182=self.C3; C3$jscomp$182.Plugins.System.Instance=class extends C3$jscomp$182.DefendedBase{constructor(a,b){super();this._inst=a;this._objectClass=this._inst.GetObjectClass();this._sdkType=this._objectClass.GetSdkType();this._runtime=this._inst.GetRuntime()}Release(){this._runtime=this._sdkType=this._objectClass=this._inst=null}};const C3$jscomp$183=self.C3,tmpPickArray=[]; C3$jscomp$183.Plugins.System.Cnds={EveryTick(){return!0},OnLayoutStart(){return!0},OnLayoutEnd(){return!0},OnSuspend(){return!0},OnResume(){return!0},IsSuspended(){return this._runtime.IsSuspended()},Else(){const a=this._runtime.GetCurrentEventStackFrame();return a.GetElseBranchRan()?!1:!a.GetLastEventTrue()},TriggerOnce(){const a=this._runtime.GetCurrentCondition().GetSavedDataMap();let b=a.get("TriggerOnce_lastTick");"undefined"===typeof b&&(b=-1,a.set("TriggerOnce_lastTick",-1));const c=this._runtime.GetTickCount(); a.set("TriggerOnce_lastTick",c);return this._runtime.IsLayoutFirstTick()||b!==c-1},Every(a){const b=this._runtime.GetCurrentCondition().GetSavedDataMap(),c=b.get("Every_lastTime")||0,d=this._runtime.GetGameTime();b.has("Every_seconds")||b.set("Every_seconds",a);const e=b.get("Every_seconds");if(d>=c+e)return b.set("Every_lastTime",c+e),d>=b.get("Every_lastTime")+.04&&b.set("Every_lastTime",d),b.set("Every_seconds",a),!0;d<c-.1&&b.set("Every_lastTime",d);return!1},IsGroupActive(a){return(a=this._runtime.GetEventSheetManager().GetEventGroupByName(a))&& a.IsGroupActive()},IsPreview(){return this._runtime.IsPreview()},IsMobile(){return C3$jscomp$183.Platform.IsMobile},OnLoadFinished(){return!0},OnCanvasSnapshot(){return!0},EffectsSupported(){return!0},OnSaveComplete(){return!0},OnSaveFailed(){return!0},OnLoadComplete(){return!0},OnLoadFailed(){return!0},ObjectUIDExists(a){return!!this._runtime.GetInstanceByUID(a)},IsOnPlatform(a){switch(a){case 0:return"browser"===C3$jscomp$183.Platform.Context;case 1:return"iOS"===C3$jscomp$183.Platform.OS;case 2:return"Android"=== C3$jscomp$183.Platform.OS;case 8:return"cordova"===C3$jscomp$183.Platform.Context;case 9:return"scirra-arcade"===this._runtime.GetExportType();case 10:return"nwjs"===C3$jscomp$183.Platform.Context;case 13:return"windows-uwp"===this._runtime.GetExportType();default:return!1}},RegexTest(a,b,c){return this.GetRegex(b,c).test(a)},Compare(a,b,c){return C3$jscomp$183.compare(a,b,c)},CompareBetween(a,b,c){return a>=b&&a<=c},CompareVar(a,b,c){return C3$jscomp$183.compare(a.GetValue(),b,c)},CompareBoolVar(a){return!!a.GetValue()}, CompareTime(a,b){const c=this._runtime.GetGameTime();return 0===a?(a=this._runtime.GetCurrentCondition().GetSavedDataMap(),!a.get("CompareTime_executed")&&c>=b?(a.set("CompareTime_executed",!0),!0):!1):C3$jscomp$183.compare(c,a,b)},IsNaN(a){return isNaN(a)},AngleWithin(a,b,c){return C3$jscomp$183.angleDiff(C3$jscomp$183.toRadians(a),C3$jscomp$183.toRadians(c))<=C3$jscomp$183.toRadians(b)},IsClockwiseFrom(a,b){return C3$jscomp$183.angleClockwise(C3$jscomp$183.toRadians(a),C3$jscomp$183.toRadians(b))}, IsBetweenAngles(a,b,c){a=C3$jscomp$183.toRadians(a);b=C3$jscomp$183.toRadians(b);c=C3$jscomp$183.toRadians(c);return C3$jscomp$183.angleClockwise(c,b)?C3$jscomp$183.angleClockwise(a,b)&&!C3$jscomp$183.angleClockwise(a,c):!(!C3$jscomp$183.angleClockwise(a,b)&&C3$jscomp$183.angleClockwise(a,c))},IsValueType(a,b){return"number"===typeof a?0===b:1===b},EvaluateExpression(a){return!!a},OnSignal(a){return a.toLowerCase()===this._signalTags.at(-1)},PickByComparison(a,b,c,d){if(!a)return!1;const e=this._GetForEachStack(), g=e.Push(),k=a.GetCurrentSol();C3$jscomp$183.shallowAssignArray(g,k.GetInstances());k.IsSelectAll()&&C3$jscomp$183.clearArray(k._GetOwnElseInstances());const l=this._runtime.GetCurrentCondition();let n=0;for(let p=0,r=g.length;p<r;++p){const w=g[p];g[n]=w;b=l.ReevaluateParameter(1,p);d=l.ReevaluateParameter(3,p);C3$jscomp$183.compare(b,c,d)?++n:k._PushElseInstance(w)}C3$jscomp$183.truncateArray(g,n);k.SetArrayPicked(g);b=!!g.length;C3$jscomp$183.clearArray(g);e.Pop();a.ApplySolToContainer();return b}, PickByEvaluate(a,b){if(!a)return!1;const c=this._GetForEachStack(),d=c.Push(),e=a.GetCurrentSol();C3$jscomp$183.shallowAssignArray(d,e.GetInstances());e.IsSelectAll()&&C3$jscomp$183.clearArray(e._GetOwnElseInstances());const g=this._runtime.GetCurrentCondition();let k=0;for(let l=0,n=d.length;l<n;++l){const p=d[l];d[k]=p;(b=g.ReevaluateParameter(1,l))?++k:e._PushElseInstance(p)}C3$jscomp$183.truncateArray(d,k);e.SetArrayPicked(d);b=!!d.length;C3$jscomp$183.clearArray(d);c.Pop();a.ApplySolToContainer(); return b},PickNth(a,b){if(!a)return!1;const c=a.GetCurrentSol(),d=c.GetInstances();b=Math.floor(b);if(b>=d.length)return!1;c.PickOne(d[b]);a.ApplySolToContainer();return!0},PickRandom(a){if(!a)return!1;const b=a.GetCurrentSol(),c=b.GetInstances(),d=Math.floor(this._runtime.Random()*c.length);if(d>=c.length)return!1;b.PickOne(c[d]);a.ApplySolToContainer();return!0},PickAll(a){if(!a||!a.GetInstanceCount())return!1;a.GetCurrentSol()._SetSelectAll(!0);a.ApplySolToContainer();return!0},PickOverlappingPoint(a, b,c){if(!a)return!1;const d=a.GetCurrentSol();var e=d.GetInstances();const g=this._runtime.GetCurrentEvent().IsOrBlock(),k=this._runtime.GetCurrentCondition().IsInverted();d.IsSelectAll()?(C3$jscomp$183.shallowAssignArray(tmpPickArray,e),d.ClearArrays(),d._SetSelectAll(!1)):g?(C3$jscomp$183.shallowAssignArray(tmpPickArray,d._GetOwnElseInstances()),C3$jscomp$183.clearArray(d._GetOwnElseInstances())):(C3$jscomp$183.shallowAssignArray(tmpPickArray,d._GetOwnInstances()),C3$jscomp$183.clearArray(d._GetOwnInstances())); for(let l=0,n=tmpPickArray.length;l<n;++l)e=tmpPickArray[l],C3$jscomp$183.xor(e.GetWorldInfo().ContainsPoint(b,c),k)?d._PushInstance(e):d._PushElseInstance(e);a.ApplySolToContainer();return C3$jscomp$183.xor(!!d._GetOwnInstances().length,k)},PickLastCreated(a){if(!a)return!1;var b=a.IsFamily();let c=null;const d=this._runtime._GetInstancesPendingCreate();for(let e=d.length-1;0<=e;--e){const g=d[e];if(b){if(g.GetObjectClass().BelongsToFamily(a)){c=g;break}}else if(g.GetObjectClass()===a){c=g;break}}c|| (b=a.GetInstances(),b.length&&(c=b.at(-1)));if(!c)return!1;a.GetCurrentSol().PickOne(c);a.ApplySolToContainer();return!0},Repeat(a){return this._runtime.IsDebugging()?this._DebugRepeat(a):this._Repeat(a)},While(){return this._runtime.IsDebugging()?this._DebugWhile():this._While()},For(a,b,c){return this._runtime.IsDebugging()?this._DebugFor(a,b,c):this._For(a,b,c)},ForEach(a){return this._runtime.IsDebugging()?this._DebugForEach(a):this._ForEach(a)},ForEachOrdered(a,b,c){return this._runtime.IsDebugging()? this._DebugForEachOrdered(a,c):this._ForEachOrdered(a,c)},LayerVisible(a){return a?a.IsVisible():!1},LayerInteractive(a){return a?a.IsSelfAndParentsInteractive():!1},LayerEmpty(a){return a?!a.GetInstanceCount():!1},LayerCmpOpacity(a,b,c){return a?C3$jscomp$183.compare(100*a.GetOpacity(),b,c):!1},OnImageLoadingComplete(){return!0},IsLoadingImages(){return 0<this._imagesLoadingTotal},TemplateExists(a,b){const c=this._runtime.GetTemplateManager();return c&&b?!!c.GetTemplateData(a,b):!1}}; const C3$jscomp$184=self.C3;function SortZOrderList$jscomp$1(a,b){const c=a[0]-b[0];return 0!==c?c:a[1]-b[1]}function SortInstancesByValue(a,b){return a[1]-b[1]}const tempZOrderList$jscomp$1=[],tempInstValues=[],tempRect$jscomp$9=C3$jscomp$184.New(C3$jscomp$184.Rect),tempColor$jscomp$7=C3$jscomp$184.New(C3$jscomp$184.Color); C3$jscomp$184.Plugins.System.Acts={SetVar(a,b){a.SetValue(b)},AddVar(a,b){a.IsNumber()&&"number"!==typeof b&&(b=parseFloat(b));a.SetValue(a.GetValue()+b)},SubVar(a,b){a.IsNumber()&&a.SetValue(a.GetValue()-b)},SetBoolVar(a,b){a.SetValue(!!b)},ToggleBoolVar(a){a.SetValue(!a.GetValue())},ResetGlobals(){this._runtime.GetEventSheetManager().ResetAllGlobalsToInitialValue()},CreateObject(a,b,c,d,e,g){if(a&&b&&(c=this._runtime.CreateInstance(a,b,c,d,e,g))){e&&b.SortAndAddInstancesByZIndex(c);b=this._runtime.GetEventSheetManager(); b.BlockFlushingInstances(!0);c._TriggerOnCreatedOnSelfAndRelated();b.BlockFlushingInstances(!1);b=new Map;c.CollectInstancesToPick(b,a,e);for(const [k,l]of b)k.GetCurrentSol().SetSetPicked(l)}},CreateObjectByName(a,b,c,d,e,g){a&&b&&(a=this._runtime.GetObjectClassByName(a))&&C3$jscomp$184.Plugins.System.Acts.CreateObject.call(this,a,b,c,d,e,g)},RecreateInitialObjects(a,b,c,d,e,g,k,l,n,p){if(a){var r=this._runtime.GetCurrentLayout();if(g&&(r=this._runtime.GetLayoutManager().GetLayoutByName(g),!r))return; g=null;if("number"!==typeof k||0<=k)if(g=r.GetLayer(k),!g)return;tempRect$jscomp$9.set(b,c,d,e);b=r.RecreateInitialObjects(a,tempRect$jscomp$9,g,l,n,p);a.GetCurrentSol().SetArrayPicked(b);a.ApplySolToContainer()}},StopLoop(){const a=this._loopStack;a.IsInLoop()&&a.GetCurrent().Stop()},SetGroupActive(a,b){(a=this._runtime.GetEventSheetManager().GetEventGroupByName(a))&&(0===b?a.SetGroupActive(!1):1===b?a.SetGroupActive(!0):a.SetGroupActive(!a.IsGroupActive()))},SetTimescale(a){this._runtime.SetTimeScale(a)}, SetObjectTimescale(a,b){0>b&&(b=0);if(a){a=a.GetCurrentSol().GetInstances();for(const c of a)c.SetTimeScale(b)}},RestoreObjectTimescale(a){if(a){a=a.GetCurrentSol().GetInstances();for(const b of a)b.RestoreTimeScale()}},Wait(a){if(!(0>a))return this._runtime.GetEventSheetManager().AddScheduledWait().InitTimer(a),!0},WaitForSignal(a){this._runtime.GetEventSheetManager().AddScheduledWait().InitSignal(a);return!0},WaitForPreviousActions(){const a=this._runtime.GetEventSheetManager();a.AddScheduledWait().InitPromise(a.GetPromiseForAllAsyncActions()); return!0},Signal(a){a=a.toLowerCase();this._signalTags.push(a);this._runtime.Trigger(C3$jscomp$184.Plugins.System.Cnds.OnSignal,null);this._signalTags.pop();for(const b of this._runtime.GetEventSheetManager().scheduledWaits())b.IsSignal()&&b.GetSignalTag()===a&&b.SetSignalled()},async SnapshotCanvas(a,b,c,d,e,g){const k=this._runtime.GetCanvasManager();k&&(this.UpdateRender(),await k.SnapshotCanvas(0===a?"image/png":"image/jpeg",b/100,c,d,e,g),await this._runtime.TriggerAsync(C3$jscomp$184.Plugins.System.Cnds.OnCanvasSnapshot, null))},SetCanvasSize(a,b){if(!(0>=a||0>=b)){this._runtime.SetViewportSize(a,b);this._runtime.GetCurrentLayout().BoundScrolling();var c=this._runtime.GetCanvasManager();c&&("off"!==c.GetCurrentFullscreenMode()&&this._runtime.SetOriginalViewportSize(a,b),c.SetSize(c.GetLastWidth(),c.GetLastHeight(),!0),this._runtime.UpdateRender())}},SetFullscreenQuality(a){const b=this._runtime.GetCanvasManager();b&&"off"!==b.GetCurrentFullscreenMode()&&(b.SetFullscreenScalingQuality(0!==a?"high":"low"),b.SetSize(b.GetLastWidth(), b.GetLastHeight(),!0))},SaveState(a){this._runtime.SaveToSlot(a)},LoadState(a){this._runtime.LoadFromSlot(a)},LoadStateJSON(a){this._runtime.LoadFromJsonString(a)},SetHalfFramerateMode(a){},ResetPersisted(){for(const a of this._runtime.GetLayoutManager().GetAllLayouts())a.ResetPersistData()},SetPixelRounding(a){this._runtime.SetPixelRoundingEnabled(0!==a)},SetMinimumFramerate(a){this._runtime.SetMinimumFramerate(a)},SortZOrderByInstVar(a,b){if(a){var c=a.GetCurrentSol().GetInstances(),d=this._runtime.GetCurrentLayout(), e=a.IsFamily();a=a.GetFamilyIndex();for(let k=0,l=c.length;k<l;++k){var g=c[k];const n=g.GetWorldInfo();if(!n)continue;let p;p=e?g.GetInstanceVariableValue(b+g.GetObjectClass().GetFamilyInstanceVariableOffset(a)):g.GetInstanceVariableValue(b);tempZOrderList$jscomp$1.push([n.GetLayer().GetIndex(),n.GetZIndex()]);tempInstValues.push([g,p])}if(tempZOrderList$jscomp$1.length){tempZOrderList$jscomp$1.sort(SortZOrderList$jscomp$1);tempInstValues.sort(SortInstancesByValue);b=!1;for(let k=0,l=tempZOrderList$jscomp$1.length;k< l;++k)c=tempInstValues[k][0],e=d.GetLayerByIndex(tempZOrderList$jscomp$1[k][0]),a=tempZOrderList$jscomp$1[k][1],g=e._GetInstances(),g[a]!==c&&(g[a]=c,c.GetWorldInfo()._SetLayer(e,!0),e.SetZIndicesChanged(),b=!0);b&&this._runtime.UpdateRender();C3$jscomp$184.clearArray(tempZOrderList$jscomp$1);C3$jscomp$184.clearArray(tempInstValues)}}},GoToLayout(a){if(!this._runtime.IsLoading()){var b=this._runtime.GetLayoutManager();b.IsPendingChangeMainLayout()||b.ChangeMainLayout(a)}},GoToLayoutByName(a){if(!this._runtime.IsLoading()){var b= this._runtime.GetLayoutManager();b.IsPendingChangeMainLayout()||(a=b.GetLayoutByName(a))&&b.ChangeMainLayout(a)}},NextPrevLayout(a){if(!this._runtime.IsLoading()){var b=this._runtime.GetLayoutManager();if(!b.IsPendingChangeMainLayout()){var c=b.GetAllLayouts(),d=c.indexOf(b.GetMainRunningLayout());a&&0===d||(a||d!==c.length-1)&&b.ChangeMainLayout(c[d+(a?-1:1)])}}},RestartLayout(){if(!this._runtime.IsLoading()){var a=this._runtime.GetLayoutManager();a.IsPendingChangeMainLayout()||(a.ChangeMainLayout(a.GetMainRunningLayout()), this._runtime.GetEventSheetManager().ResetAllGroupsInitialActivation())}},SetLayerVisible(a,b){a&&a.SetVisible(b)},SetLayerInteractive(a,b){a&&a.SetInteractive(b)},SetLayerOpacity(a,b){a&&a.SetOpacity(b/100)},SetLayerScale(a,b){a&&a.SetOwnScale(b)},SetLayerScaleRate(a,b){a&&a.SetScaleRate(b)},SetLayerAngle(a,b){a&&a.SetAngle(C3$jscomp$184.toRadians(+b))},SetLayerScroll(a,b,c){a&&(a.SetOwnScrollPositionEnabled(!0),a.SetScrollX(b),a.SetScrollY(c))},RestoreLayerScroll(a){a&&a.SetOwnScrollPositionEnabled(!1)}, SetLayerParallax(a,b,c){a&&a.SetParallax(b/100,c/100)},SetLayerZElevation(a,b){a&&a.SetZElevation(+b)},SetLayerBackground(a,b){a&&(tempColor$jscomp$7.setFromRgbValue(b),tempColor$jscomp$7.clamp(),a=a.GetBackgroundColor(),a.equalsIgnoringAlpha(tempColor$jscomp$7)||(a.copyRgb(tempColor$jscomp$7),this.UpdateRender()))},SetLayerTransparent(a,b){a&&a.SetTransparent(b)},SetLayerBlendMode(a,b){a&&a.SetBlendMode(b)},SetLayerEffectEnabled(a,b,c){a&&(c=a.GetEffectList().GetEffectTypeByName(c))&&(b=1===b,c.IsActive()!== b&&(c.SetActive(b),a.UpdateActiveEffects(),this._runtime.UpdateRender()))},SetLayerEffectParam(a,b,c,d){if(a&&(a=a.GetEffectList(),b=a.GetEffectTypeByName(b))){c=Math.floor(c);var e=b.GetShaderProgram().GetParameterType(c);e&&("color"===e?(tempColor$jscomp$7.setFromRgbValue(d),d=tempColor$jscomp$7):"percent"===e&&(d/=100),a.SetEffectParameter(b.GetIndex(),c,d)&&b.IsActive()&&this._runtime.UpdateRender())}},SetLayerForceOwnTexture(a,b){a&&a.SetForceOwnTexture(b)},SetLayoutScale(a){this._runtime.GetCurrentLayout().SetScale(+a)}, SetLayoutAngle(a){this._runtime.GetCurrentLayout().SetAngle(C3$jscomp$184.toRadians(+a))},SetLayoutEffectEnabled(a,b){const c=this._runtime.GetCurrentLayout();if(b=c.GetEffectList().GetEffectTypeByName(b))a=1===a,b.IsActive()!==a&&(b.SetActive(a),c.UpdateActiveEffects(),this._runtime.UpdateRender())},SetLayoutEffectParam(a,b,c){const d=this._runtime.GetCurrentLayout().GetEffectList();if(a=d.GetEffectTypeByName(a)){b=Math.floor(b);var e=a.GetShaderProgram().GetParameterType(b);e&&("color"===e?(tempColor$jscomp$7.setFromRgbValue(c), c=tempColor$jscomp$7):"percent"===e&&(c/=100),d.SetEffectParameter(a.GetIndex(),b,c)&&a.IsActive()&&this._runtime.UpdateRender())}},SetLayoutVanishingPoint(a,b){this._runtime.GetCurrentLayout().SetVanishingPointXY(a/100,b/100)},SetLayoutProjection(a){const b=this._runtime.GetCurrentLayout();0===a?b.SetPerspectiveProjection():b.SetOrthographicProjection()},ScrollX(a){this._runtime.GetCurrentLayout().SetScrollX(a)},ScrollY(a){this._runtime.GetCurrentLayout().SetScrollY(a)},Scroll(a,b){const c=this._runtime.GetCurrentLayout(); c.SetScrollX(a);c.SetScrollY(b)},ScrollToObject(a){if(a&&(a=a.GetFirstPicked())&&(a=a.GetWorldInfo())){var b=this._runtime.GetCurrentLayout();b.SetScrollX(a.GetX());b.SetScrollY(a.GetY())}},AddLayer(a,b,c){const d=this._runtime.GetCurrentLayout();try{d.AddLayer(a,b,c)}catch(e){console.warn("[Construct] Cannot add layer: ",e)}},MoveLayer(a,b,c){if(a){var d=this._runtime.GetCurrentLayout();try{d.MoveLayer(a,b,c)}catch(e){console.warn("[Construct] Cannot move layer: ",e)}}},RemoveLayer(a){a&&this._runtime.GetCurrentLayout().RemoveLayer(a)}, RemoveAllDynamicLayers(){this._runtime.GetCurrentLayout().RemoveAllDynamicLayers()},async LoadObjectTextures(a){const b=this._runtime.GetMainRunningLayout();b&&a&&!this._runtime.IsLoading()&&(a=a.IsFamily()?a.GetFamilyMembers():[a],await this._LoadTexturesForObjectClasses(b,a))},async LoadObjectTexturesByName(a){await C3$jscomp$184.Plugins.System.Acts.LoadObjectTextures.call(this,this._runtime.GetObjectClassByName(a))},UnloadObjectTextures(a){const b=this._runtime.GetMainRunningLayout();b&&a&&(a= a.IsFamily()?a.GetFamilyMembers():[a],this._UnloadTexturesForObjectClasses(b,a))},UnloadObjectTexturesByName(a){C3$jscomp$184.Plugins.System.Acts.UnloadObjectTextures.call(this,this._runtime.GetObjectClassByName(a))},UnloadUnusedTextures(){const a=this._runtime.GetMainRunningLayout();if(a){var b=a._GetTextureLoadedObjectTypes();this._UnloadTexturesForObjectClasses(a,b)}},async LoadLayoutTextures(a){const b=this._runtime.GetMainRunningLayout();a&&b&&!this._runtime.IsLoading()&&await this._LoadTexturesForObjectClasses(b, a._GetInitialObjectClasses())},async LoadLayoutTexturesByName(a){const b=this._runtime.GetMainRunningLayout();(a=this._runtime.GetLayoutManager().GetLayoutByName(a))&&b&&!this._runtime.IsLoading()&&await this._LoadTexturesForObjectClasses(b,a._GetInitialObjectClasses())},SetFunctionReturnValue(a){const b=this._eventStack.GetCurrentExpFuncStackFrame();if(b)switch(b.GetFunctionReturnType()){case 1:"number"===typeof a&&b.SetFunctionReturnValue(a);break;case 2:"string"===typeof a&&b.SetFunctionReturnValue(a); break;case 3:b.SetFunctionReturnValue(a)}},MapFunction(a,b,c){var d=this._GetFunctionMap(a.toLowerCase(),!0);const e=d.strMap,g=b.toLowerCase();e.has(g)&&console.warn(`[Construct] Function map '${a}' string '${b}' already in map; overwriting entry`);if(d=C3$jscomp$184.first(e.values())||d.defaultFunc){d=0!==d.GetReturnType();const k=0!==c.GetReturnType();if(d!==k){console.error(`[Construct] Function map '${a}' string '${b}' function return type not compatible with other functions in the map; entry ignored`); return}}e.set(g,c)},MapFunctionDefault(a,b){const c=this._GetFunctionMap(a.toLowerCase(),!0);c.defaultFunc&&console.warn(`[Construct] Function map '${a}' already has a default; overwriting entry`);var d=C3$jscomp$184.first(c.strMap.values())||c.defaultFunc;if(d){d=0!==d.GetReturnType();const e=0!==b.GetReturnType();if(d!==e){console.error(`[Construct] Function map '${a}' default: function return type not compatible with other functions in the map; entry ignored`);return}}c.defaultFunc=b},CallMappedFunction(a, b,c){c=Math.floor(c);var d=this._GetFunctionMap(a.toLowerCase(),!1);if(d){var e=d.strMap.get(b.toLowerCase());if(!e)if(d.defaultFunc)e=d.defaultFunc,c=0;else{console.warn(`[Construct] Call mapped function: no function associated with map '${a}' string '${b}'; call ignored (consider setting a default)`);return}if(e.IsEnabled())if(0!==e.GetReturnType())console.warn(`[Construct] Call mapped function: map '${a}' string '${b}' has a return type so cannot be called`);else{a=this._runtime;b=a.GetEventSheetManager(); var g=b.GetCurrentEvent();d=g.GetSolModifiersIncludingParents();var k=0<d.length;k&&(e.IsCopyPicked()?b.PushCopySol(d):b.PushCleanSol(d));var l=[];if(g=b.FindFirstFunctionBlockParent(g)){g=g.GetFunctionParameters();for(let n=c,p=g.length;n<p;++n)l.push(g[n].GetValue())}c=e.GetFunctionParameters();for(let n=l.length,p=c.length;n<p;++n)l.push(c[n].GetInitialValue());return a.IsDebugging()?this._DebugDoCallMappedFunction(b,e,l,k,d):this._DoCallMappedFunction(b,e,l,k,d)}}else console.warn(`[Construct] Call mapped function: map name '${a}' not found; call ignored`)}}; const C3$jscomp$185=self.C3; C3$jscomp$185.Plugins.System.Exps={int:function(a){"string"===typeof a&&(a=parseInt(a,10),isNaN(a)&&(a=0));return Math.floor(a)},float:function(a){"string"===typeof a&&(a=parseFloat(a),isNaN(a)&&(a=0));return a},str(a){return a.toString()},len(a){return"string"===typeof a?a.length:0},random(a,b){return"undefined"===typeof b?this._runtime.Random()*a:this._runtime.Random()*(b-a)+a},choose(...a){const b=Math.floor(this._runtime.Random()*a.length);return a[b]},chooseindex(a,...b){"number"!==typeof a&& (a=0);a=C3$jscomp$185.clamp(Math.floor(a),0,b.length-1);return b[a]},pi(){return Math.PI},infinity(){return Infinity},sqrt(a){return Math.sqrt(a)},abs(a){return Math.abs(a)},round(a){return Math.round(a)},roundtodp(a,b){b=Math.max(Math.floor(b),0);b=Math.pow(10,b);return Math.round((a+Number.EPSILON)*b)/b},floor(a){return Math.floor(a)},ceil(a){return Math.ceil(a)},sign(a){return Math.sign(a)},sin(a){return Math.sin(C3$jscomp$185.toRadians(a))},cos(a){return Math.cos(C3$jscomp$185.toRadians(a))}, tan(a){return Math.tan(C3$jscomp$185.toRadians(a))},asin(a){return C3$jscomp$185.toDegrees(Math.asin(a))},acos(a){return C3$jscomp$185.toDegrees(Math.acos(a))},atan(a){return C3$jscomp$185.toDegrees(Math.atan(a))},exp(a){return Math.exp(a)},ln(a){return Math.log(a)},log10(a){return Math.log(a)/Math.LN10},max(...a){let b=a[0];"number"!==typeof b&&(b=0);for(let c=1,d=a.length;c<d;++c){let e=a[c];"number"===typeof e&&b<e&&(b=e)}return b},min(...a){let b=a[0];"number"!==typeof b&&(b=0);for(let c=1,d= a.length;c<d;++c){let e=a[c];"number"===typeof e&&b>e&&(b=e)}return b},clamp(a,b,c){return C3$jscomp$185.clamp(a,b,c)},distance(a,b,c,d){return C3$jscomp$185.distanceTo(a,b,c,d)},angle(a,b,c,d){return C3$jscomp$185.toDegrees(C3$jscomp$185.angleTo(a,b,c,d))},lerp(a,b,c){return C3$jscomp$185.lerp(a,b,c)},unlerp(a,b,c){return C3$jscomp$185.unlerp(a,b,c)},qarp(a,b,c,d){return C3$jscomp$185.qarp(a,b,c,d)},cubic(a,b,c,d,e){return C3$jscomp$185.cubic(a,b,c,d,e)},cosp(a,b,c){return C3$jscomp$185.cosp(a,b, c)},anglediff(a,b){return C3$jscomp$185.toDegrees(C3$jscomp$185.angleDiff(C3$jscomp$185.toRadians(a),C3$jscomp$185.toRadians(b)))},anglelerp(a,b,c){return C3$jscomp$185.toDegrees(C3$jscomp$185.angleLerp(C3$jscomp$185.toRadians(a),C3$jscomp$185.toRadians(b),c))},anglerotate(a,b,c){return C3$jscomp$185.toDegrees(C3$jscomp$185.angleRotate(C3$jscomp$185.toRadians(a),C3$jscomp$185.toRadians(b),C3$jscomp$185.toRadians(c)))},setbit(a,b,c){b|=0;return(a|0)&~(1<<b)|(0!==c?1:0)<<b},togglebit(a,b){return(a| 0)^1<<(b|0)},getbit(a,b){return(a|0)&1<<(b|0)?1:0},newline(){return"\n"},uppercase(a){return"string"===typeof a?a.toUpperCase():""},lowercase(a){return"string"===typeof a?a.toLowerCase():""},left(a,b){return"string"===typeof a?a.substr(0,b):""},mid(a,b,c){return"string"!==typeof a?"":0>c?a.substr(b):a.substr(b,c)},right(a,b){return"string"===typeof a?a.substr(Math.max(a.length-b,0)):""},trim(a){return"string"===typeof a?a.trim():""},tokenat(a,b,c){if("string"!==typeof a||"string"!==typeof c)return""; a=a.split(c);b=Math.floor(b);return 0>b||b>=a.length?"":a[b]},tokencount(a,b){return"string"===typeof a&&"string"===typeof b&&a.length?a.split(b).length:0},find(a,b){return"string"===typeof a&&"string"===typeof b?a.search(new RegExp(C3$jscomp$185.EscapeRegex(b),"i")):-1},findcase(a,b){return"string"===typeof a&&"string"===typeof b?a.search(new RegExp(C3$jscomp$185.EscapeRegex(b),"")):-1},replace(a,b,c){return"string"===typeof a&&"string"===typeof b&&"string"===typeof c?a.replace(new RegExp(C3$jscomp$185.EscapeRegex(b), "gi"),c):"string"===typeof a?a:""},regexsearch(a,b,c){b=this.GetRegex(b,c);return a?a.search(b):-1},regexreplace(a,b,c,d){b=this.GetRegex(b,c);return a?a.replace(b,d):""},regexmatchcount(a,b,c){return(a=this.GetRegexMatches(a.toString(),b,c))?a.length:0},regexmatchat(a,b,c,d){d=Math.floor(d);a=this.GetRegexMatches(a.toString(),b,c);return!a||0>d||d>=a.length?"":a[d]},zeropad(a,b){let c=0>a?"-":"";0>a&&(a=-a);c+="0".repeat(Math.max(b-a.toString().length,0));return c+a.toString()},urlencode(a){return encodeURIComponent(a)}, urldecode(a){return decodeURIComponent(a)},dt(){return this._runtime._GetDtFast()},timescale(){return this._runtime.GetTimeScale()},wallclocktime(){return(Date.now()-this._runtime.GetStartTime())/1E3},unixtime(){return Date.now()},time(){return this._runtime.GetGameTime()},tickcount(){return this._runtime.GetTickCount()},objectcount(){return this._runtime.GetObjectCount()},fps(){return this._runtime.GetFPS()},cpuutilisation(){return this._runtime.GetMainThreadTime()},gpuutilisation(){return this._runtime.GetGPUUtilisation()}, windowwidth(){return this._runtime.GetCanvasManager().GetDeviceWidth()},windowheight(){return this._runtime.GetCanvasManager().GetDeviceHeight()},originalwindowwidth(){return this._runtime.GetOriginalViewportWidth()},originalwindowheight(){return this._runtime.GetOriginalViewportHeight()},originalviewportwidth(){return this._runtime.GetOriginalViewportWidth()},originalviewportheight(){return this._runtime.GetOriginalViewportHeight()},scrollx(){return this._runtime.GetCurrentLayout().GetScrollX()}, scrolly(){return this._runtime.GetCurrentLayout().GetScrollY()},layoutname(){return this._runtime.GetCurrentLayout().GetName()},layoutscale(){return this._runtime.GetCurrentLayout().GetScale()},layoutangle(){return C3$jscomp$185.toDegrees(this._runtime.GetCurrentLayout().GetAngle())},layoutwidth(){return this._runtime.GetCurrentLayout().GetWidth()},layoutheight(){return this._runtime.GetCurrentLayout().GetHeight()},vanishingpointx(){return 100*this._runtime.GetCurrentLayout().GetVanishingPointX()}, vanishingpointy(){return 100*this._runtime.GetCurrentLayout().GetVanishingPointY()},viewportleft(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetViewport3D().getLeft():0},viewporttop(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetViewport3D().getTop():0},viewportright(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetViewport3D().getRight():0},viewportbottom(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetViewport3D().getBottom():0},viewportwidth(a){return(a= this._runtime.GetCurrentLayout().GetLayer(a))?a.GetViewport3D().width():0},viewportheight(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetViewport3D().height():0},viewportmidx(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?(a=a.GetViewport3D(),(a.getLeft()+a.getRight())/2):0},viewportmidy(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?(a=a.GetViewport3D(),(a.getTop()+a.getBottom())/2):0},canvastolayerx(a,b,c){return(a=this._runtime.GetCurrentLayout().GetLayer(a))? a.CanvasCssToLayer(b,c)[0]:0},canvastolayery(a,b,c){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.CanvasCssToLayer(b,c)[1]:0},layertocanvasx(a,b,c){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.LayerToCanvasCss(b,c)[0]:0},layertocanvasy(a,b,c){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.LayerToCanvasCss(b,c)[1]:0},layertolayerx(a,b,c,d){const e=this._runtime.GetCurrentLayout();a=e.GetLayer(a);b=e.GetLayer(b);if(!a||!b||a===b)return c;const [g,k]=a.LayerToCanvasCss(c, d);return b.CanvasCssToLayer(g,k)[0]},layertolayery(a,b,c,d){const e=this._runtime.GetCurrentLayout();a=e.GetLayer(a);b=e.GetLayer(b);if(!a||!b||a===b)return d;const [g,k]=a.LayerToCanvasCss(c,d);return b.CanvasCssToLayer(g,k)[1]},layerscale(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetOwnScale():0},layerangle(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?C3$jscomp$185.toDegrees(a.GetOwnAngle()):0},layeropacity(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))? 100*a.GetOpacity():0},layerscalerate(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetScaleRate():0},layerscrollx(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetScrollX():0},layerscrolly(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetScrollY():0},layerparallaxx(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?100*a.GetParallaxX():0},layerparallaxy(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?100*a.GetParallaxY():0},layerzelevation(a){return(a= this._runtime.GetCurrentLayout().GetLayer(a))?a.GetZElevation():0},layerindex(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetIndex():-1},canvassnapshot(){const a=this._runtime.GetCanvasManager();return a?a.GetCanvasSnapshotUrl():""},loopindex(a){const b=this._loopStack;return b.IsInLoop()?a?(a=b.FindByName(a))?a.GetIndex():0:b.GetCurrent().GetIndex():0},savestatejson(){return this._runtime.GetLastSaveJsonString()},callmapped(a,b,...c){var d=this._GetFunctionMap(a.toLowerCase(),!1); if(!d)return console.warn(`[Construct] Call mapped function: map name '${a}' not found; returning 0`),0;let e=d.strMap.get(b.toLowerCase());if(!e)if(d.defaultFunc)e=d.defaultFunc;else return console.warn(`[Construct] Call mapped function: no function associated with map '${a}' string '${b}'; returning 0 (consider setting a default)`),0;d=e.GetReturnType();const g=e.GetDefaultReturnValue();if(0===d)return console.warn(`[Construct] Call mapped function: map '${a}' string '${b}' has no return type so cannot be called from an expression; returning 0`), 0;if(!e.IsEnabled())return g;a=this._runtime.GetEventSheetManager();b=a.GetCurrentEvent().GetSolModifiersIncludingParents();const k=0<b.length;k&&(e.IsCopyPicked()?a.PushCopySol(b):a.PushCleanSol(b));var l=e.GetFunctionParameters();for(let n=c.length,p=l.length;n<p;++n)c.push(l[n].GetInitialValue());l=e.GetEventBlock();c=l.RunAsExpressionFunctionCall(l.GetSolModifiersIncludingParents(),e.IsCopyPicked(),d,g,...c);k&&a.PopSol(b);return c},loadingprogress(){return this._runtime.GetAssetManager().GetLoadProgress()}, imageloadingprogress(){return 0===this._imagesLoadingTotal?1:this._imagesLoadingComplete/this._imagesLoadingTotal},renderer(){return this._runtime.GetWebGPURenderer()?"webgpu":"webgl"},rendererdetail(){return this._runtime.GetWebGPURenderer()?this._runtime.GetWebGPURenderer().GetBasicAdapterInfoString():this._runtime.GetWebGLRenderer().GetUnmaskedRenderer()},imagememoryusage(){let a=this._runtime.GetRenderer().GetEstimatedTextureMemoryUsage();return Math.round(100*a/1048576)/100},rgb(a,b,c){return C3$jscomp$185.PackRGB(a, b,c)},rgbex(a,b,c){return C3$jscomp$185.PackRGBEx(a/100,b/100,c/100)},rgba(a,b,c,d){return C3$jscomp$185.PackRGBAEx(a/100,b/100,c/100,d/100)},rgbex255(a,b,c){return C3$jscomp$185.PackRGBEx(a/255,b/255,c/255)},rgba255(a,b,c,d){return C3$jscomp$185.PackRGBAEx(a/255,b/255,c/255,d/255)},projectname(){return this._runtime.GetProjectName()},projectversion(){return this._runtime.GetProjectVersion()},currenteventsheetname(){return this._runtime.GetCurrentEvent().GetEventSheet().GetName()},currenteventnumber(){return this._runtime.GetCurrentEvent().GetDisplayNumber()}}; "use strict";const C3$jscomp$186=self.C3;C3$jscomp$186.Plugins.Sprite=class extends C3$jscomp$186.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$187=self.C3,spawnPickStack=[]; C3$jscomp$187.Plugins.Sprite.Type=class extends C3$jscomp$187.SDKTypeBase{constructor(a){super(a);this._animations=a.GetAnimations()}Release(){C3$jscomp$187.clearArray(this._animations);super.Release()}OnCreate(){for(const a of this._animations)a.LoadAllAssets(this._runtime)}LoadTextures(a){const b={sampling:this._runtime.GetSampling()};return Promise.all(this._animations.map(c=>c.LoadAllTextures(a,b)))}ReleaseTextures(){for(const a of this._animations)a.ReleaseAllTextures()}OnDynamicTextureLoadComplete(){this._UpdateAllCurrentTexture()}_UpdateAllCurrentTexture(){for(const a of this._objectClass.instancesIncludingPendingCreate())a.GetSdkInstance()._UpdateCurrentTexture()}FinishCondition(a){C3$jscomp$187.Plugins.Sprite.FinishCollisionCondition(this, a)}BeforeRunAction(a){spawnPickStack.push({objectClass:null,createHierarchy:!1,instances:[]})}_SpawnPickInstance(a,b,c){const d=spawnPickStack.at(-1);d.objectClass=a;d.createHierarchy=c;d.instances.push(b)}AfterRunAction(a){a=spawnPickStack.pop();const b=a.objectClass,c=a.createHierarchy;if(b){var d=new Map;for(const e of a.instances)e.CollectInstancesToPick(d,b,c);for(const [e,g]of d)e.GetCurrentSol().SetSetPicked(g)}}}; const C3$jscomp$188=self.C3,C3X$jscomp$18=self.C3X,tempRect$jscomp$10=C3$jscomp$188.New(C3$jscomp$188.Rect),tempQuad$jscomp$6=C3$jscomp$188.New(C3$jscomp$188.Quad),tempVec2$jscomp$1=C3$jscomp$188.New(C3$jscomp$188.Vector2),FLAG_PLAYING_FORWARDS=1,FLAG_ANIMATION_PLAYING=2,FLAG_ANIMATION_TRIGGER=4; C3$jscomp$188.Plugins.Sprite.Instance=class extends C3$jscomp$188.SDKWorldInstanceBase{constructor(a,b){super(a);let c=!0,d="",e=0,g=!0;b&&(c=!!b[0],d=b[1],e=b[2],g=b[3]);this._currentAnimation=this._objectClass.GetAnimationByName(d)||this._objectClass.GetAnimations()[0];this._currentFrameIndex=C3$jscomp$188.clamp(e,0,this._currentAnimation.GetFrameCount()-1);this._currentAnimationFrame=this._currentAnimation.GetFrameAt(this._currentFrameIndex);b=this._currentAnimationFrame.GetImageInfo();this._currentTexture= b.GetTexture();this._currentRcTex=b.GetTexRect();this._currentQuadTex=b.GetTexQuad();this.HandleRendererContextLoss();a.SetFlag(FLAG_ANIMATION_PLAYING,!0);a.SetFlag(FLAG_PLAYING_FORWARDS,0<=this._currentAnimation.GetSpeed());this._currentAnimationSpeed=Math.abs(this._currentAnimation.GetSpeed());this._currentAnimationRepeatTo=this._currentAnimation.GetRepeatTo();this._animationTimer=C3$jscomp$188.New(C3$jscomp$188.KahanSum);this._animationRepeats=this._frameStartTime=0;this._animTriggerName="";this._changeAnimFrameIndex= -1;this._changeAnimationName="";this._changeAnimationFrom=0;a=this.GetWorldInfo();this._bquadRef=a.GetBoundingQuad();a.SetVisible(c);a.SetCollisionEnabled(g);a.SetOriginX(this._currentAnimationFrame.GetOriginX());a.SetOriginY(this._currentAnimationFrame.GetOriginY());a.SetSourceCollisionPoly(this._currentAnimationFrame.GetCollisionPoly());a.SetBboxChanged();1===this._objectClass.GetAnimationCount()&&1===this._objectClass.GetAnimations()[0].GetFrameCount()||0===this._currentAnimationSpeed||this._StartTicking()}Release(){this._animationTimer= this._currentTexture=this._currentAnimationFrame=this._currentAnimation=null;super.Release()}GetCurrentImageInfo(){return this._currentAnimationFrame.GetImageInfo()}IsOriginalSizeKnown(){return!0}OnRendererContextLost(){this._currentTexture=null}OnRendererContextRestored(){this._UpdateCurrentTexture()}Draw(a){var b=this._currentTexture;null!==b&&(a.SetTexture(b),b=this.GetWorldInfo(),b.HasMesh()?this._DrawMesh(b,a):this._DrawStandard(b,a))}_DrawStandard(a,b){let c=this._bquadRef;this._runtime.IsPixelRoundingEnabled()&& (c=a.PixelRoundQuad(c));b.Quad4(c,this._currentQuadTex)}_DrawMesh(a,b){const c=a.GetTransformedMesh();if(a.IsMeshChanged()){a.CalculateBbox(tempRect$jscomp$10,tempQuad$jscomp$6,!1);let d=tempQuad$jscomp$6;this._runtime.IsPixelRoundingEnabled()&&(d=a.PixelRoundQuad(d));c.CalculateTransformedMesh(a.GetSourceMesh(),d,this._currentQuadTex);a.SetMeshChanged(!1)}c.Draw(b)}GetAnimationTime(){return this._animationTimer.Get()}IsAnimationPlaying(){return this._inst.GetFlag(FLAG_ANIMATION_PLAYING)}SetAnimationPlaying(a){this._inst.SetFlag(FLAG_ANIMATION_PLAYING, a)}IsPlayingForwards(){return this._inst.GetFlag(FLAG_PLAYING_FORWARDS)}SetPlayingForwards(a){this._inst.SetFlag(FLAG_PLAYING_FORWARDS,a)}IsInAnimationTrigger(){return this._inst.GetFlag(FLAG_ANIMATION_TRIGGER)}SetInAnimationTrigger(a){this._inst.SetFlag(FLAG_ANIMATION_TRIGGER,a)}Tick(){this._changeAnimationName&&this._DoChangeAnimation();0<=this._changeAnimFrameIndex&&this._DoChangeAnimFrame();const a=this._currentAnimationSpeed;if(this.IsAnimationPlaying()&&0!==a){var b=this._runtime.GetDt(this._inst); this._animationTimer.Add(b);b=this.GetAnimationTime();var c=this._currentAnimationFrame,d=c.GetDuration()/a;if(!(b<this._frameStartTime+d)){var e=this._currentAnimation,g=this._currentAnimationRepeatTo,k=e.GetFrameCount(),l=e.GetRepeatCount(),n=e.IsLooping(),p=e.IsPingPong();this.IsPlayingForwards()?this._currentFrameIndex++:this._currentFrameIndex--;this._frameStartTime+=d;this._currentFrameIndex>=k&&(p?(this.SetPlayingForwards(!1),this._currentFrameIndex=k-2):n?this._currentFrameIndex=g:(this._animationRepeats++, this._animationRepeats>=l?this._FinishAnimation(!1):this._currentFrameIndex=g));0>this._currentFrameIndex&&(p?(this._currentFrameIndex=1,this.SetPlayingForwards(!0),n||(this._animationRepeats++,this._animationRepeats>=l&&this._FinishAnimation(!0))):n?this._currentFrameIndex=g:(this._animationRepeats++,this._animationRepeats>=l?this._FinishAnimation(!0):this._currentFrameIndex=g));this._currentFrameIndex=C3$jscomp$188.clamp(this._currentFrameIndex,0,k-1);d=e.GetFrameAt(this._currentFrameIndex);b>this._frameStartTime+ d.GetDuration()/a&&(this._frameStartTime=b);this._OnFrameChanged(c,d)}}else this._StopTicking()}_FinishAnimation(a){this._currentFrameIndex=a?0:this._currentAnimation.GetFrameCount()-1;this.SetAnimationPlaying(!1);this._animTriggerName=this._currentAnimation.GetName();this.SetInAnimationTrigger(!0);this.DispatchScriptEvent("animationend",!1,{animationName:this._animTriggerName});this.Trigger(C3$jscomp$188.Plugins.Sprite.Cnds.OnAnyAnimFinished);this.Trigger(C3$jscomp$188.Plugins.Sprite.Cnds.OnAnimFinished); this.SetInAnimationTrigger(!1);this._animationRepeats=0}_OnFrameChanged(a,b,c){if(a!==b){var d=this.GetWorldInfo(),e=a.GetImageInfo(),g=b.GetImageInfo(),k=e.GetWidth();e=e.GetHeight();var l=g.GetWidth(),n=g.GetHeight();if(c&&c.onFrameChange)c.onFrameChange(d,k,e,l,n);else k!==l&&d.SetWidth(d.GetWidth()*(l/k)),e!==n&&d.SetHeight(d.GetHeight()*(n/e));d.SetOriginX(b.GetOriginX());d.SetOriginY(b.GetOriginY());d.SetSourceCollisionPoly(b.GetCollisionPoly());d.SetBboxChanged();this._currentAnimationFrame= b;this._currentTexture=g.GetTexture();this._currentRcTex=g.GetTexRect();this._currentQuadTex=g.GetTexQuad();c=this.GetInstance().GetBehaviorInstances();for(let p=0,r=c.length;p<r;++p)c[p].OnSpriteFrameChanged(a,b);this.DispatchScriptEvent("framechange",!1,{animationName:this._currentAnimation.GetName(),animationFrame:this._currentFrameIndex});this.Trigger(C3$jscomp$188.Plugins.Sprite.Cnds.OnFrameChanged);this._runtime.UpdateRender()}}_StartAnim(a){this.SetAnimationPlaying(!0);this._frameStartTime= this.GetAnimationTime();1===a&&0!==this._currentFrameIndex&&(this._changeAnimFrameIndex=0,this.IsInAnimationTrigger()||this._DoChangeAnimFrame());this._StartTicking()}_SetAnim(a,b){this._changeAnimationName=a;this._changeAnimationFrom=b;this._StartTicking();this.IsInAnimationTrigger()||this._DoChangeAnimation()}_GetCurrentAnimation(){return this._currentAnimation}_GetCurrentAnimationName(){return this._changeAnimationName?this._changeAnimationName:this._currentAnimation.GetName()}_SetAnimFrame(a){isFinite(a)&& (this._changeAnimFrameIndex=a,this.IsInAnimationTrigger()||this._DoChangeAnimFrame())}_GetAnimFrame(){return this._currentFrameIndex}_SetAnimSpeed(a){this._currentAnimationSpeed=Math.abs(a);this.SetPlayingForwards(0<=a);0<this._currentAnimationSpeed&&this._StartTicking()}_GetAnimSpeed(){return this.IsPlayingForwards()?this._currentAnimationSpeed:-this._currentAnimationSpeed}_SetAnimRepeatToFrame(a){this._currentAnimationRepeatTo=a=C3$jscomp$188.clamp(Math.floor(a),0,this._currentAnimation.GetFrameCount()- 1)}_GetAnimRepeatToFrame(){return this._currentAnimationRepeatTo}_DoChangeAnimation(a){const b=this._currentAnimationFrame;var c=this._objectClass.GetAnimationByName(this._changeAnimationName);this._changeAnimationName="";!c||c===this._currentAnimation&&this.IsAnimationPlaying()||(this._currentAnimation=c,this.SetPlayingForwards(0<=c.GetSpeed()),this._currentAnimationSpeed=Math.abs(c.GetSpeed()),this._currentAnimationRepeatTo=c.GetRepeatTo(),this._currentFrameIndex=C3$jscomp$188.clamp(this._currentFrameIndex, 0,this._currentAnimation.GetFrameCount()-1),1===this._changeAnimationFrom&&(this._currentFrameIndex=0),this.SetAnimationPlaying(!0),this._frameStartTime=this.GetAnimationTime(),c=this._currentAnimation.GetFrameAt(this._currentFrameIndex),this._OnFrameChanged(b,c,a))}_DoChangeAnimFrame(){const a=this._currentAnimationFrame;var b=this._currentFrameIndex;this._currentFrameIndex=C3$jscomp$188.clamp(Math.floor(this._changeAnimFrameIndex),0,this._currentAnimation.GetFrameCount()-1);this._changeAnimFrameIndex= -1;b!==this._currentFrameIndex&&(b=this._currentAnimation.GetFrameAt(this._currentFrameIndex),this._OnFrameChanged(a,b),this._frameStartTime=this.GetAnimationTime())}_UpdateCurrentTexture(){const a=this._currentAnimationFrame.GetImageInfo();this._currentTexture=a.GetTexture();this._currentRcTex=a.GetTexRect();this._currentQuadTex=a.GetTexQuad();this.GetWorldInfo().SetMeshChanged(!0)}GetTexture(){return this._currentTexture}GetTexRect(){return this._currentRcTex}GetTexQuad(){return this._currentQuadTex}GetImagePointCount(){return this._currentAnimationFrame.GetImagePointCount()}GetImagePoint(a){const b= this._currentAnimationFrame,c=this.GetWorldInfo();if("string"===typeof a)a=b.GetImagePointByName(a);else if("number"===typeof a)a=b.GetImagePointByIndex(a-1);else throw new TypeError("expected string or number");let d=c.GetTotalZElevation();if(!a)return[c.GetX(),c.GetY(),d];tempVec2$jscomp$1.copy(a.GetVec2());if(c.HasMesh()){const [e,g,k]=c.GetSourceMesh().TransformPoint(tempVec2$jscomp$1.getX(),tempVec2$jscomp$1.getY());tempVec2$jscomp$1.set(e,g);d+=k}tempVec2$jscomp$1.offset(-b.GetOriginX(),-b.GetOriginY()); tempVec2$jscomp$1.scale(c.GetWidth(),c.GetHeight());tempVec2$jscomp$1.rotate(c.GetAngle());tempVec2$jscomp$1.offset(c.GetX(),c.GetY());return[tempVec2$jscomp$1.getX(),tempVec2$jscomp$1.getY(),d]}GetCollisionPolyPointCount(){return this.GetWorldInfo().GetTransformedCollisionPoly().pointCount()}GetCollisionPolyPoint(a){a=Math.floor(a);const b=this.GetWorldInfo();var c=b.GetTransformedCollisionPoly();const d=c.pointCount();a===d&&(a=0);if(0>a||a>=d)return[0,0];c=c.pointsArr();return[c[2*a]+b.GetX(), c[2*a+1]+b.GetY()]}GetDebuggerProperties(){const a=C3$jscomp$188.Plugins.Sprite.Acts;return[{title:"plugins.sprite.debugger.animation-properties.title",properties:[{name:"plugins.sprite.debugger.animation-properties.current-animation",value:this._currentAnimation.GetName(),onedit:b=>this.CallAction(a.SetAnim,b,0)},{name:"plugins.sprite.debugger.animation-properties.current-frame",value:this._currentFrameIndex,onedit:b=>this.CallAction(a.SetAnimFrame,b)},{name:"plugins.sprite.debugger.animation-properties.is-playing", value:this.IsAnimationPlaying(),onedit:b=>b?this.CallAction(a.StartAnim,0):this.CallAction(a.StopAnim)},{name:"plugins.sprite.debugger.animation-properties.speed",value:this._currentAnimationSpeed,onedit:b=>this.CallAction(a.SetAnimSpeed,b)},{name:"plugins.sprite.debugger.animation-properties.repeats",value:this._animationRepeats,onedit:b=>this._animationRepeats=b}]}]}SaveToJson(){const a={a:this._currentAnimation.GetSID()};0!==this._frameStartTime&&(a.fs=this._frameStartTime);var b=this.GetAnimationTime(); 0!==b&&(a.at=b);0!==this._currentFrameIndex&&(a.f=this._currentFrameIndex);0!==this._currentAnimationSpeed&&(a.cas=this._currentAnimationSpeed);1!==this._animationRepeats&&(a.ar=this._animationRepeats);0!==this._currentAnimationRepeatTo&&(a.rt=this._currentAnimationRepeatTo);this.IsAnimationPlaying()||(a.ap=this.IsAnimationPlaying());this.IsPlayingForwards()||(a.af=this.IsPlayingForwards());b=this.GetWorldInfo();b.IsCollisionEnabled()&&(a.ce=b.IsCollisionEnabled());return a}LoadFromJson(a){var b= this.GetObjectClass().GetAnimationBySID(a.a);b&&(this._currentAnimation=b);this._frameStartTime=a.hasOwnProperty("fs")?a.fs:0;this._animationTimer.Set(a.hasOwnProperty("at")?a.at:0);b=a.hasOwnProperty("f")?a.f:0;this._currentFrameIndex=C3$jscomp$188.clamp(b,0,this._currentAnimation.GetFrameCount()-1);this._currentAnimationSpeed=a.hasOwnProperty("cas")?a.cas:0;this._animationRepeats=a.hasOwnProperty("ar")?a.ar:1;b=a.hasOwnProperty("rt")?a.rt:0;this._currentAnimationRepeatTo=C3$jscomp$188.clamp(b,0, this._currentAnimation.GetFrameCount()-1);this.SetAnimationPlaying(a.hasOwnProperty("ap")?!!a.ap:!0);this.SetPlayingForwards(a.hasOwnProperty("af")?!!a.af:!0);this._currentAnimationFrame=b=this._currentAnimation.GetFrameAt(this._currentFrameIndex);this._UpdateCurrentTexture();const c=this.GetWorldInfo();c.SetOriginX(b.GetOriginX());c.SetOriginY(b.GetOriginY());c.SetSourceCollisionPoly(b.GetCollisionPoly());c.SetCollisionEnabled(!!a.ce);this.IsAnimationPlaying()&&this._StartTicking()}GetPropertyValueByIndex(a){const b= this.GetWorldInfo();switch(a){case 3:return b.IsCollisionEnabled();case 2:return C3$jscomp$188.clamp(this._currentFrameIndex,0,this._currentAnimation.GetFrameCount()-1);case 1:return this._currentAnimation.GetName()}}SetPropertyValueByIndex(a,b,c){var d=this.GetWorldInfo();switch(a){case 3:d.SetCollisionEnabled(!!b);break;case 2:this.SetAnimationPlaying(!1);a=this._currentAnimation.GetFrameCount()-1;d=b=C3$jscomp$188.clamp(b,0,a);b=this._currentAnimation.GetFrameAt(this._currentFrameIndex);const e= this._currentAnimation.GetFrameAt(d);this._OnFrameChanged(b,e,c);this._currentFrameIndex=C3$jscomp$188.clamp(d,0,a);break;case 1:this._changeAnimationName=b,this._DoChangeAnimation(c)}}GetScriptInterfaceClass(){return self.ISpriteInstance}};const map$jscomp$19=new WeakMap,ANIM_FROM_MODES=new Map([["current-frame",0],["beginning",1]]); self.ISpriteInstance=class extends self.IWorldInstance{constructor(){super();map$jscomp$19.set(this,self.IInstance._GetInitInst().GetSdkInstance())}getImagePointCount(){return map$jscomp$19.get(this).GetImagePointCount()}getImagePointX(a){return this.getImagePoint(a)[0]}getImagePointY(a){return this.getImagePoint(a)[1]}getImagePointZ(a){return this.getImagePoint(a)[2]}getImagePoint(a){if("string"!==typeof a&&"number"!==typeof a)throw new TypeError("expected string or number");return map$jscomp$19.get(this).GetImagePoint(a)}getPolyPointCount(){return map$jscomp$19.get(this).GetCollisionPolyPointCount()}getPolyPointX(a){C3X$jscomp$18.RequireFiniteNumber(a); return map$jscomp$19.get(this).GetCollisionPolyPoint(a)[0]}getPolyPointY(a){C3X$jscomp$18.RequireFiniteNumber(a);return map$jscomp$19.get(this).GetCollisionPolyPoint(a)[1]}getPolyPoint(a){C3X$jscomp$18.RequireFiniteNumber(a);return map$jscomp$19.get(this).GetCollisionPolyPoint(a)}stopAnimation(){map$jscomp$19.get(this).SetAnimationPlaying(!1)}startAnimation(a="current-frame"){C3X$jscomp$18.RequireString(a);a=ANIM_FROM_MODES.get(a);if("undefined"===typeof a)throw Error("invalid mode");map$jscomp$19.get(this)._StartAnim(a)}setAnimation(a, b="beginning"){C3X$jscomp$18.RequireString(a);C3X$jscomp$18.RequireString(b);b=ANIM_FROM_MODES.get(b);if("undefined"===typeof b)throw Error("invalid mode");const c=map$jscomp$19.get(this);if(!c.GetObjectClass().GetAnimationByName(a))throw Error(`animation name "${a}" does not exist`);c._SetAnim(a,b)}getAnimation(a){C3X$jscomp$18.RequireString(a);return(a=map$jscomp$19.get(this).GetObjectClass().GetAnimationByName(a))?a.GetIAnimation():null}get animation(){return map$jscomp$19.get(this)._GetCurrentAnimation().GetIAnimation()}get animationName(){return map$jscomp$19.get(this)._GetCurrentAnimationName()}set animationFrame(a){C3X$jscomp$18.RequireFiniteNumber(a); map$jscomp$19.get(this)._SetAnimFrame(a)}get animationFrame(){return map$jscomp$19.get(this)._GetAnimFrame()}set animationSpeed(a){C3X$jscomp$18.RequireFiniteNumber(a);map$jscomp$19.get(this)._SetAnimSpeed(a)}get animationSpeed(){return map$jscomp$19.get(this)._GetAnimSpeed()}set animationRepeatToFrame(a){C3X$jscomp$18.RequireFiniteNumber(a);map$jscomp$19.get(this)._SetAnimRepeatToFrame(a)}get animationRepeatToFrame(){return map$jscomp$19.get(this)._GetAnimRepeatToFrame()}get imageWidth(){return map$jscomp$19.get(this).GetCurrentImageInfo().GetWidth()}get imageHeight(){return map$jscomp$19.get(this).GetCurrentImageInfo().GetHeight()}getImageSize(){const a= map$jscomp$19.get(this).GetCurrentImageInfo();return[a.GetWidth(),a.GetHeight()]}async replaceCurrentAnimationFrame(a){C3X$jscomp$18.RequireInstanceOf(a,Blob);const b=map$jscomp$19.get(this),c=b.GetRuntime(),d=b.GetCurrentImageInfo(),e=C3$jscomp$188.New(C3$jscomp$188.ImageInfo);e.LoadDynamicBlobAsset(c,a);await e.LoadStaticTexture(c.GetRenderer(),{sampling:c.GetSampling()});b.WasReleased()?e.Release():(d.ReplaceWith(e),b.GetSdkType()._UpdateAllCurrentTexture(),c.UpdateRender())}setSolidCollisionFilter(a, b){C3X$jscomp$18.RequireString(b);map$jscomp$19.get(this).GetWorldInfo().SetSolidCollisionFilter(!!a,b)}};const C3$jscomp$189=self.C3; C3$jscomp$189.Plugins.Sprite.Cnds={IsAnimPlaying(a){return C3$jscomp$189.equalsNoCase(this._GetCurrentAnimationName(),a)},CompareFrame(a,b){return C3$jscomp$189.compare(this._currentFrameIndex,a,b)},CompareFrameTag(a,b){const c=this._currentAnimationFrame.GetTag();return C3$jscomp$189.compare(c.toLowerCase(),a,b.toLowerCase())},CompareAnimSpeed(a,b){return C3$jscomp$189.compare(this._GetAnimSpeed(),a,b)},OnAnimFinished(a){return C3$jscomp$189.equalsNoCase(this._animTriggerName,a)},OnAnyAnimFinished(){return!0}, OnFrameChanged(){return!0},IsMirrored(){return 0>this.GetWorldInfo().GetWidth()},IsFlipped(){return 0>this.GetWorldInfo().GetHeight()},OnURLLoaded(){return!0},OnURLFailed(){return!0},IsCollisionEnabled(){return this.GetWorldInfo().IsCollisionEnabled()}};const C3$jscomp$190=self.C3; C3$jscomp$190.Plugins.Sprite.Acts={Spawn(a,b,c,d){if(a&&b){var [e,g]=this.GetImagePoint(c);if(c=this._runtime.CreateInstance(a,b,e,g,d))d&&b.SortAndAddInstancesByZIndex(c),a.GetPlugin().IsRotatable()&&(b=c.GetWorldInfo(),b.SetAngle(this.GetWorldInfo().GetAngle()),b.SetBboxChanged()),b=this._runtime.GetEventSheetManager(),b.BlockFlushingInstances(!0),c._TriggerOnCreatedOnSelfAndRelated(),b.BlockFlushingInstances(!1),a!==this._runtime.GetCurrentAction().GetObjectClass()&&this._sdkType._SpawnPickInstance(a, c,d)}},StopAnim(){this.SetAnimationPlaying(!1)},StartAnim(a){this._StartAnim(a)},SetAnim(a,b){this._SetAnim(a,b)},SetAnimFrame(a){this._SetAnimFrame(a)},SetAnimSpeed(a){this._SetAnimSpeed(a)},SetAnimRepeatToFrame(a){this._SetAnimRepeatToFrame(a)},SetMirrored(a){const b=this.GetWorldInfo(),c=b.GetWidth();a=Math.abs(c)*(0===a?-1:1);c!==a&&(b.SetWidth(a),b.SetBboxChanged())},SetFlipped(a){const b=this.GetWorldInfo(),c=b.GetHeight();a=Math.abs(c)*(0===a?-1:1);c!==a&&(b.SetHeight(a),b.SetBboxChanged())}, SetScale(a){const b=this._currentAnimationFrame.GetImageInfo(),c=this.GetWorldInfo();var d=0>c.GetWidth()?-1:1;const e=0>c.GetHeight()?-1:1;d*=b.GetWidth()*a;a=b.GetHeight()*a*e;if(c.GetWidth()!==d||c.GetHeight()!==a)c.SetSize(d,a),c.SetBboxChanged()},async LoadURL(a,b,c){c=this._currentAnimationFrame.GetImageInfo();const d=this.GetWorldInfo(),e=this._runtime,g=this._sdkType;if(c.GetURL()===a)0===b&&(d.SetSize(c.GetWidth(),c.GetHeight()),d.SetBboxChanged()),this.Trigger(C3$jscomp$190.Plugins.Sprite.Cnds.OnURLLoaded); else{var k=C3$jscomp$190.New(C3$jscomp$190.ImageInfo);try{await k.LoadDynamicAsset(e,a);if(!k.IsLoaded())throw Error("image failed to load");if(this.WasReleased()){k.Release();return}await k.LoadStaticTexture(e.GetRenderer(),{sampling:e.GetSampling()})}catch(l){console.error("Load image from URL failed: ",l);this.WasReleased()||this.Trigger(C3$jscomp$190.Plugins.Sprite.Cnds.OnURLFailed);return}this.WasReleased()?k.Release():(c.ReplaceWith(k),g._UpdateAllCurrentTexture(),e.UpdateRender(),0===b&&(d.SetSize(c.GetWidth(), c.GetHeight()),d.SetBboxChanged()),await this.TriggerAsync(C3$jscomp$190.Plugins.Sprite.Cnds.OnURLLoaded))}},SetCollisions(a){this.GetWorldInfo().SetCollisionEnabled(a)},SetSolidCollisionFilter(a,b){this.GetWorldInfo().SetSolidCollisionFilter(0===a,b)},SetEffect(a){this.GetWorldInfo().SetBlendMode(a);this._runtime.UpdateRender()}}; self.C3.Plugins.Sprite.Exps={AnimationFrame(){return this._currentFrameIndex},AnimationFrameCount(){return this._currentAnimation.GetFrameCount()},AnimationFrameTag(){return this._currentAnimationFrame.GetTag()},AnimationName(){return this._currentAnimation.GetName()},AnimationSpeed(){return this._GetAnimSpeed()},OriginalAnimationSpeed(){return this._currentAnimation.GetSpeed()},ImagePointX(a){return this.GetImagePoint(a)[0]},ImagePointY(a){return this.GetImagePoint(a)[1]},ImagePointZ(a){return this.GetImagePoint(a)[2]}, ImagePointCount(){return this.GetImagePointCount()},ImageWidth(){return this.GetCurrentImageInfo().GetWidth()},ImageHeight(){return this.GetCurrentImageInfo().GetHeight()},PolyPointXAt(a){return this.GetCollisionPolyPoint(a)[0]},PolyPointYAt(a){return this.GetCollisionPolyPoint(a)[1]},PolyPointCount(){return this.GetCollisionPolyPointCount()}};"use strict";const C3$jscomp$192=self.C3;C3$jscomp$192.Plugins.Particles=class extends C3$jscomp$192.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}}; const C3$jscomp$193=self.C3;C3$jscomp$193.Plugins.Particles.Type=class extends C3$jscomp$193.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}LoadTextures(a){return this.GetImageInfo().LoadStaticTexture(a,{sampling:this._runtime.GetSampling()})}ReleaseTextures(){this.GetImageInfo().ReleaseTexture()}};const C3$jscomp$194=self.C3,C3X$jscomp$19=self.C3X,tempRect$jscomp$11=C3$jscomp$194.New(C3$jscomp$194.Rect); C3$jscomp$194.Plugins.Particles.Instance=class extends C3$jscomp$194.SDKWorldInstanceBase{constructor(a,b){super(a);this._isFirstTick=!0;this._particleEngine=a=C3$jscomp$194.New(self.ParticleEngine);a.ononeshotfinish=()=>this._OnOneShotFinish();this._spawnObjectClass=null;this._particleUpdateCallback=(e,g,k,l,n,p)=>this._OnParticleUpdate(e,g,k,l,n,p);this._particleDestroyCallback=e=>this._OnParticleDestroy(e);let c=this._hasAnyDefaultParticle=!0;b&&(a.SetRate(b[0]),a.SetSprayCone(C3$jscomp$194.toRadians(b[1])), a.SetSprayType(b[2]?"one-shot":"continuous-spray"),this._SetParticleObjectClass(this._runtime.GetObjectClassBySID(b[3])),c=b[4],a.SetInitSpeed(b[5]),a.SetInitSize(b[6]),a.SetInitOpacity(b[7]/100),a.SetGrowRate(b[8]),a.SetInitXRandom(b[9]),a.SetInitYRandom(b[10]),a.SetInitSpeedRandom(b[11]),a.SetInitSizeRandom(b[12]),a.SetGrowRandom(b[13]),a.SetAcceleration(b[14]),a.SetGravity(b[15]),a.SetLifeAngleRandom(b[16]),a.SetLifeSpeedRandom(b[17]),a.SetLifeOpacityRandom(b[18]),a.SetDestroyModeIndex(b[19]), a.SetTimeout(b[20]));this._UpdateEngineParameters();this._spawnObjectClass&&(this._hasAnyDefaultParticle=!1);"one-shot"===a.GetSprayType()?a.CreateOneShotSpray():a.SetSpraying(!0);const d=this.GetWorldInfo();d.SetVisible(c);d.SetBboxChangeEventEnabled(!0);this._inst.Dispatcher().addEventListener("bboxchange",()=>{d.OverwriteBoundingBox(this._particleEngine.GetBoundingBox())});this.GetRuntime().GetRenderer().IsWebGPU()&&d.SetUsePointsShaderProgram();this._afterLoad=e=>this._OnAfterLoad(e);this.GetRuntime().Dispatcher().addEventListener("afterload", this._afterLoad);this._StartTicking()}Release(){this.GetRuntime().Dispatcher().removeEventListener("afterload",this._afterLoad);this._afterLoad=null;this._particleEngine.Release();this._particleDestroyCallback=this._particleUpdateCallback=this._particleEngine=null;super.Release()}GetParticleEngine(){return this._particleEngine}_SetRate(a){this._particleEngine.SetRate(a);"one-shot"===this._particleEngine.GetSprayType()&&this._isFirstTick&&this._particleEngine.SetParticleCount(a)}_SetParticleObjectClass(a){a=== this.GetObjectClass()&&(a=null);a!==this._spawnObjectClass&&(this._spawnObjectClass=a,this._particleEngine.onparticlecreate=a?b=>this._OnParticleCreate(b):null,this._spawnObjectClass||(this._hasAnyDefaultParticle=!0))}_UpdateEngineParameters(){const a=this._particleEngine,b=this.GetWorldInfo();a.SetMasterOpacity(b.GetOpacity());a.SetPixelRounding(this._runtime.IsPixelRoundingEnabled());a.SetSpawnX(b.GetX());a.SetSpawnY(b.GetY());a.SetSpawnAngle(b.GetAngle());a.SetInitSizeScale(Math.abs(b.GetSceneGraphScale()))}_OnOneShotFinish(){this._runtime.DestroyInstance(this._inst)}Draw(a){if(this._hasAnyDefaultParticle){var b= this._objectClass.GetImageInfo(),c=b.GetTexture();if(c){var d=this.GetWorldInfo(),e=d.GetLayer();this._runtime.GetCanvasManager().IsPastingToDrawingCanvas()?tempRect$jscomp$11.set(-Infinity,-Infinity,Infinity,Infinity):e.Has3DCamera()?e.CalculateViewport3D(d.GetTotalZElevation(),tempRect$jscomp$11):e.GetViewportForZ(d.GetTotalZElevation(),tempRect$jscomp$11);a.SetTexture(c);c=e.Get2DScaleFactorToZ(d.GetTotalZElevation());this._particleEngine.SetParticleScale(e.GetRenderScale()*c);this._particleEngine.Draw(a, b.GetTexQuad(),tempRect$jscomp$11,e.Has3DCamera())}}}SaveToJson(){const a=this._particleEngine;return{r:a.GetRate(),sc:a.GetSprayCone(),st:a.GetSprayType(),isp:a.GetInitSpeed(),isz:a.GetInitSize(),io:a.GetInitOpacity(),gr:a.GetGrowRate(),xr:a.GetInitXRandom(),yr:a.GetInitYRandom(),spr:a.GetInitSpeedRandom(),szr:a.GetInitSizeRandom(),grnd:a.GetGrowRandom(),acc:a.GetAcceleration(),g:a.GetGravity(),lar:a.GetLifeAngleRandom(),lsr:a.GetLifeSpeedRandom(),lor:a.GetLifeOpacityRandom(),dm:a.GetDestroyModeIndex(), to:a.GetTimeout(),s:a.IsSpraying(),pcc:a._GetCreateCounter(),ft:this._isFirstTick,soc:this._spawnObjectClass?this._spawnObjectClass.GetSID():null,p:a.GetParticles().map(b=>b.toJSON())}}LoadFromJson(a,b){const c=this._particleEngine;c.SetRate(a.r);c.SetSprayCone(a.sc);c.SetSprayType(a.st);c.SetInitSpeed(a.isp);c.SetInitSize(a.isz);c.SetInitOpacity(a.io);c.SetGrowRate(a.gr);c.SetInitXRandom(a.xr);c.SetInitYRandom(a.yr);c.SetInitSpeedRandom(a.spr);c.SetInitSizeRandom(a.szr);c.SetGrowRandom(a.grnd);c.SetAcceleration(a.acc); c.SetGravity(a.g);c.SetLifeAngleRandom(a.lar);c.SetLifeSpeedRandom(a.lsr);c.SetLifeOpacityRandom(a.lor);c.SetDestroyModeIndex(a.dm);c.SetTimeout(a.to);c.SetSpraying(a.s);c._SetCreateCounter(a.pcc);this._isFirstTick=a.ft;if(a.hasOwnProperty("soc")){var d=this.GetRuntime().GetObjectClassBySID(a.soc);d&&this._SetParticleObjectClass(d)}a=a.p;c.SetParticleCount(a.length);d=c.GetParticles();for(let e=0,g=d.length;e<g;++e)d[e].setFromJSON(a[e]);"state"===b&&this._spawnObjectClass&&(c.UpdateAllParticlesUserData(), c.ApplyParticleDataToUserData(this))}_OnAfterLoad(){var a=this._particleEngine;a.UpdateAllParticlesUserData();a.ApplyParticleDataToUserData(this);if("one-shot"===a.GetSprayType()){a=a.GetParticles();for(let d=0,e=a.length;d<e;++d){var b=a[d],c=b.GetUserData();c&&(c=c.GetWorldInfo())&&(c=c.GetInstance())&&(b=b.GetUserDataUID(),c=c.GetUID(),"number"!==typeof b||"number"!==typeof c||b!==c)&&(c=this.GetRuntime(),(b=c.GetInstanceByUID(b))&&c.DestroyInstance(b))}}}Tick(){const a=this._runtime.GetDt(this._inst); this._UpdateEngineParameters();this._isFirstTick&&"one-shot"===this._particleEngine.GetSprayType()&&this._particleEngine.ReInitAllParticles();this._particleEngine.Tick(a);this._particleEngine.IsSpraying()&&this._runtime.UpdateRender();this.GetWorldInfo().SetBboxChanged();this._isFirstTick=!1}_FastForward(a){const b=1/60;for(this._isFirstTick&&"one-shot"===this._particleEngine.GetSprayType()&&this._particleEngine.ReInitAllParticles();0<a;)this._particleEngine.Tick(b),a-=b;this._particleEngine.IsSpraying()&& this._runtime.UpdateRender();this.GetWorldInfo().SetBboxChanged();this._isFirstTick=!1}_OnParticleCreate(a){const b=this._runtime.CreateInstance(this._spawnObjectClass,this.GetWorldInfo().GetLayer(),a.GetX(),a.GetY()),c=b.GetWorldInfo();c.SetSize(a.GetSize(),a.GetSize());c.SetAngle(a.GetAngle());c.SetOpacity(a.GetOpacity());c.SetUnpremultipliedColor(this.GetWorldInfo().GetUnpremultipliedColor());c.SetBboxChanged();c.ZOrderMoveAdjacentToInstance(this.GetInstance(),!0);b._TriggerOnCreated();a.SetUpdateCallback(this._particleUpdateCallback); a.SetDestroyCallback(this._particleDestroyCallback);return b}_OnParticleUpdate(a,b,c,d,e,g){a.IsDestroyed()||(a=a.GetWorldInfo(),a.OffsetXY(b,c),a.SetSize(a.GetWidth()+d,a.GetHeight()+d),a.SetAngle(a.GetAngle()+e),a.SetOpacity(a.GetOpacity()+g),a.SetBboxChanged())}_OnParticleDestroy(a){a.IsDestroyed()||this._runtime.DestroyInstance(a)}GetPropertyValueByIndex(a){const b=this._particleEngine;switch(a){case 0:return b.GetRate();case 1:return C3$jscomp$194.toDegrees(b.GetSprayCone());case 2:return"one-shot"=== b.GetSprayType()?1:0;case 5:return b.GetInitSpeed();case 6:return b.GetInitSize();case 7:return 100*b.GetInitOpacity();case 8:return b.GetGrowRate();case 9:return b.GetInitXRandom();case 10:return b.GetInitYRandom();case 11:return b.GetInitSpeedRandom();case 12:return b.GetInitSizeRandom();case 13:return b.GetGrowRandom();case 14:return b.GetAcceleration();case 15:return b.GetGravity();case 16:return b.GetLifeAngleRandom();case 17:return b.GetLifeSpeedRandom();case 18:return b.GetLifeOpacityRandom(); case 19:return b.GetDestroyModeIndex();case 20:return b.GetTimeout()}}SetPropertyValueByIndex(a,b){const c=this._particleEngine;switch(a){case 0:c.SetRate(b);break;case 1:c.SetSprayCone(C3$jscomp$194.toRadians(b));break;case 2:c.SetSprayType(b?"one-shot":"continuous-spray");break;case 5:c.SetInitSpeed(b);break;case 6:c.SetInitSize(b);break;case 7:c.SetInitOpacity(b/100);break;case 8:c.SetGrowRate(b);break;case 9:c.SetInitXRandom(b);break;case 10:c.SetInitYRandom(b);break;case 11:c.SetInitSpeedRandom(b); break;case 12:c.SetInitSizeRandom(b);break;case 13:c.SetGrowRandom(b);break;case 14:c.SetAcceleration(b);break;case 15:c.SetGravity(b);break;case 16:c.SetLifeAngleRandom(b);break;case 17:c.SetLifeSpeedRandom(b);break;case 18:c.SetLifeOpacityRandom(b);break;case 19:c.SetDestroyModeIndex(b);break;case 20:c.SetTimeout(b)}}GetDebuggerProperties(){const a=this._particleEngine;return[{title:"plugins.particles.name",properties:[{name:"plugins.particles.debugger.particle-count",value:a.GetParticleCount()}, {name:"plugins.particles.properties.type.name",value:["plugins.particles.properties.type.items."+a.GetSprayType()]},{name:"plugins.particles.debugger.is-spraying",value:a.IsSpraying(),onedit:b=>a.SetSpraying(b)},{name:"plugins.particles.properties.rate.name",value:a.GetRate(),onedit:b=>a.SetRate(b)},{name:"plugins.particles.properties.spray-cone.name",value:C3$jscomp$194.toDegrees(a.GetSprayCone()),onedit:b=>a.SetSprayCone(C3$jscomp$194.toRadians(b))},{name:"plugins.particles.properties.speed.name", value:a.GetInitSpeed(),onedit:b=>a.SetInitSpeed(b)},{name:"plugins.particles.properties.size.name",value:a.GetInitSize(),onedit:b=>a.SetInitSize(b)},{name:"plugins.particles.properties.opacity.name",value:a.GetInitOpacity(),onedit:b=>a.SetInitOpacity(b)},{name:"plugins.particles.properties.grow-rate.name",value:a.GetGrowRate(),onedit:b=>a.SetGrowRate(b)},{name:"plugins.particles.properties.x-randomiser.name",value:a.GetInitXRandom(),onedit:b=>a.SetInitXRandom(b)},{name:"plugins.particles.properties.y-randomiser.name", value:a.GetInitYRandom(),onedit:b=>a.SetInitYRandom(b)},{name:"plugins.particles.properties.initial-speed-randomiser.name",value:a.GetInitSpeedRandom(),onedit:b=>a.SetInitSpeedRandom(b)},{name:"plugins.particles.properties.size-randomiser.name",value:a.GetInitSizeRandom(),onedit:b=>a.SetInitSizeRandom(b)},{name:"plugins.particles.properties.grow-rate-randomiser.name",value:a.GetGrowRandom(),onedit:b=>a.SetGrowRandom(b)},{name:"plugins.particles.properties.acceleration.name",value:a.GetAcceleration(), onedit:b=>a.SetAcceleration(b)},{name:"plugins.particles.properties.gravity.name",value:a.GetGravity(),onedit:b=>a.SetGravity(b)},{name:"plugins.particles.properties.angle-randomiser.name",value:a.GetLifeAngleRandom(),onedit:b=>a.SetLifeAngleRandom(b)},{name:"plugins.particles.properties.life-speed-randomiser.name",value:a.GetLifeSpeedRandom(),onedit:b=>a.SetLifeSpeedRandom(b)},{name:"plugins.particles.properties.opacity-randomiser.name",value:a.GetLifeOpacityRandom(),onedit:b=>a.SetLifeOpacityRandom(b)}, {name:"plugins.particles.properties.timeout.name",value:a.GetTimeout(),onedit:b=>a.SetTimeout(b)}]}]}GetScriptInterfaceClass(){return self.IParticlesInstance}};const map$jscomp$20=new WeakMap;function GetParticleEngine(a){return map$jscomp$20.get(a).GetParticleEngine()} self.IParticlesInstance=class extends self.IWorldInstance{constructor(){super();map$jscomp$20.set(this,self.IInstance._GetInitInst().GetSdkInstance())}set isSpraying(a){GetParticleEngine(this).SetSpraying(!!a)}get isSpraying(){return GetParticleEngine(this).IsSpraying()}set rate(a){C3X$jscomp$19.RequireFiniteNumber(a);map$jscomp$20.get(this)._SetRate(a)}get rate(){return GetParticleEngine(this).GetRate()}set sprayCone(a){C3X$jscomp$19.RequireFiniteNumber(a);GetParticleEngine(this).SetSprayCone(a)}get sprayCone(){return GetParticleEngine(this).GetSprayCone()}set initSpeed(a){C3X$jscomp$19.RequireFiniteNumber(a); GetParticleEngine(this).SetInitSpeed(a)}get initSpeed(){return GetParticleEngine(this).GetInitSpeed()}set initSize(a){C3X$jscomp$19.RequireFiniteNumber(a);GetParticleEngine(this).SetInitSize(a)}get initSize(){return GetParticleEngine(this).GetInitSize()}set initOpacity(a){C3X$jscomp$19.RequireFiniteNumber(a);GetParticleEngine(this).SetInitOpacity(a)}get initOpacity(){return GetParticleEngine(this).GetInitOpacity()}set initXRandom(a){C3X$jscomp$19.RequireFiniteNumber(a);GetParticleEngine(this).SetInitXRandom(a)}get initXRandom(){return GetParticleEngine(this).GetInitXRandom()}set initYRandom(a){C3X$jscomp$19.RequireFiniteNumber(a); GetParticleEngine(this).SetInitYRandom(a)}get initYRandom(){return GetParticleEngine(this).GetInitYRandom()}set initSpeedRandom(a){C3X$jscomp$19.RequireFiniteNumber(a);GetParticleEngine(this).SetInitSpeedRandom(a)}get initSpeedRandom(){return GetParticleEngine(this).GetInitSpeedRandom()}set initSizeRandom(a){C3X$jscomp$19.RequireFiniteNumber(a);GetParticleEngine(this).SetInitSizeRandom(a)}get initSizeRandom(){return GetParticleEngine(this).GetInitSizeRandom()}set initGrowRate(a){C3X$jscomp$19.RequireFiniteNumber(a); GetParticleEngine(this).SetGrowRate(a)}get initGrowRate(){return GetParticleEngine(this).GetGrowRate()}set initGrowRandom(a){C3X$jscomp$19.RequireFiniteNumber(a);GetParticleEngine(this).SetGrowRandom(a)}get initGrowRandom(){return GetParticleEngine(this).GetGrowRandom()}set acceleration(a){C3X$jscomp$19.RequireFiniteNumber(a);GetParticleEngine(this).SetAcceleration(a)}get acceleration(){return GetParticleEngine(this).GetAcceleration()}set gravity(a){C3X$jscomp$19.RequireFiniteNumber(a);GetParticleEngine(this).SetGravity(a)}get gravity(){return GetParticleEngine(this).GetGravity()}set lifeAngleRandom(a){C3X$jscomp$19.RequireFiniteNumber(a); GetParticleEngine(this).SetLifeAngleRandom(a)}get lifeAngleRandom(){return GetParticleEngine(this).GetLifeAngleRandom()}set lifeSpeedRandom(a){C3X$jscomp$19.RequireFiniteNumber(a);GetParticleEngine(this).SetLifeSpeedRandom(a)}get lifeSpeedRandom(){return GetParticleEngine(this).GetLifeSpeedRandom()}set lifeOpacityRandom(a){C3X$jscomp$19.RequireFiniteNumber(a);GetParticleEngine(this).SetLifeOpacityRandom(a)}get lifeOpacityRandom(){return GetParticleEngine(this).GetLifeOpacityRandom()}set timeout(a){C3X$jscomp$19.RequireFiniteNumber(a); GetParticleEngine(this).SetTimeout(a)}get timeout(){return GetParticleEngine(this).GetTimeout()}fastForward(a){C3X$jscomp$19.RequireFiniteNumber(a);map$jscomp$20.get(this)._FastForward(a)}setParticleObjectClass(a){const b=map$jscomp$20.get(this);a?b._SetParticleObjectClass(b.GetRuntime()._UnwrapIObjectClass(a)):b._SetParticleObjectClass(null)}};self.C3.Plugins.Particles.Cnds={IsSpraying(){return this._particleEngine.IsSpraying()}};const C3$jscomp$196=self.C3; C3$jscomp$196.Plugins.Particles.Acts={SetSpraying(a){this._particleEngine.SetSpraying(0!==a)},SetRate(a){this._SetRate(a)},SetParticleObject(a){this._SetParticleObjectClass(a)},UnsetParticleObject(){this._SetParticleObjectClass(null)},SetSprayCone(a){this._particleEngine.SetSprayCone(C3$jscomp$196.toRadians(a))},SetInitSpeed(a){this._particleEngine.SetInitSpeed(a)},SetInitSize(a){this._particleEngine.SetInitSize(a)},SetInitOpacity(a){this._particleEngine.SetInitOpacity(a/100)},SetGrowRate(a){this._particleEngine.SetGrowRate(a)}, SetXRandomiser(a){this._particleEngine.SetInitXRandom(a)},SetYRandomiser(a){this._particleEngine.SetInitYRandom(a)},SetSpeedRandomiser(a){this._particleEngine.SetInitSpeedRandom(a)},SetSizeRandomiser(a){this._particleEngine.SetInitSizeRandom(a)},SetGrowRateRandomiser(a){this._particleEngine.SetGrowRandom(a)},SetParticleAcc(a){this._particleEngine.SetAcceleration(a)},SetGravity(a){this._particleEngine.SetGravity(a)},SetAngleRandomiser(a){this._particleEngine.SetLifeAngleRandom(a)},SetLifeSpeedRandomiser(a){this._particleEngine.SetLifeSpeedRandom(a)}, SetOpacityRandomiser(a){this._particleEngine.SetLifeOpacityRandom(a)},SetTimeout(a){this._particleEngine.SetTimeout(a)},FastForward(a){this._FastForward(a)},SetEffect(a){this.GetWorldInfo().SetBlendMode(a);this._runtime.UpdateRender()}};const C3$jscomp$197=self.C3; C3$jscomp$197.Plugins.Particles.Exps={ParticleCount(){return this._particleEngine.GetParticleCount()},Rate(){return this._particleEngine.GetRate()},SprayCone(){return C3$jscomp$197.toDegrees(this._particleEngine.GetSprayCone())},InitSpeed(){return this._particleEngine.GetInitSpeed()},InitSize(){return this._particleEngine.GetInitSize()},InitOpacity(){return 100*this._particleEngine.GetInitOpacity()},InitGrowRate(){return this._particleEngine.GetGrowRate()},XRandom(){return this._particleEngine.GetInitXRandom()}, YRandom(){return this._particleEngine.GetInitYRandom()},InitSizeRandom(){return this._particleEngine.GetInitSizeRandom()},InitSpeedRandom(){return this._particleEngine.GetInitSpeedRandom()},InitGrowRandom(){return this._particleEngine.GetGrowRandom()},ParticleAcceleration(){return this._particleEngine.GetAcceleration()},Gravity(){return this._particleEngine.GetGravity()},ParticleAngleRandom(){return this._particleEngine.GetLifeAngleRandom()},ParticleSpeedRandom(){return this._particleEngine.GetLifeSpeedRandom()}, ParticleOpacityRandom(){return this._particleEngine.GetLifeOpacityRandom()},Timeout(){return this._particleEngine.GetTimeout()}};"use strict";const C3$jscomp$198=self.C3,inactiveParticles=[],VALID_SPRAY_TYPES=new Set(["continuous-spray","one-shot"]),DESTROY_MODES=["fade-to-invisible","timeout-expired","particle-stopped"],tempRect$jscomp$12=C3$jscomp$198.New(C3$jscomp$198.Rect); self.ParticleEngine=class{constructor(){this._sprayCone=this._rate=0;this._sprayType="continuous-spray";this._isSpraying=!1;this._masterOpacity=0;this._isPixelRounding=!1;this._initSize=this._initSpeed=this._spawnAngle=this._spawnY=this._spawnX=0;this._initSizeScale=1;this._createCounter=this._timeout=this._destroyMode=this._lifeOpacityRandom=this._lifeSpeedRandom=this._lifeAngleRandom=this._gravity=this._acceleration=this._growRandom=this._initSizeRandom=this._initSpeedRandom=this._yRandom=this._xRandom= this._growRate=this._initOpacity=0;this._particleScale=1;this.onparticlecreate=this.ononeshotfinish=null;this._particles=[];this._boundingBox=new C3$jscomp$198.Rect;this._color=new C3$jscomp$198.Color}Release(){this.Cancel();C3$jscomp$198.clearArray(this._particles);this._color=this._boundingBox=this.onparticlecreate=this.ononeshotfinish=this._particles=null}Cancel(){const a=this._particles;for(let b=0,c=a.length;b<c;++b)a[b].Destroy();C3$jscomp$198.appendArray(inactiveParticles,a);C3$jscomp$198.clearArray(a); 1E3<inactiveParticles.length&&C3$jscomp$198.truncateArray(inactiveParticles,1E3);this._isSpraying=!1}CreateOneShotSpray(){for(let a=0,b=this._rate;a<b;++a)this._CreateParticle();this._particles.length&&(this._isSpraying=!0)}_CreateParticle(){let a;inactiveParticles.length?(a=inactiveParticles.pop(),a.SetEngine(this)):a=C3$jscomp$198.New(self.Particle,this);this._particles.push(a);a.Init(this.onparticlecreate);return a}ReInitAllParticles(){const a=this._particles,b=this.onparticlecreate;for(let c= 0,d=a.length;c<d;++c)a[c].Init(b)}UpdateAllParticlesUserData(){const a=this._particles,b=this.onparticlecreate;for(let c=0,d=a.length;c<d;++c)a[c].UpdateUserData(b)}ApplyParticleDataToUserData(a){const b=this._particles;for(let d=0,e=b.length;d<e;++d){const g=b[d];var c=g.GetUserData();c&&(c=c.GetWorldInfo(),c.SetX(g.GetX()),c.SetY(g.GetY()),c.SetSize(g.GetSize(),g.GetSize()),c.SetOpacity(g.GetOpacity()),c.SetAngle(g.GetAngle()),c.SetUnpremultipliedColor(a.GetWorldInfo().GetUnpremultipliedColor()), c.SetBboxChanged())}}SetParticleCount(a){var b=this._particles;if(a<b.length){a=b.length-a;for(let c=0;c<a;++c){const d=b.pop();d.Destroy();inactiveParticles.push(d)}1E3<inactiveParticles.length&&C3$jscomp$198.truncateArray(inactiveParticles,1E3)}else if(a>b.length)for(b=a-b.length,a=0;a<b;++a)this._CreateParticle()}GetParticles(){return this._particles}GetParticleCount(){return this._particles.length}Tick(a){this._SpawnContinuous(a);this._TickParticles(a);this._MaybeFinishOneShot()}_SpawnContinuous(a){if("continuous-spray"=== this._sprayType&&this._isSpraying){this._createCounter+=a*this._rate;a=Math.floor(this._createCounter);this._createCounter-=a;for(let b=0;b<a;++b)this._CreateParticle()}}_SetCreateCounter(a){this._createCounter=a}_GetCreateCounter(){return this._createCounter}_TickParticles(a){const b=this._boundingBox;b.set(this._spawnX,this._spawnY,this._spawnX,this._spawnY);const c=this._particles;let d=0;for(let e=0,g=c.length;e<g;++e){const k=c[e];c[d]=k;k.Tick(a);k.IsActive()?(++d,b.expandToContain(k.GetBoundingBox())): (k.Destroy(),inactiveParticles.push(k))}C3$jscomp$198.truncateArray(c,d);1E3<inactiveParticles.length&&C3$jscomp$198.truncateArray(inactiveParticles,1E3)}_MaybeFinishOneShot(){if("one-shot"===this._sprayType&&0===this._particles.length&&this._isSpraying){if(this.ononeshotfinish)this.ononeshotfinish();this._isSpraying=!1}}Draw(a,b,c,d){tempRect$jscomp$12.set(b.getTlx(),b.getTly(),b.getBrx(),b.getBry());a.StartRenderingPoints(tempRect$jscomp$12);this._color.copy(a.GetColor());const e=this._particles; for(let g=0,k=e.length;g<k;++g){const l=e[g];c.intersectsRect(l.GetBoundingBox())&&l.Draw(a,b,d)}a.FinishRenderingPoints()}GetColor(){return this._color}SetRate(a){this._rate=+a}GetRate(){return this._rate}SetSprayCone(a){this._sprayCone=+a}GetSprayCone(){return this._sprayCone}SetSprayType(a){if(!VALID_SPRAY_TYPES.has(a))throw Error("invalid spray type");this._sprayType=a}GetSprayType(){return this._sprayType}SetSpraying(a){this._isSpraying=!!a}IsSpraying(){return this._isSpraying}SetMasterOpacity(a){this._masterOpacity= +a}GetMasterOpacity(){return this._masterOpacity}SetPixelRounding(a){this._isPixelRounding=!!a}IsPixelRounding(){return this._isPixelRounding}SetSpawnX(a){this._spawnX=+a}GetSpawnX(){return this._spawnX}SetSpawnY(a){this._spawnY=+a}GetSpawnY(){return this._spawnY}SetSpawnAngle(a){this._spawnAngle=+a}GetInitAngle(){return this._spawnAngle}SetInitSpeed(a){this._initSpeed=+a}GetInitSpeed(){return this._initSpeed}SetInitSize(a){this._initSize=+a}GetInitSize(){return this._initSize}SetInitSizeScale(a){this._initSizeScale= +a}GetInitSizeScale(){return this._initSizeScale}SetInitOpacity(a){this._initOpacity=+a}GetInitOpacity(){return this._initOpacity}SetGrowRate(a){this._growRate=+a}GetGrowRate(){return this._growRate}SetInitXRandom(a){this._xRandom=+a}GetInitXRandom(){return this._xRandom}SetInitYRandom(a){this._yRandom=+a}GetInitYRandom(){return this._yRandom}SetInitSpeedRandom(a){this._initSpeedRandom=+a}GetInitSpeedRandom(){return this._initSpeedRandom}SetInitSizeRandom(a){this._initSizeRandom=+a}GetInitSizeRandom(){return this._initSizeRandom}SetGrowRandom(a){this._growRandom= +a}GetGrowRandom(){return this._growRandom}SetAcceleration(a){this._acceleration=+a}GetAcceleration(){return this._acceleration}SetGravity(a){this._gravity=+a}GetGravity(){return this._gravity}SetLifeAngleRandom(a){this._lifeAngleRandom=+a}GetLifeAngleRandom(){return this._lifeAngleRandom}SetLifeSpeedRandom(a){this._lifeSpeedRandom=+a}GetLifeSpeedRandom(){return this._lifeSpeedRandom}SetLifeOpacityRandom(a){this._lifeOpacityRandom=+a}GetLifeOpacityRandom(){return this._lifeOpacityRandom}SetDestroyMode(a){a= DESTROY_MODES.indexOf(a);if(-1===a)throw Error("invalid destroy mode");this._destroyMode=a}SetDestroyModeIndex(a){this.SetDestroyMode(DESTROY_MODES[a])}GetDestroyMode(){return DESTROY_MODES[this._destroyMode]}GetDestroyModeIndex(){return this._destroyMode}SetTimeout(a){this._timeout=+a}GetTimeout(){return this._timeout}SetParticleScale(a){this._particleScale=+a}GetParticleScale(){return this._particleScale}GetBoundingBox(){return this._boundingBox}};"use strict";const C3$jscomp$199=self.C3; function randomOffset(a){return Math.random()*a-a/2}const tmpQuad$jscomp$3=new C3$jscomp$199.Quad,tmpColor=new C3$jscomp$199.Color,DPR=self.devicePixelRatio||1;let didChangeColor=!1; self.Particle=class{constructor(a){this._engine=a;this._isActive=!1;this._angle=this._speed=this._y=this._x=0;this._opacity=1;this._age=this._gs=this._halfSize=this._size=this._grow=this._lastOpacity=0;this._bbox=new C3$jscomp$199.Rect;this._userData=null;this._userDataUid=NaN;this._destroyCallback=this._updateCallback=null}SetEngine(a){this._engine=a}Init(a){const b=this._engine;this._isActive=!0;this._x=b.GetSpawnX()+randomOffset(b.GetInitXRandom());this._y=b.GetSpawnY()+randomOffset(b.GetInitYRandom()); this._speed=b.GetInitSpeed()+randomOffset(b.GetInitSpeedRandom());this._angle=b.GetInitAngle()+randomOffset(b.GetSprayCone());this._lastOpacity=this._opacity=b.GetInitOpacity();this._size=(b.GetInitSize()+randomOffset(b.GetInitSizeRandom()))*b.GetInitSizeScale();this._halfSize=this._size/2;this._grow=b.GetGrowRate()+randomOffset(b.GetGrowRandom());this._age=this._gs=0;this._UpdateBoundingBox();a?this._userData||(this._userData=a(this)):this._destroyCallback=this._updateCallback=this._userData=null}UpdateUserData(a){if(a){if(!this._userData|| this._userData.IsDestroyed())this._userData=a(this)}else this._destroyCallback=this._updateCallback=this._userData=null}SetUpdateCallback(a){this._updateCallback=a}SetDestroyCallback(a){this._destroyCallback=a}Destroy(){const a=this._destroyCallback;a&&a(this._userData);this._destroyCallback=this._updateCallback=this._userData=null}toJSON(){let a;this._userData&&(a=this._userData.GetWorldInfo().GetInstance().GetUID());return[this._x,this._y,this._speed,this._angle,this._opacity,this._grow,this._size, this._gs,this._age,a]}setFromJSON(a){this._x=a[0];this._y=a[1];this._speed=a[2];this._angle=a[3];this._opacity=a[4];this._grow=a[5];this._size=a[6];this._gs=a[7];this._age=a[8];this._userDataUid=a[9];this._halfSize=this._size/2;this._UpdateBoundingBox()}Tick(a){var b=this._engine,c=this._speed*a,d=this._angle;const e=Math.cos(d)*c;c=Math.sin(d)*c+this._gs*a;this._x+=e;this._y+=c;d=this._grow*a;this._size+=d;this._halfSize=this._size/2;this._speed+=b.GetAcceleration()*a;this._gs+=b.GetGravity()*a; this._age+=a;this._UpdateBoundingBox();var g=b.GetLifeAngleRandom(),k=b.GetLifeSpeedRandom();const l=b.GetLifeOpacityRandom();let n=0;0!==g&&(n=randomOffset(g*a),this._angle+=n);0!==k&&(this._speed+=randomOffset(k*a));0!==l&&(this._opacity=C3$jscomp$199.clamp(this._opacity+randomOffset(l*a),0,1));a=1<=this._size&&(2===b.GetDestroyModeIndex()?0<this._speed:this._age<b.GetTimeout());(g=this._updateCallback)&&a&&(k=b.GetMasterOpacity()*this._opacity,0===b.GetDestroyModeIndex()&&(k*=1-this._age/b.GetTimeout()), b=k-this._lastOpacity,this._lastOpacity=k,g(this._userData,e,c,d,n,b));this._isActive=a}IsActive(){return this._isActive}GetBoundingBox(){return this._bbox}_UpdateBoundingBox(){const a=this._x,b=this._y,c=this._halfSize;this._bbox.set(a-c,b-c,a+c,b+c)}Draw(a,b,c){if(!this._userData){var d=this._engine,e=d.GetMasterOpacity()*this._opacity;0===d.GetDestroyModeIndex()&&(e*=1-this._age/d.GetTimeout());if(!(0>=e)){var g=this._size,k=g*d.GetParticleScale()*DPR;if(!(1>k)){var l=this._x,n=this._y;d.IsPixelRounding()&& (l=l+.5|0,n=n+.5|0);a.IsWebGPU()?a.Point(l,n,g,e):c||k>a.GetMaxPointSize()||k<a.GetMinPointSize()?(tmpColor.copy(d.GetColor()),tmpColor.multiplyAlpha(e),a.SetColor(tmpColor),didChangeColor=!0,tmpQuad$jscomp$3.setFromRect(this._bbox),a.Quad4(tmpQuad$jscomp$3,b)):(didChangeColor&&(a.SetColor(d.GetColor()),didChangeColor=!1),a.Point(l,n,k,e))}}}}GetUserData(){return this._userData}GetUserDataUID(){return this._userDataUid}GetX(){return this._x}GetY(){return this._y}GetSize(){return this._size}GetAngle(){return this._angle}GetOpacity(){return this._opacity}}; "use strict";const C3$jscomp$200=self.C3;C3$jscomp$200.Plugins.TiledBg=class extends C3$jscomp$200.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$201=self.C3;function WrapModeToStr(a){switch(a){case 0:return"clamp-to-edge";case 2:return"mirror-repeat"}return"repeat"} C3$jscomp$201.Plugins.TiledBg.Type=class extends C3$jscomp$201.SDKTypeBase{constructor(a,b){super(a);this._wrapY=this._wrapX="repeat";b&&(this._wrapX=WrapModeToStr(b[0]),this._wrapY=WrapModeToStr(b[1]))}Release(){super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}LoadTextures(a){return this.GetImageInfo().LoadStaticTexture(a,{sampling:this._runtime.GetSampling(),wrapX:this._wrapX,wrapY:this._wrapY})}ReleaseTextures(){this.GetImageInfo().ReleaseTexture()}}; const C3$jscomp$202=self.C3,C3X$jscomp$20=self.C3X,tempRect$jscomp$13=C3$jscomp$202.New(C3$jscomp$202.Rect),tempQuad$jscomp$7=C3$jscomp$202.New(C3$jscomp$202.Quad),rcTex$jscomp$3=C3$jscomp$202.New(C3$jscomp$202.Rect),qTex=C3$jscomp$202.New(C3$jscomp$202.Quad); C3$jscomp$202.Plugins.TiledBg.Instance=class extends C3$jscomp$202.SDKWorldInstanceBase{constructor(a,b){super(a);this._imageOffsetY=this._imageOffsetX=0;this._imageScaleY=this._imageScaleX=1;this._imageAngle=0;this._enableTileRandomization=!1;this._tileBlendMarginY=this._tileBlendMarginX=this._tileAngleRandom=this._tileYRandom=this._tileXRandom=0;this._ownImageInfo=null;b&&(this.GetWorldInfo().SetVisible(!!b[0]),this._imageOffsetX=b[4],this._imageOffsetY=b[5],this._imageScaleX=b[6],this._imageScaleY= b[7],this._imageAngle=C3$jscomp$202.toRadians(b[8]),this._enableTileRandomization=!!b[9],this._tileXRandom=b[10],this._tileYRandom=b[11],this._tileAngleRandom=b[12],this._tileBlendMarginX=b[13],this._tileBlendMarginY=b[14])}Release(){this._ReleaseOwnImage();super.Release()}_ReleaseOwnImage(){this._ownImageInfo&&(this._ownImageInfo.Release(),this._ownImageInfo=null)}CalculateTextureCoordsFor3DFace(a,b,c){var d=this.GetCurrentImageInfo();const e=d.GetWidth();d=d.GetHeight();const g=this._imageOffsetX/ e,k=this._imageOffsetY/d,l=this._imageAngle;rcTex$jscomp$3.set(0,0,a/(e*this._imageScaleX),b/(d*this._imageScaleY));rcTex$jscomp$3.offset(-g,-k);0===l?c.setFromRect(rcTex$jscomp$3):c.setFromRotatedRect(rcTex$jscomp$3,-l)}SetTilingShaderProgram(a){if(this._enableTileRandomization){const b=this.GetCurrentImageInfo();a.SetTileRandomizationMode();a.SetTileRandomizationInfo(b.GetWidth()*this._imageScaleX,b.GetHeight()*this._imageScaleY,this._tileXRandom,this._tileYRandom,this._tileAngleRandom,this._tileBlendMarginX, this._tileBlendMarginY)}else a.SetTextureFillMode()}Draw(a){var b=this.GetCurrentImageInfo(),c=b.GetTexture();if(null!==c){this.SetTilingShaderProgram(a);a.SetTexture(c);c=b.GetWidth();b=b.GetHeight();var d=this._imageOffsetX/c,e=this._imageOffsetY/b,g=this.GetWorldInfo();rcTex$jscomp$3.set(0,0,g.GetWidth()/(c*this._imageScaleX),g.GetHeight()/(b*this._imageScaleY));rcTex$jscomp$3.offset(-d,-e);g.HasMesh()?this._DrawMesh(g,a):this._DrawStandard(g,a)}}_DrawStandard(a,b){let c=a.GetBoundingQuad();this._runtime.IsPixelRoundingEnabled()&& (c=a.PixelRoundQuad(c));0===this._imageAngle?b.Quad3(c,rcTex$jscomp$3):(qTex.setFromRotatedRect(rcTex$jscomp$3,-this._imageAngle),b.Quad4(c,qTex))}_DrawMesh(a,b){const c=a.GetTransformedMesh();if(a.IsMeshChanged()){a.CalculateBbox(tempRect$jscomp$13,tempQuad$jscomp$7,!1);let d=tempQuad$jscomp$7;this._runtime.IsPixelRoundingEnabled()&&(d=a.PixelRoundQuad(d));let e=rcTex$jscomp$3;0!==this._imageAngle&&(qTex.setFromRotatedRect(rcTex$jscomp$3,-this._imageAngle),e=qTex);c.CalculateTransformedMesh(a.GetSourceMesh(), d,e);a.SetMeshChanged(!1)}c.Draw(b)}GetCurrentImageInfo(){return this._ownImageInfo||this._objectClass.GetImageInfo()}IsOriginalSizeKnown(){return!0}GetTexture(){return this.GetCurrentImageInfo().GetTexture()}_SetMeshChanged(){this.GetWorldInfo().SetMeshChanged(!0)}_SetImageOffsetX(a){this._imageOffsetX!==a&&(this._imageOffsetX=a,this._runtime.UpdateRender(),this._SetMeshChanged())}_GetImageOffsetX(){return this._imageOffsetX}_SetImageOffsetY(a){this._imageOffsetY!==a&&(this._imageOffsetY=a,this._runtime.UpdateRender(), this._SetMeshChanged())}_GetImageOffsetY(){return this._imageOffsetY}_SetImageScaleX(a){this._imageScaleX!==a&&(this._imageScaleX=a,this._runtime.UpdateRender(),this._SetMeshChanged())}_GetImageScaleX(){return this._imageScaleX}_SetImageScaleY(a){this._imageScaleY!==a&&(this._imageScaleY=a,this._runtime.UpdateRender(),this._SetMeshChanged())}_GetImageScaleY(){return this._imageScaleY}_SetImageAngle(a){this._imageAngle!==a&&(this._imageAngle=a,this._runtime.UpdateRender(),this._SetMeshChanged())}_GetImageAngle(){return this._imageAngle}_SetTileRandomizationEnabled(a){a= !!a;this._enableTileRandomization!==a&&(this._enableTileRandomization=a,this._runtime.UpdateRender())}_IsTileRandomizationEnabled(){return this._enableTileRandomization}_SetTileXRandom(a){this._tileXRandom!==a&&(this._tileXRandom=a,this._IsTileRandomizationEnabled()&&this._runtime.UpdateRender())}_GetTileXRandom(){return this._tileXRandom}_SetTileYRandom(a){this._tileYRandom!==a&&(this._tileYRandom=a,this._IsTileRandomizationEnabled()&&this._runtime.UpdateRender())}_GetTileYRandom(){return this._tileYRandom}_SetTileAngleRandom(a){this._tileAngleRandom!== a&&(this._tileAngleRandom=a,this._IsTileRandomizationEnabled()&&this._runtime.UpdateRender())}_GetTileAngleRandom(){return this._tileAngleRandom}_SetTileBlendMarginX(a){this._tileBlendMarginX!==a&&(this._tileBlendMarginX=a,this._IsTileRandomizationEnabled()&&this._runtime.UpdateRender())}_GetTileBlendMarginX(){return this._tileBlendMarginX}_SetTileBlendMarginY(a){this._tileBlendMarginY!==a&&(this._tileBlendMarginY=a,this._IsTileRandomizationEnabled()&&this._runtime.UpdateRender())}_GetTileBlendMarginY(){return this._tileBlendMarginY}GetDebuggerProperties(){return[{title:"plugins.tiledbg.properties.image-transform.name", properties:[{name:"plugins.tiledbg.properties.image-offset-x.name",value:this._GetImageOffsetX(),onedit:a=>this._SetImageOffsetX(a)},{name:"plugins.tiledbg.properties.image-offset-y.name",value:this._GetImageOffsetY(),onedit:a=>this._SetImageOffsetY(a)},{name:"plugins.tiledbg.properties.image-scale-x.name",value:100*this._GetImageScaleX(),onedit:a=>this._SetImageScaleX(a/100)},{name:"plugins.tiledbg.properties.image-scale-y.name",value:100*this._GetImageScaleY(),onedit:a=>this._SetImageScaleY(a/100)}, {name:"plugins.tiledbg.properties.image-angle.name",value:C3$jscomp$202.toDegrees(this._GetImageAngle()),onedit:a=>this._SetImageAngle(C3$jscomp$202.toRadians(a))}]},{title:"plugins.tiledbg.properties.tile-randomization.name",properties:[{name:"plugins.tiledbg.properties.enable-tile-randomization.name",value:this._IsTileRandomizationEnabled(),onedit:a=>this._SetTileRandomizationEnabled(a)},{name:"plugins.tiledbg.properties.x-random.name",value:100*this._GetTileXRandom(),onedit:a=>this._SetTileXRandom(a/ 100)},{name:"plugins.tiledbg.properties.y-random.name",value:100*this._GetTileYRandom(),onedit:a=>this._SetTileYRandom(a/100)},{name:"plugins.tiledbg.properties.angle-random.name",value:100*this._GetTileAngleRandom(),onedit:a=>this._SetTileAngleRandom(a/100)},{name:"plugins.tiledbg.properties.blend-margin-x.name",value:100*this._GetTileBlendMarginX(),onedit:a=>this._SetTileBlendMarginX(a/100)},{name:"plugins.tiledbg.properties.blend-margin-y.name",value:100*this._GetTileBlendMarginY(),onedit:a=>this._SetTileBlendMarginY(a/ 100)}]}]}GetPropertyValueByIndex(a){switch(a){case 4:return this._GetImageOffsetX();case 5:return this._GetImageOffsetY();case 6:return this._GetImageScaleX();case 7:return this._GetImageScaleY();case 8:return this._GetImageAngle();case 9:return this._IsTileRandomizationEnabled();case 10:return this._GetTileXRandom();case 11:return this._GetTileYRandom();case 12:return this._GetTileAngleRandom();case 13:return this._GetTileBlendMarginX();case 14:return this._GetTileBlendMarginY()}}SetPropertyValueByIndex(a, b){switch(a){case 4:this._SetImageOffsetX(b);break;case 5:this._SetImageOffsetY(b);break;case 6:this._SetImageScaleX(b);break;case 7:this._SetImageScaleY(b);break;case 8:this._SetImageAngle(b);break;case 9:this._SetTileRandomizationEnabled(!!b);break;case 10:this._SetTileXRandom(b);break;case 11:this._SetTileYRandom(b);break;case 12:this._SetTileAngleRandom(b);break;case 13:this._SetTileBlendMarginX(b);break;case 14:this._SetTileBlendMarginY(b)}}GetScriptInterfaceClass(){return self.ITiledBackgroundInstance}}; const map$jscomp$21=new WeakMap; self.ITiledBackgroundInstance=class extends self.IWorldInstance{constructor(){super();map$jscomp$21.set(this,self.IInstance._GetInitInst().GetSdkInstance())}set imageOffsetX(a){C3X$jscomp$20.RequireFiniteNumber(a);map$jscomp$21.get(this)._SetImageOffsetX(a)}get imageOffsetX(){return map$jscomp$21.get(this)._GetImageOffsetX()}set imageOffsetY(a){C3X$jscomp$20.RequireFiniteNumber(a);map$jscomp$21.get(this)._SetImageOffsetY(a)}get imageOffsetY(){return map$jscomp$21.get(this)._GetImageOffsetY()}setImageOffset(a,b){C3X$jscomp$20.RequireFiniteNumber(a); C3X$jscomp$20.RequireFiniteNumber(b);const c=map$jscomp$21.get(this);c._SetImageOffsetX(a);c._SetImageOffsetY(b)}getImageOffset(){const a=map$jscomp$21.get(this);return[a._GetImageOffsetX(),a._GetImageOffsetY()]}set imageScaleX(a){C3X$jscomp$20.RequireFiniteNumber(a);map$jscomp$21.get(this)._SetImageScaleX(a)}get imageScaleX(){return map$jscomp$21.get(this)._GetImageScaleX()}set imageScaleY(a){C3X$jscomp$20.RequireFiniteNumber(a);map$jscomp$21.get(this)._SetImageScaleY(a)}get imageScaleY(){return map$jscomp$21.get(this)._GetImageScaleY()}setImageScale(a, b){C3X$jscomp$20.RequireFiniteNumber(a);C3X$jscomp$20.RequireFiniteNumber(b);const c=map$jscomp$21.get(this);c._SetImageScaleX(a);c._SetImageScaleY(b)}getImageScale(){const a=map$jscomp$21.get(this);return[a._GetImageScaleX(),a._GetImageScaleY()]}set imageAngle(a){C3X$jscomp$20.RequireFiniteNumber(a);map$jscomp$21.get(this)._SetImageAngle(a)}get imageAngle(){return map$jscomp$21.get(this)._GetImageAngle()}set imageAngleDegrees(a){C3X$jscomp$20.RequireFiniteNumber(a);map$jscomp$21.get(this)._SetImageAngle(C3$jscomp$202.toRadians(a))}get imageAngleDegrees(){return C3$jscomp$202.toDegrees(map$jscomp$21.get(this)._GetImageAngle())}get imageWidth(){return map$jscomp$21.get(this).GetCurrentImageInfo().GetWidth()}get imageHeight(){return map$jscomp$21.get(this).GetCurrentImageInfo().GetHeight()}getImageSize(){const a= map$jscomp$21.get(this).GetCurrentImageInfo();return[a.GetWidth(),a.GetHeight()]}set enableTileRandomization(a){map$jscomp$21.get(this)._SetTileRandomizationEnabled(!!a)}get enableTileRandomization(){return map$jscomp$21.get(this)._IsTileRandomizationEnabled()}set tileXRandom(a){C3X$jscomp$20.RequireFiniteNumber(a);map$jscomp$21.get(this)._SetTileXRandom(a)}get tileXRandom(){return map$jscomp$21.get(this)._GetTileXRandom()}set tileYRandom(a){C3X$jscomp$20.RequireFiniteNumber(a);map$jscomp$21.get(this)._SetTileYRandom(a)}get tileYRandom(){return map$jscomp$21.get(this)._GetTileYRandom()}setTileRandom(a, b){C3X$jscomp$20.RequireFiniteNumber(a);C3X$jscomp$20.RequireFiniteNumber(b);const c=map$jscomp$21.get(this);c._SetTileXRandom(a);c._SetTileYRandom(b)}getTileRandom(){const a=map$jscomp$21.get(this);return[a._GetTileXRandom(),a._GetTileYRandom()]}set tileAngleRandom(a){C3X$jscomp$20.RequireFiniteNumber(a);map$jscomp$21.get(this)._SetTileAngleRandom(a)}get tileAngleRandom(){return map$jscomp$21.get(this)._GetTileAngleRandom()}set tileBlendMarginX(a){C3X$jscomp$20.RequireFiniteNumber(a);map$jscomp$21.get(this)._SetTileBlendMarginX(a)}get tileBlendMarginX(){return map$jscomp$21.get(this)._GetTileBlendMarginX()}set tileBlendMarginY(a){C3X$jscomp$20.RequireFiniteNumber(a); map$jscomp$21.get(this)._SetTileBlendMarginY(a)}get tileBlendMarginY(){return map$jscomp$21.get(this)._GetTileBlendMarginY()}setTileBlendMargin(a,b){C3X$jscomp$20.RequireFiniteNumber(a);C3X$jscomp$20.RequireFiniteNumber(b);const c=map$jscomp$21.get(this);c._SetTileBlendMarginX(a);c._SetTileBlendMarginY(b)}getTileBlendMargin(){const a=map$jscomp$21.get(this);return[a._GetTileBlendMarginX(),a._GetTileBlendMarginY()]}async replaceImage(a){C3X$jscomp$20.RequireInstanceOf(a,Blob);const b=map$jscomp$21.get(this), c=b.GetRuntime(),d=C3$jscomp$202.New(C3$jscomp$202.ImageInfo);d.LoadDynamicBlobAsset(c,a);await d.LoadStaticTexture(c.GetRenderer(),{sampling:c.GetSampling(),wrapX:"repeat",wrapY:"repeat"});b.WasReleased()?d.Release():(b._ReleaseOwnImage(),b._ownImageInfo=d,c.UpdateRender())}};self.C3.Plugins.TiledBg.Cnds={OnURLLoaded(){return!0},OnURLFailed(){return!0},IsTileRandomizationEnabled(){return this._IsTileRandomizationEnabled()}};const C3$jscomp$204=self.C3; C3$jscomp$204.Plugins.TiledBg.Acts={SetImageOffsetX(a){this._SetImageOffsetX(a)},SetImageOffsetY(a){this._SetImageOffsetY(a)},SetImageScaleX(a){this._SetImageScaleX(a/100)},SetImageScaleY(a){this._SetImageScaleY(a/100)},SetImageAngle(a){this._SetImageAngle(C3$jscomp$204.toRadians(a))},SetTileRandomizationEnabled(a){this._SetTileRandomizationEnabled(a)},SetTilePosRandom(a,b){this._SetTileXRandom(a/100);this._SetTileYRandom(b/100)},SetTileAngleRandom(a){this._SetTileAngleRandom(a/100)},SetTileBlendMargin(a, b){this._SetTileBlendMarginX(a/100);this._SetTileBlendMarginY(b/100)},SetEffect(a){this.GetWorldInfo().SetBlendMode(a);this._runtime.UpdateRender()},async LoadURL(a,b){if(!this._ownImageInfo||this._ownImageInfo.GetURL()!==a){b=this._runtime;var c=C3$jscomp$204.New(C3$jscomp$204.ImageInfo);try{await c.LoadDynamicAsset(b,a);if(!c.IsLoaded())throw Error("image failed to load");if(this.WasReleased())return c.Release(),null;if(!await c.LoadStaticTexture(b.GetRenderer(),{sampling:b.GetSampling(),wrapX:"repeat", wrapY:"repeat"}))return}catch(d){console.error("Load image from URL failed: ",d);this.WasReleased()||this.Trigger(C3$jscomp$204.Plugins.TiledBg.Cnds.OnURLFailed);return}this.WasReleased()?c.Release():(this._ReleaseOwnImage(),this._ownImageInfo=c,b.UpdateRender(),await this.TriggerAsync(C3$jscomp$204.Plugins.TiledBg.Cnds.OnURLLoaded))}}};const C3$jscomp$205=self.C3; C3$jscomp$205.Plugins.TiledBg.Exps={ImageWidth(){return this.GetCurrentImageInfo().GetWidth()},ImageHeight(){return this.GetCurrentImageInfo().GetHeight()},ImageOffsetX(){return this._imageOffsetX},ImageOffsetY(){return this._imageOffsetY},ImageScaleX(){return 100*this._imageScaleX},ImageScaleY(){return 100*this._imageScaleY},ImageAngle(){return C3$jscomp$205.toDegrees(this._imageAngle)},TileXRandom(){return 100*this._GetTileXRandom()},TileYRandom(){return 100*this._GetTileYRandom()},TileAngleRandom(){return 100* this._GetTileAngleRandom()},TileBlendMarginX(){return 100*this._GetTileBlendMarginX()},TileBlendMarginY(){return 100*this._GetTileBlendMarginY()}};"use strict";const C3$jscomp$206=self.C3;C3$jscomp$206.Plugins.NinePatch=class extends C3$jscomp$206.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$207=self.C3; C3$jscomp$207.Plugins.NinePatch.Type=class extends C3$jscomp$207.SDKTypeBase{constructor(a){super(a);this._drawable=this._textureSet=null}Release(){this.ReleaseTextures();super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}async LoadTextures(a){this._drawable=await this.GetImageInfo().ExtractImageToCanvas()}CreatePatch(a,b,c,d){!this._textureSet&&this._drawable&&(this._textureSet=new self.NinePatchTextureSet(this),this._textureSet.CreateTextures(this._drawable,a,b,c,d))}ReleaseTextures(){this._textureSet&& (this._textureSet.Release(),this._textureSet=null)}GetTextureSet(){return this._textureSet}};const C3$jscomp$208=self.C3,tempRect1=C3$jscomp$208.New(C3$jscomp$208.Rect),tempRect2$jscomp$2=C3$jscomp$208.New(C3$jscomp$208.Rect),tempQuad$jscomp$8=C3$jscomp$208.New(C3$jscomp$208.Quad); C3$jscomp$208.Plugins.NinePatch.Instance=class extends C3$jscomp$208.SDKWorldInstanceBase{constructor(a,b){super(a);this._bottomMargin=this._topMargin=this._rightMargin=this._leftMargin=16;this._fill=this._edges=1;this._isSeamless=!0;this._callback3d=null;b&&(this._leftMargin=b[0],this._rightMargin=b[1],this._topMargin=b[2],this._bottomMargin=b[3],this._edges=b[4],this._fill=b[5],this._isSeamless=!!b[8],this.GetWorldInfo().SetVisible(!!b[6]));this._sdkType.CreatePatch(this._leftMargin,this._rightMargin, this._topMargin,this._bottomMargin)}Release(){super.Release()}_Set3DCallback(a){this._callback3d=a}Draw(a){const b=this.GetWorldInfo(),c=b.GetBoundingQuad();this._Draw(a,c.getTlx(),c.getTly(),b.GetWidth(),b.GetHeight())}_Draw(a,b,c,d,e){let g=this._sdkType.GetTextureSet();if(!g&&(this._sdkType.CreatePatch(this._leftMargin,this._rightMargin,this._topMargin,this._bottomMargin),g=this._sdkType.GetTextureSet(),!g))return;var k=g.GetImageWidth(),l=g.GetImageHeight();const n=Math.min(this._leftMargin,k), p=Math.min(this._rightMargin,k),r=Math.min(this._topMargin,l),w=Math.min(this._bottomMargin,l);k-=p;l-=w;var y=this._isSeamless?1:0;const B=this._edges,C=this._fill;0<n&&0<r&&this._DrawPatch(a,g.GetTexture(),0,0,n+y,r+y,b,c,n+y,r+y);0<p&&0<r&&this._DrawPatch(a,g.GetTexture(),k-y,0,p+y,r+y,b+d-p-y,c,p+y,r+y);0<p&&0<w&&this._DrawPatch(a,g.GetTexture(),k-y,l-y,p+y,w+y,b+d-p-y,c+e-w-y,p+y,w+y);0<n&&0<w&&this._DrawPatch(a,g.GetTexture(),0,l-y,n+y,w+y,b,c+e-w-y,n+y,w+y);0===B?(y=2===C?0:y,0<n&&l>r&&this._TilePatch(a, g.GetLeftTexture(),b,c+r,n+y,e-r-w,0,0),0<p&&l>r&&this._TilePatch(a,g.GetRightTexture(),b+d-p-y,c+r,p+y,e-r-w,y,0),0<r&&k>n&&this._TilePatch(a,g.GetTopTexture(),b+n,c,d-n-p,r+y,0,0),0<w&&k>n&&this._TilePatch(a,g.GetBottomTexture(),b+n,c+e-w-y,d-n-p,w+y,0,y)):1===B&&(0<n&&l>r&&this._DrawPatch(a,g.GetTexture(),0,r,n,l-r,b,c+r,n,e-r-w),0<p&&l>r&&this._DrawPatch(a,g.GetTexture(),k,r,p,l-r,b+d-p,c+r,p,e-r-w),0<r&&k>n&&this._DrawPatch(a,g.GetTexture(),n,0,k-n,r,b+n,c,d-n-p,r),0<w&&k>n&&this._DrawPatch(a, g.GetTexture(),n,l,k-n,w,b+n,c+e-w,d-n-p,w));l>r&&k>n&&(0===C?this._TilePatch(a,g.GetFillTexture(),b+n,c+r,d-n-p,e-r-w,0,0):1===C&&this._DrawPatch(a,g.GetTexture(),n,r,k-n,l-r,b+n,c+r,d-n-p,e-r-w))}_DrawPatch(a,b,c,d,e,g,k,l,n,p){const r=b.GetWidth(),w=b.GetHeight();a.SetTexture(b);tempRect1.set(k,l,k+n,l+p);tempRect2$jscomp$2.set(c/r,d/w,(c+e)/r,(d+g)/w);null===this._callback3d?(b=this.GetWorldInfo(),d=b.GetBoundingQuad(),c=d.getTlx(),d=d.getTly(),tempRect1.offset(-c,-d),tempQuad$jscomp$8.setFromRotatedRect(tempRect1, b.GetAngle()),tempQuad$jscomp$8.offset(c,d),a.Quad3(tempQuad$jscomp$8,tempRect2$jscomp$2)):this._callback3d(tempRect1,tempRect2$jscomp$2)}_TilePatch(a,b,c,d,e,g,k,l){const n=b.GetWidth(),p=b.GetHeight();a.SetTexture(b);tempRect1.set(c,d,c+e,d+g);tempRect2$jscomp$2.set(-k/n,-l/p,(e-k)/n,(g-l)/p);null===this._callback3d?(b=this.GetWorldInfo(),d=b.GetBoundingQuad(),c=d.getTlx(),d=d.getTly(),tempRect1.offset(-c,-d),tempQuad$jscomp$8.setFromRotatedRect(tempRect1,b.GetAngle()),tempQuad$jscomp$8.offset(c, d),a.Quad3(tempQuad$jscomp$8,tempRect2$jscomp$2)):this._callback3d(tempRect1,tempRect2$jscomp$2)}GetCurrentImageInfo(){this._objectClass.GetImageInfo()}GetPropertyValueByIndex(a){}SetPropertyValueByIndex(a,b){}};self.C3.Plugins.NinePatch.Cnds={};self.C3.Plugins.NinePatch.Acts={SetEffect(a){this.GetWorldInfo().SetBlendMode(a);this._runtime.UpdateRender()}};self.C3.Plugins.NinePatch.Exps={};"use strict";const C3$jscomp$212=self.C3; function CloneDrawable(a){const b=C3$jscomp$212.CreateCanvas(a.width,a.height);b.getContext("2d").drawImage(a,0,0);return b} self.NinePatchTextureSet=class{constructor(a){this._sdkType=a;this._runtime=this._sdkType.GetRuntime();this._bottomTexture=this._topTexture=this._rightTexture=this._leftTexture=this._fillTexture=this._texture=null;this._imageHeight=this._imageWidth=0;this._renderer=this._runtime.GetRenderer();this._wasReleased=this._isLoading=!1}Release(){this._renderer.IsContextLost()||(this._renderer.DeleteTexture(this._texture),this._renderer.DeleteTexture(this._fillTexture),this._renderer.DeleteTexture(this._leftTexture), this._renderer.DeleteTexture(this._rightTexture),this._renderer.DeleteTexture(this._topTexture),this._renderer.DeleteTexture(this._bottomTexture));this._renderer=this._sdkType=this._bottomTexture=this._topTexture=this._rightTexture=this._leftTexture=this._fillTexture=this._texture=null;this._wasReleased=!0}WasReleased(){return this._wasReleased}CreateTextures(a,b,c,d,e){this._SliceImage(a,b,c,d,e)}HasCreatedTextures(){return!!this._texture}_SliceImage(a,b,c,d,e){if(!this._wasReleased){var g=a.width, k=a.height;this._imageWidth=g;this._imageHeight=k;b=Math.min(Math.floor(b),g);c=Math.min(Math.floor(c),g);d=Math.min(Math.floor(d),k);e=Math.min(Math.floor(e),k);var l=g-c,n=k-e,p=this._runtime.GetSampling(),r=this._runtime.GetCanvasManager().GetTextureAnisotropy();this._texture=this._renderer.CreateStaticTexture(CloneDrawable(a),{sampling:p,anisotropy:r});l>b&&n>d&&(this._fillTexture=this._renderer.CreateStaticTexture(this._SliceSubImage(CloneDrawable(a),b,d,l,n),{wrapX:"repeat",wrapY:"repeat",sampling:p, anisotropy:r}));0<b&&n>d&&(this._leftTexture=this._renderer.CreateStaticTexture(this._SliceSubImage(CloneDrawable(a),0,d,b,n),{wrapY:"repeat",sampling:p,anisotropy:r}));0<c&&n>d&&(this._rightTexture=this._renderer.CreateStaticTexture(this._SliceSubImage(CloneDrawable(a),l,d,g,n),{wrapY:"repeat",sampling:p,anisotropy:r}));0<d&&l>b&&(this._topTexture=this._renderer.CreateStaticTexture(this._SliceSubImage(CloneDrawable(a),b,0,l,d),{wrapX:"repeat",sampling:p,anisotropy:r}));0<e&&l>b&&(this._bottomTexture= this._renderer.CreateStaticTexture(this._SliceSubImage(CloneDrawable(a),b,n,l,k),{wrapX:"repeat",sampling:p,anisotropy:r}))}}_SliceSubImage(a,b,c,d,e){d-=b;e-=c;const g=C3$jscomp$212.CreateCanvas(d,e);g.getContext("2d").drawImage(a,b,c,d,e,0,0,d,e);return g}GetImageWidth(){return this._imageWidth}GetImageHeight(){return this._imageHeight}GetTexture(){return this._texture}GetFillTexture(){return this._fillTexture}GetLeftTexture(){return this._leftTexture}GetRightTexture(){return this._rightTexture}GetTopTexture(){return this._topTexture}GetBottomTexture(){return this._bottomTexture}}; "use strict";const C3$jscomp$213=self.C3;C3$jscomp$213.Plugins.Spritefont2=class extends C3$jscomp$213.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$214=self.C3; C3$jscomp$214.Plugins.Spritefont2.Type=class extends C3$jscomp$214.SDKTypeBase{constructor(a){super(a);this._spriteFont=C3$jscomp$214.New(self.SpriteFont)}Release(){super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}LoadTextures(a){return this.GetImageInfo().LoadStaticTexture(a,{sampling:this._runtime.GetSampling()})}ReleaseTextures(){this.GetImageInfo().ReleaseTexture()}GetSpriteFont(){return this._spriteFont}UpdateSettings(a,b,c,d){const e=this.GetImageInfo(),g=this._spriteFont; g.SetWidth(e.GetWidth());g.SetHeight(e.GetHeight());g.SetCharacterWidth(a);g.SetCharacterHeight(b);g.SetCharacterSet(c);g.SetSpacingData(d);g.UpdateCharacterMap()}};const C3$jscomp$215=self.C3,C3X$jscomp$21=self.C3X,tempVec2$jscomp$2=C3$jscomp$215.New(C3$jscomp$215.Vector2),HORIZONTAL_ALIGNMENTS=["left","center","right"],VERTICAL_ALIGNMENTS=["top","center","bottom"]; C3$jscomp$215.Plugins.Spritefont2.Instance=class extends C3$jscomp$215.SDKWorldInstanceBase{constructor(a,b){super(a);this._text="";this._enableBBcode=!0;this._characterHeight=this._characterWidth=16;this._characterSet="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@\u00b0+=*$\u00a3\u20ac<>";a="";this._characterScale=1;this._verticalAlign=this._horizontalAlign=this._lineHeight=this._characterSpacing=0;this._wrapByWord=!0;this._readAloud=!1;this._spriteFontText= this._screenReaderText=null;this._typewriterEndTime=this._typewriterStartTime=-1;this._typewriterLength=0;b&&(this._text=b[0],this._enableBBcode=b[1],this._characterWidth=b[2],this._characterHeight=b[3],this._characterSet=b[4],a=b[5],this._characterScale=b[6],this._characterSpacing=b[7],this._lineHeight=b[8],this._horizontalAlign=b[9],this._verticalAlign=b[10],this._wrapByWord=0===b[11],this.GetWorldInfo().SetVisible(b[12]),this._readAloud=!!b[14]);this._sdkType.UpdateSettings(this._characterWidth, this._characterHeight,this._characterSet,a);this._spriteFontText=C3$jscomp$215.New(self.SpriteFontText,this._sdkType.GetSpriteFont());b=this.GetWorldInfo();this._spriteFontText.SetSize(b.GetWidth(),b.GetHeight());this._UpdateSettings();this._UpdateScreenReaderText();this._inst.SetMustMitigateZFighting()}Release(){this._CancelTypewriter();this._screenReaderText&&(this._screenReaderText.Release(),this._screenReaderText=null);this._spriteFontText.Release();this._spriteFontText=null;super.Release()}_UpdateSettings(){const a= this._spriteFontText;a&&(a.SetBBCodeEnabled(this._enableBBcode),a.SetText(this._text),a.SetWordWrapMode(this._wrapByWord?"word":"character"),a.SetHorizontalAlign(HORIZONTAL_ALIGNMENTS[this._horizontalAlign]),a.SetVerticalAlign(VERTICAL_ALIGNMENTS[this._verticalAlign]),a.SetSpacing(this._characterSpacing),a.SetLineHeight(this._lineHeight))}_UpdateTextSize(){const a=this.GetWorldInfo();this._spriteFontText.SetSize(a.GetWidth(),a.GetHeight());this._spriteFontText.SetScale(this._characterScale)}_UpdateScreenReaderText(){if(this._readAloud){let a= this._text;this._enableBBcode&&(a=C3$jscomp$215.BBString.StripAnyTags(a));this._screenReaderText?this._screenReaderText.SetText(a):this._screenReaderText=C3$jscomp$215.New(C3$jscomp$215.ScreenReaderText,this._runtime,a)}else this._screenReaderText&&(this._screenReaderText.Release(),this._screenReaderText=null)}Draw(a){const b=this._objectClass.GetImageInfo();var c=b.GetTexture();if(c){a.SetTexture(c);c=this.GetWorldInfo();var d=c.GetBoundingQuad(),e=this._spriteFontText;e.SetScale(this._characterScale); e.SetSceneGraphScale(c.GetSceneGraphScale());this._runtime.IsPixelRoundingEnabled()&&(d=c.PixelRoundQuad(d));e.SetSize(c.GetWidth(),c.GetHeight());e.GetSpriteFont().SetTexRect(b.GetTexRect());e.SetColor(c.GetUnpremultipliedColor());e.Draw(a,d.getTlx(),d.getTly(),c.GetAngle())}}SaveToJson(){const a={t:this._text,ebbc:this._enableBBcode,csc:this._characterScale,csp:this._characterSpacing,lh:this._lineHeight,ha:this._horizontalAlign,va:this._verticalAlign,w:this._wrapByWord,cw:this._sdkType.GetSpriteFont().GetCharacterWidth(), ch:this._sdkType.GetSpriteFont().GetCharacterHeight(),cs:this._sdkType.GetSpriteFont().GetCharacterSet(),sd:this._sdkType.GetSpriteFont().GetSpacingData()};-1!==this._typewriterEndTime&&(a.tw={st:this._typewriterStartTime,en:this._typewriterEndTime,l:this._typewriterLength});return a}LoadFromJson(a){this._CancelTypewriter();this._text=a.t;this._enableBBcode=a.ebbc;this._characterScale=a.csc;this._characterSpacing=a.csp;this._lineHeight=a.lh;this._horizontalAlign=a.ha;this._verticalAlign=a.va;this._wrapByWord= a.w;if(a.hasOwnProperty("tw")){var b=a.tw;this._typewriterStartTime=b.st;this._typewriterEndTime=b.en;this._typewriterLength=a.l}b=this._sdkType.GetSpriteFont();b.SetCharacterWidth(a.cw);b.SetCharacterHeight(a.ch);b.SetCharacterSet(a.cs);b.SetSpacingData(a.sd);this._UpdateSettings();this._UpdateScreenReaderText();-1!==this._typewriterEndTime&&this._StartTicking()}GetPropertyValueByIndex(a){switch(a){case 0:return this.GetText();case 1:return this._enableBBcode;case 2:return this._sdkType.GetSpriteFont().GetCharacterWidth(); case 3:return this._sdkType.GetSpriteFont().GetCharacterHeight();case 4:return this._sdkType.GetSpriteFont().GetCharacterSet();case 5:return this._sdkType.GetSpriteFont().GetSpacingData();case 6:return this._GetScale();case 7:return this._GetCharacterSpacing();case 8:return this._GetLineHeight();case 9:return this._GetHAlign();case 10:return this._GetVAlign();case 11:return this._IsWrapByWord()?1:0}}SetPropertyValueByIndex(a,b){switch(a){case 0:this._SetText(b);break;case 1:if(this._enableBBcode=== !!b)break;this._enableBBcode=!!b;this._UpdateSettings();break;case 2:this._sdkType.GetSpriteFont().SetCharacterWidth(b);break;case 3:this._sdkType.GetSpriteFont().SetCharacterHeight(b);break;case 4:this._sdkType.GetSpriteFont().SetCharacterSet(b);break;case 5:this._sdkType.GetSpriteFont().SetSpacingData(b);break;case 6:this._SetScale(b);break;case 7:this._SetCharacterSpacing(b);break;case 8:this._SetLineHeight(b);break;case 9:this._SetHAlign(b);break;case 10:this._SetVAlign(b);break;case 11:this._SetWrapByWord(0=== b)}}_SetText(a){this._text!==a&&(this._text=a,this._spriteFontText.SetText(a),this._UpdateScreenReaderText(),this._runtime.UpdateRender())}GetText(){return this._text}_StartTypewriter(a,b){this._SetText(a);this._typewriterStartTime=this._runtime.GetWallTime();this._typewriterEndTime=this._typewriterStartTime+b/this.GetInstance().GetActiveTimeScale();this._typewriterLength=C3$jscomp$215.CountGraphemes(C3$jscomp$215.BBString.StripAnyTags(a));this._spriteFontText.SetDrawMaxCharacterCount(0);this._StartTicking()}_CancelTypewriter(){this._typewriterEndTime= this._typewriterStartTime=-1;this._typewriterLength=0;this._spriteFontText.SetDrawMaxCharacterCount(-1);this._StopTicking()}_FinishTypewriter(){-1!==this._typewriterEndTime&&(this._CancelTypewriter(),this.Trigger(C3$jscomp$215.Plugins.Spritefont2.Cnds.OnTypewriterTextFinished),this._runtime.UpdateRender())}_SetScale(a){this._characterScale!==a&&(this._characterScale=a,this._spriteFontText.SetScale(this._characterScale),this._runtime.UpdateRender())}_GetScale(){return this._characterScale}_SetCharacterSpacing(a){this._characterSpacing!== a&&(this._characterSpacing=a,this._spriteFontText.SetSpacing(this._characterSpacing),this._runtime.UpdateRender())}_GetCharacterSpacing(){return this._characterSpacing}_SetLineHeight(a){this._lineHeight!==a&&(this._lineHeight=a,this._spriteFontText.SetLineHeight(this._lineHeight),this._runtime.UpdateRender())}_GetLineHeight(){return this._lineHeight}_SetHAlign(a){this._horizontalAlign!==a&&(this._horizontalAlign=a,this._UpdateSettings(),this._runtime.UpdateRender())}_GetHAlign(){return this._horizontalAlign}_SetVAlign(a){this._verticalAlign!== a&&(this._verticalAlign=a,this._UpdateSettings(),this._runtime.UpdateRender())}_GetVAlign(){return this._verticalAlign}_SetWrapByWord(a){a=!!a;this._wrapByWord!==a&&(this._wrapByWord=a,this._UpdateSettings(),this._runtime.UpdateRender())}_IsWrapByWord(){return this._wrapByWord}_SetReadAloud(a){this._readAloud=!!a;this._UpdateScreenReaderText()}_IsReadAloud(){return this._readAloud}_GetTextWidth(){this._UpdateTextSize();return this._spriteFontText.GetTextWidth()}_GetTextHeight(){this._UpdateTextSize(); return this._spriteFontText.GetTextHeight()}_GetTagAtPosition(a,b){this._UpdateTextSize();const c=this.GetWorldInfo();tempVec2$jscomp$2.set(a-c.GetX(),b-c.GetY());tempVec2$jscomp$2.rotate(-c.GetAngle());tempVec2$jscomp$2.offset(c.GetWidth()*c.GetOriginX(),c.GetHeight()*c.GetOriginY());if(a=this._spriteFontText.HitTestFragment(tempVec2$jscomp$2.getX(),tempVec2$jscomp$2.getY()))if(a=a.GetStyleTag("tag"))return a.param;return""}_HasTagAtPosition(a,b,c){return(b=this._GetTagAtPosition(b,c))&&C3$jscomp$215.equalsNoCase(a, b)}_GetTagPosition(a,b){this._UpdateTextSize();b=Math.floor(b);a=this._spriteFontText.FindFragmentWithTag(a,b);if(!a)return null;b=this.GetWorldInfo();tempVec2$jscomp$2.set(a.GetPosX(),a.GetPosY());tempVec2$jscomp$2.offset(-b.GetWidth()*b.GetOriginX(),-b.GetHeight()*b.GetOriginY());tempVec2$jscomp$2.rotate(b.GetAngle());tempVec2$jscomp$2.offset(b.GetX(),b.GetY());return{x:tempVec2$jscomp$2.getX(),y:tempVec2$jscomp$2.getY(),width:a.GetWidth(),height:a.GetHeight()}}_GetTagCount(a){this._UpdateTextSize(); return this._spriteFontText.CountFragmentsWithTag(a)}Tick(){var a=this._runtime.GetWallTime();a>=this._typewriterEndTime?(this._CancelTypewriter(),this.Trigger(C3$jscomp$215.Plugins.Spritefont2.Cnds.OnTypewriterTextFinished),this._runtime.UpdateRender()):(a=C3$jscomp$215.relerp(this._typewriterStartTime,this._typewriterEndTime,a,0,this._typewriterLength),a=Math.floor(a),a!==this._spriteFontText.GetDrawMaxCharacterCount()&&(this._spriteFontText.SetDrawMaxCharacterCount(a),this._runtime.UpdateRender()))}GetDebuggerProperties(){return[{title:"plugins.spritefont2.name", properties:[{name:"plugins.spritefont2.properties.text.name",value:this.GetText(),onedit:a=>this._SetText(a)},{name:"plugins.spritefont2.properties.scale.name",value:this._GetScale(),onedit:a=>this._SetScale(a)},{name:"plugins.spritefont2.properties.character-spacing.name",value:this._GetCharacterSpacing(),onedit:a=>this._SetCharacterSpacing(a)},{name:"plugins.spritefont2.properties.line-height.name",value:this._GetLineHeight(),onedit:a=>this._SetLineHeight(a)}]}]}GetScriptInterfaceClass(){return self.ISpriteFontInstance}}; const map$jscomp$22=new WeakMap,SCRIPT_HORIZONTAL_ALIGNMENTS=new Map([["left",0],["center",1],["right",2]]),SCRIPT_VERTICAL_ALIGNMENTS=new Map([["top",0],["center",1],["bottom",2]]),SCRIPT_WRAP_MODES=new Map([["word",!0],["character",!1]]); self.ISpriteFontInstance=class extends self.IWorldInstance{constructor(){super();map$jscomp$22.set(this,self.IInstance._GetInitInst().GetSdkInstance())}get text(){return map$jscomp$22.get(this).GetText()}set text(a){C3X$jscomp$21.RequireString(a);const b=map$jscomp$22.get(this);b._CancelTypewriter();b._SetText(a)}typewriterText(a,b){C3X$jscomp$21.RequireString(a);C3X$jscomp$21.RequireFiniteNumber(b);const c=map$jscomp$22.get(this);c._CancelTypewriter();c._StartTypewriter(a,b)}typewriterFinish(){map$jscomp$22.get(this)._FinishTypewriter()}set characterScale(a){C3X$jscomp$21.RequireFiniteNumber(a); map$jscomp$22.get(this)._SetScale(a)}get characterScale(){return map$jscomp$22.get(this)._GetScale()}set characterSpacing(a){C3X$jscomp$21.RequireFiniteNumber(a);map$jscomp$22.get(this)._SetCharacterSpacing(a)}get characterSpacing(){return map$jscomp$22.get(this)._GetCharacterSpacing()}set lineHeight(a){C3X$jscomp$21.RequireFiniteNumber(a);map$jscomp$22.get(this)._SetLineHeight(a)}get lineHeight(){return map$jscomp$22.get(this)._GetLineHeight()}set horizontalAlign(a){C3X$jscomp$21.RequireString(a); a=SCRIPT_HORIZONTAL_ALIGNMENTS.get(a);if("undefined"===typeof a)throw Error("invalid mode");map$jscomp$22.get(this)._SetHAlign(a)}get horizontalAlign(){return HORIZONTAL_ALIGNMENTS[map$jscomp$22.get(this)._GetHAlign()]}set verticalAlign(a){C3X$jscomp$21.RequireString(a);a=SCRIPT_VERTICAL_ALIGNMENTS.get(a);if("undefined"===typeof a)throw Error("invalid mode");map$jscomp$22.get(this)._SetVAlign(a)}get verticalAlign(){return VERTICAL_ALIGNMENTS[map$jscomp$22.get(this)._GetVAlign()]}set wordWrapMode(a){C3X$jscomp$21.RequireString(a); a=SCRIPT_WRAP_MODES.get(a);if("undefined"===typeof a)throw Error("invalid mode");map$jscomp$22.get(this)._SetWrapByWord(a)}get wordWrapMode(){return map$jscomp$22.get(this)._IsWrapByWord()?"word":"character"}set readAloud(a){map$jscomp$22.get(this)._SetReadAloud(!!a)}get readAloud(){return map$jscomp$22.get(this)._IsReadAloud()}get textWidth(){return map$jscomp$22.get(this)._GetTextWidth()}get textHeight(){return map$jscomp$22.get(this)._GetTextHeight()}getTextSize(){const a=map$jscomp$22.get(this); return[a._GetTextWidth(),a._GetTextHeight()]}hasTagAtPosition(a,b,c){C3X$jscomp$21.RequireString(a);C3X$jscomp$21.RequireFiniteNumber(b);C3X$jscomp$21.RequireFiniteNumber(c);return map$jscomp$22.get(this)._HasTagAtPosition(a,b,c)}getTagAtPosition(a,b){C3X$jscomp$21.RequireFiniteNumber(a);C3X$jscomp$21.RequireFiniteNumber(b);return map$jscomp$22.get(this)._GetTagAtPosition(a,b)}getTagPositionAndSize(a,b=0){C3X$jscomp$21.RequireString(a);C3X$jscomp$21.RequireFiniteNumber(b);return map$jscomp$22.get(this)._GetTagPosition(a, b)}getTagCount(a){C3X$jscomp$21.RequireString(a);return map$jscomp$22.get(this)._GetTagCount(a)}};const C3$jscomp$216=self.C3;C3$jscomp$216.Plugins.Spritefont2.Cnds={CompareText(a,b){return b?this._text===a:C3$jscomp$216.equalsNoCase(this._text,a)},IsRunningTypewriterText(){return-1!==this._typewriterEndTime},OnTypewriterTextFinished(){return!0},HasTagAtPosition(a,b,c){return this._HasTagAtPosition(a,b,c)}}; self.C3.Plugins.Spritefont2.Acts={SetText(a){this._CancelTypewriter();"number"===typeof a&&1E9>a&&(a=Math.round(1E10*a)/1E10);this._SetText(a.toString())},AppendText(a){this._CancelTypewriter();"number"===typeof a&&1E9>a&&(a=Math.round(1E10*a)/1E10);(a=a.toString())&&this._SetText(this._text+a)},TypewriterText(a,b){this._CancelTypewriter();"number"===typeof a&&1E9>a&&(a=Math.round(1E10*a)/1E10);this._StartTypewriter(a.toString(),b)},TypewriterFinish(){this._FinishTypewriter()},SetScale(a){this._SetScale(a)}, SetCharacterSpacing(a){this._SetCharacterSpacing(a)},SetLineHeight(a){this._SetLineHeight(a)},SetCharacterWidth(a,b){let c=!1;const d=this._sdkType.GetSpriteFont();for(const e of a)if(" "===e)d.SetSpaceWidth(b),c=!0;else if(a=d.GetCharacter(e))a.SetDisplayWidth(b),c=!0;c&&d.SetCharacterWidthsChanged();this._runtime.UpdateRender()},SetEffect(a){this.GetWorldInfo().SetBlendMode(a);this._runtime.UpdateRender()},SetHAlign(a){this._SetHAlign(a)},SetVAlign(a){this._SetVAlign(a)},SetWrapping(a){this._SetWrapByWord(0=== a)},SetReadAloud(a){this._SetReadAloud(a)}};const C3$jscomp$218=self.C3; C3$jscomp$218.Plugins.Spritefont2.Exps={CharacterWidth(a){return(a=this._sdkType.GetSpriteFont().GetCharacter(a))?a.GetDisplayWidth():this._sdkType.GetSpriteFont().GetCharacterWidth()},CharacterHeight(){return this._characterHeight},CharacterScale(){return this._characterScale},CharacterSpacing(){return this._characterSpacing},LineHeight(){return this._lineHeight},Text(){return this._text},PlainText(){return this._enableBBcode?C3$jscomp$218.BBString.StripAnyTags(this._text):this._text},TextWidth(){return this._GetTextWidth()}, TextHeight(){return this._GetTextHeight()},TagAtPosition(a,b){return this._GetTagAtPosition(a,b)},TagCount(a){return this._GetTagCount(a)},TagX(a,b){return(a=this._GetTagPosition(a,b))?a.x:0},TagY(a,b){return(a=this._GetTagPosition(a,b))?a.y:0},TagWidth(a,b){return(a=this._GetTagPosition(a,b))?a.width:0},TagHeight(a,b){return(a=this._GetTagPosition(a,b))?a.height:0}};"use strict";const C3$jscomp$219=self.C3; self.SpriteFontCharacter=class{constructor(a,b,c,d){let e=a.GetCharacterWidth(),g=a.GetCharacterHeight();this._spriteFont=a;this._char=b;this._pxRect=new C3$jscomp$219.Rect(c,d,c+e,d+g);this._texRect=new C3$jscomp$219.Rect;this._displayWidth=-1;this._UpdateTexRect()}Release(){this._texRect=this._pxRect=this._spriteFont=null}_UpdateTexRect(){let a=this._spriteFont.GetWidth(),b=this._spriteFont.GetHeight();this._texRect.copy(this._pxRect);this._texRect.divide(a,b);this._texRect.lerpInto(this._spriteFont.GetTexRect())}GetSpriteFont(){return this._spriteFont}GetChar(){return this._char}GetTexRect(){return this._texRect}SetDisplayWidth(a){this._displayWidth= a}GetDisplayWidth(){return 0>this._displayWidth?this._spriteFont.GetCharacterWidth():this._displayWidth}};"use strict";const C3$jscomp$220=self.C3,tmpRect$jscomp$3=new C3$jscomp$220.Rect,tmpQuad$jscomp$4=new C3$jscomp$220.Quad,tmpColor$jscomp$1=new C3$jscomp$220.Color,VALID_HORIZ_ALIGNMENTS$jscomp$1=new Set(["left","center","right"]),VALID_VERT_ALIGNMENTS$jscomp$1=new Set(["top","center","bottom"]),VALID_WORD_WRAP_MODES$jscomp$1=new Set(["word","character"]); function getOffsetParam$jscomp$1(a,b){a=a.trim();const c=parseFloat(a);return isFinite(c)?a.endsWith("%")?b*c/100:c:0} self.SpriteFontText=class{constructor(a){this._spriteFont=a;this._cssHeight=this._cssWidth=0;this._text="";this._isBBcodeEnabled=!1;this._bbString=null;this._wrappedText=C3$jscomp$220.New(C3$jscomp$220.WordWrap);this._wrapMode="word";this._wrapChanged=!1;this._horizontalAlign="left";this._verticalAlign="top";this._sceneGraphScale=this._scale=1;this._lineHeight=this._spacing=0;this._color=C3$jscomp$220.New(C3$jscomp$220.Color);this._drawMaxCharCount=-1;this._drawCharCount=0;this._measureTextCallback= b=>this._MeasureText(b);this._spriteFont._AddSpriteFontText(this)}Release(){this._spriteFont._RemoveSpriteFontText(this);this._measureTextCallback=this._color=null;this._wrappedText.Clear();this._bbString=this._spriteFont=this._wrappedText=null}_MeasureText(a){if(a.IsIcon())return{width:0,height:0};var b=a.GetCharacterArray(),c=a.GetStyleTag("scale"),d=(c?parseFloat(c.param):this._scale)*this._sceneGraphScale;c=a.GetStyleTag("scalex");c=(c?parseFloat(c.param):1)*d;a=a.GetStyleTag("scaley");a=(a?parseFloat(a.param): 1)*d;a=this._spriteFont.GetCharacterHeight()*a+this._lineHeight;const e=this.GetSpriteFont();d=e.GetCharacterWidth()*c;const g=this.GetSpacing();if(e.HasAnyCustomWidths()){let l=0,n=0;for(var k of b){b=d;const p=e.GetCharacter(k);p?b=p.GetDisplayWidth()*c:" "===k&&(b=e.GetSpaceWidth()*c);n+=b;++l}return{width:n+l*g,height:a}}k=b.length;return{width:d*k+Math.max(k,0)*g,height:a}}_SetWrapChanged(){this._wrapChanged=!0;this._wrappedText.Clear()}SetSize(a,b){0>=a||0>=b||this._cssWidth===a&&this._cssHeight=== b||(this._cssWidth!==a&&this._SetWrapChanged(),this._cssWidth=a,this._cssHeight=b)}SetDrawMaxCharacterCount(a){this._drawMaxCharCount=Math.floor(a)}GetDrawMaxCharacterCount(){return this._drawMaxCharCount}HitTestFragment(a,b){const c=this._wrappedText.GetLines();for(const d of c)if(b>d.GetPosY()&&b<d.GetPosY()+d.GetHeight())for(const e of d.fragments())if(a>=e.GetPosX()&&a<e.GetPosX()+e.GetWidth())return e;return null}*fragmentsWithTag(a){var b=this._wrappedText.GetLines();for(const c of b)for(const d of c.fragments())(b= d.GetStyleTag("tag"))&&C3$jscomp$220.equalsNoCase(b.param,a)&&(yield d)}FindFragmentWithTag(a,b){for(const c of this.fragmentsWithTag(a)){if(0===b)return c;--b}return null}CountFragmentsWithTag(a){let b=0;for(const c of this.fragmentsWithTag(a))++b;return b}_MaybeWrapText(){if(this._wrapChanged){!this._isBBcodeEnabled||this._bbString&&this._bbString.toString()===this._text||(this._bbString=new C3$jscomp$220.BBString(this._text,{noEscape:!0}));var a=-this.GetSpacing();this._wrappedText.WordWrap(this._isBBcodeEnabled? this._bbString.toFragmentList():this._text,this._measureTextCallback,this._cssWidth,this._wrapMode,a);this._wrapChanged=!1}}Draw(a,b,c,d){this._MaybeWrapText();let e=this._drawCharCount=0;const g=this._lineHeight,k=C3$jscomp$220.cloneArray(this._wrappedText.GetLines()),l=Math.sin(d);d=Math.cos(d);var n=k.reduce((p,r)=>p+r.GetHeight(),0)-g;"center"===this._verticalAlign?e=Math.max(Math.floor(this._cssHeight/2-n/2),0):"bottom"===this._verticalAlign&&(e=Math.floor(this._cssHeight-n));for(let p=0,r=k.length;p< r;++p){n=k[p];const w=n.GetHeight();if(0<p&&e>this._cssHeight-(w-g))break;0<=e&&this._DrawLine(a,n,b,c,e,l,d);e+=w}}_DrawLine(a,b,c,d,e,g,k){const l=b.GetHeight();let n=0;"center"===this._horizontalAlign?n=Math.max(Math.floor((this._cssWidth-b.GetWidth())/2),0):"right"===this._horizontalAlign&&(n=Math.max(Math.floor(this._cssWidth-b.GetWidth()),0));b.SetPosX(n);b.SetPosY(e);for(const p of b.fragments())p.IsIcon()||(this._DrawFragment(a,p,c,d,n,e,g,k,l),n+=p.GetWidth())}_DrawFragment(a,b,c,d,e,g,k, l,n){if(!b.IsIcon()){var p=b.GetStyleTag("offsetx");e+=p?getOffsetParam$jscomp$1(p.param,b.GetHeight()):0;p=b.GetStyleTag("offsety");g+=p?getOffsetParam$jscomp$1(p.param,b.GetHeight()):0;b.SetPosX(e);b.SetPosY(g);p=b.GetCharacterArray();var r=b.GetWidth();if(-1!==this._drawMaxCharCount){if(this._drawCharCount>=this._drawMaxCharCount)return;this._drawCharCount+p.length>this._drawMaxCharCount&&(p=p.slice(0,this._drawMaxCharCount-this._drawCharCount),r=this._MeasureText(b).width);this._drawCharCount+= p.length}var w=b.GetStyleTag("background");if(!(C3$jscomp$220.IsCharArrayAllWhitespace(p)&&!w||b.HasStyleTag("hide"))){var y=b.GetStyleTag("scale"),B=(y?parseFloat(y.param):this._scale)*this._sceneGraphScale;y=b.GetStyleTag("scalex");y=(y?parseFloat(y.param):1)*B;var C=b.GetStyleTag("scaley");B*=C?parseFloat(C.param):1;B*=this._spriteFont.GetCharacterHeight();g+=n-this._lineHeight-B;w&&(a.SetColorFillMode(),tmpColor$jscomp$1.parseString(w.param),tmpColor$jscomp$1.setA(1),a.SetColor(tmpColor$jscomp$1), tmpRect$jscomp$3.set(e,g,e+r,g+B),tmpRect$jscomp$3.getRight()>this._cssWidth&&tmpRect$jscomp$3.setRight(this._cssWidth),tmpQuad$jscomp$4.setFromRotatedRectPrecalc(tmpRect$jscomp$3,k,l),tmpQuad$jscomp$4.offset(c,d),a.Quad(tmpQuad$jscomp$4),a.SetTextureFillMode());(n=b.GetStyleTag("color"))?(tmpColor$jscomp$1.parseString(n.param),tmpColor$jscomp$1.setA(this._color.getA())):tmpColor$jscomp$1.copy(this._color);(b=b.GetStyleTag("opacity"))&&tmpColor$jscomp$1.setA(tmpColor$jscomp$1.getA()*parseFloat(b.param)/ 100);tmpColor$jscomp$1.premultiply();a.SetColor(tmpColor$jscomp$1);b=this._spriteFont.GetCharacterWidth()*y;n=Math.abs(this.GetSpacing());for(const E of p)if(p=this._spriteFont.GetCharacter(E)){r=p.GetDisplayWidth()*y;if(e+r>this._cssWidth+n+1E-5)break;tmpRect$jscomp$3.set(e,g,e+b,g+B);tmpQuad$jscomp$4.setFromRotatedRectPrecalc(tmpRect$jscomp$3,k,l);tmpQuad$jscomp$4.offset(c,d);a.Quad3(tmpQuad$jscomp$4,p.GetTexRect());e+=r+this._spacing}else e+=this._spriteFont.GetSpaceWidth()*y+this._spacing}}}GetSpriteFont(){return this._spriteFont}SetBBCodeEnabled(a){a= !!a;this._isBBcodeEnabled!==a&&(this._isBBcodeEnabled=a,this._SetWrapChanged())}IsBBCodeEnabled(){return this._isBBcodeEnabled}SetText(a){this._text!==a&&(this._text=a,this._SetWrapChanged())}SetWordWrapMode(a){if(!VALID_WORD_WRAP_MODES$jscomp$1.has(a))throw Error("invalid word wrap mode");this._wrapMode!==a&&(this._wrapMode=a,this._SetWrapChanged())}SetHorizontalAlign(a){if(!VALID_HORIZ_ALIGNMENTS$jscomp$1.has(a))throw Error("invalid alignment");this._horizontalAlign=a}SetVerticalAlign(a){if(!VALID_VERT_ALIGNMENTS$jscomp$1.has(a))throw Error("invalid alignment"); this._verticalAlign=a}SetScale(a){this._scale!==a&&(this._scale=a,this._SetWrapChanged())}GetScale(){return this._scale}SetSceneGraphScale(a){this._sceneGraphScale!==a&&(this._sceneGraphScale=a,this._SetWrapChanged())}GetSceneGraphScale(){return this._sceneGraphScale}SetSpacing(a){this._spacing!==a&&(this._spacing=a,this._SetWrapChanged())}GetSpacing(){return this._spacing}SetLineHeight(a){this._lineHeight=a;this._SetWrapChanged()}GetLineHeight(){return this._lineHeight}SetOpacity(a){a=C3$jscomp$220.clamp(a, 0,1);this._color.a=a}SetColor(a){this._color.equals(a)||this._color.copy(a)}GetColor(){return this._color}GetTextWidth(){this._MaybeWrapText();return this._wrappedText.GetMaxLineWidth()}GetTextHeight(){this._MaybeWrapText();var a=this._spriteFont.GetCharacterHeight()*this._scale;const b=this._lineHeight;a+=b;return this._wrappedText.GetLineCount()*a-b}};"use strict";const C3$jscomp$221=self.C3,DEFAULT_SPRITEFONT_OPTS={width:256,height:256,characterWidth:16,characterHeight:16,characterSet:""}; self.SpriteFont=class{constructor(a){a=Object.assign({},DEFAULT_SPRITEFONT_OPTS,a);if(0>=a.width||0>=a.height||0>=a.characterWidth||0>=a.characterHeight)throw Error("invalid size");this._width=a.width;this._height=a.height;this._characterWidth=a.characterWidth;this._characterHeight=a.characterHeight;this._characterSet=a.characterSet;this._spacingData="";this._spacingParsed=null;this._hasAnyCustomWidths=!1;this._spaceWidth=-1;this._texRect=new C3$jscomp$221.Rect(0,0,1,1);this._characterMap=new Map; this._mapChanged=!0;this._allTexts=new Set}Release(){this._texRect=null;this._ReleaseCharacters();this._characterMap=null;this._allTexts&&this._allTexts.clear();this._allTexts=null}_ReleaseCharacters(){for(let a of this._characterMap.values())a.Release();this._characterMap.clear()}_AddSpriteFontText(a){this._allTexts.add(a)}_RemoveSpriteFontText(a){this._allTexts.delete(a)}UpdateCharacterMap(){if(this._mapChanged){this._ReleaseCharacters();var a=C3$jscomp$221.SplitGraphemes(this._characterSet),b= Math.floor(this._width/this._characterWidth),c=b*Math.floor(this._height/this._characterHeight);for(let d=0,e=a.length;d<e&&!(d>=c);++d){let g=a[d];this._characterMap.has(g)||this._characterMap.set(g,C3$jscomp$221.New(self.SpriteFontCharacter,this,g,d%b*this._characterWidth,Math.floor(d/b)*this._characterHeight))}this._hasAnyCustomWidths=!1;this._spaceWidth=-1;if(Array.isArray(this._spacingParsed))for(let d of this._spacingParsed)if(Array.isArray(d)&&2===d.length&&(a=d[0],b=d[1],"number"===typeof a&& isFinite(a)&&"string"===typeof b&&a!==this._characterWidth))for(let e of b)(b=this._characterMap.get(e))?(b.SetDisplayWidth(a),this._hasAnyCustomWidths=!0):" "===e&&(this._spaceWidth=a,this._hasAnyCustomWidths=!0);this._mapChanged=!1;for(let d of this._allTexts)d._SetWrapChanged()}}SetCharacterWidthsChanged(){this._hasAnyCustomWidths=!0;for(const a of this._allTexts)a._SetWrapChanged()}GetCharacter(a){this.UpdateCharacterMap();return this._characterMap.get(a)||null}HasAnyCustomWidths(){return this._hasAnyCustomWidths}SetWidth(a){a= Math.floor(a);if(0>=a)throw Error("invalid size");this._width!==a&&(this._width=a,this._mapChanged=!0)}GetWidth(){return this._width}SetHeight(a){a=Math.floor(a);if(0>=a)throw Error("invalid size");this._height!==a&&(this._height=a,this._mapChanged=!0)}GetHeight(){return this._height}SetTexRect(a){if(!this._texRect.equals(a)){this._texRect.copy(a);for(const b of this._characterMap.values())b._UpdateTexRect()}}GetTexRect(){return this._texRect}SetCharacterWidth(a){a=Math.floor(a);if(0>=a)throw Error("invalid size"); this._characterWidth!==a&&(this._characterWidth=a,this._mapChanged=!0)}GetCharacterWidth(){return this._characterWidth}SetCharacterHeight(a){a=Math.floor(a);if(0>=a)throw Error("invalid size");this._characterHeight!==a&&(this._characterHeight=a,this._mapChanged=!0)}GetCharacterHeight(){return this._characterHeight}SetCharacterSet(a){this._characterSet!==a&&(this._characterSet=a,this._mapChanged=!0)}GetCharacterSet(){return this._characterSet}SetSpacingData(a){if(this._spacingData!==a&&(this._spacingData= a,this._mapChanged=!0,this._spacingParsed=null,this._spacingData.length))try{this._spacingParsed=JSON.parse(this._spacingData)}catch(b){this._spacingParsed=null}}GetSpacingData(){return this._spacingData}SetSpaceWidth(a){0>a&&(a=-1);this._spaceWidth!==a&&(this._spaceWidth=a,0<=this._spaceWidth&&(this._hasAnyCustomWidths=!0))}GetSpaceWidth(){return 0>this._spaceWidth?this._characterWidth:this._spaceWidth}};"use strict";const C3$jscomp$222=self.C3;C3$jscomp$222.Plugins.Tilemap=class extends C3$jscomp$222.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}}; C3$jscomp$222.Plugins.Tilemap.TILE_FLIPPED_HORIZONTAL=-2147483648;C3$jscomp$222.Plugins.Tilemap.TILE_FLIPPED_VERTICAL=1073741824;C3$jscomp$222.Plugins.Tilemap.TILE_FLIPPED_DIAGONAL=536870912;C3$jscomp$222.Plugins.Tilemap.TILE_FLAGS_MASK=3758096384;C3$jscomp$222.Plugins.Tilemap.TILE_ID_MASK=536870911; const C3$jscomp$223=self.C3,TILE_FLIPPED_HORIZONTAL=C3$jscomp$223.Plugins.Tilemap.TILE_FLIPPED_HORIZONTAL,TILE_FLIPPED_VERTICAL=C3$jscomp$223.Plugins.Tilemap.TILE_FLIPPED_VERTICAL,TILE_FLIPPED_DIAGONAL=C3$jscomp$223.Plugins.Tilemap.TILE_FLIPPED_DIAGONAL,TILE_ID_MASK=C3$jscomp$223.Plugins.Tilemap.TILE_ID_MASK; C3$jscomp$223.Plugins.Tilemap.Type=class extends C3$jscomp$223.SDKTypeBase{constructor(a){super(a);this._tilePolys=[];this._areTilePolysCached=!1;this._maxTileIndex=0;this._brushesData=[];this._nameToIndexMap=null}Release(){this._nameToIndexMap.clear();this._nameToIndexMap=null;super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}LoadTextures(a){return this.GetImageInfo().LoadStaticTexture(a,{sampling:this._runtime.GetSampling()})}ReleaseTextures(){this.GetImageInfo().ReleaseTexture()}OnDynamicTextureLoadComplete(){for(const a of this.GetObjectClass().instancesIncludingPendingCreate())a.GetSdkInstance()._OnDynamicTextureLoadComplete()}LoadTilemapData(a, b,c){this._maxTileIndex=b;for(const d of a)d?this._tilePolys.push({poly:d[0],use:!!d[1],flipmap:[[[null,null],[null,null]],[[null,null],[null,null]]]}):this._tilePolys.push(null);for(const d of c)this._brushesData.push({name:d[0],type:d[1],tileData:d[2]})}_ForceCacheOfTileCollisionPolys(a,b){this._areTilePolysCached=!1;this._MaybeCacheTileCollisionPolys(a,b)}_MaybeCacheTileCollisionPolys(a,b){if(!this._areTilePolysCached){this._areTilePolysCached=!0;for(let c=0,d=this._tilePolys.length;c<d;++c)this._tilePolys[c]&& (this._CacheTilePoly(c,a,b,!1,!1,!1),this._CacheTilePoly(c,a,b,!1,!1,!0),this._CacheTilePoly(c,a,b,!1,!0,!1),this._CacheTilePoly(c,a,b,!1,!0,!0),this._CacheTilePoly(c,a,b,!0,!1,!1),this._CacheTilePoly(c,a,b,!0,!1,!0),this._CacheTilePoly(c,a,b,!0,!0,!1),this._CacheTilePoly(c,a,b,!0,!0,!0))}}_CacheTilePoly(a,b,c,d,e,g){if(!(0>a||a>=this._tilePolys.length)&&(a=this._tilePolys[a])){var k=C3$jscomp$223.New(C3$jscomp$223.CollisionPoly,a.poly,a.use);k.transform(b,c,0);g&&k.diag();d&&k.mirror(b/2);e&&k.flip(c/ 2);a.flipmap[d?1:0][e?1:0][g?1:0]=null;a.flipmap[d?1:0][e?1:0][g?1:0]=k}}GetTilePoly(a){if(-1===a)return null;var b=a&TILE_ID_MASK;return 0>b||b>=this._tilePolys.length?null:(b=this._tilePolys[b])?b.flipmap[a&TILE_FLIPPED_HORIZONTAL?1:0][a&TILE_FLIPPED_VERTICAL?1:0][a&TILE_FLIPPED_DIAGONAL?1:0]:null}IsTilePolyEnabled(a){return a?a.IsEnabled():!0}GetMaxTileIndex(){return this._maxTileIndex}GetBrushData(a){this._nameToIndexMap||(this._nameToIndexMap=new Map);var b=this._nameToIndexMap.get(a);if("number"=== typeof b&&0<=b)return this._brushesData[b];for(b=0;b<this._brushesData.length;b++)if(this._brushesData[b].name===a)return this._nameToIndexMap.set(a,b),this._brushesData[b]}}; const C3$jscomp$224=self.C3,C3X$jscomp$22=self.C3X,TILE_FLIPPED_HORIZONTAL$jscomp$1=C3$jscomp$224.Plugins.Tilemap.TILE_FLIPPED_HORIZONTAL,TILE_FLIPPED_VERTICAL$jscomp$1=C3$jscomp$224.Plugins.Tilemap.TILE_FLIPPED_VERTICAL,TILE_FLIPPED_DIAGONAL$jscomp$1=C3$jscomp$224.Plugins.Tilemap.TILE_FLIPPED_DIAGONAL,TILE_FLAGS_MASK=C3$jscomp$224.Plugins.Tilemap.TILE_FLAGS_MASK,TILE_ID_MASK$jscomp$1=C3$jscomp$224.Plugins.Tilemap.TILE_ID_MASK,tempRect$jscomp$14=C3$jscomp$224.New(C3$jscomp$224.Rect),tempRect2$jscomp$3= C3$jscomp$224.New(C3$jscomp$224.Rect),tempRect3$jscomp$2=C3$jscomp$224.New(C3$jscomp$224.Rect); function RunLengthDecode(a){const b=[];a=a.split(",");for(let g=0,k=a.length;g<k;++g){var c=a[g],d=c.indexOf("x");if(-1<d){var e=parseInt(c.substring(0,d),10);c=c.substring(d+1);d=parseInt(c,10);c.includes("h")&&(d|=TILE_FLIPPED_HORIZONTAL$jscomp$1);c.includes("v")&&(d|=TILE_FLIPPED_VERTICAL$jscomp$1);for(c.includes("d")&&(d|=TILE_FLIPPED_DIAGONAL$jscomp$1);0<e;--e)b.push(d)}else e=parseInt(c,10),c.includes("h")&&(e|=TILE_FLIPPED_HORIZONTAL$jscomp$1),c.includes("v")&&(e|=TILE_FLIPPED_VERTICAL$jscomp$1), c.includes("d")&&(e|=TILE_FLIPPED_DIAGONAL$jscomp$1),b.push(e)}return b} C3$jscomp$224.Plugins.Tilemap.Instance=class extends C3$jscomp$224.SDKWorldInstanceBase{constructor(a,b){super(a);a=this.GetWorldInfo();this._tileHeight=this._tileWidth=32;this._mapHeight=this._mapWidth=this._tileYspacing=this._tileXspacing=this._tileYoffset=this._tileXoffset=0;this._lastWidth=a.GetWidth();this._lastHeight=a.GetHeight();this._cellHeight=this._cellWidth=0;this._tileCells=[];this._tileTexQuads=new Map;this._isAnyQuadMapChanged=!0;this._ownImageInfo=null;b&&(a.SetVisible(b[0]),this._tileWidth= Math.max(b[1],1),this._tileHeight=Math.max(b[2],1),this._tileXoffset=b[3],this._tileYoffset=b[4],this._tileXspacing=b[5],this._tileYspacing=b[6]);this._cellWidth=Math.ceil(this._runtime.GetOriginalViewportWidth()/this._tileWidth);this._cellHeight=Math.ceil(this._runtime.GetOriginalViewportHeight()/this._tileHeight);this._sdkType._MaybeCacheTileCollisionPolys(this._tileWidth,this._tileHeight);this._autoTiling=null}Release(){this._ReleaseOwnImage();C3$jscomp$224.clearArray(this._tileCells);this._tileCells= null;this._tileTexQuads.clear();this._tileTexQuads=null;super.Release()}_ReleaseOwnImage(){this._ownImageInfo&&(this._ownImageInfo.Release(),this._ownImageInfo=null)}LoadTilemapData(a,b,c){this._mapWidth=b;this._mapHeight=c;this._MaybeResizeTilemap(!0);this.SetTilesFromRLECSV(a);this._MaybeBuildAllQuadMap()}_MaybeResizeTilemap(a){const [b,c]=this.GetMapDisplaySize();if(!(b<=this._mapWidth&&c<=this._mapHeight)||a){if(a){a=Math.ceil(this._mapHeight/this._cellHeight);var d=Math.ceil(this._mapWidth/this._cellWidth)}else a= this._tileCells.length,d=Math.ceil(this._mapWidth/this._cellWidth),c>this._mapHeight&&(this._mapHeight=c,a=Math.ceil(this._mapHeight/this._cellHeight)),b>this._mapWidth&&(this._mapWidth=b,d=Math.ceil(this._mapWidth/this._cellWidth)),this._SetAllQuadMapChanged(),this._SetPhysicsChanged(),this._runtime.UpdateRender();var e=this._tileCells;if(e.length<a)for(var g=e.length;g<a;++g)e.push([]);for(g=0;g<a;++g){const k=e[g];for(let l=k.length;l<d;++l)k.push(C3$jscomp$224.New(C3$jscomp$224.Plugins.Tilemap.TileCell, this,l,g))}}}SetTilesFromRLECSV(a){a=RunLengthDecode(a);let b=0;const c=this._mapWidth,d=this._cellWidth,e=this._cellHeight;for(let g=0,k=this._mapHeight;g<k;++g)for(let l=0;l<c;++l){const n=a[b++],p=this.GetCellAt(l,g);p&&p.SetTileAt(l%d,g%e,n)}}GetTilesAsRLECSV(){let a="";if(0>=this._mapWidth||0>=this._mapHeight)return a;let b=1;var c=this.GetTileAt(0,0);const [d,e]=this.GetMapDisplaySize();let g,k,l;for(let n=0;n<e;++n)for(let p=0===n?1:0;p<d;++p){const r=this.GetTileAt(p,n);r===c?++b:(-1===c? (g=-1,c=l=k=!1):(g=c&TILE_ID_MASK$jscomp$1,k=0!==(c&TILE_FLIPPED_HORIZONTAL$jscomp$1),l=0!==(c&TILE_FLIPPED_VERTICAL$jscomp$1),c=0!==(c&TILE_FLIPPED_DIAGONAL$jscomp$1)),a=1===b?a+(""+g):a+(""+b+"x"+g),k&&(a+="h"),l&&(a+="v"),c&&(a+="d"),a+=",",b=1,c=r)}-1===c?(g=-1,c=l=k=!1):(g=c&TILE_ID_MASK$jscomp$1,k=0!==(c&TILE_FLIPPED_HORIZONTAL$jscomp$1),l=0!==(c&TILE_FLIPPED_VERTICAL$jscomp$1),c=0!==(c&TILE_FLIPPED_DIAGONAL$jscomp$1));a=1===b?a+(""+g):a+(""+b+"x"+g);k&&(a+="h");l&&(a+="v");c&&(a+="d");return a}_SetAllQuadMapChanged(){const a= this._tileCells;for(let b=0,c=a.length;b<c;++b){const d=a[b];for(let e=0,g=d.length;e<g;++e)d[e]._SetQuadMapChanged()}this._isAnyQuadMapChanged=!0}_MaybeBuildAllQuadMap(){if(this._isAnyQuadMapChanged){this._isAnyQuadMapChanged=!1;var a=this._tileCells;for(let b=0,c=a.length;b<c;++b){const d=a[b];for(let e=0,g=d.length;e<g;++e)d[e].MaybeBuildQuadMap()}}}SetTileChanged(){this._isAnyQuadMapChanged=!0;this._SetPhysicsChanged();this._runtime.UpdateRender()}_SetPhysicsChanged(){this.GetWorldInfo().SetPhysicsBodyChanged(!0)}GetCellAt(a, b){if(0>a||0>b)return null;b=Math.floor(b/this._cellHeight);if(b>=this._tileCells.length)return null;b=this._tileCells[b];a=Math.floor(a/this._cellWidth);return a>=b.length?null:b[a]}GetCellAtIndex(a,b){if(0>a||0>b||b>=this._tileCells.length)return null;b=this._tileCells[b];return a>=b.length?null:b[a]}GetTileAt(a,b){a=Math.floor(a);b=Math.floor(b);if(0>a||0>b||a>=this._mapWidth||b>=this._mapHeight)return-1;const c=this.GetCellAt(a,b);return c?c.GetTilesArr()[b%this._cellHeight][a%this._cellWidth]: -1}SetTileAt(a,b,c){a=Math.floor(a);b=Math.floor(b);if(!(0>a||0>b||a>=this._mapWidth||b>=this._mapHeight||-1!==c&&(c&TILE_ID_MASK$jscomp$1)>this.GetMaxTileIndex())){var d=this.GetCellAt(a,b);d&&d.SetTileAt(a%this._cellWidth,b%this._cellHeight,c)}}GetMaxTileIndex(){return this._sdkType.GetMaxTileIndex()}WorldToCellX(a){return Math.floor((a-this.GetWorldInfo().GetX())/(this._cellWidth*this._tileWidth))}WorldToCellY(a){return Math.floor((a-this.GetWorldInfo().GetY())/(this._cellHeight*this._tileHeight))}WorldToTileX(a){return Math.floor((a- this.GetWorldInfo().GetX())/this._tileWidth)}WorldToTileY(a){return Math.floor((a-this.GetWorldInfo().GetY())/this._tileHeight)}GetMapWidth(){return this._mapWidth}GetMapHeight(){return this._mapHeight}GetMapDisplayWidth(){return Math.floor(this.GetWorldInfo().GetWidth()/this.GetTileWidth())}GetMapDisplayHeight(){return Math.floor(this.GetWorldInfo().GetHeight()/this.GetTileHeight())}GetMapDisplaySize(){const a=this.GetWorldInfo();return[Math.floor(a.GetWidth()/this.GetTileWidth()),Math.floor(a.GetHeight()/ this.GetTileHeight())]}GetTileWidth(){return this._tileWidth}GetTileHeight(){return this._tileHeight}GetCellWidth(){return this._cellWidth}GetCellHeight(){return this._cellHeight}GetCollisionRectCandidates(a,b){var c=this.WorldToCellX(a.getLeft());const d=this.WorldToCellY(a.getTop()),e=this.WorldToCellX(a.getRight());for(a=this.WorldToCellY(a.getBottom());c<=e;++c)for(let g=d;g<=a;++g){const k=this.GetCellAtIndex(c,g);k&&(k.MaybeBuildQuadMap(),C3$jscomp$224.appendArray(b,k.GetCollisionRects()))}}TestPointOverlapTile(a, b){var c=this.WorldToTileX(a),d=this.WorldToTileY(b);c=this.GetTileAt(c,d);if(-1===c)return!1;c=this._sdkType.GetTilePoly(c);if(!c)return!0;if(!this._sdkType.IsTilePolyEnabled(c))return!1;var e=this.GetWorldInfo();d=Math.floor((a-e.GetX())/this._tileWidth)*this._tileWidth+e.GetX();e=Math.floor((b-e.GetY())/this._tileHeight)*this._tileHeight+e.GetY();a-=d;b-=e;return c.containsPoint(a,b)}GetAllCollisionRects(a){const b=this._tileCells;for(let c=0,d=b.length;c<d;++c){const e=b[c];for(let g=0,k=e.length;g< k;++g){const l=e[g];l.MaybeBuildQuadMap();C3$jscomp$224.appendArray(a,l.GetCollisionRects())}}}GetCurrentImageInfo(){return this._ownImageInfo||this._objectClass.GetImageInfo()}GetTileUvQuad(a){const b=this._tileTexQuads;var c=b.get(a);if(c)return c;var d=a&TILE_ID_MASK$jscomp$1;c=0!==(a&TILE_FLIPPED_HORIZONTAL$jscomp$1);const e=0!==(a&TILE_FLIPPED_VERTICAL$jscomp$1),g=0!==(a&TILE_FLIPPED_DIAGONAL$jscomp$1);var k=this.GetCurrentImageInfo(),l=k.GetWidth(),n=this._tileWidth,p=this._tileXspacing;n=Math.floor((Math.floor((l- this._tileXoffset)/(n+p)*n)+p)/n);l=d%n;d=Math.floor(d/n);n=k.GetOffsetX()+this._tileXoffset+(this._tileWidth+this._tileXspacing)*l;p=k.GetOffsetY()+this._tileYoffset+(this._tileHeight+this._tileYspacing)*d;tempRect$jscomp$14.setWH(n,p,this._tileWidth,this._tileHeight);tempRect$jscomp$14.divide(k.GetSheetWidth(),k.GetSheetHeight());k=C3$jscomp$224.New(C3$jscomp$224.Quad);k.setFromRect(tempRect$jscomp$14);g&&k.diag();c&&k.mirror();e&&k.flip();k.offset(l,d);b.set(a,k);return k}_OnDynamicTextureLoadComplete(){this._tileTexQuads.clear(); this._SetAllQuadMapChanged()}Draw(a){var b=this.GetCurrentImageInfo(),c=b.GetTexture();if(c){tempRect$jscomp$14.copy(b.GetTexRect());tempRect$jscomp$14.offsetLeft(this._tileXoffset/c.GetWidth());tempRect$jscomp$14.offsetTop(this._tileYoffset/c.GetHeight());a.SetTilemapFillMode();a.SetTilemapInfo(tempRect$jscomp$14,c.GetWidth(),c.GetHeight(),this._tileWidth,this._tileHeight,this._tileXspacing,this._tileYspacing);a.SetTexture(c);var d=this.GetWorldInfo(),e=d.GetLayer();if(d.GetWidth()!==this._lastWidth|| d.GetHeight()!==this._lastHeight)this._SetPhysicsChanged(),this._SetAllQuadMapChanged(),this._lastWidth=d.GetWidth(),this._lastHeight=d.GetHeight();b=d.GetX();c=d.GetY();this._runtime.IsPixelRoundingEnabled()&&(b=Math.round(b),c=Math.round(c));var g=this._cellWidth*this._tileWidth,k=this._cellHeight*this._tileHeight;d=d.GetTotalZElevation();if(e.Has3DCamera()){tempRect2$jscomp$3.set(-Infinity,-Infinity,Infinity,Infinity);k=e._GetViewFrustum();for(var l of this._tileCells)for(var n of l)n.GetLayoutRect(tempRect3$jscomp$2), k.ContainsAABB(tempRect3$jscomp$2.getLeft(),tempRect3$jscomp$2.getTop(),d,tempRect3$jscomp$2.getRight(),tempRect3$jscomp$2.getBottom(),d)&&(n.MaybeBuildQuadMap(),n.Draw(a,tempRect2$jscomp$3,b,c))}else for(e.GetViewportForZ(d,tempRect2$jscomp$3),e=Math.floor((tempRect2$jscomp$3.getLeft()-b)/g),l=Math.floor((tempRect2$jscomp$3.getRight()-b)/g),n=Math.floor((tempRect2$jscomp$3.getTop()-c)/k),k=Math.floor((tempRect2$jscomp$3.getBottom()-c)/k),g=e;g<=l;++g)for(e=n;e<=k;++e)if(d=this.GetCellAtIndex(g,e))d.MaybeBuildQuadMap(), d.Draw(a,tempRect2$jscomp$3,b,c)}}SaveToJson(){this._MaybeResizeTilemap();const [a,b]=this.GetMapDisplaySize();return{tw:this._tileWidth,th:this._tileHeight,tox:this._tileXoffset,toy:this._tileYoffset,tsx:this._tileXspacing,tsy:this._tileYspacing,w:a,h:b,d:this.GetTilesAsRLECSV()}}LoadFromJson(a){this._tileWidth=a.tw;this._tileHeight=a.th;this._tileXoffset=a.tox;this._tileYoffset=a.toy;this._tileXspacing=a.tsx;this._tileYspacing=a.tsy;this._mapWidth=a.w;this._mapHeight=a.h;this._MaybeResizeTilemap(!0); this.SetTilesFromRLECSV(a.d);this._SetPhysicsChanged();this._SetAllQuadMapChanged()}GetAsJsonString(){this._MaybeResizeTilemap();const [a,b]=this.GetMapDisplaySize();return JSON.stringify({c2tilemap:!0,width:a,height:b,data:this.GetTilesAsRLECSV()})}StateComboToFlags(a){switch(a){case 0:return 0;case 1:return TILE_FLIPPED_HORIZONTAL$jscomp$1;case 2:return TILE_FLIPPED_VERTICAL$jscomp$1;case 3:return TILE_FLIPPED_HORIZONTAL$jscomp$1|TILE_FLIPPED_DIAGONAL$jscomp$1;case 4:return TILE_FLIPPED_HORIZONTAL$jscomp$1| TILE_FLIPPED_VERTICAL$jscomp$1;case 5:return TILE_FLIPPED_VERTICAL$jscomp$1|TILE_FLIPPED_DIAGONAL$jscomp$1;case 6:return TILE_FLIPPED_HORIZONTAL$jscomp$1|TILE_FLIPPED_VERTICAL$jscomp$1|TILE_FLIPPED_DIAGONAL$jscomp$1;case 7:return TILE_FLIPPED_DIAGONAL$jscomp$1;default:return 0}}GetPropertyValueByIndex(a){switch(a){case 1:return this._tileWidth;case 2:return this._tileHeight;case 3:return this._tileXoffset;case 4:return this._tileYoffset;case 5:return this._tileXspacing;case 6:return this._tileYspacing}}SetPropertyValueByIndex(a, b){switch(a){case 1:if(this._tileWidth===b)break;this._tileWidth=Math.max(b,1);this._cellWidth=Math.ceil(this._runtime.GetOriginalViewportWidth()/this._tileWidth);this._sdkType._ForceCacheOfTileCollisionPolys();this._UpdateQuadMaps();break;case 2:if(this._tileHeight===b)break;this._tileHeight=Math.max(b,1);this._cellHeight=Math.ceil(this._runtime.GetOriginalViewportHeight()/this._tileHeight);this._sdkType._ForceCacheOfTileCollisionPolys();this._UpdateQuadMaps();break;case 3:if(this._tileXoffset=== b)break;this._tileXoffset=b;this._UpdateQuadMaps();break;case 4:if(this._tileYoffset===b)break;this._tileYoffset=b;this._UpdateQuadMaps();break;case 5:if(this._tileXspacing===b)break;this._tileXspacing=b;this._UpdateQuadMaps();break;case 6:this._tileYspacing!==b&&(this._tileYspacing=b,this._UpdateQuadMaps())}}_UpdateQuadMaps(){this._tileTexQuads.clear();this._SetAllQuadMapChanged();this._MaybeBuildAllQuadMap()}GetScriptInterfaceClass(){return ITilemapInstance}}; const map$jscomp$23=new WeakMap,ITilemapInstance=self.ITilemapInstance=class extends self.IWorldInstance{constructor(){super();map$jscomp$23.set(this,self.IInstance._GetInitInst().GetSdkInstance())}get mapWidth(){return map$jscomp$23.get(this).GetMapWidth()}get mapHeight(){return map$jscomp$23.get(this).GetMapHeight()}getMapSize(){const a=map$jscomp$23.get(this);return[a.GetMapWidth(),a.GetMapHeight()]}get mapDisplayWidth(){return map$jscomp$23.get(this).GetMapDisplayWidth()}get mapDisplayHeight(){return map$jscomp$23.get(this).GetMapDisplayHeight()}getMapDisplaySize(){const a= map$jscomp$23.get(this);return[a.GetMapDisplayWidth(),a.GetMapDisplayHeight()]}get tileWidth(){return map$jscomp$23.get(this).GetTileWidth()}get tileHeight(){return map$jscomp$23.get(this).GetTileHeight()}getTileSize(){const a=map$jscomp$23.get(this);return[a.GetTileWidth(),a.GetTileHeight()]}getTileAt(a,b){C3X$jscomp$22.RequireFiniteNumber(a);C3X$jscomp$22.RequireFiniteNumber(b);return map$jscomp$23.get(this).GetTileAt(a,b)}setTileAt(a,b,c){C3X$jscomp$22.RequireFiniteNumber(a);C3X$jscomp$22.RequireFiniteNumber(b); C3X$jscomp$22.RequireFiniteNumber(c);const d=map$jscomp$23.get(this);d._MaybeResizeTilemap();return d.SetTileAt(a,b,c)}async replaceImage(a){C3X$jscomp$22.RequireInstanceOf(a,Blob);const b=map$jscomp$23.get(this),c=b.GetRuntime(),d=C3$jscomp$224.New(C3$jscomp$224.ImageInfo);d.LoadDynamicBlobAsset(c,a);await d.LoadStaticTexture(c.GetRenderer(),{sampling:c.GetSampling()});b.WasReleased()?d.Release():(b._ReleaseOwnImage(),b._ownImageInfo=d,b._tileTexQuads.clear(),b._SetAllQuadMapChanged(),c.UpdateRender())}}; ITilemapInstance.TILE_FLIPPED_HORIZONTAL=TILE_FLIPPED_HORIZONTAL$jscomp$1;ITilemapInstance.TILE_FLIPPED_VERTICAL=TILE_FLIPPED_VERTICAL$jscomp$1;ITilemapInstance.TILE_FLIPPED_DIAGONAL=TILE_FLIPPED_DIAGONAL$jscomp$1;ITilemapInstance.TILE_FLAGS_MASK=TILE_FLAGS_MASK;ITilemapInstance.TILE_ID_MASK=TILE_ID_MASK$jscomp$1;const C3$jscomp$225=self.C3,TILE_FLAGS_MASK$jscomp$1=C3$jscomp$225.Plugins.Tilemap.TILE_FLAGS_MASK,TILE_ID_MASK$jscomp$2=C3$jscomp$225.Plugins.Tilemap.TILE_ID_MASK; C3$jscomp$225.Plugins.Tilemap.Cnds={CompareTileAt(a,b,c,d){a=this.GetTileAt(a,b);-1!==a&&(a&=TILE_ID_MASK$jscomp$2);return C3$jscomp$225.compare(a,c,d)},CompareTileStateAt(a,b,c){a=this.GetTileAt(a,b);b=0;-1!==a&&(b=a&TILE_FLAGS_MASK$jscomp$1);return b===this.StateComboToFlags(c)},OnURLLoaded(){return!0},OnURLFailed(){return!0},BrushExists(a){this._autoTiling||(this._autoTiling=new C3$jscomp$225.Plugins.Tilemap.AutoTiling(this,this._sdkType));return this._autoTiling.BrushExists(a)}}; const C3$jscomp$226=self.C3,TILE_ID_MASK$jscomp$3=C3$jscomp$226.Plugins.Tilemap.TILE_ID_MASK; C3$jscomp$226.Plugins.Tilemap.Acts={EraseTile(a,b){this._MaybeResizeTilemap();this.SetTileAt(a,b,-1)},SetTile(a,b,c,d){this._MaybeResizeTilemap();this.SetTileAt(a,b,c&TILE_ID_MASK$jscomp$3|this.StateComboToFlags(d))},SetTileState(a,b,c){const d=this.GetTileAt(a,b);-1!==d&&(this._MaybeResizeTilemap(),this.SetTileAt(a,b,d&TILE_ID_MASK$jscomp$3|this.StateComboToFlags(c)))},EraseTileRange(a,b,c,d){const e=Math.floor(Math.max(a,0));var g=Math.floor(Math.max(b,0));a=Math.floor(Math.min(a+c,this._mapWidth)); for(b=Math.floor(Math.min(b+d,this._mapHeight));g<b;++g)for(d=e;d<a;++d)this.SetTileAt(d,g,-1)},SetTileRange(a,b,c,d,e,g){this._MaybeResizeTilemap();const k=Math.floor(Math.max(a,0));var l=Math.floor(Math.max(b,0));a=Math.floor(Math.min(a+c,this._mapWidth));b=Math.floor(Math.min(b+d,this._mapHeight));for(e=e&TILE_ID_MASK$jscomp$3|this.StateComboToFlags(g);l<b;++l)for(g=k;g<a;++g)this.SetTileAt(g,l,e)},SetTileStateRange(a,b,c,d,e){this._MaybeResizeTilemap();const g=Math.floor(Math.max(a,0));var k= Math.floor(Math.max(b,0));a=Math.floor(Math.min(a+c,this._mapWidth));b=Math.floor(Math.min(b+d,this._mapHeight));for(e=this.StateComboToFlags(e);k<b;++k)for(d=g;d<a;++d)c=this.GetTileAt(d,k),-1!==c&&this.SetTileAt(d,k,c&TILE_ID_MASK$jscomp$3|e)},LoadFromJSON(a){let b=null;try{b=JSON.parse(a)}catch(c){console.error("[Construct] Failed to parse tilemap JSON: ",c);return}b.c2tilemap?(this._mapWidth=b.width,this._mapHeight=b.height,this._MaybeResizeTilemap(!0),this.SetTilesFromRLECSV(b.data),this._SetAllQuadMapChanged(), this._SetPhysicsChanged()):console.error("[Construct] Unrecognized JSON data format")},JSONDownload(a){const b=URL.createObjectURL(new Blob([this.GetAsJsonString()],{type:"application/json"}));this._runtime.InvokeDownload(b,a)},async LoadURL(a,b){if(!this._ownImageInfo||this._ownImageInfo.GetURL()!==a){b=this._runtime;var c=C3$jscomp$226.New(C3$jscomp$226.ImageInfo);try{await c.LoadDynamicAsset(b,a);if(!c.IsLoaded())throw Error("image failed to load");if(this.WasReleased())return c.Release(),null; if(!await c.LoadStaticTexture(b.GetRenderer(),{sampling:b.GetSampling()}))return}catch(d){console.error("Load image from URL failed: ",d);this.WasReleased()||this.Trigger(C3$jscomp$226.Plugins.Tilemap.Cnds.OnURLFailed);return}this.WasReleased()?c.Release():(this._ReleaseOwnImage(),this._ownImageInfo=c,b.UpdateRender(),this._tileTexQuads.clear(),this._SetAllQuadMapChanged(),await this.TriggerAsync(C3$jscomp$226.Plugins.Tilemap.Cnds.OnURLLoaded))}},SetEffect(a){2<=a&&a++;this.GetWorldInfo().SetBlendMode(a); this._runtime.UpdateRender()},SetTileWithBrush(a,b,c){this._MaybeResizeTilemap();this._autoTiling||(this._autoTiling=new C3$jscomp$226.Plugins.Tilemap.AutoTiling(this,this._sdkType));this._autoTiling.SetAutoTile(a,b,c)},EraseTileWithBrush(a,b,c){this._MaybeResizeTilemap();this._autoTiling||(this._autoTiling=new C3$jscomp$226.Plugins.Tilemap.AutoTiling(this,this._sdkType));this._autoTiling.EraseAutoTile(a,b,c)},SetTileWithBrushByName(a,b,c){C3$jscomp$226.Plugins.Tilemap.Acts.SetTileWithBrush.call(this, a,b,c)},EraseTileWithBrushByName(a,b,c){C3$jscomp$226.Plugins.Tilemap.Acts.EraseTileWithBrush.call(this,a,b,c)}};const C3$jscomp$227=self.C3,TILE_ID_MASK$jscomp$4=C3$jscomp$227.Plugins.Tilemap.TILE_ID_MASK; C3$jscomp$227.Plugins.Tilemap.Exps={TileAt(a,b){a=this.GetTileAt(a,b);return-1===a?-1:a&TILE_ID_MASK$jscomp$4},PositionToTileX(a){return this.WorldToTileX(a)},PositionToTileY(a){return this.WorldToTileY(a)},TileToPositionX(a){return a*this._tileWidth+this.GetWorldInfo().GetX()+this._tileWidth/2},TileToPositionY(a){return a*this._tileHeight+this.GetWorldInfo().GetY()+this._tileHeight/2},SnapX(a){const b=this.GetWorldInfo().GetX();return Math.floor((a-b)/this._tileWidth)*this._tileWidth+b+this._tileWidth/ 2},SnapY(a){const b=this.GetWorldInfo().GetY();return Math.floor((a-b)/this._tileHeight)*this._tileHeight+b+this._tileHeight/2},TilesJSON(){return this.GetAsJsonString()},TileWidth(){return this.GetTileWidth()},TileHeight(){return this.GetTileHeight()},MapDisplayWidth(){return this.GetMapDisplayWidth()},MapDisplayHeight(){return this.GetMapDisplayHeight()}};"use strict"; const C3$jscomp$228=self.C3,TILE_FLIPPED_HORIZONTAL$jscomp$2=C3$jscomp$228.Plugins.Tilemap.TILE_FLIPPED_HORIZONTAL,TILE_FLIPPED_VERTICAL$jscomp$2=C3$jscomp$228.Plugins.Tilemap.TILE_FLIPPED_VERTICAL,TILE_FLIPPED_DIAGONAL$jscomp$2=C3$jscomp$228.Plugins.Tilemap.TILE_FLIPPED_DIAGONAL,TILE_ID_MASK$jscomp$5=C3$jscomp$228.Plugins.Tilemap.TILE_ID_MASK,tempRect$jscomp$15=C3$jscomp$228.New(C3$jscomp$228.Rect),tempQuad$jscomp$9=C3$jscomp$228.New(C3$jscomp$228.Quad); C3$jscomp$228.Plugins.Tilemap.TileQuad=class extends C3$jscomp$228.DefendedBase{constructor(){super();this._tileId=this._id=-1;this._isDiagFlip=this._isVertFlip=this._isHorizFlip=!1;this._rc=C3$jscomp$228.New(C3$jscomp$228.Rect);this._uv=null}Update(a,b,c,d,e,g,k,l){this._id=a;this._tileId=a&TILE_ID_MASK$jscomp$5;this._isHorizFlip=0!==(a&TILE_FLIPPED_HORIZONTAL$jscomp$2);this._isVertFlip=0!==(a&TILE_FLIPPED_VERTICAL$jscomp$2);this._isDiagFlip=0!==(a&TILE_FLIPPED_DIAGONAL$jscomp$2);this._rc.setWH(d* b+g,e*c+k,b,c);this._uv=l.GetTileUvQuad(this._id)}Draw(a,b,c,d,e){tempRect$jscomp$15.copy(this._rc);tempRect$jscomp$15.offset(c,d);tempRect$jscomp$15.intersectsRect(b)&&(tempQuad$jscomp$9.setFromRect(tempRect$jscomp$15),a.Quad4(tempQuad$jscomp$9,this._uv))}};"use strict";const C3$jscomp$229=self.C3; C3$jscomp$229.Plugins.Tilemap.TileCollisionRect=class extends C3$jscomp$229.DefendedBase{constructor(){super();this._id=-1;this._poly=null;this._rc=C3$jscomp$229.New(C3$jscomp$229.Rect)}Update(a,b,c,d,e,g,k,l){this._id=a;this._poly=b;this._rc.setWH(e*c+k,g*d+l,c,d)}ExtendRight(a){this._rc.setRight(this._rc.getRight()+a)}GetTileId(){return this._id}HasPoly(){return!!this._poly}GetPoly(){return this._poly}GetRect(){return this._rc}};"use strict";const C3$jscomp$230=self.C3; C3$jscomp$230.Plugins.Tilemap.TileCell=class extends C3$jscomp$230.DefendedBase{constructor(a,b,c){super();const d=a.GetCellWidth(),e=a.GetCellHeight();this._sdkInst=a;this._x=b;this._y=c;this._left=this._x*d*a.GetTileWidth();this._top=this._y*e*a.GetTileHeight();this._tiles=[];this._quads=[];this._collisionRects=[];this._isQuadMapValid=!1;for(a=0;a<e;++a)b=new Int32Array(d),b.fill(-1),this._tiles.push(b)}Clear(){const a=this._sdkInst.GetCellWidth();var b=this._sdkInst.GetCellHeight();const c=this._tiles; if(c.length<b)for(let d=c.length;d<b;++d)c.push(new Int32Array(a));else c.length>b&&C3$jscomp$230.truncateArray(c,b);for(let d=0,e=c.length;d<e;++d)b=c[d],b.length!==a&&(b=new Int32Array(a),c[d]=b),b.fill(-1)}GetLayoutRect(a){var b=this._sdkInst,c=b.GetWorldInfo();const d=b.GetCellWidth()*b.GetTileWidth();b=b.GetCellHeight()*b.GetTileHeight();const e=c.GetX()+this._left;c=c.GetY()+this._top;a.set(e,c,e+d,c+b)}_SetQuadMapChanged(){this._isQuadMapValid=!1}MaybeBuildQuadMap(){if(!this._isQuadMapValid){var a= this._sdkInst,b=a.GetSdkType(),c=a.GetWorldInfo(),d=a.GetTileWidth(),e=a.GetTileHeight(),g=a.GetCellWidth(),k=a.GetCellHeight(),l=this._left,n=this._top;if(!(0>=d||0>=e)){var p=Math.min(a.GetMapWidth(),Math.floor(c.GetWidth()/d));c=Math.min(a.GetMapHeight(),Math.floor(c.GetHeight()/e));p-=l/d;c-=n/e;p>g&&(p=g);c>k&&(c=k);g=this._tiles;k=this._quads;var r=0;for(var w=0;w<c;++w){var y=g[w];for(var B=0;B<p;++B){var C=y[B];if(-1!==C){var E=void 0;r<k.length?E=k[r]:(E=C3$jscomp$230.New(C3$jscomp$230.Plugins.Tilemap.TileQuad), k.push(E));E.Update(C,d,e,B,w,l,n,a);++r}}}r<k.length&&C3$jscomp$230.truncateArray(k,r);k=null;r=!1;a=this._collisionRects;C3$jscomp$230.clearArray(a);for(w=0;w<c;++w){y=g[w];for(B=0;B<p;++B){C=y[B];E=b.GetTilePoly(C);const F=b.IsTilePolyEnabled(E);-1!==C&&F?!k||E||r?(k&&a.push(k),k=C3$jscomp$230.New(C3$jscomp$230.Plugins.Tilemap.TileCollisionRect),k.Update(C,E,d,e,B,w,l,n),r=!!E):k.ExtendRight(d):k&&(a.push(k),k=null,r=!1)}k&&(a.push(k),k=null,r=!1)}b=a.length;for(d=0;d<b;++d)if(l=a[d],!l.HasPoly())for(l= l.GetRect(),n=d+1;n<b;++n)p=a[n],c=p.GetRect(),c.getTop()<l.getBottom()||c.getTop()>l.getBottom()||c.getRight()>l.getRight()||c.getLeft()>l.getLeft()||p.HasPoly()||c.getLeft()!==l.getLeft()||c.getRight()!==l.getRight()||(a.splice(n,1),--b,l.setBottom(l.getBottom()+e),--n);this._isQuadMapValid=!0}}}SetTileAt(a,b,c){this._tiles[b][a]!==c&&(this._tiles[b][a]=c,this._isQuadMapValid=!1,this._sdkInst.SetTileChanged())}GetTilesArr(){return this._tiles}GetCollisionRects(){return this._collisionRects}Draw(a, b,c,d){const e=this._sdkInst,g=this._quads;for(let k=0,l=g.length;k<l;++k)g[k].Draw(a,b,c,d,e)}};"use strict";const C3$jscomp$231=self.C3,AUTO_TILING_PATCH=Object.freeze([[0,0,0],[0,0,0],[0,0,0]]); C3$jscomp$231.Plugins.Tilemap.AutoTiling=class{constructor(a,b){this._sdkInst=a;this._sdkType=b;this._brushAdapterInstances=[null,null];this._brushAdapterConstructors=[C3$jscomp$231.Plugins.Tilemap.AutoTiling16,C3$jscomp$231.Plugins.Tilemap.AutoTiling47];this._probabilityTable=new C3$jscomp$231.ProbabilityTable}get AUTO_TILING_PATCH(){return AUTO_TILING_PATCH}get IGNORE_INDEX(){return-999}get FORCE_INDEX(){return-998}get EMPTY_INDEX(){return-1}get PAINT_MODE(){return 0}get ERASE_MODE(){return 1}GetSdkIntance(){return this._sdkInst}GetSdkType(){return this._sdkType}SetAutoTile(a,b, c){this.BrushExists(c)&&(this._SetAutoTileMode(c,0),this._SetAutoTilePatch(a,b,this._GetAutoTilePatch(a,b,c)))}EraseAutoTile(a,b,c){this.BrushExists(c)&&(this._SetAutoTileMode(c,1),this._EraseTile(a,b),this._SetAutoTilePatch(a,b,this._GetAutoTilePatch(a,b,c)))}BrushExists(a){return!!this.GetSdkType().GetBrushData(a)}GetTile(a,b){return this.GetSdkIntance().GetTileAt(a,b)}DoesTileExist(a,b,c){a=this.GetTile(a,b);return!!this.IsTileValid(a,!0,a,c)}IsTileValid(a,b,c,d){return-1===a?0:b&&-998===a?1:b&& d&&!this._IsTileIndexInBrush(c,d)?0:1}GetTileIndex(a,b,c,d){a=d.tileData[a];if(!a.length)return-1;if(1===a.length)return a[0][0];const e=this.GetTile(b,c);if(this.IsTileValid(e)&&a.some(g=>e===g[0]))return e;this._probabilityTable.Clear();for(let [g,k]of a)"number"!==typeof k&&(k=1),this._probabilityTable.AddItem(k,g);return this._probabilityTable.Sample()}_SetTile(a,b,c){-1!==a&&this.GetSdkIntance().SetTileAt(a,b,c)}_EraseTile(a,b){this.GetSdkIntance().SetTileAt(a,b,-1)}_IsTileIndexInBrush(a,b){for(const c of b.tileData)for(const [d]of c)if(d=== a)return!0;return!1}_SetAutoTilePatch(a,b,c){c&&(this._SetTile(a-1,b-1,c[0][0]),this._SetTile(a,b-1,c[1][0]),this._SetTile(a+1,b-1,c[2][0]),this._SetTile(a-1,b,c[0][1]),this._SetTile(a,b,c[1][1]),this._SetTile(a+1,b,c[2][1]),this._SetTile(a-1,b+1,c[0][2]),this._SetTile(a,b+1,c[1][2]),this._SetTile(a+1,b+1,c[2][2]))}_GetBrushType(a){return this.GetSdkType().GetBrushData(a).type}_MaybeCreateBrushAdapter(a){a=this._GetBrushType(a);this._brushAdapterInstances[a]||(this._brushAdapterInstances[a]=new this._brushAdapterConstructors[a](this))}_SetAutoTileMode(a, b){this._MaybeCreateBrushAdapter(a);a=this._GetBrushType(a);this._brushAdapterInstances[a]&&this._brushAdapterInstances[a].SetMode(b)}_GetAutoTilePatch(a,b,c){this._MaybeCreateBrushAdapter(c);c=this.GetSdkType().GetBrushData(c);if(this._brushAdapterInstances[c.type])return this._brushAdapterInstances[c.type].BuildPatch(a,b,c)}};"use strict"; self.C3.Plugins.Tilemap.AutoTiling16=class{constructor(a){this._auto=a;this._mode=a.PAINT_MODE}SetMode(a){this._mode=a}BuildPatch(a,b,c){return this._Build4BitAutoTilePatch(a,b,c)}_Build4BitAutoTilePatch(a,b,c){const d=this._mode===this._auto.PAINT_MODE?this._4BitAutoTiling(a,b,void 0,c):this._auto.EMPTY_INDEX,e=this._Get4BitAutoTile(a,b-1,"s",c),g=this._Get4BitAutoTile(a-1,b,"e",c),k=this._Get4BitAutoTile(a+1,b,"w",c),l=this._Get4BitAutoTile(a,b+1,"n",c),n=this._auto.AUTO_TILING_PATCH;n[0][0]=this._auto.IGNORE_INDEX; n[1][0]=this._Get4BitTileIndex(e,a,b-1,c);n[2][0]=this._auto.IGNORE_INDEX;n[0][1]=this._Get4BitTileIndex(g,a-1,b,c);n[1][1]=this._Get4BitTileIndex(d,a,b,c);n[2][1]=this._Get4BitTileIndex(k,a+1,b,c);n[0][2]=this._auto.IGNORE_INDEX;n[1][2]=this._Get4BitTileIndex(l,a,b+1,c);n[2][2]=this._auto.IGNORE_INDEX;return n}_Get4BitAutoTile(a,b,c,d){return this._auto.DoesTileExist(a,b,d)?this._4BitAutoTiling(a,b,c,d):this._auto.IGNORE_INDEX}_4BitAutoTiling(a,b,c,d){this._mode===this._auto.ERASE_MODE&&(c=void 0); const e=this._auto.GetTile(a,b-1);var g=this._auto.GetTile(a-1,b),k=this._auto.GetTile(a+1,b);a=this._auto.GetTile(a,b+1);const l="w"===c?this._auto.FORCE_INDEX:g,n="e"===c?this._auto.FORCE_INDEX:k;b="s"===c?this._auto.FORCE_INDEX:a;c=this._auto.IsTileValid("n"===c?this._auto.FORCE_INDEX:e,!0,e,d);g=this._auto.IsTileValid(l,!0,g,d);k=this._auto.IsTileValid(n,!0,k,d);d=this._auto.IsTileValid(b,!0,a,d);return 1*c+2*g+4*k+8*d}_Get4BitTileIndex(a,b,c,d){return a===this._auto.IGNORE_INDEX||a===this._auto.EMPTY_INDEX? a:this._auto.GetTileIndex(a,b,c,d)}};"use strict";const C3$jscomp$233=self.C3,TILE_INDEX_MAP=new Map([[2,1],[8,2],[10,3],[11,4],[16,5],[18,6],[22,7],[24,8],[26,9],[27,10],[30,11],[31,12],[64,13],[66,14],[72,15],[74,16],[75,17],[80,18],[82,19],[86,20],[88,21],[90,22],[91,23],[94,24],[95,25],[104,26],[106,27],[107,28],[120,29],[122,30],[123,31],[126,32],[127,33],[208,34],[210,35],[214,36],[216,37],[218,38],[219,39],[222,40],[223,41],[248,42],[250,43],[251,44],[254,45],[255,46],[0,47]]); C3$jscomp$233.Plugins.Tilemap.AutoTiling47=class{constructor(a){this._auto=a;this._mode=a.PAINT_MODE}SetMode(a){this._mode=a}BuildPatch(a,b,c){return this._Build8BitAutoTilePatch(a,b,c)}_Build8BitAutoTilePatch(a,b,c){const d=this._mode===this._auto.PAINT_MODE?this._8BitAutoTiling(a,b,void 0,c):this._auto.EMPTY_INDEX,e=this._Get8BitAutoTile(a-1,b-1,"se",c),g=this._Get8BitAutoTile(a,b-1,"s",c),k=this._Get8BitAutoTile(a+1,b-1,"sw",c),l=this._Get8BitAutoTile(a-1,b,"e",c),n=this._Get8BitAutoTile(a+1,b, "w",c),p=this._Get8BitAutoTile(a-1,b+1,"ne",c),r=this._Get8BitAutoTile(a,b+1,"n",c),w=this._Get8BitAutoTile(a+1,b+1,"nw",c),y=this._auto.AUTO_TILING_PATCH;y[0][0]=this._Get8BitTileIndex(e,a-1,b-1,c);y[1][0]=this._Get8BitTileIndex(g,a,b-1,c);y[2][0]=this._Get8BitTileIndex(k,a+1,b-1,c);y[0][1]=this._Get8BitTileIndex(l,a-1,b,c);y[1][1]=this._Get8BitTileIndex(d,a,b,c);y[2][1]=this._Get8BitTileIndex(n,a+1,b,c);y[0][2]=this._Get8BitTileIndex(p,a-1,b+1,c);y[1][2]=this._Get8BitTileIndex(r,a,b+1,c);y[2][2]= this._Get8BitTileIndex(w,a+1,b+1,c);return y}_Get8BitAutoTile(a,b,c,d){return this._auto.DoesTileExist(a,b,d)?this._8BitAutoTiling(a,b,c,d):this._auto.IGNORE_INDEX}_8BitAutoTiling(a,b,c,d){this._mode===this._auto.ERASE_MODE&&(c=void 0);const e=this._auto.GetTile(a,b-1);var g=this._auto.GetTile(a-1,b),k=this._auto.GetTile(a+1,b),l=this._auto.GetTile(a,b+1),n=this._auto.GetTile(a-1,b-1),p=this._auto.GetTile(a+1,b-1),r=this._auto.GetTile(a-1,b+1);a=this._auto.GetTile(a+1,b+1);const w="w"===c?this._auto.FORCE_INDEX: g,y="e"===c?this._auto.FORCE_INDEX:k,B="s"===c?this._auto.FORCE_INDEX:l,C="nw"===c?this._auto.FORCE_INDEX:n,E="ne"===c?this._auto.FORCE_INDEX:p,F="sw"===c?this._auto.FORCE_INDEX:r;b="se"===c?this._auto.FORCE_INDEX:a;c=this._auto.IsTileValid("n"===c?this._auto.FORCE_INDEX:e,!0,e,d);g=this._auto.IsTileValid(w,!0,g,d);k=this._auto.IsTileValid(y,!0,k,d);l=this._auto.IsTileValid(B,!0,l,d);n=c&&g?this._auto.IsTileValid(C,!0,n,d):0;p=c&&k?this._auto.IsTileValid(E,!0,p,d):0;r=l&&g?this._auto.IsTileValid(F, !0,r,d):0;d=l&&k?this._auto.IsTileValid(b,!0,a,d):0;return 1*n+2*c+4*p+8*g+16*k+32*r+64*l+128*d}_Get8BitTileIndex(a,b,c,d){return a===this._auto.IGNORE_INDEX||a===this._auto.EMPTY_INDEX?a:this._auto.GetTileIndex(TILE_INDEX_MAP.get(a),b,c,d)}};"use strict";const C3$jscomp$234=self.C3;C3$jscomp$234.Plugins.Arr=class extends C3$jscomp$234.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$235=self.C3;C3$jscomp$235.Plugins.Arr.Type=class extends C3$jscomp$235.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}}; const C3$jscomp$236=self.C3,C3X$jscomp$23=self.C3X,IInstance$jscomp$3=self.IInstance;function ResizeArray(a,b,c){if(b<a.length)C3$jscomp$236.truncateArray(a,b);else if(b>a.length)if("function"===typeof c)for(var d=a.length;d<b;++d)a.push(c());else for(d=a.length;d<b;++d)a.push(c)} C3$jscomp$236.Plugins.Arr.Instance=class extends C3$jscomp$236.SDKInstanceBase{constructor(a,b){super(a);this._cx=10;this._cz=this._cy=1;this._arr=null;this._forX=[];this._forY=[];this._forZ=[];this._forDepth=-1;b&&(this._cx=b[0],this._cy=b[1],this._cz=b[2]);this._arr=C3$jscomp$236.MakeFilledArray(this._cx,()=>C3$jscomp$236.MakeFilledArray(this._cy,()=>C3$jscomp$236.MakeFilledArray(this._cz,0)))}Release(){this._arr=null;super.Release()}At(a,b,c){a=Math.floor(a);b=Math.floor(b);c=Math.floor(c);return 0<= a&&a<this._cx&&0<=b&&b<this._cy&&0<=c&&c<this._cz?this._arr[a][b][c]:0}Set(a,b,c,d){a=Math.floor(a);b=Math.floor(b);c=Math.floor(c);0<=a&&a<this._cx&&0<=b&&b<this._cy&&0<=c&&c<this._cz&&(this._arr[a][b][c]=d)}SetSize(a,b,c){a=Math.floor(a);b=Math.floor(b);c=Math.floor(c);0>a&&(a=0);0>b&&(b=0);0>c&&(c=0);if(this._cx!==a||this._cy!==b||this._cz!==c){this._cx=a;this._cy=b;this._cz=c;var d=this._arr;ResizeArray(d,a,()=>C3$jscomp$236.MakeFilledArray(b,()=>C3$jscomp$236.MakeFilledArray(c,0)));for(let e= 0;e<a;++e){ResizeArray(d[e],b,()=>C3$jscomp$236.MakeFilledArray(c,0));for(let g=0;g<b;++g)ResizeArray(d[e][g],c,0)}}}GetWidth(){return this._cx}GetHeight(){return this._cy}GetDepth(){return this._cz}_ShuffleHelper(a,b,c,d,e){for(;0<b;){const l=Math.floor(this._runtime.Random()*b);--b;if(0===a){var g=this.At(b,d,e),k=this.At(l,d,e);this.Set(b,d,e,k);this.Set(l,d,e,g)}else 1===a?(g=this.At(c,b,e),k=this.At(c,l,e),this.Set(c,b,e,k),this.Set(c,l,e,g)):2===a&&(g=this.At(c,d,b),k=this.At(c,d,l),this.Set(c, d,b,k),this.Set(c,d,l,g))}}GetDebuggerProperties(){const a=[{title:"plugins.arr.debugger.array-properties.title",properties:[{name:"plugins.arr.properties.width.name",value:this._cx,onedit:c=>this.SetSize(c,this._cy,this._cz)},{name:"plugins.arr.properties.height.name",value:this._cy,onedit:c=>this.SetSize(this._cx,c,this._cz)},{name:"plugins.arr.properties.depth.name",value:this._cz,onedit:c=>this.SetSize(this._cx,this._cy,c)},{name:"plugins.arr.properties.elements.name",value:this._cx*this._cy* this._cz}]}],b=[];if(1===this._cy&&1===this._cz)for(let c=0;c<this._cx;++c)b.push({name:"$"+c,value:this._arr[c][0][0],onedit:d=>this._arr[c][0][0]=d});else for(let c=0;c<this._cx;++c)b.push({name:"$"+c,value:this._arr[c].toString()});b.length&&a.push({title:"plugins.arr.debugger.array-data.title",properties:b});return a}GetAsJsonString(){return JSON.stringify({c2array:!0,size:[this._cx,this._cy,this._cz],data:this._arr})}SaveToJson(){return{size:[this._cx,this._cy,this._cz],data:this._arr}}LoadFromJson(a){const b= a.size;this._cx=b[0];this._cy=b[1];this._cz=b[2];this._arr=a.data}_GetForX(){return 0<=this._forDepth&&this._forDepth<this._forX.length?this._forX[this._forDepth]:0}_GetForY(){return 0<=this._forDepth&&this._forDepth<this._forY.length?this._forY[this._forDepth]:0}_GetForZ(){return 0<=this._forDepth&&this._forDepth<this._forZ.length?this._forZ[this._forDepth]:0}GetScriptInterfaceClass(){return self.IArrayInstance}};const map$jscomp$24=new WeakMap; self.IArrayInstance=class extends IInstance$jscomp$3{constructor(){super();map$jscomp$24.set(this,IInstance$jscomp$3._GetInitInst().GetSdkInstance())}get width(){return map$jscomp$24.get(this).GetWidth()}get height(){return map$jscomp$24.get(this).GetHeight()}get depth(){return map$jscomp$24.get(this).GetDepth()}setSize(a,b=1,c=1){C3X$jscomp$23.RequireFiniteNumber(a);C3X$jscomp$23.RequireFiniteNumber(b);C3X$jscomp$23.RequireFiniteNumber(c);map$jscomp$24.get(this).SetSize(a,b,c)}getAt(a,b=0,c=0){C3X$jscomp$23.RequireFiniteNumber(a); C3X$jscomp$23.RequireFiniteNumber(b);C3X$jscomp$23.RequireFiniteNumber(c);return map$jscomp$24.get(this).At(a,b,c)}setAt(a,b,c=0,d=0){C3X$jscomp$23.RequireFiniteNumber(b);C3X$jscomp$23.RequireFiniteNumber(c);C3X$jscomp$23.RequireFiniteNumber(d);if("number"!==typeof a&&"string"!==typeof a)throw new TypeError("invalid type");map$jscomp$24.get(this).Set(b,c,d,a)}};const C3$jscomp$237=self.C3;function DoForEachTrigger(a,b,c,d,e){a.PushCopySol(c);b.Retrigger(d,e);a.PopSol(c)} C3$jscomp$237.Plugins.Arr.Cnds={CompareX(a,b,c){return C3$jscomp$237.compare(this.At(a,0,0),b,c)},CompareXY(a,b,c,d){return C3$jscomp$237.compare(this.At(a,b,0),c,d)},CompareXYZ(a,b,c,d,e){return C3$jscomp$237.compare(this.At(a,b,c),d,e)},ArrForEach(a){const b=this._runtime,c=b.GetEventSheetManager(),d=b.GetCurrentEvent(),e=d.GetSolModifiers(),g=b.GetEventStack(),k=g.GetCurrentStackFrame(),l=g.Push(d),n=++this._forDepth,p=this._forX;var r=this._forY,w=this._forZ;const y=this._cx,B=this._cy;var C= this._cz;n===this._forX.length?(p.push(0),r.push(0),w.push(0)):(p[n]=0,r[n]=0,w[n]=0);b.SetDebuggingEnabled(!1);if(0===a)for(a=0;a<y;++a)for(let E=0;E<B;++E)for(let F=0;F<C;++F)p[n]=a,r[n]=E,w[n]=F,DoForEachTrigger(c,d,e,k,l);else if(1===a)for(w=0;w<y;++w)for(C=0;C<B;++C)p[n]=w,r[n]=C,DoForEachTrigger(c,d,e,k,l);else for(r=0;r<y;++r)p[n]=r,DoForEachTrigger(c,d,e,k,l);b.SetDebuggingEnabled(!0);this._forDepth--;g.Pop();return!1},CompareCurrent(a,b){return C3$jscomp$237.compare(this.At(this._GetForX(), this._GetForY(),this._GetForZ()),a,b)},Contains(a){const b=this._cx,c=this._cy,d=this._cz,e=this._arr;for(let g=0;g<b;++g)for(let k=0;k<c;++k)for(let l=0;l<d;++l)if(e[g][k][l]===a)return!0;return!1},IsEmpty(){return 0===this._cx||0===this._cy||0===this._cz},CompareSize(a,b,c){let d=0;switch(a){case 0:d=this._cx;break;case 1:d=this._cy;break;case 2:d=this._cz}return C3$jscomp$237.compare(d,b,c)}};const C3$jscomp$238=self.C3; function CompareValues(a,b){if("number"===typeof a&&"number"===typeof b)return a-b;a=a.toString();b=b.toString();return a<b?-1:a>b?1:0} C3$jscomp$238.Plugins.Arr.Acts={Clear(a){const b=this._cx,c=this._cy,d=this._cz,e=this._arr;for(let g=0;g<b;++g)for(let k=0;k<c;++k)for(let l=0;l<d;++l)e[g][k][l]=a},SetSize(a,b,c){this.SetSize(a,b,c)},SetX(a,b){this.Set(a,0,0,b)},SetXY(a,b,c){this.Set(a,b,0,c)},SetXYZ(a,b,c,d){this.Set(a,b,c,d)},Push(a,b,c){var d=this._cx,e=this._cy;const g=this._cz,k=this._arr;if(0===c)d=C3$jscomp$238.MakeFilledArray(e,()=>C3$jscomp$238.MakeFilledArray(g,b)),0===a?k.push(d):k.unshift(d),this._cx++;else if(1===c){for(e= 0;e<d;++e)c=C3$jscomp$238.MakeFilledArray(g,b),0===a?k[e].push(c):k[e].unshift(c);this._cy++}else{for(c=0;c<d;++c)for(let l=0;l<e;++l)0===a?k[c][l].push(b):k[c][l].unshift(b);this._cz++}},Pop(a,b){const c=this._cx;var d=this._cy,e=this._cz;const g=this._arr;if(0===b)0!==c&&(0===a?g.pop():g.shift(),this._cx--);else if(1===b){if(0!==d){for(d=0;d<c;++d)0===a?g[d].pop():g[d].shift();this._cy--}}else if(0!==e){for(b=0;b<c;++b)for(e=0;e<d;++e)0===a?g[b][e].pop():g[b][e].shift();this._cz--}},Reverse(a){const b= this._cx;var c=this._cy,d=this._cz;const e=this._arr;if(0!==b&&0!==c&&0!==d)if(0===a)e.reverse();else if(1===a)for(c=0;c<b;++c)e[c].reverse();else for(a=0;a<b;++a)for(d=0;d<c;++d)e[a][d].reverse()},Sort(a){const b=this._cx;var c=this._cy,d=this._cz;const e=this._arr;if(0!==b&&0!==c&&0!==d)if(0===a)e.sort((g,k)=>CompareValues(g[0][0],k[0][0]));else if(1===a)for(c=0;c<b;++c)e[c].sort((g,k)=>CompareValues(g[0],k[0]));else for(a=0;a<b;++a)for(d=0;d<c;++d)e[a][d].sort(CompareValues)},Shuffle(a){const b= this._cx,c=this._cy,d=this._cz;if(0!==b&&0!==c&&0!==d)if(0===a)for(var e=0;e<c;++e)for(var g=0;g<d;++g)this._ShuffleHelper(a,b,0,e,g);else if(1===a)for(e=0;e<b;++e)for(g=0;g<d;++g)this._ShuffleHelper(a,c,e,0,g);else for(e=0;e<b;++e)for(g=0;g<c;++g)this._ShuffleHelper(a,d,e,g,0)},Delete(a,b){a=Math.floor(a);if(!(0>a)){var c=this._cx,d=this._cy,e=this._cz,g=this._arr;if(0===b)a>=c||(g.splice(a,1),this._cx--);else if(1===b){if(!(a>=d)){for(d=0;d<c;++d)g[d].splice(a,1);this._cy--}}else if(!(a>=e)){for(b= 0;b<c;++b)for(e=0;e<d;++e)g[b][e].splice(a,1);this._cz--}}},Insert(a,b,c){b=Math.floor(b);if(!(0>b)){var d=this._cx,e=this._cy,g=this._cz,k=this._arr;if(0===c)b>d||(k.splice(b,0,C3$jscomp$238.MakeFilledArray(e,()=>C3$jscomp$238.MakeFilledArray(g,a))),this._cx++);else if(1===c){if(!(b>e)){for(e=0;e<d;++e)k[e].splice(b,0,C3$jscomp$238.MakeFilledArray(g,a));this._cy++}}else if(!(b>g)){for(c=0;c<d;++c)for(let l=0;l<e;++l)k[c][l].splice(b,0,a);this._cz++}}},SplitString(a,b,c){a=a.split(b);this.SetSize(a.length, 1,1);for(let d=0,e=a.length;d<e;++d)b=a[d],0===c?String(Number(b))===b&&(b=Number(b)):2===c&&(b=Number(b)),this.Set(d,0,0,b)},JSONLoad(a){let b=null;try{b=JSON.parse(a)}catch(c){console.error("[Construct] Failed to parse JSON: ",c);return}b.c2array&&(a=b.size,this._cx=a[0],this._cy=a[1],this._cz=a[2],this._arr=b.data)},JSONDownload(a){const b=URL.createObjectURL(new Blob([this.GetAsJsonString()],{type:"application/json"}));this._runtime.InvokeDownload(b,a)}}; self.C3.Plugins.Arr.Exps={At(a,b,c){return this.At(a,b||0,c||0)},Width(){return this._cx},Height(){return this._cy},Depth(){return this._cz},CurX(){return this._GetForX()},CurY(){return this._GetForY()},CurZ(){return this._GetForZ()},CurValue(){return this.At(this._GetForX(),this._GetForY(),this._GetForZ())},Front(){return this.At(0,0,0)},Back(){return this.At(this._cx-1,0,0)},IndexOf(a){const b=this._arr;for(let c=0,d=this._cx;c<d;++c)if(b[c][0][0]===a)return c;return-1},LastIndexOf(a){const b=this._arr; for(let c=this._cx-1;0<=c;--c)if(b[c][0][0]===a)return c;return-1},JoinString(a){let b=[];for(let c=0;c<this._cx;++c)b.push(this.At(c,0,0));return b.join(a)},AsJSON(){return this.GetAsJsonString()}};"use strict";const C3$jscomp$240=self.C3,actionPromises=[];C3$jscomp$240.Plugins.Audio=class extends C3$jscomp$240.SDKPluginBase{constructor(a){super(a)}_AddActionPromise(a){actionPromises.push(a)}static async WaitForAllActionPromises(){await Promise.all(actionPromises);C3$jscomp$240.clearArray(actionPromises)}Release(){super.Release()}}; const C3$jscomp$241=self.C3;C3$jscomp$241.Plugins.Audio.Type=class extends C3$jscomp$241.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.IAudioObjectType}};function GetAudioDOMInterface(){if(self.C3Audio_DOMInterface)return self.C3Audio_DOMInterface;throw Error("audio scripting API cannot be used here - make sure the project is using DOM mode, not worker mode");}self.IAudioObjectType=class extends self.IObjectClass{constructor(a){super(a)}get audioContext(){return GetAudioDOMInterface().GetAudioContext()}get destinationNode(){return GetAudioDOMInterface().GetDestinationNode()}}; const C3$jscomp$242=self.C3,LATENCY_HINTS=["interactive","balanced","playback"]; C3$jscomp$242.Plugins.Audio.Instance=class extends C3$jscomp$242.SDKInstanceBase{constructor(a,b){super(a,"audio");this._nextPlayTime=0;this._triggerTags=[];this._enableMultiTags=!0;this._saveLoadMode=this._timeScaleMode=0;this._playInBackground=!1;this._distanceModel=this._panningModel=1;this._listenerPos=[this._runtime.GetViewportWidth()/2,this._runtime.GetViewportHeight()/2,600];this._listenerForwardVec=[0,0,-1];this._listenerUpVec=[0,1,0];this._referenceDistance=600;this._maxDistance=1E4;this._rolloffFactor= 1;this._listenerInst=null;this._loadListenerUid=-1;this._masterVolume=1;this._isSilent=!1;this._sampleRate=0;this._audioContextState="suspended";this._outputLatency=0;this._effectCount=new Map;this._preloadCount=this._preloadTotal=0;this._bufferMetadata=new Map;this._remoteUrls=new Map;a="interactive";b&&(this._timeScaleMode=b[0],this._saveLoadMode=b[1],this._playInBackground=b[2],a=LATENCY_HINTS[b[3]],this._enableMultiTags=b[4],this._panningModel=b[5],this._distanceModel=b[6],this._listenerPos[2]= b[7],this._referenceDistance=b[8],this._maxDistance=b[9],this._rolloffFactor=b[10]);this._lastAIState=[];this._lastFxState=[];this._lastAnalysersData=[];this.AddDOMMessageHandlers([["state",c=>this._OnUpdateState(c)],["audiocontext-state",c=>this._OnAudioContextStateChanged(c)],["fxstate",c=>this._OnUpdateFxState(c)],["trigger",c=>this._OnTrigger(c)],["buffer-metadata",c=>this._OnBufferMetadata(c)]]);b=this.GetRuntime().Dispatcher();this._disposables=new C3$jscomp$242.CompositeDisposable(C3$jscomp$242.Disposable.From(b, "instancedestroy",c=>this._OnInstanceDestroyed(c.instance)),C3$jscomp$242.Disposable.From(b,"afterload",()=>this._OnAfterLoad()),C3$jscomp$242.Disposable.From(b,"suspend",()=>this._OnSuspend()),C3$jscomp$242.Disposable.From(b,"resume",()=>this._OnResume()));this._runtime.AddLoadPromise(this.PostToDOMAsync("create-audio-context",{preloadList:this._runtime.GetAssetManager().GetAudioToPreload().map(c=>({originalUrl:c.originalUrl,url:c.url,type:c.type,fileSize:c.fileSize})),isiOSCordova:this._runtime.IsiOSCordova(), isSafari:"Safari"===C3$jscomp$242.Platform.Browser,timeScaleMode:this._timeScaleMode,latencyHint:a,panningModel:this._panningModel,distanceModel:this._distanceModel,refDistance:this._referenceDistance,maxDistance:this._maxDistance,rolloffFactor:this._rolloffFactor,listenerPos:this._listenerPos}).then(c=>{this._sampleRate=c.sampleRate;this._audioContextState=c.audioContextState;this._outputLatency=c.outputLatency}));this._StartTicking()}Release(){this._listenerInst=null;super.Release()}_SplitTags(a){return this._enableMultiTags? a.split(" ").filter(b=>!!b):a?[a]:[]}_MatchTagLists(a,b){for(const c of b){b=!1;for(const d of a)if(C3$jscomp$242.equalsNoCase(d,c)){b=!0;break}if(!b)return!1}return!0}_MatchTagListToStr(a,b){return this._MatchTagLists(a,this._SplitTags(b))}_AddActionPromise(a){this.GetPlugin()._AddActionPromise(a)}_OnInstanceDestroyed(a){this._listenerInst===a&&(this._listenerInst=null)}DbToLinearNoCap(a){return Math.pow(10,a/20)}DbToLinear(a){a=this.DbToLinearNoCap(a);return isFinite(a)?Math.max(Math.min(a,1),0): 0}LinearToDbNoCap(a){return Math.log(a)/Math.log(10)*20}LinearToDb(a){return this.LinearToDbNoCap(Math.max(Math.min(a,1),0))}_OnSuspend(){this._playInBackground||this.PostToDOM("set-suspended",{isSuspended:!0})}_OnResume(){this._playInBackground||this.PostToDOM("set-suspended",{isSuspended:!1})}_OnUpdateState(a){const b=a.tickCount;this._outputLatency=a.outputLatency;const c=this._lastAIState.filter(d=>d.hasOwnProperty("placeholder")&&(d.placeholder>b||-1===d.placeholder));this._lastAIState=a.audioInstances; this._lastAnalysersData=a.analysers;0<c.length&&C3$jscomp$242.appendArray(this._lastAIState,c)}_OnBufferMetadata(a){this._bufferMetadata.set(a.originalUrl,{duration:a.duration})}_OnAudioContextStateChanged(a){this._audioContextState=a.audioContextState}GetAudioContextState(){return this._runtime.IsExportToVideo()?"running":this._audioContextState}_OnUpdateFxState(a){this._lastFxState=a.fxstate}_GetFirstAudioStateByTags(a){a=this._SplitTags(a);for(const b of this._lastAIState)if(this._MatchTagLists(b.tags, a))return b;return null}_IsTagPlaying(a){const b=this._SplitTags(a);return this._lastAIState.some(c=>this._MatchTagLists(c.tags,b)&&c.isPlaying)}_MaybeMarkAsPlaying(a,b,c,d,e){if(this._IsTagPlaying(b))return null;const g=this._bufferMetadata.get(a);a={tags:this._SplitTags(b),duration:g?g.duration:0,volume:e,isPlaying:!0,playbackTime:0,playbackRate:1,uid:-1,bufferOriginalUrl:a,bufferUrl:"",bufferType:"",isMusic:c,isLooping:d,isMuted:!1,resumePosition:0,pan:null,placeholder:-1};this._lastAIState.push(a); return a}async _OnTrigger(a){const b=a.type;this._triggerTags=a.tags;a=a.aiid;if("ended"===b){for(const c of this._lastAIState)if(c.aiid===a){c.isPlaying=!1;break}await this.TriggerAsync(C3$jscomp$242.Plugins.Audio.Cnds.OnEnded)}else"fade-ended"===b&&await this.TriggerAsync(C3$jscomp$242.Plugins.Audio.Cnds.OnFadeEnded)}_MatchTriggerTag(a){return this._MatchTagListToStr(this._triggerTags,a)}Tick(){const a={timeScale:this._runtime.GetTimeScale(),gameTime:this._runtime.GetGameTimeRaw(),instPans:this.GetInstancePans(), tickCount:this._runtime.GetTickCountNoSave()};if(this._listenerInst){const b=this._listenerInst.GetWorldInfo();this._listenerPos[0]=b.GetX();this._listenerPos[1]=b.GetY();a.listenerPos=this._listenerPos;a.listenerOrientation=[...this._listenerForwardVec,...this._listenerUpVec]}this.PostToDOM("tick",a)}rotatePtAround(a,b,c,d,e){if(0===c)return[a,b];const g=Math.sin(c);c=Math.cos(c);a-=d;b-=e;const k=a*g;a=a*c-b*g;b=b*c+k;return[a+d,b+e]}GetInstancePans(){return this._lastAIState.filter(a=>-1!==a.uid).map(a=> this._runtime.GetInstanceByUID(a.uid)).filter(a=>a).map(a=>{const b=a.GetWorldInfo(),c=b.GetLayer().GetAngle(),[d,e]=this.rotatePtAround(b.GetX(),b.GetY(),-c,this._listenerPos[0],this._listenerPos[1]);return{uid:a.GetUID(),x:d,y:e,z:b.GetTotalZElevation(),angle:b.GetAngle()-c}})}GetAnalyserData(a,b){for(const c of this._lastAnalysersData)if(c.index===b&&C3$jscomp$242.equalsNoCase(c.tag,a))return c;return null}_IncrementEffectCount(a){for(const b of this._SplitTags(a))a=b.toLowerCase(),this._effectCount.set(a, (this._effectCount.get(a)||0)+1)}_ShouldSave(a){return a.hasOwnProperty("placeholder")||3===this._saveLoadMode?!1:a.isMusic&&1===this._saveLoadMode?!1:a.isMusic||2!==this._saveLoadMode?!0:!1}SaveToJson(){return{isSilent:this._isSilent,masterVolume:this._masterVolume,listenerZ:this._listenerPos[2],listenerForwardVec:this._listenerForwardVec,listenerUpVec:this._listenerUpVec,listenerUid:this._listenerInst?this._listenerInst.GetUID():-1,remoteUrls:[...this._remoteUrls.entries()],playing:this._lastAIState.filter(a=> this._ShouldSave(a)),effects:this._lastFxState,analysers:this._lastAnalysersData}}LoadFromJson(a){this._isSilent=a.isSilent;this._masterVolume=a.masterVolume;this._listenerPos[2]=a.listenerZ;this._listenerInst=null;this._loadListenerUid=a.listenerUid;a.hasOwnProperty("listenerForwardVec")?this._listenerForwardVec=a.listenerForwardVec:this._listenerForwardVec=[0,0,-1];a.hasOwnProperty("listenerUpVec")?this._listenerUpVec=a.listenerUpVec:this._listenerUpVec=[0,1,0];this._remoteUrls.clear();if(a.remoteUrls)for(const [b, c]of a.remoteUrls)this._remoteUrls.set(b,c);this._lastAIState=a.playing;for(const b of this._lastAIState)b.hasOwnProperty("tag")&&!b.hasOwnProperty("tags")&&(b.tags=[b.tag].filter(c=>!!c));this._lastFxState=a.effects;this._lastAnalysersData=a.analysers}_OnAfterLoad(){if(-1!==this._loadListenerUid&&(this._listenerInst=this._runtime.GetInstanceByUID(this._loadListenerUid),this._loadListenerUid=-1,this._listenerInst)){var a=this._listenerInst.GetWorldInfo();this._listenerPos[0]=a.GetX();this._listenerPos[1]= a.GetY()}for(var b of this._lastAIState)(a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b.bufferOriginalUrl))?(b.bufferUrl=a.url,b.bufferType=a.type):b.bufferUrl=null;for(const c of Object.values(this._lastFxState))for(const d of c)d.hasOwnProperty("bufferOriginalUrl")&&(b=this._runtime.GetAssetManager().GetProjectAudioFileUrl(d.bufferOriginalUrl))&&(d.bufferUrl=b.url,d.bufferType=b.type);this.PostToDOM("load-state",{saveLoadMode:this._saveLoadMode,timeScale:this._runtime.GetTimeScale(), gameTime:this._runtime.GetGameTimeRaw(),listenerPos:this._listenerPos,listenerOrientation:[...this._listenerForwardVec,...this._listenerUpVec],isSilent:this._isSilent,masterVolume:this._masterVolume,playing:this._lastAIState.filter(c=>null!==c.bufferUrl),effects:this._lastFxState})}GetDebuggerProperties(){const a=[];for(const [b,c]of Object.entries(this._lastFxState))a.push({name:"$"+b,value:c.map(d=>d.type).join(", ")});return[{title:"plugins.audio.debugger.tag-effects",properties:a},{title:"plugins.audio.debugger.currently-playing", properties:[{name:"plugins.audio.debugger.currently-playing-count",value:this._lastAIState.length},...this._lastAIState.map((b,c)=>({name:"$#"+c,value:`${b.bufferOriginalUrl} ("${b.tags}") ${Math.round(10*b.playbackTime)/10} / ${Math.round(10*b.duration)/10}`}))]}]}}; self.C3.Plugins.Audio.Cnds={OnEnded(a){return this._MatchTriggerTag(a)},OnFadeEnded(a){return this._MatchTriggerTag(a)},PreloadsComplete(){return this._preloadCount===this._preloadTotal},AdvancedAudioSupported(){return!0},IsSilent(){return this._isSilent},IsAnyPlaying(){for(const a of this._lastAIState)if(a.isPlaying)return!0;return!1},IsTagPlaying(a){return this._IsTagPlaying(a)}};const C3$jscomp$244=self.C3,FILTER_TYPES="lowpass highpass bandpass lowshelf highshelf peaking notch allpass".split(" "); C3$jscomp$244.Plugins.Audio.Acts={Play(a,b,c,d,e){a=C3$jscomp$244.Plugins.Audio.Acts._DoPlay.call(this,a,b,c,d,e);this._AddActionPromise(a);return a},PlayFromTimeline(a,b,c,d){C3$jscomp$244.Plugins.Audio.Acts._DoPlay.call(this,a,0,b,0,c,d)},async _DoPlay(a,b,c,d,e,g){if(!this._isSilent){var k=a[1],l=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]);if(l){var n=this._nextPlayTime;this._nextPlayTime=0;var p=this._MaybeMarkAsPlaying(a[0],e,k,0!==b,this.DbToLinear(c));try{await this.PostToDOMAsync("play", {originalUrl:a[0],url:l.url,type:l.type,isMusic:k,tags:this._SplitTags(e),isLooping:0!==b,vol:this.DbToLinear(c),stereoPan:C3$jscomp$244.clamp(d/100,-1,1),pos:g||0,off:n,trueClock:!!self.C3_GetAudioContextCurrentTime})}finally{p&&(p.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtPosition(a,b,c,d,e,g,k,l,n,p,r){if(!this._isSilent){var w=a[1],y=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]);if(y){var B=this._nextPlayTime;this._nextPlayTime=0;var C=this._MaybeMarkAsPlaying(a[0], r,w,0!==b,this.DbToLinear(c));try{await this.PostToDOMAsync("play",{originalUrl:a[0],url:y.url,type:y.type,isMusic:w,tags:this._SplitTags(r),isLooping:0!==b,vol:this.DbToLinear(c),pos:0,off:B,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:d,y:e,z:g,angle:C3$jscomp$244.toRadians(k),innerAngle:C3$jscomp$244.toRadians(l),outerAngle:C3$jscomp$244.toRadians(n),outerGain:this.DbToLinear(p)}})}finally{C&&(C.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtObject(a,b,c,d,e,g,k,l){if(!this._isSilent&& d&&(d=d.GetFirstPicked())&&d.GetWorldInfo()){var n=d.GetWorldInfo(),p=n.GetLayer().GetAngle(),[r,w]=this.rotatePtAround(n.GetX(),n.GetY(),-p,this._listenerPos[0],this._listenerPos[1]),y=a[1],B=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]);if(B){var C=this._nextPlayTime;this._nextPlayTime=0;var E=this._MaybeMarkAsPlaying(a[0],l,y,0!==b,this.DbToLinear(c));try{await this.PostToDOMAsync("play",{originalUrl:a[0],url:B.url,type:B.type,isMusic:y,tags:this._SplitTags(l),isLooping:0!==b,vol:this.DbToLinear(c), pos:0,off:C,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:r,y:w,z:n.GetTotalZElevation(),angle:n.GetAngle()-p,innerAngle:C3$jscomp$244.toRadians(e),outerAngle:C3$jscomp$244.toRadians(g),outerGain:this.DbToLinear(k),uid:d.GetUID()}})}finally{E&&(E.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayByName(a,b,c,d,e,g){if(!this._isSilent){a=1===a;var k=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b)||this._remoteUrls.get(b.toLowerCase());if(k){var l=this._nextPlayTime; this._nextPlayTime=0;var n=this._MaybeMarkAsPlaying(b,g,a,0!==c,this.DbToLinear(d));try{await this.PostToDOMAsync("play",{originalUrl:b,url:k.url,type:k.type,isMusic:a,tags:this._SplitTags(g),isLooping:0!==c,vol:this.DbToLinear(d),stereoPan:C3$jscomp$244.clamp(e/100,-1,1),pos:0,off:l,trueClock:!!self.C3_GetAudioContextCurrentTime})}finally{n&&(n.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtPositionByName(a,b,c,d,e,g,k,l,n,p,r,w){if(!this._isSilent){a=1===a;var y=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b)|| this._remoteUrls.get(b.toLowerCase());if(y){var B=this._nextPlayTime;this._nextPlayTime=0;var C=this._MaybeMarkAsPlaying(b,w,a,0!==c,this.DbToLinear(d));try{await this.PostToDOMAsync("play",{originalUrl:b,url:y.url,type:y.type,isMusic:a,tags:this._SplitTags(w),isLooping:0!==c,vol:this.DbToLinear(d),pos:0,off:B,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:e,y:g,z:k,angle:C3$jscomp$244.toRadians(l),innerAngle:C3$jscomp$244.toRadians(n),outerAngle:C3$jscomp$244.toRadians(p),outerGain:this.DbToLinear(r)}})}finally{C&& (C.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtObjectByName(a,b,c,d,e,g,k,l,n){if(!this._isSilent&&!this._isSilent&&e&&(e=e.GetFirstPicked())&&e.GetWorldInfo()){var p=e.GetWorldInfo(),r=p.GetLayer().GetAngle(),[w,y]=this.rotatePtAround(p.GetX(),p.GetY(),-r,this._listenerPos[0],this._listenerPos[1]);a=1===a;var B=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b)||this._remoteUrls.get(b.toLowerCase());if(B){var C=this._nextPlayTime;this._nextPlayTime=0;var E=this._MaybeMarkAsPlaying(b, n,a,0!==c,this.DbToLinear(d));try{await this.PostToDOMAsync("play",{originalUrl:b,url:B.url,type:B.type,isMusic:a,tags:this._SplitTags(n),isLooping:0!==c,vol:this.DbToLinear(d),pos:0,off:C,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:w,y,z:p.GetTotalZElevation(),angle:p.GetAngle()-r,innerAngle:C3$jscomp$244.toRadians(g),outerAngle:C3$jscomp$244.toRadians(k),outerGain:this.DbToLinear(l),uid:e.GetUID()}})}finally{E&&(E.placeholder=this._runtime.GetTickCountNoSave())}}}},SetLooping(a,b){this.PostToDOM("set-looping", {tags:this._SplitTags(a),isLooping:0===b})},SetMuted(a,b){this.PostToDOM("set-muted",{tags:this._SplitTags(a),isMuted:0===b})},SetVolume(a,b){this.PostToDOM("set-volume",{tags:this._SplitTags(a),vol:this.DbToLinear(b)})},FadeVolume(a,b,c,d){this.PostToDOM("fade-volume",{tags:this._SplitTags(a),vol:this.DbToLinear(b),duration:c,stopOnEnd:0===d})},SetStereoPan(a,b){this.PostToDOM("set-stereo-pan",{tags:this._SplitTags(a),p:C3$jscomp$244.clamp(b/100,-1,1)})},async Preload(a){const b=a[1],c=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]); c&&(this._preloadTotal++,await this.PostToDOMAsync("preload",{originalUrl:a[0],url:c.url,type:c.type,isMusic:b}),this._preloadCount++)},async PreloadByName(a,b){a=1===a;const c=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b)||this._remoteUrls.get(b.toLowerCase());c&&(this._preloadTotal++,await this.PostToDOMAsync("preload",{originalUrl:b,url:c.url,type:c.type,isMusic:a}),this._preloadCount++)},SetPlaybackRate(a,b){this.PostToDOM("set-playback-rate",{tags:this._SplitTags(a),rate:Math.max(b, 0)})},Stop(a){this.PostToDOM("stop",{tags:this._SplitTags(a)})},StopAll(){this.PostToDOM("stop-all")},SetPaused(a,b){this.PostToDOM("set-paused",{tags:this._SplitTags(a),paused:0===b})},Seek(a,b){this.PostToDOM("seek",{tags:this._SplitTags(a),pos:b})},SetSilent(a){2===a&&(a=this._isSilent?1:0);a=0===a;this._isSilent!==a&&(this._isSilent=a,this.PostToDOM("set-silent",{isSilent:a}))},SetMasterVolume(a){a=this.DbToLinear(a);this._masterVolume!==a&&(this._masterVolume=a,this.PostToDOM("set-master-volume", {vol:a}))},AddFilterEffect(a,b,c,d,e,g,k){b=FILTER_TYPES[b];this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"filter",tags:this._SplitTags(a),params:[b,c,d,e,g,C3$jscomp$244.clamp(k/100,0,1)]})},AddDelayEffect(a,b,c,d){this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"delay",tags:this._SplitTags(a),params:[b,this.DbToLinear(c),C3$jscomp$244.clamp(d/100,0,1)]})},AddFlangerEffect(a,b,c,d,e,g){this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"flanger",tags:this._SplitTags(a), params:[b/1E3,c/1E3,d,e/100,C3$jscomp$244.clamp(g/100,0,1)]})},AddPhaserEffect(a,b,c,d,e,g,k){this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"phaser",tags:this._SplitTags(a),params:[b,c,d,e,g,C3$jscomp$244.clamp(k/100,0,1)]})},AddConvolutionEffect(a,b,c,d){const e=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b[0]);e&&(this._IncrementEffectCount(a),this.PostToDOM("add-effect",{type:"convolution",tags:this._SplitTags(a),bufferOriginalUrl:b[0],bufferUrl:e.url,bufferType:e.type, params:[0===c,C3$jscomp$244.clamp(d/100,0,1)]}))},AddGainEffect(a,b){this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"gain",tags:this._SplitTags(a),params:[this.DbToLinear(b)]})},AddStereoPanEffect(a,b){this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"stereopan",tags:this._SplitTags(a),params:[C3$jscomp$244.clamp(b/100,-1,1)]})},AddMuteEffect(a){this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"gain",tags:this._SplitTags(a),params:[0]})},AddTremoloEffect(a, b,c){this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"tremolo",tags:this._SplitTags(a),params:[b,C3$jscomp$244.clamp(c/100,0,1)]})},AddRingModEffect(a,b,c){this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"ringmod",tags:this._SplitTags(a),params:[b,C3$jscomp$244.clamp(c/100,0,1)]})},AddDistortionEffect(a,b,c,d,e,g){this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"distortion",tags:this._SplitTags(a),params:[this.DbToLinearNoCap(b),this.DbToLinearNoCap(c), d,this.DbToLinearNoCap(e),C3$jscomp$244.clamp(g/100,0,1)]})},AddCompressorEffect(a,b,c,d,e,g){this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"compressor",tags:this._SplitTags(a),params:[b,c,d,e/1E3,g/1E3]})},AddAnalyserEffect(a,b,c){this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"analyser",tags:this._SplitTags(a),params:[b,c]})},RemoveEffects(a){a=this._SplitTags(a);for(const b of a)this._effectCount.set(b.toLowerCase(),0);this.PostToDOM("remove-effects",{tags:a}); this._lastFxState={}},SetEffectParameter(a,b,c,d,e,g){this.PostToDOM("set-effect-param",{tags:this._SplitTags(a),index:Math.floor(b),param:c,value:d,ramp:e,time:g})},SetListenerObject(a){a&&(a=a.GetFirstPicked())&&a.GetWorldInfo()&&(this._listenerInst=a)},SetListenerZ(a){this._listenerPos[2]=a},SetListenerOrientation(a,b,c,d,e,g){this._listenerForwardVec[0]=a;this._listenerForwardVec[1]=b;this._listenerForwardVec[2]=-c;this._listenerUpVec[0]=d;this._listenerUpVec[1]=e;this._listenerUpVec[2]=-g},ScheduleNextPlay(a){this._nextPlayTime= Math.max(a,0)},UnloadAudio(a){const b=a[1];(a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]))&&this.PostToDOM("unload",{url:a.url,type:a.type,isMusic:b})},UnloadAudioByName(a,b){a=1===a;(b=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b)||this._remoteUrls.get(b.toLowerCase()))&&this.PostToDOM("unload",{url:b.url,type:b.type,isMusic:a})},UnloadAll(){this.PostToDOM("unload-all")},AddRemoteURL(a,b,c){this._remoteUrls.set(c.toLowerCase(),{url:a,type:b})}}; self.C3.Plugins.Audio.Exps={Duration(a){return(a=this._GetFirstAudioStateByTags(a))?a.duration:0},PlaybackTime(a){return(a=this._GetFirstAudioStateByTags(a))?a.playbackTime:0},PlaybackRate(a){return(a=this._GetFirstAudioStateByTags(a))?a.playbackRate:0},Volume(a){return(a=this._GetFirstAudioStateByTags(a))?this.LinearToDb(a.volume):0},MasterVolume(){return this.LinearToDb(this._masterVolume)},EffectCount(a){return this._effectCount.get(a.toLowerCase())||0},AnalyserFreqBinCount(a,b){return(a=this.GetAnalyserData(a, Math.floor(b)))?a.binCount:0},AnalyserFreqBinAt(a,b,c){a=this.GetAnalyserData(a,Math.floor(b));if(!a)return 0;c=Math.floor(c);return 0>c||c>=a.binCount?0:a.freqBins[c]},AnalyserPeakLevel(a,b){return(a=this.GetAnalyserData(a,Math.floor(b)))?a.peak:0},AnalyserRMSLevel(a,b){return(a=this.GetAnalyserData(a,Math.floor(b)))?a.rms:0},SampleRate(){return this._sampleRate},CurrentTime(){return self.C3_GetAudioContextCurrentTime?self.C3_GetAudioContextCurrentTime():performance.now()/1E3},OutputLatency(){return this._outputLatency}}; "use strict";const C3$jscomp$246=self.C3;C3$jscomp$246.Plugins.Browser=class extends C3$jscomp$246.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$247=self.C3;C3$jscomp$247.Plugins.Browser.Type=class extends C3$jscomp$247.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};const C3$jscomp$248=self.C3; C3$jscomp$248.Plugins.Browser.Instance=class extends C3$jscomp$248.SDKInstanceBase{constructor(a,b){super(a,"browser");this._initLocationStr="";this._isOnline=!1;this._docTitle=this._referrer="";this._isCookieEnabled=!1;this._windowOuterHeight=this._windowOuterWidth=this._screenHeight=this._screenWidth=0;this._isConstructArcade=!1;this._cssStyleMap=new Map;this.AddDOMMessageHandlers([["online-state",c=>this._OnOnlineStateChanged(c)],["backbutton",()=>this._OnBackButton()],["sw-message",c=>this._OnSWMessage(c)], ["hashchange",c=>this._OnHashChange(c)]]);a=this.GetRuntime().Dispatcher();this._disposables=new C3$jscomp$248.CompositeDisposable(C3$jscomp$248.Disposable.From(a,"afterfirstlayoutstart",()=>this._OnAfterFirstLayoutStart()),C3$jscomp$248.Disposable.From(a,"window-resize",()=>this._OnWindowResize()),C3$jscomp$248.Disposable.From(a,"suspend",()=>this._OnSuspend()),C3$jscomp$248.Disposable.From(a,"resume",()=>this._OnResume()));this._runtime.AddLoadPromise(this.PostToDOMAsync("get-initial-state",{exportType:this._runtime.GetExportType()}).then(c=> {this._initLocationStr=c.location;this._isOnline=c.isOnline;this._referrer=c.referrer;this._docTitle=c.title;this._isCookieEnabled=c.isCookieEnabled;this._screenWidth=c.screenWidth;this._screenHeight=c.screenHeight;this._windowOuterWidth=c.windowOuterWidth;this._windowOuterHeight=c.windowOuterHeight;this._isConstructArcade=c.isConstructArcade}))}Release(){super.Release()}_OnAfterFirstLayoutStart(){this.PostToDOM("ready-for-sw-messages")}async _OnOnlineStateChanged(a){a=!!a.isOnline;this._isOnline!== a&&((this._isOnline=a)?await this.TriggerAsync(C3$jscomp$248.Plugins.Browser.Cnds.OnOnline):await this.TriggerAsync(C3$jscomp$248.Plugins.Browser.Cnds.OnOffline))}async _OnWindowResize(){await this.TriggerAsync(C3$jscomp$248.Plugins.Browser.Cnds.OnResize)}_OnSuspend(){this.Trigger(C3$jscomp$248.Plugins.Browser.Cnds.OnPageHidden)}_OnResume(){this.Trigger(C3$jscomp$248.Plugins.Browser.Cnds.OnPageVisible)}async _OnBackButton(){await this.TriggerAsync(C3$jscomp$248.Plugins.Browser.Cnds.OnBackButton)}_OnSWMessage(a){a= a.type;"downloading-update"===a?this.Trigger(C3$jscomp$248.Plugins.Browser.Cnds.OnUpdateFound):"update-ready"===a||"update-pending"===a?this.Trigger(C3$jscomp$248.Plugins.Browser.Cnds.OnUpdateReady):"offline-ready"===a&&this.Trigger(C3$jscomp$248.Plugins.Browser.Cnds.OnOfflineReady)}_OnHashChange(a){this._initLocationStr=a.location;this.Trigger(C3$jscomp$248.Plugins.Browser.Cnds.OnHashChange)}GetDebuggerProperties(){return[{title:"plugins.browser.name",properties:[{name:"plugins.browser.debugger.user-agent", value:navigator.userAgent},{name:"plugins.browser.debugger.is-online",value:this._isOnline},{name:"plugins.browser.debugger.is-fullscreen",value:this._runtime.GetCanvasManager().IsDocumentFullscreen()}]}]}}; self.C3.Plugins.Browser.Cnds={IsOnline(){return this._isOnline},OnOnline(){return!0},OnOffline(){return!0},OnResize(){return!0},CookiesEnabled(){return this._isCookieEnabled},IsFullscreen(){return this._runtime.GetCanvasManager().IsDocumentFullscreen()},OnBackButton(){return!0},IsPortraitLandscape(a){const b=this._runtime.GetCanvasManager().GetLastWidth(),c=this._runtime.GetCanvasManager().GetLastHeight();return(b<=c?0:1)===a},OnUpdateFound(){return!0},OnUpdateReady(){return!0},OnOfflineReady(){return!0}, OnHashChange(){return!0},PageVisible(){return!this._runtime.IsSuspended()},OnPageHidden(){return!0},OnPageVisible(){return!0},HasJava(){return!1},IsDownloadingUpdate(){return!1},OnMenuButton(){return!1},OnSearchButton(){return!1},IsMetered(){return!1},IsCharging(){return!0},SupportsFullscreen(){return!0}};const C3$jscomp$250=self.C3,ORIENTATIONS="portrait landscape portrait-primary portrait-secondary landscape-primary landscape-secondary".split(" "); C3$jscomp$250.Plugins.Browser.Acts={Alert(a){this.PostToDOM("alert",{message:a.toString()})},Close(){this._isConstructArcade||(this._runtime.IsDebug()?self.C3Debugger.CloseWindow():this.PostToDOM("close"))},Focus(){this.PostToDOM("set-focus",{isFocus:!0})},Blur(){this.PostToDOM("set-focus",{isFocus:!1})},GoBack(){this._isConstructArcade||this.PostToDOM("navigate",{type:"back"})},GoForward(){this._isConstructArcade||this.PostToDOM("navigate",{type:"forward"})},GoHome(){},Reload(){this._isConstructArcade|| (this._runtime.IsDebug()?this._runtime.PostToDebugger({type:"reload"}):this.PostToDOM("navigate",{type:"reload"}))},GoToURL(a,b){this._PostToDOMMaybeSync("navigate",{type:"url",url:a,target:b,exportType:this._runtime.GetExportType()})},GoToURLWindow(a,b){this._PostToDOMMaybeSync("navigate",{type:"new-window",url:a,tag:b,exportType:this._runtime.GetExportType()})},RequestFullScreen(a,b){2<=a&&(a+=1);6===a&&(a=2);1===a&&(a=0);a=C3$jscomp$250.CanvasManager._FullscreenModeNumberToString(a);this._runtime.GetCanvasManager().SetDocumentFullscreenMode(a); this._PostToDOMMaybeSync("request-fullscreen",{navUI:b})},CancelFullScreen(){this._PostToDOMMaybeSync("exit-fullscreen")},Vibrate(a){a=a.split(",");for(let b=0,c=a.length;b<c;++b)a[b]=parseInt(a[b],10);this._PostToDOMMaybeSync("vibrate",{pattern:a})},async InvokeDownload(a,b){a&&b&&(a=await this._runtime.GetAssetManager().GetProjectFileUrl(a),this._runtime.InvokeDownload(a,b))},InvokeDownloadString(a,b,c){c&&(a=`data:${b},${encodeURIComponent(a)}`,this._runtime.InvokeDownload(a,c))},ConsoleLog(a, b){b=b.toString();0===a?console.log(b):1===a?console.warn(b):2===a&&console.error(b)},ConsoleGroup(a){console.group(a)},ConsoleGroupEnd(){console.groupEnd()},ExecJs(a){try{eval(a)}catch(b){console.error("Error executing JavaScript: ",b)}},LockOrientation(a){a=Math.floor(a);0>a||a>=ORIENTATIONS.length||this._PostToDOMMaybeSync("lock-orientation",{orientation:ORIENTATIONS[a]})},UnlockOrientation(){this._PostToDOMMaybeSync("unlock-orientation")},LoadStyleSheet(a){this._runtime.GetAssetManager().LoadStyleSheet(a)}, async SetDocumentCSSStyle(a,b,c,d){await this.PostToDOMAsync("set-document-css-style",{prop:C3$jscomp$250.CSSToCamelCase(a),value:b,selector:c,"is-all":0!==d})},async GetDocumentCSSStyle(a,b,c){a=await this.PostToDOMAsync("get-document-css-style",{prop:a,selector:b});a.isOk&&this._cssStyleMap.set(c.toLowerCase(),a.result.trim())},SetHash(a){this.PostToDOM("set-hash",{hash:a})}}; self.C3.Plugins.Browser.Exps={URL(){return this._runtime.IsInWorker()?this._initLocationStr:location.toString()},Protocol(){return this._runtime.IsInWorker()?(new URL(this._initLocationStr)).protocol:location.protocol},Domain(){return this._runtime.IsInWorker()?(new URL(this._initLocationStr)).hostname:location.hostname},Port(){return this._runtime.IsInWorker()?(new URL(this._initLocationStr)).port:location.port},PathName(){return this._runtime.IsInWorker()?(new URL(this._initLocationStr)).pathname: location.pathname},Hash(){return this._runtime.IsInWorker()?(new URL(this._initLocationStr)).hash:location.hash},QueryString(){return this._runtime.IsInWorker()?(new URL(this._initLocationStr)).search:location.search},QueryParam(a){const b=this._runtime.IsInWorker()?(new URL(this._initLocationStr)).search:location.search;return(a=RegExp("[?&]"+a+"=([^&]*)").exec(b))?decodeURIComponent(a[1].replace(/\+/g," ")):""},Referrer(){return this._referrer},Title(){return this._docTitle},Language(){return navigator.language}, Platform(){return navigator.platform},UserAgent(){return navigator.userAgent},ExecJS(a){let b=0;try{b=eval(a)}catch(c){console.error("Error executing JavaScript: ",c)}return"number"===typeof b||"string"===typeof b?b:"boolean"===typeof b?b?1:0:0},CSSStyleValue(a){return this._cssStyleMap.get(a)||""},Name(){return navigator.appName},Version(){return navigator.appVersion},Product(){return navigator.product},Vendor(){return navigator.vendor},BatteryLevel(){return 1},BatteryTimeLeft(){return Infinity}, Bandwidth(){const a=navigator.connection;return a?a.downlink||a.downlinkMax||a.bandwidth||Infinity:Infinity},ConnectionType(){const a=navigator.connection;return a?a.type||"unknown":"unknown"},DevicePixelRatio(){return self.devicePixelRatio},ScreenWidth(){return this._screenWidth},ScreenHeight(){return this._screenHeight},WindowInnerWidth(){return this._runtime.GetCanvasManager().GetLastWidth()},WindowInnerHeight(){return this._runtime.GetCanvasManager().GetLastHeight()},WindowOuterWidth(){return this._windowOuterWidth}, WindowOuterHeight(){return this._windowOuterWidth}};"use strict";const C3$jscomp$252=self.C3;C3$jscomp$252.Plugins.Keyboard=class extends C3$jscomp$252.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$253=self.C3;C3$jscomp$253.Plugins.Keyboard.Type=class extends C3$jscomp$253.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.IKeyboardObjectType}};let keyboardObjectType=null; function GetKeyboardSdkInstance(){return keyboardObjectType.GetSingleGlobalInstance().GetSdkInstance()}self.IKeyboardObjectType=class extends self.IObjectClass{constructor(a){super(a);keyboardObjectType=a;a.GetRuntime()._GetCommonScriptInterfaces().keyboard=this}isKeyDown(a){const b=GetKeyboardSdkInstance();if("string"===typeof a)return b.IsKeyDown(a);if("number"===typeof a)return b.IsKeyCodeDown(a);throw new TypeError("expected string or number");}};const C3$jscomp$254=self.C3; C3$jscomp$254.Plugins.Keyboard.Instance=class extends C3$jscomp$254.SDKInstanceBase{constructor(a,b){super(a);this._keysDownByString=new Set;this._keysDownByWhich=new Set;this._triggerWhich=0;this._triggerTypedKey=this._triggerString="";a=this.GetRuntime().Dispatcher();this._disposables=new C3$jscomp$254.CompositeDisposable(C3$jscomp$254.Disposable.From(a,"keydown",c=>this._OnKeyDown(c.data)),C3$jscomp$254.Disposable.From(a,"keyup",c=>this._OnKeyUp(c.data)),C3$jscomp$254.Disposable.From(a,"window-blur", ()=>this._OnWindowOrKeyboardBlur()),C3$jscomp$254.Disposable.From(a,"keyboard-blur",()=>this._OnWindowOrKeyboardBlur()))}Release(){super.Release()}_OnKeyDown(a){const b=a.which,c=a.code||b.toString();a=a.key;this._keysDownByString.has(c)||(this._keysDownByString.add(c),this._keysDownByWhich.add(b),this._triggerString=c,this._triggerWhich=b,this._triggerTypedKey=a,this.Trigger(C3$jscomp$254.Plugins.Keyboard.Cnds.OnAnyKey),this.Trigger(C3$jscomp$254.Plugins.Keyboard.Cnds.OnKey),this.Trigger(C3$jscomp$254.Plugins.Keyboard.Cnds.OnLeftRightKeyPressed), this.Trigger(C3$jscomp$254.Plugins.Keyboard.Cnds.OnKeyCode))}_OnKeyUp(a){const b=a.which,c=a.code||b.toString();a=a.key;this._keysDownByString.delete(c);this._keysDownByWhich.delete(b);this._triggerString=c;this._triggerWhich=b;this._triggerTypedKey=a;this.Trigger(C3$jscomp$254.Plugins.Keyboard.Cnds.OnAnyKeyReleased);this.Trigger(C3$jscomp$254.Plugins.Keyboard.Cnds.OnKeyReleased);this.Trigger(C3$jscomp$254.Plugins.Keyboard.Cnds.OnLeftRightKeyReleased);this.Trigger(C3$jscomp$254.Plugins.Keyboard.Cnds.OnKeyCodeReleased)}_OnWindowOrKeyboardBlur(){for(const a of this._keysDownByWhich)this._keysDownByWhich.delete(a), this._triggerWhich=a,this.Trigger(C3$jscomp$254.Plugins.Keyboard.Cnds.OnAnyKeyReleased),this.Trigger(C3$jscomp$254.Plugins.Keyboard.Cnds.OnKeyReleased),this.Trigger(C3$jscomp$254.Plugins.Keyboard.Cnds.OnKeyCodeReleased);this._keysDownByString.clear()}IsKeyDown(a){return this._keysDownByString.has(a)}IsKeyCodeDown(a){return this._keysDownByWhich.has(a)}SaveToJson(){return{tk:this._triggerWhich,tkk:this._triggerTypedKey}}LoadFromJson(a){this._triggerWhich=a.tk;a.hasOwnProperty("tkk")&&(this._triggerTypedKey= a.tkk)}GetDebuggerProperties(){return[{title:"plugins.keyboard.name",properties:[{name:"plugins.keyboard.debugger.last-key-code",value:this._triggerWhich},{name:"plugins.keyboard.debugger.last-key-string",value:C3$jscomp$254.Plugins.Keyboard.Exps.StringFromKeyCode(this._triggerWhich)},{name:"plugins.keyboard.debugger.last-typed-key",value:this._triggerTypedKey}]}]}};const LEFTRIGHT_KEY_STRINGS="ShiftLeft ShiftRight ControlLeft ControlRight AltLeft AltRight MetaLeft MetaRight".split(" "); self.C3.Plugins.Keyboard.Cnds={IsKeyDown(a){return this._keysDownByWhich.has(a)},OnKey(a){return this._triggerWhich===a},OnAnyKey(){return!0},OnAnyKeyReleased(){return!0},OnKeyReleased(a){return this._triggerWhich===a},IsKeyCodeDown(a){a=Math.floor(a);return this._keysDownByWhich.has(a)},OnKeyCode(a){return this._triggerWhich===a},OnKeyCodeReleased(a){return this._triggerWhich===a},OnLeftRightKeyPressed(a){return this._triggerString===LEFTRIGHT_KEY_STRINGS[a]},OnLeftRightKeyReleased(a){return this._triggerString=== LEFTRIGHT_KEY_STRINGS[a]},IsLeftRightKeyDown(a){return this._keysDownByString.has(LEFTRIGHT_KEY_STRINGS[a])}};self.C3.Plugins.Keyboard.Acts={}; function StringFromCharCode(a){a=Math.floor(a);switch(a){case 8:return"backspace";case 9:return"tab";case 13:return"enter";case 16:return"shift";case 17:return"control";case 18:return"alt";case 19:return"pause";case 20:return"capslock";case 27:return"esc";case 33:return"pageup";case 34:return"pagedown";case 35:return"end";case 36:return"home";case 37:return"\u2190";case 38:return"\u2191";case 39:return"\u2192";case 40:return"\u2193";case 45:return"insert";case 46:return"del";case 91:return"left window key"; case 92:return"right window key";case 93:return"select";case 96:return"numpad 0";case 97:return"numpad 1";case 98:return"numpad 2";case 99:return"numpad 3";case 100:return"numpad 4";case 101:return"numpad 5";case 102:return"numpad 6";case 103:return"numpad 7";case 104:return"numpad 8";case 105:return"numpad 9";case 106:return"numpad *";case 107:return"numpad +";case 109:return"numpad -";case 110:return"numpad .";case 111:return"numpad /";case 112:return"F1";case 113:return"F2";case 114:return"F3"; case 115:return"F4";case 116:return"F5";case 117:return"F6";case 118:return"F7";case 119:return"F8";case 120:return"F9";case 121:return"F10";case 122:return"F11";case 123:return"F12";case 144:return"numlock";case 145:return"scroll lock";case 186:return";";case 187:return"=";case 188:return",";case 189:return"-";case 190:return".";case 191:return"/";case 192:return"'";case 219:return"[";case 220:return"\\";case 221:return"]";case 222:return"#";case 223:return"`";default:return String.fromCharCode(a)}} self.C3.Plugins.Keyboard.Exps={LastKeyCode(){return this._triggerWhich},StringFromKeyCode(a){return StringFromCharCode(a)},TypedKey(){return this._triggerTypedKey}};"use strict";const C3$jscomp$258=self.C3;C3$jscomp$258.Plugins.LocalStorage=class extends C3$jscomp$258.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$259=self.C3;C3$jscomp$259.Plugins.LocalStorage.Type=class extends C3$jscomp$259.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}}; const C3$jscomp$260=self.C3; C3$jscomp$260.Plugins.LocalStorage.Instance=class extends C3$jscomp$260.SDKInstanceBase{constructor(a,b){super(a);this._lastValue=this._currentKey="";this._keyNamesList=[];this._errorMessage="";this._pendingSets=this._pendingGets=0;this._storage=this._runtime._GetProjectStorage();this._debugCache=new Map;this._isLoadingDebugCache=!1}Release(){super.Release()}async _TriggerStorageError(a){this._errorMessage=this._GetErrorString(a);await this.TriggerAsync(C3$jscomp$260.Plugins.LocalStorage.Cnds.OnError)}_GetErrorString(a){return a?"string"=== typeof a?a:"string"===typeof a.message?a.message:"string"===typeof a.name?a.name:"string"===typeof a.data?a.data:"unknown error":"unknown error"}GetDebuggerProperties(){this._isLoadingDebugCache||this._DebugCacheStorage();return[{title:"plugins.localstorage.name",properties:[...this._debugCache.entries()].map(a=>({name:"$"+a[0],value:a[1],onedit:b=>this._storage.setItem(a[0],b)}))}]}async _DebugCacheStorage(){this._isLoadingDebugCache=!0;try{const a=await this._storage.keys();a.sort((c,d)=>{c=c.toLowerCase(); d=d.toLowerCase();return c<d?-1:d<c?1:0});const b=await Promise.all(a.map(c=>this._storage.getItem(c)));this._debugCache.clear();for(let c=0,d=a.length;c<d;++c)this._debugCache.set(a[c],b[c])}catch(a){console.warn("[C3 debugger] Error displaying local storage: ",a)}finally{this._isLoadingDebugCache=!1}}};const C3$jscomp$261=self.C3; C3$jscomp$261.Plugins.LocalStorage.Cnds={OnItemSet(a){return this._currentKey===a},OnAnyItemSet(){return!0},OnItemGet(a){return this._currentKey===a},OnAnyItemGet(){return!0},OnItemRemoved(a){return this._currentKey===a},OnAnyItemRemoved(){return!0},OnCleared(){return!0},OnAllKeyNamesLoaded(){return!0},OnError(){return!0},OnItemExists(a){return this._currentKey===a},OnItemMissing(a){return this._currentKey===a},CompareKey(a,b){return C3$jscomp$261.compare(this._currentKey,a,b)},CompareValue(a,b){return C3$jscomp$261.compare(this._lastValue, a,b)},IsProcessingSets(){return 0<this._pendingSets},IsProcessingGets(){return 0<this._pendingGets},OnAllSetsComplete(){return!0},OnAllGetsComplete(){return!0}};const C3$jscomp$262=self.C3;function IsExpressionType(a){return"string"===typeof a||"number"===typeof a} C3$jscomp$262.Plugins.LocalStorage.Acts={async SetItem(a,b){this._pendingSets++;try{const c=await this._storage.setItem(a,b);await this.ScheduleTriggers(async()=>{this._currentKey=a;this._lastValue=c;await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnAnyItemSet);await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnItemSet)})}catch(c){await this._TriggerStorageError(c)}finally{this._pendingSets--,0===this._pendingSets&&await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnAllSetsComplete)}}, async SetBinaryItem(a,b){if(b&&(b=b.GetFirstPicked(this._inst))&&(b=b.GetSdkInstance())){b=b.GetArrayBufferReadOnly();this._pendingSets++;try{await this._storage.setItem(a,b),await this.ScheduleTriggers(async()=>{this._currentKey=a;this._lastValue="";await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnAnyItemSet);await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnItemSet)})}catch(c){await this._TriggerStorageError(c)}finally{this._pendingSets--,0===this._pendingSets&& await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnAllSetsComplete)}}},async GetItem(a){this._pendingGets++;try{const b=await this._storage.getItem(a);await this.ScheduleTriggers(async()=>{this._currentKey=a;this._lastValue=IsExpressionType(b)?b:"";await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnAnyItemGet);await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnItemGet)})}catch(b){await this._TriggerStorageError(b)}finally{this._pendingGets--,0===this._pendingGets&& await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnAllGetsComplete)}},async GetBinaryItem(a,b){if(b&&(b=b.GetFirstPicked(this._inst))){var c=b.GetSdkInstance();this._pendingGets++;try{let d=await this._storage.getItem(a);d=d instanceof ArrayBuffer?d:new ArrayBuffer(0);await this.ScheduleTriggers(async()=>{this._lastValue="";this._currentKey=a;c.SetArrayBufferTransfer(d);await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnAnyItemGet);await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnItemGet)})}catch(d){await this._TriggerStorageError(d)}finally{this._pendingGets--, 0===this._pendingGets&&await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnAllGetsComplete)}}},async CheckItemExists(a){try{const b=await this._storage.getItem(a);await this.ScheduleTriggers(async()=>{this._currentKey=a;"undefined"===typeof b||null===b?(this._lastValue="",await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnItemMissing)):(this._lastValue=IsExpressionType(b)?b:"",await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnItemExists))})}catch(b){await this._TriggerStorageError(b)}}, async RemoveItem(a){try{await this._storage.removeItem(a),await this.ScheduleTriggers(async()=>{this._currentKey=a;this._lastValue="";await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnAnyItemRemoved);await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnItemRemoved)})}catch(b){await this._TriggerStorageError(b)}},async ClearStorage(){try{await this._storage.clear(),await this.ScheduleTriggers(async()=>{this._lastValue=this._currentKey="";C3$jscomp$262.clearArray(this._keyNamesList); await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnCleared)})}catch(a){await this._TriggerStorageError(a)}},async GetAllKeyNames(){try{const a=await this._storage.keys();await this.ScheduleTriggers(async()=>{this._keyNamesList=a;await this.TriggerAsync(C3$jscomp$262.Plugins.LocalStorage.Cnds.OnAllKeyNamesLoaded)})}catch(a){await this._TriggerStorageError(a)}}}; self.C3.Plugins.LocalStorage.Exps={ItemValue(){return this._lastValue},Key(){return this._currentKey},KeyCount(){return this._keyNamesList.length},KeyAt(a){a=Math.floor(a);return 0>a||a>=this._keyNamesList.length?"":this._keyNamesList[a]},ErrorMessage(){return this._errorMessage}};"use strict";const C3$jscomp$264=self.C3;C3$jscomp$264.Plugins.Mouse=class extends C3$jscomp$264.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$265=self.C3,C3X$jscomp$26=self.C3X; C3$jscomp$265.Plugins.Mouse.Type=class extends C3$jscomp$265.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.IMouseObjectType}};let mouseObjectType=null;function GetMouseSdkInstance(){return mouseObjectType.GetSingleGlobalInstance().GetSdkInstance()} self.IMouseObjectType=class extends self.IObjectClass{constructor(a){super(a);mouseObjectType=a;a.GetRuntime()._GetCommonScriptInterfaces().mouse=this}getMouseX(a){return GetMouseSdkInstance().GetMousePositionForLayer(a)[0]}getMouseY(a){return GetMouseSdkInstance().GetMousePositionForLayer(a)[1]}getMousePosition(a){return GetMouseSdkInstance().GetMousePositionForLayer(a)}isMouseButtonDown(a){return GetMouseSdkInstance().IsMouseButtonDown(a)}setCursorStyle(a){C3X$jscomp$26.RequireString(a);GetMouseSdkInstance().SetCursorStyle(a)}setCursorObjectClass(a){const b= GetMouseSdkInstance();a=b.GetRuntime()._UnwrapIObjectClass(a);b.SetCursorObjectClass(a)}};const C3$jscomp$266=self.C3;let lastSetCursor=null; C3$jscomp$266.Plugins.Mouse.Instance=class extends C3$jscomp$266.SDKInstanceBase{constructor(a,b){super(a,"mouse");this._buttonMap=[!1,!1,!1];this._wheelDeltaZ=this._wheelDeltaY=this._wheelDeltaX=this._triggerDir=this._triggerType=this._triggerButton=this._mouseYcanvas=this._mouseXcanvas=0;this._hasPointerLock=!1;this._movementY=this._movementX=0;this.AddDOMMessageHandlers([["pointer-lock-change",c=>this._OnPointerLockChange(c)],["pointer-lock-error",c=>this._OnPointerLockError(c)]]);a=this.GetRuntime().Dispatcher(); this._disposables=new C3$jscomp$266.CompositeDisposable(C3$jscomp$266.Disposable.From(a,"pointermove",c=>this._OnPointerMove(c.data)),C3$jscomp$266.Disposable.From(a,"pointerdown",c=>this._OnPointerDown(c.data)),C3$jscomp$266.Disposable.From(a,"pointerup",c=>this._OnPointerUp(c.data)),C3$jscomp$266.Disposable.From(a,"dblclick",c=>this._OnDoubleClick(c.data)),C3$jscomp$266.Disposable.From(a,"wheel",c=>this._OnMouseWheel(c.data)),C3$jscomp$266.Disposable.From(a,"window-blur",()=>this._OnWindowBlur()))}Release(){super.Release()}_OnPointerDown(a){"mouse"=== a.pointerType&&(this._mouseXcanvas=a.pageX-this._runtime.GetCanvasClientX(),this._mouseYcanvas=a.pageY-this._runtime.GetCanvasClientY(),this._CheckButtonChanges(a.lastButtons,a.buttons))}_OnPointerMove(a){this._movementX=a.movementX;this._movementY=a.movementY;this.Trigger(C3$jscomp$266.Plugins.Mouse.Cnds.OnMovement);this._movementY=this._movementX=0;"mouse"===a.pointerType&&(this._mouseXcanvas=a.pageX-this._runtime.GetCanvasClientX(),this._mouseYcanvas=a.pageY-this._runtime.GetCanvasClientY(),this._CheckButtonChanges(a.lastButtons, a.buttons))}_OnPointerUp(a){"mouse"===a.pointerType&&this._CheckButtonChanges(a.lastButtons,a.buttons)}_CheckButtonChanges(a,b){this._CheckButtonChange(a,b,1,0);this._CheckButtonChange(a,b,4,1);this._CheckButtonChange(a,b,2,2)}_CheckButtonChange(a,b,c,d){!(a&c)&&b&c?this._OnMouseDown(d):a&c&&!(b&c)&&this._OnMouseUp(d)}_OnMouseDown(a){this._buttonMap[a]=!0;this.Trigger(C3$jscomp$266.Plugins.Mouse.Cnds.OnAnyClick);this._triggerButton=a;this._triggerType=0;this.Trigger(C3$jscomp$266.Plugins.Mouse.Cnds.OnClick); this.Trigger(C3$jscomp$266.Plugins.Mouse.Cnds.OnObjectClicked)}_OnMouseUp(a){this._buttonMap[a]&&(this._buttonMap[a]=!1,this._triggerButton=a,this.Trigger(C3$jscomp$266.Plugins.Mouse.Cnds.OnRelease))}_OnDoubleClick(a){this._triggerButton=a.button;this._triggerType=1;this.Trigger(C3$jscomp$266.Plugins.Mouse.Cnds.OnClick);this.Trigger(C3$jscomp$266.Plugins.Mouse.Cnds.OnObjectClicked)}_OnMouseWheel(a){this._triggerDir=0>a.deltaY?1:0;this._wheelDeltaX=a.deltaX;this._wheelDeltaY=a.deltaY;this._wheelDeltaZ= a.deltaZ;this.Trigger(C3$jscomp$266.Plugins.Mouse.Cnds.OnWheel)}_OnWindowBlur(){for(let a=0,b=this._buttonMap.length;a<b&&this._buttonMap[a];++a)this._buttonMap[a]=!1,this._triggerButton=a,this.Trigger(C3$jscomp$266.Plugins.Mouse.Cnds.OnRelease)}GetMousePositionForLayer(a){const b=this._runtime.GetMainRunningLayout(),c=this._mouseXcanvas,d=this._mouseYcanvas;return"undefined"===typeof a?b.GetLayerByIndex(0).CanvasCssToLayer_DefaultTransform(c,d):(a=b.GetLayer(a))?a.CanvasCssToLayer(c,d):[0,0]}IsMouseButtonDown(a){a= Math.floor(a);return!!this._buttonMap[a]}_IsMouseOverCanvas(){return 0<=this._mouseXcanvas&&0<=this._mouseYcanvas&&this._mouseXcanvas<this._runtime.GetCanvasCssWidth()&&this._mouseYcanvas<this._runtime.GetCanvasCssHeight()}SetCursorStyle(a){lastSetCursor!==a&&(lastSetCursor=a,this.PostToDOM("cursor",a))}async SetCursorObjectClass(a){if(!C3$jscomp$266.Platform.IsMobile&&a){var b=a.GetFirstPicked();b&&(a=b.GetWorldInfo(),b=b.GetCurrentImageInfo(),a&&b&&lastSetCursor!==b&&(lastSetCursor=b,a=`url(${await b.ExtractImageToBlobURL()}) ${Math.round(a.GetOriginX()* b.GetWidth())} ${Math.round(a.GetOriginY()*b.GetHeight())}, auto`,this.PostToDOM("cursor",a)))}}_OnPointerLockChange(a){this._UpdatePointerLockState(a["has-pointer-lock"])}_OnPointerLockError(a){this._UpdatePointerLockState(a["has-pointer-lock"]);this.Trigger(C3$jscomp$266.Plugins.Mouse.Cnds.OnPointerLockError)}_UpdatePointerLockState(a){this._hasPointerLock!==a&&((this._hasPointerLock=a)?this.Trigger(C3$jscomp$266.Plugins.Mouse.Cnds.OnPointerLocked):this.Trigger(C3$jscomp$266.Plugins.Mouse.Cnds.OnPointerUnlocked))}GetDebuggerProperties(){return[{title:"plugins.mouse.name", properties:[{name:"plugins.mouse.debugger.absolute-position",value:this._mouseXcanvas+","+this._mouseYcanvas},{name:"plugins.mouse.debugger.left-button",value:this._buttonMap[0]},{name:"plugins.mouse.debugger.middle-button",value:this._buttonMap[1]},{name:"plugins.mouse.debugger.right-button",value:this._buttonMap[2]}]},{title:"plugins.mouse.debugger.position-on-each-layer",properties:this._runtime.GetMainRunningLayout().GetLayers().map(a=>({name:"$"+a.GetName(),value:a.CanvasCssToLayer(this._mouseXcanvas, this._mouseYcanvas).join(", ")}))}]}};const C3$jscomp$267=self.C3; C3$jscomp$267.Plugins.Mouse.Cnds={OnClick(a,b){return this._triggerButton===a&&this._triggerType===b},OnAnyClick(){return!0},IsButtonDown(a){return this._buttonMap[a]},OnRelease(a){return this._triggerButton===a},IsOverObject(a){if(!this._IsMouseOverCanvas())return!1;const b=this._runtime.GetCurrentCondition().IsInverted(),c=this._mouseXcanvas,d=this._mouseYcanvas;return C3$jscomp$267.xor(this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(a,c,d,b),b)},OnObjectClicked(a,b,c){if(a!== this._triggerButton||b!==this._triggerType||!this._IsMouseOverCanvas())return!1;a=this._mouseXcanvas;b=this._mouseYcanvas;return this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(c,a,b,!1)},OnWheel(a){return 2===a||this._triggerDir===a},OnPointerLocked(){return!0},OnPointerUnlocked(){return!0},OnPointerLockError(){return!0},HasPointerLock(){return this._hasPointerLock},OnMovement(){return!0}};const CURSOR_STYLES="auto pointer text crosshair move help wait none".split(" "); self.C3.Plugins.Mouse.Acts={SetCursor(a){this.SetCursorStyle(CURSOR_STYLES[a])},SetCursorSprite(a){this.SetCursorObjectClass(a)},RequestPointerLock(){this._PostToDOMMaybeSync("request-pointer-lock")},ReleasePointerLock(){this.PostToDOM("release-pointer-lock")}}; self.C3.Plugins.Mouse.Exps={X(a){return this.GetMousePositionForLayer(a)[0]},Y(a){return this.GetMousePositionForLayer(a)[1]},AbsoluteX(){return this._mouseXcanvas},AbsoluteY(){return this._mouseYcanvas},MovementX(){return this._movementX},MovementY(){return this._movementY},WheelDeltaX(){return this._wheelDeltaX},WheelDeltaY(){return this._wheelDeltaY},WheelDeltaZ(){return this._wheelDeltaZ}};"use strict";const C3$jscomp$270=self.C3;C3$jscomp$270.Plugins.Touch=class extends C3$jscomp$270.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}}; const C3$jscomp$271=self.C3,C3X$jscomp$27=self.C3X;C3$jscomp$271.Plugins.Touch.Type=class extends C3$jscomp$271.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.ITouchObjectType}};let touchObjectType=null;function GetTouchSdkInstance(){return touchObjectType.GetSingleGlobalInstance().GetSdkInstance()} self.ITouchObjectType=class extends self.IObjectClass{constructor(a){super(a);touchObjectType=a;a.GetRuntime()._GetCommonScriptInterfaces().touch=this}requestPermission(a){C3X$jscomp$27.RequireString(a);const b=GetTouchSdkInstance();if("orientation"===a)return b._RequestPermission(0);if("motion"===a)return b._RequestPermission(1);throw Error("invalid type");}};const C3$jscomp$272=self.C3; C3$jscomp$272.Plugins.Touch.Instance=class extends C3$jscomp$272.SDKInstanceBase{constructor(a,b){super(a,"touch");this._touches=new Map;this._isMouseDown=this._useMouseInput=!1;this._getTouchIndex=this._curTouchY=this._curTouchX=this._triggerPermission=this._triggerId=this._triggerIndex=this._accWithGZ=this._accWithGY=this._accWithGX=this._accZ=this._accY=this._accX=this._orientGamma=this._orientBeta=this._orientAlpha=this._orientCompassHeading=0;this._permissionPromises=[];b&&(this._useMouseInput= b[0]);this.AddDOMMessageHandler("permission-result",c=>this._OnPermissionResult(c));a=this.GetRuntime().Dispatcher();this._disposables=new C3$jscomp$272.CompositeDisposable(C3$jscomp$272.Disposable.From(a,"pointerdown",c=>this._OnPointerDown(c.data)),C3$jscomp$272.Disposable.From(a,"pointermove",c=>this._OnPointerMove(c.data)),C3$jscomp$272.Disposable.From(a,"pointerup",c=>this._OnPointerUp(c.data,!1)),C3$jscomp$272.Disposable.From(a,"pointercancel",c=>this._OnPointerUp(c.data,!0)),C3$jscomp$272.Disposable.From(a, "deviceorientation",c=>this._OnDeviceOrientation(c.data)),C3$jscomp$272.Disposable.From(a,"deviceorientationabsolute",c=>this._OnDeviceOrientationAbsolute(c.data)),C3$jscomp$272.Disposable.From(a,"devicemotion",c=>this._OnDeviceMotion(c.data)),C3$jscomp$272.Disposable.From(a,"tick2",c=>this._OnTick2()))}Release(){this._touches.clear();super.Release()}_OnPointerDown(a){if("mouse"===a.pointerType)if(this._useMouseInput)this._isMouseDown=!0;else return;const b=a.pointerId;if(!this._touches.has(b)){var c= a.pageX-this._runtime.GetCanvasClientX();a=a.pageY-this._runtime.GetCanvasClientY();var d=performance.now(),e=this._touches.size;this._triggerIndex=e;this._triggerId=b;var g=C3$jscomp$272.New(C3$jscomp$272.Plugins.Touch.TouchInfo);g.Init(d,c,a,b,e);this._touches.set(b,g);this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnNthTouchStart);this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnTouchStart);this._curTouchX=c;this._curTouchY=a;this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnTouchObject)}}_OnPointerMove(a){if("mouse"!== a.pointerType||this._isMouseDown){var b=this._touches.get(a.pointerId);if(b){var c=performance.now();if(!(2>c-b.GetTime())){var d=a.pageX-this._runtime.GetCanvasClientX(),e=a.pageY-this._runtime.GetCanvasClientY();b.Update(c,d,e,a.width,a.height,a.pressure)}}}}_OnPointerUp(a,b){if("mouse"===a.pointerType)if(this._isMouseDown)this._isMouseDown=!1;else return;const c=performance.now();a=a.pointerId;const d=this._touches.get(a);d&&(this._triggerIndex=d.GetStartIndex(),this._triggerId=d.GetId(),this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnNthTouchEnd), this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnTouchEnd),b||(b=d.ShouldTriggerTap(c),"single-tap"===b?(this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnTapGesture),this._curTouchX=d.GetX(),this._curTouchY=d.GetY(),this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnTapGestureObject)):"double-tap"===b&&(this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnDoubleTapGesture),this._curTouchX=d.GetX(),this._curTouchY=d.GetY(),this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnDoubleTapGestureObject))),d.Release(), this._touches.delete(a))}_RequestPermission(a){this._PostToDOMMaybeSync("request-permission",{type:a});return new Promise((b,c)=>{this._permissionPromises.push({type:a,resolve:b,reject:c})})}_OnPermissionResult(a){const b=a.result,c=a.type;this._triggerPermission=c;a=this._permissionPromises.filter(d=>d.type===c);for(const d of a)d.resolve(b?"granted":"denied");this._permissionPromises=this._permissionPromises.filter(d=>d.type!==c);b?(this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnPermissionGranted), 0===c?this._runtime.RequestDeviceOrientationEvent():this._runtime.RequestDeviceMotionEvent()):this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnPermissionDenied)}_OnDeviceOrientation(a){"number"===typeof a.webkitCompassHeading?this._orientCompassHeading=a.webkitCompassHeading:a.absolute&&(this._orientCompassHeading=a.alpha);this._orientAlpha=a.alpha;this._orientBeta=a.beta;this._orientGamma=a.gamma}_OnDeviceOrientationAbsolute(a){this._orientCompassHeading=a.alpha}_OnDeviceMotion(a){const b=a.acceleration; b&&(this._accX=b.x,this._accY=b.y,this._accZ=b.z);if(a=a.accelerationIncludingGravity)this._accWithGX=a.x,this._accWithGY=a.y,this._accWithGZ=a.z}_OnTick2(){const a=performance.now();let b=0;for(const c of this._touches.values())c.GetTime()<=a-50&&c._SetLastTime(a),c.ShouldTriggerHold(a)&&(this._triggerIndex=c.GetStartIndex(),this._triggerId=c.GetId(),this._getTouchIndex=b,this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnHoldGesture),this._curTouchX=c.GetX(),this._curTouchY=c.GetY(),this.Trigger(C3$jscomp$272.Plugins.Touch.Cnds.OnHoldGestureObject), this._getTouchIndex=0),++b}_GetTouchByIndex(a){a=Math.floor(a);for(const b of this._touches.values()){if(0===a)return b;--a}return null}_IsClientPosOnCanvas(a,b){return 0<=a&&0<=b&&a<this._runtime.GetCanvasCssWidth()&&b<this._runtime.GetCanvasCssHeight()}GetDebuggerProperties(){return[{title:"plugins.touch.debugger.touches",properties:[...this._touches.values()].map(a=>({name:"$"+a.GetId(),value:a.GetX()+", "+a.GetY()}))}]}};const C3$jscomp$273=self.C3,tempArr=[]; C3$jscomp$273.Plugins.Touch.Cnds={OnTouchStart(){return!0},OnTouchEnd(){return!0},IsInTouch(){return 0<this._touches.size},OnTouchObject(a){return a&&this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)?this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(a,this._curTouchX,this._curTouchY,!1):!1},IsTouchingObject(a){if(!a)return!1;const b=new Map,c=a.GetCurrentSol();var d=c.GetInstances();for(const e of d){d=e.GetWorldInfo();const g=d.GetLayer();let k=b.get(g);"undefined"===typeof k&& (k=g.IsSelfAndParentsInteractive(),b.set(g,k));if(k&&d.IsInViewport2())for(const l of this._touches.values()){if(!this._IsClientPosOnCanvas(l.GetX(),l.GetY()))continue;const [n,p]=g.CanvasCssToLayer(l.GetX(),l.GetY(),d.GetTotalZElevation());if(d.ContainsPoint(n,p)){tempArr.push(e);break}}}b.clear();return tempArr.length?(c.SetArrayPicked(tempArr),a.ApplySolToContainer(),C3$jscomp$273.clearArray(tempArr),!0):!1},CompareTouchSpeed(a,b,c){return(a=this._GetTouchByIndex(a))?C3$jscomp$273.compare(a.GetSpeed(), b,c):!1},OrientationSupported(){return!0},MotionSupported(){return!0},CompareOrientation(a,b,c){this._runtime.RequestDeviceOrientationEvent();return C3$jscomp$273.compare(0===a?this._orientAlpha:1===a?this._orientBeta:this._orientGamma,b,c)},CompareAcceleration(a,b,c){this._runtime.RequestDeviceMotionEvent();return C3$jscomp$273.compare(0===a?this._accWithGX:1===a?this._accWithGY:2===a?this._accWithGZ:3===a?this._accX:4===a?this._accY:this._accZ,b,c)},OnNthTouchStart(a){a=Math.floor(a);return a=== this._triggerIndex},OnNthTouchEnd(a){a=Math.floor(a);return a===this._triggerIndex},HasNthTouch(a){a=Math.floor(a);return this._touches.size>=a+1},OnHoldGesture(){return!0},OnTapGesture(){return!0},OnDoubleTapGesture(){return!0},OnHoldGestureObject(a){return a&&this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)?this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(a,this._curTouchX,this._curTouchY,!1):!1},OnTapGestureObject(a){return a&&this._IsClientPosOnCanvas(this._curTouchX, this._curTouchY)?this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(a,this._curTouchX,this._curTouchY,!1):!1},OnDoubleTapGestureObject(a){return a&&this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)?this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(a,this._curTouchX,this._curTouchY,!1):!1},OnPermissionGranted(a){return this._triggerPermission===a},OnPermissionDenied(a){return this._triggerPermission===a}};self.C3.Plugins.Touch.Acts={RequestPermission(a){this._RequestPermission(a)}}; const C3$jscomp$275=self.C3; C3$jscomp$275.Plugins.Touch.Exps={TouchCount(){return this._touches.size},X(a){const b=this._GetTouchByIndex(this._getTouchIndex);return b?b.GetPositionForLayer(this._runtime.GetCurrentLayout(),a,!0):0},Y(a){const b=this._GetTouchByIndex(this._getTouchIndex);return b?b.GetPositionForLayer(this._runtime.GetCurrentLayout(),a,!1):0},XAt(a,b){return(a=this._GetTouchByIndex(a))?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),b,!0):0},YAt(a,b){return(a=this._GetTouchByIndex(a))?a.GetPositionForLayer(this._runtime.GetCurrentLayout(), b,!1):0},XForID(a,b){return(a=this._touches.get(a))?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),b,!0):0},YForID(a,b){return(a=this._touches.get(a))?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),b,!1):0},AbsoluteX(){const a=this._GetTouchByIndex(0);return a?a.GetX():0},AbsoluteY(){const a=this._GetTouchByIndex(0);return a?a.GetY():0},AbsoluteXAt(a){return(a=this._GetTouchByIndex(a))?a.GetX():0},AbsoluteYAt(a){return(a=this._GetTouchByIndex(a))?a.GetY():0},AbsoluteXForID(a){return(a= this._touches.get(a))?a.GetX():0},AbsoluteYForID(a){return(a=this._touches.get(a))?a.GetY():0},SpeedAt(a){return(a=this._GetTouchByIndex(a))?a.GetSpeed():0},SpeedForID(a){return(a=this._touches.get(a))?a.GetSpeed():0},AngleAt(a){return(a=this._GetTouchByIndex(a))?C3$jscomp$275.toDegrees(a.GetAngle()):0},AngleForID(a){return(a=this._touches.get(a))?C3$jscomp$275.toDegrees(a.GetAngle()):0},CompassHeading(){this._runtime.RequestDeviceOrientationEvent();return this._orientCompassHeading},Alpha(){this._runtime.RequestDeviceOrientationEvent(); return this._orientAlpha},Beta(){this._runtime.RequestDeviceOrientationEvent();return this._orientBeta},Gamma(){this._runtime.RequestDeviceOrientationEvent();return this._orientGamma},AccelerationXWithG(){this._runtime.RequestDeviceMotionEvent();return this._accWithGX},AccelerationYWithG(){this._runtime.RequestDeviceMotionEvent();return this._accWithGY},AccelerationZWithG(){this._runtime.RequestDeviceMotionEvent();return this._accWithGZ},AccelerationX(){this._runtime.RequestDeviceMotionEvent();return this._accX}, AccelerationY(){this._runtime.RequestDeviceMotionEvent();return this._accY},AccelerationZ(){this._runtime.RequestDeviceMotionEvent();return this._accZ},TouchIndex(){return this._triggerIndex},TouchID(){return this._triggerId},WidthForID(a){return(a=this._touches.get(a))?a.GetWidth():0},HeightForID(a){return(a=this._touches.get(a))?a.GetHeight():0},PressureForID(a){return(a=this._touches.get(a))?a.GetPressure():0}};"use strict";const C3$jscomp$276=self.C3; let lastTapX=-1E3,lastTapY=-1E3,lastTapTime=-1E4; C3$jscomp$276.Plugins.Touch.TouchInfo=class extends C3$jscomp$276.DefendedBase{constructor(){super();this._pressure=this._height=this._width=this._lastY=this._lastX=this._y=this._x=this._startY=this._startX=this._lastTime=this._time=this._startTime=this._startIndex=this._pointerId=0;this._isTooFarForHold=this._hasTriggeredHold=!1}Release(){}Init(a,b,c,d,e){this._pointerId=d;this._startIndex=e;this._startTime=this._lastTime=this._time=a;this._startX=b;this._startY=c;this._x=b;this._y=c;this._lastX= b;this._lastY=c}Update(a,b,c,d,e,g){this._lastTime=this._time;this._time=a;this._lastX=this._x;this._lastY=this._y;this._x=b;this._y=c;this._width=d;this._height=e;this._pressure=g;!this._isTooFarForHold&&15<=C3$jscomp$276.distanceTo(this._startX,this._startY,this._x,this._y)&&(this._isTooFarForHold=!0)}GetId(){return this._pointerId}GetStartIndex(){return this._startIndex}GetTime(){return this._time}_SetLastTime(a){this._lastTime=a}GetX(){return this._x}GetY(){return this._y}GetSpeed(){const a=C3$jscomp$276.distanceTo(this._x, this._y,this._lastX,this._lastY),b=(this._time-this._lastTime)/1E3;return 0<b?a/b:0}GetAngle(){return C3$jscomp$276.angleTo(this._lastX,this._lastY,this._x,this._y)}GetWidth(){return this._width}GetHeight(){return this._height}GetPressure(){return this._pressure}ShouldTriggerHold(a){return this._hasTriggeredHold?!1:500<=a-this._startTime&&!this._isTooFarForHold&&15>C3$jscomp$276.distanceTo(this._startX,this._startY,this._x,this._y)?this._hasTriggeredHold=!0:!1}ShouldTriggerTap(a){if(this._hasTriggeredHold)return""; if(333>=a-this._startTime&&!this._isTooFarForHold&&15>C3$jscomp$276.distanceTo(this._startX,this._startY,this._x,this._y)){if(666>=a-lastTapTime&&25>C3$jscomp$276.distanceTo(lastTapX,lastTapY,this._x,this._y))return lastTapY=lastTapX=-1E3,lastTapTime=-1E4,"double-tap";lastTapX=this._x;lastTapY=this._y;lastTapTime=a;return"single-tap"}return""}GetPositionForLayer(a,b,c){return"undefined"===typeof b?a.GetLayerByIndex(0).CanvasCssToLayer_DefaultTransform(this._x,this._y)[c?0:1]:(a=a.GetLayer(b))?a.CanvasCssToLayer(this._x, this._y)[c?0:1]:0}};"use strict";const C3$jscomp$277=self.C3;C3$jscomp$277.Plugins.AdvancedRandom=class extends C3$jscomp$277.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$278=self.C3,C3X$jscomp$28=self.C3X;C3$jscomp$278.Plugins.AdvancedRandom.Type=class extends C3$jscomp$278.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.IAdvancedRandomObjectType}};const VALID_GRADIENT_MODES=new Set(["rgb","float"]); let advancedRandomObjectType=null;function GetSdkInstance(){return advancedRandomObjectType.GetSingleGlobalInstance().GetSdkInstance()} self.IAdvancedRandomObjectType=class extends self.IObjectClass{constructor(a){super(a);advancedRandomObjectType=a}set seed(a){C3X$jscomp$28.RequireString(a);GetSdkInstance()._UpdateSeed(a)}get seed(){return GetSdkInstance()._GetCurrentSeed()}set octaves(a){C3X$jscomp$28.RequireFiniteNumber(a);GetSdkInstance()._SetOctaves(a)}get octaves(){return GetSdkInstance()._GetOctaves()}classic2d(a,b){C3X$jscomp$28.RequireNumber(a);C3X$jscomp$28.RequireNumber(b);return GetSdkInstance()._GetClassic2d(a,b)}classic3d(a, b,c){C3X$jscomp$28.RequireNumber(a);C3X$jscomp$28.RequireNumber(b);C3X$jscomp$28.RequireNumber(c);return GetSdkInstance()._GetClassic3d(a,b,c)}billow2d(a,b){C3X$jscomp$28.RequireNumber(a);C3X$jscomp$28.RequireNumber(b);return GetSdkInstance()._GetBillow2d(a,b)}billow3d(a,b,c){C3X$jscomp$28.RequireNumber(a);C3X$jscomp$28.RequireNumber(b);C3X$jscomp$28.RequireNumber(c);return GetSdkInstance()._GetBillow3d(a,b,c)}ridged2d(a,b){C3X$jscomp$28.RequireNumber(a);C3X$jscomp$28.RequireNumber(b);return GetSdkInstance()._GetRidged2d(a, b)}ridged3d(a,b,c){C3X$jscomp$28.RequireNumber(a);C3X$jscomp$28.RequireNumber(b);C3X$jscomp$28.RequireNumber(c);return GetSdkInstance()._GetRidged3d(a,b,c)}cellular2d(a,b){C3X$jscomp$28.RequireNumber(a);C3X$jscomp$28.RequireNumber(b);return GetSdkInstance()._GetCellular2d(a,b)}cellular3d(a,b,c){C3X$jscomp$28.RequireNumber(a);C3X$jscomp$28.RequireNumber(b);C3X$jscomp$28.RequireNumber(c);return GetSdkInstance()._GetCellular3d(a,b,c)}voronoi2d(a,b){C3X$jscomp$28.RequireNumber(a);C3X$jscomp$28.RequireNumber(b); return GetSdkInstance()._GetVoronoi2d(a,b)}voronoi3d(a,b,c){C3X$jscomp$28.RequireNumber(a);C3X$jscomp$28.RequireNumber(b);C3X$jscomp$28.RequireNumber(c);return GetSdkInstance()._GetVoronoi3d(a,b,c)}createGradient(a,b){C3X$jscomp$28.RequireString(a);if(!VALID_GRADIENT_MODES.has(b))throw Error("invalid mode");GetSdkInstance()._CreateGradient(a,b)}setCurrentGradient(a){C3X$jscomp$28.RequireString(a);GetSdkInstance()._SetGradient(a)}addGradientStop(a,b){C3X$jscomp$28.RequireNumber(a);C3X$jscomp$28.RequireNumber(b); GetSdkInstance()._AddGradientStop(a,b)}sampleGradient(a,b){C3X$jscomp$28.RequireOptionalString(a);C3X$jscomp$28.RequireNumber(b);return a?GetSdkInstance()._SampleGradientByName(a,b):GetSdkInstance()._SampleCurrentGradient(b)}createProbabilityTable(a){C3X$jscomp$28.RequireString(a);GetSdkInstance()._CreateProbabilityTable(a)}createProbabilityTableFromJSON(a,b){C3X$jscomp$28.RequireString(a);C3X$jscomp$28.RequireString(b);GetSdkInstance()._CreateProbabilityTableFromJSON(a,b)}getProbabilityTableAsJSON(){return GetSdkInstance()._GetProbabilityTableAsJSON()}setCurrentProbabilityTable(a){C3X$jscomp$28.RequireString(a); GetSdkInstance()._SetProbabilityTable(a)}addProbabilityTableEntry(a,b){C3X$jscomp$28.RequireNumber(a);if("number"!==typeof b&&"string"!==typeof b)throw new TypeError("invalid value");GetSdkInstance()._AddProbabilityEntry(a,b)}removeProbabilityTableEntry(a,b){C3X$jscomp$28.RequireNumber(a);if("number"!==typeof b&&"string"!==typeof b)throw new TypeError("invalid value");GetSdkInstance()._RemoveProbabilityEntry(a,b)}sampleProbabilityTable(a){C3X$jscomp$28.RequireOptionalString(a);return a?GetSdkInstance()._SampleProbabilityTableByName(a): GetSdkInstance()._SampleCurrentProbabilityTable()}createPermutationTable(a,b){C3X$jscomp$28.RequireFiniteNumber(a);C3X$jscomp$28.RequireNumber(b);GetSdkInstance()._CreatePermutationTable(a,b)}shufflePermutationTable(){GetSdkInstance()._ShufflePermutationTable()}getPermutation(a){C3X$jscomp$28.RequireFiniteNumber(a);return GetSdkInstance()._GetPermutation(a)}};const C3$jscomp$279=self.C3;function shuffle(a,b){let c=a.length;for(;0<c;){const d=Math.floor(b(0,c--)),e=a[c];a[c]=a[d];a[d]=e}return a} class Gradient{constructor(a,b){this.mode=a;this.name=b;this.stops=[]}GetName(){return this.name}AddStop(a,b){switch(this.mode){case "rgb":b=this._CreateStopRGB(b);break;case "float":b=this._CreateStopFloat(b)}let c=this.stops.length;for(;c--;)if(a>this.stops[c][0]){this.stops.splice(c+1,0,[a,b]);return}this.stops.push([a,b])}_CreateStopFloat(a){return[a]}_CreateStopRGB(a){const b=C3$jscomp$279.GetRValue(a),c=C3$jscomp$279.GetGValue(a),d=C3$jscomp$279.GetBValue(a);return[a,b,c,d,C3$jscomp$279.GetAValue(a)]}_SampleFloat(a, b,c){return C3$jscomp$279.lerp(a[0],b[0],c)}_SampleRGB(a,b,c){return C3$jscomp$279.PackRGBAEx(C3$jscomp$279.lerp(a[1],b[1],c),C3$jscomp$279.lerp(a[2],b[2],c),C3$jscomp$279.lerp(a[3],b[3],c),C3$jscomp$279.lerp(a[4],b[4],c))}Sample(a){const b=this.stops;var c=b[0];const d=b.length;var e=b[d-1];if(a<c[0])return c[1][0];if(a>e[0])return e[1][0];e=null;for(let g=1;g<d&&!(e=c,c=b[g],c[0]>a);g++);a=C3$jscomp$279.clamp((a-e[0])/(c[0]-e[0]),0,1);switch(this.mode){case "rgb":return this._SampleRGB(e[1],c[1], a);case "float":return this._SampleFloat(e[1],c[1],a)}}asJSON(a=!1){return"rgb"===this.mode?JSON.stringify(this.stops.map(([b,c])=>[b,a?c.slice(1):c[0]])):JSON.stringify(this.stops)}}let replaceSystemPRNG=!1; C3$jscomp$279.Plugins.AdvancedRandom.Instance=class extends C3$jscomp$279.SDKInstanceBase{constructor(a,b){super(a);this._core=null;this._currentSeed="";this._octaves=1;this._lacunarity=2;this._persistence=.5;this._gradients=new Map;this._probabilityTables=new Map;this._currentProbabilityTable=this._currentGradient=null;this._permutation=[0];a=b[0];replaceSystemPRNG=b[1];this._CreateGradient("default","rgb");this._AddGradientStop(0,C3$jscomp$279.PackRGBEx(0,0,0));this._AddGradientStop(1,C3$jscomp$279.PackRGBEx(1, 1,1));this._CreateProbabilityTable("default");this._runtime.AddLoadPromise(this._Init(a))}async _Init(a){this._core=(await this._InstatiateWASMModule()).instance.exports;""===a&&(a=this._RandomSeed(10));this._UpdateSeed(a);replaceSystemPRNG&&this._runtime.SetRandomNumberGeneratorCallback(()=>this._core.randomXorshiro(0,1))}async _InstatiateWASMModule(){var a=await this._runtime.GetAssetManager().FetchBlob("noise.wasm");a=new Response(a,{headers:{"content-type":"application/wasm"}});if(this._SupportsWASMStreamingInstantiation())return WebAssembly.instantiateStreaming(a); a=await a.arrayBuffer();return WebAssembly.instantiate(a)}_SupportsWASMStreamingInstantiation(){return"function"===typeof WebAssembly.instantiateStreaming}Release(){super.Release()}_RandomSeed(a){const b=[];for(;a--;)b.push(String.fromCharCode(Math.round(25*Math.random())+65));return b.join("")}_UpdateSeed(a){this._currentSeed=a;let b=5381;for(let c=0,d=a.length;c<d;c++)b=(b<<5)+b+a.charCodeAt(c);this._core.seed(b>>>0)}_GetCurrentSeed(){return this._currentSeed}_SetOctaves(a){this._octaves=C3$jscomp$279.clamp(a| 0,1,16)}_GetOctaves(){return this._octaves}_GetClassic2d(a,b){return this._core.classic2d(a,b,this._octaves)}_GetClassic3d(a,b,c){return this._core.classic3d(a,b,c,this._octaves)}_GetBillow2d(a,b){return this._core.billow2d(a,b,this._octaves)}_GetBillow3d(a,b,c){return this._core.billow3d(a,b,c,this._octaves)}_GetRidged2d(a,b){return this._core.ridged2d(a,b,this._octaves)}_GetRidged3d(a,b,c){return this._core.ridged3d(a,b,c,this._octaves)}_GetCellular2d(a,b){return this._core.cellular2d(a,b)}_GetCellular3d(a, b,c){return this._core.cellular3d(a,b,c)}_GetVoronoi2d(a,b){return this._core.voronoi2d(a,b)}_GetVoronoi3d(a,b,c){return this._core.voronoi3d(a,b,c)}_CreateGradient(a,b){b=new Gradient(b,a);this._gradients.set(a.toLowerCase(),b);this._currentGradient=b}_SetGradient(a){this._currentGradient=this._gradients.get(a.toLowerCase())||null}_AddGradientStop(a,b){const c=this._currentGradient;null!==c&&c.AddStop(a,b)}_SampleCurrentGradient(a){const b=this._currentGradient;return b?b.Sample(a):0}_SampleGradientByName(a, b){return(a=this._gradients.get(a.toLowerCase()))?a.Sample(b):0}_CreateProbabilityTable(a){const b=new C3$jscomp$279.ProbabilityTable(a);this._probabilityTables.set(a.toLowerCase(),b);this._currentProbabilityTable=b}_CreateProbabilityTableFromJSON(a,b){b=C3$jscomp$279.ProbabilityTable.fromJSON(b);this._probabilityTables.set(a.toLowerCase(),b);this._currentProbabilityTable=b}_GetProbabilityTableAsJSON(){return this._currentProbabilityTable?this._currentProbabilityTable.asJSON():""}_SetProbabilityTable(a){this._currentProbabilityTable= this._probabilityTables.get(a.toLowerCase())||null}_AddProbabilityEntry(a,b){const c=this._currentProbabilityTable;c&&c.AddItem(a,b)}_RemoveProbabilityEntry(a,b){const c=this._currentProbabilityTable;c&&c.RemoveItem(a,b)}_SampleCurrentProbabilityTable(){const a=this._currentProbabilityTable;return a?a.Sample(this._core.randomXorshiro(0,a.GetTotalWeight())):0}_SampleProbabilityTableByName(a){return(a=this._probabilityTables.get(a.toLowerCase()))?a.Sample(this._core.randomXorshiro(0,a.GetTotalWeight())): 0}_CreatePermutationTable(a,b){if(2>a)this._permutation=[b];else{this._permutation=[];for(let c=0;c<a;c++)this._permutation.push(c+b);shuffle(this._permutation,this._core.randomXorshiro)}}_ShufflePermutationTable(){shuffle(this._permutation,this._core.randomXorshiro)}_GetPermutation(a){a=Math.floor(a);const b=this._permutation,c=b.length;a%=c;0>a&&(a+=c);return b[a]}GetDebuggerProperties(){const a=[],b=[];for(var c of this._probabilityTables.values()){const d=c.asJSON();b.push({name:"$"+c.GetName(), value:d.slice(1,-1).toString().replace(/,/g,", ")})}for(const d of this._gradients.values())c=d.asJSON(!0),a.push({name:"$"+d.GetName(),value:c.slice(1,-1).toString().replace(/,/g,", ")});return[{title:"plugins.advancedrandom.debugger.title",properties:[{name:"plugins.advancedrandom.debugger.seed",value:this._GetCurrentSeed(),onedit:d=>this._UpdateSeed(d)},{name:"plugins.advancedrandom.debugger.replace-system",value:replaceSystemPRNG},{name:"plugins.advancedrandom.debugger.noise-octaves",value:this._GetOctaves()}, {name:"plugins.advancedrandom.debugger.noise-lacunarity",value:this._lacunarity},{name:"plugins.advancedrandom.debugger.noise-persistence",value:this._persistence},{name:"plugins.advancedrandom.debugger.current-probability-table",value:this._currentProbabilityTable?this._currentProbabilityTable.GetName():""},{name:"plugins.advancedrandom.debugger.current-gradient",value:this._currentGradient?this._currentGradient.GetName():""},{name:"plugins.advancedrandom.debugger.permutation-table",value:this._permutation.toString().replace(/,/g, ", ")}]},{title:"plugins.advancedrandom.debugger.gradients",properties:a},{title:"plugins.advancedrandom.debugger.probability-tables",properties:b}]}};self.C3.Plugins.AdvancedRandom.Cnds={}; self.C3.Plugins.AdvancedRandom.Acts={SetSeed(a){this._UpdateSeed(a)},SetOctaves(a){this._SetOctaves(a)},CreateGradient(a,b){this._CreateGradient(a,["rgb","float"][b])},SetGradient(a){this._SetGradient(a)},AddStop(a,b){this._AddGradientStop(a,b)},CreateProbabilityTable(a){this._CreateProbabilityTable(a)},CreateProbabilityTableFromJSON(a,b){try{this._CreateProbabilityTableFromJSON(a,b)}catch(c){console.warn("Failed to create probability table from JSON String",c)}},SetProbabilityTable(a){this._SetProbabilityTable(a)}, AddProbabilityEntry(a,b){this._AddProbabilityEntry(b,a)},RemoveProbabilityEntry(a,b){this._RemoveProbabilityEntry(b,a)},CreatePermutationTable(a,b){this._CreatePermutationTable(a,b)},ShufflePermutationTable(){this._ShufflePermutationTable()}}; self.C3.Plugins.AdvancedRandom.Exps={Classic2d(a,b){return this._GetClassic2d(a,b)},Classic3d(a,b,c){return this._GetClassic3d(a,b,c)},Billow2d(a,b){return this._GetBillow2d(a,b)},Billow3d(a,b,c){return this._GetBillow3d(a,b,c)},Ridged2d(a,b){return this._GetRidged2d(a,b)},Ridged3d(a,b,c){return this._GetRidged3d(a,b,c)},Cellular2d(a,b){return this._GetCellular2d(a,b)},Cellular3d(a,b,c){return this._GetCellular3d(a,b,c)},Voronoi2d(a,b){return this._GetVoronoi2d(a,b)},Voronoi3d(a,b,c){return this._GetVoronoi3d(a, b,c)},Gradient(a){return this._SampleCurrentGradient(a)},GradientByName(a,b){return this._SampleGradientByName(a,b)},Weighted(){return this._SampleCurrentProbabilityTable()},WeightedByName(a){return this._SampleProbabilityTableByName(a)},RandomSeed(){return this._RandomSeed(10)},Seed(){return this._GetCurrentSeed()},Octaves(){return this._GetOctaves()},Permutation(a){return this._GetPermutation(a)},ProbabilityTableAsJSON(){return this._GetProbabilityTableAsJSON()}};"use strict"; const C3$jscomp$283=self.C3;C3$jscomp$283.Plugins.AJAX=class extends C3$jscomp$283.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$284=self.C3;C3$jscomp$284.Plugins.AJAX.Type=class extends C3$jscomp$284.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};const C3$jscomp$285=self.C3; C3$jscomp$285.Plugins.AJAX.Instance=class extends C3$jscomp$285.SDKInstanceBase{constructor(a,b){super(a);this._lastData="";this._lastStatusCode=0;this._curTag="";this._progress=0;this._timeout=-1;this._nextRequestHeaders=new Map;this._nextReponseBinaryData=null;this._nextRequestOverrideMimeType="";this._nextRequestWithCredentials=!1;this._nwjsAppFolder=this._nwjsPath=this._nwjsFs=null;if(this._isNWjs="nwjs"===this._runtime.GetExportType())this._nwjsFs=require("fs"),this._nwjsPath=require("path"), this._nwjsAppFolder=this._nwjsPath.dirname((self.process||nw.process).execPath)+"\\"}Release(){super.Release()}async _TriggerError(a,b,c){console.error(`[Construct] AJAX request to '${b}' (tag '${a}') failed: `,c);this._curTag=a;await this.TriggerAsync(C3$jscomp$285.Plugins.AJAX.Cnds.OnAnyError);this._curTag=a;await this.TriggerAsync(C3$jscomp$285.Plugins.AJAX.Cnds.OnError)}async _TriggerComplete(a){this._curTag=a;await this.TriggerAsync(C3$jscomp$285.Plugins.AJAX.Cnds.OnAnyComplete);this._curTag= a;await this.TriggerAsync(C3$jscomp$285.Plugins.AJAX.Cnds.OnComplete)}async _OnProgress(a,b){b.lengthComputable&&(this._progress=b.loaded/b.total,this._curTag=a,await this.TriggerAsync(C3$jscomp$285.Plugins.AJAX.Cnds.OnProgress))}_OnError(a,b,c){if(this._isNWjs){var d=this._nwjsFs,e=this._nwjsAppFolder+b;d.existsSync(e)?d.readFile(e,{encoding:"utf8"},(g,k)=>{g?this._TriggerError(a,b,g):(this._lastData=k.replace(/\r\n/g,"\n"),this._TriggerComplete(a))}):this._TriggerError(a,b,c)}else this._TriggerError(a, b,c)}async _DoCordovaRequest(a,b){const c=this._runtime.GetAssetManager(),d=this._nextReponseBinaryData;this._nextReponseBinaryData=null;try{if(d){const e=await c.CordovaFetchLocalFileAsArrayBuffer(b);d.SetArrayBufferTransfer(e);this._lastData=""}else this._lastData=(await c.CordovaFetchLocalFileAsText(b)).replace(/\r\n/g,"\n");this._lastStatusCode=0;this._TriggerComplete(a)}catch(e){this._TriggerError(a,b,e)}}_DoRequest(a,b,c,d){return new Promise(e=>{const g=l=>{this._OnError(a,b,l);e()},k=this._nextReponseBinaryData; this._nextReponseBinaryData=null;try{const l=new XMLHttpRequest;l.onreadystatechange=()=>{if(4===l.readyState){this._lastData=k?"":(l.responseText||"").replace(/\r\n/g,"\n");this._lastStatusCode=l.status;if(400<=l.status)this._TriggerError(a,b,l.status+l.statusText);else{const n=this._lastData.length||k&&l.response instanceof ArrayBuffer;this._isNWjs&&!n||!this._isNWjs&&0===l.status&&!n||(k&&k.SetArrayBufferTransfer(l.response),this._TriggerComplete(a))}e()}};l.onerror=g;l.ontimeout=g;l.onabort=g; l.onprogress=n=>this._OnProgress(a,n);l.open(c,b);0<=this._timeout&&"undefined"!==typeof l.timeout&&(l.timeout=this._timeout);l.responseType=k?"arraybuffer":"text";d&&!this._nextRequestHeaders.has("Content-Type")&&("string"!==typeof d?l.setRequestHeader("Content-Type","application/octet-stream"):l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"));for(const [n,p]of this._nextRequestHeaders)try{l.setRequestHeader(n,p)}catch(r){console.error(`[Construct] AJAX: Failed to set header '${n}: ${p}': `, r)}this._nextRequestHeaders.clear();if(this._nextRequestOverrideMimeType){try{l.overrideMimeType(this._nextRequestOverrideMimeType)}catch(n){console.error("[Construct] AJAX: failed to override MIME type: ",n)}this._nextRequestOverrideMimeType=""}this._nextRequestWithCredentials&&(l.withCredentials=!0,this._nextRequestWithCredentials=!1);d?l.send(d):l.send()}catch(l){g(l)}})}GetDebuggerProperties(){return[{title:"plugins.ajax.debugger.title",properties:[{name:"plugins.ajax.debugger.last-status-code", value:this._lastStatusCode},{name:"plugins.ajax.debugger.last-data",value:this._lastData}]}]}SaveToJson(){return{lastData:this._lastData,lastStatusCode:this._lastStatusCode}}LoadFromJson(a){this._lastData=a.lastData;this._lastStatusCode=a.hasOwnProperty("lastStatusCode")?a.lastStatusCode:0;this._curTag="";this._progress=0}};const C3$jscomp$286=self.C3; C3$jscomp$286.Plugins.AJAX.Cnds={OnComplete(a){return C3$jscomp$286.equalsNoCase(this._curTag,a)},OnAnyComplete(){return!0},OnError(a){return C3$jscomp$286.equalsNoCase(this._curTag,a)},OnAnyError(){return!0},OnProgress(a){return C3$jscomp$286.equalsNoCase(this._curTag,a)}};const C3$jscomp$287=self.C3; C3$jscomp$287.Plugins.AJAX.Acts={async Request(a,b){this._runtime.IsCordova()&&C3$jscomp$287.IsRelativeURL(b)&&this._runtime.GetAssetManager().IsFileProtocol()?await this._DoCordovaRequest(a,b):this._runtime.IsPreview()&&C3$jscomp$287.IsRelativeURL(b)?(b=this._runtime.GetAssetManager().GetLocalUrlAsBlobUrl(b),await this._DoRequest(a,b,"GET",null)):await this._DoRequest(a,b,"GET",null)},async RequestFile(a,b){this._runtime.IsCordova()&&this._runtime.GetAssetManager().IsFileProtocol()?await this._DoCordovaRequest(a, b):await this._DoRequest(a,this._runtime.GetAssetManager().GetLocalUrlAsBlobUrl(b),"GET",null)},async Post(a,b,c,d){await this._DoRequest(a,b,d,c)},async PostBinary(a,b,c,d){c&&(c=c.GetFirstPicked(this._inst))&&(c=c.GetSdkInstance().GetArrayBufferReadOnly(),await this._DoRequest(a,b,d,c))},SetTimeout(a){this._timeout=1E3*a},SetHeader(a,b){this._nextRequestHeaders.set(a,b)},SetResponseBinary(a){a&&(a=a.GetFirstPicked(this._inst))&&(this._nextReponseBinaryData=a.GetSdkInstance())},OverrideMIMEType(a){this._nextRequestOverrideMimeType= a},SetWithCredentials(a){this._nextRequestWithCredentials=!!a}};self.C3.Plugins.AJAX.Exps={LastData(){return this._lastData},LastStatusCode(){return this._lastStatusCode},Progress(){return this._progress},Tag(){return this._curTag}};"use strict";const C3$jscomp$289=self.C3;C3$jscomp$289.Plugins.Dictionary=class extends C3$jscomp$289.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$290=self.C3;C3$jscomp$290.Plugins.Dictionary.Type=class extends C3$jscomp$290.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}}; const C3$jscomp$291=self.C3,IInstance$jscomp$4=self.IInstance; C3$jscomp$291.Plugins.Dictionary.Instance=class extends C3$jscomp$291.SDKInstanceBase{constructor(a,b){super(a);this._data=new Map;this._curKey=""}Release(){this._data.clear();super.Release()}GetAsJsonString(){return JSON.stringify({c2dictionary:!0,data:C3$jscomp$291.MapToObject(this._data)})}GetDataMap(){return this._data}SaveToJson(){return C3$jscomp$291.MapToObject(this._data)}LoadFromJson(a){C3$jscomp$291.ObjectToMap(a,this._data)}GetDebuggerProperties(){return[{title:"plugins.dictionary.name",properties:[{name:"plugins.dictionary.debugger.key-count", value:this._data.size},...[...this._data].map(a=>({name:"$"+a[0],value:a[1],onedit:b=>this._data.set(a[0],b)}))]}]}GetScriptInterfaceClass(){return self.IDictionaryInstance}};const map$jscomp$25=new WeakMap;self.IDictionaryInstance=class extends IInstance$jscomp$4{constructor(){super();map$jscomp$25.set(this,IInstance$jscomp$4._GetInitInst().GetSdkInstance())}getDataMap(){return map$jscomp$25.get(this).GetDataMap()}};const C3$jscomp$292=self.C3; C3$jscomp$292.Plugins.Dictionary.Cnds={CompareValue(a,b,c){a=this._data.get(a);return"undefined"===typeof a?!1:C3$jscomp$292.compare(a,b,c)},ForEachKey(){const a=this._runtime,b=a.GetEventSheetManager(),c=a.GetCurrentEvent(),d=c.GetSolModifiers(),e=a.GetEventStack(),g=e.GetCurrentStackFrame(),k=e.Push(c);a.SetDebuggingEnabled(!1);for(const l of this._data.keys())this._curKey=l,b.PushCopySol(d),c.Retrigger(g,k),b.PopSol(d);a.SetDebuggingEnabled(!0);this._curKey="";e.Pop();return!1},CompareCurrentValue(a, b){const c=this._data.get(this._curKey);return"undefined"===typeof c?!1:C3$jscomp$292.compare(c,a,b)},HasKey(a){return this._data.has(a)},IsEmpty(){return 0===this._data.size}};const C3$jscomp$293=self.C3; C3$jscomp$293.Plugins.Dictionary.Acts={AddKey(a,b){this._data.set(a,b)},SetKey(a,b){this._data.has(a)&&this._data.set(a,b)},DeleteKey(a){this._data.delete(a)},Clear(){this._data.clear()},JSONLoad(a){let b=null;try{b=JSON.parse(a)}catch(c){console.error("[Construct] Error parsing JSON: ",c);return}b.c2dictionary&&C3$jscomp$293.ObjectToMap(b.data,this._data)},JSONDownload(a){const b=URL.createObjectURL(new Blob([this.GetAsJsonString()],{type:"application/json"}));this._runtime.InvokeDownload(b,a)}}; self.C3.Plugins.Dictionary.Exps={Get(a){a=this._data.get(a);return"undefined"===typeof a?0:a},GetDefault(a,b){a=this._data.get(a);return"undefined"===typeof a?b:a},KeyCount(){return this._data.size},CurrentKey(){return this._curKey},CurrentValue(){return this._data.get(this._curKey)||0},AsJSON(){return this.GetAsJsonString()}};"use strict";const C3$jscomp$295=self.C3;C3$jscomp$295.Plugins.Date=class extends C3$jscomp$295.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}}; const C3$jscomp$296=self.C3;C3$jscomp$296.Plugins.Date.Type=class extends C3$jscomp$296.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};const C3$jscomp$297=self.C3;C3$jscomp$297.Plugins.Date.Instance=class extends C3$jscomp$297.SDKInstanceBase{constructor(a,b){super(a)}}; const C3$jscomp$298=self.C3,getters=[[a=>C3$jscomp$298.Plugins.Date.Exps.GetYear(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetMonth(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetDate(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetDay(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetHours(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetMinutes(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetSeconds(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetMilliseconds(a)],[a=>C3$jscomp$298.Plugins.Date.Exps.GetUTCYear(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetUTCMonth(a), a=>C3$jscomp$298.Plugins.Date.Exps.GetUTCDate(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetUTCDay(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetUTCHours(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetUTCMinutes(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetUTCSeconds(a),a=>C3$jscomp$298.Plugins.Date.Exps.GetUTCMilliseconds(a)]],parse=a=>C3$jscomp$298.Plugins.Date.Exps.Parse(a); C3$jscomp$298.Plugins.Date.Cnds={CompareTimeStamps(a,b,c){return C3$jscomp$298.compare(a,b,c)},CompareDateStrings(a,b,c){return C3$jscomp$298.compare(parse(a),b,parse(c))},CompareTimestampParts(a,b,c,d){return C3$jscomp$298.compare(getters[1][d](a),b,getters[1][d](c))},CompareDateStringParts(a,b,c,d,e){return C3$jscomp$298.compare(getters[e][d](parse(a)),b,getters[e][d](parse(c)))}};self.C3.Plugins.Date.Acts={};const C3$jscomp$300=self.C3,Intl$jscomp$1=self.Intl,getters$jscomp$1=new Map; getters$jscomp$1.set("local",new Map([["year",a=>(new Date(a)).getFullYear()],["month",a=>(new Date(a)).getMonth()],["date",a=>(new Date(a)).getDate()],["day",a=>(new Date(a)).getDay()],["hours",a=>(new Date(a)).getHours()],["minutes",a=>(new Date(a)).getMinutes()],["seconds",a=>(new Date(a)).getSeconds()],["milliseconds",a=>(new Date(a)).getMilliseconds()]])); getters$jscomp$1.set("universal",new Map([["year",a=>(new Date(a)).getUTCFullYear()],["month",a=>(new Date(a)).getUTCMonth()],["date",a=>(new Date(a)).getUTCDate()],["day",a=>(new Date(a)).getUTCDay()],["hours",a=>(new Date(a)).getUTCHours()],["minutes",a=>(new Date(a)).getUTCMinutes()],["seconds",a=>(new Date(a)).getUTCSeconds()],["milliseconds",a=>(new Date(a)).getUTCMilliseconds()]]));const setters=new Map; setters.set("local",new Map([["year",(a,b)=>(new Date(a)).setFullYear(b)],["month",(a,b)=>(new Date(a)).setMonth(b)],["date",(a,b)=>(new Date(a)).setDate(b)],["hours",(a,b)=>(new Date(a)).setHours(b)],["minutes",(a,b)=>(new Date(a)).setMinutes(b)],["seconds",(a,b)=>(new Date(a)).setSeconds(b)],["milliseconds",(a,b)=>(new Date(a)).setMilliseconds(b)]])); setters.set("universal",new Map([["year",(a,b)=>(new Date(a)).setUTCFullYear(b)],["month",(a,b)=>(new Date(a)).setUTCMonth(b)],["date",(a,b)=>(new Date(a)).setUTCDate(b)],["hours",(a,b)=>(new Date(a)).setUTCHours(b)],["minutes",(a,b)=>(new Date(a)).setUTCMinutes(b)],["seconds",(a,b)=>(new Date(a)).setUTCSeconds(b)],["milliseconds",(a,b)=>(new Date(a)).setUTCMilliseconds(b)]])); const validate_date_format_option=function(a,b,c,d){c.includes(a)&&(d[b]=a)},validate_hour_format_option=function(a,b){a&&("12"===a?b.hour12=!0:"24"===a&&(b.hour12=!1))},validate_locale=function(a){try{return Intl$jscomp$1.getCanonicalLocales(a)}catch(b){return self.navigator.language}},DATE_STYLES=["full","long","medium","short"],TIME_STYLES=["full","long","medium","short"],WEEK_DAY_FORMATS=["long","short","narrow"],YEAR_FORMATS=["numeric","2-digit"],MONTH_FORMATS=["numeric","2-digit","long","short", "narrow"],DAY_FORMATS=["numeric","2-digit"],HOUR_FORMATS=["numeric","2-digit"],MINUTE_FORMATS=["numeric","2-digit"],SECOND_FORMATS=["numeric","2-digit"]; C3$jscomp$300.Plugins.Date.Exps={ToString(a){return(new Date(a)).toString()},ToDateString(a){return(new Date(a)).toDateString()},ToTimeString(a){return(new Date(a)).toTimeString()},ToLocaleString(a){return(new Date(a)).toLocaleString()},ToLocaleDateString(a){return(new Date(a)).toLocaleDateString()},ToLocaleTimeString(a){return(new Date(a)).toLocaleTimeString()},ToUTCString(a){return(new Date(a)).toUTCString()},Parse(a){return Date.parse(a)},Get(a,b,c,d,e,g,k){return Date.UTC(a,b,c,d,e,g,k)},Now(){return Date.now()}, TimezoneOffset(){return(new Date(Date.now())).getTimezoneOffset()},GetYear(a){return getters$jscomp$1.get("local").get("year")(a)},GetUTCYear(a){return getters$jscomp$1.get("universal").get("year")(a)},GetMonth(a){return getters$jscomp$1.get("local").get("month")(a)},GetUTCMonth(a){return getters$jscomp$1.get("universal").get("month")(a)},GetDate(a){return getters$jscomp$1.get("local").get("date")(a)},GetUTCDate(a){return getters$jscomp$1.get("universal").get("date")(a)},GetDay(a){return getters$jscomp$1.get("local").get("day")(a)}, GetUTCDay(a){return getters$jscomp$1.get("universal").get("day")(a)},GetHours(a){return getters$jscomp$1.get("local").get("hours")(a)},GetUTCHours(a){return getters$jscomp$1.get("universal").get("hours")(a)},GetMinutes(a){return getters$jscomp$1.get("local").get("minutes")(a)},GetUTCMinutes(a){return getters$jscomp$1.get("universal").get("minutes")(a)},GetSeconds(a){return getters$jscomp$1.get("local").get("seconds")(a)},GetUTCSeconds(a){return getters$jscomp$1.get("universal").get("seconds")(a)}, GetMilliseconds(a){return getters$jscomp$1.get("local").get("milliseconds")(a)},GetUTCMilliseconds(a){return getters$jscomp$1.get("universal").get("milliseconds")(a)},ChangeYear(a,b){return setters.get("local").get("year")(a,b)},ChangeUTCYear(a,b){return setters.get("universal").get("year")(a,b)},ChangeMonth(a,b){return setters.get("local").get("month")(a,b)},ChangeUTCMonth(a,b){return setters.get("universal").get("month")(a,b)},ChangeDate(a,b){return setters.get("local").get("date")(a,b)},ChangeUTCDate(a, b){return setters.get("universal").get("date")(a,b)},ChangeDay(a,b){const c=C3$jscomp$300.Plugins.Date.Exps.GetYear(a),d=C3$jscomp$300.Plugins.Date.Exps.GetMonth(a),e=C3$jscomp$300.Plugins.Date.Exps.GetDate(a),g=C3$jscomp$300.Plugins.Date.Exps.GetHours(a),k=C3$jscomp$300.Plugins.Date.Exps.GetMinutes(a),l=C3$jscomp$300.Plugins.Date.Exps.GetSeconds(a),n=C3$jscomp$300.Plugins.Date.Exps.GetMilliseconds(a);a=C3$jscomp$300.Plugins.Date.Exps.GetDay(a);return(new Date(c,d,e+(b-a),g,k,l,n)).getTime()},ChangeUTCDay(a, b){const c=C3$jscomp$300.Plugins.Date.Exps.GetUTCYear(a),d=C3$jscomp$300.Plugins.Date.Exps.GetUTCMonth(a),e=C3$jscomp$300.Plugins.Date.Exps.GetUTCDate(a),g=C3$jscomp$300.Plugins.Date.Exps.GetUTCHours(a),k=C3$jscomp$300.Plugins.Date.Exps.GetUTCMinutes(a),l=C3$jscomp$300.Plugins.Date.Exps.GetUTCSeconds(a),n=C3$jscomp$300.Plugins.Date.Exps.GetUTCMilliseconds(a);a=C3$jscomp$300.Plugins.Date.Exps.GetUTCDay(a);return C3$jscomp$300.Plugins.Date.Exps.Get(c,d,e+(b-a),g,k,l,n)},ChangeHours(a,b){return setters.get("local").get("hours")(a, b)},ChangeUTCHours(a,b){return setters.get("universal").get("hours")(a,b)},ChangeMinutes(a,b){return setters.get("local").get("minutes")(a,b)},ChangeUTCMinutes(a,b){return setters.get("universal").get("minutes")(a,b)},ChangeSeconds(a,b){return setters.get("local").get("seconds")(a,b)},ChangeUTCSeconds(a,b){return setters.get("universal").get("seconds")(a,b)},ChangeMilliseconds(a,b){return setters.get("local").get("milliseconds")(a,b)},ChangeUTCMilliseconds(a,b){return setters.get("universal").get("milliseconds")(a, b)},Difference(a,b){return b-a},ToTimerHours(a){return Math.trunc(C3$jscomp$300.Plugins.Date.Exps.ToTotalHours(a))},ToTimerMinutes(a){return Math.trunc(C3$jscomp$300.Plugins.Date.Exps.ToTotalMinutes(a))%60},ToTimerSeconds(a){return Math.trunc(C3$jscomp$300.Plugins.Date.Exps.ToTotalSeconds(a))%60},ToTimerMilliseconds(a){return a%1E3},ToTotalHours(a){return a/36E5},ToTotalMinutes(a){return a/6E4},ToTotalSeconds(a){return a/1E3},FormatDateWithStyles(a,b,c,d,e){if(a=validate_locale(a)){var g={};validate_date_format_option.call(this, c,"dateStyle",DATE_STYLES,g);validate_date_format_option.call(this,d,"timeStyle",TIME_STYLES,g);validate_hour_format_option.call(this,e,g);return(new Intl$jscomp$1.DateTimeFormat(a,g)).format(b)}},FormatDateWithComponents(a,b,c,d,e,g,k,l,n,p){if(a=validate_locale(a)){var r={};validate_date_format_option.call(this,c,"weekday",WEEK_DAY_FORMATS,r);validate_date_format_option.call(this,d,"year",YEAR_FORMATS,r);validate_date_format_option.call(this,e,"month",MONTH_FORMATS,r);validate_date_format_option.call(this, g,"day",DAY_FORMATS,r);validate_date_format_option.call(this,k,"hour",HOUR_FORMATS,r);validate_date_format_option.call(this,l,"minute",MINUTE_FORMATS,r);validate_date_format_option.call(this,n,"second",SECOND_FORMATS,r);validate_hour_format_option.call(this,p,r);return(new Intl$jscomp$1.DateTimeFormat(a,r)).format(b)}}};"use strict";const C3$jscomp$301=self.C3;C3$jscomp$301.Behaviors.LOS=class extends C3$jscomp$301.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}}; const C3$jscomp$302=self.C3; C3$jscomp$302.Behaviors.LOS.Type=class extends C3$jscomp$302.SDKBehaviorTypeBase{constructor(a){super(a);this._obstacleTypes=[]}Release(){C3$jscomp$302.clearArray(this._obstacleTypes);super.Release()}OnCreate(){}AddObstacle(a){if(!this._obstacleTypes.includes(a)){for(const b of this._obstacleTypes)if(b.IsFamily()&&b.FamilyHasMember(a))return;this._obstacleTypes.push(a)}}ClearObstacles(){C3$jscomp$302.clearArray(this._obstacleTypes)}GetObstacleTypes(){return this._obstacleTypes}FindLOSBehavior(a){const b=this.GetBehaviorType(); for(const c of a.GetBehaviorInstances())if(c.GetBehaviorType()===b)return c.GetSdkInstance();return null}};const C3$jscomp$303=self.C3,C3X$jscomp$30=self.C3X,IBehaviorInstance$jscomp$2=self.IBehaviorInstance,collisionCandidates=[]; C3$jscomp$303.Behaviors.LOS.Instance=class extends C3$jscomp$303.SDKBehaviorInstanceBase{constructor(a,b){super(a);this._obstacleMode=0;this._range=1E4;this._cone=C3$jscomp$303.toRadians(360);this._useCollisionCells=!0;this._ray=new C3$jscomp$303.Ray;b&&(this._obstacleMode=b[0],this._range=b[1],this._cone=C3$jscomp$303.toRadians(b[2]),this._useCollisionCells=b[3])}Release(){super.Release()}SaveToJson(){return{r:this._range,c:this._cone,om:this._obstacleMode,ucc:this._useCollisionCells,t:this.GetSdkType().GetObstacleTypes().map(a=> a.GetSID())}}LoadFromJson(a){this._range=a.r;this._cone=a.c;this._obstacleMode=a.om||0;this._useCollisionCells=!!a.ucc;const b=this.GetSdkType().GetObstacleTypes();C3$jscomp$303.clearArray(b);for(const c of a.t)(a=this._runtime.GetObjectClassBySID(c))&&b.push(a)}HasLOSToInstance(a,b){const c=a.GetUID(),[d,e]=a.GetImagePoint(b);return this.HasLOSTo(d,e)||this._ray.DidCollide()&&this._ray.hitUid===c}HasLOSTo(a,b){const c=this.GetWorldInfo();let d=c.GetAngle();0>c.GetWidth()&&(d+=Math.PI);return this.HasLOSBetweenPositions(c.GetX(), c.GetY(),d,a,b)}HasLOSBetweenPositions(a,b,c,d,e){this._ray.Reset();var g=this._range;if(C3$jscomp$303.distanceSquared(a,b,d,e)>g*g)return!1;g=C3$jscomp$303.angleTo(a,b,d,e);return C3$jscomp$303.angleDiff(c,g)>this._cone/2?!1:!this.CastRay(a,b,d,e,this._useCollisionCells).DidCollide()}_GetCollisionCandidates(a,b){if(b){b=this.GetWorldInfo().GetLayer();var c=this._runtime.GetCollisionEngine();0===this._obstacleMode?c.GetSolidCollisionCandidates(b,a.rect,collisionCandidates):c.GetObjectClassesCollisionCandidates(b, this._GetObstacleTypes(),a.rect,collisionCandidates);return collisionCandidates}if(0===this._obstacleMode)return(a=this._runtime.GetSolidBehavior())?a.GetInstances():collisionCandidates;for(c of this._GetObstacleTypes())C3$jscomp$303.appendArray(collisionCandidates,c.GetInstances());return collisionCandidates}_GetObstacleTypes(){return this.GetSdkType().GetObstacleTypes()}CastRay(a,b,c,d,e){a=this._ray.Set(a,b,c,d);e=this._GetCollisionCandidates(a,e);b=this._runtime.GetCollisionEngine();c=0===this._obstacleMode; d=this._inst;for(let g=0,k=e.length;g<k;++g){const l=e[g];l!==d&&(c&&!b.IsSolidCollisionAllowed(l,d)||b.TestRayIntersectsInstance(l,a))}a.Complete();C3$jscomp$303.clearArray(collisionCandidates);return a}_GetRay(){return this._ray}_GetRayHitX(){const a=this._ray;return a.DidCollide()?a.hitX:0}_GetRayHitY(){const a=this._ray;return a.DidCollide()?a.hitY:0}_GetRayHitDistance(){const a=this._ray;return a.DidCollide()?a.distance:0}_GetRayHitUID(){const a=this._ray;return a.DidCollide()?a.hitUid:-1}_GetRayNormalX(a){const b= this._ray;return b.DidCollide()?b.hitX+a*b.normalX:0}_GetRayNormalY(a){const b=this._ray;return b.DidCollide()?b.hitY+a*b.normalY:0}_GetRayNormalAngle(){const a=this._ray;return a.DidCollide()?a.hitNormal:0}_GetRayReflectionX(a){const b=this._ray;return b.DidCollide()?b.hitX+a*b.reflectionX:0}_GetRayReflectionY(a){const b=this._ray;return b.DidCollide()?b.hitY+a*b.reflectionY:0}_GetRayReflectionAngle(){const a=this._ray;return a.DidCollide()?Math.atan2(a.reflectionY,a.reflectionX):0}_SetRange(a){this._range= a}_GetRange(){return this._range}_SetConeOfView(a){this._cone=a}_GetConeOfView(){return this._cone}GetPropertyValueByIndex(a){switch(a){case 0:return this._obstacleMode;case 1:return this._range;case 2:return C3$jscomp$303.toDegrees(this._cone);case 3:return this._useCollisionCells}}SetPropertyValueByIndex(a,b){switch(a){case 0:this._obstacleMode=b;break;case 1:this._range=b;break;case 2:this._cone=C3$jscomp$303.toRadians(b);break;case 3:this._useCollisionCells=!!b}}GetDebuggerProperties(){return[{title:"$"+ this.GetBehaviorType().GetName(),properties:[{name:"behaviors.los.properties.range.name",value:this._GetRange(),onedit:a=>this._SetRange(a)},{name:"behaviors.los.properties.cone-of-view.name",value:C3$jscomp$303.toDegrees(this._GetConeOfView()),onedit:a=>this._SetConeOfView(C3$jscomp$303.toRadians(a))}]}]}GetScriptInterfaceClass(){return self.ILOSBehaviorInstance}};const map$jscomp$26=new WeakMap; self.ILOSBehaviorInstance=class extends IBehaviorInstance$jscomp$2{constructor(){super();const a=IBehaviorInstance$jscomp$2._GetInitInst().GetSdkInstance();map$jscomp$26.set(this,a);this.ray=new self.ILOSBehaviorRay(a)}set range(a){C3X$jscomp$30.RequireFiniteNumber(a);map$jscomp$26.get(this)._SetRange(a)}get range(){return map$jscomp$26.get(this)._GetRange()}set coneOfView(a){C3X$jscomp$30.RequireFiniteNumber(a);map$jscomp$26.get(this)._SetConeOfView(a)}get coneOfView(){return map$jscomp$26.get(this)._GetConeOfView()}hasLOStoPosition(a, b){C3X$jscomp$30.RequireNumber(a);C3X$jscomp$30.RequireNumber(b);return map$jscomp$26.get(this).HasLOSTo(a,b)}hasLOSBetweenPositions(a,b,c,d,e){C3X$jscomp$30.RequireNumber(a);C3X$jscomp$30.RequireNumber(b);C3X$jscomp$30.RequireNumber(c);C3X$jscomp$30.RequireNumber(d);C3X$jscomp$30.RequireNumber(e);return map$jscomp$26.get(this).HasLOSBetweenPositions(a,b,c,d,e)}castRay(a,b,c,d,e=!0){C3X$jscomp$30.RequireNumber(a);C3X$jscomp$30.RequireNumber(b);C3X$jscomp$30.RequireNumber(c);C3X$jscomp$30.RequireNumber(d); map$jscomp$26.get(this).CastRay(a,b,c,d,e);return this.ray}addObstacle(a){const b=map$jscomp$26.get(this);a=b.GetRuntime()._UnwrapIObjectClass(a);b.GetSdkType().AddObstacle(a)}clearObstacles(){map$jscomp$26.get(this).GetSdkType().ClearObstacles()}}; self.ILOSBehaviorRay=class{constructor(a){map$jscomp$26.set(this,a)}get didCollide(){return map$jscomp$26.get(this)._GetRay().DidCollide()}get hitX(){return map$jscomp$26.get(this)._GetRayHitX()}get hitY(){return map$jscomp$26.get(this)._GetRayHitY()}getHitPosition(){const a=map$jscomp$26.get(this);return[a._GetRayHitX(),a._GetRayHitY()]}get hitDistance(){return map$jscomp$26.get(this)._GetRayHitDistance()}get hitUid(){return map$jscomp$26.get(this)._GetRayHitUID()}getNormalX(a){C3X$jscomp$30.RequireFiniteNumber(a); return map$jscomp$26.get(this)._GetRayNormalX(a)}getNormalY(a){C3X$jscomp$30.RequireFiniteNumber(a);return map$jscomp$26.get(this)._GetRayNormalY(a)}getNormal(a){C3X$jscomp$30.RequireFiniteNumber(a);const b=map$jscomp$26.get(this);return[b._GetRayNormalX(a),b._GetRayNormalY(a)]}get normalAngle(){return map$jscomp$26.get(this)._GetRayNormalAngle()}getReflectionX(a){C3X$jscomp$30.RequireFiniteNumber(a);return map$jscomp$26.get(this)._GetRayReflectionX(a)}getReflectionY(a){C3X$jscomp$30.RequireFiniteNumber(a); return map$jscomp$26.get(this)._GetRayReflectionY(a)}getReflection(a){C3X$jscomp$30.RequireFiniteNumber(a);const b=map$jscomp$26.get(this);return[b._GetRayReflectionX(a),b._GetRayReflectionY(a)]}get reflectionAngle(){return map$jscomp$26.get(this)._GetRayReflectionAngle()}};const C3$jscomp$304=self.C3,lToPick=new Set,rToPick$jscomp$1=new Set; C3$jscomp$304.Behaviors.LOS.Cnds={HasLOSToPosition(a,b){return this.HasLOSTo(a,b)},RayIntersected(){return this._ray.DidCollide()},HasLOSBetweenPositions(a,b,c,d,e){return this.HasLOSBetweenPositions(a,b,C3$jscomp$304.toRadians(c),d,e)},HasLOSToObject(a,b){if(!a)return!1;var c=this._runtime.GetCurrentCondition();const d=c.GetEventBlock().IsOrBlock();var e=c.GetRuntime();const g=c.GetObjectClass().GetCurrentSol();a=a.GetCurrentSol();let k=g.GetInstances(),l=a.GetInstances();g.IsSelectAll()?C3$jscomp$304.clearArray(g._GetOwnElseInstances()): d&&(k=e.IsCurrentConditionFirst()&&!g._GetOwnElseInstances().length&&g._GetOwnInstances().length?g._GetOwnInstances():g._GetOwnElseInstances());a.IsSelectAll()?C3$jscomp$304.clearArray(a._GetOwnElseInstances()):d&&(l=e.IsCurrentConditionFirst()&&!a._GetOwnElseInstances().length&&a._GetOwnInstances().length?a._GetOwnInstances():a._GetOwnElseInstances());c=c.IsInverted();e=this.GetSdkType();for(const n of k){let p=!1;const r=e.FindLOSBehavior(n);if(0===l.length)c&&(p=!0);else for(const w of l)n!==w&& C3$jscomp$304.xor(r.HasLOSToInstance(w,b),c)&&(p=!0,rToPick$jscomp$1.add(w));p&&lToPick.add(n)}d?(k===g._GetOwnElseInstances()?g.TransferElseInstancesToOwn(lToPick):(g.AddElseInstances(lToPick,k),g.SetSetPicked(lToPick)),l===a._GetOwnElseInstances()?a.TransferElseInstancesToOwn(rToPick$jscomp$1):(a.AddElseInstances(rToPick$jscomp$1,l),a.SetSetPicked(rToPick$jscomp$1))):(g.SetSetPicked(lToPick),a.SetSetPicked(rToPick$jscomp$1));lToPick.clear();rToPick$jscomp$1.clear();return g.HasAnyInstances()}}; const C3$jscomp$305=self.C3;C3$jscomp$305.Behaviors.LOS.Acts={SetRange(a){this._SetRange(a)},SetCone(a){this._SetConeOfView(C3$jscomp$305.toRadians(a))},CastRay(a,b,c,d,e){this.CastRay(a,b,c,d,e)},AddObstacle(a){this.GetSdkType().AddObstacle(a)},ClearObstacles(){this.GetSdkType().ClearObstacles()}};const C3$jscomp$306=self.C3; C3$jscomp$306.Behaviors.LOS.Exps={Range(){return this._GetRange()},ConeOfView(){return C3$jscomp$306.toDegrees(this._GetConeOfView())},HitX(){return this._GetRayHitX()},HitY(){return this._GetRayHitY()},HitDistance(){return this._GetRayHitDistance()},HitUID(){return this._GetRayHitUID()},NormalX(a){return this._GetRayNormalX(a)},NormalY(a){return this._GetRayNormalY(a)},NormalAngle(){return C3$jscomp$306.toDegrees(this._GetRayNormalAngle())},ReflectionX(a){return this._GetRayReflectionX(a)},ReflectionY(a){return this._GetRayReflectionY(a)}, ReflectionAngle(){return C3$jscomp$306.toDegrees(this._GetRayReflectionAngle())}};"use strict";const C3$jscomp$307=self.C3;C3$jscomp$307.Behaviors.EightDir=class extends C3$jscomp$307.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$308=self.C3;C3$jscomp$308.Behaviors.EightDir.Type=class extends C3$jscomp$308.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}}; const C3$jscomp$309=self.C3,C3X$jscomp$31=self.C3X,IBehaviorInstance$jscomp$3=self.IBehaviorInstance; C3$jscomp$309.Behaviors.EightDir.Instance=class extends C3$jscomp$309.SDKBehaviorInstanceBase{constructor(a,b){super(a);this._simRight=this._simLeft=this._simDown=this._simUp=this._ignoreInput=this._rightKey=this._leftKey=this._downKey=this._upKey=!1;this._dy=this._dx=0;this._maxSpeed=200;this._acc=600;this._dec=500;this._angleMode=this._directions=3;this._allowSliding=!1;this._isEnabled=this._defaultControls=!0;b&&(this._maxSpeed=b[0],this._acc=b[1],this._dec=b[2],this._directions=b[3],this._angleMode= b[4],this._allowSliding=!!b[5],this._defaultControls=!!b[6],this._isEnabled=!!b[7]);this._isEnabled&&this._StartTicking();this._defaultControls&&this._BindEvents()}_BindEvents(){if(!this._disposables){var a=this._runtime.Dispatcher();this._disposables=new C3$jscomp$309.CompositeDisposable(C3$jscomp$309.Disposable.From(a,"keydown",b=>this._OnKeyDown(b.data)),C3$jscomp$309.Disposable.From(a,"keyup",b=>this._OnKeyUp(b.data)),C3$jscomp$309.Disposable.From(a,"window-blur",()=>this._OnWindowOrKeyboardBlur()), C3$jscomp$309.Disposable.From(a,"keyboard-blur",()=>this._OnWindowOrKeyboardBlur()))}}_UnBindEvents(){this._disposables&&(this._disposables.Release(),this._disposables=null)}Release(){super.Release()}SaveToJson(){return{dx:this._dx,dy:this._dy,e:this._isEnabled,ms:this._maxSpeed,acc:this._acc,dec:this._dec,d:this._directions,am:this._angleMode,dc:this._defaultControls,ii:this._ignoreInput}}LoadFromJson(a){this._dx=a.dx;this._dy=a.dy;this._SetEnabled(a.e);this._maxSpeed=a.ms;this._acc=a.acc;this._dec= a.dec;this._directions=a.d;this._angleMode=a.am;this._defaultControls=a.dc;this._ignoreInput=a.ii;this._simRight=this._simLeft=this._simDown=this._simUp=this._rightKey=this._leftKey=this._downKey=this._upKey=!1;this._defaultControls?this._BindEvents():this._UnBindEvents()}_OnKeyDown(a){switch(a.key){case "ArrowLeft":this._leftKey=!0;break;case "ArrowUp":this._upKey=!0;break;case "ArrowRight":this._rightKey=!0;break;case "ArrowDown":this._downKey=!0}}_OnKeyUp(a){switch(a.key){case "ArrowLeft":this._leftKey= !1;break;case "ArrowUp":this._upKey=!1;break;case "ArrowRight":this._rightKey=!1;break;case "ArrowDown":this._downKey=!1}}_OnWindowOrKeyboardBlur(){this._rightKey=this._leftKey=this._downKey=this._upKey=!1}Tick(){var a=this._runtime.GetDt(this._inst);const b=this._runtime.GetCollisionEngine();var c=this._leftKey||this._simLeft,d=this._rightKey||this._simRight,e=this._upKey||this._simUp,g=this._downKey||this._simDown;this._simDown=this._simUp=this._simRight=this._simLeft=!1;if(this._isEnabled){var k= b.TestOverlapSolid(this._inst);if(k&&(b.RegisterCollision(this._inst,k),!b.PushOutSolidNearest(this._inst)))return;this._ignoreInput&&(c=d=e=g=!1);0===this._directions?c=d=!1:1===this._directions&&(e=g=!1);2===this._directions&&(e||g)&&(c=d=!1);c===d&&(0>this._dx?this._dx=Math.min(this._dx+this._dec*a,0):0<this._dx&&(this._dx=Math.max(this._dx-this._dec*a,0)));e===g&&(0>this._dy?this._dy=Math.min(this._dy+this._dec*a,0):0<this._dy&&(this._dy=Math.max(this._dy-this._dec*a,0)));var l=0,n=0;c&&!d&&(l= 0<this._dx?-(this._acc+this._dec):-this._acc);d&&!c&&(l=0>this._dx?this._acc+this._dec:this._acc);e&&!g&&(n=0<this._dy?-(this._acc+this._dec):-this._acc);g&&!e&&(n=0>this._dy?this._acc+this._dec:this._acc);this._dx+=l*a;this._dy+=n*a;if(0!==this._dx||0!==this._dy){e=Math.hypot(this._dx,this._dy);c=Math.atan2(this._dy,this._dx);var p=this._maxSpeed*Math.cos(c),r=this._maxSpeed*Math.sin(c);e>this._maxSpeed&&(e=this._maxSpeed,this._dx=p,this._dy=r);c=this._inst.GetWorldInfo();g=c.GetX();const C=c.GetY(); d=c.GetAngle();p=Math.abs(p)*a;r=Math.abs(r)*a;l=C3$jscomp$309.clamp(this._dx*a+.5*l*a*a,-p,p);n=C3$jscomp$309.clamp(this._dy*a+.5*n*a*a,-r,r);if(this._allowSliding){if(c.OffsetXY(l,n),c.SetBboxChanged(),k=b.TestOverlapSolid(this._inst)){b.RegisterCollision(this._inst,k);var w=Math.atan2(this._dy,this._dx)+Math.PI/2;r=!1;p=(c.GetWidth()+c.GetHeight())/4;if(b.PushOutSolidAxis(this._inst,Math.cos(w),Math.sin(w),Math.max(2.5*e*a,p))){r=!0;w=c.GetX();var y=c.GetY();k=e*a;var B=C3$jscomp$309.distanceTo(g, C,w,y);B>1.01*k&&(B=k/B,k=C3$jscomp$309.lerp(g,w,B),B=C3$jscomp$309.lerp(C,y,B),c.SetXY(k,B),c.SetBboxChanged(),k=b.TestOverlapSolid(this._inst))&&(y=C3$jscomp$309.angleTo(g,C,w,y)+Math.PI/2,w=Math.cos(y),y=Math.sin(y),k=(c.GetWidth()+c.GetHeight())/2/10,b.PushOutSolidAxis(this._inst,w,y,Math.max(k,1))||(c.SetXY(g,C),c.SetBboxChanged(),r=!1))}r||(r=Math.hypot(l,n),this._dy=this._dx=0,b.PushOutSolid(this._inst,-l/r,-n/r,Math.max(2.5*e*a,p))||(c.SetXY(g,C),c.SetBboxChanged()))}}else{c.OffsetX(l);c.SetBboxChanged(); if(k=b.TestOverlapSolid(this._inst))b.PushOutSolid(this._inst,0>this._dx?1:-1,0,Math.max(Math.abs(Math.floor(l)),1))||(c.SetX(g),c.SetBboxChanged()),this._dx=0,b.RegisterCollision(this._inst,k);c.OffsetY(n);c.SetBboxChanged();if(k=b.TestOverlapSolid(this._inst))b.PushOutSolid(this._inst,0,0>this._dy?1:-1,Math.max(Math.abs(Math.floor(n)),1))||(c.SetY(C),c.SetBboxChanged()),this._dy=0,b.RegisterCollision(this._inst,k)}a=C3$jscomp$309.roundToDp(this._dx,6);e=C3$jscomp$309.roundToDp(this._dy,6);0===a&& 0===e||!this._inst.GetPlugin().IsRotatable()||(1===this._angleMode?c.SetAngle(C3$jscomp$309.toRadians(90*Math.round(C3$jscomp$309.toDegrees(Math.atan2(e,a))/90))):2===this._angleMode?c.SetAngle(C3$jscomp$309.toRadians(45*Math.round(C3$jscomp$309.toDegrees(Math.atan2(e,a))/45))):3===this._angleMode&&c.SetAngle(Math.atan2(e,a)));c.SetBboxChanged();c.GetAngle()!=d&&(k=b.TestOverlapSolid(this._inst))&&(c.SetAngle(d),c.SetBboxChanged(),b.RegisterCollision(this._inst,k))}}}GetPropertyValueByIndex(a){switch(a){case 0:return this._GetMaxSpeed(); case 1:return this._GetAcceleration();case 2:return this._GetDeceleration();case 3:return this._directions;case 4:return this._angleMode;case 5:return this._allowSliding;case 6:return this._IsDefaultControls();case 7:return this._IsEnabled()}}SetPropertyValueByIndex(a,b){switch(a){case 0:this._SetMaxSpeed(b);break;case 1:this._SetAcceleration(b);break;case 2:this._SetDeceleration(b);break;case 3:this._directions=b;break;case 4:this._angleMode=b;break;case 5:this._allowSliding=!!b;break;case 6:this._SetDefaultControls(!!b); break;case 7:this._SetEnabled(!!b)}}_Stop(){this._dy=this._dx=0}_Reverse(){this._dx*=-1;this._dy*=-1}_MaybeClampSpeed(){const a=Math.hypot(this._dx,this._dy);a>this._maxSpeed&&this._SetSpeed(a)}_SetSpeed(a){a=C3$jscomp$309.clamp(a,0,this._maxSpeed);const b=Math.atan2(this._dy,this._dx);this._dx=a*Math.cos(b);this._dy=a*Math.sin(b)}_GetSpeed(){return Math.hypot(this._dx,this._dy)}_SetMaxSpeed(a){this._maxSpeed=Math.max(a,0)}_GetMaxSpeed(){return this._maxSpeed}_SetAcceleration(a){this._acc=Math.max(a, 0)}_GetAcceleration(){return this._acc}_SetDeceleration(a){this._dec=Math.max(a,0)}_GetDeceleration(){return this._dec}_GetMovingAngle(){return Math.atan2(this._dy,this._dx)}_SetVectorX(a){this._dx=a;this._MaybeClampSpeed()}_GetVectorX(){return this._dx}_SetVectorY(a){this._dy=a;this._MaybeClampSpeed()}_GetVectorY(){return this._dy}_SimulateControl(a){if(this._isEnabled)switch(a){case 0:this._simLeft=!0;break;case 1:this._simRight=!0;break;case 2:this._simUp=!0;break;case 3:this._simDown=!0}}_SetDefaultControls(a){a= !!a;this._defaultControls!==a&&((this._defaultControls=a)?this._BindEvents():(this._UnBindEvents(),this._OnWindowOrKeyboardBlur()))}_IsDefaultControls(){return this._defaultControls}_SetIgnoreInput(a){this._ignoreInput=!!a}_IsIgnoreInput(){return this._ignoreInput}_SetEnabled(a){(this._isEnabled=!!a)?this._StartTicking():(this._simDown=this._simUp=this._simRight=this._simLeft=!1,this._StopTicking())}_IsEnabled(){return this._isEnabled}_SetAllowSliding(a){this._allowSliding=!!a}_IsAllowSliding(){return this._allowSliding}GetDebuggerProperties(){return[{title:"$"+ this.GetBehaviorType().GetName(),properties:[{name:"behaviors.eightdir.debugger.vector-x",value:this._GetVectorX(),onedit:a=>this._SetVectorX(a)},{name:"behaviors.eightdir.debugger.vector-y",value:this._GetVectorY(),onedit:a=>this._SetVectorY(a)},{name:"behaviors.eightdir.debugger.speed",value:this._GetSpeed(),onedit:a=>this._SetSpeed(a)},{name:"behaviors.eightdir.debugger.angle-of-motion",value:C3$jscomp$309.toDegrees(this._GetMovingAngle())},{name:"behaviors.eightdir.properties.max-speed.name", value:this._GetMaxSpeed(),onedit:a=>this._SetMaxSpeed(a)},{name:"behaviors.eightdir.properties.acceleration.name",value:this._GetAcceleration(),onedit:a=>this._SetAcceleration(a)},{name:"behaviors.eightdir.properties.deceleration.name",value:this._GetDeceleration(),onedit:a=>this._SetDeceleration(a)},{name:"behaviors.eightdir.properties.allow-sliding.name",value:this._IsAllowSliding(),onedit:a=>this._SetAllowSliding(a)},{name:"behaviors.eightdir.properties.enabled.name",value:this._IsEnabled(),onedit:a=> this._SetEnabled(a)}]}]}GetScriptInterfaceClass(){return self.I8DirectionBehaviorInstance}};const map$jscomp$27=new WeakMap,SIMULATE_CONTROL_MAP=new Map([["left",0],["right",1],["up",2],["down",3]]); self.I8DirectionBehaviorInstance=class extends IBehaviorInstance$jscomp$3{constructor(){super();map$jscomp$27.set(this,IBehaviorInstance$jscomp$3._GetInitInst().GetSdkInstance())}stop(){map$jscomp$27.get(this)._Stop()}reverse(){map$jscomp$27.get(this)._Reverse()}simulateControl(a){C3X$jscomp$31.RequireString(a);a=SIMULATE_CONTROL_MAP.get(a);if("number"!==typeof a)throw Error("invalid control");map$jscomp$27.get(this)._SimulateControl(a)}get speed(){return map$jscomp$27.get(this)._GetSpeed()}set speed(a){C3X$jscomp$31.RequireFiniteNumber(a); map$jscomp$27.get(this)._SetSpeed(a)}get maxSpeed(){return map$jscomp$27.get(this)._GetMaxSpeed()}set maxSpeed(a){C3X$jscomp$31.RequireFiniteNumber(a);map$jscomp$27.get(this)._SetMaxSpeed(a)}get acceleration(){return map$jscomp$27.get(this)._GetAcceleration()}set acceleration(a){C3X$jscomp$31.RequireFiniteNumber(a);map$jscomp$27.get(this)._SetAcceleration(a)}get deceleration(){return map$jscomp$27.get(this)._GetDeceleration()}set deceleration(a){C3X$jscomp$31.RequireFiniteNumber(a);map$jscomp$27.get(this)._SetDeceleration(a)}get vectorX(){return map$jscomp$27.get(this)._GetVectorX()}set vectorX(a){C3X$jscomp$31.RequireFiniteNumber(a); map$jscomp$27.get(this)._SetVectorX(a)}get vectorY(){return map$jscomp$27.get(this)._GetVectorY()}set vectorY(a){C3X$jscomp$31.RequireFiniteNumber(a);map$jscomp$27.get(this)._SetVectorY(a)}setVector(a,b){C3X$jscomp$31.RequireFiniteNumber(a);C3X$jscomp$31.RequireFiniteNumber(b);const c=map$jscomp$27.get(this);c._SetVectorX(a);c._SetVectorY(b)}getVector(){const a=map$jscomp$27.get(this);return[a._GetVectorX(),a._GetVectorY()]}get isDefaultControls(){return map$jscomp$27.get(this)._IsDefaultControls()}set isDefaultControls(a){map$jscomp$27.get(this)._SetDefaultControls(!!a)}get isIgnoringInput(){return map$jscomp$27.get(this)._IsIgnoreInput()}set isIgnoringInput(a){map$jscomp$27.get(this)._SetIgnoreInput(!!a)}get isAllowSliding(){return map$jscomp$27.get(this)._IsAllowSliding()}set isAllowSliding(a){map$jscomp$27.get(this)._SetAllowSliding(!!a)}get isEnabled(){return map$jscomp$27.get(this)._IsEnabled()}set isEnabled(a){map$jscomp$27.get(this)._SetEnabled(!!a)}}; const C3$jscomp$310=self.C3;C3$jscomp$310.Behaviors.EightDir.Cnds={IsMoving(){return 1E-10<this._GetSpeed()},CompareSpeed(a,b){return C3$jscomp$310.compare(this._GetSpeed(),a,b)},IsEnabled(){return this._IsEnabled()},IsAllowSliding(){return this._IsAllowSliding()}}; self.C3.Behaviors.EightDir.Acts={Stop(){this._Stop()},Reverse(){this._Reverse()},SetIgnoreInput(a){this._SetIgnoreInput(a)},SetSpeed(a){this._SetSpeed(a)},SetMaxSpeed(a){this._SetMaxSpeed(a)},SetAcceleration(a){this._SetAcceleration(a)},SetDeceleration(a){this._SetDeceleration(a)},SimulateControl(a){this._SimulateControl(a)},SetEnabled(a){this._SetEnabled(a)},SetVectorX(a){this._SetVectorX(a)},SetVectorY(a){this._SetVectorY(a)},SetDefaultControls(a){this._SetDefaultControls(!!a)},SetAllowSliding(a){this._SetAllowSliding(a)}}; const C3$jscomp$312=self.C3;C3$jscomp$312.Behaviors.EightDir.Exps={Speed(){return this._GetSpeed()},MaxSpeed(){return this._GetMaxSpeed()},Acceleration(){return this._GetAcceleration()},Deceleration(){return this._GetDeceleration()},MovingAngle(){return C3$jscomp$312.toDegrees(this._GetMovingAngle())},VectorX(){return this._GetVectorX()},VectorY(){return this._GetVectorY()}};"use strict";const C3$jscomp$313=self.C3;C3$jscomp$313.Behaviors.Timer=class extends C3$jscomp$313.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}}; const C3$jscomp$314=self.C3;C3$jscomp$314.Behaviors.Timer.Type=class extends C3$jscomp$314.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};const C3$jscomp$315=self.C3,C3X$jscomp$32=self.C3X,IBehaviorInstance$jscomp$4=self.IBehaviorInstance; C3$jscomp$315.Behaviors.Timer.SingleTimer=class{constructor(a,b,c,d){this._current=C3$jscomp$315.New(C3$jscomp$315.KahanSum);this._current.Set(a||0);this._total=C3$jscomp$315.New(C3$jscomp$315.KahanSum);this._total.Set(b||0);this._duration=c||0;this._isRegular=!!d;this._isPaused=!1}GetCurrentTime(){return this._current.Get()}GetTotalTime(){return this._total.Get()}GetDuration(){return this._duration}SetPaused(a){this._isPaused=!!a}IsPaused(){return this._isPaused}Add(a){this._current.Add(a);this._total.Add(a)}HasFinished(){return this._current.Get()>= this._duration}Update(){if(this.HasFinished())if(this._isRegular)this._current.Subtract(this._duration);else return!0;return!1}SaveToJson(){return{c:this._current.Get(),t:this._total.Get(),d:this._duration,r:this._isRegular,p:this._isPaused}}LoadFromJson(a){this._current.Set(a.c);this._total.Set(a.t);this._duration=a.d;this._isRegular=!!a.r;this._isPaused=!!a.p}}; C3$jscomp$315.Behaviors.Timer.Instance=class extends C3$jscomp$315.SDKBehaviorInstanceBase{constructor(a,b){super(a);this._timers=new Map}Release(){this._timers.clear();super.Release()}_StartTimer(a,b,c){a=new C3$jscomp$315.Behaviors.Timer.SingleTimer(0,0,a,c);this._timers.set(b.toLowerCase(),a);this._UpdateTickState()}_StopTimer(a){this._timers.delete(a.toLowerCase());this._UpdateTickState()}_StopAllTimers(){this._timers.clear();this._UpdateTickState()}_IsTimerRunning(a){return this._timers.has(a.toLowerCase())}_GetTimerCurrentTime(a){return(a= this._timers.get(a.toLowerCase()))?a.GetCurrentTime():0}_GetTimerTotalTime(a){return(a=this._timers.get(a.toLowerCase()))?a.GetTotalTime():0}_GetTimerDuration(a){return(a=this._timers.get(a.toLowerCase()))?a.GetDuration():0}_HasTimerFinished(a){return(a=this._timers.get(a.toLowerCase()))?a.HasFinished():!1}_SetTimerPaused(a,b){(a=this._timers.get(a.toLowerCase()))&&a.SetPaused(b)}_IsTimerPaused(a){return(a=this._timers.get(a.toLowerCase()))?a.IsPaused():!1}_UpdateTickState(){0<this._timers.size?(this._StartTicking(), this._StartTicking2()):(this._StopTicking(),this._StopTicking2())}SaveToJson(){const a={};for(const [b,c]of this._timers.entries())a[b]=c.SaveToJson();return a}LoadFromJson(a){this._timers.clear();for(const [b,c]of Object.entries(a))a=new C3$jscomp$315.Behaviors.Timer.SingleTimer,a.LoadFromJson(c),this._timers.set(b,a);this._UpdateTickState()}Tick(){const a=this._runtime.GetDt(this._inst);for(const [b,c]of this._timers)c.IsPaused()||(c.Add(a),c.HasFinished()&&this.DispatchScriptEvent("timer",!1,{tag:b}))}Tick2(){for(const [a, b]of this._timers.entries())b.Update()&&this._timers.delete(a)}GetDebuggerProperties(){return[{title:"behaviors.timer.debugger.timers",properties:[...this._timers.entries()].map(a=>({name:"$"+a[0],value:`${Math.round(10*a[1].GetCurrentTime())/10} / ${Math.round(10*a[1].GetDuration())/10}`}))}]}GetScriptInterfaceClass(){return self.ITimerBehaviorInstance}};const map$jscomp$28=new WeakMap,VALID_TIMER_TYPES=["once","regular"]; self.ITimerBehaviorInstance=class extends IBehaviorInstance$jscomp$4{constructor(){super();map$jscomp$28.set(this,IBehaviorInstance$jscomp$4._GetInitInst().GetSdkInstance())}startTimer(a,b,c="once"){C3X$jscomp$32.RequireFiniteNumber(a);C3X$jscomp$32.RequireString(b);c=VALID_TIMER_TYPES.indexOf(c);if(-1===c)throw Error("invalid type");map$jscomp$28.get(this)._StartTimer(a,b,1===c)}setTimerPaused(a,b){C3X$jscomp$32.RequireString(a);map$jscomp$28.get(this)._SetTimerPaused(a,!!b)}stopTimer(a){C3X$jscomp$32.RequireString(a); map$jscomp$28.get(this)._StopTimer(a)}stopAllTimers(){map$jscomp$28.get(this)._StopAllTimers()}isTimerRunning(a){C3X$jscomp$32.RequireString(a);return map$jscomp$28.get(this)._IsTimerRunning(a)}isTimerPaused(a){C3X$jscomp$32.RequireString(a);return map$jscomp$28.get(this)._IsTimerPaused(a)}getCurrentTime(a){C3X$jscomp$32.RequireString(a);return map$jscomp$28.get(this)._GetTimerCurrentTime(a)}getTotalTime(a){C3X$jscomp$32.RequireString(a);return map$jscomp$28.get(this)._GetTimerTotalTime(a)}getDuration(a){C3X$jscomp$32.RequireString(a); return map$jscomp$28.get(this)._GetTimerDuration(a)}hasFinished(a){C3X$jscomp$32.RequireString(a);return map$jscomp$28.get(this)._HasTimerFinished(a)}};self.C3.Behaviors.Timer.Cnds={OnTimer(a){return this._HasTimerFinished(a)},IsTimerRunning(a){return this._IsTimerRunning(a)},IsTimerPaused(a){return this._IsTimerPaused(a)}}; self.C3.Behaviors.Timer.Acts={StartTimer(a,b,c){this._StartTimer(a,c,1===b)},StopTimer(a){this._StopTimer(a)},StopAllTimers(){this._StopAllTimers()},PauseResumeTimer(a,b){this._SetTimerPaused(a,0===b)}};self.C3.Behaviors.Timer.Exps={CurrentTime(a){return this._GetTimerCurrentTime(a)},TotalTime(a){return this._GetTimerTotalTime(a)},Duration(a){return this._GetTimerDuration(a)}};"use strict";const C3$jscomp$319=self.C3;C3$jscomp$319.Behaviors.Pin=class extends C3$jscomp$319.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}}; const C3$jscomp$320=self.C3;C3$jscomp$320.Behaviors.Pin.Type=class extends C3$jscomp$320.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};const C3$jscomp$321=self.C3; C3$jscomp$321.Behaviors.Pin.Instance=class extends C3$jscomp$321.SDKBehaviorInstanceBase{constructor(a,b){super(a);this._pinInst=null;this._pinUid=-1;this._mode="";this._propSet=new Set;this._lastKnownAngle=this._dz=this._dAngle=this._dHeight=this._dWidth=this._dy=this._dx=this._pinImagePoint=this._pinAngle=this._pinDist=0;this._destroy=!1;b&&(this._destroy=b[0]);a=this._runtime.Dispatcher();this._disposables=new C3$jscomp$321.CompositeDisposable(C3$jscomp$321.Disposable.From(a,"instancedestroy", c=>this._OnInstanceDestroyed(c.instance)),C3$jscomp$321.Disposable.From(a,"afterload",c=>this._OnAfterLoad()))}Release(){this._pinInst=null;super.Release()}_SetPinInst(a){a?(this._pinInst=a,this._StartTicking2()):(this._pinInst=null,this._StopTicking2())}_Pin(a,b,c){if(a&&(a=a.GetFirstPicked(this._inst)))if(this._mode=b,this._SetPinInst(a),b=this._inst.GetWorldInfo(),a=a.GetWorldInfo(),"properties"===this._mode){const d=this._propSet;d.clear();for(const e of c)d.add(e);this._dx=b.GetX()-a.GetX(); this._dy=b.GetY()-a.GetY();this._dAngle=b.GetAngle()-a.GetAngle();this._lastKnownAngle=b.GetAngle();this._dz=b.GetZElevation()-a.GetZElevation();d.has("x")&&d.has("y")&&(this._pinAngle=C3$jscomp$321.angleTo(a.GetX(),a.GetY(),b.GetX(),b.GetY())-a.GetAngle(),this._pinDist=C3$jscomp$321.distanceTo(a.GetX(),a.GetY(),b.GetX(),b.GetY()));d.has("width-abs")?this._dWidth=b.GetWidth()-a.GetWidth():d.has("width-scale")&&(this._dWidth=b.GetWidth()/a.GetWidth());d.has("height-abs")?this._dHeight=b.GetHeight()- a.GetHeight():d.has("height-scale")&&(this._dHeight=b.GetHeight()/a.GetHeight())}else this._pinDist=C3$jscomp$321.distanceTo(a.GetX(),a.GetY(),b.GetX(),b.GetY())}SaveToJson(){const a=this._propSet,b=this._mode,c={uid:this._pinInst?this._pinInst.GetUID():-1,m:b,d:this._destroy};if("rope"===b||"bar"===b)c.pd=this._pinDist;else if("properties"===b){c.ps=[...this._propSet];a.has("imagepoint")?c.ip=this._pinImagePoint:a.has("x")&&a.has("y")?(c.pa=this._pinAngle,c.pd=this._pinDist):(a.has("x")&&(c.dx=this._dx), a.has("y")&&(c.dy=this._dy));a.has("angle")&&(c.da=this._dAngle,c.lka=this._lastKnownAngle);if(a.has("width-abs")||a.has("width-scale"))c.dw=this._dWidth;if(a.has("height-abs")||a.has("height-scale"))c.dh=this._dHeight;a.has("z")&&(c.dz=this._dz)}return c}LoadFromJson(a){const b=a.m,c=this._propSet;c.clear();this._pinUid=a.uid;if("number"===typeof b)this._LoadFromJson_Legacy(a);else if(this._mode=b,a.hasOwnProperty("d")&&(this._destroy=!!a.d),"rope"===b||"bar"===b)this._pinDist=a.pd;else if("properties"=== b){for(const d of a.ps)c.add(d);c.has("imagepoint")?this._pinImagePoint=a.ip:c.has("x")&&c.has("y")?(this._pinAngle=a.pa,this._pinDist=a.pd):(c.has("x")&&(this._dx=a.dx),c.has("y")&&(this._dy=a.dy));c.has("angle")&&(this._dAngle=a.da,this._lastKnownAngle=a.lka||0);if(c.has("width-abs")||c.has("width-scale"))this._dWidth=a.dw;if(c.has("height-abs")||c.has("height-scale"))this._dHeight=a.dh;c.has("z")&&(this._dz=a.dz)}}_LoadFromJson_Legacy(a){const b=this._propSet,c=a.msa,d=a.tsa,e=a.pa,g=a.pd;switch(a.m){case 0:this._mode= "properties";b.add("x").add("y").add("angle");this._pinAngle=e;this._pinDist=g;this._dAngle=c-d;this._lastKnownAngle=a.lka;break;case 1:this._mode="properties";b.add("x").add("y");this._pinAngle=e;this._pinDist=g;break;case 2:this._mode="properties";b.add("angle");this._dAngle=c-d;this._lastKnownAngle=a.lka;break;case 3:this._mode="rope";this._pinDist=a.pd;break;case 4:this._mode="bar",this._pinDist=a.pd}}_OnAfterLoad(){-1===this._pinUid?this._SetPinInst(null):(this._SetPinInst(this._runtime.GetInstanceByUID(this._pinUid)), this._pinUid=-1)}_OnInstanceDestroyed(a){this._pinInst===a&&(this._SetPinInst(null),this._destroy&&this._runtime.DestroyInstance(this._inst))}Tick2(){var a=this._pinInst;if(a){var b=a.GetWorldInfo(),c=this._inst.GetWorldInfo(),d=this._mode,e=!1;if("rope"===d||"bar"===d){if(a=C3$jscomp$321.distanceTo(c.GetX(),c.GetY(),b.GetX(),b.GetY()),a>this._pinDist||"bar"===d&&a<this._pinDist)e=C3$jscomp$321.angleTo(b.GetX(),b.GetY(),c.GetX(),c.GetY()),c.SetXY(b.GetX()+Math.cos(e)*this._pinDist,b.GetY()+Math.sin(e)* this._pinDist),e=!0}else{d=this._propSet;if(d.has("imagepoint")){const [g,k]=a.GetImagePoint(this._pinImagePoint);c.EqualsXY(g,k)||(c.SetXY(g,k),e=!0)}else if(d.has("x")&&d.has("y")){a=b.GetX()+Math.cos(b.GetAngle()+this._pinAngle)*this._pinDist;const g=b.GetY()+Math.sin(b.GetAngle()+this._pinAngle)*this._pinDist;c.EqualsXY(a,g)||(c.SetXY(a,g),e=!0)}else a=b.GetX()+this._dx,d.has("x")&&a!==c.GetX()&&(c.SetX(a),e=!0),a=b.GetY()+this._dy,d.has("y")&&a!==c.GetY()&&(c.SetY(a),e=!0);d.has("angle")&&(this._lastKnownAngle!== c.GetAngle()&&(this._dAngle=C3$jscomp$321.clampAngle(this._dAngle+(c.GetAngle()-this._lastKnownAngle))),a=C3$jscomp$321.clampAngle(b.GetAngle()+this._dAngle),a!==c.GetAngle()&&(c.SetAngle(a),e=!0),this._lastKnownAngle=c.GetAngle());d.has("width-abs")&&(a=b.GetWidth()+this._dWidth,a!==c.GetWidth()&&(c.SetWidth(a),e=!0));d.has("width-scale")&&(a=b.GetWidth()*this._dWidth,a!==c.GetWidth()&&(c.SetWidth(a),e=!0));d.has("height-abs")&&(a=b.GetHeight()+this._dHeight,a!==c.GetHeight()&&(c.SetHeight(a),e= !0));d.has("height-scale")&&(a=b.GetHeight()*this._dHeight,a!==c.GetHeight()&&(c.SetHeight(a),e=!0));d.has("z")&&(a=b.GetZElevation()+this._dz,a!==c.GetZElevation()&&(c.SetZElevation(a),this._runtime.UpdateRender()))}e&&c.SetBboxChanged()}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.pin.debugger.is-pinned",value:!!this._pinInst},{name:"behaviors.pin.debugger.pinned-uid",value:this._pinInst?this._pinInst.GetUID():0}]}]}}; self.C3.Behaviors.Pin.Cnds={IsPinned(){return!!this._pinInst},WillDestroy(){return this._destroy}}; self.C3.Behaviors.Pin.Acts={PinByDistance(a,b){this._Pin(a,0===b?"rope":"bar")},PinByProperties(a,b,c,d,e,g,k){const l=[];b&&l.push("x");c&&l.push("y");d&&l.push("angle");k&&l.push("z");1===e?l.push("width-abs"):2===e&&l.push("width-scale");1===g?l.push("height-abs"):2===g&&l.push("height-scale");0!==l.length&&this._Pin(a,"properties",l)},PinByImagePoint(a,b,c,d,e,g){const k=["imagepoint"];c&&k.push("angle");g&&k.push("z");1===d?k.push("width-abs"):2===d&&k.push("width-scale");1===e?k.push("height-abs"): 2===e&&k.push("height-scale");this._pinImagePoint=b;this._Pin(a,"properties",k)},SetPinDistance(a){if("rope"===this._mode||"bar"===this._mode)this._pinDist=Math.max(a,0)},SetDestroy(a){this._destroy=a},Unpin(){this._SetPinInst(null);this._mode="";this._propSet.clear();this._pinImagePoint=""},Pin(a,b){switch(b){case 0:this._Pin(a,"properties",["x","y","angle"]);break;case 1:this._Pin(a,"properties",["x","y"]);break;case 2:this._Pin(a,"properties",["angle"]);break;case 3:this._Pin(a,"rope");break;case 4:this._Pin(a, "bar")}}};self.C3.Behaviors.Pin.Exps={PinnedUID(){return this._pinInst?this._pinInst.GetUID():-1}};"use strict";const C3$jscomp$325=self.C3;C3$jscomp$325.Behaviors.Fade=class extends C3$jscomp$325.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$326=self.C3;C3$jscomp$326.Behaviors.Fade.Type=class extends C3$jscomp$326.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}}; const C3$jscomp$327=self.C3,C3X$jscomp$33=self.C3X,IBehaviorInstance$jscomp$5=self.IBehaviorInstance; C3$jscomp$327.Behaviors.Fade.Instance=class extends C3$jscomp$327.SDKBehaviorInstanceBase{constructor(a,b){super(a);this._fadeOutTime=this._waitTime=this._fadeInTime=0;this._activeAtStart=this._destroy=!0;this._setMaxOpacity=!1;this._stage=0;this._stageTime=C3$jscomp$327.New(C3$jscomp$327.KahanSum);this._maxOpacity=this._inst.GetWorldInfo().GetOpacity()||1;b&&(this._fadeInTime=b[0],this._waitTime=b[1],this._fadeOutTime=b[2],this._destroy=!!b[3],this._stage=(this._activeAtStart=!!b[4])?0:3);this._activeAtStart&& (0===this._fadeInTime?(this._stage=1,0===this._waitTime&&(this._stage=2)):(this._inst.GetWorldInfo().SetOpacity(0),this._runtime.UpdateRender()));this._StartTicking()}Release(){super.Release()}SaveToJson(){return{fit:this._fadeInTime,wt:this._waitTime,fot:this._fadeOutTime,d:this._destroy,s:this._stage,st:this._stageTime.Get(),mo:this._maxOpacity}}LoadFromJson(a){this._fadeInTime=a.fit;this._waitTime=a.wt;this._fadeOutTime=a.fot;this._destroy=a.d;this._stage=a.s;this._stageTime.Set(a.st);this._maxOpacity= a.mo;3===this._stage?this._StopTicking():this._StartTicking()}Tick(){var a=this._runtime.GetDt(this._inst);this._stageTime.Add(a);a=this._inst.GetWorldInfo();0===this._stage&&(a.SetOpacity(this._stageTime.Get()/this._fadeInTime*this._maxOpacity),this._runtime.UpdateRender(),a.GetOpacity()>=this._maxOpacity&&(a.SetOpacity(this._maxOpacity),this._stage=1,this._stageTime.Reset(),this.DispatchScriptEvent("fadeinend"),this.Trigger(C3$jscomp$327.Behaviors.Fade.Cnds.OnFadeInEnd)));1===this._stage&&this._stageTime.Get()>= this._waitTime&&(this._stage=2,this._stageTime.Reset(),this.DispatchScriptEvent("waitend"),this.Trigger(C3$jscomp$327.Behaviors.Fade.Cnds.OnWaitEnd));2===this._stage&&(0!==this._fadeOutTime?(a.SetOpacity(this._maxOpacity-this._stageTime.Get()/this._fadeOutTime*this._maxOpacity),this._runtime.UpdateRender(),0>=a.GetOpacity()&&(this._stage=3,this._stageTime.Reset(),this.DispatchScriptEvent("fadeoutend"),this.Trigger(C3$jscomp$327.Behaviors.Fade.Cnds.OnFadeOutEnd),this._destroy&&this._runtime.DestroyInstance(this._inst))): (this._stage=3,this._stageTime.Reset()));3===this._stage&&this._StopTicking()}_StartFade(){this._activeAtStart||this._setMaxOpacity||(this._maxOpacity=this._inst.GetWorldInfo().GetOpacity()||1,this._setMaxOpacity=!0);3===this._stage&&this.Start()}_RestartFade(){this.Start()}Start(){this._stage=0;this._stageTime.Reset();0===this._fadeInTime?(this._stage=1,0===this._waitTime&&(this._stage=2)):(this._inst.GetWorldInfo().SetOpacity(0),this._runtime.UpdateRender());this._StartTicking()}_SetFadeInTime(a){this._fadeInTime= Math.max(a,0)}_GetFadeInTime(){return this._fadeInTime}_SetWaitTime(a){this._waitTime=Math.max(a,0)}_GetWaitTime(){return this._waitTime}_SetFadeOutTime(a){this._fadeOutTime=Math.max(a,0)}_GetFadeOutTime(){return this._fadeOutTime}GetPropertyValueByIndex(a){switch(a){case 0:return this._GetFadeInTime();case 1:return this._GetWaitTime();case 2:return this._GetFadeOutTime();case 3:return this._destroy}}SetPropertyValueByIndex(a,b){switch(a){case 0:this._SetFadeInTime(b);break;case 1:this._SetWaitTime(b); break;case 2:this._SetFadeOutTime(b);break;case 3:this._destroy=!!b}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.fade.properties.fade-in-time.name",value:this._GetFadeInTime(),onedit:a=>this._SetFadeInTime(a)},{name:"behaviors.fade.properties.wait-time.name",value:this._GetWaitTime(),onedit:a=>this._SetWaitTime(a)},{name:"behaviors.fade.properties.fade-out-time.name",value:this._GetFadeOutTime(),onedit:a=>this._SetFadeOutTime(a)},{name:"behaviors.fade.debugger.stage", value:["behaviors.fade.debugger."+["fade-in","wait","fade-out","done"][this._stage]]}]}]}GetScriptInterfaceClass(){return self.IFadeBehaviorInstance}};const map$jscomp$29=new WeakMap; self.IFadeBehaviorInstance=class extends IBehaviorInstance$jscomp$5{constructor(){super();map$jscomp$29.set(this,IBehaviorInstance$jscomp$5._GetInitInst().GetSdkInstance())}startFade(){map$jscomp$29.get(this)._StartFade()}restartFade(){map$jscomp$29.get(this)._RestartFade()}set fadeInTime(a){C3X$jscomp$33.RequireFiniteNumber(a);map$jscomp$29.get(this)._SetFadeInTime(a)}get fadeInTime(){return map$jscomp$29.get(this)._GetFadeInTime()}set waitTime(a){C3X$jscomp$33.RequireFiniteNumber(a);map$jscomp$29.get(this)._SetWaitTime(a)}get waitTime(){return map$jscomp$29.get(this)._GetWaitTime()}set fadeOutTime(a){C3X$jscomp$33.RequireFiniteNumber(a); map$jscomp$29.get(this)._SetFadeOutTime(a)}get fadeOutTime(){return map$jscomp$29.get(this)._GetFadeOutTime()}};self.C3.Behaviors.Fade.Cnds={OnFadeOutEnd(){return!0},OnFadeInEnd(){return!0},OnWaitEnd(){return!0}};self.C3.Behaviors.Fade.Acts={StartFade(){this._StartFade()},RestartFade(){this._RestartFade()},SetFadeInTime(a){this._SetFadeInTime(a)},SetWaitTime(a){this._SetWaitTime(a)},SetFadeOutTime(a){this._SetFadeOutTime(a)}}; self.C3.Behaviors.Fade.Exps={FadeInTime(){return this._GetFadeInTime()},WaitTime(){return this._GetWaitTime()},FadeOutTime(){return this._GetFadeOutTime()}};"use strict";const C3$jscomp$331=self.C3; C3$jscomp$331.Behaviors.scrollto=class extends C3$jscomp$331.SDKBehaviorBase{constructor(a){super(a);this._shakeMode=this._shakeEnd=this._shakeStart=this._shakeMag=0}Release(){super.Release()}SetShakeMagnitude(a){this._shakeMag=a}GetShakeMagnitude(){return this._shakeMag}SetShakeStart(a){this._shakeStart=a}GetShakeStart(){return this._shakeStart}SetShakeEnd(a){this._shakeEnd=a}GetShakeEnd(){return this._shakeEnd}SetShakeMode(a){this._shakeMode=a}GetShakeMode(){return this._shakeMode}}; const C3$jscomp$332=self.C3;C3$jscomp$332.Behaviors.scrollto.Type=class extends C3$jscomp$332.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};const C3$jscomp$333=self.C3; C3$jscomp$333.Behaviors.scrollto.Instance=class extends C3$jscomp$333.SDKBehaviorInstanceBase{constructor(a,b){super(a);this._isEnabled=!0;b&&(this._isEnabled=b[0]);this._isEnabled&&this._StartTicking2()}Release(){super.Release()}SaveToJson(){const a=this.GetBehavior();return{e:this._isEnabled,smg:a.GetShakeMagnitude(),ss:a.GetShakeStart(),se:a.GetShakeEnd(),smd:a.GetShakeMode()}}LoadFromJson(a){const b=this.GetBehavior();b.SetShakeMagnitude(a.smg);b.SetShakeStart(a.ss);b.SetShakeEnd(a.se);b.SetShakeMode(a.smd); (this._isEnabled=a.e)?this._StartTicking2():this._StopTicking2()}_SetEnabled(a){(this._isEnabled=!!a)?this._StartTicking2():this._StopTicking2()}IsEnabled(){return this._isEnabled}Tick2(){if(this.IsEnabled()){this._runtime.GetDt(this._inst);var a=this.GetBehavior(),b=a.GetInstances(),c=0,d=0,e=0;for(var g of b)(b=g.GetBehaviorInstanceFromCtor(C3$jscomp$333.Behaviors.scrollto))&&b.GetSdkInstance().IsEnabled()&&(b=g.GetWorldInfo(),c+=b.GetX(),d+=b.GetY(),++e);g=this._inst.GetWorldInfo().GetLayout(); var k=this._runtime.GetGameTime(),l=b=0;k>=a.GetShakeStart()&&k<a.GetShakeEnd()&&(b=a.GetShakeMagnitude()*Math.min(this._runtime.GetTimeScale(),1),0===a.GetShakeMode()&&(b*=1-(k-a.GetShakeStart())/(a.GetShakeEnd()-a.GetShakeStart())),a=this._runtime.Random()*Math.PI*2,k=this._runtime.Random()*b,b=Math.cos(a)*k,l=Math.sin(a)*k);g.SetScrollX(c/e+b);g.SetScrollY(d/e+l)}}GetPropertyValueByIndex(a){switch(a){case 0:return this._isEnabled}}SetPropertyValueByIndex(a,b){switch(a){case 0:(this._isEnabled= !!b)?this._StartTicking2():this._StopTicking2()}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.scrollto.properties.enabled.name",value:this.IsEnabled(),onedit:a=>this._SetEnabled(a)}]}]}};self.C3.Behaviors.scrollto.Cnds={IsEnabled(){return this.IsEnabled()}}; self.C3.Behaviors.scrollto.Acts={Shake(a,b,c){const d=this.GetBehavior();d.SetShakeMagnitude(a);d.SetShakeStart(this._runtime.GetGameTime());d.SetShakeEnd(this._runtime.GetGameTime()+b);d.SetShakeMode(c)},SetEnabled(a){this._SetEnabled(0!==a)}};self.C3.Behaviors.scrollto.Exps={};"use strict";const C3$jscomp$337=self.C3;C3$jscomp$337.Behaviors.Flash=class extends C3$jscomp$337.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$338=self.C3; C3$jscomp$338.Behaviors.Flash.Type=class extends C3$jscomp$338.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};const C3$jscomp$339=self.C3,C3X$jscomp$34=self.C3X,IBehaviorInstance$jscomp$6=self.IBehaviorInstance; C3$jscomp$339.Behaviors.Flash.Instance=class extends C3$jscomp$339.SDKBehaviorInstanceBase{constructor(a,b){super(a);this._timeLeft=this._stageTimeLeft=this._stage=this._offTime=this._onTime=0;this._StartTicking()}Release(){super.Release()}_Flash(a,b,c){this._onTime=a;this._offTime=b;this._stage=1;this._stageTimeLeft=b;this._timeLeft=c;this._inst.GetWorldInfo().SetVisible(!1);this._runtime.UpdateRender()}_StopFlashing(){this._timeLeft=0;this._inst.GetWorldInfo().SetVisible(!0);this._runtime.UpdateRender()}_IsFlashing(){return 0< this._timeLeft}SaveToJson(){return{on:this._onTime,off:this._offTime,s:this._stage,stl:this._stageTimeLeft,tl:this._timeLeft}}LoadFromJson(a){this._onTime=a.on;this._offTime=a.off;this._stage=a.s;this._stageTimeLeft=a.stl;this._timeLeft=null===a.tl?Infinity:a.tl}Tick(){if(!(0>=this._timeLeft)){var a=this._runtime.GetDt(this._inst);this._timeLeft-=a;if(0>=this._timeLeft)return this._timeLeft=0,this._inst.GetWorldInfo().SetVisible(!0),this._runtime.UpdateRender(),this.DispatchScriptEvent("flashend"), this.DebugTrigger(C3$jscomp$339.Behaviors.Flash.Cnds.OnFlashEnded);this._stageTimeLeft-=a;0>=this._stageTimeLeft&&(0===this._stage?(this._inst.GetWorldInfo().SetVisible(!1),this._stage=1,this._stageTimeLeft+=this._offTime):(this._inst.GetWorldInfo().SetVisible(!0),this._stage=0,this._stageTimeLeft+=this._onTime),this._runtime.UpdateRender())}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.flash.debugger.on-time",value:this._onTime,onedit:a=> this._onTime=a},{name:"behaviors.flash.debugger.off-time",value:this._offTime,onedit:a=>this._offTime=a},{name:"behaviors.flash.debugger.is-flashing",value:0<this._timeLeft},{name:"behaviors.flash.debugger.time-left",value:this._timeLeft}]}]}GetScriptInterfaceClass(){return self.IFlashBehaviorInstance}};const map$jscomp$30=new WeakMap; self.IFlashBehaviorInstance=class extends IBehaviorInstance$jscomp$6{constructor(){super();map$jscomp$30.set(this,IBehaviorInstance$jscomp$6._GetInitInst().GetSdkInstance())}flash(a,b,c){C3X$jscomp$34.RequireFiniteNumber(a);C3X$jscomp$34.RequireFiniteNumber(b);C3X$jscomp$34.RequireFiniteNumber(c);map$jscomp$30.get(this)._Flash(a,b,c)}stop(){map$jscomp$30.get(this)._StopFlashing()}get isFlashing(){return map$jscomp$30.get(this)._IsFlashing()}}; self.C3.Behaviors.Flash.Cnds={IsFlashing(){return this._IsFlashing()},OnFlashEnded(){return!0}};self.C3.Behaviors.Flash.Acts={Flash(a,b,c){this._Flash(a,b,c)},StopFlashing(){this._StopFlashing()}};self.C3.Behaviors.Flash.Exps={};"use strict";const C3$jscomp$343=self.C3;C3$jscomp$343.Behaviors.Tween=class extends C3$jscomp$343.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$344=self.C3;C3$jscomp$344.Behaviors.Tween.Type=class extends C3$jscomp$344.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}}; const C3$jscomp$345=self.C3,NAMESPACE=C3$jscomp$345.Behaviors.Tween; NAMESPACE.Instance=class extends C3$jscomp$345.SDKBehaviorInstanceBase{constructor(a,b){super(a);this._allowMultiple=!1;this._enabled=!0;b&&(this._allowMultiple=!1,this._enabled=!!b[0]);this._activeTweens=new Map;this._disabledTweens=[];this._waitingForReleaseTweens=new Map;this._waitingForReleaseTweensJson=this._disabledTweensJson=this._activeTweensJson=this._finishingTween=null;this._finishingTweenName="";this._afterLoad=c=>this._OnAfterLoad(c);this.GetRuntime().Dispatcher().addEventListener("afterload", this._afterLoad)}Release(){this.GetRuntime().Dispatcher().removeEventListener("afterload",this._afterLoad);this._afterLoad=null;this._finishingTween&&(this.ReleaseAndCompleteTween(this._finishingTween),this._finishingTween=null);this.ReleaseAndCompleteTweens();this._tweens=null;this.ClearDisabledList();this._disabledTweens=null;this._ReleaseWaitingTweens();this._waitingForReleaseTweens=null;super.Release()}SetEnabled(a){this._enabled=!!a;a?this._waitingForReleaseTweens&&this._waitingForReleaseTweens.size&& this._StartTicking2():this._StopTicking2();for(const b of this.AllTweens())a?this.IsInDisabledList(b)&&b.Resume():((b.IsPlaying()||b.IsScheduled())&&this.AddToDisabledList(b),b.Stop());a&&this.ClearDisabledList()}IsEnabled(){return this._enabled}AddToDisabledList(a){this._disabledTweens.push(a)}IsInDisabledList(a){return this._disabledTweens.includes(a)}ClearDisabledList(){C3$jscomp$345.clearArray(this._disabledTweens)}GetFinishingTween(){return this._finishingTween}IsInstanceValid(){const a=this.GetObjectInstance(); return a?!a.IsDestroyed():!1}GetTween(a,b,c=!1){if((b=b?this.PropertyTweens(b,c):this.AllTweens(c))&&b.length)for(const d of b)if(d.HasTags(a))return d}GetTweenIncludingWaitingForRelease(a,b){return this.GetTween(a,b,!0)}*GetTweens(a,b,c=!1){if((b=b?this.PropertyTweens(b,c):this.AllTweens(c))&&b.length)for(const d of b)d.HasTags(a)&&(yield d)}*GetTweensIncludingWaitingForRelease(a,b){yield*this.GetTweens(a,b,!0)}PropertyTweens(a,b){if(b)return b=this._activeTweens.get(a),a=this._waitingForReleaseTweens.get(a), b||(b=[]),a||(a=[]),b.concat(a).filter(c=>c).filter(c=>!c.IsReleased());(a=this._activeTweens.get(a))||(a=[]);return a.filter(c=>c).filter(c=>!c.IsReleased())}AllTweens(a){if(a){a=[...this._activeTweens.values()].flat();const b=[...this._waitingForReleaseTweens.values()].flat();return a.concat(b).filter(c=>c).filter(c=>!c.IsReleased())}return[...this._activeTweens.values()].flat().filter(b=>b).filter(b=>!b.IsReleased())}AllTweensIncludingWaitingForRelease(){return this.AllTweens(!0)}SaveToJson(){return{s:!1, e:!!this._enabled,at:this._SaveActiveTweensToJson(),dt:this._SaveDisabledTweensToJson(),wt:this._SaveWaitingForReleaseTweensToJson(),ft:this._SaveFinishingTweenToJson()}}LoadFromJson(a){a&&(this._activeTweensJson=a.at,this._disabledTweensJson=a.dt,this._waitingForReleaseTweensJson=a.wt,this._finishingTweenName=a.ft,this._allowMultiple=!1,this._enabled=!!a.e)}_OnAfterLoad(a){a=this.GetRuntime().GetTimelineManager();this._PopulateTweenMap(this._activeTweensJson,this._activeTweens,a);if(this._disabledTweensJson){C3$jscomp$345.clearArray(this._disabledTweens); for(const b of this._disabledTweensJson)this._PopulateTweenArray(this._disabledTweens,b,a)}this._PopulateTweenMap(this._waitingForReleaseTweensJson,this._waitingForReleaseTweens,a);this._finishingTween=this._GetTween(this._finishingTweenName,a);this._enabled?this._waitingForReleaseTweens&&this._waitingForReleaseTweens.size&&this._StartTicking2():this._StopTicking2()}_PopulateTweenMap(a,b,c){if(a)for(const e in a){let g=b.get(e);g?C3$jscomp$345.clearArray(g):g=[];var d=a[e];for(const k of d)this._PopulateTweenArray(g, k.name,c)?this._LoadTweenFromJson(k.name,k,c):(d=C3$jscomp$345.TweenState.Build({runtime:this.GetRuntime(),json:k}),d.AddCompletedCallback(l=>this._FinishTriggers(l)),c.AddScheduledTimeline(d),this._PopulateTweenArray(g,d,c));b.set(e,g)}}_GetTween(a,b){return b.GetScheduledOrPlayingTimelineByName(a)}_PopulateTweenArray(a,b,c){if("string"===typeof b){if(b=this._GetTween(b,c))return!!a.push(b)}else return!!a.push(b);return!1}_LoadTweenFromJson(a,b,c){"string"===typeof a?(a=this._GetTween(a,c))&&a._LoadFromJson(b): a._LoadFromJson(b)}_SaveActiveTweensToJson(){const a={};for(const [b,c]of this._activeTweens)a[b]=c.filter(d=>!d.IsReleased()).map(d=>d._SaveToJson());return a}_SaveDisabledTweensToJson(){return this._disabledTweens.filter(a=>!a.IsReleased()).map(a=>a.GetName())}_SaveWaitingForReleaseTweensToJson(){const a={};for(const [b,c]of this._waitingForReleaseTweens)a[b]=c.map(d=>d._SaveToJson());return a}_SaveFinishingTweenToJson(){return this._finishingTween?this._finishingTween.GetName():""}Tick2(){this._ReleaseWaitingTweens()}CreateTween(a){var b= NAMESPACE.Config.GetPropertyTracksConfig(a.property,a.startValue,a.endValue,a.ease,a.resultMode,this.GetObjectInstance());const c=NAMESPACE.Maps.GetPropertyFromIndex(a.property);NAMESPACE.Maps.IsValueId(c)||this.ReleaseTweens(a.property);b=C3$jscomp$345.TweenState.Build({runtime:this.GetRuntime(),id:c,tags:a.tags,time:a.time,instance:this.GetObjectInstance(),releaseOnComplete:!!a.releaseOnComplete,loop:!!a.loop,pingPong:!!a.pingPong,repeatCount:a.repeatCount,initialValueMode:a.initialValueMode,propertyTracksConfig:b}); b.AddCompletedCallback(d=>this._FinishTriggers(d));this._AddTween(b,a.property);return b}_MaybeRemoveFromActiveTweenMap(a){var b=a.GetId();this._activeTweens.has(b)&&(b=this._activeTweens.get(b))&&(a=b.indexOf(a),-1!==a&&b.splice(a,1))}ReleaseTween(a,b=!1){this._MaybeRemoveFromActiveTweenMap(a);a.IsReleased()||this._IsInWaitingList(a)||(a.Stop(b),this._AddToWaitingList(a))}ReleaseTweens(a,b=!1){if(C3$jscomp$345.IsFiniteNumber(a)){var c=NAMESPACE.Maps.GetPropertyFromIndex(a);if(this._activeTweens.has(c)){c= this._activeTweens.get(c);var d=this.GetFinishingTween();for(var e of c)e===d||e.IsReleased()||this._IsInWaitingList(e)||(e.Stop(b),e.Release());C3$jscomp$345.clearArray(c)}}else{e=this.GetFinishingTween();for(c of this.AllTweens())c===e||c.IsReleased()||this._IsInWaitingList(c)||(c.Stop(b),c.Release());for(d of this._activeTweens.keys())C3$jscomp$345.clearArray(this._activeTweens.get(d)),this._activeTweens.delete(d);this._activeTweens.clear()}}ReleaseAndCompleteTween(a){this.ReleaseTween(a,!0)}ReleaseAndCompleteTweens(){this.ReleaseTweens(NaN, !0)}GetPropertyValueByIndex(a){switch(a){case 0:return this._enabled}}SetPropertyValueByIndex(a,b){switch(a){case 0:this._enabled=!!b}}_GetBehaviorType(a){a=a.GetInstance().GetBehaviorInstances();for(const b of a)if(a=b.GetBehaviorType(),a.GetInstanceSdkCtor()===this.constructor)return a}Trigger(a,b,c,d){return this._runtime?super.Trigger(a):b.Trigger(a,c,d)}_FinishTriggers(a){this._finishingTween=a;NAMESPACE.Cnds.SetFinishingTween(a);let b,c;if(this.GetRuntime())b=this._inst,c=this._runtime,this.Trigger(NAMESPACE.Cnds.OnTweensFinished), this.Trigger(NAMESPACE.Cnds.OnAnyTweensFinished),this.ReleaseTween(a);else{b=a.GetInstance();if(!b||b&&b.IsDestroyed())return;c=b.GetRuntime();const d=this._GetBehaviorType(a);this.Trigger(NAMESPACE.Cnds.OnTweensFinished,c,b,d);this.Trigger(NAMESPACE.Cnds.OnAnyTweensFinished,c,b,d);a.Stop()}this._finishingTween=null;NAMESPACE.Cnds.SetFinishingTween(null);a.GetDestroyInstanceOnComplete()&&c.DestroyInstance(b)}_AddTween(a,b){b=NAMESPACE.Maps.GetPropertyFromIndex(b);this._activeTweens.has(b)||this._activeTweens.set(b, []);this._activeTweens.get(b).push(a)}_AddToWaitingList(a){const b=a.GetId();this._waitingForReleaseTweens.has(b)||this._waitingForReleaseTweens.set(b,[]);this._waitingForReleaseTweens.get(b).push(a);this.IsTicking2()||this._StartTicking2()}_IsInWaitingList(a){const b=a.GetId();return this._waitingForReleaseTweens.has(b)?this._waitingForReleaseTweens.get(b).includes(a):!1}_ReleaseWaitingTweens(){if(this._waitingForReleaseTweens.size){for(const a of this._waitingForReleaseTweens.values()){for(const b of a)b.IsReleased()|| b.Release();C3$jscomp$345.clearArray(a)}this._waitingForReleaseTweens.clear();this.IsTicking2()&&this._StopTicking2()}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.tween.properties.enabled.name",value:this.IsEnabled(),onedit:a=>this.SetEnabled(a)}]}]}GetScriptInterfaceClass(){return self.ITweenBehaviorInstance}};const C3$jscomp$346=self.C3;let finishingTween$jscomp$2=null; C3$jscomp$346.Behaviors.Tween.Cnds={SetFinishingTween(a){finishingTween$jscomp$2=a},OnTweensFinished(a){return finishingTween$jscomp$2.HasTags(a)},OnAnyTweensFinished(){return!0},IsPlaying(a){return(a=[...this.GetTweensIncludingWaitingForRelease(a)],a.length)?a.some(C3$jscomp$346.TweenState.IsPlaying):!1},IsAnyPlaying(){const a=[...this.AllTweensIncludingWaitingForRelease()];return a&&a.length?a.some(C3$jscomp$346.TweenState.IsPlaying):!1},IsPaused(a){return(a=[...this.GetTweensIncludingWaitingForRelease(a)], a.length)?a.some(C3$jscomp$346.TweenState.IsPaused):!1},IsAnyPaused(){const a=[...this.AllTweensIncludingWaitingForRelease()];return a&&a.length?a.some(C3$jscomp$346.TweenState.IsPaused):!1}};const C3$jscomp$347=self.C3,Ease$jscomp$3=self.Ease,NAMESPACE$jscomp$1=C3$jscomp$347.Behaviors.Tween; NAMESPACE$jscomp$1.Acts={SetEnabled(a){this.SetEnabled(!!a)},async TweenOneProperty(...a){this.IsEnabled()&&this.IsInstanceValid()&&(a=this.CreateTween(NAMESPACE$jscomp$1.TweenArguments.OneProperty(this,...a)),a.Play()&&await a.GetPlayPromise())},async TweenTwoProperties(...a){this.IsEnabled()&&this.IsInstanceValid()&&(a=this.CreateTween(NAMESPACE$jscomp$1.TweenArguments.TwoProperties(this,...a)),a.Play()&&await a.GetPlayPromise())},async TweenValue(...a){this.IsEnabled()&&this.IsInstanceValid()&& (a=this.CreateTween(NAMESPACE$jscomp$1.TweenArguments.ValueProperty(this,...a)),a.Play()&&await a.GetPlayPromise())},PauseTweens(a){if(this.IsEnabled()&&this.IsInstanceValid())for(const b of this.GetTweens(a))b.Stop()},PauseAllTweens(){if(this.IsEnabled()&&this.IsInstanceValid())for(const a of this.AllTweens())a.Stop()},ResumeTweens(a){if(this.IsEnabled()&&this.IsInstanceValid())for(const b of this.GetTweens(a))b.Resume()},ResumeAllTweens(){if(this.IsEnabled()&&this.IsInstanceValid())for(const a of this.AllTweens())a.Resume()}, StopTweens(a){if(this.IsEnabled()&&this.IsInstanceValid())for(const b of this.GetTweens(a))this.ReleaseTween(b)},StopAllTweens(){if(this.IsEnabled()&&this.IsInstanceValid())for(const a of this.AllTweens())this.ReleaseTween(a)},SetOnePropertyTweensEndValue(a,b,c){if(this.IsEnabled()&&this.IsInstanceValid()){b=C3$jscomp$347.Behaviors.Tween.Maps.GetSinglePropertyFromIndex(b);for(const d of this.GetTweens(a))d.BeforeSetEndValues([b]),d.SetEndValue(c,b)}},SetTwoPropertiesTweensEndValue(a,b,c,d){if(this.IsEnabled()&& this.IsInstanceValid()){b=C3$jscomp$347.Behaviors.Tween.Maps.GetRealProperties(b);for(const e of this.GetTweens(a))e.BeforeSetEndValues(b),e.SetEndValue(c,b[0]),e.SetEndValue(d,b[1])}},SetValuePropertyTweensStartValue(a,b){if(this.IsEnabled()&&this.IsInstanceValid())for(const c of this.GetTweens(a,"value"))c.SetStartValue(b,"value")},SetValuePropertyTweensEndValue(a,b){if(this.IsEnabled()&&this.IsInstanceValid())for(const c of this.GetTweens(a,"value"))c.BeforeSetEndValues(["value"]),c.SetEndValue(b, "value")},SetTweensEase(a,b){if(this.IsEnabled()&&this.IsInstanceValid()){b=Ease$jscomp$3.GetEaseFromIndex(b);for(const c of this.GetTweens(a))c.SetEase(b)}},SetAllTweensEase(a){if(this.IsEnabled()&&this.IsInstanceValid()){a=Ease$jscomp$3.GetEaseFromIndex(a);for(const b of this.AllTweens())b.SetEase(a)}},SetTweensTime(a,b){if(this.IsEnabled()&&this.IsInstanceValid())for(const c of this.GetTweens(a))c.SetTime(b)},SetAllTweensTime(a){if(this.IsEnabled()&&this.IsInstanceValid())for(const b of this.AllTweens())b.SetTime(a)}, SetTweensPlaybackRate(a,b){if(this.IsEnabled()&&this.IsInstanceValid())for(const c of this.GetTweens(a))c.SetPlaybackRate(b)},SetAllTweensPlaybackRate(a){if(this.IsEnabled()&&this.IsInstanceValid())for(const b of this.AllTweens())b.SetPlaybackRate(a)},SetTweensDestroyOnComplete(a,b){if(this.IsEnabled()&&this.IsInstanceValid())for(const c of this.GetTweens(a))c.SetDestroyInstanceOnComplete(!!b)},SetAllTweensDestroyOnComplete(a){if(this.IsEnabled()&&this.IsInstanceValid())for(const b of this.AllTweens())b.SetDestroyInstanceOnComplete(!!a)}}; self.C3.Behaviors.Tween.Exps={Time(a){return(a=this.GetTweenIncludingWaitingForRelease(a))?a.GetTime():0},Progress(a){return(a=this.GetTweenIncludingWaitingForRelease(a))?a.GetTime()/a.GetTotalTime():0},Value(a){return(a=this.GetTweenIncludingWaitingForRelease(a,"value"))?a.GetPropertyTrack("value").GetSourceAdapterValue():0},Tags(){return this.GetFinishingTween()?this.GetFinishingTween().GetStringTags():""}};"use strict"; const C3$jscomp$349=self.C3,Ease$jscomp$4=self.Ease,PAIR_PROPERTIES=["position","size","scale"],SINGLE_PROPERTIES="offsetX offsetY offsetWidth offsetHeight offsetAngle offsetOpacity offsetColor offsetZElevation offsetScaleX offsetScaleY".split(" "),VALUE_PROPERTIES=["value"],PROPERTY_INDEX_TO_NAME=[].concat(PAIR_PROPERTIES).concat(SINGLE_PROPERTIES).concat(VALUE_PROPERTIES),PROPERTY_PAIR_TO_REAL_PROPERTIES={position:["offsetX","offsetY"],size:["offsetWidth","offsetHeight"],scale:["offsetScaleX","offsetScaleY"]}, ALL_REAL_PROPERTIES=Object.assign({},PROPERTY_INDEX_TO_NAME.reduce((a,b)=>Object.assign({},a,{[b]:[b]}),{}),PROPERTY_PAIR_TO_REAL_PROPERTIES); C3$jscomp$349.Behaviors.Tween.Maps=class{constructor(){}static GetEases(){return[...Ease$jscomp$4.GetRuntimeEaseNames()]}static GetEaseFromIndex(a){return[...Ease$jscomp$4.GetRuntimeEaseNames()][a]}static GetPropertyFromIndex(a){return PROPERTY_INDEX_TO_NAME[a]}static GetPropertyIndexFromName(a){return PROPERTY_INDEX_TO_NAME.indexOf(a)}static GetPairPropertyFromIndex(a){return PAIR_PROPERTIES[a]}static GetSinglePropertyFromIndex(a){return SINGLE_PROPERTIES[a]}static GetValuePropertyFromIndex(a){return VALUE_PROPERTIES[a]}static GetPairProperties(a){return PROPERTY_PAIR_TO_REAL_PROPERTIES[a]}static GetRealProperties(a){return C3$jscomp$349.IsString(a)?ALL_REAL_PROPERTIES[a]: ALL_REAL_PROPERTIES[PROPERTY_INDEX_TO_NAME[a]]}static IsPairId(a){return!!PROPERTY_PAIR_TO_REAL_PROPERTIES[a]}static IsColorId(a){return"offsetColor"===a}static IsAngleId(a){return"offsetAngle"===a}static IsOpacityId(a){return"offsetOpacity"===a}static IsValueId(a){return"value"===a}};"use strict";const C3$jscomp$350=self.C3,NAMESPACE$jscomp$2=C3$jscomp$350.Behaviors.Tween,TWEEN_CONFIGURATIONS=new Map; NAMESPACE$jscomp$2.Config=class{constructor(){}static GetPropertyTracksConfig(a,b,c,d,e,g){0===TWEEN_CONFIGURATIONS.size&&this._CreateConfigObjects();var k=NAMESPACE$jscomp$2.PropertyTypes.Pick(a);k=TWEEN_CONFIGURATIONS.get(k);C3$jscomp$350.IsFiniteNumber(a)&&(a=NAMESPACE$jscomp$2.Maps.GetPropertyFromIndex(a));return this._GetConfig(k,a,b,c,d,e,g)}static TransformValue(a,b){return C3$jscomp$350.Behaviors.Tween.GetPropertyTracksConfig(a).valueGetter(b)}static _CreateConfigObjects(){const a=NAMESPACE$jscomp$2.PropertyTypes, b=NAMESPACE$jscomp$2.ValueGetters;this._AddConfigObject(a.PAIR,this._GetPairConfig,b._GetPropertyValue);this._AddConfigObject(a.COLOR,this._GetColorConfig,b._GetColorPropertyValue);this._AddConfigObject(a.ANGLE,this._GetAngleConfig,b._GetPropertyAngleValue);this._AddConfigObject(a.VALUE,this._GetValueConfig,b._GetPropertyValue);this._AddConfigObject(a.OTHER,this._GetCommonConfig,b._GetPropertyValue)}static _AddConfigObject(a,b,c){TWEEN_CONFIGURATIONS.set(a,this._CreateConfigObject(a,b,c))}static _CreateConfigObject(a, b,c){return{name:a,configFunc:b,valueGetter:c}}static _GetConfig(a,b,c,d,e,g,k){return a.configFunc(b,a.valueGetter(c),a.valueGetter(d),e,g,k)}static _GetPairConfig(a,b,c,d,e,g){return NAMESPACE$jscomp$2.Maps.GetPairProperties(a).map((k,l)=>({sourceId:"world-instance",property:k,type:"float",valueType:"numeric",startValue:b[l],endValue:c[l],ease:NAMESPACE$jscomp$2.Maps.GetEaseFromIndex(d),resultMode:e}))}static _GetColorConfig(a,b,c,d,e,g){return C3$jscomp$350.Plugins.Text&&g.GetPlugin()instanceof C3$jscomp$350.Plugins.Text?{sourceId:"plugin",sourceArgs:[7],property:"color",type:"color",valueType:"color",startValue:b,endValue:c,ease:NAMESPACE$jscomp$2.Maps.GetEaseFromIndex(d),resultMode:e}:{sourceId:"world-instance",property:a,type:"color",valueType:"color",startValue:b,endValue:c,ease:NAMESPACE$jscomp$2.Maps.GetEaseFromIndex(d),resultMode:e}}static _GetAngleConfig(a,b,c,d,e,g){return{sourceId:"world-instance",property:a,type:"angle",valueType:"angle",startValue:b,endValue:c,ease:NAMESPACE$jscomp$2.Maps.GetEaseFromIndex(d), resultMode:e}}static _GetCommonConfig(a,b,c,d,e,g){return{sourceId:"world-instance",property:a,type:"float",valueType:"numeric",startValue:b,endValue:c,ease:NAMESPACE$jscomp$2.Maps.GetEaseFromIndex(d),resultMode:e}}static _GetValueConfig(a,b,c,d,e,g){return{sourceId:"value",property:a,type:"float",valueType:"numeric",startValue:b,endValue:c,ease:NAMESPACE$jscomp$2.Maps.GetEaseFromIndex(d),resultMode:e}}};"use strict"; const C3$jscomp$351=self.C3,NAMESPACE$jscomp$3=C3$jscomp$351.Behaviors.Tween,COMMON_VARIABLE_ARGS=Object.assign({},{resultMode:"absolute"},{tags:"",property:"",time:0,ease:0,releaseOnComplete:0,loop:!1,pingPong:!1,repeatCount:1}),ONE_PROPERTY_ARGS=Object.assign({},COMMON_VARIABLE_ARGS,{initialValueMode:"current-state",startValue:0,endValue:0}),TWO_PROPERTIES_ARGS=Object.assign({},COMMON_VARIABLE_ARGS,{initialValueMode:"current-state",startValue:[0,0],endValue:[0,0]}),COLOR_PROPERTY_ARGS=Object.assign({}, COMMON_VARIABLE_ARGS,{initialValueMode:"current-state",startValue:[0,0,0],endValue:[0,0,0]}),VALUE_PROPERTY_ARGS=Object.assign({},ONE_PROPERTY_ARGS,{initialValueMode:"start-value"}); NAMESPACE$jscomp$3.TweenArguments=class{constructor(){}static _SetCommonProperties(a,b,c,d,e,g,k,l){a.tags=b;a.time=c;a.ease=d;a.releaseOnComplete=e;a.loop=g;a.pingPong=k;a.repeatCount=l}static OneProperty(a,b,c,d,e,g,k,l,n,p){a="string"===typeof c?c:NAMESPACE$jscomp$3.Maps.GetSinglePropertyFromIndex(c);c=NAMESPACE$jscomp$3.Maps.IsColorId(a)?COLOR_PROPERTY_ARGS:ONE_PROPERTY_ARGS;this._SetCommonProperties(c,b,e,g,k,l,n,p);NAMESPACE$jscomp$3.Maps.IsColorId(a)?(COLOR_PROPERTY_ARGS.endValue[0]=C3$jscomp$351.GetRValue(d), COLOR_PROPERTY_ARGS.endValue[1]=C3$jscomp$351.GetGValue(d),COLOR_PROPERTY_ARGS.endValue[2]=C3$jscomp$351.GetBValue(d),COLOR_PROPERTY_ARGS.property=NAMESPACE$jscomp$3.Maps.GetPropertyIndexFromName(a)):NAMESPACE$jscomp$3.Maps.IsOpacityId(a)?ONE_PROPERTY_ARGS.endValue=d/100:ONE_PROPERTY_ARGS.endValue=d;c.property=NAMESPACE$jscomp$3.Maps.GetPropertyIndexFromName(a);return c}static TwoProperties(a,b,c,d,e,g,k,l,n,p,r){this._SetCommonProperties(TWO_PROPERTIES_ARGS,b,g,k,l,n,p,r);a="string"===typeof c?c: NAMESPACE$jscomp$3.Maps.GetPairPropertyFromIndex(c);TWO_PROPERTIES_ARGS.endValue[0]=d;TWO_PROPERTIES_ARGS.endValue[1]=e;TWO_PROPERTIES_ARGS.property=NAMESPACE$jscomp$3.Maps.GetPropertyIndexFromName(a);return TWO_PROPERTIES_ARGS}static ValueProperty(a,b,c,d,e,g,k,l,n,p){this._SetCommonProperties(VALUE_PROPERTY_ARGS,b,e,g,k,l,n,p);VALUE_PROPERTY_ARGS.startValue=c;VALUE_PROPERTY_ARGS.endValue=d;VALUE_PROPERTY_ARGS.property=NAMESPACE$jscomp$3.Maps.GetPropertyIndexFromName("value");return VALUE_PROPERTY_ARGS}}; "use strict";const C3$jscomp$352=self.C3,NAMESPACE$jscomp$4=C3$jscomp$352.Behaviors.Tween,TYPE_CHECK_OBJECTS=[]; NAMESPACE$jscomp$4.PropertyTypes=class{constructor(){}static Pick(a){0===TYPE_CHECK_OBJECTS.length&&(TYPE_CHECK_OBJECTS.push({checkFunc:NAMESPACE$jscomp$4.Maps.IsPairId,result:this.PAIR}),TYPE_CHECK_OBJECTS.push({checkFunc:NAMESPACE$jscomp$4.Maps.IsColorId,result:this.COLOR}),TYPE_CHECK_OBJECTS.push({checkFunc:NAMESPACE$jscomp$4.Maps.IsAngleId,result:this.ANGLE}),TYPE_CHECK_OBJECTS.push({checkFunc:NAMESPACE$jscomp$4.Maps.IsValueId,result:this.VALUE}),TYPE_CHECK_OBJECTS.push({checkFunc:()=>!0,result:this.OTHER})); C3$jscomp$352.IsFiniteNumber(a)&&(a=C3$jscomp$352.Behaviors.Tween.Maps.GetPropertyFromIndex(a));for(const b of TYPE_CHECK_OBJECTS)if(b.checkFunc(a))return b.result}static get PAIR(){return"pair"}static get COLOR(){return"color"}static get ANGLE(){return"angle"}static get VALUE(){return"value"}static get OTHER(){return"other"}};"use strict";const C3$jscomp$353=self.C3; C3$jscomp$353.Behaviors.Tween.ValueGetters=class{constructor(){}static _GetPropertyAngleValue(a){a=C3$jscomp$353.toRadians(parseFloat(a));return C3$jscomp$353.clampAngle(a)}static _GetColorPropertyValue(a){return a.slice(0)}static _GetPropertyValue(a){return a}};"use strict"; const C3$jscomp$354=self.C3,C3X$jscomp$35=self.C3X,IBehaviorInstance$jscomp$7=self.IBehaviorInstance,Ease$jscomp$5=self.Ease,NAMESPACE$jscomp$6=C3$jscomp$354.Behaviors.Tween,map$jscomp$32=new WeakMap,TWEEN_PROPERTIES=new Map([["x",{name:"offsetX",type:"one"}],["y",{name:"offsetY",type:"one"}],["width",{name:"offsetWidth",type:"one"}],["height",{name:"offsetHeight",type:"one"}],["angle",{name:"offsetAngle",type:"one"}],["opacity",{name:"offsetOpacity",type:"one"}],["color",{name:"offsetColor",type:"color"}], ["z-elevation",{name:"offsetZElevation",type:"one"}],["x-scale",{name:"offsetScaleX",type:"one"}],["y-scale",{name:"offsetScaleY",type:"one"}],["position",{name:"position",type:"two"}],["size",{name:"size",type:"two"}],["scale",{name:"scale",type:"two"}],["value",{name:"value",type:"value"}]]); function getIndexForEase(a){C3X$jscomp$35.RequireString(a);var b=Ease$jscomp$5.ToInternal(a);b=b?Ease$jscomp$5.GetIndexForEase(b,null):Ease$jscomp$5.GetIndexForEase(a,null);if(-1===b)throw Error(`invalid ease name '${a}'`);return b}const TWEEN_OPTS={tags:"",destroyOnComplete:!1,loop:!1,pingPong:!1,repeatCount:1,startValue:0},I_TWEEN_OPTS={easeToIndexFunc:getIndexForEase}; self.ITweenBehaviorInstance=class extends IBehaviorInstance$jscomp$7{constructor(){super();map$jscomp$32.set(this,IBehaviorInstance$jscomp$7._GetInitInst().GetSdkInstance())}startTween(a,b,c,d,e){const g=map$jscomp$32.get(this);if(!g.IsEnabled()||!g.IsInstanceValid())return null;const k=TWEEN_PROPERTIES.get(a);if(!k)throw Error("invalid tween property");"one"===k.type||"value"===k.type?C3X$jscomp$35.RequireNumber(b):(C3X$jscomp$35.RequireArray(b),"two"===k.type?(C3X$jscomp$35.RequireNumber(b[0]), C3X$jscomp$35.RequireNumber(b[1])):"color"===k.type&&(C3X$jscomp$35.RequireNumber(b[0]),C3X$jscomp$35.RequireNumber(b[1]),C3X$jscomp$35.RequireNumber(b[2])));"angle"===a?b=C3$jscomp$354.toDegrees(b):"opacity"===a?b*=100:"color"===a&&(b=C3$jscomp$354.PackRGBEx(b[0],b[1],b[2]));a=getIndexForEase(d);C3X$jscomp$35.RequireFiniteNumber(c);e=Object.assign({},TWEEN_OPTS,e);"value"===k.type&&C3X$jscomp$35.RequireNumber(e.startValue);let l;"one"===k.type||"color"===k.type?l=g.CreateTween(NAMESPACE$jscomp$6.TweenArguments.OneProperty(g, e.tags,k.name,b,c,a,!!e.destroyOnComplete,!!e.loop,!!e.pingPong,e.repeatCount)):"two"===k.type?l=g.CreateTween(NAMESPACE$jscomp$6.TweenArguments.TwoProperties(g,e.tags,k.name,b[0],b[1],c,a,!!e.destroyOnComplete,!!e.loop,!!e.pingPong,e.repeatCount)):"value"===k.type&&(l=g.CreateTween(NAMESPACE$jscomp$6.TweenArguments.ValueProperty(g,e.tags,e.startValue,b,c,a,!!e.destroyOnComplete,!!e.loop,!!e.pingPong,e.repeatCount)));if(!l.Play())throw Error("failed to start tween");return l.GetITweenState(g,I_TWEEN_OPTS)}*allTweens(){const a= map$jscomp$32.get(this);for(const b of a.AllTweens())yield b.GetITweenState(a,I_TWEEN_OPTS)}*tweensByTags(a){C3X$jscomp$35.RequireString(a);const b=map$jscomp$32.get(this);for(const c of b.GetTweens(a))yield c.GetITweenState(b,I_TWEEN_OPTS)}get isEnabled(){return map$jscomp$32.get(this).IsEnabled()}set isEnabled(a){map$jscomp$32.get(this).SetEnabled(a)}};"use strict";const C3$jscomp$355=self.C3;C3$jscomp$355.Behaviors.Anchor=class extends C3$jscomp$355.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}}; const C3$jscomp$356=self.C3;C3$jscomp$356.Behaviors.Anchor.Type=class extends C3$jscomp$356.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};const C3$jscomp$357=self.C3,IBehaviorInstance$jscomp$8=self.IBehaviorInstance; C3$jscomp$357.Behaviors.Anchor.Instance=class extends C3$jscomp$357.SDKBehaviorInstanceBase{constructor(a,b){super(a);this._anchorTop=this._anchorLeft=2;this._anchorBottom=this._anchorRight=0;this._isEnabled=!0;a=this._inst.GetWorldInfo().GetBoundingBox();this._xLeft=a.getLeft();this._yTop=a.getTop();this._xRight=this._runtime.GetOriginalViewportWidth()-a.getLeft();this._yBottom=this._runtime.GetOriginalViewportHeight()-a.getTop();this._rDiff=this._runtime.GetOriginalViewportWidth()-a.getRight(); this._bDiff=this._runtime.GetOriginalViewportHeight()-a.getBottom();b&&(this._anchorLeft=b[0],this._anchorTop=b[1],this._anchorRight=b[2],this._anchorBottom=b[3],this._isEnabled=!!b[4]);b=this._runtime.Dispatcher();this._disposables=new C3$jscomp$357.CompositeDisposable(C3$jscomp$357.Disposable.From(b,"layoutchange",()=>this._OnLayoutChange()));this._isEnabled&&this._StartTicking()}Release(){super.Release()}SaveToJson(){return{xl:this._xLeft,yt:this._yTop,xr:this._xRight,yb:this._yBottom,rd:this._rDiff, bd:this._bDiff,al:this._anchorLeft,at:this._anchorTop,ar:this._anchorRight,ab:this._anchorBottom,e:this._isEnabled}}LoadFromJson(a){this._xLeft=a.xl;this._yTop=a.yt;this._xRight=a.xr;this._yBottom=a.yb;this._rDiff=a.rd;this._bDiff=a.bd;this._anchorLeft=a.al;this._anchorTop=a.at;this._anchorRight=a.ar;this._anchorBottom=a.ab;(this._isEnabled=a.e)?this._StartTicking():this._StopTicking()}_SetEnabled(a){this._isEnabled&&!a?(this._isEnabled=!1,this._StopTicking()):!this._isEnabled&&a&&(a=this._inst.GetWorldInfo().GetBoundingBox(), this._xLeft=a.getLeft(),this._yTop=a.getTop(),this._xRight=this._runtime.GetOriginalViewportWidth()-a.getLeft(),this._yBottom=this._runtime.GetOriginalViewportHeight()-a.getTop(),this._rDiff=this._runtime.GetOriginalViewportWidth()-a.getRight(),this._bDiff=this._runtime.GetOriginalViewportHeight()-a.getBottom(),this._isEnabled=!0,this._StartTicking())}_IsEnabled(){return this._isEnabled}_UpdatePosition(){if(this._isEnabled){var a=this._inst.GetWorldInfo(),b=a.GetLayer().GetViewport();if(0===this._anchorLeft){var c= b.getLeft()+this._xLeft-a.GetBoundingBox().getLeft();0!==c&&(a.OffsetX(c),a.SetBboxChanged())}else 1===this._anchorLeft&&(c=b.getRight()-this._xRight-a.GetBoundingBox().getLeft(),0!==c&&(a.OffsetX(c),a.SetBboxChanged()));0===this._anchorTop?(c=b.getTop()+this._yTop-a.GetBoundingBox().getTop(),0!==c&&(a.OffsetY(c),a.SetBboxChanged())):1===this._anchorTop&&(c=b.getBottom()-this._yBottom-a.GetBoundingBox().getTop(),0!==c&&(a.OffsetY(c),a.SetBboxChanged()));1===this._anchorRight&&(c=b.getRight()-this._rDiff- a.GetBoundingBox().getRight(),0!==c&&(a.OffsetX(a.GetOriginX()*c),a.SetWidth(Math.max(a.GetWidth()+c),0),a.SetBboxChanged(),this._rDiff=b.getRight()-a.GetBoundingBox().getRight()));1===this._anchorBottom&&(c=b.getBottom()-this._bDiff-a.GetBoundingBox().getBottom(),0!==c&&(a.OffsetY(a.GetOriginY()*c),a.SetHeight(Math.max(a.GetHeight()+c,0)),a.SetBboxChanged(),this._bDiff=b.getBottom()-a.GetBoundingBox().getBottom()))}}Tick(){this._UpdatePosition()}_OnLayoutChange(){this._UpdatePosition()}GetPropertyValueByIndex(a){switch(a){case 0:return this._anchorLeft; case 1:return this._anchorTop;case 2:return this._anchorRight;case 3:return this._anchorBottom;case 4:return this._isEnabled}}SetPropertyValueByIndex(a,b){switch(a){case 0:this._anchorLeft=b;break;case 1:this._anchorTop=b;break;case 2:this._anchorRight=b;break;case 3:this._anchorBottom=b;break;case 4:(this._isEnabled=!!b)?this._StartTicking():this._StopTicking()}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.anchor.properties.enabled.name", value:this._IsEnabled(),onedit:a=>this._SetEnabled(a)}]}]}GetScriptInterfaceClass(){return self.IAnchorBehaviorInstance}};const map$jscomp$33=new WeakMap;self.IAnchorBehaviorInstance=class extends IBehaviorInstance$jscomp$8{constructor(){super();map$jscomp$33.set(this,IBehaviorInstance$jscomp$8._GetInitInst().GetSdkInstance())}get isEnabled(){return map$jscomp$33.get(this)._IsEnabled()}set isEnabled(a){map$jscomp$33.get(this)._SetEnabled(a)}};self.C3.Behaviors.Anchor.Cnds={IsEnabled(){return this._IsEnabled()}}; self.C3.Behaviors.Anchor.Acts={SetEnabled(a){this._SetEnabled(0!==a)}};self.C3.Behaviors.Anchor.Exps={};"use strict";const C3$jscomp$361=self.C3;C3$jscomp$361.Behaviors.solid=class extends C3$jscomp$361.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$362=self.C3;C3$jscomp$362.Behaviors.solid.Type=class extends C3$jscomp$362.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}}; const C3$jscomp$363=self.C3,C3X$jscomp$37=self.C3X,IBehaviorInstance$jscomp$9=self.IBehaviorInstance,EMPTY_SET=new Set; C3$jscomp$363.Behaviors.solid.Instance=class extends C3$jscomp$363.SDKBehaviorInstanceBase{constructor(a,b){super(a);this.SetEnabled(!0);b&&(this.SetEnabled(b[0]),this.SetTags(b[1]))}Release(){super.Release()}SetEnabled(a){this._inst._SetSolidEnabled(!!a)}IsEnabled(){return this._inst._IsSolidEnabled()}SetTags(a){const b=this._inst.GetSavedDataMap();if(a.trim()){var c=b.get("solidTags");c||(c=new Set,b.set("solidTags",c));c.clear();for(const d of a.split(" "))d&&c.add(d.toLowerCase())}else b.delete("solidTags")}GetTags(){return this._inst.GetSavedDataMap().get("solidTags")|| EMPTY_SET}_GetTagsString(){return[...this.GetTags()].join(" ")}SaveToJson(){return{e:this.IsEnabled()}}LoadFromJson(a){this.SetEnabled(a.e)}GetPropertyValueByIndex(a){switch(a){case 0:return this.IsEnabled()}}SetPropertyValueByIndex(a,b){switch(a){case 0:this.SetEnabled(b)}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.solid.properties.enabled.name",value:this.IsEnabled(),onedit:a=>this.SetEnabled(a)},{name:"behaviors.solid.properties.tags.name", value:this._GetTagsString(),onedit:a=>this.SetTags(a)}]}]}GetScriptInterfaceClass(){return self.ISolidBehaviorInstance}};const map$jscomp$34=new WeakMap;self.ISolidBehaviorInstance=class extends IBehaviorInstance$jscomp$9{constructor(){super();map$jscomp$34.set(this,IBehaviorInstance$jscomp$9._GetInitInst().GetSdkInstance())}set isEnabled(a){map$jscomp$34.get(this).SetEnabled(!!a)}get isEnabled(){return map$jscomp$34.get(this).IsEnabled()}set tags(a){C3X$jscomp$37.RequireString(a);map$jscomp$34.get(this).SetTags(a)}get tags(){return map$jscomp$34.get(this)._GetTagsString()}}; self.C3.Behaviors.solid.Cnds={IsEnabled(){return this.IsEnabled()}};self.C3.Behaviors.solid.Acts={SetEnabled(a){this.SetEnabled(a)},SetTags(a){this.SetTags(a)}};self.C3.Behaviors.solid.Exps={};"use strict";const C3$jscomp$367=self.C3;C3$jscomp$367.Behaviors.Bullet=class extends C3$jscomp$367.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$368=self.C3;C3$jscomp$368.Behaviors.Bullet.Type=class extends C3$jscomp$368.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}}; const C3$jscomp$369=self.C3,C3X$jscomp$38=self.C3X,IBehaviorInstance$jscomp$10=self.IBehaviorInstance; C3$jscomp$369.Behaviors.Bullet.Instance=class extends C3$jscomp$369.SDKBehaviorInstanceBase{constructor(a,b){super(a);a=this.GetWorldInfo();this._g=this._acc=this._speed=0;this._isStepping=this._setAngle=this._bounceOffSolid=!1;this._isEnabled=!0;this._dy=this._dx=0;this._lastX=a.GetX();this._lastY=a.GetY();this._lastKnownAngle=a.GetAngle();this._travelled=0;this._stepSize=Math.min(Math.abs(a.GetWidth()),Math.abs(a.GetHeight())/2);this._stopStepping=!1;b&&(this._speed=b[0],this._acc=b[1],this._g= b[2],this._bounceOffSolid=!!b[3],this._setAngle=!!b[4],this._isStepping=!!b[5],this._isEnabled=!!b[6]);b=a.GetAngle();this._dx=Math.cos(b)*this._speed;this._dy=Math.sin(b)*this._speed;this._isEnabled&&(this._StartTicking(),this._bounceOffSolid&&this._StartPostTicking())}Release(){super.Release()}SaveToJson(){const a={dx:this._dx,dy:this._dy,lx:this._lastX,ly:this._lastY,lka:this._lastKnownAngle,t:this._travelled};0!==this._acc&&(a.acc=this._acc);0!==this._g&&(a.g=this._g);this._isStepping&&(a.st= this._isStepping);this._isEnabled||(a.e=this._isEnabled);this._bounceOffSolid&&(a.bos=this._bounceOffSolid);this._setAngle&&(a.sa=this._setAngle);return a}LoadFromJson(a){this._dx=a.dx;this._dy=a.dy;this._lastX=a.lx;this._lastY=a.ly;this._lastKnownAngle=a.lka;this._travelled=a.t;this._acc=a.hasOwnProperty("acc")?a.acc:0;this._g=a.hasOwnProperty("g")?a.g:0;this._isStepping=a.hasOwnProperty("st")?a.st:!1;this._bounceOffSolid=a.hasOwnProperty("bos")?a.bos:!1;this._setAngle=a.hasOwnProperty("sa")?a.sa: !1;this._SetEnabled(a.hasOwnProperty("e")?a.e:!0)}Tick(){if(this._isEnabled){var a=this._runtime.GetDt(this._inst),b=this._inst.GetWorldInfo();if(b.GetAngle()!==this._lastKnownAngle){var c=b.GetAngle();if(this._setAngle){var d=C3$jscomp$369.distanceTo(0,0,this._dx,this._dy);this._dx=Math.cos(c)*d;this._dy=Math.sin(c)*d}this._lastKnownAngle=c}c=d=0;if(0!==this._acc){let e=C3$jscomp$369.distanceTo(0,0,this._dx,this._dy),g;g=0===this._dx&&0===this._dy?b.GetAngle():C3$jscomp$369.angleTo(0,0,this._dx, this._dy);e+=this._acc*a;d=Math.cos(g)*this._acc;c=Math.sin(g)*this._acc;0>e&&(c=d=e=0);this._dx=Math.cos(g)*e;this._dy=Math.sin(g)*e}0!==this._g&&(this._dy+=this._g*a,c+=this._g);this._lastX=b.GetX();this._lastY=b.GetY();if(0!==this._dx||0!==this._dy)d=this._dx*a+.5*d*a*a,a=this._dy*a+.5*c*a*a,c=C3$jscomp$369.distanceTo(0,0,d,a),this._MoveBy(d,a,c),this._travelled+=c,!this._setAngle||0===d&&0===a||(a=C3$jscomp$369.angleTo(0,0,d,a),b.SetAngle(a),this._lastKnownAngle=b.GetAngle()),b.SetBboxChanged()}}_MoveBy(a, b,c){const d=this.GetWorldInfo();if(!this._isStepping||c<=this._stepSize)d.OffsetXY(a,b),d.SetBboxChanged(),this._isStepping&&this.Trigger(C3$jscomp$369.Behaviors.Bullet.Cnds.OnStep);else{this._stopStepping=!1;var e=d.GetX(),g=d.GetY(),k=e+a,l=g+b;b=C3$jscomp$369.angleTo(0,0,a,b);a=Math.cos(b)*this._stepSize;b=Math.sin(b)*this._stepSize;c=Math.floor(c/this._stepSize);for(let n=1;n<=c;++n)if(d.SetXY(e+a*n,g+b*n),d.SetBboxChanged(),this.Trigger(C3$jscomp$369.Behaviors.Bullet.Cnds.OnStep),this._inst.IsDestroyed()|| this._stopStepping)return;d.SetXY(k,l);d.SetBboxChanged();this.Trigger(C3$jscomp$369.Behaviors.Bullet.Cnds.OnStep)}}PostTick(){if(this._isEnabled&&this._bounceOffSolid&&(0!==this._dx||0!==this._dy)){var a=this._runtime.GetDt(this._inst),b=this._inst.GetWorldInfo(),c=this._runtime.GetCollisionEngine(),d=c.TestOverlapSolid(this._inst);if(d){c.RegisterCollision(this._inst,d);d=C3$jscomp$369.distanceTo(0,0,this._dx,this._dy);const e=c.CalculateBounceAngle(this._inst,this._lastX,this._lastY);this._dx= Math.cos(e)*d;this._dy=Math.sin(e)*d;b.OffsetXY(this._dx*a,this._dy*a);b.SetBboxChanged();this._setAngle&&(b.SetAngle(e),this._lastKnownAngle=b.GetAngle(),b.SetBboxChanged());c.PushOutSolid(this._inst,this._dx/d,this._dy/d,Math.max(2.5*d*a,30))||c.PushOutSolidNearest(this._inst,100)}}}GetPropertyValueByIndex(a){switch(a){case 0:return this._GetSpeed();case 1:return this._GetAcceleration();case 2:return this._GetGravity();case 4:return this._setAngle;case 5:return this._isStepping;case 6:return this._IsEnabled()}}SetPropertyValueByIndex(a, b){switch(a){case 0:this._SetSpeed(b);break;case 1:this._acc=b;break;case 2:this._g=b;break;case 4:this._setAngle=!!b;break;case 5:this._isStepping=!!b;break;case 6:this._SetEnabled(!!b)}}_SetSpeed(a){const b=C3$jscomp$369.angleTo(0,0,this._dx,this._dy);this._dx=Math.cos(b)*a;this._dy=Math.sin(b)*a}_GetSpeed(){return C3$jscomp$369.roundToDp(C3$jscomp$369.distanceTo(0,0,this._dx,this._dy),6)}_SetAcceleration(a){this._acc=a}_GetAcceleration(){return this._acc}_SetGravity(a){this._g=a}_GetGravity(){return this._g}_SetAngleOfMotion(a){const b= C3$jscomp$369.distanceTo(0,0,this._dx,this._dy);this._dx=Math.cos(a)*b;this._dy=Math.sin(a)*b}_GetAngleOfMotion(){return C3$jscomp$369.angleTo(0,0,this._dx,this._dy)}_SetBounceOffSolids(a){a=!!a;this._bounceOffSolid!==a&&(this._bounceOffSolid=a,this._isEnabled&&(this._bounceOffSolid?this._StartPostTicking():this._StopPostTicking()))}_IsBounceOffSolids(){return this._bounceOffSolid}_SetDistanceTravelled(a){this._travelled=a}_GetDistanceTravelled(){return this._travelled}_SetEnabled(a){(this._isEnabled= !!a)?(this._StartTicking(),this._bounceOffSolid&&this._StartPostTicking()):(this._StopTicking(),this._StopPostTicking())}_IsEnabled(){return this._isEnabled}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.bullet.debugger.vector-x",value:this._dx,onedit:a=>this._dx=a},{name:"behaviors.bullet.debugger.vector-y",value:this._dy,onedit:a=>this._dy=a},{name:"behaviors.bullet.properties.speed.name",value:this._GetSpeed(),onedit:a=>this._SetSpeed(a)}, {name:"behaviors.bullet.debugger.angle-of-motion",value:C3$jscomp$369.toDegrees(this._GetAngleOfMotion())},{name:"behaviors.bullet.properties.gravity.name",value:this._GetGravity(),onedit:a=>this._SetGravity(a)},{name:"behaviors.bullet.properties.acceleration.name",value:this._GetAcceleration(),onedit:a=>this._SetAcceleration(a)},{name:"behaviors.bullet.debugger.distance-travelled",value:this._GetDistanceTravelled()},{name:"behaviors.bullet.properties.enabled.name",value:this._IsEnabled(),onedit:a=> this._SetEnabled(a)}]}]}GetScriptInterfaceClass(){return self.IBulletBehaviorInstance}};const map$jscomp$35=new WeakMap; self.IBulletBehaviorInstance=class extends IBehaviorInstance$jscomp$10{constructor(){super();map$jscomp$35.set(this,IBehaviorInstance$jscomp$10._GetInitInst().GetSdkInstance())}get speed(){return map$jscomp$35.get(this)._GetSpeed()}set speed(a){C3X$jscomp$38.RequireFiniteNumber(a);map$jscomp$35.get(this)._SetSpeed(a)}get acceleration(){return map$jscomp$35.get(this)._GetAcceleration()}set acceleration(a){C3X$jscomp$38.RequireFiniteNumber(a);map$jscomp$35.get(this)._SetAcceleration(a)}get gravity(){return map$jscomp$35.get(this)._GetGravity()}set gravity(a){C3X$jscomp$38.RequireFiniteNumber(a); map$jscomp$35.get(this)._SetGravity(a)}get angleOfMotion(){return map$jscomp$35.get(this)._GetAngleOfMotion()}set angleOfMotion(a){C3X$jscomp$38.RequireFiniteNumber(a);map$jscomp$35.get(this)._SetAngleOfMotion(a)}get bounceOffSolids(){return map$jscomp$35.get(this)._IsBounceOffSolids()}set bounceOffSolids(a){map$jscomp$35.get(this)._SetBounceOffSolids(!!a)}get distanceTravelled(){return map$jscomp$35.get(this)._GetDistanceTravelled()}set distanceTravelled(a){C3X$jscomp$38.RequireFiniteNumber(a);map$jscomp$35.get(this)._SetDistanceTravelled(a)}get isEnabled(){return map$jscomp$35.get(this)._IsEnabled()}set isEnabled(a){map$jscomp$35.get(this)._SetEnabled(a)}}; const C3$jscomp$370=self.C3;C3$jscomp$370.Behaviors.Bullet.Cnds={CompareSpeed(a,b){return C3$jscomp$370.compare(Math.hypot(this._dx,this._dy),a,b)},CompareTravelled(a,b){return C3$jscomp$370.compare(this._GetDistanceTravelled(),a,b)},OnStep(){return!0},IsEnabled(){return this._IsEnabled()}};const C3$jscomp$371=self.C3; C3$jscomp$371.Behaviors.Bullet.Acts={SetSpeed(a){this._SetSpeed(a)},SetAcceleration(a){this._SetAcceleration(a)},SetGravity(a){this._SetGravity(a)},SetAngleOfMotion(a){this._SetAngleOfMotion(C3$jscomp$371.toRadians(a))},Bounce(a){if(a&&(a=a.GetFirstPicked(this._inst))){var b=this._inst.GetWorldInfo(),c=this._runtime.GetCollisionEngine(),d=this._runtime.GetDt(this._inst),e=C3$jscomp$371.distanceTo(0,0,this._dx,this._dy),g=c.CalculateBounceAngle(this._inst,this._lastX,this._lastY,a);this._dx=Math.cos(g)* e;this._dy=Math.sin(g)*e;b.OffsetXY(this._dx*d,this._dy*d);b.SetBboxChanged();this._setAngle&&(b.SetAngle(g),this._lastKnownAngle=b.GetAngle(),b.SetBboxChanged());0!==e&&(this._bounceOffSolid?c.PushOutSolid(this._inst,this._dx/e,this._dy/e,Math.max(2.5*e*d,30))||c.PushOutSolidNearest(this._inst,100):c.PushOut(this._inst,this._dx/e,this._dy/e,Math.max(2.5*e*d,30),a))}},SetBounceOffSolids(a){this._SetBounceOffSolids(a)},SetDistanceTravelled(a){this._SetDistanceTravelled(a)},SetEnabled(a){this._SetEnabled(a)}, StopStepping(){this._stopStepping=!0}};const C3$jscomp$372=self.C3;C3$jscomp$372.Behaviors.Bullet.Exps={Speed(){return this._GetSpeed()},Acceleration(){return this._GetAcceleration()},AngleOfMotion(){return C3$jscomp$372.toDegrees(this._GetAngleOfMotion())},DistanceTravelled(){return this._GetDistanceTravelled()},Gravity(){return this._GetGravity()}};"use strict";const C3$jscomp$373=self.C3;C3$jscomp$373.Behaviors.Rotate=class extends C3$jscomp$373.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}}; const C3$jscomp$374=self.C3;C3$jscomp$374.Behaviors.Rotate.Type=class extends C3$jscomp$374.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};const C3$jscomp$375=self.C3,C3X$jscomp$39=self.C3X,IBehaviorInstance$jscomp$11=self.IBehaviorInstance; C3$jscomp$375.Behaviors.Rotate.Instance=class extends C3$jscomp$375.SDKBehaviorInstanceBase{constructor(a,b){super(a);this._acceleration=this._speed=0;this._isEnabled=!0;b&&(this._speed=C3$jscomp$375.toRadians(b[0]),this._acceleration=C3$jscomp$375.toRadians(b[1]),this._isEnabled=b[2]);this._isEnabled&&this._StartTicking()}Release(){super.Release()}_SetSpeed(a){this._speed=a}_GetSpeed(){return this._speed}_SetAcceleration(a){this._acceleration=a}_GetAcceleration(){return this._acceleration}SaveToJson(){return{s:this._speed, a:this._acceleration,e:this._isEnabled}}LoadFromJson(a){this._speed=a.s;this._acceleration=a.a;this._SetEnabled(a.e)}Tick(){if(this._isEnabled){var a=this._runtime.GetDt(this._inst);if(0!==a&&(0!==this._acceleration&&(this._speed+=this._acceleration*a),0!==this._speed)){const b=this._inst.GetWorldInfo();b.SetAngle(b.GetAngle()+this._speed*a);b.SetBboxChanged()}}}GetPropertyValueByIndex(a){switch(a){case 0:return C3$jscomp$375.toDegrees(this._GetSpeed());case 1:return C3$jscomp$375.toDegrees(this._GetAcceleration()); case 2:return this._IsEnabled()}}SetPropertyValueByIndex(a,b){switch(a){case 0:this._SetSpeed(C3$jscomp$375.toRadians(b));break;case 1:this._SetAcceleration(C3$jscomp$375.toRadians(b));break;case 2:this._SetEnabled(b)}}_SetEnabled(a){(this._isEnabled=!!a)?this._StartTicking():this._StopTicking()}_IsEnabled(){return this._isEnabled}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.rotate.properties.speed.name",value:C3$jscomp$375.toDegrees(this._GetSpeed()), onedit:a=>this._SetSpeed(C3$jscomp$375.toRadians(a))},{name:"behaviors.rotate.properties.acceleration.name",value:C3$jscomp$375.toDegrees(this._GetAcceleration()),onedit:a=>this._SetAcceleration(C3$jscomp$375.toRadians(a))},{name:"behaviors.rotate.properties.enabled.name",value:this._IsEnabled(),onedit:a=>this._SetEnabled(a)}]}]}GetScriptInterfaceClass(){return self.IRotateBehaviorInstance}};const map$jscomp$36=new WeakMap; self.IRotateBehaviorInstance=class extends IBehaviorInstance$jscomp$11{constructor(){super();map$jscomp$36.set(this,IBehaviorInstance$jscomp$11._GetInitInst().GetSdkInstance())}set speed(a){C3X$jscomp$39.RequireFiniteNumber(a);map$jscomp$36.get(this)._SetSpeed(a)}get speed(){return map$jscomp$36.get(this)._GetSpeed()}set acceleration(a){C3X$jscomp$39.RequireFiniteNumber(a);map$jscomp$36.get(this)._SetAcceleration(a)}get acceleration(){return map$jscomp$36.get(this)._GetAcceleration()}get isEnabled(){return map$jscomp$36.get(this)._IsEnabled()}set isEnabled(a){map$jscomp$36.get(this)._SetEnabled(a)}}; self.C3.Behaviors.Rotate.Cnds={IsEnabled(){return this._IsEnabled()}};const C3$jscomp$377=self.C3;C3$jscomp$377.Behaviors.Rotate.Acts={SetSpeed(a){this._SetSpeed(C3$jscomp$377.toRadians(a))},SetAcceleration(a){this._SetAcceleration(C3$jscomp$377.toRadians(a))},SetEnabled(a){this._SetEnabled(a)}};const C3$jscomp$378=self.C3;C3$jscomp$378.Behaviors.Rotate.Exps={Speed(){return C3$jscomp$378.toDegrees(this._GetSpeed())},Acceleration(){return C3$jscomp$378.toDegrees(this._GetAcceleration())}};"use strict"; const C3$jscomp$379=self.C3;C3$jscomp$379.Behaviors.destroy=class extends C3$jscomp$379.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$380=self.C3;C3$jscomp$380.Behaviors.destroy.Type=class extends C3$jscomp$380.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};const C3$jscomp$381=self.C3; C3$jscomp$381.Behaviors.destroy.Instance=class extends C3$jscomp$381.SDKBehaviorInstanceBase{constructor(a,b){super(a);this._StartTicking()}Release(){super.Release()}Tick(){var a=this._inst.GetWorldInfo();const b=a.GetBoundingBox();a=a.GetLayout();(0>b.getRight()||0>b.getBottom()||b.getLeft()>a.GetWidth()||b.getTop()>a.GetHeight())&&this._runtime.DestroyInstance(this._inst)}};self.C3.Behaviors.destroy.Cnds={};self.C3.Behaviors.destroy.Acts={};self.C3.Behaviors.destroy.Exps={}; const C3$jscomp$385=self.C3; self.C3_GetObjectRefTable=function(){return[C3$jscomp$385.Plugins.Sprite,C3$jscomp$385.Behaviors.LOS,C3$jscomp$385.Behaviors.EightDir,C3$jscomp$385.Behaviors.Timer,C3$jscomp$385.Behaviors.Pin,C3$jscomp$385.Behaviors.Fade,C3$jscomp$385.Plugins.Particles,C3$jscomp$385.Behaviors.scrollto,C3$jscomp$385.Behaviors.Flash,C3$jscomp$385.Plugins.TiledBg,C3$jscomp$385.Plugins.NinePatch,C3$jscomp$385.Behaviors.Tween,C3$jscomp$385.Plugins.Spritefont2,C3$jscomp$385.Behaviors.Anchor,C3$jscomp$385.Behaviors.solid, C3$jscomp$385.Plugins.Tilemap,C3$jscomp$385.Behaviors.Bullet,C3$jscomp$385.Plugins.Arr,C3$jscomp$385.Plugins.Audio,C3$jscomp$385.Plugins.Browser,C3$jscomp$385.Plugins.Keyboard,C3$jscomp$385.Plugins.LocalStorage,C3$jscomp$385.Plugins.Mouse,C3$jscomp$385.Plugins.Touch,C3$jscomp$385.Plugins.AdvancedRandom,C3$jscomp$385.Plugins.AJAX,C3$jscomp$385.Plugins.Dictionary,C3$jscomp$385.Plugins.Date,C3$jscomp$385.Behaviors.Rotate,C3$jscomp$385.Behaviors.destroy,C3$jscomp$385.Plugins.System.Cnds.IsGroupActive, C3$jscomp$385.Plugins.Sprite.Cnds.PickByUID,C3$jscomp$385.Plugins.System.Acts.CreateObject,C3$jscomp$385.Plugins.Sprite.Exps.X,C3$jscomp$385.Plugins.Sprite.Exps.Y,C3$jscomp$385.Plugins.Sprite.Acts.SetInstanceVar,C3$jscomp$385.Plugins.Sprite.Exps.UID,C3$jscomp$385.Plugins.Sprite.Acts.SetPos,C3$jscomp$385.Plugins.Sprite.Acts.SetPosToObject,C3$jscomp$385.Plugins.Arr.Exps.At,C3$jscomp$385.Plugins.System.Exps.random,C3$jscomp$385.Plugins.Arr.Exps.Width,C3$jscomp$385.Plugins.Sprite.Acts.SetAnim,C3$jscomp$385.Plugins.Arr.Exps.IndexOf, C3$jscomp$385.Plugins.Sprite.Exps.AnimationName,C3$jscomp$385.Plugins.Sprite.Acts.SetBoolInstanceVar,C3$jscomp$385.Behaviors.LOS.Acts.AddObstacle,C3$jscomp$385.Behaviors.LOS.Acts.SetRange,C3$jscomp$385.Plugins.Sprite.Acts.SetWidth,C3$jscomp$385.Plugins.Sprite.Exps.Width,C3$jscomp$385.Plugins.Sprite.Acts.MoveToLayer,C3$jscomp$385.Plugins.Sprite.Acts.SetAngle,C3$jscomp$385.Plugins.System.Acts.AddVar,C3$jscomp$385.Behaviors.Bullet.Acts.SetEnabled,C3$jscomp$385.Plugins.Sprite.Cnds.CompareInstanceVar, C3$jscomp$385.Plugins.System.Cnds.Compare,C3$jscomp$385.Plugins.Sprite.Exps.Count,C3$jscomp$385.Plugins.System.Cnds.TriggerOnce,C3$jscomp$385.Plugins.Arr.Cnds.CompareSize,C3$jscomp$385.Plugins.AdvancedRandom.Acts.SetProbabilityTable,C3$jscomp$385.Plugins.System.Cnds.Repeat,C3$jscomp$385.Plugins.System.Cnds.PickRandom,C3$jscomp$385.Plugins.AdvancedRandom.Exps.Weighted,C3$jscomp$385.Plugins.Sprite.Cnds.PickParent,C3$jscomp$385.Plugins.System.Cnds.For,C3$jscomp$385.Plugins.Sprite.Acts.Spawn,C3$jscomp$385.Plugins.Sprite.Acts.AddChild, C3$jscomp$385.Plugins.TiledBg.Acts.SetWidth,C3$jscomp$385.Plugins.System.Exps.loopindex,C3$jscomp$385.Plugins.System.Cnds.CompareBetween,C3$jscomp$385.Plugins.System.Cnds.CompareBoolVar,C3$jscomp$385.Plugins.System.Cnds.CompareVar,C3$jscomp$385.Plugins.System.Acts.SetVar,C3$jscomp$385.Plugins.System.Acts.SetBoolVar,C3$jscomp$385.Plugins.System.Cnds.ForEach,C3$jscomp$385.Plugins.Sprite.Cnds.IsOverlapping,C3$jscomp$385.Plugins.Sprite.Cnds.IsOnScreen,C3$jscomp$385.Plugins.Browser.Acts.ConsoleLog,C3$jscomp$385.Plugins.Sprite.Cnds.IsBoolInstanceVarSet, C3$jscomp$385.Plugins.Sprite.Cnds.PickChildren,C3$jscomp$385.Plugins.Sprite.Acts.MoveAtAngle,C3$jscomp$385.Plugins.Sprite.Exps.Angle,C3$jscomp$385.Plugins.System.Exps.dt,C3$jscomp$385.Plugins.Sprite.Acts.SetVisible,C3$jscomp$385.Plugins.Sprite.Acts.RotateTowardAngle,C3$jscomp$385.Behaviors.Timer.Acts.StartTimer,C3$jscomp$385.Plugins.System.Exps.int,C3$jscomp$385.Behaviors.Bullet.Cnds.CompareSpeed,C3$jscomp$385.Behaviors.Bullet.Acts.SetAcceleration,C3$jscomp$385.Plugins.System.Exps.anglelerp,C3$jscomp$385.Behaviors.Bullet.Exps.AngleOfMotion, C3$jscomp$385.Plugins.System.Cnds.Else,C3$jscomp$385.Behaviors.Timer.Cnds.OnTimer,C3$jscomp$385.Behaviors.Bullet.Acts.SetSpeed,C3$jscomp$385.Behaviors.Bullet.Acts.SetAngleOfMotion,C3$jscomp$385.Behaviors.LOS.Cnds.HasLOSToObject,C3$jscomp$385.Plugins.Sprite.Acts.RotateTowardPosition,C3$jscomp$385.Plugins.Sprite.Cnds.AngleWithin,C3$jscomp$385.Plugins.Sprite.Acts.SetAnimSpeed,C3$jscomp$385.Plugins.Sprite.Acts.Destroy,C3$jscomp$385.Plugins.Sprite.Acts.SetSize,C3$jscomp$385.Plugins.Audio.Acts.PlayAtObject, C3$jscomp$385.Plugins.Particles.Acts.SetPosToObject,C3$jscomp$385.Plugins.Particles.Acts.SetRate,C3$jscomp$385.Plugins.Particles.Acts.SetOpacity,C3$jscomp$385.Plugins.Particles.Acts.SetInitSpeed,C3$jscomp$385.Plugins.System.Acts.SubVar,C3$jscomp$385.Plugins.Sprite.Cnds.OnAnimFinished,C3$jscomp$385.Behaviors.Bullet.Cnds.OnStep,C3$jscomp$385.Plugins.System.Cnds.PickNth,C3$jscomp$385.Plugins.Tilemap.Exps.SnapX,C3$jscomp$385.Plugins.Tilemap.Exps.SnapY,C3$jscomp$385.Plugins.Sprite.Cnds.OnCollision,C3$jscomp$385.Behaviors.EightDir.Acts.SetVectorX, C3$jscomp$385.Behaviors.EightDir.Acts.SetVectorY,C3$jscomp$385.Behaviors.Bullet.Exps.Speed,C3$jscomp$385.Plugins.System.Cnds.Every,C3$jscomp$385.Plugins.Sprite.Acts.SubInstanceVar,C3$jscomp$385.Plugins.Particles.Acts.SetAngle,C3$jscomp$385.Plugins.Sprite.Exps.Height,C3$jscomp$385.Plugins.System.Exps.choose,C3$jscomp$385.Plugins.Sprite.Exps.ImagePointX,C3$jscomp$385.Plugins.Sprite.Exps.ImagePointY,C3$jscomp$385.Behaviors.LOS.Acts.CastRay,C3$jscomp$385.Behaviors.LOS.Cnds.RayIntersected,C3$jscomp$385.Behaviors.LOS.Exps.HitX, C3$jscomp$385.Behaviors.LOS.Exps.HitY,C3$jscomp$385.Plugins.TiledBg.Acts.SetPos,C3$jscomp$385.Plugins.TiledBg.Acts.SetAngle,C3$jscomp$385.Plugins.TiledBg.Acts.SetVisible,C3$jscomp$385.Plugins.TiledBg.Exps.Count,C3$jscomp$385.Plugins.TiledBg.Acts.SetImageOffsetY,C3$jscomp$385.Plugins.TiledBg.Acts.SetImageOffsetX,C3$jscomp$385.Plugins.TiledBg.Exps.ImageOffsetX,C3$jscomp$385.Plugins.Audio.Acts.Stop,C3$jscomp$385.Plugins.Audio.Acts.FadeVolume,C3$jscomp$385.Plugins.System.Cnds.OnLayoutStart,C3$jscomp$385.Behaviors.Tween.Acts.TweenOneProperty, C3$jscomp$385.Plugins.Particles.Acts.Destroy,C3$jscomp$385.Plugins.Audio.Cnds.IsTagPlaying,C3$jscomp$385.Plugins.Audio.Acts.PlayByName,C3$jscomp$385.Plugins.System.Acts.SetGroupActive,C3$jscomp$385.Plugins.System.Acts.SetLayoutScale,C3$jscomp$385.Plugins.Arr.Acts.SetX,C3$jscomp$385.Plugins.TiledBg.Exps.ImageOffsetY,C3$jscomp$385.Plugins.Spritefont2.Cnds.CompareInstanceVar,C3$jscomp$385.Plugins.Arr.Cnds.CompareX,C3$jscomp$385.Plugins.Spritefont2.Acts.SetText,C3$jscomp$385.Behaviors.Tween.Cnds.OnTweensFinished, C3$jscomp$385.Plugins.System.Acts.SetLayerVisible,C3$jscomp$385.Plugins.Sprite.Cnds.OnCreated,C3$jscomp$385.Plugins.System.Exps.roundtodp,C3$jscomp$385.Plugins.Sprite.Cnds.OnDestroyed,C3$jscomp$385.Plugins.Sprite.Cnds.IsAnimPlaying,C3$jscomp$385.Plugins.Sprite.Acts.SetAnimFrame,C3$jscomp$385.Plugins.System.Acts.Wait,C3$jscomp$385.Plugins.Sprite.Acts.ZMoveToObject,C3$jscomp$385.Plugins.Sprite.Acts.SetTowardPosition,C3$jscomp$385.Behaviors.Fade.Acts.StartFade,C3$jscomp$385.Behaviors.Fade.Acts.SetFadeOutTime, C3$jscomp$385.Behaviors.Bullet.Cnds.CompareTravelled,C3$jscomp$385.Plugins.Sprite.Exps.ImageWidth,C3$jscomp$385.Plugins.Sprite.Exps.ImageHeight,C3$jscomp$385.Plugins.Sprite.Cnds.PickDistance,C3$jscomp$385.Plugins.TiledBg.Acts.MoveToBottom,C3$jscomp$385.Behaviors.LOS.Exps.Range,C3$jscomp$385.Behaviors.Bullet.Acts.SetBounceOffSolids,C3$jscomp$385.Behaviors.EightDir.Exps.Speed,C3$jscomp$385.Behaviors.EightDir.Acts.SetMaxSpeed,C3$jscomp$385.Behaviors.Fade.Acts.SetWaitTime,C3$jscomp$385.Plugins.Spritefont2.Acts.SetInstanceVar, C3$jscomp$385.Plugins.Audio.Acts.Play,C3$jscomp$385.Plugins.Spritefont2.Acts.SetScale,C3$jscomp$385.Plugins.Spritefont2.Acts.SetCharacterSpacing,C3$jscomp$385.Plugins.Spritefont2.Acts.SetHAlign,C3$jscomp$385.Plugins.Spritefont2.Acts.SetWidth,C3$jscomp$385.Plugins.Spritefont2.Exps.TextWidth,C3$jscomp$385.Plugins.Spritefont2.Acts.SetHeight,C3$jscomp$385.Plugins.Spritefont2.Exps.TextHeight,C3$jscomp$385.Behaviors.Tween.Acts.SetEnabled,C3$jscomp$385.Plugins.Spritefont2.Exps.Y,C3$jscomp$385.Plugins.Arr.Acts.SetXY, C3$jscomp$385.Plugins.System.Acts.SetLayerScale,C3$jscomp$385.Plugins.System.Exps.layerscale,C3$jscomp$385.Plugins.System.Exps.viewportleft,C3$jscomp$385.Plugins.System.Exps.viewportright,C3$jscomp$385.Plugins.System.Exps.viewporttop,C3$jscomp$385.Plugins.System.Exps.viewportbottom,C3$jscomp$385.Plugins.Spritefont2.Exps.Text,C3$jscomp$385.Plugins.Mouse.Exps.X,C3$jscomp$385.Plugins.Mouse.Exps.Y,C3$jscomp$385.Plugins.System.Exps.len,C3$jscomp$385.Plugins.Spritefont2.Acts.AppendText,C3$jscomp$385.Plugins.System.Exps.time, C3$jscomp$385.Plugins.System.Exps.mid,C3$jscomp$385.Behaviors.Timer.Cnds.IsTimerRunning,C3$jscomp$385.Plugins.NinePatch.Exps.BBoxLeft,C3$jscomp$385.Plugins.NinePatch.Exps.BBoxRight,C3$jscomp$385.Plugins.NinePatch.Exps.BBoxTop,C3$jscomp$385.Plugins.NinePatch.Exps.BBoxBottom,C3$jscomp$385.Plugins.Particles.Acts.SetEffectParam,C3$jscomp$385.Plugins.Particles.Acts.SetInitSize,C3$jscomp$385.Plugins.Particles.Acts.SetSizeRandomiser,C3$jscomp$385.Plugins.Particles.Acts.SetGrowRate,C3$jscomp$385.Plugins.Particles.Acts.SetSpeedRandomiser, C3$jscomp$385.Plugins.Particles.Acts.SetLifeSpeedRandomiser,C3$jscomp$385.Plugins.Particles.Acts.SetTimeout,C3$jscomp$385.Plugins.Particles.Acts.SetSprayCone,C3$jscomp$385.Plugins.System.Cnds.OnLayoutEnd,C3$jscomp$385.Plugins.Audio.Acts.StopAll,C3$jscomp$385.Plugins.TiledBg.Acts.SetOpacity,C3$jscomp$385.Plugins.Touch.Cnds.OnTouchObject,C3$jscomp$385.Plugins.Mouse.Cnds.OnObjectClicked,C3$jscomp$385.Plugins.NinePatch.Acts.Destroy,C3$jscomp$385.Plugins.System.Acts.GoToLayout,C3$jscomp$385.Plugins.System.Acts.RestartLayout, C3$jscomp$385.Behaviors.Tween.Acts.TweenTwoProperties,C3$jscomp$385.Plugins.Touch.Exps.TouchCount,C3$jscomp$385.Plugins.Touch.Exps.XAt,C3$jscomp$385.Plugins.Touch.Cnds.IsTouchingObject,C3$jscomp$385.Plugins.Touch.Exps.YAt,C3$jscomp$385.Plugins.System.Exps.min,C3$jscomp$385.Plugins.System.Cnds.AngleWithin,C3$jscomp$385.Behaviors.EightDir.Acts.SimulateControl,C3$jscomp$385.Plugins.Touch.Exps.TouchID,C3$jscomp$385.Plugins.Touch.Cnds.OnTouchEnd,C3$jscomp$385.Plugins.Sprite.Cnds.IsVisible,C3$jscomp$385.Plugins.Keyboard.Cnds.IsKeyDown, C3$jscomp$385.Plugins.Mouse.Cnds.IsButtonDown,C3$jscomp$385.Plugins.Keyboard.Cnds.OnKey,C3$jscomp$385.Behaviors.EightDir.Cnds.CompareSpeed,C3$jscomp$385.Plugins.Sprite.Acts.AddInstanceVar,C3$jscomp$385.Plugins.Touch.Cnds.OnTapGestureObject,C3$jscomp$385.Plugins.System.Acts.ToggleBoolVar,C3$jscomp$385.Plugins.System.Acts.SetTimescale,C3$jscomp$385.Plugins.Mouse.Acts.SetCursor,C3$jscomp$385.Plugins.NinePatch.Acts.SetWidth,C3$jscomp$385.Plugins.Audio.Cnds.AdvancedAudioSupported,C3$jscomp$385.Plugins.Audio.Acts.SetListenerObject, C3$jscomp$385.Plugins.Audio.Acts.SetListenerZ,C3$jscomp$385.Behaviors.EightDir.Exps.MovingAngle,C3$jscomp$385.Plugins.NinePatch.Cnds.CompareWidth,C3$jscomp$385.Plugins.NinePatch.Acts.SetEffectParam,C3$jscomp$385.Behaviors.EightDir.Acts.SetEnabled,C3$jscomp$385.Plugins.Particles.Acts.SetPos,C3$jscomp$385.Behaviors.scrollto.Acts.Shake,C3$jscomp$385.Plugins.NinePatch.Acts.SetSize,C3$jscomp$385.Plugins.System.Exps.viewportwidth,C3$jscomp$385.Plugins.NinePatch.Exps.LayerName,C3$jscomp$385.Plugins.System.Exps.viewportheight, C3$jscomp$385.Plugins.Arr.Cnds.CompareXY,C3$jscomp$385.Plugins.TiledBg.Acts.Destroy,C3$jscomp$385.Plugins.TiledBg.Cnds.IsOnScreen,C3$jscomp$385.Behaviors.Flash.Acts.Flash,C3$jscomp$385.Plugins.System.Cnds.PickAll,C3$jscomp$385.Plugins.TiledBg.Exps.LayerName,C3$jscomp$385.Plugins.Browser.Acts.LockOrientation,C3$jscomp$385.Plugins.System.Cnds.EveryTick,C3$jscomp$385.Plugins.System.Exps.loadingprogress,C3$jscomp$385.Plugins.System.Cnds.OnLoadFinished,C3$jscomp$385.Plugins.LocalStorage.Acts.CheckItemExists, C3$jscomp$385.Plugins.AJAX.Acts.RequestFile,C3$jscomp$385.Plugins.System.Exps.viewportmidx,C3$jscomp$385.Plugins.Sprite.Exps.LayerName,C3$jscomp$385.Plugins.NinePatch.Acts.SetPos,C3$jscomp$385.Plugins.System.Exps.layoutwidth,C3$jscomp$385.Plugins.LocalStorage.Cnds.OnItemExists,C3$jscomp$385.Plugins.Dictionary.Acts.JSONLoad,C3$jscomp$385.Plugins.LocalStorage.Exps.ItemValue,C3$jscomp$385.Plugins.Arr.Acts.JSONLoad,C3$jscomp$385.Plugins.Dictionary.Exps.Get,C3$jscomp$385.Plugins.LocalStorage.Cnds.OnItemMissing, C3$jscomp$385.Plugins.System.Acts.WaitForPreviousActions,C3$jscomp$385.Plugins.AJAX.Cnds.OnComplete,C3$jscomp$385.Plugins.AJAX.Exps.LastData,C3$jscomp$385.Plugins.Mouse.Cnds.OnAnyClick,C3$jscomp$385.Plugins.Keyboard.Cnds.OnAnyKey,C3$jscomp$385.Plugins.Touch.Cnds.OnTouchStart,C3$jscomp$385.Plugins.Dictionary.Cnds.ForEachKey,C3$jscomp$385.Plugins.AdvancedRandom.Acts.CreateProbabilityTableFromJSON,C3$jscomp$385.Plugins.Dictionary.Exps.CurrentKey,C3$jscomp$385.Plugins.Dictionary.Exps.CurrentValue,C3$jscomp$385.Plugins.System.Cnds.LayerVisible, C3$jscomp$385.Plugins.Sprite.Cnds.CompareFrame,C3$jscomp$385.Plugins.NinePatch.Cnds.CompareInstanceVar,C3$jscomp$385.Plugins.System.Exps.layoutheight,C3$jscomp$385.Plugins.Browser.Cnds.OnResize,C3$jscomp$385.Plugins.Dictionary.Acts.AddKey,C3$jscomp$385.Plugins.Arr.Exps.AsJSON,C3$jscomp$385.Plugins.LocalStorage.Acts.SetItem,C3$jscomp$385.Plugins.Dictionary.Exps.AsJSON,C3$jscomp$385.Plugins.TiledBg.Exps.BBoxTop,C3$jscomp$385.Plugins.System.Acts.SetLayerOpacity,C3$jscomp$385.Plugins.Sprite.Acts.SetScale, C3$jscomp$385.Plugins.TiledBg.Exps.Y,C3$jscomp$385.Plugins.Sprite.Acts.SetMirrored,C3$jscomp$385.Plugins.System.Cnds.PickByComparison,C3$jscomp$385.Plugins.System.Acts.ScrollX,C3$jscomp$385.Plugins.System.Cnds.LayerCmpOpacity,C3$jscomp$385.Plugins.Spritefont2.Acts.SetY,C3$jscomp$385.Behaviors.Tween.Acts.TweenValue,C3$jscomp$385.Plugins.System.Acts.GoToLayoutByName,C3$jscomp$385.Behaviors.Tween.Cnds.IsPlaying,C3$jscomp$385.Behaviors.Tween.Exps.Value,C3$jscomp$385.Plugins.System.Exps.scrollx,C3$jscomp$385.Plugins.Date.Exps.Now, C3$jscomp$385.Plugins.Arr.Cnds.ArrForEach,C3$jscomp$385.Plugins.Arr.Exps.CurValue,C3$jscomp$385.Plugins.Arr.Exps.CurX,C3$jscomp$385.Plugins.Arr.Acts.SetSize,C3$jscomp$385.Plugins.Arr.Exps.Height,C3$jscomp$385.Plugins.Arr.Exps.Depth,C3$jscomp$385.Plugins.System.Acts.StopLoop,C3$jscomp$385.Plugins.Arr.Cnds.CompareCurrent,C3$jscomp$385.Plugins.Spritefont2.Acts.SetDefaultColor,C3$jscomp$385.Plugins.Arr.Acts.Insert,C3$jscomp$385.Behaviors.Anchor.Acts.SetEnabled,C3$jscomp$385.Plugins.Spritefont2.Acts.SetPos, C3$jscomp$385.Plugins.Spritefont2.Exps.IID,C3$jscomp$385.Plugins.Spritefont2.Acts.SetAngle,C3$jscomp$385.Plugins.Spritefont2.Exps.X,C3$jscomp$385.Behaviors.Pin.Acts.PinByProperties,C3$jscomp$385.Behaviors.Rotate.Acts.SetSpeed,C3$jscomp$385.Behaviors.Rotate.Acts.SetAcceleration,C3$jscomp$385.Plugins.System.Exps.zeropad,C3$jscomp$385.Behaviors.Rotate.Exps.Speed,C3$jscomp$385.Plugins.Spritefont2.Cnds.PickDistance,C3$jscomp$385.Plugins.Spritefont2.Acts.Destroy]}; self.C3_JsPropNameTable=[{weapon:0},{wepname:0},{firerate:0},{damage:0},{shoot:0},{recoil:0},{autoaim:0},{LineOfSight:0},{player_top:0},{health:0},{a:0},{d:0},{overlap:0},{burning:0},{corroded:0},{shield:0},{"8Direction":0},{Timer:0},{player_base:0},{player_shadow:0},{spawn_player:0},{ready:0},{spawn_enemy:0},{tankID:0},{Pin:0},{en_health:0},{en_health_bg:0},{pinned:0},{state:0},{enemy_base:0},{enemy_shadow:0},{startX:0},{startY:0},{targetX:0},{targetY:0},{enemy_top:0},{aidID:0},{aid_icon:0},{enemyID:0}, {en_icon:0},{radar:0},{player_crush:0},{Fade:0},{gunfire_all:0},{hit_shell:0},{part_en_smoke:0},{part_rocket:0},{ScrollTo:0},{camera:0},{phaserfire:0},{hit_simple:0},{pl_shock_hit:0},{part_pl_smoke:0},{debris_block:0},{debris_explosive:0},{fow_view:0},{bang:0},{enemy_crush:0},{hit_bang:0},{hit_phaser:0},{hit_flame:0},{part_bang:0},{harmful:0},{fire:0},{corrosion:0},{bang_light:0},{part_corrosion:0},{debris_corrosion:0},{debris_aidcrate:0},{debris_crate:0},{part_pl_burn:0},{part_en_burn:0},{part_pl_corr:0}, {part_en_corr:0},{flashing:0},{Flash:0},{emit:0},{em_fire:0},{emitterID:0},{em_beam:0},{pl_shock_light:0},{en_shock_light:0},{en_shock_hit:0},{hit_flash:0},{shooter:0},{bullet:0},{targetUID:0},{follow:0},{bul_rocket:0},{lastX:0},{lastY:0},{bul_phaser:0},{Tween:0},{bul_phaser_trail:0},{bul_flame:0},{bul_gren:0},{mine:0},{topID:0},{en_shock:0},{pl_shock:0},{btn_fscrn:0},{level:0},{btn_level:0},{btn_fight:0},{logo:0},{btn_sound:0},{Anchor:0},{scorefont:0},{popupUpgrades:0},{aim:0},{price:0},{ammo:0}, {price_ammo:0},{intensity:0},{btn_upg_wep:0},{ico_tank:0},{scorelabel:0},{pop_close:0},{left:0},{btn_gunswitch:0},{btn_add_lvl:0},{btn_add_ammo:0},{ind_lvl:0},{loader_bar:0},{btn_any:0},{upgrade:0},{btn_upg_tank:0},{color:0},{content:0},{effect:0},{font_10px:0},{prize:0},{font_7px:0},{part_ui:0},{player_hp:0},{player_hp_bg:0},{ind_lvl2:0},{level_bar_bg:0},{level_bar:0},{ammo_bar:0},{ammo_bar_bg:0},{loader_bg:0},{loader_icon:0},{font_10x16px:0},{ico_ammo:0},{btn_confirm:0},{btn_play:0},{help_desktop:0}, {btn_lvl_end:0},{popupStats:0},{btn_shop:0},{pop_stats_line:0},{level_group:0},{btn_next_prev:0},{btn_switcher:0},{dist:0},{ang:0},{tmbstickbase:0},{TouchID:0},{tmbstick:0},{shop_item:0},{shopitem:0},{shop_buy_btn:0},{coin_sparks:0},{btn_pause:0},{btn_lang:0},{btn_spin:0},{part_coins:0},{pop_lang:0},{shop_item_bg:0},{"9lives_logo":0},{loader_spinner:0},{icon_warn:0},{part_wheel:0},{bg_cammo:0},{bg_fade:0},{bg_loader:0},{ui_wep_bg:0},{resist:0},{resistMax:0},{Solid:0},{block_fragile:0},{blockID:0}, {block_flash:0},{clouds:0},{floorQty:0},{tm_landscape:0},{block_shadow:0},{menu_bg_tank:0},{bg_menu:0},{tb_palms:0},{bg_rocks:0},{stuff:0},{qty:0},{aid:0},{Bullet:0},{coin:0},{emitter:0},{arrLevels:0},{arrPlayerGuns:0},{Audio:0},{Browser:0},{Keyboard:0},{LocalStorage:0},{Mouse:0},{Touch:0},{probTables:0},{arrEnemyTank:0},{arrPlayerTank:0},{arrEnemyGuns:0},{AJAX:0},{dictProb:0},{arrGunDB:0},{Date:0},{arrWheel:0},{dictGameData:0},{spin_point:0},{rotating:0},{Rotate:0},{spin_wheel:0},{f_mob_controls:0}, {f_pl_tank:0},{DestroyOutsideLayout:0},{f_bullets:0},{DestroyOutsideLayout2:0},{f_destroy:0},{f_radar:0},{f_upg_gui:0},{f_ind_lvls:0},{f_game_gui:0},{f_particles:0},{f_enemies:0},{f_debris:0},{f_en_tank:0},{f_bul_hits:0},{f_pushed:0},{f_hp_gui:0},{f_tilemaps:0},{f_emitters:0},{f_menu_gui:0},{spawnerUID:0},{topUID:0},{enqty:0},{stop:0},{free_spawner:0},{tankUID:0},{tankState:0},{tankAccel:0},{tankSpeed:0},{ignore_input:0},{music_track:0},{hp_bar:0},{en_count:0},{aid_count:0},{fight_range:0},{add_coins:0}, {shield_time:0},{tanks_destroyed:0},{obj_destroyed:0},{ammo_collected:0},{coins_collected:0},{GetTileX:0},{GetTileY:0},{plays:0},{patrolOff:0},{pause:0},{debrisAmount:0},{blockUID:0},{hitX:0},{hitY:0},{bulletAnimation:0},{bulletUID:0},{stuffUID:0},{speed:0},{coinsInCrate:0},{tweenTime:0},{won:0},{aaAngle:0},{viewAngle:0},{mag:0},{dur:0},{control_mode:0},{first_time:0},{all_sounds:0},{adblock:0},{MaxAchievedLevel:0},{SelectedLevel:0},{CurrentPage:0},{NumberPages:0},{PageWidth:0},{coins:0},{firerateLag:0}, {damageLag:0},{speedLag:0},{armorLag:0},{aimLag:0},{soundOff:0},{musicOff:0},{autoAim:0},{dailyTime:0},{bonusTimer:0},{bonusInterval:0},{rewTime:0},{justUpdate:0},{gunType:0},{gunPrice:0},{weaponName:0},{weaponLevel:0},{weaponPrice:0},{ammoQty:0},{ammoPrice:0}];const C3$jscomp$386=self.C3;function bothNumbers(a,b){return"number"===typeof a&&"number"===typeof b}function add$jscomp$4(a,b){return bothNumbers(a,b)?a+b:a}function subtract$jscomp$1(a,b){return bothNumbers(a,b)?a-b:a} function multiply$jscomp$1(a,b){return bothNumbers(a,b)?a*b:a}function divide$jscomp$1(a,b){return bothNumbers(a,b)?a/b:a}function and(a,b){return"string"===typeof a||"string"===typeof b?("number"===typeof a?(Math.round(1E10*a)/1E10).toString():a)+("number"===typeof b?(Math.round(1E10*b)/1E10).toString():b):a&&b?1:0} self.C3_ExpressionFuncs=[()=>"Spawn",a=>{const b=a._GetNode(0).GetVar();return()=>b.GetValue()},()=>"Game",a=>{const b=a._GetNode(0);return()=>b.ExpObject()},()=>"",a=>{const b=a._GetNode(0);return()=>b.ExpObject()-6},a=>{const b=a._GetNode(0);return()=>b.ExpObject()-16},()=>0,a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod(),d=a._GetNode(2);return()=>b.ExpObject(Math.floor(c(0,d.ExpObject())),0)},a=>{const b=a._GetNode(0);return()=>b.ExpInstVar()},a=>{const b=a._GetNode(0),c=a._GetNode(1), d=a._GetNode(2);return()=>b.ExpObject(c.ExpObject(d.ExpInstVar()),1)},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>b.ExpObject(c.ExpObject(d.ExpInstVar()),2)},a=>{const b=a._GetNode(0).GetVar(),c=a._GetNode(1).GetVar();return()=>b.GetValue()+.35*c.GetValue()},a=>{const b=a._GetNode(0);return()=>b.ExpObject(1)},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>multiply$jscomp$1(divide$jscomp$1(b.ExpInstVar(),c.ExpObject(1)),12)},()=>"UI",a=>{const b=a._GetNode(0).GetBoundMethod(); return()=>b(360)},()=>1,()=>"rocket",()=>"shock",()=>"enVariety0",()=>2,()=>"enVariety1",()=>"enVariety2",a=>{const b=a._GetNode(0).GetVar();return()=>Math.floor(b.GetValue()/3)},a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b()},()=>"enbeams",()=>"Effects",()=>"Fire",()=>4,a=>{const b=a._GetNode(0).GetVar();return()=>Math.ceil(Math.sqrt(b.GetValue())/1.3)},a=>{const b=a._GetNode(0).GetVar();return()=>and("Spawners ready: ",b.GetValue())},a=>{const b=a._GetNode(0);return()=>b.ExpObject()+2}, a=>{const b=a._GetNode(0);return()=>b.ExpObject()+180},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpInstVar(),0,10*c())},()=>"AI",()=>"State machine",()=>"wait",a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>multiply$jscomp$1(multiply$jscomp$1(b.ExpObject(2),30),c())},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(1,3))},()=>"patrol",a=>{const b=a._GetNode(0);return()=>b.ExpObject(0)}, ()=>-15,a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3).GetBoundMethod();return()=>b(c.ExpObject(),d.ExpBehavior(),4*e())},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(3,7))},a=>{const b=a._GetNode(0);return()=>divide$jscomp$1(b.ExpObject(0),2)},()=>5,a=>{const b=a._GetNode(0).GetBoundMethod();return()=>Math.floor(b(360))},()=>"follow",()=>10,a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=> multiply$jscomp$1(multiply$jscomp$1(b.ExpObject(2),100),c())},()=>3,a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3);return()=>C3$jscomp$386.toDegrees(C3$jscomp$386.angleTo(b.ExpObject(),c.ExpObject(),d.ExpObject(),e.ExpObject()))},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3),g=a._GetNode(4),k=a._GetNode(5),l=a._GetNode(6).GetBoundMethod();return()=>b(c.ExpObject(),C3$jscomp$386.toDegrees(C3$jscomp$386.angleTo(d.ExpObject(),e.ExpObject(), g.ExpObject(),k.ExpObject())),30*l())},()=>"dead",()=>"orange",()=>64,()=>"fire_bang",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(360))},()=>3.5,()=>1.6,()=>"explode",()=>23,()=>360,()=>-100,()=>"fx",()=>30,()=>40,()=>100,()=>60,()=>96,()=>"big_bang",()=>18,()=>"coins",()=>"Blocks",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(30,40))},()=>-50,()=>"won",()=>"aiCollisions",()=>.35,()=>"overlap",a=>{const b=a._GetNode(0); return()=>b.ExpObject()-1},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3);return()=>C3$jscomp$386.distanceTo(b.ExpObject(),c.ExpObject(),d.ExpObject(),e.ExpObject())},()=>25,a=>{const b=a._GetNode(0);return()=>b.ExpInstVar()+180},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3),g=a._GetNode(4),k=a._GetNode(5);return()=>C3$jscomp$386.toDegrees(C3$jscomp$386.angleTo(b.ExpObject(),c.ExpObject(),d.ExpObject(e.ExpObject()),g.ExpObject(k.ExpObject())))}, a=>{const b=a._GetNode(0);return()=>.3*(25-b.ExpInstVar())},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpInstVar()*Math.cos(C3$jscomp$386.toRadians(c.ExpInstVar()))},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpInstVar()*Math.sin(C3$jscomp$386.toRadians(c.ExpInstVar()))},()=>"aiEffects",a=>{const b=a._GetNode(0);return()=>b.ExpBehavior()},a=>{const b=a._GetNode(0);return()=>divide$jscomp$1(b.ExpObject(1,0),2)},()=>15,()=>45,()=>75,()=>"burning",()=>.5,a=>{const b=a._GetNode(0); return()=>divide$jscomp$1(b.ExpObject(1,0),90)},()=>"corroded",()=>"Enemy Firing",()=>"mg",()=>"enemy",a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>b.ExpObject()+c(-1,1)},()=>-24,()=>"shotgun",()=>-17,()=>"shot",a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>b.ExpObject()+c(-15,15)},a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b(120,180)},()=>"minigun",()=>"barrels",a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b("barrels")},()=>"cannon", ()=>-11,()=>"flame",a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>b.ExpObject()+c(-4,4)},a=>{const b=a._GetNode(0);return()=>b.ExpObject()/1.5},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(160,200))},()=>-5,()=>"enflame fx",()=>"phaser",()=>-4,()=>-19,()=>"grenades",()=>-12,()=>"gren",a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod(),d=a._GetNode(2).GetBoundMethod();return()=>b.ExpObject()+c(d(-8,8))},a=>{const b=a._GetNode(0), c=a._GetNode(1).GetBoundMethod();return()=>subtract$jscomp$1(b.ExpBehavior(),c(15,30))},a=>{const b=a._GetNode(0);return()=>-(b.ExpBehavior()/2)},a=>{const b=a._GetNode(0);return()=>b.ExpObject("fire")},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetVar();return()=>b.ExpInstVar()+Math.cos(C3$jscomp$386.toRadians(c.ExpObject()))*d.GetValue()},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetVar();return()=>b.ExpInstVar()+Math.sin(C3$jscomp$386.toRadians(c.ExpObject()))*d.GetValue()}, a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3);return()=>C3$jscomp$386.distanceTo(b.ExpInstVar(),c.ExpInstVar(),d.ExpInstVar(),e.ExpInstVar())},()=>.05,a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>8*b(c(3))},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod(),d=a._GetNode(2).GetBoundMethod(),e=a._GetNode(3).GetBoundMethod();return()=>b.ExpObject()+c(d(100,250))*e()},()=>-20,()=>"enshock fx",()=>"enflame",()=>"enshock",()=> "System",()=>"fadein",()=>.8,()=>"ignore_input",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(0,4))},()=>"music",a=>{const b=a._GetNode(0).GetVar();return()=>and("level_",b.GetValue())},()=>"mobile",()=>"Desktop Controls",()=>"Mobile Controls",()=>"desktop",()=>2.125,a=>{const b=a._GetNode(0),c=a._GetNode(1).GetVar();return()=>add$jscomp$4(b.ExpObject(0),c.GetValue()/4)},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetVar();return()=>add$jscomp$4(b.ExpObject(1), c.GetValue()/10)},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetVar();return()=>subtract$jscomp$1(b.ExpObject(0),c.GetValue()/4)},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetVar();return()=>subtract$jscomp$1(b.ExpObject(1),c.GetValue()/10)},a=>{const b=a._GetNode(0).GetVar();return()=>Math.floor(b.GetValue()/100*25)},()=>.06,a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>b.ExpObject()-72*c()},()=>"guiAmmo",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2); return()=>and("*",b(c.ExpObject(d.ExpInstVar(),6)))},()=>"^",()=>"Transition",()=>"Collisions",()=>"Destructible Blocks",()=>"block",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(1.2,2),1)},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(6,9))},()=>"dust_bang",a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod(),d=a._GetNode(2).GetBoundMethod();return()=>b.ExpObject()+c(d(-4,4))},a=>{const b=a._GetNode(0).GetBoundMethod(); return()=>and("rotating",b(1,2))},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod(),d=a._GetNode(2).GetBoundMethod();return()=>b.ExpBehavior()+c(d(-40,54))},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>b.ExpObject()+c.ExpObject()*Math.cos(C3$jscomp$386.toRadians(d.ExpBehavior()))},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>b.ExpObject()+c.ExpObject()*Math.sin(C3$jscomp$386.toRadians(d.ExpBehavior()))},a=>{const b=a._GetNode(0),c=a._GetNode(1); return()=>b.ExpObject()+4*Math.cos(C3$jscomp$386.toRadians(c.ExpBehavior()))},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject()+4*Math.sin(C3$jscomp$386.toRadians(c.ExpBehavior()))},a=>{const b=a._GetNode(0);return()=>b.ExpInstVar_Family()},a=>{const b=a._GetNode(0);return()=>b.ExpInstVar()/2},()=>.07,()=>"EnemyBullets",()=>"PlayerBullets",()=>"player",()=>"Bullet Effects",()=>-16,()=>32,()=>-8,()=>48,a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3);return()=> C3$jscomp$386.distanceTo(b.ExpObject(),c.ExpObject(),d.ExpInstVar(),e.ExpInstVar())},()=>"DecreaseHeight",()=>.1,a=>{const b=a._GetNode(0).GetVar();return()=>8E-4*b.GetValue()},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>b.ExpObject()+16*c()},a=>{const b=a._GetNode(0);return()=>b.ExpBehavior()/4},a=>{const b=a._GetNode(0).GetVar();return()=>b.GetValue()/2.2},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(), 1.085*c.ExpObject(),12*d())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject(),16*d())},()=>.6,a=>{const b=a._GetNode(0).GetVar();return()=>b.GetValue()/9},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3),g=a._GetNode(4),k=a._GetNode(5),l=a._GetNode(6).GetBoundMethod();return()=>b(c.ExpObject(),C3$jscomp$386.toDegrees(C3$jscomp$386.angleTo(d.ExpObject(),e.ExpObject(),g.ExpObject(), k.ExpObject())),12*l())},a=>{const b=a._GetNode(0);return()=>b.ExpObject()-180},a=>{const b=a._GetNode(0);return()=>b.ExpBehavior()/2},()=>"Beam Block",()=>"Beam",()=>"embeams",()=>"fire",()=>-25,()=>"embeam fx",a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>b.ExpInstVar()+Math.cos(C3$jscomp$386.toRadians(c.ExpObject()))*d.ExpBehavior()},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>b.ExpInstVar()+Math.sin(C3$jscomp$386.toRadians(c.ExpObject()))*d.ExpBehavior()}, a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>8*b(c(2))},()=>"embeamtank fx",()=>"embeamtank",()=>.3,()=>"crate",()=>"aidcrate",()=>.04,()=>"embeamstuff fx",()=>"embeamstuff",()=>"Stuff",()=>"explosive",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(.6,.9),1)},()=>"corrosion",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(1,1.6),1)},()=>24,()=>35,()=>.14,a=>{const b=a._GetNode(0); return()=>b.ExpObject(0,2)},a=>{const b=a._GetNode(0).GetVar();return()=>b.GetValue()+180},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(100))},()=>20,()=>"green",()=>"corr_bang",a=>{const b=a._GetNode(0);return()=>divide$jscomp$1(b.ExpObject(1,2),2)},()=>"aidEmergency1",()=>"aidEmergency0",()=>"aidMixed1",()=>"aidMixed0",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(8,16))},a=>{const b=a._GetNode(0).GetBoundMethod(), c=a._GetNode(1).GetBoundMethod();return()=>b(c(4,8))},()=>"Collect Items",()=>8,a=>{const b=a._GetNode(0);return()=>b.ExpObject()-2},()=>"gotcoins",a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b(1,1.5)},()=>-1,a=>{const b=a._GetNode(0).GetVar();return()=>and("[color=#f8d67a]+",b.GetValue())+"[/color]"},()=>"pos",a=>{const b=a._GetNode(0);return()=>b.ExpObject()-40},()=>"opa",()=>"aid",a=>{const b=a._GetNode(0);return()=>b.ExpObject(1,2)},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=> C3$jscomp$386.clamp(b.ExpInstVar()+4,0,c.ExpObject(1,2))},()=>"remedy fx",()=>"ammo",a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject(c.ExpInstVar(),6)},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject(c.ExpInstVar(),3)},()=>6,a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3),g=a._GetNode(4);return()=>C3$jscomp$386.clamp(add$jscomp$4(b.ExpObject(c.ExpInstVar(),6),d.ExpInstVar()),0,e.ExpObject(g.ExpInstVar(),3))},()=>"shield",a=>{const b=a._GetNode(0).GetVar(); return()=>b.GetValue()-2},()=>-10,()=>"shield fx",()=>"Bang Damage",a=>{const b=a._GetNode(0);return()=>divide$jscomp$1(b.ExpObject(1,0),15)},a=>{const b=a._GetNode(0);return()=>divide$jscomp$1(b.ExpObject(1,2),15)},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>b(1,3)*(c.ExpInstVar()/3)},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2).GetBoundMethod();return()=>b(c.ExpInstVar()/d(1,3),2)},()=>"GameResult",()=>"lost",()=>"LevelEnd",a=>{const b=a._GetNode(0).GetBoundMethod(); return()=>b("UI")/2},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>(b("LevelEnd")+c("LevelEnd"))/2},a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b("LevelEnd")-400},()=>"bg_popup",()=>55,()=>.4,()=>"popup",()=>"result",()=>1.5,()=>"tnkDest",()=>"[color=#f8d67a]tanks destroyed:[/color]",()=>"tanksDestroyed",()=>"objDest",()=>"[color=#f8d67a]objects destroyed:[/color]",()=>"objDestroyed",()=>"amColl",()=>"[color=#f8d67a]ammo picked up:[/color]",()=>"ammoCollected", ()=>"cnsErnd",()=>"[color=#f8d67a]coins earned[/color]",()=>"coinsCollected",()=>"win",()=>"salut",()=>"victory fx",()=>"#60a73b",()=>"victory!",a=>{const b=a._GetNode(0).GetVar();return()=>b.GetValue()+1},()=>"unlocked",()=>-3,()=>"noise fx",()=>"#d54a4a",()=>"defeat!",()=>"EndEffects",a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod(),d=a._GetNode(2).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(),c(),12*d())},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=> b(c.ExpInstVar())},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod(),d=a._GetNode(2).GetBoundMethod(),e=a._GetNode(3).GetBoundMethod(),g=a._GetNode(4),k=a._GetNode(5).GetBoundMethod();return()=>and("[color="+b.ExpInstVar()+"][offsetY=",2*Math.sin(C3$jscomp$386.toRadians(300*c()+90*d())))+"]"+e(g.ExpInstVar(),k(),1)+"[/offsetY][/color]"},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod(),d=a._GetNode(2).GetBoundMethod(),e=a._GetNode(3).GetBoundMethod(),g=a._GetNode(4),k=a._GetNode(5).GetBoundMethod(); return()=>and(and("[color="+b.ExpInstVar()+"][offsetX=",c(-1,1))+"][offsetY=",d(-1,1))+"]"+e(g.ExpInstVar(),k(),1)+"[/offsetY][/offsetX][/color]"},a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b(.25,1)},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2);return()=>b(c.ExpObject(),d.ExpObject())},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2);return()=>b(c.ExpObject(),d.ExpObject()/2)},()=>"AdjustHSL",a=>{const b=a._GetNode(0).GetBoundMethod(); return()=>b(0,20,45,65,75)},()=>-1.25,()=>1.1,()=>340,()=>"salut fx",()=>"ui fx",()=>.25,()=>"continue",()=>"upgrade",()=>"restart",a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b("UI")+33},a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b("UI")-33},a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b("UI")-72},a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b("UI")-15},a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b("UI")+100},()=>"Aim",()=>"AutoAim",()=>"ctrl",a=>{const b= a._GetNode(0);return()=>1.3*b.ExpObject()},()=>"Sticks",a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject(),12*d())},()=>"t",a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b()-1},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(),"UI")},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetBoundMethod(),e=a._GetNode(3).GetBoundMethod(),g=a._GetNode(4).GetBoundMethod(), k=a._GetNode(5).GetBoundMethod();return()=>C3$jscomp$386.toDegrees(C3$jscomp$386.angleTo(b.ExpObject(),c.ExpObject(),d(e(),"UI"),g(k(),"UI")))},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetBoundMethod(),e=a._GetNode(3).GetBoundMethod(),g=a._GetNode(4).GetBoundMethod(),k=a._GetNode(5).GetBoundMethod();return()=>C3$jscomp$386.distanceTo(b.ExpObject(),c.ExpObject(),d(e(),"UI"),g(k(),"UI"))},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3);return()=> b(c.ExpInstVar(),d.ExpObject()/2-e.ExpObject()/3)},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>b.ExpObject()+c.ExpInstVar()*Math.cos(C3$jscomp$386.toRadians(d.ExpInstVar()))},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>b.ExpObject()+c.ExpInstVar()*Math.sin(C3$jscomp$386.toRadians(d.ExpInstVar()))},()=>"Moving",()=>270,()=>180,()=>90,()=>"tankidling",()=>"tankmoving fx",()=>"tankmoving",()=>"tankidling fx",a=>{const b=a._GetNode(0),c=a._GetNode(1),d= a._GetNode(2),e=a._GetNode(3).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject()+18*Math.cos(C3$jscomp$386.toRadians(d.ExpInstVar())),8*e())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject()+18*Math.sin(C3$jscomp$386.toRadians(d.ExpInstVar())),8*e())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(), c.ExpObject()+52*Math.cos(C3$jscomp$386.toRadians(d.ExpInstVar())),10*e())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject()+52*Math.sin(C3$jscomp$386.toRadians(d.ExpInstVar())),10*e())},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>multiply$jscomp$1(multiply$jscomp$1(b.ExpObject(2,2),50),c())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetBoundMethod();return()=> C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject(),8*d())},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>multiply$jscomp$1(multiply$jscomp$1(b.ExpObject(2,2),20),c())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetVar(),e=a._GetNode(3).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject()+18*Math.cos(C3$jscomp$386.toRadians(d.GetValue())),8*e())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetVar(),e=a._GetNode(3).GetBoundMethod(); return()=>C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject()+18*Math.sin(C3$jscomp$386.toRadians(d.GetValue())),8*e())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject(),10*d())},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>multiply$jscomp$1(multiply$jscomp$1(b.ExpObject(2,2),60),c())},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod(),d=a._GetNode(2).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(), c(),9*d())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetVar(),e=a._GetNode(3).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject()+22*Math.cos(C3$jscomp$386.toRadians(d.GetValue())),6*e())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetVar(),e=a._GetNode(3).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject()+18*Math.sin(C3$jscomp$386.toRadians(d.GetValue())),6*e())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetVar(), e=a._GetNode(3).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject()+48*Math.cos(C3$jscomp$386.toRadians(d.GetValue())),6*e())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetVar(),e=a._GetNode(3).GetBoundMethod();return()=>C3$jscomp$386.lerp(b.ExpObject(),c.ExpObject()+32*Math.sin(C3$jscomp$386.toRadians(d.GetValue())),6*e())},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>multiply$jscomp$1(multiply$jscomp$1(b.ExpObject(2,2),75),c())},a=>{const b= a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject(c.ExpInstVar())},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject(c.ExpInstVar(),1)},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject(c.ExpInstVar(),2)},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject(c.ExpInstVar()-1)},()=>"CreatePlayer",a=>{const b=a._GetNode(0).GetVar();return()=>b.GetValue()+2},()=>"FOW",()=>16,a=>{const b=a._GetNode(0);return()=>b.ExpObject()+3},a=>{const b=a._GetNode(0).GetBoundMethod(), c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3).GetBoundMethod();return()=>b(c.ExpObject(),d.ExpBehavior(),8*e())},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>b.ExpBehavior()+100*c()},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2).GetVar();return()=>multiply$jscomp$1(divide$jscomp$1(b.ExpInstVar(),c.ExpObject(1,2)),d.GetValue())},a=>{const b=a._GetNode(0).GetVar();return()=>2*Math.floor(b.GetValue()/100*33)},()=>"Tint",()=>-0x73035c00f3ff,()=>-281489405158399,a=> {const b=a._GetNode(0).GetVar();return()=>Math.floor(b.GetValue()/100*33)},()=>-281479775036415,()=>1.2,()=>-2,()=>"burn fx",()=>"Camera",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>b(c.ExpObject())},()=>"Flash",()=>"Firing",()=>"default",()=>-22,a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>subtract$jscomp$1(b.ExpObject(c.ExpInstVar(),6),1)},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod(),d=a._GetNode(2).GetBoundMethod();return()=>b.ExpObject()+c(d(-15,15))}, a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(120,180))},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>subtract$jscomp$1(b.ExpObject(c.ExpInstVar(),6),.25)},()=>-9,a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>subtract$jscomp$1(b.ExpObject(c.ExpInstVar(),6),.05)},()=>"flame fx",a=>{const b=a._GetNode(0).GetVar(),c=a._GetNode(1),d=a._GetNode(2).GetVar();return()=>b.GetValue()+Math.cos(C3$jscomp$386.toRadians(c.ExpObject()))*d.GetValue()},a=>{const b= a._GetNode(0).GetVar(),c=a._GetNode(1),d=a._GetNode(2).GetVar();return()=>b.GetValue()+Math.sin(C3$jscomp$386.toRadians(c.ExpObject()))*d.GetValue()},()=>"beams",()=>"shock fx",a=>{const b=a._GetNode(0).GetVar(),c=a._GetNode(1).GetVar(),d=a._GetNode(2).GetVar(),e=a._GetNode(3).GetVar();return()=>C3$jscomp$386.distanceTo(b.GetValue(),c.GetValue(),d.GetValue(),e.GetValue())},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>subtract$jscomp$1(b.ExpObject(c.ExpInstVar(),6),.125)},()=>"burn",()=>.16, a=>{const b=a._GetNode(0);return()=>divide$jscomp$1(b.ExpObject(1,2),120)},()=>"corroded fx",a=>{const b=a._GetNode(0).GetVar();return()=>b.GetValue()-3},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>.042*(b.ExpObject()-c.ExpObject())+d.ExpObject()},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>.04*(b.ExpObject()-c.ExpObject())+d.ExpObject()},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>b(c.ExpObject())+300},()=>"Loader",()=>"splash", a=>{const b=a._GetNode(0);return()=>Math.floor(b.ExpObject()/100*75)},a=>{const b=a._GetNode(0).GetBoundMethod();return()=>C3$jscomp$386.clamp(0,320*b(),320)},()=>"Menu",()=>"Start",()=>"playerData",()=>"gdb",()=>"prob",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>-b(c.ExpObject())/2.3},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>b(c.ExpObject())+3},a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b()/2},a=>{const b=a._GetNode(0).GetBoundMethod(); return()=>b("PopupMenu")-200},a=>{const b=a._GetNode(0);return()=>b.ExpObject("arrPlayerGuns")},a=>{const b=a._GetNode(0);return()=>b.ExpObject("arrPlayerTank")},a=>{const b=a._GetNode(0);return()=>b.ExpObject("arrEnemyGuns")},a=>{const b=a._GetNode(0);return()=>b.ExpObject("arrEnemyTank")},a=>{const b=a._GetNode(0);return()=>b.ExpObject("arrLevels")},a=>{const b=a._GetNode(0);return()=>b.ExpObject("fightRange")},a=>{const b=a._GetNode(0);return()=>b.ExpObject("coins")},a=>{const b=a._GetNode(0); return()=>b.ExpObject("hpBar")},a=>{const b=a._GetNode(0);return()=>b.ExpObject("dailyTime")},a=>{const b=a._GetNode(0);return()=>b.ExpObject("autoAim")},a=>{const b=a._GetNode(0);return()=>b.ExpObject("allSounds")},()=>"Previous Data Loaded",()=>"apt",()=>"Defaults Requested",()=>"Defaults Loaded",()=>"Buttons",()=>"PopupMenu",()=>"Sync",()=>.2,()=>"menu",()=>"info",()=>.7,()=>"bg_popup_in",()=>50,()=>.55,()=>"creditsTitle",()=>"[color=#b0c1cb]credits[/color]",()=>"creditsText",()=>"developer: 9lives games\n[color=#f8d67a]dev@9lives.games[/color]\nmusic: alexander ehlers", ()=>"bg_popup_out",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>b(c.ExpObject())+144},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>b(c.ExpObject())+68},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>b(c.ExpObject())-202},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>b(c.ExpObject())-56},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>b(c.ExpObject())-98},a=>{const b=a._GetNode(0).GetBoundMethod(), c=a._GetNode(1);return()=>b(c.ExpObject())+44},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>b(c.ExpObject())-50},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>b(c.ExpObject())-54},()=>"arrPlayerGuns",()=>"arrPlayerTank",()=>"arrEnemyGuns",()=>"arrEnemyTank",()=>"arrLevels",()=>"fightRange",()=>"hpBar",()=>"dailyTime",()=>"autoAim",()=>"allSounds",()=>"Data Saved",()=>"Levels",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1);return()=>b(c.ExpObject())+ 25},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject()+c.ExpObject()/2},()=>"Tutorial",a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b("LevelsUI")},a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b("Cursor")-200},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetVar(),d=a._GetNode(2).GetVar();return()=>b()*c.GetValue()+d.GetValue()/2},()=>"next",()=>"locked",a=>{const b=a._GetNode(0);return()=>and("[color=d69c48]",b.ExpInstVar()+1)+"[/color]"},a=>{const b=a._GetNode(0); return()=>and("[color=9bc674]",b.ExpInstVar()+1)+"[/color]"},()=>47,()=>71,a=>{const b=a._GetNode(0).GetVar(),c=a._GetNode(1).GetVar(),d=a._GetNode(2).GetVar();return()=>b.GetValue()*c.GetValue()+d.GetValue()/2},()=>"soon",()=>"tutorial",a=>{const b=a._GetNode(0).GetVar();return()=>and("Level",b.GetValue())},a=>{const b=a._GetNode(0);return()=>b.ExpBehavior("tutorial")},()=>"loader",()=>320,a=>{const b=a._GetNode(0).GetVar(),c=a._GetNode(1).GetVar(),d=a._GetNode(2).GetVar(),e=a._GetNode(3).GetVar(); return()=>b.GetValue()<c.GetValue()-1?d.GetValue()+1:e.GetValue()},()=>"prev",a=>{const b=a._GetNode(0).GetVar(),c=a._GetNode(1).GetVar(),d=a._GetNode(2).GetVar();return()=>0<b.GetValue()?c.GetValue()-1:d.GetValue()},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetVar(),d=a._GetNode(2).GetVar(),e=a._GetNode(3).GetVar(),g=a._GetNode(4).GetBoundMethod();return()=>C3$jscomp$386.lerp(b(),c.GetValue()*d.GetValue()+e.GetValue()/2,8*g())},()=>"active",()=>"inactive",a=>{const b=a._GetNode(0).GetVar(); return()=>b.GetValue()-1},()=>"Upgrades",a=>{const b=a._GetNode(0);return()=>b.ExpObject(0,0)},a=>{const b=a._GetNode(0);return()=>b.ExpObject(0,1)},()=>200,()=>432E5,a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b("PopUpgrade")},a=>{const b=a._GetNode(0).GetBoundMethod();return()=>b("PopUpgrade")-200},()=>"weapon",()=>"[color=#b0c1cb]weapons[/color]",()=>"tank",()=>"[color=#b0c1cb]upgrades[/color]",()=>"Bonus",a=>{const b=a._GetNode(0).GetVar(),c=a._GetNode(1).GetVar();return()=>b.GetValue()+ c.GetValue()},()=>"rewad",a=>{const b=a._GetNode(0).GetVar();return()=>b.GetValue()+15E4},()=>"Coins",a=>{const b=a._GetNode(0).GetVar();return()=>and("[color=#f8d67a]",b.GetValue())+"[/color]"},a=>{const b=a._GetNode(0).GetVar();return()=>and("Coins: ",b.GetValue())},()=>"nocoins",a=>{const b=a._GetNode(0);return()=>b.ExpObject("txtCenter")},()=>"Guns Buttons",a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject(c.ExpObject(),4)},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject(c.ExpObject(), 5)},a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject(c.ExpObject(),3)},a=>{const b=a._GetNode(0);return()=>and("$[color=#f8d67a]",b.ExpInstVar())+"[/color]"},()=>"[color=#f8d67a]max.[/color]",()=>"PopUpgrade",()=>"bought",()=>"Buying Guns",()=>"UpgradesUI",a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject()+c.ExpInstVar()},a=>{const b=a._GetNode(0);return()=>b.ExpObject()+1},a=>{const b=a._GetNode(0);return()=>b.ExpObject(1,1)},a=>{const b=a._GetNode(0).GetVar();return()=> b.GetValue()+500},a=>{const b=a._GetNode(0).GetVar();return()=>b.GetValue()/2},a=>{const b=a._GetNode(0);return()=>b.ExpObject(2,1)},a=>{const b=a._GetNode(0);return()=>b.ExpObject(2,2)},a=>{const b=a._GetNode(0);return()=>b.ExpObject(3,1)},a=>{const b=a._GetNode(0);return()=>b.ExpObject(3,2)},a=>{const b=a._GetNode(0).GetVar();return()=>b.GetValue()+1E3},a=>{const b=a._GetNode(0);return()=>b.ExpObject(4,1)},a=>{const b=a._GetNode(0);return()=>b.ExpObject(4,2)},a=>{const b=a._GetNode(0);return()=> b.ExpObject(5,1)},a=>{const b=a._GetNode(0);return()=>b.ExpObject(5,2)},a=>{const b=a._GetNode(0);return()=>b.ExpObject(6,1)},a=>{const b=a._GetNode(0);return()=>b.ExpObject(6,2)},a=>{const b=a._GetNode(0);return()=>b.ExpObject(7,1)},a=>{const b=a._GetNode(0);return()=>b.ExpObject(7,2)},a=>{const b=a._GetNode(0);return()=>b.ExpObject(8,1)},a=>{const b=a._GetNode(0);return()=>b.ExpObject(8,2)},()=>"tilt",a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod(),d=a._GetNode(2),e=a._GetNode(3),g=a._GetNode(4).GetBoundMethod(); return()=>add$jscomp$4(b.ExpObject(),multiply$jscomp$1(c(d.ExpInstVar(),2*e.ExpInstVar()),g(-1,1)))},()=>"Upgrading Guns",()=>"textUpgrade",()=>"[color=#b0c1cb]small caliber[/color]",()=>"[color=#b0c1cb]shotgun[/color]",()=>"[color=#b0c1cb]minigun[/color]",()=>"[color=#b0c1cb]cannon[/color]",()=>"[color=#b0c1cb]flamethrower[/color]",()=>"[color=#b0c1cb]phaser[/color]",()=>"[color=#b0c1cb]homing missiles[/color]",()=>"[color=#b0c1cb]grenades[/color]",()=>"[color=#b0c1cb]emitter[/color]",a=>{const b= a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject(c.ExpInstVar_Family())},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>b.ExpObject(c.ExpObject(d.ExpInstVar_Family()),5)},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>add$jscomp$4(b.ExpObject(c.ExpObject(d.ExpInstVar_Family()),4),1)},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3);return()=>b(add$jscomp$4(c.ExpObject(d.ExpObject(e.ExpInstVar_Family()),2),.01), 3)},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>add$jscomp$4(b.ExpObject(c.ExpObject(d.ExpInstVar_Family()),3),5)},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3);return()=>b(subtract$jscomp$1(c.ExpObject(d.ExpObject(e.ExpInstVar_Family()),1),.001),3)},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3);return()=>b(subtract$jscomp$1(c.ExpObject(d.ExpObject(e.ExpInstVar_Family()),1),.01),3)},a=> {const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>add$jscomp$4(b.ExpObject(c.ExpObject(d.ExpInstVar_Family()),5),350)},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>add$jscomp$4(b.ExpObject(c.ExpObject(d.ExpInstVar_Family()),5),500)},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>add$jscomp$4(b.ExpObject(c.ExpObject(d.ExpInstVar_Family()),5),1E3)},()=>"lvlPrice",a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>b.ExpObject(c.ExpObject(d.ExpInstVar_Family()), 3)},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3),g=a._GetNode(4),k=a._GetNode(5),l=a._GetNode(6);return()=>Math.floor(multiply$jscomp$1(subtract$jscomp$1(b.ExpObject(c.ExpObject(d.ExpInstVar_Family()),3),e.ExpObject(g.ExpObject(k.ExpInstVar_Family()),6)),l.ExpInstVar_Family()))},()=>"ammoPrice",a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>add$jscomp$4(multiply$jscomp$1(20,b.ExpObject(c.ExpObject(),4)),4)},()=>"ammobar",a=>{const b=a._GetNode(0),c=a._GetNode(1), d=a._GetNode(2),e=a._GetNode(3);return()=>multiply$jscomp$1(divide$jscomp$1(b.ExpObject(c.ExpObject(),6),d.ExpObject(e.ExpObject(),3)),100)},()=>"lvlLvl",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3),g=a._GetNode(4),k=a._GetNode(5),l=a._GetNode(6),n=a._GetNode(7);return()=>and("[color=#f8d67a]damage: [/color]",b(multiply$jscomp$1(multiply$jscomp$1(c.ExpObject(d.ExpObject(),2),divide$jscomp$1(1,e.ExpObject(g.ExpObject(),1))),k.ExpObject(l.ExpObject(n.ExpObject()), 3)),2))+"/sec."},()=>"[color=#f8d67a]max. damage[/color]",a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>and("$",b.ExpObject(c.ExpObject(),5))},()=>"max.",()=>"ammoQty",()=>"[color=#f8d67a]infinite ammo[/color]",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3),g=a._GetNode(4);return()=>and(and("[color=#f8d67a]ammo: [/color]",b(c.ExpObject(d.ExpObject(),6)))+"[color=#f8d67a]/",e.ExpObject(g.ExpObject(),3))+"[/color]"},()=>"$0",a=>{const b=a._GetNode(0), c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3),g=a._GetNode(4),k=a._GetNode(5),l=a._GetNode(6);return()=>and("$",Math.floor(multiply$jscomp$1(subtract$jscomp$1(b.ExpObject(c.ExpObject(d.ExpInstVar_Family()),3),e.ExpObject(g.ExpObject(k.ExpInstVar_Family()),6)),l.ExpInstVar_Family())))},()=>"Upgrading Tank",a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject(c.ExpObject(),1)},()=>"speed",a=>{const b=a._GetNode(0);return()=>b.ExpObject(0,3)},a=>{const b=a._GetNode(0);return()=>add$jscomp$4(b.ExpObject(0, 1),1)},a=>{const b=a._GetNode(0);return()=>add$jscomp$4(b.ExpObject(0,2),2)},a=>{const b=a._GetNode(0);return()=>add$jscomp$4(b.ExpObject(0,3),500)},()=>"armor",a=>{const b=a._GetNode(0);return()=>b.ExpObject(1,3)},a=>{const b=a._GetNode(0);return()=>add$jscomp$4(b.ExpObject(1,1),1)},a=>{const b=a._GetNode(0);return()=>add$jscomp$4(b.ExpObject(1,2),2)},a=>{const b=a._GetNode(0);return()=>add$jscomp$4(b.ExpObject(1,3),1E3)},()=>"aim",a=>{const b=a._GetNode(0);return()=>b.ExpObject(2,3)},a=>{const b= a._GetNode(0);return()=>add$jscomp$4(b.ExpObject(2,1),1)},a=>{const b=a._GetNode(0);return()=>add$jscomp$4(b.ExpObject(2,2),1)},a=>{const b=a._GetNode(0);return()=>add$jscomp$4(b.ExpObject(2,3),800)},()=>"Upgrading Enemy",a=>{const b=a._GetNode(0),c=a._GetNode(1);return()=>b.ExpObject(c.ExpObject())},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3),g=a._GetNode(4);return()=>b(add$jscomp$4(c.ExpObject(d.ExpObject(),1),divide$jscomp$1(e.ExpObject(g.ExpObject(), 1),8)),3)},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2),e=a._GetNode(3),g=a._GetNode(4);return()=>b(subtract$jscomp$1(c.ExpObject(d.ExpObject(),2),divide$jscomp$1(e.ExpObject(g.ExpObject(),2),1.35)),3)},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2);return()=>b(subtract$jscomp$1(c.ExpObject(0,2),divide$jscomp$1(d.ExpObject(0,2),6.1)),3)},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2);return()=>b(subtract$jscomp$1(c.ExpObject(1, 2),divide$jscomp$1(d.ExpObject(1,2),1.25)),3)},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1),d=a._GetNode(2);return()=>b(subtract$jscomp$1(c.ExpObject(2,2),divide$jscomp$1(d.ExpObject(2,2),3)),3)},()=>"UI Buttons",()=>"settings",()=>"Settings",()=>"soundoff",()=>"musicoff",()=>"autoaim",()=>"textSettings",()=>"[color=#b0c1cb]settings[/color]",()=>"sound",()=>"auto aim on mobile",()=>-0x8002000803ff,()=>"autoaimNotice",()=>"[color=#f8d67a]+25% more coins if disabled[/color]",()=>"[color=#86723f]+25% more coins if disabled[/color]", ()=>-14,()=>"bonus",()=>"textBonus",()=>"[color=#b0c1cb]daily bonus game[/color]",()=>"[color=#f8d67a]spin the wheel every day and get free coins![/color]",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>multiply$jscomp$1(b()+1,c(100,150,200))},()=>"wheel",a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2);return()=>b.ExpObject()+26*Math.cos(C3$jscomp$386.toRadians(360/c.ExpObject()*d.ExpObject()))},a=>{const b=a._GetNode(0),c=a._GetNode(1),d=a._GetNode(2); return()=>b.ExpObject()+26*Math.sin(C3$jscomp$386.toRadians(360/c.ExpObject()*d.ExpObject()))},a=>{const b=a._GetNode(0),c=a._GetNode(1).GetBoundMethod();return()=>b.ExpObject(c())},a=>{const b=a._GetNode(0);return()=>and("$",b.ExpInstVar())},()=>"wheel fx",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetBoundMethod();return()=>b(c(900,1200))},()=>-150,()=>"countdown",a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetVar(),d=a._GetNode(2).GetBoundMethod();return()=>Math.round((b()+ c.GetValue()-d())/1E3)},a=>{const b=a._GetNode(0).GetBoundMethod(),c=a._GetNode(1).GetVar(),d=a._GetNode(2).GetBoundMethod(),e=a._GetNode(3).GetVar(),g=a._GetNode(4).GetBoundMethod(),k=a._GetNode(5).GetVar();return()=>b(Math.floor(c.GetValue()/3600)%60,2)+":"+d(Math.floor(e.GetValue()/60)%60,2)+":"+g(Math.floor(k.GetValue()%60),2)},()=>300,a=>{const b=a._GetNode(0).GetVar();return()=>and("[color=#f8d67a]hooray! your bonus today: [/color]\n[scale=1.5]",b.GetValue())+"[/scale] coins!"},()=>"wheelcoins", ()=>"pop_out"];var module$working$266937462$c3runtime={};var module$working$266937462$__c3root__={};
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0.2 |
proxy
|
phpinfo
|
�а�тройка