/* For license information please see game.js.LEGAL.txt */ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(M){var Z=0;return function(){return Z>>0,$jscomp.propertyToPolyfillSymbol[ra]= $jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(ra):$jscomp.POLYFILL_PREFIX+fa+"$"+ra),$jscomp.defineProperty(la,$jscomp.propertyToPolyfillSymbol[ra],{configurable:!0,writable:!0,value:Z})))};$jscomp.initSymbol=function(){}; $jscomp.polyfill("Symbol",function(M){if(M)return M;var Z=function(qb,ua){this.$jscomp$symbol$id_=qb;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:ua})};Z.prototype.toString=function(){return this.$jscomp$symbol$id_};var fa="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",la=0,ra=function(qb){if(this instanceof ra)throw new TypeError("Symbol is not a constructor");return new Z(fa+(qb||"")+"_"+la++,qb)};return ra},"es6","es3"); $jscomp.polyfill("Symbol.iterator",function(M){if(M)return M;M=Symbol("Symbol.iterator");for(var Z="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),fa=0;fafa&&(fa=Math.max(fa+ra,0));faZ||1342177279>>=1)fa+=fa;return la}},"es6","es3"); $jscomp.polyfill("Array.prototype.fill",function(M){return M?M:function(Z,fa,la){var ra=this.length||0;0>fa&&(fa=Math.max(0,ra+fa));if(null==la||la>ra)la=ra;la=Number(la);0>la&&(la=Math.max(0,ra+la));for(fa=Number(fa||0);faZ?-fa:fa}},"es6","es3"); (function(){var M,Z,fa,la,ra,qb,ua,cb,Ca,Ia,Ra,zb,Vc,ef,bj,cj,Nw,Ow,Pw,Qw,Rw,Sw,Tw,Uw,Vw,Rq,Sq;function wJ(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof global)return global;throw Error("Unable to locate global object.");}function Ww(){return new Promise(function(v,x){try{var G=!0,L=self.indexedDB.open("validate-browser-context-for-indexeddb-analytics-module");L.onsuccess=function(){L.result.close();G||self.indexedDB.deleteDatabase("validate-browser-context-for-indexeddb-analytics-module"); v(!0)};L.onupgradeneeded=function(){G=!1};L.onerror=function(){var K;x((null===(K=L.error)||void 0===K?void 0:K.message)||"")}}catch(K){x(K)}})}function xJ(v,x){return v.replace(Xw,function(G,L){G=x[L];return null!=G?String(G):"<"+L+"?>"})}function Tq(v,x){if(v===x)return!0;for(var G=Object.keys(v),L=Object.keys(x),K=$jscomp.makeIterator(G),u=K.next();!u.done;u=K.next()){var P=u.value;if(!L.includes(P))return!1;u=v[P];P=x[P];if(null!==u&&"object"===typeof u&&null!==P&&"object"===typeof P){if(!Tq(u, P))return!1}else if(u!==P)return!1}v=$jscomp.makeIterator(L);for(x=v.next();!x.done;x=v.next())if(!G.includes(x.value))return!1;return!0}function yJ(v){var x=new Promise(function(G,L){var K=function(){v.removeEventListener("success",u);v.removeEventListener("error",P)},u=function(){G(Pf(v.result));K()},P=function(){L(v.error);K()};v.addEventListener("success",u);v.addEventListener("error",P)});x.then(function(G){G instanceof IDBCursor&&Uq.set(G,v)}).catch(function(){});Nm.set(x,v);return x}function zJ(v){if(!Om.has(v)){var x= new Promise(function(G,L){var K=function(){v.removeEventListener("complete",u);v.removeEventListener("error",P);v.removeEventListener("abort",P)},u=function(){G();K()},P=function(){L(v.error||new DOMException("AbortError","AbortError"));K()};v.addEventListener("complete",u);v.addEventListener("error",P);v.addEventListener("abort",P)});Om.set(v,x)}}function AJ(v){return v!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(Yw||(Yw=[IDBCursor.prototype.advance,IDBCursor.prototype.continue, IDBCursor.prototype.continuePrimaryKey])).includes(v)?function(){var x=$jscomp.getRestArguments.apply(0,arguments);v.apply(Pm(this),x);return Pf(Uq.get(this))}:function(){var x=$jscomp.getRestArguments.apply(0,arguments);return Pf(v.apply(Pm(this),x))}:function(x){var G=$jscomp.getRestArguments.apply(1,arguments);G=v.call.apply(v,[Pm(this),x].concat($jscomp.arrayFromIterable(G)));Vq.set(G,x.sort?x.sort():[x]);return Pf(G)}}function Pf(v){if(v instanceof IDBRequest)return yJ(v);if(Qm.has(v))return Qm.get(v); if("function"===typeof v)var x=AJ(v);else v instanceof IDBTransaction&&zJ(v),x=Zw(v,$w||($w=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(v,Rm):v;x!==v&&(Qm.set(v,x),Nm.set(x,v));return x}function Sm(v,x,G){G=void 0===G?{}:G;var L=G.blocked,K=G.upgrade,u=G.blocking,P=G.terminated,aa=indexedDB.open(v,x);v=Pf(aa);K&&aa.addEventListener("upgradeneeded",function(da){K(Pf(aa.result),da.oldVersion,da.newVersion,Pf(aa.transaction),da)});L&&aa.addEventListener("blocked",function(da){return L(da.oldVersion, da.newVersion,da)});v.then(function(da){P&&da.addEventListener("close",function(){return P()});u&&da.addEventListener("versionchange",function(ba){return u(ba.oldVersion,ba.newVersion,ba)})}).catch(function(){});return v}function Wq(v,x){var G=(void 0===x?{}:x).blocked;v=indexedDB.deleteDatabase(v);G&&v.addEventListener("blocked",function(L){return G(L.oldVersion,L)});return Pf(v).then(function(){})}function ax(v,x){if(v instanceof IDBDatabase&&!(x in v)&&"string"===typeof x){if(Tm.get(x))return Tm.get(x); var G=x.replace(/FromIndex$/,""),L=x!==G,K=bx.includes(G);if(G in(L?IDBIndex:IDBObjectStore).prototype&&(K||cx.includes(G)))return v=function(u){var P=$jscomp.getRestArguments.apply(1,arguments);return gb(this,null,function da(){var ba=this,wa,Ga;return $jscomp.generator.createGenerator(da,function(za){return 1==za.nextAddress?(wa=ba.transaction(u,K?"readwrite":"readonly"),Ga=wa.store,L&&(Ga=Ga.index(P.shift())),za.yield(Promise.all([Ga[G].apply(Ga,$jscomp.arrayFromIterable(P)),K&&wa.done]),2)):za.return(za.yieldResult[0])})})}, Tm.set(x,v),v}}function dx(v,x){try{v.container.addComponent(x)}catch(G){ff.debug("Component "+x.name+" failed to register with FirebaseApp "+v.name,G)}}function Jh(v){var x=v.name;if(Um.has(x))return ff.debug("There were multiple attempts to register component "+x+"."),!1;Um.set(x,v);x=$jscomp.makeIterator(Gk.values());for(var G=x.next();!G.done;G=x.next())dx(G.value,v);x=$jscomp.makeIterator(ex.values());for(G=x.next();!G.done;G=x.next())dx(G.value,v);return!0}function Xq(v,x){var G=v.container.getProvider("heartbeat").getImmediate({optional:!0}); G&&G.triggerHeartbeat();return v.container.getProvider(x)}function Yq(v,x){x=void 0===x?{}:x;"object"!==typeof x&&(x={name:x});var G=Object.assign({name:Vm,automaticDataCollectionEnabled:!1},x);x=G.name;if("string"!==typeof x||!x)throw Qf.create("bad-app-name",{appName:String(x)});v||(v=Zq());if(!v)throw Qf.create("no-options");var L=Gk.get(x);if(L){if(Tq(v,L.options)&&Tq(G,L.config))return L;throw Qf.create("duplicate-app",{appName:x});}L=new dj(x);for(var K=$jscomp.makeIterator(Um.values()),u=K.next();!u.done;u= K.next())L.addComponent(u.value);v=new Wm(v,G,L);Gk.set(x,v);return v}function BJ(v){v=void 0===v?Vm:v;var x=Gk.get(v);if(!x&&v===Vm&&Zq())return Yq();if(!x)throw Qf.create("no-app",{appName:v});return x}function Dg(v,x,G){var L,K=null!==(L=fx[v])&&void 0!==L?L:v;G&&(K+="-"+G);v=K.match(/\s|\//);G=x.match(/\s|\//);v||G?(L=['Unable to register library "'+K+'" with version "'+x+'":'],v&&L.push('library name "'+K+'" contains illegal characters (whitespace or "/")'),v&&G&&L.push("and"),G&&L.push('version name "'+ x+'" contains illegal characters (whitespace or "/")'),ff.warn(L.join(" "))):Jh(new be(K+"-version",function(){return{library:K,version:x}},"VERSION"))}function gx(){Xm||(Xm=Sm(hx,ix,{upgrade:function(v,x){switch(x){case 0:try{v.createObjectStore(ej)}catch(G){console.warn(G)}}}}).catch(function(v){throw Qf.create("idb-open",{originalErrorMessage:v.message});}));return Xm}function CJ(v){return gb(this,null,function G(){var L,K,u,P,aa;return $jscomp.generator.createGenerator(G,function(da){switch(da.nextAddress){case 1:return da.setCatchFinallyBlocks(2), da.yield(gx(),4);case 4:return L=da.yieldResult,K=L.transaction(ej),da.yield(K.objectStore(ej).get(v.name+"!"+v.options.appId),5);case 5:return u=da.yieldResult,da.yield(K.done,6);case 6:return da.return(u);case 2:P=da.enterCatchBlock(),P instanceof Hk?ff.warn(P.message):(aa=Qf.create("idb-get",{originalErrorMessage:null===P||void 0===P?void 0:P.message}),ff.warn(aa.message)),da.jumpToEnd()}})})}function jx(v,x){return gb(this,null,function L(){var K,u,P,aa,da;return $jscomp.generator.createGenerator(L, function(ba){switch(ba.nextAddress){case 1:return ba.setCatchFinallyBlocks(2),ba.yield(gx(),4);case 4:return K=ba.yieldResult,u=K.transaction(ej,"readwrite"),P=u.objectStore(ej),ba.yield(P.put(x,v.name+"!"+v.options.appId),5);case 5:return ba.yield(u.done,6);case 6:ba.leaveTryBlock(0);break;case 2:aa=ba.enterCatchBlock(),aa instanceof Hk?ff.warn(aa.message):(da=Qf.create("idb-set",{originalErrorMessage:null===aa||void 0===aa?void 0:aa.message}),ff.warn(da.message)),ba.jumpToEnd()}})})}function DJ(v, x){x=void 0===x?kx:x;var G=[],L=v.slice();v=$jscomp.makeIterator(v);for(var K=v.next(),u={};!K.done;u={singleDateHeartbeat:void 0},K=v.next()){u.singleDateHeartbeat=K.value;if(K=G.find(function(P){return function(aa){return aa.agent===P.singleDateHeartbeat.agent}}(u))){if(K.dates.push(u.singleDateHeartbeat.date),lx(G)>x){K.dates.pop();break}}else if(G.push({agent:u.singleDateHeartbeat.agent,dates:[u.singleDateHeartbeat.date]}),lx(G)>x){G.pop();break}L=L.slice(1)}return{heartbeatsToSend:G,unsentEntries:L}} function lx(v){return $q(JSON.stringify({version:2,heartbeats:v})).length}function EJ(v){Jh(new be("platform-logger",function(x){return new ar(x)},"PRIVATE"));Jh(new be("heartbeat",function(x){return new Ym(x)},"PRIVATE"));Dg(Zm,br,v);Dg(Zm,br,"esm2017");Dg("fire-js","")}function mx(v){return v instanceof Hk&&v.code.includes("request-failed")}function nx(v){return ox+"/projects/"+v.projectId+"/installations"}function px(v){return{token:v.token,requestStatus:2,expiresIn:Number(v.expiresIn.replace("s", "000")),creationTime:Date.now()}}function qx(v,x){return gb(this,null,function L(){var K,u;return $jscomp.generator.createGenerator(L,function(P){if(1==P.nextAddress)return P.yield(x.json(),2);K=P.yieldResult;u=K.error;return P.return(Eg.create("request-failed",{requestName:v,serverCode:u.code,serverMessage:u.message,serverStatus:u.status}))})})}function rx(v){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":v.apiKey})}function FJ(v,x){x=x.refreshToken; v=rx(v);v.append("Authorization",cr+" "+x);return v}function sx(v){return gb(this,null,function G(){var L;return $jscomp.generator.createGenerator(G,function(K){if(1==K.nextAddress)return K.yield(v(),2);L=K.yieldResult;return 500<=L.status&&600>L.status?K.return(v()):K.return(L)})})}function GJ(v,x){return gb(this,arguments,function u(L,K){var P,aa,da,ba,wa,Ga,za,pc,zd,Kb,ub,Qb,h,k;return $jscomp.generator.createGenerator(u,function(m){switch(m.nextAddress){case 1:P=L;aa=P.appConfig;da=P.heartbeatServiceProvider; ba=K;wa=ba.fid;Ga=nx(aa);za=rx(aa);pc=da.getImmediate({optional:!0});if(!pc){m.jumpTo(2);break}return m.yield(pc.getHeartbeatsHeader(),3);case 3:(zd=m.yieldResult)&&za.append("x-firebase-client",zd);case 2:return Kb={fid:wa,authVersion:cr,appId:aa.appId,sdkVersion:dr},ub={method:"POST",headers:za,body:JSON.stringify(Kb)},m.yield(sx(function(){return fetch(Ga,ub)}),4);case 4:return Qb=m.yieldResult,Qb.ok?m.yield(Qb.json(),8):m.yield(qx("Create Installation",Qb),7);case 7:throw m.yieldResult;case 8:return h= m.yieldResult,k={fid:h.fid||wa,registrationStatus:2,refreshToken:h.refreshToken,authToken:px(h.authToken)},m.return(k)}})})}function tx(v){return new Promise(function(x){setTimeout(x,v)})}function Ik(v){return v.appName+"!"+v.appId}function er(v,x){if(v=fr.get(v)){v=$jscomp.makeIterator(v);for(var G=v.next();!G.done;G=v.next())G=G.value,G(x)}}function ux(v,x){var G=HJ();G&&G.postMessage({key:v,fid:x});0===fr.size&&Fg&&(Fg.close(),Fg=null)}function HJ(){!Fg&&"BroadcastChannel"in self&&(Fg=new BroadcastChannel("[Firebase] FID Change"), Fg.onmessage=function(v){er(v.data.key,v.data.fid)});return Fg}function gr(){$m||($m=Sm(vx,wx,{upgrade:function(v,x){switch(x){case 0:v.createObjectStore(Gg)}}}));return $m}function an(v,x){return gb(this,null,function L(){var K,u,P,aa,da;return $jscomp.generator.createGenerator(L,function(ba){switch(ba.nextAddress){case 1:return K=Ik(v),ba.yield(gr(),2);case 2:return u=ba.yieldResult,P=u.transaction(Gg,"readwrite"),aa=P.objectStore(Gg),ba.yield(aa.get(K),3);case 3:return da=ba.yieldResult,ba.yield(aa.put(x, K),4);case 4:return ba.yield(P.done,5);case 5:if(!da||da.fid!==x.fid){var wa=x.fid,Ga=Ik(v);er(Ga,wa);ux(Ga,wa)}return ba.return(x)}})})}function xx(v){return gb(this,null,function G(){var L,K,u;return $jscomp.generator.createGenerator(G,function(P){return 1==P.nextAddress?(L=Ik(v),P.yield(gr(),2)):3!=P.nextAddress?(K=P.yieldResult,u=K.transaction(Gg,"readwrite"),P.yield(u.objectStore(Gg).delete(L),3)):P.yield(u.done,0)})})}function bn(v,x){return gb(this,null,function L(){var K,u,P,aa,da,ba;return $jscomp.generator.createGenerator(L, function(wa){switch(wa.nextAddress){case 1:return K=Ik(v),wa.yield(gr(),2);case 2:return u=wa.yieldResult,P=u.transaction(Gg,"readwrite"),aa=P.objectStore(Gg),wa.yield(aa.get(K),3);case 3:return da=wa.yieldResult,ba=x(da),void 0===ba?wa.yield(aa.delete(K),5):wa.yield(aa.put(ba,K),5);case 5:return wa.yield(P.done,8);case 8:if(ba&&(!da||da.fid!==ba.fid)){var Ga=ba.fid,za=Ik(v);er(za,Ga);ux(za,Ga)}return wa.return(ba)}})})}function hr(v){return gb(this,null,function G(){var L,K;return $jscomp.generator.createGenerator(G, function(u){switch(u.nextAddress){case 1:return u.yield(bn(v.appConfig,function(P){if(!P){try{var aa=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(aa);aa[0]=112+aa[0]%16;var da=btoa(String.fromCharCode.apply(String,$jscomp.arrayFromIterable(aa))).replace(/\+/g,"-").replace(/\//g,"_").substr(0,22);var ba=yx.test(da)?da:cn}catch(wa){ba=cn}P={fid:ba,registrationStatus:0}}ba=zx(P);0===ba.registrationStatus?navigator.onLine?(ba={fid:ba.fid,registrationStatus:1,registrationTime:Date.now()}, aa=IJ(v,ba),ba={installationEntry:ba,registrationPromise:aa}):(aa=Promise.reject(Eg.create("app-offline")),ba={installationEntry:ba,registrationPromise:aa}):ba=1===ba.registrationStatus?{installationEntry:ba,registrationPromise:JJ(v)}:{installationEntry:ba};L=ba.registrationPromise;return ba.installationEntry}),2);case 2:K=u.yieldResult;if(K.fid!==cn){u.jumpTo(3);break}return u.yield(L,4);case 4:return u.return({installationEntry:u.yieldResult});case 3:return u.return({installationEntry:K,registrationPromise:L})}})})} function IJ(v,x){return gb(this,null,function L(){var K,u;return $jscomp.generator.createGenerator(L,function(P){switch(P.nextAddress){case 1:return P.setCatchFinallyBlocks(2),P.yield(GJ(v,x),4);case 4:return K=P.yieldResult,P.return(an(v.appConfig,K));case 2:return u=P.enterCatchBlock(),mx(u)&&409===u.customData.serverCode?P.yield(xx(v.appConfig),6):P.yield(an(v.appConfig,{fid:x.fid,registrationStatus:0}),6);case 6:throw u;}})})}function JJ(v){return gb(this,null,function G(){var L,K,u,P;return $jscomp.generator.createGenerator(G, function(aa){switch(aa.nextAddress){case 1:return aa.yield(Ax(v.appConfig),2);case 2:L=aa.yieldResult;case 3:if(1!==L.registrationStatus){if(0!==L.registrationStatus){aa.jumpTo(8);break}return aa.yield(hr(v),9)}return aa.yield(tx(100),6);case 6:return aa.yield(Ax(v.appConfig),7);case 7:L=aa.yieldResult;aa.jumpTo(3);break;case 9:return K=aa.yieldResult,u=K.installationEntry,(P=K.registrationPromise)?aa.return(P):aa.return(u);case 8:return aa.return(L)}})})}function Ax(v){return bn(v,function(x){if(!x)throw Eg.create("installation-not-found"); return zx(x)})}function zx(v){return 1===v.registrationStatus&&v.registrationTime+irGa||!wa.objectStoreNames.contains(lr))return t.return();Qb=pc.objectStore(lr);return t.yield(Qb.index("fcmSenderId").get(v), 2)}if(3!=t.nextAddress)return h=t.yieldResult,t.yield(Qb.clear(),3);if(!h)return t.return();if(2===Ga){k=h;if(!k.auth||!k.p256dh||!k.endpoint)return t.return();aa={token:k.fcmToken,createTime:null!==(ub=k.createTime)&&void 0!==ub?ub:Date.now(),subscriptionOptions:{auth:k.auth,p256dh:k.p256dh,endpoint:k.endpoint,swScope:k.swScope,vapidKey:"string"===typeof k.vapidKey?k.vapidKey:Rf(k.vapidKey)}}}else 3===Ga?(m=h,aa={token:m.fcmToken,createTime:m.createTime,subscriptionOptions:{auth:Rf(m.auth),p256dh:Rf(m.p256dh), endpoint:m.endpoint,swScope:m.swScope,vapidKey:Rf(m.vapidKey)}}):4===Ga&&(q=h,aa={token:q.fcmToken,createTime:q.createTime,subscriptionOptions:{auth:Rf(q.auth),p256dh:Rf(q.p256dh),endpoint:q.endpoint,swScope:q.swScope,vapidKey:Rf(q.vapidKey)}});t.jumpToEnd()})})}}),4);case 4:return da=ba.yieldResult,da.close(),ba.yield(Wq(dn),5);case 5:return ba.yield(Wq("fcm_vapid_details_db"),6);case 6:return ba.yield(Wq("undefined"),7);case 7:return ba.return(TJ(aa)?aa:null)}})})}function TJ(v){if(!v||!v.subscriptionOptions)return!1; var x=v.subscriptionOptions;return"number"===typeof v.createTime&&0=u.createTime+Lx?aa.return(ZJ(v,{token:u.token,createTime:Date.now(),subscriptionOptions:K})):aa.return(u.token);aa.setCatchFinallyBlocks(6);return aa.yield(Ix(v.firebaseDependencies, u.token),8);case 8:aa.leaveTryBlock(7);break;case 6:P=aa.enterCatchBlock(),console.warn(P);case 7:return aa.return(Kx(v.firebaseDependencies,K))}})})}function $J(v){return gb(this,null,function G(){var L,K;return $jscomp.generator.createGenerator(G,function(u){switch(u.nextAddress){case 1:return u.yield(Gx(v.firebaseDependencies),2);case 2:L=u.yieldResult;if(!L){u.jumpTo(3);break}return u.yield(Ix(v.firebaseDependencies,L.token),4);case 4:return u.yield(UJ(v.firebaseDependencies),3);case 3:return u.yield(v.swRegistration.pushManager.getSubscription(), 6);case 6:return(K=u.yieldResult)?u.return(K.unsubscribe()):u.return(!0)}})})}function ZJ(v,x){return gb(this,null,function L(){var K,u,P;return $jscomp.generator.createGenerator(L,function(aa){switch(aa.nextAddress){case 1:return aa.setCatchFinallyBlocks(2),aa.yield(WJ(v.firebaseDependencies,x),4);case 4:return K=aa.yieldResult,u=Object.assign(Object.assign({},x),{token:K,createTime:Date.now()}),aa.yield(nr(v.firebaseDependencies,u),5);case 5:return aa.return(K);case 2:throw P=aa.enterCatchBlock(), P;}})})}function Kx(v,x){return gb(this,null,function L(){var K,u;return $jscomp.generator.createGenerator(L,function(P){return 1==P.nextAddress?P.yield(VJ(v,x),2):3!=P.nextAddress?(K=P.yieldResult,u={token:K,createTime:Date.now(),subscriptionOptions:x},P.yield(nr(v,u),3)):P.return(u.token)})})}function YJ(v,x){return gb(this,null,function L(){var K;return $jscomp.generator.createGenerator(L,function(u){if(1==u.nextAddress)return u.yield(v.pushManager.getSubscription(),2);if(K=u.yieldResult)return u.return(K); var P=u.return,aa=v.pushManager,da=aa.subscribe,ba="=".repeat((4-x.length%4)%4);ba=(x+ba).replace(/\-/g,"+").replace(/_/g,"/");ba=atob(ba);for(var wa=new Uint8Array(ba.length),Ga=0;GaC[0]&&Y[1]N.indexOf(W)&&(T[W]=J[W]);if(null!=J&&"function"==typeof Object.getOwnPropertySymbols){var Y=0;for(W=Object.getOwnPropertySymbols(J);YN.indexOf(W[Y])&& Object.prototype.propertyIsEnumerable.call(J,W[Y])&&(T[W[Y]]=J[W[Y]])}return T}(C,["request_id"]);D&&z.resolve(D,C,function(J){return!("error_type"in J)})}}),function(D,C){return void 0===C&&(C={}),new Promise(function(J,N){J=z.add({resolve:J,reject:N},C.request_id);m(D,aa(aa({},C),{request_id:J}))})}}var aa=function(){return aa=Object.assign||function(m){for(var q,t=1,z=arguments.length;tu?G[L++]=u:(2048>u?G[L++]=u>>6|192:(55296===(u&64512)&&K+1>18|240,G[L++]=u>>12&63| 128):G[L++]=u>>12|224,G[L++]=u>>6&63|128),G[L++]=u&63|128)}return G};$x=function(x){for(var G=[],L=0,K=0;Lu)G[K++]=String.fromCharCode(u);else if(191u){var P=x[L++];G[K++]=String.fromCharCode((u&31)<<6|P&63)}else if(239u){P=x[L++];var aa=x[L++],da=x[L++];u=((u&7)<<18|(P&63)<<12|(aa&63)<<6|da&63)-65536;G[K++]=String.fromCharCode(55296+(u>>10));G[K++]=String.fromCharCode(56320+(u&1023))}else P=x[L++],aa=x[L++],G[K++]=String.fromCharCode((u&15)<<12|(P& 63)<<6|aa&63)}return G.join("")};yr={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray:function(x,G){if(!Array.isArray(x))throw Error("encodeByteArray takes an array as a parameter");this.init_(); G=G?this.byteToCharMapWebSafe_:this.byteToCharMap_;for(var L=[],K=0;K>2;u=(u&3)<<4|aa>>4;aa=(aa&15)<<2|ba>>6;ba&=63;da||(ba=64,P||(aa=64));L.push(G[wa],G[u],G[aa],G[ba])}return L.join("")},encodeString:function(x,G){return this.HAS_NATIVE_SUPPORT&&!G?btoa(x):this.encodeByteArray(xr(x),G)},decodeString:function(x,G){return this.HAS_NATIVE_SUPPORT&&!G?atob(x):$x(this.decodeStringToByteArray(x,G))},decodeStringToByteArray:function(x, G){this.init_();G=G?this.charToByteMapWebSafe_:this.charToByteMap_;for(var L=[],K=0;K>4);64!==aa&&(L.push(P<<4&240|aa>>2),64!==da&&L.push(aa<<6&192|da))}return L},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={};this.charToByteMap_={};this.byteToCharMapWebSafe_={};this.charToByteMapWebSafe_= {};for(var x=0;x=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(x)]=x,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(x)]=x)}}};zr=function(){var x=Error.apply(this,arguments);this.message=x.message;"stack"in x&&(this.stack=x.stack);this.name="DecodeBase64StringError"};$jscomp.inherits(zr,Error);ay=function(x){x=xr(x);return yr.encodeByteArray(x,!0)};$q=function(x){return ay(x).replace(/\./g,"")};by=function(x){try{return yr.decodeString(x,!0)}catch(G){console.error("base64Decode failed: ",G)}return null};cy=function(){return wJ().__FIREBASE_DEFAULTS__};dy=function(){if("undefined"!==typeof process&&"undefined"!==typeof process.env){var x=process.env.__FIREBASE_DEFAULTS__;if(x)return JSON.parse(x)}};ey= function(){if("undefined"!==typeof document){try{var x=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(G){return}return(x=x&&by(x[1]))&&JSON.parse(x)}};fy=function(){try{return cy()||dy()||ey()}catch(x){console.info("Unable to get __FIREBASE_DEFAULTS__ due to: "+x)}};Zq=function(){var x;return null===(x=fy())||void 0===x?void 0:x.config};Ar=function(){var x=this;this.reject=function(){};this.resolve=function(){};this.promise=new Promise(function(G,L){x.resolve=G;x.reject=L})};Ar.prototype.wrapCallback= function(x){var G=this;return function(L,K){L?G.reject(L):G.resolve(K);"function"===typeof x&&(G.promise.catch(function(){}),1===x.length?x(L):x(L,K))}};var v=function(x,G,L){G=Error.call(this,G);this.message=G.message;"stack"in G&&(this.stack=G.stack);this.code=x;this.customData=L;this.name="FirebaseError";Object.setPrototypeOf(this,v.prototype);Error.captureStackTrace&&Error.captureStackTrace(this,fj.prototype.create)};$jscomp.inherits(v,Error);Hk=v;fj=function(x,G,L){this.service=x;this.serviceName= G;this.errors=L};fj.prototype.create=function(x){var G=$jscomp.getRestArguments.apply(1,arguments)[0]||{},L=this.service+"/"+x,K=this.errors[x];K=K?xJ(K,G):"Error";return new Hk(L,this.serviceName+": "+K+" ("+L+").",G)};Xw=/\{\$([^}]+)}/g},gy)),be,jd,dj,hy={},Br=Je((hy["node_modules/@firebase/component/dist/esm/index.esm2017.js"]=function(){Kk();be=function(v,x,G){this.name=v;this.instanceFactory=x;this.type=G;this.multipleInstances=!1;this.serviceProps={};this.instantiationMode="LAZY";this.onInstanceCreated= null};be.prototype.setInstantiationMode=function(v){this.instantiationMode=v;return this};be.prototype.setMultipleInstances=function(v){this.multipleInstances=v;return this};be.prototype.setServiceProps=function(v){this.serviceProps=v;return this};be.prototype.setInstanceCreatedCallback=function(v){this.onInstanceCreated=v;return this};jd=function(v,x){this.name=v;this.container=x;this.component=null;this.instances=new Map;this.instancesDeferred=new Map;this.instancesOptions=new Map;this.onInitCallbacks= new Map};jd.prototype.get=function(v){v=this.normalizeInstanceIdentifier(v);if(!this.instancesDeferred.has(v)){var x=new Ar;this.instancesDeferred.set(v,x);if(this.isInitialized(v)||this.shouldAutoInitialize())try{var G=this.getOrInitializeService({instanceIdentifier:v});G&&x.resolve(G)}catch(L){}}return this.instancesDeferred.get(v).promise};jd.prototype.getImmediate=function(v){var x,G=this.normalizeInstanceIdentifier(null===v||void 0===v?void 0:v.identifier);v=null!==(x=null===v||void 0===v?void 0: v.optional)&&void 0!==x?x:!1;if(this.isInitialized(G)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:G})}catch(L){if(v)return null;throw L;}else{if(v)return null;throw Error("Service "+this.name+" is not available");}};jd.prototype.getComponent=function(){return this.component};jd.prototype.setComponent=function(v){if(v.name!==this.name)throw Error("Mismatching Component "+v.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+ this.name+" has already been provided");this.component=v;if(this.shouldAutoInitialize()){if("EAGER"===v.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:"[DEFAULT]"})}catch(K){}v=$jscomp.makeIterator(this.instancesDeferred.entries());for(var x=v.next();!x.done;x=v.next()){var G=$jscomp.makeIterator(x.value);x=G.next().value;G=G.next().value;x=this.normalizeInstanceIdentifier(x);try{var L=this.getOrInitializeService({instanceIdentifier:x});G.resolve(L)}catch(K){}}}};jd.prototype.clearInstance= function(v){v=void 0===v?"[DEFAULT]":v;this.instancesDeferred.delete(v);this.instancesOptions.delete(v);this.instances.delete(v)};jd.prototype.delete=function(){return gb(this,null,function x(){var G=this,L;return $jscomp.generator.createGenerator(x,function(K){L=Array.from(G.instances.values());return K.yield(Promise.all([].concat($jscomp.arrayFromIterable(L.filter(function(u){return"INTERNAL"in u}).map(function(u){return u.INTERNAL.delete()})),$jscomp.arrayFromIterable(L.filter(function(u){return"_delete"in u}).map(function(u){return u._delete()})))),0)})})};jd.prototype.isComponentSet=function(){return null!=this.component};jd.prototype.isInitialized=function(v){return this.instances.has(void 0===v?"[DEFAULT]":v)};jd.prototype.getOptions=function(v){return this.instancesOptions.get(void 0===v?"[DEFAULT]":v)||{}};jd.prototype.initialize=function(v){var x=v=void 0===v?{}:v;x=void 0===x.options?{}:x.options;v=this.normalizeInstanceIdentifier(v.instanceIdentifier);if(this.isInitialized(v))throw Error(this.name+ "("+v+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");x=this.getOrInitializeService({instanceIdentifier:v,options:x});for(var G=$jscomp.makeIterator(this.instancesDeferred.entries()),L=G.next();!L.done;L=G.next()){var K=$jscomp.makeIterator(L.value);L=K.next().value;K=K.next().value;L=this.normalizeInstanceIdentifier(L);v===L&&K.resolve(x)}return x};jd.prototype.onInit=function(v,x){var G;x=this.normalizeInstanceIdentifier(x); var L=null!==(G=this.onInitCallbacks.get(x))&&void 0!==G?G:new Set;L.add(v);this.onInitCallbacks.set(x,L);(G=this.instances.get(x))&&v(G,x);return function(){L.delete(v)}};jd.prototype.invokeOnInitCallbacks=function(v,x){var G=this.onInitCallbacks.get(x);if(G){G=$jscomp.makeIterator(G);for(var L=G.next();!L.done;L=G.next()){L=L.value;try{L(v,x)}catch(K){}}}};jd.prototype.getOrInitializeService=function(v){var x=v.instanceIdentifier;v=void 0===v.options?{}:v.options;var G=this.instances.get(x);if(!G&& this.component&&(G=this.component.instanceFactory(this.container,{instanceIdentifier:"[DEFAULT]"===x?void 0:x,options:v}),this.instances.set(x,G),this.instancesOptions.set(x,v),this.invokeOnInitCallbacks(G,x),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,x,G)}catch(L){}return G||null};jd.prototype.normalizeInstanceIdentifier=function(v){v=void 0===v?"[DEFAULT]":v;return this.component?this.component.multipleInstances?v:"[DEFAULT]":v};jd.prototype.shouldAutoInitialize= function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode};dj=function(v){this.name=v;this.providers=new Map};dj.prototype.addComponent=function(v){var x=this.getProvider(v.name);if(x.isComponentSet())throw Error("Component "+v.name+" has already been registered with "+this.name);x.setComponent(v)};dj.prototype.addOrOverwriteComponent=function(v){this.getProvider(v.name).isComponentSet()&&this.providers.delete(v.name);this.addComponent(v)};dj.prototype.getProvider=function(v){if(this.providers.has(v))return this.providers.get(v); var x=new jd(v,this);this.providers.set(v,x);return x};dj.prototype.getProviders=function(){return Array.from(this.providers.values())}},hy)),iy,cc,jy,ky,ly,my,Sf,ny={},sK=Je((ny["node_modules/@firebase/logger/dist/esm/index.esm2017.js"]=function(){iy=[];(function(x){x[x.DEBUG=0]="DEBUG";x[x.VERBOSE=1]="VERBOSE";x[x.INFO=2]="INFO";x[x.WARN=3]="WARN";x[x.ERROR=4]="ERROR";x[x.SILENT=5]="SILENT"})(cc||(cc={}));jy={debug:cc.DEBUG,verbose:cc.VERBOSE,info:cc.INFO,warn:cc.WARN,error:cc.ERROR,silent:cc.SILENT}; ky=cc.INFO;var v={};ly=(v[cc.DEBUG]="log",v[cc.VERBOSE]="log",v[cc.INFO]="info",v[cc.WARN]="warn",v[cc.ERROR]="error",v);my=function(x,G){var L=$jscomp.getRestArguments.apply(2,arguments);if(!(G=Date.now()-Ga});return wa.return(u._storage.overwrite(u._heartbeatsCache));case 2:ba=wa.enterCatchBlock(),ff.warn(ba),wa.jumpToEnd()}})})}; Ym.prototype.getHeartbeatsHeader=function(){return gb(this,null,function G(){var L,K=this,u,P,aa,da,ba,wa;return $jscomp.generator.createGenerator(G,function(Ga){switch(Ga.nextAddress){case 1:Ga.setCatchFinallyBlocks(2);if(null!==K._heartbeatsCache){Ga.jumpTo(4);break}return Ga.yield(K._heartbeatsCachePromise,4);case 4:if(null==(null===(L=K._heartbeatsCache)||void 0===L?void 0:L.heartbeats)||0===K._heartbeatsCache.heartbeats.length)return Ga.return("");u=(new Date).toISOString().substring(0,10);P= DJ(K._heartbeatsCache.heartbeats);aa=P.heartbeatsToSend;da=P.unsentEntries;ba=$q(JSON.stringify({version:2,heartbeats:aa}));K._heartbeatsCache.lastSentHeartbeatDate=u;if(!(0q;q++)m.push(0);for(q=0;3>q;q++)for(t=0;3>t;t++)m[q+4*t]=this.elements[q+3*t];m[3]=h.x;m[7]=h.y;m[11]=h.z;var z=3,D=z;do{q=D-z;if(0===m[q+4*q])for(t= q+1;tk;k++)h+=this.elements[k]+",";return h};v.prototype.reverse=function(h){void 0===h&&(h=new v);var k=Ey,m,q;for(m=0;3>m;m++)for(q=0;3>q;q++)k[m+6*q]=this.elements[m+3*q];k[3]=1;k[9]=0;k[15]=0;k[4]=0;k[10]=1;k[16]=0;k[5]=0;k[11]=0;k[17]=1;var t=3,z=t;do{m=z-t;if(0=== k[m+6*m])for(q=m+1;qMath.abs(q.x)?m.set(1,0,0):m.set(0,1,0);q.cross(m,h);q.cross(h,k)}else h.set(1,0,0),k.set(0,1,0)};x.prototype.toString=function(){return this.x+","+this.y+","+this.z};x.prototype.toArray=function(){return[this.x,this.y,this.z]};x.prototype.copy=function(h){this.x= h.x;this.y=h.y;this.z=h.z;return this};x.prototype.lerp=function(h,k,m){var q=this.x,t=this.y,z=this.z;m.x=q+(h.x-q)*k;m.y=t+(h.y-t)*k;m.z=z+(h.z-z)*k};x.prototype.almostEquals=function(h,k){void 0===k&&(k=1E-6);return Math.abs(this.x-h.x)>k||Math.abs(this.y-h.y)>k||Math.abs(this.z-h.z)>k?!1:!0};x.prototype.almostZero=function(h){void 0===h&&(h=1E-6);return Math.abs(this.x)>h||Math.abs(this.y)>h||Math.abs(this.z)>h?!1:!0};x.prototype.isAntiparallelTo=function(h,k){this.negate(Er);return Er.almostEquals(h, k)};x.prototype.clone=function(){return new x(this.x,this.y,this.z)};F=x;F.ZERO=new F(0,0,0);F.UNIT_X=new F(1,0,0);F.UNIT_Y=new F(0,1,0);F.UNIT_Z=new F(0,0,1);Fy=new F;Gy=new F;Er=new F;var G=function(h){void 0===h&&(h={});this.lowerBound=new F;this.upperBound=new F;h.lowerBound&&this.lowerBound.copy(h.lowerBound);h.upperBound&&this.upperBound.copy(h.upperBound)};G.prototype.setFromPoints=function(h,k,m,q){var t=this.lowerBound,z=this.upperBound;t.copy(h[0]);m&&m.vmult(t,t);z.copy(t);for(var D=1;D< h.length;D++){var C=h[D];m&&(m.vmult(C,Fr),C=Fr);C.x>z.x&&(z.x=C.x);C.xz.y&&(z.y=C.y);C.yz.z&&(z.z=C.z);C.z=h.x&&k.y<=q.y&&m.y>=h.y&&k.z<=q.z&&m.z>=h.z};G.prototype.getCorners=function(h,k,m,q,t,z,D,C){var J=this.lowerBound,N=this.upperBound;h.copy(J);k.set(N.x,J.y,J.z);m.set(N.x,N.y,J.z);q.set(J.x,N.y,N.z);t.set(N.x,J.y,N.z);z.set(J.x, N.y,J.z);D.set(J.x,J.y,N.z);C.copy(N)};G.prototype.toLocalFrame=function(h,k){var m=Gr;this.getCorners(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7]);for(var q=0;8!==q;q++){var t=m[q];h.pointToLocal(t,t)}return k.setFromPoints(m)};G.prototype.toWorldFrame=function(h,k){var m=Gr;this.getCorners(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7]);for(var q=0;8!==q;q++){var t=m[q];h.pointToWorld(t,t)}return k.setFromPoints(m)};G.prototype.overlapsRay=function(h){var k=h.direction;h=h.from;var m=1/k.x,q=1/k.y,t=1/k.z; k=(this.lowerBound.x-h.x)*m;m*=this.upperBound.x-h.x;var z=(this.lowerBound.y-h.y)*q;q*=this.upperBound.y-h.y;var D=(this.lowerBound.z-h.z)*t;h=(this.upperBound.z-h.z)*t;t=Math.min(Math.min(Math.max(k,m),Math.max(z,q)),Math.max(D,h));return 0>t||Math.max(Math.max(Math.min(k,m),Math.min(z,q)),Math.min(D,h))>t?!1:!0};jc=G;Fr=new F;Gr=[new F,new F,new F,new F,new F,new F,new F,new F];Lh=function(){this.matrix=[]};Lh.prototype.get=function(h,k){h=h.index;k=k.index;if(k>h){var m=k;k=h;h=m}return this.matrix[(h* (h+1)>>1)+k-1]};Lh.prototype.set=function(h,k,m){h=h.index;k=k.index;if(k>h){var q=k;k=h;h=q}this.matrix[(h*(h+1)>>1)+k-1]=m?1:0};Lh.prototype.reset=function(){var h=this.matrix;if(h.fill)h.fill(0);else for(var k=0,m=h.length;k!==m;k++)h[k]=0};Lh.prototype.setNumObjects=function(h){this.matrix.length=h*(h-1)>>1};gf=function(){};gf.prototype.addEventListener=function(h,k){void 0===this._listeners&&(this._listeners={});var m=this._listeners;void 0===m[h]&&(m[h]=[]);m[h].includes(k)||m[h].push(k);return this}; gf.prototype.hasEventListener=function(h,k){if(void 0===this._listeners)return!1;var m=this._listeners;return void 0!==m[h]&&m[h].includes(k)?!0:!1};gf.prototype.hasAnyEventListener=function(h){return void 0===this._listeners?!1:void 0!==this._listeners[h]};gf.prototype.removeEventListener=function(h,k){if(void 0===this._listeners)return this;var m=this._listeners;if(void 0===m[h])return this;k=m[h].indexOf(k);-1!==k&&m[h].splice(k,1);return this};gf.prototype.dispatchEvent=function(h){if(void 0=== this._listeners)return this;var k=this._listeners[h.type];if(void 0!==k){h.target=this;for(var m=0,q=k.length;mm?(h.x=this.x,h.y=this.y,h.z=this.z):(h.x=this.x/m,h.y=this.y/m,h.z=this.z/m);return[h,k]};L.prototype.setFromVectors=function(h,k){if(h.isAntiparallelTo(k))k=Hy,h.tangents(k,Iy),this.setFromAxisAngle(k,Math.PI);else{var m= h.cross(k);this.x=m.x;this.y=m.y;this.z=m.z;this.w=Math.sqrt(Ad(h.length(),2)*Ad(k.length(),2))+h.dot(k);this.normalize()}return this};L.prototype.mult=function(h,k){void 0===k&&(k=new L);var m=this.x,q=this.y,t=this.z,z=this.w,D=h.x,C=h.y,J=h.z;h=h.w;k.x=m*h+z*D+q*J-t*C;k.y=q*h+z*C+t*D-m*J;k.z=t*h+z*J+m*C-q*D;k.w=z*h-m*D-q*C-t*J;return k};L.prototype.inverse=function(h){void 0===h&&(h=new L);var k=this.x,m=this.y,q=this.z,t=this.w;this.conjugate(h);k=1/(k*k+m*m+q*q+t*t);h.x*=k;h.y*=k;h.z*=k;h.w*= k;return h};L.prototype.conjugate=function(h){void 0===h&&(h=new L);h.x=-this.x;h.y=-this.y;h.z=-this.z;h.w=this.w;return h};L.prototype.normalize=function(){var h=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===h?this.w=this.z=this.y=this.x=0:(h=1/h,this.x*=h,this.y*=h,this.z*=h,this.w*=h);return this};L.prototype.normalizeFast=function(){var h=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;0===h?this.w=this.z=this.y=this.x=0:(this.x*=h,this.y*=h,this.z*=h, this.w*=h);return this};L.prototype.vmult=function(h,k){void 0===k&&(k=new F);var m=h.x,q=h.y,t=h.z;h=this.x;var z=this.y,D=this.z,C=this.w,J=C*m+z*t-D*q,N=C*q+D*m-h*t,T=C*t+h*q-z*m;m=-h*m-z*q-D*t;k.x=J*C+m*-h+N*-D-T*-z;k.y=N*C+m*-z+T*-h-J*-D;k.z=T*C+m*-D+J*-z-N*-h;return k};L.prototype.copy=function(h){this.x=h.x;this.y=h.y;this.z=h.z;this.w=h.w;return this};L.prototype.toEuler=function(h,k){void 0===k&&(k="YZX");var m=this.x,q=this.y,t=this.z,z=this.w;switch(k){case "YZX":k=m*q+t*z;if(.499k&&(D=-2*Math.atan2(m,z),C=-Math.PI/2,J=0);void 0===D&&(J=t*t,D=Math.atan2(2*q*z-2*m*t,1-2*q*q-2*J),C=Math.asin(2*k),J=Math.atan2(2*m*z-2*q*t,1-2*m*m-2*J));break;default:throw Error("Euler order "+k+" not supported yet.");}h.y=D;h.z=C;h.x=J};L.prototype.setFromEuler=function(h,k,m,q){void 0===q&&(q="XYZ");var t=Math.cos(h/2),z=Math.cos(k/2),D=Math.cos(m/2);h=Math.sin(h/2);k=Math.sin(k/2);m=Math.sin(m/2);"XYZ"===q?(this.x=h*z*D+t*k*m,this.y=t*k*D-h*z* m,this.z=t*z*m+h*k*D,this.w=t*z*D-h*k*m):"YXZ"===q?(this.x=h*z*D+t*k*m,this.y=t*k*D-h*z*m,this.z=t*z*m-h*k*D,this.w=t*z*D+h*k*m):"ZXY"===q?(this.x=h*z*D-t*k*m,this.y=t*k*D+h*z*m,this.z=t*z*m+h*k*D,this.w=t*z*D-h*k*m):"ZYX"===q?(this.x=h*z*D-t*k*m,this.y=t*k*D+h*z*m,this.z=t*z*m-h*k*D,this.w=t*z*D+h*k*m):"YZX"===q?(this.x=h*z*D+t*k*m,this.y=t*k*D+h*z*m,this.z=t*z*m-h*k*D,this.w=t*z*D-h*k*m):"XZY"===q&&(this.x=h*z*D-t*k*m,this.y=t*k*D-h*z*m,this.z=t*z*m+h*k*D,this.w=t*z*D+h*k*m);return this};L.prototype.clone= function(){return new L(this.x,this.y,this.z,this.w)};L.prototype.slerp=function(h,k,m){void 0===m&&(m=new L);var q=this.x,t=this.y,z=this.z,D=this.w,C=h.x,J=h.y,N=h.z;h=h.w;var T=q*C+t*J+z*N+D*h;0>T&&(T=-T,C=-C,J=-J,N=-N,h=-h);if(1E-6<1-T){var W=Math.acos(T);var Y=Math.sin(W);T=Math.sin((1-k)*W)/Y;k=Math.sin(k*W)/Y}else T=1-k;m.x=T*q+k*C;m.y=T*t+k*J;m.z=T*z+k*N;m.w=T*D+k*h;return m};L.prototype.integrate=function(h,k,m,q){void 0===q&&(q=new L);var t=h.x*m.x,z=h.y*m.y;h=h.z*m.z;m=this.x;var D=this.y, C=this.z,J=this.w;k*=.5;q.x+=k*(t*J+z*C-h*D);q.y+=k*(z*J+h*m-t*C);q.z+=k*(h*J+t*D-z*m);q.w+=k*(-t*m-z*D-h*C);return q};Nd=L;Hy=new F;Iy=new F;Ke={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};var K=function(h){void 0===h&&(h={});this.id=K.idCounter++;this.type=h.type||0;this.boundingSphereRadius=0;this.collisionResponse=h.collisionResponse?h.collisionResponse:!0;this.collisionFilterGroup=void 0!==h.collisionFilterGroup?h.collisionFilterGroup: 1;this.collisionFilterMask=void 0!==h.collisionFilterMask?h.collisionFilterMask:-1;this.material=h.material?h.material:null;this.body=null};K.prototype.updateBoundingSphereRadius=function(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type;};K.prototype.volume=function(){throw"volume() not implemented for shape type "+this.type;};K.prototype.calculateLocalInertia=function(h,k){throw"calculateLocalInertia() not implemented for shape type "+this.type;};K.prototype.calculateWorldAABB= function(h,k,m,q){throw"calculateWorldAABB() not implemented for shape type "+this.type;};Wa=K;Wa.idCounter=0;Wa.types=Ke;var u=function(h){void 0===h&&(h={});this.position=new F;this.quaternion=new Nd;h.position&&this.position.copy(h.position);h.quaternion&&this.quaternion.copy(h.quaternion)};u.prototype.pointToLocal=function(h,k){return u.pointToLocalFrame(this.position,this.quaternion,h,k)};u.prototype.pointToWorld=function(h,k){return u.pointToWorldFrame(this.position,this.quaternion,h,k)};u.prototype.vectorToWorldFrame= function(h,k){void 0===k&&(k=new F);this.quaternion.vmult(h,k);return k};u.pointToLocalFrame=function(h,k,m,q){void 0===q&&(q=new F);m.vsub(h,q);k.conjugate(Hr);Hr.vmult(q,q);return q};u.pointToWorldFrame=function(h,k,m,q){void 0===q&&(q=new F);k.vmult(m,q);q.vadd(h,q);return q};u.vectorToWorldFrame=function(h,k,m){void 0===m&&(m=new F);h.vmult(k,m);return m};u.vectorToLocalFrame=function(h,k,m,q){void 0===q&&(q=new F);k.w*=-1;k.vmult(m,q);k.w*=-1;return q};Ab=u;Hr=new Nd;var P=function(h){void 0=== h&&(h={});var k=h;h=void 0===k.vertices?[]:k.vertices;var m=void 0===k.faces?[]:k.faces,q=void 0===k.normals?[]:k.normals,t=k.axes,z=k.boundingSphereRadius,D=k.adjacentFaces,C=k.uniqueEdges;k=Wa.call(this,{type:Wa.types.CONVEXPOLYHEDRON})||this;k.vertices=h;k.faces=m;k.faceNormals=q;0===k.faceNormals.length&&k.computeNormals();z?k.boundingSphereRadius=z:k.updateBoundingSphereRadius();k.worldVertices=[];k.worldVerticesNeedsUpdate=!0;k.worldFaceNormals=[];k.worldFaceNormalsNeedsUpdate=!0;k.uniqueAxes= t;C?k.uniqueEdges=C:(k.uniqueEdges=[],k.computeEdges());D?k.adjacentFaces=D:(k.adjacentFaces=[],k.computeAdjacentFaces());return k};$jscomp.inherits(P,Wa);P.prototype.computeEdges=function(){P.computeEdges(this.faces,this.vertices,this.uniqueEdges)};P.computeEdges=function(h,k,m){m.length=0;for(var q=Ny,t=0,z=h.length;tC.dot(q[z[0]]))for(console.error(".faceNormals["+t+"] = Vec3("+C.toString()+") looks like it points into the shape? The vertices follow. Make sure they are ordered CCW around the normal, using the right hand rule."),C=0;CW&&(W=V,T=U)}if(0<=T){N=Ry.reset();T=Y[T];m=m.vertices;Y=0;for(W=T.length;YC)){J=N[C];N=this.adjacentFaces[C];T=az;Y=bz;ca=cz;U=dz;var ha=ez;h=fz;var V=gz.reset(),ta=J.length,Na=this.vertices;m.vmult(W[C],ca);k.vadd(ca,ca);for(var Qa=0;Qa=m?da.STATIC:da.DYNAMIC;typeof h.type===typeof da.STATIC&&(k.type=h.type);k.allowSleep="undefined"!==typeof h.allowSleep?h.allowSleep:!0;k.sleepState=da.AWAKE;k.sleepSpeedLimit="undefined"!==typeof h.sleepSpeedLimit?h.sleepSpeedLimit:.1;k.sleepTimeLimit="undefined"!==typeof h.sleepTimeLimit?h.sleepTimeLimit:1; k.timeLastSleepy=0;k.wakeUpAfterNarrowphase=!1;k.torque=new F;k.quaternion=new Nd;h.quaternion&&k.quaternion.copy(h.quaternion);k.angularVelocity=new F;h.angularVelocity&&k.angularVelocity.copy(h.angularVelocity);k.shapes=[];k.shapeOffsets=[];k.shapeOrientations=[];k.inertia=new F;k.invInertia=new F;k.invInertiaWorld=new Kh;k.invMassSolve=0;k.invInertiaSolve=new F;k.invInertiaWorldSolve=new Kh;k.fixedRotation="undefined"!==typeof h.fixedRotation?h.fixedRotation:!1;k.angularDamping="undefined"!==typeof h.angularDamping? h.angularDamping:.01;k.linearFactor=new F(1,1,1);h.linearFactor&&k.linearFactor.copy(h.linearFactor);k.angularFactor=new F(1,1,1);h.angularFactor&&k.angularFactor.copy(h.angularFactor);k.aabb=new jc;k.aabbNeedsUpdate=!0;k.boundingRadius=0;k.wlambda=new F;k.isTrigger=!!h.isTrigger;h.shape&&k.addShape(h.shape);k.updateMassProperties();return k};$jscomp.inherits(da,gf);da.prototype.wakeUp=function(){var h=this.sleepState;this.sleepState=da.AWAKE;this.wakeUpAfterNarrowphase=!1;h===da.SLEEPING&&this.dispatchEvent(da.wakeupEvent)}; da.prototype.sleep=function(){this.sleepState=da.SLEEPING;this.velocity.set(0,0,0);this.angularVelocity.set(0,0,0);this.wakeUpAfterNarrowphase=!1};da.prototype.sleepTick=function(h){if(this.allowSleep){var k=this.sleepState,m=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),q=Ad(this.sleepSpeedLimit,2);k===da.AWAKE&&mq?this.wakeUp():k===da.SLEEPY&&h-this.timeLastSleepy>this.sleepTimeLimit&& (this.sleep(),this.dispatchEvent(da.sleepEvent))}};da.prototype.updateSolveMassProperties=function(){this.sleepState===da.SLEEPING||this.type===da.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))};da.prototype.pointToLocalFrame=function(h,k){void 0===k&&(k=new F);h.vsub(this.position,k);this.quaternion.conjugate().vmult(k, k);return k};da.prototype.vectorToLocalFrame=function(h,k){void 0===k&&(k=new F);this.quaternion.conjugate().vmult(h,k);return k};da.prototype.pointToWorldFrame=function(h,k){void 0===k&&(k=new F);this.quaternion.vmult(h,k);k.vadd(this.position,k);return k};da.prototype.vectorToWorldFrame=function(h,k){void 0===k&&(k=new F);this.quaternion.vmult(h,k);return k};da.prototype.addShape=function(h,k,m){var q=new F,t=new Nd;k&&q.copy(k);m&&t.copy(m);this.shapes.push(h);this.shapeOffsets.push(q);this.shapeOrientations.push(t); this.updateMassProperties();this.updateBoundingRadius();this.aabbNeedsUpdate=!0;h.body=this;return this};da.prototype.removeShape=function(h){var k=this.shapes.indexOf(h);if(-1===k)return console.warn("Shape does not belong to the body"),this;this.shapes.splice(k,1);this.shapeOffsets.splice(k,1);this.shapeOrientations.splice(k,1);this.updateMassProperties();this.updateBoundingRadius();this.aabbNeedsUpdate=!0;h.body=null;return this};da.prototype.updateBoundingRadius=function(){for(var h=this.shapes, k=this.shapeOffsets,m=h.length,q=0,t=0;t!==m;t++){var z=h[t];z.updateBoundingSphereRadius();var D=k[t].length();z=z.boundingSphereRadius;D+z>q&&(q=D+z)}this.boundingRadius=q};da.prototype.updateAABB=function(){for(var h=this.shapes,k=this.shapeOffsets,m=this.shapeOrientations,q=h.length,t=qz,z=rz,D=this.quaternion,C=this.aabb,J=sz,N=0;N!==q;N++){var T=h[N];D.vmult(k[N],t);t.vadd(this.position,t);D.mult(m[N],z);T.calculateWorldAABB(t,z,J.lowerBound,J.upperBound);0===N?C.copy(J):C.extend(J)}this.aabbNeedsUpdate= !1};da.prototype.updateInertiaWorld=function(h){var k=this.invInertia;if(k.x!==k.y||k.y!==k.z||h){h=tz;var m=uz;vz;h.setRotationFromQuaternion(this.quaternion);h.transpose(m);h.scale(k,h);h.mmult(m,this.invInertiaWorld)}};da.prototype.applyForce=function(h,k){void 0===k&&(k=new F);if(this.type===da.DYNAMIC){this.sleepState===da.SLEEPING&&this.wakeUp();var m=wz;k.cross(h,m);this.force.vadd(h,this.force);this.torque.vadd(m,this.torque)}};da.prototype.applyLocalForce=function(h,k){void 0===k&&(k=new F); if(this.type===da.DYNAMIC){var m=xz,q=yz;this.vectorToWorldFrame(h,m);this.vectorToWorldFrame(k,q);this.applyForce(m,q)}};da.prototype.applyTorque=function(h){this.type===da.DYNAMIC&&(this.sleepState===da.SLEEPING&&this.wakeUp(),this.torque.vadd(h,this.torque))};da.prototype.applyImpulse=function(h,k){void 0===k&&(k=new F);if(this.type===da.DYNAMIC){this.sleepState===da.SLEEPING&&this.wakeUp();var m=zz;m.copy(h);m.scale(this.invMass,m);this.velocity.vadd(m,this.velocity);m=Az;k.cross(h,m);this.invInertiaWorld.vmult(m, m);this.angularVelocity.vadd(m,this.angularVelocity)}};da.prototype.applyLocalImpulse=function(h,k){void 0===k&&(k=new F);if(this.type===da.DYNAMIC){var m=Bz,q=Cz;this.vectorToWorldFrame(h,m);this.vectorToWorldFrame(k,q);this.applyImpulse(m,q)}};da.prototype.updateMassProperties=function(){var h=Dz;this.invMass=0m.lengthSquared()};Od.prototype.aabbQuery=function(h,k,m){console.warn(".aabbQuery is not implemented in this Broadphase subclass.");return[]};Ez=new F;new F;new Nd;new F;Fz={keys:[]};Gz=[];Hz=[];new F;new F;new F;Mk=function(){return Od.call(this)|| this};$jscomp.inherits(Mk,Od);Mk.prototype.collisionPairs=function(h,k,m){h=h.bodies;for(var q=h.length,t,z,D=0;D!==q;D++)for(var C=0;C!==D;C++)t=h[D],z=h[C],this.needBroadphaseCollision(t,z)&&this.intersectionTest(t,z,k,m)};Mk.prototype.aabbQuery=function(h,k,m){void 0===m&&(m=[]);for(var q=0;qh.boundingSphereRadius||(t=this[h.type])&&t.call(this,h,k,m,q,h)};ba.prototype._intersectBox=function(h,k,m,q,t){return this._intersectConvex(h.convexPolyhedronRepresentation,k,m,q,t)};ba.prototype._intersectPlane=function(h,k,m,q,t){h=this.from;var z=this.to,D=this.direction,C=new F(0,0,1);k.vmult(C,C);var J=new F;h.vsub(m,J);k=J.dot(C);z.vsub(m,J);J=J.dot(C);if(!(0J))if(0===J)k.lerp(z,J,D),D.vsub(m, N),N.normalize(),this.reportIntersection(N,D,t,q,-1);else{var T=(-C-Math.sqrt(J))/(2*h);h=(-C+Math.sqrt(J))/(2*h);0<=T&&1>=T&&(k.lerp(z,T,D),D.vsub(m,N),N.normalize(),this.reportIntersection(N,D,t,q,-1));!this.result.shouldStop&&0<=h&&1>=h&&(k.lerp(z,h,D),D.vsub(m,N),N.normalize(),this.reportIntersection(N,D,t,q,-1))}};ba.prototype._intersectConvex=function(h,k,m,q,t,z){Wz;var D=Vz,C=Kr;Xz;z=z&&z.faceList||null;var J=h.faces,N=h.vertices;h=h.faceNormals;for(var T=this.direction,W=this.from,Y=W.distanceTo(this.to), ca=z?z.length:J.length,U=this.result,ha=0;!U.shouldStop&&haNa)))for(T.scale(Na,Bd),Bd.vadd(W,Bd),se.copy(N[ta[0]]),Qa.vmult(se,se),Ma.vadd(se,se),Na=1;!U.shouldStop&&NaY||this.reportIntersection(D,Bd,t,q,V)}}};ba.prototype._intersectTrimesh=function(h,k,m,q,t,z){z=Yz;var D=dA,C=eA,J=Kr,N=Zz,T=$z,W=aA,Y=cA,ca=bA,U=h.indices;h.vertices;var ha=this.from,V=this.to,ta=this.direction;C.position.copy(m);C.quaternion.copy(k);Ab.vectorToLocalFrame(m,k,ta,N);Ab.pointToLocalFrame(m,k,ha,T);Ab.pointToLocalFrame(m,k,V,W);W.x*=h.scale.x;W.y*=h.scale.y;W.z*=h.scale.z;T.x*=h.scale.x;T.y*=h.scale.y;T.z*=h.scale.z; W.vsub(T,N);N.normalize();W=T.distanceSquared(W);h.tree.rayQuery(this,C,D);C=0;for(ha=D.length;!this.result.shouldStop&&C!==ha;C++)V=D[C],h.getNormal(V,z),h.getVertex(U[3*V],se),se.vsub(T,J),ta=N.dot(z),ta=z.dot(J)/ta,0>ta||(N.scale(ta,Bd),Bd.vadd(T,Bd),h.getVertex(U[3*V+1],Me),h.getVertex(U[3*V+2],Ne),ta=Bd.distanceSquared(T),!ba.pointInTriangle(Bd,Me,se,Ne)&&!ba.pointInTriangle(Bd,se,Me,Ne)||ta>W||(Ab.vectorToWorldFrame(k,z,ca),Ab.pointToWorldFrame(m,k,Bd,Y),this.reportIntersection(ca,Y,t,q,V))); D.length=0};ba.prototype.reportIntersection=function(h,k,m,q,t){var z=this.from,D=this.to,C=z.distanceTo(k),J=this.result;if(!(this.skipBackfaces&&0m?h>t?0:2:m>t?1:2};wa.prototype.aabbQuery=function(h,k,m){void 0===m&&(m=[]);this.dirty&&(this.sortList(),this.dirty=!1);h=this.axisList;for(var q=0;qk.radius)throw Error("The sphere radius cannot be negative.");k.updateBoundingSphereRadius();return k};$jscomp.inherits(Vf,Wa);Vf.prototype.calculateLocalInertia=function(h,k){void 0===k&&(k=new F);h=2*h*this.radius*this.radius/5;k.x=h;k.y=h;k.z=h;return k};Vf.prototype.volume=function(){return 4*Math.PI*Math.pow(this.radius,3)/3};Vf.prototype.updateBoundingSphereRadius= function(){this.boundingSphereRadius=this.radius};Vf.prototype.calculateWorldAABB=function(h,k,m,q){k=this.radius;for(var t=["x","y","z"],z=0;zh.x&&(h.x=q.x),q.yh.y&&(h.y=q.y),q.zh.z&&(h.z=q.z)};ub.prototype.updateAABB=function(){this.computeLocalAABB(this.aabb)};ub.prototype.updateBoundingSphereRadius=function(){var h=0,k=this.vertices,m=new F,q=0;for(k=k.length/3;q!==k;q++){this.getVertex(q,m);var t=m.lengthSquared();t>h&&(h=t)}this.boundingSphereRadius=Math.sqrt(h)};ub.prototype.calculateWorldAABB=function(h,k,m,q){var t=uA,z=vA;t.position=h;t.quaternion=k;this.aabb.toWorldFrame(t, z);m.copy(z.lowerBound);q.copy(z.upperBound)};ub.prototype.volume=function(){return 4*Math.PI*this.boundingSphereRadius/3};ub.createTorus=function(h,k,m,q,t){void 0===h&&(h=1);void 0===k&&(k=.5);void 0===m&&(m=8);void 0===q&&(q=6);void 0===t&&(t=2*Math.PI);for(var z=[],D=[],C=0;C<=m;C++)for(var J=0;J<=q;J++){var N=J/q*t,T=C/m*Math.PI*2;z.push((h+k*Math.cos(T))*Math.cos(N),(h+k*Math.cos(T))*Math.sin(N),k*Math.sin(T))}for(h=1;h<=m;h++)for(k=1;k<=q;k++)t=(q+1)*(h-1)+k-1,C=(q+1)*(h-1)+k,J=(q+1)*h+k,D.push((q+ 1)*h+k-1,t,J),D.push(t,C,J);return new ub(z,D)};Ur=ub;qA=new F;Sk=new jc;rA=new F;sA=new F;Vr=new F;Wr=new F;Xr=new F;Yr=new F;Zr=new F;Kg=new jc;tA=new F;uA=new Ab;vA=new jc;Oh=function(){this.equations=[]};Oh.prototype.solve=function(h,k){return 0};Oh.prototype.addEquation=function(h){!h.enabled||h.bi.isTrigger||h.bj.isTrigger||this.equations.push(h)};Oh.prototype.removeEquation=function(h){var k=this.equations;h=k.indexOf(h);-1!==h&&k.splice(h,1)};Oh.prototype.removeAllEquations=function(){this.equations.length= 0};on=function(){var h=Oh.call(this)||this;h.iterations=10;h.tolerance=1E-7;return h};$jscomp.inherits(on,Oh);on.prototype.solve=function(h,k){var m=0,q=this.iterations,t=this.tolerance*this.tolerance,z=this.equations,D=z.length,C=k.bodies,J=C.length,N;if(0!==D)for(k=0;k!==J;k++)C[k].updateSolveMassProperties();var T=xA,W=yA;k=wA;T.length=D;W.length=D;k.length=D;for(N=0;N!==D;N++){var Y=z[N];k[N]=0;W[N]=Y.computeB(h);T[N]=1/Y.computeC()}if(0!==D){for(m=0;m!==J;m++)N=C[m],Y=N.wlambda,N.vlambda.set(0, 0,0),Y.set(0,0,0);for(m=0;m!==q;m++){for(var ca=N=0;ca!==D;ca++){var U=z[ca];var ha=W[ca];var V=T[ca];Y=k[ca];var ta=U.computeGWlambda();ha=V*(ha-ta-U.eps*Y);Y+haU.maxForce&&(ha=U.maxForce-Y);k[ca]+=ha;N+=0k||arguments.length<=k?void 0:arguments[k]);return this};Ph.prototype.get=function(){return 0===this.objects.length?this.constructObject():this.objects.pop()};Ph.prototype.constructObject=function(){throw Error("constructObject() not implemented in this Pool subclass yet!");};Ph.prototype.resize=function(h){for(var k=this.objects;k.length> h;)k.pop();for(;k.lengthU.boundingSphereRadius+V.boundingSphereRadius)){var ta=null;U.material&&V.material&&(ta=m.getContactMaterial(U.material,V.material)||null);this.currentContactMaterial=ta||W||m.defaultContactMaterial;(ta=this[U.type| V.type])&&(U.type-Eb&&kb-Cb&&(Hc=Math.abs(Hc-sb-z),null===Qa||Hch.boundingSphereRadius+k.boundingSphereRadius)&&h.findSeparatingAxis(k,m,t,q,z,ca,W,Y)){W=DA.reset();Y=BB;h.clipAgainstHull(m,t,k,q,z,ca,-100,100,W);z=t=0;for(var U=W.length;zMa&&0<$a.dot(Qa)){V= [];$a=0;for(var Da=Na.length;$a!==Da;$a++){var sb=t.get();z.vmult(ca[Na[$a]],sb);q.vadd(sb,sb);V.push(sb)}a:{$a=V;Da=Qa;sb=m;for(var Hc=null,qd=$a.length,Wc=0;Wc!==qd;Wc++){var Eb=$a[Wc],Cb=WA;$a[(Wc+1)%qd].vsub(Eb,Cb);var te=XA;Cb.cross(Da,te);Cb=YA;sb.vsub(Eb,Cb);Eb=te.dot(Cb);if(null===Hc||0=Eb&&!1===Hc)null===Hc&&(Hc=0=Y.dot(ca)){if(T)return!0;var ha=this.createContactEquation(D,C,h,k,J,N),V=zB;Y.scale(Y.dot(ca), V);W.vsub(V,V);V.vsub(m,ha.ri);ha.ni.copy(Y);W.vsub(q,ha.rj);ha.ri.vadd(m,ha.ri);ha.ri.vsub(D.position,ha.ri);ha.rj.vadd(q,ha.rj);ha.rj.vsub(C.position,ha.rj);this.result.push(ha);t++;this.enableFrictionReduction||this.createFrictionEquationsFromContact(ha,this.frictionResult)}this.enableFrictionReduction&&t&&this.createFrictionFromAverage(t)};fb.prototype.boxConvex=function(h,k,m,q,t,z,D,C,J,N,T){h.convexPolyhedronRepresentation.material=h.material;h.convexPolyhedronRepresentation.collisionResponse= h.collisionResponse;return this.convexConvex(h.convexPolyhedronRepresentation,k,m,q,t,z,D,C,h,k,T)};fb.prototype.sphereHeightfield=function(h,k,m,q,t,z,D,C,J,N,T){var W=k.data,Y=h.radius,ca=k.elementSize;J=OB;var U=NB;Ab.pointToLocalFrame(q,z,m,U);var ha=Math.floor((U.x-Y)/ca)-1;N=Math.ceil((U.x+Y)/ca)+1;var V=Math.floor((U.y-Y)/ca)-1;ca=Math.ceil((U.y+Y)/ca)+1;if(!(0>N||0>ca||ha>W.length||V>W[0].length)){0>ha&&(ha=0);0>N&&(N=0);0>V&&(V=0);0>ca&&(ca=0);ha>=W.length&&(ha=W.length-1);N>=W.length&&(N= W.length-1);ca>=W[0].length&&(ca=W[0].length-1);V>=W[0].length&&(V=W[0].length-1);W=[];k.getRectMinMax(ha,V,N,ca,W);var ta=W[0];if(!(U.z-Y>W[1]||U.z+YV||0>Y||ha>W.length||ta>W[0].length)){0>ha&&(ha=0);0>V&&(V=0);0>ta&&(ta=0);0>Y&&(Y=0);ha>=W.length&&(ha=W.length-1);V>=W.length&&(V=W.length-1);Y>=W[0].length&&(Y=W[0].length-1);ta>=W[0].length&&(ta=W[0].length-1);W=[];k.getRectMinMax(ha,ta,V,Y,W);var Na=W[0]; if(!(U.z-ca>W[1]||U.z+ca=m.dot(t)){if(T)return!0;h=this.createContactEquation(C,D,k,h,J,N);h.ni.copy(m);h.ni.negate(h.ni);h.ri.set(0,0,0);k=EB;m.scale(m.dot(q),k);q.vsub(k,k);h.rj.copy(k);this.result.push(h);this.createFrictionEquationsFromContact(h,this.frictionResult)}};fb.prototype.boxParticle=function(h,k,m,q,t,z,D,C,J,N,T){h.convexPolyhedronRepresentation.material=h.material;h.convexPolyhedronRepresentation.collisionResponse=h.collisionResponse;return this.convexParticle(h.convexPolyhedronRepresentation, k,m,q,t,z,D,C,h,k,T)};fb.prototype.convexParticle=function(h,k,m,q,t,z,D,C,J,N,T){var W=-1;z=IB;var Y=JB,ca=null,U=HB;U.copy(q);U.vsub(m,U);t.conjugate(as);as.vmult(U,U);if(h.pointIsInside(U)){h.worldVerticesNeedsUpdate&&h.computeWorldVertices(m,t);h.worldFaceNormalsNeedsUpdate&&h.computeWorldFaceNormals(t);t=0;for(U=h.faces.length;t!==U;t++){var ha=h.worldFaceNormals[t];q.vsub(h.worldVertices[h.faces[t][0]],bs);var V=-ha.dot(bs);if(null===ca||Math.abs(V)Da;Da++)if(k.getVertex(k.indices[3*Qa[$a]+Da],V),V.vsub(t,Na),Na.lengthSquared()<= Ma){ta.copy(V);Ab.pointToWorldFrame(q,z,ta,V);V.vsub(m,Na);if(T)return!0;var sb=this.createContactEquation(D,C,h,k,J,N);sb.ni.copy(Na);sb.ni.normalize();sb.ri.copy(sb.ni);sb.ri.scale(h.radius,sb.ri);sb.ri.vadd(m,sb.ri);sb.ri.vsub(D.position,sb.ri);sb.rj.copy(V);sb.rj.vsub(C.position,sb.rj);this.result.push(sb);this.createFrictionEquationsFromContact(sb,this.frictionResult)}for(ta=0;taNa;Na++)if(k.getVertex(k.indices[3*Qa[ta]+Na],W),k.getVertex(k.indices[3*Qa[ta]+(Na+1)% 3],Y),Y.vsub(W,ca),t.vsub(Y,ha),V=ha.dot(ca),t.vsub(W,ha),Ma=ha.dot(ca),0V&&(t.vsub(W,ha),U.copy(ca),U.normalize(),Ma=ha.dot(U),U.scale(Ma,ha),ha.vadd(W,ha),ha.distanceTo(t)=Y.dot(ca)){if(T)return!0;var U=this.createContactEquation(D,C,h,k,J,N);U.ni.copy(Y);var ha=GA;Y.scale(ca.dot(Y),ha);W.vsub(ha,ha);U.ri.copy(ha); U.ri.vsub(D.position,U.ri);U.rj.copy(W);U.rj.vsub(C.position,U.rj);this.result.push(U);this.createFrictionEquationsFromContact(U,this.frictionResult)}}};Lg=new F;Qh=new F;Rh=new F;zA=new F;AA=new F;BA=new Nd;CA=new Nd;qn=function(){this.array=[];this.length=0};qn.prototype.push=function(h,k,m){var q=this.array[this.length++];q?(q.point=h,q.normal=k,q.depth=m):this.array[this.length-1]={point:h,normal:k,depth:m}};qn.prototype.reset=function(){this.length=0;return this};DA=new qn;EA=new F;FA=new F; GA=new F;HA=new F;IA=new F;new F;JA=new F;KA=new F;LA=new F;MA=new F;NA=new F;OA=new F;PA=new F;QA=new F;RA=new F;SA=new F;TA=new F;UA=new jc;VA=[];Tk=new F;$r=new F;WA=new F;XA=new F;YA=new F;Uk=new F;ZA=new F;$A=new F;aB=new F;bB=[new F,new F,new F,new F,new F,new F];cB=new F;dB=new F;eB=new F;fB=new F;gB=new F;hB=new F;iB=new F;jB=new F;kB=new F;lB=new F;mB=new F;nB=new F;oB=new F;pB=new F;qB=new F;rB=new F;sB=new F;tB=new F;uB=new F;vB=new F;wB=new F;xB=new F;yB=new F;zB=new F;AB=new F;BB=new F; CB=new F;DB=new F;EB=new F;GB=new F;as=new Nd;HB=new F;IB=new F;bs=new F;JB=new F;KB=new F;LB=new F;MB=[0];NB=new F;OB=new F;Sh=function(){this.current=[];this.previous=[]};Sh.prototype.getKey=function(h,k){if(kk[m];)m++;if(h!==k[m]){for(var q=k.length-1;q>=m;q--)k[q+1]=k[q];k[m]=h}};Sh.prototype.tick=function(){var h=this.current;this.current=this.previous;this.previous=h;this.current.length= 0};Sh.prototype.getDiff=function(h,k){for(var m=this.current,q=this.previous,t=m.length,z=q.length,D=0,C=0;Cq[D];)D++;J===q[D]||h.push((J&4294901760)>>16,J&65535)}for(h=D=0;hm[D];)D++;m[D]===t||k.push((t&4294901760)>>16,t&65535)}};rn=function(h,k){return h=h&&t1E3*h););this.accumulator%=h;this.time+=k}};Bc.prototype.internalStep=function(h){this.dt=h;var k=this.contacts,m=RB,q=SB,t=this.bodies,z=t.length,D=this.solver,C=this.gravity,J=this.doProfiling,N=this.profile,T=xb.DYNAMIC,W=-Infinity,Y=this.constraints,ca=this.frictionEquationsPool;C.length();var U=C.x,ha=C.y,V=C.z;J&&(W=Pc.now());for(C=0;C!==z;C++){var ta=t[C];if(ta.type===T){var Na=ta.force;ta=ta.mass;Na.x+= ta*U;Na.y+=ta*ha;Na.z+=ta*V}}C=0;for(U=this.subsystems.length;C!==U;C++)this.subsystems[C].update();J&&(W=Pc.now());m.length=0;q.length=0;this.broadphase.collisionPairs(this,m,q);J&&(N.broadphase=Pc.now()-W);U=Y.length;for(C=0;C=2*ta&&(ca.wakeUpAfterNarrowphase=!0)),U.allowSleep&&U.type===xb.DYNAMIC&&U.sleepState=== xb.SLEEPING&&ca.sleepState===xb.AWAKE&&ca.type!==xb.STATIC&&!ca.isTrigger&&(Na=ca.velocity.lengthSquared()+ca.angularVelocity.lengthSquared(),ta=Ad(ca.sleepSpeedLimit,2),Na>=2*ta&&(U.wakeUpAfterNarrowphase=!0)),this.collisionMatrix.set(ca,U,!0),this.collisionMatrixPrevious.get(ca,U)||(lj.body=U,lj.contact=q,ca.dispatchEvent(lj),lj.body=ca,U.dispatchEvent(lj)),this.bodyOverlapKeeper.set(ca.id,U.id),this.shapeOverlapKeeper.set(ha.id,V.id);this.emitContactEvents();J&&(N.makeContactConstraints=Pc.now()- W,W=Pc.now());for(C=0;C!==z;C++)k=t[C],k.wakeUpAfterNarrowphase&&(k.wakeUp(),k.wakeUpAfterNarrowphase=!1);U=Y.length;for(C=0;C!==U;C++)for(k=Y[C],k.update(),m=0,q=k.equations.length;m!==q;m++)D.addEquation(k.equations[m]);D.solve(h,this);J&&(N.solve=Pc.now()-W);D.removeAllEquations();D=Math.pow;for(C=0;C!==z;C++)if(Y=t[C],Y.type&T&&(k=D(1-Y.linearDamping,h),m=Y.velocity,m.scale(k,m),k=Y.angularVelocity))Y=D(1-Y.angularDamping,h),k.scale(Y,k);this.dispatchEvent(QB);J&&(W=Pc.now());T=0===this.stepnumber% (this.quatNormalizeSkip+1);D=this.quatNormalizeFast;for(C=0;C!==z;C++)t[C].integrate(h,T,D);this.clearForces();this.broadphase.dirty=!0;J&&(N.integrate=Pc.now()-W);this.stepnumber+=1;this.dispatchEvent(PB);h=!0;if(this.allowSleep)for(h=!1,C=0;C!==z;C++)J=t[C],J.sleepTick(this.time),J.sleepState!==xb.SLEEPING&&(h=!0);this.hasActiveBodies=h};Bc.prototype.emitContactEvents=function(){var h=this.hasAnyEventListener("beginContact"),k=this.hasAnyEventListener("endContact");(h||k)&&this.bodyOverlapKeeper.getDiff(hf, jf);if(h){h=0;for(var m=hf.length;h>1],f=b,g=c;do{for(;0>d(a[f],e);)++f;for(;0c?c:a}function sb(a, b,c){return(b-a)*c+a}function Hc(a){return a*(2-a)}function qd(a){--a;return a*a*a+1}function Wc(a){return a*a*a*a}function Eb(a){var b=void 0===b?1.70158:b;return a*a*((b+1)*a-b)}function Cb(a){var b=void 0===b?1.70158:b;--a;return a*a*((b+1)*a+b)+1}function te(a,b,c,d,e){b=.5*(d-b);e=.5*(e-c);var f=a*a;return c+b*a+(-3*c+3*d-2*b-e)*f+(2*c-2*d+b+e)*f*a}function kb(a,b){this.x=void 0===a?0:a;this.y=void 0===b?0:b}function Uh(a,b,c,d){d=void 0===d?a:d;d.x=a.x+b.x*c;d.y=a.y+b.y*c;return d}function ds(a, b){b=void 0===b?a:b;var c=a.x;b.x=-a.y;b.y=c;return b}function E(a,b,c){this.x=void 0===a?0:a;this.y=void 0===b?0:b;this.z=void 0===c?0:c}function es(a,b,c){var d=c.x-b.x,e=c.y-b.y,f=c.z-b.z,g=a.x-b.x,l=a.y-b.y,n=a.z-b.z,r=d*g+e*l+f*n;if(0>=r)return Math.sqrt(g*g+l*l+n*n);g=a.x-c.x;l=a.y-c.y;c=a.z-c.z;if(0<=d*g+e*l+f*c)return Math.sqrt(g*g+l*l+c*c);c=1/Math.sqrt(d*d+e*e+f*f);r=r*c*c;d=d*r+b.x-a.x;e=e*r+b.y-a.y;a=f*r+b.z-a.z;return Math.sqrt(d*d+e*e+a*a)}function vn(a,b,c,d,e){var f=void 0===f?a:f; e=Math.max(void 0===e?.1:e,1E-4);e=2/e;var g=e*d;g=1/(1+g+.48*g*g+.235*g*g*g);var l=a.x-b.x,n=a.y-b.y;a=a.z-b.z;var r=(c.x+e*l)*d,w=(c.y+e*n)*d;d*=c.z+e*a;c.x=(c.x-e*r)*g;c.y=(c.y-e*w)*g;c.z=(c.z-e*d)*g;f.x=b.x+(l+r)*g;f.y=b.y+(n+w)*g;f.z=b.z+(a+d)*g;return f}function oj(a){return new E(a[0],a[1],a[2])}function dc(a,b,c,d){this.x=void 0===a?0:a;this.y=void 0===b?0:b;this.z=void 0===c?0:c;this.w=void 0===d?0:d}function fs(a,b,c,d,e){return a.x===b&&a.y===c&&a.z===d&&a.w===e}function Oe(a,b,c,d,e,f){this.a= void 0===a?1:a;this.b=void 0===b?0:b;this.c=void 0===c?0:c;this.d=void 0===d?1:d;this.ub=void 0===e?0:e;this.vb=void 0===f?0:f}function Tb(a){a=void 0===a?gs.elements:a;this.elements=new Pd(a)}function $B(a,b,c,d){var e=a.elements,f=b.elements;b=e[0];a=e[1];var g=e[2],l=e[3],n=e[4],r=e[5],w=e[6],y=e[7],A=e[8],H=e[9],I=e[10],O=e[11],S=e[12],R=e[13],ja=e[14];e=e[15];var ka=f[0],ea=f[1],ma=f[2],pa=f[3],va=f[4],Ka=f[5],Aa=f[6],Fa=f[7],xa=f[8],Ja=f[9],La=f[10],Ha=f[11],Gb=f[12],qc=f[13],Nb=f[14];f=f[15]; c[d++]=b*ka+n*ea+A*ma+S*pa;c[d++]=a*ka+r*ea+H*ma+R*pa;c[d++]=g*ka+w*ea+I*ma+ja*pa;c[d++]=l*ka+y*ea+O*ma+e*pa;c[d++]=b*va+n*Ka+A*Aa+S*Fa;c[d++]=a*va+r*Ka+H*Aa+R*Fa;c[d++]=g*va+w*Ka+I*Aa+ja*Fa;c[d++]=l*va+y*Ka+O*Aa+e*Fa;c[d++]=b*xa+n*Ja+A*La+S*Ha;c[d++]=a*xa+r*Ja+H*La+R*Ha;c[d++]=g*xa+w*Ja+I*La+ja*Ha;c[d++]=l*xa+y*Ja+O*La+e*Ha;c[d++]=b*Gb+n*qc+A*Nb+S*f;c[d++]=a*Gb+r*qc+H*Nb+R*f;c[d++]=g*Gb+w*qc+I*Nb+ja*f;c[d++]=l*Gb+y*qc+O*Nb+e*f}function Vh(a,b){var c=void 0===c?b:c,d=b.x,e=b.y,f=b.z;b=b.w;a=a.elements; c.x=a[0]*d+a[4]*e+a[8]*f+a[12]*b;c.y=a[1]*d+a[5]*e+a[9]*f+a[13]*b;c.z=a[2]*d+a[6]*e+a[10]*f+a[14]*b;c.w=a[3]*d+a[7]*e+a[11]*f+a[15]*b;return c}function aC(a,b,c){c=void 0===c?b:c;var d=b.x,e=b.y;b=b.z;a=a.elements;var f=1/(a[3]*d+a[7]*e+a[11]*b+a[15]);c.x=(a[0]*d+a[4]*e+a[8]*b+a[12])*f;c.y=(a[1]*d+a[5]*e+a[9]*b+a[13])*f;c.z=(a[2]*d+a[6]*e+a[10]*b+a[14])*f;return c}function bC(a,b,c,d,e,f,g){var l=2*f,n=c-b,r=e-d,w=1/(f-g),y=a.elements;y[0]=l/n;y[1]=0;y[2]=0;y[3]=0;y[4]=0;y[5]=l/r;y[6]=0;y[7]=0;y[8]= (c+b)/n;y[9]=(e+d)/r;y[10]=(f+g)*w;y[11]=-1;y[12]=0;y[13]=0;y[14]=2*g*f*w;y[15]=0;return a}function Ic(a,b,c,d){this.x=void 0===a?0:a;this.y=void 0===b?0:b;this.z=void 0===c?0:c;this.w=void 0===d?1:d}function pj(a,b,c){c/=2;var d=Math.sin(c);a.x=b.x*d;a.y=b.y*d;a.z=b.z*d;a.w=Math.cos(c);return a}function hs(a){return new Ic(a[0],a[1],a[2],a[3])}function kc(a,b,c,d){dc.call(this,void 0===a?0:a,void 0===b?0:b,void 0===c?0:c,void 0===d?0:d)}function wn(a,b){a.w=(b>>24&255)/255;a.x=(b>>16&255)/255;a.y= (b>>8&255)/255;a.z=(b&255)/255}function xn(a){return new kc((a>>16&255)/255,(a>>8&255)/255,(a&255)/255,(a>>24&255)/255)}function Xb(a,b,c,d){dc.call(this,void 0===a?0:a,void 0===b?0:b,void 0===c?0:c,void 0===d?0:d)}function qj(a,b,c,d,e,f){this.min=new E(void 0===a?0:a,void 0===b?0:b,void 0===c?0:c);this.max=new E(void 0===d?0:d,void 0===e?0:e,void 0===f?0:f)}function is(a,b,c){return(void 0===c?b:c).copy(b).Dk(a.min,a.max)}function rj(a,b){this.V=new E(void 0===a?0:a,void 0===b?0:b,0);this.radius= 0}function js(a,b,c,d,e,f){a=void 0===a?new ce:a;b=void 0===b?new ce:b;c=void 0===c?new ce:c;d=void 0===d?new ce:d;e=void 0===e?new ce:e;f=void 0===f?new ce:f;this.Ce=[a,b,c,d,e,f]}function ce(a,b,c,d){this.$b=new E(void 0===a?0:a,void 0===b?0:b,void 0===c?1:c);this.ea=void 0===d?0:d}function CK(a){var b=ks,c=ls,d=b.start;b=b.end.sub(d,DK);var e=a.$b,f=e.dot(b);if(0===f)return 0===a.Ne(d)?(c.copy(d),!0):!1;a=-(d.dot(e)+a.ea)/f;if(0>a||1<=a)return!1;c.copy(b).scale(a).add(d);return!0}function yn(a, b){a=void 0===a?new E:a;b=void 0===b?new E:b;this.start=a;this.end=b}function zn(a){a=void 0===a?cC:a;this.g=Math.max(a,1);this.j=null;this.M=this.g}function An(a){a=void 0===a?cC:a;this.g=Math.max(a,1);this.j=null;this.M=this.g}function yb(a,b){a=void 0===a?0:a;b=void 0===b?0:b;zn.call(this);this.keys=[];if(Array.isArray(a)){b=0;for(var c=a.length,d=this.keys,e;b>1,n=a[d].time,n<=b?(e=d,g=n):(f=d,l=n);0d.status&&null!==f)if(d.onreadystatechange=function(){},d.abort(),e.he=e.error=null,c.delete(d),"blob"===e.responseType)d=e.he=document.createElement("img"),d.addEventListener("load",b.l,!1),d.addEventListener("error",b.o,!1),d.addEventListener("abort",b.m,!1),c.set(d, e),d.src=window.URL.createObjectURL(f);else{if("json"===e.responseType)try{f=JSON.parse(f.toString())}catch(g){Wf(b,e,g.message||g.toString());return}b.g=T(b.g,e);delete b.M[e.url];e.Ac(e.url,f)}else Wf(b,e,"loading issue "+d.status+" ("+d.statusText+")")}};this.O=function(c){c=c.target;var d=b.j,e=d.get(c);c.removeEventListener("load",b.O,!1);c.removeEventListener("error",b.C,!1);c.removeEventListener("abort",b.u,!1);e.he=e.error=null;d.delete(c);b.g=T(b.g,e);delete b.M[e.url];e.Ac(e.url,c)};this.C= function(c){Wf(b,b.j.get(c.target),"loading error")};this.u=function(c){Wf(b,b.j.get(c.target),"loading abort")};this.l=function(c){c=c.target;var d=b.j,e=d.get(c);c.complete&&0=b||64336<=b&&65023>=b||65136<=b&&65279>=b?!0:!1}function cl(a){var b=this;this.app=a;this.g={};this.wc={};this.Ac=function(c,d){uC(b,c,d)};this.ac=function(c,d){c=b.wc[c];c.A(c.state=db,c.error=d)};this.M=function(c, d){var e=V(c)+"/",f=b.g[c],g=mc({},f.options),l=f.urls,n=a.da,r=1;g.Xa&&delete g.Xa;for(var w in d)c=e+w,l.push(c),n.remove(c),c=uC(b,c,d[w],g),++r,c.ia(function(){0===--r&&f.A(f.state=Ib)},function(y){f.A(f.state=db,f.error=y)});0===r&&f.A(f.state=Ib)};this.j=function(c,d){c=b.g[c];c.A(c.state=db,c.error=d)}}function uC(a,b,c,d){return(a.wc[b]||(a.wc[b]=new xj)).load(a.app,c,V(b)+"/",d)}function vC(a){this.app=a;this.g=[];this.j={}}function yj(a,b){return(a=a.j[b])?a.aa():null}function Cd(a){return void 0!== a.Pf}function Jn(a,b){var c=a.j[b];c&&c instanceof ai&&(a.unregister(c.ak),delete a.j[b])}function ai(a,b,c){this.app=a;this.ak=b;this.g=[];this.resize(void 0===c?0:c)}function xs(a){this.M=null;var b=this;this.app=a;this.g=!0;this.j=[];this.Jb=null;this.Uk=0;this.Gi=-1;this.O=this.D=this.Z=0;this.l=function(d){dl(b,d);if(b.g){var e=a.Li;b.j.push(d.pointerId);a.screen.nc(nf,d.pointerId,d.clientX*e,d.clientY*e,d.pressure)}};this.u=function(d){dl(b,d);if(b.g){var e=a.Li;a.screen.nc(bi,d.pointerId,d.clientX* e,d.clientY*e,d.pressure)}};this.C=function(d){dl(b,d);if(b.g){J(b.j,d.pointerId);var e=a.Li;a.screen.nc(el,d.pointerId,d.clientX*e,d.clientY*e)}};this.o=function(d){dl(b,d);b.g&&(J(b.j,d.pointerId),a.screen.nc(zj,d.pointerId))};this.P=function(d){dl(b,d);b.g&&(J(b.j,d.pointerId),a.screen.nc(zj,d.pointerId))};this.m=function(d){if(fl&&Kn&&122===d.keyCode)d.cancelable&&d.preventDefault(),d.stopPropagation(),wC();else if(b.g){var e=d.keyCode;switch(e){case 10009:e=Q.BACK}b.A(Qe,e)&&(d.cancelable&&d.preventDefault(), d.stopPropagation())}};this.K=function(d){if(b.g){var e=d.keyCode;switch(e){case 10009:e=Q.BACK}b.A(ys,e)&&(d.cancelable&&d.preventDefault(),d.stopPropagation())}};this.sh=function(d){b.g&&a.screen.nc(xC,d.deltaX,d.deltaY);d.cancelable&&d.preventDefault();d.stopPropagation()};var c=Ln.now();this.H=function(d){var e=c;800>=(c=Ln.now())-e&&d.preventDefault()};this.J={passive:!1};a.on(mf,this.W=function(){b.start()});a.on(Yh,this.wa=function(){b.stop()})}function dl(a,b){if("mouse"===b.pointerType)switch(b.type){case "pointerout":case "pointercancel":a.Gi= -1;break;default:a.Gi=b.pointerId;var c=a.app.Li;a.Z=b.clientX*c;a.D=b.clientY*c;a.O=b.pressure}}function yC(a){this.app=a;this.g=[];this.Tl=new zC;this.clearDepth=this.clearColor=!0;this.clearStencil=!1}function Zf(a){a=a.g;var b=a.length;return 0=a.Z&&Cj(a)-a.Za.length&&a.toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)):!1}function hD(a,b){var c=a.app,d=c.locale;return new Promise(function(e,f){c.scripts.get("https://widget.payselection.com/lib/pay-widget.js",function(){(new pw.PayWidget).pay({serviceId:"23155",key:"043604d0a6cf5f99c7af3e431eb5efcfd4e912668e11a8d73bfcdd5012e9a2fa83e897c760b94b3e7db160ac3a76b3a6a55da0b05ed694abcbb7de79a741845ce0"}, {MetaData:{PaymentType:"Pay"},CustomerInfo:{Language:d.language},PaymentRequest:{OrderId:b,Amount:null.lp(),Currency:null.Ll(),Description:d.ma(null.title)+": "+d.ma(null.description),ExtraData:{ShortDescription:d.ma(null.title)}}},{onSuccess:function(){e(new lt(null.id))},onError:function(g){f(g)},onClose:function(){f()}})},f)})}function Yc(a){jl.call(this,a);var b=this;this.j=this.m=null;this.D=function(c){var d=a.platform,e=d.Pb();if(void 0!==e&&0>2||3)),b=Math.min(b,Math.floor(32767/e));a.bh=b;if(g){var l=g.data;a=l.length/c;for(var n=g.data=new Th(b*a),r=0;rn&&(n=H),Iw&&(w=I),OA&&(A=O);f.set(.5*(l+n),.5*(r+w),.5*(y+A));l=0;n=f.x;r=f.y;f=f.z;for(g=c;gd&&(d=f)}a.gh=a.gh||-c+a.height;a.ii=a.ii||d-a.height}function pt(a){lc.call(this);this.url=a}function Xh(){lc.call(this);this.buffer=null;this.start=0;this.end=1}function qs(){this.Le=[];this.Hb={}}function Xk(){lc.call(this);this.Za=new Dd;this.Wa=this.ke=null;this.In=2}function rs(){lc.call(this);this.hm={}}function ts(){lc.call(this);this.Id=[];this.aabb=new qj}function qt(){lc.call(this); this.visible=!0;this.name="";this.duration=5;this.loop=!0;this.count=1;this.rate=new yb(10);this.Gj=new yb(5);this.Ah=qL;this.Mi=rt;this.Zj=new yb(5);this.Wb=new yb(5);this.Xb=new yb(5);this.Nd=new yb(5);this.speed=new yb(5);this.size=new yb(10);this.rotation=new yb(0);this.color=new Mg(new E(1,1,1));this.alpha=new yb(1);this.lh=new Zc;this.Ad=new yb(0);this.Bd=new yb(0);this.Yf=new yb(0);this.Sa=this.g=this.ke=null;this.Qc=!0;this.world=!1}function xj(a){a=void 0===a?[]:a;lc.call(this);this.Fb=a} function rL(a){var b=a.Fb;a.Fb=[];a=0;for(var c=b.length;aa.data.length&&a.resize(2*b);return a}function bg(a,b){if((a.M+=b)>a.P){var c=a.M,d=a.P;for(b=d||1;bc*b-d*e&&(0===d&&0===e&&1===b?f=-f:g=-g);a.Db=f;a.Wc=g;a.rotation=Math.atan2(d,0>f?-c:c)*rl}function eo(a,b){var c=void 0===c?b:c,d=vL,e=a.parent;for(d.copy(a.matrix);e;)e.matrix.mb(d,d),e=e.parent;return d.Fc().transformPoint(b, c)}function $c(a,b){a.opacity=b;return a}function ee(a,b,c){null!==b.parent&&b.parent.removeChild(b);D(a.children,c,b);b.parent=a;b.A($g);return a}function Fd(a,b){return a.Pg(fo(a.children,void 0===b?0:b))}function fo(a,b){b=void 0===b?0:b;for(var c=0,d=null,e=0;el.De(d)){d=l;break}}}else if(0===d.eg.length)for(f=a.j,g=0;gl.De(d)){d=l;break}if(f=a.Hd(d,c,b)){g=f.sub(d,QD).normalize();l=b.sub(f,yl);var n=c?zl(a,f):Al(a,f);if(0===n.length){var r=g.dot(l);0<=r&&(d=f,e&&e(f))}else for(var w=0;wd.De(b))return d.Zd}return[]}return b.Zd}function Al(a,b){if(0===b.eg.length){a=a.j;for(var c=0;cd.De(b))return d.eg}return[]}return b.eg}function mo(a,b,c,d,e){e=void 0===e?!0:e;for(var f=c.sub(b,QD).normalize(),g=Infinity,l=e?zl(a,c):Al(a,c),n=0;nb;++b)c[b]=new hl;this.m=0;this.j=new Pe(pD().ll(pl));this.D=new Pe(pD().ll(pl));a=a.X;a.cb(RD);a.cb(SD);this.l=new Tb;this.o=[];a=0;for(b=this.o;550>a;++a)b[a]=new hl;this.g=0;this.viewport=new Xb;this.clearColor=new kc}function TD(a,b){if(b.Xk){var c=!b.mh,d=b.Oa.elements, e=d[12],f=d[13];d=d[14];var g=b.pa,l=g.hb,n=b.Za,r=n.id,w=!1;if(c||a.od.ze(b.Hh)){w=a.C*e+a.O*f+a.Z*d+a.u;e=a.M;f=g.qc;for(var y=0;y=w&&VD.Ne(c)>=w&&WD.Ne(c)>=w&&XD.Ne(c)>=w),e=c;e&&(c=a.o,w=a.g++,c=w===c.length?c[w]=new hl:c[w],c.object=b,c.pa=g,c.Ze=l,c.bc=l.id,c.Za=n,c.Ec=r,c.z=d)}d=0;b=b.children;for(g= b.length;dMath.random()?"cop_add1":"cop_add2",!1);break;case 382:case 420:b.play("home",!0)}break;case pp:240===c?a.audio.play("assets/general/cop_start.wav"):255===c&&(a.audio.play("assets/general/brakes.wav").volume=.7);break;case Sl:284===c?(c=a.audio,c.play("assets/general/cop_end.wav"),c.play("assets/general/hit_metal.wav")):310===c&&a.audio.play(a.play.B.Ua.Jk)}});this.vg=new xe(this,"assets/general/PoliceBone01.anm",De);this.vg.object=null; this.state=gv;this.gg=0;this.on(Ae,this.bn).on(eh,this.cn)}function kg(a,b,c,d){d=void 0===d?[]:d;Se.call(this,a,b,c,d);this.W=this.P=0;this.Cd=!0;this.m=null}function Cf(a,b,c,d,e,f){Ea.call(this,a,void 0===b?0:b,void 0===c?0:c,void 0===d?null:d,void 0===e?0:e,void 0===f?0:f);this.Cb=Tl;this.g=Ul}function ld(a,b,c,d,e){e=void 0===e?[]:e;kg.call(this,a,b,c,e);this.i(this.m=(new Ea(a,b,c,d)).cb(Tl,Ul)).i(new Ea(a,b,c,d));this.effect=null}function mb(a){tb.call(this,a);var b=this;this.i(this.u=(new Ea(a, 0,0,"assets/common/w.png")).setColor(0).on(nf,function(){a.input.Jb||b.fa()})).i(this.V=new sa(a));this.Tb=!1;this.rb=0}function Df(a,b,c,d,e,f){Ea.call(this,a,b,c,d,void 0===e?0:e,void 0===f?0:f);var g=this;this.on(nf,function(l,n,r){if(g.$a(n,r))return!0})}function Vl(a){tb.call(this,a);this.i(this.g=Sd(new ki(a,0,0,"assets/common/w.png",32,32,new Xb(0,0,1024,1024)),.5).cb(hv,hv))}function Ya(a){tb.call(this,a);this.i(this.top=(new sa(a)).i(this.ua=(new sa(a)).Ia(-1).i(this.He=Sd((new ki(a,500, 183,"assets/common/pattern_s.png",225,183,new Xb(0,0,225,183),mh)).R(135),0)).i(this.kd=Sd((new ki(a,500,639,"assets/common/pattern.png",225,639,new Xb(0,0,225,639),mh)).R(-500),0)).i(this.title=Ta(Lb(new nb(a,"assets/common/font.json","HELLO",.5,.5),1.5).R(20),1500,100)))).i(this.V=new sa(a)).i(this.g=new sa(a));this.Kc=!1;this.re=0;this.H=this.C=!1;this.J=!0;this.dc=0}function Gc(a,b,c,d,e,f,g,l,n){Ea.call(this,a,b,c,d,void 0===l?0:l,void 0===n?0:n);this.u=e;this.o=f;this.m=g}function Af(a,b,c, d,e){Gc.call(this,a,b,c,"assets/common/base.png",162,26,36,void 0===d?0:d,void 0===e?0:e)}function qp(a,b,c,d,e){Gc.call(this,a,b+20,c+28,"assets/common/base_s.png",182,26,46,void 0===d?0:d,void 0===e?0:e)}function yi(a,b,c,d,e){sa.call(this,a,b,c,void 0===d?0:d,void 0===e?0:e);this.i((new qp(a,b,c)).setPosition(-10,-14).setColor(fc))}function dd(a,b,c,d,e){Gc.call(this,a,b,c,"assets/common/sbase.png",176,20,30,void 0===d?0:d,void 0===e?0:e)}function iv(a,b,c,d,e){Gc.call(this,a,b+33,c+33,"assets/common/sbase_s.png", 209,20,46.5,void 0===d?0:d,void 0===e?0:e)}function jv(a,b,c,d,e){sa.call(this,a,b,c,void 0===d?0:d,void 0===e?0:e);this.i((new iv(a,b,c)).setPosition(-16.5,-16.5).setColor(fc))}function zi(a,b,c,d,e){Gc.call(this,a,b,c,"assets/common/tbase.png",207,20,60,void 0===d?0:d,void 0===e?0:e)}function rp(a,b,c,d,e){Gc.call(this,a,b,c,"assets/common/bbase.png",160,26,26,void 0===d?0:d,void 0===e?0:e)}function Xj(a){sa.call(this,a,700,232,.5,.5);this.i(this.left=(new sa(a)).setPosition(234,232).i(this.l=(new Ea(a, 164,164,"assets/common/c_wheel.png",.5,.5)).R(-82))).i(this.right=(new sa(a)).setPosition(600,232).i(this.H=(new Ea(a,164,164,"assets/common/c_wheel.png",.5,.5)).setScale(117/164).R(-117/164*82))).i(this.ve=(new Ea(a,199,64,"assets/common/c_base.png",.5,.5)).setPosition(427,165)).i(this.J=(new Ea(a,175,123,"assets/common/c_seat.png",114/175,107/123)).setPosition(401,105)).i(this.o=(new Ea(a,183,73,"assets/common/c_back.png")).setPosition(129,19)).i(this.m=(new Ea(a,237,117,"assets/common/c_front.png", .5,.5)).setPosition(569,88)).i(this.u=(new Ea(a,27,27,"assets/common/c_point.png",.5,.5)).setPosition(12,218)).i(this.C=(new Ea(a,27,27,"assets/common/c_point.png",.5,.5)).setPosition(70,218)).i(this.D=(new Ea(a,27,27,"assets/common/c_point.png",.5,.5)).setPosition(128,218));this.g=0}function lg(a,b,c,d,e){xf.call(this,a,void 0===b?0:b,void 0===c?0:c,void 0===d?0:d,void 0===e?0:e);this.focus=25}function Ee(a,b,c,d,e,f,g,l,n,r){r=void 0===r?[]:r;kg.call(this,a,b,c,r);this.i(this.m=(new sa(a)).i((new Gc(a, b+2*e,c+2*f,d,g,l,n)).cb(Tl,Ul).setPosition(-e,-f))).i((new Gc(a,b+2*e,c+2*f,d,g,l,n)).setPosition(-e,-f)).on(kv,this.C);this.o=this.g=null;this.K=this.offset=0;this.effect=null}function bb(a,b,c,d,e,f,g){c=void 0===c?0:c;d=void 0===d?0:d;e=void 0===e?!1:e;f=void 0===f?20:f;a.offset=f;a.K=void 0===g?10:g;g=!!a.g;var l=a.app,n=a.width;g?a.o.Jc(b).Eb(c,d).setPosition(n/2,f):a.m.i(a.o=(new Cf(l,c,d,b,.5,.5)).setPosition(n/2,f));g?a.g.Jc(b).Eb(c,d).setPosition(n/2,f):e?a.i(a.g=(new li(l,c,d,b,.5,.5)).setPosition(n/ 2,f)):a.i(a.g=(new Ea(l,c,d,b,.5,.5)).setPosition(n/2,f));a.g.visible=a.o.visible=!!b;return a}function lv(a,b,c,d){d=void 0===d?[]:d;Ee.call(this,a,b,c,"assets/common/btn_a_b.png",19,19,410,50,69,d)}function jb(a,b,c,d){d=void 0===d?[]:d;Ee.call(this,a,b,c,"assets/common/btn_s_b.png",19,19,381,50,69,d)}function md(a,b,c,d){d=void 0===d?[]:d;Ee.call(this,a,b,c,"assets/common/btn_n_o.png",19,19,551,50,69,d)}function Wl(a,b,c,d){d=void 0===d?[]:d;Ee.call(this,a,b,c,"assets/common/btn_s_g.png",19,19, 381,50,69,d)}function Wd(a,b,c,d){d=void 0===d?[]:d;md.call(this,a,b,c,d);c=b/2-80;b=b/2+80;this.i(this.l=(new Ea(a,205,255,"assets/common/aorange.png",.5,.5)).setPosition(c,40)).i(this.D=(new Ea(a,205,255,"assets/common/aorange.png",.5,.5)).setPosition(b,40));this.m.i(this.H=(new Cf(a,205,255,"assets/common/aorange.png",.5,.5)).setPosition(c,40)).i(this.J=(new Cf(a,205,255,"assets/common/aorange.png",.5,.5)).setPosition(b,40))}function Ai(a,b,c,d,e,f,g){e=void 0===e?null:e;Ea.call(this,a,void 0=== b?0:b,void 0===c?0:c,void 0===d?null:d,void 0===f?0:f,void 0===g?0:g);"string"===typeof e&&(e=a.oa.get(e));this.m=e;this.Cb=mH;this.g=nH}function nh(a,b){sa.call(this,a);this.effect=null;a=this.wc=[this.o=new ch(a,"assets/common/"+b+".vfx"),this.u=new ch(a,"assets/common/val_"+b+".vfx"),this.l=new ch(a,"assets/common/patrick_"+b+".vfx")];for(b=0;bb;++b)ee(this,this.m[b]=(new Ea(a,250,250,"assets/common/ray.png", .5,1)).ya(ph).setColor(4294951424),b);this.pb()}function Ye(a){ib.call(this,a);var b=this;this.lb=this.Gc=null;this.m=new xe(this,"assets/general/CarBone01.anm",De);this.Ua=this.j=null;this.Ta=(new xe(this,"assets/general/Body01.anm",De)).on(op,function(c){var d=b.Ta,e=b.Ua;switch(b.state){case Ef:c===De["in"].T&&b.za(0,Xd);0===b.mc&&0===d.Ed(mv)&&(b.Ta.play("karts_hi",!1,he),e&&1<=b.Db&&a.audio.play(e.zj),b.mc=4+4*Math.random());break;case Xl:c===De[e.$].T&&0===b.mc&&(b.play("hi",!1,he),a.audio.play(e.zj), b.mc=4+4*Math.random());break;case Yj:c===De.out.T&&b.Ta.play(b.Ua&&b.Ua.gm||"kart_unlock",!0,Xd);break;case Yl:1778!==c&&1870!==c||a.audio.play(e.zj);break;case sp:0===b.mc&&(b.Ta.play("advice",!1,he),b.mc=4+4*Math.random())}});this.g=null;this.o=new xe(null,null,De);this.je=null;this.i(this.Hc=new Zl(a));this.state=-1;this.l=this.mc=0;this.C=this.O=null;this.u=0;this.on(wl,this.dn)}function HO(a,b){var c=a.Gc;c&&c.ia(void 0,b);(c=a.j)&&c.ia(void 0,b);(a=a.g)&&a.ia(void 0,b)}function nv(a,b,c){a= a.Ta;a.za(Da(a.Ed(c)+b,0,1),c)}function Zl(a){ib.call(this,a);this.i(this.Ab=(new Oa(a,"assets/general/star.mdl",oH)).setScale(.8));this.time=0}function Bi(a){ac.call(this,a,IO,JO);Rg(a.X,this)}function Zj(a){tb.call(this,a);var b=this;this.K=!OK(a.platform);var c=this.i,d=(new sa(a)).L(!1).i(this.na=new Ea(a,4096,2048,"assets/preloader/back.png",.5,.5)).i((new Ea(a,1134,844,"assets/preloader/image.png",.5,.5)).setScale(1.4).setPosition(-100,200)),e=d.i,f=Sd(new ld(a,413,303,"assets/preloader/logo.png"), .5),g=f.L;a:switch(a.platform.va){case rd:var l=!1;break a;default:l=!0}c.call(this,this.V=e.call(d,this.u=g.call(f,l).ka(Zb).on(Yd,function(){var n=a.platform;ue(n,n.yc||"/")}))).i(this.J=(new sa(a)).L(!1).i(this.W=(new Ea(a,909,225,"assets/preloader/progress_back.png",.5,.5)).R(-144).i(this.dc=(new ah(a,803,93,"assets/preloader/progress_bar.png")).setPosition(51,62))).i(this.ready=(new sa(a)).L(!1))).on(nf,this.H).on(Qe,function(n){Q.any(n)&&(a.audio.play("assets/general/click.wav"),b.H())});this.ua= 0;this.D=null;this.g=0;this.C=!1;this.l=this.P=null}function qh(a){mb.call(this,a);var b=this;this.V.i((new Df(a,1400,1E3,"assets/common/panel.png",.5,.5)).i(this.title=Lb(lb(wf(new nb(a,"assets/common/font.json","",.5,.5)).setPosition(700,550)),.9)).i(this.g=bb(new jb(a,550,250,[Q.Ka,Q.La,Q.Mc,Q.BACK,Q.Fe,Q.aj]),"assets/common/check.png",304,265,!1,40,30).setPosition(700,800).N(function(){b.fa()})));Rb(this,this.g)}function $l(a){Ya.call(this,a);var b=this;this.kd.setScale(1.15);Ta(lb(Lb(wf(this.title).R(60), .85)),1400,240,ab);this.V.i(this.na=new lg(a,3E3,2600,.5,.5));fd(this.g).i(this.login=(new jb(a,600,240,[Q.Oh])).i(Ta((new nb(a,"assets/common/font.json"," LOG IN",.5,.5)).setPosition(300,100),520,150,ab)).N(function(){a.platform.login().then(function(e){e&&window.ga&&ga("send","event","Kart Hooligans Logged In From Advice",0,a.da.version)})})).i(this.l=(new jb(a,600,240,[Q.jg])).i(Ta((new nb(a,"assets/common/font.json","GRANT",.5,.5)).setPosition(300,100),520,150,ab)).N(function(){a.platform.Zf().then(function(e){e&& window.ga&&ga("send","event","Kart Hooligans Friends Permitted From Advice",0,a.da.version)})})).i(this.Ee=bb(new jb(a,343,240,[Q.Of]),"assets/common/bell.png",237,258).N(function(){a.platform.Ee().then(function(e){e&&window.ga&&ga("send","event","Kart Hooligans Subscribed From Advice",0,a.da.version)})})).i(this.nf=bb(new jb(a,343,240,[Q.ue,Q.Cl]),"assets/common/favorites.png",287,294).N(function(){a.platform.nf().then(function(e){e&&window.ga&&ga("send","event","Kart Hooligans Added To Favorites From Advice", 0,a.da.version)})})).i(this.Vd=(new jb(a,600,240,[Q.Mh])).i(Ta((new nb(a,"assets/common/font.json","FOLLOW",.5,.5)).setPosition(300,100),520,150,ab)).N(function(){b.app.platform.Vd()})).i(this.fh=bb(new jb(a,343,240,[Q.ue,Q.Cl]),"assets/common/add.png",279,295).N(function(){a.platform.fh().then(function(e){e&&window.ga&&ga("send","event","Kart Hooligans Added To Home Screen From Advice",0,a.da.version)})})).i(this.share=bb(new jb(a,343,240,[Q.Of]),"assets/common/share.png",275,286).N(function(){a.platform.share()})).i(this.D= (new Wd(a,500,240,[Q.Ka,Q.La,Q.Mc,Q.Ge])).N(function(){b.fa()}));var c=this.na;c.clearColor=!1;var d=this.Va=c.Va;d.fe=!1;d.i(this.K=(new Ye(a)).ka(sp)).i((new Bi(a)).setScale(10,5));d=this.Ca=c.Ca;d.gd(30,c.width/c.height,1,50);mg(d,15,-.5);this.type=ak;this.u=!1;ha(this.W=[tp,am,bm,cm,dm,em,ov]);this.P=0;a.fd.on($g,function(){3<=++b.P&&up(b)});vb(this,this.login,this.l);vb(this,this.l,this.Ee);vb(this,this.Ee,this.nf);vb(this,this.nf,this.Vd);vb(this,this.Vd,this.fh);vb(this,this.fh,this.share); vb(this,this.share,this.D);Rb(this,this.D)}function up(a){a.u=!0;var b=a.app.platform;a=a.W;for(var c=0;cf;++f)e.contactEquationsPool.push(new Nh(null,null)); for(f=0;400>f;++f)e.frictionEquationsPool.push(new jj(null,null,void 0,void 0));e.addEventListener("beginContact",function(l){var n=l.bodyA;l=l.bodyB;var r=rh[n.id],w=rh[l.id];if(r&&w){var y=rv,A=zp,H=b.world.contacts;y.set(0,0,0);A.set(0,0,0);for(var I=0,O=0,S=H.length,R,ja,ka;Og){var r=n.time+=b,w=Math.abs(Math.sin(4*r));r=Math.abs(Math.cos(4*r));var y=a.Dn,A=a.na,H=a.Vn;A.color.r=A.color.b=H.opacity=y.opacity=1-.5*r;H.scale=y.scale=1-.05*r;r=a.En;y=a.xb;A=a.Wn;y.color.r= y.color.b=A.opacity=r.opacity=1-.5*w;A.scale=r.scale=1-.05*w}else w=a.na,r=a.xb,w.color.r=w.color.b=r.color.r=r.color.b=1;a.left.x=-700*Eb(1-e);w=a.width;a.right.x=w+700*Eb(1-e);r=a.wb=Da(a.wb+2*(d.state!==Hd||n.Tb||n.state===Ci?-b:b),0,1);a.Nn.x=w-130+700*Eb(1-r);a.top.y=-400*Eb(1-e)*(n.Tb?qd(f):Eb(f));a.Od.y=a.height+600*Eb(1-e)*(n.Tb?qd(g):Eb(g));a.ja.text=d.ja;a.Rc.text=Math.ceil(d.Rc);e=540;f=d.Uc;a.Mn.width=20+f/d.Ci*230;g=a.kd=Da(a.kd+4*(0=a.H&&0===a.g&&(a.g=1);a.rn.text=Math.max(Math.floor(a.H-e),0);0=(a.g-=1.5*b)&&(a.g=0),.5=a.g&&NO(a));f=a.kf;g=f.visible?Cb(Math.abs(2*a.g-1)):0;f.x=300-583*g;e=a.Yb;f=f.y+(370*g+30);for(g=0;gf.opacity?f.Tk():f.zl();f.setPosition((.5*e.x+.5)*a.width,(1-(.5*e.y+.5))*a.height-300).update(c);(c=l.sa.yg())&&a.Sg===c?1<(a.C+=3*b)&&(a.C=1):0>(a.C-=3*b)&&(a.C=0,(a.Sg=c)?(a.Un.fc=c.text,hb(a.dj,1,c.target),a.ej.value=uh(c),a.J.visible=!0):a.J.visible=!1);b=a.J;b.visible&&(c=a.Sg,b.y=20-300*Eb(1-a.C),hb(a.dj,0,Math.floor(c.count)), a.ej.value=uh(c))}function NO(a){var b=a.app,c=a.nd;if($s(b.platform)){var d=a.P,e=Math.max(a.D,0);for(a.D=-1;ed){a.D=e;break}}}if(a.kf.visible=-1!==a.D){c=c[a.D];a.H=c.Pb();var g=a.lk,l=a.kk;g.visible=!0;l.visible=!1;var n=a.lf=c.yd;n&&(l.qb=b.oa.get(n,{Ga:1,crossOrigin:""},function(){a.lf===n&&(g.visible=!1,l.visible=!0)}))}else a.H=0}function $L(a){for(var b=vH,c=a.Qa,d=0;de;d={Ri:void 0},++e)d.Ri=new mm(a),d.Ri.o=!0,d.Ri.N(function(f){return function(){var g=a.B,l=f.Ri.Rg;l=l===g.yg()?"":l;g.rc("MT",l);g.A(wv)}}(d)),this.H.i(c[e]=d.Ri);this.i(this.l=(new sa(a,0,0,.5)).i(this.$=bb(new Wl(a,343,240,[Q.Xi]),"assets/common/home.png", 303,314).N(function(){a.$.show("browse","pause-mainmenu")})).i(this.g=(new Wd(a,500,240,[Q.Ka,Q.La,Q.Nf,Q.jg])).N(function(){b.fa()})).i(this.D=(new jb(a,343,240,[Q.Of,Q.$i])).N(function(){a.audio.Eg?a.audio.Qg?(Dn(a.audio),En(a.audio)):Dn(a.audio):En(a.audio)})));a.on(tj,function(){var f=a.play.B.state;!a.play.Pd||a.Nb.Pd||f!==Hd&&f!==Fi||(b.Pd?b.Tb=!0:b.show(),a.input.enable())});a.audio.on(Qn,function(){b.Vb(b.J)}).on(Rn,function(){b.Vb(b.J)});a.B.on(wv,function(){b.Vb(b.J)});for(d=0;d=f.ra?(xv(e,f.ra),a.audio.play("assets/general/buy.wav"),RO(b,f)):a.message.Yj("NOT ENOUGH COINS"))})).i(this.sa=(new md(a,550,240,[Q.Ka,Q.La])).N(function(){pm(a.Na).sa.show()})).i(this.Hc=(new md(a,550,240)).i(this.Lc= (new Xj(a)).setPosition(275,100).setScale(.5))).i(this.D=(new Wd(a,550,240,[Q.Ka,Q.La])).N(function(){b.play()})).i(this.Ba=(new md(a,550,240,[Q.Ka,Q.La])).i((new Ea(a,600,600,"assets/common/point.png",.5,.5)).setPosition(275,-20).setColor(1325400064)).i(this.Od=(new xf(a,500,600,.5,.5)).setPosition(275,-20)).i(this.Zc=Ta(new nb(a,"assets/common/digits.json","%0/%1",.5,.5),450,100,ab).setPosition(275,140)).N(function(){var e=pm(a.Na),f=a.Na;f.mode=b.mode=Mc;f.scrollTo(Ze[e.Ba].box,!1)})).i(this.select= bb(new md(a,550,240,[Q.Ka,Q.La]),"assets/common/check.png",304,265,!1,30,20).N(function(){var e=a.B,f=a.Na,g=pm(f);switch(f.mode){case Sb:Cv(e,g.name);break;case wc:Dv(e,g.name);break;case Mb:Fp(e,g.name)}})).i(this.done=bb(new md(a,550,240,[Q.Ka,Q.La]),"assets/common/check.png",304,265,!1,30,20)).i(this.xb=bb(new md(a,550,240,[Q.Ka,Q.La]),"assets/common/close.png",268,243,!1,30,20).N(function(){switch(a.Na.mode){case Mb:Fp(a.B,"")}})).i(this.notify=bb(new md(a,550,240,[Q.Ka,Q.La]),"assets/common/bell.png", 237,258).N(function(){a.platform.Ee().then(function(e){e&&window.ga&&ga("send","event","Kart Hooligans Subscribed From Shop",0,a.da.version)})})).i(this.l=(new lv(a,430,240,[Q.$i])).N(function(){var e=a.Na;b.mode=e.mode=(e.mode+1)%zv;Ev(b);b.l.effect&&e.scrollTo(gm(e),!0,!0)}));var c=this.buttons=[this.$,this.K,this.D,this.Ba,this.sa,this.notify,this.select,this.xb,this.Hc,this.done,this.l];this.mode=Sb;for(var d=0;db.bl&&a.B.kc("BS",Math.max(0,e))});vb(this,this.share,this.u);Rb(this,this.u)}function kk(a){Ya.call(this,a);var b=this;bd(gd(this.title,"SCORE: %0"),1200);this.V.i(this.mf=(new lg(a,2600,2600,.5,.5)).R(-200)).i(this.lf=fd((new sa(a)).setPosition(50,360)).i((new sa(a,550)).i(new yi(a,550,160)).i(this.exp=(new Af(a, 550,160)).setColor(4280332490)).i(this.Od=bd((new rb(a,"assets/common/font.json","%0/%1",.5,.5)).setPosition(320,80),350)).i((new Ea(a,298,297,"assets/common/star.png",.5,.5)).R(80).i(this.kf=Ta(new nb(a,"assets/common/digits.json","x%0",.5,.5),150,130,ab).setPosition(170,140)))).i((new sa(a,550)).i(new yi(a,550,160)).i(this.ja=bd((new rb(a,"assets/common/font.json","%0",.5,.5)).setPosition(320,80),350)).i((new Ea(a,265,276,"assets/common/coin.png",.5,.5)).R(80))));fd(this.g).i(this.l=bb(new jb(a, 400,240,[Q.Kh,Q.ah,Q.ue]),"assets/common/video.png",248,304,!1,-30,-40).i(this.Zc=Ta(new rb(a,"assets/common/digits.json","%0",.5,.5),300,100,ab).setPosition(200,150)).N(function(){var e=b.na;b.na=null;e&&e()}).on(Kj,function(e){!e&&b.m===b.l&&b.Ob(b.u)})).i(this.u=(new Wd(a,500,240,[Q.Ka,Q.La,Q.Nf,Q.jg])).N(function(){var e=b.app;vh(e,function(){e.play.pb()});b.fa()})).i(this.$=bb(new Wl(a,343,240,[Q.Xi]),"assets/common/home.png",303,314).N(function(){a.$.show("browse","score-mainmenu")}));this.buttons= [this.$,this.l,this.u];var c=this.mf;c.clearColor=!1;var d=this.Va=c.Va;d.i(this.wb=(new Ye(a)).ka(HH)).i((new Bi(a)).setScale(10,5));d.fe=!1;(this.Ca=c.Ca).gd(30,c.width/c.height,1,50);this.Cc=this.D=this.Lc=this.P=this.W=this.K=this.xb=this.time=0;this.na=null;a.play.on(bk,function(){b.xb=a.B.Aa("E",0);b.K=0;b.W=0;b.P=0}).on(sh,function(){var e=a.play.B;e.ja>b.K&&(Ip(a.B,e.ja-b.K),b.K=e.ja);e.Mg>b.W&&(a.B.ye("PT",Math.floor(e.Mg-b.W)),b.W=e.Mg);e=Math.floor(e.exp);e>b.P&&(a.B.ye("E",e-b.P,0),b.P= e)});vb(this,this.$,this.l);vb(this,this.l,this.u);Rb(this,this.u)}function Jp(a){Ya.call(this,a);var b=this;ee(this.ua,this.P=(new sa(a)).i((new Af(a,1400,186,.5)).R(70).setColor(fc)).i(Ta((new nb(a,"assets/common/font.json","LOADING ISSUE",.5,.5)).setPosition(0,196),1300,90,ab)),1);this.V.i(this.effect=(new oh(a)).R(50));fd(this.g).i(this.share=bb(new jb(a,343,240,[Q.Of]),"assets/common/share.png",275,286).N(function(){var c=a.locale,d=b.l,e=b.K;e.value=d.storage;a.platform.share(c.ma("I've just unlocked %0!").replace("%0", c.ma(d.name,"_share")),void 0,void 0,e)})).i(this.D=(new Wd(a,500,240,[Q.Ka,Q.La,Q.Mc,Q.Ge])).N(function(){ik(a.Na).isLoaded()&&a.B.Md(b.l);b.fa()}));this.l=null;this.u=0;this.K={type:Gv,value:null};vb(this,this.share,this.D);Rb(this,this.D)}function UO(a){function b(e){if(!om(c,e.name))if(e.sa)e.sa.Wk(e)||(d=d||e);else if(e.Ba){var f=Ze[e.Ba];c.Qa(f.name)>=f.count&&(d=d||e)}}var c=a.app.B,d=null;rm.forEach(b);sm.forEach(b);Gi.forEach(b);return d}function VO(a){switch(a){case 1:return"_female";case 2:return"_neuter"; case 3:return"_plural";default:return""}}function Kp(a){Ya.call(this,a);var b=this;this.V.i(this.effect=(new oh(a)).R(50)).i(this.D=new lg(a,1800,1600,.5,.5));fd(this.g).i(this.share=bb(new jb(a,343,240,[Q.Of]),"assets/common/share.png",275,286).N(function(){var e=b.K,f=e.value="x"+b.level;a.platform.share(a.locale.ma("I've just unlocked %0!").replace("%0",f),void 0,void 0,e)})).i(this.l=(new Wd(a,500,240,[Q.Ka,Q.La,Q.Mc,Q.Ge])).N(function(){b.fa()}));var c=this.D;c.clearColor=!1;var d=this.Va=c.Va; d.fe=!1;d.i(this.P=(new Oa(a,"assets/general/star.mdl",oH)).setScale(.8).i((new ze(a,this.u=Ta(lb(new rb(a,"assets/common/digits.json","x%0",.5,.5)),200,170,ab).setScale(.01),(new Fb).ya(Dc).Da(vi).td(-1,-10).ab(!1))).Ra(.313).I(-90,0,90)));d=this.Ca=c.Ca;d.gd(30,c.width/c.height,1,50);mg(d,10,-.5);this.time=0;this.level=1;this.K={type:Gv,value:null};vb(this,this.share,this.l);Rb(this,this.l)}function WO(a){a=a.app.B;return Hi(a)!==a.Aa("L",1)}function Hv(a){Ya.call(this,a);var b=this;this.top.i(this.ih= (new rp(a,450,150)).setPosition(290,-60).i(this.ja=Lb(Ta(lb(new rb(a,"assets/common/font.json"," %0",.5,.5)),400,130,ab).setPosition(225,75),.8)));ee(this,this.V,0);fd(this.g).i(this.$=bb(new Wl(a,343,240,[Q.Mc,Q.BACK,Q.Fe,Q.Kf,Q.Xi]),"assets/common/home.png",303,314).N(function(){b.fa()})).i(this.Mf=(new md(a,500,240,[Q.jg,Q.Oh,Q.Dl,Q.Ka,Q.La])).i(this.Rf=Ta(new nb(a,"assets/common/font.json","%0",.5,.5),420,150,ab).setPosition(250,100)).i(this.eh=Ta(new nb(a,"assets/common/digits.json","%0", .5,.5),300,100,ab).setPosition(250,150))).i(this.Yg=(new Wd(a,500,240,[Q.jg,Q.Oh,Q.Dl,Q.Ka,Q.La])).N(function(){vh(b.app,function(){b.app.play.pb()})})).i(this.mode=(new lv(a,380,240,[Q.$i])).N(function(){IH(b,Lp(b)+1)}));this.l=[];this.list=[];this.u=null;this.D=function(c,d){d&&b.Me()};a.platform.on(qf,this.Me.bind(this));a.B.on(wv,this.Nm.bind(this));vb(this,this.$,this.Mf);vb(this,this.Mf,this.mode);Rb(this,this.$)}function XO(a){a=a.list;for(var b=0;bb?b=d.length-1:b>=d.length&&(b=0);for(var e=d[b],f=0;fd;++d){var e=new mm(a);e.ka(Zb);this.i(c[d]=e)}this.g=null;this.m=0;this.o=function(l,n){n&&(l=Nv(b),b.m+1===l.length?(a.B.ye("CL"),a.B.kc("CI",0)):a.B.ye("CI"))};c=0;for(d=1;c=wh[b].ra}function ie(a){a=a.ma("H","MAX");return Ei[ok[a]||a]||Ei.MAX}function Dv(a,b){void 0!==b&&a.rc("H",ke[b]||b);a.A(bP);a.A(im)}function Ff(a){a=a.ma("K","TURBO");return pk[ok[a]||a]||pk.TURBO}function Cv(a,b){void 0!==b&&a.rc("K",ke[b]||b);a.A(cP);a.A(im)}function Gf(a){return(a=a.ma("D",""))?wh[ok[a]||a]:null}function Fp(a,b){void 0!==b&& a.rc("D",ke[b]||b);a.A(dP);a.A(im)}function om(a,b){return a.nh(ke[b]||b,!1)}function TO(a,b){a.unlock(b);a.Md(b)}function Hi(a,b){b=void 0===b?a.Aa("E",0):b;return Math.floor(1+Math.sqrt(Math.max(b/100-1,0)))}function qk(a,b){b=void 0===b?Hi(a):b;return 1===b?0:100*Math.pow(b-1,2)+100}function SO(a,b){a.ye(ke[b]||b)}function dk(a,b){b=b.Qa;if(!b)return 0;for(var c=0,d=0;de)c=e%60,e=Math.floor(e/60)+":"+(10>c?"0"+c:c),d?hb(bh(b,a.locale.ma(d)),0,e):bh(b,e);else if(86400>e){c=Math.floor(e/60/60);e-=3600*c;var f=Math.floor(e/60);e%=60;e=c+":"+(10>f?"0"+f:f)+":"+(10>e?"0"+e:e);d?hb(bh(b,a.locale.ma(d)),0,e):bh(b,e)}else d=Math.floor(e/24/60/60),hb(bh(b,In(a.locale,d,c)),0,d)}function vh(a,b){var c=null,d=null,e=null,f=null, g=null;Zs(a.platform)?c=a.platform.ol():d=(e=XO(a.sa))?JH(a.tl,e):WO(a.l)?a.l.show():KO(a.o)?a.o.show():!(f=UO(a.Ug))||f.Ba&&-1!==a.play.B.Qa.indexOf(Ze[f.Ba])?0
Please refresh the page. If you see this screen again, report it to us

');a.childNodes.length;)n.appendChild(a.childNodes[0]);if(a=document.getElementById("submit"))a.onclick=function(){var w=WB.join("\n");try{var y=JSON.stringify(window.localStorage);w+="\n"+y}catch(A){}Qb("https://gemioli.com/backend/support.php", "POST",{subject:"Kart Hooligans Error Report",message:w},0).then(function(){document.getElementById("report").style.display="none";document.getElementById("thanks").style.display="block"},function(){alert(r("Failed to send the report. Please try again later."))})}}}var Xc=qK(rK());tK();wK();xK();var yK="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},tn="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype|| a==Object.prototype)return a;a[b]=c.value;return a},Db=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b>>0)+"_",e=0;return b});K("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator"); for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;cc&&(c=Math.max(0,e+c));if(null==d||d>e)d=e;d=Number(d);0>d&&(d=Math.max(0,e+d));for(c=Number(c||0);cb?-c:c}});var Ln="undefined"!==typeof window&&window.performance&&window.performance.now?window.performance:Date,OC="undefined"!==typeof window?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return window.setTimeout(a,1E3/60)}:null,jP="undefined"!==typeof window? window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(a){window.clearTimeout(a)}:null,gC="undefined"!==typeof window?window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext:null,Rp="undefined"!==typeof document?void 0!==document.hidden?"visibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0!==document.mozHidden? "mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":null:null;if("undefined"!==typeof document){var Sp=document.documentElement;var $H=Sp.requestFullscreen||Sp.webkitRequestFullscreen||Sp.mozRequestFullScreen||Sp.msRequestFullscreen}else $H=null;var Kn=$H,LK="undefined"!==typeof document?document.exitFullscreen||document.webkitExitFullscreen||document.mozCancelFullScreen||document.msExitFullscreen:null,kP="undefined"!==typeof document?document.fullscreenEnabled||document.webkitFullscreenEnabled|| document.mozFullScreenEnabled||document.msFullscreenEnabled:null;if("undefined"!==typeof document){var Tp=document.documentElement;var aI=void 0!==Tp.requestFullscreen?"fullscreenchange":void 0!==Tp.webkitRequestFullscreen?"webkitfullscreenchange":void 0!==Tp.mozRequestFullScreen?"mozfullscreenchange":void 0!==Tp.msRequestFullscreen?"MSFullscreenChange":null}else aI=null;var Up=aI,mc=(Object.assign?Object.assign:function(a){var b=P.apply(1,arguments);if(void 0===a||null===a)throw Error("Assign got null object."); for(var c=Object(a),d=0,e=b.length,f;d>16&255):64===e?String.fromCharCode(b>>16&255,b>>8&255): String.fromCharCode(b>>16&255,b>>8&255,b&255);return c},hL="undefined"!==typeof atob?btoa.bind(window):function(a){a=String(a);for(var b,c,d,e="",f=a.length,g=f%3,l=0;l>18&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b>>12&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b>>6&63)+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b&63);return g?e.slice(0,g-3)+"===".substring(g):e},Q={Fe:8,qn:9,Ka:13,pn:16,Tm:17,Rm:18,kn:19,ho:19,Sm:20,Mc:27,La:32,Wo:33,Vo:34,po:35,uo:36,Zg:37,Sh:38,$g:39,Lh:40,ln:44,vo:45,no:46,Ko:48,Lo:49,Mo:50,No:51,Oo:52,Po:53,Qo:54,Ro:55,So:56,To:57,ue:65,Kf:66,Ge:67,Kh:68,E:69,Mh:70,jg:71,Xi:72,Dl:73,wo:74,zo:75,Oh:76,$i:77,jk:78,aj:79,Nf:80,Q:81,mn:82,Of:83,Rh:84,ap:85,ah:86,bp:87,Nl:88,Ol:89,cp:90,Ao:96,Bo:97,Co:98,Do:99,Eo:100, Fo:101,Go:102,Ho:103,Io:104,Jo:105,Cl:107,$o:109,mo:110,oo:111,jn:144,nn:145,Yo:186,qo:187,ko:188,lo:189,Xo:190,ro:191,so:192,Uo:219,fo:220,jo:221,Zo:222,BACK:461};Q.gp=function(){var a={},b;for(b in Q)a[Q[b]]=!0;return function(c){return!!a[c]}}();Q.any=function(){var a={},b;for(b in Q)a[Q[b]]=!0;a[Q.qn]=a[Q.pn]=a[Q.Tm]=a[Q.Rm]=a[Q.kn]=a[Q.Sm]=a[Q.ln]=a[Q.jn]=a[Q.nn]=!1;return function(c){return!!a[c]}}();var AK=/^(\-|\+)?([0-9]+|Infinity)$/,BK=/^(\-|\+)?([0-9]+(\.[0-9]+)?|Infinity)$/,le=2*Math.PI, lP=1/(2*Math.PI),Ki=.5*Math.PI,cg=Math.PI/180,rl=180/Math.PI;var p=kb.prototype;p.set=function(a,b){this.x=a;this.y=b;return this};p.Ra=function(a){this.x=a;return this};p.R=function(a){this.y=a;return this};p.hg=function(a){this.x=a[0];this.y=a[1]};p.clone=function(){return new kb(this.x,this.y)};p.copy=function(a){this.x=a.x;this.y=a.y;return this};p.Dk=function(a,b){var c=void 0===c?this:c;c.x=Math.max(a.x,Math.min(b.x,this.x));c.y=Math.max(a.y,Math.min(b.y,this.y));return c};p.add=function(a, b){b=void 0===b?this:b;b.x=this.x+a.x;b.y=this.y+a.y;return b};p.sub=function(a,b){b=void 0===b?this:b;b.x=this.x-a.x;b.y=this.y-a.y;return b};p.mb=function(a,b){b=void 0===b?this:b;b.x=this.x*a.x;b.y=this.y*a.y;return b};p.dot=function(a){return this.x*a.x+this.y*a.y};p.dd=function(a,b,c){c=void 0===c?this:c;c.x=(a.x-this.x)*b+this.x;c.y=(a.y-this.y)*b+this.y;return c};p.scale=function(a,b){b=void 0===b?this:b;b.x=this.x*a;b.y=this.y*a;return b};p.Fc=function(a){a=void 0===a?this:a;a.x=-this.x;a.y= -this.y;return a};p.translate=function(a,b){this.x+=a;this.y+=b;return this};p.max=function(a,b){b=void 0===b?this:b;b.x=Math.max(this.x,a.x);b.y=Math.max(this.y,a.y);return b};p.min=function(a,b){b=void 0===b?this:b;b.x=Math.min(this.x,a.x);b.y=Math.min(this.y,a.y);return b};p.normalize=function(){var a=Math.sqrt(this.x*this.x+this.y*this.y);0===a?this.x=this.y=0:(a=1/a,this.x*=a,this.y*=a);return this};p.$b=function(a,b){var c=b.x-a.x;a=b.y-a.y;b=Math.sqrt(c*c+a*a);b=0===b?0:1/b;this.x=-a*b;this.y= c*b;return this};p.distance=function(a){var b=a.x-this.x;a=a.y-this.y;return Math.sqrt(b*b+a*a)};p.De=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};p.random=function(){this.x=Math.random();this.y=Math.random();return this};p.round=function(a){a=void 0===a?this:a;a.x=Math.round(this.x);a.y=Math.round(this.y);return a};p.floor=function(a){a=void 0===a?this:a;a.x=Math.floor(this.x);a.y=Math.floor(this.y);return a};p.ceil=function(a){a=void 0===a?this:a;a.x=Math.ceil(this.x);a.y=Math.ceil(this.y); return a};p.Ha=function(a){return this.x===a.x&&this.y===a.y};p.toString=function(){return"["+this.x+", "+this.y+"]"};Db.Object.defineProperties(kb.prototype,{size:{configurable:!0,enumerable:!0,get:function(){return 2}},Fd:{configurable:!0,enumerable:!0,get:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},Ff:{configurable:!0,enumerable:!0,get:function(){return this.x*this.x+this.y*this.y}}});p=E.prototype;p.set=function(a,b,c){this.x=a;this.y=b;this.z=c;return this};p.Ra=function(a){this.x= a;return this};p.R=function(a){this.y=a;return this};p.be=function(a){this.z=a;return this};p.hg=function(a){this.x=a[0];this.y=a[1];this.z=a[2]};p.clone=function(){return new E(this.x,this.y,this.z)};p.copy=function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this};p.Dk=function(a,b){var c=void 0===c?this:c;c.x=Math.max(a.x,Math.min(b.x,this.x));c.y=Math.max(a.y,Math.min(b.y,this.y));c.z=Math.max(a.z,Math.min(b.z,this.z));return c};p.add=function(a,b){b=void 0===b?this:b;b.x=this.x+a.x;b.y=this.y+ a.y;b.z=this.z+a.z;return b};p.sub=function(a,b){b=void 0===b?this:b;b.x=this.x-a.x;b.y=this.y-a.y;b.z=this.z-a.z;return b};p.mb=function(a,b){b=void 0===b?this:b;b.x=this.x*a.x;b.y=this.y*a.y;b.z=this.z*a.z;return b};p.dot=function(a){return this.x*a.x+this.y*a.y+this.z*a.z};p.Fa=function(a,b){b=void 0===b?this:b;var c=this.x,d=this.y,e=this.z,f=a.x,g=a.y;a=a.z;b.x=d*a-e*g;b.y=e*f-c*a;b.z=c*g-d*f;return b};p.dd=function(a,b,c){c=void 0===c?this:c;c.x=(a.x-this.x)*b+this.x;c.y=(a.y-this.y)*b+this.y; c.z=(a.z-this.z)*b+this.z;return c};p.scale=function(a,b){b=void 0===b?this:b;b.x=this.x*a;b.y=this.y*a;b.z=this.z*a;return b};p.Fc=function(a){a=void 0===a?this:a;a.x=-this.x;a.y=-this.y;a.z=-this.z;return a};p.translate=function(a,b,c){this.x+=a;this.y+=b;this.z+=c;return this};p.max=function(a,b){b=void 0===b?this:b;b.x=Math.max(this.x,a.x);b.y=Math.max(this.y,a.y);b.z=Math.max(this.z,a.z);return b};p.min=function(a,b){b=void 0===b?this:b;b.x=Math.min(this.x,a.x);b.y=Math.min(this.y,a.y);b.z=Math.min(this.z, a.z);return b};p.normalize=function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);0===a?this.x=this.y=this.z=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a);return this};p.distance=function(a){var b=a.x-this.x,c=a.y-this.y;a=a.z-this.z;return Math.sqrt(b*b+c*c+a*a)};p.De=function(a){var b=a.x-this.x,c=a.y-this.y;a=a.z-this.z;return b*b+c*c+a*a};p.random=function(){this.x=Math.random();this.y=Math.random();this.z=Math.random();return this};p.round=function(a){a=void 0===a?this:a;a.x=Math.round(this.x); a.y=Math.round(this.y);a.z=Math.round(this.z);return a};p.floor=function(a){a=void 0===a?this:a;a.x=Math.floor(this.x);a.y=Math.floor(this.y);a.z=Math.floor(this.z);return a};p.ceil=function(a){a=void 0===a?this:a;a.x=Math.ceil(this.x);a.y=Math.ceil(this.y);a.z=Math.ceil(this.z);return a};p.Ha=function(a){return this.x===a.x&&this.y===a.y&&this.z===a.z};p.toString=function(){return"["+this.x+", "+this.y+", "+this.z+"]"};Db.Object.defineProperties(E.prototype,{size:{configurable:!0,enumerable:!0,get:function(){return 3}}, Fd:{configurable:!0,enumerable:!0,get:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},Ff:{configurable:!0,enumerable:!0,get:function(){return this.x*this.x+this.y*this.y+this.z*this.z}}});var Zk=new E(0,0,0),ss=new E(1,1,1),Ce=new E(1,0,0),hp=new E(0,1,0),td=new E(0,0,1),Wu=new E(0,-1,0);p=dc.prototype;p.set=function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this};p.Ra=function(a){this.x=a;return this};p.R=function(a){this.y=a;return this};p.be=function(a){this.z= a;return this};p.hg=function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3]};p.clone=function(){return new dc(this.x,this.y,this.z,this.w)};p.copy=function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this};p.Dk=function(a,b){var c=void 0===c?this:c;c.x=Math.max(a.x,Math.min(b.x,this.x));c.y=Math.max(a.y,Math.min(b.y,this.y));c.z=Math.max(a.z,Math.min(b.z,this.z));c.w=Math.max(a.w,Math.min(b.w,this.w));return c};p.add=function(a,b){b=void 0===b?this:b;b.x=this.x+a.x;b.y=this.y+a.y;b.z= this.z+a.z;b.w=this.w+a.w;return b};p.sub=function(a,b){b=void 0===b?this:b;b.x=this.x-a.x;b.y=this.y-a.y;b.z=this.z-a.z;b.w=this.w-a.w;return b};p.mb=function(a,b){b=void 0===b?this:b;b.x=this.x*a.x;b.y=this.y*a.y;b.z=this.z*a.z;b.w=this.w*a.w;return b};p.dot=function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w};p.dd=function(a,b,c){c=void 0===c?this:c;c.x=(a.x-this.x)*b+this.x;c.y=(a.y-this.y)*b+this.y;c.z=(a.z-this.z)*b+this.z;c.w=(a.w-this.w)*b+this.w;return c};p.scale=function(a,b){b= void 0===b?this:b;b.x=this.x*a;b.y=this.y*a;b.z=this.z*a;b.w=this.w*a;return b};p.Fc=function(a){a=void 0===a?this:a;a.x=-this.x;a.y=-this.y;a.z=-this.z;a.w=-this.w;return a};p.translate=function(a,b,c,d){this.x+=a;this.y+=b;this.z+=c;this.w+=d;return this};p.max=function(a,b){b=void 0===b?this:b;b.x=Math.max(this.x,a.x);b.y=Math.max(this.y,a.y);b.z=Math.max(this.z,a.z);b.w=Math.max(this.w,a.w);return b};p.min=function(a,b){b=void 0===b?this:b;b.x=Math.min(this.x,a.x);b.y=Math.min(this.y,a.y);b.z= Math.min(this.z,a.z);b.w=Math.min(this.w,a.w);return b};p.normalize=function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.x=this.y=this.z=this.w=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this};p.distance=function(a){var b=a.x-this.x,c=a.y-this.y,d=a.z-this.z;a=a.w-this.w;return Math.sqrt(b*b+c*c+d*d+a*a)};p.De=function(a){var b=a.x-this.x,c=a.y-this.y,d=a.z-this.z;a=a.w-this.w;return b*b+c*c+d*d+a*a};p.random=function(){this.x=Math.random(); this.y=Math.random();this.z=Math.random();this.w=Math.random();return this};p.round=function(a){a=void 0===a?this:a;a.x=Math.round(this.x);a.y=Math.round(this.y);a.z=Math.round(this.z);a.w=Math.round(this.w);return a};p.floor=function(a){a=void 0===a?this:a;a.x=Math.floor(this.x);a.y=Math.floor(this.y);a.z=Math.floor(this.z);a.w=Math.floor(this.w);return a};p.ceil=function(a){a=void 0===a?this:a;a.x=Math.ceil(this.x);a.y=Math.ceil(this.y);a.z=Math.ceil(this.z);a.w=Math.ceil(this.w);return a};p.Ha= function(a){return this.x===a.x&&this.y===a.y&&this.z===a.z&&this.w===a.w};p.toString=function(){return"["+this.x+", "+this.y+", "+this.z+", "+this.w+"]"};Db.Object.defineProperties(dc.prototype,{size:{configurable:!0,enumerable:!0,get:function(){return 4}},Fd:{configurable:!0,enumerable:!0,get:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},Ff:{configurable:!0,enumerable:!0,get:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}}});p= Oe.prototype;p.copy=function(a){this.a=a.a;this.b=a.b;this.c=a.c;this.d=a.d;this.ub=a.ub;this.vb=a.vb;return this};p.clone=function(){return new Oe(this.a,this.b,this.c,this.d,this.ub,this.vb)};p.set=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.d=d;this.ub=e;this.vb=f;return this};p.Zl=function(a,b,c){var d=NaN*cg,e=Math.sin(d),f=Math.cos(d);d=c*f;c*=e;e*=NaN;f*=NaN;return this.set(d,c,e,f,a-NaN*d-NaN*e,b-NaN*c-NaN*f)};p.mb=function(a,b){b=void 0===b?this:b;var c=this.a,d=this.b,e=this.c, f=this.d,g=this.ub,l=this.vb,n=a.a,r=a.b,w=a.c,y=a.d,A=a.ub;a=a.vb;b.a=c*n+e*r;b.b=d*n+f*r;b.c=c*w+e*y;b.d=d*w+f*y;b.ub=c*A+e*a+g;b.vb=d*A+f*a+l;return b};p.Fc=function(a){a=void 0===a?this:a;var b=this.a*this.d-this.b*this.c;if(0===b)a.a=a.b=a.c=a.d=0,a.ub=-this.ub,a.vb=-this.vb;else{var c=this.a,d=this.b,e=this.c,f=this.d,g=this.ub,l=this.vb;b=1/b;a.a=f*b;a.b=-d*b;a.c=-e*b;a.d=c*b;a.ub=-a.a*g-a.c*l;a.vb=-a.b*g-a.d*l}return a};p.transformPoint=function(a,b){b=void 0===b?a:b;var c=a.x;a=a.y;b.x=c* this.a+a*this.c+this.ub;b.y=c*this.b+a*this.d+this.vb;return b};p.Gf=function(a,b){b=void 0===b?a:b;var c=a.x;a=a.y;b.x=c*this.a+a*this.c;b.y=c*this.b+a*this.d;return b};p.Ha=function(a){return this.a===a.a&&this.b===a.b&&this.c===a.c&&this.d===a.d&&this.ub===a.ub&&this.vb===a.vb};p.toString=function(){return"["+this.a+", "+this.b+", "+this.c+", "+this.d+", "+this.ub+", "+this.vb+"]"};p=Tb.prototype;p.hg=function(a){this.elements.set(a)};p.copy=function(a){this.elements.set(a.elements);return this}; p.clone=function(){return(new Tb).copy(this)};p.add=function(a,b){b=void 0===b?this:b;var c=0,d=this.elements;a=a.elements;for(var e=b.elements;16>c;++c)e[c]=d[c]+a[c];return b};p.sub=function(a,b){b=void 0===b?this:b;var c=0,d=this.elements;a=a.elements;for(var e=b.elements;16>c;++c)e[c]=d[c]-a[c];return b};p.scale=function(a,b){b=void 0===b?this:b;for(var c=0,d=this.elements,e=b.elements;16>c;++c)e[c]=d[c]*a;return b};p.mb=function(a,b){b=void 0===b?this:b;$B(this,a,b.elements,0);return b};p.Fc= function(a){a=void 0===a?this:a;var b=this.elements,c=a.elements,d=b[0],e=b[1],f=b[2],g=b[3],l=b[4],n=b[5],r=b[6],w=b[7],y=b[8],A=b[9],H=b[10],I=b[11],O=b[12],S=b[13],R=b[14];b=b[15];var ja=d*n-e*l,ka=d*r-f*l,ea=d*w-g*l,ma=e*r-f*n,pa=e*w-g*n,va=f*w-g*r,Ka=y*S-A*O,Aa=y*R-H*O,Fa=y*b-I*O,xa=A*R-H*S,Ja=A*b-I*S,La=H*b-I*R,Ha=ja*La-ka*Ja+ea*xa+ma*Fa-pa*Aa+va*Ka;0===Ha?c.set(gs.elements):(Ha=1/Ha,c[0]=(n*La-r*Ja+w*xa)*Ha,c[1]=(-e*La+f*Ja-g*xa)*Ha,c[2]=(S*va-R*pa+b*ma)*Ha,c[3]=(-A*va+H*pa-I*ma)*Ha,c[4]=(-l* La+r*Fa-w*Aa)*Ha,c[5]=(d*La-f*Fa+g*Aa)*Ha,c[6]=(-O*va+R*ea-b*ka)*Ha,c[7]=(y*va-H*ea+I*ka)*Ha,c[8]=(l*Ja-n*Fa+w*Ka)*Ha,c[9]=(-d*Ja+e*Fa-g*Ka)*Ha,c[10]=(O*pa-S*ea+b*ja)*Ha,c[11]=(-y*pa+A*ea-I*ja)*Ha,c[12]=(-l*xa+n*Aa-r*Ka)*Ha,c[13]=(d*xa-e*Aa+f*Ka)*Ha,c[14]=(-O*ma+S*ka-R*ja)*Ha,c[15]=(y*ma-A*ka+H*ja)*Ha);return a};p.Zl=function(a,b,c){var d=this.elements,e=b.x,f=b.y,g=b.z,l=b.w,n=e+e,r=f+f,w=g+g;b=e*n;var y=e*r;e*=w;var A=f*r;f*=w;g*=w;n*=l;r*=l;l*=w;w=c.x;var H=c.y;c=c.z;d[0]=(1-(A+g))*w;d[1]=(y+l)* w;d[2]=(e-r)*w;d[3]=0;d[4]=(y-l)*H;d[5]=(1-(b+g))*H;d[6]=(f+n)*H;d[7]=0;d[8]=(e+r)*c;d[9]=(f-n)*c;d[10]=(1-(b+A))*c;d[11]=0;d[12]=a.x;d[13]=a.y;d[14]=a.z;d[15]=1;return this};p.transformPoint=function(a,b){b=void 0===b?a:b;var c=a.x,d=a.y;a=a.z;var e=this.elements;b.x=e[0]*c+e[4]*d+e[8]*a+e[12];b.y=e[1]*c+e[5]*d+e[9]*a+e[13];b.z=e[2]*c+e[6]*d+e[10]*a+e[14];return b};p.Gf=function(a,b){b=void 0===b?a:b;var c=a.x,d=a.y;a=a.z;var e=this.elements;b.x=e[0]*c+e[4]*d+e[8]*a;b.y=e[1]*c+e[5]*d+e[9]*a;b.z= e[2]*c+e[6]*d+e[10]*a;return b};p.Tj=function(a,b,c,d,e,f){var g=this.elements;g[0]=2/(b-a);g[1]=0;g[2]=0;g[3]=0;g[4]=0;g[5]=2/(d-c);g[6]=0;g[7]=0;g[8]=0;g[9]=0;g[10]=-2/(f-e);g[11]=0;g[12]=-(b+a)/(b-a);g[13]=-(d+c)/(d-c);g[14]=-(f+e)/(f-e);g[15]=1;return this};p.gd=function(a,b,c,d){a=c*Math.tan(.5*a*cg);b*=a;return bC(this,-b,b,-a,a,c,d)};p.Cg=function(a,b,c){var d=this.elements;a.sub(b,Fe);b=Fe.Fd;0===b?Fe.set(0,0,1):Fe.scale(1/b);c.Fa(Fe,sg);b=sg.Fd;0===b?(Fe.x+=1E-4,c.Fa(Fe,sg),sg.normalize()): sg.scale(1/b);Fe.Fa(sg,Vp);d[0]=sg.x;d[1]=sg.y;d[2]=sg.z;d[3]=0;d[4]=Vp.x;d[5]=Vp.y;d[6]=Vp.z;d[7]=0;d[8]=Fe.x;d[9]=Fe.y;d[10]=Fe.z;d[11]=0;d[12]=a.x;d[13]=a.y;d[14]=a.z;d[15]=1;return this};p.Ra=function(a){var b=this.elements;b[0]=a.x;b[1]=a.y;b[2]=a.z;return this};p.R=function(a){var b=this.elements;b[4]=a.x;b[5]=a.y;b[6]=a.z;return this};p.be=function(a){var b=this.elements;b[8]=a.x;b[9]=a.y;b[10]=a.z;return this};p.Uj=function(a){var b=this.elements;b[0]=a.x;b[5]=a.y;b[10]=a.z};p.Dd=function(a){a= void 0===a?new Ic:a;var b=this.elements,c=b[0],d=b[1],e=b[2],f=b[4],g=b[5],l=b[6],n=b[8],r=b[9];b=b[10];var w=1/Math.sqrt(c*c+d*d+e*e),y=1/Math.sqrt(f*f+g*g+l*l),A=1/Math.sqrt(n*n+r*r+b*b);c*=w;d*=w;e*=w;f*=y;g*=y;l*=y;n*=A;r*=A;b*=A;w=c+g+b;0<=w?(c=Math.sqrt(w+1),a.w=.5*c,c=.5/c,a.x=(l-r)*c,a.y=(n-e)*c,a.z=(d-f)*c):c>g?c>b?(c=Math.sqrt(c-(g+b)+1),a.x=.5*c,c=.5/c,a.w=(l-r)*c,a.y=(d+f)*c,a.z=(e+n)*c):(c=Math.sqrt(b-(c+g)+1),a.z=.5*c,c=.5/c,a.w=(d-f)*c,a.x=(n+e)*c,a.y=(r+l)*c):g>b?(c=Math.sqrt(g-(b+ c)+1),a.y=.5*c,c=.5/c,a.w=(n-e)*c,a.z=(l+r)*c,a.x=(f+d)*c):(c=Math.sqrt(b-(c+g)+1),a.z=.5*c,c=.5/c,a.w=(d-f)*c,a.x=(n+e)*c,a.y=(r+l)*c);return a};p.Ha=function(a){var b=0,c=this.elements;for(a=a.elements;16>b;++b)if(c[b]!==a[b])return!1;return!0};p.toString=function(){for(var a="[",b=0,c=this.elements;16>b;++b)a+=c[b],a+=15===b?"":", ";return a+"]"};Db.Object.defineProperties(Tb.prototype,{size:{configurable:!0,enumerable:!0,get:function(){return 16}}});var mP=new Pd([1,0,0,0,0,1,0,0,0,0,1,0,0,0, 0,1]),nP=new Pd([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),gs=new Tb(mP);new Tb(nP);var sg=new E,Vp=new E,Fe=new E;p=Ic.prototype;p.set=function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this};p.hg=function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3]};p.clone=function(){return new Ic(this.x,this.y,this.z,this.w)};p.copy=function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this};p.mb=function(a,b){b=void 0===b?this:b;var c=this.x,d=this.y,e=this.z,f=this.w,g=a.x,l=a.y,n=a.z;a=a.w; b.x=c*a+f*g+d*n-e*l;b.y=d*a+f*l+e*g-c*n;b.z=e*a+f*n+c*l-d*g;b.w=f*a-c*g-d*l-e*n;return b};p.dd=function(a,b,c){c=void 0===c?this:c;var d=this.x,e=this.y,f=this.z,g=this.w;c.x=(a.x-d)*b+d;c.y=(a.y-e)*b+e;c.z=(a.z-f)*b+f;c.w=(a.w-g)*b+g;return c};p.jl=function(a){return this.I(a.x,a.y,a.z)};p.I=function(a,b,c){a*=cg;b*=cg;c*=cg;var d=Math.cos(.5*a),e=Math.cos(.5*b),f=Math.cos(.5*c);a=Math.sin(.5*a);b=Math.sin(.5*b);c=Math.sin(.5*c);this.x=a*e*f-d*b*c;this.y=d*b*f+a*e*c;this.z=d*e*c-a*b*f;this.w=d*e* f+a*b*c;return this};p.scale=function(a,b){b=void 0===b?this:b;b.x*=a;b.y*=a;b.z*=a;b.w*=a;return b};p.Fc=function(a){var b=a=void 0===a?this:a;b=void 0===b?this:b;b.x=-this.x;b.y=-this.y;b.z=-this.z;b.w=this.w;return a.normalize()};p.normalize=function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?(this.x=this.y=this.z=0,this.w=1):(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this};p.Gf=function(a,b){b=void 0===b?a:b;var c=a.x,d=a.y,e=a.z;a=this.x;var f= this.y,g=this.z,l=this.w,n=l*c+f*e-g*d,r=l*d+g*c-a*e,w=l*e+a*d-f*c;c=-a*c-f*d-g*e;b.x=n*l+c*-a+r*-g-w*-f;b.y=r*l+c*-f+w*-a-n*-g;b.z=w*l+c*-g+n*-f-r*-a;return b};p.pf=function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a.x=1-2*(c*c+d*d);a.y=2*(b*c+e*d);a.z=2*(b*d-e*c);return a};p.ci=function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a.x=2*(b*c-e*d);a.y=1-2*(b*b+d*d);a.z=2*(c*d+e*b);return a};p.pg=function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a.x=2*(b*d+e*c);a.y=2*(c*d-e*b);a.z=1-2*(b*b+c*c); return a};p.Ha=function(a){return this.x===a.x&&this.y===a.y&&this.z===a.z&&this.w===a.w};p.toString=function(){return"["+this.x+", "+this.y+", "+this.z+", "+this.w+"]"};Db.Object.defineProperties(Ic.prototype,{Fd:{configurable:!0,enumerable:!0,get:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},Ff:{configurable:!0,enumerable:!0,get:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}}});var $k=new Ic(0,0,0,1);new Tb;u(kc,dc);kc.prototype.clone= function(){return new kc(this.x,this.y,this.z,this.w)};Db.Object.defineProperties(kc.prototype,{r:{configurable:!0,enumerable:!0,get:function(){return this.x},set:function(a){this.x=a}},mi:{configurable:!0,enumerable:!0,get:function(){return this.y},set:function(a){this.y=a}},b:{configurable:!0,enumerable:!0,get:function(){return this.z},set:function(a){this.z=a}},a:{configurable:!0,enumerable:!0,get:function(){return this.w},set:function(a){this.w=a}}});var oP=new kc(0,0,0,1),pP=new kc(0,1,0,1), qP=new kc(1,0,0,1),kp=new kc(1,1,1,1),av=new kc(1,.92,.016,1);u(Xb,dc);Xb.prototype.Eb=function(a,b){this.z=a;this.w=b;return this};Xb.prototype.clone=function(){return new Xb(this.x,this.y,this.z,this.w)};Xb.prototype.contains=function(a){return this.x<=a.x&&a.x<=this.x+this.z&&this.y<=a.y&&a.y<=this.y+this.w};Db.Object.defineProperties(Xb.prototype,{width:{configurable:!0,enumerable:!0,get:function(){return this.z},set:function(a){this.z=a}},height:{configurable:!0,enumerable:!0,get:function(){return this.w}, set:function(a){this.w=a}},left:{configurable:!0,enumerable:!0,get:function(){return this.x}},right:{configurable:!0,enumerable:!0,get:function(){return this.x+this.z}},top:{configurable:!0,enumerable:!0,get:function(){return this.y}},bottom:{configurable:!0,enumerable:!0,get:function(){return this.y+this.w}}});var rP=new Xb(0,0,1,1),wL=new Xb(.5,.5,0,0);p=qj.prototype;p.set=function(a,b,c,d,e,f){this.min.set(a,b,c);this.max.set(d,e,f);return this};p.clone=function(){var a=this.min,b=this.max;return new qj(a.x, a.y,a.z,b.x,b.y,b.z)};p.copy=function(a){this.min.copy(a.min);this.max.copy(a.max);return this};p.V=function(a){var b=this.min,c=this.max;a.x=.5*(b.x+c.x);a.y=.5*(b.y+c.y);a.z=.5*(b.z+c.z);return a};p.gi=function(a){var b=this.min,c=this.max;return a.xc.x||a.yc.y||a.zc.z?!1:!0};p.contains=function(a,b,c){var d=this.min,e=this.max;return ae.x||be.y||ce.z?!1:!0};p.bm=function(a,b,c){var d=is(this,Hb.set(a,b,c));d.x-=a;d.y-=b;d.z-=c;return d.Fd}; p.Ne=function(a){return is(this,a,Hb).sub(a).Fd};p.Vk=function(a){var b=a.$b,c=b.x,d=b.y;b=b.z;a=a.ea;var e=this.min,f=this.max;if(0=a};p.xi=function(a){var b=this.min,c=this.max,d=a.min;a=a.max;return c.xa.x||c.ya.y||c.za.z?!1:!0};p.ze=function(a){return a.gi(is(this,a.V,Hb))};p.$h=function(a,b){b=void 0===b?this:b;var c=this.min, d=c.x,e=c.y,f=c.z,g=this.max,l=g.x,n=g.y,r=g.z;c=b.min;g=b.max;a.transformPoint(Hb.set(d,e,f),Hb);c.copy(Hb);g.copy(Hb);a.transformPoint(Hb.set(d,e,r),Hb);c.min(Hb);g.max(Hb);a.transformPoint(Hb.set(d,n,f),Hb);c.min(Hb);g.max(Hb);a.transformPoint(Hb.set(d,n,r),Hb);c.min(Hb);g.max(Hb);a.transformPoint(Hb.set(l,e,f),Hb);c.min(Hb);g.max(Hb);a.transformPoint(Hb.set(l,e,r),Hb);c.min(Hb);g.max(Hb);a.transformPoint(Hb.set(l,n,f),Hb);c.min(Hb);g.max(Hb);a.transformPoint(Hb.set(l,n,r),Hb);c.min(Hb);g.max(Hb)}; p.translate=function(a,b,c){this.min.translate(a,b,c);this.max.translate(a,b,c);return this};p.Ha=function(a){return this.min.Ha(a.min)&&this.max.Ha(a.max)};p.toString=function(){var a=this.min,b=this.max;return"(min ["+a.x+", "+a.y+", "+a.z+"], max["+b.x+", "+b.y+", "+b.z+"])"};var Hb=new E;p=rj.prototype;p.set=function(a,b,c,d){this.V.set(a,b,c);this.radius=d;return this};p.hg=function(a){this.V.set(a[0],a[1],a[2]);this.radius=a[3]};p.clone=function(){return new rj(this.V.clone(),this.radius)}; p.copy=function(a){this.V.copy(a.V);this.radius=a.radius;return this};p.gi=function(a){return a.De(this.V)<=this.radius*this.radius};p.Ne=function(a){return a.distance(this.V)-this.radius};p.Vk=function(a){return Math.abs(a.Ne(this.V))<=this.radius};p.xi=function(a){return a.ze(this)};p.ze=function(a){var b=this.radius+a.radius;return this.V.De(a.V)<=b*b};p.$h=function(a,b){b=void 0===b?this:b;var c=sP.copy(this.V);a.transformPoint(c,b.V);c.x+=this.radius;a.transformPoint(c);b.radius=b.V.distance(c)}; p.Ha=function(a){return this.V.Ha(a.V)&&this.radius===a.radius};p.toString=function(){var a=this.V;return"["+a.x+", "+a.y+", "+a.z+", "+this.radius+"]"};var sP=new E;p=js.prototype;p.set=function(a,b,c,d,e,f){var g=this.Ce;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this};p.clone=function(){var a=this.Ce;return new js(a[0].clone(),a[1].clone(),a[2].clone(),a[3].clone(),a[4].clone(),a[5].clone())};p.copy=function(a){var b=this.Ce;a=a.Ce;b[0].copy(a[0]);b[1].copy(a[1]); b[2].copy(a[2]);b[3].copy(a[3]);b[4].copy(a[4]);b[5].copy(a[5]);return this};p.gi=function(a){for(var b=0,c=this.Ce;6>b;++b)if(0>c[b].Ne(a))return!1;return!0};p.xi=function(a){var b=a.min,c=b.x,d=b.y;b=b.z;var e=a.max;a=e.x;var f=e.y;e=e.z;for(var g=0,l=this.Ce,n,r;6>g;++g)if(n=l[g],r=n.$b,0>n.bm(0b;++b)if(c[b].Ne(a)>1,n=b[l].time,n<=a?(d=l,f=n):(e=l,g=n);var r,w;0>1,r=c[n].time,r<=a?(e=n,g=r):(f=n,l=r);a=(a-g)/(l-g);if(0=e.timeout&&Wf(this,e,f instanceof XMLHttpRequest?"loading timeout "+e.he.status+" ("+e.he.statusText+")":"loading timeout"):e.jj=Math.max(e.jj-a,0);if(0b&&(b=f.priority,c=0),f.priority===b&&f.he&&++c;for(d=0;6>=c&&d=e.jj){a=e;if(a.Km>=a.Ga){this.g= T(this.g,a);delete this.M[a.url];b=a.Xa+" "+(a.error||"loading issue unknown");if(a.bo)throw b;a.ac(a.url,b)}else++a.Km,a.time=0,a.jj=a.$c,b=(-1===a.Xa.indexOf("://")&&"/"!==a.Xa[0]?"./":"")+a.Xa,"js"===a.responseType?(c=a.he=document.createElement("script"),c.addEventListener("load",this.O,!1),c.addEventListener("error",this.C,!1),c.addEventListener("abort",this.u,!1),this.j.set(c,a),c.async=1,c.type="text/javascript",c.src=b,(document.head||document.body).appendChild(c)):(c=a.he=new XMLHttpRequest, c.open("GET",b+(this.version&&void 0===a.crossOrigin?(-1===a.Xa.indexOf("?")?"?v=":"&v=")+this.version:""),!0),c.onreadystatechange=this.D,c.crossOrigin=a.crossOrigin,"json"!==a.responseType&&(c.responseType=a.responseType),this.j.set(c,a),c.send(null));break}++d}}};Db.Object.defineProperties(ns.prototype,{count:{configurable:!0,enumerable:!0,get:function(){return this.g.length+this.Z},set:function(a){this.Z=Math.max(0,a-this.g.length)}}});p=dC.prototype;p.set=function(a,b){var c=this.oa,d=c[a];c[a]= b;d&&(this.app.da.remove(a),d.dispose());return b};p.get=function(a,b,c,d){"function"===typeof b&&(d=c,c=b,b=void 0);var e=this.oa,f=e[a];f||(f=e[a]=new Pe,f.state=db);if(!(e=f.state===db)&&(e=b&&b.reload)){a:{e=this.g;for(l in e){var g=e[l];if(-1!==g.urls.indexOf(a)&&-1===g.wm.indexOf(a)){var l=!0;break a}}l=!1}e=!l}if(e){b=mc(f.options,b);f.state=rc;l=this.app;e=l.X;var n=this.j&&b.Pc?b.Pc:ol;g=b.Xa||a;var r="blob";switch(n){case ng:case ui:e.WEBGL_compressed_texture_pvrtc?(g+=".pvr.txt",r="arraybuffer"): e.WEBGL_compressed_texture_s3tc?(g+=".dxt.txt",r="arraybuffer",n=cI):e.WEBGL_compressed_texture_etc1?(g+=".etc.txt",r="arraybuffer"):n=ol;break;case cI:e.WEBGL_compressed_texture_s3tc?(g+=".dxt.txt",r="arraybuffer"):n=ol}var w=f.Ea;w.loaded=!1;w.Pc=n;if(n===ng){n=a+".a.png";var y=(b.Xa||a)+".a.png";w=w.alpha=new rf;var A="blob";w.loaded=!1;w.Pc=ui;e.WEBGL_compressed_texture_pvrtc?(y+=".pvr.txt",A="arraybuffer"):e.WEBGL_compressed_texture_etc1&&(y+=".etc.txt",A="arraybuffer");l.da.load(n,y,b.crossOrigin, A,b.priority,b.Ga,b.$c,b.timeout,this.l,this.o)}l.da.load(a,g,b.crossOrigin,r,b.priority,b.Ga,b.$c,b.timeout,this.Ac,this.ac)}return f.ia(c,d)};p.gb=function(a,b){if("function"===typeof b){var c=d,d=b;b=void 0}var e=this.g,f=e[a];f||(f=e[a]=new eC,f.state=db);if(f.state===db||b&&b.reload){b=mc(f.options,b);if(b.reload){e=0;for(var g=f.urls;e=a)return Tv;switch(a%10){case 1:return ws;case 2:case 3:case 4:return sC;default:return Tv}default:return 1c)for(var d=this.ak,e=this.app, f;cb){d.splice(c,0,a);break}a.priority=b;a.layout();a.A($g)}return this};p.remove=function(a){var b=this.g,c=b.indexOf(a);-1!==c&&(this.g=N(b,c),a.A(Jj));return this};p.clear=function(a){a=void 0===a?0:a;this.app.input.cancel();for(var b=0,c=this.g,d=c.length-1;0<=d;--d)if(c[d].priority<=a){b=d;break}this.g=c.slice(b+1);a=c.slice(0,b+1);for(b=a.length-1;0<=b;--b)a[b].A(Jj);return this};p.nc=function(){var a=Zf(this);return a?a.nc.apply(a,arguments):!1}; gl.prototype.has=function(a){return!!this.scripts[a]};gl.prototype.get=function(a,b,c,d){"function"===typeof b&&(d=c,c=b,b=void 0);var e=this.scripts,f=e[a];f||(e[a]=f=new pt(a),f.state=db);f.state===db&&(b=mc(f.options,b),f.state=rc,this.app.da.load(a,b.Xa,b.crossOrigin,b.responseType||"js",void 0===b.priority?1:b.priority,b.Ga,b.$c,b.timeout,this.Ac,this.ac));return f.ia(c,d)};gl.prototype.remove=function(a){var b=this.scripts,c=b[a];c&&(delete b[a],this.app.da.remove(a),c.dispose())};gl.prototype.clear= function(){var a=this.scripts,b=this.app.da;this.scripts={};for(var c in a)b.remove(c),a[c].dispose()};p=AC.prototype;p.dispose=function(){this.stop();var a=this.app;a.off(mf,this.dc);a.off(Yh,this.kd)};p.start=function(){if(void 0===window.WebGLRenderingContext)throw"Your browser doesn't seem to support WebGL. Please update your browser or operation system.";var a=this.canvas,b=this.wb;try{if(this.ca=a.getContext("webgl",b)||a.getContext("experimental-webgl",b),!this.ca&&(this.ca=a.getContext("webgl")|| a.getContext("experimental-webgl"),!this.ca))throw Error("");}catch(n){throw"Your device doesn't seem to support WebGL. Please update your browser or operation system.";}b=this.ca;var c=this.Bk;if(b.getShaderPrecisionFormat){try{var d=b.getShaderPrecisionFormat(b.VERTEX_SHADER,b.HIGH_INT)}catch(n){d=null}if(d&&0Ka;++Ka)f[R++]=pa[Ka];break; case 4:f[R++]=pa.x;f[R++]=pa.y;f[R++]=pa.z;f[R++]=pa.w;break;case 3:f[R++]=pa.x;f[R++]=pa.y;f[R++]=pa.z;break;case 2:f[R++]=pa.x;f[R++]=pa.y;break;case 1:f[R++]=pa}++ma;if(++xar.sg?r.data.length:r.sg:Aa=(Fa=ja.position)?Fa.eb.data.length/(Fa.stride>>2||3):0;++xa;if(0===Aa)continue;pf(a,f.Ja)}r?Qg(a,n.fg,!0,r.Fk,Aa):Qg(a,n.fg,!1,0,Aa)}};Ws.prototype.u=function(a,b){return a.qc!==b.qc?a.qc-b.qc: a.qcb?1:a> 16&255)/255,(a>>8&255)/255,(a&255)/255)):a instanceof E&&(a=new yb(a));this.color=a;return this};p.Cf=function(a){"number"===typeof a&&(a=new yb(a));this.alpha=a;return this};p.Ld=function(a){this.ke=a;return this};p.load=function(a,b,c,d){var e=this;d=mc(this.options,d);this.state=rc;var f=1;this.name=b.name||this.name;this.duration=Ma(b.duration,this.duration);this.loop=$a(b.loop,this.loop);this.world=$a(b.world,this.world);this.count=Qa(b.count,this.count);var g=b.blendMode;g&&(this.Sa=mD[g]|| Xp);this.Qc=$a(b.depthTest,this.Qc);if(this.g=b.diffuseMap)++f,a.oa.get(c+Na(b.diffuseMap),d,function(l){e.ke=l;0===--f&&e.A(e.state=Ib)},function(l){e.A(e.state=db,e.error=l)});this.rate.load(b.rate);this.Gj.load(b.lifeTime);this.Ah=Qa(b.speedMode,this.Ah);this.Mi=Qa(b.rotationMode,this.Mi);this.Zj.load(b.startSpeed);this.Wb.load(b.vx);this.Xb.load(b.vy);this.Nd.load(b.vz);this.speed.load(b.speed);this.size.load(b.size);this.rotation.load(b.rotation);this.color.load(b.color);this.alpha.load(b.alpha); this.lh=new (Li[b.emitterType]||Zc);this.lh.load(b.emitter);this.Ad.load(b.ex);this.Bd.load(b.ey);this.Yf.load(b.ez);0===--f&&this.A(this.state=Ib)};p.save=function(a){a.name=this.name;a.duration=this.duration;a.rate=this.rate;a.loop=this.loop?1:0;a.world=this.world?1:0;a.count=this.count;a.depthTest=this.Qc?1:0;this.Sa&&(a.blendMode=this.Sa.name);a.diffuseMap=this.g;this.rate.save(a.rate=[]);this.Gj.save(a.lifeTime=[]);a.speedMode=this.Ah;a.rotationMode=this.Mi;this.Zj.save(a.startSpeed=[]);this.Wb.save(a.vx= []);this.Xb.save(a.vy=[]);this.Nd.save(a.vz=[]);this.speed.save(a.speed=[]);this.size.save(a.size=[]);this.rotation.save(a.rotation=[]);this.color.save(a.color=[]);this.alpha.save(a.alpha=[]);for(var b in Li)if(this.lh.constructor==Li[b]){a.emitterType=b;break}this.lh.save(a.emitter={});this.Ad.save(a.ex=[]);this.Bd.save(a.ey=[]);this.Yf.save(a.ez=[])};var MD=qa++,qL=0,rt=0;u(xj,lc);xj.prototype.dispose=function(){for(var a=0,b=this.Fb,c=b.length;ac?(b-=a*d,b<=c&&(b=c)):(b+=a*d,b>=c&&(b=c));this.volume=b}};p.Uh=function(a,b,c){b=void 0===b?!1:b;c=void 0=== c?1:c;ao(this);this.m=a.buffer;this.H=a.start;this.Z=a.end-a.start;this.D=b;this.C=this.Rd=c;this.sb=0;return vD(this)};p.ek=function(){return this.g};Db.Object.defineProperties(Rd.prototype,{volume:{configurable:!0,enumerable:!0,get:function(){return this.C},set:function(a){this.C=a=Da(a,0,1);this.muted&&(a=0);var b=this.g;b&&(b=b.gain,b.value!==a&&(b.value=a))}},muted:{configurable:!0,enumerable:!0,get:function(){return this.K},set:function(a){this.K=a;this.volume=this.C}}});var hC=null,$n=qa++, sL=qa++;u(ji,Rd);ji.prototype.pc=function(){Rd.prototype.pc.call(this);this.wd&&(this.app.audio.Fg[this.wd]=null,this.wd="")};ji.prototype.ng=function(a){Rd.prototype.ng.call(this,a);a=this.Rd;this.volume===a&&0===a&&this.stop()};u(vj,Rd);p=vj.prototype;p.pc=function(){Rd.prototype.pc.call(this);this.maxDistance=1E4;this.setPosition(0,0,0)};p.wh=function(a){this.distanceModel=a;return this};p.ml=function(a){this.rolloffFactor=a;return this};p.zh=function(a){this.refDistance=a;return this};p.Df=function(a){this.maxDistance= a;return this};p.setPosition=function(a,b,c){if(this.ua!==a||this.Bb!==b||this.na!==c){this.ua=a;this.Bb=b;this.na=c;var d=this.l;d&&(d.positionX?(d.positionX.value=a,d.positionY.value=b,d.positionZ.value=c):d.setPosition(a,b,c))}return this};p.Bc=function(a){return this.setPosition(a.x,a.y,a.z)};p.ek=function(){return this.l};Db.Object.defineProperties(vj.prototype,{distanceModel:{configurable:!0,enumerable:!0,get:function(){return this.J},set:function(a){if(this.J!==a){this.J=a;var b=this.l;b&& (b.distanceModel=a)}}},rolloffFactor:{configurable:!0,enumerable:!0,get:function(){return this.wa},set:function(a){if(this.wa!==a){this.wa=a;var b=this.l;b&&(b.rolloffFactor=a)}}},refDistance:{configurable:!0,enumerable:!0,get:function(){return this.W},set:function(a){if(this.W!==a){this.W=a;var b=this.l;b&&(b.refDistance=a)}}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return this.P},set:function(a){if(this.P!==a){this.P=a;var b=this.l;b&&(b.maxDistance=a)}}}});u(Wg,ve);p=Wg.prototype; p.dispose=function(){this.pc();this.l=this.g=null};p.Lb=function(){this.app.audio.de.push(this)};p.pc=function(){J(this.app.audio.de,this);this.M=null;st(this);this.nk=this.Rd=this.lg=0;this.Vh=1;this.mg=!0;this.m=this.o=1;this.u=!1};p.df=function(a){this.volume=a;return this};p.yh=function(a){this.muted=a;return this};p.stop=function(){this.j&&(st(this),this.app.audio.ef.push(this))};p.ng=function(a){var b=this.volume,c=this.Rd;if(b!==c){var d=this.lg;b>c?(b-=a*d,b<=c&&(b=c)):(b+=a*d,b>=c&&(b=c)); this.volume=b}b=this.rate;c=this.Vh;b!==c&&(d=this.nk,b>c?(b-=a*d,b<=c&&(b=c)):(b+=a*d,b>=c&&(b=c)),this.rate=b)};p.Uh=function(a,b,c){b=void 0===b?1:b;c=void 0===c?1:c;st(this);var d=this.l;a=a.buffer;this.o=this.Vh=c;this.m=this.Rd=b;if(d&&a){d=this.j=d.createBufferSource();var e=this.g;d.buffer=a;d.loop=!0;d.playbackRate.value=c;d.connect(e);d.start?d.start():d.noteOn();this.g.gain.value=b;this.g.connect(this.mg?this.app.audio.Pi:this.app.audio.Hi)}return this};Db.Object.defineProperties(Wg.prototype, {rate:{configurable:!0,enumerable:!0,get:function(){return this.o},set:function(a){this.o=a;var b=this.j;b&&(b=b.playbackRate,b.value!==a&&(b.value=a))}},volume:{configurable:!0,enumerable:!0,get:function(){return this.m},set:function(a){this.m=a=Da(a,0,1);this.muted&&(a=0);var b=this.g;b&&(b=b.gain,b.value!==a&&(b.value=a))}},muted:{configurable:!0,enumerable:!0,get:function(){return this.u},set:function(a){this.u=a;this.volume=this.m}}});u(Ij,Wg);Ij.prototype.pc=function(){Wg.prototype.pc.call(this); this.wd&&(this.app.audio.Fg[this.wd]=null,this.wd="")};Ij.prototype.ng=function(a){Wg.prototype.ng.call(this,a);a=this.Rd;this.volume===a&&0===a&&this.stop()};u(xe,Cc);p=xe.prototype;p.update=function(a){for(var b=this.channels,c=b.length,d=null===this.g,e=0,f,g=void 0,l,n,r,w,y;e=(w=f.Y)){do if(this.A(op,l,e),--g,++l>y)if(n)l=w,this.A(ym,l,e);else{l=y;g=1;break}else this.A(ym,l,e);while(1<=g)}else{do if(this.A(op, l,e),--g,--l>1,Ha=y[La];Ha.frame<=Fa?(xa=La,f=Ha):(Ja=La,ea=Ha)}ea.frame<=Fa&&(f=ea);Fa=f.position;xa=f.rotation;f=f.scale;va+=(Fa.x-va)*Aa;A+=(Fa.y-A)*Aa;H+=(Fa.z-H)*Aa;if(null!==xa)if(1===Aa)I=xa.x,O=xa.y,S=xa.z,Ka=xa.w;else if(Fa=xa.x,ea=xa.y,Ha=xa.z,xa=xa.w,Ja=Ka*xa+I*Fa+O*ea+S*Ha,0>Ja&&(Fa=-Fa,ea=-ea,Ha=-Ha,xa=-xa,Ja=-Ja),1>Ja)if(La=Math.sqrt(1-Ja*Ja),.001>Math.abs(La))I=.5*(Fa+I),O=.5*(ea+O),S=.5*(Ha+S),Ka=.5*(xa+Ka);else{Ja=Math.atan2(La,Ja);var Gb=1/La;La=Math.sin((1-Aa)*Ja)*Gb;Ja=Math.sin(Aa* Ja)*Gb;I=I*La+Fa*Ja;O=O*La+ea*Ja;S=S*La+Ha*Ja;Ka=Ka*La+xa*Ja}null!==f&&(R+=(f.x-R)*Aa,ja+=(f.y-ja)*Aa,ka+=(f.z-ka)*Aa)}}w.setPosition(va,A,H);w.Ia(I,O,S,Ka);w.setScale(R,ja,ka)}}this.g=a}return d};p.Ed=function(a){return Xg(this,void 0===a?0:a).weight};p.za=function(a,b){b=Xg(this,void 0===b?0:b);b.weight!==a&&(b.weight=a,this.g=null)};p.Tc=function(a,b){b=Xg(this,void 0===b?0:b);a=Da(b.weight+a,0,1);b.weight!==a&&(b.weight=a,this.g=null)};p.play=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?0:c; var d=this.xd[a];if(d){var e=Xg(this,c),f=d.Y;d=d.T;e.animationName=a;e.frame=e.Y=f;e.T=d;e.loop=b;e.time=0;++e.timestamp;this.g=null;this.A(ym,f,c)}else this.stop(c)};p.stop=function(a){a=Xg(this,void 0===a?0:a);a.time=1;++a.timestamp;this.g=null};p.Qb=function(a){return 1!==Xg(this,void 0===a?0:a).time};var ym=qa++,op=qa++;p=zC.prototype;p.dispose=function(){this.O.dispose();for(var a=0,b=this.ud,c=b.length;aR?1:0)+2;R=Math.floor(ja)+(ja%1>R?1:0)+2}ja=S*R;var ka=ag(a,32*ja),ea=ka.ib,ma=ka.data,pa=a.matrix,va=pa.a,Ka=pa.b,Aa=pa.c,Fa=pa.d,xa=pa.ub;pa=pa.vb;var Ja=a.color,La=Ja.x,Ha=Ja.y,Gb=Ja.z;Ja=Ja.w;var qc=f/n,Nb=e/l,pb=d+y*qc,oa=d+I*qc,B=c+w*Nb,X=c+H*Nb;switch(O){case sl:case Yp:var ia=g-n+I,ya=b-l+H;break;case mh:ia=(g-n+r)/(R-2),ya=(b-l+A)/(S-2)}H=0;for(I=R-1;H=pa||2392<=pa&&2399>=pa)&&2381===S[ka+1]&&ja[pa]&&(2325<=S[ka+2]&&2361>=S[ka+2]||2392<=S[ka+2]&&2399>=S[ka+2]||8205===S[ka+2]))if(8205===S[ka+2])R[ea++]=ja[pa].Ch,++ka;else{for(var qc=2352===pa,Nb=ka+2;Nb=pb||2392<=pb&&2399>=pb)&&2381===S[Nb+1]&&ja[pb]&&(2325<=oa&&2361>=oa||2392<=oa&&2399>=oa))Nb+=2;else break}2367===S[Nb+1]&&(R[ea++]=ja[2367]?ja[2367].Ch:2367);for(var B=ka;B=X?(2367!==X&&(R[ea++]=X),ka=Nb+1):ka=Nb;qc&&(R[ea++]=ja[2352].Ch)}else if(2367===pa){var ia=R[ea-1];R[ea-1]=2367;R[ea++]=ia}else R[ea++]=pa}for(var ya=a.Qj,eb=zh,Jb=tg,hc=Jb.length=0,$b=0;hcxk&&0>1),Vi=void 0;od=$p)++He;else break}for(var zk=He-1;ed= gw){for(var Ak=zk-1;0<=Ak;){var qI=bf[Ak];if(48<=qI&&57>=qI)Ak--;else break}for(var uQ=zk;Ak$b?$b=nd=Ka=1:($b=ma,nd=pa,Ka=va);ya=l*pb.hd+f;eb=n*pb.jd+g;Jb=l*pb.ff+f;hc=n*pb.hf+g;y[w++]=oa*Fa+X*Ja+Ha;y[w++]=oa*xa+X*La+Aa;y[w++]=ya;y[w++]=eb;y[w++]=$b;y[w++]=nd;y[w++]=Ka;y[w++]=ea;y[w++]=B*Fa+X*Ja+Ha;y[w++]=B*xa+X*La+Aa;y[w++]=Jb;y[w++]=eb;y[w++]=$b;y[w++]=nd;y[w++]=Ka;y[w++]=ea;y[w++]=B*Fa+ia*Ja+Ha;y[w++]= B*xa+ia*La+Aa;y[w++]=Jb;y[w++]=hc;y[w++]=$b;y[w++]=nd;y[w++]=Ka;y[w++]=ea;y[w++]=oa*Fa+ia*Ja+Ha;y[w++]=oa*xa+ia*La+Aa;y[w++]=ya;y[w++]=hc;y[w++]=$b;y[w++]=nd;y[w++]=Ka;y[w++]=ea;I+=pb.advance}}1!==A&&vf(a);r.ib=w;bg(a,H)}};Db.Object.defineProperties(rb.prototype,{x:{configurable:!0,enumerable:!0,get:function(){this.layout();return this.O},set:function(a){this.O!==a&&(this.O=a,this.j=!0)}},y:{configurable:!0,enumerable:!0,get:function(){this.layout();return this.Z},set:function(a){this.Z!==a&&(this.Z= a,this.j=!0)}},width:{configurable:!0,enumerable:!0,get:function(){this.layout();return this.Zc}},height:{configurable:!0,enumerable:!0,get:function(){this.layout();return this.Lc}},matrix:{configurable:!0,enumerable:!0,get:function(){this.layout();return this.j?DD(this):this.Ic},set:function(a){ED(this,a)}},u:{configurable:!0,enumerable:!0,get:function(){return this.ua},set:function(a){"string"===typeof a&&(a=this.app.fonts.get(a));this.ua=a;this.g=this.j=!0}},text:{configurable:!0,enumerable:!0, get:function(){return this.m},set:function(a){"string"!==typeof a&&(a=a.toString());this.m!==a&&(this.m=a||"",this.g=this.j=!0)}},K:{configurable:!0,enumerable:!0,get:function(){return this.wa},set:function(a){this.wa=a;this.g=this.j=!0}},C:{configurable:!0,enumerable:!0,get:function(){return this.xb},set:function(a){this.xb=a;this.g=this.j=!0}},P:{configurable:!0,enumerable:!0,get:function(){return this.wb},set:function(a){this.wb=a;this.g=this.j=!0}},Ph:{configurable:!0,enumerable:!0,get:function(){return this.dc}, set:function(a){switch(a){case ab:case oI:break;default:a=GD}this.dc=a;this.g=this.j=!0}},J:{configurable:!0,enumerable:!0,get:function(){return this.na},set:function(a){this.na=a;this.g=this.j=!0}},W:{configurable:!0,enumerable:!0,get:function(){return this.mf},set:function(a){this.mf=a;this.g=this.j=!0}}});var wQ=new Oe,tg=[],zh=[],pI={32:!0,33:!0,34:!0,35:!0,36:!0,37:!0,38:!0,39:!0,40:!0,41:!0,42:!0,43:!0,44:!0,45:!0,46:!0,47:!0,58:!0,59:!0,60:!0,61:!0,62:!0,63:!0,64:!0,91:!0,92:!0,93:!0,94:!0, 95:!0,96:!0,123:!0,124:!0,125:!0,126:!0},tQ={40:41,41:40,60:62,62:60,123:125,125:123},ew={1569:[65152,-1,-1,-1],1570:[65153,-1,-1,65154],1571:[65155,-1,-1,65156],1572:[65157,-1,-1,65158],1573:[65159,-1,-1,65160],1574:[65161,65163,65164,65162],1575:[65165,-1,-1,65166],1576:[65167,65169,65170,65168],1577:[65171,-1,-1,65172],1578:[65173,65175,65176,65174],1579:[65177,65179,65180,65178],1580:[65181,65183,65184,65182],1581:[65185,65187,65188,65186],1582:[65189,65191,65192,65190],1583:[65193,-1,-1,65194], 1584:[65195,-1,-1,65196],1585:[65197,-1,-1,65198],1586:[65199,-1,-1,65200],1587:[65201,65203,65204,65202],1588:[65205,65207,65208,65206],1589:[65209,65211,65212,65210],1590:[65213,65215,65216,65214],1591:[65217,65219,65220,65218],1592:[65221,65223,65224,65222],1593:[65225,65227,65228,65226],1594:[65229,65231,65232,65230],1600:[1600,1600,1600,1600],1601:[65233,65235,65236,65234],1602:[65237,65239,65240,65238],1603:[65241,65243,65244,65242],1604:[65245,65247,65248,65246],1605:[65249,65251,65252,65250], 1606:[65253,65255,65256,65254],1607:[65257,65259,65260,65258],1608:[65261,-1,-1,65262],1609:[65263,-1,-1,65264],1610:[65265,65267,65268,65266],1662:[64342,64344,64345,64343],1728:[64420,-1,-1,64421],1740:[64508,64510,64511,64509],1670:[64378,64380,64381,64379],1705:[64398,64400,64401,64399],1711:[64402,64404,64405,64403],1688:[64394,-1,-1,64395]},sQ={1604:{1570:[65269,-1,-1,65270],1571:[65271,-1,-1,65272],1573:[65273,-1,-1,65274],1575:[65275,-1,-1,65276]}},fw={1552:!0,1554:!0,1555:!0,1556:!0,1557:!0, 1611:!0,1612:!0,1613:!0,1614:!0,1615:!0,1616:!0,1617:!0,1618:!0,1619:!0,1620:!0,1621:!0,1622:!0,1623:!0,1624:!0,1648:!0,1750:!0,1751:!0,1752:!0,1753:!0,1754:!0,1755:!0,1756:!0,1759:!0,1760:!0,1761:!0,1762:!0,1763:!0,1764:!0,1767:!0,1768:!0,1770:!0,1771:!0,1772:!0,1773:!0,8205:!0},rQ={},vQ=qa++,GD=0,ab=1,oI=2;u(nb,rb);nb.prototype.dispose=function(){this.app.locale.off(Hn,this.D)};Db.Object.defineProperties(nb.prototype,{fc:{configurable:!0,enumerable:!0,get:function(){return this.kd},set:function(a){this.kd= a;this.H="";this.D()}},Qh:{configurable:!0,enumerable:!0,get:function(){return this.H},set:function(a){this.H=a;this.D()}}});u(yt,sa);p=yt.prototype;p.Vm=function(){this.g=!1};p.Qb=function(){return this.$d.loop||0l){a=this.m+a;e=sj(b.rate,l);var w=1/e,y=b.lh,A=this.world,H=this.g?this.parent.matrix:this.matrix,I=b.Gj,O=b.Zj,S=b.Wb,R=b.Xb,ja=b.Ah,ka=b.Mi,ea=b.speed,ma=b.size,pa=b.rotation,va=b.color,Ka=b.alpha;b=b.count;var Aa=this.l;for(0>=e&&(w=2147483647,a=0);a>w;)if(a-=w,!Aa&&dg)){++d;switch(ja){case 2:y.kh(e, !1);S.Pa(e.Wb);R.Pa(e.Xb);e.speed.ea(1);break;case 1:y.kh(e,!0);ea.Pa(e.speed);break;default:y.kh(e,!0),e.speed.ea(sj(O,l))}A&&H.transformPoint(e,e);f=e.speed.value(g)*a;e.x+=n+e.Wb.value(g)*f;e.y+=r+e.Xb.value(g)*f;ma.Pa(e.size);ka===rt&&pa.Pa(e.rotation);va.Pa(e.color);Ka.Pa(e.alpha)}this.m=a}this.active=d};p.ob=function(a){var b=this.active;if(0=(b.opacity-=this.speed*a)&&(b.opacity=0,this.app.screen.remove(this),a=this.u,this.u=null,a&&a())};u(dg,tb);dg.prototype.layout=function(){tb.prototype.layout.call(this);this.l.Eb(this.width,this.height)};dg.prototype.show=function(a){switch(a){case rI:case Fj:this.l.color=0;break;default:this.l.color=2130706432}this.g=a===Fj?.3:0;this.app.screen.push(this);return this};dg.prototype.update=function(a){this.app.input.Gi=-1;0< this.g&&0>=(this.g-=a)&&(this.g=0,this.app.platform.$f())};var Fj=0,rI=1,Ug=3;u(xf,sa);xf.prototype.ob=function(a){a.flush();var b=a.X,c=this.Ca,d=this.Va,e=a.matrix,f=this.width,g=this.height;e=this.m.set(e.ub,e.vb,f*e.a+g*e.b,f*e.c+g*e.d);f=b.li;g=this.g;g=void 0===g?f:g;var l=f.z,n=f.w;if(0===l||0===n)l=g.set(0,0,0,0);else{var r=e.z,w=e.w;if(0===r||0===w)l=g.set(0,0,0,0);else{var y=f.x,A=f.y,H=e.x,I=e.y,O=Math.max(y,H),S=Math.max(A,I);l=g.set(O,S,Math.max(0,Math.min(y+l,H+r)-O),Math.max(0,Math.min(A+ n,I+w)-S))}}n=!l.Ha(e);r=c.bf;g=b.uh;w=l;y=a.Pl;A=a.viewport;y.length===a.pk&&y.push(new Xb);y[a.pk++].copy(A);A.Ha(w)||(a.flush(),A.copy(w),Aj(a.X,A.x,A.y,A.width,A.height));wD(a,l);n&&(w=this.o,y=w.elements,A=e.height,H=l.width,I=l.height,O=e.width/H,S=A/I,y[0]=O,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=S,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=O-1+2*(e.x-l.x)/H,y[13]=S-1+2*(l.y-e.y+I-A)/I,y[14]=0,y[15]=1,c.bf=w.mb(c.bf,w),ko(c));yD(a,c.zf);f.Ha(l)||ci(b,!0);this.clearColor&&di(b,!0,!0,!0,!0); this.clearDepth&&(b.Kd(!0),fi(b,!0));this.clearStencil&&IC(b);b.clear(this.clearColor,this.clearDepth,this.clearStencil);this.app.Pj.ob(b,d,c);n&&(c.bf=r,ko(c));zD(a);xD(a);a.flush();c=a.viewport;d=a.Pl[--a.pk];c.Ha(d)||(a.flush(),c.copy(d),Aj(a.X,c.x,c.y,c.width,c.height));ci(b,g)};u(ul,sa);p=ul.prototype;p.nc=function(a){switch(a){case nf:case el:case bi:if(this.$a(arguments[2],arguments[3])){var b=this.x,c=this.y,d=this.qe;this.x+=d.x;this.y+=d.y;d=this.children;for(var e=d.length-1,f;0<=e;--e)if(f= d[e],f.nc.apply(f,arguments))return this.x=b,this.y=c,!0;this.x=b;this.y=c;return this.A.apply(this,arguments)}if(this.app.input.Jb===this&&arguments[1]===this.pointerId)return sa.prototype.nc.apply(this,arguments);b=this.x;c=this.y;this.y=this.x=Infinity;d=sa.prototype.nc.apply(this,arguments);this.x=b;this.y=c;return d;default:return sa.prototype.nc.apply(this,arguments)}};p.update=function(a){if(-1===this.pointerId)this.g+=a;else{0>=a&&(a=.001);var b=this.D,c=this.u,d=this.l;d.scale(.2);d.x+=.8* (c.x-b.x)/a;d.y+=.8*(c.y-b.y)/a;b.copy(c)}d=this.g;a=Math.exp(-d/.325);b=this.m;c=this.o;var e=this.Ck,f=this.C,g=Math.exp(-d/.125);d=f.x*g;f=f.y*g;g=-Math.max(0,e.width-this.width);e=-Math.max(0,e.height-this.height);var l=b.x-c.x*a;a=b.y-c.y*a;0 n?e>A?(e=Math.sqrt(e-(n+A)+1),c.x=.5*e,e=.5/e,c.w=(r-y)*e,c.y=(f+l)*e,c.z=(g+w)*e):(e=Math.sqrt(A-(e+n)+1),c.z=.5*e,e=.5/e,c.w=(f-l)*e,c.x=(w+g)*e,c.y=(y+r)*e):n>A?(e=Math.sqrt(n-(A+e)+1),c.y=.5*e,e=.5/e,c.w=(w-g)*e,c.z=(r+y)*e,c.x=(l+f)*e):(e=Math.sqrt(A-(e+n)+1),c.z=.5*e,e=.5/e,c.w=(f-l)*e,c.x=(w+g)*e,c.y=(y+r)*e);this.Bc(jo);yf(this,dh);this.Uj(Bt);return this};p.U=function(){var a=this.ne,b=this.oe,c=this.pe,d=this.me,e=this.parent,f=e?sI:this.Oa,g=f.elements;if(0===a&&0===b&&0===c&&1===d)g[0]= this.Db,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=this.Wc,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=this.cf;else{var l=a+a,n=b+b,r=c+c,w=a*l,y=a*n;a*=r;var A=b*n;b*=r;c*=r;l*=d;n*=d;d*=r;r=this.Db;var H=this.Wc,I=this.cf;1===r&&1===H&&1===I?(g[0]=1-(A+c),g[1]=y+d,g[2]=a-n,g[3]=0,g[4]=y-d,g[5]=1-(w+c),g[6]=b+l,g[7]=0,g[8]=a+n,g[9]=b-l,g[10]=1-(w+A)):(g[0]=(1-(A+c))*r,g[1]=(y+d)*r,g[2]=(a-n)*r,g[3]=0,g[4]=(y-d)*H,g[5]=(1-(w+c))*H,g[6]=(b+l)*H,g[7]=0,g[8]=(a+n)*I,g[9]=(b-l)*I,g[10]=(1-(w+A))*I)}g[11]=0;g[12]=this.x; g[13]=this.y;g[14]=this.z;g[15]=1;e&&e.Oa.mb(f,this.Oa);e=0;f=this.children;for(g=f.length;el){a=this.j+a;e=sj(b.rate,l);var y=1/e,A=b.lh,H=b.world,I=(g=this.g)?this.parent.Oa:this.Oa,O=b.Gj,S=b.Zj,R=b.Wb,ja=b.Xb,ka= b.Nd,ea=b.Ah,ma=b.Mi,pa=b.speed,va=b.size,Ka=b.rotation,Aa=b.color,Fa=b.alpha;b=b.count;0>=e&&(y=2147483647,a=0);for(g||ac.prototype.U.call(this);a>y;)if(a-=y,dg)){++d;switch(ea){case 2:A.tg(e,!1);R.Pa(e.Wb);ja.Pa(e.Xb);ka.Pa(e.Nd);e.speed.ea(1);break;case 1:A.tg(e,!0);pa.Pa(e.speed);break;default:A.tg(e,!0),e.speed.ea(sj(S,l))}H&&I.transformPoint(e,e);f=e.speed.value(g)*a;e.x+=n+e.Wb.value(g)*f;e.y+=r+e.Xb.value(g)*f;e.z+= w+e.Nd.value(g)*f;va.Pa(e.size);ma===rt&&Ka.Pa(e.rotation);Aa.Pa(e.color);Fa.Pa(e.alpha)}this.j=a}this.active=d;if(0A&&(A=R),R=e.x,Rl&&(l=R),ja=e.y,jar&&(r=ja),ka=e.z,kaf&&(f=ka),e.color.value(g,bq),ea=bq.x, ma=bq.y,pa=bq.z,va=e.alpha.value(g),e=e.rotation.value(g),g=0;4>g;++g)O[y++]=R,O[y++]=ja,O[y++]=ka,O[y++]=ea,O[y++]=ma,O[y++]=pa,O[y++]=va,O[y++]=S,O[y++]=e;a.upload(y);b-=A;l+=A;n-=A;r+=A;w-=A;f+=A;c=l-b;e=r-n;g=f-w;this.Za.Tf.set(.5*(l+b),.5*(r+n),.5*(f+w),.5*Math.sqrt(c*c+e*e+g*g))}this.Za.Kb.sg=6*d};p.pb=function(){var a=this.$d;this.active=this.time=this.j=0;this.ce=1/(a.duration||1);a.Ad.Pa(this.Ad);a.Bd.Pa(this.Bd);a.Yf.Pa(this.Yf)};var bq=new E;u(Nj,we);Nj.prototype.setWorld=function(a){a? sf(this,"USE_WORLD_MATRIX"):this.define("USE_WORLD_MATRIX");return this};Nj.prototype.ya=function(a){this.hb[0].Sa=a;return this};Nj.prototype.Kd=function(a){this.hb[0].Qc=a;return this};var FL="attribute mediump vec2 uv;\nattribute vec3 position;\nattribute vec2 sr;\nattribute lowp vec4 pcolor;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\n#ifdef USE_WORLD_MATRIX\n uniform mat4 worldMatrix;\n#endif\nvarying lowp vec4 vColor;\nvarying mediump vec2 vUv;\nuniform mediump vec4 diffuseMapOR;\nvoid main() {\n vColor = pcolor;\n vUv = uv * diffuseMapOR.zw + diffuseMapOR.xy;\n vec2 scaledPosition = vec2(uv.x * 2.0 - 1.0, 1.0 - 2.0 * uv.y) * sr.x;\n float sinA = sin(sr.y);\n float cosA = cos(sr.y);\n vec4 worldPosition = vec4(cosA * scaledPosition.x - sinA * scaledPosition.y, sinA * scaledPosition.x + cosA * scaledPosition.y, 0.0, 0.0);\n #ifdef USE_WORLD_MATRIX\n worldPosition += viewMatrix * worldMatrix * vec4(position, 1.0);\n #else\n worldPosition += viewMatrix * vec4(position, 1.0);\n #endif\n gl_Position = projectionMatrix * worldPosition;\n}", GL="precision mediump float;\nvarying lowp vec4 vColor;\nuniform lowp vec4 color;\nuniform sampler2D diffuseMap;\nvarying mediump vec2 vUv;\n#ifdef diffuseMapALPHA\n uniform sampler2D diffuseMapAlpha;\n#endif\nvoid main() {\n lowp vec4 diffuseColor = color * vColor;\n diffuseColor *= texture2D(diffuseMap, vUv);\n #ifdef diffuseMapALPHA\n diffuseColor.a *= texture2D(diffuseMapAlpha, vUv).r;\n #endif\n if (diffuseColor.a == 0.0) discard;\n gl_FragColor = diffuseColor;\n}"; u(wb,ib);p=wb.prototype;p.Zm=function(a){for(var b=0,c=this.Fb,d=c.length,e;bf;++f)aC(e,Tc[f]);var g=uI.copy(Tc[0]).add(Tc[1]).add(Tc[2]).add(Tc[3]).scale(.25), l=vI.copy(Tc[4]).add(Tc[5]).add(Tc[6]).add(Tc[7]).scale(.25),n=Xi.copy(l).sub(g);n.normalize();for(var r=Tc[0],w=r,y=n.dot(r),A=y,H=1;8>H;++H){var I=Tc[H],O=n.dot(I);OA&&(A=O,w=I)}var S=yQ.copy(r).sub(g);Uh(g,n,S.dot(n),S);var R=zQ.copy(w).sub(l);Uh(l,n,R.dot(n),R);for(var ja=ds(n,AQ),ka=S.distance(R),ea=n.scale(this.focus,BQ).add(g).distance(S),ma=(ka*ea+ka*ea*-.6)/(ka-2*ea- -.6*ka),pa=Uh(S,n,-ma,CQ),va=0;8>va;++va){var Ka=Tc[va];iw[va].set(Ka.x-pa.x,Ka.y-pa.y).normalize()}var Aa= iw[0],Fa=Aa;y=A=ja.dot(Aa);for(var xa=1;8>xa;++xa){var Ja=iw[xa],La=ja.dot(Ja);La>A&&(A=La,Fa=Ja);Lauk;++uk)wd[Id++]=sk[uk];break;case 4:wd[Id++]=oc.x;wd[Id++]=oc.y;wd[Id++]=oc.z;wd[Id++]=oc.w;break;case 3:wd[Id++]=oc.x;wd[Id++]=oc.y;wd[Id++]=oc.z;break;case 2:wd[Id++]=oc.x;wd[Id++]=oc.y;break;case 1:wd[Id++]=oc}}++vd;if(++Mi< Jb&&(me=eb[Mi])&&me.bc===hc&&me.Ec===Nc&&vdne.sg?ne.data.length:ne.sg:Ah=(zm=tk.position)?zm.eb.data.length/(zm.stride>>2||3):0;++Mi;if(0===Ah)continue;pf(a,Ni.Ja)}ne?Qg(a,vg.fg,!0,ne.Fk,Ah):Qg(a,vg.fg,!1,0,Ah)}this.filter(a,this.j,this.D,RD);this.filter(a,this.D,this.j,SD)}Ds(a,null);Aj(a,ia.x,ia.y,ia.width,ia.height);As(a,ya.r,ya.mi,ya.b,ya.a);ci(a,X);var vk=this.M,wk=this.m;ca(vk,0,wk-1,this.H);for(var Pb,Bh,xk,Pi= -1,Oc,pe,Ge=-1,xg,Qi=c.bf,af=c.Ui,Ri=c.zf,Zp=this.l,Ch=this.j,yg=-1,xd,Si,qe,Ti,od=-1,Dh=0,zg,yd,Jd,Ui,Kd,Vi,Eh,bf,Wi,ed,yk,He=0;HeWi;++Wi)yd[Jd++]= bf[Wi];break;case 4:yd[Jd++]=Kd.x;yd[Jd++]=Kd.y;yd[Jd++]=Kd.z;yd[Jd++]=Kd.w;break;case 3:yd[Jd++]=Kd.x;yd[Jd++]=Kd.y;yd[Jd++]=Kd.z;break;case 2:yd[Jd++]=Kd.x;yd[Jd++]=Kd.y;break;case 1:yd[Jd++]=Kd}++Dh;if(++Heqe.sg?qe.data.length:qe.sg:ed=(yk=Si.position)?yk.eb.data.length/(yk.stride>>2||3):0;++He;if(0===ed)continue;pf(a,Bh.Ja)}qe?Qg(a,Oc.fg,!0,qe.Fk,ed):Qg(a,Oc.fg,!1,0,ed)}};Bl.prototype.filter= function(a,b,c,d){Ds(a,c.Ea);Aj(a,0,0,c.Ea.width,c.Ea.height);ei(a,!1);a.Kd(!1);fi(a,!1);a.tb(Mn);a.cb(d);a.Ya("source",b);a.Jd(wI.attributes);Bj(a,wI.Kb);Qg(a,Yn,!0,0,6)};Bl.prototype.H=function(a,b){return a.qc!==b.qc?a.qc-b.qc:a.qca.id)){var c= this.Sc;a=a.Sc;c===a&&(a=void 0);var d=this.app;c&&d.play.add(d.S.aa(zf).Bc(b).play(c).Df(120).wh("inverse").zh(10).df(.8));a&&d.play.add(d.S.aa(zf).Bc(b).play(a).Df(120).wh("inverse").zh(10).df(.8))}};p.U=function(){ib.prototype.U.call(this);this.H&&(this.H=!1,this.Mm())};p.Mm=function(){var a=this.Oa,b=this.body,c=a.elements;b.position.set(c[12],c[13],c[14]);a.Dd(b.quaternion);b.aabbNeedsUpdate=!0};p.isTrigger=function(){return this.body.isTrigger};p.gj=function(a,b){this.body.addShape(new Vf(a), b);return this};p.Td=function(a,b,c,d){b=void 0===b?0:b;c=void 0===c?0:c;d=void 0===d?0:d;this.body.addShape(new Vf(a),Be.set(b,c,d));return this};p.rk=function(a,b,c){this.body.addShape(new Mh(a),b,c)};p.F=function(a,b,c,d,e,f,g,l,n){d=void 0===d?0:d;e=void 0===e?0:e;f=void 0===f?0:f;g=void 0===g?0:g;l=void 0===l?0:l;n=void 0===n?0:n;this.body.addShape(new Mh(new F((void 0===a?0:a)/2,(void 0===b?0:b)/2,(void 0===c?0:c)/2)),Be.set(d,e,f),gq.I(g,l,n));return this};var rh={};u(Pa,Kc);u(cd,Pa);cd.prototype.ha= function(){Pa.prototype.ha.call(this);var a=this.body;a.updateMassProperties();a.updateBoundingRadius();a.aabbNeedsUpdate=!0};cd.prototype.jb=function(){Pa.prototype.jb.call(this);var a=this.body,b=a.shapes,c=a.shapeOffsets;a=a.shapeOrientations;for(var d=b.length,e=0;ejq;++jq)nw[jq]=new Mh(new F(1,1,1));var jq;var zI=[];var hq=[];for(kq=0;338>kq;++kq)hq[kq]=new F;var kq;var iq=[];for(lq=0;338>lq;++lq)iq[lq]=new Nd;var lq;u(Fc,Pa);var mq=0;u(ud,Kc);p=ud.prototype;p.$l=function(){return new xb({type:xb.DYNAMIC,mass:1})};p.sd= function(a){var b=this.body;b.mass=a;b.updateMassProperties();return this};p.applyForce=function(a,b){b=void 0===b?F.ZERO:b;this.body.applyForce(a,b);return this};p.ha=function(){Kc.prototype.ha.call(this);this.body.sleep()};p.sleep=function(){this.body.sleep()};p.wakeUp=function(){this.body.wakeUp()};p.input=function(a){0!==this.oi&&this.body.sleepState!==xb.SLEEPING&&this.body.applyForce(td.scale(this.oi*this.body.mass/a,GQ),F.ZERO)};p.xc=function(){var a=this.Ye,b=this.rd;this.Be.copy(a);this.ud.copy(b); var c=this.body;b.copy(c.quaternion).Gf(this.K,a).add(c.position)};p.update=function(){var a=this.app.play.Ej;this.Bc(this.Be.dd(this.Ye,a,HQ));var b=this.ud,c=this.rd,d=IQ;d=void 0===d?b:d;if(0===a)d.copy(b);else if(1===a)d.copy(c);else{var e=b.x,f=b.y,g=b.z;b=b.w;var l=c.x,n=c.y,r=c.z,w=c.w;c=b*w+e*l+f*n+g*r;0>c&&(l=-l,n=-n,r=-r,w=-w,c=-c);if(1<=c)d.x=e,d.y=f,d.z=g,d.w=b;else{var y=Math.sqrt(1-c*c);if(.001>Math.abs(y))d.x=.5*(l+e),d.y=.5*(n+f),d.z=.5*(r+g),d.w=.5*(w+b);else{c=Math.atan2(y,c);var A= 1/y;y=Math.sin((1-a)*c)*A;a=Math.sin(a*c)*A;d.x=e*y+l*a;d.y=f*y+n*a;d.z=g*y+r*a;d.w=b*y+w*a}}}yf(this,d);Kc.prototype.U.call(this)};p.Mm=function(){var a=this.Oa,b=this.body,c=this.rd;a.Dd(c);this.ud.copy(c);b.quaternion.copy(c);var d=this.Ye;a=a.elements;d.set(a[12],a[13],a[14]);this.Be.copy(d);c.Gf(Be.copy(this.K).Fc()).add(d,b.position);b.aabbNeedsUpdate=!0};p.gj=function(a,b){Fl(this);Kc.prototype.gj.call(this,a,b);return to(this)};p.rk=function(a,b,c){Fl(this);Kc.prototype.rk.call(this,a,b,c); to(this)};p.Td=function(a,b,c,d){b=void 0===b?0:b;c=void 0===c?0:c;d=void 0===d?0:d;Fl(this);Kc.prototype.Td.call(this,a,b,c,d);return to(this)};p.F=function(a,b,c,d,e,f,g,l,n){d=void 0===d?0:d;e=void 0===e?0:e;f=void 0===f?0:f;g=void 0===g?0:g;l=void 0===l?0:l;n=void 0===n?0:n;Fl(this);Kc.prototype.F.call(this,a,b,c,d,e,f,g,l,n);return to(this)};var HQ=new E,IQ=new Ic;new Tb;var GQ=new E;u(uo,ud);u(Pj,Lr);Pj.prototype.sortList=function(){for(var a=this.axisList,b=a.length,c=0;c= f)break;b[d+1]=g}b[d+1]=e}break;case 3:for(a=1,b=this.axisList,c=b.length;a=f)break;b[d+1]=g}b[d+1]=e}}};Pj.prototype.collisionPairs=function(a,b,c){this.autoDetectAxis();this.dirty&&(this.sortList(),this.dirty=!1);switch(this.axisIndex){case 0:a=0;for(var d=this.axisList,e=d.length,f=this.app.play.B.x+this.radius;af)break;for(var l=g.aabb.upperBound.x,n=a+1;nf)break;l=g.aabb.upperBound.y;for(n=a+1;nr.aabb.upperBound.x)break;this.needBroadphaseCollision(g,r)&&this.intersectionTest(g,r,b,c)}}break;case 3:for(a=0,d=this.axisList,e=d.length,f=this.app.play.B.y-this.radius;ar.aabb.upperBound.y)break;this.needBroadphaseCollision(g,r)&&this.intersectionTest(g,r,b,c)}}}};Pj.prototype.autoDetectAxis=function(){var a=0,b=0,c=0,d=0,e=this.axisList,f=e.length, g=this.app.play.B,l=g.x;g=g.y;for(var n=0;nd-c*c*f?0b.upperBound.x)break;g.overlaps(b)&&c.push(f)}break;case 1:for(e= 0;eb.upperBound.y)break;g.overlaps(b)&&c.push(f)}break;case 2:for(e=0;eR&&ka.negate(ka);ka.normalize();Ab.vectorToWorldFrame(f,ka,ka);R=ja.ri;ka.scale(y, R);R.vadd(c,R);R.vsub(g.position,R);Ab.pointToWorldFrame(d,f,Uc,Uc);Uc.vsub(l.position,ja.rj);this.result.push(ja);this.createFrictionEquationsFromContact(ja,this.frictionResult)}}H.length=0};Qj.prototype.zk=function(a,b,c,d,e,f,g,l,n,r,w){e=a.getSideNormals(KQ,e);for(var y=0,A=0;2!==y;y++)for(var H=0;2!==H;H++)for(var I=0;2!==I;I++){var O=ow[A++];O.set(0,0,0);y?O.vadd(e[0],O):O.vsub(e[0],O);H?O.vadd(e[1],O):O.vsub(e[1],O);I?O.vadd(e[2],O):O.vsub(e[2],O);c.vadd(O,O);Ab.pointToLocalFrame(d,f,O,O)}c= nq.setFromPoints(ow);c=b.getTrianglesInAABB(c,AI);e=this.world.gravity;y=-b.Jm;A=0;for(H=c.length;A!==H;A++)if(b.getNormal(c[A],Ag),!(0I;++I){O=ow[I];O.vsub(Dk,Uc);var S=Uc.dot(Ag);Ag.scale(S,Uc);O.vsub(Uc,Uc);if(pd.pointInTriangle(Uc,Dk,oq,pq)&&y<=S&&0>=S){if(w)return!0;S=this.createContactEquation(g,l,a,b,n,r);var R=S.ni;O.vsub(Uc,R);0===R.lengthSquared()?Ag.negate(R):R.normalize();Ab.pointToWorldFrame(d,f,Uc,Uc);Uc.vsub(l.position,S.rj); Ab.pointToWorldFrame(d,f,O,O);O.vsub(g.position,S.ri);this.result.push(S);this.createFrictionEquationsFromContact(S,this.frictionResult)}}c.length=0};var JQ=new F,nq=new jc,AI=[],Dk=new F,oq=new F,pq=new F,Ag=new F,Uc=new F,KQ=[new F,new F,new F,new F,new F,new F],ow=[new F,new F,new F,new F,new F,new F,new F,new F];Object.defineProperty(Qj.prototype,Rq,{configurable:!0,enumerable:!0,get:function(){return this.pl}});Object.defineProperty(Qj.prototype,Sq,{configurable:!0,enumerable:!0,get:function(){return this.zk}}); u(Lt,pd);Object.defineProperty(Lt.prototype,Ke.Wi,{configurable:!0,enumerable:!0,get:function(){return this._intersectTrimesh}});u(Sa,Pa);Sa.prototype.ha=function(){Pa.prototype.ha.call(this);(this.j=-1===this.name.indexOf("cross"))&&this.app.play.path.add(this.g)};Sa.prototype.jb=function(){Pa.prototype.jb.call(this);this.app.play.path.remove(this.g)};Sa.prototype.Vj=function(a){this.type=a;return this};Sa.prototype.U=function(){Pa.prototype.U.call(this);this.g.apply(this.Oa)};var LQ=new E,MQ=new E, NQ=new E,OQ=new E,PQ=new E,qw=new E,rw=new E,Mt=1;u(Gl,Kc);Gl.prototype.ha=function(){this.j.L(!0).setPosition(0,0,0).setScale(1);this.second.L(!1).setPosition(0,0,0).setScale(1);this.o=this.g.visible=!1;var a=60+20*Math.random();this.l=a*a;this.time=this.speed=0;Kc.prototype.ha.call(this)};Gl.prototype.nb=function(a){if(this.j.visible){var b=this.app;xi(a,this.second.visible?2:1);this.second.visible?(cv(a,ni(this.j,Be)),cv(a,ni(this.second,Be))):cv(a,this);this.j.visible=this.second.visible=this.g.visible= !1;b.audio.play(sw[tw]);tw=++tw%sw.length}};Gl.prototype.update=function(a){if(this.j.visible){var b=this.app.play.B,c=b.al;if(this.o){var d=this.xg(QQ).sub(c),e=d.Fd;this.speed+=500*a;d.scale(-Math.min(this.speed*a,e)/e);this.x+=d.x;this.y+=d.y;this.z+=d.z;this.setScale(sb(this.Db,.5+.5*Math.min(e/50,1),10*a));this.H=!0;.1>c.De(this)&&this.nb(b,c,td)}else 0d?(this.g.visible=!0,this.g.pb()):0===d&&(this.second.visible=!1);b=.7*d;c=1-.3*d;d=360*(this.time+=a)+this.x+this.y;this.j.R(b).setScale(c).I(0,0,d);this.second.R(-b).setScale(c).I(0,0,d);this.g.visible&&(this.g.update(a),this.g.Qb()||(this.g.visible=!1));this.U()}};var QQ=new E;var tw=0;var sw=[];for(qq=1;13>=qq;++qq)sw.push("assets/general/coin"+qq+".wav");var qq,dE=new na;u(uc,Kc);uc.prototype.ha=function(){Kc.prototype.ha.call(this); var a=this.g;a&&(a.visible=!0);this.effect&&this.j||eE(this);this.time=0};uc.prototype.jb=function(){Kc.prototype.jb.call(this);var a=this.app.S,b=this.effect;b&&(this.effect=null,b.visible=!0,this.Vc(b),a.release(b));if(b=this.j)this.j=null,b.visible=!0,this.Vc(b),a.release(b)};uc.prototype.nb=function(a){lh(a,300);1>a.Ae&&0>=a.Gb&&(a.app.audio.play(U(a.Ua.lj)),a.qg=2);this.g.visible=this.effect.visible=!1;this.j.L(!0).pb();a=this.app;a.audio.play("assets/general/bonus.wav");a.play.A(uw,1)};uc.prototype.update= function(a){var b=this.g;b&&b.visible&&(this.effect.update(a),b.I(0,0,this.m?130*((this.time+=a)+this.x):180+30*Math.sin((this.time+=5*a)+this.x)).U(),b.update&&b.update(a));b=this.j;b.visible&&(b.update(a),b.Qb()||(b.visible=!1))};var uw=qa++;u(fg,na);u(Pt,uc);Pt.prototype.nb=function(a,b,c){uc.prototype.nb.call(this,a,b,c);jH(a)};var SL=new fg;u(Qt,uc);Qt.prototype.nb=function(a,b,c){uc.prototype.nb.call(this,a,b,c);dv(a,10);Xe(a.Yb,rq,10)};var TL=new fg;u(Rt,uc);Rt.prototype.nb=function(a,b,c){uc.prototype.nb.call(this, a,b,c);ev(a)};var UL=new fg;u(St,uc);St.prototype.nb=function(a,b,c){uc.prototype.nb.call(this,a,b,c);iH(a)};var VL=(new fg).tb(Sc);u(Tt,uc);Tt.prototype.nb=function(a,b,c){uc.prototype.nb.call(this,a,b,c);kH(a)};var WL=new fg;u(Rj,uc);Rj.prototype.pc=function(){var a=this.g;a&&(Nt(this,null),this.app.S.release(a))};Rj.prototype.set=function(a){this.description=a=Ze[a]||og[a];var b=this.app.S.aa(a.model);b.setScale(a.xk||1).setPosition(0,0,a.yk||0);this.m=a.wk||!1;Nt(this,b);eE(this,a.Vl,a.Wl)};Rj.prototype.nb= function(a,b,c){uc.prototype.nb.call(this,a,b,c);a=this.description.name;b=this.app;b.B.ye(ke[a]||a);if(c=Ze[a])a:{b.play.B.Qa.push(c);b=b.play;c=b.Yb;for(var d=0;d=Math.sqrt(oi(this,this.app.play.B)):vc.prototype.ag.call(this)&&180>=Math.sqrt(oi(this,this.app.play.B))};p.xh=function(a){this.D=a;var b=this.body;a?b.collisionFilterMask&=-5:(b.angularFactor.set(1,1,1),this.oi=-5,Kt(this,.5,.999),b.collisionFilterMask|=4)};p.Ji=function(){if(-1!==this.name.indexOf("cross"))this.l=void 0,this.speed=20,this.Dd(this.Ic); else{var a=this.xg(wq),b=this.app.play.path,c=this.ae=pi(b,a,this.g,this.ae),d=b.Hd(c,this.g,a);d||(d=b.Hd(c,this.g=!this.g,a));if(d){d=d.sub(c,uq).normalize();var e=this.Oa.Dd(Cm).pf(vq),f=this.g;this.g=0this.m&&((this.m-=a)<-VQ?(this.m=Vt,this.O=!1,this.speed=20,this.J=.5):(this.speed=80,this.J=2,this.l=.3*this.ae.width*Math.sin(this.ee+=2*a))),0(this.m-=a)&&++this.j<=xw&&(this.xh(!0),this.cd=!1,this.ee=6*Math.random());Lc.prototype.update.call(this,a)}; p.dl=function(){0===this.j&&Lc.prototype.dl.call(this)};p.Hg=function(a,b){if(0<=this.m&&(Lc.prototype.Hg.call(this,a,b),!this.O)){b=this.app;var c=b.play,d=c.B;if(this.O=a===d)a=WQ[Math.min(this.j,3)],xi(d,a),Xe(d.Yb,$i,a),b.audio.play("assets/general/coins.wav"),this.cl(),c.A(FI,a),c.A(GI,1)}};p.cl=function(){this.C&&this.C.play(this.Mb,!1)};p.xh=function(a){a?Lc.prototype.xh.call(this,a):(0===this.j||this.j>xw)&&Lc.prototype.xh.call(this,!1)};p.sf=function(a){return 0===this.j||this.j>xw||10a.Ae&&0>=a.Gb&&(a.app.audio.play(U(a.Ua.Dj)),a.Ae=2);a.app.audio.play("assets/general/gates.wav")};p.Jg=function(){var a=this.app.play.B;lh(a,2E3);1>a.Ae&&0>=a.Gb&&(a.app.audio.play(U(a.Ua.lj)),a.qg=2);a.app.audio.play("assets/general/gates.wav")};var XQ=new ce(1,0,0,.414),ks=new yn,ls=new E,YQ=new Tb;u(vo,hd);vo.prototype.Ig= function(){hd.prototype.Ig.call(this);var a=this.app.play,b=a.B;xi(b,10);Xe(b.Yb,$i,10);Bf(b,this.app.S.aa(yo),b);a.A(No,1)};vo.prototype.Jg=function(){hd.prototype.Jg.call(this);var a=this.app.play,b=a.B;xi(b,30);Xe(b.Yb,$i,30,xq);Bf(b,this.app.S.aa(yo),b);a.A(No,1)};var No=qa++;u(wo,hd);wo.prototype.Ig=function(){hd.prototype.Ig.call(this);var a=this.app.play,b=a.B;dv(b,5);Xe(b.Yb,rq,5);Bf(b,this.app.S.aa(zo),b);a.A(Oo,1)};wo.prototype.Jg=function(){hd.prototype.Jg.call(this);var a=this.app.play, b=a.B;dv(b,20);Xe(b.Yb,rq,20,xq);Bf(b,this.app.S.aa(zo),b);a.A(Oo,1)};var Oo=qa++;u(xo,hd);xo.prototype.Ig=function(){hd.prototype.Ig.call(this);var a=this.app.play,b=a.B;ev(b,3);Xe(b.Yb,yw,3);Bf(b,this.app.S.aa(Ao),b);a.A(Po,1)};xo.prototype.Jg=function(){hd.prototype.Jg.call(this);var a=this.app.play,b=a.B,c=b.Ci;ev(b,c);Xe(b.Yb,yw,c,xq);Bf(b,this.app.S.aa(Ao),b);a.A(Po,1)};var Po=qa++;u(Ba,uo);Ba.prototype.Lb=function(){this.Ak=null;this.cd=!1};Ba.prototype.nb=function(a,b,c){if(!this.cd){this.cd= !0;var d=this.Ak;d?d.nb(a,b,c):(d=this.app.play.B,oi(d,this)a?gu:hu);e.z=b;e.Oc.a=0;this.i(e)}this.Ql&&(c=this.la= this.app.S.aa(c||(3>a?mu:nu)),c.z=b,c.Oc.a=0,this.i(c),a=this.Uc=this.app.S.aa(d||(3>a?qu:ru)),a.z=b,a.Oc.a=0,this.i(a));return this};gh.prototype.Lb=function(){this.j=0;Rc.prototype.Lb.call(this)};gh.prototype.pc=function(){hE(this)};gh.prototype.update=function(a){var b=this.app.play.B,c=b.Dd(cR).ci(dR),d=b.tc.body.velocity;c=c.dot(d);10a?ku:lu),a.z=b,this.i(a));return this};ti.prototype.pc=function(){jE(this)};ti.prototype.update=function(a){var b=this.app.play.B,c=this.g.Ja.color;c!==b.kj&&this.g.Ya("color",c=b.kj);var d=Math.max(b.speed/b.le,1)*a; b.bd&&b.Gb||(d*=-1);if(!b.bd||b.Gb)d*=10;d=this.alpha=Da(this.alpha+d,0,1);var e=this.effect;if(e){var f=e.Oc;f.copy(c);(e.visible=0<(f.a=d*Math.min(b.velocity/10,1)))&&e.update(a)}Rc.prototype.update.call(this,a)};ti.jc=function(a){a=a.oa.get("assets/general/bitumTrail.png",{Pc:ng});a.Oi(Vj);iE.Ld(a)};var iE=po((new Fb).define("TRAIL")).tb(Sc).ya(Dc).Da(dq).ab(!1);u(hh,Rc);hh.prototype.Md=function(a,b){lE(this);this.offset.set(0,a?(a+.2)/2:0,0);a&&(a=this.effect=this.app.S.aa(3>a?iu:ju),a.z=b,a.Oc.a= 0,this.i(a));return this};hh.prototype.Lb=function(){this.j=0;Rc.prototype.Lb.call(this)};hh.prototype.pc=function(){lE(this)};hh.prototype.update=function(a){var b=this.app.play.B,c=b.Wd&&2===b.Wd.type,d=Math.max(b.speed/b.le,1)*a;if(!c||b.Gb)d*=-1;if(!b.bd||b.Gb)d*=10;d=this.j=Da(this.j+d,0,1);this.alpha=.25*d;var e=this.effect;if(e){var f=e.Oc;c&&f.copy(b.Wd.color||kp);(e.visible=0<(f.a=d*Math.min(b.velocity/b.le,1)))&&e.update(a)}Rc.prototype.update.call(this,a)};hh.jc=function(a){a=a.oa.get("assets/general/sandTrail.png", {Pc:ng});a.Oi(Vj);kE.Ld(a)};var HI=new Xn("decay",!0,Pg,xm,of,Pg,xm,of),kE=(new Fb).define("TRAIL").tb(Sc).ya(HI).Da(dq).ab(!1);u(ih,Rc);ih.prototype.Lb=function(){Rc.prototype.Lb.call(this);this.time=.3};ih.prototype.pc=function(){Rc.prototype.pc.call(this);this.ie=null};ih.prototype.set=function(a){this.ie=a};ih.prototype.update=function(a){0>(this.time-=a)||!this.ie.Wd?this.alpha=0:this.alpha=.4*Math.random();Rc.prototype.update.call(this,a)};ih.jc=function(a){a=a.oa.get("assets/general/asphaltTrail.png", {Pc:ng});a.Oi(Vj);mE.Ld(a)};var mE=(new Fb).define("TRAIL").tb(Sc).ya(HI).Da(dq).ab(!1);u(Bo,ib);p=Bo.prototype;p.$m=function(){var a=this.app.play;this.g=this.j=!1;this.vj=.5a.max.z&&(a.max.z=100);var b=this.Oa;this.o.copy(a).$h(b);b.Fc(this.m)};p.gl=function(){var a=this.app,b=a.play,c=b.location,d=this.o,e=b.B,f=this.data.aabb;!this.g&&f.gi(this.m.transformPoint(e,Be))&&(this.g=!0,(e.level=this).usage===ig&&c.app.play.A(Qu,1));if(!this.j&&(this.g||290>f.max.x&&b.Ca.od.xi(d))){this.j=!0;f=b.path;a=a.S;for(var g=this.uf,l=0;lA.play.B.x?y=jh(c, H,c.Si,c.Fj):y=c.nm;break;case Nu:y=w.usage===c.si?jh(c,H,c.vl,c.jm):jh(c,H,c.ul,c.im);break;case jg:y=jh(c,H,c.xl,c.lm);break;case hg:y=jh(c,H,c.yl,c.mm);break;case JG:y=.5=Hd)for(c=this.uf,f=e.Mj,a=b.Ca.od,g=0;gBe.dot(f)&&!l.sf(a)?(b.remove(c[g]),C(c,g)):++g;if(this.g&&!b.Ca.od.xi(d)){e=this.uf; c=b.Ca.od;for(d=0;dl?-90:90:Math.asin(l)*rl;a.z=Math.atan2(2*(d*g+e*f),1-2*(f*f+g*g))*rl;b=70>c.call(b,a.z)}if(b&&!this.Aj&&.1>Math.random()){this.Aj=!0;var n="Ink01"}break;case "Vorota01":switch(b.cm){case 1:n="Vorota02";break;case 2:n="Vorota03";break;default:n="Vorota01"}}return n&&yj(this.app.S,n)};p.xc=function(){};p.update=function(){var a= this.app,b=a.Fa.isActive(),c=a.play,d=c.Lf||c.Ng.visible,e=c.Rj,f=c.B,g=a.$.Tb,l=a.Nb,n=l.Tb,r=(b?0:1)*(d||g||e||n||f.state=Hd&&!n?1:0),.25);g.zc("assets/location/amb.wav",r,.25,!0);g.zc(this.Ab,c,.25,!0);a=a.B;b=a.Pb();d=Hf(a);this.u.L(0b;++b)a[b].reset()}; Tj.prototype.cl=function(){si.prototype.cl.call(this);var a=this.j;4>a&&this.ua[a].cd()};Tj.prototype.update=function(a){si.prototype.update.call(this,a);this.effect.update(a);for(var b=this.ua,c=0;4>c;++c)b[c].update(a)};Tj.jc=function(a){a.Zb.get("assets/location/Money01.mdl").options.Jj=4};var wi=-2.45,RM=new na,QM=new F(4.5,1.95,2.45),SM=(new na).Da(4E3).ab(!1);u(kh,Oa);kh.prototype.reset=function(){this.time=-1;this.L(!0).Ya("alpha",1).be(this.g).setScale(1).I(0,0,0).U()};kh.prototype.cd=function(){this.time= 0};kh.prototype.update=function(a){0<=this.time&&this.visible&&(a=this.time+=2*a,this.be(this.g+3*Cb(Math.min(a,1))+10*(Math.max(a,1)-1)).Ya("alpha",1-(Da(a,1,1.5)-1)/.5).setScale(1.5*Cb(Math.min(a,1))).I(0,0,100*a).U(),a>=2*Math.PI&&(this.visible=!1))};var TM=(new na).Da(4E3).ya(Dc).define("ALPHA");u(fF,Oa);var UM=Za(new na,Jc|Gd|tc);u(gF,Ba);var VM=new na,Yo=qa++;u(hF,Fc);var WM=Za(new na,Jc),XM=mq++;u(xu,cd);xu.prototype.ha=function(){this.F(1,2,20.875,0,25.693,10.227).F(1,2,20.875,0,-25.693,10.227).F(1, 2,20.875,4.269,25.693,10.227).F(1,2,20.875,4.269,-25.693,10.227);cd.prototype.ha.call(this)};var YM=new na;u(iF,Ba);var ZM=new na,dp=qa++;u(jF,Oa);var $M=Za(new na,Jc|Gd|tc);u(Ue,Lc);Ue.prototype.ha=function(){this.model.pa=U(kR);Lc.prototype.ha.call(this)};Ue.prototype.wf=function(a){Lc.prototype.wf.call(this,a);this.app.play.A(this.model.pa===Yu?lR:OI,1)};Ue.jc=function(a){Za(PI.Ld(a.oa.get("assets/location/Car0002_02.png")),kd)};var Yu,PI,kR=[Yu=new na,PI=new na],aN=new F(3,1.75,1.9),bN=[{x:-1.92, y:1.518,z:0},{x:-1.92,y:-1.518,z:0},{x:1.722,y:1.518,z:0},{x:1.722,y:-1.518,z:0}],lR=qa++,OI=qa++,cN="assets/location/car_loop.wav",dN=["assets/location/car_horn1.wav","assets/location/car_horn2.wav"];u(yu,Ue);yu.jc=Ue.jc;u(zu,Ue);zu.jc=Ue.jc;u(kF,Fc);var eN=new na;u(lF,Fc);var fN=new na,VG=mq++;u(Io,Pa);Io.prototype.ha=function(){Pa.prototype.ha.call(this);this.g=!1};Io.prototype.xc=function(){if(bE(this)){var a=this.app.play.B;0=a.Gb&&a.app.audio.play(a.Ua.Jk),a.Gb=5,a.kj= oP);this.g||(this.g=!0,this.app.play.A(Pu,1))}};var gN=Za(new na,Gd|Jc),Pu=qa++;u(mF,Pa);var hN=Za(new na,Wb).tb(Sc);u(nF,Ba);var iN=new na,Uj=qa++;u(oF,Ba);var jN=new na;u(pF,Ba);var kN=new na;u(qF,Ba);var lN=new na,$o=qa++;u(rF,Pa);var mN=Za(new na,Jc);u(sF,Pa);var nN=Za(new na,Jc|Gd|tc);u(Au,Fc);Au.prototype.nb=function(a,b,c){var d=this.app.play,e=d.B,f=e.tc;a===f&&.8b)a.x=5.776*b,a.U()};var $G=Za(new na,qo|Gd|tc).Da(vi).ab(!1).td(-1,-10),aH=(new na).ya(ph).Da(vi).ab(!1).td(-1,-10);u(Cu,Ve);Cu.prototype.update=function(a){Ve.prototype.update.call(this,a);a=this.j;var b=Math.floor(5*this.time);if(a.visible=5>b)a.x=8.62+5.75*b,a.U()};u(Jo,Ba);Jo.prototype.ha=function(){Ba.prototype.ha.call(this);this.i(this.g=this.app.S.aa(Vb).setPosition(0,.714,2.579).I(126,0,0).setScale(1.12358,1.64462,1.1935))};Jo.prototype.jb= function(){Ba.prototype.jb.call(this);this.app.play.remove(this.g);this.g=null};var vN=(new na).tb(Sc),ap=qa++;u(HF,Sa);u(IF,Oa);var wN=new na;u(JF,Sa);u(KF,Sa);var xN=[new E(0,0,0),new E(60,0,0),new E(90,0,0),new E(120,.002,0),new E(150,0,0),new E(180,0,0),new E(210,0,0),new E(240,0,0),new E(270,0,0),new E(300,0,0),new E(330,0,0),new E(360,0,0),new E(390,0,0),new E(420,0,0),new E(480,0,0)];u(LF,Sa);var yN=[new E(0,0,0),new E(60,0,0),new E(90,0,2),new E(120,0,5),new E(150,0,10),new E(180,0,15),new E(210, 0,17),new E(240,0,15),new E(270,0,10),new E(300,0,0),new E(330,0,-10),new E(360,0,-15),new E(390,0,-17),new E(420,0,-15),new E(450,0,-10),new E(480,0,-5),new E(510,0,-2),new E(540,0,0),new E(600,0,0)];u(MF,Sa);var zN=[new E(0,0,0),new E(30,0,0),new E(60,0,-4),new E(90,0,-10),new E(120,0,-18),new E(150,0,-20),new E(180,0,-20),new E(210,0,-18),new E(240,0,-11),new E(270,0,-4),new E(300,0,3),new E(330,0,10),new E(360,0,16),new E(390,0,19),new E(420,0,20),new E(450,0,19),new E(480,0,16),new E(510,0,10), new E(540,0,4),new E(570,0,0),new E(600,0,0)];u(NF,Sa);u(OF,Sa);var Ub=(new na).Da(xI);u(PF,Sa);u(QF,Sa);var Ol=xn(4283912512);u(RF,Sa);u(SF,Sa);u(Du,cd);Du.prototype.ha=function(){this.F(28,10,30,0,0,13.113);cd.prototype.ha.call(this)};var AN=Za(new na,Wb);u(TF,Qc);var BN=[new E(-.631,0,8.029),new E(-.631,0,.418),new E(-.85,0,-7.402),new E(.468,0,-9.831)],CN=[(new Ic).I(90,0,0),(new Ic).I(90,0,0),(new Ic).I(90,0,0),$k],Lo=qa++;u(UF,Ba);var DN=new na;u(VF,Pa);var EN=Za(new na,kd).tb(Sc);u(WF,Qc); var bH=["BrShl01","BrShl02","BrShl03","BrShl04"],FN=[new E(-.631,7.813,.468),new E(-.631,.223,.468),new E(-.85,-7.591,.459),new E(.468,-9.569,0)];u(XF,Qc);var GN=["StatBr01","StatBr02"],HN=[new E(-.055,.048,1.805),new E(.232,-.006,-2.49)],Xo=qa++;u(YF,Ba);var IN=new na;u(ZF,Ba);var JN=new na;u($F,Pa);var KN=Za(new na,Jc);u(aG,Ba);var LN=new na;new F(2,2.25,1.25);var bp=qa++;u(bG,Pa);var MN=new na;u(cG,Qc);var NN=["StrBr01","StrBr02","StrBr03"],ON=[new E(0,1.435,-.053),new E(0,-1.515,-1.385),new E(.003, -1.055,1.977)],Ml=qa++;u(Eu,Ba);Eu.prototype.Lb=function(){Ba.prototype.Lb.call(this);this.setScale(1)};var PN=new na;u(Fu,Ba);Fu.prototype.Lb=function(){Ba.prototype.Lb.call(this);this.setScale(1)};var QN=new na;u(Gu,Ba);Gu.prototype.Lb=function(){Ba.prototype.Lb.call(this);this.setScale(1)};var RN=new na;u(dG,Qc);var SN=["StrClBr01","StrClBr02","StrClBr03"],TN=[new E(-.043,-.713,1.765),new E(0,1.435,-.053),new E(0,-1.515,-1.385)];u(eG,Ba);var UN=(new na).tb(Sc),VN=(new Fb).ya(Dc).Da(vi).td(-1,-10).ab(!1), WN=ot(3);u(fG,Ba);var XN=new na;u(gG,Ba);var YN=new na;u(hG,Ba);var ZN=new na;u(iG,Ba);var $N=new na,aO=qa++;u(Kl,cd);Kl.prototype.ha=function(){this.F(1.2,1.2,11,0,0,5.5);cd.prototype.ha.call(this)};Kl.prototype.update=function(a){a=this.time=(this.time+4*a)%Math.PI;this.g.color.a=this.j.color.a=Math.abs(Math.sin(a))};Kl.jc=function(a){$u.Ld(a.oa.get("assets/general/point.png"))};var bO=Za(new na,Wb),$u=po(new na).ya(ph).ab(!1).Da(4E3);u(jG,Ba);var cO=new na,cp=qa++;u(kG,Sa);u(lG,fh);var dO=Za(new na, Jc|Gd|tc);u(Hu,fh);Hu.prototype.update=function(a){a=this.time=(this.time+10*a)%le;this.g.Ya("shine",a);this.j.Ya("shine",a+Math.PI)};var cH=Za(new na,Gd|tc|Jc),dH=Za(new na,tc|Jc),QI=new na;QI.define("SHINE");var bv=QI.define("NODIFFUSEMAP").ya(ph).Da(vi).ab(!1).td(-1,-10);u(Iu,fh);Iu.prototype.update=function(a){a=this.time=(this.time+10*a)%le;this.g.Ya("shine",a)};u(Ju,cd);Ju.prototype.ha=function(){this.F(4.53,4.53,5.663,-.087,.254,2.831);cd.prototype.ha.call(this)};var eO=Za(new na,Wb);u(Ku, cd);Ku.prototype.ha=function(){this.F(2,2,10,0,0,5);cd.prototype.ha.call(this)};var fO=Za(new na,Wb);u(mG,Sa);var gO=[new E(0,0,0),new E(60,0,0),new E(120,0,0),new E(139.943,1.307,0),new E(159.545,5.206,0),new E(178.47,11.63,0),new E(196.394,20.47,0),new E(213.012,31.573,0),new E(228.038,44.751,0),new E(241.215,59.777,0),new E(252.319,76.394,0),new E(261.158,94.319,0),new E(267.583,113.244,0),new E(271.482,132.846,0),new E(272.789,152.789,0),new E(272.789,212.789,0),new E(272.789,272.789,0)];u(nG, Sa);var hO=[new E(0,0,0),new E(60,0,0),new E(120,0,0),new E(139.173,-1.208,0),new E(156.256,-4.364,0),new E(178.47,-11.63,0),new E(195.721,-20.083,0),new E(210.296,-29.537,0),new E(228.038,-44.751,0),new E(240.741,-59.162,0),new E(250.589,-73.473,0),new E(261.158,-94.319,0),new E(267.38,-112.495,0),new E(271.001,-129.485,0),new E(272.789,-152.789,0),new E(272.789,-212.789,0),new E(272.789,-272.789,0)];u(Ll,Fc);Ll.prototype.ha=function(){Fc.prototype.ha.call(this);var a=this.app.S;this.i(this.g=a.aa(Vb).setPosition(15.165, -21.532,16.2).I(46.61,0,0).setScale(2,2,4)).i(this.j=a.aa(Vb).setPosition(45.169,-21.532,16.2).I(46.61,0,0).setScale(2,2,4)).i(this.m=a.aa(Vb).setPosition(15.165,21.532,16.2).I(46.61,0,180).setScale(2,2,4)).i(this.o=a.aa(Vb).setPosition(45.169,21.532,16.2).I(46.61,0,180).setScale(2,2,4))};Ll.prototype.jb=function(){Fc.prototype.jb.call(this);var a=this.app.play,b=this.Ab;b&&(a.remove(b),this.Ab=null);a.remove(this.g);this.g=null;a.remove(this.j);this.j=null;a.remove(this.m);this.m=null;a.remove(this.o); this.o=null};Ll.prototype.Ji=function(a){switch(a.usage){case jg:case ig:case hg:a=this.app,a.play.add(this.Ab=a.S.aa(qi).L(!1).setScale(60,22,20),this),this.U()}};var eH=new na,fH=mq++;u(Ko,Fc);Ko.prototype.ha=function(){Fc.prototype.ha.call(this);var a=this.app,b=a.S;a.play.add(this.Ab=b.aa(qi).setScale(60,22,20),this);this.i(this.g=b.aa(Vb).setPosition(15.165,-21.532,16.2).I(46.61,0,0).setScale(2,2,4)).i(this.j=b.aa(Vb).setPosition(45.169,-21.532,16.2).I(46.61,0,0).setScale(2,2,4)).i(this.m=b.aa(Vb).setPosition(15.165, 21.532,16.2).I(46.61,0,180).setScale(2,2,4)).i(this.o=b.aa(Vb).setPosition(45.169,21.532,16.2).I(46.61,0,180).setScale(2,2,4))};Ko.prototype.jb=function(){Fc.prototype.jb.call(this);var a=this.app.play;a.remove(this.Ab);this.Ab=null;a.remove(this.g);this.g=null;a.remove(this.j);this.j=null;a.remove(this.m);this.m=null;a.remove(this.o);this.o=null};u(oG,Ba);var iO=new na;u(pG,Pa);var jO=Za(new na,Wb);u(qG,vo);var kO=new na;u(rG,wo);var lO=new na;u(sG,xo);var mO=new na;u(Lu,cd);Lu.prototype.ha=function(){this.F(32.329, 3.438,30,0,0,13.501);cd.prototype.ha.call(this)};var nO=Za(new na,Jc|tc);u(tG,Oa);var oO=Za(new na,Jc);u(uG,Qc);var pO=["YaBr01","YaBr02","YaBr03"],qO=[new E(0,.858,0),new E(0,-.647,0),new E(.743,0,-.837)];u(vG,Ba);var rO=new na;u(wG,Ba);var sO=new na;u(xG,Ba);var tO=new na;u(yG,Pa);var uO=Za(new na,Jc|tc);u(zG,Pa);var vO=Za(new na,Jc|tc);u(AG,Pa);var wO=Za(new na,Jc|Gd);u(BG,Ba);var xO=new na,Nl=qa++;u(CG,Ba);var yO=new na;u(DG,Ba);var zO=new na,So=qa++;u(EG,Ba);var AO=new na;u(FG,Ba);var BO=new na; u(GG,Oa);var CO=new na;u(HG,Oa);var DO=new na;u(jp,vc);p=jp.prototype;p.ha=function(){this.setPosition(0,0,0);this.I(0,0,0);this.wa=0;this.Hd=this.level=null;this.Mj.copy(Ce);this.kd.copy(hp);this.Ki.copy(td);this.ja=this.fd=this.Mg=0;this.exp=this.Qa.length=0;this.ua=Hi(this.app.B);this.le=50;this.Rc=this.u=90;this.Ci=6;this.Uc=0;this.Ei=this.dc=10;this.j=0;this.Ai=this.ee=10;this.pj=this.ad=0;this.Bi=this.te=10;this.ed=0;this.m=50;this.W=3;this.J=this.o=this.Z=this.qg=this.Ae=0;this.fj=!1;this.Qf= 0;this.Ab=!1;this.Gb=0;this.kj=kp;this.ka(Pl);this.Yb.reset();vc.prototype.ha.call(this);this.body.angularDamping=.2};p.jb=function(){for(var a=this.app.play,b=this.wc,c=0;c=this.Gb&&(this.app.audio.play(U(this.Ua.lj)),this.qg=2)):0===this.Ae&&0>=this.Gb&&.5aj+1&&--this.m};p.input=function(a){this.fj?(this.fj=!1,0===this.Qf&&this.app.audio.play("assets/general/accel.wav"),this.Qf+=a,lh(this,50*a)):this.Qf=Math.max(0,this.Qf-.5*a);this.Ab&&(this.Ab=!1);this.speed=Math.min((0c&&b.position.vadd(l.scale(-Math.sign(n)*(r-c),VI),b.position);b.velocity.vadd(td.scale(Math.min(20-td.dot(b.velocity),0),VI),b.velocity);b=this.bd;l=this.Wd;vc.prototype.xc.call(this, a);b&&!this.bd&&l instanceof fh&&(lh(this,100),d.play.A(zw,1),0===this.Ae&&(a=Math.random(),.4=this.Gb&&(.6=(this.Rc-=a)&&(this.Rc=0,this.bd&&2>Math.abs(f.x)&&2>Math.abs(f.y)&&this.ka(Dw));this.Uc=Math.max(this.Uc-=a,0);this.j=Math.max(this.j-=a,0);this.ad=Math.max(this.ad-=a,0);this.pj=Da(this.pj+(0=g&&(this.m=10*Math.random()+40);var l=c.Ed(Wj);c.za((1-l)*Math.min(3*Math.sin(g),1+.1*Math.sin(g)),RI);0>=(this.o-=a/ this.W)&&(this.Z=this.o=0);this.o*this.Waj&&(this.m=aj)):3<=this.J&&(xi(this,10),Xe(this.Yb,$i,10,XI),this.m>aj&&(this.m=aj)),this.J=0);this.Ae=Math.max(this.Ae-a,0);this.qg=Math.max(this.qg-a,0);this.Gb=Math.max(this.Gb-=a,0);this.Yb.update(a);this.Mg+=a;f=f.length();lh(this,.1*a*f);l=this.wa;f=6*a;g=this.l.Ed(Em);var n=Math.max(l,0);g=n>g?Math.min(g+f,n):Math.max(g-f,n);n=this.l.Ed(Fm);l=Math.max(-l,0);n=l>n?Math.min(n+f,l):Math.max(n- f,l);d.za(1,zq);d.za(g,Em);d.za(n,Fm);c.za(1,zq);c.za(g,Em);c.za(n,Fm);e.za(1,zq);e.za(g,Em);e.za(n,Fm);lH(this,a);vc.prototype.update.call(this,a);break;case Dw:f=4*a,c.Tc(f,Gm),d.Tc(f,Gm),e.Tc(f,Gm),c.Qb(Gm)||this.ka(SI)}b!==Hd&&(lH(this,a),this.U());b=this.Bb;for(c=0;c=b){var c=this.time=Math.max(b-6*a,0);0===c&&(this.visible=!1)}else b<=1+Bq?(c=1,this.time=Math.max(b-a,1)):(this.time=Math.max(b-4*a,1+Bq),c=1-(this.time-(1+Bq)));this.Ab.setScale(.3*Hc(c),.3*Cb(c)).R(-50*Cb(c))};var Bq=.5;u(np,Rl);np.prototype.set=function(a,b,c,d,e,f,g){e=void 0===e?300:e;f=void 0===f?120:f;g=void 0===g?4280332490:g;switch(a){case rq:this.m.Jc("assets/common/fuel.png").Eb(244*.8,254*.8);break;case yw:this.m.Jc("assets/common/nitro.png").Eb(154.7,221.2);break;case $i:this.m.Jc("assets/common/coin.png").Eb(185.5, 193.2)}bh(this.value,b).Ra(30+e/2);this.C.Eb(e+34,f+34);this.u.Eb(e,f).setColor(g);this.g.width=e;this.l.visible=this.o.visible=!1;if(c){a=this.title;a.L(!0);switch(c){case TI:tl(a,"assets/common/combo.png").Eb(350,134).setPosition(-90,0);this.l.visible=this.o.visible=!0;hb(this.o,0,d);break;case XI:tl(a,"assets/common/wow.png").Eb(328,158).setPosition(-20,0);break;case WI:tl(a,"assets/common/cool.png").Eb(376,165).setPosition(-20,0);break;case xq:tl(a,"assets/common/strike.png").Eb(416,158).setPosition(-20, -20)}this.g.R(120).setScale(.8)}else this.title.visible=!1,this.g.R(0).setScale(1)};u(fv,ib);p=fv.prototype;p.bn=function(){this.i(this.ie);this.ie.Wa.Hb.PolCarBone01.i(this.Gk);this.visible=!0;this.setPosition(0,0,0);this.I(0,0,0);this.state=Pl;for(var a=this.j,b=this.vg,c=this.g,d=1;dc){c=1;var e=.25*d}else e=d*Math.asin(1/c)*lP;c=c*Math.pow(2,-10*a)*Math.sin((a-e)*le/d)+1}}else c=qd(a);this.V.scale=c;this.u.opacity=.5*a;b||0!==a||(b=this.app,b.input.enable(),b.screen.remove(this))};var qR=qa++,pg=qa++; u(Df,Ea);u(Vl,tb);Vl.prototype.Nc=function(){tb.prototype.Nc.call(this);this.app.screen.clearDepth=!1};Vl.prototype.yb=function(){tb.prototype.yb.call(this);this.app.screen.clearDepth=!0};Vl.prototype.layout=function(){tb.prototype.layout.call(this);var a=this.width,b=this.height;this.g.Eb(a,b).setPosition(a/2,b/2)};var hv=new sd("attribute vec2 position;\n\tattribute mediump vec2 uv;\n uniform mat4 projectionViewWorldMatrix;\n\tvarying mediump vec2 vUv;\n void main() {\n\t\tgl_Position = projectionViewWorldMatrix * vec4(position, 0.0, 1.0);\n vUv = gl_Position.xy;\n\t}", "precision mediump float;\n\tvarying mediump vec2 vUv;\n void main() {\n float x = vUv.x;\n float y = vUv.y;\n float v = sqrt(x * x + y * y);\n vec4 bg = vec4(5.0/255.0, 69.0/255.0, 252.0/255.0, 1.0);\n vec4 fr = vec4(136.0/255.0, 247.0/255.0, 250.0/255.0, 1.0);\n gl_FragColor = mix(fr, bg, v);\n\t}");u(Ya,tb);Ya.prototype.layout=function(){tb.prototype.layout.call(this);var a=this.width;this.kd.width=this.He.width=a+200;this.top.x=this.g.x=a/2;this.V.y= this.height/2};Ya.prototype.show=function(a){var b=this;this.J=this.Kc=!0;this.dc=1;this.Pd||(this.re=0);var c=this.app,d=c.screen,e=c.ve;(this.C=e.Pd&&!(void 0===a?0:a))?(d.remove(e),d.push(e,-3),d.remove(this),d.push(this,-1)):(this.H=!0,c.Fa.show(function(){d.push(e,-3);d.push(b,-1)},void 0,5));return this};Ya.prototype.fa=function(){this.A(qg);var a=this.app;Zf(a.screen)===this&&(a.$.show(),a.Fa.speed=5);var b=Zf(a.screen);b!==a.Fa&&(this.Kc=!1,this.C=b!==a.sc,this.H=!this.C)};Ya.prototype.update= function(a){tb.prototype.update.call(this,a);var b=this.app,c=this.Kc,d=this.re=Da(this.re+(c?2:-4)*a,0,1),e=c?Eb(1-d):Cb(1-d);this.top.y=100-700*e;var f=this.width,g=this.V;g.x=f/2+(this.C?c?f*Wc(1-d):-f*Wc(1-d):0);g.scale=this.H?c?Cb(d):Eb(d):1;f=this.J;a=this.dc=Da(this.dc+(f?2:-4)*a,0,1);this.g.y=this.height-170+700*e+700*(f?Eb(1-a):Cb(1-a));c||0!==d||b.screen.remove(this);b.audio.zc("assets/general/base.wav",b.Fa.isActive()?0:1,.25)};var qg=qa++;u(Gc,Ea);Gc.prototype.ob=function(a){var b=this.qb|| Ed,c=b.hd,d=b.jd,e=b.ff,f=b.hf;a.ya(this.Sa);a.cb(b.Ea.alpha?this.g:this.Cb);a.Jc("texture",b);a.Jd(Yg);b=ag(a,96);var g=b.ib,l=b.data,n=a.matrix,r=n.a,w=n.b,y=n.c,A=n.d,H=n.ub;n=n.vb;var I=a.color,O=I.x,S=I.y,R=I.z;I=I.w;var ja=this.width,ka=this.height,ea=this.o,ma=1/this.u,pa=this.m,va=0;ja-=ea;ja<2*pa&&(va=-4*(1-ja/(2*pa)),pa=ja/2);ja+=ea;ea=pa+ea;var Ka=ea*ma*(e-c)+c,Aa=e-pa*ma*(e-c),Fa=pa*ma*(e-c)+c;ma=e-ea*ma*(e-c);l[g++]=H;l[g++]=n;l[g++]=c;l[g++]=d;l[g++]=O;l[g++]=S;l[g++]=R;l[g++]=I;l[g++]= ea*r+H;l[g++]=ea*w+n;l[g++]=Ka;l[g++]=d;l[g++]=O;l[g++]=S;l[g++]=R;l[g++]=I;l[g++]=pa*r+ka*y+H;l[g++]=pa*w+ka*A+n;l[g++]=Fa;l[g++]=f;l[g++]=O;l[g++]=S;l[g++]=R;l[g++]=I;l[g++]=ka*y+H;l[g++]=ka*A+n;l[g++]=c;l[g++]=f;l[g++]=O;l[g++]=S;l[g++]=R;l[g++]=I;l[g++]=ea*r+H;l[g++]=ea*w+n;l[g++]=Ka;l[g++]=d;l[g++]=O;l[g++]=S;l[g++]=R;l[g++]=I;l[g++]=Math.max(ja-pa,ea)*r+H;l[g++]=Math.max(ja-pa,ea)*w+n;l[g++]=Aa;l[g++]=d;l[g++]=O;l[g++]=S;l[g++]=R;l[g++]=I;l[g++]=Math.max(ja-ea,pa)*r+ka*y+H;l[g++]=Math.max(ja- ea,pa)*w+ka*A+n;l[g++]=ma;l[g++]=f;l[g++]=O;l[g++]=S;l[g++]=R;l[g++]=I;l[g++]=pa*r+ka*y+H;l[g++]=pa*w+ka*A+n;l[g++]=Fa;l[g++]=f;l[g++]=O;l[g++]=S;l[g++]=R;l[g++]=I;l[g++]=ja*r+(ka+va)*y+H;l[g++]=ja*w+(ka+va)*A+n;l[g++]=e;l[g++]=f;l[g++]=O;l[g++]=S;l[g++]=R;l[g++]=I;l[g++]=(ja-ea)*r+(ka+va)*y+H;l[g++]=(ja-ea)*w+(ka+va)*A+n;l[g++]=ma;l[g++]=f;l[g++]=O;l[g++]=S;l[g++]=R;l[g++]=I;l[g++]=(ja-pa)*r+va*y+H;l[g++]=(ja-pa)*w+va*A+n;l[g++]=Aa;l[g++]=d;l[g++]=O;l[g++]=S;l[g++]=R;l[g++]=I;l[g++]=ja*r+va*y+H; l[g++]=ja*w+va*A+n;l[g++]=e;l[g++]=d;l[g++]=O;l[g++]=S;l[g++]=R;l[g++]=I;b.ib=g;bg(a,3)};u(Af,Gc);u(qp,Gc);u(yi,sa);u(dd,Gc);u(iv,Gc);u(jv,sa);u(zi,Gc);u(rp,Gc);u(Xj,sa);Xj.prototype.reset=function(){this.g=0};Xj.prototype.update=function(a){a=this.g+=6*a;var b=Math.sin(a),c=Math.cos(a);this.J.rotation=-4*b;this.ve.y=165+5*b;this.l.rotation=90*a;this.left.setScale(1+.1*Math.abs(b),1+.1*Math.abs(c));this.H.rotation=90*a;this.right.setScale(1+.1*Math.abs(b),1+.1*Math.abs(c));this.o.y=19-6*Math.abs(c); this.m.rotation=3*c;this.m.y=88-8*Math.abs(b);this.u.setScale(1+.3*Math.abs(b),1+.3*Math.abs(c)).R(218-30*Math.abs(c));this.C.setScale(1+.3*Math.abs(Math.sin(a+1)),1+.3*Math.abs(Math.cos(a+1))).R(218-30*Math.abs(Math.cos(a+1)));this.D.setScale(1+.3*Math.abs(Math.sin(a+2)),1+.3*Math.abs(Math.cos(a+2))).R(218-30*Math.abs(Math.cos(a+2)))};u(lg,xf);lg.prototype.ob=function(a){this.app.Pj.focus=this.focus;xf.prototype.ob.call(this,a)};u(Ee,kg);Ee.prototype.Og=function(a){a=void 0===a?null:a;var b=this.effect; if(b!==a||a&&a.parent!==this)if(b&&b.parent&&b.parent.removeChild(b),this.effect=a)ee(this,a.setPosition(this.width/2,this.g?this.g.y:this.height/2).setScale(2),2),a.pb()};Ee.prototype.$a=function(a,b){return kg.prototype.$a.call(this,a,b)||this.g&&this.g.$a(a,b)};Ee.prototype.C=function(){switch(this.state){case Kf:this.color=4291611852;break;default:this.color=4294967295}if(this.g)switch(this.state){case Lf:var a=this.K;this.g.Ia(-3).R(a);this.o.Ia(-3).R(a);break;default:a=this.offset,this.g.Ia(0).R(a), this.o.Ia(0).R(a)}};u(lv,Ee);u(jb,Ee);u(md,Ee);u(Wl,Ee);u(Wd,md);Wd.prototype.$a=function(a,b){return md.prototype.$a.call(this,a,b)||this.l.$a(a,b)||this.D.$a(a,b)};Wd.prototype.C=function(){md.prototype.C.call(this);switch(this.state){case Lf:this.l.Ia(-3).R(20);this.D.Ia(-3).R(20);this.H.Ia(-3).R(20);this.J.Ia(-3).R(20);break;default:this.l.Ia(0).R(40),this.D.Ia(0).R(40),this.H.Ia(0).R(40),this.J.Ia(0).R(40)}};u(Ai,Ea);Ai.prototype.ob=function(a){var b=this.qb||Ed,c=b.hd,d=b.jd,e=b.ff,f=b.hf,g= this.o||Ed,l=g.hd,n=g.jd,r=g.ff,w=g.hf;a.ya(this.Sa);a.cb(g.Ea.alpha?this.g:this.Cb);a.Jc("texture",b);a.Jc("mask",g);a.Jd(rR);b=ag(a,40);g=b.ib;var y=b.data,A=a.matrix,H=A.a,I=A.b,O=A.c,S=A.d,R=A.ub;A=A.vb;var ja=a.color,ka=ja.x,ea=ja.y,ma=ja.z;ja=ja.w;var pa=this.width,va=this.height;y[g++]=R;y[g++]=A;y[g++]=c;y[g++]=d;y[g++]=l;y[g++]=n;y[g++]=ka;y[g++]=ea;y[g++]=ma;y[g++]=ja;y[g++]=pa*H+R;y[g++]=pa*I+A;y[g++]=e;y[g++]=d;y[g++]=r;y[g++]=n;y[g++]=ka;y[g++]=ea;y[g++]=ma;y[g++]=ja;y[g++]=pa*H+va*O+ R;y[g++]=pa*I+va*S+A;y[g++]=e;y[g++]=f;y[g++]=r;y[g++]=w;y[g++]=ka;y[g++]=ea;y[g++]=ma;y[g++]=ja;y[g++]=va*O+R;y[g++]=va*S+A;y[g++]=c;y[g++]=f;y[g++]=l;y[g++]=w;y[g++]=ka;y[g++]=ea;y[g++]=ma;y[g++]=ja;b.ib=g;bg(a,1)};Db.Object.defineProperties(Ai.prototype,{o:{configurable:!0,enumerable:!0,get:function(){return this.m},set:function(a){"string"===typeof a&&(a=this.app.oa.get(a));this.m=a}}});var mH=new sd("attribute vec2 position;\n\tattribute mediump vec2 uv;\n attribute mediump vec2 maskUv;\n\tattribute lowp vec4 color;\n\tuniform mat4 projectionViewWorldMatrix;\n\tvarying lowp vec4 vColor;\n\tvarying mediump vec2 vUv;\n varying mediump vec2 vMaskUv;\n\tvoid main() {\n\t\tvColor = color;\n\t\tvUv = uv;\n vMaskUv = maskUv;\n\t\tgl_Position = projectionViewWorldMatrix * vec4(position, 0.0, 1.0);\n\t}", "precision mediump float;\n\tvarying lowp vec4 vColor;\n\tvarying mediump vec2 vUv;\n varying mediump vec2 vMaskUv;\n\tuniform sampler2D texture;\n uniform sampler2D mask;\n\tvoid main() {\n\t\tlowp vec4 color = vColor * texture2D(texture, vUv);\n lowp vec4 masked = texture2D(mask, vMaskUv);\n color.a *= masked.a;\n\t\tif (color.a == 0.0) discard;\n\t\tgl_FragColor = color;\n\t}"),nH=new sd("attribute vec2 position;\n\tattribute mediump vec2 uv;\n attribute mediump vec2 maskUv;\n\tattribute lowp vec4 color;\n\tuniform mat4 projectionViewWorldMatrix;\n\tvarying lowp vec4 vColor;\n\tvarying mediump vec2 vUv;\n varying mediump vec2 vMaskUv;\n\tvoid main() {\n\t\tvColor = color;\n\t\tvUv = uv;\n vMaskUv = maskUv;\n\t\tgl_Position = projectionViewWorldMatrix * vec4(position, 0.0, 1.0);\n\t}", "precision mediump float;\n\tvarying lowp vec4 vColor;\n\tvarying mediump vec2 vUv;\n varying mediump vec2 vMaskUv;\n\tuniform sampler2D texture;\n\tuniform sampler2D maskAlpha;\n\tvoid main() {\n\t\tlowp vec4 color = vColor;\n\t\tcolor.a *= texture2D(maskAlpha, vMaskUv).r;\n\t\tif (color.a == 0.0) discard;\n\t\tgl_FragColor = color * texture2D(texture, vUv);\n\t}"),rR={position:new Yb([],2,0,40,!1),uv:new Yb([],2,8,40,!1),maskUv:new Yb([],2,16,40,!1),color:new Yb([],4,24,40,!1)};u(nh,sa);nh.prototype.pb= function(a){var b=this.o;if(a)switch(a.event){case zc:b=this.u;break;case Ac:b=this.l}this.effect=b;b.pb();a=this.wc;for(var c=0;cd;++d)$c(c[d].Ia(-60*a+60*d).setScale(b* (1.4+.2*Math.cos(3*a+d)),b*(2.52+.2*Math.sin(2*a+d))),b)};u(Ye,ib);p=Ye.prototype;p.dn=function(a){this.Hc.visible=a};p.isLoaded=function(){return(!this.Gc||this.Gc.isLoaded())&&(!this.j||this.j.isLoaded())&&(!this.g||this.g.isLoaded())&&!0};p.Yc=function(){var a=this.Gc;a&&(a.Yc=!0);if(a=this.j)a.Yc=!0;if(a=this.g)a.Yc=!0;return this};p.Qb=function(){return this.Gc&&this.m.Qb()||this.j&&this.Ta.Qb()||this.g&&this.o.Qb()};p.play=function(a,b,c){this.m.play(a,b,c);this.Ta.play(a,b,c);this.o.play(a, b,c)};p.Ed=function(a){return this.j?this.Ta.Ed(a):this.Gc?this.m.Ed(a):this.g?this.o.Ed(a):0};p.za=function(a,b){this.m.za(a,b);this.Ta.za(a,b);this.o.za(a,b)};p.Tc=function(a,b){this.za(Da(this.Ed(b)+a,0,1),b)};p.set=function(a,b,c){var d=this;c=void 0===c?null:c;var e=this.app.S,f=this.Ta,g=this.j;g&&(g.parent&&g.parent.Vc(g),e.release(g),uf(f,null));this.C=null;if(a){var l=a.model;Cd(l)||e.register(l);g=this.j=e.aa(l);g.ia(function(){if(d.j===g){uf(f,g);d.C=g.Wa.Hb.Body01;var A=a.Qn;if(!A.length)for(var H= g.Wa.Le,I=0;I=(this.mc-=a)&&(this.mc=0);nv(this,5*(this.Ta.Qb(he)?a:-a),he);1===this.l&&0===this.u&&0!==this.Db&&(b.audio.play(this.Ua.Zk),this.u=1.5);this.u=Math.max(this.u-=a,0);var c=this.l,d=this.l=Math.max(this.l-= 3*a,0);this.Ta.za(1.3*Math.sin(d*Math.PI),mv);0=d&&0!==this.Db&&b.audio.play("assets/general/to_kart.wav");b=8*(this.Ta.Qb(Gw)?a:-a);nv(this,b,Gw);this.Tc(-4*a,Xd);break;case Xl:0>=(this.mc-=a)&&(this.mc=0);this.Tc(5*(this.Ta.Qb(he)?a:-a),he);this.Tc(-4*a,Xd);break;case Yj:case Yl:this.Tc(4*a,Xd);break;case sp:0>=(this.mc-=a)&&(this.mc=0),nv(this,5*(this.Ta.Qb(he)?a:-a),he)}if(b=this.isLoaded())this.m.update(a),this.Ta.update(a),c=this.o,c.za(this.je&&this.je.Ue?1:0,Fw),c.update(a);this.Hc.update(a, !b);(c=this.Gc)&&(c.visible=b);c&&c.update(a);(c=this.j)&&(c.visible=b);if(c=this.g)c.visible=b,c.update(a,this.state===Bg||this.state===Im);this.U();return this};var ae=0,he=1,mv=2,Xd=3,Gw=4,Fw=5,Dq=6,Xl=0,Ef=1,Bg=2,Yj=3,Yl=4,Im=5,aJ=6,bJ=7,sp=8,HH=9,FH=10,cJ=11,dJ=12,eJ=13,xH=14,$I=["BoyMounth01","pojarMouth01","TLMouth01","TRMouth01"];u(Zl,ib);Zl.prototype.update=function(a,b){var c=this.Ab;(c.visible=b)&&c.I(this.time+=180*a,0,0)};var oH=new Fb;u(Bi,ac);Bi.prototype.setScale=function(a,b){ac.prototype.setScale.call(this, a,b,1);this.U();return this};var Eq=new Dd;Eq.attributes.position=new Yb([-1,1,0,1,1,0,1,-1,0,-1,-1,0],3);Eq.Kb=new de([0,2,1,0,3,2]);wj(Eq);var IO=Eq;var JO=Za(new Fb,Gd).Da(xI).ya(Dc).define("SHADOW").ab(!1);u(Zj,tb);Zj.prototype.yb=function(){tb.prototype.yb.call(this);this.app.screen.clearColor=!1};Zj.prototype.layout=function(){tb.prototype.layout.call(this);var a=this.width,b=this.height,c=Math.max(a/4096,b/2048);this.V.setPosition(a/2,b/2);this.J.setPosition(a/2,b);this.u.setPosition(Math.min(a/ 2-270,330*c),Math.max(200,b/2-840*c)-b/2);this.na.scale=c+.1};Zj.prototype.update=function(a){var b=this,c=this.app,d=c.da,e=d.count,f=this.ready;if(0===e){var g=this.V;if(g.visible)if(this.C){if(f.visible||(f.visible=!0,this.D||(f.i(this.D=Lb(bd(lb((new nb(c,"assets/common/font.json",c.Ub?"PRESS OK TO CONTINUE":c.Dh?"TAP TO CONTINUE":"CLICK TO CONTINUE",.5,.5)).R(this.W.y)),1100),.85)),Dj(c.platform,"loaded")),d=this.K,this.D.visible=d,this.W.visible=!d),d=this.l)this.l=null,d()}else go(this)&&((e= this.P)?(this.P=null,e()):c.init(),e=this.g=d.count,this.K||this.l||(this.l=function(){b.H()}),this.C=!0);else g.visible=this.J.visible=!0,this.g=0}e>this.g&&(this.g=e);this.C&&(d=this.dc,d.value=Math.max(d.value,0===this.g?0:1-e/this.g));f.visible&&(f.opacity=.2+.8*Math.abs(Math.sin(8*(this.ua+=a))));this.u.state===Zb&&SC(c.platform)&&(this.u.state=Ec)};Zj.prototype.H=function(){this.ready.visible&&this.app.$.start()};u(qh,mb);qh.prototype.Yj=function(a){var b=P.apply(1,arguments),c=gd(this.title, a);c.kg=b;c.g=c.j=!0;this.g.visible=!0;return this.show()};qh.prototype.Ef=function(a){var b=P.apply(1,arguments),c=gd(this.title,a);c.kg=b;c.g=c.j=!0;this.g.visible=!1;this.show(1E3)};qh.prototype.show=function(a){a=void 0===a?0:a;var b=this.g.visible;Ta(this.title,1200,b?550:900,ab).R(b?320:500);return mb.prototype.show.call(this,a)};qh.prototype.fa=function(){this.g.visible&&mb.prototype.fa.call(this)};u($l,Ya);$l.prototype.show=function(a){a=void 0===a?ak:a;var b=this.app,c=b.platform;if(a=== ak&&this.u){this.u=!1;for(var d=this.W,e=0,f;eMath.random()&&(c=a.aa(Rj),c.set(b.pop())),c||yj(a,U(sR));default:return-1===b.usage&&c.event&&c.event.fa&&-1!==a.name.indexOf(c.event.fa)?null:this.location.jh(a,b)||yj(c.S,a.id)}};p.add=function(a,b){b=void 0===b?this.Va:b;a.input&&this.Lc.push(a);a.xc&&this.Cc.push(a);a.update&&this.de.push(a);a.gl&&this.He.push(a);b.i(a);return this};p.remove=function(a){-1===this.ef.indexOf(a)&&this.ef.push(a)};p.update= function(a){tb.prototype.update.call(this,a);this.Ng.update(a);var b=a;if(this.Lf||this.Ng.visible)a=0;else{a:{var c=this.app.Nb;switch(c.state){case Di:case th:case km:c=1-c.rb;break a;default:c=1}}a*=c}this.gg+=a;c=this.l;for(var d=this.tn,e=this.keys,f=0,g=.5*this.width*this.scale,l=0;l=d&&5>g;){l=0;for(var n=e.length;l=a&&this.visible&&(this.visible= !1,this.app.play.A(Ap));var b=Da(a-2.2,0,.3)/.3;b?(1!==b&&0===this.ready.opacity&&this.app.audio.play("assets/general/ready.wav"),$c(this.ready,1-b).setScale(3*b*b*b+1,1+Eb(b))):$c(this.ready,Math.max(a-1.2,0)/.5);(b=Da(a-1.2,0,.3)/.3)?(1!==b&&0===this.g.opacity&&this.app.audio.play("assets/general/go.wav"),$c(this.g,1-b).setScale(Cb(1-b))):$c(this.g,Math.max(a,0)/.3)};u(hm,mi);hm.prototype.reset=function(){this.vi=this.startTime=0;this.Bc(Ek);this.Be.copy(Ek);this.Ye.copy(Ek);this.target.copy(Fk); this.o.copy(Fk);this.m.copy(Fk);this.velocity.set(0,0,0);this.C.set(0,0,0);this.l.copy(Ce);this.u.copy(Zk);this.O.copy(td);this.Z.copy(Zk);JD(this.Bc(Ek),Fk).U()};hm.prototype.xc=function(a){var b=this.Ye;this.Be.copy(b);var c=this.m;this.o.copy(c);var d=this.app.play,e=d.B,f=d.path,g=e.Ye;d=e.ae;var l=this.J,n=this.D.copy(d?d.direction:Ce).scale(20).add(g);d=pi(f,n,!0,d);var r=f.Hd(d,!0,n);r?(f=mo(f,d,r,n),d.direction.dd(r.direction,f,n).normalize(),d.lc.dd(r.lc,f,l).normalize()):(n.copy(d.direction), l.copy(d.lc));n=vn(this.l,n,this.u,a,.25).normalize();r=vn(this.O,l,this.Z,a,.25).normalize();f=n.Fa(r,this.H).normalize();l=this.P;var w=l.elements;w[0]=n.x;w[1]=n.y;w[2]=n.z;w[3]=0;w[4]=f.x;w[5]=f.y;w[6]=f.z;w[7]=0;w[8]=r.x;w[9]=r.y;w[10]=r.z;w[11]=0;w[12]=g.x;w[13]=g.y;w[14]=g.z;w[15]=1;g=l.transformPoint(tR,uR);n=l.transformPoint(vR,wR);e=this.vi=Da(this.vi+(e.Ab?.5:-1)*a,0,1);g.z=(1-.1*e)*(g.z-d.z)+d.z;vn(b,g,this.velocity,a,.07);vn(c,n,this.C,a,.04);a=l.Fc(this.K);a.transformPoint(g);a.transformPoint(b); b.y=g.y;l.transformPoint(b);a.transformPoint(n);a.transformPoint(c);c.y=n.y;l.transformPoint(c)};hm.prototype.update=function(a){var b=this.app,c=b.play,d=c.B,e=this.target;switch(d.state){case Pl:this.Bc(Ek);e.copy(Fk);break;case Fi:case Hd:c=c.Ej,this.Be.dd(this.Ye,c,this),this.o.dd(this.m,c,e),a=this.startTime+=.39*a,a=Da(1-(Da(a,.7,1)-.7)/(1-.7),0,1),a=a*a*(3-2*a),Ek.dd(this,1-a,this),e.dd(Fk,a)}JD(this,e).U();b=b.audio;e=d.x;a=d.y;c=d.z;var f=b.context;if(f){var g=f.listener;g.positionX?(g.positionX.setTargetAtTime(e, f.currentTime,.01),g.positionY.setTargetAtTime(a,f.currentTime,.01),g.positionZ.setTargetAtTime(c,f.currentTime,.01)):g.setPosition(e,a,c)}b.om.set(e,a,c);a=d.Dd(YI).pf(Aq);d=a.x;e=a.y;a=a.z;if(b=b.context)b=b.listener,b.forwardX?(b.forwardX.value=d,b.forwardY.value=e,b.forwardZ.value=a,b.upX.value=0,b.upY.value=0,b.upZ.value=1):b.setOrientation(d,e,a,0,0,1)};var Ek=new E(-4.204,-15.519,2.385),Fk=new E(-4.204,0,2.179),tR=new E(-7,0,5),vR=new E(0,0,2.5);u(uv,tb);p=uv.prototype;p.yb=function(){tb.prototype.yb.call(this); this.app.Fa.isActive()?this.off(jm):this.A(jm)};p.layout=function(){tb.prototype.layout.call(this);this.window.x=this.g.x=this.width/2};p.show=function(a){a=void 0===a?this.state:a;this.Tb=!0;this.rb=0;var b=this.app;b.screen.push(this);Cp(this);switch(this.state=a){case Ci:a="HI! I AM MAX. THE POLICEMAN CAUGHT ME AGAIN... LET'S GET AWAY FROM HIM!";break;case Di:a="GREAT! I WILL HIT THE GAS, AND YOU WILL DRIVE. LET'S TRY TO COLLECT SOME COINS";break;case th:a="AWESOME! I SEE OBSTACLES AHEAD. LET'S SMASH THEM TO BITS!"; break;case km:a="AMAZING! YOU ROCK! KEEP DRIVING UNTIL THE FUEL RUNS OUT!";break;default:a=""}this.window.set(a);b.input.disable();this.update(0);return this};p.fa=function(){this.Tb=!1;var a=this.app;a.input.disable();a.audio.play("assets/general/hide_panel.wav");this.A(xR)};p.update=function(a){tb.prototype.update.call(this,a);var b=this.Tb,c=this.rb=Da(this.rb+(b?2:-4)*a,0,1),d=b?Eb(1-c):Cb(1-c);this.window.R(150-700*d).update(a);this.g.R(this.height-200+700*d).update(a);b&&1===c&&this.app.input.enable(); b||0!==c||(a=this.app,a.input.enable(),a.screen.remove(this),this.rb=0)};var xR=qa++,jm=qa++,Ci=0,Di=1,th=2,km=3,MO=4;u(Bp,jb);Bp.prototype.update=function(a){var b=this.state;b===Kf?this.l=0:this.l+=a;var c=this.l%5;a=this.D;var d=this.H,e=Math.sin((Da(c,.45,.75)-.45)/.3*Math.PI);d.scale=1+.2*e;d.x=340+40*e;c=Math.sin((Da(c,.35,.35+.3)-.35)/.3*Math.PI);a.scale=1+.2*c;a.x=160+40*c;a.y=b===Lf?d.y=40:d.y=50;this.wa.setScale(a.scale).setPosition(a.x,a.y);this.J.setScale(d.scale).setPosition(d.x,d.y)}; Bp.prototype.$a=function(a,b){return jb.prototype.$a.call(this,a,b)||this.D.$a(a,b)||this.H.$a(a,b)};u(lm,sa);lm.prototype.l=function(){this.update(0)};lm.prototype.set=function(a,b,c){c=void 0===c?0:c;this.label.fc=a;this.time=0;a=this.g;if(a.visible=void 0===b?!1:b)a.opacity=0,this.app.input.disable(),this.time=-c;return this};lm.prototype.update=function(a){var b=this.time,c=Math.max(this.time+=a,0);0=b&&this.app.audio.play("assets/general/show_panel.wav"));b=this.label.text.charCodeAt(Math.floor(10* c));Number.isNaN(b)&&(b=32);b=1.5*Math.abs(Math.sin(.1*(b-32)));var d=this.m,e=d.Ta,f=e.Ed(Xd);f=b>=f?Math.min(f+4*a,b):Math.max(f-4*a,b);e.za(f,Xd);d.update(a);a=this.g;a.visible?(this.Ab.scale=Cb(Math.min(4*c,1)),b=this.sb,d=eo(this,yR.set(0,0)),$c(a.setPosition(d.x-100,d.y-100).Eb(b.width+200,b.height+200),.6*Math.min(4*c,1))):this.Ab.scale=1};u(vv,mb);p=vv.prototype;p.layout=function(){mb.prototype.layout.call(this);this.l.x=this.width/2};p.yb=function(){mb.prototype.yb.call(this);var a=this.app; a.Fa.isActive()||a.play.resume()};p.Vb=function(){var a=this.app,b=this.D,c=a.audio;b.visible=c.isEnabled();c.Eg?c.Qg?bb(b,"assets/common/sound_off.png",227,281):bb(b,"assets/common/sound_on.png",322,281):bb(b,"assets/common/music_on.png",340,282);Fd(this.l,40);b=this.sa;for(c=0;c=d.length&&(e=null);for(var f=0;fb.bl)b.show().once(qg,function(){a.fd.show()}); else a.fd.show()};fk.prototype.layout=function(){mb.prototype.layout.call(this);var a=this.width;this.dc.width=this.kd.width=a+200;this.top.x=this.P.x=a/2};fk.prototype.show=function(){var a=this,b=this.ed,c=this.ua,d=this.ad;b.visible=c.visible=d.visible=!1;var e=Math.random();hb(this.wb,0,this.na=30);.5>e?c.visible=!0:.75>e?d.visible=!0:b.visible=!0;hb(this.xb,0,this.D);this.K=null;this.time=this.g=3;var f=this.l=!1;this.Bf=!1;this.H.visible=!1;this.J&&Ej(this.app.platform,"game-revive",function(g){a.K= g;a.g=4;a.time=a.g;a.l=f;a.H.visible=!0},function(){a.J=!1;a.Bf=!0;a.fa()},function(){a.g=3;a.time=a.g;a.l=f;a.H.visible=!1});return mb.prototype.show.call(this)};fk.prototype.update=function(a){mb.prototype.update.call(this,a);!this.l&&0=(this.time-=a)&&(this.time=0,this.fa());this.fill.width=800*this.time/this.g;hb(this.ja,0,this.C);a=this.rb;a=this.Tb?Eb(1-a):Cb(1-a);this.top.y=100-700*a;Fd(this.P.R(this.height-170+700*a),40)};u(gk,mb);gk.prototype.layout=function(){mb.prototype.layout.call(this); this.K.x=this.width/2};gk.prototype.show=function(a,b,c,d){this.text=a;this.image=b;this.J=c;this.options=d;this.u.visible=!1;a=Zf(this.app.screen);a instanceof Ya?(this.g=a,a.J=!1):this.g=null;return mb.prototype.show.call(this)};gk.prototype.fa=function(){var a=this.g;a&&(a.J=!0,this.g=null);mb.prototype.fa.call(this)};gk.prototype.update=function(a){mb.prototype.update.call(this,a);a=this.rb;this.K.y=this.height-170+700*(this.Tb?Eb(1-a):Cb(1-a))};u(hk,mb);hk.prototype.layout=function(){mb.prototype.layout.call(this); this.D.x=this.width/2};hk.prototype.show=function(){this.u.visible=!1;var a=Zf(this.app.screen);a instanceof Ya?(this.g=a,a.J=!1):this.g=null;return mb.prototype.show.call(this)};hk.prototype.fa=function(){var a=this.g;a&&(a.J=!0,this.g=null);mb.prototype.fa.call(this)};hk.prototype.update=function(a){mb.prototype.update.call(this,a);a=this.rb;this.D.y=this.height-170+700*(this.Tb?Eb(1-a):Cb(1-a))};u(yv,sa);p=yv.prototype;p.Sk=function(){var a=gm(this);return a&&a.Yd};p.fn=function(){var a=this.Id; a[Sb].forEach(function(b){return b.Yc()});a[wc].forEach(function(b){return b.Yc()});a[Mb].forEach(function(b){return b.Yc()});a[Mc].forEach(function(b){return b.Yc()});this.selected.forEach(function(b){return b.L(!1)})};p.Se=function(){return this.o[this.mode].Se()};p.scrollTo=function(a,b,c){b=void 0===b?!0:b;c=void 0===c?!1:c;b&&this.layout();var d=this.mode,e=this.Je,f=this.o;if(a){var g;-1!==(g=e[Sb].indexOf(a))?(f[d=Sb].scrollTo(g,!b),b&&(f=this.app.B,this.m.set(ie(f),a,Gf(f)).L(!0).ka(Ef,!0), f=this.Id[Sb][g],f.visible=!1,f.lb||(f.set(null,e[Sb][g]),f.ka(Ef),f.update(Math.random())))):-1!==(g=e[wc].indexOf(a))?f[d=wc].scrollTo(g,!b):-1!==(g=e[Mb].indexOf(a))?(f[d=Mb].scrollTo(g,!b),b&&(f=this.app.B,this.g.set(ie(f),Ff(f),a).L(!0).ka(Bg,!0),f=this.Id[Mb][g],f.visible=!1,f.je||(f.set(null,null,e[Mb][g]),f.ka(Bg)))):-1!==(g=e[Mc].indexOf(a))&&f[d=Mc].scrollTo(g,!b);this.mode=d}else{var l=this.app.B;g=Ff(l);var n=ie(l);l=Gf(l);var r=e[Sb].indexOf(g),w=e[wc].indexOf(n),y=e[Mb].indexOf(l);f[Sb].scrollTo(-1=== r?0:r,!b);f[wc].scrollTo(-1===w?0:w,!b);f[Mb].scrollTo(-1===y?0:y,!b);f[Mc].scrollTo(0,!b);if(b)switch(this.m.set(n,g,l),this.g.set(n,g,-1===y?e[Mb][0]:l),this.Id[Sb][r].visible=!1,this.Id[Mb][-1===y?0:y].visible=!1,d){case Sb:this.m.L(!0).ka(Ef,!0);break;case Mb:this.g.L(!0).ka(Bg,!0)}}if(b&&!c)for(c=this.H,e=0;eFa&&(Fa=0);this.l||(ea[Sb]=O);va=5*io(va);for(var xa=0;xaFa&&(Fa=0);this.l||(ea[Mb]=S);va=4*io(va);for(xa=0;xaKa&&(Ka=0);this.l||(ea[wc]=I);I=2.5*io(Aa);for(Aa=0;Aava.mc&&(va.mc=Math.min(va.mc+5*a,1.5)),va.update(a)):va.visible&& va.L(!1)}else va.visible&&va.L(!1).Yc()}d=d[Mc];c=c[Mc];A=n[Mc];n=A.Se();f=Cb(f[Mc]*(1-l));1E-4>f&&(f=0);A=4.5*io(A);for(ea=0;ea=dk(d,f)?je(this,this.done): je(this,this.K),hb(this.Cc,0,f.ra)):f.event?(VH(c,this.nl,"COLLECT WITHIN %0 DAYS","COLLECT WITHIN %0"),this.P.visible=!0,og[f.name]&&0>=dk(d,f)?je(this,this.done):je(this,this.D)):je(this,this.D);else je(this,this.Hc);this.ih.visible=!0;Ta(this.title.Ra(-250),1E3,100)}else je(this,c.platform.bg()?this.notify:this.D),Ta(this.title.Ra(0),1500,100);this.Hc.ka(Zb);this.Lc.update(a);this.done.ka(Zb);f&&gd(this.title,f.name);this.left.visible=0e&&(15>=f?Math.floor(d*f)!==Math.floor(e*f)&&b.audio.play("assets/general/counter.wav"):Math.floor(d/.065)!==Math.floor(e/.065)&&b.audio.play("assets/general/counter.wav"));d=Math.min(e,1);hb(this.title,0,Math.floor(d*f)).setScale(1+.2*Math.sin(d*Math.PI));hb(this.ja,0,Math.floor(d*this.D));e=Math.floor(d*this.Cc)+this.xb;var g=this.app.B;f=Hi(g,e);d=qk(g,f);g=qk(g,f+1);e-=d;d=g-d;hb(hb(this.Od,0,e),1,d);this.exp.width= 550*Da(e/d,0,1);hb(this.kf,0,f);Fd(this.lf,140);f=this.g;f.Pg(fo(this.buttons,40));c.update(a);mg(this.Ca,17,-.5);d=b.Nb;d.window.parent===f?d.window.setPosition(f.width/2,-680).update(a):this.wa===this.$&&Rb(this,this.u);b.audio.zc(c.lb.ld,b.Fa.isActive()||!this.Kc?0:.1,.25,!0)};kk.prototype.Ob=function(a,b){return null!==a||this.app.Ub?this.app.Nb.window.parent===this.g&&a!==this.$?!1:Ya.prototype.Ob.call(this,a,b):Ya.prototype.Ob.call(this,a,b)};u(Jp,Ya);p=Jp.prototype;p.Nc=function(){Ya.prototype.Nc.call(this); this.app.B.unlock(this.l);xc.Ga=1;this.u++};p.yb=function(){Ya.prototype.yb.call(this);xc.Ga=0;this.u++};p.show=function(a,b){var c=this;if(void 0===a)return null;var d=this.app;if(this.Pd)return(d.Ug===this?d.Lm:d.Ug).show(a,b);this.l=a;window.ga&&ga("send","event","Kart Hooligans Unlock",a.name,this.app.da.version,this.app.B.Aa("PT",0)/60);xc.Ga=1;b=d.Na;var e=d.sc,f=e.Pd;this.V.i(b);b.Cj(a,!f);Ya.prototype.show.call(this);up(d.Zh);f&&(this.C=this.H=e.Kc=!1);d.audio.play("assets/general/congrats.wav"); this.effect.pb(a);this.share.visible=Pn(d.platform);Fd(this.g,40);hb(gd(this.title,"%0 UNLOCKED",VO(a.Sb)),0,d.locale.ma(a.name));var g=this.P;g.visible=!1;var l=this.u;HO(ik(b),function(){l===c.u&&(g.visible=!0)});return this};p.layout=function(){Ya.prototype.layout.call(this);var a=this.app.Na;a.parent===this.V&&a.layout()};p.update=function(a){Ya.prototype.update.call(this,a);var b=this.app.Na;b.parent===this.V&&b.update(a);$c(this.effect,this.re).update(a)};u(Kp,Ya);Kp.prototype.show=function(){Ya.prototype.show.call(this); var a=this.app;up(a.Zh);this.share.visible=Pn(a.platform);Fd(this.g,40);var b=a.B,c=this.level=Hi(b);b.kc("L",c);hb(this.u,0,c);hb(gd(this.title,"%0 UNLOCKED"),0,"x"+c);a.audio.play("assets/general/congrats.wav");window.ga&&ga("send","event","Kart Hooligans Level",c,a.da.version,b.Aa("PT",0)/60);return this};Kp.prototype.update=function(a){Ya.prototype.update.call(this,a);$c(this.effect,this.re).update(a);a=this.time=(this.time+a)%Math.PI;this.P.be(1.85+.1*Math.sin(2*a)).I(0,5*Math.sin(2*a),15*Math.cos(4* a)).U()};u(Hv,Ya);p=Hv.prototype;p.Nc=function(){Ya.prototype.Nc.call(this);xc.Ga=1;var a=this.l,b=Lp(this);a[b].Vb();a[(b+1)%a.length].ck()};p.yb=function(){Ya.prototype.yb.call(this);xc.Ga=0};p.Nm=function(){for(var a=this.list,b=this.app.B.yg(),c=0;cuh(a))return a;for(var b=this.list,c=0;cuh(a))return a;return null};p.Me=function(){for(var a=this.list,b=0;b=b&&(this.count=b,this.flush())};u(LH,Jf);u(Jv,Jf);Jv.prototype.j=function(){var a=this.target;if(Math.floor(this.count)=a?(this.count=a,this.flush()):this.count=b}};u(MH,Jf);u(mk,Ya);mk.prototype.A=function(a){if(a!==qg||!this.unlock)return Ya.prototype.A.apply(this,arguments)};mk.prototype.Nc= function(){Ya.prototype.Nc.call(this);xc.Ga=1};mk.prototype.yb=function(){Ya.prototype.yb.call(this);xc.Ga=0};mk.prototype.update=function(a){Ya.prototype.update.call(this,a);var b=this.xb,c=b.time;b.update(a);var d=b.time,e=this.re,f=this.Kc,g=this.effect;1>c&&1<=d&&g.L(!0).pb();g.update(a);var l=b.Ek.kg[0],n=b.Nk.kg[0],r=1.5;0g?g=0:this.u=g=Math.min(g+a,1),hb(this.ja, 0,Math.round(this.wb+(c+g)*l)),g=Math.round(c*n)+this.na,r=this.app.B,a=Hi(r,g),l=qk(r,a),r=qk(r,a+1),g-=l,l=r-l,hb(hb(this.Lc,0,g),1,l),this.exp.width=550*Da(g/l,0,1),hb(this.Zc,0,a),15>n?Math.floor(b*n)!==Math.floor(c*n)&&this.app.audio.play("assets/general/counter.wav"):Math.floor(b/.065)!==Math.floor(c/.065)&&this.app.audio.play("assets/general/counter.wav"),r=2.5):(g.y=-80,b.y=0);Fd(this.Od,140);d=e*(Da(d,r,r+.5)-r)/.5;f=f?Eb(1-d):Cb(1-d);Fd(this.g,40).y=this.height-170+700*f};u(Kv,If);p=Kv.prototype; p.sk=function(){var a=this.app,b=a.platform;$s(b)&&(If.prototype.sk.call(this),a.sa.on($g,function(){b.qf()}))};p.layout=function(a,b){If.prototype.layout.call(this,a,b);this.Na.height=b};p.Vb=function(){for(var a=this.app,b=a.B,c=vp(b),d=c.length,e=300,f=this.g,g=this.l,l=this.o,n=f.length,r;n=e&&l<=b;g.opacity=g.yd.opacity=1-Da((l-b+850)/400,0,1)}d=this.process;f=d.y;d.visible&&f>=e&&f<=b&&(d.update(a),d.opacity=1-Da((d.y-b+700)/250,0,1),c.Bg())};u(Lv,sa);Lv.prototype.g=function(a){var b=this;if(a){var c= this.uk;if(c){var d=this.yd;d.qb?d.visible=d.qb.isLoaded():d.qb=this.app.oa.get(c,{Ga:1,crossOrigin:""},function(){b.uk===c&&(b.am.opacity=0,d.visible=!0)})}}else this.yd.visible=!1};u(Mv,If);p=Mv.prototype;p.Me=function(a){this.g=null;this.m=0;var b=Nv(this);if(b){var c=this.m=this.app.B.Aa("CI",0);if(b=b[c])c=new (b.Sg||Jf)(this.app,"CT",b.target,b.text,b.event),c.priority=90,c.qa=b.qa,c.Gm=b.ta,c.index=b.index,b=this.g=c.on(Hw,this.o),a.push(b)}};p.Vb=function(){var a=this.app.sa;a.title.fc="CITY QUESTS"; a.ih.visible=!0;this.Kc&&this.g&&aP(a,this.g);for(var b=this.sa,c=0;cd;e.Md(f.text,g?0:f.target,f.target,g,f.qa)}e.visible=!0}for(d=c=0;d=this.app.B.Aa("CL",0)};p.Bm=function(){var a=this.app.sc;bb(a.sa,"assets/common/city.png",283,315,!1,40,30);a.nl.fc="COMPLETE CITY QUESTS"};var um=[[{text:"COLLECT COINS",target:50,event:Ql,qa:{ja:100,exp:10},ta:400},{text:"HIT SUITCASES",target:5,event:Qo,qa:{id:"WRECKING BALL"},ta:600}], [{text:"DRIVE ALONG ACCEL STRIPS",target:10,event:Bw,qa:{ja:200,exp:20},ta:800},{text:"TAKE THE HIGHWAY",target:3,event:Qu,qa:{id:"LIGHTOR"},ta:1E3}],[{text:"KNOCK COINS OUT OF CASH CARS",target:20,event:FI,qa:{ja:250,exp:30},ta:1500},{text:"BUMP INTO CARS AT CROSSROADS",target:6,event:EI,qa:{id:"T-1000"},ta:2E3}],[{text:"HIT ORANGE SAFETY BARRIERS",target:3,event:Mo,qa:{ja:300,exp:40},ta:2500},{text:"MISS HIGHWAY TURNS",target:2,event:Uu,qa:{id:"ARROW SIGN"},ta:3E3}],[{text:"GET STUCK IN BITUMEN SPOTS", target:3,event:Pu,qa:{ja:400,exp:50},ta:3500},{text:"COLLECT COINS ON THE HIGHWAY",target:250,event:Ru,qa:{ja:500,exp:70},ta:4E3},{text:"BREAK ARM BARRIERS",target:10,event:Lo,qa:{id:"MEGAN"},ta:5E3}],[{text:"TURN LEFT AT FORKS",target:4,event:II,qa:{ja:600,exp:80},ta:5500},{text:"BUMP INTO BLUE PASSENGER CARS",target:7,event:OI,qa:{ja:700,exp:100},ta:6E3},{text:"HIT TRASH CONTAINERS",target:10,event:$o,qa:{id:"ROLLER"},ta:6500}],[{text:"DO A RAMP JUMP ON THE HIGHWAY",target:6,event:Su,qa:{ja:700, exp:120},ta:7E3},{text:"PASS THROUGHT COINS GATES",target:15,event:No,qa:{ja:800,exp:150},ta:7500},{text:"BUMP INTO CASH CARS",target:5,event:GI,qa:{id:"WARNING"},ta:8E3}],[{text:"HIT BARRELS",target:20,event:To,qa:{ja:900,exp:170},ta:8500},{text:"DRIVE ONTO AN OVERPASS",target:10,event:Vo,qa:{ja:1E3,exp:200},ta:9E3},{text:"SWEEP AWAY TABLES AND CHAIRS",target:15,event:bp,qa:{id:"ALFREDO"},ta:9500}],[{text:"BUMP INTO RED TRUCKS",target:20,event:LI,qa:{ja:1100,exp:250},ta:1E4},{text:"BUMP INTO CARS ON THE HIGHWAY", target:20,event:ep,qa:{ja:700,exp:300},ta:10500},{text:"BREAK STATUES",target:12,event:Xo,qa:{id:"CLEANER"},ta:11E3}],[{text:"PASS THROUGHT GAS GATES",target:20,event:Oo,qa:{ja:1300,exp:350},ta:11500},{text:"BREAK ROAD BARRICADES",target:30,event:Ml,qa:{ja:1500,exp:400},ta:12E3},{text:"HIT SPOTLIGTHS",target:40,event:ap,qa:{id:"BIG CHAIN"},ta:12500}],[{text:"BREAK CRATES ON THE HIGHWAY",target:15,event:fp,qa:{ja:1700,exp:450},ta:13E3},{text:"BREAK TREES",target:30,event:Uo,qa:{ja:2E3,exp:500},ta:13500}, {text:"HIT ATMS",target:20,event:Ro,qa:{id:"ROBIN"},ta:14E3}],[{text:"HIT SPEED LIMIT 40 MPH SIGNS",target:20,event:So,qa:{ja:2300,exp:600},ta:14500},{text:"KNOCK OVER TRAFFIC CONES",target:60,event:dp,qa:{ja:2500,exp:700},ta:15E3},{text:"SCATTER GARBAGE BAGS",target:100,event:Uj,qa:{id:"DUSTCAR"},ta:15500}],[{text:"HIT SUPERMARKET TROLLEYS",target:30,event:cp,qa:{ja:2700,exp:800},ta:16E3},{text:"HIT FLOWER BEDS",target:50,event:Yo,qa:{ja:3E3,exp:900},ta:16500},{text:"COLLECT BONUSES ON THE HIGHWAY", target:25,event:Tu,qa:{id:"FLASHER"},ta:17E3}],[{text:"PASS THROUGHT NITRO GATES",target:30,event:Po,qa:{ja:3300,exp:1E3},ta:17500},{text:"HIT HYDRANTS",target:50,event:Wo,qa:{ja:3500,exp:1100},ta:18E3},{text:"SMASH TRASH BINS",target:50,event:Zo,qa:{id:"PASCAL"},ta:19E3}],[{text:"BUMP INTO VANS",target:60,event:Aw,qa:{ja:4E3,exp:1300},ta:2E4},{text:"LAND ON TOP OF CARS",target:5,event:DI,qa:{ja:5E3,exp:1500},ta:21E3},{text:"HIT NO ENTRY SIGN",target:50,event:Nl,qa:{id:"EXCAVATOR"},ta:22E3}]];u(Np, Ya);p=Np.prototype;p.Nc=function(){Ya.prototype.Nc.call(this);xc.Ga=1};p.yb=function(){Ya.prototype.yb.call(this);xc.Ga=0};p.has=function(){for(var a,b=this.app,c=b.B,d=0;db?1:0):c};p.yj=function(){return this.app.locale.ma("ME")};p.Pb=function(){return this.Aa("BS",0)};p.description=function(a){return Ei[a]||pk[a]||wh[a]};p.unlock=function(a){this.vh(ke[a.name]||a.name,!0);return this};p.Md=function(a){a=a.name;Ei[a]?Dv(this,a):pk[a]?Cv(this,a):wh[a]&&Fp(this,a);return this};p.yg=function(){return this.ma("MT","")};p.Qa=function(a){return this.Aa(ke[a]||a,0)};p.zd=function(a){return this.Aa(ke[a]||a,0)};p.cc=function(){var a=this.app,b=a.event;b&&b.storage!== this.ma("EV","")&&this.remove("ET");b&&this.rc("EV",b.storage);b&&(b.co=0);if(a=a.Na)Ep(a,Sb,sm),Ep(a,wc,rm),Ep(a,Mb,Gi),Ep(a,Mc,zR)};var sH=qa++,bP=qa++,cP=qa++,dP=qa++,im=qa++,wv=qa++,ok={},ke={};u(gc,Oa);gc.prototype.isLoaded=function(){var a=this.model.isLoaded(),b=this.Gd;b=b?b.isLoaded():!0;var c=this.animation;c=c?c.isLoaded():!0;var d=this.o;d=d?d.isLoaded():!0;this.Yc&&(this.Yc=!1,a||this.app.Zb.get(this.C,xc),b||this.app.Zb.gb(this.u,xc),c||this.app.xd.get(this.l,xc),d||this.app.audio.gb(this.O, xc));return a&&b&&c&&d};gc.prototype.ia=function(a,b){var c=this;if(this.isLoaded())a&&a();else if(b){var d=function(l){a&&c.off(Qp,a);b&&(b(l),b=void 0)};if(a)this.once(Qp,a);this.model.ac(d);var e;null==(e=this.Gd)||e.ac(d);var f;null==(f=this.animation)||f.ac(d);var g;null==(g=this.o)||g.ac(d)}else if(a)this.once(Qp,a);return this};var Qp=qa++,xc={Pc:ui,Ga:0};u(xh,Fb);var zc,Ac,fJ=[zc={start:{month:2,day:7},end:{month:2,day:21},storage:"e1",zd:["VALENTINE"],fa:"_ehide",init:function(a){function b(f){ib.call(this, f);this.i(this.j=(new ib(f)).be(1).i((new Oa(f,"assets/events/val/HeartMenu.mdl",b.g)).be(-1)));this.g=3*Math.random()}function c(f){Te.call(this,f,"assets/general/val_end.vfx")}function d(f){Te.call(this,f,"assets/general/val.vfx")}a.oa.gb("assets/events/val/atlas.json",{Pc:ui});a.Zb.gb("assets/events/val/models.json");zc.ei=new Oa(a,"assets/events/val/KolchLuk01.mdl",new Fb);var e=a.play.xf;e.on(Ae,zc.el=function(){e.Gk.Wa.Hb.PoliceBone02.i(zc.ei);zc.ei.U()});zc.$=(new Hh.model(a)).setScale(1.5); zc.fl=function(){a.sc.show(Mc,!0,Hh,!0)};zc.time=0;u(d,Te);d.Pe=rk;d.id=Bk;a.ba("val_effect",Hh.Vl=d,4);u(c,Te);c.Pe=rk;c.id=Bk;a.ba("val_end_effect",Hh.Wl=c,4);zc.Yd=new ch(a,"assets/common/val.vfx");u(b,ib);b.Pe=rk;b.id=Bk;b.prototype.update=function(f){f=this.g+=.5*f;this.j.setScale(1-.1*Cb(Math.abs(Math.sin(3*f)))).U()};b.g=Za(new na,kd|tc);a.ba("HeartMenu",b,12)},dispose:function(a){a.play.xf.off(Ae,zc.el);zc.ei.parent&&zc.ei.parent.removeChild(zc.ei);Jn(a.S,"HeartMenu")},update:function(a){var b= zc.time+=a;zc.$.I(0,0,10*Math.sin(b));zc.Yd.parent&&zc.Yd.update(a)}},Ac={start:{month:3,day:10},end:{month:3,day:24},storage:"e2",zd:["TREASURE CHEST"],fa:"_ehide",init:function(a){function b(f){ib.call(this,f);this.i(this.j=(new ib(f)).setPosition(0,-.135,-.791).i(this.Ab=(new Oa(f,"assets/events/patrick/TrelistMenu01.mdl",b.g)).setPosition(0,.135,.791)));this.g=3*Math.random()}function c(f){Te.call(this,f,"assets/general/patrick_end.vfx")}function d(f){Te.call(this,f,"assets/general/patrick.vfx")} a.oa.gb("assets/events/patrick/atlas.json",{Pc:ui});a.Zb.gb("assets/events/patrick/models.json");Ac.di=new Oa(a,"assets/events/patrick/BorodaPol01.mdl",(new Fb).define("SKINNING"));var e=a.play.xf;e.on(Ae,Ac.el=function(){e.ie.Wa.Hb.PolCarBone01.i(Ac.di);e.vg.object=Ac.di});Ac.$=(new Ih.model(a)).setScale(.85);Ac.fl=function(){a.sc.show(Mc,!0,Ih,!0)};Ac.time=0;u(d,Te);d.Pe=rk;d.id=Bk;a.ba("patrick_effect",Ih.Vl=d,4);u(c,Te);c.Pe=rk;c.id=Bk;a.ba("patrick_end_effect",Ih.Wl=c,4);Ac.Yd=new ch(a,"assets/common/patrick.vfx"); u(b,ib);b.Pe=rk;b.id=Bk;b.prototype.update=function(f){f=this.g+=1*f;this.j.I(2*Math.sin(4*f+1),5*Math.cos(f),3*Math.sin(3*f)).U()};b.g=Za(new na,kd|tc);a.ba("TrelistMenu01",b,12)},dispose:function(a){a.play.xf.off(Ae,Ac.el);Ac.di.parent&&(Ac.di.parent.removeChild(Ac.di),a.play.xf.vg.object=null);Jn(a.S,"TrelistMenu01")},update:function(a){var b=Ac.time+=a;Ac.$.I(0,0,10*Math.sin(b));Ac.Yd.parent&&Ac.Yd.update(a)}}];u(PH,gc);u(Pv,ib);p=Pv.prototype;p.hn=function(a){this.Hc.visible=a};p.isLoaded=function(){for(var a= this.Qa,b=0;b=a&&(this.g=8+Math.random())};var Oq=function(a,b,c,d,e){gc.call(this,a,b,c,d,e);this.i(this.g=new Oa(a,b,HR));this.time=0;this.on(wl,this.j)};u(Oq,df);Oq.prototype.j=function(a){this.g.visible=a};Oq.prototype.update=function(a){a=this.time+=5*a;this.g.Ya("alpha",Math.abs(Math.sin(a)))};var HR=eg((new Fb).ya(ph).Da(cq).ab(!1).td(-1,-10));var IR=sf(new xh,"SKINNING");var Pq=function(a,b,c,d,e){gc.call(this,a,b,c,d,e);var f=this;this.time=Math.random(); this.mode=0;var g=this.g=[];this.ia(function(){var l=V(b)+"/sphere.mdl";Fn(a.Zb.get(l).Za,Math.min(sJ.we,12));for(var n=0;12>n;++n)f.i(g[n]=(new Oa(a,l,sJ)).setScale(.095));g[0].setPosition(.339,.354,.354);g[1].setPosition(.339,.354,-.354);g[2].setPosition(.358,.177,.177);g[3].setPosition(.358,.177,-.177);g[4].setPosition(.339,0,.354);g[5].setPosition(.339,0,0);g[6].setPosition(.339,0,-.354);g[7].setPosition(.358,-.177,.177);g[8].setPosition(.358,-.177,-.177);g[9].setPosition(.339,-.354,.354);g[10].setPosition(.339, -.354,0);g[11].setPosition(.339,-.354,-.354);f.Md()})};u(Pq,df);Pq.prototype.Md=function(){var a=Kw[this.mode],b=a.color;a=a.points;var c=this.g;c.forEach(function(d){return d.visible=!1});0=(this.time-=a)&&(a=Math.floor(Math.random()*Kw.length),this.mode=a===this.mode?(a+1)%Kw.length:a,this.Md(),this.time=2+Math.random())};var Kw=[{points:[0,1,2,3,5,7,8,9,11],color:qP},{points:[0,1,3,4,5,7,9,10, 11],color:av},{points:[0,1,2,5,6,8,9,10,11],color:pP}];var sJ=po((new na).Da(cq).ab(!1));var JR=sf(new xh,"SKINNING");var tJ=function(a,b,c,d,e){gc.call(this,a,b,c,d,e);var f=this;this.ia(function(){f.Wa.Hb.TurbBone01.i((new Vb(a)).I(-90,0,20).setScale(.35,.45,.35).setPosition(.437,0,0)).i((new Vb(a)).I(-90,0,20).setScale(.35,.45,.35).setPosition(.437,0,.468)).i((new Vb(a)).I(-90,0,20).setScale(.35,.45,.35).setPosition(.437,0,-.468))})};u(tJ,df);var Lw=function(a,b,c,d,e){gc.call(this,a,b,c,d,e); var f=this;this.effect=new wb(a,"assets/general/migalka.vfx");this.ia(function(){f.Wa.Hb.MigBone01.i(new Oa(a,V(b)+"/Migalka01_1.mdl",KR)).i(f.effect)})};u(Lw,df);Lw.prototype.update=function(a){this.effect.update(a)};var KR=eg((new Fb).ya(Dc)).Cf(.8).ab(!1).Da(3999);var LR=(new xh).tb(Sc);var Mw=function(a,b,c,d,e){gc.call(this,a,b,c,d,e);var f=this;this.g=null;this.ia(function(){f.g=f.Wa.Hb.SpeedB02});this.time=0};u(Mw,df);Mw.prototype.update=function(a,b){var c=this.g;c&&(a=this.time+=5*a,c.I(180, (void 0===b?0:b)?10*(Math.sin(2*a)+Math.cos(3*a)):-115+230*this.app.play.B.velocity/100,89.025))};var uJ=function(a,b,c,d,e){gc.call(this,a,b,c,d,e);var f=this;this.ia(function(){f.Wa.Hb.TurbBone01.i(gg((new Vb(a)).I(0,0,0).setScale(.2,.2,.35).setPosition(.467,.055,0),4278255360)).i(gg((new Vb(a)).I(90,0,20).setScale(.2,.2,.35).setPosition(.467,.055,0),4278255360)).i(gg((new Vb(a)).I(180,0,0).setScale(.2,.2,.35).setPosition(.467,.055,0),4278255360)).i(gg((new Vb(a)).I(270,0,20).setScale(.2,.2,.35).setPosition(.467, .055,0),4278255360)).i(gg((new Vb(a)).I(0,0,0).setScale(.2,.2,.35).setPosition(.87,.214,.026),4294936712)).i(gg((new Vb(a)).I(90,0,25).setScale(.2,.2,.35).setPosition(.87,.214,.026),4294936712)).i(gg((new Vb(a)).I(180,0,0).setScale(.2,.2,.35).setPosition(.87,.214,.026),4294936712)).i(gg((new Vb(a)).I(270,0,25).setScale(.2,.2,.35).setPosition(.87,.214,.026),4294936712))})};u(uJ,df);var MR=sf(new xh,"SKINNING")}var Fv,Gi=[{name:"BALLOONS",storage:"d21",Sb:3,G:"ValBalls",image:"Balloons",animation:"Bone025", Ba:"HEART",event:zc},{name:"LUCKY POT",storage:"d22",G:"Gorshok01",image:"LuckyPot",animation:"Gor01",Ba:"LUCKY COIN",event:Ac},Fv={name:"SHARK FIN",storage:"d1",G:"Plavnik01",image:"Shark",Ie:"BULLDOG",ra:10},{name:"WINDING KEY",storage:"d2",G:"Key01",image:"Key",animation:"KeyB01",ra:300},{name:"BOXING GLOVES",storage:"d3",Sb:3,G:"Perchatki01",image:"Boxing",animation:"PerchB01",ra:500},{name:"LUCKY CAT",storage:"d4",G:"Kat01",image:"LuckyKat",animation:"KatB01",ra:700},{name:"LIGHT BAR",storage:"d5", Sb:1,G:"Proj01",image:"SearchLight",Ie:"TURBINE",ra:1E3,ic:tJ},{name:"TURBINE",storage:"d6",Sb:1,G:"Turbina01",image:"Turbine",animation:"TurbBone01",Ue:["TurbBone02"],ra:2E3},{name:"ROLLER SKATES",storage:"d7",Sb:3,G:"Roliki01",image:"Roller",Ie:"BOXING GLOVES",ra:3E3},{name:"SAW",storage:"d8",Sb:1,G:"Pila01",image:"Saw",animation:"PilaBone01",ra:5E3},{name:"SPEEDOMETER",storage:"d9",G:"Speed02",image:"Speedo",hc:"Speed01",animation:"SpeedB01",ic:Mw,ra:7E3},{name:"POOPY",storage:"d10",G:"Kakaha01", image:"Poopy",animation:"KaBone01",ra:1E4},{name:"BULLDOG",storage:"d11",G:"Dog01",image:"Bulldog",animation:"dogBone01",ra:13E3},{name:"TRAFFIC SIGNAL",storage:"d12",G:"Svet01",image:"Traffic",hc:"svet01",Ie:"TURBINE",ic:uJ,Ba:"TRAFFIC WAND"},{name:"STOP",storage:"d13",G:"Kirpich01",image:"Stop",pa:MR,ic:Nq,Ba:"BRICK"},{name:"PIZZA",storage:"d14",Sb:1,G:"Pizza",image:"Pizza",hc:"Pizza01",animation:"PizzaBone01",Ba:"CHEESE"},{name:"SAFE",storage:"d15",G:"Seyf01",image:"Safe",animation:"SeyfBone01", Ba:"GOLD BARS"},{name:"WRECKING BALL",storage:"d16",Sb:1,G:"Shar01",image:"WreckingBall",hc:"shar01",animation:"sharB01"},{name:"ARROW SIGN",storage:"d17",G:"Tablo01",image:"Signlight",hc:"Tablo002",pa:JR,ic:Pq,Gd:!0},{name:"WARNING",storage:"d18",Sb:1,G:"AvarZn01",image:"Warning",pa:IR,ic:Oq},{name:"BIG CHAIN",storage:"d19",Sb:1,G:"Cepochka01",image:"BigChain",Ie:"WRECKING BALL"},{name:"FLASHER",storage:"d20",Sb:1,G:"Migalka01",image:"Flasher",animation:"MigBone01",Ue:["MigBone02"],ic:Lw,pa:LR,Gd:!0}, {name:"MORE ACCESSORIES COMING SOON",fi:!0}];if(gc){var wh={};for(Qq=0;QqThe game is sandboxed. Please visit gemioli.com to play the game.

If you are the webmaster of %0, please use an iframe tag without sandbox attribute").replace("%0",a.g)); return gi.prototype.error.call(this,a)};Ji.prototype.update=function(a){gi.prototype.update.call(this,a);var b=this.event;b&&b.update(a)};Ji.prototype.ba=function(a,b,c){var d=this.S;d.ba(a,b,c);a=d.aa(b);UH(this,a,c);d.release(a)};Db.Object.defineProperties(Ji.prototype,{Ub:{configurable:!0,enumerable:!0,get:function(){return this.m||this.Z}}});var NR=qa++,yR=new kb,Be=new E,uR=new E,wR=new E;new Tb;var gq=new Ic,fc=xn(2130706432),ZI=new Oe;u(Rv,Sg);p=Rv.prototype;p.Pb=function(){return this.app.B.Pb()}; p.Wj=function(a){var b=this;if(void 0===a)return Promise.resolve();za(a);var c="OOPS, SOMETHING WENT WRONG";if(a instanceof Tn)c="PLEASE ENTER A VALID EMAIL ADDRESS";else if(a instanceof kt)c="INVALID VERIFICATION CODE ENTERED";else if(a instanceof it)c="YOUR BROWSER NOTIFICATIONS ARE BLOCKED. PLEASE ENABLE THEM IN YOUR SETTINGS";else if(a instanceof jt)return new Promise(function(){b.app.reload.Ef("YOU'VE PLAYED IN ANOTHER BROWSER/DEVICE. PLEASE RELOAD THE GAME")});return new Promise(function(d){b.app.Pm.Yj(c).once(pg, d)})};p.Ef=function(a){this.app.block.show(a);Sg.prototype.Ef.call(this,a)};p.$f=function(){this.app.block.fa();Sg.prototype.$f.call(this)};p.ol=function(){var a=this;return new Promise(function(b){a.app.Tg.show().once(pg,b)})};p.Dm=function(a){var b=this.app.reset;return new Promise(function(c,d){b.show(a).once(pg,function(){switch(b.result){case yH:c(!0);break;case zH:c(!1);break;default:d()}})})};p.Xj=function(a,b){var c=this;return new Promise(function(){c.app.Fa.show(function(){Sg.prototype.Xj.call(c, a,b)})})};p.Fm=function(a,b,c,d){var e=this;return new Promise(function(f){e.$f();e.app.share.show(a,b,c,d).once(pg,f)})};p.share=function(a,b,c,d){return Sg.prototype.share.call(this,a,b,c||"KartHooligans",d)};p.dm=function(a,b,c){a=this.app.locale.language;c=c||{};switch(c.type){case Gv:a=a+"1"+c.value;break;case GH:a=a+"2"+Sv(c.value);break;case pH:a=a+"3"+Sv(c.value);break;default:a+="0"}c=Sv(Math.abs(q(a)));a+=2The game is sandboxed. Please visit gemioli.com to play the game.

If you are the webmaster of %0, please use an iframe tag without sandbox attribute":{ru:"
Игра находится в режиме песочницы. Пожалуйста, перейдите на gemioli.com чтобы поиграть в игру.


Если вы являетесь вебмастером %0, то используйте, пожалуйста, тэг iframe без аттрибута sandbox"}, '

Please refresh the page. If you see this screen again, report it to us

':{ru:'

Попробуйте перезагрузить страницу. Если этот экран появился снова, пожалуйста, отправьте нам сообщение об ошибке

', tr:'

Lütfen sayfayı yenileyin. Bu ekranı tekrar görürseniz lütfen bize bir rapor gönderin

'},"Failed to send the report. Please try again later.":{ru:"Не удалось отправить. Пожалуйста, попробуйте позднее.",tr:"Rapor formu başarısız oldu. Lütfen daha sonra tekrar deneyin."},Eng:{ru:"Rus"},USD:{ru:"RUB"},RUB:{ru:"РУБ"}};za("Copyright (c) Dmitriy Kapustin, https://gemioli.com"); za("To license this software please contact at contact@gemioli.com");za("Game version: 231dad2");(function(a){function b(){c||(c=!0,a())}var c=!1;if("complete"===document.readyState)window.setTimeout(a);else if(document.addEventListener){var d=function(){document.removeEventListener("DOMContentLoaded",d,!1);window.removeEventListener("load",d,!1);b()};document.addEventListener("DOMContentLoaded",d,!1);window.addEventListener("load",d,!1)}else{if(document.documentElement.doScroll){var e=function(){try{document.documentElement.doScroll("left"), b()}catch(n){window.setTimeout(e,50)}},f=!0;try{f=!window.frameElement}catch(n){}f&&e()}var g=function(){document.detachEvent("onreadystatechange",l);window.detachEvent("onload",g);b()},l=function(){"complete"===document.readyState&&g()};document.attachEvent("onreadystatechange",l);window.attachEvent("onload",g)}})(function(){try{var a=new Ji;a.once(jI,function(b){WH(b,a)});document.body.appendChild(a.X.canvas);a.start()}catch(b){WH(b)}});(function(a,b){"object"===typeof v&&"undefined"!==typeof x? x.exports=b():"function"===typeof define&&define.amd?define(b):a.PointerEventsPolyfill=b()})(v,function(){function a(B,X){X=X||Object.create(null);var ia=document.createEvent("Event");"function"===typeof ia.initEvent?ia.initEvent(B,X.bubbles||!1,X.cancelable||!1):ia=new Event(B,{bubbles:X.bubbles||!1,cancelable:X.cancelable||!1});B=2;for(var ya;B=Math.abs(ia-Jb.x)&&25>=hc)return!0}},prepareEvent:function(B){var X=A.cloneEvent(B),ia=X.preventDefault;X.preventDefault=function(){B.preventDefault();ia()};X.pointerId=this.POINTER_ID;X.isPrimary=!0;X.pointerType=this.POINTER_TYPE;"webkitForce"in B&&(X.pressure=B.webkitForce- MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN);return X},prepareButtonsForMove:function(B,X){var ia=ea.get(this.POINTER_ID);B.buttons=0!==X.which&&ia?ia.buttons:0;X.buttons=B.buttons},mousedown:function(B){if(!this.isEventSimulatedFromTouch(B)){var X=ea.get(this.POINTER_ID),ia=this.prepareEvent(B);pa||(ia.buttons=ma[ia.button],X&&(ia.buttons|=X.buttons),B.buttons=ia.buttons);ea.set(this.POINTER_ID,B);X&&0!==X.buttons?A.move(ia):A.down(ia)}},webkitmouseforcechanged:function(B){this.mousemove(B)},mousemove:function(B){if(!this.isEventSimulatedFromTouch(B)){var X= this.prepareEvent(B);pa||this.prepareButtonsForMove(X,B);X.button=-1;ea.set(this.POINTER_ID,B);A.move(X)}},mouseup:function(B){if(!this.isEventSimulatedFromTouch(B)){var X=ea.get(this.POINTER_ID),ia=this.prepareEvent(B);if(!pa){var ya=ma[ia.button];ia.buttons=X?X.buttons&~ya:0;B.buttons=ia.buttons}ea.set(this.POINTER_ID,B);ia.buttons&=~ma[ia.button];0===ia.buttons?A.up(ia):A.move(ia)}},mouseover:function(B){if(!this.isEventSimulatedFromTouch(B)){var X=this.prepareEvent(B);pa||this.prepareButtonsForMove(X, B);X.button=-1;ea.set(this.POINTER_ID,B);A.enterOver(X)}},mouseout:function(B){if(!this.isEventSimulatedFromTouch(B)){var X=this.prepareEvent(B);pa||this.prepareButtonsForMove(X,B);X.button=-1;A.leaveOut(X)}},cancel:function(B){B=this.prepareEvent(B);A.cancel(B);this.deactivateMouse()},deactivateMouse:function(){ea.delete(this.POINTER_ID)}},Ka=A.captureInfo,Aa=H.findTarget.bind(H),Fa=H.allShadows.bind(H),xa=A.pointermap,Ja={events:["touchstart","touchmove","touchforcechange","touchend","touchcancel"], register:function(B){La.enableOnSubtree(B)},unregister:function(){},elementAdded:function(B){var X=B.getAttribute("touch-action"),ia=this.touchActionToScrollType(X);"number"===typeof ia&&(B._scrollType=ia,A.listen(B,this.events),Fa(B).forEach(function(ya){ya._scrollType=ia;A.listen(ya,this.events)},this))},elementRemoved:function(B){if(0eb:nd?ia=Jb>eb&&0eb&&0>ya);ia||(hc&&$b?ia=JbB))}this.firstXY=null;return ia}},findTouch:function(B,X){for(var ia=0,ya=B.length,eb;ia=X.length){var ia=[];xa.forEach(function(ya,eb){1===eb||this.findTouch(X,eb-2)||ia.push(ya.out)},this);ia.forEach(this.cancelOut, this)}},touchstart:function(B){this.vacuumTouches(B);this.setPrimaryTouch(B.changedTouches[0]);this.dedupSynthMouse(B);this.scrolling||this.processTouches(B,this.overDown)},overDown:function(B){xa.set(B.pointerId,{target:B.target,out:B,outTarget:B.target});A.enterOver(B);A.down(B)},touchforcechange:function(B){this.touchmove(B)},touchmove:function(B){this.scrolling||(this.shouldScroll(B)?(this.scrolling=!0,this.touchcancel(B)):("touchforcechange"!==B.type&&B.preventDefault(),this.processTouches(B, this.moveOverOut)))},moveOverOut:function(B){var X=xa.get(B.pointerId);if(X){var ia=X.out,ya=X.outTarget;A.move(B);ia&&ya!==B.target&&(ia.relatedTarget=B.target,B.relatedTarget=ya,ia.target=ya,B.target?(A.leaveOut(ia),A.enterOver(B)):(B.target=ya,B.relatedTarget=null,this.cancelOut(B)));X.out=B;X.outTarget=B.target}},touchend:function(B){this.dedupSynthMouse(B);this.processTouches(B,this.upOut)},upOut:function(B){this.scrolling||(A.up(B),A.leaveOut(B));this.cleanUpPointer(B)},touchcancel:function(B){this.processTouches(B, this.cancelOut)},cancelOut:function(B){A.cancel(B);A.leaveOut(B);this.cleanUpPointer(B)},cleanUpPointer:function(B){xa.delete(B.pointerId);this.removePrimaryPointer(B)},dedupSynthMouse:function(B){var X=va.lastTouches;B=B.changedTouches[0];this.isPrimaryTouch(B)&&(B={x:B.clientX,y:B.clientY},X.push(B),X=function(ia,ya){ya=ia.indexOf(ya);-1