},c.Point.rperp=function(a,b){return"undefined"==typeofb&&(b=newc.Point),b.setTo(a.y,-a.x)},c.Point.distance=function(a,b,d){vare=c.Math.distance(a.x,a.y,b.x,b.y);returnd?Math.round(e):e},c.Point.project=function(a,b,d){"undefined"==typeofd&&(d=newc.Point);vare=a.dot(b)/b.getMagnitudeSq();return0!==e&&d.setTo(e*b.x,e*b.y),d},c.Point.projectUnit=function(a,b,d){"undefined"==typeofd&&(d=newc.Point);vare=a.dot(b);return0!==e&&d.setTo(e*b.x,e*b.y),d},c.Point.normalRightHand=function(a,b){return"undefined"==typeofb&&(b=newc.Point),b.setTo(-1*a.y,a.x)},c.Point.normalize=function(a,b){"undefined"==typeofb&&(b=newc.Point);vard=a.getMagnitude();return0!==d&&b.setTo(a.x/d,a.y/d),b},c.Point.rotate=function(a,b,d,e,f,g){f=f||!1,g=g||null,f&&(e=c.Math.degToRad(e)),null===g&&(g=Math.sqrt((b-a.x)*(b-a.x)+(d-a.y)*(d-a.y)));varh=e+Math.atan2(a.y-d,a.x-b);returna.setTo(b+g*Math.cos(h),d+g*Math.sin(h))},c.Point.centroid=function(a,b){if("undefined"==typeofb&&(b=newc.Point),"[object Array]"!==Object.prototype.toString.call(a))thrownewError("Phaser.Point. Parameter 'points' must be an array");vard=a.length;if(1>d)thrownewError("Phaser.Point. Parameter 'points' array must not be empty");if(1===d)returnb.copyFrom(a[0]),b;for(vare=0;d>e;e++)c.Point.add(b,a[e],b);returnb.divide(d,d),b},c.Point.parse=function(a,b,d){b=b||"x",d=d||"y";vare=newc.Point;returna[b]&&(e.x=parseInt(a[b],10)),a[d]&&(e.y=parseInt(a[d],10)),e},PIXI.Point=c.Point,c.Rectangle=function(a,b,c,d){a=a||0,b=b||0,c=c||0,d=d||0,this.x=a,this.y=b,this.width=c,this.height=d},c.Rectangle.prototype={offset:function(a,b){returnthis.x+=a,this.y+=b,this},offsetPoint:function(a){returnthis.offset(a.x,a.y)},setTo:function(a,b,c,d){returnthis.x=a,this.y=b,this.width=c,this.height=d,this},scale:function(a,b){return"undefined"==typeofb&&(b=a),this.width*=a,this.height*=b,this},centerOn:function(a,b){returnthis.centerX=a,this.centerY=b,this},floor:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y)},floorAll:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.width=Math.floor(this.width),this.height=Math.floor(this.height)},copyFrom:function(a){returnthis.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){returna.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},inflate:function(a,b){returnc.Rectangle.inflate(this,a,b)},size:function(a){returnc.Rectangle.size(this,a)},clone:function(a){returnc.Rectangle.clone(this,a)},contains:function(a,b){returnc.Rectangle.contains(this,a,b)},containsRect:function(a){returnc.Rectangle.containsRect(a,this)},equals:function(a){returnc.Rectangle.equals(this,a)},intersection:function(a,b){returnc.Rectangle.intersection(this,a,b)},intersects:function(a){returnc.Rectangle.intersects(this,a)},intersectsRaw:function(a,b,d,e,f){returnc.Rectangle.intersectsRaw(this,a,b,d,e,f)},union:function(a,b){returnc.Rectangle.union(this,a,b)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(c.Rectangle.prototype,"halfWidth",{get:function(){returnMath.round(this.width/2)}}),Object.defineProperty(c.Rectangle.prototype,"halfHeight",{get:function(){returnMath.round(this.height/2)}}),Object.defineProperty(c.Rectangle.prototype,"bottom",{get:function(){returnthis.y+this.height},set:function(a){this.height=a<=this.y?0:a-this.y}}),Object.defineProperty(c.Rectangle.prototype,"bottomRight",{get:function(){returnnewc.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(c.Rectangle.prototype,"left",{get:function(){returnthis.x},set:function(a){this.width=a>=this.right?0:this.right-a,this.x=a}}),Object.defineProperty(c.Rectangle.prototype,"right",{get:function(){returnthis.x+this.width},set:function(a){this.width=a<=this.x?0:a-this.x}}),Object.defineProperty(c.Rectangle.prototype,"volume",{get:function(){returnthis.width*this.height}}),Object.defineProperty(c.Rectangle.prototype,"perimeter",{get:function(){return2*this.width+2*this.heigh
},checkState:function(a){if(this.states[a]){varb=!1;return(this.states[a].preload||this.states[a].create||this.states[a].update||this.states[a].render)&&(b=!0),b===!1?(console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"),!1):!0}returnconsole.warn("Phaser.StateManager - No state found with the key: "+a),!1},link:function(a){this.states[a].game=this.game,this.states[a].add=this.game.add,this.states[a].make=this.game.make,this.states[a].camera=this.game.camera,this.states[a].cache=this.game.cache,this.states[a].input=this.game.input,this.states[a].load=this.game.load,this.states[a].math=this.game.math,this.states[a].sound=this.game.sound,this.states[a].scale=this.game.scale,this.states[a].state=this,this.states[a].stage=this.game.stage,this.states[a].time=this.game.time,this.states[a].tweens=this.game.tweens,this.states[a].world=this.game.world,this.states[a].particles=this.game.particles,this.states[a].rnd=this.game.rnd,this.states[a].physics=this.game.physics},unlink:function(a){this.states[a]&&(this.states[a].game=null,this.states[a].add=null,this.states[a].make=null,this.states[a].camera=null,this.states[a].cache=null,this.states[a].input=null,this.states[a].load=null,this.states[a].math=null,this.states[a].sound=null,this.states[a].scale=null,this.states[a].state=null,this.states[a].stage=null,this.states[a].time=null,this.states[a].tweens=null,this.states[a].world=null,this.states[a].particles=null,this.states[a].rnd=null,this.states[a].physics=null)},setCurrentState:function(a){this.callbackContext=this.states[a],this.link(a),this.onInitCallback=this.states[a].init||this.dummy,this.onPreloadCallback=this.states[a].preload||null,this.onLoadRenderCallback=this.states[a].loadRender||null,this.onLoadUpdateCallback=this.states[a].loadUpdate||null,this.onCreateCallback=this.states[a].create||null,this.onUpdateCallback=this.states[a].update||null,this.onPreRenderCallback=this.states[a].preRender||null,this.onRenderCallback=this.states[a].render||null,this.onResizeCallback=this.states[a].resize||null,this.onPausedCallback=this.states[a].paused||null,this.onResumedCallback=this.states[a].resumed||null,this.onPauseUpdateCallback=this.states[a].pauseUpdate||null,this.onShutDownCallback=this.states[a].shutdown||this.dummy,this.current=a,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),a===this._pendingState&&(this._args=[])},getCurrentState:function(){returnthis.states[this.current]},loadComplete:function(){this._created===!1&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},pause:function(){this._created&&this.onPausedCallback&&this.onPausedCallback.call(this.callbackContext,this.game)},resume:function(){this._created&&this.onResumedCallback&&this.onResumedCallback.call(this.callbackContext,this.game)},update:function(){this._created&&this.onUpdateCallback?this.onUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},pauseUpdate:function(){this._created&&this.onPauseUpdateCallback?this.onPauseUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},preRender:function(a){this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game,a)},resize:function(a,b){this.onResizeCallback&&this.onResizeCallback.call(this.callbackContext,a,b)},render:function(){this._created&&this.onRenderCallback?(this.game.renderType===c.CANVAS&&(this.game.context.save(),this.game.context.setTransform(1,0,0,1,0,0)),this.onRenderCallback.call(this.callbackContext,this.game),this.game.renderType===c.CANVAS&&this.game.context.restore()):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){this.clearCurrentState(),this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this
},c.FlexGrid.prototype={setSize:function(a,b){this.width=a,this.height=b,this.ratioH=a/b,this.ratioV=b/a,this.scaleNone=newc.Point(1,1),this.boundsNone.width=this.width,this.boundsNone.height=this.height,this.refresh()},createCustomLayer:function(a,b,d,e){"undefined"==typeofe&&(e=!0),this.customWidth=a,this.customHeight=b,this.boundsCustom.width=a,this.boundsCustom.height=b;varf=newc.FlexLayer(this,this.positionCustom,this.boundsCustom,this.scaleCustom);returne&&this.game.world.add(f),this.layers.push(f),"undefined"!=typeofd&&null!==typeofd&&f.addMultiple(d),f},createFluidLayer:function(a,b){"undefined"==typeofb&&(b=!0);vard=newc.FlexLayer(this,this.positionFluid,this.boundsFluid,this.scaleFluid);returnb&&this.game.world.add(d),this.layers.push(d),"undefined"!=typeofa&&null!==typeofa&&d.addMultiple(a),d},createFullLayer:function(a){varb=newc.FlexLayer(this,this.positionFull,this.boundsFull,this.scaleFluid);returnthis.game.world.add(b),this.layers.push(b),"undefined"!=typeofa&&b.addMultiple(a),b},createFixedLayer:function(a){varb=newc.FlexLayer(this,this.positionNone,this.boundsNone,this.scaleNone);returnthis.game.world.add(b),this.layers.push(b),"undefined"!=typeofa&&b.addMultiple(a),b},reset:function(){for(vara=this.layers.length;a--;)this.layers[a].persist||(this.layers[a].position=null,this.layers[a].scale=null,this.layers.slice(a,1))},onResize:function(a,b){this.ratioH=a/b,this.ratioV=b/a,this.refresh(a,b)},refresh:function(){this.multiplier=Math.min(this.manager.height/this.height,this.manager.width/this.width),this.boundsFluid.width=Math.round(this.width*this.multiplier),this.boundsFluid.height=Math.round(this.height*this.multiplier),this.scaleFluid.set(this.boundsFluid.width/this.width,this.boundsFluid.height/this.height),this.scaleFluidInversed.set(this.width/this.boundsFluid.width,this.height/this.boundsFluid.height),this.scaleFull.set(this.boundsFull.width/this.width,this.boundsFull.height/this.height),this.boundsFull.width=Math.round(this.manager.width*this.scaleFluidInversed.x),this.boundsFull.height=Math.round(this.manager.height*this.scaleFluidInversed.y),this.boundsFluid.centerOn(this.manager.bounds.centerX,this.manager.bounds.centerY),this.boundsNone.centerOn(this.manager.bounds.centerX,this.manager.bounds.centerY),this.positionFluid.set(this.boundsFluid.x,this.boundsFluid.y),this.positionNone.set(this.boundsNone.x,this.boundsNone.y)},fitSprite:function(a){this.manager.scaleSprite(a),a.x=this.manager.bounds.centerX,a.y=this.manager.bounds.centerY},debug:function(){this.game.debug.text(this.boundsFluid.width+" x "+this.boundsFluid.height,this.boundsFluid.x+4,this.boundsFluid.y+16),this.game.debug.geom(this.boundsFluid,"rgba(255,0,0,0.9",!1)}},c.FlexGrid.prototype.constructor=c.FlexGrid,c.FlexLayer=function(a,b,d,e){c.Group.call(this,a.game,null,"__flexLayer"+a.game.rnd.uuid(),!1),this.manager=a.manager,this.grid=a,this.persist=!1,this.position=b,this.bounds=d,this.scale=e,this.topLeft=d.topLeft,this.topMiddle=newc.Point(d.halfWidth,0),this.topRight=d.topRight,this.bottomLeft=d.bottomLeft,this.bottomMiddle=newc.Point(d.halfWidth,d.bottom),this.bottomRight=d.bottomRight},c.FlexLayer.prototype=Object.create(c.Group.prototype),c.FlexLayer.prototype.constructor=c.FlexLayer,c.FlexLayer.prototype.resize=function(){},c.FlexLayer.prototype.debug=function(){this.game.debug.text(this.bounds.width+" x "+this.bounds.height,this.bounds.x+4,this.bounds.y+16),this.game.debug.geom(this.bounds,"rgba(0,0,255,0.9",!1),this.game.debug.geom(this.topLeft,"rgba(255,255,255,0.9"),this.game.debug.geom(this.topMiddle,"rgba(255,255,255,0.9"),this.game.debug.geom(this.topRight,"rgba(255,255,255,0.9")},c.ScaleManager=function(a,b,d){this.game=a,this.dom=c.DOM,this.grid=null,this.width=0,this.height=0,this.minWidth=null,this.maxWidth=null,this.minHeight=null,this.maxHeight=null,this.offset=newc.Point,this.forceLandscape=!1,this.forcePortrait=!1,this.incorrectOrientation=!1,this._pageAlignHorizontally=!1,this._pageAlignVertically=!1,this.maxIterations=5,this.onOrientationChange=newc.Signal,this.enterLandscape=n
}}),c.Input=function(a){this.game=a,this.hitCanvas=null,this.hitContext=null,this.moveCallbacks=[],this.moveCallback=null,this.moveCallbackContext=this,this.pollRate=0,this.enabled=!0,this.multiInputOverride=c.Input.MOUSE_TOUCH_COMBINE,this.position=null,this.speed=null,this.circle=null,this.scale=null,this.maxPointers=-1,this.currentPointers=0,this.tapRate=200,this.doubleTapRate=300,this.holdRate=2e3,this.justPressedRate=200,this.justReleasedRate=200,this.recordPointerHistory=!1,this.recordRate=100,this.recordLimit=100,this.pointer1=null,this.pointer2=null,this.pointer3=null,this.pointer4=null,this.pointer5=null,this.pointer6=null,this.pointer7=null,this.pointer8=null,this.pointer9=null,this.pointer10=null,this.pointers=[],this.activePointer=null,this.mousePointer=null,this.mouse=null,this.keyboard=null,this.touch=null,this.mspointer=null,this.gamepad=null,this.resetLocked=!1,this.onDown=null,this.onUp=null,this.onTap=null,this.onHold=null,this.minPriorityID=0,this.interactiveItems=newc.ArraySet,this._localPoint=newc.Point,this._pollCounter=0,this._oldPosition=null,this._x=0,this._y=0},c.Input.MOUSE_OVERRIDES_TOUCH=0,c.Input.TOUCH_OVERRIDES_MOUSE=1,c.Input.MOUSE_TOUCH_COMBINE=2,c.Input.MAX_POINTERS=10,c.Input.prototype={boot:function(){this.mousePointer=newc.Pointer(this.game,0),this.addPointer(),this.addPointer(),this.mouse=newc.Mouse(this.game),this.keyboard=newc.Keyboard(this.game),this.touch=newc.Touch(this.game),this.mspointer=newc.MSPointer(this.game),this.gamepad=newc.Gamepad(this.game),this.onDown=newc.Signal,this.onUp=newc.Signal,this.onTap=newc.Signal,this.onHold=newc.Signal,this.scale=newc.Point(1,1),this.speed=newc.Point,this.position=newc.Point,this._oldPosition=newc.Point,this.circle=newc.Circle(0,0,44),this.activePointer=this.mousePointer,this.currentPointers=0,this.hitCanvas=document.createElement("canvas"),this.hitCanvas.width=1,this.hitCanvas.height=1,this.hitContext=this.hitCanvas.getContext("2d"),this.mouse.start(),this.keyboard.start(),this.touch.start(),this.mspointer.start(),this.mousePointer.active=!0;vara=this;this._onClickTrampoline=function(b){a.onClickTrampoline(b)},this.game.canvas.addEventListener("click",this._onClickTrampoline,!1)},destroy:function(){this.mouse.stop(),this.keyboard.stop(),this.touch.stop(),this.mspointer.stop(),this.gamepad.stop(),this.moveCallbacks=[],this.game.canvas.removeEventListener("click",this._onClickTrampoline)},addMoveCallback:function(a,b){returnthis.moveCallbacks.push({callback:a,context:b})-1},deleteMoveCallback:function(a){this.moveCallbacks[a]&&this.moveCallbacks.splice(a,1)},addPointer:function(){if(this.pointers.length>=c.Input.MAX_POINTERS)returnconsole.warn("Phaser.Input.addPointer: only "+c.Input.MAX_POINTERS+" pointer allowed"),null;vara=this.pointers.length+1,b=newc.Pointer(this.game,a);returnthis.pointers.push(b),this["pointer"+a]=b,b},update:function(){if(this.keyboard.update(),this.pollRate>0&&this._pollCounter<this.pollRate)returnvoidthis._pollCounter++;this.speed.x=this.position.x-this._oldPosition.x,this.speed.y=this.position.y-this._oldPosition.y,this._oldPosition.copyFrom(this.position),this.mousePointer.update(),this.gamepad.active&&this.gamepad.update();for(vara=0;a<this.pointers.length;a++)this.pointers[a].update();this._pollCounter=0},reset:function(a){if(this.game.isBooted&&!this.resetLocked){"undefined"==typeofa&&(a=!1),this.keyboard.reset(a),this.mousePointer.reset(),this.gamepad.reset();for(varb=0;b<this.pointers.length;b++)this.pointers[b].reset();this.currentPointers=0,"none"!==this.game.canvas.style.cursor&&(this.game.canvas.style.cursor="inherit"),a&&(this.onDown.dispose(),this.onUp.dispose(),this.onTap.dispose(),this.onHold.dispose(),this.onDown=newc.Signal,this.onUp=newc.Signal,this.onTap=newc.Signal,this.onHold=newc.Signal,this.moveCallbacks=[]),this._pollCounter=0}},resetSpeed:function(a,b){this._oldPosition.setTo(a,b),this.speed.setTo(0,0)},startPointer:function(a){if(this.maxPointers>=0&&this.countActivePointers(this.maxPointers)>=this.maxPointers)returnnull;if(!this.pointer1.active)return
-1===g?this._fileList.push(e):this._fileList[g]=e},pack:function(a,b,c,d){return"undefined"==typeofb&&(b=null),"undefined"==typeofc&&(c=null),"undefined"==typeofd&&(d=this),null===b&&null===c?(console.warn("Phaser.Loader.pack - Both url and data are null. One must be set."),this):(c&&"string"==typeofc&&(c=JSON.parse(c)),this._packList.push({key:a,url:b,data:c,loaded:!1,error:!1,callbackContext:d}),this)},image:function(a,b,c){return"undefined"==typeofc&&(c=!1),c?this.replaceInFileList("image",a,b):this.addToFileList("image",a,b),this},text:function(a,b,c){return"undefined"==typeofc&&(c=!1),c?this.replaceInFileList("text",a,b):this.addToFileList("text",a,b),this},json:function(a,b,c){return"undefined"==typeofc&&(c=!1),c?this.replaceInFileList("json",a,b):this.addToFileList("json",a,b),this},xml:function(a,b,c){return"undefined"==typeofc&&(c=!1),c?this.replaceInFileList("xml",a,b):this.addToFileList("xml",a,b),this},script:function(a,b,c,d){return"undefined"==typeofc&&(c=!1),c!==!1&&"undefined"==typeofd&&(d=c),this.addToFileList("script",a,b,{callback:c,callbackContext:d}),this},binary:function(a,b,c,d){return"undefined"==typeofc&&(c=!1),c!==!1&&"undefined"==typeofd&&(d=c),this.addToFileList("binary",a,b,{callback:c,callbackContext:d}),this},spritesheet:function(a,b,c,d,e,f,g){return"undefined"==typeofe&&(e=-1),"undefined"==typeoff&&(f=0),"undefined"==typeofg&&(g=0),this.addToFileList("spritesheet",a,b,{frameWidth:c,frameHeight:d,frameMax:e,margin:f,spacing:g}),this},audio:function(a,b,c){return"undefined"==typeofc&&(c=!0),this.addToFileList("audio",a,b,{buffer:null,autoDecode:c}),this},audiosprite:function(a,b,c){returnthis.audio(a,b),this.json(a+"-audioatlas",c),this},tilemap:function(a,b,d,e){if("undefined"==typeofb&&(b=null),"undefined"==typeofd&&(d=null),"undefined"==typeofe&&(e=c.Tilemap.CSV),null==b&&null==d)returnconsole.warn("Phaser.Loader.tilemap - Both url and data are null. One must be set."),this;if(d){switch(e){casec.Tilemap.CSV:break;casec.Tilemap.TILED_JSON:"string"==typeofd&&(d=JSON.parse(d))}this.game.cache.addTilemap(a,null,d,e)}elsethis.addToFileList("tilemap",a,b,{format:e});returnthis},physics:function(a,b,d,e){return"undefined"==typeofb&&(b=null),"undefined"==typeofd&&(d=null),"undefined"==typeofe&&(e=c.Physics.LIME_CORONA_JSON),null==b&&null==d?(console.warn("Phaser.Loader.physics - Both url and data are null. One must be set."),this):(d?("string"==typeofd&&(d=JSON.parse(d)),this.game.cache.addPhysicsData(a,null,d,e)):this.addToFileList("physics",a,b,{format:e}),this)},bitmapFont:function(a,b,c,d,e,f){if("undefined"==typeofc&&(c=null),"undefined"==typeofd&&(d=null),"undefined"==typeofe&&(e=0),"undefined"==typeoff&&(f=0),c)this.addToFileList("bitmapfont",a,b,{xmlURL:c,xSpacing:e,ySpacing:f});elseif("string"==typeofd){varg;try{if(window.DOMParser){varh=newDOMParser;g=h.parseFromString(d,"text/xml")}elseg=newActiveXObject("Microsoft.XMLDOM"),g.async="false",g.loadXML(d)}catch(i){g=void0}if(!g||!g.documentElement||g.getElementsByTagName("parsererror").length)thrownewError("Phaser.Loader. Invalid Bitmap Font XML given");this.addToFileList("bitmapfont",a,b,{xmlURL:null,xmlData:g,xSpacing:e,ySpacing:f})}returnthis},atlasJSONArray:function(a,b,d,e){returnthis.atlas(a,b,d,e,c.Loader.TEXTURE_ATLAS_JSON_ARRAY)},atlasJSONHash:function(a,b,d,e){returnthis.atlas(a,b,d,e,c.Loader.TEXTURE_ATLAS_JSON_HASH)},atlasXML:function(a,b,d,e){returnthis.atlas(a,b,d,e,c.Loader.TEXTURE_ATLAS_XML_STARLING)},atlas:function(a,b,d,e,f){if("undefined"==typeofd&&(d=null),"undefined"==typeofe&&(e=null),"undefined"==typeoff&&(f=c.Loader.TEXTURE_ATLAS_JSON_ARRAY),d)this.addToFileList("textureatlas",a,b,{atlasURL:d,format:f});else{switch(f){casec.Loader.TEXTURE_ATLAS_JSON_ARRAY:"string"==typeofe&&(e=JSON.parse(e));break;casec.Loader.TEXTURE_ATLAS_XML_STARLING:if("string"==typeofe){varg;try{if(window.DOMParser){varh=newDOMParser;g=h.parseFromString(e,"text/xml")}elseg=newActiveXObject("Microsoft.XMLDOM"),g.async="false",g.loadXML(e)}catch(i){g=void0}if(!g||!g.documentElement||