vard=a.length;if(1>d)thrownewError("Phaser.Point. Parameter 'points' array must not be empty");if(1===d)returnc.copyFrom(a[0]),c;for(vare=0;d>e;e++)b.Point.add(c,a[e],c);returnc.divide(d,d),c},PIXI.Point=b.Point,b.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},b.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},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,c){returnb.Rectangle.inflate(this,a,c)},size:function(a){returnb.Rectangle.size(this,a)},clone:function(a){returnb.Rectangle.clone(this,a)},contains:function(a,c){returnb.Rectangle.contains(this,a,c)},containsRect:function(a){returnb.Rectangle.containsRect(a,this)},equals:function(a){returnb.Rectangle.equals(this,a)},intersection:function(a,c){returnb.Rectangle.intersection(this,a,c)},intersects:function(a,c){returnb.Rectangle.intersects(this,a,c)},intersectsRaw:function(a,c,d,e,f){returnb.Rectangle.intersectsRaw(this,a,c,d,e,f)},union:function(a,c){returnb.Rectangle.union(this,a,c)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(b.Rectangle.prototype,"halfWidth",{get:function(){returnMath.round(this.width/2)}}),Object.defineProperty(b.Rectangle.prototype,"halfHeight",{get:function(){returnMath.round(this.height/2)}}),Object.defineProperty(b.Rectangle.prototype,"bottom",{get:function(){returnthis.y+this.height},set:function(a){this.height=a<=this.y?0:a-this.y}}),Object.defineProperty(b.Rectangle.prototype,"bottomRight",{get:function(){returnnewb.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(b.Rectangle.prototype,"left",{get:function(){returnthis.x},set:function(a){this.width=a>=this.right?0:this.right-a,this.x=a}}),Object.defineProperty(b.Rectangle.prototype,"right",{get:function(){returnthis.x+this.width},set:function(a){this.width=a<=this.x?0:a-this.x}}),Object.defineProperty(b.Rectangle.prototype,"volume",{get:function(){returnthis.width*this.height}}),Object.defineProperty(b.Rectangle.prototype,"perimeter",{get:function(){return2*this.width+2*this.height}}),Object.defineProperty(b.Rectangle.prototype,"centerX",{get:function(){returnthis.x+this.halfWidth},set:function(a){this.x=a-this.halfWidth}}),Object.defineProperty(b.Rectangle.prototype,"centerY",{get:function(){returnthis.y+this.halfHeight},set:function(a){this.y=a-this.halfHeight}}),Object.defineProperty(b.Rectangle.prototype,"randomX",{get:function(){returnthis.x+Math.random()*this.width}}),Object.defineProperty(b.Rectangle.prototype,"randomY",{get:function(){returnthis.y+Math.random()*this.height}}),Object.defineProperty(b.Rectangle.prototype,"top",{get:function(){returnthis.y},set:function(a){a>=this.bottom?(this.height=0,this.y=a):this.height=this.bottom-a}}),Object.defineProperty(b.Rectangle.prototype,"topLeft",{get:function(){returnnewb.Point(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}}),Object.defineProperty(b.Rectangle.prototype,"topRight",{get:function(){returnnewb.Point(this.x+this.width,this.y)},set:function(a){this.right=a.x,this.y=a.y}}),Object.defineProperty(b.Rectangle.prototype,"empty",{get:function(){return!this.width||!this.height},set:function(a){a===!0&&this.setTo(0,0,0,0)}}),b.Rectangle.prototype.constructor=b.Rectangle,b.Rectangle.inflate=function(a,b,c){returna.x-=b,a.width+=2*b,a.y-=c,a.height+=2*c,a},b.Rectangle.inflatePoint=function(a,c){returnb.Rectangle.infl
},set:function(a){this.animations.frame=a}}),Object.defineProperty(b.Sprite.prototype,"frameName",{get:function(){returnthis.animations.frameName},set:function(a){this.animations.frameName=a}}),Object.defineProperty(b.Sprite.prototype,"renderOrderID",{get:function(){returnthis._cache[3]}}),Object.defineProperty(b.Sprite.prototype,"inputEnabled",{get:function(){returnthis.input&&this.input.enabled},set:function(a){a?null===this.input?(this.input=newb.InputHandler(this),this.input.start()):this.input&&!this.input.enabled&&this.input.start():this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.Sprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&this.body.removeFromWorld(),this.visible=!1)}}),Object.defineProperty(b.Sprite.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),Object.defineProperty(b.Sprite.prototype,"smoothed",{get:function(){return!this.texture.baseTexture.scaleMode},set:function(a){a?this.texture&&(this.texture.baseTexture.scaleMode=0):this.texture&&(this.texture.baseTexture.scaleMode=1)}}),Object.defineProperty(b.Sprite.prototype,"x",{get:function(){returnthis.position.x},set:function(a){this.position.x=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),Object.defineProperty(b.Sprite.prototype,"y",{get:function(){returnthis.position.y},set:function(a){this.position.y=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),Object.defineProperty(b.Sprite.prototype,"destroyPhase",{get:function(){return!!this._cache[8]}}),b.Image=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.exists=!0,this.name="",this.type=b.IMAGE,this.z=0,this.events=newb.Events(this),this.animations=newb.AnimationManager(this),this.key=e,PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.position.set(c,d),this.world=newb.Point(c,d),this.alive=!0,this.autoCull=!1,this.input=null,this.debug=!1,this.cameraOffset=newb.Point,this.cropRect=null,this._cache=[0,0,0,0,1,0,1,0,0],this._crop=null,this._frame=null,this._bounds=newb.Rectangle,this.loadTexture(e,f)},b.Image.prototype=Object.create(PIXI.Sprite.prototype),b.Image.prototype.constructor=b.Image,b.Image.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)returnthis._cache[3]=-1,!1;this.autoCull&&(this._bounds.copyFrom(this.getBounds()),this.renderable=this.game.world.camera.screenView.intersects(this._bounds)),this.world.setTo(this.game.camera.x+this.worldTransform.tx,this.game.camera.y+this.worldTransform.ty),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(vara=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Image.prototype.update=function(){},b.Image.prototype.postUpdate=function(){this.keyinstanceofb.BitmapData&&this.key.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(vara=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Image.prototype.loadTexture=function(a,c){c=c||0,this.key=a;vard=!0,e=this.smoothed;ainstanceofb.RenderTexture?(this.key=a.key,this.setTexture(a)):ainstanceofb.BitmapData?this.setTexture(a.texture):ainstanceofPIXI.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])),d=!this.animations.loadFrameData(this.game.cache.getFrameData(a),c)):(console.warn("Texture with key '"+a+"' not found."),this.key="__missing",this.s
case"text":case"script":case"physics":this.xhrLoad(this._fileIndex,this.baseURL+a.url,"text","fileComplete","fileError");break;case"binary":this.xhrLoad(this._fileIndex,this.baseURL+a.url,"arraybuffer","fileComplete","fileError")}},xhrLoad:function(a,b,c,d,e){this._xhr.open("GET",b,!0),this._xhr.responseType=c;varf=this;this._xhr.onload=function(){returnf[d](a)},this._xhr.onerror=function(){returnf[e](a)},this._xhr.send()},getAudioURL:function(a){varb;"string"==typeofa&&(a=[a]);for(varc=0;c<a.length;c++)if(b=a[c].toLowerCase(),b=b.substr((Math.max(0,b.lastIndexOf("."))||1/0)+1),this.game.device.canPlayAudio(b))returna[c];returnnull},fileError:function(a){this._fileList[a].loaded=!0,this._fileList[a].error=!0,this.onFileError.dispatch(this._fileList[a].key,this._fileList[a]),console.warn("Phaser.Loader error loading file: "+this._fileList[a].key+" from URL "+this._fileList[a].url),this.nextFile(a,!1)},fileComplete:function(a){if(!this._fileList[a])returnvoidconsole.warn("Phaser.Loader fileComplete invalid index "+a);varc=this._fileList[a];c.loaded=!0;vard=!0;switch(c.type){case"image":this.game.cache.addImage(c.key,c.url,c.data);break;case"spritesheet":this.game.cache.addSpriteSheet(c.key,c.url,c.data,c.frameWidth,c.frameHeight,c.frameMax,c.margin,c.spacing);break;case"textureatlas":if(null==c.atlasURL)this.game.cache.addTextureAtlas(c.key,c.url,c.data,c.atlasData,c.format);elseif(d=!1,c.format==b.Loader.TEXTURE_ATLAS_JSON_ARRAY||c.format==b.Loader.TEXTURE_ATLAS_JSON_HASH)this.xhrLoad(this._fileIndex,this.baseURL+c.atlasURL,"text","jsonLoadComplete","dataLoadError");else{if(c.format!=b.Loader.TEXTURE_ATLAS_XML_STARLING)thrownewError("Phaser.Loader. Invalid Texture Atlas format: "+c.format);this.xhrLoad(this._fileIndex,this.baseURL+c.atlasURL,"text","xmlLoadComplete","dataLoadError")}break;case"bitmapfont":null==c.xmlURL?this.game.cache.addBitmapFont(c.key,c.url,c.data,c.xmlData,c.xSpacing,c.ySpacing):(d=!1,this.xhrLoad(this._fileIndex,this.baseURL+c.xmlURL,"text","xmlLoadComplete","dataLoadError"));break;case"audio":if(this.game.sound.usingWebAudio){if(c.data=this._xhr.response,this.game.cache.addSound(c.key,c.url,c.data,!0,!1),c.autoDecode){vare=this,f=c.key;this.game.cache.updateSound(f,"isDecoding",!0),this.game.sound.context.decodeAudioData(c.data,function(a){a&&(e.game.cache.decodedSound(f,a),e.game.sound.onSoundDecode.dispatch(f,e.game.cache.getSound(f)))})}}elsec.data.removeEventListener("canplaythrough",b.GAMES[this.game.id].load.fileComplete),this.game.cache.addSound(c.key,c.url,c.data,!1,!0);break;case"text":c.data=this._xhr.responseText,this.game.cache.addText(c.key,c.url,c.data);break;case"physics":varg=JSON.parse(this._xhr.responseText);this.game.cache.addPhysicsData(c.key,c.url,g,c.format);break;case"script":c.data=document.createElement("script"),c.data.language="javascript",c.data.type="text/javascript",c.data.defer=!1,c.data.text=this._xhr.responseText,document.head.appendChild(c.data),c.callback&&(c.data=c.callback.call(c.callbackContext,c.key,this._xhr.responseText));break;case"binary":c.data=c.callback?c.callback.call(c.callbackContext,c.key,this._xhr.response):this._xhr.response,this.game.cache.addBinary(c.key,c.data)}d&&this.nextFile(a,!0)},jsonLoadComplete:function(a){if(!this._fileList[a])returnvoidconsole.warn("Phaser.Loader jsonLoadComplete invalid index "+a);varb=this._fileList[a];if(this._ajax&&this._ajax.responseText)varc=JSON.parse(this._ajax.responseText);elsevarc=JSON.parse(this._xhr.responseText);b.loaded=!0,"tilemap"===b.type?this.game.cache.addTilemap(b.key,b.url,c,b.format):"json"===b.type?this.game.cache.addJSON(b.key,b.url,c):this.game.cache.addTextureAtlas(b.key,b.url,b.data,c,b.format),this.nextFile(a,!0)},csvLoadComplete:function(a){if(!this._fileList[a])returnvoidconsole.warn("Phaser.Loader csvLoadComplete invalid index "+a);varb=this._fileList[a],c=this._xhr.responseText;b.loaded=!0,this.game.cache.addTilemap(b.key,b.url,c,b.format),this.nextFile(a,!0)},dataLoadError:function(a){varb=this._fileList[a];b.loaded=!0,b.error=!0,console.warn("Phaser.Loader
},hexToRGB:function(a){varc=b.Color.hexToColor(a);returnc?b.Color.getColor32(c.a,c.r,c.g,c.b):void0},hexToColor:function(a,c){c||(c=b.Color.createColor());vard=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;a=a.replace(d,function(a,b,c,d){returnb+b+c+c+d+d});vare=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);returne&&(c.r=parseInt(e[1],16),c.g=parseInt(e[2],16),c.b=parseInt(e[3],16)),c},componentToHex:function(a){varb=a.toString(16);return1==b.length?"0"+b:b},HSVColorWheel:function(a,c){"undefined"==typeofa&&(a=1),"undefined"==typeofc&&(c=1);for(vard=[],e=0;359>=e;e++)d.push(b.Color.HSVtoRGB(e/359,a,c));returnd},HSLColorWheel:function(a,c){"undefined"==typeofa&&(a=.5),"undefined"==typeofc&&(c=.5);for(vard=[],e=0;359>=e;e++)d.push(b.Color.HSLtoRGB(e/359,a,c));returnd},interpolateColor:function(a,c,d,e,f){"undefined"==typeoff&&(f=255);varg=b.Color.getRGB(a),h=b.Color.getRGB(c),i=(h.red-g.red)*e/d+g.red,j=(h.green-g.green)*e/d+g.green,k=(h.blue-g.blue)*e/d+g.blue;returnb.Color.getColor32(f,i,j,k)},interpolateColorWithRGB:function(a,c,d,e,f,g){varh=b.Color.getRGB(a),i=(c-h.red)*g/f+h.red,j=(d-h.green)*g/f+h.green,k=(e-h.blue)*g/f+h.blue;returnb.Color.getColor(i,j,k)},interpolateRGB:function(a,c,d,e,f,g,h,i){varj=(e-a)*i/h+a,k=(f-c)*i/h+c,l=(g-d)*i/h+d;returnb.Color.getColor(j,k,l)},getRandomColor:function(a,c,d){if("undefined"==typeofa&&(a=0),"undefined"==typeofc&&(c=255),"undefined"==typeofd&&(d=255),c>255||a>c)returnb.Color.getColor(255,255,255);vare=a+Math.round(Math.random()*(c-a)),f=a+Math.round(Math.random()*(c-a)),g=a+Math.round(Math.random()*(c-a));returnb.Color.getColor32(d,e,f,g)},getRGB:function(a){returna>16777215?{alpha:a>>>24,red:a>>16&255,green:a>>8&255,blue:255&a,a:a>>>24,r:a>>16&255,g:a>>8&255,b:255&a}:{alpha:255,red:a>>16&255,green:a>>8&255,blue:255&a,a:255,r:a>>16&255,g:a>>8&255,b:255&a}},getWebRGB:function(a){if("object"==typeofa)return"rgba("+a.r.toString()+","+a.g.toString()+","+a.b.toString()+","+(a.a/255).toString()+")";varc=b.Color.getRGB(a);return"rgba("+c.r.toString()+","+c.g.toString()+","+c.b.toString()+","+(c.a/255).toString()+")"},getAlpha:function(a){returna>>>24},getAlphaFloat:function(a){return(a>>>24)/255},getRed:function(a){returna>>16&255},getGreen:function(a){returna>>8&255},getBlue:function(a){return255&a}},b.Physics=function(a,b){b=b||{},this.game=a,this.config=b,this.arcade=null,this.p2=null,this.ninja=null,this.box2d=null,this.chipmunk=null,this.parseConfig()},b.Physics.ARCADE=0,b.Physics.P2JS=1,b.Physics.NINJA=2,b.Physics.BOX2D=3,b.Physics.CHIPMUNK=5,b.Physics.prototype={parseConfig:function(){this.config.hasOwnProperty("arcade")&&this.config.arcade!==!0||!b.Physics.hasOwnProperty("Arcade")||(this.arcade=newb.Physics.Arcade(this.game),this.game.time.deltaCap=.2),this.config.hasOwnProperty("ninja")&&this.config.ninja===!0&&b.Physics.hasOwnProperty("Ninja")&&(this.ninja=newb.Physics.Ninja(this.game)),this.config.hasOwnProperty("p2")&&this.config.p2===!0&&b.Physics.hasOwnProperty("P2")&&(this.p2=newb.Physics.P2(this.game,this.config))},startSystem:function(a){if(a===b.Physics.ARCADE?this.arcade=newb.Physics.Arcade(this.game):a===b.Physics.P2JS&&(this.p2=newb.Physics.P2(this.game,this.config)),a===b.Physics.NINJA)this.ninja=newb.Physics.Ninja(this.game);else{if(a===b.Physics.BOX2D&&null===this.box2d)thrownewError("The Box2D physics system has not been implemented yet.");if(a===b.Physics.CHIPMUNK&&null===this.chipmunk)thrownewError("The Chipmunk physics system has not been implemented yet.")}},enable:function(a,c,d){"undefined"==typeofc&&(c=b.Physics.ARCADE),"undefined"==typeofd&&(d=!1),c===b.Physics.ARCADE?this.arcade.enable(a):c===b.Physics.P2JS&&this.p2?this.p2.enable(a,d):c===b.Physics.NINJA&&this.ninja&&this.ninja.enableAABB(a)},preUpdate:function(){this.p2&&this.p2.preUpdate()},update:function(){this.p2&&this.p2.update()},setBoundsToWorld:function(){this.arcade&&this.arcade.setBoundsToWorld(),this.ninja&&this.ninja.setBoundsToWorld(),this.p2&&this.p2.setBoundsToWorld()},clear:function(){this.p2&&this.p2.clear()},destroy:function(){this.p2
for(f=0;f<d.layers.length;f++)for(g=d.layers[f],A=0;A<g.data.length;A++)for(i=g.data[A],B=0;B<i.length;B++)C=i[B],C.index<0||(D=d.tiles[C.index][2],p=d.tilesets[D],p.tileProperties&&p.tileProperties[C.index-p.firstgid]&&(C.properties=p.tileProperties[C.index-p.firstgid]));returnd}},b.Tileset=function(a,b,c,d,e,f,g){("undefined"==typeofc||0>=c)&&(c=32),("undefined"==typeofd||0>=d)&&(d=32),"undefined"==typeofe&&(e=0),"undefined"==typeoff&&(f=0),this.name=a,this.firstgid=b,this.tileWidth=c,this.tileHeight=d,this.tileMargin=e,this.tileSpacing=f,this.properties=g,this.image=null,this.rows=0,this.columns=0,this.total=0,this.drawCoords=[]},b.Tileset.prototype={draw:function(a,b,c,d){this.image&&this.drawCoords[d]&&a.drawImage(this.image,this.drawCoords[d][0],this.drawCoords[d][1],this.tileWidth,this.tileHeight,b,c,this.tileWidth,this.tileHeight)},setImage:function(a){this.image=a,this.rows=Math.round((a.height-this.tileMargin)/(this.tileHeight+this.tileSpacing)),this.columns=Math.round((a.width-this.tileMargin)/(this.tileWidth+this.tileSpacing)),this.total=this.rows*this.columns,this.drawCoords.length=0;for(varb=this.tileMargin,c=this.tileMargin,d=this.firstgid,e=0;e<this.rows;e++){for(varf=0;f<this.columns;f++)this.drawCoords[d]=[b,c],b+=this.tileWidth+this.tileSpacing,d++;b=this.tileMargin,c+=this.tileHeight+this.tileSpacing}},setSpacing:function(a,b){this.tileMargin=a,this.tileSpacing=b,this.setImage(this.image)}},b.Tileset.prototype.constructor=b.Tileset,"undefined"!=typeofexports?("undefined"!=typeofmodule&&module.exports&&(exports=module.exports=b),exports.Phaser=b):"undefined"!=typeofdefine&&define.amd?define("Phaser",function(){returna.Phaser=b}()):a.Phaser=b}.call(this),!function(a){"object"==typeofexports?module.exports=a():"function"==typeofdefine&&define.amd?define("p2",function(){returnthis.p2=a()}()):"undefined"!=typeofwindow?window.p2=a():"undefined"!=typeofglobal?self.p2=a():"undefined"!=typeofself&&(self.p2=a())}(function(){returnfunctiona(b,c,d){functione(g,h){if(!c[g]){if(!b[g]){vari="function"==typeofrequire&&require;if(!h&&i)returni(g,!0);if(f)returnf(g,!0);thrownewError("Cannot find module '"+g+"'")}varj=c[g]={exports:{}};b[g][0].call(j.exports,function(a){varc=b[g][1][a];returne(c?c:a)},j,j.exports,a,b,c,d)}returnc[g].exports}for(varf="function"==typeofrequire&&require,g=0;g<d.length;g++)e(d[g]);returne}({1:[function(a,b){a=functionc(b,d,e){functionf(h,i){if(!d[h]){if(!b[h]){varj="function"==typeofa&&a;if(!i&&j)returnj(h,!0);if(g)returng(h,!0);thrownewError("Cannot find module '"+h+"'")}vark=d[h]={exports:{}};b[h][0].call(k.exports,function(a){varc=b[h][1][a];returnf(c?c:a)},k,k.exports,c,b,d,e)}returnd[h].exports}for(varg="function"==typeofa&&a,h=0;h<e.length;h++)f(e[h]);returnf}({PcZj9L:[function(a,b,c){functiond(a,b){varc=typeofa;if("base64"===b&&"string"===c)for(a=ib(a);a.length%4!==0;)a+="=";vare;if("number"===c)e=nb(a);elseif("string"===c)e=d.byteLength(a,b);else{if("object"!==c)thrownewError("First argument needs to be a number, array or string.");e=nb(a.length)}varf=lb(newCb(e));if(d.isBuffer(a))f.set(a);elseif(ob(a))for(varg=0;e>g;g++)f[g]=d.isBuffer(a)?a.readUInt8(g):a[g];else"string"===c&&f.write(a,0,b);returnf}functione(a,b,c,e){c=Number(c)||0;varf=a.length-c;e?(e=Number(e),e>f&&(e=f)):e=f;varg=b.length;if(g%2!==0)thrownewError("Invalid hex string");e>g/2&&(e=g/2);for(varh=0;e>h;h++){vari=parseInt(b.substr(2*h,2),16);if(isNaN(i))thrownewError("Invalid hex string");a[c+h]=i}returnd._charsWritten=2*h,h}functionf(a,b,c,e){returnd._charsWritten=tb(qb(b),a,c,e)}functiong(a,b,c,e){returnd._charsWritten=tb(rb(b),a,c,e)}functionh(a,b,c,d){returng(a,b,c,d)}functioni(a,b,c,e){returnd._charsWritten=tb(sb(b),a,c,e)}functionj(a,b,c,d){if(isFinite(b))isFinite(c)||(d=c,c=void0);else{varj=d;d=b,b=c,c=j}b=Number(b)||0;vark=this.length-b;switch(c?(c=Number(c),c>k&&(c=k)):c=k,d=String(d||"utf8").toLowerCase()){case"hex":returne(this,a,b,c);case"utf8":case"utf-8":returnf(this,a,b,c);case"ascii":returng(this,a,b,c);case"binary":r
a[f+1]=e}returna},c.prototype.getCollisionPairs=function(){vara=this.axisList,b=this.result,d=this.axisIndex;b.length=0;for(varf=a.length;f--;){varg=a[f];g.aabbNeedsUpdate&&g.updateAABB()}c.sortAxisList(a,d);for(varh=0,i=0|a.length;h!==i;h++)for(varj=a[h],k=h+1;i>k;k++){varl=a[k],m=l.aabb.lowerBound[d]<=j.aabb.upperBound[d];if(!m)break;e.canCollide(j,l)&&this.boundingVolumeCheck(j,l)&&b.push(j,l)}returnb}},{"../collision/Broadphase":10,"../utils/Utils":50,__browserify_Buffer:1,__browserify_process:2}],15:[function(a,b){functionc(a,b,c,e){this.type=c,e=d.defaults(e,{collideConnected:!0,wakeUpBodies:!0}),this.equations=[],this.bodyA=a,this.bodyB=b,this.collideConnected=e.collideConnected,e.wakeUpBodies&&(a&&a.wakeUp(),b&&b.wakeUp())}a("__browserify_process"),a("__browserify_Buffer");b.exports=c;vard=a("../utils/Utils");c.prototype.update=function(){thrownewError("method update() not implmemented in this Constraint subclass!")},c.DISTANCE=1,c.GEAR=2,c.LOCK=3,c.PRISMATIC=4,c.REVOLUTE=5,c.prototype.setStiffness=function(a){for(varb=this.equations,c=0;c!==b.length;c++){vard=b[c];d.stiffness=a,d.needsUpdate=!0}},c.prototype.setRelaxation=function(a){for(varb=this.equations,c=0;c!==b.length;c++){vard=b[c];d.relaxation=a,d.needsUpdate=!0}}},{"../utils/Utils":50,__browserify_Buffer:1,__browserify_process:2}],16:[function(a,b){functionc(a,b,c){c=g.defaults(c,{localAnchorA:[0,0],localAnchorB:[0,0]}),d.call(this,a,b,d.DISTANCE,c),this.localAnchorA=f.fromValues(c.localAnchorA[0],c.localAnchorA[1]),this.localAnchorB=f.fromValues(c.localAnchorB[0],c.localAnchorB[1]);varh=this.localAnchorA,i=this.localAnchorB;if(this.distance=0,"number"==typeofc.distance)this.distance=c.distance;else{varj=f.create(),k=f.create(),l=f.create();f.rotate(j,h,a.angle),f.rotate(k,i,b.angle),f.add(l,b.position,k),f.sub(l,l,j),f.sub(l,l,a.position),this.distance=f.length(l)}varm;m="undefined"==typeofc.maxForce?Number.MAX_VALUE:c.maxForce;varn=newe(a,b,-m,m);this.equations=[n],this.maxForce=m;varl=f.create(),o=f.create(),p=f.create(),q=this;n.computeGq=function(){vara=this.bodyA,b=this.bodyB,c=a.position,d=b.position;returnf.rotate(o,h,a.angle),f.rotate(p,i,b.angle),f.add(l,d,p),f.sub(l,l,o),f.sub(l,l,c),f.length(l)-q.distance},this.setMaxForce(m),this.upperLimitEnabled=!1,this.upperLimit=1,this.lowerLimitEnabled=!1,this.lowerLimit=0,this.position=0}vard=(a("__browserify_process"),a("__browserify_Buffer"),a("./Constraint")),e=a("../equations/Equation"),f=a("../math/vec2"),g=a("../utils/Utils");b.exports=c,c.prototype=newd;varh=f.create(),i=f.create(),j=f.create();c.prototype.update=function(){vara=this.equations[0],b=this.bodyA,c=this.bodyB,d=(this.distance,b.position),e=c.position,g=this.equations[0],k=a.G;f.rotate(i,this.localAnchorA,b.angle),f.rotate(j,this.localAnchorB,c.angle),f.add(h,e,j),f.sub(h,h,i),f.sub(h,h,d),this.position=f.length(h);varl=!1;if(this.upperLimitEnabled&&this.position>this.upperLimit&&(g.maxForce=0,g.minForce=-this.maxForce,this.distance=this.upperLimit,l=!0),this.lowerLimitEnabled&&this.position<this.lowerLimit&&(g.maxForce=this.maxForce,g.minForce=0,this.distance=this.lowerLimit,l=!0),(this.lowerLimitEnabled||this.upperLimitEnabled)&&!l)returnvoid(g.enabled=!1);g.enabled=!0,f.normalize(h,h);varm=f.crossLength(i,h),n=f.crossLength(j,h);k[0]=-h[0],k[1]=-h[1],k[2]=-m,k[3]=h[0],k[4]=h[1],k[5]=n},c.prototype.setMaxForce=function(a){varb=this.equations[0];b.minForce=-a,b.maxForce=a},c.prototype.getMaxForce=function(){vara=this.equations[0];returna.maxForce}},{"../equations/Equation":23,"../math/vec2":31,"../utils/Utils":50,"./Constraint":15,__browserify_Buffer:1,__browserify_process:2}],17:[function(a,b){functionc(a,b,c){c=c||{},d.call(this,a,b,d.GEAR,c),this.ratio="number"==typeofc.ratio?c.ratio:1,this.angle="number"==typeofc.angle?c.angle:b.angle-this.ratio*a.angle,c.angle=this.angle,c.ratio=this.ratio,this.equations=[newe(a,b,c)],"number"==typeofc.maxTorque&&this.setMaxTorque(c.maxTorque)}{vard=(a("__browserify_process"),a("__browserify_Buffer"),a("./Constraint")),e=(a("../equations/Equation"),a