!function(i){function s(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,s),e.l=!0,e.exports}var n={};s.m=i,s.c=n,s.d=function(t,e,i){s.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=58)}([function(t,e,i){"use strict";e.__esModule=!0;var s=i(6);e.MyRand=s.MyRand,e.UiStrUtil=s.UiStrUtil;var n=i(41);e.Drawing=n.Drawing;var o=i(19);e.NapeUtil=o.NapeUtil;var a=i(68);e.GameCore=a.GameCore;var r=i(69);e.GameObject=r.GameObject;var h=i(70);e.IDisposed=h.IDisposed;var l=i(71);e.IUpdated=l.IUpdated;var c=i(72);e.ISafed=c.ISafed;var u=i(73);e.IRestarted=u.IRestarted;var d=i(74);e.IActivatable=d.IActivatable;var p=i(42);e.GamePhysics=p.GamePhysics;var f=i(43);e.NapePhysics=f.NapePhysics;var y=i(75);e.GameView=y.GameView;var g=i(44);e.RaceCamera=g.RaceCamera;var m=i(33);e.CameraPathes=m.CameraPathes;var v=i(76);e.CarParams=v.CarParams;var b=i(77);e.CarUpgrades=b.CarUpgrades;var x=i(78);e.RaceCars=x.RaceCars;var _=i(79);e.WeaponParams=_.WeaponParams;var w=i(45);e.Inventory=w.Inventory;var P=i(80);e.LeagueVO=P.LeagueVO;var C=i(81);e.MapVO=C.MapVO;var T=i(82);e.RaceData=T.RaceData;var S=i(83);e.BgElVo=S.BgElVo;var A=i(84);e.ShopCarVO=A.ShopCarVO;var E=i(46);e.CarsData=E.CarsData;var I=i(35);e.GameData=I.GameData;var M=i(34);e.RacesData=M.RacesData;var O=i(85);e.ShopData=O.ShopData;var B=i(86);e.CarBuilder=B.CarBuilder;var R=i(88);e.RaceBuilder=R.RaceBuilder;var L=i(89);e.FrameGraphic=L.FrameGraphic;var D=i(49);e.GroundPartClip=D.GroundPartClip;var k=i(48);e.SmokePartClip=k.SmokePartClip;var F=i(90);e.TrailPart=F.TrailPart;var G=i(91);e.WheelGraphic=G.WheelGraphic;var U=i(92);e.BgEl=U.BgEl;var N=i(93);e.LandscapeShape=N.LandscapeShape;var j=i(50);e.CarObject=j.CarObject;var W=i(94);e.BikeObject=W.BikeObject;var X=i(95);e.CorpseObject=X.CorpseObject;var V=i(96);e.DriverObject=V.DriverObject;var H=i(97);e.FrameObject=H.FrameObject;var Y=i(98);e.PartObject=Y.PartObject;var q=i(99);e.WheelObject=q.WheelObject;var z=i(100);e.BgObject=z.BgObject;var K=i(101);e.DecorActObject=K.DecorActObject;var J=i(102);e.DecorMultiObject=J.DecorMultiObject;var Z=i(51);e.DecorObject=Z.DecorObject;var Q=i(103);e.VectorDecor=Q.VectorDecor;var $=i(39);e.CarExplodeObject=$.CarExplodeObject;var tt=i(52);e.GlassExplodeObject=tt.GlassExplodeObject;var et=i(38);e.TrailParticlesSystem=et.TrailParticlesSystem;var it=i(47);e.TrailPartObject=it.TrailPartObject;var st=i(104);e.GlassBlock=st.GlassBlock;var nt=i(53);e.GlassBlockPart=nt.GlassBlockPart;var ot=i(105);e.GroundObject=ot.GroundObject;var at=i(106);e.PlankObject=at.PlankObject;var rt=i(107);e.ShaperObject=rt.ShaperObject;var ht=i(108);e.WaterObject=ht.WaterObject;var lt=i(110);e.BoostObject=lt.BoostObject;var ct=i(55);e.DynamicBodyObject=ct.DynamicBodyObject;var ut=i(111);e.FinishObject=ut.FinishObject;var dt=i(112);e.MotorObject=dt.MotorObject;var pt=i(113);e.MoverPatherObject=pt.MoverPatherObject;var ft=i(114);e.PivotObject=ft.PivotObject;var yt=i(115);e.RemovedBodyObjects=yt.RemovedBodyObjects;var gt=i(116);e.SafePointObject=gt.SafePointObject;var mt=i(117);e.SpikesObject=mt.SpikesObject;var vt=i(118);e.TntObject=vt.TntObject;var bt=i(119);e.ToggleObject=bt.ToggleObject;var xt=i(120);e.CameraZone=xt.CameraZone;var _t=i(121);e.WaypointObject=_t.WaypointObject;var wt=i(1);e.ObjectTypes=wt.ObjectTypes;var Pt=i(11);e.CbTypes=Pt.CbTypes;var Ct=i(7);e.Filters=Ct.Filters;var Tt=i(8);e.Materials=Tt.Materials;var St=i(122);e.MaxPhysics=St.MaxPhysics;var At=i(123);e.BodyEffector=At.BodyEffector;var Et=i(124);e.BoostEffector=Et.BoostEffector;var It=i(125);e.PlayerController=It.PlayerController;var Mt=i(56);e.CarController=Mt.CarController;var Ot=i(5);e.GraphicUtil=Ot.GraphicUtil;var Bt=i(54);e.PhysicUtil=Bt.PhysicUtil;var Rt=i(2);e.MaxGameView=Rt.MaxGameView},function(t,e,i){"use strict";e.__esModule=!0;var s=function(){function t(){}return t.BG=0,t.LANDSCAPE=1,t.LANDSCAPE_SHAPE=9,t.CAR=2,t.BULLET=3,t.FRONT=4,t.OBJECT=5,t.EFFECT=6,t.CAR_PART=7,t.LANDSCAPE_BACK=8,t}();e.ObjectTypes=s},function(t,e,i){"use strict";var s,n=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});e.__esModule=!0;var r=i(0),o=i(20),h=i(1),l=Phaser.SpriteBatch,a=i(9),c=i(6),u=i(36),d=i(3),p=function(){};e.default=p;var f=function(t,e,i){this.target=i,this.method=e,this.key=t};e.RenderVO=f;var y=function(){function t(){}return t.BG=[["Bg0_0","Bg1_0","Bg2_0"],["Bg0_0","Bg1_0","Bg2_0"],["Bg0_0","Bg1_0","Bg2_0"]],t.ROAD_LINE=[["line","RoadLine0_1","RoadLine1_4","RoadLine0_3","RoadLine0_4","Plank0","RoadLine0_0","RoadLine0_7","RoadLine0_8","line_ivy","UnLine0","UnLine1","LineChain","CandyGround","RoadLine0_Bg"],["line","RoadLine0_1","RoadLine1_4","RoadLine0_3","RoadLine0_4","Plank0","RoadLine0_0","RoadLine0_7","RoadLine0_8","line_ivy","UnLine0","UnLine1","LineChain","CandyGround","RoadLine0_Bg"],["line","RoadLine0_1","RoadLine1_4","RoadLine0_3","RoadLine0_4","Plank0","RoadLine0_0","RoadLine0_7","RoadLine0_8","line_ivy","UnLine0","UnLine1","LineChain","CandyGround","line"]],t.PILLAR_LINE=[["RoadPillar0_0","RoadPillar0_1","RoadPillar0_2"],["RoadPillar0_0","RoadPillar0_1","RoadPillar0_2"],["RoadPillar0_0","RoadPillar0_1","RoadPillar0_2"]],t.ROAD_TILE=["RoadTile0","RoadTile0","RoadTile0"],t.ROAD_SHAPE=[["RoadTile0_1","RoadTile1_1","RoadTile0","UnTile0","UnTile1","UnTile2","RoadTile0_Bg"],["RoadTile0_1","RoadTile1_1","RoadTile0","UnTile0","UnTile1","UnTile2","RoadTile0_Bg"],["RoadTile0_1","RoadTile1_1","RoadTile0","UnTile0","UnTile1","UnTile2","RoadTile0_Bg"]],t.DECORS=[["Dec1","Dec2","Dec3","Dec4","Dec5","Dec6","Dec7","Dec8","Dec9","Dec10","Dec11","Dec12","Dec13","Dec14","Dec15","Dec16","Dec17","Dec18","Dec19","Dec29","Sign1","Sign2","Sign15","Sign21","SignPillar","PillarTop0_0","PillarTop0_1","PillarTop0_2","PillarBot0_0","PillarBot0_1","PillarBot0_2","GlassCrashed0_0","GlassCrashed0_1","GlassCrashed0_2","GlassCrashed0_3","GlassCrashed0_4","GlassCrashed0_5","BoostAnim","RocketAnim","Pivot0","particle_boost","GeyserBase","geyser_anim","PlankCandy0","PlankCandy1"],["Dec1","Dec2","Dec3","Dec4","Dec5","Dec6","Dec7","Dec8","Dec9","Dec10","Dec11","Dec12","Dec13","Dec14","Dec15","Dec16","Dec17","Dec18","Dec19","Dec29","Sign1","Sign2","Sign15","Sign21","SignPillar","PillarTop0_0","PillarTop0_1","PillarTop0_2","PillarBot0_0","PillarBot0_1","PillarBot0_2","GlassCrashed0_0","GlassCrashed0_1","GlassCrashed0_2","GlassCrashed0_3","GlassCrashed0_4","GlassCrashed0_5","BoostAnim","RocketAnim","Pivot0","particle_boost","GeyserBase","geyser_anim","PlankCandy0","PlankCandy1"],["Dec13","Dec14","Dec15","Dec16","Dec29","Sign1","Sign2","Sign15","Sign21","SignPillar","PillarTop0_0","PillarTop0_1","PillarTop0_2","PillarBot0_0","PillarBot0_1","PillarBot0_2","GlassCrashed0_0","GlassCrashed0_1","GlassCrashed0_2","GlassCrashed0_3","GlassCrashed0_4","GlassCrashed0_5","BoostAnim","RocketAnim","Pivot0","particle_boost","GeyserBase","geyser_anim","PlankCandy0","PlankCandy1"]],t.OBJECTS=[["Tnt1","BarrelE","SpikesE","Removed0","Removed1","Plank0","GlassCrashed0","GlassCrashed1","BoostE","PlankCandy","PlankBone"],["Tnt1","BarrelE","SpikesE","Removed0","Removed1","Plank0","GlassCrashed0","GlassCrashed1","BoostE","PlankCandy","PlankBone"],["Tnt1","BarrelE","SpikesE","Removed0","Removed1","Plank0","GlassCrashed0","GlassCrashed1","BoostE","PlankCandy","PlankBone"]],t.FRAMES_ANCHORX=[.48,.493,.45,.38],t.FRAMES_ANCHORY=[.65,.65,.62,.55],t.SUSPEND_BACK_ANCHORX=[.05,0,.05,0],t.SUSPEND_BACK_ANCHORY=[.5,.5,.5,.5],t.SUSPEND_FRONT_ANCHORX=[.8,.95,.8,.95],t.SUSPEND_FRONT_ANCHORY=[.2,.5,.5,.5],t.WHEELS=[["Wheel_1_0"],["Wheel_2_0"],["Wheel_3_0"],["Wheel_4_0"],["Wheel_5_0"]],t}();e.AssetsList=y;var g=function(){function t(){this.storage={}}return t.prototype.getByKey=function(t){return this.storage[t]},t.prototype.add=function(t,e){this.storage[t]=e},t.prototype.dispose=function(){for(var t in this.storage)this.storage[t]&&(this.storage[t]=null)},Object.defineProperty(t,"instance",{get:function(){return null===t._instance&&(t._instance=new t),t._instance},enumerable:!0,configurable:!0}),t._instance=null,t}();e.AssetsStorage=g;var m=function(a){function t(t){var e=a.call(this,t)||this;return e.gamePadLayer=null,e.bg=new l(e.game,e.game.world),e.bg.interactive=!1,e.bg.scale.set(2),e.race=new l(e.game,e.game.world),e.race.interactive=!1,e.landscapeShapes=new l(e.game,e.race),e.landscape=new l(e.game,e.race),e.objects=new l(e.game,e.race),e.front=new l(e.game,e.race),e.raceCamera=new r.RaceCamera,e.raceCamera.setup(e.race,o.default.GAME_W,o.default.GAME_H,d.MaxGameCore.instance),e.gamePadLayer=e.game.add.spriteBatch(e.game.world),u.default.instance.init(e.gamePadLayer,e.game),e}return n(t,a),t.prototype.start=function(){a.prototype.start.call(this),this.game.world.addChild(this.bg),this.game.world.addChild(this.race),this.game.world.addChild(this.gamePadLayer),this.raceCamera.setup(this.race,o.default.GAME_W,o.default.GAME_H,d.MaxGameCore.instance)},t.prototype.add=function(t){t.type===h.ObjectTypes.BG?this.bg.addChild(t.graphic):t.type===h.ObjectTypes.LANDSCAPE?this.landscape.addChild(t.graphic):t.type===h.ObjectTypes.LANDSCAPE_SHAPE?this.landscapeShapes.addChild(t.graphic):t.type===h.ObjectTypes.LANDSCAPE_BACK?this.landscape.addChildAt(t.graphic,0):t.type===h.ObjectTypes.CAR?this.objects.addChild(t.graphic):t.type===h.ObjectTypes.OBJECT?this.objects.addChild(t.graphic):t.type===h.ObjectTypes.BULLET?this.objects.addChild(t.graphic):t.type===h.ObjectTypes.EFFECT?this.front.addChild(t.graphic):t.type===h.ObjectTypes.CAR_PART?this.front.addChildAt(t.graphic,0):t.type===h.ObjectTypes.FRONT&&this.front.addChild(t.graphic)},t.prototype.update=function(t,e,i,s){if(a.prototype.update.call(this,t,e,i,s),i){var n=r.RacesData.TARGET_X,o=r.RacesData.TARGET_Y;r.CameraZone.focusedOnPoint?this.raceCamera.focusOnPoint(n,o):r.CameraZone.current?this.raceCamera.focusOnCameraZone(n,o):this.raceCamera.focusOnCar(n,o,t)}},t.prototype.release=function(){this.raceCamera.release(),this.raceCamera=null,this.bg=null,this.landscape=null,this.landscapeShapes=null,this.objects=null,this.front=null},t}(r.GameView);e.MaxGameView=m;var v=function(){function t(){this.complete=new a.Signal}return Object.defineProperty(t,"instance",{get:function(){return null===t._instance&&(t._instance=new t),t._instance},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.theme=r.RacesData.map.settings.theme%3,1Math.PI?t-=2*Math.PI:t<-Math.PI&&(t+=2*Math.PI),t},y.normalizeAngle2=function(t){return(t%=2*Math.PI)>Math.PI?t-=2*Math.PI:t<-Math.PI&&(t+=2*Math.PI),t},y.normalizeVertices=function(t){var e={};e.className=t.className,e.params={},e.params.vertices=[];var i=t.params,s=i.x,n=i.y;for(var o in i)"vertices"!==o&&(e.params[o]=i[o]);for(var a=y.TO_RAD*i.rotation,r=i.vertices,h=e.params.vertices,l=r.length,c=0;c>0,i=e.toString();e<10&&(i="0"+i);var s=(e=(t-=60*e)>>0).toString();return e<10&&(s="0"+s),i+":"+s},s.PRICE_POSTFIX="",s.RANKS=["","k","m","omg","wtf"],s}();e.UiStrUtil=o},function(t,e,i){"use strict";e.__esModule=!0;var s=nape.dynamics.InteractionFilter,n=function(){function t(){}return t.NOTHING=new s(0,0,0,0,0,0),t.SENSOR=new s(0,0,1,4369),t.SENS_ONLY_PLAYER=new s(0,0,1,4368),t.TOGGLE=new s(0,0,1,4369),t.WITH_EARTH_ONLY=new s(1,4369,0,0),t.WHEEL=new s(4096,272,17,4369),t.DRIVER_PART=new s(4096,272),t.BODY_COLLIDER=new s(4096,272,17,4369),t.GROUND=new s(17,4369,1,4369),t.PLAYER_ONLY=new s(256,4096,1,4369),t.WATER=new s(0,0,1,4369),t}();e.Filters=n},function(t,e,i){"use strict";e.__esModule=!0;var s=nape.phys.Material,n=function(){function t(){}return t.DEFAULT=new s,t.GROUND=new s,t.WIEGHTLESS=new s(0,1,2,.001),t.TUMBEWEED=new s(0,1,2,.5),t.GBARREL=new s(0,1,2,.5),t}();e.Materials=n},function(e,t,i){(function(t){e.exports=t.Phaser=i(62)}).call(t,i(29))},function(t,e,i){"use strict";e.__esModule=!0;var s=i(18),n=function(){function e(t){this.music=null,this.audioInstances={},this.sound=t.sound}return e.getInstance=function(t){if(null===e.instance){if(!t)throw new Error("Cant create a new instance without a game");e.instance=new e(t)}return e.instance},e.prototype.play=function(t,e,i){return void 0===e&&(e=1),void 0===i&&(i=!1),this.audioInstances.hasOwnProperty(t)||(this.audioInstances[t]=this.sound.add(t)),s.default.getInstance().sfx?(this.audioInstances[t].play(void 0,void 0,e,i,!0),this.audioInstances[t]):this.audioInstances[t].play(void 0,void 0,0,i,!0)},e.prototype.stop=function(t){this.audioInstances.hasOwnProperty(t)&&this.audioInstances[t].stop()},e.prototype.playMusic=function(t){if(!s.default.getInstance().music)return this.music=this.sound.play(t,.5,!0),void this.music.stop();null!==this.music&&this.music.name===t||(null!==this.music&&this.music.name!==t&&this.music.stop(),this.music=this.sound.play(t,.5,!0))},e.prototype.fadeMusicVolume=function(t,e){this.music&&this.music.fadeTo(t,e)},e.prototype.stopMusic=function(){null!==this.music&&this.music.isPlaying&&this.music.stop()},e.prototype.toggleSfx=function(){s.default.getInstance().sfx=!s.default.getInstance().sfx},e.prototype.toggleMusic=function(){s.default.getInstance().music=!s.default.getInstance().music,s.default.getInstance().music?this.music&&this.music.play(void 0,void 0,1,!0):this.music&&this.music.isPlaying&&this.stopMusic()},e.instance=null,e}();e.default=n},function(t,e,i){"use strict";e.__esModule=!0;var s=nape.callbacks.CbType,n=function(){function t(){}return t.WHEEL=new s,t.BODY_COLLIDER=new s,t.ZONE_FINISH=new s,t.COIN=new s,t.DESTOYED=new s,t.TOGGLE=new s,t.TOGGLE_OFF=new s,t.GROUND=new s,t.DRIVER=new s,t.DRIVER_PART=new s,t.SAFE_POINT=new s,t.SPIKES=new s,t.SAW=new s,t.BARREL=new s,t.WOOD=new s,t.WATER=new s,t.GLASS=new s,t.BOOST=new s,t.GEYSER=new s,t}();e.CbTypes=n},function(e,t,i){(function(t){e.exports=t.PIXI=i(61)}).call(t,i(29))},function(t,e,i){"use strict";e.__esModule=!0;var s=function(){function t(){this.brandInstances={},this.brandDomains=[],this.brandInstances[t.COOLMATH]="http://www.coolmathgames.com/",this.brandInstances[t.Kizi]="http://kizi.com",this.brandInstances[t.Y8]="http://y8.com",this.brandInstances[t.YEP10]="http://yep10.com/?utm_source=x3m_html5",this.brandInstances[t.Google]="https://play.google.com/store/apps/details?id=air.com.aceviral.motox3m&referrer=utm_source%3Dx3m_html5",this.brandInstances[t.Apple]="https://itunes.apple.com/us/app/moto-x3m-free/id1085088518/?referrer=utm_source%3Dx3m_html5",(t.Current=t.Vseigru)===t.Vseigru&&(this.brandDomains=[],this.brandDomains.push("y8.com"),this.brandDomains.push("id.net"),this.brandDomains.push("pog.com"),this.brandDomains.push("gamepost.com"),this.brandDomains.push("dollmania.com"),this.brandDomains.push("madpuffers.com"),this.brandDomains.push("iriysoft.ru"),this.brandDomains.push("iriysoft.com"))}return t.getInstance=function(){return null===t.instance&&(t.instance=new t),t.instance},t.prototype.checkDomain=function(t){return!0},t.prototype.getUrlLock=function(){return null!==t.Current?this.brandInstances[t.Current]:""},t.prototype.getUrl=function(t){return this.brandInstances[t]},t.instance=null,t.YEP10="yep10",t.Kizi="kizi",t.COOLMATH="coolmath",t.Y8="y8",t.Current=t.Vseigru="vseigru",t.Google="google",t.Apple="itunes",t}();e.default=s},function(t,e,i){"use strict";var s,n=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});e.__esModule=!0,i(12),i(9);var h=i(17),o=function(r){function t(t,e,i,s,n,o){void 0===o&&(o=null);var a=r.call(this,t)||this;return a._enable=!0,a._graphics=null,a._texts=null,a.sScale=1,a.inputEnableChildren=!0,a._graphics=a.game.add.group(a),a._texts=a.game.add.group(a),a.btn=a.game.add.button(0,0,o,s,n),a.btn.anchor.set(.5),a._graphics.addChild(a.btn),a.label=new h.default(a.game,0,2,e,i,70,40),a.label.anchor.set(.5),a._texts.addChild(a.label),null!==s&&null!==n&&(a.label.events.onInputDown.add(s,n),a.btn.onInputOver.add(a.onOver,a),a.btn.onInputDown.add(a.onDownLabel,a),a.btn.onInputOut.add(a.onOut,a)),a.game.add.existing(a),a}return n(t,r),t.prototype.onOver=function(){this.sScale=this.btn.scale.x,this.btn.scale.set(1.1*this.sScale)},t.prototype.onDownLabel=function(){this.btn.scale.set(.9)},t.prototype.onOut=function(){this.btn.scale.set(this.sScale)},t.prototype.setText=function(t){this.label.setText(t)},t.prototype.setFrames=function(t,e,i,s){this.btn.setFrames(t,e,i,s)},t.prototype.destroy=function(t){this.id=null,this.label=null,this.btn=null,this._graphics=null,this._texts=null,r.prototype.destroy.call(this,t)},Object.defineProperty(t.prototype,"enable",{get:function(){return this._enable},set:function(t){this._enable!==t&&(this._enable=t,this.btn.inputEnabled=this._enable,this._enable?(this.btn.tint=16777215,this.label.tint=16777215):(this.btn.tint=10066329,this.label.tint=10066329))},enumerable:!0,configurable:!0}),t}(Phaser.Group);e.default=o},function(t,e,i){},function(t,e,i){"use strict";var s,n=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});e.__esModule=!0;var l=i(4),c=i(23),o=function(r){function h(t,e,i,s){var n=r.call(this,t)||this;n.alpha=0,n.beginFill(e,1),n.drawRect(0,0,n.game.width,n.game.height),n.endFill(),c.default.Name!==i&&(h.prevState=i);var o=n.game.add.text(n.game.width/2,n.game.height/2,"LOADING...",l.Constants.styleCredits0);o.anchor.set(.5),n.addChild(o),t.add.existing(n);var a=n.game.add.tween(n);return a.to({alpha:1},100),a.onComplete.add(function(){t.state.start(i,!0,!1,s)}),a.start(),n}return n(h,r),h.prevState="menu",h}(Phaser.Graphics);e.default=o},function(t,e,i){"use strict";var s,n=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});e.__esModule=!0,i(12),i(9);var o=function(h){function t(t,e,i,s,n,o,a){var r=h.call(this,t,e,i,s,n)||this;return r.maxWidth=o,r.maxHeight=a,r.game.add.existing(r),r}return n(t,h),t.prototype.setText=function(t){return h.prototype.setText.call(this,t),(this.maxWidth||this.maxHeight)&&this.makeFontFit(),this},t.prototype.setMaxSize=function(t,e){this.maxWidth=t,this.maxHeight=e},t.prototype.makeFontFit=function(){for(var t;this.width>this.maxWidth||this.height>this.maxHeight;){if((t=parseInt(this.fontSize.toString().replace("px",""),10)-1)<10){t=10,this.fontSize=t;break}this.fontSize=t}},t}(Phaser.Text);e.default=o},function(t,e,i){"use strict";e.__esModule=!0;var o=i(4),s=function(){function s(t,e,i){var s=this;this.musicOn=!0,this.sfxOn=!0,this.game=t,this.callback=e,this.callbackContext=i,this.game.storage.getItem(o.Constants.STORAGE_KEY_SFX).then(function(t){null==t?(s.initFirstSave(),s.callback&&s.callbackContext&&s.callback.call(s.callbackContext)):s.restore()})}return s.prototype.initFirstSave=function(){this.sfxOn=!0,this.musicOn=!0,this.save()},s.getInstance=function(t,e,i){return s.instance?i&&e.call(i):s.instance=new s(t,e,i),s.instance},Object.defineProperty(s.prototype,"music",{get:function(){return this.musicOn},set:function(t){this.musicOn=t,this.save()},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"sfx",{get:function(){return this.sfxOn},set:function(t){this.sfxOn=t,this.save()},enumerable:!0,configurable:!0}),s.prototype.save=function(){var t=JSON.stringify({m:this.musicOn,sf:this.sfxOn}),e=this.hash(t);this.game.storage.setItem(o.Constants.STORAGE_KEY_SFX,t),this.game.storage.setItem(o.Constants.STORAGE_KEY_SFX+"h",e)},s.prototype.restore=function(){var i,s,n=this,t=this.game.storage.getItem(o.Constants.STORAGE_KEY_SFX),e=this.game.storage.getItem(o.Constants.STORAGE_KEY_SFX+"h");Promise.all([t,e]).then(function(t){if(i=t[0]||"",s=t[1]||"0",""===i)return n.initFirstSave(),void(n.callback&&n.callbackContext&&n.callback.call(n.callbackContext));if(s!==n.hash(i))return n.initFirstSave(),void(n.callback&&n.callbackContext&&n.callback.call(n.callbackContext));if(i&&""!==i)try{var e=JSON.parse(i);n.musicOn=e.m,n.sfxOn=e.sf}catch(t){n.initFirstSave()}else n.initFirstSave();n.callback&&n.callbackContext&&n.callback.call(n.callbackContext)})},s.prototype.hash=function(t){var e,i,s=0;if(0===t.length)return s.toString();for(e=0,i=t.length;e=r.priceList[r.currCar])m.GameData.carId=r.carList[r.currCar],b.Inventory.instance.skin=r.carList[r.currCar],this.setNewViewCar(),f.default.getInstance().save();else{this.priceTxt.y=c.default.HEIGHT-70;var t=this.game.add.tween(this.priceTxt);t.to({y:this.priceTxt.y-15},150,Phaser.Easing.Bounce.InOut,!1,0,3,!0),t.start()}},r.prototype.onPlayDown=function(){new g.default(this.game,0,o.default.Name)},r.prototype.onMenu=function(){new g.default(this.game,0,u.default.Name)},r.prototype.onNext=function(){r.currCar>0;g-=100*m;var v=this.game.add.sprite(200,90,C.default.Garage,"improved_bg");if(v.anchor.set(.5),t.addChild(v),v.visible=e.improved,v.alpha=0,e.improved){var b=new T.default(this.game,"NEW BEST TIME",P.Constants.styleBestTime,null,null);b.angle=25,b.y=-25,v.addChild(b);var x=new T.default(this.game,m.toString()+"."+g.toString()+" sec",P.Constants.styleBestTime,null,null);x.angle=25,x.x=-8,x.y=-5,v.addChild(x),b.label.setShadow(1,1,"rgba(0,0,0,0.8)"),x.label.setShadow(1,1,"rgba(0,0,0,0.8)");var _=v.x,w=v.y;v.x=-500,v.alpha=0,this.game.add.tween(v).to({x:_,y:w,alpha:1},250,Phaser.Easing.Back.InOut,!0)}i.setText("Your time: "+m+"."+g+" sec.")},a.prototype.postRace=function(t){var e=A.RacesData.data;e.timer=f.MaxGameCore.instance.timer;var i,s=0,n=A.RacesData.map.settings.prizes;if(0===n.length);else{i=n.split(",");var o=void 0,a=void 0;for(o=0;oa.MAX_FRAME_TIME&&(this.deltaTime=a.MAX_FRAME_TIME),this.prevTimeMS=this.currTimeMS,this.timeAcc+=this.deltaTime;this.timeAcc>=a.DESIRED_FRAME_TIME;)this.updateGameController(a.DESIRED_FRAME_TIME),this.timeAcc-=a.DESIRED_FRAME_TIME;f.MaxGameCore.instance.physics.updateGraphics(),g.default.instance.setTimer()}},a.prototype.resize=function(){o.prototype.resize.call(this);var t=1;t=1<(t=this.game.width/this.game.height>=P.Constants.WIDTH/P.Constants.HEIGHT?this.game.width/P.Constants.WIDTH:this.game.height/P.Constants.HEIGHT)?1:t,g.default.instance.resize(t),this.resizePopup(t)},a.prototype.shutdown=function(){this.closePopup(),f.MaxGameCore.instance.release(),g.default.instance.release(),o.prototype.shutdown.call(this)},a.prototype.render=function(){null!==this.popup&&dragonBones.PhaserFactory.factory.dragonBones.advanceTime(-1),o.prototype.render.call(this)},a.prototype.initData=function(){this.isFirstUpdate=!0},a.prototype.updateGameController=function(t){f.MaxGameCore.instance.update(t)},a.Name="gameplay",a.pause=!1,a.MAX_FRAME_TIME=.1,a.DESIRED_FRAME_TIME=1/30,a.isAdsPause=!1,a.loadedLevel=!1,a.currCar=-1,a}(Phaser.State));e.default=o},function(t,e,i){"use strict";var s,n=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});e.__esModule=!0,i(12),i(9);var o=i(10),r=i(25),h=i(4),l=i(14),c=i(40),u=i(16),d=i(20),p=i(0),f=i(17),y=i(24),g=i(31),m=i(23),v=i(30),b=i(13),x=(i(15),i(18)),a=function(a){function e(){var t=a.call(this)||this;return t.name=e.Name,t.popup=null,t.popup_btn=null,t._armatureDisplay=null,t}return n(e,a),e.prototype.init=function(){this.game.world.removeAll(),dragonBones.PhaserFactory.init(this.game),d.default.DISPLAY_W=Phaser.Math.max(this.game.width,this.game.height),d.default.DISPLAY_H=Phaser.Math.min(this.game.width,this.game.height)},e.prototype.create=function(){a.prototype.create.call(this),p.Inventory.instance.signalUnlock.removeAll(),p.Inventory.instance.signalUnlock.addOnce(function(){new u.default(this.game,0,y.default.Name)},this),this.background2=this.game.add.sprite(0,0,h.Atlases.Garage,"0bg_garage0000"),this.background=this.game.add.sprite(0,0,h.Atlases.Garage,"0bg_garage0000"),this.background3=this.game.add.sprite(0,0,h.Atlases.Garage,"bg0000"),this.background4=this.game.add.sprite(0,0,h.Atlases.Garage,"bg0000");var t=this.game.cache.getJSON(g.default.DBMenu),e=this.game.cache.getJSON(g.default.DBMenu_Texture),i=this.game.cache.getImage(v.default.DBMenu,!0).base;dragonBones.PhaserFactory.factory.parseDragonBonesData(t),dragonBones.PhaserFactory.factory.parseTextureAtlasData(e,i),this._armatureDisplay=dragonBones.PhaserFactory.factory.buildArmatureDisplay("MenuAnim"),this._armatureDisplay.x=0,this._armatureDisplay.y=360,this.background.addChild(this._armatureDisplay);this.bgTop=this.game.add.image(0,0,h.Atlases.Garage,"top_bg0000"),this.bgTop.scale.set(1.5,1),this.playBtn=new l.default(this.game,"Play",h.Constants.stylePlay,this.startGame,this,h.Atlases.Garage),this.playBtn.setFrames("play_btn0000","play_btn0000","play_btn0000","play_btn0000"),this.playBtn.x=500,this.playBtn.y=200,this.playBtn.label.x=130,this.playBtn.label.stroke="#000000",this.playBtn.label.strokeThickness=5;var s=new f.default(this.game,130,2,"Play",h.Constants.stylePlay);s.anchor.set(.5),this.playBtn.label.parent.addChildAt(s,0),this.play2=this.game.add.image(130,0,h.Atlases.Garage,"black0000"),this.play2.alpha=0,this.play2.width=195,this.play2.height=90,this.play2.anchor.set(.5),this.play2.inputEnabled=!0,this.play2.input.useHandCursor=!0,this.play2.events.onInputDown.addOnce(this.startGame,this),this.play2.events.onInputOut.add(this.outPlay,this),this.play2.events.onInputOver.add(this.overPlay,this),this.playBtn.label.parent.addChildAt(this.play2,0),s.stroke="#FFFFFF",s.strokeThickness=10,this.background4.addChild(this.playBtn),this.moregames=new l.default(this.game,"",null,this.onMoreGames,this,h.Atlases.Garage),this.moregames.setFrames("branding_l00000","branding_l00000","branding_l00000","branding_l00000"),this.moregames.x=620,this.moregames.y=400,this.background4.addChild(this.moregames),this.moregames.visible=!0;var n=new l.default(this.game,"",{font:"bold 20px Djvu",fill:"#FFFFFF"},this.onCredits,this,h.Atlases.Garage);n.setFrames("btn_credits0000","btn_credits0000","btn_credits0000","btn_credits0000"),n.x=35,n.y=35,this.world.addChild(n),this.logo=this.game.add.image(200,100,h.Atlases.Garage,"0logo0000"),this.logo.anchor.set(.5),this.logo.angle=90,this.musicBtn=this.game.add.image(this.game.width-28,25,h.Atlases.Garage,"InGameMusicButton0000"),this.musicBtn.inputEnabled=!1,this.musicBtn.events.onInputUp.add(this.toggleMusic,this),this.musicBtn.events.onInputOver.add(this.onBtnOver,this),this.musicBtn.events.onInputOut.add(this.onBtnOut,this),this.musicBtn.anchor.set(.5),this.playBtn.visible=!1,this.blackRightBG=this.game.add.sprite(900,h.Constants.HEIGHT/2,h.Atlases.Garage,"0popup_bg0000"),this.blackRightBG.anchor.set(.5),this.blackRightBG.angle=90,this.background3.addChild(this.blackRightBG);var o=this.game.add.sprite(0,-h.Constants.HEIGHT/2,h.Atlases.Garage,"0popup_bg0000");o.anchor.set(.5),this.blackRightBG.addChild(o),(o=this.game.add.sprite(0,0,h.Atlases.Garage,"0popup_bg0000")).anchor.set(.5),this.blackRightBG.addChild(o),this.textVersion=new f.default(this.game,680,470," "+h.Constants.VERSION,h.Constants.styleVersion),this.background3.addChild(this.textVersion),x.default.getInstance(this.game,this.onLoadSave,this),new c.default(this.game,0,null),this.resize()},e.prototype.onLoadSave=function(){this._armatureDisplay.animation.play("biker menu animation",-1),o.default.getInstance(this.game).playMusic(h.Sounds.MenuMusic),this.musicBtn.inputEnabled=!0,this.updateSoundButtons(),this.playBtn.visible=!0},e.prototype.onMoreGames=function(){window.open(b.default.getInstance().getUrl(b.default.Current),"_blank")},e.prototype.initGame=function(){null===p.GameData.currentCar&&(p.GameData.currentCar=this.game.cache.getJSON(g.default.Car001),p.CarsData.geomObj=this.game.cache.getJSON(g.default.Objects),this.setCar(p.GameData.currentCar))},e.prototype.overPlay=function(){this.playBtn.btn.scale.set(1.1)},e.prototype.outPlay=function(){this.playBtn.btn.scale.set(1)},e.prototype.startGame=function(){r.default.getInstance(this.game,this.onStartGameLoad,this)},e.prototype.onStartGameLoad=function(){this.initGame(),new u.default(this.game,0,y.default.Name)},e.prototype.setCar=function(t){p.CarsData.params=new p.CarParams,p.CarsData.params.setData(t),m.default.currCar=m.default.carList.indexOf(p.Inventory.instance.skin),p.CarsData.params.skinId=m.default.carList[m.default.currCar]},e.prototype.resetGame=function(){p.Inventory.instance.reset(),r.default.getInstance().save()},e.prototype.onBtnOver=function(t){t.scale.set(1.1)},e.prototype.onBtnOut=function(t){t.scale.set(1)},e.prototype.toggleMusic=function(){x.default.getInstance().music?o.default.getInstance().toggleMusic():x.default.getInstance().sfx?o.default.getInstance().toggleSfx():(o.default.getInstance().toggleSfx(),o.default.getInstance().toggleMusic()),this.updateSoundButtons(),o.default.getInstance().play(h.Sounds.Click)},e.prototype.updateSoundButtons=function(){var t=x.default.getInstance().music?0:1;t+=x.default.getInstance().sfx?0:1,this.musicBtn.loadTexture(h.Atlases.Garage,"InGameMusicButton000"+t)},e.prototype.onCredits=function(){this.createPopup();for(var t,e=[" "," "," "," "," ","CEO: Konstantin Matrunchik","Coding: Dmitry Borozenets","Art: Andrey Zdyschuk","Game Design: Vasiliy Kachor","Menu song: skyler182.newgrounds.com","Ported by iriysoft.com"],i=0;ithis.maxX)return NaN;for(var i=this.points.length,s=c.get(0,0),n=1;n=t){var a=this.points[n-1],r=t-a.x;s.x=o.x-a.x,s.y=o.y-a.y;var h=r*Math.tan(s.angle),l=a.y+h;return l>0,i=(e<10?"0"+e:e)+"."+(t-=100*e);i.length<5&&(i+="0"),this.timer.setText(i)},s.prototype.showFlipMsg=function(t,e){var i="FLIP",s="";s=s+"-"+.5*t+" sec",this.flipTexts.setText(s),this.flipBG.setText(s),1i.maxMove?i.maxMove:t:i.move===o.CameraZone.VER&&(n=ei.maxMove?i.maxMove:e),this.tweening=!0,this.update(s,n,i.scale,!0)},c.prototype.focusOnPoint=function(t,e){this.tweening=!0,this.update(t,e,1,!0)},c.prototype.getFrameHBySpeed=function(t){var e=this.viewportH;500Number(s)&&(this.save[o.RACE_PREFIX+t.toString()+o.RACE_RESULT]=e);var n=this.save[o.RACE_PREFIX+t.toString()+o.RACE_TIME];return it.torque?this.deltaTorque=t.maxTorque-t.torque:this.deltaTorque=0,this.tiltTorque=t.flipTorque,this.frame.maxFlipVel=this.maxTiltSpeed=t.maxFlipSpeed},l.prototype.restart=function(){this.wheelieTimer=0,this.accell=!1,this.safeId=-1,this.finished=!1,this.maxFlyAngle=this.minFlyAngle=this.startFlyAngle=this.rotation=this.frame.body.rotation,this.fallTime=this.flyTime=0,(((this.frame.body.userData.handler=this).backWheel.body.userData.handler=this).frontWheel.body.userData.handler=this).frame.body.userData.graphic=this.frame.graphic,this.backWheel.body.userData.graphicEx=this.backWheel.graphic,this.frontWheel.body.userData.graphicEx=this.frontWheel.graphic,this._drive=!0,this._deadDelay=0,this.dead=!1,this.itemId=-1,this.setVisible(!0),this.setAlpha(1),this.review(),this.compound.space=this.space},l.prototype.release=function(){this.space=null,this.compound.space=null,this.compound=null,this.frame=null,this.backWheel=null,this.frontWheel=null,this.callbackFinish=null,this.callbackDie=null,this.callbackStunt=null,this.callbackFight=null,this.suspendBack=null,this.suspendBackLocal&&this.suspendBackLocal.dispose(),this.suspendBackLocal=null,this.suspendFront=null,this.boost.dispose(),this.boost=null,e.prototype.release.call(this)},Object.defineProperty(l.prototype,"drive",{get:function(){return this._drive},set:function(t){t&&!this._drive&&(this.frontWheel.startSpin(),this.backWheel.startSpin()),this._drive=t},enumerable:!0,configurable:!0}),l.prototype.addBoost=function(t,e){this.boost.add(t,e)},l.prototype.update=function(t){void 0===t&&(t=0),this.dead&&this.driver?(this.x=this.driver.parts[0].body.position.x,this.y=this.driver.parts[0].body.position.y):(this.x=this.frame.body.position.x,this.y=this.frame.body.position.y),this.rotation=this.frame.body.rotation;var e,i=this.speed;if(this.speed=this.frame.body.velocity.length,this.speedV=this.frame.body.velocity.y,this.hasGround=this.frame.hasGround||this.backWheel.hasGround||this.frontWheel.hasGround,this.hasGround?(this.flyTime>this.LONG_FLY_TIME&&(this.processLand(),500this.maxFlyAngle?this.maxFlyAngle=this.rotation:this.rotation>0;e<=(t-=2*i*Math.PI)&&i++;var s=i;t=this.maxFlyAngle-this.startFlyAngle,e<=(t-=2*(i=t/(2*Math.PI)>>0)*Math.PI)&&i++;var n=i;0-a&&p.applyAngularImpulse(-t*o/c)):e||(p.angularVel*=this.dampingDelta),Math.abs(p.angularVel)this.maxTiltSpeed&&(i.angularVel=this.maxTiltSpeed),this.driver){var n=e;if(0===n)if(this.hasGround)this.controller.accell&&(n=-1);else{var o=this.frame.body.velocity.y;o<-20?n=1:20>0])):g.GraphicUtil.createImageWithObj(n,e.getByKey(i)),d.NapeUtil.setupStartPos(this.body),this.body.userData.graphicEx=this.graphic,0<=i.indexOf("Barrel")&&this.body.cbTypes.add(m.CbTypes.BARREL),0===i.indexOf("Removed")&&this.body.cbTypes.add(m.CbTypes.WOOD),(l||0===i.indexOf("Plank"))&&(this.body.userData.isGround=!0,l&&(this.body.userData.isPT=!0)),!1===t.params.active?this.activeOnStart=!1:this.activeOnStart=!0},c.prototype.restart=function(){d.NapeUtil.stopBody(this.body),d.NapeUtil.resetStartPos(this.body),this.activeOnStart||(this.graphic.x=this.body.position.x,this.graphic.y=this.body.position.y,this.graphic.rotation=this.body.rotation,this.activate(!1))},c.prototype.review=function(){this.restart()},c.prototype.activate=function(t){var e,i;if(void 0===t&&(t=!0),t)for(this.body.space=o.MaxGameCore.instance.getSpace(),e=this.body.constraints.iterator();e.hasNext();)(i=e.next()).active=!0;else{for(e=this.body.constraints.iterator();e.hasNext();)(i=e.next()).active=!1,i.userData.skipActive=!0;this.body.space=null}},c.prototype.isActive=function(){return this.activeOnStart},c.CANDIES=["PlankBone","PlankCandy","PlankCandy0","PlankCandy1"],c.CANDIES_COUNT=4,c}(d.GameObject);e.DynamicBodyObject=a},function(t,e,i){"use strict";e.__esModule=!0;var s=function(){function t(t){this.accell=!1,this.brake=!1,this.car=t}return t.prototype.getBoost=function(){return!1},t.prototype.getDrive=function(){return 0},t.prototype.getTilt=function(){return 0},t.prototype.getUseItem=function(){return!1},t.prototype.dispose=function(){this.car=null},t}();e.CarController=s},function(t,e,i){"use strict";var s,n=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});e.__esModule=!0,i(12),i(9);var a=i(4),r=i(13),o=i(16),h=i(32),l=i(17),c=function(e){function i(){var t=e.call(this)||this;return t.name=i.Name,t.bike=null,t.logo=null,t.wait=null,t.mainParent=null,t}return n(i,e),i.prototype.preload=function(){e.prototype.preload.call(this),this.game.load.onFileComplete.add(this.fileComplete,this);var t=r.default.getInstance().checkDomain(document.URL.split("//")[1].split("/")[0]);-1===document.URL.indexOf("84.42.47.232")&&-1===document.URL.indexOf("192.168.10.38")||(t=!0),t?this.preloadSplash():this.preloadLock()},i.prototype.init=function(){e.prototype.init.call(this),this.mainParent=this.game.add.group(),this.mainParent.x=this.game.width/2,this.mainParent.y=this.game.height/2,this.setPauseViewCar(this.mainParent)},i.prototype.preloadLock=function(){this.game.load.atlas(a.Atlases.Garage,"https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/atlases/x1/"+a.Atlases.Garage+".png","https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/atlases/x1/"+a.Atlases.Garage+".json")},i.prototype.preloadSplash=function(){r.default.Current===r.default.COOLMATH||new o.default(this.game,0,h.default.Name)},i.prototype.createLock=function(){this.logo=this.game.add.image(0,-30,a.Atlases.Garage,"branding_l20000"),this.logo.anchor.set(.5),this.logo.inputEnabled=!0,this.logo.input.useHandCursor=!0,this.logo.events.onInputDown.add(this.opensitelockLink,this);var t={font:"25px Arial",fill:"#A8DB2B"},e={font:"25px Arial",fill:"#FFFFFF"},i=new l.default(this.game,0,-200,"This is version is url-locked",t),s=new l.default(this.game,0,-160,r.default.getInstance().getUrlLock(),e),n=new l.default(this.game,0,100,"Contact to license this game",t),o=new l.default(this.game,0,140,"madpuffers@gmail.com",e);i.anchor.set(.5),s.anchor.set(.5),n.anchor.set(.5),o.anchor.set(.5),this.mainParent.addChild(this.logo),this.mainParent.addChild(i),this.mainParent.addChild(s),this.mainParent.addChild(n),this.mainParent.addChild(o)},i.prototype.opensitelockLink=function(){window.open("http://"+r.default.getInstance().getUrlLock(),"_blank")},i.prototype.createSplash=function(){},i.prototype.fileComplete=function(t,e,i,s,n){100===t&&this.game.load.onFileComplete.removeAll()},i.prototype.setPauseViewCar=function(t){null!==this.bike&&this.bike.destroy(),this.bike=this.game.add.group(t),this.bike.x=0,this.bike.y=10},i.prototype.create=function(){e.prototype.create.call(this);var t=r.default.getInstance().checkDomain(document.URL.split("//")[1].split("/")[0]);-1===document.URL.indexOf("84.42.47.232")&&-1===document.URL.indexOf("192.168.10.38")||(t=!0),t?this.createSplash():this.createLock()},i.prototype.resize=function(){var t=1;t=1<(t=this.game.width/a.Constants.WIDTH)?1:t,this.mainParent&&(this.mainParent.x=this.game.width/2,this.mainParent.y=this.game.height/2),this.wait&&this.wait.position.set(this.game.width/2,this.game.height/2),e.prototype.resize.call(this)},i.prototype.shutdown=function(){e.prototype.shutdown.call(this)},i.Name="sitelock",i}(Phaser.State);e.default=c},function(t,e,i){"use strict";var s,n=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});e.__esModule=!0,i(59),i(12),i(9);var o,a,r,h=i(64),l=i(65),c=i(32),u=i(57),d=i(37);i(15);a=o||(o={}),r=function(e){function t(){var t=e.call(this,{enableDebug:!1,width:720,height:480,renderer:Phaser.WEBGL,parent:"content",transparent:!0,antialias:!0,preserveDrawingBuffer:!1,physicsConfig:null,seed:"",state:null,forceSetTimeOut:!1})||this;return t.state.add("game",{create:t.stateCreator.bind(t),preload:t.statePreloader.bind(t)},!0),t}return n(t,e),t.prototype.statePreloader=function(){var e=this;["https://cdn.jsdelivr.net/npm/@orange-games/phaser-cachebuster@2.0/build/phaser-cachebuster.min.js","https://cdn.jsdelivr.net/npm/@orange-games/phaser-super-storage@1.0/build/phaser-super-storage.min.js","https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/box2dweb/dragonBones.min.js"].forEach(function(t){e.load.script(t,t)})},t.prototype.stateCreator=function(){var t=this;this.plugins.add(PhaserSuperStorage.StoragePlugin),this.plugins.add(PhaserCachebuster.CacheBuster),this.storage.forcePromises=!0,this.state.add(l.Boot.Name,l.Boot,!1),this.state.add(c.default.Name,c.default,!1),this.state.add(u.default.Name,u.default,!1),this.state.add(l.Menu.Name,l.Menu,!1),this.state.add(l.Garage.Name,l.Garage,!1),this.state.add(l.ChooseZone.Name,l.ChooseZone,!1),this.state.add(l.Gameplay.Name,l.Gameplay,!1);var e=function(){t.recursiveUpdateText(t.stage)};h.load({custom:{families:["Aller Display","CfCrackBold","Impact"],urls:["https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/css/AllerDisplay.css","https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/css/CfCrackBold.css","https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/css/impact.css"]},active:e,inactive:e}),this.state.start(l.Boot.Name),this.state.remove("game")},t.prototype.recursiveUpdateText=function(t){var e=this;t instanceof Phaser.Text&&(t.dirty=!0),t.children&&0t.vertices.length)throw new Error("lol2");if(e<0)throw new Error("lol3");for(var s=e;se[t][0])&&(t=i);C.left(this.at(t-1),this.at(t),this.at(t+1))||this.reverse()},w.prototype.reverse=function(){for(var t=[],e=0,i=this.vertices.length;e!==i;e++)t.push(this.vertices.pop());this.vertices=t},w.prototype.isReflex=function(t){return C.right(this.at(t-1),this.at(t),this.at(t+1))};var h=[],l=[];w.prototype.canSee=function(t,e){var i,s,n=h,o=l;if(C.leftOn(this.at(t+1),this.at(t),this.at(e))&&C.rightOn(this.at(t-1),this.at(t),this.at(e)))return!1;s=C.sqdist(this.at(t),this.at(e));for(var a=0;a!==this.vertices.length;++a)if((a+1)%this.vertices.length!==t&&a!==t&&C.leftOn(this.at(t),this.at(e),this.at(a+1))&&C.rightOn(this.at(t),this.at(e),this.at(a))&&(n[0]=this.at(t),n[1]=this.at(e),o[0]=this.at(a),o[1]=this.at(a+1),i=r.lineInt(n,o),C.sqdist(this.at(t),i)n)return t;for(var x=0;x (http://steffe.se)",keywords:["p2.js","p2","physics","engine","2d"],main:"./src/p2.js",engines:{node:"*"},repository:{type:"git",url:"https://github.com/schteppe/p2.js.git"},bugs:{url:"https://github.com/schteppe/p2.js/issues"},licenses:[{type:"MIT"}],devDependencies:{grunt:"^0.4.5","grunt-contrib-jshint":"^0.11.2","grunt-contrib-nodeunit":"^0.4.1","grunt-contrib-uglify":"~0.4.0","grunt-contrib-watch":"~0.5.0","grunt-browserify":"~2.0.1","grunt-contrib-concat":"^0.4.0"},dependencies:{"poly-decomp":"0.1.0"}}},{}],7:[function(t,e,i){function s(t){this.lowerBound=p.create(),t&&t.lowerBound&&p.copy(this.lowerBound,t.lowerBound),this.upperBound=p.create(),t&&t.upperBound&&p.copy(this.upperBound,t.upperBound)}var p=t("../math/vec2");t("../utils/Utils"),e.exports=s;var f=p.create();s.prototype.setFromPoints=function(t,e,i,s){var n=this.lowerBound,o=this.upperBound;"number"!=typeof i&&(i=0),0!==i?p.rotate(n,t[0],i):p.copy(n,t[0]),p.copy(o,n);for(var a=Math.cos(i),r=Math.sin(i),h=1;ho[d]&&(o[d]=l[d]),l[d]i&&(this.lowerBound[e]=i);var s=t.upperBound[e];this.upperBound[e]Math.pow(d,2))return 0;if(h)return!0;var p=this.createContactEquation(t,n,e,o);return X(p.normalA,a,i),W.normalize(p.normalA,p.normalA),W.scale(p.contactPointA,p.normalA,l),W.scale(p.contactPointB,p.normalA,-c),V(p.contactPointA,p.contactPointA,i),X(p.contactPointA,p.contactPointA,t.position),V(p.contactPointB,p.contactPointB,a),X(p.contactPointB,p.contactPointB,n.position),this.contactEquations.push(p),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(p)),1},j.prototype[l.PLANE|l.CONVEX]=j.prototype[l.PLANE|l.BOX]=j.prototype.planeConvex=function(t,e,i,s,n,o,a,r,h){var l=Y,c=q,u=z,d=0;W.rotate(c,C,s);for(var p=0;p!==o.vertices.length;p++){var f=o.vertices[p];if(W.rotate(l,f,r),V(l,l,a),X(u,l,i),H(u,c)<=0){if(h)return!0;d++;var y=this.createContactEquation(t,n,e,o);X(u,l,i),W.copy(y.normalA,c);var g=H(u,y.normalA);W.scale(u,y.normalA,g),X(y.contactPointB,l,n.position),X(y.contactPointA,l,u),X(y.contactPointA,y.contactPointA,t.position),this.contactEquations.push(y),this.enableFrictionReduction||this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(y))}}return this.enableFrictionReduction&&this.enableFriction&&d&&this.frictionEquations.push(this.createFrictionFromAverage(d)),d},j.prototype[l.PARTICLE|l.PLANE]=j.prototype.particlePlane=function(t,e,i,s,n,o,a,r,h){var l=Y,c=q;r=r||0,X(l,i,a),W.rotate(c,C,r);var u=H(l,c);if(0Math.pow(e.radius,2))return 0;if(h)return!0;var c=this.createContactEquation(t,n,e,o);return W.copy(c.normalA,l),W.normalize(c.normalA,c.normalA),W.scale(c.contactPointA,c.normalA,e.radius),V(c.contactPointA,c.contactPointA,i),X(c.contactPointA,c.contactPointA,t.position),X(c.contactPointB,a,n.position),this.contactEquations.push(c),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(c)),1};var T=new r({radius:1}),S=W.create(),A=W.create();W.create(),j.prototype[l.PLANE|l.CAPSULE]=j.prototype.planeCapsule=function(t,e,i,s,n,o,a,r,h){var l,c=S,u=A,d=T;W.set(c,-o.length/2,0),W.rotate(c,c,r),V(c,c,a),W.set(u,o.length/2,0),W.rotate(u,u,r),V(u,u,a),d.radius=o.radius,this.enableFrictionReduction&&(l=this.enableFriction,this.enableFriction=!1);var p=this.circlePlane(n,d,c,0,t,e,i,s,h),f=this.circlePlane(n,d,u,0,t,e,i,s,h);if(this.enableFrictionReduction&&(this.enableFriction=l),h)return p||f;var y=p+f;return this.enableFrictionReduction&&y&&this.frictionEquations.push(this.createFrictionFromAverage(y)),y},j.prototype[l.CIRCLE|l.PLANE]=j.prototype.circlePlane=function(t,e,i,s,n,o,a,r,h){var l=t,c=e,u=i,d=n,p=a,f=r;f=f||0;var y=Y,g=q,m=z;X(y,u,p),W.rotate(g,C,f);var v=H(g,y);if(v>c.radius)return 0;if(h)return!0;var b=this.createContactEquation(d,l,o,e);return W.copy(b.normalA,g),W.scale(b.contactPointB,b.normalA,-c.radius),V(b.contactPointB,b.contactPointB,u),X(b.contactPointB,b.contactPointB,l.position),W.scale(m,b.normalA,v),X(b.contactPointA,y,m),V(b.contactPointA,b.contactPointA,p),X(b.contactPointA,b.contactPointA,d.position),this.contactEquations.push(b),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(b)),1},j.prototype[l.CONVEX]=j.prototype[l.CONVEX|l.BOX]=j.prototype[l.BOX]=j.prototype.convexConvex=function(t,e,i,s,n,o,a,r,h,l){var c=Y,u=q,d=z,p=K,f=J,y=Z,g=Q,m=$,v=0,l="number"==typeof l?l:0;if(!j.findSeparatingAxis(e,i,s,o,a,r,c))return 0;X(g,a,i),0y[0]&&(_=f,x=y);var w=_[0]-x[1];h=w<=0,(null===r||ry[0]&&(_=f,x=y);var w=_[0]-x[1];h=w<=0,(null===r||r=c.length&&(x=c.length-1);for(var _=c[b],w=c[x],P=b;P_&&(_=c[P]);if(i[1]-l>_)return!h&&0;for(var C=!1,P=b;P=m[0]&&p[0]=l.length&&(g=l.length-1);for(var m=l[y],v=l[g],b=y;bm&&(m=l[b]);if(t.aabb.lowerBound[1]>m)return!h&&0;for(var x=0,b=y;be.boundingRadius*e.boundingRadius||(this._currentBody=n,(this._currentShape=e).raycast(t,this,s,i),this._currentBody=this._currentShape=null)},a.prototype.getAABB=function(t){var e=this.to,i=this.from;h.set(t.lowerBound,Math.min(e[0],i[0]),Math.min(e[1],i[1])),h.set(t.upperBound,Math.max(e[0],i[0]),Math.max(e[1],i[1]))},h.create(),a.prototype.reportIntersection=function(t,e,i,s){this.from,this.to;var n=this._currentShape,o=this._currentBody;if(!(this.skipBackfaces&&0this.upperLimit&&(o.maxForce=0,o.minForce=-this.maxForce,this.distance=this.upperLimit,r=!0),this.lowerLimitEnabled&&this.position>1;if(e<3)return[];for(var i=[],s=[],n=0;n3*o)break}return i.push(s[0],s[1],s[2]),i},_PointInTriangle:function(t,e,i,s,n,o,a,r){var h=a-i,l=r-s,c=n-i,u=o-s,d=t-i,p=e-s,f=h*h+l*l,y=h*c+l*u,g=h*d+l*p,m=c*c+u*u,v=c*d+u*p,b=1/(f*m-y*y),x=(m*g-y*v)*b,_=(f*v-y*g)*b;return 0<=x&&0<=_&&x+_<1},_convex:function(t,e,i,s,n,o){return 0<=(e-s)*(n-i)+(i-t)*(o-s)}};e.exports=v},{}],30:[function(t,e,i){var a=e.exports={},s=t("../utils/Utils");a.crossLength=function(t,e){return t[0]*e[1]-t[1]*e[0]},a.crossVZ=function(t,e,i){return a.rotate(t,e,-Math.PI/2),a.scale(t,t,i),t},a.crossZV=function(t,e,i){return a.rotate(t,i,Math.PI/2),a.scale(t,t,e),t},a.rotate=function(t,e,i){if(0!==i){var s=Math.cos(i),n=Math.sin(i),o=e[0],a=e[1];t[0]=s*o-n*a,t[1]=n*o+s*a}else t[0]=e[0],t[1]=e[1]},a.rotate90cw=function(t,e){var i=e[0],s=e[1];t[0]=s,t[1]=-i},a.toLocalFrame=function(t,e,i,s){a.copy(t,e),a.sub(t,t,i),a.rotate(t,t,-s)},a.toGlobalFrame=function(t,e,i,s){a.copy(t,e),a.rotate(t,t,s),a.add(t,t,i)},a.vectorToLocalFrame=function(t,e,i){a.rotate(t,e,-i)},a.vectorToGlobalFrame=function(t,e,i){a.rotate(t,e,i)},a.centroid=function(t,e,i,s){return a.add(t,e,i),a.add(t,t,s),a.scale(t,t,1/3),t},a.create=function(){var t=new s.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},a.clone=function(t){var e=new s.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},a.fromValues=function(t,e){var i=new s.ARRAY_TYPE(2);return i[0]=t,i[1]=e,i},a.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},a.set=function(t,e,i){return t[0]=e,t[1]=i,t},a.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t},a.subtract=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t},a.sub=a.subtract,a.multiply=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t},a.mul=a.multiply,a.divide=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t},a.div=a.divide,a.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},a.distance=function(t,e){var i=e[0]-t[0],s=e[1]-t[1];return Math.sqrt(i*i+s*s)},a.dist=a.distance,a.squaredDistance=function(t,e){var i=e[0]-t[0],s=e[1]-t[1];return i*i+s*s},a.sqrDist=a.squaredDistance,a.length=function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)},a.len=a.length,a.squaredLength=function(t){var e=t[0],i=t[1];return e*e+i*i},a.sqrLen=a.squaredLength,a.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},a.normalize=function(t,e){var i=e[0],s=e[1],n=i*i+s*s;return 0=Math.pow(this.sleepSpeedLimit,2)?(this.idleTime=0,this.sleepState=r.AWAKE):(this.idleTime+=i,this.sleepState=r.SLEEPY),this.idleTime>this.sleepTimeLimit&&(e?this.wantsToSleep=!0:this.sleep()))},r.prototype.overlaps=function(t){return this.world.overlapKeeper.bodiesAreOverlapping(this,t)};var P=u.create(),C=u.create();r.prototype.integrate=function(t){var e=this.invMass,i=this.force,s=this.position,n=this.velocity;u.copy(this.previousPosition,this.position),this.previousAngle=this.angle,this.fixedRotation||(this.angularVelocity+=this.angularForce*this.invInertia*t),u.scale(P,i,t*e),u.multiply(P,this.massMultiplier,P),u.add(n,P,n),this.integrateToTimeOfImpact(t)||(u.scale(C,n,t),u.add(s,s,C),this.fixedRotation||(this.angle+=this.angularVelocity*t)),this.aabbNeedsUpdate=!0};var T=new s,S=new n({mode:n.ALL}),A=u.create(),E=u.create(),I=u.create(),M=u.create();r.prototype.integrateToTimeOfImpact=function(t){if(this.ccdSpeedThreshold<0||u.squaredLength(this.velocity)f&&(w.sub(r,a,h),w.normalize(r,r),e.reportIntersection(t,p,r,-1),t.shouldStop(e)))return}else{var v=Math.sqrt(p),b=1/(2*y),x=(-g-v)*b,_=(-g+v)*b;if(0<=x&&x<=1&&(w.lerp(a,n,o,x),w.squaredDistance(a,i)>f&&(w.sub(r,a,h),w.normalize(r,r),e.reportIntersection(t,x,r,-1),t.shouldStop(e))))return;if(0<=_&&_<=1&&(w.lerp(a,n,o,_),w.squaredDistance(a,i)>f&&(w.sub(r,a,h),w.normalize(r,r),e.reportIntersection(t,_,r,-1),t.shouldStop(e))))return}}}},{"../math/vec2":30,"./Shape":45}],39:[function(t,e,i){function s(t){"number"==typeof t&&(t={radius:t}),t=t||{},this.radius=t.radius||1,t.type=n.CIRCLE,n.call(this,t)}var n=t("./Shape"),m=t("../math/vec2");(((e.exports=s).prototype=new n).constructor=s).prototype.computeMomentOfInertia=function(t){var e=this.radius;return t*e*e/2},s.prototype.updateBoundingRadius=function(){this.boundingRadius=this.radius},s.prototype.updateArea=function(){this.area=Math.PI*this.radius*this.radius},s.prototype.computeAABB=function(t,e,i){var s=this.radius;m.set(t.upperBound,s,s),m.set(t.lowerBound,-s,-s),e&&(m.add(t.lowerBound,t.lowerBound,e),m.add(t.upperBound,t.upperBound,e))};var v=m.create(),b=m.create();s.prototype.raycast=function(t,e,i,s){var n=e.from,o=e.to,a=this.radius,r=Math.pow(o[0]-n[0],2)+Math.pow(o[1]-n[1],2),h=2*((o[0]-n[0])*(n[0]-i[0])+(o[1]-n[1])*(n[1]-i[1])),l=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)-Math.pow(a,2),c=Math.pow(h,2)-4*r*l,u=v,d=b;if(!(c<0))if(0===c)m.lerp(u,n,o,c),m.sub(d,u,i),m.normalize(d,d),e.reportIntersection(t,c,d,-1);else{var p=Math.sqrt(c),f=1/(2*r),y=(-h-p)*f,g=(-h+p)*f;if(0<=y&&y<=1&&(m.lerp(u,n,o,y),m.sub(d,u,i),m.normalize(d,d),e.reportIntersection(t,y,d,-1),t.shouldStop(e)))return;0<=g&&g<=1&&(m.lerp(u,n,o,g),m.sub(d,u,i),m.normalize(d,d),e.reportIntersection(t,g,d,-1))}}},{"../math/vec2":30,"./Shape":45}],40:[function(t,e,i){function d(t){Array.isArray(t)&&(t={vertices:t,axes:arguments[1]}),t=t||{},this.vertices=[];for(var e=void 0!==t.vertices?t.vertices:[],i=0;it;)e.pop();for(;e.length=t&&s=2*Math.pow(o.sleepSpeedLimit,2)&&(e._wakeUpAfterNarrowphase=!0),o.allowSleep&&o.type===z.DYNAMIC&&o.sleepState===z.SLEEPING&&e.sleepState===z.AWAKE&&e.type!==z.STATIC&&q.squaredLength(e.velocity)+Math.pow(e.angularVelocity,2)>=2*Math.pow(e.sleepSpeedLimit,2)&&(o._wakeUpAfterNarrowphase=!0),this.overlapKeeper.setOverlapping(e,i,o,a),this.has("beginContact")&&this.overlapKeeper.isNewOverlap(i,a)){var b=this.beginContactEvent;if(b.shapeA=i,b.shapeB=a,b.bodyA=e,b.bodyB=o,b.contactEquations.length=0,"number"==typeof y)for(var x=t.contactEquations.length-y;x=this.children.length)throw new Error("The supplied index is out of bounds");var i=this.getChildIndex(t);this.children.splice(i,1),this.children.splice(e,0,t)},L.DisplayObjectContainer.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject must be a child of the caller");return this.children[t]},L.DisplayObjectContainer.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1!==e)return this.removeChildAt(e)},L.DisplayObjectContainer.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e&&(e.parent=void 0,this.children.splice(t,1)),e},L.DisplayObjectContainer.prototype.removeChildren=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.children.length);var i=e-t;if(0>16&255)/255,(t>>8&255)/255,(255&t)/255]},L.rgb2hex=function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},L.canUseNewCanvasBlendModes=function(){if(void 0===document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",i=new Image;i.src=t+"AP804Oa6"+e;var s=new Image;s.src=t+"/wCKxvRF"+e;var n=L.CanvasPool.create(this,6,1).getContext("2d");if(n.globalCompositeOperation="multiply",n.drawImage(i,0,0),n.drawImage(s,2,0),!n.getImageData(2,0,1,1))return!1;var o=n.getImageData(2,0,1,1).data;return L.CanvasPool.remove(this),255===o[0]&&0===o[1]&&0===o[2]},L.getNextPowerOfTwo=function(t){if(0=this.size&&(this.flush(),this.currentBaseTexture=i.baseTexture);var n=i._uvs;if(n){var o,a,r,h,l=t.anchor.x,c=t.anchor.y;if(i.trim){var u=i.trim;o=(a=u.x-l*u.width)+i.crop.width,r=(h=u.y-c*u.height)+i.crop.height}else o=i.frame.width*(1-l),a=i.frame.width*-l,r=i.frame.height*(1-c),h=i.frame.height*-c;var d=4*this.currentBatchSize*this.vertSize,p=i.baseTexture.resolution,f=s.a/p,y=s.b/p,g=s.c/p,m=s.d/p,v=s.tx,b=s.ty,x=this.colors,_=this.positions;this.renderSession.roundPixels?(_[d]=f*a+g*h+v|0,_[d+1]=m*h+y*a+b|0,_[d+5]=f*o+g*h+v|0,_[d+6]=m*h+y*o+b|0,_[d+10]=f*o+g*r+v|0,_[d+11]=m*r+y*o+b|0,_[d+15]=f*a+g*r+v|0,_[d+16]=m*r+y*a+b|0):(_[d]=f*a+g*h+v,_[d+1]=m*h+y*a+b,_[d+5]=f*o+g*h+v,_[d+6]=m*h+y*o+b,_[d+10]=f*o+g*r+v,_[d+11]=m*r+y*o+b,_[d+15]=f*a+g*r+v,_[d+16]=m*r+y*a+b),_[d+2]=n.x0,_[d+3]=n.y0,_[d+7]=n.x1,_[d+8]=n.y1,_[d+12]=n.x2,_[d+13]=n.y2,_[d+17]=n.x3,_[d+18]=n.y3;var w=t.tint;x[d+4]=x[d+9]=x[d+14]=x[d+19]=(w>>16)+(65280&w)+((255&w)<<16)+(255*t.worldAlpha<<24),this.sprites[this.currentBatchSize++]=t}},L.WebGLSpriteBatch.prototype.renderTilingSprite=function(t){var e=t.tilingTexture;this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=e.baseTexture),t._uvs||(t._uvs=new L.TextureUvs);var i=t._uvs,s=e.baseTexture.width,n=e.baseTexture.height;t.tilePosition.x%=s*t.tileScaleOffset.x,t.tilePosition.y%=n*t.tileScaleOffset.y;var o=t.tilePosition.x/(s*t.tileScaleOffset.x),a=t.tilePosition.y/(n*t.tileScaleOffset.y),r=t.width/s/(t.tileScale.x*t.tileScaleOffset.x),h=t.height/n/(t.tileScale.y*t.tileScaleOffset.y);i.x0=0-o,i.y0=0-a,i.x1=1*r-o,i.y1=0-a,i.x2=1*r-o,i.y2=1*h-a,i.x3=0-o,i.y3=1*h-a;var l=t.tint,c=(l>>16)+(65280&l)+((255&l)<<16)+(255*t.worldAlpha<<24),u=this.positions,d=this.colors,p=t.width,f=t.height,y=t.anchor.x,g=t.anchor.y,m=p*(1-y),v=p*-y,b=f*(1-g),x=f*-g,_=4*this.currentBatchSize*this.vertSize,w=e.baseTexture.resolution,P=t.worldTransform,C=P.a/w,T=P.b/w,S=P.c/w,A=P.d/w,E=P.tx,I=P.ty;u[_++]=C*v+S*x+E,u[_++]=A*x+T*v+I,u[_++]=i.x0,u[_++]=i.y0,d[_++]=c,u[_++]=C*m+S*x+E,u[_++]=A*x+T*m+I,u[_++]=i.x1,u[_++]=i.y1,d[_++]=c,u[_++]=C*m+S*b+E,u[_++]=A*b+T*m+I,u[_++]=i.x2,u[_++]=i.y2,d[_++]=c,u[_++]=C*v+S*b+E,u[_++]=A*b+T*v+I,u[_++]=i.x3,u[_++]=i.y3,d[_++]=c,this.sprites[this.currentBatchSize++]=t},L.WebGLSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var t,e=this.gl;if(this.dirty){this.dirty=!1,e.activeTexture(e.TEXTURE0),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t=this.defaultShader.shaders[e.id];var i=4*this.vertSize;e.vertexAttribPointer(t.aVertexPosition,2,e.FLOAT,!1,i,0),e.vertexAttribPointer(t.aTextureCoord,2,e.FLOAT,!1,i,8),e.vertexAttribPointer(t.colorAttribute,4,e.UNSIGNED_BYTE,!0,i,16)}if(this.currentBatchSize>.5*this.size)e.bufferSubData(e.ARRAY_BUFFER,0,this.vertices);else{var s=this.positions.subarray(0,4*this.currentBatchSize*this.vertSize);e.bufferSubData(e.ARRAY_BUFFER,0,s)}for(var n,o,a,r,h=0,l=0,c=null,u=this.renderSession.blendModeManager.currentBlendMode,d=null,p=!1,f=!1,y=0,g=this.currentBatchSize;y=this.size&&this.flush()}},L.WebGLFastSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var t=this.gl;if(this.currentBaseTexture._glTextures[t.id]||this.renderSession.renderer.updateTexture(this.currentBaseTexture,t),t.bindTexture(t.TEXTURE_2D,this.currentBaseTexture._glTextures[t.id]),this.currentBatchSize>.5*this.size)t.bufferSubData(t.ARRAY_BUFFER,0,this.vertices);else{var e=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);t.bufferSubData(t.ARRAY_BUFFER,0,e)}t.drawElements(t.TRIANGLES,6*this.currentBatchSize,t.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},L.WebGLFastSpriteBatch.prototype.stop=function(){this.flush()},L.WebGLFastSpriteBatch.prototype.start=function(){var t=this.gl;t.activeTexture(t.TEXTURE0),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.renderSession.projection;t.uniform2f(this.shader.projectionVector,e.x,e.y),t.uniformMatrix3fv(this.shader.uMatrix,!1,this.matrix);var i=4*this.vertSize;t.vertexAttribPointer(this.shader.aVertexPosition,2,t.FLOAT,!1,i,0),t.vertexAttribPointer(this.shader.aPositionCoord,2,t.FLOAT,!1,i,8),t.vertexAttribPointer(this.shader.aScale,2,t.FLOAT,!1,i,16),t.vertexAttribPointer(this.shader.aRotation,1,t.FLOAT,!1,i,24),t.vertexAttribPointer(this.shader.aTextureCoord,2,t.FLOAT,!1,i,28),t.vertexAttribPointer(this.shader.colorAttribute,1,t.FLOAT,!1,i,36)},L.WebGLFilterManager=function(){this.filterStack=[],this.offsetX=0,this.offsetY=0},L.WebGLFilterManager.prototype.constructor=L.WebGLFilterManager,L.WebGLFilterManager.prototype.setContext=function(t){this.gl=t,this.texturePool=[],this.initShaderBuffers()},L.WebGLFilterManager.prototype.begin=function(t,e){this.renderSession=t,this.defaultShader=t.shaderManager.defaultShader;var i=this.renderSession.projection;this.width=2*i.x,this.height=2*-i.y,this.buffer=e},L.WebGLFilterManager.prototype.pushFilter=function(t){var e=this.gl,i=this.renderSession.projection,s=this.renderSession.offset;t._filterArea=t.target.filterArea||t.target.getBounds(),t._previous_stencil_mgr=this.renderSession.stencilManager,this.renderSession.stencilManager=new L.WebGLStencilManager,this.renderSession.stencilManager.setContext(e),e.disable(e.STENCIL_TEST),this.filterStack.push(t);var n=t.filterPasses[0];this.offsetX+=t._filterArea.x,this.offsetY+=t._filterArea.y;var o=this.texturePool.pop();o?o.resize(this.width*this.renderSession.resolution,this.height*this.renderSession.resolution):o=new L.FilterTexture(this.gl,this.width*this.renderSession.resolution,this.height*this.renderSession.resolution),e.bindTexture(e.TEXTURE_2D,o.texture);var a=t._filterArea,r=n.padding;a.x-=r,a.y-=r,a.width+=2*r,a.height+=2*r,a.x<0&&(a.x=0),a.width>this.width&&(a.width=this.width),a.y<0&&(a.y=0),a.height>this.height&&(a.height=this.height),e.bindFramebuffer(e.FRAMEBUFFER,o.frameBuffer),e.viewport(0,0,a.width*this.renderSession.resolution,a.height*this.renderSession.resolution),i.x=a.width/2,i.y=-a.height/2,s.x=-a.x,s.y=-a.y,e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t._glFilterTexture=o},L.WebGLFilterManager.prototype.popFilter=function(){var t=this.gl,e=this.filterStack.pop(),i=e._filterArea,s=e._glFilterTexture,n=this.renderSession.projection,o=this.renderSession.offset;if(1this.baseTexture.width||t.y+t.height>this.baseTexture.height))this.valid=t&&t.width&&t.height&&this.baseTexture.source&&this.baseTexture.hasLoaded,this.trim&&(this.width=this.trim.width,this.height=this.trim.height,this.frame.width=this.trim.width,this.frame.height=this.trim.height),this.valid&&this._updateUvs();else{if(!L.TextureSilentFail)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=!1}},L.Texture.prototype._updateUvs=function(){this._uvs||(this._uvs=new L.TextureUvs);var t=this.crop,e=this.baseTexture.width,i=this.baseTexture.height;this._uvs.x0=t.x/e,this._uvs.y0=t.y/i,this._uvs.x1=(t.x+t.width)/e,this._uvs.y1=t.y/i,this._uvs.x2=(t.x+t.width)/e,this._uvs.y2=(t.y+t.height)/i,this._uvs.x3=t.x/e,this._uvs.y3=(t.y+t.height)/i},L.Texture.fromCanvas=function(t,e){var i=L.BaseTexture.fromCanvas(t,e);return new L.Texture(i)},L.TextureUvs=function(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0},L.RenderTexture=function(t,e,i,s,n){if(this.width=t||100,this.height=e||100,this.resolution=n||1,this.frame=new L.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution),this.crop=new L.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution),this.baseTexture=new L.BaseTexture,this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution,this.baseTexture._glTextures=[],this.baseTexture.resolution=this.resolution,this.baseTexture.scaleMode=s||L.scaleModes.DEFAULT,this.baseTexture.hasLoaded=!0,L.Texture.call(this,this.baseTexture,new L.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution)),this.renderer=i||L.defaultRenderer,this.renderer.type===L.WEBGL_RENDERER){var o=this.renderer.gl;this.baseTexture._dirty[o.id]=!1,this.textureBuffer=new L.FilterTexture(o,this.width,this.height,this.baseTexture.scaleMode),this.baseTexture._glTextures[o.id]=this.textureBuffer.texture,this.render=this.renderWebGL,this.projection=new L.Point(.5*this.width,.5*-this.height)}else this.render=this.renderCanvas,this.textureBuffer=new L.CanvasBuffer(this.width*this.resolution,this.height*this.resolution),this.baseTexture.source=this.textureBuffer.canvas;this.valid=!0,this.tempMatrix=new Phaser.Matrix,this._updateUvs()},L.RenderTexture.prototype=Object.create(L.Texture.prototype),L.RenderTexture.prototype.constructor=L.RenderTexture,L.RenderTexture.prototype.resize=function(t,e,i){t===this.width&&e===this.height||(this.valid=0>>0;if("function"!=typeof t)throw new TypeError;for(var s=2<=arguments.length?arguments[1]:void 0,n=0;n=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var o=Math.ceil((n=e-t.length)/2);t=new Array(n-o+1).join(i)+t+new Array(o+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t},isPlainObject:function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},extend:function(){var t,e,i,s,n,o,a=arguments[0]||{},r=1,h=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[1]||{},r=2),h===r&&(a=this,--r);rthis.x?(this._radius=0,this._diameter=0):this.radius=this.x-t}}),Object.defineProperty(W.Circle.prototype,"right",{get:function(){return this.x+this._radius},set:function(t){tthis.y?(this._radius=0,this._diameter=0):this.radius=this.y-t}}),Object.defineProperty(W.Circle.prototype,"bottom",{get:function(){return this.y+this._radius},set:function(t){t=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius},W.Circle.equals=function(t,e){return t.x===e.x&&t.y===e.y&&t.diameter===e.diameter},W.Circle.intersects=function(t,e){return W.Math.distance(t.x,t.y,e.x,e.y)<=t.radius+e.radius},W.Circle.circumferencePoint=function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s=new W.Point),!0===i&&(e=W.Math.degToRad(e)),s.x=t.x+t.radius*Math.cos(e),s.y=t.y+t.radius*Math.sin(e),s},W.Circle.intersectsRectangle=function(t,e){var i=Math.abs(t.x-e.x-e.halfWidth);if(i>e.halfWidth+t.radius)return!1;var s=Math.abs(t.y-e.y-e.halfHeight);if(s>e.halfHeight+t.radius)return!1;if(i<=e.halfWidth||s<=e.halfHeight)return!0;var n=i-e.halfWidth,o=s-e.halfHeight;return n*n+o*o<=t.radius*t.radius},PIXI.Circle=W.Circle,W.Ellipse=function(t,e,i,s){t=t||0,e=e||0,i=i||0,s=s||0,this.x=t,this.y=e,this.width=i,this.height=s,this.type=W.ELLIPSE},W.Ellipse.prototype={setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},getBounds:function(){return new W.Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)},copyFrom:function(t){return this.setTo(t.x,t.y,t.width,t.height)},copyTo:function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},clone:function(t){return null==t?t=new W.Ellipse(this.x,this.y,this.width,this.height):t.setTo(this.x,this.y,this.width,this.height),t},contains:function(t,e){return W.Ellipse.contains(this,t,e)},random:function(t){void 0===t&&(t=new W.Point);var e=Math.random()*Math.PI*2,i=Math.random();return t.x=Math.sqrt(i)*Math.cos(e),t.y=Math.sqrt(i)*Math.sin(e),t.x=this.x+t.x*this.width/2,t.y=this.y+t.y*this.height/2,t},toString:function(){return"[{Phaser.Ellipse (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")}]"}},W.Ellipse.prototype.constructor=W.Ellipse,Object.defineProperty(W.Ellipse.prototype,"left",{get:function(){return this.x},set:function(t){this.x=t}}),Object.defineProperty(W.Ellipse.prototype,"right",{get:function(){return this.x+this.width},set:function(t){tr&&c<=l)return!0}else if(h=r&&c<=l)return!0;if(s=a&&c<=h)return!0}else if(l=a&&c<=h)return!0;return!1},W.Line.reflect=function(t,e){return 2*e.normalAngle-3.141592653589793-t.angle},W.Matrix=function(t,e,i,s,n,o){null!=t||(t=1),null!=e||(e=0),null!=i||(i=0),null!=s||(s=1),null!=n||(n=0),null!=o||(o=0),this.a=t,this.b=e,this.c=i,this.d=s,this.tx=n,this.ty=o,this.type=W.MATRIX},W.Matrix.prototype={fromArray:function(t){return this.setTo(t[0],t[1],t[3],t[4],t[2],t[5])},setTo:function(t,e,i,s,n,o){return this.a=t,this.b=e,this.c=i,this.d=s,this.tx=n,this.ty=o,this},clone:function(t){return null==t?t=new W.Matrix(this.a,this.b,this.c,this.d,this.tx,this.ty):(t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty),t},copyTo:function(t){return t.copyFrom(this),t},copyFrom:function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},toArray:function(t,e){return void 0===e&&(e=new PIXI.Float32Array(9)),e[8]=(e[7]=t?(e[0]=this.a,e[1]=this.b,e[2]=0,e[3]=this.c,e[4]=this.d,e[5]=0,e[6]=this.tx,this.ty):(e[0]=this.a,e[1]=this.c,e[2]=this.tx,e[3]=this.b,e[4]=this.d,e[5]=this.ty,e[6]=0),1),e},apply:function(t,e){return void 0===e&&(e=new W.Point),e.x=this.a*t.x+this.c*t.y+this.tx,e.y=this.b*t.x+this.d*t.y+this.ty,e},applyInverse:function(t,e){void 0===e&&(e=new W.Point);var i=1/(this.a*this.d+this.c*-this.b),s=t.x,n=t.y;return e.x=this.d*i*s+-this.c*i*n+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*n+-this.b*i*s+(-this.ty*this.a+this.tx*this.b)*i,e},translate:function(t,e){return this.tx+=t,this.ty+=e,this},scale:function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},rotate:function(t){var e=Math.cos(t),i=Math.sin(t),s=this.a,n=this.c,o=this.tx;return this.a=s*e-this.b*i,this.b=s*i+this.b*e,this.c=n*e-this.d*i,this.d=n*i+this.d*e,this.tx=o*e-this.ty*i,this.ty=o*i+this.ty*e,this},append:function(t){var e=this.a,i=this.b,s=this.c,n=this.d;return this.a=t.a*e+t.b*s,this.b=t.a*i+t.b*n,this.c=t.c*e+t.d*s,this.d=t.c*i+t.d*n,this.tx=t.tx*e+t.ty*s+this.tx,this.ty=t.tx*i+t.ty*n+this.ty,this},identity:function(){return this.setTo(1,0,0,1,0,0)}},W.identityMatrix=new W.Matrix,PIXI.Matrix=W.Matrix,PIXI.identityMatrix=W.identityMatrix,W.Point=function(t,e){t=t||0,e=e||0,this.x=t,this.y=e,this.type=W.POINT},W.Point.prototype={copyFrom:function(t){return this.setTo(t.x,t.y)},invert:function(){return this.setTo(this.y,this.x)},setTo:function(t,e){return this.x=t||0,this.y=e||(0!==e?this.x:0),this},set:function(t,e){return this.x=t||0,this.y=e||(0!==e?this.x:0),this},add:function(t,e){return this.x+=t,this.y+=e,this},subtract:function(t,e){return this.x-=t,this.y-=e,this},multiply:function(t,e){return this.x*=t,this.y*=e,this},divide:function(t,e){return this.x/=t,this.y/=e,this},clampX:function(t,e){return this.x=W.Math.clamp(this.x,t,e),this},clampY:function(t,e){return this.y=W.Math.clamp(this.y,t,e),this},clamp:function(t,e){return this.x=W.Math.clamp(this.x,t,e),this.y=W.Math.clamp(this.y,t,e),this},clone:function(t){return null==t?t=new W.Point(this.x,this.y):t.setTo(this.x,this.y),t},copyTo:function(t){return t.x=this.x,t.y=this.y,t},distance:function(t,e){return W.Point.distance(this,t,e)},equals:function(t){return t.x===this.x&&t.y===this.y},angle:function(t,e){return void 0===e&&(e=!1),e?W.Math.radToDeg(Math.atan2(t.y-this.y,t.x-this.x)):Math.atan2(t.y-this.y,t.x-this.x)},rotate:function(t,e,i,s,n){return W.Point.rotate(this,t,e,i,s,n)},getMagnitude:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},getMagnitudeSq:function(){return this.x*this.x+this.y*this.y},setMagnitude:function(t){return this.normalize().multiply(t,t)},normalize:function(){if(!this.isZero()){var t=this.getMagnitude();this.x/=t,this.y/=t}return this},isZero:function(){return 0===this.x&&0===this.y},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},perp:function(){return this.setTo(-this.y,this.x)},rperp:function(){return this.setTo(this.y,-this.x)},normalRightHand:function(){return this.setTo(-1*this.y,this.x)},floor:function(){return this.setTo(Math.floor(this.x),Math.floor(this.y))},ceil:function(){return this.setTo(Math.ceil(this.x),Math.ceil(this.y))},toString:function(){return"[{Point (x="+this.x+" y="+this.y+")}]"}},W.Point.prototype.constructor=W.Point,W.Point.add=function(t,e,i){return void 0===i&&(i=new W.Point),i.x=t.x+e.x,i.y=t.y+e.y,i},W.Point.subtract=function(t,e,i){return void 0===i&&(i=new W.Point),i.x=t.x-e.x,i.y=t.y-e.y,i},W.Point.multiply=function(t,e,i){return void 0===i&&(i=new W.Point),i.x=t.x*e.x,i.y=t.y*e.y,i},W.Point.divide=function(t,e,i){return void 0===i&&(i=new W.Point),i.x=t.x/e.x,i.y=t.y/e.y,i},W.Point.equals=function(t,e){return t.x===e.x&&t.y===e.y},W.Point.angle=function(t,e){return Math.atan2(t.y-e.y,t.x-e.x)},W.Point.negative=function(t,e){return void 0===e&&(e=new W.Point),e.setTo(-t.x,-t.y)},W.Point.multiplyAdd=function(t,e,i,s){return void 0===s&&(s=new W.Point),s.setTo(t.x+e.x*i,t.y+e.y*i)},W.Point.interpolate=function(t,e,i,s){return void 0===s&&(s=new W.Point),s.setTo(t.x+(e.x-t.x)*i,t.y+(e.y-t.y)*i)},W.Point.perp=function(t,e){return void 0===e&&(e=new W.Point),e.setTo(-t.y,t.x)},W.Point.rperp=function(t,e){return void 0===e&&(e=new W.Point),e.setTo(t.y,-t.x)},W.Point.distance=function(t,e,i){var s=W.Math.distance(t.x,t.y,e.x,e.y);return i?Math.round(s):s},W.Point.project=function(t,e,i){void 0===i&&(i=new W.Point);var s=t.dot(e)/e.getMagnitudeSq();return 0!==s&&i.setTo(s*e.x,s*e.y),i},W.Point.projectUnit=function(t,e,i){void 0===i&&(i=new W.Point);var s=t.dot(e);return 0!==s&&i.setTo(s*e.x,s*e.y),i},W.Point.normalRightHand=function(t,e){return void 0===e&&(e=new W.Point),e.setTo(-1*t.y,t.x)},W.Point.normalize=function(t,e){void 0===e&&(e=new W.Point);var i=t.getMagnitude();return 0!==i&&e.setTo(t.x/i,t.y/i),e},W.Point.rotate=function(t,e,i,s,n,o){if(n&&(s=W.Math.degToRad(s)),void 0===o){t.subtract(e,i);var a=Math.sin(s),r=Math.cos(s),h=r*t.x-a*t.y,l=a*t.x+r*t.y;t.x=h+e,t.y=l+i}else{var c=s+Math.atan2(t.y-i,t.x-e);t.x=e+o*Math.cos(c),t.y=i+o*Math.sin(c)}return t},W.Point.centroid=function(t,e){if(void 0===e&&(e=new W.Point),"[object Array]"!==Object.prototype.toString.call(t))throw new Error("Phaser.Point. Parameter 'points' must be an array");var i=t.length;if(i<1)throw new Error("Phaser.Point. Parameter 'points' array must not be empty");if(1===i)return e.copyFrom(t[0]),e;for(var s=0;s=this.right?this.width=0:this.width=this.right-t,this.x=t}}),Object.defineProperty(W.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}}),Object.defineProperty(W.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(W.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(W.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(t){this.x=t-this.halfWidth}}),Object.defineProperty(W.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(t){this.y=t-this.halfHeight}}),Object.defineProperty(W.Rectangle.prototype,"randomX",{get:function(){return this.x+Math.random()*this.width}}),Object.defineProperty(W.Rectangle.prototype,"randomY",{get:function(){return this.y+Math.random()*this.height}}),Object.defineProperty(W.Rectangle.prototype,"top",{get:function(){return this.y},set:function(t){t>=this.bottom?(this.height=0,this.y=t):this.height=this.bottom-t}}),Object.defineProperty(W.Rectangle.prototype,"topLeft",{get:function(){return new W.Point(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y}}),Object.defineProperty(W.Rectangle.prototype,"topRight",{get:function(){return new W.Point(this.x+this.width,this.y)},set:function(t){this.right=t.x,this.y=t.y}}),Object.defineProperty(W.Rectangle.prototype,"empty",{get:function(){return!this.width||!this.height},set:function(t){!0===t&&this.setTo(0,0,0,0)}}),W.Rectangle.prototype.constructor=W.Rectangle,W.Rectangle.inflate=function(t,e,i){return t.x-=e,t.width+=2*e,t.y-=i,t.height+=2*i,t},W.Rectangle.inflatePoint=function(t,e){return W.Rectangle.inflate(t,e.x,e.y)},W.Rectangle.size=function(t,e){return null==e?e=new W.Point(t.width,t.height):e.setTo(t.width,t.height),e},W.Rectangle.clone=function(t,e){return null==e?e=new W.Rectangle(t.x,t.y,t.width,t.height):e.setTo(t.x,t.y,t.width,t.height),e},W.Rectangle.contains=function(t,e,i){return!(t.width<=0||t.height<=0)&&e>=t.x&&e=t.y&&ie.volume)&&t.x>=e.x&&t.y>=e.y&&t.righte.right||t.y>e.bottom)},W.Rectangle.intersectsRaw=function(t,e,i,s,n,o){return void 0===o&&(o=0),!(e>t.right+o||it.bottom+o||ni&&(i=t.x),t.xn&&(n=t.y),t.ythis.deadzone.right&&(this.view.x=this.game.math.linear(this.view.x,this._targetPosition.x-this.deadzone.right,this.lerp.x)),this._edge=this._targetPosition.y-this.view.y,this._edgethis.deadzone.bottom&&(this.view.y=this.game.math.linear(this.view.y,this._targetPosition.y-this.deadzone.bottom,this.lerp.y))):(this.view.x=this.game.math.linear(this.view.x,this._targetPosition.x-this.view.halfWidth,this.lerp.x),this.view.y=this.game.math.linear(this.view.y,this._targetPosition.y-this.view.halfHeight,this.lerp.y)),this.bounds&&this.checkBounds(),this.roundPx&&this.view.floor(),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},setBoundsToWorld:function(){this.bounds&&this.bounds.copyFrom(this.game.world.bounds)},checkBounds:function(){this.atLimit.x=!1,this.atLimit.y=!1;var t=this.view.x+this._shake.x,e=this.view.right+this._shake.x,i=this.view.y+this._shake.y,s=this.view.bottom+this._shake.y;t<=this.bounds.x*this.scale.x&&(this.atLimit.x=!0,this.view.x=this.bounds.x*this.scale.x,this._shake.shakeBounds||(this._shake.x=0)),e>=this.bounds.right*this.scale.x&&(this.atLimit.x=!0,this.view.x=this.bounds.right*this.scale.x-this.width,this._shake.shakeBounds||(this._shake.x=0)),i<=this.bounds.top*this.scale.y&&(this.atLimit.y=!0,this.view.y=this.bounds.top*this.scale.y,this._shake.shakeBounds||(this._shake.y=0)),s>=this.bounds.bottom*this.scale.y&&(this.atLimit.y=!0,this.view.y=this.bounds.bottom*this.scale.y-this.height,this._shake.shakeBounds||(this._shake.y=0))},setPosition:function(t,e){this.view.x=t,this.view.y=e,this.bounds&&this.checkBounds()},setSize:function(t,e){this.view.width=t,this.view.height=e},reset:function(){this.target=null,this.view.x=0,this.view.y=0,this._shake.duration=0,this.resetFX()},resetFX:function(){this.fx.clear(),this.fx.alpha=0,this._fxDuration=0}},W.Camera.prototype.constructor=W.Camera,Object.defineProperty(W.Camera.prototype,"x",{get:function(){return this.view.x},set:function(t){this.view.x=t,this.bounds&&this.checkBounds()}}),Object.defineProperty(W.Camera.prototype,"y",{get:function(){return this.view.y},set:function(t){this.view.y=t,this.bounds&&this.checkBounds()}}),Object.defineProperty(W.Camera.prototype,"position",{get:function(){return this._position.set(this.view.x,this.view.y),this._position},set:function(t){void 0!==t.x&&(this.view.x=t.x),void 0!==t.y&&(this.view.y=t.y),this.bounds&&this.checkBounds()}}),Object.defineProperty(W.Camera.prototype,"width",{get:function(){return this.view.width},set:function(t){this.view.width=t}}),Object.defineProperty(W.Camera.prototype,"height",{get:function(){return this.view.height},set:function(t){this.view.height=t}}),Object.defineProperty(W.Camera.prototype,"shakeIntensity",{get:function(){return this._shake.intensity},set:function(t){this._shake.intensity=t}}),W.State=function(){this.game=null,this.key="",this.add=null,this.make=null,this.camera=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.sound=null,this.scale=null,this.stage=null,this.state=null,this.time=null,this.tweens=null,this.world=null,this.particles=null,this.physics=null,this.rnd=null},W.State.prototype={init:function(){},preload:function(){},loadUpdate:function(){},loadRender:function(){},create:function(){},update:function(){},preRender:function(){},render:function(){},resize:function(){},paused:function(){},resumed:function(){},pauseUpdate:function(){},shutdown:function(){}},W.State.prototype.constructor=W.State,W.StateManager=function(t,e){this.game=t,this.states={},(this._pendingState=null)!=e&&(this._pendingState=e),this._clearWorld=!1,this._clearCache=!1,this._created=!1,this._args=[],this.current="",this.onStateChange=new W.Signal,this.onInitCallback=null,this.onPreloadCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onResizeCallback=null,this.onPreRenderCallback=null,this.onLoadUpdateCallback=null,this.onLoadRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onPauseUpdateCallback=null,this.onShutDownCallback=null},W.StateManager.prototype={boot:function(){this.game.onPause.add(this.pause,this),this.game.onResume.add(this.resume,this),null!==this._pendingState&&"string"!=typeof this._pendingState&&this.add("default",this._pendingState,!0)},add:function(t,e,i){var s;return void 0===i&&(i=!1),e instanceof W.State?s=e:"object"==typeof e?(s=e).game=this.game:"function"==typeof e&&(s=new e(this.game)),this.states[t]=s,i&&(this.game.isBooted?this.start(t):this._pendingState=t),s},remove:function(t){this.current===t&&(this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onPreRenderCallback=null,this.onRenderCallback=null,this.onResizeCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onPauseUpdateCallback=null),delete this.states[t]},start:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.checkState(t)&&(this._pendingState=t,this._clearWorld=e,this._clearCache=i,3=this.children.length?-1:this.getChildAt(t)},W.Group.prototype.create=function(t,e,i,s,n,o){void 0===n&&(n=!0);var a=new this.classType(this.game,t,e,i,s);return a.exists=n,a.visible=n,a.alive=n,this.add(a,!1,o)},W.Group.prototype.createMultiple=function(s,t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1),Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);var o=this,a=[];return t.forEach(function(i){e.forEach(function(t){for(var e=0;ethis.children.length||-1===t&&-1===e)return!1;for(var a=new W.Rectangle(0,0,i,s),r=t*i,h=e*s,l=o;lthis.children.length-1&&(t=0),this.cursor)return this.cursorIndex=t,this.cursor=this.children[this.cursorIndex],this.cursor},W.Group.prototype.next=function(){if(this.cursor)return this.cursorIndex>=this.children.length-1?this.cursorIndex=0:this.cursorIndex++,this.cursor=this.children[this.cursorIndex],this.cursor},W.Group.prototype.previous=function(){if(this.cursor)return 0===this.cursorIndex?this.cursorIndex=this.children.length-1:this.cursorIndex--,this.cursor=this.children[this.cursorIndex],this.cursor},W.Group.prototype.swap=function(t,e){this.swapChildren(t,e),this.updateZ()},W.Group.prototype.bringToTop=function(t){return t.parent===this&&this.getIndex(t)this.children.length)return-1;this.getChildAt(t).x=e,this.getChildAt(t).y=i},W.Group.prototype.reverse=function(){this.children.reverse(),this.updateZ()},W.Group.prototype.getIndex=function(t){return this.children.indexOf(t)},W.Group.prototype.getByName=function(t){for(var e=0;ee[this._sortProperty]?1:t.ze[this._sortProperty]?-1:0},W.Group.prototype.iterate=function(t,e,i,s,n,o){if(0===this.children.length){if(i===W.Group.RETURN_TOTAL)return 0;if(i===W.Group.RETURN_ALL)return[]}var a=0;if(i===W.Group.RETURN_ALL)var r=[];for(var h=0;hs&&(!e||e.call(i,r,n))&&(s=n,o=r)}return o},W.Group.prototype.countLiving=function(){return this.iterate("alive",!0,W.Group.RETURN_TOTAL)},W.Group.prototype.countDead=function(){return this.iterate("alive",!1,W.Group.RETURN_TOTAL)},W.Group.prototype.getRandom=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.children.length),0===e?null:W.ArrayUtils.getRandomItem(this.children,t,e)},W.Group.prototype.getRandomExists=function(t,e){var i=this.getAll("exists",!0,t,e);return this.game.rnd.pick(i)},W.Group.prototype.getAll=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=this.children.length);for(var n=[],o=i;othis.children.length)return!1;for(var n=e;t<=n;){!s&&this.children[n].events&&this.children[n].events.onRemovedFromGroup$dispatch(this.children[n],this);var o=this.removeChild(this.children[n]);this.removeFromHash(o),i&&o&&o.destroy(!0),this.cursor===this.children[n]&&(this.cursor=null),n--}this.updateZ()}},W.Group.prototype.destroy=function(t,e){null===this.game||this.ignoreDestroy||(void 0===t&&(t=!0),void 0===e&&(e=!1),this.onDestroy.dispatch(this,t,e),this.removeAll(t),this.cursor=null,this.filters=null,this.pendingDestroy=!1,e||(this.parent&&this.parent.removeChild(this),this.game=null,this.exists=!1))},Object.defineProperty(W.Group.prototype,"total",{get:function(){return this.iterate("exists",!0,W.Group.RETURN_TOTAL)}}),Object.defineProperty(W.Group.prototype,"length",{get:function(){return this.children.length}}),Object.defineProperty(W.Group.prototype,"angle",{get:function(){return W.Math.radToDeg(this.rotation)},set:function(t){this.rotation=W.Math.degToRad(t)}}),Object.defineProperty(W.Group.prototype,"centerX",{get:function(){return this.getBounds(this.parent).centerX},set:function(t){var e=this.getBounds(this.parent),i=this.x-e.x;this.x=t+i-e.halfWidth}}),Object.defineProperty(W.Group.prototype,"centerY",{get:function(){return this.getBounds(this.parent).centerY},set:function(t){var e=this.getBounds(this.parent),i=this.y-e.y;this.y=t+i-e.halfHeight}}),Object.defineProperty(W.Group.prototype,"left",{get:function(){return this.getBounds(this.parent).left},set:function(t){var e=this.getBounds(this.parent),i=this.x-e.x;this.x=t+i}}),Object.defineProperty(W.Group.prototype,"right",{get:function(){return this.getBounds(this.parent).right},set:function(t){var e=this.getBounds(this.parent),i=this.x-e.x;this.x=t+i-e.width}}),Object.defineProperty(W.Group.prototype,"top",{get:function(){return this.getBounds(this.parent).top},set:function(t){var e=this.getBounds(this.parent),i=this.y-e.y;this.y=t+i}}),Object.defineProperty(W.Group.prototype,"bottom",{get:function(){return this.getBounds(this.parent).bottom},set:function(t){var e=this.getBounds(this.parent),i=this.y-e.y;this.y=t+i-e.height}}),W.World=function(t){W.Group.call(this,t,null,"__world",!1),this.bounds=new W.Rectangle(0,0,t.width,t.height),this.camera=null,this._definedSize=!1,this._width=t.width,this._height=t.height,this.game.state.onStateChange.add(this.stateChange,this)},W.World.prototype=Object.create(W.Group.prototype),W.World.prototype.constructor=W.World,W.World.prototype.boot=function(){this.camera=new W.Camera(this.game,0,0,0,this.game.width,this.game.height),this.game.stage.addChild(this),this.camera.boot()},W.World.prototype.stateChange=function(){this.x=0,this.y=0,this.camera.reset()},W.World.prototype.setBounds=function(t,e,i,s){this._definedSize=!0,this._width=i,this._height=s,this.bounds.setTo(t,e,i,s),this.x=t,this.y=e,this.camera.bounds&&this.camera.bounds.setTo(t,e,Math.max(i,this.game.width),Math.max(s,this.game.height)),this.game.physics.setBoundsToWorld()},W.World.prototype.resize=function(t,e){this._definedSize&&(tthis.bounds.right&&(t.x=this.bounds.left)),n&&(t.y+t._currentBounds.heightthis.bounds.bottom&&(t.y=this.bounds.top))):(s&&t.x+ethis.bounds.right&&(t.x=this.bounds.left-e),n&&t.y+ethis.bounds.bottom&&(t.y=this.bounds.top-e))},Object.defineProperty(W.World.prototype,"width",{get:function(){return this.bounds.width},set:function(t){tthis._nextFpsNotification&&(this._nextFpsNotification=this.time.time+1e4,this.fpsProblemNotifier.dispatch()),this._deltaTime=0,this._spiraling=0,this.updateRender(this.time.slowMotion*this.time.desiredFps);else{var e=1e3*this.time.slowMotion/this.time.desiredFps;this._deltaTime+=Math.max(Math.min(3*e,this.time.elapsed),0);var i=0;for(this.updatesThisFrame=Math.floor(this._deltaTime/e),this.forceSingleUpdate&&(this.updatesThisFrame=Math.min(1,this.updatesThisFrame));this._deltaTime>=e&&(this._deltaTime-=e,this.currentUpdateID=i,this.updateLogic(this.time.desiredFpsMult),i++,!this.forceSingleUpdate||1!==i);)this.time.refresh();i>this._lastCount?this._spiraling++:i=W.Input.MAX_POINTERS)return null;var t=this.pointers.length+1,e=new W.Pointer(this.game,t,W.PointerMode.TOUCH);return this.pointers.push(e),this["pointer"+t]=e},update:function(){if(this.keyboard&&this.keyboard.update(),0=this.maxPointers)return null;if(!this.pointer1.active)return this.pointer1.start(t);if(!this.pointer2.active)return this.pointer2.start(t);for(var e=2;e=o&&this._localPoint.x=a&&this._localPoint.y=o&&this._localPoint.x=a&&this._localPoint.ythis.game.time.time},justReleased:function(t){return t=t||250,this.isUp&&this.timeUp+t>this.game.time.time},reset:function(){this.isDown=!1,this.isUp=!0,this.timeDown=this.game.time.time,this.repeats=0,this.altKey=!1,this.shiftKey=!1,this.ctrlKey=!1},destroy:function(){this.onDown.dispose(),this.onUp.dispose(),this.onFloat.dispose(),this.parent=null,this.game=null}},W.DeviceButton.prototype.constructor=W.DeviceButton,Object.defineProperty(W.DeviceButton.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.time-this.timeDown}}),W.Pointer=function(t,e,i){this.game=t,this.id=e,this.type=W.POINTER,this.exists=!0,this.identifier=0,this.pointerId=null,this.pointerMode=i||W.PointerMode.CURSOR|W.PointerMode.CONTACT,this.target=null,this.button=null,this.leftButton=new W.DeviceButton(this,W.Pointer.LEFT_BUTTON),this.middleButton=new W.DeviceButton(this,W.Pointer.MIDDLE_BUTTON),this.rightButton=new W.DeviceButton(this,W.Pointer.RIGHT_BUTTON),this.backButton=new W.DeviceButton(this,W.Pointer.BACK_BUTTON),this.forwardButton=new W.DeviceButton(this,W.Pointer.FORWARD_BUTTON),this.eraserButton=new W.DeviceButton(this,W.Pointer.ERASER_BUTTON),this._holdSent=!1,this._history=[],this._nextDrop=0,this._stateReset=!1,this.withinGame=!1,this.clientX=-1,this.clientY=-1,this.pageX=-1,this.pageY=-1,this.screenX=-1,this.screenY=-1,this.rawMovementX=0,this.rawMovementY=0,this.movementX=0,this.movementY=0,this.x=-1,this.y=-1,this.isMouse=0===e,this.isDown=!1,this.isUp=!0,this.timeDown=0,this.timeUp=0,this.previousTapTime=0,this.totalTouches=0,this.msSinceLastClick=Number.MAX_VALUE,this.targetObject=null,this.interactiveCandidates=[],this.active=!1,this.dirty=!1,this.position=new W.Point,this.positionDown=new W.Point,this.positionUp=new W.Point,this.circle=new W.Circle(0,0,44),this._clickTrampolines=null,this._trampolineTargetObject=null},W.Pointer.NO_BUTTON=0,W.Pointer.LEFT_BUTTON=1,W.Pointer.RIGHT_BUTTON=2,W.Pointer.MIDDLE_BUTTON=4,W.Pointer.BACK_BUTTON=8,W.Pointer.FORWARD_BUTTON=16,W.Pointer.ERASER_BUTTON=32,W.Pointer.prototype={resetButtons:function(){this.isDown=!1,this.isUp=!0,this.isMouse&&(this.leftButton.reset(),this.middleButton.reset(),this.rightButton.reset(),this.backButton.reset(),this.forwardButton.reset(),this.eraserButton.reset())},processButtonsDown:function(t,e){W.Pointer.LEFT_BUTTON&t&&this.leftButton.start(e),W.Pointer.RIGHT_BUTTON&t&&this.rightButton.start(e),W.Pointer.MIDDLE_BUTTON&t&&this.middleButton.start(e),W.Pointer.BACK_BUTTON&t&&this.backButton.start(e),W.Pointer.FORWARD_BUTTON&t&&this.forwardButton.start(e),W.Pointer.ERASER_BUTTON&t&&this.eraserButton.start(e)},processButtonsUp:function(t,e){t===W.Mouse.LEFT_BUTTON&&this.leftButton.stop(e),t===W.Mouse.RIGHT_BUTTON&&this.rightButton.stop(e),t===W.Mouse.MIDDLE_BUTTON&&this.middleButton.stop(e),t===W.Mouse.BACK_BUTTON&&this.backButton.stop(e),t===W.Mouse.FORWARD_BUTTON&&this.forwardButton.stop(e),5===t&&this.eraserButton.stop(e)},updateButtons:function(t){this.button=t.button;var e="down"===t.type.toLowerCase().substr(-4);void 0!==t.buttons?e?this.processButtonsDown(t.buttons,t):this.processButtonsUp(t.button,t):e?this.leftButton.start(t):(this.leftButton.stop(t),this.rightButton.stop(t)),1===t.buttons&&t.ctrlKey&&this.leftButton.isDown&&(this.leftButton.stop(t),this.rightButton.start(t)),this.isUp=!0,this.isDown=!1,(this.leftButton.isDown||this.rightButton.isDown||this.middleButton.isDown||this.backButton.isDown||this.forwardButton.isDown||this.eraserButton.isDown)&&(this.isUp=!1,this.isDown=!0)},start:function(t){var e=this.game.input;return t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.isMouse?this.updateButtons(t):(this.isDown=!0,this.isUp=!1),this.active=!0,this.withinGame=!0,this.dirty=!1,this._history=[],this._clickTrampolines=null,this._trampolineTargetObject=null,this.msSinceLastClick=this.game.time.time-this.timeDown,this.timeDown=this.game.time.time,this._holdSent=!1,this.move(t,!0),this.positionDown.setTo(this.x,this.y),(e.multiInputOverride===W.Input.MOUSE_OVERRIDES_TOUCH||e.multiInputOverride===W.Input.MOUSE_TOUCH_COMBINE||e.multiInputOverride===W.Input.TOUCH_OVERRIDES_MOUSE&&0===e.totalActivePointers)&&(e.x=this.x,e.y=this.y,e.position.setTo(this.x,this.y),e.onDown.dispatch(this,t),e.resetSpeed(this.x,this.y)),this._stateReset=!1,this.totalTouches++,null!==this.targetObject&&this.targetObject._touchedHandler(this),this},update:function(){var t=this.game.input;this.active&&(this.dirty&&(0=t.holdRate&&((t.multiInputOverride===W.Input.MOUSE_OVERRIDES_TOUCH||t.multiInputOverride===W.Input.MOUSE_TOUCH_COMBINE||t.multiInputOverride===W.Input.TOUCH_OVERRIDES_MOUSE&&0===t.totalActivePointers)&&t.onHold.dispatch(this),this._holdSent=!0),t.recordPointerHistory&&this.game.time.time>=this._nextDrop&&(this._nextDrop=this.game.time.time+t.recordRate,this._history.push({x:this.position.x,y:this.position.y}),this._history.length>t.recordLimit&&this._history.shift()))},move:function(t,e){var i=this.game.input;if(!i.pollLocked){if(void 0===e&&(e=!1),void 0!==t.button&&(this.button=t.button),e&&this.isMouse&&this.updateButtons(t),this.clientX=t.clientX,this.clientY=t.clientY,this.pageX=t.pageX,this.pageY=t.pageY,this.screenX=t.screenX,this.screenY=t.screenY,this.isMouse&&i.mouse.locked&&!e&&(this.rawMovementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.rawMovementY=t.movementY||t.mozMovementY||t.webkitMovementY||0,this.movementX+=this.rawMovementX,this.movementY+=this.rawMovementY),this.x=(this.pageX-this.game.scale.offset.x)*i.scale.x,this.y=(this.pageY-this.game.scale.offset.y)*i.scale.y,this.position.setTo(this.x,this.y),this.circle.x=this.x,this.circle.y=this.y,(i.multiInputOverride===W.Input.MOUSE_OVERRIDES_TOUCH||i.multiInputOverride===W.Input.MOUSE_TOUCH_COMBINE||i.multiInputOverride===W.Input.TOUCH_OVERRIDES_MOUSE&&0===i.totalActivePointers)&&(i.activePointer=this,i.x=this.x,i.y=this.y,i.position.setTo(i.x,i.y),i.circle.x=i.x,i.circle.y=i.y),this.withinGame=this.game.scale.bounds.contains(this.pageX,this.pageY),this.game.paused)return this;for(var s=i.moveCallbacks.length;s--;)i.moveCallbacks[s].callback.call(i.moveCallbacks[s].context,this,this.x,this.y,e);return null!==this.targetObject&&!0===this.targetObject.isDragged?!1===this.targetObject.update(this)&&(this.targetObject=null):0this.game.time.time},justReleased:function(t){return t=t||this.game.input.justReleasedRate,this.isUp&&this.timeUp+t>this.game.time.time},addClickTrampoline:function(t,e,i,s){if(this.isDown){for(var n=this._clickTrampolines=this._clickTrampolines||[],o=0;ot||this.priorityID===t&&this.sprite.renderOrderID>e))},isPixelPerfect:function(){return this.pixelPerfectClick||this.pixelPerfectOver},pointerX:function(t){return t=t||0,this._pointerData[t].x},pointerY:function(t){return t=t||0,this._pointerData[t].y},pointerDown:function(t){return t=t||0,this._pointerData[t].isDown},pointerUp:function(t){return t=t||0,this._pointerData[t].isUp},pointerTimeDown:function(t){return t=t||0,this._pointerData[t].timeDown},pointerTimeUp:function(t){return t=t||0,this._pointerData[t].timeUp},pointerOver:function(t){if(!this.enabled)return!1;if(void 0!==t)return this._pointerData[t].isOver;for(var e=0;e<10;e++)if(this._pointerData[e].isOver)return!0;return!1},pointerOut:function(t){if(!this.enabled)return!1;if(void 0!==t)return this._pointerData[t].isOut;for(var e=0;e<10;e++)if(this._pointerData[e].isOut)return!0},pointerTimeOver:function(t){return t=t||0,this._pointerData[t].timeOver},pointerTimeOut:function(t){return t=t||0,this._pointerData[t].timeOut},pointerDragged:function(t){return t=t||0,this._pointerData[t].isDragged},checkPointerDown:function(t,e){return!!(t.isDown&&this.enabled&&this.sprite&&this.sprite.parent&&this.sprite.visible&&this.sprite.parent.visible&&0!==this.sprite.worldScale.x&&0!==this.sprite.worldScale.y)&&!!this.game.input.hitTest(this.sprite,t,this._tempPoint)&&(void 0===e&&(e=!1),!(!e&&this.pixelPerfectClick)||this.checkPixel(this._tempPoint.x,this._tempPoint.y))},checkPointerOver:function(t,e){return!!(this.enabled&&this.sprite&&this.sprite.parent&&this.sprite.visible&&this.sprite.parent.visible&&0!==this.sprite.worldScale.x&&0!==this.sprite.worldScale.y)&&!!this.game.input.hitTest(this.sprite,t,this._tempPoint)&&(void 0===e&&(e=!1),!(!e&&this.pixelPerfectOver)||this.checkPixel(this._tempPoint.x,this._tempPoint.y))},checkPixel:function(t,e,i){if(this.sprite.texture.baseTexture.source){if(null===t&&null===e){this.game.input.getLocalPosition(this.sprite,i,this._tempPoint);t=this._tempPoint.x,e=this._tempPoint.y}if(0!==this.sprite.anchor.x&&(t-=-this.sprite.texture.frame.width*this.sprite.anchor.x),0!==this.sprite.anchor.y&&(e-=-this.sprite.texture.frame.height*this.sprite.anchor.y),t+=this.sprite.texture.frame.x,e+=this.sprite.texture.frame.y,this.sprite.texture.trim&&(t-=this.sprite.texture.trim.x,e-=this.sprite.texture.trim.y,tthis.sprite.texture.crop.right||ethis.sprite.texture.crop.bottom))return this._dx=t,this._dy=e,!1;if(this._dx=t,this._dy=e,this.game.input.hitContext.clearRect(0,0,1,1),this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source,t,e,1,1,0,0,1,1),this.game.input.hitContext.getImageData(0,0,1,1).data[3]>=this.pixelPerfectAlpha)return!0}return!1},update:function(t){if(null!==this.sprite&&void 0!==this.sprite.parent)return this.enabled&&this.sprite.visible&&this.sprite.parent.visible?this._pendingDrag?(this._dragDistancePass||(this._dragDistancePass=W.Math.distance(t.x,t.y,this.downPoint.x,this.downPoint.y)>=this.dragDistanceThreshold),this._dragDistancePass&&this._dragTimePass&&this.startDrag(t),!0):this.draggable&&this._draggedPointerID===t.id?this.updateDrag(t,!1):this._pointerData[t.id].isOver?this.checkPointerOver(t)?(this._pointerData[t.id].x=t.x-this.sprite.x,this._pointerData[t.id].y=t.y-this.sprite.y,!0):(this._pointerOutHandler(t),!1):void 0:(this._pointerOutHandler(t),!1)},_pointerOverHandler:function(t,e){if(null!==this.sprite){var i=this._pointerData[t.id];if(!1===i.isOver||t.dirty){var s=!1===i.isOver;i.isOver=!0,i.isOut=!1,i.timeOver=this.game.time.time,i.x=t.x-this.sprite.x,i.y=t.y-this.sprite.y,this.useHandCursor&&!1===i.isDragged&&(this.game.canvas.style.cursor="pointer",this._setHandCursor=!0),!e&&s&&this.sprite&&this.sprite.events&&this.sprite.events.onInputOver$dispatch(this.sprite,t),this.sprite.parent&&this.sprite.parent.type===W.GROUP&&this.sprite.parent.onChildInputOver.dispatch(this.sprite,t)}}},_pointerOutHandler:function(t,e){if(null!==this.sprite){var i=this._pointerData[t.id];i.isOver=!1,i.isOut=!0,i.timeOut=this.game.time.time,this.useHandCursor&&!1===i.isDragged&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1),!e&&this.sprite&&this.sprite.events&&(this.sprite.events.onInputOut$dispatch(this.sprite,t),this.sprite&&this.sprite.parent&&this.sprite.parent.type===W.GROUP&&this.sprite.parent.onChildInputOut.dispatch(this.sprite,t))}},_touchedHandler:function(t){if(null!==this.sprite){var e=this._pointerData[t.id];if(!e.isDown&&e.isOver){if(this.pixelPerfectClick&&!this.checkPixel(null,null,t))return;if(e.isDown=!0,e.isUp=!1,e.timeDown=this.game.time.time,this.downPoint.set(t.x,t.y),t.dirty=!0,this.sprite&&this.sprite.events&&(this.sprite.events.onInputDown$dispatch(this.sprite,t),this.sprite&&this.sprite.parent&&this.sprite.parent.type===W.GROUP&&this.sprite.parent.onChildInputDown.dispatch(this.sprite,t),null===this.sprite))return;this.draggable&&!1===this.isDragged&&(0===this.dragTimeThreshold&&0===this.dragDistanceThreshold?this.startDrag(t):(this._pendingDrag=!0,this._dragDistancePass=0===this.dragDistanceThreshold,0this.boundsRect.right&&(this.sprite.cameraOffset.x=this.boundsRect.right-this.sprite.width),this.sprite.cameraOffset.ythis.boundsRect.bottom&&(this.sprite.cameraOffset.y=this.boundsRect.bottom-this.sprite.height)):(this.sprite.leftthis.boundsRect.right&&(this.sprite.x=this.boundsRect.right-(this.sprite.width-this.sprite.offsetX)),this.sprite.topthis.boundsRect.bottom&&(this.sprite.y=this.boundsRect.bottom-(this.sprite.height-this.sprite.offsetY)))},checkBoundsSprite:function(){this.sprite.fixedToCamera&&this.boundsSprite.fixedToCamera?(this.sprite.cameraOffset.xthis.boundsSprite.cameraOffset.x+this.boundsSprite.width&&(this.sprite.cameraOffset.x=this.boundsSprite.cameraOffset.x+this.boundsSprite.width-this.sprite.width),this.sprite.cameraOffset.ythis.boundsSprite.cameraOffset.y+this.boundsSprite.height&&(this.sprite.cameraOffset.y=this.boundsSprite.cameraOffset.y+this.boundsSprite.height-this.sprite.height)):(this.sprite.leftthis.boundsSprite.right&&(this.sprite.x=this.boundsSprite.right-(this.sprite.width-this.sprite.offsetX)),this.sprite.topthis.boundsSprite.bottom&&(this.sprite.y=this.boundsSprite.bottom-(this.sprite.height-this.sprite.offsetY)))}},W.InputHandler.prototype.constructor=W.InputHandler,W.Gamepad=function(t){this.game=t,this._gamepadIndexMap={},this._rawPads=[],this._active=!1,this.enabled=!0,this._gamepadSupportAvailable=!!navigator.webkitGetGamepads||!!navigator.webkitGamepads||-1!==navigator.userAgent.indexOf("Firefox/")||!!navigator.getGamepads,this._prevRawGamepadTypes=[],this._prevTimestamps=[],(this.callbackContext=this).onConnectCallback=null,this.onDisconnectCallback=null,this.onDownCallback=null,this.onUpCallback=null,this.onAxisCallback=null,this.onFloatCallback=null,this._ongamepadconnected=null,this._gamepaddisconnected=null,this._gamepads=[new W.SinglePad(t,this),new W.SinglePad(t,this),new W.SinglePad(t,this),new W.SinglePad(t,this)]},W.Gamepad.prototype={addCallbacks:function(t,e){void 0!==e&&(this.onConnectCallback="function"==typeof e.onConnect?e.onConnect:this.onConnectCallback,this.onDisconnectCallback="function"==typeof e.onDisconnect?e.onDisconnect:this.onDisconnectCallback,this.onDownCallback="function"==typeof e.onDown?e.onDown:this.onDownCallback,this.onUpCallback="function"==typeof e.onUp?e.onUp:this.onUpCallback,this.onAxisCallback="function"==typeof e.onAxis?e.onAxis:this.onAxisCallback,this.onFloatCallback="function"==typeof e.onFloat?e.onFloat:this.onFloatCallback,this.callbackContext=t)},start:function(){if(!this._active){this._active=!0;var e=this;this._onGamepadConnected=function(t){return e.onGamepadConnected(t)},this._onGamepadDisconnected=function(t){return e.onGamepadDisconnected(t)},window.addEventListener("gamepadconnected",this._onGamepadConnected,!1),window.addEventListener("gamepaddisconnected",this._onGamepadDisconnected,!1)}},onGamepadConnected:function(t){var e=t.gamepad;this._rawPads.push(e),this._gamepads[e.index].connect(e)},onGamepadDisconnected:function(t){var e=t.gamepad;for(var i in this._rawPads)this._rawPads[i].index===e.index&&this._rawPads.splice(i,1);this._gamepads[e.index].disconnect()},update:function(){this._pollGamepads(),this.pad1.pollStatus(),this.pad2.pollStatus(),this.pad3.pollStatus(),this.pad4.pollStatus()},_pollGamepads:function(){if(this._active){if(navigator.getGamepads)var t=navigator.getGamepads();else if(navigator.webkitGetGamepads)t=navigator.webkitGetGamepads();else if(navigator.webkitGamepads)t=navigator.webkitGamepads();if(t){for(var e=!(this._rawPads=[]),i=0;ithis.deadZone||s<0&&s<-this.deadZone?this.processAxisChange(i,s):this.processAxisChange(i,0)}this._prevTimestamp=this._rawPad.timestamp}},connect:function(t){var e=!this.connected;this.connected=!0,this.index=t.index,this._rawPad=t,this._buttons=[],this._buttonsLen=t.buttons.length,this._axes=[],this._axesLen=t.axes.length;for(var i=0;ithis.maxHealth&&(this.health=this.maxHealth),this},heal:function(t){return this.alive&&(this.health+=t,this.health>this.maxHealth&&(this.health=this.maxHealth)),this}},W.Component.InCamera=function(){},W.Component.InCamera.prototype={inCamera:{get:function(){return this.game.world.camera.view.intersects(this._bounds)}}},W.Component.InputEnabled=function(){},W.Component.InputEnabled.prototype={input:null,inputEnabled:{get:function(){return this.input&&this.input.enabled},set:function(t){t?null===this.input?(this.input=new W.InputHandler(this),this.input.start()):this.input&&!this.input.enabled&&this.input.start():this.input&&this.input.enabled&&this.input.stop()}}},W.Component.InWorld=function(){},W.Component.InWorld.preUpdate=function(){if(this.autoCull||this.checkWorldBounds){if(this._bounds.copyFrom(this.getBounds()),this._bounds.x+=this.game.camera.view.x,this._bounds.y+=this.game.camera.view.y,this.autoCull)if(this.game.world.camera.view.intersects(this._bounds))this.renderable=!0,this.game.world.camera.totalInView++;else if(this.renderable=!1,this.outOfCameraBoundsKill)return this.kill(),!1;if(this.checkWorldBounds)if(this._outOfBoundsFired&&this.game.world.bounds.intersects(this._bounds))this._outOfBoundsFired=!1,this.events.onEnterBounds$dispatch(this);else if(!this._outOfBoundsFired&&!this.game.world.bounds.intersects(this._bounds)&&(this._outOfBoundsFired=!0,this.events.onOutOfBounds$dispatch(this),this.outOfBoundsKill))return this.kill(),!1}return!0},W.Component.InWorld.prototype={checkWorldBounds:!1,outOfBoundsKill:!1,outOfCameraBoundsKill:!1,_outOfBoundsFired:!1,inWorld:{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}},W.Component.LifeSpan=function(){},W.Component.LifeSpan.preUpdate=function(){return!(0this.scaleMax.x&&(t.a=this.scaleMax.x),t.d>this.scaleMax.y&&(t.d=this.scaleMax.y))},setScaleMinMax:function(t,e,i,s){void 0===e?e=i=s=t:void 0===i&&(i=s=e,e=t),null===t?this.scaleMin=null:this.scaleMin?this.scaleMin.set(t,e):this.scaleMin=new W.Point(t,e),null===i?this.scaleMax=null:this.scaleMax?this.scaleMax.set(i,s):this.scaleMax=new W.Point(i,s),null===this.scaleMin?this.transformCallback=null:(this.transformCallback=this.checkTransform,this.transformCallbackContext=this)}},W.Component.Smoothed=function(){},W.Component.Smoothed.prototype={smoothed:{get:function(){return!this.texture.baseTexture.scaleMode},set:function(t){t?this.texture&&(this.texture.baseTexture.scaleMode=0):this.texture&&(this.texture.baseTexture.scaleMode=1)}}},W.GameObjectFactory=function(t){this.game=t,this.world=this.game.world},W.GameObjectFactory.prototype={existing:function(t){return this.world.add(t)},weapon:function(t,e,i,s){var n=this.game.plugins.add(W.Weapon);return n.createBullets(t,e,i,s),n},image:function(t,e,i,s,n){return void 0===n&&(n=this.world),n.add(new W.Image(this.game,t,e,i,s))},sprite:function(t,e,i,s,n){return void 0===n&&(n=this.world),n.create(t,e,i,s)},creature:function(t,e,i,s,n){void 0===n&&(n=this.world);var o=new W.Creature(this.game,t,e,i,s);return n.add(o),o},tween:function(t){return this.game.tweens.create(t)},group:function(t,e,i,s,n){return new W.Group(this.game,t,e,i,s,n)},physicsGroup:function(t,e,i,s){return new W.Group(this.game,e,i,s,!0,t)},spriteBatch:function(t,e,i){return void 0===t&&(t=null),void 0===e&&(e="group"),void 0===i&&(i=!1),new W.SpriteBatch(this.game,t,e,i)},audio:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},sound:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},audioSprite:function(t){return this.game.sound.addSprite(t)},tileSprite:function(t,e,i,s,n,o,a){return void 0===a&&(a=this.world),a.add(new W.TileSprite(this.game,t,e,i,s,n,o))},rope:function(t,e,i,s,n,o){return void 0===o&&(o=this.world),o.add(new W.Rope(this.game,t,e,i,s,n))},text:function(t,e,i,s,n){return void 0===n&&(n=this.world),n.add(new W.Text(this.game,t,e,i,s))},button:function(t,e,i,s,n,o,a,r,h,l){return void 0===l&&(l=this.world),l.add(new W.Button(this.game,t,e,i,s,n,o,a,r,h))},graphics:function(t,e,i){return void 0===i&&(i=this.world),i.add(new W.Graphics(this.game,t,e))},emitter:function(t,e,i){return this.game.particles.add(new W.Particles.Arcade.Emitter(this.game,t,e,i))},retroFont:function(t,e,i,s,n,o,a,r,h){return new W.RetroFont(this.game,t,e,i,s,n,o,a,r,h)},bitmapText:function(t,e,i,s,n,o){return void 0===o&&(o=this.world),o.add(new W.BitmapText(this.game,t,e,i,s,n))},tilemap:function(t,e,i,s,n){return new W.Tilemap(this.game,t,e,i,s,n)},renderTexture:function(t,e,i,s){void 0!==i&&""!==i||(i=this.game.rnd.uuid()),void 0===s&&(s=!1);var n=new W.RenderTexture(this.game,t,e,i);return s&&this.game.cache.addRenderTexture(i,n),n},video:function(t,e){return new W.Video(this.game,t,e)},bitmapData:function(t,e,i,s){void 0===s&&(s=!1),void 0!==i&&""!==i||(i=this.game.rnd.uuid());var n=new W.BitmapData(this.game,i,t,e);return s&&this.game.cache.addBitmapData(i,n),n},filter:function(t){var e=Array.prototype.slice.call(arguments,1);return(t=new W.Filter[t](this.game)).init.apply(t,e),t},plugin:function(t){return this.game.plugins.add(t)}},W.GameObjectFactory.prototype.constructor=W.GameObjectFactory,W.GameObjectCreator=function(t){this.game=t,this.world=this.game.world},W.GameObjectCreator.prototype={image:function(t,e,i,s){return new W.Image(this.game,t,e,i,s)},sprite:function(t,e,i,s){return new W.Sprite(this.game,t,e,i,s)},tween:function(t){return new W.Tween(t,this.game,this.game.tweens)},group:function(t,e,i,s,n){return new W.Group(this.game,t,e,i,s,n)},spriteBatch:function(t,e,i){return void 0===e&&(e="group"),void 0===i&&(i=!1),new W.SpriteBatch(this.game,t,e,i)},audio:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},audioSprite:function(t){return this.game.sound.addSprite(t)},sound:function(t,e,i,s){return this.game.sound.add(t,e,i,s)},tileSprite:function(t,e,i,s,n,o){return new W.TileSprite(this.game,t,e,i,s,n,o)},rope:function(t,e,i,s,n){return new W.Rope(this.game,t,e,i,s,n)},text:function(t,e,i,s){return new W.Text(this.game,t,e,i,s)},button:function(t,e,i,s,n,o,a,r,h){return new W.Button(this.game,t,e,i,s,n,o,a,r,h)},graphics:function(t,e){return new W.Graphics(this.game,t,e)},emitter:function(t,e,i){return new W.Particles.Arcade.Emitter(this.game,t,e,i)},retroFont:function(t,e,i,s,n,o,a,r,h){return new W.RetroFont(this.game,t,e,i,s,n,o,a,r,h)},bitmapText:function(t,e,i,s,n,o){return new W.BitmapText(this.game,t,e,i,s,n,o)},tilemap:function(t,e,i,s,n){return new W.Tilemap(this.game,t,e,i,s,n)},renderTexture:function(t,e,i,s){void 0!==i&&""!==i||(i=this.game.rnd.uuid()),void 0===s&&(s=!1);var n=new W.RenderTexture(this.game,t,e,i);return s&&this.game.cache.addRenderTexture(i,n),n},bitmapData:function(t,e,i,s){void 0===s&&(s=!1),void 0!==i&&""!==i||(i=this.game.rnd.uuid());var n=new W.BitmapData(this.game,i,t,e);return s&&this.game.cache.addBitmapData(i,n),n},filter:function(t){var e=Array.prototype.slice.call(arguments,1);return(t=new W.Filter[t](this.game)).init.apply(t,e),t}},W.GameObjectCreator.prototype.constructor=W.GameObjectCreator,W.Sprite=function(t,e,i,s,n){e=e||0,i=i||0,s=s||null,n=n||null,this.type=W.SPRITE,this.physicsType=W.SPRITE,PIXI.Sprite.call(this,W.Cache.DEFAULT),W.Component.Core.init.call(this,t,e,i,s,n)},W.Sprite.prototype=Object.create(PIXI.Sprite.prototype),W.Sprite.prototype.constructor=W.Sprite,W.Component.Core.install.call(W.Sprite.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Crop","Delta","Destroy","FixedToCamera","Health","InCamera","InputEnabled","InWorld","LifeSpan","LoadTexture","Overlap","PhysicsBody","Reset","ScaleMinMax","Smoothed"]),W.Sprite.prototype.preUpdatePhysics=W.Component.PhysicsBody.preUpdate,W.Sprite.prototype.preUpdateLifeSpan=W.Component.LifeSpan.preUpdate,W.Sprite.prototype.preUpdateInWorld=W.Component.InWorld.preUpdate,W.Sprite.prototype.preUpdateCore=W.Component.Core.preUpdate,W.Sprite.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},W.Image=function(t,e,i,s,n){e=e||0,i=i||0,s=s||null,n=n||null,this.type=W.IMAGE,PIXI.Sprite.call(this,W.Cache.DEFAULT),W.Component.Core.init.call(this,t,e,i,s,n)},W.Image.prototype=Object.create(PIXI.Sprite.prototype),W.Image.prototype.constructor=W.Image,W.Component.Core.install.call(W.Image.prototype,["Angle","Animation","AutoCull","Bounds","BringToTop","Crop","Destroy","FixedToCamera","InputEnabled","LifeSpan","LoadTexture","Overlap","Reset","ScaleMinMax","Smoothed"]),W.Image.prototype.preUpdateInWorld=W.Component.InWorld.preUpdate,W.Image.prototype.preUpdateCore=W.Component.Core.preUpdate,W.Image.prototype.preUpdate=function(){return!!this.preUpdateInWorld()&&this.preUpdateCore()},W.Button=function(t,e,i,s,n,o,a,r,h,l){e=e||0,i=i||0,s=s||null,n=n||null,o=o||this,W.Image.call(this,t,e,i,s,r),this.type=W.BUTTON,this.physicsType=W.SPRITE,this._onOverFrame=null,this._onOutFrame=null,this._onDownFrame=null,this._onUpFrame=null,this.onOverSound=null,this.onOutSound=null,this.onDownSound=null,this.onUpSound=null,this.onOverSoundMarker="",this.onOutSoundMarker="",this.onDownSoundMarker="",this.onUpSoundMarker="",this.onInputOver=new W.Signal,this.onInputOut=new W.Signal,this.onInputDown=new W.Signal,this.onInputUp=new W.Signal,this.onOverMouseOnly=!0,this.justReleasedPreventsOver=W.PointerMode.TOUCH,this.freezeFrames=!1,this.forceOut=!1,this.inputEnabled=!0,this.input.start(0,!0),this.input.useHandCursor=!0,this.setFrames(a,r,h,l),null!==n&&this.onInputUp.add(n,o),this.events.onInputOver.add(this.onInputOverHandler,this),this.events.onInputOut.add(this.onInputOutHandler,this),this.events.onInputDown.add(this.onInputDownHandler,this),this.events.onInputUp.add(this.onInputUpHandler,this),this.events.onRemovedFromWorld.add(this.removedFromWorld,this)},W.Button.prototype=Object.create(W.Image.prototype),W.Button.prototype.constructor=W.Button;W.Button.prototype.clearFrames=function(){this.setFrames(null,null,null,null)},W.Button.prototype.removedFromWorld=function(){this.inputEnabled=!1},W.Button.prototype.setStateFrame=function(t,e,i){var s="_on"+t+"Frame";null!==e?(this[s]=e,i&&this.changeStateFrame(t)):this[s]=null},W.Button.prototype.changeStateFrame=function(t){if(this.freezeFrames)return!1;var e=this["_on"+t+"Frame"];return"string"==typeof e?(this.frameName=e,!0):"number"==typeof e&&(this.frame=e,!0)},W.Button.prototype.setFrames=function(t,e,i,s){this.setStateFrame("Over",t,this.input.pointerOver()),this.setStateFrame("Out",e,!this.input.pointerOver()),this.setStateFrame("Down",i,this.input.pointerDown()),this.setStateFrame("Up",s,this.input.pointerUp())},W.Button.prototype.setStateSound=function(t,e,i){var s="on"+t+"Sound",n="on"+t+"SoundMarker";e instanceof W.Sound||e instanceof W.AudioSprite?(this[s]=e,this[n]="string"==typeof i?i:""):(this[s]=null,this[n]="")},W.Button.prototype.playStateSound=function(t){var e=this["on"+t+"Sound"];if(e){var i=this["on"+t+"SoundMarker"];return e.play(i),!0}return!1},W.Button.prototype.setSounds=function(t,e,i,s,n,o,a,r){this.setStateSound("Over",t,e),this.setStateSound("Out",n,o),this.setStateSound("Down",i,s),this.setStateSound("Up",a,r)},W.Button.prototype.setOverSound=function(t,e){this.setStateSound("Over",t,e)},W.Button.prototype.setOutSound=function(t,e){this.setStateSound("Out",t,e)},W.Button.prototype.setDownSound=function(t,e){this.setStateSound("Down",t,e)},W.Button.prototype.setUpSound=function(t,e){this.setStateSound("Up",t,e)},W.Button.prototype.onInputOverHandler=function(t,e){e.justReleased()&&(this.justReleasedPreventsOver&e.pointerMode)===e.pointerMode||(this.changeStateFrame("Over"),this.onOverMouseOnly&&!e.isMouse||(this.playStateSound("Over"),this.onInputOver&&this.onInputOver.dispatch(this,e)))},W.Button.prototype.onInputOutHandler=function(t,e){this.changeStateFrame("Out"),this.playStateSound("Out"),this.onInputOut&&this.onInputOut.dispatch(this,e)},W.Button.prototype.onInputDownHandler=function(t,e){this.changeStateFrame("Down"),this.playStateSound("Down"),this.onInputDown&&this.onInputDown.dispatch(this,e)},W.Button.prototype.onInputUpHandler=function(t,e,i){if(this.playStateSound("Up"),this.onInputUp&&this.onInputUp.dispatch(this,e,i),!this.freezeFrames)if(!0===this.forceOut||(this.forceOut&e.pointerMode)===e.pointerMode)this.changeStateFrame("Out");else{this.changeStateFrame("Up")||(i?this.changeStateFrame("Over"):this.changeStateFrame("Out"))}},W.SpriteBatch=function(t,e,i,s){null!=e||(e=t.world),PIXI.SpriteBatch.call(this),W.Group.call(this,t,e,i,s),this.type=W.SPRITEBATCH},W.SpriteBatch.prototype=W.Utils.extend(!0,W.SpriteBatch.prototype,PIXI.SpriteBatch.prototype,W.Group.prototype),W.SpriteBatch.prototype.constructor=W.SpriteBatch,W.BitmapData=function(t,e,i,s,n){void 0!==i&&0!==i||(i=256),void 0!==s&&0!==s||(s=256),void 0===n&&(n=!1),this.game=t,this.key=e,this.width=i,this.height=s,this.canvas=W.Canvas.create(this,i,s,null,n),this.context=this.canvas.getContext("2d",{alpha:!0}),this.ctx=this.context,this.smoothProperty=t.renderType===W.CANVAS?t.renderer.renderSession.smoothProperty:W.Canvas.getSmoothingPrefix(this.context),this.imageData=this.context.getImageData(0,0,i,s),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data),this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.frameData=new W.FrameData,this.textureFrame=this.frameData.addFrame(new W.Frame(0,0,0,i,s,"bitmapData")),this.texture.frame=this.textureFrame,this.type=W.BITMAPDATA,this.disableTextureUpload=!1,this.dirty=!1,this.cls=this.clear,this._image=null,this._pos=new W.Point,this._size=new W.Point,this._scale=new W.Point,this._rotate=0,this._alpha={prev:1,current:1},this._anchor=new W.Point,this._tempR=0,this._tempG=0,this._tempB=0,this._circle=new W.Circle,this._swapCanvas=void 0},W.BitmapData.prototype={move:function(t,e,i){return 0!==t&&this.moveH(t,i),0!==e&&this.moveV(e,i),this},moveH:function(t,e){void 0===e&&(e=!0),void 0===this._swapCanvas&&(this._swapCanvas=PIXI.CanvasPool.create(this,this.width,this.height));var i=this._swapCanvas.getContext("2d"),s=this.height,n=this.canvas;if(i.clearRect(0,0,this.width,this.height),t<0){t=Math.abs(t);var o=this.width-t;e&&i.drawImage(n,0,0,t,s,o,0,t,s),i.drawImage(n,t,0,o,s,0,0,o,s)}else{o=this.width-t;e&&i.drawImage(n,o,0,t,s,0,0,t,s),i.drawImage(n,0,0,o,s,t,0,o,s)}return this.clear(),this.copy(this._swapCanvas)},moveV:function(t,e){void 0===e&&(e=!0),void 0===this._swapCanvas&&(this._swapCanvas=PIXI.CanvasPool.create(this,this.width,this.height));var i=this._swapCanvas.getContext("2d"),s=this.width,n=this.canvas;if(i.clearRect(0,0,this.width,this.height),t<0){t=Math.abs(t);var o=this.height-t;e&&i.drawImage(n,0,0,s,t,0,o,s,t),i.drawImage(n,0,t,s,o,0,0,s,o)}else{o=this.height-t;e&&i.drawImage(n,0,o,s,t,0,0,s,t),i.drawImage(n,0,0,s,o,0,t,s,o)}return this.clear(),this.copy(this._swapCanvas)},add:function(t){if(Array.isArray(t))for(var e=0;e=this.height||s<=0)&&(o=!0)):2!==t&&3!==t||++s===this.height&&(s=0,((i+=n)>=this.width||i<=0)&&(o=!0)),0===e.a&&!o;);return e.x=i,e.y=s,e},getBounds:function(t){return void 0===t&&(t=new W.Rectangle),t.x=this.getFirstPixel(2).x,t.x===this.width?t.setTo(0,0,0,0):(t.y=this.getFirstPixel(0).y,t.width=this.getFirstPixel(3).x-t.x+1,t.height=this.getFirstPixel(1).y-t.y+1,t)},addToWorld:function(t,e,i,s,n,o){n=n||1,o=o||1;var a=this.game.add.image(t,e,this);return a.anchor.set(i,s),a.scale.set(n,o),a},copy:function(t,e,i,s,n,o,a,r,h,l,c,u,d,p,f,y,g){if(null!=t||(t=this),(t instanceof W.RenderTexture||t instanceof PIXI.RenderTexture)&&(t=t.getCanvas()),(this._image=t)instanceof W.Sprite||t instanceof W.Image||t instanceof W.Text||t instanceof PIXI.Sprite)this._pos.set(t.texture.crop.x,t.texture.crop.y),this._size.set(t.texture.crop.width,t.texture.crop.height),this._scale.set(t.scale.x,t.scale.y),this._anchor.set(t.anchor.x,t.anchor.y),this._rotate=t.rotation,this._alpha.current=t.alpha,t.texture instanceof W.RenderTexture||t.texture instanceof PIXI.RenderTexture?this._image=t.texture.getCanvas():this._image=t.texture.baseTexture.source,null!=o||(o=t.x),null!=a||(a=t.y),t.texture.trim&&(o+=t.texture.trim.x-t.anchor.x*t.texture.trim.width,a+=t.texture.trim.y-t.anchor.y*t.texture.trim.height),16777215!==t.tint&&(t.cachedTint!==t.tint&&(t.cachedTint=t.tint,t.tintedTexture=PIXI.CanvasTinter.getTintedTexture(t,t.tint)),this._image=t.tintedTexture,this._pos.set(0));else{if(this._pos.set(0),this._scale.set(1),this._anchor.set(0),this._rotate=0,this._alpha.current=1,t instanceof W.BitmapData)this._image=t.canvas;else if("string"==typeof t){if(null===(t=this.game.cache.getImage(t)))return;this._image=t}this._size.set(this._image.width,this._image.height)}if(null!=e||(e=0),null!=i||(i=0),s&&(this._size.x=s),n&&(this._size.y=n),null!=o||(o=e),null!=a||(a=i),null!=r||(r=this._size.x),null!=h||(h=this._size.y),"number"==typeof l&&(this._rotate=l),"number"==typeof c&&(this._anchor.x=c),"number"==typeof u&&(this._anchor.y=u),"number"==typeof d&&(this._scale.x=d),"number"==typeof p&&(this._scale.y=p),"number"==typeof f&&(this._alpha.current=f),void 0===y&&(y=null),void 0===g&&(g=!1),!(this._alpha.current<=0||0===this._scale.x||0===this._scale.y||0===this._size.x||0===this._size.y)){var m=this.context;return this._alpha.prev=m.globalAlpha,m.save(),m.globalAlpha=this._alpha.current,y&&(this.op=y),g&&(o|=0,a|=0),m.translate(o,a),m.scale(this._scale.x,this._scale.y),m.rotate(this._rotate),m.drawImage(this._image,this._pos.x+e,this._pos.y+i,this._size.x,this._size.y,-r*this._anchor.x,-h*this._anchor.y,r,h),m.restore(),m.globalAlpha=this._alpha.prev,this.dirty=!0,this}},copyTransform:function(t,e,i){if(void 0===e&&(e=null),void 0===i&&(i=!1),!t.hasOwnProperty("worldTransform")||!t.worldVisible||0===t.worldAlpha)return this;var s=t.worldTransform;if(this._pos.set(t.texture.crop.x,t.texture.crop.y),this._size.set(t.texture.crop.width,t.texture.crop.height),0===s.a||0===s.d||0===this._size.x||0===this._size.y)return this;t.texture instanceof W.RenderTexture||t.texture instanceof PIXI.RenderTexture?this._image=t.texture.getCanvas():this._image=t.texture.baseTexture.source;var n=s.tx,o=s.ty;t.texture.trim&&(n+=t.texture.trim.x-t.anchor.x*t.texture.trim.width,o+=t.texture.trim.y-t.anchor.y*t.texture.trim.height),16777215!==t.tint&&(t.cachedTint!==t.tint&&(t.cachedTint=t.tint,t.tintedTexture=PIXI.CanvasTinter.getTintedTexture(t,t.tint)),this._image=t.tintedTexture,this._pos.set(0)),i&&(n|=0,o|=0);var a=this.context;return this._alpha.prev=a.globalAlpha,a.save(),a.globalAlpha=this._alpha.current,e&&(this.op=e),a[this.smoothProperty]=t.texture.baseTexture.scaleMode===PIXI.scaleModes.LINEAR,a.setTransform(s.a,s.b,s.c,s.d,n,o),a.drawImage(this._image,this._pos.x,this._pos.y,this._size.x,this._size.y,-this._size.x*t.anchor.x,-this._size.y*t.anchor.y,this._size.x,this._size.y),a.restore(),a.globalAlpha=this._alpha.prev,this.dirty=!0,this},copyRect:function(t,e,i,s,n,o,a){return this.copy(t,e.x,e.y,e.width,e.height,i,s,e.width,e.height,0,0,0,1,1,n,o,a)},draw:function(t,e,i,s,n,o,a){return this.copy(t,null,null,null,null,e,i,s,n,null,null,null,null,null,null,o,a)},drawGroup:function(t,e,i){return 0e.width&&(s=e.width);var n=this.context;return n.fillStyle=n.createPattern(e,i),this._circle=new W.Circle(t.start.x,t.start.y,e.height),this._circle.circumferencePoint(t.angle-1.5707963267948966,!1,this._pos),n.save(),n.translate(this._pos.x,this._pos.y),n.rotate(t.angle),n.fillRect(0,0,s,e.height),n.restore(),this.dirty=!0,this}},render:function(){return!this.disableTextureUpload&&this.dirty&&(this.baseTexture.dirty(),this.dirty=!1),this},destroy:function(){this.frameData.destroy(),this.texture.destroy(!0),PIXI.CanvasPool.remove(this)},blendReset:function(){return this.op="source-over",this},blendSourceOver:function(){return this.op="source-over",this},blendSourceIn:function(){return this.op="source-in",this},blendSourceOut:function(){return this.op="source-out",this},blendSourceAtop:function(){return this.op="source-atop",this},blendDestinationOver:function(){return this.op="destination-over",this},blendDestinationIn:function(){return this.op="destination-in",this},blendDestinationOut:function(){return this.op="destination-out",this},blendDestinationAtop:function(){return this.op="destination-atop",this},blendXor:function(){return this.op="xor",this},blendAdd:function(){return this.op="lighter",this},blendMultiply:function(){return this.op="multiply",this},blendScreen:function(){return this.op="screen",this},blendOverlay:function(){return this.op="overlay",this},blendDarken:function(){return this.op="darken",this},blendLighten:function(){return this.op="lighten",this},blendColorDodge:function(){return this.op="color-dodge",this},blendColorBurn:function(){return this.op="color-burn",this},blendHardLight:function(){return this.op="hard-light",this},blendSoftLight:function(){return this.op="soft-light",this},blendDifference:function(){return this.op="difference",this},blendExclusion:function(){return this.op="exclusion",this},blendHue:function(){return this.op="hue",this},blendSaturation:function(){return this.op="saturation",this},blendColor:function(){return this.op="color",this},blendLuminosity:function(){return this.op="luminosity",this}},Object.defineProperty(W.BitmapData.prototype,"smoothed",{get:function(){W.Canvas.getSmoothingEnabled(this.context)},set:function(t){W.Canvas.setSmoothingEnabled(this.context,t)}}),Object.defineProperty(W.BitmapData.prototype,"op",{get:function(){return this.context.globalCompositeOperation},set:function(t){this.context.globalCompositeOperation=t}}),W.BitmapData.getTransform=function(t,e,i,s,n,o){return"number"!=typeof t&&(t=0),"number"!=typeof e&&(e=0),"number"!=typeof i&&(i=1),"number"!=typeof s&&(s=1),"number"!=typeof n&&(n=0),"number"!=typeof o&&(o=0),{sx:i,sy:s,scaleX:i,scaleY:s,skewX:n,skewY:o,translateX:t,translateY:e,tx:t,ty:e}},W.BitmapData.prototype.constructor=W.BitmapData,PIXI.Graphics=function(){PIXI.DisplayObjectContainer.call(this),this.renderable=!0,this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this.blendMode=PIXI.blendModes.NORMAL,this.currentPath=null,this._webGL=[],this.isMask=!1,this.boundsPadding=0,this._localBounds=new PIXI.Rectangle(0,0,1,1),this.dirty=!0,this._boundsDirty=!1,this.webGLDirty=!1,this.cachedSpriteDirty=!1},PIXI.Graphics.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),PIXI.Graphics.prototype.constructor=PIXI.Graphics,PIXI.Graphics.prototype.lineStyle=function(t,e,i){return this.lineWidth=t||0,this.lineColor=e||0,this.lineAlpha=void 0===i?1:i,this.currentPath&&(this.currentPath.shape.points.length?this.drawShape(new PIXI.Polygon(this.currentPath.shape.points.slice(-2))):(this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha)),this},PIXI.Graphics.prototype.moveTo=function(t,e){return this.drawShape(new PIXI.Polygon([t,e])),this},PIXI.Graphics.prototype.lineTo=function(t,e){return this.currentPath||this.moveTo(0,0),this.currentPath.shape.points.push(t,e),this.dirty=!0,this._boundsDirty=!0,this},PIXI.Graphics.prototype.quadraticCurveTo=function(t,e,i,s){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var n,o,a=this.currentPath.shape.points;0===a.length&&this.moveTo(0,0);for(var r=a[a.length-2],h=a[a.length-1],l=0,c=1;c<=20;++c)n=r+(t-r)*(l=c/20),o=h+(e-h)*l,a.push(n+(t+(i-t)*l-n)*l,o+(e+(s-e)*l-o)*l);return this.dirty=!0,this._boundsDirty=!0,this},PIXI.Graphics.prototype.bezierCurveTo=function(t,e,i,s,n,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var a,r,h,l,c,u=this.currentPath.shape.points,d=u[u.length-2],p=u[u.length-1],f=0,y=1;y<=20;++y)h=(r=(a=1-(f=y/20))*a)*a,c=(l=f*f)*f,u.push(h*d+3*r*f*t+3*a*l*i+c*n,h*p+3*r*f*e+3*a*l*s+c*o);return this.dirty=!0,this._boundsDirty=!0,this},PIXI.Graphics.prototype.arcTo=function(t,e,i,s,n){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,a=o[o.length-2],r=o[o.length-1]-e,h=a-t,l=s-e,c=i-t,u=Math.abs(r*c-h*l);if(u<1e-8||0===n)o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e);else{var d=r*r+h*h,p=l*l+c*c,f=r*l+h*c,y=n*Math.sqrt(d)/u,g=n*Math.sqrt(p)/u,m=y*f/d,v=g*f/p,b=y*c+g*h,x=y*l+g*r,_=h*(g+m),w=r*(g+m),P=c*(y+v),C=l*(y+v),T=Math.atan2(w-x,_-b),S=Math.atan2(C-x,P-b);this.arc(b+t,x+e,n,T,S,c*r80*i){s=o=t[0],n=a=t[1];for(var f=i;fo.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,u=PIXI.EarCut.zOrder(r,h,e,i,s),d=PIXI.EarCut.zOrder(l,c,e,i,s),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&PIXI.EarCut.pointInTriangle(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=PIXI.EarCut.area(p.prev,p,p.next))return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&PIXI.EarCut.pointInTriangle(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=PIXI.EarCut.area(p.prev,p,p.next))return!1;p=p.prevZ}return!0},PIXI.EarCut.cureLocalIntersections=function(t,e,i){var s=t;do{var n=s.prev,o=s.next.next;PIXI.EarCut.intersects(n,s,s.next,o)&&PIXI.EarCut.locallyInside(n,o)&&PIXI.EarCut.locallyInside(o,n)&&(e.push(n.i/i),e.push(s.i/i),e.push(o.i/i),PIXI.EarCut.removeNode(s),PIXI.EarCut.removeNode(s.next),s=t=o),s=s.next}while(s!==t);return s},PIXI.EarCut.splitEarcut=function(t,e,i,s,n,o){var a=t;do{for(var r=a.next.next;r!==a.prev;){if(a.i!==r.i&&PIXI.EarCut.isValidDiagonal(a,r)){var h=PIXI.EarCut.splitPolygon(a,r);return a=PIXI.EarCut.filterPoints(a,a.next),h=PIXI.EarCut.filterPoints(h,h.next),PIXI.EarCut.earcutLinked(a,e,i,s,n,o),void PIXI.EarCut.earcutLinked(h,e,i,s,n,o)}r=r.next}a=a.next}while(a!==t)},PIXI.EarCut.eliminateHoles=function(t,e,i,s){var n,o,a,r,h,l=[];for(n=0,o=e.length;n=s.next.y){var r=s.x+(o-s.y)*(s.next.x-s.x)/(s.next.y-s.y);r<=n&&a=s.x&&s.x>=i.x&&PIXI.EarCut.pointInTriangle(oi.x)&&PIXI.EarCut.locallyInside(s,t)&&(i=s,c=h),s=s.next;return i},PIXI.EarCut.indexCurve=function(t,e,i,s){for(var n=t;null===n.z&&(n.z=PIXI.EarCut.zOrder(n.x,n.y,e,i,s)),n.prevZ=n.prev,n.nextZ=n.next,(n=n.next)!==t;);n.prevZ.nextZ=null,n.prevZ=null,PIXI.EarCut.sortLinked(n)},PIXI.EarCut.sortLinked=function(t){var e,i,s,n,o,a,r,h,l=1;do{for(i=t,o=t=null,a=0;i;){for(a++,s=i,e=r=0;eo!=i.next.y>o&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(s=!s),(i=i.next)!==t;);return s},PIXI.EarCut.splitPolygon=function(t,e){var i=new PIXI.EarCut.Node(t.i,t.x,t.y),s=new PIXI.EarCut.Node(e.i,e.x,e.y),n=t.next,o=e.prev;return(t.next=e).prev=t,(i.next=n).prev=i,(s.next=i).prev=s,(o.next=s).prev=o,s},PIXI.EarCut.insertNode=function(t,e,i,s){var n=new PIXI.EarCut.Node(t,e,i);return s?(n.next=s.next,(n.prev=s).next.prev=n,s.next=n):(n.prev=n).next=n,n},PIXI.EarCut.removeNode=function(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)},PIXI.EarCut.Node=function(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1},PIXI.WebGLGraphics=function(){},PIXI.WebGLGraphics.stencilBufferLimit=6,PIXI.WebGLGraphics.renderGraphics=function(t,e){var i,s=e.gl,n=e.projection,o=e.offset,a=e.shaderManager.primitiveShader;t.dirty&&PIXI.WebGLGraphics.updateGraphics(t,s);for(var r=t._webGL[s.id],h=0;h=PIXI.WebGLGraphics.stencilBufferLimit)if(a.points.length<2*PIXI.WebGLGraphics.stencilBufferLimit){s=PIXI.WebGLGraphics.switchMode(n,0),PIXI.WebGLGraphics.buildPoly(a,s)||(s=PIXI.WebGLGraphics.switchMode(n,1),PIXI.WebGLGraphics.buildComplexPoly(a,s))}else s=PIXI.WebGLGraphics.switchMode(n,1),PIXI.WebGLGraphics.buildComplexPoly(a,s);0>16&255)/255,i=(t.tint>>8&255)/255,s=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((a>>8&255)/255*i*255<<8)+(255&a)/255*s*255,o._lineTint=((r>>16&255)/255*e*255<<16)+((r>>8&255)/255*i*255<<8)+(255&r)/255*s*255}},W.Graphics=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),this.type=W.GRAPHICS,this.physicsType=W.SPRITE,this.anchor=new W.Point,PIXI.Graphics.call(this),W.Component.Core.init.call(this,t,e,i,"",null)},W.Graphics.prototype=Object.create(PIXI.Graphics.prototype),W.Graphics.prototype.constructor=W.Graphics,W.Component.Core.install.call(W.Graphics.prototype,["Angle","AutoCull","Bounds","Destroy","FixedToCamera","InputEnabled","InWorld","LifeSpan","PhysicsBody","Reset"]),W.Graphics.prototype.preUpdatePhysics=W.Component.PhysicsBody.preUpdate,W.Graphics.prototype.preUpdateLifeSpan=W.Component.LifeSpan.preUpdate,W.Graphics.prototype.preUpdateInWorld=W.Component.InWorld.preUpdate,W.Graphics.prototype.preUpdateCore=W.Component.Core.preUpdate,W.Graphics.prototype.preUpdate=function(){return!!(this.preUpdatePhysics()&&this.preUpdateLifeSpan()&&this.preUpdateInWorld())&&this.preUpdateCore()},W.Graphics.prototype.postUpdate=function(){W.Component.PhysicsBody.postUpdate.call(this),W.Component.FixedToCamera.postUpdate.call(this),this._boundsDirty&&(this.updateLocalBounds(),this._boundsDirty=!1);for(var t=0;ty&&(m=-y),0!==m&&(g+=0i&&(this.style.wordWrapWidth=i)),this.updateTexture(),this},W.Text.prototype.updateTexture=function(){var t=this.texture.baseTexture,e=this.texture.crop,i=this.texture.frame,s=this.canvas.width,n=this.canvas.height;if(t.width=s,t.height=n,e.width=s,e.height=n,i.width=s,i.height=n,this.texture.width=s,this.texture.height=n,this._width=s,this._height=n,this.textBounds){var o=this.textBounds.x,a=this.textBounds.y;"right"===this.style.boundsAlignH?o+=this.textBounds.width-this.canvas.width/this.resolution:"center"===this.style.boundsAlignH&&(o+=this.textBounds.halfWidth-this.canvas.width/this.resolution/2),"bottom"===this.style.boundsAlignV?a+=this.textBounds.height-this.canvas.height/this.resolution:"middle"===this.style.boundsAlignV&&(a+=this.textBounds.halfHeight-this.canvas.height/this.resolution/2),this.pivot.x=-o,this.pivot.y=-a}this.renderable=0!==s&&0!==n,this.texture.requiresReTint=!0,this.texture.baseTexture.dirty()},W.Text.prototype._renderWebGL=function(t){this.dirty&&(this.updateText(),this.dirty=!1),PIXI.Sprite.prototype._renderWebGL.call(this,t)},W.Text.prototype._renderCanvas=function(t){this.dirty&&(this.updateText(),this.dirty=!1),PIXI.Sprite.prototype._renderCanvas.call(this,t)},W.Text.prototype.determineFontProperties=function(t){var e=W.Text.fontPropertiesCache[t];if(!e){e={};var i=W.Text.fontPropertiesCanvas,s=W.Text.fontPropertiesContext;s.font=t;var n=Math.ceil(s.measureText("|MÉq").width),o=Math.ceil(s.measureText("|MÉq").width),a=2*o;if(o=1.4*o|0,i.width=n,i.height=a,s.fillStyle="#f00",s.fillRect(0,0,n,a),s.font=t,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText("|MÉq",0,o),!s.getImageData(0,0,n,a))return e.ascent=o,e.descent=o+6,e.fontSize=e.ascent+e.descent,W.Text.fontPropertiesCache[t]=e;var r,h,l=s.getImageData(0,0,n,a).data,c=l.length,u=4*n,d=0,p=!1;for(r=0;rthis.textWidth&&(this.textWidth=c.width),n+=t.lineHeight*i,e=e.substr(c.text.length+1)}while(!1===c.end);this.textHeight=n;for(var o=0,a=0,r=this.textWidth*this.anchor.x,h=this.textHeight*this.anchor.y,l=0;l?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",W.RetroFont.TEXT_SET2=" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",W.RetroFont.TEXT_SET3="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",W.RetroFont.TEXT_SET4="ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",W.RetroFont.TEXT_SET5="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",W.RetroFont.TEXT_SET6="ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",W.RetroFont.TEXT_SET7="AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",W.RetroFont.TEXT_SET8="0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",W.RetroFont.TEXT_SET9="ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",W.RetroFont.TEXT_SET10="ABCDEFGHIJKLMNOPQRSTUVWXYZ",W.RetroFont.TEXT_SET11="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",W.RetroFont.prototype.setFixedWidth=function(t,e){void 0===e&&(e="left"),this.fixedWidth=t,this.align=e},W.RetroFont.prototype.setText=function(t,e,i,s,n,o){this.multiLine=e||!1,this.customSpacingX=i||0,this.customSpacingY=s||0,this.align=n||"left",this.autoUpperCase=!o,0this.width))break},W.RetroFont.prototype.getLongestLine=function(){var t=0;if(0t&&(t=e[i].length);return t},W.RetroFont.prototype.removeUnsupportedCharacters=function(t){for(var e="",i=0;i=W.Math.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et[i]&&(i=e);return t[i]},minProperty:function(t){if(2===arguments.length&&"object"==typeof arguments[1])var e=arguments[1];else e=arguments.slice(1);for(var i=1,s=0,n=e.length;ie[s][t]&&(s=i);return e[s][t]},wrapAngle:function(t,e){return e?this.wrap(t,-Math.PI,Math.PI):this.wrap(t,-180,180)},linearInterpolation:function(t,e){var i=t.length-1,s=i*e,n=Math.floor(s);return e<0?this.linear(t[0],t[1],s):1>>0,s=(e*=s)>>>0,s+=4294967296*(e-=s);return 2.3283064365386963e-10*(s>>>0)},integer:function(){return 4294967296*this.rnd.apply(this)},frac:function(){return this.rnd.apply(this)+11102230246251565e-32*(2097152*this.rnd.apply(this)|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return this.integerInRange(t,e)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick([-1,1])},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-1)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")}},W.RandomDataGenerator.prototype.constructor=W.RandomDataGenerator,W.QuadTree=function(t,e,i,s,n,o,a){this.maxObjects=10,this.maxLevels=4,this.level=0,this.bounds={},this.objects=[],this.nodes=[],this._empty=[],this.reset(t,e,i,s,n,o,a)},W.QuadTree.prototype={reset:function(t,e,i,s,n,o,a){this.maxObjects=n||10,this.maxLevels=o||4,this.level=a||0,this.bounds={x:Math.round(t),y:Math.round(e),width:i,height:s,subWidth:Math.floor(i/2),subHeight:Math.floor(s/2),right:Math.round(t)+Math.floor(i/2),bottom:Math.round(e)+Math.floor(s/2)},this.objects.length=0,this.nodes.length=0},populate:function(t){t.forEach(this.populateHandler,this,!0)},populateHandler:function(t){t.body&&t.exists&&this.insert(t.body)},split:function(){this.nodes[0]=new W.QuadTree(this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level+1),this.nodes[1]=new W.QuadTree(this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level+1),this.nodes[2]=new W.QuadTree(this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level+1),this.nodes[3]=new W.QuadTree(this.bounds.right,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level+1)},insert:function(t){var e,i=0;if(null==this.nodes[0]||-1===(e=this.getIndex(t))){if(this.objects.push(t),this.objects.length>this.maxObjects&&this.levelthis.bounds.bottom&&(e=2):t.x>this.bounds.right&&(t.ythis.bounds.bottom&&(e=3)),e},retrieve:function(t){if(t instanceof W.Rectangle)var e=this.objects,i=this.getIndex(t);else{if(!t.body)return this._empty;e=this.objects,i=this.getIndex(t.body)}return this.nodes[0]&&(e=-1!==i?e.concat(this.nodes[i].retrieve(t)):(e=(e=(e=e.concat(this.nodes[0].retrieve(t))).concat(this.nodes[1].retrieve(t))).concat(this.nodes[2].retrieve(t))).concat(this.nodes[3].retrieve(t))),e},clear:function(){this.objects.length=0;for(var t=this.nodes.length;t--;)this.nodes[t].clear(),this.nodes.splice(t,1);this.nodes.length=0}},W.QuadTree.prototype.constructor=W.QuadTree,W.Net=function(t){this.game=t},W.Net.prototype={getHostName:function(){return window.location&&window.location.hostname?window.location.hostname:null},checkDomainName:function(t){return-1!==window.location.hostname.indexOf(t)},updateQueryString:function(t,e,i,s){void 0===i&&(i=!1),void 0!==s&&""!==s||(s=window.location.href);var n="",o=new RegExp("([?|&])"+t+"=.*?(&|#|$)(.*)","gi");if(o.test(s))n=null!=e?s.replace(o,"$1"+t+"="+e+"$2$3"):s.replace(o,"$1$3").replace(/(&|\?)$/,"");else if(null!=e){var a=-1!==s.indexOf("?")?"&":"?",r=s.split("#");s=r[0]+a+t+"="+e,r[1]&&(s+="#"+r[1]),n=s}else n=s;if(!i)return n;window.location.href=n},getQueryString:function(t){void 0===t&&(t="");var e={},i=location.search.substring(1).split("&");for(var s in i){var n=i[s].split("=");if(1this.timeline.length-1)&&(t=0),this.current=t,this.timeline[this.current].start(),this},stop:function(t){return void 0===t&&(t=!1),this.isRunning=!1,this._onUpdateCallback=null,this._onUpdateCallbackContext=null,t&&(this.onComplete.dispatch(this.target,this),this._hasStarted=!1,this.chainedTween&&this.chainedTween.start()),this.manager.remove(this),this},updateTweenData:function(t,e,i){if(0===this.timeline.length)return this;if(void 0===i&&(i=0),-1===i)for(var s=0;s=this.startTime))return W.TweenData.PENDING;this.isRunning=!0}var e=this.parent.frameBased?this.game.time.physicsElapsedMS:this.game.time.elapsedMS;for(var i in this.parent.reverse?(this.dt-=e*this.parent.timeScale,this.dt=Math.max(this.dt,0)):(this.dt+=e*this.parent.timeScale,this.dt=Math.min(this.dt,this.duration)),this.percent=this.dt/this.duration,this.value=this.easingFunction(this.percent),this.vEnd){var s=this.vStart[i],n=this.vEnd[i];Array.isArray(n)?this.parent.target[i]=this.interpolationFunction.call(this.interpolationContext,n,this.value):this.parent.target[i]=s+(n-s)*this.value}return!this.parent.reverse&&1===this.percent||this.parent.reverse&&0===this.percent?this.repeat():W.TweenData.RUNNING},generateData:function(t){this.parent.reverse?this.dt=this.duration:this.dt=0;var e=[],i=!1,s=1/t*1e3;do{this.parent.reverse?(this.dt-=s,this.dt=Math.max(this.dt,0)):(this.dt+=s,this.dt=Math.min(this.dt,this.duration)),this.percent=this.dt/this.duration,this.value=this.easingFunction(this.percent);var n={};for(var o in this.vEnd){var a=this.vStart[o],r=this.vEnd[o];Array.isArray(r)?n[o]=this.interpolationFunction(r,this.value):n[o]=a+(r-a)*this.value}e.push(n),(!this.parent.reverse&&1===this.percent||this.parent.reverse&&0===this.percent)&&(i=!0)}while(!i);if(this.yoyo){var h=e.slice();h.reverse(),e=e.concat(h)}return e},repeat:function(){if(this.yoyo){if(this.inReverse&&0===this.repeatCounter){for(var t in this.vStartCache)this.vStart[t]=this.vStartCache[t],this.vEnd[t]=this.vEndCache[t];return this.inReverse=!1,W.TweenData.COMPLETE}this.inReverse=!this.inReverse}else if(0===this.repeatCounter)return W.TweenData.COMPLETE;if(this.inReverse)for(var t in this.vStartCache)this.vStart[t]=this.vEndCache[t],this.vEnd[t]=this.vStartCache[t];else{for(var t in this.vStartCache)this.vStart[t]=this.vStartCache[t],this.vEnd[t]=this.vEndCache[t];0=2*this._desiredFps&&(this.suggestedFps=5*Math.floor(200/(this._elapsedAccumulator/this._frameCount)),this._frameCount=0,this._elapsedAccumulator=0),this.msMin=Math.min(this.msMin,this.elapsed),this.msMax=Math.max(this.msMax,this.elapsed),this.frames++,this.now>this._timeLastSecond+1e3&&(this.fps=Math.round(1e3*this.frames/(this.now-this._timeLastSecond)),this.fpsMin=Math.min(this.fpsMin,this.fps),this.fpsMax=Math.max(this.fpsMax,this.fps),this._timeLastSecond=this.now,this.frames=0)},gamePaused:function(){this._pauseStarted=Date.now(),this.events.pause();for(var t=this._timers.length;t--;)this._timers[t]._pause()},gameResumed:function(){this.time=Date.now(),this.pauseDuration=this.time-this._pauseStarted,this.events.resume();for(var t=this._timers.length;t--;)this._timers[t]._resume()},totalElapsedSeconds:function(){return.001*(this.time-this._started)},elapsedSince:function(t){return this.time-t},elapsedSecondsSince:function(t){return.001*(this.time-t)},reset:function(){this._started=this.time,this.removeAll()}},Object.defineProperty(W.Time.prototype,"desiredFps",{get:function(){return this._desiredFps},set:function(t){this._desiredFps=t,this.physicsElapsed=1/t,this.physicsElapsedMS=1e3*this.physicsElapsed,this.desiredFpsMult=1/t}}),W.Time.prototype.constructor=W.Time,W.Timer=function(t,e){void 0===e&&(e=!0),this.game=t,this.running=!1,this.autoDestroy=e,this.expired=!1,this.elapsed=0,this.events=[],this.onComplete=new W.Signal,this.nextTick=0,this.timeCap=1e3,this.paused=!1,this._codePaused=!1,this._started=0,this._pauseStarted=0,this._pauseTotal=0,this._now=Date.now(),this._len=0,this._marked=0,this._i=0,this._diff=0,this._newTick=0},W.Timer.MINUTE=6e4,W.Timer.SECOND=1e3,W.Timer.HALF=500,W.Timer.QUARTER=250,W.Timer.prototype={create:function(t,e,i,s,n,o){var a=t=Math.round(t);0===this._now?a+=this.game.time.time:a+=this._now;var r=new W.TimerEvent(this,t,a,i,e,s,n,o);return this.events.push(r),this.order(),this.expired=!1,r},add:function(t,e,i){return this.create(t,!1,0,e,i,Array.prototype.slice.call(arguments,3))},repeat:function(t,e,i,s){return this.create(t,!1,e,i,s,Array.prototype.slice.call(arguments,4))},loop:function(t,e,i){return this.create(t,!0,0,e,i,Array.prototype.slice.call(arguments,3))},start:function(t){if(!this.running){this._started=this.game.time.time+(t||0),this.running=!0;for(var e=0;ee.tick?1:0},clearPendingEvents:function(){for(this._i=this.events.length;this._i--;)this.events[this._i].pendingDelete&&this.events.splice(this._i,1);this._len=this.events.length,this._i=0},update:function(t){if(this.paused)return!0;if(this.elapsed=t-this._now,this._now=t,this.elapsed>this.timeCap&&this.adjustEvents(t-this.elapsed),this._marked=0,this.clearPendingEvents(),this.running&&this._now>=this.nextTick&&0=this.events[this._i].tick&&!this.events[this._i].pendingDelete;)this._newTick=this._now+this.events[this._i].delay-(this._now-this.events[this._i].tick),this._newTick<0&&(this._newTick=this._now+this.events[this._i].delay),!0===this.events[this._i].loop?this.events[this._i].tick=this._newTick:0this._marked?this.order():(this.expired=!0,this.onComplete.dispatch(this))}return!this.expired||!this.autoDestroy},pause:function(){this.running&&(this._codePaused=!0,this.paused||(this._pauseStarted=this.game.time.time,this.paused=!0))},_pause:function(){!this.paused&&this.running&&(this._pauseStarted=this.game.time.time,this.paused=!0)},adjustEvents:function(t){for(var e=0;ethis._now?this.nextTick-this._now:0}}),Object.defineProperty(W.Timer.prototype,"length",{get:function(){return this.events.length}}),Object.defineProperty(W.Timer.prototype,"ms",{get:function(){return this.running?this._now-this._started-this._pauseTotal:0}}),Object.defineProperty(W.Timer.prototype,"seconds",{get:function(){return this.running?.001*this.ms:0}}),W.Timer.prototype.constructor=W.Timer,W.TimerEvent=function(t,e,i,s,n,o,a,r){this.timer=t,this.delay=e,this.tick=i,this.repeatCount=s-1,this.loop=n,this.callback=o,this.callbackContext=a,this.args=r,this.pendingDelete=!1},W.TimerEvent.prototype.constructor=W.TimerEvent,W.AnimationManager=function(t){this.sprite=t,this.game=t.game,this.currentFrame=null,this.currentAnim=null,this.updateIfVisible=!0,this.isLoaded=!1,this._frameData=null,this._anims={},this._outputFrames=[]},W.AnimationManager.prototype={loadFrameData:function(t,e){if(void 0===t)return!1;if(this.isLoaded)for(var i in this._anims)this._anims[i].updateFrameData(t);return this._frameData=t,null==e?this.frame=0:"string"==typeof e?this.frameName=e:this.frame=e,this.isLoaded=!0},copyFrameData:function(t,e){if(this._frameData=t.clone(),this.isLoaded)for(var i in this._anims)this._anims[i].updateFrameData(this._frameData);return null==e?this.frame=0:"string"==typeof e?this.frameName=e:this.frame=e,this.isLoaded=!0},add:function(t,e,i,s,n){return e=e||[],i=i||60,void 0===s&&(s=!1),void 0===n&&(n=!(!e||"number"!=typeof e[0])),this._outputFrames=[],this._frameData.getFrameIndexes(e,n,this._outputFrames),this._anims[t]=new W.Animation(this.game,this.sprite,t,this._frameData,this._outputFrames,i,s),this.currentAnim=this._anims[t],this.sprite.tilingTexture&&(this.sprite.refreshTexture=!0),this._anims[t]},validateFrames:function(t,e){void 0===e&&(e=!0);for(var i=0;ithis._frameData.total)return!1}else if(!1===this._frameData.checkFrameName(t[i]))return!1;return!0},play:function(t,e,i,s){if(this._anims[t])return this.currentAnim===this._anims[t]?!1===this.currentAnim.isPlaying?(this.currentAnim.paused=!1,this.currentAnim.play(e,i,s)):this.currentAnim:(this.currentAnim&&this.currentAnim.isPlaying&&this.currentAnim.stop(),this.currentAnim=this._anims[t],this.currentAnim.paused=!1,this.currentFrame=this.currentAnim.currentFrame,this.currentAnim.play(e,i,s))},stop:function(t,e){void 0===e&&(e=!1),!this.currentAnim||"string"==typeof t&&t!==this.currentAnim.name||this.currentAnim.stop(e)},update:function(){return!(this.updateIfVisible&&!this.sprite.visible||!this.currentAnim||!this.currentAnim.update()||(this.currentFrame=this.currentAnim.currentFrame,0))},next:function(t){this.currentAnim&&(this.currentAnim.next(t),this.currentFrame=this.currentAnim.currentFrame)},previous:function(t){this.currentAnim&&(this.currentAnim.previous(t),this.currentFrame=this.currentAnim.currentFrame)},getAnimation:function(t){return"string"==typeof t&&this._anims[t]?this._anims[t]:null},refreshFrame:function(){},destroy:function(){var t=null;for(var t in this._anims)this._anims.hasOwnProperty(t)&&this._anims[t].destroy();this._anims={},this._outputFrames=[],this._frameData=null,this.currentAnim=null,this.currentFrame=null,this.sprite=null,this.game=null}},W.AnimationManager.prototype.constructor=W.AnimationManager,Object.defineProperty(W.AnimationManager.prototype,"frameData",{get:function(){return this._frameData}}),Object.defineProperty(W.AnimationManager.prototype,"frameTotal",{get:function(){return this._frameData.total}}),Object.defineProperty(W.AnimationManager.prototype,"paused",{get:function(){return this.currentAnim.isPaused},set:function(t){this.currentAnim.paused=t}}),Object.defineProperty(W.AnimationManager.prototype,"name",{get:function(){if(this.currentAnim)return this.currentAnim.name}}),Object.defineProperty(W.AnimationManager.prototype,"frame",{get:function(){if(this.currentFrame)return this.currentFrame.index},set:function(t){"number"==typeof t&&this._frameData&&null!==this._frameData.getFrame(t)&&(this.currentFrame=this._frameData.getFrame(t),this.currentFrame&&this.sprite.setFrame(this.currentFrame))}}),Object.defineProperty(W.AnimationManager.prototype,"frameName",{get:function(){if(this.currentFrame)return this.currentFrame.name},set:function(t){"string"==typeof t&&this._frameData&&null!==this._frameData.getFrameByName(t)&&(this.currentFrame=this._frameData.getFrameByName(t),this.currentFrame&&(this._frameIndex=this.currentFrame.index,this.sprite.setFrame(this.currentFrame)))}}),W.Animation=function(t,e,i,s,n,o,a){void 0===a&&(a=!1),this.game=t,this._parent=e,this._frameData=s,this.name=i,this._frames=[],this._frames=this._frames.concat(n),this.delay=1e3/o,this.loop=a,this.loopCount=0,this.killOnComplete=!1,this.isFinished=!1,this.isPlaying=!1,this.isPaused=!1,this._pauseStartTime=0,this._frameIndex=0,this._frameDiff=0,this._frameSkip=1,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart=new W.Signal,this.onUpdate=null,this.onComplete=new W.Signal,this.onLoop=new W.Signal,this.isReversed=!1,this.game.onPause.add(this.onPause,this),this.game.onResume.add(this.onResume,this)},W.Animation.prototype={play:function(t,e,i){return"number"==typeof t&&(this.delay=1e3/t),"boolean"==typeof e&&(this.loop=e),void 0!==i&&(this.killOnComplete=i),this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.time,this._timeNextFrame=this.game.time.time+this.delay,this._frameIndex=this.isReversed?this._frames.length-1:0,this.updateCurrentFrame(!1,!0),this._parent.events.onAnimationStart$dispatch(this._parent,this),this.onStart.dispatch(this._parent,this),(this._parent.animations.currentAnim=this)._parent.animations.currentFrame=this.currentFrame,this},restart:function(){this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.time,this._timeNextFrame=this.game.time.time+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this._parent.setFrame(this.currentFrame),(this._parent.animations.currentAnim=this)._parent.animations.currentFrame=this.currentFrame,this.onStart.dispatch(this._parent,this)},reverse:function(){return this.reversed=!this.reversed,this},reverseOnce:function(){return this.onComplete.addOnce(this.reverse,this),this.reverse()},setFrame:function(t,e){var i;if(void 0===e&&(e=!1),"string"==typeof t)for(var s=0;s=this._timeNextFrame)&&(this._frameSkip=1,this._frameDiff=this.game.time.time-this._timeNextFrame,this._timeLastFrame=this.game.time.time,this._frameDiff>this.delay&&(this._frameSkip=Math.floor(this._frameDiff/this.delay),this._frameDiff-=this._frameSkip*this.delay),this._timeNextFrame=this.game.time.time+(this.delay-this._frameDiff),this.isReversed?this._frameIndex-=this._frameSkip:this._frameIndex+=this._frameSkip,!this.isReversed&&this._frameIndex>=this._frames.length||this.isReversed&&this._frameIndex<=-1?this.loop?(this._frameIndex=Math.abs(this._frameIndex)%this._frames.length,this.isReversed&&(this._frameIndex=this._frames.length-1-this._frameIndex),this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&this._parent.setFrame(this.currentFrame),this.loopCount++,this._parent.events.onAnimationLoop$dispatch(this._parent,this),this.onLoop.dispatch(this._parent,this),!this.onUpdate||(this.onUpdate.dispatch(this,this.currentFrame),!!this._frameData)):(this.complete(),!1):this.updateCurrentFrame(!0))},updateCurrentFrame:function(t,e){if(void 0===e&&(e=!1),!this._frameData)return!1;var i=this.currentFrame.index;return this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(e||!e&&i!==this.currentFrame.index)&&this._parent.setFrame(this.currentFrame),!this.onUpdate||!t||(this.onUpdate.dispatch(this,this.currentFrame),!!this._frameData)},next:function(t){void 0===t&&(t=1);var e=this._frameIndex+t;e>=this._frames.length&&(this.loop?e%=this._frames.length:e=this._frames.length-1),e!==this._frameIndex&&(this._frameIndex=e,this.updateCurrentFrame(!0))},previous:function(t){void 0===t&&(t=1);var e=this._frameIndex-t;e<0&&(this.loop?e=this._frames.length+e:e++),e!==this._frameIndex&&(this._frameIndex=e,this.updateCurrentFrame(!0))},updateFrameData:function(t){this._frameData=t,this.currentFrame=this._frameData?this._frameData.getFrame(this._frames[this._frameIndex%this._frames.length]):null},destroy:function(){this._frameData&&(this.game.onPause.remove(this.onPause,this),this.game.onResume.remove(this.onResume,this),this.game=null,this._parent=null,this._frames=null,this._frameData=null,this.currentFrame=null,this.isPlaying=!1,this.onStart.dispose(),this.onLoop.dispose(),this.onComplete.dispose(),this.onUpdate&&this.onUpdate.dispose())},complete:function(){this._frameIndex=this._frames.length-1,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.isPlaying=!1,this.isFinished=!0,this.paused=!1,this._parent.events.onAnimationComplete$dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this),this.killOnComplete&&this._parent.kill()}},W.Animation.prototype.constructor=W.Animation,Object.defineProperty(W.Animation.prototype,"paused",{get:function(){return this.isPaused},set:function(t){(this.isPaused=t)?this._pauseStartTime=this.game.time.time:this.isPlaying&&(this._timeNextFrame=this.game.time.time+this.delay)}}),Object.defineProperty(W.Animation.prototype,"reversed",{get:function(){return this.isReversed},set:function(t){this.isReversed=t}}),Object.defineProperty(W.Animation.prototype,"frameTotal",{get:function(){return this._frames.length}}),Object.defineProperty(W.Animation.prototype,"frame",{get:function(){return null!==this.currentFrame?this.currentFrame.index:this._frameIndex},set:function(t){this.currentFrame=this._frameData.getFrame(this._frames[t]),null!==this.currentFrame&&(this._frameIndex=t,this._parent.setFrame(this.currentFrame),this.onUpdate&&this.onUpdate.dispatch(this,this.currentFrame))}}),Object.defineProperty(W.Animation.prototype,"speed",{get:function(){return 1e3/this.delay},set:function(t){0=this._frames.length&&(t=0),this._frames[t]},getFrameByName:function(t){return"number"==typeof this._frameNames[t]?this._frames[this._frameNames[t]]:null},checkFrameName:function(t){return null!=this._frameNames[t]},clone:function(){for(var t=new W.FrameData,e=0;eh&&(d=o,p+=s+a);return u},JSONData:function(t,e){if(e.frames){for(var i,s=new W.FrameData,n=e.frames,o=0;o=i||e&&this._loadedPackCount===this._totalPackCount)break}if(this.updateProgress(),this._processingHead>=this._fileList.length)this.finishedLoading();else if(!this._flightQueue.length){var n=this;setTimeout(function(){n.finishedLoading(!0)},2e3)}}else this.finishedLoading(!0)},finishedLoading:function(t){this.hasLoaded||(this.hasLoaded=!0,this.isLoading=!1,t||this._fileLoadStarted||(this._fileLoadStarted=!0,this.onLoadStart.dispatch()),this.onLoadComplete.dispatch(),this.game.state.loadComplete(),this.reset())},asyncComplete:function(t,e){void 0===e&&(e=""),t.loaded=!0,t.error=!!e,e&&(t.errorMessage=e),this.processLoadQueue()},processPack:function(t){var e=t.data[t.key];if(e)for(var i=0;i=this.durationMS&&(this.usingWebAudio?this.loop?(this.onLoop.dispatch(this),this.isPlaying=!1,""===this.currentMarker?(this.currentTime=0,this.startTime=this.game.time.time,this.isPlaying=!0):(this.onMarkerComplete.dispatch(this.currentMarker,this),this.play(this.currentMarker,0,this.volume,!0,!0))):""!==this.currentMarker&&this.stop():this.loop?(this.onLoop.dispatch(this),""===this.currentMarker&&(this.currentTime=0,this.startTime=this.game.time.time),this.isPlaying=!1,this.play(this.currentMarker,0,this.volume,!0,!0)):this.stop()))):this.destroy()},loopFull:function(t){return this.play(null,0,t,!0)},play:function(t,e,i,s,n){if(void 0!==t&&!1!==t&&null!==t||(t=""),void 0===n&&(n=!0),this.isPlaying&&!this.allowMultiple&&!n&&!this.override)return this;if(this._sound&&this.isPlaying&&!this.allowMultiple&&(this.override||n)){if(this.usingWebAudio){if(void 0===this._sound.stop)this._sound.noteOff(0);else try{this._sound.stop(0)}catch(t){}this.externalNode?this._sound.disconnect(this.externalNode):this.gainNode&&this._sound.disconnect(this.gainNode)}else this.usingAudioTag&&(this._sound.pause(),this._sound.currentTime=0);this.isPlaying=!1}if(""===t&&0this.width}}),Object.defineProperty(W.ScaleManager.prototype,"isGameLandscape",{get:function(){return this.width>this.height}}),W.Utils.Debug=function(t){this.game=t,this.sprite=null,this.bmd=null,this.canvas=null,this.context=null,this.font="14px Courier",this.columnWidth=100,this.lineHeight=16,this.renderShadow=!0,this.currentX=0,this.currentY=0,this.currentAlpha=1,this.dirty=!1},W.Utils.Debug.prototype={boot:function(){this.game.renderType===W.CANVAS?this.context=this.game.context:(this.bmd=new W.BitmapData(this.game,"__DEBUG",this.game.width,this.game.height,!0),this.sprite=this.game.make.image(0,0,this.bmd),this.game.stage.addChild(this.sprite),this.game.scale.onSizeChange.add(this.resize,this),this.canvas=PIXI.CanvasPool.create(this,this.game.width,this.game.height),this.context=this.canvas.getContext("2d"))},resize:function(t,e,i){this.bmd.resize(e,i),this.canvas.width=e,this.canvas.height=i},preUpdate:function(){this.dirty&&this.sprite&&(this.bmd.clear(),this.bmd.draw(this.canvas,0,0),this.context.clearRect(0,0,this.game.width,this.game.height),this.dirty=!1)},reset:function(){this.context&&this.context.clearRect(0,0,this.game.width,this.game.height),this.sprite&&this.bmd.clear()},start:function(t,e,i,s){"number"!=typeof t&&(t=0),"number"!=typeof e&&(e=0),i=i||"rgb(255,255,255)",void 0===s&&(s=0),this.currentX=t,this.currentY=e,this.currentColor=i,this.columnWidth=s,this.dirty=!0,this.context.save(),this.context.setTransform(1,0,0,1,0,0),this.context.strokeStyle=i,this.context.fillStyle=i,this.context.font=this.font,this.context.globalAlpha=this.currentAlpha},stop:function(){this.context.restore()},line:function(){for(var t=this.currentX,e=0;ee.width?s:n;if("viewport"===t)return this.visualBounds.height>this.visualBounds.width?s:n;if("window.orientation"===t&&"number"==typeof window.orientation)return 0===window.orientation||180===window.orientation?s:n;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return s;if(window.matchMedia("(orientation: landscape)").matches)return n}return this.visualBounds.height>this.visualBounds.width?s:n},visualBounds:new W.Rectangle,layoutBounds:new W.Rectangle,documentBounds:new W.Rectangle},W.Device.whenReady(function(t){var e=window&&"pageXOffset"in window?function(){return window.pageXOffset}:function(){return document.documentElement.scrollLeft},i=window&&"pageYOffset"in window?function(){return window.pageYOffset}:function(){return document.documentElement.scrollTop};if(Object.defineProperty(W.DOM,"scrollX",{get:e}),Object.defineProperty(W.DOM,"scrollY",{get:i}),Object.defineProperty(W.DOM.visualBounds,"x",{get:e}),Object.defineProperty(W.DOM.visualBounds,"y",{get:i}),Object.defineProperty(W.DOM.layoutBounds,"x",{value:0}),Object.defineProperty(W.DOM.layoutBounds,"y",{value:0}),t.desktop&&document.documentElement.clientWidth<=window.innerWidth&&document.documentElement.clientHeight<=window.innerHeight){var s=function(){return Math.max(window.innerWidth,document.documentElement.clientWidth)},n=function(){return Math.max(window.innerHeight,document.documentElement.clientHeight)};Object.defineProperty(W.DOM.visualBounds,"width",{get:s}),Object.defineProperty(W.DOM.visualBounds,"height",{get:n}),Object.defineProperty(W.DOM.layoutBounds,"width",{get:s}),Object.defineProperty(W.DOM.layoutBounds,"height",{get:n})}else Object.defineProperty(W.DOM.visualBounds,"width",{get:function(){return window.innerWidth}}),Object.defineProperty(W.DOM.visualBounds,"height",{get:function(){return window.innerHeight}}),Object.defineProperty(W.DOM.layoutBounds,"width",{get:function(){var t=document.documentElement.clientWidth,e=window.innerWidth;return t>>0:(t<<24|e<<16|i<<8|s)>>>0},unpackPixel:function(t,e,i,s){return null!=e||(e=W.Color.createColor()),null!=i||(i=!1),null!=s||(s=!1),W.Device.LITTLE_ENDIAN?(e.a=(4278190080&t)>>>24,e.b=(16711680&t)>>>16,e.g=(65280&t)>>>8,e.r=255&t):(e.r=(4278190080&t)>>>24,e.g=(16711680&t)>>>16,e.b=(65280&t)>>>8,e.a=255&t),e.color=t,e.rgba="rgba("+e.r+","+e.g+","+e.b+","+e.a/255+")",i&&W.Color.RGBtoHSL(e.r,e.g,e.b,e),s&&W.Color.RGBtoHSV(e.r,e.g,e.b,e),e},fromRGBA:function(t,e){return e||(e=W.Color.createColor()),e.r=(4278190080&t)>>>24,e.g=(16711680&t)>>>16,e.b=(65280&t)>>>8,e.a=255&t,e.rgba="rgba("+e.r+","+e.g+","+e.b+","+e.a+")",e},toRGBA:function(t,e,i,s){return t<<24|e<<16|i<<8|s},toABGR:function(t,e,i,s){return(s<<24|i<<16|e<<8|t)>>>0},RGBtoHSL:function(t,e,i,s){s||(s=W.Color.createColor(t,e,i,1)),t/=255,e/=255,i/=255;var n=Math.min(t,e,i),o=Math.max(t,e,i);if(s.h=0,s.s=0,s.l=(o+n)/2,o!==n){var a=o-n;s.s=.5>>24,red:t>>16&255,green:t>>8&255,blue:255&t,a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{alpha:255,red:t>>16&255,green:t>>8&255,blue:255&t,a:255,r:t>>16&255,g:t>>8&255,b:255&t}},getWebRGB:function(t){if("object"==typeof t)return"rgba("+t.r.toString()+","+t.g.toString()+","+t.b.toString()+","+(t.a/255).toString()+")";var e=W.Color.getRGB(t);return"rgba("+e.r.toString()+","+e.g.toString()+","+e.b.toString()+","+(e.a/255).toString()+")"},getAlpha:function(t){return t>>>24},getAlphaFloat:function(t){return(t>>>24)/255},getRed:function(t){return t>>16&255},getGreen:function(t){return t>>8&255},getBlue:function(t){return 255&t},blendNormal:function(t){return t},blendLighten:function(t,e){return t>8)},blendExclusion:function(t,e){return t+e-2*t*e/255},blendOverlay:function(t,e){return e<128?2*t*e/255:255-2*(255-t)*(255-e)/255},blendSoftLight:function(t,e){return e<128?2*(64+(t>>1))*(e/255):255-2*(255-(64+(t>>1)))*(255-e)/255},blendHardLight:function(t,e){return W.Color.blendOverlay(e,t)},blendColorDodge:function(t,e){return 255===e?e:Math.min(255,(t<<8)/(255-e))},blendColorBurn:function(t,e){return 0===e?e:Math.max(0,255-(255-t<<8)/e)},blendLinearDodge:function(t,e){return W.Color.blendAdd(t,e)},blendLinearBurn:function(t,e){return W.Color.blendSubtract(t,e)},blendLinearLight:function(t,e){return e<128?W.Color.blendLinearBurn(t,2*e):W.Color.blendLinearDodge(t,2*(e-128))},blendVividLight:function(t,e){return e<128?W.Color.blendColorBurn(t,2*e):W.Color.blendColorDodge(t,2*(e-128))},blendPinLight:function(t,e){return e<128?W.Color.blendDarken(t,2*e):W.Color.blendLighten(t,2*(e-128))},blendHardMix:function(t,e){return W.Color.blendVividLight(t,e)<128?0:255},blendReflect:function(t,e){return 255===e?e:Math.min(255,t*t/(255-e))},blendGlow:function(t,e){return W.Color.blendReflect(e,t)},blendPhoenix:function(t,e){return Math.min(t,e)-Math.max(t,e)+255}},W.Physics=function(t,e){e=e||{},this.game=t,this.config=e,this.arcade=null,this.p2=null,this.ninja=null,this.box2d=null,this.chipmunk=null,this.matter=null,this.parseConfig()},W.Physics.ARCADE=0,W.Physics.P2JS=1,W.Physics.NINJA=2,W.Physics.BOX2D=3,W.Physics.CHIPMUNK=4,W.Physics.MATTERJS=5,W.Physics.prototype={parseConfig:function(){this.config.hasOwnProperty("arcade")&&!0!==this.config.arcade||!W.Physics.hasOwnProperty("Arcade")||(this.arcade=new W.Physics.Arcade(this.game)),this.config.hasOwnProperty("ninja")&&!0===this.config.ninja&&W.Physics.hasOwnProperty("Ninja")&&(this.ninja=new W.Physics.Ninja(this.game)),this.config.hasOwnProperty("p2")&&!0===this.config.p2&&W.Physics.hasOwnProperty("P2")&&(this.p2=new W.Physics.P2(this.game,this.config)),this.config.hasOwnProperty("box2d")&&!0===this.config.box2d&&W.Physics.hasOwnProperty("BOX2D")&&(this.box2d=new W.Physics.BOX2D(this.game,this.config)),this.config.hasOwnProperty("matter")&&!0===this.config.matter&&W.Physics.hasOwnProperty("Matter")&&(this.matter=new W.Physics.Matter(this.game,this.config))},startSystem:function(t){t===W.Physics.ARCADE?this.arcade=new W.Physics.Arcade(this.game):t===W.Physics.P2JS?null===this.p2?this.p2=new W.Physics.P2(this.game,this.config):this.p2.reset():t===W.Physics.NINJA?this.ninja=new W.Physics.Ninja(this.game):t===W.Physics.BOX2D?null===this.box2d?this.box2d=new W.Physics.Box2D(this.game,this.config):this.box2d.reset():t===W.Physics.MATTERJS&&(null===this.matter?this.matter=new W.Physics.Matter(this.game,this.config):this.matter.reset())},enable:function(t,e,i){void 0===e&&(e=W.Physics.ARCADE),void 0===i&&(i=!1),e===W.Physics.ARCADE?this.arcade.enable(t):e===W.Physics.P2JS&&this.p2?this.p2.enable(t,i):e===W.Physics.NINJA&&this.ninja?this.ninja.enableAABB(t):e===W.Physics.BOX2D&&this.box2d?this.box2d.enable(t):e===W.Physics.MATTERJS&&this.matter&&this.matter.enable(t)},preUpdate:function(){this.p2&&this.p2.preUpdate(),this.box2d&&this.box2d.preUpdate(),this.matter&&this.matter.preUpdate()},update:function(){this.p2&&this.p2.update(),this.box2d&&this.box2d.update(),this.matter&&this.matter.update()},setBoundsToWorld:function(){this.arcade&&this.arcade.setBoundsToWorld(),this.ninja&&this.ninja.setBoundsToWorld(),this.p2&&this.p2.setBoundsToWorld(),this.box2d&&this.box2d.setBoundsToWorld(),this.matter&&this.matter.setBoundsToWorld()},clear:function(){this.p2&&this.p2.clear(),this.box2d&&this.box2d.clear(),this.matter&&this.matter.clear()},reset:function(){this.p2&&this.p2.reset(),this.box2d&&this.box2d.reset(),this.matter&&this.matter.reset()},destroy:function(){this.p2&&this.p2.destroy(),this.box2d&&this.box2d.destroy(),this.matter&&this.matter.destroy(),this.arcade=null,this.ninja=null,this.p2=null,this.box2d=null,this.matter=null}},W.Physics.prototype.constructor=W.Physics,W.Physics.Arcade=function(t){this.game=t,this.gravity=new W.Point,this.bounds=new W.Rectangle(0,0,t.world.width,t.world.height),this.checkCollision={up:!0,down:!0,left:!0,right:!0},this.maxObjects=10,this.maxLevels=4,this.OVERLAP_BIAS=4,this.forceX=!1,this.sortDirection=W.Physics.Arcade.LEFT_RIGHT,this.skipQuadTree=!0,this.isPaused=!1,this.quadTree=new W.QuadTree(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this._total=0,this.setBoundsToWorld()},W.Physics.Arcade.prototype.constructor=W.Physics.Arcade,W.Physics.Arcade.SORT_NONE=0,W.Physics.Arcade.LEFT_RIGHT=1,W.Physics.Arcade.RIGHT_LEFT=2,W.Physics.Arcade.TOP_BOTTOM=3,W.Physics.Arcade.BOTTOM_TOP=4,W.Physics.Arcade.prototype={setBounds:function(t,e,i,s){this.bounds.setTo(t,e,i,s)},setBoundsToWorld:function(){this.bounds.copyFrom(this.game.world.bounds)},enable:function(t,e){void 0===e&&(e=!0);var i=1;if(Array.isArray(t))for(i=t.length;i--;)t[i]instanceof W.Group?this.enable(t[i].children,e):(this.enableBody(t[i]),e&&t[i].hasOwnProperty("children")&&0a.right)break;if(a.x>t.body.right)continue}else if(this.sortDirection===W.Physics.Arcade.TOP_BOTTOM){if(t.body.bottoma.bottom)break;if(a.y>t.body.bottom)continue}this.collideSpriteVsSprite(t,h,i,s,n,o)}}else{this.quadTree.clear(),this.quadTree.reset(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this.quadTree.populate(e);var l=this.quadTree.retrieve(t);for(r=0;rl.right)continue;if(l.x>a.right)break}else if(this.sortDirection===W.Physics.Arcade.TOP_BOTTOM){if(a.bottoml.bottom)continue;if(l.y>r.body.bottom)break}this.collideSpriteVsSprite(r,c,e,i,s,n)}}}}},collideGroupVsGroup:function(t,e,i,s,n,o){if(0!==t.length&&0!==e.length)for(var a=0;a=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=W.Math.clamp(t.center.x,e.left,e.right),s=W.Math.clamp(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.radius*t.radius},separateCircle:function(t,e,i){this.getOverlapX(t,e),this.getOverlapY(t,e);var s=e.center.x-t.center.x,n=e.center.y-t.center.y,o=Math.atan2(n,s),a=0;if(t.isCircle!==e.isCircle){var r={x:e.isCircle?t.position.x:e.position.x,y:e.isCircle?t.position.y:e.position.y,right:e.isCircle?t.right:e.right,bottom:e.isCircle?t.bottom:e.bottom},h={x:t.isCircle?t.position.x+t.radius:e.position.x+e.radius,y:t.isCircle?t.position.y+t.radius:e.position.y+e.radius,radius:t.isCircle?t.radius:e.radius};h.yt.velocity.x?t.velocity.x*=-1:e.velocity.x<0&&!e.immovable&&t.velocity.xt.velocity.y?t.velocity.y*=-1:e.velocity.y<0&&!e.immovable&&t.velocity.yMath.PI/2&&(t.velocity.x<0&&!t.immovable&&e.velocity.xe.velocity.x?e.velocity.x*=-1:t.velocity.y<0&&!t.immovable&&e.velocity.ye.velocity.y&&(e.velocity.y*=-1)),t.immovable||(t.x+=t.velocity.x*this.game.time.physicsElapsed-a*Math.cos(o),t.y+=t.velocity.y*this.game.time.physicsElapsed-a*Math.sin(o)),e.immovable||(e.x+=e.velocity.x*this.game.time.physicsElapsed+a*Math.cos(o),e.y+=e.velocity.y*this.game.time.physicsElapsed+a*Math.sin(o)),t.onCollide&&t.onCollide.dispatch(t.sprite,e.sprite),e.onCollide&&e.onCollide.dispatch(e.sprite,t.sprite),!0},getOverlapX:function(t,e,i){var s=0,n=t.deltaAbsX()+e.deltaAbsX()+this.OVERLAP_BIAS;return 0===t.deltaX()&&0===e.deltaX()?(t.embedded=!0,e.embedded=!0):t.deltaX()>e.deltaX()?n<(s=t.right-e.x)&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?s=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0):t.deltaX()e.deltaY()?n<(s=t.bottom-e.y)&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?s=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0):t.deltaY()this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:0this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.sprite.position.x+=this._dx,this.sprite.position.y+=this._dy,this._reset=!0),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.allowRotation&&(this.sprite.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y)},checkWorldBounds:function(){var t=this.position,e=this.game.physics.arcade.bounds,i=this.game.physics.arcade.checkCollision,s=this.worldBounce?-this.worldBounce.x:-this.bounce.x,n=this.worldBounce?-this.worldBounce.y:-this.bounce.y;if(this.isCircle){var o=this.center.x-this.radius,a=this.center.y-this.radius,r=this.center.x+this.radius,h=this.center.y+this.radius;oe.right&&i.right&&(t.x=e.right-this.halfWidth-this.radius,this.velocity.x*=s,this.blocked.right=!0),ae.bottom&&i.down&&(t.y=e.bottom-this.halfHeight-this.radius,this.velocity.y*=n,this.blocked.down=!0)}else t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=s,this.blocked.right=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=n,this.blocked.down=!0);return this.blocked.up||this.blocked.down||this.blocked.left||this.blocked.right},moveFrom:function(t,e,i){return void 0===e&&(e=this.speed),0!==e&&(void 0===i?(s=this.angle,i=this.game.math.radToDeg(s)):s=this.game.math.degToRad(i),this.moveTimer=0,this.moveDuration=t,0===i||180===i?this.velocity.set(Math.cos(s)*e,0):90===i||270===i?this.velocity.set(0,Math.sin(s)*e):this.velocity.set(Math.cos(s)*e,Math.sin(s)*e),this.isMoving=!0);var s},moveTo:function(t,e,i){var s,n=e/(t/1e3);return 0!==n&&(void 0===i?(s=this.angle,i=this.game.math.radToDeg(s)):s=this.game.math.degToRad(i),e=Math.abs(e),this.moveDuration=0,this.moveDistance=e,null===this.moveTarget&&(this.moveTarget=new W.Line,this.moveEnd=new W.Point),this.moveTarget.fromAngle(this.x,this.y,s,e),this.moveEnd.set(this.moveTarget.end.x,this.moveTarget.end.y),this.moveTarget.setTo(this.x,this.y,this.x,this.y),0===i||180===i?this.velocity.set(Math.cos(s)*n,0):90===i||270===i?this.velocity.set(0,Math.sin(s)*n):this.velocity.set(Math.cos(s)*n,Math.sin(s)*n),this.isMoving=!0)},setSize:function(t,e,i,s){void 0===i&&(i=this.offset.x),void 0===s&&(s=this.offset.y),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.setTo(i,s),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.isCircle=!1,this.radius=0},setCircle:function(t,e,i){void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),0e.deltaAbsY()?l=-1:e.deltaAbsX()e.left&&(s=t.right-n-e.left)>this.TILE_BIAS&&(s=0),0!==s&&(t.customSeparateX?t.overlapX=s:this.processTileSeparationX(t,s)),s},tileCheckY:function(t,e,i){var s=0,n=i.fixedToCamera?0:i.position.y;return t.deltaY()<0&&!t.blocked.up&&e.collideDown&&t.checkCollision.up?e.faceBottom&&t.y-ne.top&&(s=t.bottom-n-e.top)>this.TILE_BIAS&&(s=0),0!==s&&(t.customSeparateY?t.overlapY=s:this.processTileSeparationY(t,s)),s},processTileSeparationX:function(t,e){e<0?t.blocked.left=!0:0=this.firstgid&&tthis.right||e>this.bottom)},intersects:function(t,e,i,s){return!(i<=this.worldX||s<=this.worldY||t>=this.worldX+this.width||e>=this.worldY+this.height)},setCollisionCallback:function(t,e){this.collisionCallback=t,this.collisionCallbackContext=e},destroy:function(){this.collisionCallback=null,this.collisionCallbackContext=null,this.properties=null},setCollision:function(t,e,i,s){this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s},resetCollision:function(){this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1},isInteresting:function(t,e){return t&&e?this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.faceTop||this.faceBottom||this.faceLeft||this.faceRight||this.collisionCallback:t?this.collideLeft||this.collideRight||this.collideUp||this.collideDown:!!e&&(this.faceTop||this.faceBottom||this.faceLeft||this.faceRight)},copy:function(t){this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext}},W.Tile.prototype.constructor=W.Tile,Object.defineProperty(W.Tile.prototype,"collides",{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}}),Object.defineProperty(W.Tile.prototype,"canCollide",{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}}),Object.defineProperty(W.Tile.prototype,"left",{get:function(){return this.worldX}}),Object.defineProperty(W.Tile.prototype,"right",{get:function(){return this.worldX+this.width}}),Object.defineProperty(W.Tile.prototype,"top",{get:function(){return this.worldY}}),Object.defineProperty(W.Tile.prototype,"bottom",{get:function(){return this.worldY+this.height}}),W.Tilemap=function(t,e,i,s,n,o){this.game=t,this.key=e;var a=W.TilemapParser.parse(this.game,e,i,s,n,o);null!==a&&(this.width=a.width,this.height=a.height,this.tileWidth=a.tileWidth,this.tileHeight=a.tileHeight,this.orientation=a.orientation,this.format=a.format,this.version=a.version,this.properties=a.properties,this.widthInPixels=a.widthInPixels,this.heightInPixels=a.heightInPixels,this.layers=a.layers,this.tilesets=a.tilesets,this.imagecollections=a.imagecollections,this.tiles=a.tiles,this.objects=a.objects,this.collideIndexes=[],this.collision=a.collision,this.images=a.images,this.enableDebug=!1,this.currentLayer=0,this.debugMap=[],this._results=[],this._tempA=0,this._tempB=0)},W.Tilemap.CSV=0,W.Tilemap.TILED_JSON=1,W.Tilemap.NORTH=0,W.Tilemap.EAST=1,W.Tilemap.SOUTH=2,W.Tilemap.WEST=3,W.Tilemap.prototype={create:function(t,e,i,s,n,o){return void 0===o&&(o=this.game.world),this.width=e,this.height=i,this.setTileSize(s,n),this.layers.length=0,this.createBlankLayer(t,e,i,s,n,o)},setTileSize:function(t,e){this.tileWidth=t,this.tileHeight=e,this.widthInPixels=this.width*t,this.heightInPixels=this.height*e},addTilesetImage:function(t,e,i,s,n,o,a){if(void 0===t)return null;void 0===i&&(i=this.tileWidth),void 0===s&&(s=this.tileHeight),void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=0),0===i&&(i=32),0===s&&(s=32);var r=null;if(null!=e||(e=t),e instanceof W.BitmapData)r=e.canvas;else{if(!this.game.cache.checkImageKey(e))return null;r=this.game.cache.getImage(e)}var h=this.getTilesetIndex(t);if(null===h&&this.format===W.Tilemap.TILED_JSON)return null;if(this.tilesets[h])return this.tilesets[h].setImage(r),this.tilesets[h];var l=new W.Tileset(t,a,i,s,n,o,{});l.setImage(r),this.tilesets.push(l);for(var c=this.tilesets.length-1,u=n,d=n,p=0,f=0,y=0,g=a;gthis.layers.length)){void 0===e||e<=0?e=Math.min(this.game.width,this.layers[n].widthInPixels):e>this.game.width&&(e=this.game.width),void 0===i||i<=0?i=Math.min(this.game.height,this.layers[n].heightInPixels):i>this.game.height&&(i=this.game.height),this.enableDebug;var o=s.add(new W.TilemapLayer(this.game,this,n,e,i));return this.enableDebug,o}},createBlankLayer:function(t,e,i,s,n,o){if(void 0===o&&(o=this.game.world),null===this.getLayerIndex(t)){for(var a,r={name:t,x:0,y:0,width:e,height:i,widthInPixels:e*s,heightInPixels:i*n,alpha:1,visible:!0,properties:{},indexes:[],callbacks:[],bodies:[],data:null},h=[],l=0;lthis.game.width&&(u=this.game.width),d>this.game.height&&(d=this.game.height),(h=new W.TilemapLayer(this.game,this,this.layers.length-1,u,d)).name=t,o.add(h)}},getIndex:function(t,e){for(var i=0;ithis.layers[n].width&&(i=this.layers[n].width),s>this.layers[n].height&&(s=this.layers[n].height),this._results.length=0,this._results.push({x:t,y:e,width:i,height:s,layer:n});for(var o=e;o>>0;o.data=h,delete o.encoding}else if(o.compression)continue;var c={name:o.name,x:o.x,y:o.y,width:o.width,height:o.height,widthInPixels:o.width*t.tilewidth,heightInPixels:o.height*t.tileheight,alpha:o.opacity,visible:o.visible,properties:{},indexes:[],callbacks:[],bodies:[]};o.properties&&(c.properties=o.properties);var u,d,p,f=0,y=[],g=[],m=0;for(r=o.data.length;m=this.firstgid&&t=this._timer)if(this._timer=this.game.time.time+this.frequency*this.game.time.slowMotion,0!==this._flowTotal)if(0=this._flowTotal)){this.on=!1;break}}else this.emitParticle()&&(this._counter++,-1!==this._flowTotal&&this._counter>=this._flowTotal&&(this.on=!1));else this.emitParticle()&&(this._counter++,0=this._quantity&&(this.on=!1));for(t=this.children.length;t--;)this.children[t].exists&&this.children[t].update()},W.Particles.Arcade.Emitter.prototype.makeParticles=function(t,e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=this.maxParticles),void 0===s&&(s=!1),void 0===n&&(n=!1);var o,a=0,r=t,h=e;for(this._frames=e,i>this.maxParticles&&(this.maxParticles=i);athis.maxParticles&&(i=this.maxParticles),this._counter=0,this._flowQuantity=i,this._flowTotal=s,n?(this.start(!0,t,e,i),this._counter+=i,this.on=!0,this._timer=this.game.time.time+e*this.game.time.slowMotion):this.start(!1,t,e,i),this},W.Particles.Arcade.Emitter.prototype.start=function(t,e,i,s,n){if(void 0===t&&(t=!0),void 0===e&&(e=0),null!=i||(i=250),void 0===s&&(s=0),void 0===n&&(n=!1),s>this.maxParticles&&(s=this.maxParticles),this.revive(),this.visible=!0,this.lifespan=e,this.frequency=i,t||n)for(var o=0;o=this.bulletFrames.length&&(this.bulletFrameIndex=0)):this.bulletFrameRandom&&(l.frame=this.bulletFrames[Math.floor(Math.random()*this.bulletFrames.length)]);if(l.data.bodyDirty&&(this._data.customBody&&l.body.setSize(this._data.width,this._data.height,this._data.offsetX,this._data.offsetY),l.body.collideWorldBounds=this.bulletCollideWorldBounds,l.data.bodyDirty=!1),l.body.velocity.set(r,h),l.body.gravity.set(this.bulletGravity.x,this.bulletGravity.y),0!==this.bulletSpeedVariance){var u=this.fireRate;(u+=W.Math.between(-this.fireRateVariance,this.fireRateVariance))<0&&(u=0),this._nextFire=this.game.time.now+u}else this._nextFire=this.game.time.now+this.fireRate;this.shots++,this.onFire.dispatch(l,this,s),0W.Weapon.KILL_LIFESPAN&&(this.data.killType===W.Weapon.KILL_DISTANCE?this.game.physics.arcade.distanceToXY(this,this.data.fromX,this.data.fromY,!0)>this.data.killDistance&&this.kill():this.data.bulletManager.bulletBounds.intersects(this)||this.kill()),this.data.rotateToVelocity&&(this.rotation=Math.atan2(this.body.velocity.y,this.body.velocity.x)),this.data.bulletManager.bulletWorldWrap&&this.game.world.wrap(this,this.data.bulletManager.bulletWorldWrapPadding))},W.Video=function(t,e,i){if(void 0===e&&(e=null),void 0===i&&(i=null),this.game=t,this.key=e,this.width=0,this.height=0,this.type=W.VIDEO,this.disableTextureUpload=!1,this.touchLocked=!1,this.onPlay=new W.Signal,this.onChangeSource=new W.Signal,this.onComplete=new W.Signal,this.onAccess=new W.Signal,this.onError=new W.Signal,this.onTimeout=new W.Signal,this.timeout=15e3,this._timeOutID=null,this.video=null,this.videoStream=null,this.isStreaming=!1,this.retryLimit=20,this.retry=0,this.retryInterval=500,this._retryID=null,this._codeMuted=!1,this._muted=!1,this._codePaused=!1,this._paused=!1,this._pending=!1,this._autoplay=!1,this._endCallback=null,this._playCallback=null,e&&this.game.cache.checkVideoKey(e)){var s=this.game.cache.getVideo(e);s.isBlob?this.createVideoFromBlob(s.data):this.video=s.data,this.width=this.video.videoWidth,this.height=this.video.videoHeight}else i&&this.createVideoFromURL(i,!1);this.video&&!i?this.baseTexture=new PIXI.BaseTexture(this.video):this.baseTexture=new PIXI.BaseTexture(W.Cache.DEFAULT.baseTexture.source),this.baseTexture.forceLoaded(this.width,this.height),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new W.Frame(0,0,0,this.width,this.height,"video"),this.texture.setFrame(this.textureFrame),this.texture.valid=!1,null!==e&&this.video&&(this.texture.valid=this.video.canplay),this.snapshot=null,W.BitmapData&&(this.snapshot=new W.BitmapData(this.game,"",this.width,this.height)),!this.game.device.cocoonJS&&(this.game.device.iOS||this.game.device.android)||window.PhaserGlobal&&window.PhaserGlobal.fakeiOSTouchLock?this.setTouchLock():s&&(s.locked=!1)},W.Video.prototype={connectToMediaStream:function(t,e){return t&&e&&(this.video=t,this.videoStream=e,this.isStreaming=!0,this.baseTexture.source=this.video,this.updateTexture(null,this.video.videoWidth,this.video.videoHeight),this.onAccess.dispatch(this)),this},startMediaStream:function(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=null),!this.game.device.getUserMedia)return this.onError.dispatch(this,"No getUserMedia"),!1;null!==this.videoStream&&(this.videoStream.active?this.videoStream.active=!1:this.videoStream.stop()),this.removeVideoElement(),this.video=document.createElement("video"),this.video.setAttribute("autoplay","autoplay"),null!==e&&(this.video.width=e),null!==i&&(this.video.height=i),this._timeOutID=window.setTimeout(this.getUserMediaTimeout.bind(this),this.timeout);try{navigator.getUserMedia({audio:t,video:!0},this.getUserMediaSuccess.bind(this),this.getUserMediaError.bind(this))}catch(t){this.getUserMediaError(t)}return this},getUserMediaTimeout:function(){clearTimeout(this._timeOutID),this.onTimeout.dispatch(this)},getUserMediaError:function(t){clearTimeout(this._timeOutID),this.onError.dispatch(this,t)},getUserMediaSuccess:function(t){clearTimeout(this._timeOutID),this.videoStream=t,void 0!==this.video.mozSrcObject?this.video.mozSrcObject=t:this.video.src=window.URL&&window.URL.createObjectURL(t)||t;var n=this;this.video.onloadeddata=function(){var s=10;!function t(){if(0=t.w?M()&&O(t,i,s)&&(null===t.u||t.u.hasOwnProperty(t.a.c))?R(t,t.v):R(t,t.B):setTimeout(f(function(){B(this)},t),50):R(t,t.v)}function R(t,e){setTimeout(f(function(){i(this.g.a),i(this.h.a),i(this.j.a),i(this.m.a),e(this.a)},t),0)}function L(t,e,i){this.c=t,this.a=e,this.f=0,this.m=this.j=!1,this.s=i}function D(t){0==--t.f&&t.j&&(t.m?((t=t.a).g&&y(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),P(t,"active")):w(t.a))}function t(t){this.j=t,this.a=new C,this.h=0,this.f=this.g=!0}function k(n,t,e){var i,s=[],o=e.timeout;(i=t).g&&y(i.f,[i.a.c("wf","loading")]),P(i,"loading");s=function(t,e,i){var s,n=[];for(s in e)if(e.hasOwnProperty(s)){var o=t.c[s];o&&n.push(o(e[s],i))}return n}(n.a,e,n.c);var a=new L(n.c,t,o);for(n.h=s.length,t=0,e=s.length;t=o.f?s():n.fonts.load((t=o.a,x(t)+" "+t.f+"00 300px "+v(t.c)),o.h).then(function(t){1<=t.length?i():setTimeout(e,25)},function(){s()})}()}),i=null,e=new Promise(function(t,e){i=setTimeout(e,o.f)});Promise.race([e,t]).then(function(){i&&(clearTimeout(i),i=null),o.g(o.a)},function(){o.j(o.a)})};var Y={D:"serif",C:"sans-serif"},q=null;I.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=V(),B(this)};var z=null;L.prototype.g=function(t){var e=this.a;e.g&&y(e.f,[e.a.c("wf",t.c,b(t).toString(),"active")],[e.a.c("wf",t.c,b(t).toString(),"loading"),e.a.c("wf",t.c,b(t).toString(),"inactive")]),P(e,"fontactive",t),this.m=!0,D(this)},L.prototype.h=function(t){var e=this.a;if(e.g){var i=o(e.f,e.a.c("wf",t.c,b(t).toString(),"active")),s=[],n=[e.a.c("wf",t.c,b(t).toString(),"loading")];i||s.push(e.a.c("wf",t.c,b(t).toString(),"inactive")),y(e.f,s,n)}P(e,"fontinactive",t),D(this)},t.prototype.load=function(t){this.c=new e(this.j,t.context||this.j),this.g=!1!==t.events,this.f=!1!==t.classes,k(this,new _(this.c,t),t)},F.prototype.load=function(a){var e=this,r=e.a.projectId,t=e.a.version;if(r){var h=e.c.o;u(this.c,(e.a.api||"https://fast.fonts.net/jsapi")+"/"+r+".js"+(t?"?v="+t:""),function(t){t?a([]):(h["__MonotypeConfiguration__"+r]=function(){return e.a},function t(){if(h["__mti_fntLst"+r]){var e,i=h["__mti_fntLst"+r](),s=[];if(i)for(var n=0;nt.game.height?t.handleCorrect():t.handleIncorrect():r.Constants.PORTRAIT_LOCKED&&(t.game.widtht.game.height?(document.getElementById("orientation").style.display="none",document.getElementById("content").style.display="block"):(document.getElementById("orientation").style.display="block",document.getElementById("content").style.display="none"))},a.setScaling=function(t){window.innerWidth>window.innerHeight?window.innerWidth:window.innerHeight;t.device.pixelRatio,r.Constants.GAME_SCALE=1},a.prototype.preload=function(){var e=this;this.game.load.cacheBuster=1549358371062;var i="x"+r.Constants.GAME_SCALE+"/";r.Images.preloadList.forEach(function(t){e.game.load.image(t,"https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/images/"+i+t+".png")}),r.JSONData.preloadList.forEach(function(t){e.game.load.json(t,"https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/levels/"+t+".json")}),r.Atlases.preloadList.forEach(function(t){e.game.load.atlas(t,"https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/atlases/"+i+t+".png","https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/atlases/"+i+t+".json")}),r.Sounds.preloadList.forEach(function(t){e.game.device.iOS?e.game.load.audio(t,["https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/sounds/"+t+".m4a"]):e.game.load.audio(t,["https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/sounds/"+t+".ogg","https://840137492-163049537400263946.preview.editmysite.com/uploads/b/139890129-622598590552046666/files/assets/sounds/"+t+".mp3"])})},a.prototype.create=function(){o.default.hide(),l.default.Current===l.default.YEP10?this.game.state.start(h.default.Name):this.game.state.start(c.default.Name)},a.prototype.handleCorrect=function(){document.getElementById("orientation").style.display="none",document.getElementById("content").style.display="block"},a.prototype.handleIncorrect=function(){document.getElementById("orientation").style.display="block",document.getElementById("content").style.display="none"},a.Name="boot",a}(Phaser.State);e.default=a},function(t,e,i){"use strict";e.__esModule=!0;var s=function(){function t(){}return t.show=function(){var t=document.getElementById("loader");t&&(t.style.display="block")},t.hide=function(){var t=document.getElementById("loader");t&&(t.style.display="none")},t}();e.default=s},function(t,e,i){"use strict";e.__esModule=!0;var s=function(){function t(){this.updated=[],this.restarted=[],this.objects=[],this.game=null}return t.prototype.start=function(){this.view.start(),this.physics.start()},t.prototype.init=function(t){this.game=t},t.prototype.add=function(t){this.objects.push(t),t.update&&(this.updatedLen=this.updated.push(t)),t.restart&&this.restarted.push(t),t.body&&this.physics.add(t),t.graphic&&this.view.add(t)},t.prototype.update=function(t){this.physics.update(t);for(var e=0;e>0,c[p].y>>0);var f=new g(u);if(f.isConvex())a=new B(f,G.Materials.WIEGHTLESS,r),f.dispose(),o.shapes.add(a);else{for(f.convexDecomposition(!1,y.polyList),f.dispose();!y.polyList.empty();)f=y.polyList.pop(),a=new B(f,G.Materials.WIEGHTLESS,r),o.shapes.add(a),f.dispose();y.polyList.clear()}}}return o.align(),o.compound=s,o.userData.skinId=t.skinId,n.body=o,n.skinId=t.skinId,n.graphic=F.GraphicUtil.createCarFrameGraphic(t,l),n.create(t),n},y.createCar=function(t,e,i,s,n){var o,a,r=new R.BikeObject,h=y.createFrame(t,e,i,r.compound);r.frame=h,o=y.createWheel(t,r.compound,!0,h.body),r.backWheel=o,o=y.createWheel(t,r.compound,!1,h.body),r.frontWheel=o,r.brakeJoint=o.brakeJoint,0.25*Math.PI?n=.25*Math.PI:n<-.25*Math.PI&&(n=-.25*Math.PI),e.rotation=n}}this.effector.update(t)},t}(o.GameObject);e.DriverPartObject=h},function(t,e,i){"use strict";e.__esModule=!0;var s=Phaser.Signal,n=i(0),o=i(0),a=i(0),r=i(3),h=i(21),l=function(){function t(){this.complete=new s,this.handlers={}}return t.prototype.start=function(){this.parseParams(),this.parseLayers(),this.buildBg(),r.MaxGameCore.instance.initialDeactivate(),this.complete.dispatch(this)},t.prototype.parseParams=function(){var t=n.RacesData.map.settings;n.RacesData.data.gravityY=t.gravityY,a.MaxPhysics.space.gravity.setxy(0,n.RacesData.data.gravityY),n.RacesData.data.countdown=0},t.prototype.buildBg=function(){var t=new n.BgObject;t.create();var e;t.layer0.height;e=a.GraphicUtil.game.width/a.GraphicUtil.game.height>=h.default.WIDTH/h.default.HEIGHT?a.GraphicUtil.game.width/h.default.WIDTH:a.GraphicUtil.game.height/h.default.HEIGHT,t.layer0.scale.set(1.5*e),r.MaxGameCore.instance.add(t)},t.prototype.parseLayers=function(){r.MaxGameCore.instance;for(var t=n.RacesData.map.layers,e=t.length,i=0;i=s.PART_COUNT&&(this.partPos=0)},s.PART_COUNT=60,s}(Phaser.Sprite);e.FrameGraphic=o},function(t,e,i){"use strict";var s,n=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});e.__esModule=!0;var o=i(5),a=i(9),r=function(i){function t(){var t=i.call(this,o.GraphicUtil.game)||this;t.anim=null;var e=t.game.add.sprite(0,0,o.GraphicUtil.currentAtlass,"TrailCircle0000");return e.anchor.set(.5),t.addChild(e),t.visible=!1,t.alpha=.3,t.anim=t.game.add.tween(t),t.anim.to({alpha:0},500,a.Easing.Linear.None,!1),t.anim.onComplete.add(t.animationComplete,t),t}return n(t,i),t.prototype.animationComplete=function(){this.visible=!1,this.alpha=.3},t.prototype.emit=function(t,e){this.visible=!0,this.x=t,this.y=e,this.anim.start()},t}(Phaser.Group);e.TrailPart=r},function(t,e,i){"use strict";var s,n=this&&this.__extends||(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});e.__esModule=!0;var o=i(49),a=i(0),r=function(s){function h(t,e){var i=s.call(this,a.GraphicUtil.game,0,0,a.GraphicUtil.currentAtlass,"Wheel_"+a.Inventory.instance.skin+"_"+(2===a.Inventory.instance.skin?e?0:1:0)+"0000")||this;return i.parts=[],i.parts2=[],i.anchor.set(.5),i}return n(h,s),h.prototype.createGroundParts=function(){for(var t=0;t=h.PART_COUNT&&(this.partPos=0),this.hasParts=!0},h.prototype.update2=function(t){if(this.hasParts){this.hasParts=!1;for(var e=0;e=a.FrameGraphic.PART_COUNT&&(this.partPos2=0)},h.prototype.restart=function(){if(this.hasParts){for(var t=0;tthis.MIN_AC_BR_TIME&&(this.maxVelTimer=this.MAX_VEL_TIME),this.accelWithBrakeTimer=0),this.brakePart=this.accelWithBrakeTimer/this.MIN_AC_BR_TIME,1this.SMOKE_INIT_DELTA&&(this.graphic.emitGround(n,o,e,0this.DISABLECCD_OFF_TIME&&(0===this.disableOnDelay&&(this.body.disableCCD=!1),this.disableOnDelay=this.DISABLECCD_ON_TIME)),this.isPlayer&&this.graphic.update2(t),this.trail&&this.trail.emit(this.body.position.x,this.body.position.y),this.effector.update(t)},t.prototype.startSpin=function(){this.distanceJoint.frequency=this.freq,this.startSpinDelay=this.START_SPIN_DELAY},t.prototype.brake=function(t){t?this.braked||(this.circle.material=this.brakeMaterial,this.body.shapes.remove(this.circle),this.body.shapes.add(this.circle)):this.braked&&(this.circle.material=this.material,this.body.shapes.remove(this.circle),this.body.shapes.add(this.circle)),this.braked=t},t.prototype.connect=function(t){1c.ANIM_TIME||this.startAnim())},c.prototype.startAnim=function(){this.isCrashed},c.prototype.crashGlass=function(){d.RaceCamera.inCamera(this.explodeX,this.explodeY,256)&&p.GlassExplodeObject.get().activate(this.explodeX,this.explodeY);var t=c.getParts(),e=t.length,i=u.get();i.setxy(-.25*this.bodyW+.5*Math.random()*this.bodyW,this.bodyHHalf);var s=this.collidePos;s.y+=2*this.bodyHHalf;for(var n=c.PARTS_DATA[this.className],o=this.body.rotation,a=0;ay&&(y=g.y)}if(h+=u,l+=d,i&&(e.shape=!1,e.line=!0,e.lineId=13),!0!==e.shape&&!0!==e.line||(this.graphic=P.GraphicUtil.createGround(h,l,f,e.line,e.shape,y,e.lineId)),!0===e.camera){r=f.length;var m=e.cameraOffsetY;for(p=0;p=this.position){this.pointId=i-1;var o=1-(t-this.position)/n;this.body.position.x=this.points[i-1].x+o*(this.points[i].x-this.points[i-1].x),this.body.position.y=this.points[i-1].y+o*(this.points[i].y-this.points[i-1].y),this.calcVel(),e=!0}s.dispose()}this.breaked=!1,this.body.type=p.KINEMATIC,this.body.allowRotation=!1,this.updateBodyGraphic()},t.prototype.create=function(t){void 0===t&&(t=null),this.space=g.MaxGameCore.instance.getSpace(),this.id=t.params.id,this.safeId=t.params.safeId;var e=null;if(t.params.body)this.body=new d(p.KINEMATIC,u.weak()),this.body.shapes.add(new f(16,null,m.Materials.DEFAULT,v.Filters.NOTHING)),this.body.space=this.space;else{for(var i=u.get(t.params.x,t.params.y),s=y.NapeUtil.bodiesUnderPoint(this.space,i);!s.empty()&&!(e=s.pop()).isDynamic();)e=null;e&&((this.body=e).type=p.KINEMATIC,y.NapeUtil.stopBody(e)),i.dispose()}this.speed=this.baseSpeed=t.params.speed,this.accelDist=null===t.params.accelDist?0:t.params.accelDist,0=this.position){this.pointId=r-1;var c=1-(o-this.position)/l;this.body.position.x=this.points[r-1].x+c*(this.points[r].x-this.points[r-1].x),this.body.position.y=this.points[r-1].y+c*(this.points[r].y-this.points[r-1].y),this.calcVel(),a=!0}h.dispose()}this.totalLength=o,(this.body.userData.handler=this).body.userData.hasMover=!0},t.prototype.calcVel=function(){var t=this.body.position,e=this.getNextPoint().sub(t,!0),i=e.angle;this.velocity.x=Math.cos(i)*this.speed,this.velocity.y=Math.sin(i)*this.speed;var s=e.length;this.timeToPointTotal=this.timeToPoint=s/this.speed},t.prototype.calcAccelVel=function(t){var e,i=0;if(0=this.pointId;e--)i+=u.distance(this.points[e+1],this.points[e]);i+=u.distance(this.points[this.pointId],this.body.position),i=this.totalLength-i}ithis.totalLength-this.accelDist?this.speed=this.minSpeed+(this.totalLength-i)/this.accelDist*(this.baseSpeed-this.minSpeed):this.speed=this.baseSpeed;var s=this.body.position,n=this.getNextPoint().sub(s,!0),o=n.angle;this.velocity.x=Math.cos(o)*this.speed,this.velocity.y=Math.sin(o)*this.speed;var a=n.length;this.timeToPointTotal=this.timeToPoint=a/this.speed},t.prototype.getNextPoint=function(){return 0=this.points.length-1?this.points[0]:this.points[this.pointId+1]:this.pointId<=0?this.points[this.points.length-1]:this.points[this.pointId-1]},t.prototype.update=function(t){void 0===t&&(t=0),this.breaked||(this.active?(!0===this.body.userData.skipMove?this.body.velocity.x=this.body.velocity.y=0:0this.points.length-1)&&(0