},setTo:function(a,b){returnthis.x=a||0,this.y=b||(0!==b?this.x:0),this},set:function(a,b){returnthis.x=a||0,this.y=b||(0!==b?this.x:0),this},add:function(a,b){returnthis.x+=a,this.y+=b,this},subtract:function(a,b){returnthis.x-=a,this.y-=b,this},multiply:function(a,b){returnthis.x*=a,this.y*=b,this},divide:function(a,b){returnthis.x/=a,this.y/=b,this},clampX:function(a,b){returnthis.x=c.Math.clamp(this.x,a,b),this},clampY:function(a,b){returnthis.y=c.Math.clamp(this.y,a,b),this},clamp:function(a,b){returnthis.x=c.Math.clamp(this.x,a,b),this.y=c.Math.clamp(this.y,a,b),this},clone:function(a){return"undefined"==typeofa||null===a?a=newc.Point(this.x,this.y):a.setTo(this.x,this.y),a},copyTo:function(a){returna.x=this.x,a.y=this.y,a},distance:function(a,b){returnc.Point.distance(this,a,b)},equals:function(a){returna.x===this.x&&a.y===this.y},angle:function(a,b){return"undefined"==typeofb&&(b=!1),b?c.Math.radToDeg(Math.atan2(a.y-this.y,a.x-this.x)):Math.atan2(a.y-this.y,a.x-this.x)},rotate:function(a,b,d,e,f){returnc.Point.rotate(this,a,b,d,e,f)},getMagnitude:function(){returnMath.sqrt(this.x*this.x+this.y*this.y)},getMagnitudeSq:function(){returnthis.x*this.x+this.y*this.y},setMagnitude:function(a){returnthis.normalize().multiply(a,a)},normalize:function(){if(!this.isZero()){vara=this.getMagnitude();this.x/=a,this.y/=a}returnthis},isZero:function(){return0===this.x&&0===this.y},dot:function(a){returnthis.x*a.x+this.y*a.y},cross:function(a){returnthis.x*a.y-this.y*a.x},perp:function(){returnthis.setTo(-this.y,this.x)},rperp:function(){returnthis.setTo(this.y,-this.x)},normalRightHand:function(){returnthis.setTo(-1*this.y,this.x)},floor:function(){returnthis.setTo(Math.floor(this.x),Math.floor(this.y))},ceil:function(){returnthis.setTo(Math.ceil(this.x),Math.ceil(this.y))},toString:function(){return"[{Point (x="+this.x+" y="+this.y+")}]"}},c.Point.prototype.constructor=c.Point,c.Point.add=function(a,b,d){return"undefined"==typeofd&&(d=newc.Point),d.x=a.x+b.x,d.y=a.y+b.y,d},c.Point.subtract=function(a,b,d){return"undefined"==typeofd&&(d=newc.Point),d.x=a.x-b.x,d.y=a.y-b.y,d},c.Point.multiply=function(a,b,d){return"undefined"==typeofd&&(d=newc.Point),d.x=a.x*b.x,d.y=a.y*b.y,d},c.Point.divide=function(a,b,d){return"undefined"==typeofd&&(d=newc.Point),d.x=a.x/b.x,d.y=a.y/b.y,d},c.Point.equals=function(a,b){returna.x===b.x&&a.y===b.y},c.Point.angle=function(a,b){returnMath.atan2(a.y-b.y,a.x-b.x)},c.Point.negative=function(a,b){return"undefined"==typeofb&&(b=newc.Point),b.setTo(-a.x,-a.y)},c.Point.multiplyAdd=function(a,b,d,e){return"undefined"==typeofe&&(e=newc.Point),e.setTo(a.x+b.x*d,a.y+b.y*d)},c.Point.interpolate=function(a,b,d,e){return"undefined"==typeofe&&(e=newc.Point),e.setTo(a.x+(b.x-a.x)*d,a.y+(b.y-a.y)*d)},c.Point.perp=function(a,b){return"undefined"==typeofb&&(b=newc.Point),b.setTo(-a.y,a.x)},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){"undefined"==typeoff&&(f=!1),"undefined"==typeofg&&(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.x=b+g*Math.cos(h),a.y=d+g*Math.sin(h),a},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.
},c.Component.FixedToCamera.prototype={_fixedToCamera:!1,fixedToCamera:{get:function(){returnthis._fixedToCamera},set:function(a){a?(this._fixedToCamera=!0,this.cameraOffset.set(this.x,this.y)):this._fixedToCamera=!1}},cameraOffset:newc.Point},c.Component.Health=function(){},c.Component.Health.prototype={health:1,maxHealth:100,damage:function(a){returnthis.alive&&(this.health-=a,this.health<=0&&this.kill()),this},heal:function(a){returnthis.alive&&(this.health+=a,this.health>this.maxHealth&&(this.health=this.maxHealth)),this}},c.Component.InCamera=function(){},c.Component.InCamera.prototype={inCamera:{get:function(){returnthis.game.world.camera.view.intersects(this._bounds)}}},c.Component.InputEnabled=function(){},c.Component.InputEnabled.prototype={input:null,inputEnabled:{get:function(){returnthis.input&&this.input.enabled},set:function(a){a?null===this.input?(this.input=newc.InputHandler(this),this.input.start()):this.input&&!this.input.enabled&&this.input.start():this.input&&this.input.enabled&&this.input.stop()}}},c.Component.InWorld=function(){},c.Component.InWorld.preUpdate=function(){if((this.autoCull||this.checkWorldBounds)&&(this._bounds.copyFrom(this.getBounds()),this._bounds.x+=this.game.camera.view.x,this._bounds.y+=this.game.camera.view.y,this.autoCull&&(this.game.world.camera.view.intersects(this._bounds)?(this.renderable=!0,this.game.world.camera.totalInView++):this.renderable=!1),this.checkWorldBounds))if(this._outOfBoundsFired&&this.game.world.bounds.intersects(this._bounds))this._outOfBoundsFired=!1,this.events.onEnterBounds$dispatch(this);elseif(!this._outOfBoundsFired&&!this.game.world.bounds.intersects(this._bounds)&&(this._outOfBoundsFired=!0,this.events.onOutOfBounds$dispatch(this),this.outOfBoundsKill))returnthis.kill(),!1;return!0},c.Component.InWorld.prototype={checkWorldBounds:!1,outOfBoundsKill:!1,_outOfBoundsFired:!1,inWorld:{get:function(){returnthis.game.world.bounds.intersects(this.getBounds())}}},c.Component.LifeSpan=function(){},c.Component.LifeSpan.preUpdate=function(){returnthis.lifespan>0&&(this.lifespan-=this.game.time.physicsElapsedMS,this.lifespan<=0)?(this.kill(),!1):!0},c.Component.LifeSpan.prototype={alive:!0,lifespan:0,revive:function(a){return"undefined"==typeofa&&(a=1),this.alive=!0,this.exists=!0,this.visible=!0,"number"==typeofthis.health&&(this.health=a),this.events&&this.events.onRevived$dispatch(this),this},kill:function(){returnthis.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled$dispatch(this),this}},c.Component.LoadTexture=function(){},c.Component.LoadTexture.prototype={customRender:!1,_frame:null,loadTexture:function(a,b,d){b=b||0,(d||"undefined"==typeofd)&&this.animations&&this.animations.stop(),this.key=a,this.customRender=!1;vare=!0,f=!this.texture.baseTexture.scaleMode;if(c.RenderTexture&&ainstanceofc.RenderTexture)this.key=a.key,this.setTexture(a);elseif(c.BitmapData&&ainstanceofc.BitmapData)this.customRender=!0,this.setTexture(a.texture),this.game.cache.getFrameData(a.key,c.Cache.BITMAPDATA)&&(e=!this.animations.loadFrameData(this.game.cache.getFrameData(a.key,c.Cache.BITMAPDATA),b));elseif(c.Video&&ainstanceofc.Video){this.customRender=!0;varg=a.texture.valid;this.setTexture(a.texture),this.setFrame(a.texture.frame.clone()),a.onChangeSource.add(this.resizeFrame,this),this.texture.valid=g}elseainstanceofPIXI.Texture?this.setTexture(a):null===a||"undefined"==typeofa?(this.key="__default",this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeofa||this.game.cache.checkImageKey(a)?(this.setTexture(newPIXI.Texture(PIXI.BaseTextureCache[a])),e=!this.animations.loadFrameData(this.game.cache.getFrameData(a),b)):(console.warn("Texture with key '"+a+"' not found."),this.key="__missing",this.setTexture(PIXI.TextureCache[this.key]));e&&(this._frame=c.Rectangle.clone(this.texture.frame)),f||(this.texture.baseTexture.scaleMode=1)},setFrame:function(a){this._frame=a,this.texture.frame.x=a.x,this.texture.frame.y=a.y,this.texture.frame.width=a.width,this.texture.frame.height=a.height,this.texture.crop.x=a.x,this.t
},isTweening:function(a){returnthis._tweens.some(function(b){returnb.target===a})},_pauseAll:function(){for(vara=this._tweens.length-1;a>=0;a--)this._tweens[a]._pause()},_resumeAll:function(){for(vara=this._tweens.length-1;a>=0;a--)this._tweens[a]._resume()},pauseAll:function(){for(vara=this._tweens.length-1;a>=0;a--)this._tweens[a].pause()},resumeAll:function(){for(vara=this._tweens.length-1;a>=0;a--)this._tweens[a].resume(!0)}},c.TweenManager.prototype.constructor=c.TweenManager,c.Tween=function(a,b,d){this.game=b,this.target=a,this.manager=d,this.timeline=[],this.reverse=!1,this.timeScale=1,this.repeatCounter=0,this.pendingDelete=!1,this.onStart=newc.Signal,this.onLoop=newc.Signal,this.onRepeat=newc.Signal,this.onChildComplete=newc.Signal,this.onComplete=newc.Signal,this.isRunning=!1,this.current=0,this.properties={},this.chainedTween=null,this.isPaused=!1,this._onUpdateCallback=null,this._onUpdateCallbackContext=null,this._pausedTime=0,this._codePaused=!1,this._hasStarted=!1},c.Tween.prototype={to:function(a,b,d,e,f,g,h){return("undefined"==typeofb||0>=b)&&(b=1e3),("undefined"==typeofd||null===d)&&(d=c.Easing.Default),"undefined"==typeofe&&(e=!1),"undefined"==typeoff&&(f=0),"undefined"==typeofg&&(g=0),"undefined"==typeofh&&(h=!1),"string"==typeofd&&this.manager.easeMap[d]&&(d=this.manager.easeMap[d]),this.isRunning?(console.warn("Phaser.Tween.to cannot be called after Tween.start"),this):(this.timeline.push(newc.TweenData(this).to(a,b,d,f,g,h)),e&&this.start(),this)},from:function(a,b,d,e,f,g,h){return"undefined"==typeofb&&(b=1e3),("undefined"==typeofd||null===d)&&(d=c.Easing.Default),"undefined"==typeofe&&(e=!1),"undefined"==typeoff&&(f=0),"undefined"==typeofg&&(g=0),"undefined"==typeofh&&(h=!1),"string"==typeofd&&this.manager.easeMap[d]&&(d=this.manager.easeMap[d]),this.isRunning?(console.warn("Phaser.Tween.from cannot be called after Tween.start"),this):(this.timeline.push(newc.TweenData(this).from(a,b,d,f,g,h)),e&&this.start(),this)},start:function(a){if("undefined"==typeofa&&(a=0),null===this.game||null===this.target||0===this.timeline.length||this.isRunning)returnthis;for(varb=0;b<this.timeline.length;b++)for(varcinthis.timeline[b].vEnd)this.properties[c]=this.target[c]||0,Array.isArray(this.properties[c])||(this.properties[c]*=1);for(varb=0;b<this.timeline.length;b++)this.timeline[b].loadValues();returnthis.manager.add(this),this.isRunning=!0,(0>a||a>this.timeline.length-1)&&(a=0),this.current=a,this.timeline[this.current].start(),this},stop:function(a){return"undefined"==typeofa&&(a=!1),this.isRunning=!1,this._onUpdateCallback=null,this._onUpdateCallbackContext=null,a&&(this.onComplete.dispatch(this.target,this),this.chainedTween&&this.chainedTween.start()),this.manager.remove(this),this},updateTweenData:function(a,b,c){if(0===this.timeline.length)returnthis;if("undefined"==typeofc&&(c=0),-1===c)for(vard=0;d<this.timeline.length;d++)this.timeline[d][a]=b;elsethis.timeline[c][a]=b;returnthis},delay:function(a,b){returnthis.updateTweenData("delay",a,b)},repeat:function(a,b,c){return"undefined"==typeofb&&(b=0),this.updateTweenData("repeatCounter",a,c),this.updateTweenData("repeatDelay",b,c)},repeatDelay:function(a,b){returnthis.updateTweenData("repeatDelay",a,b)},yoyo:function(a,b,c){return"undefined"==typeofb&&(b=0),this.updateTweenData("yoyo",a,c),this.updateTweenData("yoyoDelay",b,c)},yoyoDelay:function(a,b){returnthis.updateTweenData("yoyoDelay",a,b)},easing:function(a,b){return"string"==typeofa&&this.manager.easeMap[a]&&(a=this.manager.easeMap[a]),this.updateTweenData("easingFunction",a,b)},interpolation:function(a,b,d){return"undefined"==typeofb&&(b=c.Math),this.updateTweenData("interpolationFunction",a,d),this.updateTweenData("interpolationContext",b,d)},repeatAll:function(a){return"undefined"==typeofa&&(a=0),this.repeatCounter=a,this},chain:function(){for(vara=arguments.length;a--;)a>0?arguments[a-1].chainedTween=arguments[a]:this.chainedTween=arguments[a];returnthis},loop:function(a){return"undefined"==typeofa&&(a=!0),a?this.repeatAll(-1):this.repeatC
returna},getRect:function(a){return"undefined"==typeofa?a=newc.Rectangle(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a}},c.Frame.prototype.constructor=c.Frame,c.FrameData=function(){this._frames=[],this._frameNames=[]},c.FrameData.prototype={addFrame:function(a){returna.index=this._frames.length,this._frames.push(a),""!==a.name&&(this._frameNames[a.name]=a.index),a},getFrame:function(a){returna>=this._frames.length&&(a=0),this._frames[a]},getFrameByName:function(a){return"number"==typeofthis._frameNames[a]?this._frames[this._frameNames[a]]:null},checkFrameName:function(a){returnnull==this._frameNames[a]?!1:!0},clone:function(){for(vara=newc.FrameData,b=0;b<this._frames.length;b++)a._frames.push(this._frames[b].clone());for(vardinthis._frameNames)this._frameNames.hasOwnProperty(d)&&a._frameNames.push(this._frameNames[d]);returna},getFrameRange:function(a,b,c){"undefined"==typeofc&&(c=[]);for(vard=a;b>=d;d++)c.push(this._frames[d]);returnc},getFrames:function(a,b,c){if("undefined"==typeofb&&(b=!0),"undefined"==typeofc&&(c=[]),"undefined"==typeofa||0===a.length)for(vard=0;d<this._frames.length;d++)c.push(this._frames[d]);elsefor(vard=0;d<a.length;d++)c.push(b?this.getFrame(a[d]):this.getFrameByName(a[d]));returnc},getFrameIndexes:function(a,b,c){if("undefined"==typeofb&&(b=!0),"undefined"==typeofc&&(c=[]),"undefined"==typeofa||0===a.length)for(vard=0;d<this._frames.length;d++)c.push(this._frames[d].index);elsefor(vard=0;d<a.length;d++)b?c.push(this._frames[a[d]].index):this.getFrameByName(a[d])&&c.push(this.getFrameByName(a[d]).index);returnc}},c.FrameData.prototype.constructor=c.FrameData,Object.defineProperty(c.FrameData.prototype,"total",{get:function(){returnthis._frames.length}}),c.AnimationParser={spriteSheet:function(a,b,d,e,f,g,h){vari=a.cache.getImage(b);if(null==i)returnnull;varj=i.width,k=i.height;0>=d&&(d=Math.floor(-j/Math.min(-1,d))),0>=e&&(e=Math.floor(-k/Math.min(-1,e)));varl=Math.floor((j-g)/(d+h)),m=Math.floor((k-g)/(e+h)),n=l*m;if(-1!==f&&(n=f),0===j||0===k||d>j||e>k||0===n)returnconsole.warn("Phaser.AnimationParser.spriteSheet: '"+b+"'s width/height zero or width/height < given frameWidth/frameHeight"),null;for(varo=newc.FrameData,p=g,q=g,r=0;n>r;r++)o.addFrame(newc.Frame(r,p,q,d,e,"")),p+=d+h,p+d>j&&(p=g,q+=e+h);returno},JSONData:function(a,b){if(!b.frames)returnconsole.warn("Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array"),voidconsole.log(b);for(vard,e=newc.FrameData,f=b.frames,g=0;g<f.length;g++)d=e.addFrame(newc.Frame(g,f[g].frame.x,f[g].frame.y,f[g].frame.w,f[g].frame.h,f[g].filename)),f[g].trimmed&&d.setTrim(f[g].trimmed,f[g].sourceSize.w,f[g].sourceSize.h,f[g].spriteSourceSize.x,f[g].spriteSourceSize.y,f[g].spriteSourceSize.w,f[g].spriteSourceSize.h);returne},JSONDataHash:function(a,b){if(!b.frames)returnconsole.warn("Phaser.AnimationParser.JSONDataHash: Invalid Texture Atlas JSON given, missing 'frames' object"),voidconsole.log(b);vard,e=newc.FrameData,f=b.frames,g=0;for(varhinf)d=e.addFrame(newc.Frame(g,f[h].frame.x,f[h].frame.y,f[h].frame.w,f[h].frame.h,h)),f[h].trimmed&&d.setTrim(f[h].trimmed,f[h].sourceSize.w,f[h].sourceSize.h,f[h].spriteSourceSize.x,f[h].spriteSourceSize.y,f[h].spriteSourceSize.w,f[h].spriteSourceSize.h),g++;returne},XMLData:function(a,b){if(!b.getElementsByTagName("TextureAtlas"))returnvoidconsole.warn("Phaser.AnimationParser.XMLData: Invalid Texture Atlas XML given, missing <TextureAtlas> tag");for(vard,e,f,g,h,i,j,k,l,m,n,o=newc.FrameData,p=b.getElementsByTagName("SubTexture"),q=0;q<p.length;q++)f=p[q].attributes,e=f.name.value,g=parseInt(f.x.value,10),h=parseInt(f.y.value,10),i=parseInt(f.width.value,10),j=parseInt(f.height.value,10),k=null,l=null,f.frameX&&(k=Math.abs(parseInt(f.frameX.value,10)),l=Math.abs(parseInt(f.frameY.value,10)),m=parseInt(f.frameWidth.value,10),n=parseInt(f.frameHeight.value,10)),d=o.addFrame(newc.Frame(q,g,h,i,j,e)),(null!==k||null!==l)&&d.setTrim(!0,i,j,k,l,m,n);returno}},c.Cache=function(a){this.game
varg=this;f.onerror=function(){try{returne.call(g,a,f)}catch(b){g.asyncComplete(a,b.message||"Exception")}},f.ontimeout=function(){try{returne.call(g,a,f)}catch(b){g.asyncComplete(a,b.message||"Exception")}},f.onprogress=function(){},f.onload=function(){try{returnd.call(g,a,f)}catch(b){g.asyncComplete(a,b.message||"Exception")}},a.requestObject=f,a.requestUrl=b,setTimeout(function(){f.send()},0)},getVideoURL:function(a){for(varb=0;b<a.length;b++){varc,d=a[b];if(d.uri)d=d.uri,c=d.type;else{if(0===d.indexOf("blob:")||0===d.indexOf("data:"))returnd;d.indexOf("?")>=0&&(d=d.substr(0,d.indexOf("?")));vare=d.substr((Math.max(0,d.lastIndexOf("."))||1/0)+1);c=e.toLowerCase()}if(this.game.device.canPlayVideo(c))returna[b]}returnnull},getAudioURL:function(a){if(this.game.sound.noAudio)returnnull;for(varb=0;b<a.length;b++){varc,d=a[b];if(d.uri)d=d.uri,c=d.type;else{if(0===d.indexOf("blob:")||0===d.indexOf("data:"))returnd;d.indexOf("?")>=0&&(d=d.substr(0,d.indexOf("?")));vare=d.substr((Math.max(0,d.lastIndexOf("."))||1/0)+1);c=e.toLowerCase()}if(this.game.device.canPlayAudio(c))returna[b]}returnnull},fileError:function(a,b,c){vard=a.requestUrl||this.transformUrl(a.url,a),e="error loading asset from URL "+d;!c&&b&&(c=b.status),c&&(e=e+" ("+c+")"),this.asyncComplete(a,e)},fileComplete:function(a,b){vard=!0;switch(a.type){case"packfile":vare=JSON.parse(b.responseText);a.data=e||{};break;case"image":this.game.cache.addImage(a.key,a.url,a.data);break;case"spritesheet":this.game.cache.addSpriteSheet(a.key,a.url,a.data,a.frameWidth,a.frameHeight,a.frameMax,a.margin,a.spacing);break;case"textureatlas":if(null==a.atlasURL)this.game.cache.addTextureAtlas(a.key,a.url,a.data,a.atlasData,a.format);elseif(d=!1,a.format==c.Loader.TEXTURE_ATLAS_JSON_ARRAY||a.format==c.Loader.TEXTURE_ATLAS_JSON_HASH)this.xhrLoad(a,this.transformUrl(a.atlasURL,a),"text",this.jsonLoadComplete);else{if(a.format!=c.Loader.TEXTURE_ATLAS_XML_STARLING)thrownewError("Phaser.Loader. Invalid Texture Atlas format: "+a.format);this.xhrLoad(a,this.transformUrl(a.atlasURL,a),"text",this.xmlLoadComplete)}break;case"bitmapfont":a.atlasURL?(d=!1,this.xhrLoad(a,this.transformUrl(a.atlasURL,a),"text",function(a,b){varc;try{c=JSON.parse(b.responseText)}catch(d){}c?(a.atlasType="json",this.jsonLoadComplete(a,b)):(a.atlasType="xml",this.xmlLoadComplete(a,b))})):this.game.cache.addBitmapFont(a.key,a.url,a.data,a.atlasData,a.atlasType,a.xSpacing,a.ySpacing);break;case"video":if(a.asBlob)try{a.data=newBlob([newUint8Array(b.response)])}catch(f){thrownewError("Phaser.Loader. Unable to parse video file as Blob: "+a.key)}this.game.cache.addVideo(a.key,a.url,a.data,a.asBlob);break;case"audio":this.game.sound.usingWebAudio?(a.data=b.response,this.game.cache.addSound(a.key,a.url,a.data,!0,!1),a.autoDecode&&this.game.sound.decode(a.key)):this.game.cache.addSound(a.key,a.url,a.data,!1,!0);break;case"text":a.data=b.responseText,this.game.cache.addText(a.key,a.url,a.data);break;case"physics":vare=JSON.parse(b.responseText);this.game.cache.addPhysicsData(a.key,a.url,e,a.format);break;case"script":a.data=document.createElement("script"),a.data.language="javascript",a.data.type="text/javascript",a.data.defer=!1,a.data.text=b.responseText,document.head.appendChild(a.data),a.callback&&(a.data=a.callback.call(a.callbackContext,a.key,b.responseText));break;case"binary":a.data=a.callback?a.callback.call(a.callbackContext,a.key,b.response):b.response,this.game.cache.addBinary(a.key,a.data)}d&&this.asyncComplete(a)},jsonLoadComplete:function(a,b){varc=JSON.parse(b.responseText);"tilemap"===a.type?this.game.cache.addTilemap(a.key,a.url,c,a.format):"bitmapfont"===a.type?this.game.cache.addBitmapFont(a.key,a.url,a.data,c,a.atlasType,a.xSpacing,a.ySpacing):"json"===a.type?this.game.cache.addJSON(a.key,a.url,c):this.game.cache.addTextureAtlas(a.key,a.url,a.data,c,a.format),this.asyncComplete(a)},csvLoadComplete:function(a,b){varc=b.responseText;this.game.cache.addTilemap(a.key,a.url,c,a.format),this.asyncComplete(a)},xmlLoadComplete:function(a,b){varc=b.responseText,d=this.parseXml(c
},{"../equations/FrictionEquation":28,"../math/vec2":35,"../utils/Utils":54,"./Solver":51,Zbi7gb:4,buffer:1}],51:[function(a,b){(function(){functionc(a,b){a=a||{},d.call(this),this.type=b,this.equations=[],this.equationSortFunction=a.equationSortFunction||!1}vard=(a("../utils/Utils"),a("../events/EventEmitter"));b.exports=c,c.prototype=newd,c.prototype.constructor=c,c.prototype.solve=function(){thrownewError("Solver.solve should be implemented by subclasses!")};vare={bodies:[]};c.prototype.solveIsland=function(a,b){this.removeAllEquations(),b.equations.length&&(this.addEquations(b.equations),e.bodies.length=0,b.getBodies(e.bodies),e.bodies.length&&this.solve(a,e))},c.prototype.sortEquations=function(){this.equationSortFunction&&this.equations.sort(this.equationSortFunction)},c.prototype.addEquation=function(a){a.enabled&&this.equations.push(a)},c.prototype.addEquations=function(a){for(varb=0,c=a.length;b!==c;b++){vard=a[b];d.enabled&&this.equations.push(d)}},c.prototype.removeEquation=function(a){varb=this.equations.indexOf(a);-1!==b&&this.equations.splice(b,1)},c.prototype.removeAllEquations=function(){this.equations.length=0},c.GS=1,c.ISLAND=2}).call(this,a("Zbi7gb"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},a("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/solver\\Solver.js","/solver")},{"../events/EventEmitter":31,"../utils/Utils":54,Zbi7gb:4,buffer:1}],52:[function(a,b){(function(){functionc(){this.overlappingShapesLastState=newe,this.overlappingShapesCurrentState=newe,this.recordPool=[],this.tmpDict=newe,this.tmpArray1=[]}functiond(a,b,c,d){this.shapeA=b,this.shapeB=d,this.bodyA=a,this.bodyB=c}{vare=a("./TupleDictionary");a("./Utils")}b.exports=c,c.prototype.tick=function(){for(vara=this.overlappingShapesLastState,b=this.overlappingShapesCurrentState,c=a.keys.length;c--;){vard=a.keys[c],e=a.getByKey(d),f=b.getByKey(d);e&&!f&&this.recordPool.push(e)}a.reset(),a.copy(b),b.reset()},c.prototype.setOverlapping=function(a,b,c,e){varf=(this.overlappingShapesLastState,this.overlappingShapesCurrentState);if(!f.get(b.id,e.id)){varg;this.recordPool.length?(g=this.recordPool.pop(),g.set(a,b,c,e)):g=newd(a,b,c,e),f.set(b.id,e.id,g)}},c.prototype.getNewOverlaps=function(a){returnthis.getDiff(this.overlappingShapesLastState,this.overlappingShapesCurrentState,a)},c.prototype.getEndOverlaps=function(a){returnthis.getDiff(this.overlappingShapesCurrentState,this.overlappingShapesLastState,a)},c.prototype.bodiesAreOverlapping=function(a,b){for(varc=this.overlappingShapesCurrentState,d=c.keys.length;d--;){vare=c.keys[d],f=c.data[e];if(f.bodyA===a&&f.bodyB===b||f.bodyA===b&&f.bodyB===a)return!0}return!1},c.prototype.getDiff=function(a,b,c){varc=c||[],d=a,e=b;c.length=0;for(varf=e.keys.length;f--;){varg=e.keys[f],h=e.data[g];if(!h)thrownewError("Key "+g+" had no data!");vari=d.data[g];i||c.push(h)}returnc},c.prototype.isNewOverlap=function(a,b){varc=0|a.id,d=0|b.id,e=this.overlappingShapesLastState,f=this.overlappingShapesCurrentState;return!e.get(c,d)&&!!f.get(c,d)},c.prototype.getNewBodyOverlaps=function(a){this.tmpArray1.length=0;varb=this.getNewOverlaps(this.tmpArray1);returnthis.getBodyDiff(b,a)},c.prototype.getEndBodyOverlaps=function(a){this.tmpArray1.length=0;varb=this.getEndOverlaps(this.tmpArray1);returnthis.getBodyDiff(b,a)},c.prototype.getBodyDiff=function(a,b){b=b||[];for(varc=this.tmpDict,d=a.length;d--;){vare=a[d];c.set(0|e.bodyA.id,0|e.bodyB.id,e)}for(d=c.keys.length;d--;){vare=c.getByKey(c.keys[d]);e&&b.push(e.bodyA,e.bodyB)}returnc.reset(),b},d.prototype.set=function(a,b,c,e){d.call(this,a,b,c,e)}}).call(this,a("Zbi7gb"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},a("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/utils\\OverlapKeeper.js","/utils")},{"./TupleDictionary":53,"./Utils":54,Zbi7gb:4,buffer:1}],53:[function(a,b){(function(){functionc(){this.data={},this.keys=[]}vard=a("./Utils");b.exports=c,c.prototype.getKey=function(a,b){returna=0|a,b=0|b,(0|a)===(0|b)?-1:0|((0|a)>(0|b)?a<
},addBody:function(a){returna.data.world?!1:(this.world.addBody(a.data),this.onBodyAdded.dispatch(a),!0)},removeBody:function(a){returna.data.world==this.world&&(this.world.removeBody(a.data),this.onBodyRemoved.dispatch(a)),a},addSpring:function(a){returnthis.world.addSpring(ainstanceofc.Physics.P2.Spring||ainstanceofc.Physics.P2.RotationalSpring?a.data:a),this.onSpringAdded.dispatch(a),a},removeSpring:function(a){returnthis.world.removeSpring(ainstanceofc.Physics.P2.Spring||ainstanceofc.Physics.P2.RotationalSpring?a.data:a),this.onSpringRemoved.dispatch(a),a},createDistanceConstraint:function(a,b,d,e,f,g){returna=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(newc.Physics.P2.DistanceConstraint(this,a,b,d,e,f,g)):voidconsole.warn("Cannot create Constraint, invalid body objects given")},createGearConstraint:function(a,b,d,e){returna=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(newc.Physics.P2.GearConstraint(this,a,b,d,e)):voidconsole.warn("Cannot create Constraint, invalid body objects given")},createRevoluteConstraint:function(a,b,d,e,f,g){returna=this.getBody(a),d=this.getBody(d),a&&d?this.addConstraint(newc.Physics.P2.RevoluteConstraint(this,a,b,d,e,f,g)):voidconsole.warn("Cannot create Constraint, invalid body objects given")},createLockConstraint:function(a,b,d,e,f){returna=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(newc.Physics.P2.LockConstraint(this,a,b,d,e,f)):voidconsole.warn("Cannot create Constraint, invalid body objects given")},createPrismaticConstraint:function(a,b,d,e,f,g,h){returna=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(newc.Physics.P2.PrismaticConstraint(this,a,b,d,e,f,g,h)):voidconsole.warn("Cannot create Constraint, invalid body objects given")},addConstraint:function(a){returnthis.world.addConstraint(a),this.onConstraintAdded.dispatch(a),a},removeConstraint:function(a){returnthis.world.removeConstraint(a),this.onConstraintRemoved.dispatch(a),a},addContactMaterial:function(a){returnthis.world.addContactMaterial(a),this.onContactMaterialAdded.dispatch(a),a},removeContactMaterial:function(a){returnthis.world.removeContactMaterial(a),this.onContactMaterialRemoved.dispatch(a),a},getContactMaterial:function(a,b){returnthis.world.getContactMaterial(a,b)},setMaterial:function(a,b){for(varc=b.length;c--;)b[c].setMaterial(a)},createMaterial:function(a,b){a=a||"";vard=newc.Physics.P2.Material(a);returnthis.materials.push(d),"undefined"!=typeofb&&b.setMaterial(d),d},createContactMaterial:function(a,b,d){"undefined"==typeofa&&(a=this.createMaterial()),"undefined"==typeofb&&(b=this.createMaterial());vare=newc.Physics.P2.ContactMaterial(a,b,d);returnthis.addContactMaterial(e)},getBodies:function(){for(vara=[],b=this.world.bodies.length;b--;)a.push(this.world.bodies[b].parent);returna},getBody:function(a){returnainstanceofp2.Body?a:ainstanceofc.Physics.P2.Body?a.data:a.body&&a.body.type===c.Physics.P2JS?a.body.data:null},getSprings:function(){for(vara=[],b=this.world.springs.length;b--;)a.push(this.world.springs[b].parent);returna},getConstraints:function(){for(vara=[],b=this.world.constraints.length;b--;)a.push(this.world.constraints[b]);returna},hitTest:function(a,b,d,e){"undefined"==typeofb&&(b=this.world.bodies),"undefined"==typeofd&&(d=5),"undefined"==typeofe&&(e=!1);for(varf=[this.pxmi(a.x),this.pxmi(a.y)],g=[],h=b.length;h--;)b[h]instanceofc.Physics.P2.Body&&(!e||b[h].data.type!==p2.Body.STATIC)?g.push(b[h].data):b[h]instanceofp2.Body&&b[h].parent&&(!e||b[h].type!==p2.Body.STATIC)?g.push(b[h]):b[h]instanceofc.Sprite&&b[h].hasOwnProperty("body")&&(!e||b[h].body.data.type!==p2.Body.STATIC)&&g.push(b[h].body.data);returnthis.world.hitTest(f,g,d)},toJSON:function(){returnthis.world.toJSON()},createCollisionGroup:function(a){varb=Math.pow(2,this._collisionGroupID);this.walls.left&&(this.walls.left.shapes[0].collisionMask=this.walls.left.shapes[0].collisionMask|b),this.walls.right&&(this.walls.right.shapes[0].collisionMask=this.walls.right.shapes[0].collisionMask|b),this.walls.top&&(this.walls.top