this.renderSession.resolution=this.resolution,this.initContext(),this.mapBlendModes()},b.WebGLRenderer.prototype.constructor=b.WebGLRenderer,b.WebGLRenderer.prototype.initContext=function(){vara=this.view.getContext("webgl",this._contextOptions)||this.view.getContext("experimental-webgl",this._contextOptions);if(this.gl=a,!a)thrownewError("This browser does not support webGL. Try using the canvas renderer");this.glContextId=a.id=b.WebGLRenderer.glContextId++,b.glContexts[this.glContextId]=a,b.instances[this.glContextId]=this,a.disable(a.DEPTH_TEST),a.disable(a.CULL_FACE),a.enable(a.BLEND),this.shaderManager.setContext(a),this.spriteBatch.setContext(a),this.maskManager.setContext(a),this.filterManager.setContext(a),this.blendModeManager.setContext(a),this.stencilManager.setContext(a),this.renderSession.gl=this.gl,this.resize(this.width,this.height)},b.WebGLRenderer.prototype.render=function(a){if(!this.contextLost){varb=this.gl;b.viewport(0,0,this.width,this.height),b.bindFramebuffer(b.FRAMEBUFFER,null),this.game.clearBeforeRender&&(b.clearColor(a._bgColor.r,a._bgColor.g,a._bgColor.b,a._bgColor.a),b.clear(b.COLOR_BUFFER_BIT)),this.offset.x=this.game.camera._shake.x,this.offset.y=this.game.camera._shake.y,this.renderDisplayObject(a,this.projection)}},b.WebGLRenderer.prototype.renderDisplayObject=function(a,c,d,e){this.renderSession.blendModeManager.setBlendMode(b.blendModes.NORMAL),this.renderSession.drawCount=0,this.renderSession.flipY=d?-1:1,this.renderSession.projection=c,this.renderSession.offset=this.offset,this.spriteBatch.begin(this.renderSession),this.filterManager.begin(this.renderSession,d),a._renderWebGL(this.renderSession,e),this.spriteBatch.end()},b.WebGLRenderer.prototype.resize=function(a,b){this.width=a*this.resolution,this.height=b*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px"),this.gl.viewport(0,0,this.width,this.height),this.projection.x=this.width/2/this.resolution,this.projection.y=-this.height/2/this.resolution},b.WebGLRenderer.prototype.updateTexture=function(a){if(!a.hasLoaded)return!1;varc=this.gl;returna._glTextures[c.id]||(a._glTextures[c.id]=c.createTexture()),c.bindTexture(c.TEXTURE_2D,a._glTextures[c.id]),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultipliedAlpha),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a.source),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a.mipmap&&b.isPowerOfTwo(a.width,a.height)?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR_MIPMAP_LINEAR:c.NEAREST_MIPMAP_NEAREST),c.generateMipmap(c.TEXTURE_2D)):c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a._powerOf2?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT)):(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE)),a._dirty[c.id]=!1,!0},b.WebGLRenderer.prototype.destroy=function(){b.glContexts[this.glContextId]=null,this.projection=null,this.offset=null,this.shaderManager.destroy(),this.spriteBatch.destroy(),this.maskManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.spriteBatch=null,this.maskManager=null,this.filterManager=null,this.gl=null,this.renderSession=null,b.CanvasPool.remove(this),b.instances[this.glContextId]=null,b.WebGLRenderer.glContextId--},b.WebGLRenderer.prototype.mapBlendModes=function(){vara=this.gl;if(!b.blendModesWebGL){varc=[],d=b.blendModes;c[d.NORMAL]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],c[d.ADD]=[a.SRC_ALPHA,a.DST_ALPHA],c[d.MULTIPLY]=[a.DST_COLOR,a.ONE_MINUS_SRC_ALPHA],c[d.SCREEN]=[a.SRC_ALPHA,a.ONE],c[d.OVERLAY]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],c[d.DARKEN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],c[d.LIGHTEN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],c[d.COLOR_DODGE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],c[d.COLOR_BURN]=[a.ONE,a.ONE_MINUS_S
this._clearWorld=b,this._clearCache=c,arguments.length>3&&(this._args=Array.prototype.splice.call(arguments,3)))},restart:function(a,b){void0===a&&(a=!0),void0===b&&(b=!1),this._pendingState=this.current,this._clearWorld=a,this._clearCache=b,arguments.length>2&&(this._args=Array.prototype.slice.call(arguments,2))},dummy:function(){},preUpdate:function(){if(this._pendingState&&this.game.isBooted){vara=this.current;if(this.clearCurrentState(),this.setCurrentState(this._pendingState),this.onStateChange.dispatch(this.current,a),this.current!==this._pendingState)return;this._pendingState=null,this.onPreloadCallback?(this.game.load.reset(!0),this.onPreloadCallback.call(this.callbackContext,this.game),0===this.game.load.totalQueuedFiles()&&0===this.game.load.totalQueuedPacks()?this.loadComplete():this.game.load.start()):this.loadComplete()}},clearCurrentState:function(){this.current&&(this.onShutDownCallback&&this.onShutDownCallback.call(this.callbackContext,this.game),this.game.tweens.removeAll(),this.game.camera.reset(),this.game.input.reset(!0),this.game.physics.clear(),this.game.time.removeAll(),this.game.scale.reset(this._clearWorld),this.game.debug&&this.game.debug.reset(),this._clearWorld&&(this.game.world.shutdown(),this._clearCache&&this.game.cache.destroy()))},checkState:function(a){returnthis.states[a]?!!(this.states[a].preload||this.states[a].create||this.states[a].update||this.states[a].render)||(console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"),!1):(console.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,this.states[a].key=a},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&&this.game.physics.reset(),this.current=a,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),a===this._pendingState&&(this._args=[]),this.game._kickstart=!0},getCurrentState:function(){returnthis.states[this.current]},loadComplete:function(){this._created===!1&&this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game),this._created===!1&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.
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.frameBased=d.frameBased,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(void0===b||b<=0)&&(b=1e3),void0!==d&&null!==d||(d=c.Easing.Default),void0===e&&(e=!1),void0===f&&(f=0),void0===g&&(g=0),void0===h&&(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){returnvoid0===b&&(b=1e3),void0!==d&&null!==d||(d=c.Easing.Default),void0===e&&(e=!1),void0===f&&(f=0),void0===g&&(g=0),void0===h&&(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(void0===a&&(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,(a<0||a>this.timeline.length-1)&&(a=0),this.current=a,this.timeline[this.current].start(),this},stop:function(a){returnvoid0===a&&(a=!1),this.isRunning=!1,this._onUpdateCallback=null,this._onUpdateCallbackContext=null,a&&(this.onComplete.dispatch(this.target,this),this._hasStarted=!1,this.chainedTween&&this.chainedTween.start()),this.manager.remove(this),this},updateTweenData:function(a,b,c){if(0===this.timeline.length)returnthis;if(void0===c&&(c=0),c===-1)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){returnvoid0===b&&(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){returnvoid0===b&&(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){returnvoid0===b&&(b=c.Math),this.updateTweenData("interpolationFunction",a,d),this.updateTweenData("interpolationContext",b,d)},repeatAll:function(a){returnvoid0===a&&(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){returnvoid0===a&&(a=!0),this.repeatCounter=a?-1:0,this},onUpdateCallback:function(a,b){returnthis._onUpdateCallback=a,this._onUpdateCallbackContext=b,this},pause:function(){this.isPaused=!0,this._codePaused=!0,this._pausedTime=this.game.time.time},_pause:function(){this._codePaused||(this.isPaused=!0,this._pausedTime=this.game.time.time)},resume:function(){if(this.isPaused){this.isPaused=!1,this._codePaused=!1;for(vara=0;a<this.timeline.length;a++)this.timeline[a].isRunning||(this.timeline[a].startTime+=this.game.time.time-this._pausedTime)}},_resume:function(){this._codePaused||this.resume()},update:function(a){if(this.pendingDelete||!this.target)return!1;if(this.isPaused)return!0;varb=this.timeline[this.current].update(a);if(b
this.centerX=Math.floor(b/2),this.centerY=Math.floor(c/2),this.spriteSourceSizeX=d,this.spriteSourceSizeY=e,this.spriteSourceSizeW=f,this.spriteSourceSizeH=g)},clone:function(){vara=newc.Frame(this.index,this.x,this.y,this.width,this.height,this.name);for(varbinthis)this.hasOwnProperty(b)&&(a[b]=this[b]);returna},getRect:function(a){returnvoid0===a?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]},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){void0===c&&(c=[]);for(vard=a;d<=b;d++)c.push(this._frames[d]);returnc},getFrames:function(a,b,c){if(void0===b&&(b=!0),void0===c&&(c=[]),void0===a||0===a.length)for(vard=0;d<this._frames.length;d++)c.push(this._frames[d]);elsefor(vard=0;d<a.length;d++)b?c.push(this.getFrame(a[d])):c.push(this.getFrameByName(a[d]));returnc},getFrameIndexes:function(a,b,c){if(void0===b&&(b=!0),void0===c&&(c=[]),void0===a||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&&this._frames[a[d]]?c.push(this._frames[a[d]].index):this.getFrameByName(a[d])&&c.push(this.getFrameByName(a[d]).index);returnc},destroy:function(){this._frames=null,this._frameNames=null}},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=b;if("string"==typeofb&&(i=a.cache.getImage(b)),null===i)returnnull;varj=i.width,k=i.height;d<=0&&(d=Math.floor(-j/Math.min(-1,d))),e<=0&&(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(f!==-1&&(n=f),0===j||0===k||j<d||k<e||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;r<n;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},JSONDataPyxel:function(a,b){vard=["layers","tilewidth","tileheight","tileswide","tileshigh"];if(d.forEach(function(a){if(!b[a])returnconsole.warn('Phaser.AnimationParser.JSONDataPyxel: Invalid Pyxel Tilemap JSON given, missing "'+a+'" key.'),voidconsole.log(b)}),1!==b.layers.length)returnconsole.warn("Phaser.AnimationParser.JSONDataPyxel: Too many layers, this parser only supports flat Tilemaps."),voidconsole.log(b);for(vare,f=newc.FrameData,g=b.tileheight,h=b.tilewidth,i=b.layers[0].tiles,j=0;j<i.length;j++)e=f.addFrame(newc.Frame(j,i[j].x,i[j].y,h,g,"frame_"+j)),e.setTrim(!1);returnf},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,
this.headers[a.type]&&f.setRequestHeader("Accept",this.headers[a.type]),e=e||this.fileError;varg=this;f.onload=function(){try{return4===f.readyState&&f.status>=400&&f.status<=599?e.call(g,a,f):d.call(g,a,f)}catch(b){g.hasLoaded?window.console&&console.error(b):g.asyncComplete(a,b.message||"Exception")}},f.onerror=function(){try{returne.call(g,a,f)}catch(b){g.hasLoaded?window.console&&console.error(b):g.asyncComplete(a,b.message||"Exception")}},a.requestObject=f,a.requestUrl=b,f.send()},xhrLoadWithXDR:function(a,b,c,d,e){this._warnedAboutXDomainRequest||this.game.device.ie&&!(this.game.device.ieVersion>=10)||(this._warnedAboutXDomainRequest=!0,console.warn("Phaser.Loader - using XDomainRequest outside of IE 9"));varf=newwindow.XDomainRequest;f.open("GET",b,!0),f.responseType=c,f.timeout=3e3,e=e||this.fileError;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{return4===f.readyState&&f.status>=400&&f.status<=599?e.call(g,a,f):d.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){if(c=d.type,d=d.uri,this.game.device.canPlayVideo(c))returnd}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);if(c=e.toLowerCase(),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){if(c=d.type,d=d.uri,this.game.device.canPlayAudio(c))returnd}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);if(c=e.toLowerCase(),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.cache.addImage(a.key,a.url,a.data);break;case"spritesheet":this.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.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||a.format===c.Loader.TEXTURE_ATLAS_JSON_PYXEL)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(a){}c?(a.atlasType="json",this.jsonLoadComplete(a,b)):(a.atlasType="xml",this.xmlLoadComplete(a,b))})):this.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=b.response}catch(b){thrownewError("Phaser.Loader. Unable to parse video file as Blob: "+a.key)}this.cache.addVideo(a.key,a.url,a.data,a.asBlob);break;case"audio":this.game.sound.usingWebAudio?(a.data=b.response,this.cache.addSound(a.key,a.url,a.data,!0,!1),a.autoDecode&&this.game.sound.decode(a.key)):this.cache.addSound(a.key,a.url,a.data,!1,!0);break;case"text":a.data=b.responseText,this.cache.addText(a.key,a.url,a.data);break;case"shader":a.data=b.responseText,this.cache.addShader(a.key,a.url,a.data);break;case"physics":vare=JSON.parse(b.responseText);this.cache.addPhysicsData
null===this.bmd&&(this.bmd=this.game.make.bitmapData(),this.canvas=this.bmd.canvas,this.ctx=this.bmd.context),this.bmd.resize(b,c),this.ctx.fillStyle=f;for(varg=0;g<c;g+=e)this.ctx.fillRect(0,g,b,1);for(varh=0;h<b;h+=d)this.ctx.fillRect(h,0,1,c);returnthis.bmd.generateTexture(a)}},c.Create.prototype.constructor=c.Create,c.FlexGrid=function(a,b,d){this.game=a.game,this.manager=a,this.width=b,this.height=d,this.boundsCustom=newc.Rectangle(0,0,b,d),this.boundsFluid=newc.Rectangle(0,0,b,d),this.boundsFull=newc.Rectangle(0,0,b,d),this.boundsNone=newc.Rectangle(0,0,b,d),this.positionCustom=newc.Point(0,0),this.positionFluid=newc.Point(0,0),this.positionFull=newc.Point(0,0),this.positionNone=newc.Point(0,0),this.scaleCustom=newc.Point(1,1),this.scaleFluid=newc.Point(1,1),this.scaleFluidInversed=newc.Point(1,1),this.scaleFull=newc.Point(1,1),this.scaleNone=newc.Point(1,1),this.customWidth=0,this.customHeight=0,this.customOffsetX=0,this.customOffsetY=0,this.ratioH=b/d,this.ratioV=d/b,this.multiplier=0,this.layers=[]},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){void0===e&&(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){void0===b&&(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.bottomLef