text: !function(i){var n={};function s(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,s),e.l=!0,e.exports}s.m=i,s.c=n,s.d=function(t,e,i){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(i,n,function(t){return e[t]}.bind(null,n));return i},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="/js",s(s.s=0)}([function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0}),i(1);var r=i(4),o={width:640,height:360,type:Phaser.AUTO,parent:"game",scene:[r.MainScene],title:"German Teaching Game",pixelArt:!1,physics:{default:"arcade",arcade:{gravity:{y:200}}}},a=function(e){function t(t){return e.call(this,t)||this}return s(t,e),t}(Phaser.Game);e.Game=a,window.onload=function(){new a(o)}},function(e,t,i){(function(t){e.exports=t.Phaser=i(3)}).call(this,i(2))},function(R,S){var T;T=function(){return this}();try{T=T||Function("return this")()||eval("this")}catch(R){"object"==typeof window&&(T=window)}R.exports=T},function(U,V,W){window,U.exports=function(i){var n={};function s(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,s),e.l=!0,e.exports}return s.m=i,s.c=n,s.d=function(t,e,i){s.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},s.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=1127)}([function(t,e){function r(t,e,i,n){for(var s in e)if(e.hasOwnProperty(s)){var r=(u=e,c=s,f=void 0,f=(d=i)?u[c]:Object.getOwnPropertyDescriptor(u,c),!d&&f.value&&"object"==typeof f.value&&(f=f.value),!(!f||!((l=f).get&&"function"==typeof l.get||l.set&&"function"==typeof l.set))&&(void 0===f.enumerable&&(f.enumerable=!0),void 0===f.configurable&&(f.configurable=!0),f));if(!1!==r){if(o=(n||t).prototype,a=s,h=void 0,(h=Object.getOwnPropertyDescriptor(o,a))&&(h.value&&"object"==typeof h.value&&(h=h.value),!1===h.configurable)){if(p.ignoreFinals)continue;throw new Error("cannot override final property '"+s+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,s,r)}else t.prototype[s]=e[s]}var o,a,h,l,u,c,d,f}function o(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)r(t,e[i].prototype||e[i])}}function p(t){var e,i;if(t||(t={}),t.initialize){if("function"!=typeof t.initialize)throw new Error("initialize must be a function");e=t.initialize,delete t.initialize}else if(t.Extends){var n=t.Extends;e=function(){n.apply(this,arguments)}}else e=function(){};t.Extends?(e.prototype=Object.create(t.Extends.prototype),e.prototype.constructor=e,i=t.Extends,delete t.Extends):e.prototype.constructor=e;var s=null;return t.Mixins&&(s=t.Mixins,delete t.Mixins),o(e,s),r(e,t,!0,i),e}p.extend=r,p.mixin=o,p.ignoreFinals=!1,t.exports=p},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e,i){var n=typeof t;return t&&"number"!==n&&"string"!==n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.x=0,this.y=0,this.y="object"==typeof t?(this.x=t.x||0,t.y||0):(void 0===e&&(e=t),this.x=t||0,e||0)},clone:function(){return new n(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return 0<i&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this}});n.ZERO=new n,t.exports=n},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o<n.length;o++){if(!s.hasOwnProperty(n[o])){r=i;break}r=s[n[o]],s=s[n[o]]}return r}return i}return i}},function(t,e,i){var n=i(0),s=i(15),r=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once("destroy",this.destroy,this)},start:function(){this.systems.events.once("shutdown",this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});r.register=function(t,e){r.prototype.hasOwnProperty(t)||(r.prototype[t]=e)},s.register("GameObjectFactory",r,"add"),t.exports=r},function(t,e,i){var n=new(i(0))({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=n},function(t,e){var i={},n={install:function(t){for(var e in i)t[e]=i[e]},register:function(t,e){i[t]=e},destroy:function(){i={}}};t.exports=n},function(t,e){t.exports=function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},function(t,e,i){var n=i(0),s=i(39),r=i(190),o=i(398),a=i(54),h=i(187),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new a),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new a),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new a),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new a),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports={getTintFromFloats:function(t,e,i,n){return((255&(255*n|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n<t.length;++n){var s=t[n];s.type===e.FLOAT?i+=s.size:i+=1}return i}}},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,f="~";function s(){}function r(t,e,i,n,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var r=new function(t,e,i){this.fn=t,this.context=e,this.once=i||!1}(i,n||t,s),o=f?f+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],r]:t._events[o].push(r):(t._events[o]=r,t._eventsCount++),t}function l(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(f=!1)),o.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(f?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},o.prototype.listeners=function(t){var e=f?f+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,r=new Array(s);n<s;n++)r[n]=i[n].fn;return r},o.prototype.listenerCount=function(t){var e=f?f+t:t,i=this._events[e];return i?i.fn?1:i.length:0},o.prototype.emit=function(t,e,i,n,s,r){var o=f?f+t:t;if(!this._events[o])return!1;var a,h,l=this._events[o],u=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),u){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,i),!0;case 4:return l.fn.call(l.context,e,i,n),!0;case 5:return l.fn.call(l.context,e,i,n,s),!0;case 6:return l.fn.call(l.context,e,i,n,s,r),!0}for(h=1,a=new Array(u-1);h<u;h++)a[h-1]=arguments[h];l.fn.apply(l.context,a)}else{var c,d=l.length;for(h=0;h<d;h++)switch(l[h].once&&this.removeListener(t,l[h].fn,void 0,!0),u){case 1:l[h].fn.call(l[h].context);break;case 2:l[h].fn.call(l[h].context,e);break;case 3:l[h].fn.call(l[h].context,e,i);break;case 4:l[h].fn.call(l[h].context,e,i,n);break;default:if(!a)for(c=1,a=new Array(u-1);c<u;c++)a[c-1]=arguments[c];l[h].fn.apply(l[h].context,a)}}return!0},o.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,i,n){var s=f?f+t:t;if(!this._events[s])return this;if(!e)return l(this,s),this;var r=this._events[s];if(r.fn)r.fn!==e||n&&!r.once||i&&r.context!==i||l(this,s);else{for(var o=0,a=[],h=r.length;o<h;o++)(r[o].fn!==e||n&&!r[o].once||i&&r[o].context!==i)&&a.push(r[o]);a.length?this._events[s]=1===a.length?a[0]:a:l(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=f?f+t:t,this._events[e]&&l(this,e)):(this._events=new s,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=f,o.EventEmitter=o,t.exports=o},function(t,e,i){var s=i(16),r=i(4);t.exports=function(t,e,i){var n=r(t,e,null);if(null===n)return i;if(Array.isArray(n))return s.RND.pick(n);if("object"==typeof n){if(n.hasOwnProperty("randInt"))return s.RND.integerInRange(n.randInt[0],n.randInt[1]);if(n.hasOwnProperty("randFloat"))return s.RND.realInRange(n.randFloat[0],n.randFloat[1])}else if("function"==typeof n)return n(e);return n}},function(t,e,i){var n=i(0),s=i(15),r=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once("destroy",this.destroy,this)},start:function(){this.systems.events.once("shutdown",this.shutdown,this)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});r.register=function(t,e){r.prototype.hasOwnProperty(t)||(r.prototype[t]=e)},s.register("GameObjectCreator",r,"make"),t.exports=r},function(t,e,i){t.exports={Alpha:i(401),Animation:i(427),BlendMode:i(400),ComputedSize:i(1045),Crop:i(1044),Depth:i(399),Flip:i(1043),GetBounds:i(1042),Mask:i(395),Origin:i(1041),Pipeline:i(186),ScaleMode:i(1040),ScrollFactor:i(392),Size:i(1039),Texture:i(1038),TextureCrop:i(1037),Tint:i(1036),ToJSON:i(391),Transform:i(390),TransformMatrix:i(38),Visible:i(389)}},function(t,e){var s={},r={},i={register:function(t,e,i,n){void 0===n&&(n=!1),s[t]={plugin:e,mapping:i,custom:n}},registerCustom:function(t,e,i,n){r[t]={plugin:e,mapping:i,data:n}},hasCore:function(t){return s.hasOwnProperty(t)},hasCustom:function(t){return r.hasOwnProperty(t)},getCore:function(t){return s[t]},getCustom:function(t){return r[t]},getCustomClass:function(t){return r.hasOwnProperty(t)?r[t].plugin:null},remove:function(t){s.hasOwnProperty(t)&&delete s[t]},removeCustom:function(t){r.hasOwnProperty(t)&&delete r[t]},destroyCorePlugins:function(){for(var t in s)s.hasOwnProperty(t)&&delete s[t]},destroyCustomPlugins:function(){for(var t in r)r.hasOwnProperty(t)&&delete r[t]}};t.exports=i},function(t,e,i){var n=i(404),s={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:new n};t.exports=s},function(t,e,i){var f=i(2);t.exports=function(t,e,i,n,s,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=r.width),void 0===n&&(n=r.height);var o=f(s,"isNotEmpty",!1),a=f(s,"isColliding",!1),h=f(s,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(n+=e,e=0),t+i>r.width&&(i=Math.max(r.width-t,0)),e+n>r.height&&(n=Math.max(r.height-e,0));for(var l=[],u=e;u<e+n;u++)for(var c=t;c<t+i;c++){var d=r.data[u][c];if(null!==d){if(o&&-1===d.index)continue;if(a&&!d.collides)continue;if(h&&!d.hasInterestingFace)continue;l.push(d)}}return l}},function(t,e){t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},function(t,e,i){var n=i(0),s=i(391),r=i(123),o=i(11),a=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.type=e,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return s(this)},willRender:function(t){return!(a.RENDER_MASK!==this.renderFlags||0<this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),(t=e).parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit("destroy",this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});a.RENDER_MASK=15,t.exports=a},function(t,e,i){var u=i(8),c=function(){var t,e,i,n,s,r,o=arguments[0]||{},a=1,h=arguments.length,l=!1;for("boolean"==typeof o&&(l=o,o=arguments[1]||{},a=2),h===a&&(o=this,--a);a<h;a++)if(null!=(t=arguments[a]))for(e in t)i=o[e],o!==(n=t[e])&&(l&&n&&(u(n)||(s=Array.isArray(n)))?(r=s?(s=!1,i&&Array.isArray(i)?i:[]):i&&u(i)?i:{},o[e]=c(l,r,n)):void 0!==n&&(o[e]=n));return o};t.exports=c},function(t,e,i){var n=i(0),s=i(18),r=i(2),o=i(141),a=i(140),h=i(254),l=i(105),u=new n({initialize:function(t,e){this.loader=t,this.cache=r(e,"cache",!1),this.type=r(e,"type",!1),this.key=r(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.type||!this.key)throw new Error("Error calling 'Loader."+this.type+"' invalid key provided.");this.url=r(e,"url"),void 0===this.url?this.url=t.path+i+"."+r(e,"extension",""):"function"!=typeof this.url&&(this.url=t.path+this.url),this.src="",this.xhrSettings=l(r(e,"responseType",void 0)),r(e,"xhrSettings",!1)&&(this.xhrSettings=a(this.xhrSettings,r(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?s.FILE_POPULATED:s.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=r(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){(this.linkFile=t).linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===s.FILE_POPULATED?this.loader.nextFile(this,!0):(this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=h(this,this.loader.xhr))},onLoad:function(t,e){var i=!(e.target&&200!==e.target.status);4===t.readyState&&400<=t.status&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit("fileprogress",this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit("filecomplete",e,i,t),this.loader.emit("filecomplete-"+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){t.exports=function(t,e,i,n,s){var r=n.alpha*i.alpha;if(r<=0)return!1;var o=t._tempMatrix1.copyFromArray(n.matrix.matrix),a=t._tempMatrix2.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),h=t._tempMatrix3;return s?(o.multiplyWithOffset(s,-n.scrollX*i.scrollFactorX,-n.scrollY*i.scrollFactorY),a.e=i.x,a.f=i.y):(a.e-=n.scrollX*i.scrollFactorX,a.f-=n.scrollY*i.scrollFactorY),o.multiply(a,h),e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=r,e.save(),h.setToContext(e),!0}},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){var n,a,s,h=i(26),l=i(120),u=[],c=!1;t.exports=(s=function(){var e=0;return u.forEach(function(t){t.parent&&e++}),e},{create2D:function(t,e,i){return n(t,e,i,h.CANVAS)},create:n=function(t,e,i,n,s){var r;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=h.CANVAS),void 0===s&&(s=!1);var o=a(n);return null===o?(o={parent:t,canvas:document.createElement("canvas"),type:n},n===h.CANVAS&&u.push(o)):o.parent=t,r=o.canvas,s&&(o.parent=r),r.width=e,r.height=i,c&&n===h.CANVAS&&l.disable(r.getContext("2d")),r},createWebGL:function(t,e,i){return n(t,e,i,h.WEBGL)},disableSmoothing:function(){c=!0},enableSmoothing:function(){c=!1},first:a=function(t){if(void 0===t&&(t=h.CANVAS),t===h.WEBGL)return null;for(var e=0;e<u.length;e++){var i=u[e];if(!i.parent&&i.type===t)return i}return null},free:function(){return u.length-s()},pool:u,remove:function(e){var i=e instanceof HTMLCanvasElement;u.forEach(function(t){(i&&t.canvas===e||!i&&t.parent===e)&&(t.parent=null,t.canvas.width=1,t.canvas.height=1)})},total:s})},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o<h;o++)t[o][e]=i+a*n,a++;else for(o=s;0<=o;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n={VERSION:"3.15.1",BlendModes:i(66),ScaleModes:i(94),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(54),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),this.isFilled=void 0!==t&&(this.fillColor=t,this.fillAlpha=e,!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),this.isStroked=void 0!==t&&(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e,i){var l=i(66),u=i(12),c=i(94);t.exports=function(t,e,i){e.x=u(i,"x",0),e.y=u(i,"y",0),e.depth=u(i,"depth",0),e.flipX=u(i,"flipX",!1),e.flipY=u(i,"flipY",!1);var n=u(i,"scale",null);"number"==typeof n?e.setScale(n):null!==n&&(e.scaleX=u(n,"x",1),e.scaleY=u(n,"y",1));var s=u(i,"scrollFactor",null);"number"==typeof s?e.setScrollFactor(s):null!==s&&(e.scrollFactorX=u(s,"x",1),e.scrollFactorY=u(s,"y",1)),e.rotation=u(i,"rotation",0);var r=u(i,"angle",null);null!==r&&(e.angle=r),e.alpha=u(i,"alpha",1);var o=u(i,"origin",null);if("number"==typeof o)e.setOrigin(o);else if(null!==o){var a=u(o,"x",.5),h=u(o,"y",.5);e.setOrigin(a,h)}return e.scaleMode=u(i,"scaleMode",c.DEFAULT),e.blendMode=u(i,"blendMode",l.NORMAL),e.visible=u(i,"visible",!0),u(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e){t.exports=function(t,e,i){var n=i||e.fillColor,s=e.fillAlpha,r=(16711680&n)>>>16,o=(65280&n)>>>8,a=255&n;t.fillStyle="rgba("+r+","+o+","+a+","+s+")"}},function(t,e,i){var n=i(16);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o<h;o++)t[o][e]+=i+a*n,a++;else for(o=s;0<=o;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){(function(n){var h={};t.exports=h,function(){h._nextId=0,h._seed=0,h._nowStartTime=+new Date,h.extend=function(t,e){var i,n;n="boolean"==typeof e?(i=2,e):(i=1,!0);for(var s=i;s<arguments.length;s++){var r=arguments[s];if(r)for(var o in r)n&&r[o]&&r[o].constructor===Object?t[o]&&t[o].constructor!==Object?t[o]=r[o]:(t[o]=t[o]||{},h.extend(t[o],n,r[o])):t[o]=r[o]}return t},h.clone=function(t,e){return h.extend({},e,t)},h.keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var i in t)e.push(i);return e},h.values=function(t){var e=[];if(Object.keys){for(var i=Object.keys(t),n=0;n<i.length;n++)e.push(t[i[n]]);return e}for(var s in t)e.push(t[s]);return e},h.get=function(t,e,i,n){e=e.split(".").slice(i,n);for(var s=0;s<e.length;s+=1)t=t[e[s]];return t},h.set=function(t,e,i,n,s){var r=e.split(".").slice(n,s);return h.get(t,e,0,-1)[r[r.length-1]]=i},h.shuffle=function(t){for(var e=t.length-1;0<e;e--){var i=Math.floor(h.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t},h.choose=function(t){return t[Math.floor(h.random()*t.length)]},h.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},h.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},h.isFunction=function(t){return"function"==typeof t},h.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},h.isString=function(t){return"[object String]"===toString.call(t)},h.clamp=function(t,e,i){return t<e?e:i<t?i:t},h.sign=function(t){return t<0?-1:1},h.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-h._nowStartTime},h.random=function(t,e){return e=void 0!==e?e:1,(t=void 0!==t?t:0)+i()*(e-t)};var i=function(){return h._seed=(9301*h._seed+49297)%233280,h._seed/233280};h.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},h.logLevel=1,h.log=function(){console&&0<h.logLevel&&h.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},h.info=function(){console&&0<h.logLevel&&h.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},h.warn=function(){console&&0<h.logLevel&&h.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},h.nextId=function(){return h._nextId++},h.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1},h.map=function(t,e){if(t.map)return t.map(e);for(var i=[],n=0;n<t.length;n+=1)i.push(e(t[n]));return i},h.topologicalSort=function(t){var e=[],i=[],n=[];for(var s in t)i[s]||n[s]||h._topologicalSort(s,i,n,t,e);return e},h._topologicalSort=function(t,e,i,n,s){var r=n[t]||[];i[t]=!0;for(var o=0;o<r.length;o+=1){var a=r[o];i[a]||e[a]||h._topologicalSort(a,e,i,n,s)}i[t]=!1,e[t]=!0,s.push(t)},h.chain=function(){for(var r=[],t=0;t<arguments.length;t+=1){var e=arguments[t];e._chained?r.push.apply(r,e._chained):r.push(e)}var i=function(){for(var t,e=new Array(arguments.length),i=0,n=arguments.length;i<n;i++)e[i]=arguments[i];for(i=0;i<r.length;i+=1){var s=r[i].apply(t,e);void 0!==s&&(t=s)}return t};return i._chained=r,i},h.chainPathBefore=function(t,e,i){return h.set(t,e,h.chain(i,h.get(t,e)))},h.chainPathAfter=function(t,e,i){return h.set(t,e,h.chain(h.get(t,e),i))},h._requireGlobal=function(t,e){return"undefined"!=typeof window?window[t]:void 0!==n?n[t]:null}}()}).call(this,i(200))},function(t,e,i){var d=i(102),f=i(17);t.exports=function(t,e,i,n,s){for(var r=null,o=null,a=null,h=null,l=f(t,e,i,n,null,s),u=0;u<l.length;u++){var c=l[u];c&&(c.collides?(r=d(c.x,c.y-1,!0,s),o=d(c.x,c.y+1,!0,s),a=d(c.x-1,c.y,!0,s),h=d(c.x+1,c.y,!0,s),c.faceTop=!r||!r.collides,c.faceBottom=!o||!o.collides,c.faceLeft=!a||!a.collides,c.faceRight=!h||!h.collides):c.resetFaces())}}},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e){t.exports=function(t,e){var i=e.strokeColor,n=e.strokeAlpha,s=(16711680&i)>>>16,r=(65280&i)>>>8,o=255&i;t.strokeStyle="rgba("+s+","+r+","+o+","+n+")",t.lineWidth=e.lineWidth}},function(t,e,i){var n=i(0),r=i(177),o=i(376),s=i(176),a=i(375),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return s(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,s=this.a;return this._color=r(e,i,n),this._color32=o(e,i,n,s),this._rgba="rgba("+e+","+i+","+n+","+s/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,s(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,s(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,s(this._h,this._s,t,this)}}});t.exports=h},function(t,e,i){var n=i(0),c=i(3),s=new n({initialize:function(t,e,i,n,s,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===s&&(s=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,n,s,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},scaleY:{get:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[5]=s*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,s,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*i,a=n*n,h=s*s,l=r*r,u=Math.sqrt(o+h),c=Math.sqrt(a+l);return t.translateX=e[4],t.translateY=e[5],t.scaleX=u,t.scaleY=c,t.rotation=Math.acos(i/u)*(Math.atan(-s/i)<0?-1:1),t},applyITRS:function(t,e,i,n,s){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new c);var n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5],u=1/(s*a+o*-r);return i.x=a*u*t+-o*u*e+(l*o-h*a)*u,i.y=s*u*e+-r*u*t+(-l*s+h*r)*u,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=s},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},function(t,e){t.exports=function(t,e,i){return 0<t.radius&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileHeight,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),s*=r.scaleY),e?Math.floor(t/s):t/s}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileWidth,r=n.tilemapLayer;return r&&(void 0===i&&(i=r.scene.cameras.main),t-=r.x+i.scrollX*(1-r.scrollFactorX),s*=r.scaleX),e?Math.floor(t/s):t/s}},function(t,e,i){var n=i(0),h=i(18),l=i(21),s=i(7),u=i(2),c=i(4),d=i(8),r=new n({Extends:l,initialize:function(t,e,i,n,s){var r="json";if(d(e)){var o=e;e=u(o,"key"),i=u(o,"url"),n=u(o,"xhrSettings"),r=u(o,"extension",r),s=u(o,"dataKey",s)}var a={type:"json",cache:t.cacheManager.json,extension:r,responseType:"text",key:e,url:i,xhrSettings:n,config:s};l.call(this,t,a),d(i)&&(this.data=s?c(i,s):i,this.state=h.FILE_POPULATED)},onProcess:function(){if(this.state!==h.FILE_POPULATED){this.state=h.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?c(t,e,t):t}this.onProcessComplete()}});s.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new r(this,t[s]));else this.addFile(new r(this,t,e,n,i));return this}),t.exports=r},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return Math.sqrt(s*s+r*r)}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e,i){var n=i(0),s=i(397),r=i(189),o=i(188),a=i(3),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new a),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new a),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=h},function(t,e,i){var n=i(0),s=i(14),r=i(265),o=new n({Mixins:[s.Alpha,s.Flip,s.Visible],initialize:function(t,e,i,n,s,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=s,this.height=r,this.baseWidth=void 0!==o?o:s,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=null,(this.collisionCallbackContext=this).tint=16777215,this.physics={}},containsPoint:function(t,e){return!(t<this.pixelX||e<this.pixelY||t>this.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return this.getLeft(t)+this.width/2},getCenterY:function(t){return this.getTop(t)+this.height/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){return void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){return void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(t,e){return this.collisionCallbackContext=null===t?void(this.collisionCallback=void 0):(this.collisionCallback=t,e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight-(this.height-this.baseHeight),this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.tilemapLayer;return t?t.tileset:null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.loader=t,this.type=e,this.key=i,this.files=n,this.complete=!1,this.pending=n.length,this.failed=0,this.config={};for(var s=0;s<n.length;s++)n[s].multiFile=this},isReadyToProcess:function(){return 0===this.pending&&0===this.failed&&!this.complete},addToMultiFile:function(t){return this.files.push(t),(t.multiFile=this).pending++,this.complete=!1,this},onFileComplete:function(t){-1!==this.files.indexOf(t)&&this.pending--},onFileFailed:function(t){-1!==this.files.indexOf(t)&&this.failed++}});t.exports=n},function(t,e,i){var n=i(0),s=i(18),c=i(21),r=i(7),d=i(2),f=i(8),o=new n({Extends:c,initialize:function t(e,i,n,s,r){var o,a="png";if(f(i)){var h=i;i=d(h,"key"),n=d(h,"url"),o=d(h,"normalMap"),s=d(h,"xhrSettings"),a=d(h,"extension",a),r=d(h,"frameConfig")}Array.isArray(n)&&(o=n[1],n=n[0]);var l={type:"image",cache:e.textureManager,extension:a,responseType:"blob",key:i,url:n,xhrSettings:s,config:r};if(c.call(this,e,l),o){var u=new t(e,this.key,o,s,r);u.type="normalMap",this.setLink(u),e.addFile(u)}},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){c.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){c.revokeObjectURL(t.data),t.onProcessError()},c.createObjectURL(this.data,this.xhrLoader.response,"image/png")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});r.register("image",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},function(t,e,i){var n=i(0),s=i(69),r=i(278),o=i(277),a=i(54),h=i(184),l=new n({initialize:function(t,e,i,n,s,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.x3=s,this.y3=r},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.x3=s,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new a),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new a),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new a),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var v=i(10);t.exports=function(t,e,i,n,s){var r=t.strokeTint,o=v.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);r.TL=o,r.TR=o,r.BL=o,r.BR=o;var a=e.pathData,h=a.length-1,l=e.lineWidth,u=l/2,c=a[0]-n,d=a[1]-s;e.closePath||(h-=2);for(var f=2;f<h;f+=2){var p=a[f]-n,g=a[f+1]-s;t.setTexture2D(),t.batchLine(c,d,p,g,u,u,l,f-2,!!e.closePath&&f===h-1),c=p,d=g}}},function(t,e,i){var n=i(0),r=i(14),o=i(19),s=i(829),a=new n({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScaleMode,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,s],initialize:function(t,e,i,n,s){o.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new r.Animation(this),this.setTexture(n,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e,i){return this.anims.play(t,e,i),this},toJSON:function(){return r.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=a},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||s<e||i<=e||s<i||s<e+i){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,s,r,o,a,h,l,u=e&&e.length,c=u?e[0]*i:t.length,d=g(t,0,c,i,!0),f=[];if(!d)return f;if(u&&(d=function(t,e,i,n){var s,r,o,a,h,l=[];for(s=0,r=e.length;s<r;s++)o=e[s]*n,a=s<r-1?e[s+1]*n:t.length,(h=g(t,o,a,n,!1))===h.next&&(h.steiner=!0),l.push(w(h));for(l.sort(m),s=0;s<l.length;s++)x(l[s],i),i=v(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=r=t[0],s=o=t[1];for(var p=i;p<c;p+=i)a=t[p],h=t[p+1],a<n&&(n=a),h<s&&(s=h),r<a&&(r=a),o<h&&(o=h);l=Math.max(r-n,o-s)}return y(d,f,i,n,s,l),f}function g(t,e,i,n,s){var r,o;if(s===0<M(t,e,i,n))for(r=e;r<i;r+=n)o=h(r,t[r],t[r+1],o);else for(r=i-n;e<=r;r-=n)o=h(r,t[r],t[r+1],o);return o&&a(o,o.next)&&(C(o),o=o.next),o}function v(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!a(n,n.next)&&0!==T(n.prev,n,n.next))n=n.next;else{if(C(n),(n=e=n.prev)===n.next)return null;i=!0}}while(i||n!==e);return e}function y(t,e,i,n,s,r,o){if(t){!o&&r&&function(t,e,i,n){for(var s=t;null===s.z&&(s.z=p(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,(s=s.next)!==t;);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,r=t=null,o=0;i;){for(o++,n=i,e=a=0;e<l&&(a++,n=n.nextZ);e++);for(h=l;0<a||0<h&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(i=(s=i).nextZ,a--):(n=(s=n).nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(1<o)}(s)}(t,n,s,r);for(var a,h,l=t;t.prev!==t.next;)if(a=t.prev,h=t.next,r?c(t,n,s,r):u(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),C(t),t=h.next,l=h.next;else if((t=h)===l){o?1===o?y(t=d(t,e,i),e,i,n,s,r,2):2===o&&f(t,e,i,n,s,r):y(v(t),e,i,n,s,r,1);break}}}function u(t){var e=t.prev,i=t,n=t.next;if(0<=T(e,i,n))return!1;for(var s=t.next.next;s!==t.prev;){if(b(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&0<=T(s.prev,s,s.next))return!1;s=s.next}return!0}function c(t,e,i,n){var s=t.prev,r=t,o=t.next;if(0<=T(s,r,o))return!1;for(var a=s.x<r.x?s.x<o.x?s.x:o.x:r.x<o.x?r.x:o.x,h=s.y<r.y?s.y<o.y?s.y:o.y:r.y<o.y?r.y:o.y,l=s.x>r.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=p(a,h,e,i,n),d=p(l,u,e,i,n),f=t.nextZ;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&b(s.x,s.y,r.x,r.y,o.x,o.y,f.x,f.y)&&0<=T(f.prev,f,f.next))return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&b(s.x,s.y,r.x,r.y,o.x,o.y,f.x,f.y)&&0<=T(f.prev,f,f.next))return!1;f=f.prevZ}return!0}function d(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!a(s,r)&&S(s,n,n.next,r)&&_(s,r)&&_(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),C(n),C(n.next),n=t=r),n=n.next}while(n!==t);return n}function f(t,e,i,n,s,r){var o,a,h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&(a=l,(o=h).next.i!==a.i&&o.prev.i!==a.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&S(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(o,a)&&_(o,a)&&_(a,o)&&function(t,e){for(var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),(i=i.next)!==t;);return n}(o,a))){var u=A(h,l);return h=v(h,h.next),u=v(u,u.next),y(h,e,i,n,s,r),void y(u,e,i,n,s,r)}l=l.next}h=h.next}while(h!==t)}function m(t,e){return t.x-e.x}function x(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&o<a){if((o=a)===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(s===o)return i.prev;var h,l=i,u=i.x,c=i.y,d=1/0;for(n=i.next;n!==l;)s>=n.x&&n.x>=u&&s!==n.x&&b(r<c?s:o,r,u,c,r<c?o:s,r,n.x,n.y)&&((h=Math.abs(r-n.y)/(s-n.x))<d||h===d&&n.x>i.x)&&_(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=A(e,t);v(i,i.next)}}function p(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function w(t){for(var e=t,i=t;e.x<i.x&&(i=e),(e=e.next)!==t;);return i}function b(t,e,i,n,s,r,o,a){return 0<=(s-o)*(e-a)-(t-o)*(r-a)&&0<=(t-o)*(n-a)-(i-o)*(e-a)&&0<=(i-o)*(r-a)-(s-o)*(n-a)}function T(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function a(t,e){return t.x===e.x&&t.y===e.y}function S(t,e,i,n){return!!(a(t,e)&&a(i,n)||a(t,n)&&a(i,e))||0<T(t,e,i)!=0<T(t,e,n)&&0<T(i,n,t)!=0<T(i,n,e)}function _(t,e){return T(t.prev,t,t.next)<0?0<=T(t,e,t.next)&&0<=T(t,t.prev,e):T(t,e,t.prev)<0||T(t,t.next,e)<0}function A(t,e){var i=new o(t.i,t.x,t.y),n=new o(e.i,e.x,e.y),s=t.next,r=e.prev;return(t.next=e).prev=t,(i.next=s).prev=i,(n.next=i).prev=n,(r.next=n).prev=r,n}function h(t,e,i,n){var s=new o(t,e,i);return n?(s.next=n.next,(s.prev=n).next.prev=s,n.next=s):(s.prev=s).next=s,s}function C(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function o(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(t,e,i,n){for(var s=0,r=e,o=i-n;r<i;r+=n)s+=(t[o]-t[r])*(t[r+1]+t[o+1]),o=r;return s}(t.exports=n).deviation=function(t,e,i,n){var s=e&&e.length,r=s?e[0]*i:t.length,o=Math.abs(M(t,0,r,i));if(s)for(var a=0,h=e.length;a<h;a++){var l=e[a]*i,u=a<h-1?e[a+1]*i:t.length;o-=Math.abs(M(t,l,u,i))}var c=0;for(a=0;a<n.length;a+=3){var d=n[a]*i,f=n[a+1]*i,p=n[a+2]*i;c+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)},n.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,s=0;s<t.length;s++){for(var r=0;r<t[s].length;r++)for(var o=0;o<e;o++)i.vertices.push(t[s][r][o]);0<s&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16}},function(t,e,i){var l={};t.exports=l;var u=i(76),c=i(81),s=i(222),r=i(33),d=i(80),f=i(505);!function(){l._inertiaScale=4,l._nextCollidingGroupId=1,l._nextNonCollidingGroupId=-1,l._nextCategory=1,l.create=function(t){var e={id:r.nextId(),type:"body",label:"Body",gameObject:null,parts:[],plugin:{},angle:0,vertices:u.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,ignoreGravity:!1,ignorePointer:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0},lineWidth:0},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,_original:null},i=r.extend(e,t);return n(i,t),i},l.nextGroup=function(t){return t?l._nextNonCollidingGroupId--:l._nextCollidingGroupId++},l.nextCategory=function(){return l._nextCategory=l._nextCategory<<1,l._nextCategory};var n=function(t,e){e=e||{},l.set(t,{bounds:t.bounds||d.create(t.vertices),positionPrev:t.positionPrev||c.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),u.rotate(t.vertices,t.angle,t.position),f.rotate(t.axes,t.angle),d.update(t.bounds,t.vertices,t.velocity),l.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia});var i=t.isStatic?"#2e2b44":r.choose(["#006BA6","#0496FF","#FFBC42","#D81159","#8F2D56"]);t.render.fillStyle=t.render.fillStyle||i,t.render.strokeStyle=t.render.strokeStyle||"#000",t.render.sprite.xOffset+=-(t.bounds.min.x-t.position.x)/(t.bounds.max.x-t.bounds.min.x),t.render.sprite.yOffset+=-(t.bounds.min.y-t.position.y)/(t.bounds.max.y-t.bounds.min.y)};l.set=function(t,e,i){var n;for(n in"string"==typeof e&&(n=e,(e={})[n]=i),e)if(e.hasOwnProperty(n))switch(i=e[n],n){case"isStatic":l.setStatic(t,i);break;case"isSleeping":s.set(t,i);break;case"mass":l.setMass(t,i);break;case"density":l.setDensity(t,i);break;case"inertia":l.setInertia(t,i);break;case"vertices":l.setVertices(t,i);break;case"position":l.setPosition(t,i);break;case"angle":l.setAngle(t,i);break;case"velocity":l.setVelocity(t,i);break;case"angularVelocity":l.setAngularVelocity(t,i);break;case"parts":l.setParts(t,i);break;default:t[n]=i}},l.setStatic=function(t,e){for(var i=0;i<t.parts.length;i++){var n=t.parts[i];(n.isStatic=e)?(n._original={restitution:n.restitution,friction:n.friction,mass:n.mass,inertia:n.inertia,density:n.density,inverseMass:n.inverseMass,inverseInertia:n.inverseInertia},n.restitution=0,n.friction=1,n.mass=n.inertia=n.density=1/0,n.inverseMass=n.inverseInertia=0,n.positionPrev.x=n.position.x,n.positionPrev.y=n.position.y,n.anglePrev=n.angle,n.angularVelocity=0,n.speed=0,n.angularSpeed=0,n.motion=0):n._original&&(n.restitution=n._original.restitution,n.friction=n._original.friction,n.mass=n._original.mass,n.inertia=n._original.inertia,n.density=n._original.density,n.inverseMass=n._original.inverseMass,n.inverseInertia=n._original.inverseInertia,n._original=null)}},l.setMass=function(t,e){var i=t.inertia/(t.mass/6);t.inertia=i*(e/6),t.inverseInertia=1/t.inertia,t.mass=e,t.inverseMass=1/t.mass,t.density=t.mass/t.area},l.setDensity=function(t,e){l.setMass(t,e*t.area),t.density=e},l.setInertia=function(t,e){t.inertia=e,t.inverseInertia=1/t.inertia},l.setVertices=function(t,e){e[0].body===t?t.vertices=e:t.vertices=u.create(e,t),t.axes=f.fromVertices(t.vertices),t.area=u.area(t.vertices),l.setMass(t,t.density*t.area);var i=u.centre(t.vertices);u.translate(t.vertices,i,-1),l.setInertia(t,l._inertiaScale*u.inertia(t.vertices,t.mass)),u.translate(t.vertices,t.position),d.update(t.bounds,t.vertices,t.velocity)},l.setParts=function(t,e,i){var n;for(e=e.slice(0),t.parts.length=0,t.parts.push(t),t.parent=t,n=0;n<e.length;n++){var s=e[n];s!==t&&(s.parent=t).parts.push(s)}if(1!==t.parts.length){if(i=void 0===i||i){var r=[];for(n=0;n<e.length;n++)r=r.concat(e[n].vertices);u.clockwiseSort(r);var o=u.hull(r),a=u.centre(o);l.setVertices(t,o),u.translate(t.vertices,a)}var h=l._totalProperties(t);t.area=h.area,(t.parent=t).position.x=h.centre.x,t.position.y=h.centre.y,t.positionPrev.x=h.centre.x,t.positionPrev.y=h.centre.y,l.setMass(t,h.mass),l.setInertia(t,h.inertia),l.setPosition(t,h.centre)}},l.setPosition=function(t,e){var i=c.sub(e,t.position);t.positionPrev.x+=i.x,t.positionPrev.y+=i.y;for(var n=0;n<t.parts.length;n++){var s=t.parts[n];s.position.x+=i.x,s.position.y+=i.y,u.translate(s.vertices,i),d.update(s.bounds,s.vertices,t.velocity)}},l.setAngle=function(t,e){var i=e-t.angle;t.anglePrev+=i;for(var n=0;n<t.parts.length;n++){var s=t.parts[n];s.angle+=i,u.rotate(s.vertices,i,t.position),f.rotate(s.axes,i),d.update(s.bounds,s.vertices,t.velocity),0<n&&c.rotateAbout(s.position,i,t.position,s.position)}},l.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=c.magnitude(t.velocity)},l.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},l.translate=function(t,e){l.setPosition(t,c.add(t.position,e))},l.rotate=function(t,e,i){if(i){var n=Math.cos(e),s=Math.sin(e),r=t.position.x-i.x,o=t.position.y-i.y;l.setPosition(t,{x:i.x+(r*n-o*s),y:i.y+(r*s+o*n)}),l.setAngle(t,t.angle+e)}else l.setAngle(t,t.angle+e)},l.scale=function(t,e,i,n){var s=0,r=0;n=n||t.position;for(var o=0;o<t.parts.length;o++){var a=t.parts[o];u.scale(a.vertices,e,i,n),a.axes=f.fromVertices(a.vertices),a.area=u.area(a.vertices),l.setMass(a,t.density*a.area),u.translate(a.vertices,{x:-a.position.x,y:-a.position.y}),l.setInertia(a,l._inertiaScale*u.inertia(a.vertices,a.mass)),u.translate(a.vertices,{x:a.position.x,y:a.position.y}),0<o&&(s+=a.area,r+=a.inertia),a.position.x=n.x+(a.position.x-n.x)*e,a.position.y=n.y+(a.position.y-n.y)*i,d.update(a.bounds,a.vertices,t.velocity)}1<t.parts.length&&(t.area=s,t.isStatic||(l.setMass(t,t.density*s),l.setInertia(t,r))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},l.update=function(t,e,i,n){var s=Math.pow(e*i*t.timeScale,2),r=1-t.frictionAir*i*t.timeScale,o=t.position.x-t.positionPrev.x,a=t.position.y-t.positionPrev.y;t.velocity.x=o*r*n+t.force.x/t.mass*s,t.velocity.y=a*r*n+t.force.y/t.mass*s,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*r*n+t.torque/t.inertia*s,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=c.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var h=0;h<t.parts.length;h++){var l=t.parts[h];u.translate(l.vertices,t.velocity),0<h&&(l.position.x+=t.velocity.x,l.position.y+=t.velocity.y),0!==t.angularVelocity&&(u.rotate(l.vertices,t.angularVelocity,t.position),f.rotate(l.axes,t.angularVelocity),0<h&&c.rotateAbout(l.position,t.angularVelocity,t.position,l.position)),d.update(l.bounds,l.vertices,t.velocity)}},l.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,s=e.y-t.position.y;t.torque+=n*i.y-s*i.x},l._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i<t.parts.length;i++){var n=t.parts[i],s=n.mass!==1/0?n.mass:1;e.mass+=s,e.area+=n.area,e.inertia+=n.inertia,e.centre=c.add(e.centre,c.mult(n.position,s))}return e.centre=c.div(e.centre,e.mass),e}}()},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,y=(l*f-u*c)*g;return 0<=v&&0<=y&&v+y<1}},function(t,e,i){var n=i(0),s=i(173),r=i(9),o=i(3),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();i<e&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),1<n&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(0<a)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){var n=i(0),s=i(40),r=i(405),o=i(403),a=i(191),h=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=h},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e,i){var a={};t.exports=a;var w=i(81),b=i(33);a.create=function(t,e){for(var i=[],n=0;n<t.length;n++){var s=t[n],r={x:s.x,y:s.y,index:n,body:e,isInternal:!1,contact:null};r.contact={vertex:r,normalImpulse:0,tangentImpulse:0},i.push(r)}return i},a.fromPath=function(t,e){var n=[];return t.replace(/L?\s*([\-\d\.e]+)[\s,]*([\-\d\.e]+)*/gi,function(t,e,i){n.push({x:parseFloat(e),y:parseFloat(i)})}),a.create(n,e)},a.centre=function(t){for(var e,i,n,s=a.area(t,!0),r={x:0,y:0},o=0;o<t.length;o++)n=(o+1)%t.length,e=w.cross(t[o],t[n]),i=w.mult(w.add(t[o],t[n]),e),r=w.add(r,i);return w.div(r,6*s)},a.mean=function(t){for(var e={x:0,y:0},i=0;i<t.length;i++)e.x+=t[i].x,e.y+=t[i].y;return w.div(e,t.length)},a.area=function(t,e){for(var i=0,n=t.length-1,s=0;s<t.length;s++)i+=(t[n].x-t[s].x)*(t[n].y+t[s].y),n=s;return e?i/2:Math.abs(i)/2},a.inertia=function(t,e){for(var i,n,s=0,r=0,o=t,a=0;a<o.length;a++)n=(a+1)%o.length,s+=(i=Math.abs(w.cross(o[n],o[a])))*(w.dot(o[n],o[n])+w.dot(o[n],o[a])+w.dot(o[a],o[a])),r+=i;return e/6*(s/r)},a.translate=function(t,e,i){var n;if(i)for(n=0;n<t.length;n++)t[n].x+=e.x*i,t[n].y+=e.y*i;else for(n=0;n<t.length;n++)t[n].x+=e.x,t[n].y+=e.y;return t},a.rotate=function(t,e,i){if(0!==e){for(var n=Math.cos(e),s=Math.sin(e),r=0;r<t.length;r++){var o=t[r],a=o.x-i.x,h=o.y-i.y;o.x=i.x+(a*n-h*s),o.y=i.y+(a*s+h*n)}return t}},a.contains=function(t,e){for(var i=0;i<t.length;i++){var n=t[i],s=t[(i+1)%t.length];if(0<(e.x-n.x)*(s.y-n.y)+(e.y-n.y)*(n.x-s.x))return!1}return!0},a.scale=function(t,e,i,n){if(1===e&&1===i)return t;var s,r;n=n||a.centre(t);for(var o=0;o<t.length;o++)s=t[o],r=w.sub(s,n),t[o].x=n.x+r.x*e,t[o].y=n.y+r.y*i;return t},a.chamfer=function(t,e,i,n,s){e="number"==typeof e?[e]:e||[8],i=void 0!==i?i:-1,n=n||2,s=s||14;for(var r=[],o=0;o<t.length;o++){var a=t[0<=o-1?o-1:t.length-1],h=t[o],l=t[(o+1)%t.length],u=e[o<e.length?o:e.length-1];if(0!==u){var c=w.normalise({x:h.y-a.y,y:a.x-h.x}),d=w.normalise({x:l.y-h.y,y:h.x-l.x}),f=Math.sqrt(2*Math.pow(u,2)),p=w.mult(b.clone(c),u),g=w.normalise(w.mult(w.add(c,d),.5)),v=w.sub(h,w.mult(g,f)),y=i;-1===i&&(y=1.75*Math.pow(u,.32)),(y=b.clamp(y,n,s))%2==1&&(y+=1);for(var m=Math.acos(w.dot(c,d))/y,x=0;x<y;x++)r.push(w.add(w.rotate(p,m*x),v))}else r.push(h)}return r},a.clockwiseSort=function(t){var i=a.mean(t);return t.sort(function(t,e){return w.angle(i,t)-w.angle(i,e)}),t},a.isConvex=function(t){var e,i,n,s,r=0,o=t.length;if(o<3)return null;for(e=0;e<o;e++)if(n=(e+2)%o,s=(t[i=(e+1)%o].x-t[e].x)*(t[n].y-t[i].y),(s-=(t[i].y-t[e].y)*(t[n].x-t[i].x))<0?r|=1:0<s&&(r|=2),3===r)return!1;return 0!==r||null},a.hull=function(t){var e,i,n=[],s=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i<t.length;i+=1){for(e=t[i];2<=s.length&&w.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}for(i=t.length-1;0<=i;i-=1){for(e=t[i];2<=n.length&&w.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),s.pop(),n.concat(s)}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","map"),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.widthInPixels=s(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.tileHeight),this.format=s(t,"format",null),this.orientation=s(t,"orientation","orthogonal"),this.renderOrder=s(t,"renderOrder","right-down"),this.version=s(t,"version","1"),this.properties=s(t,"properties",{}),this.layers=s(t,"layers",[]),this.images=s(t,"images",[]),this.objects=s(t,"objects",{}),this.collision=s(t,"collision",{}),this.tilesets=s(t,"tilesets",[]),this.imageCollections=s(t,"imageCollections",[]),this.tiles=s(t,"tiles",[])}});t.exports=r},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","layer"),this.x=s(t,"x",0),this.y=s(t,"y",0),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.baseTileWidth=s(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=s(t,"baseTileHeight",this.tileHeight),this.widthInPixels=s(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=s(t,"alpha",1),this.visible=s(t,"visible",!0),this.properties=s(t,"properties",{}),this.indexes=s(t,"indexes",[]),this.collideIndexes=s(t,"collideIndexes",[]),this.callbacks=s(t,"callbacks",[]),this.bodies=s(t,"bodies",[]),this.data=s(t,"data",[]),this.tilemapLayer=s(t,"tilemapLayer",null)}});t.exports=r},function(t,e){t.exports=function(t,e,i){return 0<=t&&t<i.width&&0<=e&&e<i.height}},function(t,e){var i={};(t.exports=i).create=function(t){var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&i.update(e,t),e},i.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var n=0;n<e.length;n++){var s=e[n];s.x>t.max.x&&(t.max.x=s.x),s.x<t.min.x&&(t.min.x=s.x),s.y>t.max.y&&(t.max.y=s.y),s.y<t.min.y&&(t.min.y=s.y)}i&&(0<i.x?t.max.x+=i.x:t.min.x+=i.x,0<i.y?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){var i={};(t.exports=i).create=function(t,e){return{x:t||0,y:e||0}},i.clone=function(t){return{x:t.x,y:t.y}},i.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},i.rotate=function(t,e,i){var n=Math.cos(e),s=Math.sin(e);i||(i={});var r=t.x*n-t.y*s;return i.y=t.x*s+t.y*n,i.x=r,i},i.rotateAbout=function(t,e,i,n){var s=Math.cos(e),r=Math.sin(e);n||(n={});var o=i.x+((t.x-i.x)*s-(t.y-i.y)*r);return n.y=i.y+((t.x-i.x)*r+(t.y-i.y)*s),n.x=o,n},i.normalise=function(t){var e=i.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},i.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},i.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},i.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},i.mult=function(t,e){return{x:t.x*e,y:t.y*e}},i.div=function(t,e){return{x:t.x/e,y:t.y/e}},i.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},i.neg=function(t){return{x:-t.x,y:-t.y}},i.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]},function(t,e,i){var A=i(10);t.exports=function(t,e,i,n,s,r){for(var o=A.getTintAppendFloatAlphaAndSwap(i.fillColor,i.fillAlpha*n),a=i.pathData,h=i.pathIndexes,l=0;l<h.length;l+=3){var u=2*h[l],c=2*h[l+1],d=2*h[l+2],f=a[u+0]-s,p=a[u+1]-r,g=a[c+0]-s,v=a[c+1]-r,y=a[d+0]-s,m=a[d+1]-r,x=e.getX(f,p),w=e.getY(f,p),b=e.getX(g,v),T=e.getY(g,v),S=e.getX(y,m),_=e.getY(y,m);t.setTexture2D(),t.batchTri(x,w,b,T,S,_,0,0,1,1,o,o,o,t.tintEffect)}}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e,i){var n=i(174);t.exports=function(e,t){if("string"==typeof e&&n.hasOwnProperty(e)){if(t){var i=t.slice(0);return i.unshift(0),function(t){return i[0]=t,n[e].apply(this,i)}}return n[e]}return"function"==typeof e?e:(Array.isArray(e)&&e.length,n.Power0)}},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(826),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,s){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=a},function(t,e,i){var k=i(417),n=i(0),F=i(2),L=i(4),s=i(8),R=i(312),r=i(95),o=i(61),a=new n({initialize:function(t,e,i){i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?s(e[0])&&(i=e,e=null):s(e)&&(i=e,e=null),this.scene=t,this.children=new r(e),this.isParent=!0,this.classType=F(i,"classType",o),this.active=F(i,"active",!0),this.maxSize=F(i,"maxSize",-1),this.defaultKey=F(i,"defaultKey",null),this.defaultFrame=F(i,"defaultFrame",null),this.runChildUpdate=F(i,"runChildUpdate",!1),this.createCallback=F(i,"createCallback",null),this.removeCallback=F(i,"removeCallback",null),this.createMultipleCallback=F(i,"createMultipleCallback",null),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i<t.length;i++){var n=this.createFromConfig(t[i]);e=e.concat(n)}return e},createFromConfig:function(t){if(this.isFull())return[];this.classType=F(t,"classType",this.classType);var e=F(t,"key",void 0),i=F(t,"frame",null),n=F(t,"visible",!0),s=F(t,"active",!0),r=[];if(void 0===e)return r;Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);for(var o=F(t,"repeat",0),a=F(t,"randomKey",!1),h=F(t,"randomFrame",!1),l=F(t,"yoyo",!1),u=F(t,"frameQuantity",1),c=F(t,"max",0),d=R(e,i,{max:c,qty:u,random:a,randomB:h,repeat:o,yoyo:l}),f=0;f<d.length;f++){var p=this.create(0,0,d[f].a,d[f].b,n,s);if(!p)break;r.push(p)}var g=L(t,"setXY.x",0),v=L(t,"setXY.y",0),y=L(t,"setXY.stepX",0),m=L(t,"setXY.stepY",0);k.SetXY(r,g,v,y,m);var x=L(t,"setRotation.value",0),w=L(t,"setRotation.step",0);k.SetRotation(r,x,w);var b=L(t,"setScale.x",1),T=L(t,"setScale.y",b),S=L(t,"setScale.stepX",0),_=L(t,"setScale.stepY",0);k.SetScale(r,b,T,S,_);var A=L(t,"setAlpha.value",1),C=L(t,"setAlpha.step",0);k.SetAlpha(r,A,C);var M=F(t,"hitArea",null),P=F(t,"hitAreaCallback",null);M&&k.SetHitArea(r,M,P);var E=F(t,"gridAlign",!1);return E&&k.GridAlign(r,E),this.createMultipleCallback&&this.createMultipleCallback.call(this,r),r},preUpdate:function(t,e){if(this.runChildUpdate&&0!==this.children.size)for(var i=this.children.entries.slice(),n=0;n<i.length;n++){var s=i[n];s.active&&s.update(t,e)}},add:function(t,e){return void 0===e&&(e=!1),this.isFull()||(this.children.set(t),this.createCallback&&this.createCallback.call(this,t),e&&(this.scene.sys.displayList.add(t),t.preUpdate&&this.scene.sys.updateList.add(t)),t.on("destroy",this.remove,this)),this},addMultiple:function(t,e){if(void 0===e&&(e=!1),Array.isArray(t))for(var i=0;i<t.length;i++)this.add(t[i],e);return this},remove:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),this.children.contains(t)&&(this.children.delete(t),this.removeCallback&&this.removeCallback.call(this,t),t.off("destroy",this.remove,this),i?t.destroy():e&&(t.scene.sys.displayList.remove(t),t.preUpdate&&t.scene.sys.updateList.remove(t))),this},clear:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.children,n=0;n<i.size;n++){var s=i.entries[n];s.off("destroy",this.remove,this),e?s.destroy():t&&(s.scene.sys.displayList.remove(s),s.preUpdate&&s.scene.sys.updateList.remove(s))}return this.children.clear(),this},contains:function(t){return this.children.contains(t)},getChildren:function(){return this.children.entries},getLength:function(){return this.children.size},getFirst:function(t,e,i,n,s,r,o){return this.getHandler(!0,1,t,e,i,n,s,r,o)},getFirstNth:function(t,e,i,n,s,r,o,a){return this.getHandler(!0,t,e,i,n,s,r,o,a)},getLast:function(t,e,i,n,s,r,o){return this.getHandler(!1,1,t,e,i,n,s,r,o)},getLastNth:function(t,e,i,n,s,r,o,a){return this.getHandler(!1,t,e,i,n,s,r,o,a)},getHandler:function(t,e,i,n,s,r,o,a,h){var l,u;void 0===i&&(i=!1),void 0===n&&(n=!1);var c=0,d=this.children.entries;if(t)for(u=0;u<d.length;u++)if((l=d[u]).active===i){if(++c===e)break}else l=null;else for(u=d.length-1;0<=u;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return k.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i<this.children.size;i++)this.children.entries[i].active===t&&e++;return e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setDepth:function(t,e){return k.SetDepth(this.children.entries,t,e),this},kill:function(t){this.children.contains(t)&&t.setActive(!1)},killAndHide:function(t){this.children.contains(t)&&(t.setActive(!1),t.setVisible(!1))},toggleVisible:function(){return k.ToggleVisible(this.children.entries),this},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){if(t)for(var e=this.children,i=0;i<e.size;i++){var n=e.entries[i];n.off("destroy",this.remove,this),n.destroy()}this.children.clear(),this.scene=void 0,this.children=void 0}}});t.exports=a},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e,i){var n=i(0),s=i(89),r=i(308),o=i(307),a=i(185),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=h},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],s=e;s<i;s++)t[s]=t[s+1];return t.length=i,n}}},function(t,e,i){(function(i){var n={android:!1,chromeOS:!1,cocoonJS:!1,cocoonJSApp:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){var t=navigator.userAgent;/Windows/.test(t)?n.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?n.macOS=!0:/Android/.test(t)?n.android=!0:/Linux/.test(t)?n.linux=!0:/iP[ao]d|iPhone/i.test(t)?(n.iOS=!0,navigator.appVersion.match(/OS (\d+)/),n.iOSVersion=parseInt(RegExp.$1,10),n.iPhone=-1!==t.toLowerCase().indexOf("iphone"),n.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?n.kindle=!0:/CrOS/.test(t)&&(n.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(n.android=!1,n.iOS=!1,n.macOS=!1,n.windows=!0,n.windowsPhone=!0);var e=/Silk/.test(t);if((n.windows||n.macOS||n.linux&&!e||n.chromeOS)&&(n.desktop=!0),(n.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(n.desktop=!1),navigator.standalone&&(n.webApp=!0),void 0!==window.cordova&&(n.cordova=!0),void 0!==i&&i.versions&&i.versions.node&&(n.node=!0),n.node&&"object"==typeof i.versions&&(n.nodeWebkit=!!i.versions["node-webkit"],n.electron=!!i.versions.electron),navigator.isCocoonJS){n.cocoonJS=!0;try{n.cocoonJSApp="undefined"!=typeof CocoonJS}catch(t){n.cocoonJSApp=!1}}return void 0!==window.ejecta&&(n.ejecta=!0),/Crosswalk/.test(t)&&(n.crosswalk=!0),n.pixelRatio=window.devicePixelRatio||1,n}()}).call(this,i(907))},function(t,e,i){var n=i(23);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e])},set:function(t){return-1===this.entries.indexOf(t)&&this.entries.push(t),this},get:function(t,e){for(var i=0;i<this.entries.length;i++){var n=this.entries[i];if(n[t]===e)return n}},getArray:function(){return this.entries.slice(0)},delete:function(t){var e=this.entries.indexOf(t);return-1<e&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t<this.entries.length;t++){var e=this.entries[t];console.log(e)}console.groupEnd()},each:function(t,e){var i,n=this.entries.slice(),s=n.length;if(e)for(i=0;i<s&&!1!==t.call(e,n[i],i);i++);else for(i=0;i<s&&!1!==t(n[i],i);i++);return this},iterate:function(t,e){var i,n=this.entries.length;if(e)for(i=0;i<n&&!1!==t.call(e,this.entries[i],i);i++);else for(i=0;i<n&&!1!==t(this.entries[i],i);i++);return this},iterateLocal:function(t){var e,i=[];for(e=1;e<arguments.length;e++)i.push(arguments[e]);var n=this.entries.length;for(e=0;e<n;e++){var s=this.entries[e];s[t].apply(s,i)}return this},clear:function(){return this.entries.length=0,this},contains:function(t){return-1<this.entries.indexOf(t)},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(e){var i=new n;return this.entries.forEach(function(t){e.contains(t)&&i.set(t)}),i},difference:function(e){var i=new n;return this.entries.forEach(function(t){e.contains(t)||i.set(t)}),i},size:{get:function(){return this.entries.length},set:function(t){return t<this.entries.length?this.entries.length=t:this.entries.length}}});t.exports=n},function(t,e,i){var s=i(63);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)||(i[n]=e[n]);return i}},function(t,e,i){var F=i(129),L=i(12),R=i(84),O=i(86),D=i(98),B=i(205),I=i(131),Y=i(4),X=i(130),z=i(128),N=i(127);t.exports=function(t,e,i){void 0===i&&(i=F);for(var n=i.targets?i.targets:I(e),s=B(e),r=D(e,"delay",i.delay),o=D(e,"duration",i.duration),a=Y(e,"easeParams",i.easeParams),h=O(Y(e,"ease",i.ease),a),l=D(e,"hold",i.hold),u=D(e,"repeat",i.repeat),c=D(e,"repeatDelay",i.repeatDelay),d=R(e,"yoyo",i.yoyo),f=R(e,"flipX",i.flipX),p=R(e,"flipY",i.flipY),g=[],v=0;v<s.length;v++)for(var y=s[v].key,m=s[v].value,x=0;x<n.length;x++){var w=X(y,m),b=N(n[x],y,w.getEnd,w.getStart,O(Y(m,"ease",h),a),D(m,"delay",r),D(m,"duration",o),R(m,"yoyo",d),D(m,"hold",l),D(m,"repeat",u),D(m,"repeatDelay",c),R(m,"flipX",f),R(m,"flipY",p));g.push(b)}var T=new z(t,g,n);T.offset=L(e,"offset",null),T.completeDelay=L(e,"completeDelay",0),T.loop=Math.round(L(e,"loop",0)),T.loopDelay=Math.round(L(e,"loopDelay",0)),T.paused=R(e,"paused",!1),T.useFrames=R(e,"useFrames",!1);for(var S=Y(e,"callbackScope",T),_=[T,null],A=z.TYPES,C=0;C<A.length;C++){var M=A[C],P=Y(e,M,!1);if(P){var E=Y(e,M+"Scope",S),k=Y(e,M+"Params",[]);T.setCallback(M,P,_.concat(k),E)}}return T}},function(t,e){t.exports=function(n,s,t){return n.hasOwnProperty(s)?"function"==typeof n[s]?function(t,e,i){return n[s](t,e,i)}:function(){return n[s]}:"function"==typeof t?t:function(){return t}}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o,a){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o={}),void 0===a&&(a={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=n,this.tileMargin=s,this.tileSpacing=r,this.tileProperties=o,this.tileData=a,this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},getTileTextureCoordinates:function(t){return this.containsTileIndex(t)?this.texCoordinates[t-this.firstgid]:null},setImage:function(t){return this.image=t,this.glTexture=t.get().source.glTexture,this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e){var i=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),n=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);i%1==0&&n%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),i=Math.floor(i),n=Math.floor(n),this.rows=i,this.columns=n,this.total=i*n,this.texCoordinates.length=0;for(var s=this.tileMargin,r=this.tileMargin,o=0;o<this.rows;o++){for(var a=0;a<this.columns;a++)this.texCoordinates.push({x:s,y:r}),s+=this.tileWidth+this.tileSpacing;s=this.tileMargin,r+=this.tileHeight+this.tileSpacing}return this}});t.exports=n},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.y+e.scrollY*(1-s.scrollFactorY),n*=s.scaleY),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.x+e.scrollX*(1-s.scrollFactorX),n*=s.scaleX),r+t*n}},function(t,e,i){var r=i(79);t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),r(t,e,n)){var s=n.data[e][t];return null===s?null:-1===s.index?i?s:null:s}return null}},function(t,e,i){t.exports={CalculateFacesAt:i(136),CalculateFacesWithin:i(34),Copy:i(489),CreateFromTiles:i(488),CullTiles:i(487),Fill:i(486),FilterTiles:i(485),FindByIndex:i(484),FindTile:i(483),ForEachTile:i(482),GetTileAt:i(102),GetTileAtWorldXY:i(481),GetTilesWithin:i(17),GetTilesWithinShape:i(480),GetTilesWithinWorldXY:i(479),HasTileAt:i(219),HasTileAtWorldXY:i(478),IsInLayerBounds:i(79),PutTileAt:i(135),PutTileAtWorldXY:i(477),PutTilesAt:i(476),Randomize:i(475),RemoveTileAt:i(218),RemoveTileAtWorldXY:i(474),RenderDebug:i(473),ReplaceByIndex:i(220),SetCollision:i(472),SetCollisionBetween:i(471),SetCollisionByExclusion:i(470),SetCollisionByProperty:i(469),SetCollisionFromCollisionGroup:i(468),SetTileIndexCallback:i(467),SetTileLocationCallback:i(466),Shuffle:i(465),SwapByIndex:i(464),TileToWorldX:i(101),TileToWorldXY:i(463),TileToWorldY:i(100),WeightedRandomize:i(462),WorldToTileX:i(50),WorldToTileXY:i(461),WorldToTileY:i(49)}},function(t,e,i){var n=i(0),s=i(236),r=i(61),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},function(t,e){t.exports=function(t,e,i,n,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),{responseType:t,async:e,user:i,password:n,timeout:s,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e,i){var l=i(4),u={},n={register:function(t,e,i,n,s){u[t]={plugin:e,mapping:i,settingsKey:n,configKey:s}},getPlugin:function(t){return u[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,n=e.game.config;for(var s in u){var r=u[s].plugin,o=u[s].mapping,a=u[s].settingsKey,h=u[s].configKey;l(i,a,n[h])&&(t[o]=new r(t))}},remove:function(t){u.hasOwnProperty(t)&&delete u[t]}};t.exports=n},function(t,e,i){var v=i(6);t.exports=function(t,e,i){void 0===i&&(i=new v);var n=t.x1,s=t.y1,r=t.x2,o=t.y2,a=e.x1,h=e.y1,l=e.x2,u=e.y2,c=(l-a)*(s-h)-(u-h)*(n-a),d=(r-n)*(s-h)-(o-s)*(n-a),f=(u-h)*(r-n)-(l-a)*(o-s);if(0===f)return!1;var p=c/f,g=d/f;return 0<=p&&p<=1&&0<=g&&g<=1&&(i.x=n+p*(r-n),i.y=s+p*(o-s),!0)}},function(t,e,i){var n=i(0),s=i(14),c=i(19),r=i(731),o=new n({Extends:c,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.Size,s.Texture,s.Transform,s.Visible,s.ScrollFactor,r],initialize:function(t,e,i,n,s,r,o,a,h){if(c.call(this,t,"Mesh"),n.length!==s.length)throw new Error("Mesh Vertex count must match UV count");var l,u=n.length/2|0;if(0<r.length&&r.length<u)throw new Error("Mesh Color count must match Vertex count");if(0<o.length&&o.length<u)throw new Error("Mesh Alpha count must match Vertex count");if(0===r.length)for(l=0;l<u;++l)r[l]=16777215;if(0===o.length)for(l=0;l<u;++l)o[l]=1;this.vertices=new Float32Array(n),this.uv=new Float32Array(s),this.colors=new Uint32Array(r),this.alphas=new Float32Array(o),this.tintFill=!1,this.setTexture(a,h),this.setPosition(e,i),this.setSizeToFrame(),this.setOrigin(),this.initPipeline()}});t.exports=o},function(t,e,i){var n=i(0),s=i(14),h=i(19),l=i(846),r=i(845),o=i(844),a=new n({Extends:h,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Texture,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,s,r,o){void 0===s&&(s=""),void 0===o&&(o=0),h.call(this,t,"BitmapText"),this.font=n;var a=this.scene.sys.cache.bitmapFont.get(n);this.fontData=a.data,this._text="",this._fontSize=r||this.fontData.size,this._letterSpacing=0,this._align=o,this._bounds=l(this,!1,this._bounds),this._dirty=!1,this.setTexture(a.texture,a.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.setText(s)},setLeftAlign:function(){return this._align=a.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=a.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=a.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},getTextBounds:function(t){return this._dirty&&l(this,t,this._bounds),this._bounds},setFont:function(t,e,i){if(void 0===e&&(e=this._fontSize),void 0===i&&(i=this._align),t!==this.font){var n=this.scene.sys.cache.bitmapFont.get(t);n&&(this.font=t,this.fontData=n.data,this._fontSize=e,this._align=i,this.setTexture(n.texture,n.frame),l(this,!1,this._bounds))}return this},align:{set:function(t){this._align=t,this._dirty=!0},get:function(){return this._align}},text:{set:function(t){this.setText(t)},get:function(){return this._text}},fontSize:{set:function(t){this._fontSize=t,this._dirty=!0},get:function(){return this._fontSize}},letterSpacing:{set:function(t){this._letterSpacing=t,this._dirty=!0},get:function(){return this._letterSpacing}},width:{get:function(){return this.getTextBounds(!1),this._bounds.global.width}},height:{get:function(){return this.getTextBounds(!1),this._bounds.global.height}},toJSON:function(){var t=s.ToJSON(this),e={font:this.font,text:this.text,fontSize:this.fontSize,letterSpacing:this.letterSpacing,align:this.align};return t.data=e,t}});a.ALIGN_LEFT=0,a.ALIGN_CENTER=1,a.ALIGN_RIGHT=2,a.ParseFromAtlas=r,t.exports=a},function(e,t,i){!function(){var t=function(t,e){return n(t.slice(),e)};function n(t,e){"function"!=typeof e&&(e=function(t,e){return String(t).localeCompare(e)});var i=t.length;if(i<=1)return t;for(var n=new Array(i),s=1;s<i;s*=2){o(t,e,s,n);var r=t;t=n,n=r}return t}t.inplace=function(t,e){var i=n(t,e);return i!==t&&o(i,null,t.length,t),t};var o=function(t,e,i,n){var s,r,o,a,h,l=t.length,u=0,c=2*i;for(s=0;s<l;s+=c)for(o=(r=s+i)+i,l<r&&(r=l),l<o&&(o=l),a=s,h=r;;)if(a<r&&h<o)e(t[a],t[h])<=0?n[u++]=t[a++]:n[u++]=t[h++];else if(a<r)n[u++]=t[a++];else{if(!(h<o))break;n[u++]=t[h++]}};e.exports=t}()},function(t,e,i){var n=i(163),s=i(315);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=s(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=s(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i<t.length;i++)t[i].reverse();t.reverse()}return t}},function(t,e,i){var s=i(164),n=i(0),r=i(1),o=i(110),a=new n({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t){return t&&(this._sortKey=t,o.inplace(this.list,this.sortHandler)),this},sortHandler:function(t,e){return t[this._sortKey]-e[this._sortKey]},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirstElement(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return-1<this.list.indexOf(t)},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){for(var i=[null],n=2;n<arguments.length;n++)i.push(arguments[n]);for(n=0;n<this.list.length;n++)i[0]=this.list[n],t.apply(e,i)},shutdown:function(){this.removeAll(),this.list=[]},destroy:function(){this.removeAll(),this.parent=null,this.addCallback=null,this.removeCallback=null},length:{get:function(){return this.list.length}},first:{get:function(){return(this.position=0)<this.list.length?this.list[0]:null}},last:{get:function(){return 0<this.list.length?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return 0<this.position?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){var n=i(0),M=i(23),s=i(20),r=new n({initialize:function(t,e,i,n,s,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,n,s)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,r=s.cut;r.x=i,r.y=n,r.w=t,r.h=e,r.r=i+t,r.b=n+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.b=n+r,this.x=i,this.y=n,this.width=s,this.height=r,this.halfWidth=.5*s,this.halfHeight=.5*r,this.centerX=Math.floor(s/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,n,s,r,o){var a=this.cutX,h=this.cutY,l=this.cutWidth,u=this.cutHeight,c=this.realWidth,d=this.realHeight,f=a+(e=M(e,0,c)),p=h+(i=M(i,0,d)),g=n=M(n,0,c-e),v=s=M(s,0,d-i),y=this.data;if(y.trim){var m=y.spriteSourceSize,x=e+(n=M(n,0,l-e)),w=i+(s=M(s,0,u-i));if(m.r<e||m.b<i||m.x>x||m.y>w)v=g=p=f=0;else{var b=Math.max(m.x,e),T=Math.max(m.y,i),S=Math.min(m.r,x)-b,_=Math.min(m.b,w)-T;g=S,v=_,f=r?a+(l-(b-m.x)-S):a+(b-m.x),p=o?h+(u-(T-m.y)-_):h+(T-m.y),e=b,i=T,n=S,s=_}}else r&&(f=a+(l-e-n)),o&&(p=h+(u-i-s));var A=this.source.width,C=this.source.height;return t.u0=Math.max(0,f/A),t.v0=Math.max(0,p/C),t.u1=Math.min(1,(f+g)/A),t.v1=Math.min(1,(p+v)/C),t.x=e,t.y=i,t.cx=f,t.cy=p,t.cw=g,t.ch=v,t.width=n,t.height=s,t.flipX=r,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new r(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=r},function(t,e,i){var n=i(0),s=i(11),r=i(20),o=i(1),a=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=r(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),1):(t=r(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,0)))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(this.markers[t.name]=r(!0,this.markers[t.name],t),0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),1)))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=r(this.currentConfig,e),this.isPlaying=!0,!(this.isPaused=!1)},pause:function(){return!(this.isPaused||!this.isPlaying||(this.isPlaying=!1,this.isPaused=!0,0))},resume:function(){return!(!this.isPaused||this.isPlaying||(this.isPlaying=!0,this.isPaused=!1))},stop:function(){return!(!this.isPaused&&!this.isPlaying||(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),0))},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:o,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit("destroy",this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=a},function(t,e,i){var n=i(0),o=i(63),s=i(11),r=i(1),a=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on("blur",function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on("focus",function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on("prestep",this.update,this),t.events.once("destroy",this.destroy,this)},add:r,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var s=o(e),r=i.spritemap[n];s.loop=!!r.hasOwnProperty("loop")&&r.loop,i.addMarker({name:n,start:r.start,duration:r.end-r.start,config:s})}return i},play:function(t,e){var i=this.add(t);return i.once("ended",i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once("ended",n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;0<=i;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit("pauseall",this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit("resumeall",this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit("stopall",this)},unlock:r,onBlur:r,onFocus:r,update:function(e,i){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit("unlocked",this));for(var t=this.sounds.length-1;0<=t;t--)this.sounds[t].pendingRemove&&this.sounds.splice(t,1);this.sounds.forEach(function(t){t.update(e,i)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(i,n){var s=this;this.sounds.forEach(function(t,e){t.pendingRemove||i.call(n||s,t,e,s.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("rate",this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit("detune",this,t)}}});t.exports=a},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e){t.exports=function(t,e){return 0<t&&0==(t&t-1)&&0<e&&0==(e&e-1)}},function(t,e,i){var n,s=i(92),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(n=navigator.userAgent,/Edge\/\d+/.test(n)?r.edge=!0:/Chrome\/(\d+)/.test(n)&&!s.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&s.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?r.opera=!0:/Safari/.test(n)&&!s.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(r.silk=!0),r)},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e){var i,n="";t.exports={disable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!1),t},enable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!0),t},getPrefix:i=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i<e.length;i++){var n=e[i]+"mageSmoothingEnabled";if(n in t)return n}return null},isEnabled:function(t){return null!==n?t[n]:null}}},function(t,e,i){var n=i(0),s=i(14),r=i(31),o=i(11),a=i(9),h=i(38),l=i(178),A=i(3),u=new n({Extends:o,Mixins:[s.Alpha,s.Visible],initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),o.call(this),this.scene,this.sceneManager,this.config,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new a,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new a,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new h,this.transparent=!0,this.backgroundColor=l("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new A(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new A);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOn:function(t,e){var i=.5*this.width,n=.5*this.height;return this.midPoint.set(t,e),this.scrollX=t-i,this.scrollY=e-n,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o;for(var g=f.length=0;g<p;++g){var v=t[g];if(v.hasOwnProperty("width")&&!v.parentContainer){var y=v.width,m=v.height,x=v.x-l*v.scrollFactorX-y*v.originX,w=v.y-u*v.scrollFactorY-m*v.originY,b=x*i+w*s+a,T=x*n+w*r+h,S=(x+y)*i+(w+m)*s+a,_=(x+y)*n+(w+m)*r+h,A=c+y,C=d+m;-y<b&&-m<T&&b<A&&T<C&&-y<S&&-m<_&&S<A&&_<C&&f.push(v)}else f.push(v)}return f},getWorldPoint:function(t,e,i){void 0===i&&(i=new A);var n=this.matrix.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5],u=s*a-r*o;if(!u)return i.x=t,i.y=e,i;var c=a*(u=1/u),d=-r*u,f=-o*u,p=s*u,g=(o*l-a*h)*u,v=(r*h-s*l)*u,y=Math.cos(this.rotation),m=Math.sin(this.rotation),x=this.zoom,w=this.resolution,b=this.scrollX,T=this.scrollY,S=t+(b*y-T*m)*x,_=e+(b*m+T*y)*x;return i.x=(S*c+_*f)*w+g,i.y=(S*d+_*p)*w+v,i},ignore:function(t){var e=this.id;Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];Array.isArray(n)?this.ignore(n):n.isParent?this.ignore(n.getChildren()):n.cameraFilter|=e}return this},preRender:function(t,e){var i=this.width,n=this.height,s=.5*i,r=.5*n,o=this.zoom*t,a=this.matrix,h=i*this.originX,l=n*this.originY,u=this.scrollX,c=this.scrollY;this.useBounds&&(u=this.clampX(u),c=this.clampY(c)),this.roundPixels&&(h=Math.round(h),l=Math.round(l)),this.scrollX=u,this.scrollY=c;var d=u+s,f=c+r;this.midPoint.set(d,f);var p=i/o,g=n/o;this.worldView.setTo(d-p/2,f-g/2,p,g),a.loadIdentity(),a.scale(e,e),a.translate(this.x+h,this.y+l),a.rotate(this.rotation),a.scale(o,o),a.translate(-h,-l)},clampX:function(t){var e=this._bounds,i=this.displayWidth,n=e.x+(i-this.width)/2,s=Math.max(n,n+e.width-i);return t<n?t=n:s<t&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return t<n?t=n:s<t&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=l(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.config=t.sys.game.config,this.sceneManager=t.sys.game.scene;var e=this.config.resolution;return this.resolution=e,this._cx=this._x*e,this._cy=this._y*e,this._cw=this._width*e,this._ch=this._height*e,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.config){var t=0!==this._x||0!==this._y||this.config.width!==this._width||this.config.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit("cameradestroy",this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.config=null,this.sceneManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=u},function(t,e){t.exports=function(t){for(var e=t.length-1;0<e;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.parent=t,(this.events=e)||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n<t.length;n++)i.push(e[t[n]]);return i}return e[t]},getAll:function(){var t={};for(var e in this.list)this.list.hasOwnProperty(e)&&(t[e]=this.list[e]);return t},query:function(t){var e={};for(var i in this.list)this.list.hasOwnProperty(i)&&i.match(t)&&(e[i]=this.list[i]);return e},set:function(t,e){if(this._frozen)return this;if("string"==typeof t)return this.setValue(t,e);for(var i in t)this.setValue(i,t[i]);return this},setValue:function(i,t){if(this._frozen)return this;if(this.has(i))this.values[i]=t;else{var n=this,s=this.list,r=this.events,o=this.parent;Object.defineProperty(this.values,i,{enumerable:!0,configurable:!0,get:function(){return s[i]},set:function(t){if(!n._frozen){var e=s[i];s[i]=t,r.emit("changedata",o,i,t,e),r.emit("changedata_"+i,o,t,e)}}}),s[i]=t,r.emit("setdata",o,i,t)}return this},each:function(t,e){for(var i=[this.parent,null,void 0],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var s in this.list)i[1]=s,i[2]=this.list[s],t.apply(e,i);return this},merge:function(t,e){for(var i in void 0===e&&(e=!0),t)t.hasOwnProperty(i)&&(e||!e&&!this.has(i))&&this.setValue(i,t[i]);return this},remove:function(t){if(this._frozen)return this;if(!Array.isArray(t))return this.removeValue(t);for(var e=0;e<t.length;e++)this.removeValue(t[e]);return this},removeValue:function(t){if(this.has(t)){var e=this.list[t];delete this.list[t],delete this.values[t],this.events.emit("removedata",this.parent,t,e)}return this},pop:function(t){var e=void 0;return!this._frozen&&this.has(t)&&(e=this.list[t],delete this.list[t],delete this.values[t],this.events.emit("removedata",this,t,e)),e},has:function(t){return this.list.hasOwnProperty(t)},setFreeze:function(t){return this._frozen=t,this},reset:function(){for(var t in this.list)delete this.list[t],delete this.values[t];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off("changedata"),this.events.off("setdata"),this.events.off("removedata"),this.parent=null},freeze:{get:function(){return this._frozen},set:function(t){this._frozen=!!t}},count:{get:function(){var t=0;for(var e in this.list)void 0!==this.list[e]&&t++;return t}}});t.exports=n},function(t,e){t.exports=function(t){return 2*(t.width+t.height)}},function(t,e,i){var r=i(66),n=i(71),s=i(40),o=i(0),a=i(14),h=i(19),l=i(9),u=i(39),c=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.ScaleMode,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,n,s){void 0===n&&(n=1),void 0===s&&(s=n),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=n,this.height=s,this.blendMode=r.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){return void 0===i&&(i=!0),this.width=t,this.height=e,i&&this.input&&this.input.hitArea instanceof l&&(this.input.hitArea.width=t,this.input.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new n(0,0,t),s)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return void 0===t?this.setRectangleDropZone(this.width,this.height):this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},renderCanvas:function(){},renderWebGL:function(){}});t.exports=c},function(t,e,i){var p={};t.exports=p;var A=i(76),C=i(33),M=i(67),P=i(80),E=i(81),k=i(1069);p.rectangle=function(t,e,i,n,s){s=s||{};var r={label:"Rectangle Body",position:{x:t,y:e},vertices:A.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(s.chamfer){var o=s.chamfer;r.vertices=A.chamfer(r.vertices,o.radius,o.quality,o.qualityMin,o.qualityMax),delete s.chamfer}return M.create(C.extend({},r,s))},p.trapezoid=function(t,e,i,n,s,r){r=r||{};var o,a=i*(s*=.5),h=a+(1-2*s)*i,l=h+a;o=s<.5?"L 0 0 L "+a+" "+-n+" L "+h+" "+-n+" L "+l+" 0":"L 0 0 L "+h+" "+-n+" L "+l+" 0";var u={label:"Trapezoid Body",position:{x:t,y:e},vertices:A.fromPath(o)};if(r.chamfer){var c=r.chamfer;u.vertices=A.chamfer(u.vertices,c.radius,c.quality,c.qualityMin,c.qualityMax),delete r.chamfer}return M.create(C.extend({},u,r))},p.circle=function(t,e,i,n,s){n=n||{};var r={label:"Circle Body",circleRadius:i};s=s||25;var o=Math.ceil(Math.max(10,Math.min(s,i)));return o%2==1&&(o+=1),p.polygon(t,e,o,i,C.extend({},r,n))},p.polygon=function(t,e,i,n,s){if(s=s||{},i<3)return p.circle(t,e,n,s);for(var r=2*Math.PI/i,o="",a=.5*r,h=0;h<i;h+=1){var l=a+h*r,u=Math.cos(l)*n,c=Math.sin(l)*n;o+="L "+u.toFixed(3)+" "+c.toFixed(3)+" "}var d={label:"Polygon Body",position:{x:t,y:e},vertices:A.fromPath(o)};if(s.chamfer){var f=s.chamfer;d.vertices=A.chamfer(d.vertices,f.radius,f.quality,f.qualityMin,f.qualityMax),delete s.chamfer}return M.create(C.extend({},d,s))},p.fromVertices=function(t,e,i,n,s,r,o){var a,h,l,u,c,d,f,p,g;for(n=n||{},h=[],s=void 0!==s&&s,r=void 0!==r?r:.01,o=void 0!==o?o:10,k||C.warn("Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull."),C.isArray(i[0])||(i=[i]),p=0;p<i.length;p+=1)if(u=i[p],(l=A.isConvex(u))||!k)u=l?A.clockwiseSort(u):A.hull(u),h.push({position:{x:t,y:e},vertices:u});else{var v=u.map(function(t){return[t.x,t.y]});k.makeCCW(v),!1!==r&&k.removeCollinearPoints(v,r);var y=k.quickDecomp(v);for(c=0;c<y.length;c++){var m=y[c].map(function(t){return{x:t[0],y:t[1]}});0<o&&A.area(m)<o||h.push({position:A.centre(m),vertices:m})}}for(c=0;c<h.length;c++)h[c]=M.create(C.extend(h[c],n));if(s)for(c=0;c<h.length;c++){var x=h[c];for(d=c+1;d<h.length;d++){var w=h[d];if(P.overlaps(x.bounds,w.bounds)){var b=x.vertices,T=w.vertices;for(f=0;f<x.vertices.length;f++)for(g=0;g<w.vertices.length;g++){var S=E.magnitudeSquared(E.sub(b[(f+1)%b.length],T[g])),_=E.magnitudeSquared(E.sub(b[f],T[(g+1)%T.length]));S<5&&_<5&&(b[f].isInternal=!0,T[g].isInternal=!0)}}}}return 1<h.length?(a=M.create(C.extend({parts:h.slice(0)},n)),M.setPosition(a,{x:t,y:e}),a):h[0]}},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d){return{target:t,key:e,getEndValue:i,getStartValue:n,ease:s,duration:0,totalDuration:0,delay:0,yoyo:a,hold:0,repeat:0,repeatDelay:0,flipX:c,flipY:d,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:r,duration:o,hold:h,repeat:l,repeatDelay:u},state:0}}},function(t,e,i){var n=i(0),s=i(13),r=i(5),u=i(83),o=new n({initialize:function(t,e,i){this.parent=t,this.parentIsTimeline=t.hasOwnProperty("isTimeline"),this.data=e,this.totalData=e.length,this.targets=i,this.totalTargets=i.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=u.PENDING_ADD,this._pausedState=u.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onRepeat:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(){return this.data[0].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===u.ACTIVE},isPaused:function(){return this.state===u.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){for(var n=0;n<this.totalData;n++){var s=this.data[n];if(s.key===t){s.end=e,i&&(s.start=s.current);break}}return this},restart:function(){this.state===u.REMOVED?(this.seek(0),this.parent.makeActive(this)):(this.stop(),this.play())},calcDuration:function(){for(var t=0,e=this.data,i=0;i<this.totalData;i++){var n=e[i];n.t1=n.duration+n.hold,n.yoyo&&(n.t1+=n.duration),n.t2=n.t1+n.repeatDelay,n.totalDuration=n.delay+n.t1,-1===n.repeat?n.totalDuration+=999999999999*n.t2:0<n.repeat&&(n.totalDuration+=n.t2*n.repeat),n.totalDuration>t&&(t=n.totalDuration)}this.duration=t,this.loopCounter=-1===this.loop?999999999999:this.loop,0<this.loopCounter?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){for(var t=this.data,e=this.totalTargets,i=0;i<this.totalData;i++){var n=t[i],s=n.target,r=n.gen;n.delay=r.delay(i,e,s),n.duration=r.duration(i,e,s),n.hold=r.hold(i,e,s),n.repeat=r.repeat(i,e,s),n.repeatDelay=r.repeatDelay(i,e,s)}return this.calcDuration(),this.progress=0,this.totalProgress=0,this.elapsed=0,this.totalElapsed=0,this.paused&&!this.parentIsTimeline?(this.state=u.PENDING_ADD,this._pausedState=u.INIT,!1):(this.state=u.INIT,!0)},nextState:function(){if(0<this.loopCounter){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&(t.params[1]=this.targets,t.func.apply(t.scope,t.params)),this.resetTweenData(!0),0<this.loopDelay?(this.countdown=this.loopDelay,this.state=u.LOOP_DELAY):this.state=u.ACTIVE}else if(0<this.completeDelay)this.countdown=this.completeDelay,this.state=u.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=u.PENDING_REMOVE}},pause:function(){if(this.state!==u.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=u.PAUSED,this},play:function(t){if(this.state!==u.ACTIVE){this.state!==u.PENDING_REMOVE&&this.state!==u.REMOVED||(this.init(),this.parent.makeActive(this),t=!0);var e=this.callbacks.onStart;this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?(e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=u.ACTIVE):(this.countdown=this.calculatedOffset,this.state=u.OFFSET_DELAY)):(this.paused?this.paused=!1:(this.resetTweenData(t),this.state=u.ACTIVE,e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params))),this.parent.makeActive(this))}},resetTweenData:function(t){for(var e=this.data,i=0;i<this.totalData;i++){var n=e[i];n.progress=0,n.elapsed=0,n.repeatCounter=-1===n.repeat?999999999999:n.repeat,t?(n.start=n.getStartValue(n.target,n.key,n.start),n.end=n.getEndValue(n.target,n.key,n.end),n.current=n.start,n.state=u.PLAYING_FORWARD):0<n.delay?(n.elapsed=n.delay,n.state=u.DELAY):n.state=u.PENDING_RENDER}},resume:function(){return this.state===u.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t){for(var e=this.data,i=0;i<this.totalData;i++){var n=this.totalDuration*t,s=e[i],r=0,o=0;n<=s.delay?o=r=0:n>=s.totalDuration?(r=1,o=s.duration):n>s.delay&&n<=s.t1?(r=(n=Math.max(0,n-s.delay))/s.t1,o=s.duration*r):n>s.t1&&n<s.totalDuration&&(n-=s.delay,(n=(n-=s.t1)/s.t2%1*s.t2)>s.repeatDelay&&(r=n/s.t1,o=s.duration*r)),s.progress=r,s.elapsed=o;var a=s.ease(s.progress);s.current=s.start+(s.end-s.start)*a,s.target[s.key]=s.current}},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){if(void 0===t&&(t=0),t)this.countdown=t,this.state=u.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)),this.state=u.PENDING_REMOVE}},stop:function(t){this.state===u.ACTIVE&&void 0!==t&&this.seek(t),this.state!==u.REMOVED&&(this.state!==u.PAUSED&&this.state!==u.PENDING_ADD||(this.parent._destroy.push(this),this.parent._toProcess++),this.state=u.PENDING_REMOVE)},update:function(t,e){if(this.state===u.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case u.ACTIVE:for(var i=!1,n=0;n<this.totalData;n++)this.updateTweenData(this,this.data[n],e)&&(i=!0);i||this.nextState();break;case u.LOOP_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=u.ACTIVE);break;case u.OFFSET_DELAY:if(this.countdown-=e,this.countdown<=0){var s=this.callbacks.onStart;s&&(s.params[1]=this.targets,s.func.apply(s.scope,s.params)),this.state=u.ACTIVE}break;case u.COMPLETE_DELAY:if(this.countdown-=e,this.countdown<=0){var r=this.callbacks.onComplete;r&&r.func.apply(r.scope,r.params),this.state=u.PENDING_REMOVE}}return this.state===u.PENDING_REMOVE},setStateFromEnd:function(t,e,i){if(e.yoyo){e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onYoyo;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.start=e.getStartValue(e.target,e.key,e.start),u.PLAYING_BACKWARD}if(0<e.repeatCounter){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var s=t.callbacks.onRepeat;return s&&(s.params[1]=e.target,s.func.apply(s.scope,s.params)),e.start=e.getStartValue(e.target,e.key,e.start),e.end=e.getEndValue(e.target,e.key,e.start),0<e.repeatDelay?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,u.REPEAT_DELAY):u.PLAYING_FORWARD}return u.COMPLETE},setStateFromStart:function(t,e,i){if(0<e.repeatCounter){e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY();var n=t.callbacks.onRepeat;return n&&(n.params[1]=e.target,n.func.apply(n.scope,n.params)),e.end=e.getEndValue(e.target,e.key,e.start),0<e.repeatDelay?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,u.REPEAT_DELAY):u.PLAYING_FORWARD}return u.COMPLETE},updateTweenData:function(t,e,i){switch(e.state){case u.PLAYING_FORWARD:case u.PLAYING_BACKWARD:if(!e.target){e.state=u.COMPLETE;break}var n=e.elapsed,s=e.duration,r=0;(n+=i)>s&&(r=n-s,n=s);var o,a=e.state===u.PLAYING_FORWARD,h=n/s;o=a?e.ease(h):e.ease(1-h),e.current=e.start+(e.end-e.start)*o,e.target[e.key]=e.current,e.elapsed=n,e.progress=h;var l=t.callbacks.onUpdate;l&&(l.params[1]=e.target,l.func.apply(l.scope,l.params)),1===h&&(a?0<e.hold?(e.elapsed=e.hold-r,e.state=u.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,r):e.state=this.setStateFromStart(t,e,r));break;case u.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=u.PENDING_RENDER);break;case u.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=u.PLAYING_FORWARD);break;case u.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case u.PENDING_RENDER:e.target?(e.start=e.getStartValue(e.target,e.key,e.target[e.key]),e.end=e.getEndValue(e.target,e.key,e.start),e.current=e.start,e.target[e.key]=e.start,e.state=u.PLAYING_FORWARD):e.state=u.COMPLETE}return e.state!==u.COMPLETE}});o.TYPES=["onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],r.register("tween",function(t){return this.scene.sys.tweens.add(t)}),s.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=o},function(t,e){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},function(t,e){function l(t){return!!t.getStart&&"function"==typeof t.getStart}function u(t){return!!t.getEnd&&"function"==typeof t.getEnd}var c=function(t,e){var i,n,s=function(t,e,i){return i},r=function(t,e,i){return i},o=typeof e;if("number"===o)s=function(){return e};else if("string"===o){var a=e[0],h=parseFloat(e.substr(2));switch(a){case"+":s=function(t,e,i){return i+h};break;case"-":s=function(t,e,i){return i-h};break;case"*":s=function(t,e,i){return i*h};break;case"/":s=function(t,e,i){return i/h};break;default:s=function(){return parseFloat(e)}}}else"function"===o?s=e:"object"===o&&(l(n=e)||u(n))?(u(e)&&(s=e.getEnd),l(e)&&(r=e.getStart)):e.hasOwnProperty("value")&&(i=c(t,e.value));return i||(i={getEnd:s,getStart:r}),i};t.exports=c},function(t,e,i){var n=i(4);t.exports=function(t){var e=n(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},function(t,e,i){var u=i(29),c=i(77),d=i(217),f=i(209);t.exports=function(t,e,i,n,s,r,o,a){void 0===i&&(i=32),void 0===n&&(n=32),void 0===s&&(s=10),void 0===r&&(r=10),void 0===a&&(a=!1);var h=null;if(Array.isArray(o))h=d(void 0!==e?e:"map",u.ARRAY_2D,o,i,n,a);else if(void 0!==e){var l=t.cache.tilemap.get(e);l?h=d(e,l.format,l.data,i,n,a):console.warn("No map data found for key "+e)}return null===h&&(h=new c({tileWidth:i,tileHeight:n,width:s,height:r})),new f(t,h)}},function(t,e,i){var p=i(29),g=i(78),v=i(77),y=i(55);t.exports=function(t,e,i,n,s){for(var r=new g({tileWidth:i,tileHeight:n}),o=new v({name:t,tileWidth:i,tileHeight:n,format:p.ARRAY_2D,layers:[r]}),a=[],h=e.length,l=0,u=0;u<e.length;u++){a[u]=[];for(var c=e[u],d=0;d<c.length;d++){var f=parseInt(c[d],10);isNaN(f)||-1===f?a[u][d]=s?null:new y(r,-1,d,u,i,n):a[u][d]=new y(r,f,d,u,i,n)}0===l&&(l=c.length)}return o.width=r.width=l,o.height=r.height=h,o.widthInPixels=r.widthInPixels=l*i,o.heightInPixels=r.heightInPixels=h*n,r.data=a,o}},function(t,e){t.exports=function(t,e,i){var n=i.collideIndexes.indexOf(t);e&&-1===n?i.collideIndexes.push(t):e||-1===n||i.collideIndexes.splice(n,1)}},function(t,e,i){var u=i(55),c=i(79),d=i(136),f=i(56);t.exports=function(t,e,i,n,s){if(!c(e,i,s))return null;void 0===n&&(n=!0);var r=s.data[i][e],o=r&&r.collides;if(t instanceof u)null===s.data[i][e]&&(s.data[i][e]=new u(s,t.index,e,i,t.width,t.height)),s.data[i][e].copy(t);else{var a=t;null===s.data[i][e]?s.data[i][e]=new u(s,a,e,i,s.tileWidth,s.tileHeight):s.data[i][e].index=a}var h=s.data[i][e],l=-1!==s.collideIndexes.indexOf(h.index);return f(h,l),n&&o!==h.collides&&d(e,i,s),h}},function(t,e,i){var l=i(102);t.exports=function(t,e,i){var n=l(t,e,!0,i),s=l(t,e-1,!0,i),r=l(t,e+1,!0,i),o=l(t-1,e,!0,i),a=l(t+1,e,!0,i),h=n&&n.collides;return h&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),s&&s.collides&&(h&&(n.faceTop=!1),s.faceBottom=!h),r&&r.collides&&(h&&(n.faceBottom=!1),r.faceTop=!h),o&&o.collides&&(h&&(n.faceLeft=!1),o.faceRight=!h),a&&a.collides&&(h&&(n.faceRight=!1),a.faceLeft=!h),n&&!n.collides&&n.resetFaces(),n}},function(t,e,i){var c={};t.exports=c;var o=i(195),r=i(33),a=i(80),d=i(67);c.create=function(t){return r.extend({id:r.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{}},t)},c.setModified=function(t,e,i,n){if(t.isModified=e,i&&t.parent&&c.setModified(t.parent,e,i,n),n)for(var s=0;s<t.composites.length;s++){var r=t.composites[s];c.setModified(r,e,i,n)}},c.add=function(t,e){var i=[].concat(e);o.trigger(t,"beforeAdd",{object:e});for(var n=0;n<i.length;n++){var s=i[n];switch(s.type){case"body":if(s.parent!==s){r.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}c.addBody(t,s);break;case"constraint":c.addConstraint(t,s);break;case"composite":c.addComposite(t,s);break;case"mouseConstraint":c.addConstraint(t,s.constraint)}}return o.trigger(t,"afterAdd",{object:e}),t},c.remove=function(t,e,i){var n=[].concat(e);o.trigger(t,"beforeRemove",{object:e});for(var s=0;s<n.length;s++){var r=n[s];switch(r.type){case"body":c.removeBody(t,r,i);break;case"constraint":c.removeConstraint(t,r,i);break;case"composite":c.removeComposite(t,r,i);break;case"mouseConstraint":c.removeConstraint(t,r.constraint)}}return o.trigger(t,"afterRemove",{object:e}),t},c.addComposite=function(t,e){return t.composites.push(e),e.parent=t,c.setModified(t,!0,!0,!1),t},c.removeComposite=function(t,e,i){var n=t.composites.indexOf(e);if(-1!==n&&(c.removeCompositeAt(t,n),c.setModified(t,!0,!0,!1)),i)for(var s=0;s<t.composites.length;s++)c.removeComposite(t.composites[s],e,!0);return t},c.removeCompositeAt=function(t,e){return t.composites.splice(e,1),c.setModified(t,!0,!0,!1),t},c.addBody=function(t,e){return t.bodies.push(e),c.setModified(t,!0,!0,!1),t},c.removeBody=function(t,e,i){var n=t.bodies.indexOf(e);if(-1!==n&&(c.removeBodyAt(t,n),c.setModified(t,!0,!0,!1)),i)for(var s=0;s<t.composites.length;s++)c.removeBody(t.composites[s],e,!0);return t},c.removeBodyAt=function(t,e){return t.bodies.splice(e,1),c.setModified(t,!0,!0,!1),t},c.addConstraint=function(t,e){return t.constraints.push(e),c.setModified(t,!0,!0,!1),t},c.removeConstraint=function(t,e,i){var n=t.constraints.indexOf(e);if(-1!==n&&c.removeConstraintAt(t,n),i)for(var s=0;s<t.composites.length;s++)c.removeConstraint(t.composites[s],e,!0);return t},c.removeConstraintAt=function(t,e){return t.constraints.splice(e,1),c.setModified(t,!0,!0,!1),t},c.clear=function(t,e,i){if(i)for(var n=0;n<t.composites.length;n++)c.clear(t.composites[n],e,!0);return e?t.bodies=t.bodies.filter(function(t){return t.isStatic}):t.bodies.length=0,t.constraints.length=0,t.composites.length=0,c.setModified(t,!0,!0,!1),t},c.allBodies=function(t){for(var e=[].concat(t.bodies),i=0;i<t.composites.length;i++)e=e.concat(c.allBodies(t.composites[i]));return e},c.allConstraints=function(t){for(var e=[].concat(t.constraints),i=0;i<t.composites.length;i++)e=e.concat(c.allConstraints(t.composites[i]));return e},c.allComposites=function(t){for(var e=[].concat(t.composites),i=0;i<t.composites.length;i++)e=e.concat(c.allComposites(t.composites[i]));return e},c.get=function(t,e,i){var n,s;switch(i){case"body":n=c.allBodies(t);break;case"constraint":n=c.allConstraints(t);break;case"composite":n=c.allComposites(t).concat(t)}return n?0===(s=n.filter(function(t){return t.id.toString()===e.toString()})).length?null:s[0]:null},c.move=function(t,e,i){return c.remove(t,e),c.add(i,e),t},c.rebase=function(t){for(var e=c.allBodies(t).concat(c.allConstraints(t)).concat(c.allComposites(t)),i=0;i<e.length;i++)e[i].id=r.nextId();return c.setModified(t,!0,!0,!1),t},c.translate=function(t,e,i){for(var n=i?c.allBodies(t):t.bodies,s=0;s<n.length;s++)d.translate(n[s],e);return c.setModified(t,!0,!0,!1),t},c.rotate=function(t,e,i,n){for(var s=Math.cos(e),r=Math.sin(e),o=n?c.allBodies(t):t.bodies,a=0;a<o.length;a++){var h=o[a],l=h.position.x-i.x,u=h.position.y-i.y;d.setPosition(h,{x:i.x+(l*s-u*r),y:i.y+(l*r+u*s)}),d.rotate(h,e)}return c.setModified(t,!0,!0,!1),t},c.scale=function(t,e,i,n,s){for(var r=s?c.allBodies(t):t.bodies,o=0;o<r.length;o++){var a=r[o],h=a.position.x-n.x,l=a.position.y-n.y;d.setPosition(a,{x:n.x+h*e,y:n.y+l*i}),d.scale(a,e,i)}return c.setModified(t,!0,!0,!1),t},c.bounds=function(t){for(var e=c.allBodies(t),i=[],n=0;n<e.length;n+=1){var s=e[n];i.push(s.bounds.min,s.bounds.max)}return a.create(i)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,this.z="object"==typeof t?(this.x=t.x||0,this.y=t.y||0,t.z||0):(this.x=t||0,this.y=e||0,i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},clone:function(){return new n(this.x,this.y,this.z)},crossVectors:function(t,e){var i=t.x,n=t.y,s=t.z,r=e.x,o=e.y,a=e.z;return this.x=n*a-s*o,this.y=s*r-i*a,this.z=i*o-n*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return this.z="object"==typeof t?(this.x=t.x||0,this.y=t.y||0,t.z||0):(this.x=t||0,this.y=e||0,i||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return 0<n&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,this.z=e*r-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+n*s[6],this.y=e*s[1]+i*s[4]+n*s[7],this.z=e*s[2]+i*s[5]+n*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12],this.y=s[1]*e+s[5]*i+s[9]*n+s[13],this.z=s[2]*e+s[6]*i+s[10]*n+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=e*s[0]+i*s[4]+n*s[8]+s[12],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=e*s[2]+i*s[6]+n*s[10]+s[14],h=e*s[3]+i*s[7]+n*s[11]+s[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],y=s[12],m=s[13],x=s[14],w=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+y)*w,this.y=(e*o+i*u+n*p+m)*w,this.z=(e*a+i*c+n*g+x)*w,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});t.exports=n},function(t,e,i){var n=i(0),s=i(18),a=i(21),r=i(7),h=i(2),l=i(8),o=i(343),u=new n({Extends:a,initialize:function(t,e,i,n){var s="xml";if(l(e)){var r=e;e=h(r,"key"),i=h(r,"url"),n=h(r,"xhrSettings"),s=h(r,"extension",s)}var o={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};a.call(this,t,o)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=o(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});r.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new u(this,t[n]));else this.addFile(new u(this,t,e,i));return this}),t.exports=u},function(t,e,i){var s=i(20),r=i(105);t.exports=function(t,e){var i=void 0===t?r():s({},t);if(e)for(var n in e)void 0!==e[n]&&(i[n]=e[n]);return i}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,o=t.x3-e,a=t.y3-i,t.x3=o*s-a*r+e,t.y3=o*r+a*s+i,t}},function(t,e){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var s,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,v=d*d+f*f,y=p*v-g*g,m=0===y?0:1/y,x=t.x1,w=t.y1,b=0;b<e.length&&(r=(p*(l=d*(o=e[b].x-x)+f*(a=e[b].y-w))-g*(h=u*o+c*a))*m,!(0<=(s=(v*h-g*l)*m)&&0<=r&&s+r<1&&(n.push({x:e[b].x,y:e[b].y}),i)));b++);return n}},function(t,e){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.right<e.x||t.bottom<e.y||t.x>e.right||t.y>e.bottom)}},function(t,e,i){var n=i(0),r=i(108),s=new n({Extends:r,initialize:function(t,e,i,n,s){r.call(this,t,e,i,[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,1,0,0,1,1,1,0],[16777215,16777215,16777215,16777215,16777215,16777215],[1,1,1,1,1,1],n,s),this.resetPosition()},setFrame:function(t){return this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,t=this.frame,this.uv[0]=t.u0,this.uv[1]=t.v0,this.uv[2]=t.u0,this.uv[3]=t.v1,this.uv[4]=t.u1,this.uv[5]=t.v1,this.uv[6]=t.u0,this.uv[7]=t.v0,this.uv[8]=t.u1,this.uv[9]=t.v1,this.uv[10]=t.u1,this.uv[11]=t.v0,this},topLeftX:{get:function(){return this.x+this.vertices[0]},set:function(t){this.vertices[0]=t-this.x,this.vertices[6]=t-this.x}},topLeftY:{get:function(){return this.y+this.vertices[1]},set:function(t){this.vertices[1]=t-this.y,this.vertices[7]=t-this.y}},topRightX:{get:function(){return this.x+this.vertices[10]},set:function(t){this.vertices[10]=t-this.x}},topRightY:{get:function(){return this.y+this.vertices[11]},set:function(t){this.vertices[11]=t-this.y}},bottomLeftX:{get:function(){return this.x+this.vertices[2]},set:function(t){this.vertices[2]=t-this.x}},bottomLeftY:{get:function(){return this.y+this.vertices[3]},set:function(t){this.vertices[3]=t-this.y}},bottomRightX:{get:function(){return this.x+this.vertices[4]},set:function(t){this.vertices[4]=t-this.x,this.vertices[8]=t-this.x}},bottomRightY:{get:function(){return this.y+this.vertices[5]},set:function(t){this.vertices[5]=t-this.y,this.vertices[9]=t-this.y}},topLeftAlpha:{get:function(){return this.alphas[0]},set:function(t){this.alphas[0]=t,this.alphas[3]=t}},topRightAlpha:{get:function(){return this.alphas[5]},set:function(t){this.alphas[5]=t}},bottomLeftAlpha:{get:function(){return this.alphas[1]},set:function(t){this.alphas[1]=t}},bottomRightAlpha:{get:function(){return this.alphas[2]},set:function(t){this.alphas[2]=t,this.alphas[4]=t}},topLeftColor:{get:function(){return this.colors[0]},set:function(t){this.colors[0]=t,this.colors[3]=t}},topRightColor:{get:function(){return this.colors[5]},set:function(t){this.colors[5]=t}},bottomLeftColor:{get:function(){return this.colors[1]},set:function(t){this.colors[1]=t}},bottomRightColor:{get:function(){return this.colors[2]},set:function(t){this.colors[2]=t,this.colors[4]=t}},setTopLeft:function(t,e){return this.topLeftX=t,this.topLeftY=e,this},setTopRight:function(t,e){return this.topRightX=t,this.topRightY=e,this},setBottomLeft:function(t,e){return this.bottomLeftX=t,this.bottomLeftY=e,this},setBottomRight:function(t,e){return this.bottomRightX=t,this.bottomRightY=e,this},resetPosition:function(){var t=this.x,e=this.y,i=Math.floor(this.width/2),n=Math.floor(this.height/2);return this.setTopLeft(t-i,e-n),this.setTopRight(t+i,e-n),this.setBottomLeft(t-i,e+n),this.setBottomRight(t+i,e+n),this},resetAlpha:function(){var t=this.alphas;return t[0]=1,t[1]=1,t[2]=1,t[3]=1,t[4]=1,t[5]=1,this},resetColors:function(){var t=this.colors;return t[0]=16777215,t[1]=16777215,t[2]=16777215,t[3]=16777215,t[4]=16777215,t[5]=16777215,this},reset:function(){return this.resetPosition(),this.resetAlpha(),this.resetColors()}});t.exports=s},function(t,e){t.exports=function(t,e,i){for(var n=!1,s=-1,r=t.points.length-1;++s<t.points.length;r=s){var o=t.points[s].x,a=t.points[s].y,h=t.points[r].x,l=t.points[r].y;(a<=i&&i<l||l<=i&&i<a)&&e<(h-o)*(i-a)/(l-a)+o&&(n=!n)}return n}},function(t,e,i){var n=i(0),s=i(150),r=i(284),o=new n({initialize:function(t){this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return s(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,n=0;n<t.length;n++)e={x:0,y:0},"number"==typeof t[n]||"string"==typeof t[n]?(e.x=parseFloat(t[n]),e.y=parseFloat(t[n+1]),n++):Array.isArray(t[n])?(e.x=t[n][0],e.y=t[n][1]):(e.x=t[n].x,e.y=t[n].y),this.points.push(e),e.y<i&&(i=e.y);return this.calculateArea(i),this},calculateArea:function(){if(this.points.length<3)return this.area=0,this.area;for(var t,e,i=0,n=0;n<this.points.length-1;n++)t=this.points[n],i+=((e=this.points[n+1]).x-t.x)*(t.y+e.y);return t=this.points[0],e=this.points[this.points.length-1],i+=(t.x-e.x)*(e.y+t.y),this.area=.5*-i,this.area},getPoints:function(t,e,i){return r(this,t,e,i)}});t.exports=o},function(t,e,i){var u=i(24),n=i(0),s=i(14),c=i(26),d=i(19),f=i(294),o=i(120),r=i(805),p=i(3),a=new n({Extends:d,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Crop,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Tint,s.Transform,s.Visible,r],initialize:function(t,e,i,n,s,r,o){var a=t.sys.game.renderer;d.call(this,t,"TileSprite");var h=t.sys.textures.get(r),l=h.get(o);s=n&&s?(n=Math.floor(n),Math.floor(s)):(n=l.width,l.height),this._tilePosition=new p,this._tileScale=new p(1,1),this.dirty=!1,this.renderer=a,this.canvas=u.create(this,n,s),this.context=this.canvas.getContext("2d"),this.displayTexture=h,this.displayFrame=l,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=f(l.width),this.potHeight=f(l.height),this.fillCanvas=u.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(n,s),this.setFrame(o),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.config.renderType===c.WEBGL&&t.sys.game.renderer.onContextRestored(function(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)},this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){return this.displayFrame=this.displayTexture.get(t),this.displayFrame.cutWidth&&this.displayFrame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0!==t&&(this.tileScaleX=t),void 0!==e&&(this.tileScaleY=e),this},updateTileTexture:function(){if(this.dirty){var t=this.displayFrame,e=this.fillContext,i=this.fillCanvas,n=this.potWidth,s=this.potHeight;this.renderer.gl||(n=t.cutWidth,s=t.cutHeight),e.clearRect(0,0,n,s),i.width=n,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,n,s),this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height)),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||o.disable(e);var i=this._tileScale.x,n=this._tileScale.y,s=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,n),e.translate(-s,-r),e.fillStyle=this.fillPattern,e.fillRect(s,r,this.width/i,this.height/n),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),u.remove(this.canvas),u.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=a},function(t,e,i){var n=i(169),r=i(24),s=i(0),o=i(14),a=i(26),h=i(19),p=i(811),l=i(4),u=i(342),c=i(810),d=i(807),f=new s({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScaleMode,o.ScrollFactor,o.Tint,o.Transform,o.Visible,c],initialize:function(t,e,i,n,s){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.renderer=t.sys.game.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.canvas=r.create(this),this.context=this.canvas.getContext("2d"),this.style=new d(this,s),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text="",this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=t.sys.game.config.resolution),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),s&&s.padding&&this.setPadding(s.padding),s&&s.lineSpacing&&(this.lineSpacing=s.lineSpacing),this.setText(n),t.sys.game.config.renderType===a.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.dirty=!0},this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",n(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var n="",s=t.replace(/ +/gi," ").split(this.splitRegExp),r=s.length,o=0;o<r;o++){var a=s[o],h="";if(a=a.replace(/^ *|\s*$/gi,""),e.measureText(a).width<i)n+=a+"\n";else{for(var l=i,u=a.split(" "),c=0;c<u.length;c++){var d=u[c],f=d+" ",p=e.measureText(f).width;if(l<p){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var y=u[c].length?c:c+1,m=u.slice(y).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=m+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;r<s.length;r++){for(var o=i,a=s[r].split(" "),h=0;h<a.length;h++){var l=e.measureText(a[h]).width,u=l+e.measureText(" ").width;o<u?(0<h&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=u,n+=a[h],h<a.length-1&&(n+=" "))}r<s.length-1&&(n+="\n")}return n},getWrappedText:function(t){return void 0===t&&(t=this._text),this.style.syncFont(this.canvas,this.context),this.runWordWrap(t).split(this.splitRegExp)},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this._text&&(this._text=t.toString(),this.updateText()),this},setStyle:function(t){return this.style.setStyle(t)},setFont:function(t){return this.style.setFont(t)},setFontFamily:function(t){return this.style.setFontFamily(t)},setFontSize:function(t){return this.style.setFontSize(t)},setFontStyle:function(t){return this.style.setFontStyle(t)},setFixedSize:function(t,e){return this.style.setFixedSize(t,e)},setBackgroundColor:function(t){return this.style.setBackgroundColor(t)},setFill:function(t){return this.style.setFill(t)},setColor:function(t){return this.style.setColor(t)},setStroke:function(t,e){return this.style.setStroke(t,e)},setShadow:function(t,e,i,n,s,r){return this.style.setShadow(t,e,i,n,s,r)},setShadowOffset:function(t,e){return this.style.setShadowOffset(t,e)},setShadowColor:function(t){return this.style.setShadowColor(t)},setShadowBlur:function(t){return this.style.setShadowBlur(t)},setShadowStroke:function(t){return this.style.setShadowStroke(t)},setShadowFill:function(t){return this.style.setShadowFill(t)},setWordWrapWidth:function(t,e){return this.style.setWordWrapWidth(t,e)},setWordWrapCallback:function(t,e){return this.style.setWordWrapCallback(t,e)},setAlign:function(t){return this.style.setAlign(t)},setResolution:function(t){return this.style.setResolution(t)},setLineSpacing:function(t){return this.lineSpacing=t,this.updateText()},setPadding:function(t,e,i,n){if("object"==typeof t){var s=t,r=l(s,"x",null);i=null!==r?t=r:(t=l(s,"left",0),l(s,"right",t));var o=l(s,"y",null);n=null!==o?e=o:(e=l(s,"top",0),l(s,"bottom",e))}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=e);return this.padding.left=t,this.padding.top=e,this.padding.right=i,this.padding.bottom=n,this.updateText()},setMaxLines:function(t){return this.style.setMaxLines(t)},updateText:function(){var t=this.canvas,e=this.context,i=this.style,n=i.resolution,s=i.metrics;i.syncFont(t,e);var r=this._text;(i.wordWrapWidth||i.wordWrapCallback)&&(r=this.runWordWrap(this._text));var o,a,h=r.split(this.splitRegExp),l=p(this,s,h),u=this.padding,c=l.width+u.left+u.right,d=l.height+u.top+u.bottom;0===i.fixedWidth&&(this.width=c),0===i.fixedHeight&&(this.height=d),this.updateDisplayOrigin(),c*=n,d*=n,c=Math.max(c,1),d=Math.max(d,1),t.width!==c||t.height!==d?(t.width=c,t.height=d,this.frame.setSize(c,d),i.syncFont(t,e)):e.clearRect(0,0,c,d),e.save(),e.scale(n,n),i.backgroundColor&&(e.fillStyle=i.backgroundColor,e.fillRect(0,0,c,d)),i.syncStyle(t,e),e.textBaseline="alphabetic",e.translate(u.left,u.top);for(var f=0;f<l.lines;f++)o=i.strokeThickness/2,a=i.strokeThickness/2+f*l.lineHeight+s.ascent,0<f&&(a+=l.lineSpacing*f),i.rtl?o=c-o:"right"===i.align?o+=l.width-l.lineWidths[f]:"center"===i.align&&(o+=(l.width-l.lineWidths[f])/2),this.autoRound&&(o=Math.round(o),a=Math.round(a)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(h[f],o,a)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(h[f],o,a));return e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0,this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&u(this.canvas),r.remove(this.canvas),this.texture.destroy()}});t.exports=f},function(t,e,i){var a=i(121),h=i(24),n=i(0),s=i(14),l=i(26),u=i(113),c=i(19),r=i(817),d=i(295),o=new n({Extends:c,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Crop,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScaleMode,s.ScrollFactor,s.Tint,s.Transform,s.Visible,r],initialize:function(t,e,i,n,s){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=32),void 0===s&&(s=32),c.call(this,t,"RenderTexture"),this.renderer=t.sys.game.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=h.create2D(this,n,s),this.context=this.canvas.getContext("2d"),this.framebuffer=null,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(d(),this.canvas),this.frame=this.texture.get(),this._saved=!1,this.camera=new a(0,0,n,s),this.dirty=!1,this.gl=null;var r=this.renderer;if(r.type===l.WEBGL){var o=r.gl;this.gl=o,this.drawGameObject=this.batchGameObjectWebGL,this.framebuffer=r.createFramebuffer(n,s,this.frame.source.glTexture,!1)}else r.type===l.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas);this.camera.setScene(t),this.setPosition(e,i),this.setSize(n,s),this.setOrigin(0,0),this.initPipeline()},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){if(void 0===e&&(e=t),t!==this.width||e!==this.height){if(this.canvas.width=t,this.canvas.height=e,this.gl){var i=this.gl;this.renderer.deleteTexture(this.frame.source.glTexture),this.renderer.deleteFramebuffer(this.framebuffer),this.frame.source.glTexture=this.renderer.createTexture2D(0,i.NEAREST,i.NEAREST,i.CLAMP_TO_EDGE,i.CLAMP_TO_EDGE,i.RGBA,null,t,e,!1),this.framebuffer=this.renderer.createFramebuffer(t,e,this.frame.source.glTexture,!1),this.frame.glTexture=this.frame.source.glTexture}this.frame.source.width=t,this.frame.source.height=e,this.camera.setSize(t,e),this.frame.setSize(t,e),this.width=t,this.height=e}return this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e){void 0===e&&(e=1);var i=255&(t>>16|0),n=255&(t>>8|0),s=255&(0|t);if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var r=this.gl;r.clearColor(i/255,n/255,s/255,e),r.clear(r.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else this.context.fillStyle="rgb("+i+","+n+","+s+")",this.context.fillRect(0,0,this.canvas.width,this.canvas.height);return this},clear:function(){if(this.dirty){if(this.gl){this.renderer.setFramebuffer(this.framebuffer);var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),this.renderer.setFramebuffer(null)}else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,this.canvas.width,this.canvas.height),e.restore()}this.dirty=!1}return this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1,1),r){this.renderer.setFramebuffer(this.framebuffer);var o=this.pipeline;o.projOrtho(0,this.width,0,this.height,-1e3,1e3),this.batchList(t,e,i,n,s),o.flush(),this.renderer.setFramebuffer(null),o.projOrtho(0,o.width,o.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1,1),o){this.renderer.setFramebuffer(this.framebuffer);var h=this.pipeline;h.projOrtho(0,this.width,0,this.height,-1e3,1e3),h.batchTextureFrame(a,i,n,r,s,this.camera.matrix,null),h.flush(),this.renderer.setFramebuffer(null),h.projOrtho(0,h.width,h.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i,n,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;r<t.length;r++){var o=t[r];o&&o!==this&&(o.renderWebGL||o.renderCanvas?this.drawGameObject(o,e,i):o.isParent||o.list?this.batchGroup(o.getChildren(),e,i):"string"==typeof o?this.batchTextureFrameKey(o,null,e,i,n,s):o instanceof u?this.batchTextureFrame(o,e,i,n,s):Array.isArray(o)&&this.batchList(o,e,i,n,s))}},batchGroup:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);for(var n=0;n<t.length;n++){var s=t[n];if(s.willRender()){var r=s.x+e,o=s.y+i;this.drawGameObject(s,r,o)}}},batchGameObjectWebGL:function(t,e,i){void 0===e&&(e=t.x),void 0===i&&(i=t.y);var n=t.x,s=t.y;this.renderer.setBlendMode(t.blendMode),t.setPosition(e,i),t.renderWebGL(this.renderer,t,0,this.camera,null),t.setPosition(n,s)},batchGameObjectCanvas:function(t,e,i){void 0===e&&(e=t.x),void 0===i&&(i=t.y);var n=t.x,s=t.y;t.setPosition(e,i),t.renderCanvas(this.renderer,t,0,this.camera,null),t.setPosition(n,s)},batchTextureFrameKey:function(t,e,i,n,s,r){var o=this.textureManager.getFrame(t,e);o&&this.batchTextureFrame(o,i,n,s,r)},batchTextureFrame:function(t,e,i,n,s){if(void 0===e&&(e=0),void 0===i&&(i=0),this.gl)this.pipeline.batchTextureFrame(t,e,i,s,n,this.camera.matrix,null);else{var r=this.context,o=t.canvasData,a=t.source.image,h=this.camera.matrix;r.globalAlpha=this.globalAlpha,r.setTransform(h[0],h[1],h[2],h[3],h[4],h[5]),r.drawImage(a,o.x,o.y,o.width,o.height,e,i,o.width,o.height)}},preDestroy:function(){this._saved||(h.remove(this.canvas),this.gl&&this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy())}});t.exports=o},function(t,e,i){var n=i(0),s=i(14),r=i(19),o=i(304),a=i(112),h=i(302),l=i(821),u=new n({Extends:r,Mixins:[s.Depth,s.Pipeline,s.Transform,s.Visible,l],initialize:function(t,e,i,n){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(n=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var s=0;s<n.length;s++)this.createEmitter(n[s])}},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){this.frame=this.texture.get(t);var e=[];return this.texture.getFramesFromTextureSource(this.frame.sourceIndex).forEach(function(t){e.push(t.name)}),this.frameNames=e,this.defaultFrame=this.frame,this},setEmitterFrames:function(t,e){Array.isArray(t)||(t=[t]);for(var i=e.frames,n=i.length=0;n<t.length;n++){var s=t[n];-1!==this.frameNames.indexOf(s)&&i.push(this.texture.get(s))}return 0<i.length?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;s<n.length;s++){var r=n[s];r.active&&r.emitParticle(t,e,i)}return this},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},getProcessors:function(){return this.wells.getAll("active",!0)},preUpdate:function(t,e){e*=this.timeScale;for(var i=this.emitters.list,n=0;n<i.length;n++){var s=i[n];s.active&&s.preUpdate(t,e)}},setAlpha:function(){},setScrollFactor:function(){},setBlendMode:function(){}});t.exports=u},function(t,e,i){var r=i(6);t.exports=function(t,e,i){void 0===i&&(i=new r);var n=t.width/2,s=t.height/2;return i.x=t.x+n*Math.cos(e),i.y=t.y+s*Math.sin(e),i}},function(t,e){t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,LINE_FX_TO:12,MOVE_FX_TO:13,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,SET_TEXTURE:19,CLEAR_TEXTURE:20,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},function(t,e,i){var n=i(121),s=i(0),a=i(157),r=i(401),o=i(400),h=i(399),l=i(395),u=i(186),c=i(390),d=i(389),f=i(392),p=i(90),g=i(19),v=i(2),y=i(4),m=i(16),x=i(831),w=new s({Extends:g,Mixins:[r,o,h,l,u,c,d,f,x],initialize:function(t,e){var i=y(e,"x",0),n=y(e,"y",0);g.call(this,t,"Graphics"),this.setPosition(i,n),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.setDefaultStyles(e)},setDefaultStyles:function(t){return y(t,"lineStyle",null)&&(this.defaultStrokeWidth=y(t,"lineStyle.width",1),this.defaultStrokeColor=y(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=y(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),y(t,"fillStyle",null)&&(this.defaultFillColor=y(t,"fillStyle.color",16777215),this.defaultFillAlpha=y(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(a.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(a.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,n,s){return void 0===s&&(s=1),this.commandBuffer.push(a.GRADIENT_FILL_STYLE,s,t,e,i,n),this},lineGradientStyle:function(t,e,i,n,s,r){return void 0===r&&(r=1),this.commandBuffer.push(a.GRADIENT_LINE_STYLE,t,r,e,i,n,s),this},setTexture:function(t,e,i){if(void 0===i&&(i=0),void 0===t)this.commandBuffer.push(a.CLEAR_TEXTURE);else{var n=this.scene.sys.textures.getFrame(t,e);n&&(2===i&&(i=3),this.commandBuffer.push(a.SET_TEXTURE,n,i))}return this},beginPath:function(){return this.commandBuffer.push(a.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(a.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(a.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(a.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,m.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,m.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(a.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var s=this._lineWidth/2,r=t-s,o=t+s;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+n),this.lineTo(o+i,e+n),this.strokePath(),this},fillRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=v(s,"tl",20),o=v(s,"tr",20),a=v(s,"bl",20),h=v(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-m.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,m.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,m.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-m.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=v(s,"tl",20),o=v(s,"tr",20),a=v(s,"bl",20),h=v(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-m.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,m.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,m.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-m.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(a.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,s,r){return this.commandBuffer.push(a.FILL_TRIANGLE,t,e,i,n,s,r),this},strokeTriangle:function(t,e,i,n,s,r){return this.commandBuffer.push(a.STROKE_TRIANGLE,t,e,i,n,s,r),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(a.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(a.MOVE_TO,t,e),this},lineFxTo:function(t,e,i,n){return this.commandBuffer.push(a.LINE_FX_TO,t,e,i,n,1),this},moveFxTo:function(t,e,i,n){return this.commandBuffer.push(a.MOVE_FX_TO,t,e,i,n,1),this},strokePoints:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n<i;n++)this.lineTo(t[n].x,t[n].y);return e&&this.lineTo(t[0].x,t[0].y),this.strokePath(),this},fillPoints:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n<i;n++)this.lineTo(t[n].x,t[n].y);return e&&this.lineTo(t[0].x,t[0].y),this.fillPath(),this},strokeEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.strokePoints(i,!0)},strokeEllipse:function(t,e,i,n,s){void 0===s&&(s=32);var r=new p(t,e,i,n).getPoints(s);return this.strokePoints(r,!0)},fillEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.fillPoints(i,!0)},fillEllipse:function(t,e,i,n,s){void 0===s&&(s=32);var r=new p(t,e,i,n).getPoints(s);return this.fillPoints(r,!0)},arc:function(t,e,i,n,s,r,o){return void 0===r&&(r=!1),void 0===o&&(o=0),this.commandBuffer.push(a.ARC,t,e,i,n,s,r,o),this},slice:function(t,e,i,n,s,r,o){return void 0===r&&(r=!1),void 0===o&&(o=0),this.commandBuffer.push(a.BEGIN_PATH),this.commandBuffer.push(a.MOVE_TO,t,e),this.commandBuffer.push(a.ARC,t,e,i,n,s,r,o),this.commandBuffer.push(a.CLOSE_PATH),this},save:function(){return this.commandBuffer.push(a.SAVE),this},restore:function(){return this.commandBuffer.push(a.RESTORE),this},translate:function(t,e){return this.commandBuffer.push(a.TRANSLATE,t,e),this},scale:function(t,e){return this.commandBuffer.push(a.SCALE,t,e),this},rotate:function(t){return this.commandBuffer.push(a.ROTATE,t),this},clear:function(){return this.commandBuffer.length=0,-1<this.defaultFillColor&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),-1<this.defaultStrokeColor&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.game.config.width),void 0===i&&(i=r.game.config.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e,i){var a=i(109),n=i(0),s=i(834),r=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r,o){a.call(this,t,e,i,n,s,r,o),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=r},function(t,e,i){var r=i(164),s=i(66),n=i(0),o=i(14),a=i(19),h=i(9),l=i(837),u=i(309),c=i(3),d=new n({Extends:a,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.ScrollFactor,o.Transform,o.Visible,l],initialize:function(t,e,i,n){a.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new h),t.setTo(this.x,this.y,0,0),0<this.list.length)for(var e=this.list,i=new h,n=0;n<e.length;n++){var s=e[n];s.getBounds&&(s.getBounds(i),u(i,t,t))}return t},addHandler:function(t){t.once("destroy",this.remove,this),this.exclusive&&(this._displayList.remove(t),t.parentContainer&&t.parentContainer.remove(t),t.parentContainer=this)},removeHandler:function(t){t.off("destroy",this.remove),this.exclusive&&(t.parentContainer=null)},pointToContainer:function(t,e){if(void 0===e&&(e=new c),this.parentContainer)return this.parentContainer.pointToContainer(t,e);var i=this.tempTransformMatrix;return i.applyITRS(this.x,this.y,this.rotation,this.scaleX,this.scaleY),i.invert(),i.transformPoint(t.x,t.y,e),e},getBoundsTransformMatrix:function(){return this.getWorldTransformMatrix(this.tempTransformMatrix,this.localTransform)},add:function(t){return r.Add(this.list,t,this.maxSize,this.addHandler,this),this},addAt:function(t,e){return r.AddAt(this.list,t,e,this.maxSize,this.addHandler,this),this},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t){return t&&(this._sortKey=t,r.StableSort.inplace(this.list,this.sortHandler)),this},sortHandler:function(t,e){return t[this._sortKey]-e[this._sortKey]},getByName:function(t){return r.GetFirst(this.list,"name",t)},getRandom:function(t,e){return r.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return r.GetFirstElement(this.list,t,e,i,n)},getAll:function(t,e,i,n){return r.GetAll(this.list,t,e,i,n)},count:function(t,e,i,n){return r.CountAllMatching(this.list,t,e,i,n)},swap:function(t,e){return r.Swap(this.list,t,e),this},moveTo:function(t,e){return r.MoveTo(this.list,t,e),this},remove:function(t,e){var i=r.Remove(this.list,t,this.removeHandler,this);if(e&&i){Array.isArray(i)||(i=[i]);for(var n=0;n<i.length;n++)i[n].destroy()}return this},removeAt:function(t,e){var i=r.RemoveAt(this.list,t,this.removeHandler,this);return e&&i&&i.destroy(),this},removeBetween:function(t,e,i){var n=r.RemoveBetween(this.list,t,e,this.removeHandler,this);if(i)for(var s=0;s<n.length;s++)n[s].destroy();return this},removeAll:function(t){var e=r.RemoveBetween(this.list,0,this.list.length,this.removeHandler,this);if(t)for(var i=0;i<e.length;i++)e[i].destroy();return this},bringToTop:function(t){return r.BringToTop(this.list,t),this},sendToBack:function(t){return r.SendToBack(this.list,t),this},moveUp:function(t){return r.MoveUp(this.list,t),this},moveDown:function(t){return r.MoveDown(this.list,t),this},reverse:function(){return this.list.reverse(),this},shuffle:function(){return r.Shuffle(this.list),this},replace:function(t,e,i){return r.Replace(this.list,t,e)&&(this.addHandler(e),this.removeHandler(t),i&&t.destroy()),this},exists:function(t){return-1<this.list.indexOf(t)},setAll:function(t,e,i,n){return r.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,n=[null],s=this.list.slice(),r=s.length;for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<r;i++)n[0]=s[i],t.apply(e,n);return this},iterate:function(t,e){var i,n=[null];for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<this.list.length;i++)n[0]=this.list[i],t.apply(e,n);return this},length:{get:function(){return this.list.length}},first:{get:function(){return(this.position=0)<this.list.length?this.list[0]:null}},last:{get:function(){return 0<this.list.length?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return 0<this.position?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null}});t.exports=d},function(t,e,i){var n=i(841),o=i(838),s=i(0),r=i(14),a=i(113),h=i(19),l=i(112),u=new s({Extends:h,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.ScaleMode,r.ScrollFactor,r.Size,r.Texture,r.Transform,r.Visible,n],initialize:function(t,e,i,n,s){h.call(this,t,"Blitter"),this.setTexture(n,s),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,n,s){void 0===n&&(n=!0),void 0===s&&(s=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var r=new o(this,t,e,i,n);return this.children.addAt(r,s,!1),this.dirty=!0,r},createFromCallback:function(t,e,i,n){for(var s=this.createMultiple(e,i,n),r=0;r<s.length;r++){var o=s[r];t.call(this,o,r)}return s},createMultiple:function(i,t,n){void 0===t&&(t=this.frame.name),void 0===n&&(n=!0),Array.isArray(t)||(t=[t]);var s=[],r=this;return t.forEach(function(t){for(var e=0;e<i;e++)s.push(r.create(0,0,t,n))}),s},childCanRender:function(t){return t.visible&&0<t.alpha},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},function(t,e){t.exports=function(t){if(!Array.isArray(t)||t.length<2||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i<t.length;i++)if(t[i].length!==e)return!1;return!0}},function(t,e,i){t.exports={Matrix:i(874),Add:i(867),AddAt:i(866),BringToTop:i(865),CountAllMatching:i(864),Each:i(863),EachInRange:i(862),FindClosestInSorted:i(383),GetAll:i(861),GetFirst:i(860),GetRandom:i(162),MoveDown:i(859),MoveTo:i(858),MoveUp:i(857),NumberArray:i(856),NumberArrayStep:i(855),QuickSelect:i(313),Range:i(312),Remove:i(330),RemoveAt:i(854),RemoveBetween:i(853),RemoveRandomElement:i(852),Replace:i(851),RotateLeft:i(387),RotateRight:i(386),SafeRange:i(62),SendToBack:i(850),SetAll:i(849),Shuffle:i(122),SpliceOne:i(91),StableSort:i(110),Swap:i(848)}},function(t,e,i){var n=i(0),a=i(113),o=i(317),s=new n({initialize:function(t,e,i,n,s){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE";for(var r=this.frameTotal=0;r<i.length;r++)this.source.push(new o(this,i[r],n,s))},add:function(t,e,i,n,s,r){var o=new a(this,t,e,i,n,s,r);return this.frames[t]=o,1===this.frameTotal&&(this.firstFrame=t),this.frameTotal++,o},has:function(t){return this.frames[t]},get:function(t){t||(t=this.firstFrame);var e=this.frames[t];return e||(console.warn("Texture.frame missing: "+t),e=this.frames[this.firstFrame]),e},getTextureSourceIndex:function(t){for(var e=0;e<this.source.length;e++)if(this.source[e]===t)return e;return-1},getFramesFromTextureSource:function(t,e){void 0===e&&(e=!1);var i=[];for(var n in this.frames)if("__BASE"!==n||e){var s=this.frames[n];s.sourceIndex===t&&i.push(s)}return i},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn("Texture.frame missing: "+t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return e=i?i.sourceIndex:(console.warn("Texture.frame missing: "+t),this.frames.__BASE.sourceIndex),this.dataSource[e].image},setDataSource:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=this.source[e];this.dataSource.push(new o(this,t[e],i.width,i.height))}},setFilter:function(t){var e;for(e=0;e<this.source.length;e++)this.source[e].setFilter(t);for(e=0;e<this.dataSource.length;e++)this.dataSource[e].setFilter(t)},destroy:function(){var t;for(t=0;t<this.source.length;t++)this.source[t].destroy();for(t=0;t<this.dataSource.length;t++)this.dataSource[t].destroy();for(var e in this.frames)this.frames[e].destroy();this.source=[],this.dataSource=[],this.frames={},this.manager=null}});t.exports=s},function(t,e,i){var n=i(0),s=i(116),r=i(167),o=i(890),a=i(889),h=i(1),l=i(326),u=new n({initialize:function(t,e){this.scene=t,this.game,this.config=e,this.settings=l.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=h},init:function(t){this.settings.status=s.INIT,this.sceneUpdate=h,this.game=t,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;(this.plugins=e).addToScene(this,r.Global,[r.CoreScene,a(this),o(this)]),this.events.emit("boot",this),this.settings.isBooted=!0},install:function(t){Array.isArray(t)||(t=[t]),this.plugins.installLocal(this,t)},step:function(t,e){this.events.emit("preupdate",t,e),this.events.emit("update",t,e),this.sceneUpdate.call(this.scene,t,e),this.events.emit("postupdate",t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.cameras.render(t,e),this.events.emit("render",t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){return this.settings.active&&(this.settings.status=s.PAUSED,this.settings.active=!1,this.events.emit("pause",this,t)),this},resume:function(t){return this.settings.active||(this.settings.status=s.RUNNING,this.settings.active=!0,this.events.emit("resume",this,t)),this},sleep:function(t){return this.settings.status=s.SLEEPING,this.settings.active=!1,this.settings.visible=!1,this.events.emit("sleep",this,t),this},wake:function(t){var e=this.settings;return e.status=s.RUNNING,e.active=!0,e.visible=!0,this.events.emit("wake",this,t),e.isTransition&&this.events.emit("transitionwake",e.transitionFrom,e.transitionDuration),this},isSleeping:function(){return this.settings.status===s.SLEEPING},isActive:function(){return this.settings.status===s.RUNNING},isPaused:function(){return this.settings.status===s.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&0<this.scenePlugin._duration},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit("start",this),this.events.emit("ready",this,t)},resize:function(t,e){this.events.emit("resize",t,e)},shutdown:function(t){this.events.off("transitioninit"),this.events.off("transitionstart"),this.events.off("transitioncomplete"),this.events.off("transitionout"),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit("shutdown",this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit("destroy",this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e<t.length;e++)this[t[e]]=null}});t.exports=u},function(t,e,i){t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},function(t,e,i){var r=i(92),n=i(118),o=i(24),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){a.canvas=!!window.CanvasRenderingContext2D||r.cocoonJS;try{a.localStorage=!!localStorage.getItem}catch(s){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,s=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=o.createWebGL(this);r.cocoonJS&&(t.screencanvas=!1);var e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=o.create2D(this),n=i.getContext("2d").createImageData(1,1);return s=n.data instanceof Uint8ClampedArray,o.remove(t),o.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(a.getUserMedia=!1),!r.iOS&&(n.ie||n.firefox||n.chrome)&&(a.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&s,a}()},function(t,e){t.exports=function(t,e,i){var n;if(void 0===i&&(i=!0),e)"string"==typeof e?n=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(n=e);else if(t.parentElement)return t;return n||(n=document.body),i&&n.style&&(n.style.overflow="hidden"),n.appendChild(t),t}},function(t,e){t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},function(t,e){t.exports=function(t,e,i,n,s){var r=.5*(n-e),o=.5*(s-i),a=t*t;return(2*i-2*n+r+o)*(t*a)+(-3*i+3*n-2*r-o)*a+r*t+i}},function(t,e,i){var n=i(16);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e,i){var u=i(9);t.exports=function(t,e){if(void 0===e&&(e=new u),0===t.length)return e;for(var i,n,s,r=Number.MAX_VALUE,o=Number.MAX_VALUE,a=Number.MIN_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER,l=0;l<t.length;l++)i=t[l],s=Array.isArray(i)?(n=i[0],i[1]):(n=i.x,i.y),r=Math.min(r,n),o=Math.min(o,s),a=Math.max(a,n),h=Math.max(h,s);return e.x=r,e.y=o,e.width=a-r,e.height=h-o,e}},function(t,e,i){var n=i(369),s=i(368),r=i(367),o=i(366),a=i(365),h=i(364),l=i(363),u=i(362),c=i(361),d=i(360),f=i(359),p=i(358);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:n.Out,Bounce:s.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":n.In,"Bounce.easeIn":s.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":n.Out,"Bounce.easeOut":s.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":s.InOut}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){var f=i(177);t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var s=Math.floor(6*t),r=6*t-s,o=Math.floor(i*(1-e)*255),a=Math.floor(i*(1-r*e)*255),h=Math.floor(i*(1-(1-r)*e)*255),l=i=Math.floor(i*=255),u=i,c=i,d=s%6;return 0===d?(u=h,c=o):1===d?(l=a,c=o):2===d?(l=o,c=h):3===d?(l=o,u=a):4===d?(l=h,u=o):5===d&&(u=o,c=a),n?n.setTo?n.setTo(l,u,c,n.alpha,!1):(n.r=l,n.g=u,n.b=c,n.color=f(l,u,c),n):{r:l,g:u,b:c,color:f(l,u,c)}}},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){var n=i(377),s=i(374),r=i(372),o=i(371);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):n(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===n&&(n=3);var s=0;if(e+1>=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(s-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e][0],t[e][1])},set:function(t,e){return this.has(t)||(this.entries[t]=e,this.size++),this},get:function(t){if(this.has(t))return this.entries[t]},getArray:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},has:function(t){return this.entries.hasOwnProperty(t)},delete:function(t){return this.has(t)&&(delete this.entries[t],this.size--),this},clear:function(){return Object.keys(this.entries).forEach(function(t){delete this.entries[t]},this),this.size=0,this},keys:function(){return Object.keys(this.entries)},values:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},dump:function(){var t=this.entries;for(var e in console.group("Map"),t)console.log(e,t[e]);console.groupEnd()},each:function(t){var e=this.entries;for(var i in e)if(!1===t(i,e[i]))break;return this},contains:function(t){var e=this.entries;for(var i in e)if(e[i]===t)return!0;return!1},merge:function(t,e){void 0===e&&(e=!1);var i=this.entries,n=t.entries;for(var s in n)i.hasOwnProperty(s)&&e?i[s]=n[s]:this.set(s,n[s]);return this}});t.exports=n},function(t,e){t.exports=function(t,e,i){return t<=e?0:i<=t?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,n,s){var r=n+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},function(t,e,i){var h=i(6);t.exports=function(t,e){void 0===e&&(e=new h);var i=t.x2-t.x1,n=t.y2-t.y1,s=t.x3-t.x1,r=t.y3-t.y1,o=Math.random(),a=Math.random();return 1<=o+a&&(o=1-o,a=1-a),e.x=t.x1+(i*o+s*a),e.y=t.y1+(n*o+r*a),e}},function(t,e,i){var s=i(6);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return e.x=t.x+n*Math.cos(i)*t.width/2,e.y=t.y+n*Math.sin(i)*t.height/2,e}},function(t,e){t.exports={defaultPipeline:null,pipeline:null,initPipeline:function(t){void 0===t&&(t="TextureTintPipeline");var e=this.scene.sys.game.renderer;return!!(e&&e.gl&&e.hasPipeline(t))&&(this.defaultPipeline=e.getPipeline(t),this.pipeline=this.defaultPipeline,!0)},setPipeline:function(t){var e=this.scene.sys.game.renderer;return e&&e.gl&&e.hasPipeline(t)&&(this.pipeline=e.getPipeline(t)),this},resetPipeline:function(){return this.pipeline=this.defaultPipeline,null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){var n=i(6);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){var d=i(65),f=i(6);t.exports=function(t,e,i,n){void 0===n&&(n=[]),e||(e=d(t)/i);for(var s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=0;h<e;h++){var l=h/e,u=s+(o-s)*l,c=r+(a-r)*l;n.push(new f(u,c))}return n}},function(t,e,i){var s=i(124),r=i(6);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||1<=e)return i.x=t.x,i.y=t.y,i;var n=s(t)*e;return.5<e?(n-=t.width+t.height)<=t.width?(i.x=t.right-n,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(n-t.width)):n<=t.width?(i.x=t.x+n,i.y=t.y):(i.x=t.right,i.y=t.y+(n-t.width)),i}},function(t,e,i){var a=i(6);t.exports=function(t,e){void 0===e&&(e=new a);var i=2*Math.PI*Math.random(),n=Math.random()+Math.random(),s=1<n?2-n:n,r=s*Math.cos(i),o=s*Math.sin(i);return e.x=t.x+r*t.radius,e.y=t.y+o*t.radius,e}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e){t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},function(t,e,i){var b={};t.exports=b;var o=i(76),T=i(81),a=i(222),h=i(80),l=i(505),u=i(33);b._warming=.4,b._torqueDampen=1,b._minLength=1e-6,b.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?T.add(e.bodyA.position,e.pointA):e.pointA,n=e.bodyB?T.add(e.bodyB.position,e.pointB):e.pointB,s=T.magnitude(T.sub(i,n));e.length=void 0!==e.length?e.length:s,e.id=e.id||u.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(0<e.length?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var r={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&.1<e.stiffness?(r.type="pin",r.anchors=!1):e.stiffness<.9&&(r.type="spring"),e.render=u.extend(r,e.render),e},b.preSolveAll=function(t){for(var e=0;e<t.length;e+=1){var i=t[e],n=i.constraintImpulse;i.isStatic||0===n.x&&0===n.y&&0===n.angle||(i.position.x+=n.x,i.position.y+=n.y,i.angle+=n.angle)}},b.solveAll=function(t,e){for(var i=0;i<t.length;i+=1){var n=t[i],s=!n.bodyA||n.bodyA&&n.bodyA.isStatic,r=!n.bodyB||n.bodyB&&n.bodyB.isStatic;(s||r)&&b.solve(t[i],e)}for(i=0;i<t.length;i+=1)s=!(n=t[i]).bodyA||n.bodyA&&n.bodyA.isStatic,r=!n.bodyB||n.bodyB&&n.bodyB.isStatic,s||r||b.solve(t[i],e)},b.solve=function(t,e){var i=t.bodyA,n=t.bodyB,s=t.pointA,r=t.pointB;if(i||n){i&&!i.isStatic&&(T.rotate(s,i.angle-t.angleA,s),t.angleA=i.angle),n&&!n.isStatic&&(T.rotate(r,n.angle-t.angleB,r),t.angleB=n.angle);var o=s,a=r;if(i&&(o=T.add(i.position,s)),n&&(a=T.add(n.position,r)),o&&a){var h=T.sub(o,a),l=T.magnitude(h);l<b._minLength&&(l=b._minLength);var u,c,d,f,p,g=(l-t.length)/l,v=t.stiffness<1?t.stiffness*e:t.stiffness,y=T.mult(h,g*v),m=(i?i.inverseMass:0)+(n?n.inverseMass:0),x=m+((i?i.inverseInertia:0)+(n?n.inverseInertia:0));if(t.damping){var w=T.create();d=T.div(h,l),p=T.sub(n&&T.sub(n.position,n.positionPrev)||w,i&&T.sub(i.position,i.positionPrev)||w),f=T.dot(d,p)}i&&!i.isStatic&&(c=i.inverseMass/m,i.constraintImpulse.x-=y.x*c,i.constraintImpulse.y-=y.y*c,i.position.x-=y.x*c,i.position.y-=y.y*c,t.damping&&(i.positionPrev.x-=t.damping*d.x*f*c,i.positionPrev.y-=t.damping*d.y*f*c),u=T.cross(s,y)/x*b._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=u,i.angle-=u),n&&!n.isStatic&&(c=n.inverseMass/m,n.constraintImpulse.x+=y.x*c,n.constraintImpulse.y+=y.y*c,n.position.x+=y.x*c,n.position.y+=y.y*c,t.damping&&(n.positionPrev.x+=t.damping*d.x*f*c,n.positionPrev.y+=t.damping*d.y*f*c),u=T.cross(r,y)/x*b._torqueDampen*n.inverseInertia*(1-t.angularStiffness),n.constraintImpulse.angle+=u,n.angle+=u)}}},b.postSolveAll=function(t){for(var e=0;e<t.length;e++){var i=t[e],n=i.constraintImpulse;if(!(i.isStatic||0===n.x&&0===n.y&&0===n.angle)){a.set(i,!1);for(var s=0;s<i.parts.length;s++){var r=i.parts[s];o.translate(r.vertices,n),0<s&&(r.position.x+=n.x,r.position.y+=n.y),0!==n.angle&&(o.rotate(r.vertices,n.angle,i.position),l.rotate(r.axes,n.angle),0<s&&T.rotateAbout(r.position,n.angle,i.position,r.position)),h.update(r.bounds,r.vertices,i.velocity)}n.angle*=b._warming,n.x*=b._warming,n.y*=b._warming}}}},function(t,e,i){var n={};t.exports=n;var u=i(33);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r<s.length;r++)n=s[r],t.events=t.events||{},t.events[n]=t.events[n]||[],t.events[n].push(i);return i},n.off=function(t,e,i){if(e){"function"==typeof e&&(i=e,e=u.keys(t.events).join(" "));for(var n=e.split(" "),s=0;s<n.length;s++){var r=t.events[n[s]],o=[];if(i&&r)for(var a=0;a<r.length;a++)r[a]!==i&&o.push(r[a]);t.events[n[s]]=o}}else t.events={}},n.trigger=function(t,e,i){var n,s,r,o,a=t.events;if(a&&0<u.keys(a).length){i||(i={}),n=e.split(" ");for(var h=0;h<n.length;h++)if(r=a[s=n[h]]){(o=u.clone(i,!1)).name=s,o.source=t;for(var l=0;l<r.length;l++)r[l].apply(t,[o])}}}},function(t,e,i){var n=i(0),O=i(64),s=i(2),r=i(894),o=i(893),a=i(892),h=i(38),D=i(10),l=i(197),u=new n({Extends:l,Mixins:[r],initialize:function(t){var e=t.renderer.config;l.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:s(t,"topology",t.renderer.gl.TRIANGLES),vertShader:s(t,"vertShader",a),fragShader:s(t,"fragShader",o),vertexCapacity:s(t,"vertexCapacity",6*e.batchSize),vertexSize:s(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this.batches=[],this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this._tempMatrix4=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.tintEffect=2,this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[],this.mvpInit()},onBind:function(){return l.prototype.onBind.call(this),this.mvpUpdate(),0===this.batches.length&&this.pushBatch(),this},resize:function(t,e,i){return l.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){t||(t=this.renderer.blankTexture.glTexture,e=0);var i=this.batches;0===i.length&&this.pushBatch();var n=i[i.length-1];return 0<e?(n.textures[e-1]&&n.textures[e-1]!==t&&this.pushBatch(),i[i.length-1].textures[e-1]=t):(null!==n.texture&&n.texture!==t&&this.pushBatch(),i[i.length-1].texture=t),this},pushBatch:function(){var t={first:this.vertexCount,texture:null,textures:[]};this.batches.push(t)},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t,e,i,n=this.gl,s=this.vertexCount,r=this.topology,o=this.vertexSize,a=this.renderer,h=this.batches,l=0,u=null;if(0===h.length||0===s)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,s*o));for(var c=0;c<h.length-1;c++){if(u=h[c],t=h[c+1],0<u.textures.length){for(e=0;e<u.textures.length;++e)(i=u.textures[e])&&a.setTexture2D(i,1+e);n.activeTexture(n.TEXTURE0)}l=t.first-u.first,null===u.texture||l<=0||(a.setTexture2D(u.texture,0),n.drawArrays(r,u.first,l))}if(0<(u=h[h.length-1]).textures.length){for(e=0;e<u.textures.length;++e)(i=u.textures[e])&&a.setTexture2D(i,1+e);n.activeTexture(n.TEXTURE0)}return l=s-u.first,u.texture&&0<l&&(a.setTexture2D(u.texture,0),n.drawArrays(r,u.first,l)),this.vertexCount=0,h.length=0,this.pushBatch(),this.flushLocked=!1,this},batchSprite:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix1,s=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,l=o.v0,u=o.u1,c=o.v1,d=o.x,f=o.y,p=o.cutWidth,g=o.cutHeight,v=-t.displayOriginX+d,y=-t.displayOriginY+f;if(t.isCropped){var m=t._crop;m.flipX===t.flipX&&m.flipY===t.flipY||o.updateCropUVs(m,t.flipX,t.flipY),h=m.u0,l=m.v0,u=m.u1,c=m.v1,p=m.width,g=m.height,d=m.x,f=m.y,v=-t.displayOriginX+d,y=-t.displayOriginY+f}t.flipX&&(v+=p,p*=-1),t.flipY&&(y+=g,g*=-1);var x=v+p,w=y+g;s.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),s.e=t.x,s.f=t.y):(s.e-=e.scrollX*t.scrollFactorX,s.f-=e.scrollY*t.scrollFactorY),n.multiply(s,r);var b=r.getX(v,y),T=r.getY(v,y),S=r.getX(v,w),_=r.getY(v,w),A=r.getX(x,w),C=r.getY(x,w),M=r.getX(x,y),P=r.getY(x,y),E=D.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),k=D.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),F=D.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),L=D.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(b|=0,T|=0,S|=0,_|=0,A|=0,C|=0,M|=0,P|=0),this.setTexture2D(a,0);var R=t._isTinted&&t.tintFill;this.batchQuad(b,T,S,_,A,C,M,P,h,l,u,c,E,k,F,L,R)},batchQuad:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v){var y=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),y=!0);var m=this.vertexViewF32,x=this.vertexViewU32,w=this.vertexCount*this.vertexComponentCount-1;return m[++w]=t,m[++w]=e,m[++w]=h,m[++w]=l,m[++w]=v,x[++w]=d,m[++w]=i,m[++w]=n,m[++w]=h,m[++w]=c,m[++w]=v,x[++w]=p,m[++w]=s,m[++w]=r,m[++w]=u,m[++w]=c,m[++w]=v,x[++w]=g,m[++w]=t,m[++w]=e,m[++w]=h,m[++w]=l,m[++w]=v,x[++w]=d,m[++w]=s,m[++w]=r,m[++w]=u,m[++w]=c,m[++w]=v,x[++w]=g,m[++w]=o,m[++w]=a,m[++w]=u,m[++w]=l,m[++w]=v,x[++w]=f,this.vertexCount+=6,y},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f){var p=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),p=!0);var g=this.vertexViewF32,v=this.vertexViewU32,y=this.vertexCount*this.vertexComponentCount-1;return g[++y]=t,g[++y]=e,g[++y]=o,g[++y]=a,g[++y]=f,v[++y]=u,g[++y]=i,g[++y]=n,g[++y]=o,g[++y]=l,g[++y]=f,v[++y]=c,g[++y]=s,g[++y]=r,g[++y]=h,g[++y]=l,g[++y]=f,v[++y]=d,this.vertexCount+=3,p},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w,b,T,S,_,A,C,M,P,E,k){this.renderer.setPipeline(this,t);var F=this._tempMatrix1,L=this._tempMatrix2,R=this._tempMatrix3,O=y/i+C,D=m/n+M,B=(y+x)/i+C,I=(m+w)/n+M,Y=o,X=a,z=-g,N=-v;if(t.isCropped){var U=t._crop;Y=U.width,X=U.height,o=U.width,a=U.height;var V=y=U.x,G=m=U.y;c&&(V=x-U.x-U.width),d&&!e.isRenderTexture&&(G=w-U.y-U.height),O=V/i+C,D=G/n+M,B=(V+U.width)/i+C,I=(G+U.height)/n+M,z=-g+y,N=-v+m}d^=!k&&e.isRenderTexture?1:0,c&&(Y*=-1,z+=o),d&&(X*=-1,N+=a);var W=z+Y,H=N+X;L.applyITRS(s,r,u,h,l),F.copyFrom(P.matrix),E?(F.multiplyWithOffset(E,-P.scrollX*f,-P.scrollY*p),L.e=s,L.f=r):(L.e-=P.scrollX*f,L.f-=P.scrollY*p),F.multiply(L,R);var j=R.getX(z,N),q=R.getY(z,N),K=R.getX(z,H),J=R.getY(z,H),Z=R.getX(W,H),Q=R.getY(W,H),$=R.getX(W,N),tt=R.getY(W,N);P.roundPixels&&(j|=0,q|=0,K|=0,J|=0,Z|=0,Q|=0,$|=0,tt|=0),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,O,D,B,I,b,T,S,_,A)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,u=i+t.height;o?a.multiply(o,h):h=a;var c=h.getX(e,i),d=h.getY(e,i),f=h.getX(e,u),p=h.getY(e,u),g=h.getX(l,u),v=h.getY(l,u),y=h.getX(l,i),m=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=D.getTintAppendFloatAlpha(n,s),this.batchQuad(c,d,f,p,g,v,y,m,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n,h=D.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),y=this.currentFrame,m=y.u0,x=y.v0,w=y.u1,b=y.v1;this.batchQuad(l,u,c,d,f,p,g,v,m,x,w,b,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,y=g.v0,m=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,y,m,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var s,r,o=t.length,a=this.polygonCache,h=this.fillTint.TL,l=this.fillTint.TR,u=this.fillTint.BL,c=this.tintEffect,d=0;d<o;++d)r=t[d],a.push(r.x,r.y);o=(s=O(a)).length;for(var f=this.currentFrame,p=0;p<o;p+=3){var g=2*s[p+0],v=2*s[p+1],y=2*s[p+2],m=a[g+0],x=a[g+1],w=a[v+0],b=a[v+1],T=a[y+0],S=a[y+1],_=n.getX(m,x),A=n.getY(m,x),C=n.getX(w,b),M=n.getY(w,b),P=n.getX(T,S),E=n.getY(T,S),k=f.u0,F=f.v0,L=f.u1,R=f.v1;this.batchTri(_,A,C,M,P,E,k,F,L,R,h,l,u,c)}a.length=0},batchStrokePath:function(t,e,i,n,s){this.renderer.setPipeline(this),this.prevQuad[4]=0,this.firstQuad[4]=0;for(var r=t.length-1,o=0;o<r;o++){var a=t[o],h=t[o+1];this.batchLine(a.x,a.y,h.x,h.y,a.width/2,h.width/2,e,o,!i&&o===r-1,n,s)}},batchLine:function(t,e,i,n,s,r,o,a,h,l,u){this.renderer.setPipeline(this);var c=this._tempMatrix3;u&&u.multiply(l,c);var d=i-t,f=n-e,p=Math.sqrt(d*d+f*f),g=s*(n-e)/p,v=s*(t-i)/p,y=r*(n-e)/p,m=r*(t-i)/p,x=i-y,w=n-m,b=t-g,T=e-v,S=i+y,_=n+m,A=t+g,C=e+v,M=c.getX(x,w),P=c.getY(x,w),E=c.getX(b,T),k=c.getY(b,T),F=c.getX(S,_),L=c.getY(S,_),R=c.getX(A,C),O=c.getY(A,C),D=this.strokeTint,B=this.tintEffect,I=D.TL,Y=D.TR,X=D.BL,z=D.BR,N=this.currentFrame,U=N.u0,V=N.v0,G=N.u1,W=N.v1;if(this.batchQuad(R,O,E,k,M,P,F,L,U,V,G,W,I,Y,X,z,B),!(o<=2)){var H=this.prevQuad,j=this.firstQuad;0<a&&H[4]?this.batchQuad(R,O,E,k,H[0],H[1],H[2],H[3],U,V,G,W,I,Y,X,z,B):(j[0]=R,j[1]=O,j[2]=E,j[3]=k,j[4]=1),h&&j[4]?this.batchQuad(M,P,F,L,j[0],j[1],j[2],j[3],U,V,G,W,I,Y,X,z,B):(H[0]=M,H[1]=P,H[2]=F,H[3]=L,H[4]=1)}}});t.exports=u},function(t,e,i){var n=i(0),s=i(10),r=new n({initialize:function(t){this.name="WebGLPipeline",this.game=t.game,this.view=t.game.canvas,this.resolution=t.game.config.resolution,this.width=t.game.config.width*this.resolution,this.height=t.game.config.height*this.resolution,this.gl=t.gl,this.vertexCount=0,this.vertexCapacity=t.vertexCapacity,this.renderer=t.renderer,this.vertexData=t.vertices?t.vertices:new ArrayBuffer(t.vertexCapacity*t.vertexSize),this.vertexBuffer=this.renderer.createVertexBuffer(t.vertices?t.vertices:this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=this.renderer.createProgram(t.vertShader,t.fragShader),this.attributes=t.attributes,this.vertexSize=t.vertexSize,this.topology=t.topology,this.bytes=new Uint8Array(this.vertexData),this.vertexComponentCount=s.getComponentCount(t.attributes,this.gl),this.flushLocked=!1,this.active=!1},boot:function(){},addAttribute:function(t,e,i,n,s){return this.attributes.push({name:t,size:e,type:this.renderer.glFormats[i],normalized:n,offset:s}),this},shouldFlush:function(){return this.vertexCount>=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o<i.length;++o){var a=i[o],h=t.getAttribLocation(n,a.name);0<=h?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(53);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(53);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(nCa,oCa){var pCa;pCa=function(){return this}();try{pCa=pCa||Function("return this")()||eval("this")}catch(nCa){"object"==typeof window&&(pCa=window)}nCa.exports=pCa},function(t,e,i){var n=i(0),s=i(11),r=i(97),a=i(83),o=new n({Extends:s,initialize:function(t){s.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=a.PENDING_ADD,this._pausedState=a.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===a.ACTIVE},add:function(t){return this.queue(r(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"==typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],n=parseFloat(t.substr(2)),s=e;switch(i){case"+":s+=n;break;case"-":s-=n}return Math.max(0,s)},calcDuration:function(){for(var t=0,e=0,i=0,n=0;n<this.totalData;n++){var s=this.data[n];s.init(),this.hasOffset(s)?this.isOffsetAbsolute(s.offset)?(s.calculatedOffset=s.offset,0===s.offset&&(i=0)):this.isOffsetRelative(s.offset)&&(s.calculatedOffset=this.getRelativeOffset(s.offset,t)):s.calculatedOffset=i,t=s.totalDuration+s.calculatedOffset,e+=s.totalDuration,i+=s.totalDuration}this.duration=e,this.loopCounter=-1===this.loop?999999999999:this.loop,0<this.loopCounter?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e<this.totalData;e++)this.data[e].play(t)},setCallback:function(t,e,i,n){return-1!==o.TYPES.indexOf(t)&&(this.callbacks[t]={func:e,scope:n,params:i}),this},makeActive:function(t){return this.manager.makeActive(t)},play:function(){if(this.state!==a.ACTIVE){if(this.paused)return this.paused=!1,void this.manager.makeActive(this);this.resetTweens(!1),this.state=a.ACTIVE;var t=this.callbacks.onStart;t&&t.func.apply(t.scope,t.params),this.emit("start",this)}},nextState:function(){if(0<this.loopCounter){this.elapsed=0,this.progress=0,this.loopCounter--;var t=this.callbacks.onLoop;t&&t.func.apply(t.scope,t.params),this.emit("loop",this,this.loopCounter),this.resetTweens(!0),0<this.loopDelay?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):this.state=a.ACTIVE}else if(0<this.completeDelay)this.countdown=this.completeDelay,this.state=a.COMPLETE_DELAY;else{var e=this.callbacks.onComplete;e&&e.func.apply(e.scope,e.params),this.emit("complete",this),this.state=a.PENDING_REMOVE}},update:function(t,e){if(this.state!==a.PAUSED){var i=e;switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case a.ACTIVE:for(var n=this.totalData,s=0;s<this.totalData;s++)this.data[s].update(t,i)&&n--;var r=this.callbacks.onUpdate;r&&r.func.apply(r.scope,r.params),this.emit("update",this),0===n&&this.nextState();break;case a.LOOP_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=a.ACTIVE);break;case a.COMPLETE_DELAY:if(this.countdown-=e,this.countdown<=0){var o=this.callbacks.onComplete;o&&o.func.apply(o.scope,o.params),this.emit("complete",this),this.state=a.PENDING_REMOVE}}return this.state===a.PENDING_REMOVE}},stop:function(){this.state=a.PENDING_REMOVE},pause:function(){if(this.state!==a.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=a.PAUSED,this.emit("pause",this),this},resume:function(){return this.state===a.PAUSED&&(this.paused=!1,this.state=this._pausedState),this.emit("resume",this),this},hasTarget:function(t){for(var e=0;e<this.data.length;e++)if(this.data[e].hasTarget(t))return!0;return!1},destroy:function(){for(var t=0;t<this.data.length;t++)this.data[t].stop()}});o.TYPES=["onStart","onUpdate","onLoop","onComplete","onYoyo"],t.exports=o},function(t,e,i){var _=i(63),A=i(129),C=i(12),M=i(84),P=i(86),E=i(98),k=i(131),F=i(204),L=i(4),R=i(201),O=i(97);t.exports=function(t,e){var i=new R(t),n=F(e);if(0===n.length)return i.paused=!0,i;var s=_(A);s.targets=k(e);var r=C(e,"totalDuration",0);s.duration=0<r?Math.floor(r/n.length):E(e,"duration",s.duration),s.delay=E(e,"delay",s.delay),s.easeParams=L(e,"easeParams",s.easeParams),s.ease=P(L(e,"ease",s.ease),s.easeParams),s.hold=E(e,"hold",s.hold),s.repeat=E(e,"repeat",s.repeat),s.repeatDelay=E(e,"repeatDelay",s.repeatDelay),s.yoyo=M(e,"yoyo",s.yoyo),s.flipX=M(e,"flipX",s.flipX),s.flipY=M(e,"flipY",s.flipY);for(var o=0;o<n.length;o++)i.queue(O(i,n[o],s));i.completeDelay=C(e,"completeDelay",0),i.loop=Math.round(C(e,"loop",0)),i.loopDelay=Math.round(C(e,"loopDelay",0)),i.paused=M(e,"paused",!1),i.useFrames=M(e,"useFrames",!1);var a=L(e,"callbackScope",i),h=[i],l=L(e,"onStart",!1);if(l){var u=L(e,"onStartScope",a),c=L(e,"onStartParams",[]);i.setCallback("onStart",l,h.concat(c),u)}var d=L(e,"onUpdate",!1);if(d){var f=L(e,"onUpdateScope",a),p=L(e,"onUpdateParams",[]);i.setCallback("onUpdate",d,h.concat(p),f)}var g=L(e,"onLoop",!1);if(g){var v=L(e,"onLoopScope",a),y=L(e,"onLoopParams",[]);i.setCallback("onLoop",g,h.concat(y),v)}var m=L(e,"onYoyo",!1);if(m){var x=L(e,"onYoyoScope",a),w=L(e,"onYoyoParams",[]);i.setCallback("onYoyo",m,h.concat(null,w),x)}var b=L(e,"onComplete",!1);if(b){var T=L(e,"onCompleteScope",a),S=L(e,"onCompleteParams",[]);i.setCallback("onComplete",b,h.concat(S),T)}return i}},function(t,e,i){var C=i(129),M=i(12),P=i(84),E=i(86),k=i(98),F=i(4),L=i(130),R=i(128),O=i(127);t.exports=function(t,e,i){void 0===i&&(i=C);var n=F(e,"from",0),s=F(e,"to",1),r=[{value:n}],o=k(e,"delay",i.delay),a=k(e,"duration",i.duration),h=F(e,"easeParams",i.easeParams),l=E(F(e,"ease",i.ease),h),u=k(e,"hold",i.hold),c=k(e,"repeat",i.repeat),d=k(e,"repeatDelay",i.repeatDelay),f=P(e,"yoyo",i.yoyo),p=[],g=L("value",s),v=O(r[0],"value",g.getEnd,g.getStart,l,o,a,f,u,c,d,!1,!1);v.start=n,v.current=n,v.to=s,p.push(v);var y=new R(t,p,r);y.offset=M(e,"offset",null),y.completeDelay=M(e,"completeDelay",0),y.loop=Math.round(M(e,"loop",0)),y.loopDelay=Math.round(M(e,"loopDelay",0)),y.paused=P(e,"paused",!1),y.useFrames=P(e,"useFrames",!1);for(var m=F(e,"callbackScope",y),x=[y,null],w=R.TYPES,b=0;b<w.length;b++){var T=w[b],S=F(e,T,!1);if(S){var _=F(e,T+"Scope",m),A=F(e,T+"Params",[]);y.setCallback(T,S,x.concat(A),_)}}return y}},function(t,e,i){var n=i(4);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(437);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){return this.delay=s(t,"delay",0),this.repeat=s(t,"repeat",0),this.loop=s(t,"loop",!1),this.callback=s(t,"callback",void 0),this.callbackScope=s(t,"callbackScope",this.callback),this.args=s(t,"args",[]),this.timeScale=s(t,"timeScale",1),this.startAt=s(t,"startAt",0),this.paused=s(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(0<this.repeat){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(0),s=i(14),o=i(26),a=i(19),r=i(446),h=i(103),l=i(38),L=i(10),u=new n({Extends:a,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,r],initialize:function(t,e,i,n,s,r){a.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],(this.layer.tilemapLayer=this).tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.renderer=t.sys.game.renderer,this.vertexBuffer=[],this.bufferData=[],this.vertexViewF32=[],this.vertexViewU32=[],this.dirty=[],this.vertexCount=[],this._renderOrder=0,this._tempMatrix=new l,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,r),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.updateVBOData(),this.initPipeline("TextureTintPipeline"),t.sys.game.config.renderType===o.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.updateVBOData()},this)},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;s<t.length;s++){var r=t[s];if("string"==typeof r&&(r=n.getTileset(r)),r){i.push(r);for(var o=r.firstgid,a=0;a<r.total;a++)e[o+a]=r}}this.gidMap=e,this.tileset=i},updateVBOData:function(){for(var t=0;t<this.tileset.length;t++)this.dirty[t]=!0,this.vertexCount[t]=0,this.vertexBuffer[t]=null,this.bufferData[t]=null,this.vertexViewF32[t]=null,this.vertexViewU32[t]=null;return this},upload:function(t,e){var i=this.renderer,n=i.gl,s=i.pipelines.TextureTintPipeline;if(this.dirty[e]){var r,o,a,h=this.tileset[e],l=this.layer.width,u=this.layer.height,c=h.image.source[0].width,d=h.image.source[0].height,f=this.layer.data,p=this._renderOrder,g=h.firstgid,v=h.firstgid+h.total,y=this.vertexBuffer[e],m=this.bufferData[e],x=-1,w=l*u*s.vertexSize*6;if(this.vertexCount[e]=0,null===m&&(m=new ArrayBuffer(w),this.bufferData[e]=m,this.vertexViewF32[e]=new Float32Array(m),this.vertexViewU32[e]=new Uint32Array(m)),0===p)for(o=0;o<u;o++)for(a=0;a<l;a++)!(r=f[o][a])||r.index<g||r.index>v||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(1===p)for(o=0;o<u;o++)for(a=l-1;0<=a;a--)!(r=f[o][a])||r.index<g||r.index>v||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(2===p)for(o=u-1;0<=o;o--)for(a=0;a<l;a++)!(r=f[o][a])||r.index<g||r.index>v||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(3===p)for(o=u-1;0<=o;o--)for(a=l-1;0<=a;a--)!(r=f[o][a])||r.index<g||r.index>v||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));this.dirty[e]=!1,null===y?(y=i.createVertexBuffer(m,n.STATIC_DRAW),this.vertexBuffer[e]=y):(i.setVertexBuffer(y),n.bufferSubData(n.ARRAY_BUFFER,0,m))}return this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=a.x/n,l=a.y/s,u=(a.x+e.width)/n,c=(a.y+e.height)/s,d=this._tempMatrix,f=e.width,p=e.height,g=f/2,v=p/2,y=-g,m=-v;e.flipX&&(f*=-1,y+=e.width),e.flipY&&(p*=-1,m+=e.height);var x=y+f,w=m+p;d.applyITRS(g+e.pixelX,v+e.pixelY,e.rotation,1,1);var b=L.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),T=d.getX(y,m),S=d.getY(y,m),_=d.getX(y,w),A=d.getY(y,w),C=d.getX(x,w),M=d.getY(x,w),P=d.getX(x,m),E=d.getY(x,m);r.roundPixels&&(T|=0,S|=0,_|=0,A|=0,C|=0,M|=0,P|=0,E|=0);var k=this.vertexViewF32[o],F=this.vertexViewU32[o];return k[++t]=T,k[++t]=S,k[++t]=h,k[++t]=l,k[++t]=0,F[++t]=b,k[++t]=_,k[++t]=A,k[++t]=h,k[++t]=c,k[++t]=0,F[++t]=b,k[++t]=C,k[++t]=M,k[++t]=u,k[++t]=c,k[++t]=0,F[++t]=b,k[++t]=T,k[++t]=S,k[++t]=h,k[++t]=l,k[++t]=0,F[++t]=b,k[++t]=C,k[++t]=M,k[++t]=u,k[++t]=c,k[++t]=0,F[++t]=b,k[++t]=P,k[++t]=E,k[++t]=u,k[++t]=l,k[++t]=0,F[++t]=b,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),0<=t&&t<4){this._renderOrder=t;for(var e=0;e<this.tileset.length;e++)this.dirty[e]=!0}return this},calculateFacesAt:function(t,e){return h.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return h.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return h.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles)},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},findByIndex:function(t,e,i){return h.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return h.FindTile(t,e,i,n,s,r,o,this.layer)},filterTiles:function(t,e,i,n,s,r,o){return h.FilterTiles(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return h.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return h.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return h.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return h.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return h.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},getTilesWithinShape:function(t,e,i){return h.GetTilesWithinShape(t,e,i,this.layer)},hasTileAt:function(t,e){return h.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return h.HasTileAtWorldXY(t,e,i,this.layer)},renderDebug:function(t,e){return h.RenderDebug(t,e,this.layer),this},setCollision:function(t,e,i){return h.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return h.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return h.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return h.SetCollisionByExclusion(t,e,i,this.layer),this},setTileIndexCallback:function(t,e,i){return h.SetTileIndexCallback(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return h.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return h.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return h.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return h.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return h.TileToWorldXY(t,e,i,n,this.layer)},worldToTileX:function(t,e,i){return h.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return h.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return h.WorldToTileXY(t,e,i,n,s,this.layer)},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null;for(var t=0;t<this.tileset.length;t++)this.dirty[t]=!0,this.vertexCount[t]=0,this.vertexBuffer[t]=null,this.bufferData[t]=null,this.vertexViewF32[t]=null,this.vertexViewU32[t]=null;this.gidMap=[],this.tileset=[],a.prototype.destroy.call(this)}});t.exports=u},function(t,e,i){var n=i(0),s=i(14),r=i(449),o=i(19),a=i(103),h=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.ScaleMode,s.Transform,s.Visible,s.ScrollFactor,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DynamicTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],(this.layer.tilemapLayer=this).tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=a.CullTiles,this._renderOrder=0,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,r),this.setOrigin(),this.setSize(this.layer.tileWidth*this.layer.width,this.layer.tileHeight*this.layer.height),this.initPipeline("TextureTintPipeline")},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;s<t.length;s++){var r=t[s];if("string"==typeof r&&(r=n.getTileset(r)),r){i.push(r);for(var o=r.firstgid,a=0;a<r.total;a++)e[o+a]=r}}this.gidMap=e,this.tileset=i},setRenderOrder:function(t){return"string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),0<=t&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(){this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this)},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i){return a.SetCollision(t,e,i,this.layer),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),g=i(31),f=i(208),v=i(20),u=i(29),p=i(78),y=i(242),o=i(207),m=i(55),h=i(103),c=i(99),s=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),-1<e.indexOf(t)&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(null!=e||(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var a=this.scene.sys.textures.get(e),h=this.getTilesetIndex(t);if(null===h&&this.format===u.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var l=this.tilesets[h];return l?(l.setTileSize(i,n),l.setSpacing(s,r),l.setImage(a)):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),(l=new c(t,o,i,n,s,r)).setImage(a),this.tilesets.push(l)),l},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof f))return null;var i=new o(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")||null!==a&&h.Copy(t,e,i,n,s,r,o,a),this},createBlankDynamicLayer:function(t,e,i,n,s,r,o,a){if(void 0===o&&(o=e.tileWidth),void 0===a&&(a=e.tileHeight),void 0===s&&(s=this.width),void 0===r&&(r=this.height),void 0===i&&(i=0),void 0===n&&(n=0),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var h,l=new p({name:t,tileWidth:o,tileHeight:a,width:s,height:r}),u=0;u<r;u++){h=[];for(var c=0;c<s;c++)h.push(new m(l,-1,c,u,o,a,this.tileWidth,this.tileHeight));l.data.push(h)}this.layers.push(l),this.currentLayerIndex=this.layers.length-1;var d=new f(this.scene,this,this.currentLayerIndex,e,i,n);return d.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(d),d},createDynamicLayer:function(t,e,i,n){var s=this.getLayerIndex(t);if(null===s)return console.warn("Invalid Tilemap Layer ID: "+t),null;if(this.layers[s].tilemapLayer)return console.warn("Tilemap Layer ID already exists:"+t),null;this.currentLayerIndex=s,void 0===i&&this.layers[s].x&&(i=this.layers[s].x),void 0===n&&this.layers[s].y&&(n=this.layers[s].y);var r=new f(this.scene,this,s,e,i,n);return r.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(r),r},createFromObjects:function(t,e,i,n){void 0===i&&(i={}),void 0===n&&(n=this.scene);var s=this.getObjectLayer(t);if(s){for(var r=s.objects,o=[],a=0;a<r.length;a++){var h=!1,l=r[a];if((void 0!==l.gid&&"number"==typeof e&&l.gid===e||void 0!==l.id&&"number"==typeof e&&l.id===e||void 0!==l.name&&"string"==typeof e&&l.name===e)&&(h=!0),h){var u=v({},i,l.properties);u.x=l.x,u.y=l.y;var c=this.scene.make.sprite(u);c.name=l.name,l.width&&(c.displayWidth=l.width),l.height&&(c.displayHeight=l.height);var d={x:c.originX*c.displayWidth,y:(c.originY-1)*c.displayHeight};if(l.rotation){var f=g(l.rotation);y(d,f),c.rotation=f}for(var p in c.x+=d.x,c.y+=d.y,void 0===l.flippedHorizontal&&void 0===l.flippedVertical||c.setFlip(l.flippedHorizontal,l.flippedVertical),l.visible||(c.visible=!1),l.properties)c.hasOwnProperty(p)||c.setData(p,l.properties[p]);o.push(c)}}return o}console.warn("Cannot create from object. Invalid objectgroup name given: "+t)},createFromTiles:function(t,e,i,n,s,r){return null===(r=this.getLayer(r))?null:h.CreateFromTiles(t,e,i,n,s,r)},createStaticLayer:function(t,e,i,n){var s=this.getLayerIndex(t);if(null===s)return console.warn("Invalid Tilemap Layer ID: "+t),null;if(this.layers[s].tilemapLayer)return console.warn("Tilemap Layer ID already exists:"+t),null;this.currentLayerIndex=s,void 0===i&&this.layers[s].x&&(i=this.layers[s].x),void 0===n&&this.layers[s].y&&(n=this.layers[s].y);var r=new o(this.scene,this,s,e,i,n);return r.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(r),r},destroy:function(){this.removeAllLayers(),this.tilesets.length=0,this.objects.length=0,this.scene=void 0},fill:function(t,e,i,n,s,r,o){return o=this.getLayer(o),this._isStaticCall(o,"fill")||null!==o&&h.Fill(t,e,i,n,s,r,o),this},filterObjects:function(t,e,i){if("string"==typeof t){var n=t;if(!(t=this.getObjectLayer(t)))return console.warn("No object layer found with the name: "+n),null}return t.objects.filter(e,i)},filterTiles:function(t,e,i,n,s,r,o,a){return null===(a=this.getLayer(a))?null:h.FilterTiles(t,e,i,n,s,r,o,a)},findByIndex:function(t,e,i,n){return null===(n=this.getLayer(n))?null:h.FindByIndex(t,e,i,n)},findObject:function(t,e,i){if("string"==typeof t){var n=t;if(!(t=this.getObjectLayer(t)))return console.warn("No object layer found with the name: "+n),null}return t.objects.find(e,i)||null},findTile:function(t,e,i,n,s,r,o,a){return null===(a=this.getLayer(a))?null:h.FindTile(t,e,i,n,s,r,o,a)},forEachTile:function(t,e,i,n,s,r,o,a){return null!==(a=this.getLayer(a))&&h.ForEachTile(t,e,i,n,s,r,o,a),this},getImageIndex:function(t){return this.getIndex(this.images,t)},getIndex:function(t,e){for(var i=0;i<t.length;i++)if(t[i].name===e)return i;return null},getLayer:function(t){var e=this.getLayerIndex(t);return null!==e?this.layers[e]:null},getObjectLayer:function(t){var e=this.getIndex(this.objects,t);return null!==e?this.objects[e]:null},getLayerIndex:function(t){return void 0===t?this.currentLayerIndex:"string"==typeof t?this.getLayerIndexByName(t):"number"==typeof t&&t<this.layers.length?t:t instanceof o||t instanceof f?t.layerIndex:null},getLayerIndexByName:function(t){return this.getIndex(this.layers,t)},getTileAt:function(t,e,i,n){return null===(n=this.getLayer(n))?null:h.GetTileAt(t,e,i,n)},getTileAtWorldXY:function(t,e,i,n,s){return null===(s=this.getLayer(s))?null:h.GetTileAtWorldXY(t,e,i,n,s)},getTilesWithin:function(t,e,i,n,s,r){return null===(r=this.getLayer(r))?null:h.GetTilesWithin(t,e,i,n,s,r)},getTilesWithinShape:function(t,e,i,n){return null===(n=this.getLayer(n))?null:h.GetTilesWithinShape(t,e,i,n)},getTilesWithinWorldXY:function(t,e,i,n,s,r,o){return null===(o=this.getLayer(o))?null:h.GetTilesWithinWorldXY(t,e,i,n,s,r,o)},getTileset:function(t){var e=this.getIndex(this.tilesets,t);return null!==e?this.tilesets[e]:null},getTilesetIndex:function(t){return this.getIndex(this.tilesets,t)},hasTileAt:function(t,e,i){return null===(i=this.getLayer(i))?null:h.HasTileAt(t,e,i)},hasTileAtWorldXY:function(t,e,i,n){return null===(n=this.getLayer(n))?null:h.HasTileAtWorldXY(t,e,i,n)},layer:{get:function(){return this.layers[this.currentLayerIndex]},set:function(t){this.setLayer(t)}},putTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"putTileAt")?null:null===s?null:h.PutTileAt(t,e,i,n,s)},putTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"putTileAtWorldXY")?null:null===r?null:h.PutTileAtWorldXY(t,e,i,n,s,r)},putTilesAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"putTilesAt")||null!==s&&h.PutTilesAt(t,e,i,n,s),this},randomize:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"randomize")||null!==r&&h.Randomize(t,e,i,n,s,r),this},calculateFacesAt:function(t,e,i){return null===(i=this.getLayer(i))||h.CalculateFacesAt(t,e,i),this},calculateFacesWithin:function(t,e,i,n,s){return null===(s=this.getLayer(s))||h.CalculateFacesWithin(t,e,i,n,s),this},removeAllLayers:function(){for(var t=0;t<this.layers.length;t++)this.layers[t].tilemapLayer&&this.layers[t].tilemapLayer.destroy();return this.layers.length=0,this.currentLayerIndex=0,this},removeTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"removeTileAt")?null:null===s?null:h.RemoveTileAt(t,e,i,n,s)},removeTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"removeTileAtWorldXY")?null:null===r?null:h.RemoveTileAtWorldXY(t,e,i,n,s,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))||h.RenderDebug(t,e,i),this},replaceByIndex:function(t,e,i,n,s,r,o){return o=this.getLayer(o),this._isStaticCall(o,"replaceByIndex")||null!==o&&h.ReplaceByIndex(t,e,i,n,s,r,o),this},setCollision:function(t,e,i,n){return null===(n=this.getLayer(n))||h.SetCollision(t,e,i,n),this},setCollisionBetween:function(t,e,i,n,s){return null===(s=this.getLayer(s))||h.SetCollisionBetween(t,e,i,n,s),this},setCollisionByProperty:function(t,e,i,n){return null===(n=this.getLayer(n))||h.SetCollisionByProperty(t,e,i,n),this},setCollisionByExclusion:function(t,e,i,n){return null===(n=this.getLayer(n))||h.SetCollisionByExclusion(t,e,i,n),this},setCollisionFromCollisionGroup:function(t,e,i){return null===(i=this.getLayer(i))||h.SetCollisionFromCollisionGroup(t,e,i),this},setTileIndexCallback:function(t,e,i,n){return null===(n=this.getLayer(n))||h.SetTileIndexCallback(t,e,i,n),this},setTileLocationCallback:function(t,e,i,n,s,r,o){return null===(o=this.getLayer(o))||h.SetTileLocationCallback(t,e,i,n,s,r,o),this},setLayer:function(t){var e=this.getLayerIndex(t);return null!==e&&(this.currentLayerIndex=e),this},setBaseTileSize:function(t,e){this.tileWidth=t,this.tileHeight=e,this.widthInPixels=this.width*t,this.heightInPixels=this.height*e;for(var i=0;i<this.layers.length;i++){this.layers[i].baseTileWidth=t,this.layers[i].baseTileHeight=e;for(var n=this.layers[i].data,s=this.layers[i].width,r=this.layers[i].height,o=0;o<r;++o)for(var a=0;a<s;++a){var h=n[o][a];null!==h&&h.setSize(void 0,void 0,t,e)}}return this},setLayerTileSize:function(t,e,i){if(null===(i=this.getLayer(i)))return this;i.tileWidth=t,i.tileHeight=e;for(var n=i.data,s=i.width,r=i.height,o=0;o<r;++o)for(var a=0;a<s;++a){var h=n[o][a];null!==h&&h.setSize(t,e)}return this},shuffle:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"shuffle")||null!==s&&h.Shuffle(t,e,i,n,s),this},swapByIndex:function(t,e,i,n,s,r,o){return o=this.getLayer(o),this._isStaticCall(o,"swapByIndex")||null!==o&&h.SwapByIndex(t,e,i,n,s,r,o),this},tileToWorldX:function(t,e,i){return null===(i=this.getLayer(i))?null:h.TileToWorldX(t,e,i)},tileToWorldY:function(t,e,i){return null===(i=this.getLayer(i))?null:h.TileToWorldY(t,e,i)},tileToWorldXY:function(t,e,i,n,s){return null===(s=this.getLayer(s))?null:h.TileToWorldXY(t,e,i,n,s)},weightedRandomize:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"weightedRandomize")||null!==r&&h.WeightedRandomize(t,e,i,n,s,r),this},worldToTileX:function(t,e,i,n){return null===(n=this.getLayer(n))?null:h.WorldToTileX(t,e,i,n)},worldToTileY:function(t,e,i,n){return null===(n=this.getLayer(n))?null:h.WorldToTileY(t,e,i,n)},worldToTileXY:function(t,e,i,n,s,r){return null===(r=this.getLayer(r))?null:h.WorldToTileXY(t,e,i,n,s,r)},_isStaticCall:function(t,e){return t.tilemapLayer instanceof o&&(console.warn(e+": You cannot change the tiles in a static tilemap layer"),!0)}});t.exports=s},function(t,e,i){var a=i(29),h=i(77),l=i(451),u=i(450);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var n=0,s=0,r=0;r<e.layer.length;r++)e.layer[r].width>n&&(n=e.layer[r].width),e.layer[r].height>s&&(s=e.layer[r].height);var o=new h({width:n,height:s,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:a.WELTMEISTER});return o.layers=l(e,i),o.tilesets=u(e),o}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","object layer"),this.opacity=s(t,"opacity",1),this.properties=s(t,"properties",{}),this.propertyTypes=s(t,"propertytypes",{}),this.type=s(t,"type","objectgroup"),this.visible=s(t,"visible",!0),this.objects=s(t,"objects",[])}});t.exports=r},function(t,e,i){var r=i(455),o=i(214),a=function(t){return{x:t.x,y:t.y}},h=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var n=r(t,h);if(n.x+=e,n.y+=i,t.gid){var s=o(t.gid);n.gid=s.gid,n.flippedHorizontal=s.flippedHorizontal,n.flippedVertical=s.flippedVertical,n.flippedAntiDiagonal=s.flippedAntiDiagonal}else t.polyline?n.polyline=t.polyline.map(a):t.polygon?n.polygon=t.polygon.map(a):t.ellipse?(n.ellipse=t.ellipse,n.width=t.width,n.height=t.height):t.text?(n.width=t.width,n.height=t.height,n.text=t.text):(n.rectangle=!0,n.width=t.width,n.height=t.height);return n}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|n,this.imageMargin=0|s,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},addImage:function(t,e){return this.images.push({gid:t,image:e}),this.total++,this}});t.exports=n},function(t,e){t.exports=function(t){var e=Boolean(2147483648&t),i=Boolean(1073741824&t),n=Boolean(536870912&t);t&=536870911;var s=0,r=!1;return e&&i&&n?(s=Math.PI/2,r=!0):e&&i&&!n?(s=Math.PI,r=!1):e&&!i&&n?(s=Math.PI/2,r=!1):!e||i||n?!e&&i&&n?(s=3*Math.PI/2,r=!1):e||!i||n?e||i||!n?e||i||n||(s=0,r=!1):(s=3*Math.PI/2,r=!0):(s=Math.PI,r=!0):r=!(s=0),{gid:t,flippedHorizontal:e,flippedVertical:i,flippedAntiDiagonal:n,rotation:s,flipped:r}}},function(t,e,i){var r=i(29),o=i(77),a=i(459),h=i(457),l=i(456),u=i(454),c=i(453),d=i(452);t.exports=function(t,e,i){if("orthogonal"!==e.orientation)return console.warn("Only orthogonal map types are supported in this version of Phaser"),null;var n=new o({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:e.orientation,format:r.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder});n.layers=a(e,i),n.images=h(e);var s=l(e);return n.tilesets=s.tilesets,n.imageCollections=s.imageCollections,n.objects=u(e),n.tiles=c(n),d(n),n}},function(t,e,i){var a=i(29),h=i(133);t.exports=function(t,e,i,n,s){var r=e.trim().split("\n").map(function(t){return t.split(",")}),o=h(t,r,i,n,s);return o.format=a.CSV,o}},function(t,e,i){var a=i(29),h=i(133),l=i(216),u=i(215),c=i(210);t.exports=function(t,e,i,n,s,r){var o;switch(e){case a.ARRAY_2D:o=h(t,i,n,s,r);break;case a.CSV:o=l(t,i,n,s,r);break;case a.TILED_JSON:o=u(t,i,r);break;case a.WELTMEISTER:o=c(t,i,r);break;default:console.warn("Unrecognized tilemap data format: "+e),o=null}return o}},function(t,e,i){var o=i(55),a=i(79),h=i(136);t.exports=function(t,e,i,n,s){if(void 0===i&&(i=!1),void 0===n&&(n=!0),!a(t,e,s))return null;var r=s.data[e][t];return null===r?null:(s.data[e][t]=i?null:new o(s,-1,t,e,r.width,r.height),n&&r&&r.collides&&h(t,e,s),r)}},function(t,e,i){var s=i(79);t.exports=function(t,e,i){if(s(t,e,i)){var n=i.data[e][t];return null!==n&&-1<n.index}return!1}},function(t,e,i){var l=i(17);t.exports=function(t,e,i,n,s,r,o){for(var a=l(i,n,s,r,null,o),h=0;h<a.length;h++)a[h]&&a[h].index===t&&(a[h].index=e)}},function(t,e,i){var n=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game,this.scene,this.systems},init:function(){},start:function(){},stop:function(){},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},function(t,e,i){var u={};t.exports=u;var n=i(195);u._motionWakeThreshold=.18,u._motionSleepThreshold=.08,u._minBias=.9,u.update=function(t,e){for(var i=e*e*e,n=0;n<t.length;n++){var s=t[n],r=s.speed*s.speed+s.angularSpeed*s.angularSpeed;if(0===s.force.x&&0===s.force.y){var o=Math.min(s.motion,r),a=Math.max(s.motion,r);s.motion=u._minBias*o+(1-u._minBias)*a,0<s.sleepThreshold&&s.motion<u._motionSleepThreshold*i?(s.sleepCounter+=1,s.sleepCounter>=s.sleepThreshold&&u.set(s,!0)):0<s.sleepCounter&&(s.sleepCounter-=1)}else u.set(s,!1)}},u.afterCollisions=function(t,e){for(var i=e*e*e,n=0;n<t.length;n++){var s=t[n];if(s.isActive){var r=s.collision,o=r.bodyA.parent,a=r.bodyB.parent;if(!(o.isSleeping&&a.isSleeping||o.isStatic||a.isStatic)&&(o.isSleeping||a.isSleeping)){var h=o.isSleeping&&!o.isStatic?o:a,l=h===o?a:o;!h.isStatic&&l.motion>u._motionWakeThreshold*i&&u.set(h,!1)}}}},u.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},function(t,e){t.exports={NONE:0,A:1,B:2,BOTH:3}},function(t,e){t.exports={NEVER:0,LITE:1,PASSIVE:2,ACTIVE:4,FIXED:8}},function(t,e,i){var n=i(40),s=i(0),r=i(35),o=i(39),a=i(3),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,(t.body=this).gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i,n){void 0===i&&(i=this.offset.x),void 0===n&&(n=this.offset.y);var s=this.gameObject;return!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),this.offset.set(i,n),this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),0<t?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var a=i(313);function n(t){if(!(this instanceof n))return new n(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function u(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function f(t,e){y(t,0,t.children.length,e,t)}function y(t,e,i,n,s){s||(s=g(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var r,o=e;o<i;o++)r=t.children[o],c(s,t.leaf?n(r):r);return s}function c(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function r(t,e){return t.minX-e.minX}function o(t,e){return t.minY-e.minY}function m(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function l(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,n,s){for(var r,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=n||(r=e+Math.ceil((i-e)/n/2)*n,a(t,r,e,i,s),o.push(e,r,r,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!l(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s<r;s++)o=e.children[s],l(t,a=e.leaf?n(o):o)&&(e.leaf?i.push(o):p(t,a)?this._all(o,i):h.push(o));e=h.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!l(t,e))return!1;for(var n,s,r,o,a=[];e;){for(n=0,s=e.children.length;n<s;n++)if(r=e.children[n],l(t,o=e.leaf?i(r):r)){if(e.leaf||p(t,o))return!0;a.push(r)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var s=this.data;this.data=n,n=s}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=g([]),this},remove:function(t,e){if(!t)return this;for(var i,n,s,r,o=this.data,a=this.toBBox(t),h=[],l=[];o||h.length;){if(o||(o=h.pop(),n=h[h.length-1],i=l.pop(),r=!0),o.leaf&&-1!==(s=u(t,o.children,e)))return o.children.splice(s,1),h.push(o),this._condense(h),this;r||o.leaf||!p(o,a)?n?(i++,o=n.children[i],r=!1):o=null:(h.push(o),l.push(i),i=0,o=(n=o).children[0])}return this},toBBox:function(t){return t},compareMinX:r,compareMinY:o,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,n){var s,r=i-e+1,o=this._maxEntries;if(r<=o)return f(s=g(t.slice(e,i+1)),this.toBBox),s;n||(n=Math.ceil(Math.log(r)/Math.log(o)),o=Math.ceil(r/Math.pow(o,n-1))),(s=g([])).leaf=!1,s.height=n;var a,h,l,u,c=Math.ceil(r/o),d=c*Math.ceil(Math.sqrt(o));for(v(t,e,i,d,this.compareMinX),a=e;a<=i;a+=d)for(v(t,a,l=Math.min(a+d-1,i),c,this.compareMinY),h=a;h<=l;h+=c)u=Math.min(h+c-1,l),s.children.push(this._build(t,h,u,n-1));return f(s,this.toBBox),s},_chooseSubtree:function(t,e,i,n){for(var s,r,o,a,h,l,u,c;n.push(e),!e.leaf&&n.length-1!==i;){for(u=c=1/0,s=0,r=e.children.length;s<r;s++)h=m(o=e.children[s]),d=t,f=o,(l=(Math.max(f.maxX,d.maxX)-Math.min(f.minX,d.minX))*(Math.max(f.maxY,d.maxY)-Math.min(f.minY,d.minY))-h)<c?(c=l,u=h<u?h:u,a=o):l===c&&h<u&&(u=h,a=o);e=a||e.children[0]}var d,f;return e},_insert:function(t,e,i){var n=this.toBBox,s=i?t:n(t),r=[],o=this._chooseSubtree(s,this.data,e,r);for(o.children.push(t),c(o,s);0<=e&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),o=g(i.children.splice(r,i.children.length-r));o.height=i.height,o.leaf=i.leaf,f(i,this.toBBox),f(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,f(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,a,h,l,u,c,d,f,p,g,v;for(h=l=1/0,n=e;n<=i-e;n++)c=s=y(t,0,n,this.toBBox),d=r=y(t,n,i,this.toBBox),f=Math.max(c.minX,d.minX),p=Math.max(c.minY,d.minY),g=Math.min(c.maxX,d.maxX),v=Math.min(c.maxY,d.maxY),o=Math.max(0,g-f)*Math.max(0,v-p),a=m(s)+m(r),o<h?(h=o,u=n,l=a<l?a:l):o===h&&a<l&&(l=a,u=n);return u},_chooseSplitAxis:function(t,e,i){var n=t.leaf?this.compareMinX:r,s=t.leaf?this.compareMinY:o;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,s)&&t.children.sort(n)},_allDistMargin:function(t,e,i,n){t.children.sort(n);var s,r,o=this.toBBox,a=y(t,0,e,o),h=y(t,i-e,i,o),l=d(a)+d(h);for(s=e;s<i-e;s++)r=t.children[s],c(a,t.leaf?o(r):r),l+=d(a);for(s=i-e-1;e<=s;s--)r=t.children[s],c(h,t.leaf?o(r):r),l+=d(h);return l},_adjustParentBBoxes:function(t,e,i){for(var n=i;0<=n;n--)c(e[n],t)},_condense:function(t){for(var e,i=t.length-1;0<=i;i--)0===t[i].children.length?0<i?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():f(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(){this._pending=[],this._active=[],this._destroy=[],this._toProcess=0},add:function(t){return this._pending.push(t),this._toProcess++,this},remove:function(t){return this._destroy.push(t),this._toProcess++,this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;t<i.length;t++){e=i[t];var s=n.indexOf(e);-1!==s&&n.splice(s,1)}for(i.length=0,i=this._pending,t=0;t<i.length;t++)e=i[t],this._active.push(e);return i.length=0,this._toProcess=0,this._active},getActive:function(){return this._active},destroy:function(){this._pending=[],this._active=[],this._destroy=[]}});t.exports=n},function(t,e,i){var o=i(35);t.exports=function(t,e,i,n){var s=0,r=t.deltaAbsY()+e.deltaAbsY()+n;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(s=t.bottom-e.y)>r&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?s=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===o.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===o.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dy<e._dy&&(-(s=t.y-e.bottom)>r&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?s=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===o.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===o.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=s,e.overlapY=s}},function(t,e,i){var o=i(35);t.exports=function(t,e,i,n){var s=0,r=t.deltaAbsX()+e.deltaAbsX()+n;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(s=t.right-e.x)>r&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?s=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===o.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===o.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dx<e._dx&&(-(s=t.x-e.width-e.x)>r&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?s=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===o.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===o.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=s,e.overlapX=s}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(40),s=i(0),r=i(35),a=i(172),o=i(9),h=i(39),l=i(3),u=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x,e.y),this.prev=new l(e.x,e.y),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=n,this.sourceWidth=i,this.sourceHeight=n,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(n/2),this.center=new l(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.isMoving=!1,this.stopVelocityOnCollide=!0,this.physicsType=r.DYNAMIC_BODY,this._reset=!0,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._bounds=new o},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=a(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var n=!1;if(this.syncBounds){var s=t.getBounds(this._bounds);this.width=s.width,this.height=s.height,n=!0}else{var r=Math.abs(e.scaleX),o=Math.abs(e.scaleY);this._sx===r&&this._sy===o||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*o,this._sx=r,this._sy=o,n=!0)}n&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},update:function(t){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.none=!0,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.updateBounds();var e=this.transform;if(this.position.x=e.x+e.scaleX*(this.offset.x-e.displayOriginX),this.position.y=e.y+e.scaleY*(this.offset.y-e.displayOriginY),this.updateCenter(),this.rotation=e.rotation,this.preRotation=this.rotation,this._reset&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves){this.world.updateMotion(this,t);var i=this.velocity.x,n=this.velocity.y;this.newVelocity.set(i*t,n*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(n,i),this.speed=Math.sqrt(i*i+n*n),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit("worldbounds",this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y,this.moves&&(0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:0<this._dx&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:0<this._dy&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.gameObject.x+=this._dx,this.gameObject.y+=this._dy,this._reset=!0),this._dx<0?this.facing=r.FACING_LEFT:0<this._dx&&(this.facing=r.FACING_RIGHT),this._dy<0?this.facing=r.FACING_UP:0<this._dy&&(this.facing=r.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},checkWorldBounds:function(){var t=this.position,e=this.world.bounds,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y;return t.x<e.x&&i.left?(t.x=e.x,this.velocity.x*=n,this.blocked.left=!0,this.blocked.none=!1):this.right>e.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,this.blocked.none=!1),t.y<e.y&&i.up?(t.y=e.y,this.velocity.y*=s,this.blocked.up=!0,this.blocked.none=!1):this.bottom>e.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,this.blocked.none=!1),!this.blocked.none},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),0<t?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft(this.position),this.prev.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return 0<this._dx?this._dx:-this._dx},deltaAbsY:function(){return 0<this._dy?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height)),this.debugShowVelocity&&(t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t){return void 0===t&&(t=!0),this.collideWorldBounds=t,this},setVelocity:function(t,e){return this.velocity.set(t,e),this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){var e=this.velocity.x=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},function(t,e,i){var n=i(232),f=i(23),s=i(0),o=i(231),p=i(35),S=i(52),r=i(11),g=i(248),v=i(247),y=i(246),_=i(230),A=i(229),a=i(4),h=i(228),m=i(514),l=i(9),u=i(227),x=i(513),d=i(508),w=i(507),c=i(95),b=i(225),T=i(226),C=i(38),M=i(3),P=i(53),E=new s({Extends:r,initialize:function(t,e){r.call(this),this.scene=t,this.bodies=new c,this.staticBodies=new c,this.pendingDestroy=new c,this.colliders=new h,this.gravity=new M(a(e,"gravity.x",0),a(e,"gravity.y",0)),this.bounds=new l(a(e,"x",0),a(e,"y",0),a(e,"width",t.sys.game.config.width),a(e,"height",t.sys.game.config.height)),this.checkCollision={up:a(e,"checkCollision.up",!0),down:a(e,"checkCollision.down",!0),left:a(e,"checkCollision.left",!0),right:a(e,"checkCollision.right",!0)},this.fps=a(e,"fps",60),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=a(e,"timeScale",1),this.OVERLAP_BIAS=a(e,"overlapBias",4),this.TILE_BIAS=a(e,"tileBias",16),this.forceX=a(e,"forceX",!1),this.isPaused=a(e,"isPaused",!1),this._total=0,this.drawDebug=a(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:a(e,"debugShowBody",!0),debugShowStaticBody:a(e,"debugShowStaticBody",!0),debugShowVelocity:a(e,"debugShowVelocity",!0),bodyDebugColor:a(e,"debugBodyColor",16711935),staticBodyDebugColor:a(e,"debugStaticBodyColor",255),velocityDebugColor:a(e,"debugVelocityColor",65280)},this.maxEntries=a(e,"maxEntries",16),this.useTree=a(e,"useTree",!0),this.tree=new u(this.maxEntries),this.staticTree=new u(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new C,this._tempMatrix2=new C,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=p.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];if(n.isParent)for(var s=n.getChildren(),r=0;r<s.length;r++){var o=s[r];o.isParent?this.enable(o,e):this.enableBody(o,e)}else this.enableBody(n,e)}},enableBody:function(t,e){return void 0===e&&(e=p.DYNAMIC_BODY),t.body||(e===p.DYNAMIC_BODY?t.body=new n(this,t):e===p.STATIC_BODY&&(t.body=new b(this,t))),this.add(t.body),t},add:function(t){return t.physicsType===p.DYNAMIC_BODY?this.bodies.set(t):t.physicsType===p.STATIC_BODY&&(this.staticBodies.set(t),this.staticTree.insert(t)),t.enable=!0,t},disable:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];if(i.isParent)for(var n=i.getChildren(),s=0;s<n.length;s++){var r=n[s];r.isParent?this.disable(r):this.disableBody(r.body)}else this.disableBody(i.body)}},disableBody:function(t){this.remove(t),t.enable=!1},remove:function(t){t.physicsType===p.DYNAMIC_BODY?(this.tree.remove(t),this.bodies.delete(t)):t.physicsType===p.STATIC_BODY&&(this.staticBodies.delete(t),this.staticTree.remove(t))},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},setBounds:function(t,e,i,n,s,r,o,a){return this.bounds.setTo(t,e,i,n),void 0!==s&&this.setBoundsCollision(s,r,o,a),this},setBoundsCollision:function(t,e,i,n){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===n&&(n=!0),this.checkCollision.left=t,this.checkCollision.right=e,this.checkCollision.up=i,this.checkCollision.down=n,this},pause:function(){return this.isPaused=!0,this.emit("pause"),this},resume:function(){return this.isPaused=!1,this.emit("resume"),this},addCollider:function(t,e,i,n,s){void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i);var r=new o(this,!1,t,e,i,n,s);return this.colliders.add(r),r},addOverlap:function(t,e,i,n,s){void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i);var r=new o(this,!0,t,e,i,n,s);return this.colliders.add(r),r},removeCollider:function(t){return this.colliders.remove(t),this},setFPS:function(t){return this.fps=t,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this},update:function(t,e){if(!this.isPaused&&0!==this.bodies.size){var i=0,n=this._frameTime,s=this._frameTimeMS*this.timeScale;for(this._elapsed+=e;this._elapsed>=s;)this._elapsed-=s,i++,this.step(n);this.stepsLastFrame=i}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e<s;e++)(i=n[e]).enable&&i.update(t);this.useTree&&(this.tree.clear(),this.tree.load(n));var r=this.colliders.update();for(e=0;e<r.length;e++){var o=r[e];o.active&&o.update()}for(s=n.length,e=0;e<s;e++)(i=n[e]).enable&&i.postUpdate()},postUpdate:function(){var t,e,i=this.bodies,n=this.staticBodies,s=this.pendingDestroy,r=i.entries,o=r.length;if(this.drawDebug){var a=this.debugGraphic;for(a.clear(),t=0;t<o;t++)(e=r[t]).willDrawDebug()&&e.drawDebug(a);for(o=(r=n.entries).length,t=0;t<o;t++)(e=r[t]).willDrawDebug()&&e.drawDebug(a)}if(0<s.size){var h=this.tree,l=this.staticTree;for(o=(r=s.entries).length,t=0;t<o;t++)(e=r[t]).physicsType===p.DYNAMIC_BODY?(h.remove(e),i.delete(e)):e.physicsType===p.STATIC_BODY&&(l.remove(e),n.delete(e)),e.world=void 0,e.gameObject=void 0;s.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,n=t.angularAcceleration,s=t.angularDrag,r=t.maxAngular;n?i+=n*e:t.allowDrag&&s&&(v(i-(s*=e),0,.1)?i-=s:y(i+s,0,.1)?i+=s:i=0);var o=(i=f(i,-r,r))-t.angularVelocity;t.angularVelocity+=o,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,n=t.acceleration.x,s=t.drag.x,r=t.maxVelocity.x,o=t.velocity.y,a=t.acceleration.y,h=t.drag.y,l=t.maxVelocity.y,u=t.speed,c=t.allowDrag,d=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,o+=(this.gravity.y+t.gravity.y)*e),n?i+=n*e:c&&s&&(d?(i*=s,g(u,0,.001)&&(i=0)):v(i-(s*=e),0,.01)?i-=s:y(i+s,0,.01)?i+=s:i=0),a?o+=a*e:c&&h&&(d?(o*=h,g(u,0,.001)&&(o=0)):v(o-(h*=e),0,.01)?o-=h:y(o+h,0,.01)?o+=h:o=0),i=f(i,-r,r),o=f(o,-l,l),t.velocity.set(i,o)},separate:function(t,e,i,n,s){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(n,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,s);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=o.center;if((h.y<a.y||h.y>a.bottom)&&(h.x<a.x||h.x>a.right))return this.separateCircle(t,e,s)}var l=!1,u=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)<Math.abs(this.gravity.x+t.gravity.x)?(l=d(t,e,s,this.OVERLAP_BIAS),this.intersects(t,e)&&(u=w(t,e,s,this.OVERLAP_BIAS))):(u=w(t,e,s,this.OVERLAP_BIAS),this.intersects(t,e)&&(l=d(t,e,s,this.OVERLAP_BIAS)));var c=l||u;return c&&(s&&(t.onOverlap||e.onOverlap)?this.emit("overlap",t.gameObject,e.gameObject,t,e):(t.postUpdate(),e.postUpdate(),(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e))),c},separateCircle:function(t,e,i,n){_(t,e,!1,n),A(t,e,!1,n);var s=e.center.x-t.center.x,r=e.center.y-t.center.y,o=Math.atan2(r,s),a=0;if(t.isCircle!==e.isCircle){var h={x:e.isCircle?t.position.x:e.position.x,y:e.isCircle?t.position.y:e.position.y,right:e.isCircle?t.right:e.right,bottom:e.isCircle?t.bottom:e.bottom},l={x:t.isCircle?t.center.x:e.center.x,y:t.isCircle?t.center.y:e.center.y,radius:t.isCircle?t.halfWidth:e.halfWidth};l.y<h.y?l.x<h.x?a=S(l.x,l.y,h.x,h.y)-l.radius:h.right<l.x&&(a=S(l.x,l.y,h.right,h.y)-l.radius):h.bottom<l.y&&(l.x<h.x?a=S(l.x,l.y,h.x,h.bottom)-l.radius:h.right<l.x&&(a=S(l.x,l.y,h.right,h.bottom)-l.radius)),a*=-1}else a=t.halfWidth+e.halfWidth-S(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===a||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==a&&(t.onOverlap||e.onOverlap)&&this.emit("overlap",t.gameObject,e.gameObject,t,e),0!==a;var u=t.velocity.x,c=t.velocity.y,d=t.mass,f=e.velocity.x,p=e.velocity.y,g=e.mass,v=u*Math.cos(o)+c*Math.sin(o),y=u*Math.sin(o)-c*Math.cos(o),m=f*Math.cos(o)+p*Math.sin(o),x=f*Math.sin(o)-p*Math.cos(o),w=((d-g)*v+2*g*m)/(d+g),b=(2*d*v+(g-d)*m)/(d+g);t.immovable||(t.velocity.x=(w*Math.cos(o)-y*Math.sin(o))*t.bounce.x,t.velocity.y=(y*Math.cos(o)+w*Math.sin(o))*t.bounce.y,u=t.velocity.x,c=t.velocity.y),e.immovable||(e.velocity.x=(b*Math.cos(o)-x*Math.sin(o))*e.bounce.x,e.velocity.y=(x*Math.cos(o)+b*Math.sin(o))*e.bounce.y,f=e.velocity.x,p=e.velocity.y),Math.abs(o)<Math.PI/2?0<u&&!t.immovable&&u<f?t.velocity.x*=-1:f<0&&!e.immovable&&u<f?e.velocity.x*=-1:0<c&&!t.immovable&&c<p?t.velocity.y*=-1:p<0&&!e.immovable&&c<p&&(e.velocity.y*=-1):Math.abs(o)>Math.PI/2&&(u<0&&!t.immovable&&f<u?t.velocity.x*=-1:0<f&&!e.immovable&&f<u?e.velocity.x*=-1:c<0&&!t.immovable&&p<c?t.velocity.y*=-1:0<p&&!e.immovable&&p<u&&(e.velocity.y*=-1));var T=this._frameTime;return t.immovable||(t.x+=t.velocity.x*T-a*Math.cos(o),t.y+=t.velocity.y*T-a*Math.sin(o)),e.immovable||(e.x+=e.velocity.x*T+a*Math.cos(o),e.y+=e.velocity.y*T+a*Math.sin(o)),(t.onCollide||e.onCollide)&&this.emit("collide",t.gameObject,e.gameObject,t,e),t.postUpdate(),e.postUpdate(),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?S(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=f(t.center.x,e.left,e.right),n=f(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;o<e.length;o++)this.collideHandler(t,e[o],i,n,s,r);else if(a&&!h)for(o=0;o<t.length;o++)this.collideHandler(t[o],e,i,n,s,r);else for(o=0;o<t.length;o++)for(var l=0;l<e.length;l++)this.collideHandler(t[o],e[l],i,n,s,r);else this.collideHandler(t,e,i,n,s,r);return 0<this._total},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body||(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),0))},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,a,h,l=t.body;if(0!==e.length&&l&&l.enable)if(this.useTree){var u=this.treeMinMax;u.minX=l.left,u.minY=l.top,u.maxX=l.right,u.maxY=l.bottom;var c=e.physicsType===p.DYNAMIC_BODY?this.tree.search(u):this.staticTree.search(u);for(a=c.length,o=0;o<a;o++)l!==(h=c[o])&&e.contains(h.gameObject)&&this.separate(l,h,n,s,r)&&(i&&i.call(s,l.gameObject,h.gameObject),this._total++)}else{var d=e.getChildren(),f=e.children.entries.indexOf(t);for(a=d.length,o=0;o<a;o++)(h=d[o].body)&&o!==f&&h.enable&&this.separate(l,h,n,s,r)&&(i&&i.call(s,l.gameObject,h.gameObject),this._total++)}},collideGroupVsTilemapLayer:function(t,e,i,n,s,r){var o=t.getChildren();if(0===o.length)return!1;for(var a=!1,h=0;h<o.length;h++)o[h].body&&this.collideSpriteVsTilemapLayer(o[h],e,i,n,s,r)&&(a=!0);return a},collideSpriteVsTilemapLayer:function(t,e,i,n,s,r){var o=t.body;if(!o.enable)return!1;var a=o.position.x,h=o.position.y,l=o.width,u=o.height,c=e.layer;if(c.tileWidth>c.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f,p=e.getTilesWithinWorldXY(a,h,l,u);if(0===p.length)return!1;for(var g={left:0,right:0,top:0,bottom:0},v=0;v<p.length;v++)f=p[v],g.left=e.tileToWorldX(f.x),g.top=e.tileToWorldY(f.y),f.baseHeight!==f.height&&(g.top-=(f.height-f.baseHeight)*e.scaleY),g.right=g.left+f.width*e.scaleX,g.bottom=g.top+f.height*e.scaleY,T(g,o)&&(!n||n.call(s,t,f))&&m(f,t)&&(r||x(v,o,f,g,e,this.TILE_BIAS))&&(this._total++,i&&i.call(s,t,f),r&&o.onOverlap?t.emit("overlap",o.gameObject,f,o,null):o.onCollide&&t.emit("collide",o.gameObject,f,o,null),o.postUpdate())},collideGroupVsGroup:function(t,e,i,n,s,r){if(0!==t.length&&0!==e.length)for(var o=t.getChildren(),a=0;a<o.length;a++)this.collideSpriteVsGroup(o[a],e,i,n,s,r)},wrap:function(t,e){t.body?this.wrapObject(t,e):t.getChildren?this.wrapArray(t.getChildren(),e):Array.isArray(t)?this.wrapArray(t,e):this.wrapObject(t,e)},wrapArray:function(t,e){for(var i=0;i<t.length;i++)this.wrapObject(t[i],e)},wrapObject:function(t,e){void 0===e&&(e=0),t.x=P(t.x,this.bounds.left-e,this.bounds.right+e),t.y=P(t.y,this.bounds.top-e,this.bounds.bottom+e)},shutdown:function(){this.tree.clear(),this.staticTree.clear(),this.bodies.clear(),this.staticBodies.clear(),this.colliders.destroy(),this.removeAllListeners()},destroy:function(){this.shutdown(),this.scene=null}});t.exports=E},function(t,e,i){var s=i(104),n=i(0),r=i(35),o=i(88),a=i(8),h=new n({Extends:o,initialize:function(t,e,i,n){i||n?a(i)?(n=i,i=null,n.createCallback=this.createCallbackHandler,n.removeCallback=this.removeCallbackHandler,n.createMultipleCallback=this.createMultipleCallbackHandler,n.classType=s):Array.isArray(i)&&a(i[0])&&(n=i,i=null,n.forEach(function(t){t.createCallback=this.createCallbackHandler,t.removeCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=s})):n={createCallback:this.createCallbackHandler,removeCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=r.STATIC_BODY,o.call(this,e,i,n)},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e<t.length;e++)t[e].body.reset();return this}});t.exports=h},function(t,e,i){var s=i(104),n=i(0),r=i(35),o=i(2),a=i(88),h=i(8),l=new n({Extends:a,initialize:function(t,e,i,n){i||n?h(i)?(n=i,i=null,n.createCallback=this.createCallbackHandler,n.removeCallback=this.removeCallbackHandler):Array.isArray(i)&&h(i[0])&&(n=i,i=null,n.forEach(function(t){t.createCallback=this.createCallbackHandler,t.removeCallback=this.removeCallbackHandler})):n={createCallback:this.createCallbackHandler,removeCallback:this.removeCallbackHandler},this.world=t,n.classType=o(n,"classType",s),this.physicsType=r.DYNAMIC_BODY,this.defaults={setCollideWorldBounds:o(n,"collideWorldBounds",!1),setAccelerationX:o(n,"accelerationX",0),setAccelerationY:o(n,"accelerationY",0),setAllowDrag:o(n,"allowDrag",!0),setAllowGravity:o(n,"allowGravity",!0),setAllowRotation:o(n,"allowRotation",!0),setBounceX:o(n,"bounceX",0),setBounceY:o(n,"bounceY",0),setDragX:o(n,"dragX",0),setDragY:o(n,"dragY",0),setEnable:o(n,"enable",!0),setGravityX:o(n,"gravityX",0),setGravityY:o(n,"gravityY",0),setFrictionX:o(n,"frictionX",0),setFrictionY:o(n,"frictionY",0),setVelocityX:o(n,"velocityX",0),setVelocityY:o(n,"velocityY",0),setAngularVelocity:o(n,"angularVelocity",0),setAngularAcceleration:o(n,"angularAcceleration",0),setAngularDrag:o(n,"angularDrag",0),setMass:o(n,"mass",1),setImmovable:o(n,"immovable",!1)},a.call(this,e,i,n)},createCallbackHandler:function(t){t.body||this.world.enableBody(t,r.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var n=this.getChildren(),s=0;s<n.length;s++)n[s].body.velocity.set(t+s*i,e+s*i);return this},setVelocityX:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),n=0;n<i.length;n++)i[n].body.velocity.x=t+n*e;return this},setVelocityY:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),n=0;n<i.length;n++)i[n].body.velocity.y=t+n*e;return this}});t.exports=l},function(t,e,i){t.exports={Acceleration:i(526),Angular:i(525),Bounce:i(524),Debug:i(523),Drag:i(522),Enable:i(521),Friction:i(520),Gravity:i(519),Immovable:i(518),Mass:i(517),Size:i(516),Velocity:i(515)}},function(t,e,i){var n=i(0),s=i(236),r=i(87),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},function(t,e,i){var r=i(237),o=i(104),n=i(0),a=i(35),s=i(235),h=i(234),l=new n({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,n,s){return this.world.addCollider(t,e,i,n,s)},overlap:function(t,e,i,n,s){return this.world.addOverlap(t,e,i,n,s)},existing:function(t,e){var i=e?a.STATIC_BODY:a.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,n){var s=new r(this.scene,t,e,i,n);return this.sys.displayList.add(s),this.world.enableBody(s,a.STATIC_BODY),s},image:function(t,e,i,n){var s=new r(this.scene,t,e,i,n);return this.sys.displayList.add(s),this.world.enableBody(s,a.DYNAMIC_BODY),s},staticSprite:function(t,e,i,n){var s=new o(this.scene,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),this.world.enableBody(s,a.STATIC_BODY),s},sprite:function(t,e,i,n){var s=new o(this.scene,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),this.world.enableBody(s,a.DYNAMIC_BODY),s},staticGroup:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new s(this.world,this.world.scene,t,e))},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=l},function(t,e,i){var n=i(0),s=i(138),r=i(241),a=new Int8Array([1,2,0]),h=new Float32Array([0,0,0]),o=new s(1,0,0),l=new s(0,1,0),u=new s,c=new r,d=new n({initialize:function(t,e,i,n){this.w="object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,n||0)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},set:function(t,e,i,n){return this.w="object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return 0<s&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(o).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):.999999<i?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+i,this.normalize())},setAxes:function(t,e,i){var n=c.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,d=e;if(1e-6<1-u){var f=Math.acos(u),p=Math.sin(f);c=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n,r=s?1/s:0;return this.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(0<n)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this.x=(i[7]-i[5])*e,this.y=(i[2]-i[6])*e,this.z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var r=a[s],o=a[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*o+o]+1),h[s]=.5*e,e=.5/e,h[r]=(i[3*r+s]+i[3*s+r])*e,h[o]=(i[3*o+s]+i[3*s+o])*e,this.x=h[0],this.y=h[1],this.z=h[2],this.w=(i[3*o+r]-i[3*r+o])*e}return this}});t.exports=d},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=n,t[13]=r,t[14]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],y=e*o-i*r,m=e*a-n*r,x=e*h-s*r,w=i*a-n*o,b=i*h-s*o,T=n*h-s*a,S=l*p-u*f,_=l*g-c*f,A=l*v-d*f,C=u*g-c*p,M=u*v-d*p,P=c*v-d*g,E=y*P-m*M+x*C+w*A-b*_+T*S;return E?(E=1/E,t[0]=(o*P-a*M+h*C)*E,t[1]=(n*M-i*P-s*C)*E,t[2]=(p*T-g*b+v*w)*E,t[3]=(c*b-u*T-d*w)*E,t[4]=(a*A-r*P-h*_)*E,t[5]=(e*P-n*A+s*_)*E,t[6]=(g*x-f*T-v*m)*E,t[7]=(l*T-c*x+d*m)*E,t[8]=(r*M-o*A+h*S)*E,t[9]=(i*A-e*M-s*S)*E,t[10]=(f*b-p*x+v*y)*E,t[11]=(u*x-l*b-d*y)*E,t[12]=(o*_-r*C-a*S)*E,t[13]=(e*C-i*_+n*S)*E,t[14]=(p*m-f*w-g*y)*E,t[15]=(l*w-u*m+c*y)*E,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return t[0]=o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),t[1]=-(i*(c*v-d*g)-u*(n*v-s*g)+p*(n*d-s*c)),t[2]=i*(a*v-h*g)-o*(n*v-s*g)+p*(n*h-s*a),t[3]=-(i*(a*d-h*c)-o*(n*d-s*c)+u*(n*h-s*a)),t[4]=-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),t[5]=e*(c*v-d*g)-l*(n*v-s*g)+f*(n*d-s*c),t[6]=-(e*(a*v-h*g)-r*(n*v-s*g)+f*(n*h-s*a)),t[7]=e*(a*d-h*c)-r*(n*d-s*c)+l*(n*h-s*a),t[8]=r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=t.val,x=m[0],w=m[1],b=m[2],T=m[3];return e[0]=x*i+w*o+b*u+T*p,e[1]=x*n+w*a+b*c+T*g,e[2]=x*s+w*h+b*d+T*v,e[3]=x*r+w*l+b*f+T*y,x=m[4],w=m[5],b=m[6],T=m[7],e[4]=x*i+w*o+b*u+T*p,e[5]=x*n+w*a+b*c+T*g,e[6]=x*s+w*h+b*d+T*v,e[7]=x*r+w*l+b*f+T*y,x=m[8],w=m[9],b=m[10],T=m[11],e[8]=x*i+w*o+b*u+T*p,e[9]=x*n+w*a+b*c+T*g,e[10]=x*s+w*h+b*d+T*v,e[11]=x*r+w*l+b*f+T*y,x=m[12],w=m[13],b=m[14],T=m[15],e[12]=x*i+w*o+b*u+T*p,e[13]=x*n+w*a+b*c+T*g,e[14]=x*s+w*h+b*d+T*v,e[15]=x*r+w*l+b*f+T*y,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},scale:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],d=i[2],f=i[3],p=i[4],g=i[5],v=i[6],y=i[7],m=i[8],x=i[9],w=i[10],b=i[11],T=n*n*l+h,S=s*n*l+r*a,_=r*n*l-s*a,A=n*s*l-r*a,C=s*s*l+h,M=r*s*l+n*a,P=n*r*l+s*a,E=s*r*l-n*a,k=r*r*l+h;return i[0]=u*T+p*S+m*_,i[1]=c*T+g*S+x*_,i[2]=d*T+v*S+w*_,i[3]=f*T+y*S+b*_,i[4]=u*A+p*C+m*M,i[5]=c*A+g*C+x*M,i[6]=d*A+v*C+w*M,i[7]=f*A+y*C+b*M,i[8]=u*P+p*E+m*k,i[9]=c*P+g*E+x*k,i[10]=d*P+v*E+w*k,i[11]=f*P+y*E+b*k,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,y=o*h,m=o*l;return i[0]=1-(f+g),i[1]=c+m,i[2]=d-y,i[3]=0,i[4]=c-m,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+y,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,y=r*h;return e[0]=1-(d+p),e[1]=u+y,e[2]=c-v,e[3]=0,e[4]=u-y,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),y=h*(g*=v)-l*(p*=v),m=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(y*y+m*m+x*x))?(y*=v=1/v,m*=v,x*=v):x=m=y=0;var w=p*x-g*m,b=g*y-f*x,T=f*m-p*y;return(v=Math.sqrt(w*w+b*b+T*T))?(w*=v=1/v,b*=v,T*=v):T=b=w=0,n[0]=y,n[1]=w,n[2]=f,n[3]=0,n[4]=m,n[5]=b,n[6]=p,n[7]=0,n[8]=x,n[9]=T,n[10]=g,n[11]=0,n[12]=-(y*s+m*r+x*o),n[13]=-(w*s+b*r+T*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),h.zero(),l.zero();var n=this.val,s=h.val,r=l.val,o=Math.sin(i),a=Math.cos(i);return n[10]=1,n[15]=1,n[0]=a,n[1]=o,n[4]=-o,n[5]=a,o=Math.sin(e),a=Math.cos(e),s[0]=1,s[15]=1,s[5]=a,s[10]=a,s[9]=-o,s[6]=o,o=Math.sin(t),a=Math.cos(t),r[5]=1,r[15]=1,r[0]=a,r[2]=-o,r[8]=o,r[10]=a,this.multiplyLocal(h),this.multiplyLocal(l),this},setWorldMatrix:function(t,e,i,n,s){return this.yawPitchRoll(t.y,t.x,t.z),h.scaling(i.x,i.y,i.z),l.xyz(e.x,e.y,e.z),this.multiplyLocal(h),this.multiplyLocal(l),void 0!==n&&this.multiplyLocal(n),void 0!==s&&this.multiplyLocal(s),this}}),h=new n,l=new n;t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*f,t[8]=(r*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],y=c[5],m=c[6],x=c[7],w=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+y*h,e[4]=g*n+v*o+y*l,e[5]=g*s+v*a+y*u,e[6]=m*i+x*r+w*h,e[7]=m*n+x*o+w*l,e[8]=m*s+x*a+w*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-h*s,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,y=this.val;return y[0]=1-(c+f),y[3]=l+v,y[6]=u-g,y[1]=l-v,y[4]=1-(h+f),y[7]=d+p,y[2]=u+g,y[5]=d-p,y[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],y=e[14],m=e[15],x=n*h-s*a,w=n*l-r*a,b=n*u-o*a,T=s*l-r*h,S=s*u-o*h,_=r*u-o*l,A=c*v-d*g,C=c*y-f*g,M=c*m-p*g,P=d*y-f*v,E=d*m-p*v,k=f*m-p*y,F=x*k-w*E+b*P+T*M-S*C+_*A;return F?(F=1/F,i[0]=(h*k-l*E+u*P)*F,i[1]=(l*M-a*k-u*C)*F,i[2]=(a*E-h*M+u*A)*F,i[3]=(r*E-s*k-o*P)*F,i[4]=(n*k-r*M+o*C)*F,i[5]=(s*M-n*E-o*A)*F,i[6]=(v*_-y*S+m*T)*F,i[7]=(y*b-g*_-m*w)*F,i[8]=(g*S-v*b+m*x)*F,this):null}});t.exports=n},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e,i){var n=i(244);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t<e+i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),e-i<t}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)<i}},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},function(t,e){t.exports=function(t){return 0<=(t%=2*Math.PI)?t:t+2*Math.PI}},function(t,e,i){var n=i(0),s=i(18),a=i(21),r=i(7),h=i(2),l=i(8),o=new n({Extends:a,initialize:function(t,e,i,n){var s="txt";if(l(e)){var r=e;e=h(r,"key"),i=h(r,"url"),n=h(r,"xhrSettings"),s=h(r,"extension",s)}var o={type:"text",cache:t.cacheManager.text,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};a.call(this,t,o)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});r.register("text",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},function(t,e,i){var n=i(0),o=i(21),a=i(2),s=i(141),h=i(8),r=new n({Extends:o,initialize:function(t,e,i,n){if(h(e)){var s=e;e=a(s,"key"),n=a(s,"config",n)}var r={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:n};o.call(this,t,r),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t<this.data.length;t++){var e=this.data[t];e.oncanplaythrough=null,e.onerror=null}this.loader.nextFile(this,!1)},onProgress:function(t){var e=t.target;e.oncanplaythrough=null,e.onerror=null,this.filesLoaded++,this.percentComplete=Math.min(this.filesLoaded/this.filesTotal,1),this.loader.emit("fileprogress",this,this.percentComplete),this.filesLoaded===this.filesTotal&&this.onLoad()},load:function(){this.data=[];var t=this.config&&this.config.instances||1;this.filesTotal=t,this.filesLoaded=0;for(var e=this.percentComplete=0;e<t;e++){var i=new Audio;i.dataset.name=this.key+("0"+e).slice(-2),i.dataset.used="false",this.locked?i.dataset.locked="true":(i.dataset.locked="false",i.preload="auto",i.oncanplaythrough=this.onProgress.bind(this),i.onerror=this.onError.bind(this)),this.data.push(i)}for(e=0;e<this.data.length;e++)(i=this.data[e]).src=s(this,this.loader.baseURL),this.locked||i.load();this.locked&&setTimeout(this.onLoad.bind(this))}});t.exports=r},function(t,e,i){var n=i(0),s=i(26),a=i(21),r=i(7),l=i(2),u=i(252),c=i(8),d=new n({Extends:a,initialize:function(t,e,i,n,s){if(c(e)){var r=e;e=l(r,"key"),n=l(r,"xhrSettings"),s=l(r,"context",s)}var o={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:n,config:{context:s}};a.call(this,t,o)},onProcess:function(){this.state=s.FILE_PROCESSING;var e=this;this.config.context.decodeAudioData(this.xhrLoader.response,function(t){e.data=t,e.onProcessComplete()},function(t){console.error("Error decoding audio: "+this.key+" - ",t?t.message:null),e.onProcessError()}),this.config.context=null}});d.create=function(t,e,i,n,s){var r=t.systems.game,o=r.config.audio,a=r.device.audio;c(e)&&(i=l(e,"url",[]),n=l(e,"config",{}));var h=d.getAudioURL(r,i);return h?!a.webAudio||o&&o.disableWebAudio?new u(t,e,h,n):new d(t,e,h,s,r.sound.context):null},d.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n=l(e[i],"url",e[i]);if(0===n.indexOf("blob:")||0===n.indexOf("data:"))return n;var s=n.match(/\.([a-zA-Z0-9]+)($|\?)/);if(s=l(e[i],"type",s?s[1]:"").toLowerCase(),t.device.audio[s])return{url:n,type:s}}return null},r.register("audio",function(t,e,i,n){var s,r=this.systems.game,o=r.config.audio,a=r.device.audio;if(o&&o.noAudio||!a.webAudio&&!a.audioData)return this;if(Array.isArray(t))for(var h=0;h<t.length;h++)(s=d.create(this,t[h]))&&this.addFile(s);else(s=d.create(this,t,e,i,n))&&this.addFile(s);return this}),t.exports=d},function(t,e,i){var s=i(140);t.exports=function(t,e){var i=s(e,t.xhrSettings),n=new XMLHttpRequest;return n.open("GET",t.src,i.async,i.user,i.password),n.responseType=t.xhrSettings.responseType,n.timeout=i.timeout,i.header&&i.headerValue&&n.setRequestHeader(i.header,i.headerValue),i.requestedWith&&n.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&n.overrideMimeType(i.overrideMimeType),n.onload=t.onLoad.bind(t,n),n.onerror=t.onError.bind(t),n.onprogress=t.onProgress.bind(t),n.send(),n}},function(t,e,i){var n=i(0),a=i(2),h=i(605),l=i(603),s=new n({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var n=0;n<e.length;n++){var s=e[n];"string"==typeof s?this.keyCodes.push(s.toUpperCase().charCodeAt(0)):"number"==typeof s?this.keyCodes.push(s):s.hasOwnProperty("keyCode")&&this.keyCodes.push(s.keyCode)}this.current=this.keyCodes[0],this.index=0,this.size=this.keyCodes.length,this.timeLastMatched=0,this.matched=!1,this.timeMatched=0,this.resetOnWrongKey=a(i,"resetOnWrongKey",!0),this.maxKeyDelay=a(i,"maxKeyDelay",0),this.resetOnMatch=a(i,"resetOnMatch",!1),this.deleteOnMatch=a(i,"deleteOnMatch",!1);var r=this,o=function(t){!r.matched&&r.enabled&&h(t,r)&&(r.manager.emit("keycombomatch",r,t),r.resetOnMatch?l(r):r.deleteOnMatch&&r.destroy())};this.onKeyDown=o,this.manager.on("keydown",o)},progress:{get:function(){return this.index/this.size}},destroy:function(){this.enabled=!1,this.keyCodes=[],this.manager.off("keydown",this.onKeyDown),this.manager=null}});t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(t){this.keyCode=t,this.originalEvent=void 0,this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},reset:function(){return this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this}});t.exports=n},function(t,e,i){var a=i(259),h=i(258),n=i(0),l=i(11),u=i(3),s=new n({Extends:l,initialize:function(t,e){l.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n<e.buttons.length;n++)i.push(new h(this,n));this.buttons=i;var s=[];for(n=0;n<e.axes.length;n++)s.push(new a(this,n));this.axes=s,this.vibration=e.vibrationActuator;var r={value:0,pressed:!1};this._LCLeft=i[14]?i[14]:r,this._LCRight=i[15]?i[15]:r,this._LCTop=i[12]?i[12]:r,this._LCBottom=i[13]?i[13]:r,this._RCLeft=i[2]?i[2]:r,this._RCRight=i[1]?i[1]:r,this._RCTop=i[3]?i[3]:r,this._RCBottom=i[0]?i[0]:r,this._FBLeftTop=i[4]?i[4]:r,this._FBLeftBottom=i[6]?i[6]:r,this._FBRightTop=i[5]?i[5]:r,this._FBRightBottom=i[7]?i[7]:r;var o={value:0};this._HAxisLeft=s[0]?s[0]:o,this._VAxisLeft=s[1]?s[1]:o,this._HAxisRight=s[2]?s[2]:o,this._VAxisRight=s[3]?s[3]:o,this.leftStick=new u,this.rightStick=new u},getAxisTotal:function(){return this.axes.length},getAxisValue:function(t){return this.axes[t].getValue()},setAxisThreshold:function(t){for(var e=0;e<this.axes.length;e++)this.axes[e].threshold=t},getButtonTotal:function(){return this.buttons.length},getButtonValue:function(t){return this.buttons[t].value},isButtonDown:function(t){return this.buttons[t].pressed},update:function(t){var e,i=this.buttons,n=t.buttons,s=i.length;for(e=0;e<s;e++)i[e].update(n[e].value);var r=this.axes,o=t.axes;for(s=r.length,e=0;e<s;e++)r[e].update(o[e]);2<=s&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),4<=s&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t<this.buttons.length;t++)this.buttons[t].destroy();for(t=0;t<this.axes.length;t++)this.axes[t].destroy();this.buttons=[],this.axes=[]},connected:{get:function(){return this.pad.connected}},timestamp:{get:function(){return this.pad.timestamp}},left:{get:function(){return this._LCLeft.pressed}},right:{get:function(){return this._LCRight.pressed}},up:{get:function(){return this._LCTop.pressed}},down:{get:function(){return this._LCBottom.pressed}},A:{get:function(){return this._RCBottom.pressed}},Y:{get:function(){return this._RCTop.pressed}},X:{get:function(){return this._RCLeft.pressed}},B:{get:function(){return this._RCRight.pressed}},L1:{get:function(){return this._FBLeftTop.value}},L2:{get:function(){return this._FBLeftBottom.value}},R1:{get:function(){return this._FBRightTop.value}},R2:{get:function(){return this._FBRightBottom.value}}});t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit("down",e,this,t),this.pad.emit("down",i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit("up",e,this,t),this.pad.emit("up",i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)<this.threshold?0:this.value},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragX:0,dragY:0}}},function(t,e,i){var d=i(6);function f(t,e,i,n){var s=t-i,r=e-n,o=s*s+r*r;return Math.sqrt(o)}t.exports=function(t,e){void 0===e&&(e=new d);var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=t.x3,a=t.y3,h=f(o,a,s,r),l=f(i,n,o,a),u=f(s,r,i,n),c=h+l+u;return e.x=(i*h+s*l+o*u)/c,e.y=(n*h+r*l+a*u)/c,e}},function(t,e){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},function(t,e){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.x<t.right&&e.right>t.x&&e.right<t.right&&e.y>t.y&&e.y<t.bottom&&e.bottom>t.y&&e.bottom<t.bottom}},function(t,e,i){var n=i(9);n.Area=i(656),n.Ceil=i(655),n.CeilAll=i(654),n.CenterOn=i(175),n.Clone=i(653),n.Contains=i(39),n.ContainsPoint=i(652),n.ContainsRect=i(264),n.CopyFrom=i(651),n.Decompose=i(270),n.Equals=i(650),n.FitInside=i(649),n.FitOutside=i(648),n.Floor=i(647),n.FloorAll=i(646),n.FromPoints=i(173),n.GetAspectRatio=i(145),n.GetCenter=i(645),n.GetPoint=i(190),n.GetPoints=i(398),n.GetSize=i(644),n.Inflate=i(643),n.Intersection=i(642),n.MarchingAnts=i(388),n.MergePoints=i(641),n.MergeRect=i(640),n.MergeXY=i(639),n.Offset=i(638),n.OffsetPoint=i(637),n.Overlaps=i(636),n.Perimeter=i(124),n.PerimeterPoint=i(635),n.Random=i(187),n.RandomOutside=i(634),n.SameDimensions=i(633),n.Scale=i(632),n.Union=i(309),t.exports=n},function(t,e){t.exports=function(t){return t.x*t.x+t.y*t.y}},function(t,e){t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},function(t,e,i){var n=i(16),s=i(53),r=i(68);t.exports=function(t){var e=r(t)-n.TAU;return s(e,-Math.PI,Math.PI)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},function(t,e){t.exports=function(t,e){return(t.x-e.x1)*(e.y2-e.y1)==(e.x2-e.x1)*(t.y-e.y1)}},function(t,e,i){var c=i(40),d=new(i(6));t.exports=function(t,e,i){if(void 0===i&&(i=d),c(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(c(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var n=t.x2-t.x1,s=t.y2-t.y1,r=e.x-t.x1,o=e.y-t.y1,a=n*n+s*s,h=n,l=s;if(0<a){var u=(r*n+o*s)/a;h*=u,l*=u}return i.x=t.x1+h,i.y=t.y1+l,h*h+l*l<=a&&0<=h*n+l*s&&c(e,i.x,i.y)}},function(t,e,i){t.exports={CircleToCircle:i(703),CircleToRectangle:i(702),GetRectangleIntersection:i(701),LineToCircle:i(272),LineToLine:i(107),LineToRectangle:i(700),PointToLine:i(271),PointToLineSegment:i(699),RectangleToRectangle:i(148),RectangleToTriangle:i(698),RectangleToValues:i(697),TriangleToCircle:i(696),TriangleToLine:i(695),TriangleToTriangle:i(694)}},function(t,e,i){t.exports={Circle:i(723),Ellipse:i(713),Intersects:i(273),Line:i(693),Point:i(675),Polygon:i(661),Rectangle:i(265),Triangle:i(631)}},function(t,e,i){var n=i(0),a=i(276),h=i(10),s=new n({initialize:function(){this.lightPool=[],this.lights=[],this.culledLights=[],this.ambientColor={r:.1,g:.1,b:.1},this.active=!1,this.maxLights=-1},enable:function(){return-1===this.maxLights&&(this.maxLights=this.scene.sys.game.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},cull:function(t){for(var e=this.lights,i=this.culledLights,n=e.length,s=t.x+t.width/2,r=t.y+t.height/2,o=(t.width+t.height)/2,a={x:0,y:0},h=t.matrix,l=this.systems.game.config.height,u=i.length=0;u<n&&i.length<this.maxLights;u++){var c=e[u];h.transformPoint(c.x,c.y,a);var d=s-(a.x-t.scrollX*c.scrollFactorX*t.zoom),f=r-(l-(a.y-t.scrollY*c.scrollFactorY*t.zoom));Math.sqrt(d*d+f*f)<c.radius+o&&i.push(e[u])}return i},forEachLight:function(t){if(t){for(var e=this.lights,i=e.length,n=0;n<i;++n)t(e[n]);return this}},setAmbientColor:function(t){var e=h.getFloatsFromUintRGB(t);return this.ambientColor.r=e[0],this.ambientColor.g=e[1],this.ambientColor.b=e[2],this},getMaxVisibleLights:function(){return 10},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,n,s){var r,o=null;return t=void 0===t?0:t,e=void 0===e?0:e,n=void 0===n?16777215:n,i=void 0===i?100:i,s=void 0===s?1:s,r=h.getFloatsFromUintRGB(n),o=null,0<this.lightPool.length?(o=this.lightPool.pop()).set(t,e,i,r[0],r[1],r[2],s):o=new a(t,e,i,r[0],r[1],r[2],s),this.lights.push(o),o},removeLight:function(t){var e=this.lights.indexOf(t);return 0<=e&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;0<this.lights.length;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=s},function(t,e,i){var n=i(0),s=i(10),r=new n({initialize:function(t,e,i,n,s,r,o){this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1},set:function(t,e,i,n,s,r,o){return this.x=t,this.y=e,this.radius=i,this.r=n,this.g=s,this.b=r,this.intensity=o,this.scrollFactorX=1,this.scrollFactorY=1,this},setScrollFactor:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this},setColor:function(t){var e=s.getFloatsFromUintRGB(t);return this.r=e[0],this.g=e[1],this.b=e[2],this},setIntensity:function(t){return this.intensity=t,this},setPosition:function(t,e){return this.x=t,this.y=e,this},setRadius:function(t){return this.radius=t,this}});t.exports=r},function(t,e,i){var g=i(65),v=i(6);t.exports=function(t,e,i,n){void 0===n&&(n=[]);var s=t.getLineA(),r=t.getLineB(),o=t.getLineC(),a=g(s),h=g(r),l=g(o),u=a+h+l;e||(e=u/i);for(var c=0;c<e;c++){var d=u*(c/e),f=0,p=new v;p.y=d<a?(f=d/a,p.x=s.x1+(s.x2-s.x1)*f,s.y1+(s.y2-s.y1)*f):a+h<d?(f=(d-=a+h)/l,p.x=o.x1+(o.x2-o.x1)*f,o.y1+(o.y2-o.y1)*f):(f=(d-=a)/h,p.x=r.x1+(r.x2-r.x1)*f,r.y1+(r.y2-r.y1)*f),n.push(p)}return n}},function(t,e,i){var c=i(6),d=i(65);t.exports=function(t,e,i){void 0===i&&(i=new c);var n=t.getLineA(),s=t.getLineB(),r=t.getLineC();if(e<=0||1<=e)return i.x=n.x1,i.y=n.y1,i;var o=d(n),a=d(s),h=d(r),l=(o+a+h)*e,u=0;return i.y=l<o?(u=l/o,i.x=n.x1+(n.x2-n.x1)*u,n.y1+(n.y2-n.y1)*u):o+a<l?(u=(l-=o+a)/h,i.x=r.x1+(r.x2-r.x1)*u,r.y1+(r.y2-r.y1)*u):(u=(l-=o)/a,i.x=s.x1+(s.x2-s.x1)*u,s.y1+(s.y2-s.y1)*u),i}},function(t,e,i){var n=i(0),f=i(27),p=i(59),s=i(772),r=new n({Extends:f,Mixins:[s],initialize:function(t,e,i,n,s,r,o,a,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=128),void 0===r&&(r=64),void 0===o&&(o=0),void 0===a&&(a=128),void 0===h&&(h=128),f.call(this,t,"Triangle",new p(n,s,r,o,a,h));var c=this.geom.right-this.geom.left,d=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(c,d),void 0!==l&&this.setFillStyle(l,u),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,n,s,r){return this.geom.setTo(t,e,i,n,s,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=r},function(t,e,i){var n=i(775),s=i(0),l=i(64),h=i(27),r=new s({Extends:h,Mixins:[n],initialize:function(t,e,i,n,s,r,o,a){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),h.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==o&&this.setFillStyle(o,a),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,r=Math.PI/e,o=n,a=n;t.push(o,a+-n);for(var h=0;h<e;h++)t.push(o+Math.cos(s)*n,a+Math.sin(s)*n),s+=r,t.push(o+Math.cos(s)*i,a+Math.sin(s)*i),s+=r;return t.push(o,a+-n),this.pathIndexes=l(t),this.pathData=t,this}});t.exports=r},function(t,e,i){var n=i(0),a=i(9),h=i(27),s=i(778),r=new n({Extends:h,Mixins:[s],initialize:function(t,e,i,n,s,r,o){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===s&&(s=128),h.call(this,t,"Rectangle",new a(0,0,n,s)),this.setPosition(e,i),this.setSize(n,s),void 0!==r&&this.setFillStyle(r,o),this.updateDisplayOrigin(),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=r},function(t,e){var c=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var e,i=[],n=t.points;for(e=0;e<n.length;e++)i.push([n[e].x,n[e].y]);var s=[];for(0<i.length&&s.push(c([0,0],i[0])),e=0;e<i.length-1;e++){var r=i[e],o=i[e+1],a=r[0],h=r[1],l=o[0],u=o[1];s.push([.85*a+.15*l,.85*h+.15*u]),s.push([.15*a+.85*l,.15*h+.85*u])}return 1<i.length&&s.push(c([0,0],i[i.length-1])),t.setTo(s)}},function(t,e,i){var a=i(65),h=i(54);t.exports=function(t){for(var e=t.points,i=0,n=0;n<e.length;n++){var s=e[n],r=e[(n+1)%e.length],o=new h(s.x,s.y,r.x,r.y);i+=a(o)}return i}},function(t,e,i){var g=i(65),v=i(54),y=i(283);t.exports=function(t,e,i,n){void 0===n&&(n=[]);var s=t.points,r=y(t);e||(e=r/i);for(var o=0;o<e;o++)for(var a=r*(o/e),h=0,l=0;l<s.length;l++){var u=s[l],c=s[(l+1)%s.length],d=new v(u.x,u.y,c.x,c.y),f=g(d);if(!(a<h||h+f<a)){var p=d.getPoint((a-h)/f);n.push(p);break}h+=f}return n}},function(t,e,i){var h=i(9);t.exports=function(t,e){void 0===e&&(e=new h);for(var i,n=1/0,s=1/0,r=-n,o=-s,a=0;a<t.points.length;a++)i=t.points[a],n=Math.min(n,i.x),s=Math.min(s,i.y),r=Math.max(r,i.x),o=Math.max(o,i.y);return e.x=n,e.y=s,e.width=r-n,e.height=o-s,e}},function(t,e,i){var n=i(781),s=i(0),r=i(64),a=i(285),h=i(151),l=i(27),o=i(282),u=new s({Extends:l,Mixins:[n],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),l.call(this,t,"Polygon",new h(n));var o=a(this.geom);this.setPosition(e,i),this.setSize(o.width,o.height),void 0!==s&&this.setFillStyle(s,r),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e<t;e++)o(this.geom);return this.updateData()},updateData:function(){for(var t=[],e=this.geom.points,i=0;i<e.length;i++)t.push(e[i].x,e[i].y);return t.push(e[0].x,e[0].y),this.pathIndexes=r(t),this.pathData=t,this}});t.exports=u},function(t,e,i){var n=i(0),c=i(27),d=i(54),s=i(784),r=new n({Extends:c,Mixins:[s],initialize:function(t,e,i,n,s,r,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=128),void 0===o&&(o=0),c.call(this,t,"Line",new d(n,s,r,o));var l=this.geom.right-this.geom.left,u=this.geom.bottom-this.geom.top;this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(l,u),void 0!==a&&this.setStrokeStyle(1,a,h),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,n){return this.geom.setTo(t,e,i,n),this}});t.exports=r},function(t,e,i){var n=i(0),s=i(787),l=i(27),r=new n({Extends:l,Mixins:[s],initialize:function(t,e,i,n,s,r,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=48),void 0===s&&(s=32),void 0===r&&(r=!1),void 0===o&&(o=15658734),void 0===a&&(a=10066329),void 0===h&&(h=13421772),l.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=o,this.fillLeft=a,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=r,this.isFilled=!0,this.setPosition(e,i),this.setSize(n,s),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=r},function(t,e,i){var n=i(790),s=i(0),h=i(27),r=new s({Extends:h,Mixins:[n],initialize:function(t,e,i,n,s,r,o,a){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=48),void 0===s&&(s=32),void 0===r&&(r=15658734),void 0===o&&(o=10066329),void 0===a&&(a=13421772),h.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=r,this.fillLeft=o,this.fillRight=a,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(n,s),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=r},function(t,e,i){var n=i(0),c=i(27),s=i(793),r=new n({Extends:c,Mixins:[s],initialize:function(t,e,i,n,s,r,o,a,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===s&&(s=128),void 0===r&&(r=32),void 0===o&&(o=32),c.call(this,t,"Grid",null),this.cellWidth=r,this.cellHeight=o,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(n,s),void 0!==a&&this.setFillStyle(a,h),void 0!==l&&this.setOutlineStyle(l,u),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),this.showCells=void 0!==t&&(this.fillColor=t,this.fillAlpha=e,!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),this.showAltCells=void 0!==t&&(this.altFillColor=t,this.altFillAlpha=e,!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),this.showOutline=void 0!==t&&(this.outlineFillColor=t,this.outlineFillAlpha=e,!0),this}});t.exports=r},function(t,e,i){var n=i(0),s=i(64),r=i(796),a=i(90),h=i(27),o=new n({Extends:h,Mixins:[r],initialize:function(t,e,i,n,s,r,o){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===s&&(s=128),h.call(this,t,"Ellipse",new a(n/2,s/2,n,s)),this._smoothness=64,this.setPosition(e,i),this.width=n,this.height=s,void 0!==r&&this.setFillStyle(r,o),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.geom.setSize(t,e),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i<e.length;i++)t.push(e[i].x,e[i].y);return t.push(e[0].x,e[0].y),this.pathIndexes=s(t),this.pathData=t,this}});t.exports=o},function(t,e,i){var n=i(0),s=i(799),r=i(64),o=i(9),a=i(27),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;s<n.length;s++)i.push(n[s].x,n[s].y);return i.push(n[0].x,n[0].y),this.pathIndexes=r(i),this.pathData=i,this}});t.exports=h},function(t,e,i){var n=i(802),s=i(0),l=i(31),u=i(64),c=i(71),d=i(16),f=i(27),r=new s({Extends:f,Mixins:[n],initialize:function(t,e,i,n,s,r,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===s&&(s=0),void 0===r&&(r=360),void 0===o&&(o=!1),f.call(this,t,"Arc",new c(0,0,n)),this._startAngle=s,this._endAngle=r,this._anticlockwise=o,this._iterations=.01,this.setPosition(e,i),this.setSize(this.geom.radius,this.geom.radius),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t,this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,n=l(this._startAngle),s=l(this._endAngle),r=i/2,o=i/2;s-=n,this._anticlockwise?s<-d.PI2?s=-d.PI2:0<s&&(s=-d.PI2+s%d.PI2):s>d.PI2?s=d.PI2:s<0&&(s=d.PI2+s%d.PI2);for(var a,h=[r+Math.cos(n)*i,o+Math.sin(n)*i];e<1;)a=s*e+n,h.push(r+Math.cos(a)*i,o+Math.sin(a)*i),e+=t;return a=s+n,h.push(r+Math.cos(a)*i,o+Math.sin(a)*i),h.push(r+Math.cos(n)*i,o+Math.sin(n)*i),this.pathIndexes=u(h),this.pathData=h,this}});t.exports=r},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<<Math.ceil(e)}},function(t,e){t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}},function(t,e,i){var n=i(0),l=i(31),r=i(84),o=i(4),a=i(61),u=i(83),h=i(3),s=new n({Extends:a,initialize:function(t,e,i,n,s,r){a.call(this,t,i,n,s,r),this.path=e,this.rotateToPath=!1,this.pathRotationVerticalAdjust=!1,this.pathRotationOffset=0,this.pathOffset=new h(i,n),this.pathVector=new h,this.pathTween,this.pathConfig=null,this._prevDirection=u.PLAYING_FORWARD},setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=!1),this.rotateToPath=t,this.pathRotationOffset=e,this.pathRotationVerticalAdjust=i,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=0,t.to=1;var n=r(t,"positionOnPath",!1);if(this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=o(t,"rotationOffset",0),this.pathRotationVerticalAdjust=r(t,"verticalAdjust",!1),this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),n&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=u.PLAYING_FORWARD,this.rotateToPath){var s=this.path.getPoint(.1);this.rotation=Math.atan2(s.y-this.y,s.x-this.x)+l(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},preUpdate:function(t,e){this.anims.update(t,e);var i=this.pathTween;if(i){var n=i.data[0];if(n.state!==u.PLAYING_FORWARD&&n.state!==u.PLAYING_BACKWARD)return;var s=this.pathVector;this.path.getPoint(i.getValue(),s),s.add(this.pathOffset);var r=this.x,o=this.y;this.setPosition(s.x,s.y);var a=this.x-r,h=this.y-o;if(0===a&&0===h)return;if(n.state!==this._prevDirection)return void(this._prevDirection=n.state);this.rotateToPath&&(this.rotation=Math.atan2(h,a)+l(this.pathRotationOffset),this.pathRotationVerticalAdjust&&(this.flipY=0!==this.rotation&&n.state===u.PLAYING_BACKWARD))}}});t.exports=s},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t){this.source=t,this._tempVec=new s},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=r},function(t,e){t.exports=function(t,e){for(var i=0;i<e.length;i++)if(t.hasOwnProperty(e[i]))return!0;return!1}},function(t,e){t.exports=function(t,e){return Math.random()*(e-t)+t}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){void 0===n&&(n=!1),void 0===s&&(s=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=s,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._length<i&&this.counter>this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=i(66),s=i(0),r=i(14),o=i(301),a=i(300),h=i(822),l=i(2),u=i(162),c=i(298),d=i(85),f=i(303),p=i(297),g=i(9),v=i(110),y=i(3),m=i(53),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0),this.y=new h(e,"y",0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3),this.angle=new h(e,"angle",{min:0,max:360}),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new y,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e<this.configFastMap.length;e++)i=this.configFastMap[e],d(t,i)&&(this[i]=l(t,i));for(e=0;e<this.configOpMap.length;e++)i=this.configOpMap[e],d(t,i)&&this[i].loadConfig(t);if(this.acceleration=0!==this.accelerationX.propertyValue||0!==this.accelerationY.propertyValue,this.moveTo=0!==this.moveToX.propertyValue||0!==this.moveToY.propertyValue,d(t,"speed")&&(this.speedX.loadConfig(t,"speed"),this.speedY=null),(c(t,["speedX","speedY"])||this.moveTo)&&(this.radial=!1),d(t,"scale")&&(this.scaleX.loadConfig(t,"scale"),this.scaleY=null),d(t,"callbackScope")){var n=l(t,"callbackScope",null);this.emitCallbackScope=n,this.deathCallbackScope=n}return d(t,"emitZone")&&this.setEmitZone(t.emitZone),d(t,"deathZone")&&this.setDeathZone(t.deathZone),d(t,"bounds")&&this.setBounds(t.bounds),d(t,"followOffset")&&this.followOffset.setFromObject(l(t,"followOffset",0)),d(t,"frame")&&this.setFrame(t.frame),this},toJSON:function(t){void 0===t&&(t={});var e=0,i="";for(e=0;e<this.configFastMap.length;e++)t[i=this.configFastMap[e]]=this[i];for(e=0;e<this.configOpMap.length;e++)this[i=this.configOpMap[e]]&&(t[i]=this[i].toJSON());return this.speedY||(delete t.speedX,t.speed=this.speedX.toJSON()),this.scaleY||(delete t.scaleX,t.scale=this.scaleX.toJSON()),t},startFollow:function(t,e,i,n){return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=!1),this.follow=t,this.followOffset.set(e,i),this.trackVisible=n,this},stopFollow:function(){return this.follow=null,this.followOffset.set(0,0),this.trackVisible=!1,this},getFrame:function(){if(1===this.frames.length)return this.defaultFrame;if(this.randomFrame)return u(this.frames);var t=this.frames[this.currentFrame];return this._frameCounter++,this._frameCounter===this.frameQuantity&&(this._frameCounter=0,this.currentFrame=m(this.currentFrame+1,0,this._frameLength)),t},setFrame:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomFrame=e,this.frameQuantity=i,this.currentFrame=0,this._frameCounter=0;var n=typeof t;if(Array.isArray(t)||"string"===n||"number"===n)this.manager.setEmitterFrames(t,this);else if("object"===n){var s=t;(t=l(s,"frames",null))&&this.manager.setEmitterFrames(t,this);var r=l(s,"cycle",!1);this.randomFrame=!r,this.frameQuantity=l(s,"quantity",i)}return this._frameLength=this.frames.length,1===this._frameLength&&(this.frameQuantity=1,this.randomFrame=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},setPosition:function(t,e){return this.x.onChange(t),this.y.onChange(e),this},setBounds:function(t,e,i,n){if("object"==typeof t){var s=t;t=s.x,e=s.y,i=d(s,"w")?s.w:s.width,n=d(s,"h")?s.h:s.height}return this.bounds?this.bounds.setTo(t,e,i,n):this.bounds=new g(t,e,i,n),this},setSpeedX:function(t){return this.speedX.onChange(t),this.radial=!1,this},setSpeedY:function(t){return this.speedY&&(this.speedY.onChange(t),this.radial=!1),this},setSpeed:function(t){return this.speedX.onChange(t),this.speedY=null,this.radial=!0,this},setScaleX:function(t){return this.scaleX.onChange(t),this},setScaleY:function(t){return this.scaleY.onChange(t),this},setScale:function(t){return this.scaleX.onChange(t),this.scaleY=null,this},setGravityX:function(t){return this.gravityX=t,this},setGravityY:function(t){return this.gravityY=t,this},setGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setAlpha:function(t){return this.alpha.onChange(t),this},setEmitterAngle:function(t){return this.angle.onChange(t),this},setAngle:function(t){return this.angle.onChange(t),this},setLifespan:function(t){return this.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity.onChange(t),this},setFrequency:function(t,e){return this.frequency=t,this._counter=0,e&&this.quantity.onChange(e),this},setEmitZone:function(t){if(void 0===t)this.emitZone=null;else{var e=l(t,"type","random"),i=l(t,"source",null);switch(e){case"random":this.emitZone=new p(i);break;case"edge":var n=l(t,"quantity",1),s=l(t,"stepRate",0),r=l(t,"yoyo",!1),o=l(t,"seamless",!0);this.emitZone=new a(i,n,s,r,o)}}return this},setDeathZone:function(t){if(void 0===t)this.deathZone=null;else{var e=l(t,"type","onEnter"),i=l(t,"source",null);if(i&&"function"==typeof i.contains){var n="onEnter"===e;this.deathZone=new o(i,n)}}return this},reserve:function(t){for(var e=this.dead,i=0;i<t;i++)e.push(new this.particleClass(this));return this},getAliveParticleCount:function(){return this.alive.length},getDeadParticleCount:function(){return this.dead.length},getParticleCount:function(){return this.getAliveParticleCount()+this.getDeadParticleCount()},atLimit:function(){return 0<this.maxParticles&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;0<e.length;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s<n;++s)t.call(e,i[s],this);return this},forEachDead:function(t,e){for(var i=this.dead,n=i.length,s=0;s<n;++s)t.call(e,i[s],this);return this},start:function(){return this.on=!0,this._counter=0,this},stop:function(){return this.on=!1,this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},depthSort:function(){return v.inplace(this.alive,this.depthSortCallback),this},flow:function(t,e){return void 0===e&&(e=1),this.frequency=t,this.quantity.onChange(e),this.start()},explode:function(t,e,i){return this.frequency=-1,this.emitParticle(t,e,i)},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.quantity.onEmit());for(var n=this.dead,s=0;s<t;s++){var r;if((r=0<n.length?n.pop():new this.particleClass(this)).fire(e,i),this.particleBringToTop?this.alive.push(r):this.alive.unshift(r),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,r,this),this.atLimit())break}return r}},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible);for(var n=this.manager.getProcessors(),s=this.alive,r=s.length,o=0;o<r;o++){var a=s[o];if(a.update(e,i,n)){var h=s[r-1];s[r-1]=a,s[o]=h,o-=1,r-=1}}var l=s.length-r;if(0<l){var u=s.splice(s.length-l,l),c=this.deathCallback,d=this.deathCallbackScope;if(c)for(var f=0;f<u.length;f++)c.call(d,u[f]);this.dead.concat(u),v.inplace(s,this.indexSortCallback)}this.on&&(0===this.frequency?this.emitParticle():0<this.frequency&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y},indexSortCallback:function(t,e){return t.index-e.index}});t.exports=x},function(t,e,i){var n=i(0),u=i(31),c=i(52),s=new n({initialize:function(t){this.emitter=t,this.frame=null,this.index=0,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return 0<this.lifeCurrent},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),s=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var r=u(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(r)*Math.abs(n),this.velocityY=Math.sin(r)*Math.abs(s)}else if(i.moveTo){var o=i.moveToX.onEmit(this,"moveToX"),a=i.moveToY?i.moveToY.onEmit(this,"moveToY"):o,h=Math.atan2(a-this.y,o-this.x),l=c(this.x,this.y,o,a)/(this.life/1e3);this.velocityX=Math.cos(h)*l,this.velocityY=Math.sin(h)*l}else this.velocityX=n,this.velocityY=s;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=u(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint"),this.index=i.alive.length},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),h<s?s=h:s<-h&&(s=-h),l<r?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;u<n.length;u++)n[u].update(this,e,i)},checkBounds:function(t){var e=t.bounds,i=-this.bounce;this.x<e.x&&t.collideLeft?(this.x=e.x,this.velocityX*=i):this.x>e.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.y<e.y&&t.collideTop?(this.y=e.y,this.velocityY*=i):this.y>e.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(0<this.delayCurrent)return this.delayCurrent-=t,!1;var n=this.emitter,s=1-this.lifeCurrent/this.life;return this.lifeT=s,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?!(this.lifeCurrent=0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",s,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",s,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",s,this.angle),this.rotation=u(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",s,this.alpha),this.tint=n.tint.onUpdate(this,"tint",s,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=s},function(t,e,i){var n=i(0),o=i(2),s=new n({initialize:function(t,e,i,n,s){if("object"==typeof t){var r=t;t=o(r,"x",0),e=o(r,"y",0),i=o(r,"power",0),n=o(r,"epsilon",100),s=o(r,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===s&&(s=50);this.x=t,this.y=e,this.active=!0,this._gravity=s,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s<this._epsilon&&(s=this._epsilon);var o=this._power*e/(s*r)*100;t.velocityX+=i*o,t.velocityY+=n*o}},epsilon:{get:function(){return Math.sqrt(this._epsilon)},set:function(t){this._epsilon=t*t}},power:{get:function(){return this._power/this._gravity},set:function(t){this._power=t*this._gravity}},gravity:{get:function(){return this._gravity},set:function(t){var e=this.power;this._gravity=t,this.power=e}}});t.exports=s},function(t,e,i){var x=i(157),w=i(22);t.exports=function(t,e,i,n,s,r,o){var a=e.commandBuffer,h=a.length,l=r||t.currentContext;if(0!==h&&w(t,l,e,n,s)){var u=1,c=1,d=0,f=0,p=1,g=0,v=0,y=0;l.save(),l.beginPath();for(var m=0;m<h;++m)switch(a[m]){case x.ARC:l.arc(a[m+1],a[m+2],a[m+3],a[m+4],a[m+5],a[m+6]),m+=7;break;case x.LINE_STYLE:p=a[m+1],d=a[m+2],u=a[m+3],g=(16711680&d)>>>16,v=(65280&d)>>>8,y=255&d,l.strokeStyle="rgba("+g+","+v+","+y+","+u+")",l.lineWidth=p,m+=3;break;case x.FILL_STYLE:f=a[m+1],c=a[m+2],g=(16711680&f)>>>16,v=(65280&f)>>>8,y=255&f,l.fillStyle="rgba("+g+","+v+","+y+","+c+")",m+=2;break;case x.BEGIN_PATH:l.beginPath();break;case x.CLOSE_PATH:l.closePath();break;case x.FILL_PATH:o||l.fill();break;case x.STROKE_PATH:o||l.stroke();break;case x.FILL_RECT:o?l.rect(a[m+1],a[m+2],a[m+3],a[m+4]):l.fillRect(a[m+1],a[m+2],a[m+3],a[m+4]),m+=4;break;case x.FILL_TRIANGLE:l.beginPath(),l.moveTo(a[m+1],a[m+2]),l.lineTo(a[m+3],a[m+4]),l.lineTo(a[m+5],a[m+6]),l.closePath(),o||l.fill(),m+=6;break;case x.STROKE_TRIANGLE:l.beginPath(),l.moveTo(a[m+1],a[m+2]),l.lineTo(a[m+3],a[m+4]),l.lineTo(a[m+5],a[m+6]),l.closePath(),o||l.stroke(),m+=6;break;case x.LINE_TO:l.lineTo(a[m+1],a[m+2]),m+=2;break;case x.MOVE_TO:l.moveTo(a[m+1],a[m+2]),m+=2;break;case x.LINE_FX_TO:l.lineTo(a[m+1],a[m+2]),m+=5;break;case x.MOVE_FX_TO:l.moveTo(a[m+1],a[m+2]),m+=5;break;case x.SAVE:l.save();break;case x.RESTORE:l.restore();break;case x.TRANSLATE:l.translate(a[m+1],a[m+2]),m+=2;break;case x.SCALE:l.scale(a[m+1],a[m+2]),m+=2;break;case x.ROTATE:l.rotate(a[m+1]),m+=1;break;case x.GRADIENT_FILL_STYLE:m+=5;break;case x.GRADIENT_LINE_STYLE:m+=6;break;case x.SET_TEXTURE:m+=2}l.restore()}}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,n=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},function(t,e,i){var o=i(306),a=i(156),h=i(93),l=i(16);t.exports=function(t,e,i,n){void 0===n&&(n=[]),e||(e=o(t)/i);for(var s=0;s<e;s++){var r=h(s/e,0,l.PI2);n.push(a(t,r))}return n}},function(t,e,i){var s=i(156),r=i(93),o=i(16),a=i(6);t.exports=function(t,e,i){void 0===i&&(i=new a);var n=r(e,0,o.PI2);return s(t,n,i)}},function(t,e,i){var a=i(9);t.exports=function(t,e,i){void 0===i&&(i=new a);var n=Math.min(t.x,e.x),s=Math.min(t.y,e.y),r=Math.max(t.right,e.right)-n,o=Math.max(t.bottom,e.bottom)-s;return i.setTo(n,s,r,o)}},function(t,e){function A(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=0);var s={},r=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0];s.font=r.getAttribute("face"),s.size=A(r,"size"),s.lineHeight=A(o,"lineHeight")+i,s.chars={};var a=t.getElementsByTagName("char"),h=void 0!==n&&n.trimmed;if(h)var l=n.height,u=n.width;for(var c=0;c<a.length;c++){var d=a[c],f=A(d,"id"),p=A(d,"x"),g=A(d,"y"),v=A(d,"width"),y=A(d,"height");h&&(p<u&&(u=p),g<l&&(l=g)),s.chars[f]={x:p,y:g,width:v,height:y,centerX:Math.floor(v/2),centerY:Math.floor(y/2),xOffset:A(d,"xoffset"),yOffset:A(d,"yoffset"),xAdvance:A(d,"xadvance")+e,data:{},kerning:{}}}if(h&&0!==l&&0!==u)for(var m in s.chars){var x=s.chars[m];x.x-=n.x,x.y-=n.y}var w=t.getElementsByTagName("kerning");for(c=0;c<w.length;c++){var b=w[c],T=A(b,"first"),S=A(b,"second"),_=A(b,"amount");s.chars[S].kerning[T]=_}return s}},function(t,e,i){var d=i(12);t.exports=function(t,e){var i=d(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var n=t.anims,s=d(i,"key",void 0),r=d(i,"startFrame",void 0),o=d(i,"delay",0),a=d(i,"repeat",0),h=d(i,"repeatDelay",0),l=d(i,"yoyo",!1),u=d(i,"play",!1),c=d(i,"delayedPlay",0);n.setDelay(o),n.setRepeat(a),n.setRepeatDelay(h),n.setYoyo(l),u?n.play(s,r):0<c?n.delayedPlay(c,s,r):n.load(s)}return t}},function(t,e,i){var f=i(4),p=i(122),g=function(t,e,i){for(var n=[],s=0;s<t.length;s++)for(var r=0;r<e.length;r++)for(var o=0;o<i;o++)n.push({a:t[s],b:e[r]});return n};t.exports=function(t,e,i){var n=f(i,"max",0),s=f(i,"qty",1),r=f(i,"random",!1),o=f(i,"randomB",!1),a=f(i,"repeat",0),h=f(i,"yoyo",!1),l=[];if(o&&p(e),-1===a)if(0===n)a=0;else{var u=t.length*e.length*s;h&&(u*=2),a=Math.ceil(n/u)}for(var c=0;c<=a;c++){var d=g(t,e,s);r&&p(d),l=l.concat(d),h&&(d.reverse(),l=l.concat(d))}return n&&l.splice(n),l}},function(t,e){var g=function(t,e,i,n,s){for(i=i||0,n=n||t.length-1,s=s||y;i<n;){if(600<n-i){var r=n-i+1,o=e-i+1,a=Math.log(r),h=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*h*(r-h)/r)*(o-r/2<0?-1:1),u=Math.max(i,Math.floor(e-o*h/r+l)),c=Math.min(n,Math.floor(e+(r-o)*h/r+l));g(t,e,u,c,s)}var d=t[e],f=i,p=n;for(v(t,i,e),0<s(t[n],d)&&v(t,i,n);f<p;){for(v(t,f,p),f++,p--;s(t[f],d)<0;)f++;for(;0<s(t[p],d);)p--}0===s(t[i],d)?v(t,i,p):v(t,++p,n),p<=e&&(i=p+1),e<=p&&(n=p-1)}};function v(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function y(t,e){return t<e?-1:e<t?1:0}t.exports=g},function(t,e){t.exports=function(t){return 0<t?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),s=0;s<i;s++){n[s]=new Array(e);for(var r=e-1;-1<r;r--)n[s][r]=t[r][s]}return n}},function(t,e,i){t.exports={AtlasXML:i(886),Canvas:i(885),Image:i(884),JSONArray:i(883),JSONHash:i(882),SpriteSheet:i(881),SpriteSheetFromAtlas:i(880),UnityYAML:i(879)}},function(t,e,i){var n=i(24),s=i(0),r=i(117),o=i(94),a=new s({initialize:function(t,e,i,n){var s=t.manager.game;this.renderer=s.renderer,this.texture=t,this.source=e,this.image=e,this.compressionAlgorithm=null,this.resolution=1,this.width=i||e.naturalWidth||e.width||0,this.height=n||e.naturalHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isRenderTexture="RenderTexture"===e.type,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.init(s)},init:function(t){this.renderer&&(this.renderer.gl?this.isCanvas?this.glTexture=this.renderer.canvasToTexture(this.image):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=this.renderer.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.glTexture=this.renderer.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t)},update:function(){this.renderer.gl&&this.isCanvas&&(this.glTexture=this.renderer.canvasToTexture(this.image,this.glTexture))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&n.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=a},function(t,e,i){var h=i(24),s=i(887),n=i(0),l=i(37),r=i(26),o=i(11),a=i(357),u=i(4),c=i(316),d=i(165),f=new n({Extends:o,initialize:function(t){o.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=h.create2D(this,1,1),this._tempContext=this._tempCanvas.getContext("2d"),this._pending=0,t.events.once("boot",this.boot,this)},boot:function(){this._pending=2,this.on("onload",this.updatePending,this),this.on("onerror",this.updatePending,this),this.addBase64("__DEFAULT",this.game.config.defaultImage),this.addBase64("__MISSING",this.game.config.missingImage),this.game.events.once("destroy",this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off("onload"),this.off("onerror"),this.game.events.emit("texturesready"))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(delete this.list[t.key],t.destroy(),this.emit("removetexture",t.key)),this},addBase64:function(e,t){if(this.checkKey(e)){var i=this,n=new Image;n.onerror=function(){i.emit("onerror",e)},n.onload=function(){var t=i.create(e,n);c.Image(t,0),i.emit("addtexture",e,t),i.emit("onload",e,t)},n.src=t}return this},getBase64:function(t,e,i,n){void 0===i&&(i="image/png"),void 0===n&&(n=.92);var s="",r=this.getFrame(t,e);if(r){var o=r.canvasData,a=h.create2D(this,o.width,o.height);a.getContext("2d").drawImage(r.source.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),s=a.toDataURL(i,n),h.remove(a)}return s},addImage:function(t,e,i){var n=null;return this.checkKey(t)&&(n=this.create(t,e),c.Image(n,0),i&&n.setDataSource(i),this.emit("addtexture",t,n)),n},addRenderTexture:function(t,e){var i=null;return this.checkKey(t)&&((i=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),this.emit("addtexture",t,i)),i},generate:function(t,e){if(this.checkKey(t)){var i=h.create(this,1,1);return e.canvas=i,a(e),this.addCanvas(t,i)}return null},createCanvas:function(t,e,i){if(void 0===e&&(e=256),void 0===i&&(i=256),this.checkKey(t)){var n=h.create(this,e,i,r.CANVAS,!0);return this.addCanvas(t,n)}return null},addCanvas:function(t,e,i){void 0===i&&(i=!1);var n=null;return i?n=new s(this,t,e,e.width,e.height):this.checkKey(t)&&(n=new s(this,t,e,e.width,e.height),this.list[t]=n,this.emit("addtexture",t,n)),n},addAtlas:function(t,e,i,n){return Array.isArray(i.textures)||Array.isArray(i.frames)?this.addAtlasJSONArray(t,e,i,n):this.addAtlasJSONHash(t,e,i,n)},addAtlasJSONArray:function(t,e,i,n){var s=null;if(this.checkKey(t)){if(s=this.create(t,e),Array.isArray(i))for(var r=1===i.length,o=0;o<s.source.length;o++){var a=r?i[0]:i[o];c.JSONArray(s,o,a)}else c.JSONArray(s,0,i);n&&s.setDataSource(n),this.emit("addtexture",t,s)}return s},addAtlasJSONHash:function(t,e,i,n){var s=null;if(this.checkKey(t)){if(s=this.create(t,e),Array.isArray(i))for(var r=0;r<i.length;r++)c.JSONHash(s,r,i[r]);else c.JSONHash(s,0,i);n&&s.setDataSource(n),this.emit("addtexture",t,s)}return s},addAtlasXML:function(t,e,i,n){var s=null;return this.checkKey(t)&&(s=this.create(t,e),c.AtlasXML(s,0,i),n&&s.setDataSource(n),this.emit("addtexture",t,s)),s},addUnityAtlas:function(t,e,i,n){var s=null;return this.checkKey(t)&&(s=this.create(t,e),c.UnityYAML(s,0,i),n&&s.setDataSource(n),this.emit("addtexture",t,s)),s},addSpriteSheet:function(t,e,i){var n=null;if(this.checkKey(t)){var s=(n=this.create(t,e)).source[0].width,r=n.source[0].height;c.SpriteSheet(n,0,0,0,s,r,i),this.emit("addtexture",t,n)}return n},addSpriteSheetFromAtlas:function(t,e){if(!this.checkKey(t))return null;var i=u(e,"atlas",null),n=u(e,"frame",null);if(i&&n){var s=this.get(i).get(n);if(s){var r=this.create(t,s.source.image);return s.trimmed?c.SpriteSheetFromAtlas(r,s,e):c.SpriteSheet(r,0,s.cutX,s.cutY,s.cutWidth,s.cutHeight,e),this.emit("addtexture",t,r),r}}},create:function(t,e,i,n){var s=null;return this.checkKey(t)&&(s=new d(this,t,e,i,n),this.list[t]=s),s},exists:function(t){return this.list.hasOwnProperty(t)},get:function(t){return void 0===t&&(t="__DEFAULT"),this.list[t]?this.list[t]:this.list.__MISSING},cloneFrame:function(t,e){if(this.list[t])return this.list[t].get(e).clone()},getFrame:function(t,e){if(this.list[t])return this.list[t].get(e)},getTextureKeys:function(){var t=[];for(var e in this.list)"__DEFAULT"!==e&&"__MISSING"!==e&&t.push(e);return t},getPixel:function(t,e,i,n){var s=this.getFrame(i,n);if(s){t-=s.x,e-=s.y;var r=s.data.cut;if(t+=r.x,e+=r.y,t>=r.x&&t<r.r&&e>=r.y&&e<r.b){var o=this._tempContext;o.clearRect(0,0,1,1),o.drawImage(s.source.image,t,e,1,1,0,0,1,1);var a=o.getImageData(0,0,1,1);return new l(a.data[0],a.data[1],a.data[2],a.data[3])}}return null},getPixelAlpha:function(t,e,i,n){var s=this.getFrame(i,n);if(s){t-=s.x,e-=s.y;var r=s.data.cut;if(t+=r.x,e+=r.y,t>=r.x&&t<r.r&&e>=r.y&&e<r.b){var o=this._tempContext;return o.clearRect(0,0,1,1),o.drawImage(s.source.image,t,e,1,1,0,0,1,1),o.getImageData(0,0,1,1).data[3]}}return null},setTexture:function(t,e,i){return this.list[e]&&(t.texture=this.list[e],t.frame=t.texture.get(i)),t},renameTexture:function(t,e){var i=this.get(t);return!(!i||t===e||(i.key=e,this.list[e]=i,delete this.list[t],0))},each:function(t,e){for(var i=[null],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var s in this.list)i[0]=this.list[s],t.apply(e,i)},destroy:function(){for(var t in this.list)this.list[t].destroy();this.list={},this.game=null,h.remove(this._tempCanvas)}});t.exports=f},function(t,e,i){var n=i(114),s=new(i(0))({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),this.audioBuffer?(this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit("play",this),!0)},pause:function(){return!(this.manager.context.currentTime<this.startTime||!n.prototype.pause.call(this)||(this.currentConfig.seek=this.getCurrentTime(),this.stopAndRemoveBufferSource(),this.emit("pause",this),0))},resume:function(){return!(this.manager.context.currentTime<this.startTime||!n.prototype.resume.call(this)||(this.createAndStartBufferSource(),this.emit("resume",this),0))},stop:function(){return!!n.prototype.stop.call(this)&&(this.stopAndRemoveBufferSource(),this.emit("stop",this),!0)},createAndStartBufferSource:function(){var t=this.currentConfig.seek,e=this.currentConfig.delay,i=this.manager.context.currentTime+e,n=(this.currentMarker?this.currentMarker.start:0)+t,s=this.duration-t;this.playTime=i-t,this.startTime=i,this.source=this.createBufferSource(),this.applyConfig(),this.source.start(Math.max(0,i),Math.max(0,n),Math.max(0,s)),this.resetConfig()},createAndStartLoopBufferSource:function(){var t=this.getLoopTime(),e=this.currentMarker?this.currentMarker.start:0,i=this.duration;this.loopTime=t,this.loopSource=this.createBufferSource(),this.loopSource.playbackRate.setValueAtTime(this.totalRate,0),this.loopSource.start(Math.max(0,t),Math.max(0,e),Math.max(0,i))},createBufferSource:function(){var e=this,t=this.manager.context.createBufferSource();return t.buffer=this.audioBuffer,t.connect(this.muteNode),t.onended=function(t){t.target===e.source&&(e.currentConfig.loop?e.hasLooped=!0:e.hasEnded=!0)},t},stopAndRemoveBufferSource:function(){this.source&&(this.source.stop(),this.source.disconnect(),this.source=null),this.playTime=0,this.startTime=0,this.stopAndRemoveLoopBufferSource()},stopAndRemoveLoopBufferSource:function(){this.loopSource&&(this.loopSource.stop(),this.loopSource.disconnect(),this.loopSource=null),this.loopTime=0},applyConfig:function(){this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:1}),n.prototype.applyConfig.call(this)},update:function(t,e){this.hasEnded?(this.hasEnded=!1,n.prototype.stop.call(this),this.stopAndRemoveBufferSource(),this.emit("ended",this)):this.hasLooped&&(this.hasLooped=!1,this.source=this.loopSource,this.loopSource=null,this.playTime=this.startTime=this.loopTime,this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:this.totalRate}),this.createAndStartLoopBufferSource(),this.emit("looped",this))},destroy:function(){n.prototype.destroy.call(this),this.audioBuffer=null,this.stopAndRemoveBufferSource(),this.muteNode.disconnect(),this.muteNode=null,this.volumeNode.disconnect(),this.volumeNode=null,this.rateUpdates.length=0,this.rateUpdates=null},calculateRate:function(){n.prototype.calculateRate.call(this);var t=this.manager.context.currentTime;this.source&&"number"==typeof this.totalRate&&this.source.playbackRate.setValueAtTime(this.totalRate,t),this.isPlaying&&(this.rateUpdates.push({time:Math.max(this.startTime,t)-this.playTime,rate:this.totalRate}),this.loopSource&&(this.stopAndRemoveLoopBufferSource(),this.createAndStartLoopBufferSource()))},getCurrentTime:function(){for(var t=0,e=0;e<this.rateUpdates.length;e++)t+=((e<this.rateUpdates.length-1?this.rateUpdates[e+1].time:this.manager.context.currentTime-this.playTime)-this.rateUpdates[e].time)*this.rateUpdates[e].rate;return t},getLoopTime:function(){for(var t=0,e=0;e<this.rateUpdates.length-1;e++)t+=(this.rateUpdates[e+1].time-this.rateUpdates[e].time)*this.rateUpdates[e].rate;var i=this.rateUpdates[this.rateUpdates.length-1];return this.playTime+i.time+(this.duration-t)/i.rate},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.calculateRate(),this.emit("rate",this,t)}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.calculateRate(),this.emit("detune",this,t)}},setDetune:function(t){return this.detune=t,this},mute:{get:function(){return 0===this.muteNode.gain.value},set:function(t){this.currentConfig.mute=t,this.muteNode.gain.setValueAtTime(t?0:1,0),this.emit("mute",this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.volumeNode.gain.value},set:function(t){this.currentConfig.volume=t,this.volumeNode.gain.setValueAtTime(t,0),this.emit("volume",this,t)}},setVolume:function(t){return this.volume=t,this},seek:{get:function(){return this.isPlaying?this.manager.context.currentTime<this.startTime?this.startTime-this.playTime:this.getCurrentTime():this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.context.currentTime<this.startTime||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.currentConfig.seek=t,this.isPlaying&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource()),this.emit("seek",this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.isPlaying&&(this.stopAndRemoveLoopBufferSource(),t&&this.createAndStartLoopBufferSource()),this.emit("loop",this,t)}},setLoop:function(t){return this.loop=t,this}});t.exports=s},function(t,e,i){var n=i(115),s=i(0),r=i(319),o=new s({Extends:n,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),n.call(this,t),this.locked&&this.unlock()},createAudioContext:function(t){var e=t.config.audio;return e&&e.context?(e.context.resume(),e.context):new AudioContext},add:function(t,e){var i=new r(this,t,e);return this.sounds.push(i),i},unlock:function(){var t=this,e=function(){t.context.resume().then(function(){document.body.removeEventListener("touchstart",e),document.body.removeEventListener("touchend",e),document.body.removeEventListener("click",e),t.unlocked=!0})};document.body&&(document.body.addEventListener("touchstart",e,!1),document.body.addEventListener("touchend",e,!1),document.body.addEventListener("click",e,!1))},onBlur:function(){this.context.suspend()},onFocus:function(){this.context.resume()},destroy:function(){if(this.destination=null,this.masterVolumeNode.disconnect(),this.masterVolumeNode=null,this.masterMuteNode.disconnect(),this.masterMuteNode=null,this.game.config.audio&&this.game.config.audio.context)this.context.suspend();else{var t=this;this.context.close().then(function(){t.context=null})}n.prototype.destroy.call(this)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return 0===this.masterMuteNode.gain.value},set:function(t){this.masterMuteNode.gain.setValueAtTime(t?0:1,0),this.emit("mute",this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this.masterVolumeNode.gain.value},set:function(t){this.masterVolumeNode.gain.setValueAtTime(t,0),this.emit("volume",this,t)}}});t.exports=o},function(t,e,i){var n=i(114),s=i(0),r=i(11),o=i(20),a=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!1},updateMarker:function(t){return!1},removeMarker:function(t){return null},play:function(t,e){return!1},pause:function(){return!1},resume:function(){return!1},stop:function(){return!1},destroy:function(){this.manager.remove(this),n.prototype.destroy.call(this)}});t.exports=a},function(t,e,i){var n=i(115),s=i(0),r=i(11),o=i(321),a=i(1),h=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){var n=i(114),s=new(i(0))({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),this.tags?(this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!(this.manager.isLocked(this,"play",[t,e])||!n.prototype.play.call(this,t,e)||!this.pickAndPlayAudioTag()||(this.emit("play",this),0))},pause:function(){return!(this.manager.isLocked(this,"pause")||0<this.startTime||!n.prototype.pause.call(this)||(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit("pause",this),0))},resume:function(){return!(this.manager.isLocked(this,"resume")||0<this.startTime||!n.prototype.resume.call(this)||!this.pickAndPlayAudioTag()||(this.emit("resume",this),0))},stop:function(){return!this.manager.isLocked(this,"stop")&&!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit("stop",this),!0)},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t<this.tags.length;t++){var e=this.tags[t];if("false"===e.dataset.used)return e.dataset.used="true",this.audio=e,!0}if(!this.manager.override)return!1;var i=[];this.manager.forEachActiveSound(function(t){t.key===this.key&&t.audio&&i.push(t)},this),i.sort(function(t,e){return t.loop===e.loop?e.seek/e.duration-t.seek/t.duration:t.loop?1:-1});var n=i[0];return this.audio=n.audio,n.reset(),n.audio=null,n.startTime=0,!(n.previousTime=0)},playCatchPromise:function(){var t=this.audio.play();t&&t.catch(function(t){console.warn(t)})},stopAndReleaseAudioTag:function(){this.audio.pause(),this.audio.dataset.used="false",this.audio=null,this.startTime=0,this.previousTime=0},reset:function(){n.prototype.stop.call(this)},onBlur:function(){this.isPlaying=!1,this.isPaused=!0,this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.currentConfig.delay=Math.max(0,(this.startTime-window.performance.now())/1e3),this.stopAndReleaseAudioTag()},onFocus:function(){this.isPlaying=!0,this.isPaused=!1,this.pickAndPlayAudioTag()},update:function(t,e){if(this.isPlaying)if(0<this.startTime)this.startTime<t-this.manager.audioPlayDelay&&(this.audio.currentTime+=Math.max(0,t-this.startTime)/1e3,this.startTime=0,this.previousTime=this.audio.currentTime,this.playCatchPromise());else{var i=this.currentMarker?this.currentMarker.start:0,n=i+this.duration,s=this.audio.currentTime;if(this.currentConfig.loop)s>=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s<i&&(this.audio.currentTime+=i,s=this.audio.currentTime),s<this.previousTime&&this.emit("looped",this);else if(n<=s)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit("ended",this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||this.emit("mute",this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||this.emit("volume",this,t)}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,"rate",t)||(this.calculateRate(),this.emit("rate",this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,"detune",t)||(this.calculateRate(),this.emit("detune",this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||0<this.startTime||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit("seek",this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit("loop",this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=s},function(t,e,i){var n=i(115),s=i(0),r=i(323),o=new s({Extends:n,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,n.call(this,t)},add:function(t,e){var i=new r(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var n=this;if(this.game.cache.audio.entries.each(function(t,e){for(var i=0;i<e.length;i++)if("true"===e[i].dataset.locked)return!(n.locked=!0);return!0}),this.locked){var e=!1,i=function(){e=!0},r=function(){if(e)e=!1;else{document.body.removeEventListener("touchmove",i),document.body.removeEventListener("touchend",r);var s=[];if(n.game.cache.audio.entries.each(function(t,e){for(var i=0;i<e.length;i++){var n=e[i];"true"===n.dataset.locked&&s.push(n)}return!0}),0!==s.length){var t=s[s.length-1];t.oncanplaythrough=function(){t.oncanplaythrough=null,s.forEach(function(t){t.dataset.locked="false"}),n.unlocked=!0},s.forEach(function(t){t.load()})}}};this.once("unlocked",function(){for(this.forEachActiveSound(function(t){null===t.currentMarker&&0===t.duration&&(t.duration=t.tags[0].duration),t.totalDuration=t.tags[0].duration});this.lockedActionsQueue.length;){var t=this.lockedActionsQueue.shift();t.sound[t.prop].apply?t.sound[t.prop].apply(t.sound,t.value||[]):t.sound[t.prop]=t.value}},this),document.body.addEventListener("touchmove",i,!1),document.body.addEventListener("touchend",r,!1)}},onBlur:function(){this.forEachActiveSound(function(t){t.isPlaying&&(this.onBlurPausedSounds.push(t),t.onBlur())})},onFocus:function(){this.onBlurPausedSounds.forEach(function(t){t.onFocus()}),this.onBlurPausedSounds.length=0},destroy:function(){n.prototype.destroy.call(this),this.onBlurPausedSounds.length=0,this.onBlurPausedSounds=null},isLocked:function(t,e,i){return"true"===t.tags[0].dataset.locked&&(this.lockedActionsQueue.push({sound:t,prop:e,value:i}),!0)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return this._mute},set:function(t){this._mute=t,this.forEachActiveSound(function(t){t.updateMute()}),this.emit("mute",this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this._volume},set:function(t){this._volume=t,this.forEachActiveSound(function(t){t.updateVolume()}),this.emit("volume",this,t)}}});t.exports=o},function(t,e,i){var n=i(324),s=i(322),r=i(320),o={create:function(t){var e=t.config.audio,i=t.device.audio;return e&&e.noAudio||!i.webAudio&&!i.audioData?new s(t):!i.webAudio||e&&e.disableWebAudio?new n(t):new r(t)}};t.exports=o},function(t,e,i){var n=i(116),s=i(4),r=i(96),o=i(888),a={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:n.PENDING,key:s(t,"key",""),active:s(t,"active",!1),visible:s(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:s(t,"pack",!1),cameras:s(t,"cameras",null),map:s(t,"map",r(o,s(t,"mapAdd",{}))),physics:s(t,"physics",{}),loader:s(t,"loader",{}),plugins:s(t,"plugins",!1),input:s(t,"input",{})}}};t.exports=a},function(t,e){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},function(t,e,i){var n=i(0),s=i(166),r=new n({initialize:function(t){this.sys=new s(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.impact,this.matter},update:function(){}});t.exports=r},function(t,e,i){var n=i(0),r=i(116),l=i(4),s=i(1),u=i(328),o=i(166),a=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)this._pending.push({key:"default",scene:e[i],autoStart:0===i,data:{}})}t.events.once("ready",this.bootQueue,this)},bootQueue:function(){if(!this.isBooted){var t,e,i,n;for(t=0;t<this._pending.length;t++){var s;i=(e=this._pending[t]).key,(n=e.scene)instanceof u?s=this.createSceneFromInstance(i,n):"object"==typeof n?s=this.createSceneFromObject(i,n):"function"==typeof n&&(s=this.createSceneFromFunction(i,n)),i=s.sys.settings.key,this.keys[i]=s,this.scenes.push(s),this._data[i]&&(s.sys.settings.data=this._data[i].data,this._data[i].autoStart&&(e.autoStart=!0)),(e.autoStart||s.sys.settings.active)&&this._start.push(i)}for(this._pending.length=0,this._data={},this.isBooted=!0,t=0;t<this._start.length;t++)e=this._start[t],this.start(e);this._start.length=0}},processQueue:function(){var t=this._pending.length,e=this._queue.length;if(0!==t||0!==e){var i,n;if(t){for(i=0;i<t;i++)n=this._pending[i],this.add(n.key,n.scene,n.autoStart,n.data);for(i=0;i<this._start.length;i++)n=this._start[i],this.start(n);return this._start.length=0,void(this._pending.length=0)}for(i=0;i<this._queue.length;i++)this[(n=this._queue[i]).op](n.keyA,n.keyB);this._queue.length=0}},add:function(t,e,i,n){return void 0===i&&(i=!1),void 0===n&&(n={}),this.isProcessing||!this.isBooted?(this._pending.push({key:t,scene:e,autoStart:i,data:n}),this.isBooted||(this._data[t]={data:n}),null):(t=this.getKey(t,e),e instanceof u?s=this.createSceneFromInstance(t,e):"object"==typeof e?(e.key=t,s=this.createSceneFromObject(t,e)):"function"==typeof e&&(s=this.createSceneFromFunction(t,e)),s.sys.settings.data=n,t=s.sys.settings.key,this.keys[t]=s,this.scenes.push(s),(i||s.sys.settings.active)&&(this._pending.length?this._start.push(t):this.start(t)),s);var s},remove:function(t){if(this.isProcessing)this._queue.push({op:"remove",keyA:t,keyB:null});else{var e=this.getScene(t);if(!e||e.sys.isTransitioning())return this;var i=this.scenes.indexOf(e),n=e.sys.settings.key;-1<i&&(delete this.keys[n],this.scenes.splice(i,1),-1<this._start.indexOf(n)&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=r.INIT,n.isTransition&&i.events.emit("transitioninit",n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=r.LOADING,e.once("complete",this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;0<=i;i--){var n=this.scenes[i].sys;n.settings.status>r.START&&n.settings.status<=r.RUNNING&&n.step(t,e)}},resize:function(t,e){for(var i=0;i<this.scenes.length;i++)this.scenes[i].sys.resize(t,e)},render:function(t){for(var e=0;e<this.scenes.length;e++){var i=this.scenes[e].sys;i.settings.visible&&i.settings.status>=r.LOADING&&i.settings.status<r.SLEEPING&&i.render(t)}this.isProcessing=!1},create:function(t){var e=t.sys,i=e.settings;t.create&&(i.status=r.CREATING,t.create.call(t,i.data),i.isTransition&&e.events.emit("transitionstart",i.transitionFrom,i.transitionDuration)),t.update&&(e.sceneUpdate=t.update),i.status=r.RUNNING},createSceneFromFunction:function(t,e){var i=new e;if(i instanceof u){var n=i.sys.settings.key;if(""!==n&&(t=n),this.keys.hasOwnProperty(t))throw new Error("Cannot add a Scene with duplicate key: "+t);return this.createSceneFromInstance(t,i)}return i.sys=new o(i),i.sys.settings.key=t,i.sys.init(this.game),i},createSceneFromInstance:function(t,e){var i=e.sys.settings.key;return""!==i?t=i:e.sys.settings.key=t,e.sys.init(this.game),e},createSceneFromObject:function(t,e){var i=new u(e),n=i.sys.settings.key;""!==n?t=n:i.sys.settings.key=t,i.sys.init(this.game);for(var s=["init","preload","create","update","render"],r=0;r<s.length;r++){var o=l(e,s[r],null);o&&(i[s[r]]=o)}if(e.hasOwnProperty("extend"))for(var a in e.extend){var h=e.extend[a];"data"===a&&i.hasOwnProperty("data")&&"object"==typeof h?i.data.merge(h):"sys"!==a&&(i[a]=h)}return i},getKey:function(t,e){if(t||(t="default"),"function"==typeof e)return t;if(e instanceof u?t=e.sys.settings.key:"object"==typeof e&&e.hasOwnProperty("key")&&(t=e.key),this.keys.hasOwnProperty(t))throw new Error("Cannot add a Scene with duplicate key: "+t);return t},getScene:function(t){if("string"==typeof t){if(this.keys[t])return this.keys[t]}else for(var e=0;e<this.scenes.length;e++)if(t===this.scenes[e])return t;return null},isActive:function(t){var e=this.getScene(t);return e?e.sys.isActive():null},isVisible:function(t){var e=this.getScene(t);return e?e.sys.isVisible():null},isSleeping:function(t){var e=this.getScene(t);return e?e.sys.isSleeping():null},pause:function(t,e){var i=this.getScene(t);return i&&i.sys.pause(e),this},resume:function(t,e){var i=this.getScene(t);return i&&i.sys.resume(e),this},sleep:function(t,e){var i=this.getScene(t);return i&&!i.sys.isTransitioning()&&i.sys.sleep(e),this},wake:function(t,e){var i=this.getScene(t);return i&&i.sys.wake(e),this},run:function(t,e){var i=this.getScene(t);if(!i){for(var n=0;n<this._pending.length;n++)if(this._pending[n].key===t){this.queueOp("start",t,e);break}return this}i.sys.isSleeping()?i.sys.wake(e):i.sys.isBooted&&!i.sys.isActive()?i.sys.resume(e):this.start(t,e)},start:function(t,e){if(!this.isBooted)return this._data[t]={autoStart:!0,data:e},this;var i=this.getScene(t);if(i){var n;if(i.sys.isActive()||i.sys.isPaused())i.sys.shutdown(),i.sys.start(e);else if(i.sys.start(e),i.sys.load&&(n=i.sys.load),n&&i.sys.settings.hasOwnProperty("pack")&&(n.reset(),n.addPack({payload:i.sys.settings.pack})))return i.sys.settings.status=r.LOADING,n.once("complete",this.payloadComplete,this),n.start(),this;this.bootScene(i)}return this},stop:function(t){var e=this.getScene(t);return e&&!e.sys.isTransitioning()&&e.sys.shutdown(),this},switch:function(t,e){var i=this.getScene(t),n=this.getScene(e);return i&&n&&i!==n&&(this.sleep(t),this.isSleeping(e)?this.wake(e):this.start(e)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e<this.scenes.length){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.push(i)}}return this},sendToBack:function(t){if(this.isProcessing)this._queue.push({op:"sendToBack",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&0<e){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(0<e){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e<this.scenes.length-1){var i=e+1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveAbove:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveAbove",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(-1!==i&&-1!==n){var s=this.getAt(n);this.scenes.splice(n,1),this.scenes.splice(i+1,0,s)}}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(-1!==i&&-1!==n){var s=this.getAt(n);this.scenes.splice(n,1),0===i?this.scenes.unshift(s):this.scenes.splice(i,0,s)}}return this},queueOp:function(t,e,i){return this._queue.push({op:t,keyA:e,keyB:i}),this},swapPosition:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"swapPosition",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(i!==n&&-1!==i&&-1!==n){var s=this.getAt(i);this.scenes[i]=this.scenes[n],this.scenes[n]=s}}return this},dump:function(){for(var t=[],e=["pending","init","start","loading","creating","running","paused","sleeping","shutdown","destroyed"],i=0;i<this.scenes.length;i++){var n=this.scenes[i].sys,s=!n.settings.visible||n.settings.status!==r.RUNNING&&n.settings.status!==r.PAUSED?"[-] ":"[*] ";s+=n.settings.key+" ("+e[n.settings.status]+")",t.push(s)}console.log(t.join("\n"))},destroy:function(){for(var t=0;t<this.scenes.length;t++)this.scenes[t].sys.destroy();this.update=s,this.scenes=[],this._pending=[],this._start=[],this._queue=[],this.game=null}});t.exports=a},function(t,e,i){var a=i(91);t.exports=function(t,e,i,n){var s;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(s=t.indexOf(e))?(a(t,s),i&&i.call(n,e),e):null;for(var r=e.length-1;0<=r;){var o=e[r];-1!==(s=t.indexOf(o))?(a(t,s),i&&i.call(n,o)):e.pop(),r--}return e}},function(t,e,i){var n=i(0),s=i(11),r=i(7),o=i(13),a=i(5),l=i(2),p=i(15),h=i(330),u=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once("boot",this.boot,this)},boot:function(){var t,e,i,n,s,r,o,a=this.game.config,h=a.installGlobalPlugins;for(h=h.concat(this._pendingGlobal),t=0;t<h.length;t++)e=h[t],i=l(e,"key",null),n=l(e,"plugin",null),s=l(e,"start",!1),r=l(e,"mapping",null),o=l(e,"data",null),i&&n&&this.install(i,n,s,r,o);for(h=(h=a.installScenePlugins).concat(this._pendingScene),t=0;t<h.length;t++)e=h[t],i=l(e,"key",null),n=l(e,"plugin",null),r=l(e,"mapping",null),i&&n&&this.installScenePlugin(i,n,r);this._pendingGlobal=[],this._pendingScene=[],this.game.events.once("destroy",this.destroy,this)},addToScene:function(t,e,i){var n,s,r,o=this.game,a=t.scene,h=t.settings.map,l=t.settings.isBooted;for(n=0;n<e.length;n++)o[s=e[n]]?(t[s]=o[s],h.hasOwnProperty(s)&&(a[h[s]]=t[s])):"game"===s&&h.hasOwnProperty(s)&&(a[h[s]]=o);for(var u=0;u<i.length;u++)for(r=i[u],n=0;n<r.length;n++)if(s=r[n],p.hasCore(s)){var c=p.getCore(s),d=new c.plugin(a,this);t[c.mapping]=d,c.custom?a[c.mapping]=d:h.hasOwnProperty(c.mapping)&&(a[h[c.mapping]]=d),l&&d.boot()}for(r=this.plugins,n=0;n<r.length;n++){var f=r[n];f.mapping&&(a[f.mapping]=f.plugin)}},getDefaultScenePlugins:function(){var t=this.game.config.defaultPlugins;return t=t.concat(this.scenePlugins)},installScenePlugin:function(t,e,i,n){if("function"==typeof e){if(p.hasCore(t))console.warn("Scene Plugin key in use: "+t);else if(p.register(t,e,i,!0),this.scenePlugins.push(t),n){var s=new e(n,this);n.sys[t]=s,i&&""!==i&&(n[i]=s),s.boot()}}else console.warn("Invalid Scene Plugin: "+t)},install:function(t,e,i,n,s){if(void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=null),"function"==typeof e)if(p.hasCustom(t))console.warn("Plugin key in use: "+t);else if(null!==n&&(i=!0),this.game.isBooted){if(p.registerCustom(t,e,n,s),i)return this.start(t)}else this._pendingGlobal.push({key:t,plugin:e,start:i,mapping:n,data:s});else console.warn("Invalid Plugin: "+t)},getIndex:function(t){for(var e=this.plugins,i=0;i<e.length;i++)if(e[i].key===t)return i;return-1},getEntry:function(t){var e=this.getIndex(t);if(-1!==e)return this.plugins[e]},isActive:function(t){var e=this.getEntry(t);return e&&e.active},start:function(t,e){void 0===e&&(e=t);var i=this.getEntry(e);return i&&!i.active?(i.active=!0,i.plugin.start()):i||(i=this.createEntry(t,e)),i?i.plugin:null},createEntry:function(t,e){var i=p.getCustom(t);if(i){var n=new i.plugin(this);i={key:e,plugin:n,active:!0,mapping:i.mapping,data:i.data},this.plugins.push(i),n.init(i.data),n.start()}return i},stop:function(t){var e=this.getEntry(t);return e&&e.active&&(e.active=!1,e.plugin.stop()),this},get:function(t,e){void 0===e&&(e=!0);var i=this.getEntry(t);if(i)return i.plugin;var n=this.getClass(t);return n&&e?(i=this.createEntry(t,t))?i.plugin:null:n||null},getClass:function(t){return p.getCustomClass(t)},removeGlobalPlugin:function(t){var e=this.getEntry(t);e&&h(this.plugins,e),p.removeCustom(t)},removeScenePlugin:function(t){h(this.scenePlugins,t),p.remove(t)},registerGameObject:function(t,e,i){return e&&a.register(t,e),i&&o.register(t,i),this},registerFileType:function(t,e,i){r.register(t,e),i&&i.sys.load&&(i.sys.load[t]=e)},destroy:function(){for(var t=0;t<this.plugins.length;t++)this.plugins[t].plugin.destroy();p.destroyCustomPlugins(),this.game.noReturn&&p.destroyCorePlugins(),this.game=null,this.plugins=[],this.scenePlugins=[]}});t.exports=u},function(t,e,i){var g=i(3);t.exports=function(t,e,i,n,s,r,o,a){void 0===a&&(a=new g);var h=Math.sin(s),l=Math.cos(s),u=l*r,c=h*r,d=-h*o,f=l*o,p=1/(u*f+d*-c);return a.x=f*p*t+-d*p*e+(n*d-i*f)*p,a.y=u*p*e+-c*p*t+(-n*u+i*c)*p,a}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=s,this.onTouchMove=s,this.onTouchEnd=s,this.onTouchCancel=s,t.events.once("boot",this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target||(this.target=this.manager.game.canvas),this.enabled&&this.target&&this.startListeners()},startListeners:function(){var e=this;this.onTouchStart=function(t){!t.defaultPrevented&&e.enabled&&e.manager&&(e.manager.queueTouchStart(t),e.capture&&t.preventDefault())},this.onTouchMove=function(t){!t.defaultPrevented&&e.enabled&&e.manager&&(e.manager.queueTouchMove(t),e.capture&&t.preventDefault())},this.onTouchEnd=function(t){!t.defaultPrevented&&e.enabled&&e.manager&&(e.manager.queueTouchEnd(t),e.capture&&t.preventDefault())},this.onTouchCancel=function(t){!t.defaultPrevented&&e.enabled&&e.manager&&(e.manager.queueTouchCancel(t),e.capture&&t.preventDefault())};var t=this.target;if(t){var i={passive:!0},n={passive:!1};this.capture?(t.addEventListener("touchstart",this.onTouchStart,n),t.addEventListener("touchmove",this.onTouchMove,n),t.addEventListener("touchend",this.onTouchEnd,n),t.addEventListener("touchcancel",this.onTouchCancel,n)):(t.addEventListener("touchstart",this.onTouchStart,i),t.addEventListener("touchmove",this.onTouchMove,i),t.addEventListener("touchend",this.onTouchEnd,i)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel)},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=r},function(t,e,i){var n=i(181);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var n=i(0),s=i(52),h=i(334),r=i(3),o=new n({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.camera=null,this.buttons=0,this.position=new r,this.prevPosition=new r,this.worldX=0,this.worldY=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.dragState=0,this.isDown=!1,this.dirty=!1,this.justDown=!1,this.justUp=!1,this.justMoved=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},reset:function(){this.dirty=!1,this.justDown=!1,this.justUp=!1,this.justMoved=!1,this.movementX=0,this.movementY=0},up:function(t,e){t.buttons&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e),this.justUp=!0,this.isDown=!1,this.dirty=!0,this.wasTouch=!1},down:function(t,e){t.buttons&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e),this.justDown=!0,this.isDown=!0,this.dirty=!0,this.wasTouch=!1},move:function(t){t.buttons&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),this.manager.mouse.locked&&(this.movementX+=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY+=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.justMoved=!0,this.dirty=!0,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e,this.justDown=!0,this.isDown=!0,this.dirty=!0,this.wasTouch=!0,this.wasCanceled=!1},touchmove:function(t){this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),this.justMoved=!0,this.dirty=!0,this.wasTouch=!0},touchend:function(t,e){this.buttons=0,this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e,this.justUp=!0,this.isDown=!1,this.dirty=!0,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1},touchcancel:function(t){this.buttons=0,this.event=t,this.primaryDown=!1,this.justUp=!1,this.isDown=!1,this.dirty=!0,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return 1&this.buttons},rightButtonDown:function(){return 2&this.buttons},middleButtonDown:function(){return 4&this.buttons},backButtonDown:function(){return 8&this.buttons},forwardButtonDown:function(){return 16&this.buttons},getDistance:function(){return s(this.downX,this.downY,this.x,this.y)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,s=this.position.x,r=this.position.y,o=0;o<t;o++){var a=1/t*o;e[o]={x:h(a,i,s),y:h(a,n,r)}}return e},destroy:function(){this.camera=null,this.manager=null,this.position=null},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}}});t.exports=o},function(t,e,i){var n=i(0),h=i(168),s=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.locked=!1,t.events.once("boot",this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.capture=t.inputMouseCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),this},requestPointerLock:function(){if(h.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){h.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var i=this,t=function(t){!t.defaultPrevented&&i.enabled&&i.manager&&(i.manager.queueMouseMove(t),i.capture&&t.preventDefault())},e=function(t){!t.defaultPrevented&&i.enabled&&i.manager&&(i.manager.queueMouseDown(t),i.capture&&t.preventDefault())},n=function(t){!t.defaultPrevented&&i.enabled&&i.manager&&(i.manager.queueMouseUp(t),i.capture&&t.preventDefault())};this.onMouseMove=t,this.onMouseDown=e,this.onMouseUp=n;var s=this.target,r={passive:!0},o={passive:!1};if(s.addEventListener("mousemove",t,this.capture?o:r),s.addEventListener("mousedown",e,this.capture?o:r),s.addEventListener("mouseup",n,this.capture?o:r),h.pointerLock){var a=function(t){var e=i.target;i.locked=document.pointerLockElement===e||document.mozPointerLockElement===e||document.webkitPointerLockElement===e,i.manager.queue.push(t)};this.pointerLockChange=a,document.addEventListener("pointerlockchange",a,!0),document.addEventListener("mozpointerlockchange",a,!0),document.addEventListener("webkitpointerlockchange",a,!0)}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),h.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.manager=null}});t.exports=s},function(t,e){t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,TOUCH_CANCEL:7,POINTER_LOCK_CHANGE:6}},function(t,e,i){var n=i(0),h=i(337),s=i(11),r=i(336),o=i(335),a=i(9),l=i(333),u=i(38),v=i(332),c=new n({initialize:function(t,e){this.game=t,this.canvas,this.config=e,this.enabled=!0,this.events=new s,this.queue=[],this.domCallbacks={up:[],down:[],move:[],upOnce:[],downOnce:[],moveOnce:[]},this._hasUpCallback=!1,this._hasDownCallback=!1,this._hasMoveCallback=!1,this._customCursor="",this._setCursor=0,this.defaultCursor="",this.mouse=e.inputMouse?new r(this):null,this.touch=e.inputTouch?new l(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++)this.pointers.push(new o(this,i));this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.dirty=!1,this.scale={x:1,y:1},this.globalTopOnly=!0,this.ignoreEvents=!1,this.bounds=new a,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new u,this._tempMatrix2=new u,t.events.once("boot",this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.updateBounds(),this.events.emit("boot"),this.game.events.on("prestep",this.update,this),this.game.events.on("poststep",this.postUpdate,this),this.game.events.once("destroy",this.destroy,this)},updateBounds:function(){var t=this.bounds,e=this.canvas.getBoundingClientRect();t.x=e.left+window.pageXOffset-document.documentElement.clientLeft,t.y=e.top+window.pageYOffset-document.documentElement.clientTop,t.width=e.width,t.height=e.height},resize:function(){this.updateBounds();var t=this.game.config.width,e=this.game.config.height,i=this.bounds.width,n=this.bounds.height;this.scale.x=t/i,this.scale.y=e/n},update:function(t){var e;this._setCursor=0,this.events.emit("update"),this.ignoreEvents=!1,this.dirty=!1;var i=this.queue.length,n=this.pointers;for(e=0;e<this.pointersTotal;e++)n[e].reset();if(this.enabled&&0!==i){this.dirty=!0,this.updateBounds(),this.scale.x=this.game.config.width/this.bounds.width,this.scale.y=this.game.config.height/this.bounds.height;var s=this.queue.splice(0,i),r=this.mousePointer;for(e=0;e<i;e+=2){var o=s[e],a=s[e+1];switch(o){case h.MOUSE_DOWN:r.down(a,t);break;case h.MOUSE_MOVE:r.move(a,t);break;case h.MOUSE_UP:r.up(a,t);break;case h.TOUCH_START:this.startPointer(a,t);break;case h.TOUCH_MOVE:this.updatePointer(a,t);break;case h.TOUCH_END:this.stopPointer(a,t);break;case h.TOUCH_CANCEL:this.cancelPointer(a,t);break;case h.POINTER_LOCK_CHANGE:this.events.emit("pointerlockchange",a,this.mouse.locked)}}}},postUpdate:function(){1===this._setCursor?this.canvas.style.cursor=this._customCursor:2===this._setCursor&&(this.canvas.style.cursor=this.defaultCursor)},setDefaultCursor:function(t){this.defaultCursor=t,this.canvas.style.cursor!==t&&(this.canvas.style.cursor=t)},setCursor:function(t){t.cursor&&(this._setCursor=1,this._customCursor=t.cursor)},resetCursor:function(t){t.cursor&&(this._setCursor=2)},startPointer:function(t,e){for(var i=this.pointers,n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],r=1;r<this.pointersTotal;r++){var o=i[r];if(!o.active){o.touchstart(s,e),this.activePointer=o;break}}},updatePointer:function(t,e){for(var i=this.pointers,n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],r=1;r<this.pointersTotal;r++){var o=i[r];if(o.active&&o.identifier===s.identifier){o.touchmove(s,e),this.activePointer=o;break}}},stopPointer:function(t,e){for(var i=this.pointers,n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],r=1;r<this.pointersTotal;r++){var o=i[r];if(o.active&&o.identifier===s.identifier){o.touchend(s,e);break}}},cancelPointer:function(t,e){for(var i=this.pointers,n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],r=1;r<this.pointersTotal;r++){var o=i[r];if(o.active&&o.identifier===s.identifier){o.touchend(s,e);break}}},addPointer:function(t){void 0===t&&(t=1);var e=[];10<this.pointersTotal+t&&(t=10-this.pointersTotal);for(var i=0;i<t;i++){var n=this.pointers.length,s=new o(this,n);this.pointers.push(s),this.pointersTotal++,e.push(s)}return e},processDomCallbacks:function(t,e,i){var n=0;for(n=0;n<t.length;n++)t[n](i);for(n=0;n<e.length;n++)e[n](i);return t=[],0<e.length},queueTouchStart:function(t){if(this.queue.push(h.TOUCH_START,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueTouchMove:function(t){if(this.queue.push(h.TOUCH_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueTouchEnd:function(t){if(this.queue.push(h.TOUCH_END,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},queueTouchCancel:function(t){this.queue.push(h.TOUCH_CANCEL,t)},queueMouseDown:function(t){if(this.queue.push(h.MOUSE_DOWN,t),this._hasDownCallback){var e=this.domCallbacks;this._hasDownCallback=this.processDomCallbacks(e.downOnce,e.down,t)}},queueMouseMove:function(t){if(this.queue.push(h.MOUSE_MOVE,t),this._hasMoveCallback){var e=this.domCallbacks;this._hasMoveCallback=this.processDomCallbacks(e.moveOnce,e.move,t)}},queueMouseUp:function(t){if(this.queue.push(h.MOUSE_UP,t),this._hasUpCallback){var e=this.domCallbacks;this._hasUpCallback=this.processDomCallbacks(e.upOnce,e.up,t)}},addUpCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.upOnce.push(t):this.domCallbacks.up.push(t),this._hasUpCallback=!0,this},addDownCallback:function(t,e){return void 0===e&&(e=!0),e?this.domCallbacks.downOnce.push(t):this.domCallbacks.down.push(t),this._hasDownCallback=!0,this},addMoveCallback:function(t,e){return void 0===e&&(e=!1),e?this.domCallbacks.moveOnce.push(t):this.domCallbacks.move.push(t),this._hasMoveCallback=!0,this},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!t.willRender(e))return!1;var n=!0,s=t.parentContainer;if(s)do{if(!s.willRender(e)){n=!1;break}s=s.parentContainer}while(s);return n},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var s=this._tempPoint,r=i.scrollX,o=i.scrollY;n.length=0;var a=t.x,h=t.y;1!==i.resolution&&(a+=i._x,h+=i._y),i.getWorldPoint(a,h,s),t.worldX=s.x,t.worldY=s.y;for(var l={x:0,y:0},u=this._tempMatrix,c=this._tempMatrix2,d=0;d<e.length;d++){var f=e[d];if(this.inputCandidate(f,i)){var p=s.x+r*f.scrollFactorX-r,g=s.y+o*f.scrollFactorY-o;f.parentContainer?(f.getWorldTransformMatrix(u,c),u.applyInverse(p,g,l)):v(p,g,f.x,f.y,f.rotation,f.scaleX,f.scaleY,l),this.pointWithinHitArea(f,l.x,l.y)&&n.push(f)}}return n},pointWithinHitArea:function(t,e,i){e+=t.displayOriginX,i+=t.displayOriginY;var n=t.input;return!(!n||!n.hitAreaCallback(n.hitArea,e,i,t)||(n.localX=e,n.localY=i,0))},pointWithinInteractiveObject:function(t,e,i){return!!t.hitArea&&(e+=t.gameObject.displayOriginX,i+=t.gameObject.displayOriginY,t.localX=e,t.localY=i,t.hitAreaCallback(t.hitArea,e,i,t))},transformPointer:function(t,e,i){t.prevPosition.x=t.x,t.prevPosition.y=t.y,t.x=(e-this.bounds.left)*this.scale.x,t.y=(i-this.bounds.top)*this.scale.y},transformX:function(t){return(t-this.bounds.left)*this.scale.x},transformY:function(t){return(t-this.bounds.top)*this.scale.y},getOffsetX:function(){return this.bounds.left},getOffsetY:function(){return this.bounds.top},getScaleX:function(){return this.game.config.width/this.bounds.width},getScaleY:function(){return this.game.config.height/this.bounds.height},destroy:function(){this.events.removeAllListeners(),this.mouse&&this.mouse.destroy(),this.touch&&this.touch.destroy();for(var t=0;t<this.pointers.length;t++)this.pointers[t].destroy();this.domCallbacks={},this.pointers=[],this.queue=[],this._tempHitTest=[],this._tempMatrix.destroy(),this.canvas=null,this.game=null}});t.exports=c},function(t,e,i){var n,s,r,o=i(24),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var i=new Image;i.onload=function(){var t=o.create(i,6,1).getContext("2d");if(t.globalCompositeOperation="multiply",t.drawImage(r,0,0),t.drawImage(i,2,0),!t.getImageData(2,0,1,1))return!1;var e=t.getImageData(2,0,1,1).data;o.remove(i),a.supportNewBlendModes=255===e[0]&&0===e[1]&&0===e[2]},i.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},function(t,e,i){t.exports={os:i(92),browser:i(118),features:i(168),input:i(902),audio:i(901),video:i(900),fullscreen:i(899),canvasFeatures:i(339)}},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0;var n=this;this.step=function t(e){n.lastTime=n.tick,n.tick=e,n.timeOutID=window.requestAnimationFrame(t),n.callback(e)},this.stepTimeout=function t(){var e=Date.now(),i=Math.max(16+n.lastTime-e,0);n.lastTime=n.tick,n.tick=e,n.timeOutID=window.setTimeout(t,i),n.callback(e)}},start:function(t,e){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(92);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova&&!n.cocoonJS?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e){t.exports=function(t,e,i){return i<0&&(i+=1),1<i&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},function(t,e,i){var n=i(37);n.ColorToRGBA=i(915),n.ComponentToHex=i(346),n.GetColor=i(177),n.GetColor32=i(376),n.HexStringToColor=i(377),n.HSLToColor=i(914),n.HSVColorWheel=i(913),n.HSVToRGB=i(176),n.HueToComponent=i(345),n.IntegerToColor=i(374),n.IntegerToRGB=i(373),n.Interpolate=i(912),n.ObjectToColor=i(372),n.RandomRGB=i(911),n.RGBStringToColor=i(371),n.RGBToHSV=i(375),n.RGBToString=i(910),n.ValueToColor=i(178),t.exports=n},function(t,e){t.exports={setCrisp:function(e){return["optimizeSpeed","crisp-edges","-moz-crisp-edges","-webkit-optimize-contrast","optimize-contrast","pixelated"].forEach(function(t){e.style["image-rendering"]=t}),e.style.msInterpolationMode="nearest-neighbor",e},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var u=i(171),n=i(0),s=i(70),c=i(3),r=new n({Extends:s,initialize:function(t){void 0===t&&(t=[]),s.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;e<t.length;e++){var i=new c;"number"==typeof t[e]?(i.x=t[e],i.y=t[e+1],e++):Array.isArray(t[e])?(i.x=t[e][0],i.y=t[e][1]):(i.x=t[e].x,i.y=t[e].y),this.points.push(i)}return this},addPoint:function(t,e){var i=new c(t,e);return this.points.push(i),i},getStartPoint:function(t){return void 0===t&&(t=new c),t.copy(this.points[0])},getResolution:function(t){return t*this.points.length},getPoint:function(t,e){void 0===e&&(e=new c);var i=this.points,n=(i.length-1)*t,s=Math.floor(n),r=n-s,o=i[0===s?s:s-1],a=i[s],h=i[s>i.length-2?i.length-1:s+1],l=i[s>i.length-3?i.length-1:s+2];return e.set(u(r,o.x,a.x,h.x,l.x),u(r,o.y,a.y,h.y,l.y))},toJSON:function(){for(var t=[],e=0;e<this.points.length;e++)t.push(this.points[e].x),t.push(this.points[e].y);return{type:this.type,points:t}}});r.fromJSON=function(t){return new r(t.points)},t.exports=r},function(t,e){t.exports=function(t,e,i,n){return(o=1-t)*o*e+2*(1-(r=t))*r*i+(s=t)*s*n;var s,r,o}},function(t,e,i){var n=i(0),s=i(70),r=i(350),o=i(3),a=new n({Extends:s,initialize:function(t,e,i){s.call(this,"QuadraticBezier"),Array.isArray(t)&&(i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,n=this.p1,s=this.p2;return e.set(r(t,i.x,n.x,s.x),r(t,i.y,n.y,s.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);return t.strokePath(),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y]}}});a.fromJSON=function(t){var e=t.points,i=new o(e[0],e[1]),n=new o(e[2],e[3]),s=new o(e[4],e[5]);return new a(i,n,s)},t.exports=a},function(t,e,i){var n=i(0),s=i(70),r=i(173),o=i(9),a=i(3),h=new a,l=new n({Extends:s,initialize:function(t,e){s.call(this,"LineCurve"),Array.isArray(t)&&(e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e},getBounds:function(t){return void 0===t&&(t=new o),r([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new a),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(){return h.copy(this.p1).subtract(this.p0).normalize()},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});l.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),n=new a(e[2],e[3]);return new l(i,n)},t.exports=l},function(t,e,i){var n=i(0),l=i(70),u=i(31),c=i(4),s=i(172),d=i(3),r=new n({Extends:l,initialize:function(t,e,i,n,s,r,o,a){if("object"==typeof t){var h=t;t=c(h,"x",0),e=c(h,"y",0),i=c(h,"xRadius",0),n=c(h,"yRadius",i),s=c(h,"startAngle",0),r=c(h,"endAngle",360),o=c(h,"clockwise",!1),a=c(h,"rotation",0)}else void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=360),void 0===o&&(o=!1),void 0===a&&(a=0);l.call(this,"EllipseCurve"),this.p0=new d(t,e),this._xRadius=i,this._yRadius=n,this._startAngle=u(s),this._endAngle=u(r),this._clockwise=o,this._rotation=u(a)},getStartPoint:function(t){return void 0===t&&(t=new d),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=2*Math.PI,n=this._endAngle-this._startAngle,s=Math.abs(n)<Number.EPSILON;n<0;)n+=i;for(;i<n;)n-=i;n<Number.EPSILON&&(n=s?0:i),this._clockwise&&!s&&(n===i?n=-i:n-=i);var r=this._startAngle+t*n,o=this.p0.x+this._xRadius*Math.cos(r),a=this.p0.y+this._yRadius*Math.sin(r);if(0!==this._rotation){var h=Math.cos(this._rotation),l=Math.sin(this._rotation),u=o-this.p0.x,c=a-this.p0.y;o=u*h-c*l+this.p0.x,a=u*l+c*h+this.p0.y}return e.set(o,a)},setXRadius:function(t){return this.xRadius=t,this},setYRadius:function(t){return this.yRadius=t,this},setWidth:function(t){return this.xRadius=2*t,this},setHeight:function(t){return this.yRadius=2*t,this},setStartAngle:function(t){return this.startAngle=t,this},setEndAngle:function(t){return this.endAngle=t,this},setClockwise:function(t){return this.clockwise=t,this},setRotation:function(t){return this.rotation=t,this},x:{get:function(){return this.p0.x},set:function(t){this.p0.x=t}},y:{get:function(){return this.p0.y},set:function(t){this.p0.y=t}},xRadius:{get:function(){return this._xRadius},set:function(t){this._xRadius=t}},yRadius:{get:function(){return this._yRadius},set:function(t){this._yRadius=t}},startAngle:{get:function(){return s(this._startAngle)},set:function(t){this._startAngle=u(t)}},endAngle:{get:function(){return s(this._endAngle)},set:function(t){this._endAngle=u(t)}},clockwise:{get:function(){return this._clockwise},set:function(t){this._clockwise=t}},angle:{get:function(){return s(this._rotation)},set:function(t){this._rotation=u(t)}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t}},toJSON:function(){return{type:this.type,x:this.p0.x,y:this.p0.y,xRadius:this._xRadius,yRadius:this._yRadius,startAngle:s(this._startAngle),endAngle:s(this._endAngle),clockwise:this._clockwise,rotation:s(this._rotation)}}});r.fromJSON=function(t){return new r(t)},t.exports=r},function(t,e){t.exports=function(t,e,i,n,s){return(l=1-t)*l*l*e+3*(h=1-(a=t))*h*a*i+3*(1-(o=t))*o*o*n+(r=t)*r*r*s;var r,o,a,h,l}},function(t,e,i){var n=i(0),o=i(354),s=i(70),a=i(3),h=new n({Extends:s,initialize:function(t,e,i,n){s.call(this,"CubicBezierCurve"),Array.isArray(t)&&(n=new a(t[6],t[7]),i=new a(t[4],t[5]),e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=n},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new a);var i=this.p0,n=this.p1,s=this.p2,r=this.p3;return e.set(o(t,i.x,n.x,s.x,r.x),o(t,i.y,n.y,s.y,r.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);return t.strokePath(),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y,this.p3.x,this.p3.y]}}});h.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),n=new a(e[2],e[3]),s=new a(e[4],e[5]),r=new a(e[6],e[7]);return new h(i,n,s,r)},t.exports=h},function(t,e){t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},function(t,e,i){var y=i(356),m=i(24),x=i(4);t.exports=function(t){var e=x(t,"data",[]),i=x(t,"canvas",null),n=x(t,"palette",y),s=x(t,"pixelWidth",1),r=x(t,"pixelHeight",s),o=x(t,"resizeCanvas",!0),a=x(t,"clearCanvas",!0),h=x(t,"preRender",null),l=x(t,"postRender",null),u=Math.floor(Math.abs(e[0].length*s)),c=Math.floor(Math.abs(e.length*r));i||(i=m.create2D(this,u,c),a=o=!1),o&&(i.width=u,i.height=c);var d=i.getContext("2d");a&&d.clearRect(0,0,u,c),h&&h(i,d);for(var f=0;f<e.length;f++)for(var p=e[f],g=0;g<p.length;g++){var v=p[g];"."!==v&&" "!==v&&(d.fillStyle=n[v],d.fillRect(g*s,f*r,s,r))}return l&&l(i,d),i}},function(t,e,i){t.exports=i(952)},function(t,e,i){t.exports={In:i(955),Out:i(954),InOut:i(953)}},function(t,e,i){t.exports={In:i(958),Out:i(957),InOut:i(956)}},function(t,e,i){t.exports={In:i(961),Out:i(960),InOut:i(959)}},function(t,e,i){t.exports={In:i(964),Out:i(963),InOut:i(962)}},function(t,e,i){t.exports=i(965)},function(t,e,i){t.exports={In:i(968),Out:i(967),InOut:i(966)}},function(t,e,i){t.exports={In:i(971),Out:i(970),InOut:i(969)}},function(t,e,i){t.exports={In:i(974),Out:i(973),InOut:i(972)}},function(t,e,i){t.exports={In:i(977),Out:i(976),InOut:i(975)}},function(t,e,i){t.exports={In:i(980),Out:i(979),InOut:i(978)}},function(t,e,i){t.exports={In:i(983),Out:i(982),InOut:i(981)}},function(t,e,i){t.exports={Fade:i(986),Flash:i(985),Pan:i(984),Shake:i(951),Zoom:i(950)}},function(t,e,i){var a=i(37);t.exports=function(t){var e=new a,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var n=parseInt(i[1],10),s=parseInt(i[2],10),r=parseInt(i[3],10),o=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(n,s,r,255*o)}return e}},function(t,e,i){var n=i(37);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e){t.exports=function(t){return 16777215<t?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(37),s=i(373);t.exports=function(t){var e=s(t);return new n(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(e<i?6:0):r===e?a=(i-t)/o+2:r===i&&(a=(t-e)/o+4),a/=6),n.hasOwnProperty("_h")?(n._h=a,n._s=h,n._v=l):(n.h=a,n.s=h,n.v=l),n}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e,i){var o=i(37);t.exports=function(t){var e=new o;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var n=parseInt(i[1],16),s=parseInt(i[2],16),r=parseInt(i[3],16);e.setTo(n,s,r)}return e}},function(t,e,i){var s=i(121),n=i(24),w=i(175),u=i(23),r=i(0),o=i(14),a=i(370),b=i(119),h=i(9),l=i(3),c=new r({Extends:s,Mixins:[o.Flip,o.Tint],initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.inputEnabled=!0,this.fadeEffect=new a.Fade(this),this.flashEffect=new a.Flash(this),this.shakeEffect=new a.Shake(this),this.panEffect=new a.Pan(this),this.zoomEffect=new a.Zoom(this),this.lerp=new l(1,1),this.followOffset=new l,this.deadzone=null,this._follow=null,this.renderToTexture=!1,this.canvas=null,this.context=null,this.glTexture=null,this.framebuffer=null,this.pipeline=null},setRenderToTexture:function(t){var e=this.scene.sys.game.renderer;return e.gl?(this.glTexture=e.createTextureFromSource(null,this.width,this.height,0),this.framebuffer=e.createFramebuffer(this.width,this.height,this.glTexture,!1)):(this.canvas=n.create2D(this,this.width,this.height),this.context=this.canvas.getContext("2d")),this.renderToTexture=!0,t&&this.setPipeline(t),this},setPipeline:function(t){if("string"==typeof t){var e=this.scene.sys.game.renderer;e.gl&&e.hasPipeline(t)&&(this.pipeline=e.getPipeline(t))}else this.pipeline=t;return this},clearRenderToTexture:function(){var t=this.scene.sys.game.renderer;return t.gl?(this.framebuffer&&t.deleteFramebuffer(this.framebuffer),this.glTexture&&t.deleteTexture(this.glTexture),this.framebuffer=null,this.glTexture=null,this.pipeline=null):(n.remove(this),this.canvas=null,this.context=null),this.renderToTexture=!1,this},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new h(0,0,t,e),this._follow){var i=this.width/2,n=this.height/2,s=this._follow.x-this.followOffset.x,r=this._follow.y-this.followOffset.y;this.midPoint.set(s,r),this.scrollX=s-i,this.scrollY=r-n}w(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,n,s,r){return this.fadeEffect.start(!1,t,e,i,n,!0,s,r)},fadeOut:function(t,e,i,n,s,r){return this.fadeEffect.start(!0,t,e,i,n,!0,s,r)},fadeFrom:function(t,e,i,n,s,r,o){return this.fadeEffect.start(!1,t,e,i,n,s,r,o)},fade:function(t,e,i,n,s,r,o){return this.fadeEffect.start(!0,t,e,i,n,s,r,o)},flash:function(t,e,i,n,s,r,o){return this.flashEffect.start(t,e,i,n,s,r,o)},shake:function(t,e,i,n,s){return this.shakeEffect.start(t,e,i,n,s)},pan:function(t,e,i,n,s,r,o){return this.panEffect.start(t,e,i,n,s,r,o)},zoomTo:function(t,e,i,n,s,r){return this.zoomEffect.start(t,e,i,n,s,r)},preRender:function(t,e){var i=this.width,n=this.height,s=.5*i,r=.5*n,o=this.zoom*t,a=this.matrix,h=i*this.originX,l=n*this.originY,u=this._follow,c=this.deadzone,d=this.scrollX,f=this.scrollY;if(c&&w(c,this.midPoint.x,this.midPoint.y),u){var p=u.x-this.followOffset.x,g=u.y-this.followOffset.y;c?(p<c.x?d=b(d,d-(c.x-p),this.lerp.x):p>c.right&&(d=b(d,d+(p-c.right),this.lerp.x)),g<c.y?f=b(f,f-(c.y-g),this.lerp.y):g>c.bottom&&(f=b(f,f+(g-c.bottom),this.lerp.y))):(d=b(d,p-h,this.lerp.x),f=b(f,g-l,this.lerp.y))}this.useBounds&&(d=this.clampX(d),f=this.clampY(f)),this.roundPixels&&(h=Math.round(h),l=Math.round(l)),this.scrollX=d,this.scrollY=f;var v=d+s,y=f+r;this.midPoint.set(v,y);var m=i/o,x=n/o;this.worldView.setTo(v-m/2,y-x/2,m,x),a.loadIdentity(),a.scale(e,e),a.translate(this.x+h,this.y+l),a.rotate(this.rotation),a.scale(o,o),a.translate(-h,-l),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=u(i,0,1),n=u(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var o=this.width/2,a=this.height/2,h=t.x-s,l=t.y-r;return this.midPoint.set(h,l),this.scrollX=h-o,this.scrollY=l-a,this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=c},function(t,e,i){var n=i(380),s=new(i(0))({initialize:function(t){this.game=t,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.text=new n,this.html=new n,this.obj=new n,this.tilemap=new n,this.xml=new n,this.custom={},this.game.events.once("destroy",this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new n),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","text","html","obj","tilemap","xml"],e=0;e<t.length;e++)this[t[e]].destroy(),this[t[e]]=null;for(var i in this.custom)this.custom[i].destroy();this.custom=null,this.game=null}});t.exports=s},function(t,e,i){var n=i(0),s=i(180),r=i(11),o=new n({initialize:function(){this.entries=new s,this.events=new r},add:function(t,e){return this.entries.set(t,e),this.events.emit("add",this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit("remove",this,t,e.data)),this},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=o},function(t,e,i){var n=i(384),s=i(0),r=i(180),o=i(11),f=i(4),p=i(179),a=new s({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.paused=!1,this.name="AnimationManager",t.events.once("boot",this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once("destroy",this.destroy,this)},add:function(t,e){if(!this.anims.has(t))return e.key=t,this.anims.set(t,e),this.emit("add",t,e),this;console.warn("Animation with key",t,"already exists")},create:function(t){var e=t.key;if(e&&!this.anims.has(e)){var i=new n(this,e,t);return this.anims.set(e,i),this.emit("add",e,i),i}console.warn("Invalid Animation Key, or Key already in use: "+e)},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var n=0;n<t.anims.length;n++)i.push(this.create(t.anims[n]));t.hasOwnProperty("globalTimeScale")&&(this.globalTimeScale=t.globalTimeScale)}else t.hasOwnProperty("key")&&"frame"===t.type&&i.push(this.create(t));return i},generateFrameNames:function(t,e){var i=f(e,"prefix",""),n=f(e,"start",0),s=f(e,"end",0),r=f(e,"suffix",""),o=f(e,"zeroPad",0),a=f(e,"outputArray",[]),h=f(e,"frames",!1),l=this.textureManager.get(t);if(!l)return a;var u,c,d=n<s?1:-1;if(s+=d,e)if(Array.isArray(h))for(u=0;u<h.length;u++)c=i+p(h[u],o,"0",1)+r,l.has(c)&&a.push({key:t,frame:c});else for(u=n;u!==s;u+=d)c=i+p(u,o,"0",1)+r,l.has(c)&&a.push({key:t,frame:c});else for(h=l.getFrameNames(),u=0;u<h.length;u++)a.push({key:t,frame:h[u]});return a},generateFrameNumbers:function(t,e){var i,n=f(e,"start",0),s=f(e,"end",-1),r=f(e,"first",!1),o=f(e,"outputArray",[]),a=f(e,"frames",!1),h=this.textureManager.get(t);if(!h)return o;if(r&&h.has(r)&&o.push({key:t,frame:r}),Array.isArray(a))for(i=0;i<a.length;i++)h.has(a[i])&&o.push({key:t,frame:a[i]});else for(-1===s&&(s=h.frameTotal),i=n;i<=s;i++)h.has(i)&&o.push({key:t,frame:i});return o},get:function(t){return this.anims.get(t)},load:function(t,e,i){var n=this.get(e);return n&&n.load(t,i),t},pauseAll:function(){return this.paused||(this.paused=!0,this.emit("pauseall")),this},play:function(t,e){if(Array.isArray(e)||(e=[e]),this.get(t)){for(var i=0;i<e.length;i++)e[i].anims.play(t);return this}},remove:function(t){var e=this.get(t);return e&&(this.emit("remove",t,e),this.anims.delete(t)),e},resumeAll:function(){return this.paused&&(this.paused=!1,this.emit("resumeall")),this},staggerPlay:function(t,e,i){if(void 0===i&&(i=0),Array.isArray(e)||(e=[e]),this.get(t)){for(var n=0;n<e.length;n++)e[n].anims.delayedPlay(i*n,t);return this}},toJSON:function(t){if(void 0!==t&&""!==t)return this.anims.get(t).toJSON();var i={anims:[],globalTimeScale:this.globalTimeScale};return this.anims.each(function(t,e){i.anims.push(e.toJSON())}),i},destroy:function(){this.anims.clear(),this.textureManager=null,this.game=null}});t.exports=a},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e){t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,s,r=1;if(i){if(t<e[0][i])return e[0];for(;e[r][i]<t;)r++}else for(;e[r]<t;)r++;return r>e.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=i(23),s=i(0),r=i(383),g=i(382),v=i(4),o=new s({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,v(i,"frames",[]),v(i,"defaultTextureKey",null)),this.frameRate=v(i,"frameRate",null),this.duration=v(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=v(i,"skipMissedFrames",!0),this.delay=v(i,"delay",0),this.repeat=v(i,"repeat",0),this.repeatDelay=v(i,"repeatDelay",0),this.yoyo=v(i,"yoyo",!1),this.showOnStart=v(i,"showOnStart",!1),this.hideOnComplete=v(i,"hideOnComplete",!1),this.paused=!1,this.manager.on("pauseall",this.pause,this),this.manager.on("resumeall",this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(0<i.length){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return 0<=t&&t<this.frames.length},completeAnimation:function(t){this.hideOnComplete&&(t.parent.visible=!1),t.stop()},getFirstTick:function(t,e){void 0===e&&(e=!0),t.accumulator=0,t.nextTick=t.msPerFrame+t.currentFrame.duration,e&&(t.nextTick+=t._delay)},getFrameAt:function(t){return this.frames[t]},getFrames:function(t,i,e){var n,s,r,o,a=[],h=1;if("string"==typeof i){o=i;var l=t.get(o).getFrameNames();i=[],l.forEach(function(t,e){i.push({key:o,frame:e})})}if(!Array.isArray(i)||0===i.length)return a;for(r=0;r<i.length;r++){var u=i[r],c=v(u,"key",e);if(c){var d=v(u,"frame",0),f=t.getFrame(c,d);(s=new g(c,d,h,f)).duration=v(u,"duration",0),s.isFirst=!n,n&&((n.nextFrame=s).prevFrame=n),a.push(s),n=s,h++}}if(0<a.length){s.isLast=!0,s.nextFrame=a[0],a[0].prevFrame=s;var p=1/(a.length-1);for(r=0;r<a.length;r++)a[r].progress=r*p}return a},getNextTick:function(t){t.accumulator-=t.nextTick,t.nextTick=t.msPerFrame+t.currentFrame.duration},load:function(t,e){e>=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),r(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):0<t.repeatCounter?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&0<t.repeatCounter)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){var i=(t.forward=e)?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):0<t.repeatCounter?(t._reverse&&!t.forward?t.currentFrame=this.getLastFrame():t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);0<t._repeatDelay&&!1===t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay):(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying&&(this.getNextTick(t),t.pendingRepeat=!1,t.parent.emit("animationrepeat",this,t.currentFrame,t.repeatCounter,t.parent)))},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var e={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(t){e.frames.push(t.toJSON())}),e},updateFrameSequence:function(){for(var t=this.frames.length,e=1/(t-1),i=0;i<t;i++){var n=this.frames[i];n.index=i+1,n.isFirst=!1,n.isLast=!1,n.progress=i*e,0===i?(n.isFirst=!0,n.isLast=1===t,n.prevFrame=this.frames[t-1],n.nextFrame=this.frames[i+1]):i===t-1?(n.isLast=!0,n.prevFrame=this.frames[t-2],n.nextFrame=this.frames[0]):1<t&&(n.prevFrame=this.frames[i-1],n.nextFrame=this.frames[i+1])}return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off("pauseall",this.pause,this),this.manager.off("resumeall",this.resume,this),this.manager.remove(this.key);for(var t=0;t<this.frames.length;t++)this.frames[t].destroy();this.frames=[],this.manager=null}});t.exports=o},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var n=Math.round(t.x1),s=Math.round(t.y1),r=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(r-n),h=Math.abs(o-s),l=n<r?1:-1,u=s<o?1:-1,c=a-h;i.push({x:n,y:s});for(var d=1;n!==r||s!==o;){var f=c<<1;-h<f&&(c-=h,n+=l),f<a&&(c+=a,s+=u),d%e==0&&i.push({x:n,y:s}),d++}return i}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n<e;n++)i=t.pop(),t.unshift(i);return i}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n<e;n++)i=t.shift(),t.push(i);return i}},function(t,e,i){var h=i(124),l=i(6);t.exports=function(t,e,i,n){if(void 0===n&&(n=[]),!e&&!i)return n;e?i=Math.round(h(t)/e):e=h(t)/i;for(var s=t.x,r=t.y,o=0,a=0;a<i;a++)switch(n.push(new l(s,r)),o){case 0:(s+=e)>=t.right&&(o=1,r+=s-t.right,s=t.right);break;case 1:(r+=e)>=t.bottom&&(o=2,s-=r-t.bottom,r=t.bottom);break;case 2:(s-=e)<=t.left&&(o=3,r-=t.left-s,s=t.left);break;case 3:(r-=e)<=t.top&&(o=0,r=t.top)}return n}},function(t,e){t.exports={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}}},function(t,e,i){var n=i(16),s=i(38),r=i(199),o=i(198),a={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=r(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new s),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new s),void 0===e&&(e=new s);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t}};t.exports=a},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e){t.exports={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}}},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.geometryMask=e},setShape:function(t){this.geometryMask=t},preRenderWebGL:function(t,e,i){var n=t.gl,s=this.geometryMask;t.flush(),n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.NOTEQUAL,1,1),n.stencilOp(n.REPLACE,n.REPLACE,n.REPLACE),s.renderWebGL(t,s,0,i),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilFunc(n.EQUAL,1,1),n.stencilOp(n.KEEP,n.KEEP,n.KEEP)},postRenderWebGL:function(t){var e=t.gl;t.flush(),e.disable(e.STENCIL_TEST)},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,0,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e){var i=t.sys.game.renderer;if(this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,i&&i.gl){var n=i.width,s=i.height,r=0==(n&n-1)&&0==(s&s-1),o=i.gl,a=r?o.REPEAT:o.CLAMP_TO_EDGE,h=o.LINEAR;this.mainTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.maskTexture=i.createTexture2D(0,h,h,a,a,o.RGBA,null,n,s),this.mainFramebuffer=i.createFramebuffer(n,s,this.mainTexture,!1),this.maskFramebuffer=i.createFramebuffer(n,s,this.maskTexture,!1),i.onContextRestored(function(t){var e=t.width,i=t.height,n=0==(e&e-1)&&0==(i&i-1),s=t.gl,r=n?s.REPEAT:s.CLAMP_TO_EDGE,o=s.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,r,r,s.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!1),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!1)},this)}},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BitmapMaskPipeline.beginMask(this,e,i)},postRenderWebGL:function(t){t.pipelines.BitmapMaskPipeline.endMask(this)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null;var t=this.renderer;t&&t.gl&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer)),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null,this.renderer=null}});t.exports=n},function(t,e,i){var n=i(394),s=i(393),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&this.texture&&(t=this),new n(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new s(this.scene,t)}};t.exports=r},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x-e,a=t.y-i;return t.x=o*s-a*r+e,t.y=o*r+a*s+i,t}},function(t,e,i){var n=i(6);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var o=i(190),a=i(124);t.exports=function(t,e,i,n){void 0===n&&(n=[]),e||(e=a(t)/i);for(var s=0;s<e;s++){var r=s/e;n.push(o(t,r))}return n}},function(t,e){t.exports={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}}},function(t,e,i){var n=i(66),s={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),-1<=(t|=0)&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,e,i){var s=i(23),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,n){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(n,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,0===(this._alphaBR=e)?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);0!==(this._alphaTL=e)&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);0!==(this._alphaTR=e)&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);0!==(this._alphaBL=e)&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);0!==(this._alphaBR=e)&&(this.renderFlags|=2)}}};t.exports=n},function(t,e){t.exports=function(t){return Math.PI*t.radius*2}},function(t,e,i){var o=i(402),a=i(192),h=i(93),l=i(16);t.exports=function(t,e,i,n){void 0===n&&(n=[]),e||(e=o(t)/i);for(var s=0;s<e;s++){var r=h(s/e,0,l.PI2);n.push(a(t,r))}return n}},function(t,e,i){var n=new(i(0))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n<t.length;n++)e=.02519603282416938*(i+=t.charCodeAt(n)),e-=i=e>>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return 2.3283064365386963e-10*((this.n=i)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e<t.length&&null!=t[e];e++){var i=t[e];this.s0-=this.hash(i),this.s0+=~~(this.s0<0),this.s1-=this.hash(i),this.s1+=~~(this.s1<0),this.s2-=this.hash(i),this.s2+=~~(this.s2<0)}},integer:function(){return 4294967296*this.rnd()},frac:function(){return this.rnd()+11102230246251565e-32*(2097152*this.rnd()|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick(this.signs)},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-1)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},rotation:function(){return this.realInRange(-3.1415926,3.1415926)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")},shuffle:function(t){for(var e=t.length-1,i=e;0<i;i--){var n=Math.floor(this.frac()*(e+1)),s=t[n];t[n]=t[i],t[i]=s}return t}});t.exports=n},function(t,e,i){var s=i(192),r=i(93),o=i(16),a=i(6);t.exports=function(t,e,i){void 0===i&&(i=new a);var n=r(e,0,o.PI2);return s(t,n,i)}},function(t,e,i){var s=i(44),r=i(42),o=i(43),a=i(41);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,s(e)+i),a(t,r(e)-n),t}},function(t,e,i){var s=i(46),r=i(42),o=i(45),a=i(41);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,s(e)-i),a(t,r(e)-n),t}},function(t,e,i){var s=i(75),r=i(42),o=i(74),a=i(41);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,s(e)+i),a(t,r(e)-n),t}},function(t,e,i){var s=i(72),r=i(44),o=i(73),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)+i),o(t,s(e)+n),t}},function(t,e,i){var s=i(72),r=i(46),o=i(73),a=i(45);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)-i),o(t,s(e)+n),t}},function(t,e,i){var n=i(74),s=i(73);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var s=i(411),r=i(75),o=i(72);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),s(t,r(e)+i,o(e)+n),t}},function(t,e,i){var s=i(48),r=i(44),o=i(47),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)+i),o(t,s(e)+n),t}},function(t,e,i){var s=i(48),r=i(46),o=i(47),a=i(45);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)-i),o(t,s(e)+n),t}},function(t,e,i){var s=i(48),r=i(75),o=i(47),a=i(74);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)+i),o(t,s(e)+n),t}},function(t,e,i){var n=i(193),r=[];r[n.BOTTOM_CENTER]=i(415),r[n.BOTTOM_LEFT]=i(414),r[n.BOTTOM_RIGHT]=i(413),r[n.CENTER]=i(412),r[n.LEFT_CENTER]=i(410),r[n.RIGHT_CENTER]=i(409),r[n.TOP_CENTER]=i(408),r[n.TOP_LEFT]=i(407),r[n.TOP_RIGHT]=i(406),t.exports=function(t,e,i,n,s){return r[i](t,e,n,s)}},function(t,e,i){t.exports={Angle:i(1050),Call:i(1049),GetFirst:i(1048),GetLast:i(1047),GridAlign:i(1046),IncAlpha:i(1035),IncX:i(1034),IncXY:i(1033),IncY:i(1032),PlaceOnCircle:i(1031),PlaceOnEllipse:i(1030),PlaceOnLine:i(1029),PlaceOnRectangle:i(1028),PlaceOnTriangle:i(1027),PlayAnimation:i(1026),PropertyValueInc:i(32),PropertyValueSet:i(25),RandomCircle:i(1025),RandomEllipse:i(1024),RandomLine:i(1023),RandomRectangle:i(1022),RandomTriangle:i(1021),Rotate:i(1020),RotateAround:i(1019),RotateAroundDistance:i(1018),ScaleX:i(1017),ScaleXY:i(1016),ScaleY:i(1015),SetAlpha:i(1014),SetBlendMode:i(1013),SetDepth:i(1012),SetHitArea:i(1011),SetOrigin:i(1010),SetRotation:i(1009),SetScale:i(1008),SetScaleX:i(1007),SetScaleY:i(1006),SetTint:i(1005),SetVisible:i(1004),SetX:i(1003),SetXY:i(1002),SetY:i(1001),ShiftPosition:i(1e3),Shuffle:i(999),SmootherStep:i(998),SmoothStep:i(997),Spread:i(996),ToggleVisible:i(995),WrapInRectangle:i(994)}},function(t,e){var l={};(t.exports=l).create=function(t,e){var i=t.bodyA,n=t.bodyB,s={id:l.id(i,n),bodyA:i,bodyB:n,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:i.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return l.update(s,t,e),s},l.update=function(t,e,i){if((t.collision=e).collided){var n=e.supports,s=t.activeContacts,r=e.parentA,o=e.parentB;t.inverseMass=r.inverseMass+o.inverseMass,t.friction=Math.min(r.friction,o.friction),t.frictionStatic=Math.max(r.frictionStatic,o.frictionStatic),t.restitution=Math.max(r.restitution,o.restitution),t.slop=Math.max(r.slop,o.slop);for(var a=0;a<n.length;a++)s[a]=n[a].contact;var h=n.length;h<s.length&&(s.length=h),t.separation=e.depth,l.setActive(t,!0,i)}else!0===t.isActive&&l.setActive(t,!1,i)},l.setActive=function(t,e,i){e?(t.isActive=!0,t.timeUpdated=i):(t.isActive=!1,t.activeContacts.length=0)},l.id=function(t,e){return t.id<e.id?"A"+t.id+"B"+e.id:"A"+e.id+"B"+t.id}},function(t,e,i){t.exports={Bounce:i(1103),Collision:i(1102),Force:i(1101),Friction:i(1100),Gravity:i(1099),Mass:i(1098),Static:i(1097),Sensor:i(1096),SetBody:i(1095),Sleep:i(1093),Transform:i(1092),Velocity:i(1091)}},function(t,e,i){var n=i(0),s=i(895),r=i(196),f=10,o=new n({Extends:r,initialize:function(t){f=t.maxLights,t.fragShader=s.replace("%LIGHT_COUNT%",f.toString()),r.call(this,t),this.defaultNormalMap},boot:function(){this.defaultNormalMap=this.game.textures.getFrame("__DEFAULT")},onBind:function(t){r.prototype.onBind.call(this);var e=this.renderer,i=this.program;return this.mvpUpdate(),e.setInt1(i,"uNormSampler",1),e.setFloat2(i,"uResolution",this.width,this.height),t&&this.setNormalMap(t),this},onRender:function(t,e){this.active=!1;var i=t.sys.lights;if(!i||i.lights.length<=0||!i.active)return this;var n=i.cull(e),s=Math.min(n.length,f);if(0===s)return this;this.active=!0;var r,o=this.renderer,a=this.program,h=e.matrix,l={x:0,y:0},u=o.height;for(r=0;r<f;++r)o.setFloat1(a,"uLights["+r+"].radius",0);for(o.setFloat4(a,"uCamera",e.x,e.y,e.rotation,e.zoom),o.setFloat3(a,"uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),r=0;r<s;++r){var c=n[r],d="uLights["+r+"].";h.transformPoint(c.x,c.y,l),o.setFloat2(a,d+"position",l.x-e.scrollX*c.scrollFactorX*e.zoom,u-(l.y-e.scrollY*c.scrollFactorY*e.zoom)),o.setFloat3(a,d+"color",c.r,c.g,c.b),o.setFloat1(a,d+"intensity",c.intensity),o.setFloat1(a,d+"radius",c.radius)}return this},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x,w,b,T,S,_,A,C,M,P,E){var k;if(this.active)if(this.renderer.setPipeline(this),t.displayTexture?k=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?k=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(k=t.tileset.image.dataSource[0]),k){this.setTexture2D(k.glTexture,1);var F=this._tempMatrix1,L=this._tempMatrix2,R=this._tempMatrix3,O=y/i+C,D=m/n+M,B=(y+x)/i+C,I=(m+w)/n+M,Y=o,X=a,z=-g,N=-v;if(t.isCropped){var U=t._crop;Y=U.width,X=U.height,o=U.width,a=U.height;var V=y=U.x,G=m=U.y;c&&(V=x-U.x-U.width),d&&!e.isRenderTexture&&(G=w-U.y-U.height),O=V/i+C,D=G/n+M,B=(V+U.width)/i+C,I=(G+U.height)/n+M,z=-g+y,N=-v+m}d^=e.isRenderTexture?1:0,c&&(Y*=-1,z+=o),d&&(X*=-1,N+=a);var W=z+Y,H=N+X;L.applyITRS(s,r,u,h,l),F.copyFrom(P.matrix),E?(F.multiplyWithOffset(E,-P.scrollX*f,-P.scrollY*p),L.e=s,L.f=r):(L.e-=P.scrollX*f,L.f-=P.scrollY*p),F.multiply(L,R);var j=R.getX(z,N),q=R.getY(z,N),K=R.getX(z,H),J=R.getY(z,H),Z=R.getX(W,H),Q=R.getY(W,H),$=R.getX(W,N),tt=R.getY(W,N);P.roundPixels&&(j|=0,q|=0,K|=0,J|=0,Z|=0,Q|=0,$|=0,tt|=0),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,O,D,B,I,b,T,S,_,A)}else console.warn("Normal map missing or invalid")},setNormalMap:function(t){var e;this.active&&t&&(t.texture&&(e=t.texture.dataSource[t.frame.sourceIndex]),e||(e=this.defaultNormalMap),this.setTexture2D(e.glTexture,1),this.renderer.setPipeline(t.defaultPipeline))},batchSprite:function(t,e,i){if(this.active){var n=t.texture.dataSource[t.frame.sourceIndex];n&&(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),r.prototype.batchSprite.call(this,t,e,i))}}});o.LIGHT_COUNT=f,t.exports=o},function(t,e,i){var n=i(0),s=i(897),r=i(896),o=i(197),a=new n({Extends:o,initialize:function(t){o.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:t.topology?t.topology:t.renderer.gl.TRIANGLES,vertShader:t.vertShader?t.vertShader:r,fragShader:t.fragShader?t.fragShader:s,vertexCapacity:t.vertexCapacity?t.vertexCapacity:3,vertexSize:t.vertexSize?t.vertexSize:2*Float32Array.BYTES_PER_ELEMENT,vertices:new Float32Array([-1,1,-1,-7,7,1]).buffer,attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.maxQuads=1,this.resolutionDirty=!0},onBind:function(){o.prototype.onBind.call(this);var t=this.renderer,e=this.program;return this.resolutionDirty&&(t.setFloat2(e,"uResolution",this.width,this.height),t.setInt1(e,"uMainSampler",0),t.setInt1(e,"uMaskSampler",1),this.resolutionDirty=!1),this},resize:function(t,e,i){return o.prototype.resize.call(this,t,e,i),this.resolutionDirty=!0,this},beginMask:function(t,e,i){var n=this.renderer,s=this.gl,r=t.bitmapMask;r&&s&&(n.flush(),n.setFramebuffer(t.maskFramebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),r.renderWebGL(n,r,0,i),n.flush(),n.setFramebuffer(t.mainFramebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT))},endMask:function(t){var e=this.renderer,i=this.gl;t.bitmapMask&&i&&(e.setFramebuffer(null),e.setPipeline(this),e.setTexture2D(t.maskTexture,1),e.setTexture2D(t.mainTexture,0),e.setInt1(this.program,"uInvertMaskAlpha",t.invertAlpha),i.drawArrays(this.topology,0,3))}});t.exports=a},function(t,e){t.exports=function(t,e,i){e||(e="image/png"),i||(i=.92);var n=t.getContext("experimental-webgl"),s=new Uint8Array(n.drawingBufferWidth*n.drawingBufferHeight*4);n.readPixels(0,0,n.drawingBufferWidth,n.drawingBufferHeight,n.RGBA,n.UNSIGNED_BYTE,s);var r,o=document.createElement("canvas"),a=o.getContext("2d");o.width=n.drawingBufferWidth,o.height=n.drawingBufferHeight;for(var h=(r=a.getImageData(0,0,o.width,o.height)).data,l=0;l<o.height;l+=1)for(var u=0;u<o.width;u+=1){var c=4*((o.height-l)*o.width+u),d=4*(l*o.width+u);h[d+0]=s[c+0],h[d+1]=s[c+1],h[d+2]=s[c+2],h[d+3]=s[c+3]}a.putImageData(r,0,0);var f=o.toDataURL(e,i),p=new Image;return p.src=f,p}},function(t,e,i){var s=i(121),n=i(0),c=i(26),a=i(117),r=i(91),o=i(38),h=i(10),l=i(422),u=i(421),d=i(420),f=i(196),p=new n({initialize:function(t){var n=this,e=t.config,i={alpha:e.transparent,depth:!1,antialias:e.antialias,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,resolution:e.resolution,autoResize:e.autoResize,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights},this.game=t,this.type=c.WEBGL,this.width=t.config.width,this.height=t.config.height,this.canvas=t.canvas,this.lostContextCallbacks=[],this.restoredContextCallbacks=[],this.blendModes=[],this.nativeTextures=[],this.contextLost=!1,this.pipelines=null,this.snapshotState={callback:null,type:null,encoder:null},this.currentActiveTextureUnit=0,this.currentTextures=new Array(16),this.currentFramebuffer=null,this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.canvas.addEventListener("webglcontextlost",function(t){n.contextLost=!0,t.preventDefault();for(var e=0;e<n.lostContextCallbacks.length;++e){var i=n.lostContextCallbacks[e];i[0].call(i[1],n)}},!1),this.canvas.addEventListener("webglcontextrestored",function(){n.contextLost=!1,n.init(n.config);for(var t=0;t<n.restoredContextCallbacks.length;++t){var e=n.restoredContextCallbacks[t];e[0].call(e[1],n)}},!1),this.gl=null,this.supportedExtensions=null,this.extensions={},this.glFormats=[],this.compression={ETC1:!1,PVRTC:!1,S3TC:!1},this.drawingBufferHeight=0,this.blankTexture=null,this.defaultCamera=new s(0,0,0,0),this._tempMatrix1=new o,this._tempMatrix2=new o,this._tempMatrix3=new o,this._tempMatrix4=new o,this.init(this.config)},init:function(t){var e,i=this.canvas,n=t.backgroundColor;if(!(e=this.game.config.context?this.game.config.context:i.getContext("webgl",t.contextCreation)||i.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e,this.game.context=e;for(var s=0;s<=16;s++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT;var r=e.getSupportedExtensions();t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE));var o="WEBGL_compressed_texture_",a="WEBKIT_"+o;this.compression.ETC1=e.getExtension(o+"etc1")||e.getExtension(a+"etc1"),this.compression.PVRTC=e.getExtension(o+"pvrtc")||e.getExtension(a+"pvrtc"),this.compression.S3TC=e.getExtension(o+"s3tc")||e.getExtension(a+"s3tc"),this.supportedExtensions=r,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(n.redGL,n.greenGL,n.blueGL,1);for(var h=0;h<this.currentTextures.length;++h)this.currentTextures[h]=null;return this.pipelines={},this.addPipeline("TextureTintPipeline",new f({game:this.game,renderer:this})),this.addPipeline("BitmapMaskPipeline",new u({game:this.game,renderer:this})),this.addPipeline("Light2D",new d({game:this.game,renderer:this,maxLights:t.maxLights})),this.setBlendMode(c.BlendModes.NORMAL),this.resize(this.width,this.height),this.game.events.once("texturesready",this.boot,this),this},boot:function(){for(var t in this.pipelines)this.pipelines[t].boot();var e=this.game.textures.getFrame("__DEFAULT");this.pipelines.TextureTintPipeline.currentFrame=e,this.blankTexture=e},resize:function(t,e){var i=this.gl,n=this.pipelines,s=this.config.resolution;for(var r in this.width=Math.floor(t*s),this.height=Math.floor(e*s),this.canvas.width=this.width,this.canvas.height=this.height,this.config.autoResize&&(this.canvas.style.width=this.width/s+"px",this.canvas.style.height=this.height/s+"px"),i.viewport(0,0,this.width,this.height),n)n[r].resize(t,e,s);return this.drawingBufferHeight=i.drawingBufferHeight,this.defaultCamera.setSize(t,e),i.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this},onContextRestored:function(t,e){return this.restoredContextCallbacks.push([t,e]),this},onContextLost:function(t,e){return this.lostContextCallbacks.push([t,e]),this},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},flush:function(){this.currentPipeline&&this.currentPipeline.flush()},hasPipeline:function(t){return t in this.pipelines},getPipeline:function(t){return this.hasPipeline(t)?this.pipelines[t]:null},removePipeline:function(t){return delete this.pipelines[t],this},addPipeline:function(t,e){return this.hasPipeline(t)?console.warn("Pipeline exists: "+t):this.pipelines[t]=e,e.name=t,this.pipelines[t].resize(this.width,this.height,this.config.resolution),e},pushScissor:function(t,e,i,n){var s=[t,e,i,n];return this.scissorStack.push(s),this.setScissor(t,e,i,n),this.currentScissor=s},setScissor:function(t,e,i,n){var s=this.gl,r=this.currentScissor,o=r[0],a=r[1],h=r[2],l=r[3];o===t&&a===e&&h===i&&l===n||(this.flush(),0<i&&0<n&&s.scissor(t,this.drawingBufferHeight-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},setBlendMode:function(t){var e=this.gl,i=this.blendModes[t];return t!==c.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t&&(this.flush(),e.enable(e.BLEND),e.blendEquation(i.equation),2<i.func.length?e.blendFuncSeparate(i.func[0],i.func[1],i.func[2],i.func[3]):e.blendFunc(i.func[0],i.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return 16<t&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e){var i=this.gl;return t!==this.currentTextures[e]&&(this.flush(),this.currentActiveTextureUnit!==e&&(i.activeTexture(i.TEXTURE0+e),this.currentActiveTextureUnit=e),i.bindTexture(i.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t){var e=this.gl,i=this.width,n=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(i=t.renderTexture.width,n=t.renderTexture.height):this.flush(),e.bindFramebuffer(e.FRAMEBUFFER,t),e.viewport(0,0,i,n),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,r=s.NEAREST,o=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,a(e,i)&&(o=s.REPEAT),n===c.ScaleModes.LINEAR&&this.config.antialias&&(r=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,r,r,o,o,s.RGBA,t):this.createTexture2D(0,r,r,o,o,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l){l=null==l||l;var u=this.gl,c=u.createTexture();return this.setTexture2D(c,0),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,i),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,s),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),null==o?u.texImage2D(u.TEXTURE_2D,t,r,a,h,0,r,u.UNSIGNED_BYTE,null):(u.texImage2D(u.TEXTURE_2D,t,r,r,u.UNSIGNED_BYTE,o),a=o.width,h=o.height),this.setTexture2D(null,0),c.isAlphaPremultiplied=l,c.isRenderTexture=!1,c.width=a,c.height=h,this.nativeTextures.push(c),c},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s]);return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&r(this.nativeTextures,e),this.gl.deleteTexture(t),this.currentTextures[0]===t&&this.setBlankTexture(!0),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,s=t._ch,r=this.pipelines.TextureTintPipeline,o=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-s),this.setFramebuffer(t.framebuffer);var a=this.gl;a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),r.projOrtho(e,n+e,i,s+i,-1e3,1e3),0<o.alphaGL&&r.drawFillRect(e,i,n+e,s+i,h.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL),t.emit("prerender",t)}else this.pushScissor(e,i,n,s),0<o.alphaGL&&r.drawFillRect(e,i,n,s,h.getTintFromFloats(o.redGL,o.greenGL,o.blueGL,1),o.alphaGL)},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,h.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,h.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit("postrender",t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=h.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.config.backgroundColor,i=this.pipelines;for(var n in this.config.clearBeforeRender&&(t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)),t.enable(t.SCISSOR_TEST),i)i[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,r=s.length,o=this.pipelines;for(var a in o)o[a].onRender(t,n);this.preRenderCamera(n);for(var h=0;h<r;h++){var l=s[h];if(l.willRender(n)){l.blendMode!==this.currentBlendMode&&this.setBlendMode(l.blendMode);var u=l.mask;u?(u.preRenderWebGL(this,l,n),l.renderWebGL(this,l,i,n),u.postRenderWebGL(this,l)):l.renderWebGL(this,l,i,n)}}this.setBlendMode(c.BlendModes.NORMAL),this.postRenderCamera(n)}},postRender:function(){if(!this.contextLost){this.flush(),this.snapshotState.callback&&(this.snapshotState.callback(l(this.canvas,this.snapshotState.type,this.snapshotState.encoder)),this.snapshotState.callback=null);var t=this.pipelines;for(var e in t)t[e].onPostRender()}},snapshot:function(t,e,i){return this.snapshotState.callback=t,this.snapshotState.type=e,this.snapshotState.encoder=i,this},canvasToTexture:function(t,e,i){void 0===i&&(i=!1);var n=this.gl;if(e)this.setTexture2D(e,0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.width=t.width,e.height=t.height,this.setTexture2D(null,0);else{var s=n.CLAMP_TO_EDGE;!i&&a(t.width,t.height)&&(s=n.REPEAT),e=this.createTexture2D(0,n.NEAREST,n.NEAREST,s,s,n.RGBA,t,t.width,t.height,!0)}return e},setTextureFilter:function(t,e){var i=this.gl,n=[i.LINEAR,i.NEAREST][e];return this.setTexture2D(t,0),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,n),this.setTexture2D(null,0),this},setFloat1:function(t,e,i){return this.setProgram(t),this.gl.uniform1f(this.gl.getUniformLocation(t,e),i),this},setFloat2:function(t,e,i,n){return this.setProgram(t),this.gl.uniform2f(this.gl.getUniformLocation(t,e),i,n),this},setFloat3:function(t,e,i,n,s){return this.setProgram(t),this.gl.uniform3f(this.gl.getUniformLocation(t,e),i,n,s),this},setFloat4:function(t,e,i,n,s,r){return this.setProgram(t),this.gl.uniform4f(this.gl.getUniformLocation(t,e),i,n,s,r),this},setFloat1v:function(t,e,i){return this.setProgram(t),this.gl.uniform1fv(this.gl.getUniformLocation(t,e),i),this},setFloat2v:function(t,e,i){return this.setProgram(t),this.gl.uniform2fv(this.gl.getUniformLocation(t,e),i),this},setFloat3v:function(t,e,i){return this.setProgram(t),this.gl.uniform3fv(this.gl.getUniformLocation(t,e),i),this},setFloat4v:function(t,e,i){return this.setProgram(t),this.gl.uniform4fv(this.gl.getUniformLocation(t,e),i),this},setInt1:function(t,e,i){return this.setProgram(t),this.gl.uniform1i(this.gl.getUniformLocation(t,e),i),this},setInt2:function(t,e,i,n){return this.setProgram(t),this.gl.uniform2i(this.gl.getUniformLocation(t,e),i,n),this},setInt3:function(t,e,i,n,s){return this.setProgram(t),this.gl.uniform3i(this.gl.getUniformLocation(t,e),i,n,s),this},setInt4:function(t,e,i,n,s,r){return this.setProgram(t),this.gl.uniform4i(this.gl.getUniformLocation(t,e),i,n,s,r),this},setMatrix2:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix2fv(this.gl.getUniformLocation(t,e),i,n),this},setMatrix3:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix3fv(this.gl.getUniformLocation(t,e),i,n),this},setMatrix4:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix4fv(this.gl.getUniformLocation(t,e),i,n),this},getMaxTextures:function(){return this.config.maxTextures},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){for(var t in this.pipelines)this.pipelines[t].destroy(),delete this.pipelines[t];for(var e=0;e<this.nativeTextures.length;++e)this.deleteTexture(this.nativeTextures[e]),delete this.nativeTextures[e];delete this.gl,delete this.game,this.contextLost=!0,this.extensions={},this.nativeTextures.length=0}});t.exports=p},function(t,e,i){var n=i(66),s=i(339);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[n.NORMAL]=i,t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":i,t[n.SCREEN]=e?"screen":i,t[n.OVERLAY]=e?"overlay":i,t[n.DARKEN]=e?"darken":i,t[n.LIGHTEN]=e?"lighten":i,t[n.COLOR_DODGE]=e?"color-dodge":i,t[n.COLOR_BURN]=e?"color-burn":i,t[n.HARD_LIGHT]=e?"hard-light":i,t[n.SOFT_LIGHT]=e?"soft-light":i,t[n.DIFFERENCE]=e?"difference":i,t[n.EXCLUSION]=e?"exclusion":i,t[n.HUE]=e?"hue":i,t[n.SATURATION]=e?"saturation":i,t[n.COLOR]=e?"color":i,t[n.LUMINOSITY]=e?"luminosity":i,t}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e="image/png"),void 0===i&&(i=.92);var n=t.toDataURL(e,i),s=new Image;return s.src=n,s}},function(t,e,i){var n=i(425),s=i(0),r=i(26),o=i(424),a=i(94),h=i(120),l=i(38),u=new s({initialize:function(t){this.game=t,this.type=r.CANVAS,this.drawCount=0,this.width=t.config.width,this.height=t.config.height,this.config={clearBeforeRender:t.config.clearBeforeRender,backgroundColor:t.config.backgroundColor,resolution:t.config.resolution,autoResize:t.config.autoResize,antialias:t.config.antialias,roundPixels:t.config.roundPixels},this.scaleMode=t.config.antialias?a.LINEAR:a.NEAREST,this.gameCanvas=t.canvas,this.gameContext=this.game.config.context?this.game.config.context:this.gameCanvas.getContext("2d"),this.currentContext=this.gameContext,this.blendModes=o(),this.currentScaleMode=0,this.snapshotCallback=null,this.snapshotType=null,this.snapshotEncoder=null,this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.init()},init:function(){this.resize(this.width,this.height)},resize:function(t,e){var i=this.config.resolution;this.width=t*i,this.height=e*i,this.gameCanvas.width=this.width,this.gameCanvas.height=this.height,this.config.autoResize&&(this.gameCanvas.style.width=this.width/i+"px",this.gameCanvas.style.height=this.height/i+"px"),this.scaleMode===a.NEAREST&&h.disable(this.gameContext)},onContextLost:function(){},onContextRestored:function(){},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),this.drawCount=0},render:function(t,e,i,n){var s=e.list,r=s.length,o=n._cx,a=n._cy,h=n._cw,l=n._ch,u=n.renderToTexture?n.context:t.sys.context,c=0!==o||0!==a||h!==u.canvas.width||l!==u.canvas.height;this.currentContext=u,n.transparent||(u.fillStyle=n.backgroundColor.rgba,u.fillRect(o,a,h,l)),u.globalAlpha=n.alpha,u.globalCompositeOperation="source-over",this.drawCount+=s.length,c&&(u.save(),u.beginPath(),u.rect(o,a,h,l),u.clip()),n.renderToTexture&&n.emit("prerender",n),n.matrix.copyToContext(u);for(var d=0;d<r;d++){var f=s[d];f.willRender(n)&&(f.mask&&f.mask.preRenderCanvas(this,f,n),f.renderCanvas(this,f,i,n),f.mask&&f.mask.postRenderCanvas(this,f,n))}u.setTransform(1,0,0,1,0,0),u.globalCompositeOperation="source-over",u.globalAlpha=1,n.flashEffect.postRenderCanvas(u),n.fadeEffect.postRenderCanvas(u),n.dirty=!1,c&&u.restore(),n.renderToTexture&&(n.emit("postrender",n),t.sys.context.drawImage(n.canvas,o,a))},postRender:function(){var t=this.gameContext;t.globalAlpha=1,t.globalCompositeOperation="source-over",this.snapshotCallback&&(this.snapshotCallback(n(this.gameCanvas,this.snapshotType,this.snapshotEncoder)),this.snapshotCallback=null)},snapshot:function(t,e,i){this.snapshotCallback=t,this.snapshotType=e,this.snapshotEncoder=i},batchSprite:function(t,e,i,n){var s=i.alpha*t.alpha;if(0!==s){var r=this.currentContext,o=this._tempMatrix1,a=this._tempMatrix2,h=this._tempMatrix3,l=e.canvasData,u=l.x,c=l.y,d=e.cutWidth,f=e.cutHeight,p=e.source.resolution,g=-t.displayOriginX+e.x,v=-t.displayOriginY+e.y,y=t.flipX?-1:1,m=t.flipY?-1:1;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||e.updateCropUVs(x,t.flipX,t.flipY),d=x.cw,f=x.ch,u=x.cx,c=x.cy,g=-t.displayOriginX+x.x,v=-t.displayOriginY+x.y,-1===y&&(0<=g?g=-(g+d):g<0&&(g=Math.abs(g)-d)),-1===m&&(0<=v?v=-(v+f):v<0&&(v=Math.abs(v)-f))}a.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY),o.multiply(a,h),r.save(),h.setToContext(r),r.scale(y,m),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.drawImage(e.source.image,u,c,d,f,g,v,d/p,f/p),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=u},function(t,e,i){var n=new(i(0))({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.once("remove",this.remove,this),this.isPlaying=!1,this.currentAnim=null,this.currentFrame=null,this._timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this._delay=0,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this.forward=!0,this._reverse=!1,this.accumulator=0,this.nextTick=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},setDelay:function(t){return void 0===t&&(t=0),this._delay=t,this.parent},getDelay:function(){return this._delay},delayedPlay:function(t,e,i){return this.play(e,!0,i),this.nextTick+=t,this.parent},getCurrentKey:function(){if(this.currentAnim)return this.currentAnim.key},load:function(t,e){return void 0===e&&(e=0),this.isPlaying&&this.stop(),this.animationManager.load(this,t,e),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.updateFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.updateFrame(t),this.parent},isPaused:{get:function(){return this._paused}},play:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!0,this._reverse=!1,this._startAnimation(t,i))},playReverse:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=0),e&&this.isPlaying&&this.currentAnim.key===t?this.parent:(this.forward=!1,this._reverse=!0,this._startAnimation(t,i))},_startAnimation:function(t,e){this.load(t,e);var i=this.currentAnim,n=this.parent;return this.repeatCounter=-1===this._repeat?Number.MAX_VALUE:this._repeat,i.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,i.showOnStart&&(n.visible=!0),n.emit("animationstart",this.currentAnim,this.currentFrame,n),n},reverse:function(t){return this.isPlaying&&this.currentAnim.key===t&&(this._reverse=!this._reverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame.progress;return this.forward||(t=1-t),t},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},remove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},getRepeat:function(){return this._repeat},setRepeat:function(t){return this._repeat=t,this.repeatCounter=0,this.parent},getRepeatDelay:function(){return this._repeatDelay},setRepeatDelay:function(t){return this._repeatDelay=t,this.parent},restart:function(t){void 0===t&&(t=!1),this.currentAnim.getFirstTick(this,t),this.forward=!0,this.isPlaying=!0,this.pendingRepeat=!1,this._paused=!1,this.updateFrame(this.currentAnim.frames[0]);var e=this.parent;return e.emit("animationrestart",this.currentAnim,this.currentFrame,e),this.parent},stop:function(){this._pendingStop=0,this.isPlaying=!1;var t=this.parent;return t.emit("animationcomplete",this.currentAnim,this.currentFrame,t),t},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopOnRepeat:function(){return this._pendingStop=2,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},setTimeScale:function(t){return void 0===t&&(t=1),this._timeScale=t,this.parent},getTimeScale:function(){return this._timeScale},getTotalFrames:function(){return this.currentAnim.frames.length},update:function(t,e){if(this.currentAnim&&this.isPlaying&&!this.currentAnim.paused){if(this.accumulator+=e*this._timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.currentAnim.completeAnimation(this);this.accumulator>=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit("animationupdate",i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off("remove",this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=n},function(t,e){t.exports=function(t){return t.split("").reverse().join("")}},function(t,e){t.exports=function(t,i){return t.replace(/%([0-9]+)/g,function(t,e){return i[Number(e)-1]})}},function(t,e,i){t.exports={Format:i(429),Pad:i(179),Reverse:i(428),UppercaseFirst:i(327),UUID:i(295)}},function(t,e,i){var s=i(63);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)&&(i[n]=e[n]);return i}},function(t,e){t.exports=function(t,e){for(var i=0;i<e.length;i++)if(!t.hasOwnProperty(e[i]))return!1;return!0}},function(t,e,i){var o=i(4),a=i(23);t.exports=function(t,e,i,n,s){void 0===s&&(s=i);var r=o(t,e,s);return a(r,i,n)}},function(t,e,i){t.exports={Clone:i(63),Extend:i(20),GetAdvancedValue:i(12),GetFastValue:i(2),GetMinMaxValue:i(433),GetValue:i(4),HasAll:i(432),HasAny:i(298),HasValue:i(85),IsPlainObject:i(8),Merge:i(96),MergeRight:i(431)}},function(t,e,i){t.exports={Array:i(164),Objects:i(434),String:i(430)}},function(t,e,i){var n=i(0),s=i(203),r=i(15),o=i(202),a=i(83),h=i(97),l=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.timeScale=1,this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){var t=this.systems.events;t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this),this.timeScale=1},createTimeline:function(t){return o(this,t)},timeline:function(t){var e=o(this,t);return e.paused||(this._add.push(e),this._toProcess++),e},create:function(t){return h(this,t)},add:function(t){var e=h(this,t);return this._add.push(e),this._toProcess++,e},existing:function(t){return this._add.push(t),this._toProcess++,this},addCounter:function(t){var e=s(this,t);return this._add.push(e),this._toProcess++,e},preUpdate:function(){if(0!==this._toProcess){var t,e,i=this._destroy,n=this._active,s=this._pending;for(t=0;t<i.length;t++){e=i[t];var r=n.indexOf(e);-1===r?-1<(r=s.indexOf(e))&&(e.state=a.REMOVED,s.splice(r,1)):(e.state=a.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;t<i.length;t++)(e=i[t]).state===a.PENDING_ADD&&(e.init()?(e.play(),this._active.push(e)):this._pending.push(e));i.length=0,this._toProcess=0}},update:function(t,e){var i,n=this._active;e*=this.timeScale;for(var s=0;s<n.length;s++)(i=n[s]).update(t,e)&&(this._destroy.push(i),this._toProcess++)},makeActive:function(t){if(-1===this._add.indexOf(t)&&-1===this._active.indexOf(t)){var e=this._pending.indexOf(t);return-1!==e&&this._pending.splice(e,1),this._add.push(t),t.state=a.PENDING_ADD,this._toProcess++,this}},each:function(t,e){for(var i=[null],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var s in this.list)i[0]=this.list[s],t.apply(e,i)},getAllTweens:function(){for(var t=this._active,e=[],i=0;i<t.length;i++)e.push(t[i]);return e},getGlobalTimeScale:function(){return this.timeScale},getTweensOf:function(t){var e,i,n=this._active,s=[];if(Array.isArray(t))for(i=0;i<n.length;i++){e=n[i];for(var r=0;r<t.length;r++)e.hasTarget(t[r])&&s.push(e)}else for(i=0;i<n.length;i++)(e=n[i]).hasTarget(t)&&s.push(e);return s},isTweening:function(t){for(var e,i=this._active,n=0;n<i.length;n++)if((e=i[n]).hasTarget(t)&&e.isPlaying())return!0;return!1},killAll:function(){for(var t=this.getAllTweens(),e=0;e<t.length;e++)t[e].stop();return this},killTweensOf:function(t){for(var e=this.getTweensOf(t),i=0;i<e.length;i++)e[i].stop();return this},pauseAll:function(){for(var t=this._active,e=0;e<t.length;e++)t[e].pause();return this},resumeAll:function(){for(var t=this._active,e=0;e<t.length;e++)t[e].resume();return this},setGlobalTimeScale:function(t){return this.timeScale=t,this},shutdown:function(){this.killAll(),this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0;var t=this.systems.events;t.off("preupdate",this.preUpdate,this),t.off("update",this.update,this),t.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("TweenManager",l,"tweens"),t.exports=l},function(t,e){t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","loop","loopDelay","offset","onComplete","onCompleteParams","onCompleteScope","onLoop","onLoopParams","onLoopScope","onRepeat","onRepeatParams","onRepeatScope","onStart","onStartParams","onStartScope","onUpdate","onUpdateParams","onUpdateScope","onYoyo","onYoyoParams","onYoyoScope","paused","props","repeat","repeatDelay","targets","useFrames","yoyo"]},function(t,e,i){t.exports={GetBoolean:i(84),GetEaseFunction:i(86),GetNewValue:i(98),GetProps:i(205),GetTargets:i(131),GetTweens:i(204),GetValueOp:i(130),NumberTweenBuilder:i(203),TimelineBuilder:i(202),TweenBuilder:i(97)}},function(t,e,i){var n=i(83),s=i(20),r={Builders:i(438),TweenManager:i(436),Tween:i(128),TweenData:i(127),Timeline:i(201)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(0),s=i(15),r=i(206),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=Date.now(),this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){var t=this.systems.events;t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this)},addEvent:function(t){var e=new r(t);return this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,n){return this.addEvent({delay:t,callback:e,args:i,callbackScope:n})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeAllEvents:function(){return this._pendingRemoval=this._pendingRemoval.concat(this._active),this},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,n;for(i=0;i<t;i++){n=this._pendingRemoval[i];var s=this._active.indexOf(n);-1<s&&this._active.splice(s,1),n.destroy()}for(i=0;i<e;i++)n=this._pendingInsertion[i],this._active.push(n);this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){if(this.now=t,!this.paused){e*=this.timeScale;for(var i=0;i<this._active.length;i++){var n=this._active[i];if(!n.paused&&(n.elapsed+=e*n.timeScale,n.elapsed>=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),0<n.repeatCount?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t<this._pendingInsertion.length;t++)this._pendingInsertion[t].destroy();for(t=0;t<this._active.length;t++)this._active[t].destroy();for(t=0;t<this._pendingRemoval.length;t++)this._pendingRemoval[t].destroy();this._active.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var e=this.systems.events;e.off("preupdate",this.preUpdate,this),e.off("update",this.update,this),e.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});s.register("Clock",o,"time"),t.exports=o},function(t,e,i){t.exports={Clock:i(440),TimerEvent:i(206)}},function(t,e,i){var n=i(5),a=i(132);n.register("tilemap",function(t,e,i,n,s,r,o){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===n&&(n=void 0),null===s&&(s=void 0),a(this.scene,t,e,i,n,s,r,o)})},function(t,e,i){var n=i(13),s=i(132);n.register("tilemap",function(t){var e=void 0!==t?t:{};return s(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)})},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix);var u=t.currentContext,c=e.gidMap;u.save(),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l),l.copyToContext(u)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,h.copyToContext(u));var d=n.alpha*e.alpha;u.globalAlpha=n.alpha*e.alpha;for(var f=0;f<o;f++){var p=r[f],g=c[p.index];if(g){var v=g.image.getSourceImage(),y=g.getTileTextureCoordinates(p.index);if(y){var m=p.width/2,x=p.height/2;u.save(),u.translate(p.pixelX+m,p.pixelY+x),0!==p.rotation&&u.rotate(p.rotation),(p.flipX||p.flipY)&&u.scale(p.flipX?-1:1,p.flipY?-1:1),u.globalAlpha=d*p.alpha,u.drawImage(v,y.x,y.y,p.width,p.height,-m,-x,p.width,p.height),u.restore()}}}u.restore()}}},function(t,e){t.exports=function(t,e,i,n){var s=e.tileset,r=e.pipeline,o=r.vertexBuffer;t.setPipeline(r),r.modelIdentity(),r.modelTranslate(e.x-n.scrollX*e.scrollFactorX,e.y-n.scrollY*e.scrollFactorY,0),r.modelScale(e.scaleX,e.scaleY,1),r.viewLoad2D(n.matrix.matrix);for(var a=0;a<s.length;a++)e.upload(n,a),0<e.vertexCount[a]&&(t.currentPipeline&&0<t.currentPipeline.vertexCount&&t.flush(),r.vertexBuffer=e.vertexBuffer[a],t.setPipeline(r),t.setTexture2D(s[a].glTexture,0),t.gl.drawArrays(r.topology,0,e.vertexCount[a]));r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}},function(t,e,i){var n=i(1),s=i(1);n=i(445),s=i(444),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix);var u=t.currentContext,c=e.gidMap;u.save(),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l),l.copyToContext(u)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,h.copyToContext(u));for(var d=n.alpha*e.alpha,f=0;f<o;f++){var p=r[f],g=c[p.index];if(g){var v=g.image.getSourceImage(),y=g.getTileTextureCoordinates(p.index);if(y){var m=p.width/2,x=p.height/2;u.save(),u.translate(p.pixelX+m,p.pixelY+x),0!==p.rotation&&u.rotate(p.rotation),(p.flipX||p.flipY)&&u.scale(p.flipX?-1:1,p.flipY?-1:1),u.globalAlpha=d*p.alpha,u.drawImage(v,y.x,y.y,p.width,p.height,-m,-x,p.width,p.height),u.restore()}}}u.restore()}}},function(t,e,i){var F=i(10);t.exports=function(t,e,i,n){e.cull(n);var s=e.culledTiles,r=s.length,o=n.alpha*e.alpha;if(!(0===r||o<=0))for(var a=e.gidMap,h=e.pipeline,l=F.getTintAppendFloatAlpha,u=e.scrollFactorX,c=e.scrollFactorY,d=e.x,f=e.y,p=e.scaleX,g=e.scaleY,v=e.tileset,y=0;y<v.length;y++)for(var m=v[y],x=m.glTexture,w=0;w<r;w++){var b=s[w],T=a[b.index];if(T===m){var S=T.getTileTextureCoordinates(b.index);if(null!==S){var _=b.width,A=b.height,C=S.x,M=S.y,P=.5*b.width,E=.5*b.height,k=l(b.tint,o*b.alpha);h.batchTexture(e,x,x.width,x.height,(P+d+b.pixelX)*p,(E+f+b.pixelY)*g,b.width,b.height,p,g,b.rotation,b.flipX,b.flipY,u,c,P,E,C,M,_,A,k,k,k,k,!1,0,0,n,null,!0)}}}}},function(t,e,i){var n=i(1),s=i(1);n=i(448),s=i(447),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var o=i(99);t.exports=function(t){for(var e=[],i=[],n=0;n<t.layer.length;n++){var s=t.layer[n],r=s.tilesetName;""!==r&&-1===i.indexOf(r)&&(i.push(r),e.push(new o(r,0,s.tilesize,s.tilesize,0,0)))}return e}},function(t,e,i){var d=i(78),f=i(55);t.exports=function(t,e){for(var i=[],n=0;n<t.layer.length;n++){for(var s=t.layer[n],r=new d({name:s.name,width:s.width,height:s.height,tileWidth:s.tilesize,tileHeight:s.tilesize,visible:1===s.visible}),o=[],a=[],h=0;h<s.data.length;h++){for(var l=0;l<s.data[h].length;l++){var u,c=s.data[h][l]-1;u=-1<c?new f(r,c,l,h,s.tilesize,s.tilesize):e?null:new f(r,-1,l,h,s.tilesize,s.tilesize),o.push(u)}a.push(o),o=[]}r.data=a,i.push(r)}return i}},function(t,e,i){var l=i(20);t.exports=function(t){for(var e,i,n,s,r,o=0;o<t.layers.length;o++){e=t.layers[o],s=null;for(var a=0;a<e.data.length;a++){r=e.data[a];for(var h=0;h<r.length;h++)null===(i=r[h])||i.index<0||(n=t.tiles[i.index][2],s=t.tilesets[n],i.width=s.tileWidth,i.height=s.tileHeight,s.tileProperties&&s.tileProperties[i.index-s.firstgid]&&(i.properties=l(i.properties,s.tileProperties[i.index-s.firstgid])))}}}},function(t,e){t.exports=function(t){for(var e=[],i=0;i<t.tilesets.length;i++)for(var n=t.tilesets[i],s=n.tileMargin,r=n.tileMargin,o=0,a=0,h=0,l=n.firstgid;l<n.firstgid+n.total&&(e[l]=[s,r,i],s+=n.tileWidth+n.tileSpacing,++o!==n.total)&&(++a!==n.columns||(s=n.tileMargin,r+=n.tileHeight+n.tileSpacing,a=0,++h!==n.rows));l++);return e}},function(t,e,i){var u=i(2),c=i(212),d=i(211);t.exports=function(t){for(var e=[],i=0;i<t.layers.length;i++)if("objectgroup"===t.layers[i].type){for(var n=t.layers[i],s=u(n,"offsetx",0),r=u(n,"offsety",0),o=[],a=0;a<n.objects.length;a++){var h=c(n.objects[a],s,r);o.push(h)}var l=new d(n);l.objects=o,e.push(l)}return e}},function(t,e,i){var r=i(85);t.exports=function(t,e){for(var i={},n=0;n<e.length;n++){var s=e[n];r(t,s)&&(i[s]=t[s])}return i}},function(t,e,i){var x=i(99),w=i(213),b=i(212);t.exports=function(t){for(var e,i=[],n=[],s=null,r=0;r<t.tilesets.length;r++){var o=t.tilesets[r];if(o.source)console.warn("Phaser can't load external tilesets. Use the Embed Tileset button and then export the map again.");else if(o.image){var a=new x(o.name,o.firstgid,o.tilewidth,o.tileheight,o.margin,o.spacing);if(1<t.version){if(Array.isArray(o.tiles)){for(var h={},l={},u=0;u<o.tiles.length;u++){var c=o.tiles[u];if(c.properties){var d={};c.properties.forEach(function(t){d[t.name]=t.value}),l[c.id]=d}if(c.objectgroup&&(h[c.id]={objectgroup:c.objectgroup},c.objectgroup.objects)){var f=c.objectgroup.objects.map(function(t){return b(t)});h[c.id].objectgroup.objects=f}}a.tileData=h,a.tileProperties=l}}else if(o.tileproperties&&(a.tileProperties=o.tileproperties),o.tiles)for(e in a.tileData=o.tiles,a.tileData){var p=a.tileData[e].objectgroup;if(p&&p.objects){var g=p.objects.map(function(t){return b(t)});a.tileData[e].objectgroup.objects=g}}a.updateTileData(o.imagewidth,o.imageheight),i.push(a)}else{var v=new w(o.name,o.firstgid,o.tilewidth,o.tileheight,o.margin,o.spacing,o.properties);for(e in o.tiles){var y=o.tiles[e].image,m=o.firstgid+parseInt(e,10);v.addImage(m,y)}n.push(v)}s&&(s.lastgid=o.firstgid-1),s=o}return{tilesets:i,imageCollections:n}}},function(t,e,i){var s=i(2);t.exports=function(t){for(var e=[],i=0;i<t.layers.length;i++)if("imagelayer"===t.layers[i].type){var n=t.layers[i];e.push({name:n.name,image:n.image,x:s(n,"offsetx",0)+n.x,y:s(n,"offsety",0)+n.y,alpha:n.opacity,visible:n.visible,properties:s(n,"properties",{})})}return e}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),s=0;s<i;s+=4)n[s/4]=(e.charCodeAt(s)|e.charCodeAt(s+1)<<8|e.charCodeAt(s+2)<<16|e.charCodeAt(s+3)<<24)>>>0;return n}},function(t,e,i){var p=i(458),g=i(2),v=i(78),y=i(214),m=i(55);t.exports=function(t,e){for(var i=[],n=0;n<t.layers.length;n++)if("tilelayer"===t.layers[n].type){var s=t.layers[n];if(s.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+s.name+"'");else{s.encoding&&"base64"===s.encoding&&(s.data=p(s.data),delete s.encoding);for(var r=new v({name:s.name,x:g(s,"offsetx",0)+s.x,y:g(s,"offsety",0)+s.y,width:s.width,height:s.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:s.opacity,visible:s.visible,properties:g(s,"properties",{})}),o=0,a=[],h=[],l=0,u=s.data.length;l<u;l++){var c=y(s.data[l]);if(0<c.gid){var d=new m(r,c.gid,o,h.length,t.tilewidth,t.tileheight);d.rotation=c.rotation,d.flipX=c.flipped,a.push(d)}else{var f=e?null:new m(r,-1,o,h.length,t.tilewidth,t.tileheight);a.push(f)}++o===s.width&&(h.push(a),o=0,a=[])}r.data=h,i.push(r)}}return i}},function(t,e,i){t.exports={Parse:i(217),Parse2DArray:i(133),ParseCSV:i(216),Impact:i(210),Tiled:i(215)}},function(t,e,i){var o=i(50),a=i(49),h=i(3);t.exports=function(t,e,i,n,s,r){return void 0===n&&(n=new h(0,0)),n.x=o(t,i,s,r),n.y=a(e,i,s,r),n}},function(t,e,i){var p=i(17);t.exports=function(t,e,i,n,s,r){if(void 0!==s){var o,a=p(t,e,i,n,null,r),h=0;for(o=0;o<s.length;o++)h+=s[o].weight;if(!(h<=0))for(o=0;o<a.length;o++){for(var l=Math.random()*h,u=0,c=-1,d=0;d<s.length;d++)if(l<=(u+=s[d].weight)){var f=s[d].index;c=Array.isArray(f)?f[Math.floor(Math.random()*f.length)]:f;break}a[o].index=c}}}},function(t,e,i){var r=i(101),o=i(100),a=i(3);t.exports=function(t,e,i,n,s){return void 0===i&&(i=new a(0,0)),i.x=r(t,n,s),i.y=o(e,n,s),i}},function(t,e,i){var l=i(17);t.exports=function(t,e,i,n,s,r,o){for(var a=l(i,n,s,r,null,o),h=0;h<a.length;h++)a[h]&&(a[h].index===t?a[h].index=e:a[h].index===e&&(a[h].index=t))}},function(t,e,i){var h=i(17),l=i(122);t.exports=function(t,e,i,n,s){var r=h(t,e,i,n,null,s),o=r.map(function(t){return t.index});l(o);for(var a=0;a<r.length;a++)r[a].index=o[a]}},function(t,e,i){var l=i(17);t.exports=function(t,e,i,n,s,r,o){for(var a=l(t,e,i,n,null,o),h=0;h<a.length;h++)a[h].setCollisionCallback(s,r)}},function(t,e){t.exports=function(t,e,i,n){if("number"==typeof t)n.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,r=t.length;s<r;s++)n.callbacks[t[s]]=null!==e?{callback:e,callbackContext:i}:void 0}},function(t,e,i){var a=i(56),h=i(34);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var n=0;n<i.height;n++)for(var s=0;s<i.width;s++){var r=i.data[n][s];if(r){var o=r.getCollisionGroup();o&&o.objects&&0<o.objects.length&&a(r,t)}}e&&h(0,0,i.width,i.height,i)}},function(t,e,i){var u=i(56),c=i(34),d=i(85);t.exports=function(t,e,i,n){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var s=0;s<n.height;s++)for(var r=0;r<n.width;r++){var o=n.data[s][r];if(o)for(var a in t)if(d(o.properties,a)){var h=t[a];Array.isArray(h)||(h=[h]);for(var l=0;l<h.length;l++)o.properties[a]===h[l]&&u(o,e)}}i&&c(0,0,n.width,n.height,n)}},function(t,e,i){var a=i(56),h=i(34),l=i(134);t.exports=function(t,e,i,n){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var s=0;s<n.height;s++)for(var r=0;r<n.width;r++){var o=n.data[s][r];o&&-1===t.indexOf(o.index)&&(a(o,e),l(o.index,e,n))}i&&h(0,0,n.width,n.height,n)}},function(t,e,i){var l=i(56),u=i(34),c=i(134);t.exports=function(t,e,i,n,s){if(void 0===i&&(i=!0),void 0===n&&(n=!0),!(e<t)){for(var r=t;r<=e;r++)c(r,i,s);for(var o=0;o<s.height;o++)for(var a=0;a<s.width;a++){var h=s.data[o][a];h&&h.index>=t&&h.index<=e&&l(h,i)}n&&u(0,0,s.width,s.height,s)}}},function(t,e,i){var h=i(56),l=i(34),u=i(134);t.exports=function(t,e,i,n){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var s=0;s<t.length;s++)u(t[s],e,n);for(var r=0;r<n.height;r++)for(var o=0;o<n.width;o++){var a=n.data[r][o];a&&-1!==t.indexOf(a.index)&&h(a,e)}i&&l(0,0,n.width,n.height,n)}},function(t,e,i){var p=i(17),n=i(347),g=new n(105,210,231,150),v=new n(243,134,48,200),y=new n(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var n=void 0!==e.tileColor?e.tileColor:g,s=void 0!==e.collidingTileColor?e.collidingTileColor:v,r=void 0!==e.faceColor?e.faceColor:y,o=p(0,0,i.width,i.height,null,i);t.translate(i.tilemapLayer.x,i.tilemapLayer.y),t.scale(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var a=0;a<o.length;a++){var h=o[a],l=h.width,u=h.height,c=h.pixelX,d=h.pixelY,f=h.collides?s:n;null!==f&&(t.fillStyle(f.color,f.alpha/255),t.fillRect(c,d,l,u)),c+=1,d+=1,l-=2,u-=2,null!==r&&(t.lineStyle(1,r.color,r.alpha/255),h.faceTop&&t.lineBetween(c,d,c+l,d),h.faceRight&&t.lineBetween(c+l,d,c+l,d+u),h.faceBottom&&t.lineBetween(c,d+u,c+l,d+u),h.faceLeft&&t.lineBetween(c,d,c,d+u))}}},function(t,e,i){var h=i(218),l=i(50),u=i(49);t.exports=function(t,e,i,n,s,r){var o=l(t,!0,s,r),a=u(e,!0,s,r);return h(o,a,i,n,r)}},function(t,e,i){var h=i(17),l=i(162);t.exports=function(t,e,i,n,s,r){var o,a=h(t,e,i,n,null,r);if(void 0===s)for(s=[],o=0;o<a.length;o++)-1===s.indexOf(a[o].index)&&s.push(a[o].index);for(o=0;o<a.length;o++)a[o].index=l(s)}},function(t,e,i){var u=i(34),c=i(135);t.exports=function(t,e,i,n,s){if(!Array.isArray(t))return null;void 0===n&&(n=!0),Array.isArray(t[0])||(t=[t]);for(var r=t.length,o=t[0].length,a=0;a<r;a++)for(var h=0;h<o;h++){var l=t[a][h];c(l,e+h,i+a,!1,s)}n&&u(e-1,i-1,o+2,r+2,s)}},function(t,e,i){var h=i(135),l=i(50),u=i(49);t.exports=function(t,e,i,n,s,r){var o=l(e,!0,s,r),a=u(i,!0,s,r);return h(t,o,a,n,r)}},function(t,e,i){var o=i(219),a=i(50),h=i(49);t.exports=function(t,e,i,n){var s=a(t,!0,i,n),r=h(e,!0,i,n);return o(s,r,n)}},function(t,e,i){var c=i(17),d=i(50),f=i(49);t.exports=function(t,e,i,n,s,r,o){var a=d(t,!0,r,o),h=f(e,!0,r,o),l=Math.ceil(d(t+i,!1,r,o)),u=Math.ceil(f(e+n,!1,r,o));return c(a,h,l-a,u-h,s,o)}},function(t,e,i){var m=i(274),x=i(17),w=i(273),b=i(1),T=i(101),S=i(100),_=i(50),A=i(49),C=function(t,e){return w.RectangleToTriangle(e,t)};t.exports=function(t,e,i,n){if(void 0===t)return[];var s=b;t instanceof m.Circle?s=w.CircleToRectangle:t instanceof m.Rectangle?s=w.RectangleToRectangle:t instanceof m.Triangle?s=C:t instanceof m.Line&&(s=w.LineToRectangle);var r=_(t.left,!0,i,n),o=A(t.top,!0,i,n),a=Math.ceil(_(t.right,!1,i,n)),h=Math.ceil(A(t.bottom,!1,i,n)),l=Math.max(a-r,1),u=Math.max(h-o,1),c=x(r,o,l,u,e,n),d=n.tileWidth,f=n.tileHeight;n.tilemapLayer&&(d*=n.tilemapLayer.scaleX,f*=n.tilemapLayer.scaleY);for(var p=[],g=new m.Rectangle(0,0,d,f),v=0;v<c.length;v++){var y=c[v];g.x=T(y.x,i,n),g.y=S(y.y,i,n),s(t,g)&&p.push(y)}return p}},function(t,e,i){var a=i(102),h=i(50),l=i(49);t.exports=function(t,e,i,n,s){var r=h(t,!0,n,s),o=l(e,!0,n,s);return a(r,o,i,s)}},function(t,e,i){var h=i(17);t.exports=function(t,e,i,n,s,r,o,a){h(i,n,s,r,o,a).forEach(t,e)}},function(t,e,i){var h=i(17);t.exports=function(t,e,i,n,s,r,o,a){return h(i,n,s,r,o,a).find(t,e)||null}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=!1);var s,r,o,a=0;if(i){for(r=n.height-1;0<=r;r--)for(s=n.width-1;0<=s;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r<n.height;r++)for(s=0;s<n.width;s++)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}return null}},function(t,e,i){var h=i(17);t.exports=function(t,e,i,n,s,r,o,a){return h(i,n,s,r,o,a).filter(t,e)}},function(t,e,i){var u=i(17),c=i(34),d=i(56);t.exports=function(t,e,i,n,s,r,o){for(var a=-1!==o.collideIndexes.indexOf(t),h=u(e,i,n,s,null,o),l=0;l<h.length;l++)h[l].index=t,d(h[l],a);r&&c(e-1,i-1,n+2,s+2,o)}},function(t,e,i){var T=i(142),S=i(243);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var s,r,o,a=t.tilemapLayer.tilemap,h=t.tilemapLayer,l=t.data,u=t.width,c=t.height,d=Math.floor(a.tileWidth*h.scaleX),f=Math.floor(a.tileHeight*h.scaleY),p=0,g=u,v=0,y=c;if(!h.skipCull&&1===h.scrollFactorX&&1===h.scrollFactorY){var m=T(e.worldView.x-h.x,d,0,!0)-h.cullPaddingX,x=S(e.worldView.right-h.x,d,0,!0)+h.cullPaddingX,w=T(e.worldView.y-h.y,f,0,!0)-h.cullPaddingY,b=S(e.worldView.bottom-h.y,f,0,!0)+h.cullPaddingY;p=Math.max(0,m),g=Math.min(u,x),v=Math.max(0,w),y=Math.min(c,b)}if(0===n)for(r=v;r<y;r++)for(s=p;s<g;s++)(o=l[r][s])&&-1!==o.index&&o.visible&&0!==o.alpha&&i.push(o);else if(1===n)for(r=v;r<y;r++)for(s=g;p<=s;s--)(o=l[r][s])&&-1!==o.index&&o.visible&&0!==o.alpha&&i.push(o);else if(2===n)for(r=y;v<=r;r--)for(s=p;s<g;s++)(o=l[r][s])&&-1!==o.index&&o.visible&&0!==o.alpha&&i.push(o);else if(3===n)for(r=y;v<=r;r--)for(s=g;p<=s;s--)(o=l[r][s])&&-1!==o.index&&o.visible&&0!==o.alpha&&i.push(o);return h.tilesDrawn=i.length,h.tilesTotal=u*c,i}},function(t,e,i){var d=i(101),f=i(100),p=i(17),g=i(220);t.exports=function(t,e,i,n,s,r){void 0===i&&(i={}),Array.isArray(t)||(t=[t]);var o=r.tilemapLayer;void 0===n&&(n=o.scene),void 0===s&&(s=n.cameras.main);var a,h=p(0,0,r.width,r.height,null,r),l=[];for(a=0;a<h.length;a++){var u=h[a];if(-1!==t.indexOf(u.index)){i.x=d(u.x,s,r),i.y=f(u.y,s,r);var c=n.make.sprite(i);l.push(c)}}if("number"==typeof e)for(a=0;a<t.length;a++)g(t[a],e,0,0,r.width,r.height,r);else if(Array.isArray(e))for(a=0;a<t.length;a++)g(t[a],e[a],0,0,r.width,r.height,r);return l}},function(t,e,i){var p=i(17),g=i(34);t.exports=function(t,e,i,n,s,r,o,a){t<0&&(t=0),e<0&&(e=0),void 0===o&&(o=!0);for(var h=p(t,e,i,n,null,a),l=s-t,u=r-e,c=0;c<h.length;c++){var d=h[c].x+l,f=h[c].y+u;0<=d&&d<a.width&&0<=f&&f<a.height&&a.data[f][d]&&a.data[f][d].copy(h[c])}o&&g(s-1,r-1,i+2,n+2,a)}},function(t,e,i){t.exports={Components:i(103),Parsers:i(460),Formats:i(29),ImageCollection:i(213),ParseToTilemap:i(132),Tile:i(55),Tilemap:i(209),TilemapCreator:i(443),TilemapFactory:i(442),Tileset:i(99),LayerData:i(78),MapData:i(77),ObjectLayer:i(211),DynamicTilemapLayer:i(208),StaticTilemapLayer:i(207)}},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){var n=i(20),s=i(491),r={FilterMode:s,Frame:i(113),Parsers:i(316),Texture:i(165),TextureManager:i(318),TextureSource:i(317)};r=n(!1,r,s),t.exports=r},function(t,e,i){t.exports={List:i(112),Map:i(180),ProcessQueue:i(228),RTree:i(227),Set:i(95)}},function(t,e,i){t.exports={SoundManagerCreator:i(325),BaseSound:i(114),BaseSoundManager:i(115),WebAudioSound:i(319),WebAudioSoundManager:i(320),HTML5AudioSound:i(323),HTML5AudioSoundManager:i(324),NoAudioSound:i(321),NoAudioSoundManager:i(322)}},function(t,e,i){var n=i(23),s=i(0),a=i(2),r=i(15),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.pluginStart,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once("shutdown",this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=a(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=a(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=a(t,"sleep",!1),this._willRemove=a(t,"remove",!1);var s=a(t,"onUpdate",null);s&&(this._onUpdate=s,this._onUpdateScope=a(t,"onUpdateScope",this.scene));var r=a(t,"allowInput",!1);this.settings.transitionAllowInput=r;var o=i.sys.settings;return o.isTransition=!0,o.transitionFrom=this.scene,o.transitionDuration=n,o.transitionAllowInput=r,a(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):a(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake():this.manager.start(e,a(t,"data")),this.systems.events.emit("transitionout",i,n),this.systems.events.on("update",this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off("update",this.step,this),t.events.emit("transitioncomplete",this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i){return this.manager.add(t,e,i),this},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off("shutdown",this.shutdown,this),t.off("postupdate",this.step,this),t.off("transitionout")},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});r.register("ScenePlugin",o,"scenePlugin"),t.exports=o},function(t,e,i){var n=i(116),s=i(20),r={SceneManager:i(329),ScenePlugin:i(495),Settings:i(326),Systems:i(166)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(221),s=new(i(0))({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this)},boot:function(){}});t.exports=s},function(t,e,i){t.exports={BasePlugin:i(221),DefaultPlugins:i(167),PluginCache:i(15),PluginManager:i(331),ScenePlugin:i(497)}},function(t,e,i){var n={};t.exports=n;var s=i(137),r=(i(194),i(33));n.create=function(t){var e=s.create();return r.extend(e,{label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}},t)}},function(t,e,i){var a={};t.exports=a;var h=i(33);a._registry={},a.register=function(t){if(a.isPlugin(t)||h.warn("Plugin.register:",a.toString(t),"does not implement all required fields."),t.name in a._registry){var e=a._registry[t.name],i=a.versionParse(t.version).number,n=a.versionParse(e.version).number;n<i?(h.warn("Plugin.register:",a.toString(e),"was upgraded to",a.toString(t)),a._registry[t.name]=t):i<n?h.warn("Plugin.register:",a.toString(e),"can not be downgraded to",a.toString(t)):t!==e&&h.warn("Plugin.register:",a.toString(t),"is already registered to different plugin object")}else a._registry[t.name]=t;return t},a.resolve=function(t){return a._registry[a.dependencyParse(t).name]},a.toString=function(t){return"string"==typeof t?t:(t.name||"anonymous")+"@"+(t.version||t.range||"0.0.0")},a.isPlugin=function(t){return t&&t.name&&t.version&&t.install},a.isUsed=function(t,e){return-1<t.used.indexOf(e)},a.isFor=function(t,e){var i=t.for&&a.dependencyParse(t.for);return!t.for||e.name===i.name&&a.versionSatisfies(e.version,i.range)},a.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=a.dependencies(t),n=h.topologicalSort(i),s=[],r=0;r<n.length;r+=1)if(n[r]!==t.name){var o=a.resolve(n[r]);o?a.isUsed(t,o.name)||(a.isFor(o,t)||(h.warn("Plugin.use:",a.toString(o),"is for",o.for,"but installed on",a.toString(t)+"."),o._warned=!0),o.install?o.install(t):(h.warn("Plugin.use:",a.toString(o),"does not specify an install function."),o._warned=!0),o._warned?(s.push("🔶 "+a.toString(o)),delete o._warned):s.push("✅ "+a.toString(o)),t.used.push(o.name)):s.push("❌ "+n[r])}0<s.length&&!o.silent&&h.info(s.join("  "))}else h.warn("Plugin.use:",a.toString(t),"does not specify any dependencies to install.")},a.dependencies=function(n,t){var s=a.dependencyParse(n),e=s.name;if(!(e in(t=t||{}))){n=a.resolve(n)||n,t[e]=h.map(n.uses||[],function(t){a.isPlugin(t)&&a.register(t);var e=a.dependencyParse(t),i=a.resolve(t);return i&&!a.versionSatisfies(i.version,e.range)?(h.warn("Plugin.dependencies:",a.toString(i),"does not satisfy",a.toString(e),"used by",a.toString(s)+"."),i._warned=!0,n._warned=!0):i||(h.warn("Plugin.dependencies:",a.toString(t),"used by",a.toString(s),"could not be resolved."),n._warned=!0),e.name});for(var i=0;i<t[e].length;i+=1)a.dependencies(t[e][i],t);return t}},a.dependencyParse=function(t){return h.isString(t)?(/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?))?$/.test(t)||h.warn("Plugin.dependencyParse:",t,"is not a valid dependency string."),{name:t.split("@")[0],range:t.split("@")[1]||"*"}):{name:t.name,range:t.range||t.version}},a.versionParse=function(t){/^\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?$/.test(t)||h.warn("Plugin.versionParse:",t,"is not a valid version or range.");var e=t.split("-");t=e[0];var i=isNaN(Number(t[0])),n=i?t.substr(1):t,s=h.map(n.split("."),function(t){return Number(t)});return{isRange:i,version:n,range:t,operator:i?t[0]:"",parts:s,prerelease:e[1],number:1e8*s[0]+1e4*s[1]+s[2]}},a.versionSatisfies=function(t,e){e=e||"*";var i=a.versionParse(e),n=i.parts,s=a.versionParse(t),r=s.parts;if(i.isRange){if("*"===i.operator||"*"===t)return!0;if("~"===i.operator)return r[0]===n[0]&&r[1]===n[1]&&r[2]>=n[2];if("^"===i.operator)return 0<n[0]?r[0]===n[0]&&s.number>=i.number:0<n[1]?r[1]===n[1]&&r[2]>=n[2]:r[2]===n[2]}return t===e||"*"===t}},function(t,e,i){var n=i(1065);n.Body=i(67),n.Composite=i(137),n.World=i(499),n.Detector=i(503),n.Grid=i(1064),n.Pairs=i(1063),n.Pair=i(418),n.Query=i(1089),n.Resolver=i(1062),n.SAT=i(502),n.Constraint=i(194),n.Common=i(33),n.Engine=i(1061),n.Events=i(195),n.Sleeping=i(222),n.Plugin=i(500),n.Bodies=i(126),n.Composites=i(1068),n.Axes=i(505),n.Bounds=i(80),n.Svg=i(1087),n.Vector=i(81),n.Vertices=i(76),n.World.add=n.Composite.add,n.World.remove=n.Composite.remove,n.World.addComposite=n.Composite.addComposite,n.World.addBody=n.Composite.addBody,n.World.addConstraint=n.Composite.addConstraint,n.World.clear=n.Composite.clear,t.exports=n},function(t,e,i){var y={};t.exports=y;var m=i(76),x=i(81);y.collides=function(t,e,i){var n,s,r,o,a=!1;if(i){var h=t.parent,l=e.parent,u=h.speed*h.speed+h.angularSpeed*h.angularSpeed+l.speed*l.speed+l.angularSpeed*l.angularSpeed;a=i&&i.collided&&u<.2,o=i}else o={collided:!1,bodyA:t,bodyB:e};if(i&&a){var c=o.axisBody,d=c===t?e:t,f=[c.axes[i.axisNumber]];if(r=y._overlapAxes(c.vertices,d.vertices,f),o.reused=!0,r.overlap<=0)return o.collided=!1,o}else{if((n=y._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return o.collided=!1,o;if((s=y._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return o.collided=!1,o;n.overlap<s.overlap?(r=n,o.axisBody=t):(r=s,o.axisBody=e),o.axisNumber=r.axisNumber}o.bodyA=t.id<e.id?t:e,o.bodyB=t.id<e.id?e:t,o.collided=!0,o.depth=r.overlap,o.parentA=o.bodyA.parent,o.parentB=o.bodyB.parent,t=o.bodyA,e=o.bodyB,x.dot(r.axis,x.sub(e.position,t.position))<0?o.normal={x:r.axis.x,y:r.axis.y}:o.normal={x:-r.axis.x,y:-r.axis.y},o.tangent=x.perp(o.normal),o.penetration=o.penetration||{},o.penetration.x=o.normal.x*o.depth,o.penetration.y=o.normal.y*o.depth;var p=y._findSupports(t,e,o.normal),g=[];if(m.contains(t.vertices,p[0])&&g.push(p[0]),m.contains(t.vertices,p[1])&&g.push(p[1]),g.length<2){var v=y._findSupports(e,t,x.neg(o.normal));m.contains(e.vertices,v[0])&&g.push(v[0]),g.length<2&&m.contains(e.vertices,v[1])&&g.push(v[1])}return g.length<1&&(g=[p[0]]),o.supports=g,o},y._overlapAxes=function(t,e,i){for(var n,s,r=x._temp[0],o=x._temp[1],a={overlap:Number.MAX_VALUE},h=0;h<i.length;h++){if(s=i[h],y._projectToAxis(r,t,s),y._projectToAxis(o,e,s),(n=Math.min(r.max-o.min,o.max-r.min))<=0)return a.overlap=n,a;n<a.overlap&&(a.overlap=n,a.axis=s,a.axisNumber=h)}return a},y._projectToAxis=function(t,e,i){for(var n=x.dot(e[0],i),s=n,r=1;r<e.length;r+=1){var o=x.dot(e[r],i);s<o?s=o:o<n&&(n=o)}t.min=n,t.max=s},y._findSupports=function(t,e,i){for(var n,s,r,o,a=Number.MAX_VALUE,h=x._temp[0],l=e.vertices,u=t.position,c=0;c<l.length;c++)s=l[c],h.x=s.x-u.x,h.y=s.y-u.y,(n=-x.dot(i,h))<a&&(a=n,r=s);return s=l[0<=r.index-1?r.index-1:l.length-1],h.x=s.x-u.x,h.y=s.y-u.y,a=-x.dot(i,h),o=s,s=l[(r.index+1)%l.length],h.x=s.x-u.x,h.y=s.y-u.y,(n=-x.dot(i,h))<a&&(o=s),[r,o]}},function(t,e,i){var g={};t.exports=g;var v=i(502),y=i(418),m=i(80);g.collisions=function(t,e){for(var i=[],n=e.pairs.table,s=e.metrics,r=0;r<t.length;r++){var o=t[r][0],a=t[r][1];if((!o.isStatic&&!o.isSleeping||!a.isStatic&&!a.isSleeping)&&g.canCollide(o.collisionFilter,a.collisionFilter)&&(s.midphaseTests+=1,m.overlaps(o.bounds,a.bounds)))for(var h=1<o.parts.length?1:0;h<o.parts.length;h++)for(var l=o.parts[h],u=1<a.parts.length?1:0;u<a.parts.length;u++){var c=a.parts[u];if(l===o&&c===a||m.overlaps(l.bounds,c.bounds)){var d,f=n[y.id(l,c)];d=f&&f.isActive?f.collision:null;var p=v.collides(l,c,d);s.narrowphaseTests+=1,p.reused&&(s.narrowReuseCount+=1),p.collided&&(i.push(p),s.narrowDetections+=1)}}}return i},g.canCollide=function(t,e){return t.group===e.group&&0!==t.group?0<t.group:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var m=i(126),x=i(67),n=i(0),s=i(419),w=i(2),b=i(85),T=i(76),r=new n({Mixins:[s.Bounce,s.Collision,s.Friction,s.Gravity,s.Mass,s.Sensor,s.Sleep,s.Static],initialize:function(t,e,i){this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var n=w(i,"body",null),s=w(i,"addToWorld",!0);if(n)this.setBody(n,s);else{var r=e.getCollisionGroup();0<w(r,"objects",[]).length?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),b(t,"isStatic")||(t.isStatic=!0),b(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,n=e.y+e.height/2,s=m.rectangle(i,n,e.width,e.height,t);return this.setBody(s,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),b(t,"isStatic")||(t.isStatic=!0),b(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,n=this.tile.getLeft(),s=this.tile.getTop(),r=this.tile.getCollisionGroup(),o=w(r,"objects",[]),a=[],h=0;h<o.length;h++){var l=o[h],u=n+l.x*e,c=s+l.y*i,d=l.width*e,f=l.height*i,p=null;if(l.rectangle)p=m.rectangle(u+d/2,c+f/2,d,f,t);else if(l.ellipse)p=m.circle(u+d/2,c+f/2,d/2,t);else if(l.polygon||l.polyline){var g=(l.polygon?l.polygon:l.polyline).map(function(t){return{x:t.x*e,y:t.y*i}}),v=T.create(g);if(T.isConvex(g)){var y=T.centre(v);u+=y.x,c+=y.y}p=m.fromVertices(u,c,v,t)}p&&a.push(p)}return 1===a.length?this.setBody(a[0],t.addToWorld):1<a.length&&(t.parts=a,this.setBody(x.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0}});t.exports=r},function(t,e,i){var n={};t.exports=n;var o=i(81),a=i(33);n.fromVertices=function(t){for(var e={},i=0;i<t.length;i++){var n=(i+1)%t.length,s=o.normalise({x:t[n].y-t[i].y,y:t[i].x-t[n].x}),r=0===s.y?1/0:s.x/s.y;e[r=r.toFixed(3).toString()]=s}return a.values(e)},n.rotate=function(t,e){if(0!==e)for(var i=Math.cos(e),n=Math.sin(e),s=0;s<t.length;s++){var r,o=t[s];r=o.x*i-o.y*n,o.y=o.x*n+o.y*i,o.x=r}}},function(t,e,i){t.exports={Acceleration:i(1121),BodyScale:i(1120),BodyType:i(1119),Bounce:i(1118),CheckAgainst:i(1117),Collides:i(1116),Debug:i(1115),Friction:i(1114),Gravity:i(1113),Offset:i(1112),SetGameObject:i(1111),Velocity:i(1110)}},function(t,e,i){var u=i(229);t.exports=function(t,e,i,n){var s=u(t,e,i,n);if(i||0===s||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==s||t.embedded&&e.embedded;var r=t.velocity.y,o=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=s,e.velocity.y=r-o*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=s,t.velocity.y=o-r*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{s*=.5,t.y-=s,e.y+=s;var a=Math.sqrt(o*o*e.mass/t.mass)*(0<o?1:-1),h=Math.sqrt(r*r*t.mass/e.mass)*(0<r?1:-1),l=.5*(a+h);a-=l,h-=l,t.velocity.y=l+a*t.bounce.y,e.velocity.y=l+h*e.bounce.y}return!0}},function(t,e,i){var u=i(230);t.exports=function(t,e,i,n){var s=u(t,e,i,n);if(i||0===s||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==s||t.embedded&&e.embedded;var r=t.velocity.x,o=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=s,e.velocity.x=r-o*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=s,t.velocity.x=o-r*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{s*=.5,t.x-=s,e.x+=s;var a=Math.sqrt(o*o*e.mass/t.mass)*(0<o?1:-1),h=Math.sqrt(r*r*t.mass/e.mass)*(0<r?1:-1),l=.5*(a+h);a-=l,h-=l,t.velocity.x=l+a*t.bounce.x,e.velocity.x=l+h*e.bounce.x}return!0}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):0<e&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var o=i(509);t.exports=function(t,e,i,n,s){var r=0;return t.deltaY()<0&&!t.blocked.up&&e.collideDown&&t.checkCollision.up?e.faceBottom&&t.y<n&&(r=t.y-n)<-s&&(r=0):0<t.deltaY()&&!t.blocked.down&&e.collideUp&&t.checkCollision.down&&e.faceTop&&t.bottom>i&&(r=t.bottom-i)>s&&(r=0),0!==r&&(t.customSeparateY?t.overlapY=r:o(t,r)),r}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):0<e&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var o=i(511);t.exports=function(t,e,i,n,s){var r=0;return t.deltaX()<0&&!t.blocked.left&&e.collideRight&&t.checkCollision.left?e.faceRight&&t.x<n&&(r=t.x-n)<-s&&(r=0):0<t.deltaX()&&!t.blocked.right&&e.collideLeft&&t.checkCollision.right&&e.faceLeft&&t.right>i&&(r=t.right-i)>s&&(r=0),0!==r&&(t.customSeparateX?t.overlapX=r:o(t,r)),r}},function(t,e,i){var v=i(512),y=i(510),m=i(226);t.exports=function(t,e,i,n,s,r){var o=n.left,a=n.top,h=n.right,l=n.bottom,u=i.faceLeft||i.faceRight,c=i.faceTop||i.faceBottom;if(!u&&!c)return!1;var d=0,f=0,p=0,g=1;if(e.deltaAbsX()>e.deltaAbsY()?p=-1:e.deltaAbsX()<e.deltaAbsY()&&(g=-1),0!==e.deltaX()&&0!==e.deltaY()&&u&&c&&(p=Math.min(Math.abs(e.position.x-h),Math.abs(e.right-o)),g=Math.min(Math.abs(e.position.y-l),Math.abs(e.bottom-a))),p<g){if(u&&0!==(d=v(e,i,o,h,r))&&!m(n,e))return!0;c&&(f=y(e,i,a,l,r))}else{if(c&&0!==(f=y(e,i,a,l,r))&&!m(n,e))return!0;u&&(d=v(e,i,o,h,r))}return 0!==d||0!==f}},function(t,e){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},function(t,e){t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},function(t,e){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},function(t,e){t.exports={setMass:function(t){return this.body.mass=t,this}}},function(t,e){t.exports={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}}},function(t,e){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},function(t,e){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},function(t,e){t.exports={enableBody:function(t,e,i,n,s){return t&&this.body.reset(e,i),n&&(this.body.gameObject.active=!0),s&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}}},function(t,e){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t){return this.body.collideWorldBounds=t,this}}},function(t,e){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},function(t,e){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},function(t,e,i){var n=i(0),s=i(31),o=i(52),l=i(249),r=i(238),a=i(2),h=i(96),u=i(15),c=i(3),d=i(233),f=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.world=new d(this.scene,this.config),this.add=new r(this.world),this.systems.events.once("destroy",this.destroy,this)},start:function(){this.world||(this.world=new d(this.scene,this.config),this.add=new r(this.world));var t=this.systems.events;t.on("update",this.world.update,this.world),t.on("postupdate",this.world.postUpdate,this.world),t.once("shutdown",this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return h(a(e,"arcade",{}),a(t,"arcade",{}))},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.world.collideObjects(t,e,i,n,s,!1)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,n,s,r){void 0===n&&(n=60);var o=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(o,n),void 0!==s&&void 0!==r&&t.body.maxVelocity.set(s,r),o},accelerateToObject:function(t,e,i,n,s){return this.accelerateTo(t,e.x,e.y,i,n,s)},closest:function(t){for(var e=this.world.tree.all(),i=Number.MAX_VALUE,n=null,s=t.x,r=t.y,o=e.length-1;0<=o;o--){var a=e[o],h=l(s,r,a.x,a.y);h<i&&(n=a,i=h)}return n},furthest:function(t){for(var e=this.world.tree.all(),i=-1,n=null,s=t.x,r=t.y,o=e.length-1;0<=o;o--){var a=e[o],h=l(s,r,a.x,a.y);i<h&&(n=a,i=h)}return n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var r=Math.atan2(i-t.y,e-t.x);return 0<s&&(n=o(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(r,n),r},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new c),i.setToPolar(t,e)},shutdown:function(){if(this.world){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("postupdate",this.world.postUpdate,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});u.register("ArcadePhysics",f,"arcadePhysics"),t.exports=f},function(t,e,i){var n=i(35),s=i(20),r={ArcadePhysics:i(527),Body:i(232),Collider:i(231),Factory:i(238),Group:i(235),Image:i(237),Sprite:i(104),StaticBody:i(225),StaticGroup:i(234),World:i(233)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(138),s=i(240),r=i(239),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,this.w="object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return this.w="object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return 0<s&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+n*n+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12]*s,this.y=r[1]*e+r[5]*i+r[9]*n+r[13]*s,this.z=r[2]*e+r[6]*i+r[10]*n+r[14]*s,this.w=r[3]*e+r[7]*i+r[11]*n+r[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var s=[],r=[],o=0;o<t;o++)e+=(i-=e*n)*n,s[o]=i,r[o]=e;return{sin:r,cos:s,length:t}}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,s=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*s,t.y=Math.sin(i)*s,t.z=n*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var s=(t-e)/(i-e);return 1<s?void 0!==n?(s=(n-t)/(n-i))<0&&(s=0):s=1:s<0&&(s=0),s}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},function(t,e){t.exports=function(t){for(var e=0,i=0;i<t.length;i++)e+=+t[i];return e/t.length}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},function(t,e,i){t.exports={Ceil:i(243),Floor:i(142),To:i(547)}},function(t,e){t.exports=function(t){return 0<t&&0==(t&t-1)}},function(t,e,i){t.exports={GetNext:i(294),IsSize:i(117),IsValue:i(549)}},function(t,e,i){var n=i(182);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){var r=i(119);t.exports=function(t,e){var i=t.length-1,n=i*e,s=Math.floor(n);return e<0?r(t[0],t[1],n):1<e?r(t[i],t[i-1],i-n):r(t[s],t[i<s+1?i:s+1],n-s)}},function(t,e,i){var r=i(171);t.exports=function(t,e){var i=t.length-1,n=i*e,s=Math.floor(n);return t[0]===t[i]?(e<0&&(s=Math.floor(n=i*(1+e))),r(n-s,t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i])):e<0?t[0]-(r(-n,t[0],t[0],t[1],t[1])-t[0]):1<e?t[i]-(r(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):r(n-s,t[s?s-1:0],t[s],t[i<s+1?i:s+1],t[i<s+2?i:s+2])}},function(t,e,i){var r=i(245);t.exports=function(t,e){for(var i=0,n=t.length-1,s=0;s<=n;s++)i+=Math.pow(1-e,n-s)*Math.pow(e,s)*t[s]*r(n,s);return i}},function(t,e,i){t.exports={Bezier:i(554),CatmullRom:i(553),CubicBezier:i(354),Linear:i(552),QuadraticBezier:i(350),SmoothStep:i(334),SmootherStep:i(551)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},function(t,e,i){t.exports={Ceil:i(557),Equal:i(248),Floor:i(556),GreaterThan:i(247),LessThan:i(246)}},function(t,e,i){t.exports={Back:i(369),Bounce:i(368),Circular:i(367),Cubic:i(366),Elastic:i(365),Expo:i(364),Linear:i(363),Quadratic:i(362),Quartic:i(361),Quintic:i(360),Sine:i(359),Stepped:i(358)}},function(t,e){t.exports=function(t,e,i,n,s){return void 0===s&&(s=2),Math.sqrt(Math.pow(i-t,s)+Math.pow(n-e,s))}},function(t,e,i){t.exports={Between:i(52),Power:i(560),Squared:i(249)}},function(t,e){t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},function(t,e,i){var n=i(16);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e<t?e+=n.PI2:e-=n.PI2),t<e?t+=i:e<t&&(t-=i))),t}},function(t,e,i){var n=i(250);t.exports=function(t){return n(t+Math.PI)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},function(t,e,i){t.exports={Between:i(568),BetweenY:i(567),BetweenPoints:i(566),BetweenPointsY:i(565),Reverse:i(564),RotateTo:i(563),ShortestBetween:i(562),Normalize:i(250),Wrap:i(199),WrapDegrees:i(198)}},function(t,e,i){var n=i(16),s=i(20),r={Angle:i(569),Distance:i(561),Easing:i(559),Fuzzy:i(558),Interpolation:i(555),Pow2:i(550),Snap:i(548),RandomDataGenerator:i(404),Average:i(546),Bernstein:i(245),Between:i(170),CatmullRom:i(171),CeilTo:i(545),Clamp:i(23),DegToRad:i(31),Difference:i(544),Factorial:i(244),FloatBetween:i(299),FloorTo:i(543),FromPercent:i(93),GetSpeed:i(542),IsEven:i(541),IsEvenStrict:i(540),Linear:i(119),MaxAdd:i(539),MinSub:i(538),Percent:i(537),RadToDeg:i(172),RandomXY:i(536),RandomXYZ:i(535),RandomXYZW:i(534),Rotate:i(242),RotateAround:i(396),RotateAroundDistance:i(183),RoundAwayFromZero:i(314),RoundTo:i(533),SinCosTableGenerator:i(532),SmootherStep:i(182),SmoothStep:i(181),TransformXY:i(332),Within:i(531),Wrap:i(53),Vector2:i(3),Vector3:i(138),Vector4:i(530),Matrix3:i(241),Matrix4:i(240),Quaternion:i(239),RotateVec3:i(529)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(0),s=i(18),r=i(95),o=i(11),a=i(7),v=i(2),h=i(15),l=i(105),u=new n({Extends:o,initialize:function(t){o.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,a.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(v(i,"baseURL",e.loaderBaseURL)),this.setPath(v(i,"path",e.loaderPath)),this.setPrefix(v(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=v(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=l(v(i,"responseType",e.loaderResponseType),v(i,"async",e.loaderAsync),v(i,"user",e.loaderUser),v(i,"password",e.loaderPassword),v(i,"timeout",e.loaderTimeout)),this.crossOrigin=v(i,"crossOrigin",e.loaderCrossOrigin),this.totalToLoad=0,this.progress=0,this.list=new r,this.inflight=new r,this.queue=new r,this._deleteQueue=new r,this.totalFailed=0,this.totalComplete=0,this.state=s.LOADER_IDLE,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.pluginStart,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},pluginStart:function(){this.systems.events.once("shutdown",this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];this.keyExists(i)||(this.list.set(i),this.emit("addfile",i.key,i.type,this,i),this.isLoading()&&(this.totalToLoad++,this.updateProgress()))}},keyExists:function(e){var i=e.hasCacheConflict();return i||this.list.iterate(function(t){if(t.type===e.type&&t.key===e.key)return!(i=!0)}),!i&&this.isLoading()&&(this.inflight.iterate(function(t){if(t.type===e.type&&t.key===e.key)return!(i=!0)}),this.queue.iterate(function(t){if(t.type===e.type&&t.key===e.key)return!(i=!0)})),i},addPack:function(t,e){e&&t.hasOwnProperty(e)&&(t={packKey:t[e]});var i=0,n=this.baseURL,s=this.path,r=this.prefix;for(var o in t){var a=t[o],h=v(a,"baseURL",n),l=v(a,"path",s),u=v(a,"prefix",r),c=v(a,"files",null),d=v(a,"defaultType","void");if(Array.isArray(c)){this.setBaseURL(h),this.setPath(l),this.setPrefix(u);for(var f=0;f<c.length;f++){var p=c[f],g=p.hasOwnProperty("type")?p.type:d;this[g]&&(this[g](p),i++)}}}return this.setBaseURL(n),this.setPath(s),this.setPrefix(r),0<i},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit("start",this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on("update",this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit("progress",this.progress)},update:function(){this.state===s.LOADER_LOADING&&0<this.list.size&&this.inflight.size<this.maxParallelDownloads&&this.checkLoadQueue()},checkLoadQueue:function(){this.list.each(function(t){if((t.state===s.FILE_POPULATED||t.state===s.FILE_PENDING&&this.inflight.size<this.maxParallelDownloads)&&(this.inflight.set(t),this.list.delete(t),t.crossOrigin||(t.crossOrigin=this.crossOrigin),t.load()),this.inflight.size===this.maxParallelDownloads)return!1},this)},nextFile:function(t,e){this.inflight&&(this.inflight.delete(t),this.updateProgress(),e?(this.totalComplete++,this.queue.set(t),this.emit("load",t),t.onProcess()):(this.totalFailed++,this._deleteQueue.set(t),this.emit("loaderror",t),this.fileProcessComplete(t)))},fileProcessComplete:function(t){this.scene&&this.systems&&this.systems.game&&!this.systems.game.pendingDestroy&&(t.state===s.FILE_ERRORED?t.multiFile&&t.multiFile.onFileFailed(t):t.state===s.FILE_COMPLETE&&(t.multiFile?t.multiFile.isReadyToProcess()&&t.multiFile.addToCache():t.addToCache()),this.queue.delete(t),0===this.list.size&&0===this.inflight.size&&0===this.queue.size&&this.loadComplete())},loadComplete:function(){this.emit("loadcomplete",this),this.list.clear(),this.inflight.clear(),this.queue.clear(),this.progress=1,this.state=s.LOADER_COMPLETE,this.systems.events.off("update",this.update,this),this._deleteQueue.iterateLocal("destroy"),this._deleteQueue.clear(),this.emit("complete",this,this.totalComplete,this.totalFailed)},flagForRemoval:function(t){this._deleteQueue.set(t)},saveJSON:function(t,e){return this.save(JSON.stringify(t),e)},save:function(t,e,i){void 0===e&&(e="file.json"),void 0===i&&(i="application/json");var n=new Blob([t],{type:i}),s=URL.createObjectURL(n),r=document.createElement("a");return r.download=e,r.textContent="Download "+e,r.href=s,r.click(),this},reset:function(){this.list.clear(),this.inflight.clear(),this.queue.clear();var t=this.systems.game.config,e=this.systems.settings.loader;this.setBaseURL(v(e,"baseURL",t.loaderBaseURL)),this.setPath(v(e,"path",t.loaderPath)),this.setPrefix(v(e,"prefix",t.loaderPrefix)),this.state=s.LOADER_IDLE},shutdown:function(){this.reset(),this.state=s.LOADER_SHUTDOWN,this.systems.events.off("update",this.update,this),this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.state=s.LOADER_DESTROYED,this.systems.events.off("update",this.update,this),this.systems.events.off("start",this.pluginStart,this),this.list=null,this.inflight=null,this.queue=null,this.scene=null,this.systems=null,this.textureManager=null,this.cacheManager=null}});h.register("Loader",u,"load"),t.exports=u},function(t,e,i){var n=i(0),s=i(7),l=i(2),u=i(58),c=i(8),d=i(57),f=i(251),a=new n({Extends:d,initialize:function(t,e,i,n,s,r){var o,a;if(c(e)){var h=e;o=new u(t,{key:e,url:l(h,"textureURL"),extension:l(h,"textureExtension","png"),normalMap:l(h,"normalMap"),xhrSettings:l(h,"textureXhrSettings")}),a=new f(t,{key:e,url:l(h,"atlasURL"),extension:l(h,"atlasExtension","txt"),xhrSettings:l(h,"atlasXhrSettings")})}else o=new u(t,e,i,s),a=new f(t,e,n,r);o.linkFile?d.call(this,t,"unityatlas",e,[o,a,o.linkFile]):d.call(this,t,"unityatlas",e,[o,a])},addToCache:function(){if(0===this.failed&&!this.complete){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});s.register("unityAtlas",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new a(this,t[o]),this.addFile(r.files);else r=new a(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(7),r=i(51),o=i(29),a=new n({Extends:r,initialize:function(t,e,i,n){r.call(this,t,e,i,n),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.TILED_JSON,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});s.register("tilemapTiledJSON",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new a(this,t[n]));else this.addFile(new a(this,t,e,i));return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(7),r=i(51),o=i(29),a=new n({Extends:r,initialize:function(t,e,i,n){r.call(this,t,e,i,n),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.WELTMEISTER,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});s.register("tilemapImpact",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new a(this,t[n]));else this.addFile(new a(this,t,e,i));return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(18),a=i(21),r=i(7),h=i(2),l=i(8),u=i(29),o=new n({Extends:a,initialize:function(t,e,i,n){var s="csv";if(l(e)){var r=e;e=h(r,"key"),i=h(r,"url"),n=h(r,"xhrSettings"),s=h(r,"extension",s)}var o={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};a.call(this,t,o),this.tilemapFormat=u.CSV},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});r.register("tilemapCSV",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},function(t,e,i){var n=i(0),f=i(18),p=i(21),s=i(7),h=i(2),l=i(8),r=new n({Extends:p,initialize:function(t,e,i,n,s){var r="svg";if(l(e)){var o=e;e=h(o,"key"),i=h(o,"url"),n=h(o,"svgConfig",{}),s=h(o,"xhrSettings"),r=h(o,"extension",r)}var a={type:"svg",cache:t.textureManager,extension:r,responseType:"text",key:e,url:i,xhrSettings:s,config:{width:h(n,"width"),height:h(n,"height"),scale:h(n,"scale")}};p.call(this,t,a)},onProcess:function(){this.state=f.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,n=this.config.height,s=this.config.scale;t:if(i&&n||s){var r=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],o=r.hasAttribute("viewBox"),a=parseFloat(r.getAttribute("width")),h=parseFloat(r.getAttribute("height"));if(!o&&a&&h)r.setAttribute("viewBox","0  0 "+a+" "+h);else if(o&&!a&&!h){var l=r.getAttribute("viewBox").split(/\s+|,/);a=l[2],h=l[3]}if(s){if(!a||!h)break t;i=a*s,n=h*s}r.setAttribute("width",i.toString()+"px"),r.setAttribute("height",n.toString()+"px"),e=[(new XMLSerializer).serializeToString(r)]}try{var u=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var c=this,d=!1;this.data.onload=function(){d||p.revokeObjectURL(c.data),c.onProcessComplete()},this.data.onerror=function(){d?c.onProcessError():(d=!0,p.revokeObjectURL(c.data),c.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},p.createObjectURL(this.data,u,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});s.register("svg",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new r(this,t[s]));else this.addFile(new r(this,t,e,i,n));return this}),t.exports=r},function(t,e,i){var n=i(0),s=i(7),r=i(58),o=new n({Extends:r,initialize:function(t,e,i,n,s){r.call(this,t,e,i,s,n),this.type="spritesheet"},addToCache:function(){var t=this.cache.addSpriteSheet(this.key,this.data,this.config);this.pendingDestroy(t)}});s.register("spritesheet",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,i,n));return this}),t.exports=o},function(t,e,i){var n=i(0),s=i(18),a=i(21),r=i(7),h=i(2),l=i(8),o=new n({Extends:a,initialize:function(t,e,i,n){var s="js";if(l(e)){var r=e;e=h(r,"key"),i=h(r,"url"),n=h(r,"xhrSettings"),s=h(r,"extension",s)}var o={type:"script",cache:!1,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};a.call(this,t,o)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});r.register("script",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},function(t,e,i){var n=i(0),l=i(18),u=i(21),s=i(7),c=i(2),d=i(8),o=new n({Extends:u,initialize:function(t,e,i,n,s,r){var o="js";if(d(e)){var a=e;e=c(a,"key"),i=c(a,"url"),r=c(a,"xhrSettings"),o=c(a,"extension",o),n=c(a,"systemKey"),s=c(a,"sceneKey")}var h={type:"scenePlugin",cache:!1,extension:o,responseType:"text",key:e,url:i,xhrSettings:r,config:{systemKey:n,sceneKey:s}};u.call(this,t,h),"function"==typeof i&&(this.data=i,this.state=l.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,n=c(e,"systemKey",i),s=c(e,"sceneKey",i);this.state===l.FILE_POPULATED?t.installScenePlugin(n,this.data,s,this.loader.scene):(this.state=l.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(n,window[this.key],s,this.loader.scene)),this.onProcessComplete()}});s.register("scenePlugin",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new o(this,t[r]));else this.addFile(new o(this,t,e,i,n,s));return this}),t.exports=o},function(t,e,i){var n=i(0),l=i(18),u=i(21),s=i(7),c=i(2),d=i(8),o=new n({Extends:u,initialize:function(t,e,i,n,s,r){var o="js";if(d(e)){var a=e;e=c(a,"key"),i=c(a,"url"),r=c(a,"xhrSettings"),o=c(a,"extension",o),n=c(a,"start"),s=c(a,"mapping")}var h={type:"plugin",cache:!1,extension:o,responseType:"text",key:e,url:i,xhrSettings:r,config:{start:n,mapping:s}};u.call(this,t,h),"function"==typeof i&&(this.data=i,this.state=l.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=c(e,"start",!1),n=c(e,"mapping",null);this.state===l.FILE_POPULATED?t.install(this.key,this.data,i,n):(this.state=l.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.install(this.key,window[this.key],i,n)),this.onProcessComplete()}});s.register("plugin",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new o(this,t[r]));else this.addFile(new o(this,t,e,i,n,s));return this}),t.exports=o},function(t,e,i){var n=i(0),s=i(18),r=i(7),o=i(51),a=new n({Extends:o,initialize:function(t,e,i,n,s){o.call(this,t,e,i,n,s),this.type="packfile"},onProcess:function(){this.state!==s.FILE_POPULATED&&(this.state=s.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.loader.addPack(this.data,this.config),this.onProcessComplete()}});r.register("pack",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new a(this,t[s]));else this.addFile(new a(this,t,e,n,i));return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(7),v=i(2),y=i(58),l=i(8),u=i(51),c=i(57),a=new n({Extends:c,initialize:function(t,e,i,n,s,r,o){if(l(e)){var a=e;e=v(a,"key"),i=v(a,"url"),r=v(a,"xhrSettings"),n=v(a,"path"),s=v(a,"baseURL"),o=v(a,"textureXhrSettings")}var h=new u(t,e,i,r);c.call(this,t,"multiatlas",e,[h]),this.config.path=n,this.config.baseURL=s,this.config.textureXhrSettings=o},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,n=this.loader,s=n.baseURL,r=n.path,o=n.prefix,a=v(i,"baseURL",s),h=v(i,"path",r),l=v(i,"prefix",o),u=v(i,"textureXhrSettings");n.setBaseURL(a),n.setPath(h),n.setPrefix(l);for(var c=0;c<e.length;c++){var d=e[c].image,f="_MA_"+d,p=new y(n,f,d,u);if(this.addToMultiFile(p),n.addFile(p),e[c].normalMap){var g=new y(n,f,e[c].normalMap,u);g.type="normalMap",p.setLink(g),this.addToMultiFile(g),n.addFile(g)}}n.setBaseURL(s),n.setPath(r),n.setPrefix(o)}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0];t.addToCache();for(var e=[],i=[],n=[],s=1;s<this.files.length;s++){var r=this.files[s];if("normalMap"!==r.type)for(var o=r.key.substr(4),a=r.data,h=0;h<t.data.textures.length;h++){var l=t.data.textures[h];if(l.image===o){i.push(a),e.push(l),r.linkFile&&n.push(r.linkFile.data);break}}}for(0===n.length&&(n=void 0),this.loader.textureManager.addAtlasJSONArray(this.key,i,e,n),this.complete=!0,s=0;s<this.files.length;s++)this.files[s].pendingDestroy()}}});s.register("multiatlas",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new a(this,t[o]),this.addFile(r.files);else r=new a(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=a},function(t,e,i){var n=i(0),o=i(18),l=i(21),s=i(7),u=i(2),c=i(8),a=new n({Extends:l,initialize:function(t,e,i,n,s,r){void 0===n&&(n=512),void 0===s&&(s=512);var o="html";if(c(e)){var a=e;e=u(a,"key"),i=u(a,"url"),r=u(a,"xhrSettings"),o=u(a,"extension",o),n=u(a,"width",n),s=u(a,"height",s)}var h={type:"html",cache:t.textureManager,extension:o,responseType:"text",key:e,url:i,xhrSettings:r,config:{width:n,height:s}};l.call(this,t,h)},onProcess:function(){this.state=o.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push('<svg width="'+t+'px" height="'+e+'px" viewBox="0 0 '+t+" "+e+'" xmlns="http://www.w3.org/2000/svg">'),i.push('<foreignObject width="100%" height="100%">'),i.push('<body xmlns="http://www.w3.org/1999/xhtml">'),i.push(this.xhrLoader.responseText),i.push("</body>"),i.push("</foreignObject>"),i.push("</svg>");var n=[i.join("\n")],s=this;try{var r=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return s.state=o.FILE_ERRORED,void s.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){l.revokeObjectURL(s.data),s.onProcessComplete()},this.data.onerror=function(){l.revokeObjectURL(s.data),s.onProcessError()},l.createObjectURL(this.data,r,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});s.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new a(this,t[r]));else this.addFile(new a(this,t,e,i,n,s));return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(18),a=i(21),r=i(7),h=i(2),l=i(8),o=new n({Extends:a,initialize:function(t,e,i,n){var s="html";if(l(e)){var r=e;e=h(r,"key"),i=h(r,"url"),n=h(r,"xhrSettings"),s=h(r,"extension",s)}var o={type:"text",cache:t.cacheManager.html,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};a.call(this,t,o)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});r.register("html",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},function(t,e,i){var n=i(0),s=i(18),a=i(21),r=i(7),h=i(2),l=i(8),o=new n({Extends:a,initialize:function(t,e,i,n){var s="glsl";if(l(e)){var r=e;e=h(r,"key"),i=h(r,"url"),n=h(r,"xhrSettings"),s=h(r,"extension",s)}var o={type:"glsl",cache:t.cacheManager.shader,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};a.call(this,t,o)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});r.register("glsl",function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new o(this,t[n]));else this.addFile(new o(this,t,e,i));return this}),t.exports=o},function(t,e,i){var n=i(0),s=i(7),l=i(2),u=i(58),c=i(8),d=i(57),r=i(310),f=i(139),a=new n({Extends:d,initialize:function(t,e,i,n,s,r){var o,a;if(c(e)){var h=e;e=l(h,"key"),o=new u(t,{key:e,url:l(h,"textureURL"),extension:l(h,"textureExtension","png"),normalMap:l(h,"normalMap"),xhrSettings:l(h,"textureXhrSettings")}),a=new f(t,{key:e,url:l(h,"fontDataURL"),extension:l(h,"fontDataExtension","xml"),xhrSettings:l(h,"fontDataXhrSettings")})}else o=new u(t,e,i,s),a=new f(t,e,n,r);o.linkFile?d.call(this,t,"bitmapfont",e,[o,a,o.linkFile]):d.call(this,t,"bitmapfont",e,[o,a])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.loader.cacheManager.bitmapFont.add(t.key,{data:r(e.data),texture:t.key,frame:null}),this.complete=!0}}});s.register("bitmapFont",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new a(this,t[o]),this.addFile(r.files);else r=new a(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(18),h=i(21),r=i(7),l=i(2),u=i(8),o=new n({Extends:h,initialize:function(t,e,i,n,s){var r="bin";if(u(e)){var o=e;e=l(o,"key"),i=l(o,"url"),n=l(o,"xhrSettings"),r=l(o,"extension",r),s=l(o,"dataType",s)}var a={type:"binary",cache:t.cacheManager.binary,extension:r,responseType:"arraybuffer",key:e,url:i,xhrSettings:n,config:{dataType:s}};h.call(this,t,a)},onProcess:function(){this.state=s.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});r.register("binary",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,n,i));return this}),t.exports=o},function(t,e,i){var u=i(253),n=i(0),s=i(7),c=i(2),d=i(8),f=i(51),p=i(57),g=new n({Extends:p,initialize:function(t,e,i,n,s,r,o){if(d(e)){var a=e;e=c(a,"key"),i=c(a,"jsonURL"),n=c(a,"audioURL"),s=c(a,"audioConfig"),r=c(a,"audioXhrSettings"),o=c(a,"jsonXhrSettings")}var h;if(n){var l=u.create(t,e,n,s,r);l&&(h=new f(t,e,i,o),p.call(this,t,"audiosprite",e,[l,h]),this.config.resourceLoad=!1)}else h=new f(t,e,i,o),p.call(this,t,"audiosprite",e,[h]),this.config.resourceLoad=!0,this.config.audioConfig=s,this.config.audioXhrSettings=r},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=c(this.config,"audioConfig"),n=c(this.config,"audioXhrSettings"),s=u.create(this.loader,t.key,e,i,n);s&&(this.addToMultiFile(s),this.loader.addFile(s))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});s.register("audioSprite",function(t,e,i,n,s,r){var o,a=this.systems.game,h=a.config.audio,l=a.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var u=0;u<t.length;u++)(o=new g(this,t[u])).files&&this.addFile(o.files);else(o=new g(this,t,e,i,n,s,r)).files&&this.addFile(o.files);return this})},function(t,e,i){var n=i(0),s=i(7),l=i(2),u=i(58),c=i(8),d=i(57),f=i(139),a=new n({Extends:d,initialize:function(t,e,i,n,s,r){var o,a;if(c(e)){var h=e;e=l(h,"key"),o=new u(t,{key:e,url:l(h,"textureURL"),extension:l(h,"textureExtension","png"),normalMap:l(h,"normalMap"),xhrSettings:l(h,"textureXhrSettings")}),a=new f(t,{key:e,url:l(h,"atlasURL"),extension:l(h,"atlasExtension","xml"),xhrSettings:l(h,"atlasXhrSettings")})}else o=new u(t,e,i,s),a=new f(t,e,n,r);o.linkFile?d.call(this,t,"atlasxml",e,[o,a,o.linkFile]):d.call(this,t,"atlasxml",e,[o,a])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});s.register("atlasXML",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new a(this,t[o]),this.addFile(r.files);else r=new a(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(7),l=i(2),u=i(58),c=i(8),d=i(51),f=i(57),a=new n({Extends:f,initialize:function(t,e,i,n,s,r){var o,a;if(c(e)){var h=e;e=l(h,"key"),o=new u(t,{key:e,url:l(h,"textureURL"),extension:l(h,"textureExtension","png"),normalMap:l(h,"normalMap"),xhrSettings:l(h,"textureXhrSettings")}),a=new d(t,{key:e,url:l(h,"atlasURL"),extension:l(h,"atlasExtension","json"),xhrSettings:l(h,"atlasXhrSettings")})}else o=new u(t,e,i,s),a=new d(t,e,n,r);o.linkFile?f.call(this,t,"atlasjson",e,[o,a,o.linkFile]):f.call(this,t,"atlasjson",e,[o,a])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});s.register("atlas",function(t,e,i,n,s){var r;if(Array.isArray(t))for(var o=0;o<t.length;o++)r=new a(this,t[o]),this.addFile(r.files);else r=new a(this,t,e,i,n,s),this.addFile(r.files);return this}),t.exports=a},function(t,e,i){var n=i(0),s=i(7),r=i(51),o=new n({Extends:r,initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.type="animationJSON"},onProcess:function(){this.loader.once("loadcomplete",this.onLoadComplete,this),r.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data),this.pendingDestroy()}});s.register("animation",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new o(this,t[s]));else this.addFile(new o(this,t,e,n,i));return this}),t.exports=o},function(t,e,i){t.exports={AnimationJSONFile:i(591),AtlasJSONFile:i(590),AtlasXMLFile:i(589),AudioFile:i(253),AudioSpriteFile:i(588),BinaryFile:i(587),BitmapFontFile:i(586),GLSLFile:i(585),HTML5AudioFile:i(252),HTMLFile:i(584),HTMLTextureFile:i(583),ImageFile:i(58),JSONFile:i(51),MultiAtlasFile:i(582),PackFile:i(581),PluginFile:i(580),ScenePluginFile:i(579),ScriptFile:i(578),SpriteSheetFile:i(577),SVGFile:i(576),TextFile:i(251),TilemapCSVFile:i(575),TilemapImpactFile:i(574),TilemapJSONFile:i(573),UnityAtlasFile:i(572),XMLFile:i(139)}},function(t,e,i){var n=i(18),s=i(20),r={FileTypes:i(592),File:i(21),FileTypesManager:i(7),GetURL:i(141),LoaderPlugin:i(571),MergeXHRSettings:i(140),MultiFile:i(57),XHRLoader:i(254),XHRSettings:i(105)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={TouchManager:i(333)}},function(t,e,i){t.exports={MouseManager:i(336)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=50),t.isUp&&t.duration<e}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=50),t.isDown&&t.duration<e}},function(t,e){t.exports=function(t){return!!t._justUp&&!(t._justUp=!1)}},function(t,e){t.exports=function(t){return!!t._justDown&&!(t._justDown=!1)}},function(t,e){t.exports=function(t,e){if(t.originalEvent=e,t.preventDefault&&e.preventDefault(),t.enabled)return t.isDown=!1,t.isUp=!0,t.timeUp=e.timeStamp,t.duration=t.timeUp-t.timeDown,t.repeats=0,t._justDown=!1,t._justUp=!0,t._tick=-1,t}},function(t,e){t.exports=function(t,e){if(t.originalEvent=e,t.preventDefault&&e.preventDefault(),t.enabled)return t.altKey=e.altKey,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.location=e.location,!1===t.isDown&&(t.isDown=!0,t.isUp=!1,t.timeDown=e.timeStamp,t.duration=0,t._justDown=!0,t._justUp=!1),t.repeats++,t}},function(t,e,i){var n=i(143),s={};for(var r in n)s[n[r]]=r;t.exports=s},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e,i){var r=i(604);t.exports=function(t,e){if(e.matched)return!0;var i=!1,n=!1;if(t.keyCode===e.current)if(0<e.index&&0<e.maxKeyDelay){var s=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=s&&(n=!0,i=r(t,e))}else n=!0,i=r(t,e);return!n&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e,i){var n=i(0),s=i(11),r=i(4),o=i(106),a=i(256),h=i(143),l=i(255),u=i(602),c=i(601),d=i(600),f=i(142),p=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.keys=[],this.combos=[],this.queue=[],this.onKeyHandler,this.time=0,t.pluginEvents.once("boot",this.boot,this),t.pluginEvents.on("start",this.start,this)},boot:function(){var t=this.settings.input,e=this.scene.sys.game.config;this.enabled=r(t,"keyboard",e.inputKeyboard),this.target=r(t,"keyboard.target",e.inputKeyboardEventTarget),this.sceneInputPlugin.pluginEvents.once("destroy",this.destroy,this)},start:function(){this.enabled&&this.startListeners(),this.sceneInputPlugin.pluginEvents.once("shutdown",this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var i=this,t=function(t){if(!t.defaultPrevented&&i.isActive()){i.queue.push(t);var e=i.keys[t.keyCode];e&&e.preventDefault&&t.preventDefault()}};this.onKeyHandler=t,this.target.addEventListener("keydown",t,!1),this.target.addEventListener("keyup",t,!1),this.sceneInputPlugin.pluginEvents.on("update",this.update,this)},stopListeners:function(){this.target.removeEventListener("keydown",this.onKeyHandler),this.target.removeEventListener("keyup",this.onKeyHandler),this.sceneInputPlugin.pluginEvents.off("update",this.update)},createCursorKeys:function(){return this.addKeys({up:h.UP,down:h.DOWN,left:h.LEFT,right:h.RIGHT,space:h.SPACE,shift:h.SHIFT})},addKeys:function(t){var e={};if("string"==typeof t){t=t.split(",");for(var i=0;i<t.length;i++){var n=t[i].trim();n&&(e[n]=this.addKey(n))}}else for(var s in t)e[s]=this.addKey(t[s]);return e},addKey:function(t){var e=this.keys;if(t instanceof a){var i=e.indexOf(t);return-1<i?e[i]=t:e[t.keyCode]=t,t}return"string"==typeof t&&(t=h[t.toUpperCase()]),e[t]||(e[t]=new a(t)),e[t]},removeKey:function(t){var e=this.keys;if(t instanceof a){var i=e.indexOf(t);-1<i&&(this.keys[i]=void 0)}else"string"==typeof t&&(t=h[t.toUpperCase()]);e[t]&&(e[t]=void 0)},createCombo:function(t,e){return new l(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=f(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(t){this.time=t;var e=this.queue.length;if(this.enabled&&0!==e)for(var i=this.queue.splice(0,e),n=this.keys,s=0;s<e;s++){var r=i[s],o=r.keyCode;"keydown"===r.type?(!u[o]||void 0!==n[o]&&!1!==n[o].isDown||(this.emit(r.type,r),this.emit("keydown_"+u[o],r)),n[o]&&c(n[o],r)):(this.emit(r.type,r),this.emit("keyup_"+u[o],r),n[o]&&d(n[o],r))}},resetKeys:function(){for(var t=this.keys,e=0;e<t.length;e++)t[e]&&t[e].reset();return this},shutdown:function(){this.resetKeys(),this.stopListeners(),this.removeAllListeners(),this.queue=[]},destroy:function(){this.shutdown(),this.keys=[],this.combos=[],this.queue=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.target=null}});o.register("KeyboardPlugin",p,"keyboard","keyboard","inputKeyboard"),t.exports=p},function(t,e,i){t.exports={KeyboardPlugin:i(606),Key:i(256),KeyCodes:i(143),KeyCombo:i(255),JustDown:i(599),JustUp:i(598),DownDuration:i(597),UpDuration:i(596)}},function(t,e){t.exports=function(r,o){return function(t,e,i,n){var s=r.getPixelAlpha(e,i,n.texture.key,n.frame.name);return s&&o<=s}}},function(t,e,i){var o=i(71),a=i(40),n=i(0),f=i(260),s=i(608),p=i(52),h=i(90),l=i(89),r=i(11),g=i(2),u=i(106),v=i(8),c=i(15),d=i(9),y=i(39),m=i(59),x=i(69),w=new n({Extends:r,initialize:function(t){r.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new r,this.enabled=!0,this.displayList,this.cameras,u.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once("destroy",this.destroy,this),this.pluginEvents.emit("boot")},start:function(){var t=this.systems.events;t.on("transitionstart",this.transitionIn,this),t.on("transitionout",this.transitionOut,this),t.on("transitioncomplete",this.transitionComplete,this),t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this),this.enabled=!0,this.pluginEvents.emit("start")},preUpdate:function(){this.pluginEvents.emit("preUpdate");var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,n=e.length;if(0!==i||0!==n){for(var s=this._list,r=0;r<i;r++){var o=t[r],a=s.indexOf(o);-1<a&&(s.splice(a,1),this.clear(o))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},update:function(t,e){if(this.isActive()){this.pluginEvents.emit("update",t,e);var i=this.manager;if(!i.globalTopOnly||!i.ignoreEvents){var n=i.dirty||0===this.pollRate;if(-1<this.pollRate&&(this._pollTimer-=e,this._pollTimer<0&&(n=!0,this._pollTimer=this.pollRate)),n)for(var s=this.manager.pointers,r=0;r<this.manager.pointersTotal;r++){var o=s[r];this._tempZones=[],this._temp=this.hitTestPointer(o),this.sortGameObjects(this._temp),this.sortGameObjects(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1));var a=this.processDragEvents(o,t);o.wasTouch||(a+=this.processOverOutEvents(o)),o.justDown&&(a+=this.processDownEvents(o)),o.justUp&&(a+=this.processUpEvents(o)),o.justMoved&&(a+=this.processMoveEvents(o)),0<a&&i.globalTopOnly&&(i.ignoreEvents=!0)}}}},clear:function(t){var e=t.input;if(e){this.queueForRemoval(t),e.gameObject=void 0,e.target=void 0,e.hitArea=void 0,e.hitAreaCallback=void 0,e.callbackContext=void 0,this.manager.resetCursor(e),t.input=null;var i=this._draggable.indexOf(t);return-1<i&&this._draggable.splice(i,1),-1<(i=this._drag[0].indexOf(t))&&this._drag[0].splice(i,1),-1<(i=this._over[0].indexOf(t))&&this._over[0].splice(i,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i<e.length;i++){for(var n=e[i],s=this.manager.hitTest(t,this._list,n),r=0;r<s.length;r++){var o=s[r];o.input.dropZone&&this._tempZones.push(o)}if(0<s.length)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){for(var e=0,i=this._temp,n=this._eventData,s=this._eventContainer,r=n.cancelled=!1,o=0;o<i.length;o++){var a=i[o];if(a.input){if(e++,a.emit("pointerdown",t,a.input.localX,a.input.localY,s),n.cancelled){r=!0;break}if(this.emit("gameobjectdown",t,a,s),n.cancelled){r=!0;break}}}return r||this.emit("pointerdown",t,i),e},processDragEvents:function(t,e){if(0===this._draggable.length)return 0;var i,n,s,r,o=this._temp;if(0===t.dragState&&t.primaryDown&&t.justDown&&0<o.length?t.dragState=1:0<t.dragState&&!t.primaryDown&&t.justUp&&(t.dragState=5),1===t.dragState){var a=[];for(i=0;i<o.length;i++)(n=o[i]).input.draggable&&0===n.input.dragState&&a.push(n);if(0===a.length)return t.dragState=0;1<a.length&&(this.sortGameObjects(a),this.topOnly&&a.splice(1)),this._drag[t.id]=a,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?t.dragState=3:t.dragState=2}if(2===t.dragState&&(0<this.dragDistanceThreshold&&p(t.x,t.y,t.downX,t.downY)>=this.dragDistanceThreshold&&(t.dragState=3),0<this.dragTimeThreshold&&e>=t.downTime+this.dragTimeThreshold&&(t.dragState=3)),3===t.dragState){for(s=this._drag[t.id],i=0;i<s.length;i++)(r=(n=s[i]).input).dragState=2,r.dragX=t.x-n.x,r.dragY=t.y-n.y,r.dragStartX=n.x,r.dragStartY=n.y,n.emit("dragstart",t,r.dragX,r.dragY),this.emit("dragstart",t,n);return t.dragState=4,s.length}if(4===t.dragState&&t.justMoved&&!t.justUp){var h=this._tempZones;for(s=this._drag[t.id],i=0;i<s.length;i++){if((r=(n=s[i]).input).target){var l=h.indexOf(r.target);0===l?(n.emit("dragover",t,r.target),this.emit("dragover",t,n,r.target)):0<l?(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),r.target=h[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):(n.emit("dragleave",t,r.target),this.emit("dragleave",t,n,r.target),h[0]?(r.target=h[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target)):r.target=null)}else!r.target&&h[0]&&(r.target=h[0],n.emit("dragenter",t,r.target),this.emit("dragenter",t,n,r.target));var u=t.x-n.input.dragX,c=t.y-n.input.dragY;n.emit("drag",t,u,c),this.emit("drag",t,n,u,c)}return s.length}if(5===t.dragState){for(s=this._drag[t.id],i=0;i<s.length;i++)if(2===(r=(n=s[i]).input).dragState){r.dragState=0,r.dragX=r.localX-n.displayOriginX,r.dragY=r.localY-n.displayOriginY;var d=!1;r.target&&(n.emit("drop",t,r.target),this.emit("drop",t,n,r.target),r.target=null,d=!0),n.emit("dragend",t,r.dragX,r.dragY,d),this.emit("dragend",t,n,d)}t.dragState=0,s.splice(0)}return 0},processMoveEvents:function(t){for(var e=0,i=this._temp,n=this._eventData,s=this._eventContainer,r=n.cancelled=!1,o=0;o<i.length;o++){var a=i[o];if(a.input){if(e++,a.emit("pointermove",t,a.input.localX,a.input.localY,s),n.cancelled){r=!0;break}if(this.emit("gameobjectmove",t,a,s),n.cancelled){r=!0;break}if(this.topOnly)break}}return r||this.emit("pointermove",t,i),e},processOverOutEvents:function(t){var e,i,n=this._temp,s=[],r=[],o=[],a=this._over[t.id],h=this._drag[t.id],l=this.manager;for(e=0;e<a.length;e++)i=a[e],-1===n.indexOf(i)&&-1===h.indexOf(i)?s.push(i):o.push(i);for(e=0;e<n.length;e++)i=n[e],-1===a.indexOf(i)&&r.push(i);var u=s.length,c=0,d=this._eventData,f=this._eventContainer,p=d.cancelled=!1;if(0<u){for(this.sortGameObjects(s),e=0;e<u;e++)if((i=s[e]).input){if(i.emit("pointerout",t,f),l.resetCursor(i.input),c++,d.cancelled){p=!0;break}if(this.emit("gameobjectout",t,i,f),d.cancelled){p=!0;break}}p||this.emit("pointerout",t,s)}if(u=r.length,d.cancelled=!1,p=!1,0<u){for(this.sortGameObjects(r),e=0;e<u;e++)if((i=r[e]).input){if(i.emit("pointerover",t,i.input.localX,i.input.localY,f),l.setCursor(i.input),c++,d.cancelled){p=!0;break}if(this.emit("gameobjectover",t,i,f),d.cancelled){p=!0;break}}p||this.emit("pointerover",t,r)}return a=o.concat(r),this._over[t.id]=this.sortGameObjects(a),c},processUpEvents:function(t){for(var e=this._temp,i=this._eventData,n=this._eventContainer,s=i.cancelled=!1,r=0;r<e.length;r++){var o=e[r];if(o.input){if(o.emit("pointerup",t,o.input.localX,o.input.localY,n),i.cancelled){s=!0;break}if(this.emit("gameobjectup",t,o,n),i.cancelled){s=!0;break}}}return s||this.emit("pointerup",t,e),e.length},queueForInsertion:function(t){return-1===this._pendingInsertion.indexOf(t)&&-1===this._list.indexOf(t)&&this._pendingInsertion.push(t),this},queueForRemoval:function(t){return this._pendingRemoval.push(t),this},setDraggable:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];n.input.draggable=e;var s=this._draggable.indexOf(n);e&&-1===s?this._draggable.push(n):!e&&-1<s&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return s(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,o=!1;if(v(e)){var a=e;e=g(a,"hitArea",null),i=g(a,"hitAreaCallback",null),n=g(a,"draggable",!1),s=g(a,"dropZone",!1),r=g(a,"cursor",!1),o=g(a,"useHandCursor",!1);var h=g(a,"pixelPerfect",!1),l=g(a,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(l)),e&&i||this.setHitAreaFromTexture(t)}else"function"!=typeof e||i||(i=e,e={});for(var u=0;u<t.length;u++){var c=t[u],d=c.input?c.input:f(c,e,i);d.dropZone=s,d.cursor=o?"pointer":r,c.input=d,n&&this.setDraggable(c),this.queueForInsertion(c)}return this},setHitAreaCircle:function(t,e,i,n,s){void 0===s&&(s=a);var r=new o(e,i,n);return this.setHitArea(t,r,s)},setHitAreaEllipse:function(t,e,i,n,s,r){void 0===r&&(r=l);var o=new h(e,i,n,s);return this.setHitArea(t,o,r)},setHitAreaFromTexture:function(t,e){void 0===e&&(e=y),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i],s=n.frame,r=0,o=0;s?(r=s.realWidth,o=s.realHeight):n.width&&(r=n.width,o=n.height),"Container"!==n.type||0!==r&&0!==o?0!==r&&0!==o&&(n.input=f(n,new d(0,0,r,o),e),this.queueForInsertion(n)):console.warn("Container.setInteractive() must specify a Shape or call setSize() first")}return this},setHitAreaRectangle:function(t,e,i,n,s,r){void 0===r&&(r=y);var o=new d(e,i,n,s);return this.setHitArea(t,o,r)},setHitAreaTriangle:function(t,e,i,n,s,r,o,a){void 0===a&&(a=x);var h=new m(e,i,n,s,r,o);return this.setHitArea(t,h,a)},setPollAlways:function(){return this.pollRate=0,this._pollTimer=0,this},setPollOnMove:function(){return this.pollRate=-1,this._pollTimer=0,this},setPollRate:function(t){return this.pollRate=t,this._pollTimer=0,this},setGlobalTopOnly:function(t){return this.manager.globalTopOnly=t,this},setTopOnly:function(t){return this.topOnly=t,this},sortGameObjects:function(t){return t.length<2?t:(this.scene.sys.depthSort(),t.sort(this.sortHandlerGO.bind(this)))},sortHandlerGO:function(t,e){if(!t.parentContainer&&!e.parentContainer)return this.displayList.getIndex(e)-this.displayList.getIndex(t);if(t.parentContainer===e.parentContainer)return e.parentContainer.getIndex(e)-t.parentContainer.getIndex(t);if(t.parentContainer===e)return-1;if(e.parentContainer===t)return 1;for(var i=t.getIndexList(),n=e.getIndexList(),s=Math.min(i.length,n.length),r=0;r<s;r++){var o=i[r],a=n[r];if(o!==a)return a-o}return 0},stopPropagation:function(){return this.manager.globalTopOnly&&(this.manager.ignoreEvents=!0),this},addUpCallback:function(t,e){return this.manager.addUpCallback(t,e),this},addDownCallback:function(t,e){return this.manager.addDownCallback(t,e),this},addMoveCallback:function(t,e){return this.manager.addMoveCallback(t,e),this},addPointer:function(t){return this.manager.addPointer(t)},setDefaultCursor:function(t){return this.manager.setDefaultCursor(t),this},transitionIn:function(){this.enabled=this.settings.transitionAllowInput},transitionComplete:function(){this.settings.transitionAllowInput||(this.enabled=!0)},transitionOut:function(){this.enabled=this.settings.transitionAllowInput},shutdown:function(){this.pluginEvents.emit("shutdown"),this._temp.length=0,this._list.length=0,this._draggable.length=0,this._pendingRemoval.length=0;for(var t=this._pendingInsertion.length=0;t<10;t++)this._drag[t]=[],this._over[t]=[];this.removeAllListeners();var e=this.systems.events;e.off("transitionstart",this.transitionIn,this),e.off("transitionout",this.transitionOut,this),e.off("transitioncomplete",this.transitionComplete,this),e.off("preupdate",this.preUpdate,this),e.off("update",this.update,this),e.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.pluginEvents.emit("destroy"),this.pluginEvents.removeAllListeners(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.cameras=null,this.manager=null,this.events=null,this.mouse=null},x:{get:function(){return this.manager.activePointer.x}},y:{get:function(){return this.manager.activePointer.y}},mousePointer:{get:function(){return this.manager.mousePointer}},activePointer:{get:function(){return this.manager.activePointer}},pointer1:{get:function(){return this.manager.pointers[1]}},pointer2:{get:function(){return this.manager.pointers[2]}},pointer3:{get:function(){return this.manager.pointers[3]}},pointer4:{get:function(){return this.manager.pointers[4]}},pointer5:{get:function(){return this.manager.pointers[5]}},pointer6:{get:function(){return this.manager.pointers[6]}},pointer7:{get:function(){return this.manager.pointers[7]}},pointer8:{get:function(){return this.manager.pointers[8]}},pointer9:{get:function(){return this.manager.pointers[9]}},pointer10:{get:function(){return this.manager.pointers[10]}}});c.register("InputPlugin",w,"input"),t.exports=w},function(t,e){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},function(t,e){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},function(t,e){t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},function(t,e,i){t.exports={DUALSHOCK_4:i(612),SNES_USB:i(611),XBOX_360:i(610)}},function(t,e,i){var n=i(0),s=i(11),h=i(257),r=i(4),o=i(106),a=new n({Extends:s,initialize:function(t){s.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once("boot",this.boot,this),t.pluginEvents.on("start",this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=r(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=r(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once("destroy",this.destroy,this)},start:function(){this.enabled&&this.startListeners(),this.sceneInputPlugin.pluginEvents.once("shutdown",this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var e=this,t=this.target,i=function(t){!t.defaultPrevented&&e.isActive()&&(e.refreshPads(),e.queue.push(t))};this.onGamepadHandler=i,t.addEventListener("gamepadconnected",i,!1),t.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on("update",this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off("update",this.update)},disconnectAll:function(){for(var t=0;t<this.gamepads.length;t++)this.gamepads.connected=!1},refreshPads:function(){var t=navigator.getGamepads();if(t)for(var e=this.gamepads,i=0;i<t.length;i++){var n=t[i];if(n){var s=n.id,r=n.index,o=e[r];if(o)o.id!==s?(o.destroy(),e[r]=new h(this,n)):o.update(n);else{var a=new h(this,n);e[r]=a,this._pad1?this._pad2?this._pad3?this._pad4||(this._pad4=a):this._pad3=a:this._pad2=a:this._pad1=a}}}else this.disconnectAll()},getAll:function(){for(var t=[],e=this.gamepads,i=0;i<e.length;i++)e[i]&&t.push(e[i]);return t},getPad:function(t){for(var e=this.gamepads,i=0;i<e.length;i++)if(e[i]&&e[i].index===t)return e[i]},update:function(){if(this.enabled){this.refreshPads();var t=this.queue.length;if(0!==t)for(var e=this.queue.splice(0,t),i=0;i<t;i++){var n=e[i],s=this.getPad(n.gamepad.index);"gamepadconnected"===n.type?this.emit("connected",s,n):"gamepaddisconnected"===n.type&&this.emit("disconnected",s,n)}}},shutdown:function(){this.stopListeners(),this.disconnectAll(),this.removeAllListeners()},destroy:function(){this.shutdown();for(var t=0;t<this.gamepads.length;t++)this.gamepads[t]&&this.gamepads[t].destroy();this.gamepads=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.target=null},total:{get:function(){return this.gamepads.length}},pad1:{get:function(){return this._pad1}},pad2:{get:function(){return this._pad2}},pad3:{get:function(){return this._pad3}},pad4:{get:function(){return this._pad4}}});o.register("GamepadPlugin",a,"gamepad","gamepad","inputGamepad"),t.exports=a},function(t,e,i){t.exports={Axis:i(259),Button:i(258),Gamepad:i(257),GamepadPlugin:i(614),Configs:i(613)}},function(t,e,i){var n=i(337),s=i(20),r={CreateInteractiveObject:i(260),Gamepad:i(615),InputManager:i(338),InputPlugin:i(609),InputPluginCache:i(106),Keyboard:i(607),Mouse:i(595),Pointer:i(335),Touch:i(594)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(144);t.exports=function(t,e,i){return n(t,e.x,e.y,i)}},function(t,e,i){var n=i(144),s=i(261);t.exports=function(t,e){var i=s(t);return n(t,i.x,i.y,e)}},function(t,e,i){var s=i(65);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),n=t.getLineC();return s(e)+s(i)+s(n)}},function(t,e){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},function(t,e){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},function(t,e,i){var n=i(69);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(59);t.exports=function(t){return new n(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},function(t,e,i){var x=i(71);t.exports=function(t,e){void 0===e&&(e=new x);var i,n,s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=t.x3,l=t.y3,u=o-s,c=a-r,d=h-s,f=l-r,p=u*(s+o)+c*(r+a),g=d*(s+h)+f*(r+l),v=2*(u*(l-a)-c*(h-o));if(Math.abs(v)<1e-6){var y=Math.min(s,o,h),m=Math.min(r,a,l);i=.5*(Math.max(s,o,h)-y),n=.5*(Math.max(r,a,l)-m),e.x=y+i,e.y=m+n,e.radius=Math.sqrt(i*i+n*n)}else e.x=(f*p-c*g)/v,e.y=(u*g-d*p)/v,i=e.x-s,n=e.y-r,e.radius=Math.sqrt(i*i+n*n);return e}},function(t,e,i){var c=i(3);function d(t,e,i,n){return t*n-e*i}t.exports=function(t,e){void 0===e&&(e=new c);var i=t.x3,n=t.y3,s=t.x1-i,r=t.y1-n,o=t.x2-i,a=t.y2-n,h=2*d(s,r,o,a),l=d(r,s*s+r*r,a,o*o+a*a),u=d(s,s*s+r*r,o,o*o+a*a);return e.x=i-l/h,e.y=n+u/h,e}},function(t,e,i){var a=i(263),h=i(262);t.exports=function(t,e,i,n){void 0===n&&(n=a);var s=n(t),r=e-s.x,o=i-s.y;return h(t,r,o)}},function(t,e,i){var s=i(59);t.exports=function(t,e,i,n){return void 0===n&&(n=i),new s(t,e,t,e-n,t+i,e)}},function(t,e,i){var v=i(64),y=i(59);t.exports=function(t,e,i,n,s){void 0===e&&(e=null),void 0===i&&(i=1),void 0===n&&(n=1),void 0===s&&(s=[]);for(var r,o,a,h,l,u,c,d,f,p=v(t,e),g=0;g<p.length;g+=3)r=p[g],o=p[g+1],a=p[g+2],h=t[2*r]*i,l=t[2*r+1]*n,u=t[2*o]*i,c=t[2*o+1]*n,d=t[2*a]*i,f=t[2*a+1]*n,s.push(new y(h,l,u,c,d,f));return s}},function(t,e,i){var s=i(59);t.exports=function(t,e,i){var n=i*(Math.sqrt(3)/2);return new s(t,e,t+i/2,e+n,t-i/2,e+n)}},function(t,e){t.exports=function(t){var e=t.x1,i=t.y1,n=t.x2,s=t.y2,r=t.x3,o=t.y3;return Math.abs(((r-e)*(s-i)-(n-e)*(o-i))/2)}},function(t,e,i){var n=i(59);n.Area=i(630),n.BuildEquilateral=i(629),n.BuildFromPolygon=i(628),n.BuildRight=i(627),n.CenterOn=i(626),n.Centroid=i(263),n.CircumCenter=i(625),n.CircumCircle=i(624),n.Clone=i(623),n.Contains=i(69),n.ContainsArray=i(147),n.ContainsPoint=i(622),n.CopyFrom=i(621),n.Decompose=i(269),n.Equals=i(620),n.GetPoint=i(278),n.GetPoints=i(277),n.InCenter=i(261),n.Perimeter=i(619),n.Offset=i(262),n.Random=i(184),n.Rotate=i(618),n.RotateAroundPoint=i(617),n.RotateAroundXY=i(144),t.exports=n},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},function(t,e){t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},function(t,e,i){var n=i(170),s=i(264),r=i(6);t.exports=function(t,e,i){if(void 0===i&&(i=new r),s(t,e))switch(n(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},function(t,e,i){var a=i(6),h=i(31);t.exports=function(t,e,i){void 0===i&&(i=new a),e=h(e);var n=Math.sin(e),s=Math.cos(e),r=0<s?t.width/2:t.width/-2,o=0<n?t.height/2:t.height/-2;return Math.abs(r*n)<Math.abs(o*s)?o=r*n/s:r=o*s/n,i.x=r+t.centerX,i.y=o+t.centerY,i}},function(t,e){t.exports=function(t,e){return t.x<e.right&&t.right>e.x&&t.y<e.bottom&&t.bottom>e.y}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e,i){var n=Math.min(t.x,e),s=Math.max(t.right,e);t.x=n,t.width=s-n;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},function(t,e){t.exports=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.right,e.right);t.x=i,t.width=n-i;var s=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=s,t.height=r-s,t}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;o<e.length;o++)i=Math.min(i,e[o].x),n=Math.max(n,e[o].x),s=Math.min(s,e[o].y),r=Math.max(r,e[o].y);return t.x=i,t.y=s,t.width=n-i,t.height=r-s,t}},function(t,e,i){var n=i(9),s=i(148);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e,i){var r=i(175);t.exports=function(t,e,i){var n=t.centerX,s=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),r(t,n,s)}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e,i){var n=i(145);t.exports=function(t,e){var i=n(t);return i>n(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e,i){var n=i(145);t.exports=function(t,e){var i=n(t);return i<n(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(39);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(9);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},function(t,e){t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},function(t,e){t.exports=function(t){return t.width*t.height}},function(t,e){t.exports=function(t){return t.points.reverse(),t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i<t.points.length;i++)e.push(t.points[i].x),e.push(t.points[i].y);return e}},function(t,e,i){var n=i(150);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(151);t.exports=function(t){return new n(t.points)}},function(t,e,i){var n=i(151);n.Clone=i(660),n.Contains=i(150),n.ContainsPoint=i(659),n.GetAABB=i(285),n.GetNumberArray=i(658),n.GetPoints=i(284),n.Perimeter=i(283),n.Reverse=i(657),n.Smooth=i(282),t.exports=n},function(t,e,i){var n=i(267);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=n(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},function(t,e,i){var s=i(6);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x*e.x+t.y*e.y;return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},function(t,e,i){var s=i(6),r=i(266);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=(t.x*e.x+t.y*e.y)/r(e);return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.setTo(-t.x,-t.y)}},function(t,e){t.exports=function(t){return t.setTo(t.y,t.x)}},function(t,e,i){var s=i(6);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=new s),n.x=t.x+(e.x-t.x)*i,n.y=t.y+(e.y-t.y)*i,n}},function(t,e,i){var h=i(9);t.exports=function(t,e){void 0===e&&(e=new h);for(var i=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=0;o<t.length;o++){var a=t[o];a.x>i&&(i=a.x),a.x<n&&(n=a.x),a.y>s&&(s=a.y),a.y<r&&(r=a.y)}return e.x=n,e.y=r,e.width=i-n,e.height=s-r,e}},function(t,e,i){var s=i(6);t.exports=function(t,e){if(void 0===e&&(e=new s),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var n=0;n<i;n++)e.x+=t[n].x,e.y+=t[n].y;e.x/=i,e.y/=i}return e}},function(t,e){t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y)}},function(t,e,i){var n=i(6);t.exports=function(t){return new n(t.x,t.y)}},function(t,e){t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},function(t,e,i){var n=i(6);n.Ceil=i(674),n.Clone=i(673),n.CopyFrom=i(672),n.Equals=i(671),n.Floor=i(670),n.GetCentroid=i(669),n.GetMagnitude=i(267),n.GetMagnitudeSq=i(266),n.GetRectangleFromPoints=i(668),n.Interpolate=i(667),n.Invert=i(666),n.Negative=i(665),n.Project=i(664),n.ProjectUnit=i(663),n.SetMagnitude=i(662),t.exports=n},function(t,e){t.exports=function(t){return Math.abs(t.x1-t.x2)}},function(t,e){t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},function(t,e){t.exports=function(t,e,i,n,s){return t.x1=e,t.y1=i,t.x2=e+Math.cos(n)*s,t.y2=i+Math.sin(n)*s,t}},function(t,e,i){var n=i(146);t.exports=function(t,e,i){return n(t,e.x,e.y,i)}},function(t,e,i){var s=i(146);t.exports=function(t,e){var i=(t.x1+t.x2)/2,n=(t.y1+t.y2)/2;return s(t,i,n,e)}},function(t,e,i){var n=i(68),s=i(268);t.exports=function(t,e){return 2*s(e)-Math.PI-n(t)}},function(t,e){t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},function(t,e){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},function(t,e,i){var n=i(16),s=i(68);t.exports=function(t){return Math.sin(s(t)-n.TAU)}},function(t,e,i){var n=i(16),s=i(68);t.exports=function(t){return Math.cos(s(t)-n.TAU)}},function(t,e){t.exports=function(t){return Math.abs(t.y1-t.y2)}},function(t,e,i){var n=i(16),s=i(68),r=i(6);t.exports=function(t,e){void 0===e&&(e=new r);var i=s(t)-n.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},function(t,e,i){var n=i(6);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},function(t,e){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},function(t,e){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},function(t,e,i){var n=i(54);t.exports=function(t){return new n(t.x1,t.y1,t.x2,t.y2)}},function(t,e){t.exports=function(t,e,i){var n=e-(t.x1+t.x2)/2,s=i-(t.y1+t.y2)/2;return t.x1+=n,t.y1+=s,t.x2+=n,t.y2+=s,t}},function(t,e,i){var n=i(54);n.Angle=i(68),n.BresenhamPoints=i(385),n.CenterOn=i(692),n.Clone=i(691),n.CopyFrom=i(690),n.Equals=i(689),n.GetMidPoint=i(688),n.GetNormal=i(687),n.GetPoint=i(397),n.GetPoints=i(189),n.Height=i(686),n.Length=i(65),n.NormalAngle=i(268),n.NormalX=i(685),n.NormalY=i(684),n.Offset=i(683),n.PerpSlope=i(682),n.Random=i(188),n.ReflectAngle=i(681),n.Rotate=i(680),n.RotateAroundPoint=i(679),n.RotateAroundXY=i(146),n.SetToAngle=i(678),n.Slope=i(677),n.Width=i(676),t.exports=n},function(t,e,i){var u=i(147),c=i(269),d=i(107);t.exports=function(t,e){if(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)return!1;var i=t.getLineA(),n=t.getLineB(),s=t.getLineC(),r=e.getLineA(),o=e.getLineB(),a=e.getLineC();if(d(i,r)||d(i,o)||d(i,a))return!0;if(d(n,r)||d(n,o)||d(n,a))return!0;if(d(s,r)||d(s,o)||d(s,a))return!0;var h=c(t),l=u(e,h,!0);return 0<l.length||(h=c(e),0<(l=u(t,h,!0)).length)}},function(t,e,i){var n=i(69),s=i(107);t.exports=function(t,e){return!!(n(t,e.getPointA())||n(t,e.getPointB())||s(t.getLineA(),e)||s(t.getLineB(),e)||s(t.getLineC(),e))}},function(t,e,i){var n=i(272),s=i(69);t.exports=function(t,e){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top||!s(t,e.x,e.y)&&!n(t.getLineA(),e)&&!n(t.getLineB(),e)&&!n(t.getLineC(),e))}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||i<t.left-r||n>t.bottom+r||s<t.top-r)}},function(t,e,i){var u=i(107),c=i(39),d=i(147),f=i(270);t.exports=function(t,e){if(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)return!1;var i=e.getLineA(),n=e.getLineB(),s=e.getLineC();if(c(t,i.x1,i.y1)||c(t,i.x2,i.y2))return!0;if(c(t,n.x1,n.y1)||c(t,n.x2,n.y2))return!0;if(c(t,s.x1,s.y1)||c(t,s.x2,s.y2))return!0;var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();if(u(i,r)||u(i,o)||u(i,a)||u(i,h))return!0;if(u(n,r)||u(n,o)||u(n,a)||u(n,h))return!0;if(u(s,r)||u(s,o)||u(s,a)||u(s,h))return!0;var l=f(t);return 0<d(e,l,!0).length}},function(t,e,i){var o=i(271);t.exports=function(t,e){if(!o(t,e))return!1;var i=Math.min(e.x1,e.x2),n=Math.max(e.x1,e.x2),s=Math.min(e.y1,e.y2),r=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=n&&t.y>=s&&t.y<=r}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(o<=i&&i<=h&&a<=n&&n<=l||o<=s&&s<=h&&a<=r&&r<=l)return!0;if(i<o&&o<=s){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(h<i&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n<a&&a<=r){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(l<n&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(9),s=i(148);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(o<s||a<r)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e,i){var n=i(52);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(9);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(89);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(89);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(90);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(90);n.Area=i(712),n.Circumference=i(306),n.CircumferencePoint=i(156),n.Clone=i(711),n.Contains=i(89),n.ContainsPoint=i(710),n.ContainsRect=i(709),n.CopyFrom=i(708),n.Equals=i(707),n.GetBounds=i(706),n.GetPoint=i(308),n.GetPoints=i(307),n.Offset=i(705),n.OffsetPoint=i(704),n.Random=i(185),t.exports=n},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e,i){var n=i(9);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e,i){var n=i(40);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e,i){var n=i(40);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(71);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t){return 0<t.radius?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(71);n.Area=i(722),n.Circumference=i(402),n.CircumferencePoint=i(192),n.Clone=i(721),n.Contains=i(40),n.ContainsPoint=i(720),n.ContainsRect=i(719),n.CopyFrom=i(718),n.Equals=i(717),n.GetBounds=i(716),n.GetPoint=i(405),n.GetPoints=i(403),n.Offset=i(715),n.OffsetPoint=i(714),n.Random=i(191),t.exports=n},function(t,e,i){var n=i(0),s=i(275),r=i(15),o=new n({Extends:s,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once("boot",this.boot,this),s.call(this)},boot:function(){var t=this.systems.events;t.on("shutdown",this.shutdown,this),t.on("destroy",this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",o,"lights"),t.exports=o},function(t,e,i){var a=i(28),n=i(13),h=i(12),l=i(149);n.register("quad",function(t,e){void 0===t&&(t={});var i=h(t,"x",0),n=h(t,"y",0),s=h(t,"key",null),r=h(t,"frame",null),o=new l(this.scene,i,n,s,r);return void 0!==e&&(t.add=e),a(this.scene,o,t),o})},function(t,e,i){var l=i(28),n=i(13),u=i(12),c=i(4),d=i(108);n.register("mesh",function(t,e){void 0===t&&(t={});var i=u(t,"key",null),n=u(t,"frame",null),s=c(t,"vertices",[]),r=c(t,"colors",[]),o=c(t,"alphas",[]),a=c(t,"uv",[]),h=new d(this.scene,0,0,s,a,r,o,i,n);return void 0!==e&&(t.add=e),l(this.scene,h,t),h})},function(t,e,i){var s=i(149);i(5).register("quad",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var h=i(108);i(5).register("mesh",function(t,e,i,n,s,r,o,a){return this.displayList.add(new h(this.scene,t,e,i,n,s,r,o,a))})},function(t,e){t.exports=function(){}},function(t,e,i){var C=i(10);t.exports=function(t,e,i,n,s){var r=this.pipeline;t.setPipeline(r,e);var o=r._tempMatrix1,a=r._tempMatrix2,h=r._tempMatrix3;a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY),o.multiply(a,h);var l=e.frame.glTexture,u=e.vertices,c=e.uv,d=e.colors,f=e.alphas,p=u.length,g=Math.floor(.5*p);r.vertexCount+g>=r.vertexCapacity&&r.flush(),r.setTexture2D(l,0);for(var v=r.vertexViewF32,y=r.vertexViewU32,m=r.vertexCount*r.vertexComponentCount-1,x=0,w=e.tintFill,b=0;b<p;b+=2){var T=u[b+0],S=u[b+1],_=T*h.a+S*h.c+h.e,A=T*h.b+S*h.d+h.f;n.roundPixels&&(_|=0,A|=0),v[++m]=_,v[++m]=A,v[++m]=c[b+0],v[++m]=c[b+1],v[++m]=w,y[++m]=C.getTintAppendFloatAlpha(d[x],n.alpha*f[x]),x++}r.vertexCount+=g}},function(t,e,i){var n=i(1),s=i(1);n=i(730),s=i(729),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(13),r=i(12),o=i(125);n.register("zone",function(t){var e=r(t,"x",0),i=r(t,"y",0),n=r(t,"width",1),s=r(t,"height",n);return new o(this.scene,e,i,n,s)})},function(t,e,i){var l=i(28),n=i(13),u=i(12),c=i(152);n.register("tileSprite",function(t,e){void 0===t&&(t={});var i=u(t,"x",0),n=u(t,"y",0),s=u(t,"width",512),r=u(t,"height",512),o=u(t,"key",""),a=u(t,"frame",""),h=new c(this.scene,i,n,s,r,o,a);return void 0!==e&&(t.add=e),l(this.scene,h,t),h})},function(t,e,i){var o=i(28),n=i(13),a=i(12),h=i(153);n.register("text",function(t,e){void 0===t&&(t={});var i=a(t,"text",""),n=a(t,"style",null),s=a(t,"padding",null);null!==s&&(n.padding=s);var r=new h(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),o(this.scene,r,t),r.autoRound=a(t,"autoRound",!0),r.resolution=a(t,"resolution",1),r})},function(t,e,i){var a=i(109),h=i(28),n=i(13),l=i(12),u=i(4);n.register("bitmapText",function(t,e){void 0===t&&(t={});var i=u(t,"font",""),n=l(t,"text",""),s=l(t,"size",!1),r=u(t,"align",0),o=new a(this.scene,0,0,i,n,s,r);return void 0!==e&&(t.add=e),h(this.scene,o,t),o})},function(t,e,i){var r=i(28),o=i(311),n=i(13),a=i(12),h=i(61);n.register("sprite",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),s=new h(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),r(this.scene,s,t),o(s,t),s})},function(t,e,i){var a=i(28),n=i(13),h=i(12),l=i(154);n.register("renderTexture",function(t,e){void 0===t&&(t={});var i=h(t,"x",0),n=h(t,"y",0),s=h(t,"width",32),r=h(t,"height",32),o=new l(this.scene,i,n,s,r);return void 0!==e&&(t.add=e),a(this.scene,o,t),o})},function(t,e,i){var n=i(13),o=i(12),a=i(2),h=i(155);n.register("particles",function(t,e){void 0===t&&(t={});var i=o(t,"key",null),n=o(t,"frame",null),s=a(t,"emitters",null),r=new h(this.scene,i,n,s);return void 0!==e&&(t.add=e),a(t,"add",!1)&&this.displayList.add(r),this.updateList.add(r),r})},function(t,e,i){var r=i(28),n=i(13),o=i(12),a=i(87);n.register("image",function(t,e){void 0===t&&(t={});var i=o(t,"key",null),n=o(t,"frame",null),s=new a(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),r(this.scene,s,t),s})},function(t,e,i){var n=i(13),s=i(88);n.register("group",function(t){return new s(this.scene,null,t)})},function(t,e,i){var n=i(13),s=i(158);n.register("graphics",function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new s(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i})},function(t,e,i){var o=i(159),a=i(28),n=i(13),h=i(12);n.register("dynamicBitmapText",function(t,e){void 0===t&&(t={});var i=h(t,"font",""),n=h(t,"text",""),s=h(t,"size",!1),r=new o(this.scene,0,0,i,n,s);return void 0!==e&&(t.add=e),a(this.scene,r,t),r})},function(t,e,i){var r=i(28),o=i(160),n=i(13),a=i(12);n.register("container",function(t,e){void 0===t&&(t={});var i=a(t,"x",0),n=a(t,"y",0),s=new o(this.scene,i,n);return void 0!==e&&(t.add=e),r(this.scene,s,t),s})},function(t,e,i){var r=i(161),o=i(28),n=i(13),a=i(12);n.register("blitter",function(t,e){void 0===t&&(t={});var i=a(t,"key",null),n=a(t,"frame",null),s=new r(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),o(this.scene,s,t),s})},function(t,e,i){var n=i(5),u=i(279);n.register("triangle",function(t,e,i,n,s,r,o,a,h,l){return this.displayList.add(new u(this.scene,t,e,i,n,s,r,o,a,h,l))})},function(t,e,i){var a=i(280);i(5).register("star",function(t,e,i,n,s,r,o){return this.displayList.add(new a(this.scene,t,e,i,n,s,r,o))})},function(t,e,i){var n=i(5),o=i(281);n.register("rectangle",function(t,e,i,n,s,r){return this.displayList.add(new o(this.scene,t,e,i,n,s,r))})},function(t,e,i){var n=i(5),r=i(286);n.register("polygon",function(t,e,i,n,s){return this.displayList.add(new r(this.scene,t,e,i,n,s))})},function(t,e,i){var n=i(5),h=i(287);n.register("line",function(t,e,i,n,s,r,o,a){return this.displayList.add(new h(this.scene,t,e,i,n,s,r,o,a))})},function(t,e,i){var n=i(5),h=i(288);n.register("isotriangle",function(t,e,i,n,s,r,o,a){return this.displayList.add(new h(this.scene,t,e,i,n,s,r,o,a))})},function(t,e,i){var n=i(5),a=i(289);n.register("isobox",function(t,e,i,n,s,r,o){return this.displayList.add(new a(this.scene,t,e,i,n,s,r,o))})},function(t,e,i){var n=i(5),u=i(290);n.register("grid",function(t,e,i,n,s,r,o,a,h,l){return this.displayList.add(new u(this.scene,t,e,i,n,s,r,o,a,h,l))})},function(t,e,i){var o=i(291);i(5).register("ellipse",function(t,e,i,n,s,r){return this.displayList.add(new o(this.scene,t,e,i,n,s,r))})},function(t,e,i){var n=i(5),r=i(292);n.register("curve",function(t,e,i,n,s){return this.displayList.add(new r(this.scene,t,e,i,n,s))})},function(t,e,i){var h=i(293),n=i(5);n.register("arc",function(t,e,i,n,s,r,o,a){return this.displayList.add(new h(this.scene,t,e,i,n,s,r,o,a))}),n.register("circle",function(t,e,i,n,s){return this.displayList.add(new h(this.scene,t,e,i,0,360,!1,n,s))})},function(t,e,i){var s=i(125);i(5).register("zone",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var o=i(152);i(5).register("tileSprite",function(t,e,i,n,s,r){return this.displayList.add(new o(this.scene,t,e,i,n,s,r))})},function(t,e,i){var s=i(153);i(5).register("text",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var o=i(109);i(5).register("bitmapText",function(t,e,i,n,s,r){return this.displayList.add(new o(this.scene,t,e,i,n,s,r))})},function(t,e,i){var n=i(5),r=i(61);n.register("sprite",function(t,e,i,n){var s=new r(this.scene,t,e,i,n);return this.displayList.add(s),this.updateList.add(s),s})},function(t,e,i){var n=i(5),s=i(154);n.register("renderTexture",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var n=i(5),o=i(296);n.register("follower",function(t,e,i,n,s){var r=new o(this.scene,t,e,i,n,s);return this.displayList.add(r),this.updateList.add(r),r})},function(t,e,i){var n=i(5),s=i(155);n.register("particles",function(t,e,i){var n=new s(this.scene,t,e,i);return this.displayList.add(n),this.updateList.add(n),n})},function(t,e,i){var s=i(87);i(5).register("image",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var n=i(88);i(5).register("group",function(t,e){return this.updateList.add(new n(this.scene,t,e))})},function(t,e,i){var n=i(158);i(5).register("graphics",function(t){return this.displayList.add(new n(this.scene,t))})},function(t,e,i){var r=i(159);i(5).register("dynamicBitmapText",function(t,e,i,n,s){return this.displayList.add(new r(this.scene,t,e,i,n,s))})},function(t,e,i){var n=i(160);i(5).register("container",function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))})},function(t,e,i){var s=i(161);i(5).register("blitter",function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))})},function(t,e,i){var p=i(30),g=i(36),v=i(22);t.exports=function(t,e,i,n,s){var r=t.currentContext;if(v(t,r,e,n,s)){var o=e._displayOriginX,a=e._displayOriginY,h=e.geom.x1-o,l=e.geom.y1-a,u=e.geom.x2-o,c=e.geom.y2-a,d=e.geom.x3-o,f=e.geom.y3-a;r.beginPath(),r.moveTo(h,l),r.lineTo(u,c),r.lineTo(d,f),r.closePath(),e.isFilled&&(p(r,e),r.fill()),e.isStroked&&(g(r,e),r.stroke())}}},function(t,e,i){var w=i(60),b=i(10);t.exports=function(t,e,i,n,s){var r=this.pipeline,o=r._tempMatrix1,a=r._tempMatrix2,h=r._tempMatrix3;t.setPipeline(r),a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY),o.multiply(a,h);var l=e._displayOriginX,u=e._displayOriginY,c=n.alpha*e.alpha;if(e.isFilled){var d=r.fillTint,f=b.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*c);d.TL=f,d.TR=f,d.BL=f,d.BR=f;var p=e.geom.x1-l,g=e.geom.y1-u,v=e.geom.x2-l,y=e.geom.y2-u,m=e.geom.x3-l,x=e.geom.y3-u;r.setTexture2D(),r.batchFillTriangle(p,g,v,y,m,x,a,o)}e.isStroked&&w(r,e,c,l,u)}},function(t,e,i){var n=i(1),s=i(1);n=i(771),s=i(770),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var g=i(30),v=i(36),y=i(22);t.exports=function(t,e,i,n,s){var r=t.currentContext;if(y(t,r,e,n,s)){var o=e._displayOriginX,a=e._displayOriginY,h=e.pathData,l=h.length-1,u=h[0]-o,c=h[1]-a;r.beginPath(),r.moveTo(u,c),e.closePath||(l-=2);for(var d=2;d<l;d+=2){var f=h[d]-o,p=h[d+1]-a;r.lineTo(f,p)}r.closePath(),e.isFilled&&(g(r,e),r.fill()),e.isStroked&&(v(r,e),r.stroke())}}},function(t,e,i){var d=i(82),f=i(60);t.exports=function(t,e,i,n,s){var r=this.pipeline,o=r._tempMatrix1,a=r._tempMatrix2,h=r._tempMatrix3;t.setPipeline(r),a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY),o.multiply(a,h);var l=e._displayOriginX,u=e._displayOriginY,c=n.alpha*e.alpha;e.isFilled&&d(r,h,e,c,l,u),e.isStroked&&f(r,e,c,l,u)}},function(t,e,i){var n=i(1),s=i(1);n=i(774),s=i(773),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var h=i(30),l=i(36),u=i(22);t.exports=function(t,e,i,n,s){var r=t.currentContext;if(u(t,r,e,n,s)){var o=e._displayOriginX,a=e._displayOriginY;e.isFilled&&(h(r,e),r.fillRect(-o,-a,e.width,e.height)),e.isStroked&&(l(r,e),r.beginPath(),r.rect(-o,-a,e.width,e.height),r.stroke())}}},function(t,e,i){var p=i(60),g=i(10);t.exports=function(t,e,i,n,s){var r=this.pipeline,o=r._tempMatrix1,a=r._tempMatrix2,h=r._tempMatrix3;t.setPipeline(r),a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY),o.multiply(a,h);var l=e._displayOriginX,u=e._displayOriginY,c=n.alpha*e.alpha;if(e.isFilled){var d=r.fillTint,f=g.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*c);d.TL=f,d.TR=f,d.BL=f,d.BR=f,r.batchFillRect(-l,-u,e.width,e.height)}e.isStroked&&p(r,e,c,l,u)}},function(t,e,i){var n=i(1),s=i(1);n=i(777),s=i(776),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var g=i(30),v=i(36),y=i(22);t.exports=function(t,e,i,n,s){var r=t.currentContext;if(y(t,r,e,n,s)){var o=e._displayOriginX,a=e._displayOriginY,h=e.pathData,l=h.length-1,u=h[0]-o,c=h[1]-a;r.beginPath(),r.moveTo(u,c),e.closePath||(l-=2);for(var d=2;d<l;d+=2){var f=h[d]-o,p=h[d+1]-a;r.lineTo(f,p)}r.closePath(),e.isFilled&&(g(r,e),r.fill()),e.isStroked&&(v(r,e),r.stroke())}}},function(t,e,i){var d=i(82),f=i(60);t.exports=function(t,e,i,n,s){var r=this.pipeline,o=r._tempMatrix1,a=r._tempMatrix2,h=r._tempMatrix3;t.setPipeline(r),a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY),o.multiply(a,h);var l=e._displayOriginX,u=e._displayOriginY,c=n.alpha*e.alpha;e.isFilled&&d(r,h,e,c,l,u),e.isStroked&&f(r,e,c,l,u)}},function(t,e,i){var n=i(1),s=i(1);n=i(780),s=i(779),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var h=i(36),l=i(22);t.exports=function(t,e,i,n,s){var r=t.currentContext;if(l(t,r,e,n,s)){var o=e._displayOriginX,a=e._displayOriginY;e.isStroked&&(h(r,e),r.beginPath(),r.moveTo(e.geom.x1-o,e.geom.y1-a),r.lineTo(e.geom.x2-o,e.geom.y2-a),r.stroke())}}},function(t,e,i){var g=i(10);t.exports=function(t,e,i,n,s){var r=this.pipeline,o=r._tempMatrix1,a=r._tempMatrix2;t.setPipeline(r),a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY);var h=e._displayOriginX,l=e._displayOriginY,u=n.alpha*e.alpha;if(e.isStroked){var c=r.strokeTint,d=g.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*u);c.TL=d,c.TR=d,c.BL=d,c.BR=d;var f=e._startWidth,p=e._endWidth;r.setTexture2D(),r.batchLine(e.geom.x1-h,e.geom.y1-l,e.geom.x2-h,e.geom.y2-l,f,p,1,0,!1,a,o)}}},function(t,e,i){var n=i(1),s=i(1);n=i(783),s=i(782),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var c=i(30),d=i(22);t.exports=function(t,e,i,n,s){var r=t.currentContext;if(d(t,r,e,n,s)&&e.isFilled){var o=e.width,a=e.height,h=o/2,l=o/e.projection,u=e.isReversed;e.showTop&&u&&(c(r,e,e.fillTop),r.beginPath(),r.moveTo(-h,-a),r.lineTo(0,-l-a),r.lineTo(h,-a),r.lineTo(0,l-a),r.fill()),e.showLeft&&(c(r,e,e.fillLeft),r.beginPath(),u?r.moveTo(-h,-a):r.moveTo(-h,0),r.lineTo(0,l),r.lineTo(0,l-a),r.fill()),e.showRight&&(c(r,e,e.fillRight),r.beginPath(),u?r.moveTo(h,-a):r.moveTo(h,0),r.lineTo(0,l),r.lineTo(0,l-a),r.fill())}}},function(t,e,i){var _=i(10);t.exports=function(t,e,i,n,s){var r=this.pipeline,o=r._tempMatrix1,a=r._tempMatrix2,h=r._tempMatrix3;t.setPipeline(r),a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY),o.multiply(a,h);var l=e.width,u=e.height,c=l/2,d=l/e.projection,f=e.isReversed,p=n.alpha*e.alpha;if(e.isFilled){var g,v,y,m,x,w,b;if(e.showTop&&f){g=_.getTintAppendFloatAlphaAndSwap(e.fillTop,p),v=h.getX(-c,-u),y=h.getY(-c,-u),m=h.getX(0,-d-u),x=h.getY(0,-d-u),w=h.getX(c,-u),b=h.getY(c,-u);var T=h.getX(0,d-u),S=h.getY(0,d-u);r.setTexture2D(),r.batchQuad(v,y,m,x,w,b,T,S,0,0,1,1,g,g,g,g,2)}e.showLeft&&(g=_.getTintAppendFloatAlphaAndSwap(e.fillLeft,p),y=f?(v=h.getX(-c,-u),h.getY(-c,-u)):(v=h.getX(-c,0),h.getY(-c,0)),m=h.getX(0,d),x=h.getY(0,d),w=h.getX(0,d-u),b=h.getY(0,d-u),r.batchTri(v,y,m,x,w,b,0,0,1,1,g,g,g,2)),e.showRight&&(g=_.getTintAppendFloatAlphaAndSwap(e.fillRight,p),y=f?(v=h.getX(c,-u),h.getY(c,-u)):(v=h.getX(c,0),h.getY(c,0)),m=h.getX(0,d),x=h.getY(0,d),w=h.getX(0,d-u),b=h.getY(0,d-u),r.setTexture2D(),r.batchTri(v,y,m,x,w,b,0,0,1,1,g,g,g,2))}}},function(t,e,i){var n=i(1),s=i(1);n=i(786),s=i(785),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var u=i(30),c=i(22);t.exports=function(t,e,i,n,s){var r=t.currentContext;if(c(t,r,e,n,s)&&e.isFilled){var o=e.width,a=e.height,h=o/2,l=o/e.projection;e.showTop&&(u(r,e,e.fillTop),r.beginPath(),r.moveTo(-h,-a),r.lineTo(0,-l-a),r.lineTo(h,-a),r.lineTo(h,-1),r.lineTo(0,l-1),r.lineTo(-h,-1),r.lineTo(-h,-a),r.fill()),e.showLeft&&(u(r,e,e.fillLeft),r.beginPath(),r.moveTo(-h,0),r.lineTo(0,l),r.lineTo(0,l-a),r.lineTo(-h,-a),r.lineTo(-h,0),r.fill()),e.showRight&&(u(r,e,e.fillRight),r.beginPath(),r.moveTo(h,0),r.lineTo(0,l),r.lineTo(0,l-a),r.lineTo(h,-a),r.lineTo(h,0),r.fill())}}},function(t,e,i){var S=i(10);t.exports=function(t,e,i,n,s){var r=this.pipeline,o=r._tempMatrix1,a=r._tempMatrix2,h=r._tempMatrix3;t.setPipeline(r),a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY),o.multiply(a,h);var l,u,c,d,f,p,g,v,y,m=e.width,x=e.height,w=m/2,b=m/e.projection,T=n.alpha*e.alpha;e.isFilled&&(e.showTop&&(l=S.getTintAppendFloatAlphaAndSwap(e.fillTop,T),u=h.getX(-w,-x),c=h.getY(-w,-x),d=h.getX(0,-b-x),f=h.getY(0,-b-x),p=h.getX(w,-x),g=h.getY(w,-x),v=h.getX(0,b-x),y=h.getY(0,b-x),r.setTexture2D(),r.batchQuad(u,c,d,f,p,g,v,y,0,0,1,1,l,l,l,l,2)),e.showLeft&&(l=S.getTintAppendFloatAlphaAndSwap(e.fillLeft,T),u=h.getX(-w,0),c=h.getY(-w,0),d=h.getX(0,b),f=h.getY(0,b),p=h.getX(0,b-x),g=h.getY(0,b-x),v=h.getX(-w,-x),y=h.getY(-w,-x),r.setTexture2D(),r.batchQuad(u,c,d,f,p,g,v,y,0,0,1,1,l,l,l,l,2)),e.showRight&&(l=S.getTintAppendFloatAlphaAndSwap(e.fillRight,T),u=h.getX(w,0),c=h.getY(w,0),d=h.getX(0,b),f=h.getY(0,b),p=h.getX(0,b-x),g=h.getY(0,b-x),v=h.getX(w,-x),y=h.getY(w,-x),r.setTexture2D(),r.batchQuad(u,c,d,f,p,g,v,y,0,0,1,1,l,l,l,l,2)))}},function(t,e,i){var n=i(1),s=i(1);n=i(789),s=i(788),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var h=i(30),l=i(36),u=i(22);t.exports=function(t,e,i,n,s){var r=t.currentContext;if(u(t,r,e,n,s)){var o=e._displayOriginX,a=e._displayOriginY;e.isFilled&&(h(r,e),r.fillRect(-o,-a,e.width,e.height)),e.isStroked&&(l(r,e),r.beginPath(),r.rect(-o,-a,e.width,e.height),r.stroke())}}},function(t,e,i){var O=i(10);t.exports=function(t,e,i,n,s){var r=this.pipeline,o=r._tempMatrix1,a=r._tempMatrix2,h=r._tempMatrix3;t.setPipeline(r),a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY),o.multiply(a,h),h.translate(-e._displayOriginX,-e._displayOriginY);var l,u,c=n.alpha*e.alpha,d=e.width,f=e.height,p=e.cellWidth,g=e.cellHeight,v=Math.ceil(d/p),y=Math.ceil(f/g),m=p,x=g,w=p-(v*p-d),b=g-(y*g-f),T=e.showCells,S=e.showAltCells,_=e.showOutline,A=0,C=0,M=0,P=0,E=0;if(_&&(m--,x--,w===p&&w--,b===g&&b--),T&&0<e.fillAlpha)for(l=r.fillTint,u=O.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*c),l.TL=u,l.TR=u,l.BL=u,l.BR=u,C=0;C<y;C++)for(S&&(M=C%2),A=0;A<v;A++)S&&M?M=0:(M++,P=A<v-1?m:w,E=C<y-1?x:b,r.setTexture2D(),r.batchFillRect(A*p,C*g,P,E));if(S&&0<e.altFillAlpha)for(l=r.fillTint,u=O.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*c),l.TL=u,l.TR=u,l.BL=u,l.BR=u,C=0;C<y;C++)for(S&&(M=C%2),A=0;A<v;A++)!S||M?(M=0,P=A<v-1?m:w,E=C<y-1?x:b,r.setTexture2D(),r.batchFillRect(A*p,C*g,P,E)):M=1;if(_&&0<e.outlineFillAlpha){var k=r.strokeTint,F=O.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*c);for(k.TL=F,k.TR=F,k.BL=F,k.BR=F,A=1;A<v;A++){var L=A*p;r.setTexture2D(),r.batchLine(L,0,L,f,1,1,1,0,!1)}for(C=1;C<y;C++){var R=C*g;r.setTexture2D(),r.batchLine(0,R,d,R,1,1,1,0,!1)}}}},function(t,e,i){var n=i(1),s=i(1);n=i(792),s=i(791),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var g=i(30),v=i(36),y=i(22);t.exports=function(t,e,i,n,s){var r=t.currentContext;if(y(t,r,e,n,s)){var o=e._displayOriginX,a=e._displayOriginY,h=e.pathData,l=h.length-1,u=h[0]-o,c=h[1]-a;r.beginPath(),r.moveTo(u,c),e.closePath||(l-=2);for(var d=2;d<l;d+=2){var f=h[d]-o,p=h[d+1]-a;r.lineTo(f,p)}r.closePath(),e.isFilled&&(g(r,e),r.fill()),e.isStroked&&(v(r,e),r.stroke())}}},function(t,e,i){var d=i(82),f=i(60);t.exports=function(t,e,i,n,s){var r=this.pipeline,o=r._tempMatrix1,a=r._tempMatrix2,h=r._tempMatrix3;t.setPipeline(r),a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY),o.multiply(a,h);var l=e._displayOriginX,u=e._displayOriginY,c=n.alpha*e.alpha;e.isFilled&&d(r,h,e,c,l,u),e.isStroked&&f(r,e,c,l,u)}},function(t,e,i){var n=i(1),s=i(1);n=i(795),s=i(794),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var g=i(30),v=i(36),y=i(22);t.exports=function(t,e,i,n,s){var r=t.currentContext;if(y(t,r,e,n,s)){var o=e._displayOriginX+e._curveBounds.x,a=e._displayOriginY+e._curveBounds.y,h=e.pathData,l=h.length-1,u=h[0]-o,c=h[1]-a;r.beginPath(),r.moveTo(u,c),e.closePath||(l-=2);for(var d=2;d<l;d+=2){var f=h[d]-o,p=h[d+1]-a;r.lineTo(f,p)}e.closePath&&r.closePath(),e.isFilled&&(g(r,e),r.fill()),e.isStroked&&(v(r,e),r.stroke())}}},function(t,e,i){var d=i(82),f=i(60);t.exports=function(t,e,i,n,s){var r=this.pipeline,o=r._tempMatrix1,a=r._tempMatrix2,h=r._tempMatrix3;t.setPipeline(r),a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY),o.multiply(a,h);var l=e._displayOriginX+e._curveBounds.x,u=e._displayOriginY+e._curveBounds.y,c=n.alpha*e.alpha;e.isFilled&&d(r,h,e,c,l,u),e.isStroked&&f(r,e,c,l,u)}},function(t,e,i){var n=i(1),s=i(1);n=i(798),s=i(797),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var a=i(31),h=i(30),l=i(36),u=i(22);t.exports=function(t,e,i,n,s){var r=t.currentContext;if(u(t,r,e,n,s)){var o=e.radius;r.beginPath(),r.arc(o-e.originX*(2*o),o-e.originY*(2*o),o,a(e._startAngle),a(e._endAngle),e.anticlockwise),e.closePath&&r.closePath(),e.isFilled&&(h(r,e),r.fill()),e.isStroked&&(l(r,e),r.stroke())}}},function(t,e,i){var d=i(82),f=i(60);t.exports=function(t,e,i,n,s){var r=this.pipeline,o=r._tempMatrix1,a=r._tempMatrix2,h=r._tempMatrix3;t.setPipeline(r),a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY),o.multiply(a,h);var l=e._displayOriginX,u=e._displayOriginY,c=n.alpha*e.alpha;e.isFilled&&d(r,h,e,c,l,u),e.isStroked&&f(r,e,c,l,u)}},function(t,e,i){var n=i(1),s=i(1);n=i(801),s=i(800),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){e.updateCanvas(),t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var o=i(10);t.exports=function(t,e,i,n,s){e.updateCanvas();var r=o.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,e.width,e.height,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*e.width,e.originY*e.height,0,0,e.width,e.height,r(e._tintTL,n.alpha*e._alphaTL),r(e._tintTR,n.alpha*e._alphaTR),r(e._tintBL,n.alpha*e._alphaBL),r(e._tintBR,n.alpha*e._alphaBR),e._isTinted&&e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,n,s)}},function(t,e,i){var n=i(1),s=i(1);n=i(804),s=i(803),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var p=i(24);t.exports=function(t){var e=p.create(this),i=e.getContext("2d");t.syncFont(e,i);var n=Math.ceil(i.measureText(t.testString).width*t.baselineX),s=n,r=2*s;s=s*t.baselineY|0,e.width=n,e.height=r,i.fillStyle="#f00",i.fillRect(0,0,n,r),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,s);var o={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,n,r))return o.ascent=s,o.descent=s+6,o.fontSize=o.ascent+o.descent,p.remove(e),o;var a,h,l=i.getImageData(0,0,n,r).data,u=l.length,c=4*n,d=0,f=!1;for(a=0;a<s;a++){for(h=0;h<c;h+=4)if(255!==l[d+h]){f=!0;break}if(f)break;d+=c}for(o.ascent=s-a,d=u-c,f=!1,a=r;s<a;a--){for(h=0;h<c;h+=4)if(255!==l[d+h]){f=!0;break}if(f)break;d-=c}return o.descent=a-s,o.fontSize=o.ascent+o.descent,p.remove(e),o}},function(t,e,i){var n=i(0),a=i(12),h=i(4),s=i(806),l={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÃ‰qgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},r=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this._font,this.setStyle(e,!1,!0);var i=h(e,"metrics",!1);this.metrics=i?{ascent:h(i,"ascent",0),descent:h(i,"descent",0),fontSize:h(i,"fontSize",0)}:s(this)},setStyle:function(t,e,i){for(var n in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),l){var s=i?l[n][1]:this[n];this[n]="wordWrapCallback"===n||"wordWrapCallbackScope"===n?h(t,l[n][0],s):a(t,l[n][0],s)}var r=h(t,"font",null);this._font=null===r?[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim():r;var o=h(t,"fill",null);return null!==o&&(this.color=o),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){t.shadowBlur=e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=s(this)),this.parent.updateText()},setFont:function(t){var e=t,i="",n="";return"string"!=typeof t&&(e=h(t,"fontFamily","Courier"),i=h(t,"fontSize","16px"),n=h(t,"fontStyle","")),e===this.fontFamily&&i===this.fontSize&&n===this.fontStyle||(this.fontFamily=e,this.fontSize=i,this.fontStyle=n,this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in l)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=r},function(t,e){t.exports=function(t,e,i,n,s){""!==e.text&&t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var l=i(10);t.exports=function(t,e,i,n,s){if(""!==e.text){var r=e.frame,o=r.width,a=r.height,h=l.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,r.glTexture,o,a,e.x,e.y,o/e.style.resolution,a/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,a,h(e._tintTL,n.alpha*e._alphaTL),h(e._tintTR,n.alpha*e._alphaTR),h(e._tintBL,n.alpha*e._alphaBL),h(e._tintBR,n.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,n,s)}}},function(t,e,i){var n=i(1),s=i(1);n=i(809),s=i(808),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i){var n=t.canvas,s=t.context,r=t.style,o=[],a=0,h=i.length;0<r.maxLines&&r.maxLines<i.length&&(h=r.maxLines),r.syncFont(n,s);for(var l=0;l<h;l++){var u=r.strokeThickness;u+=s.measureText(i[l]).width,r.wordWrap&&(u-=s.measureText(" ").width),o[l]=Math.ceil(u),a=Math.max(a,o[l])}var c=e.fontSize+r.strokeThickness,d=c*h,f=t.lineSpacing;return 1<i.length&&(d+=f*(i.length-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var w=i(4);t.exports=function(t,e){var i=e.width,n=e.height,s=Math.floor(i/2),r=Math.floor(n/2),o=w(e,"chars","");if(""!==o){var a=w(e,"image",""),h=w(e,"offset.x",0),l=w(e,"offset.y",0),u=w(e,"spacing.x",0),c=w(e,"spacing.y",0),d=w(e,"lineSpacing",0),f=w(e,"charsPerRow",null);null===f&&(f=t.sys.textures.getFrame(a).width/i)>o.length&&(f=o.length);for(var p=h,g=l,v={retroFont:!0,font:a,size:i,lineHeight:n+d,chars:{}},y=0,m=0;m<o.length;m++){var x=o.charCodeAt(m);v.chars[x]={x:p,y:g,width:i,height:n,centerX:s,centerY:r,xOffset:0,yOffset:0,xAdvance:i,data:{},kerning:{}},++y===f?(y=0,p=h,g+=n+c):p+=i+u}return{data:v,frame:null,texture:a}}}},function(t,e){t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(813),s=i(20),r={Parse:i(812)};r=s(!1,r,n),t.exports=r},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var l=i(10);t.exports=function(t,e,i,n,s){var r=e.frame,o=r.width,a=r.height,h=l.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,r.glTexture,o,a,e.x,e.y,o,a,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,a,h(e._tintTL,n.alpha*e._alphaTL),h(e._tintTR,n.alpha*e._alphaTR),h(e._tintBL,n.alpha*e._alphaBL),h(e._tintBR,n.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,n,s),t.setBlankTexture(!0)}},function(t,e,i){var n=i(1),s=i(1);n=i(816),s=i(815),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){t.exports={DeathZone:i(301),EdgeZone:i(300),RandomZone:i(297)}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.emitters.list,o=r.length;if(0!==o){var a=t._tempMatrix1.copyFrom(n.matrix),h=t._tempMatrix2,l=t._tempMatrix3,u=t._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);a.multiply(u);var c=n.roundPixels,d=t.currentContext;d.save();for(var f=0;f<o;f++){var p=r[f],g=p.alive,v=g.length;if(p.visible&&0!==v){var y=n.scrollX*p.scrollFactorX,m=n.scrollY*p.scrollFactorY;s&&(a.multiplyWithOffset(s,-y,-m),m=y=0),d.globalCompositeOperation=t.blendModes[p.blendMode];for(var x=0;x<v;x++){var w=g[x],b=w.alpha*n.alpha;if(!(b<=0)){var T=w.frame,S=T.canvasData,_=-T.halfWidth,A=-T.halfHeight;l.applyITRS(0,0,w.rotation,w.scaleX,w.scaleY),l.e=w.x-y,l.f=w.y-m,a.multiply(l,h),d.globalAlpha=b,d.save(),h.copyToContext(d),c&&(_|=0,A|=0),d.drawImage(T.source.image,S.x,S.y,S.width,S.height,_,A,S.width,S.height),d.restore()}}}}d.restore()}}},function(t,e,i){var Y=i(10);t.exports=function(t,e,i,n,s){var r=e.emitters.list,o=r.length;if(0!==o){var a=this.pipeline,h=a._tempMatrix1.copyFrom(n.matrix),l=a._tempMatrix2,u=a._tempMatrix3,c=a._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);h.multiply(c),t.setPipeline(a);var d=n.roundPixels,f=e.defaultFrame.glTexture,p=Y.getTintAppendFloatAlphaAndSwap;a.setTexture2D(f,0);for(var g=0;g<o;g++){var v=r[g],y=v.alive,m=y.length;if(v.visible&&0!==m){var x=n.scrollX*v.scrollFactorX,w=n.scrollY*v.scrollFactorY;s&&(h.multiplyWithOffset(s,-x,-w),w=x=0),t.setBlendMode(v.blendMode)&&a.setTexture2D(f,0);for(var b=0;b<m;b++){var T=y[b],S=T.alpha*n.alpha;if(!(S<=0)){var _=T.frame,A=-_.halfWidth,C=-_.halfHeight,M=A+_.width,P=C+_.height;u.applyITRS(0,0,T.rotation,T.scaleX,T.scaleY),u.e=T.x-x,u.f=T.y-w,h.multiply(u,l);var E=l.getX(A,C),k=l.getY(A,C),F=l.getX(A,P),L=l.getY(A,P),R=l.getX(M,P),O=l.getY(M,P),D=l.getX(M,C),B=l.getY(M,C);d&&(E|=0,k|=0,F|=0,L|=0,R|=0,O|=0,D|=0,B|=0);var I=p(T.tint,S);a.batchQuad(E,k,F,L,R,O,D,B,_.u0,_.v0,_.u1,_.v1,I,I,I,I,0)&&a.setTexture2D(f,0)}}}}}}},function(t,e,i){var n=i(1),s=i(1);n=i(820),s=i(819),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(0),s=i(299),r=i(86),o=i(2),a=i(53),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&(this.has(t,"random")||this.hasBoth(t,"start","end")||this.hasBoth(t,"min","max"))){this.start=this.has(t,"start")?t.start:t.min,this.end=this.has(t,"end")?t.end:t.max;var i=this.hasBoth(t,"min","max")||this.has(t,"random");if(i){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}if(this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){t.exports={GravityWell:i(304),Particle:i(303),ParticleEmitter:i(302),ParticleEmitterManager:i(155),Zones:i(818)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e,i){var n=i(1),s=i(1);n=i(825),s=i(824),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e,i){var n=i(1),s=i(1);n=i(828),s=i(827),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var X=i(157),z=i(10),N=function(t,e,i){this.x=t,this.y=e,this.width=i},U=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new N(t,e,i)},V=[];t.exports=function(t,e,i,n,s){if(0!==e.commandBuffer.length){var r=this.pipeline,o=r._tempMatrix1,a=r._tempMatrix2,h=r._tempMatrix4;t.setPipeline(r),h.loadIdentity(),a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),o.copyFrom(n.matrix),s?(o.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),a.e=e.x,a.f=e.y):(a.e-=n.scrollX*e.scrollFactorX,a.f-=n.scrollY*e.scrollFactorY),o.multiply(a);for(var l=e.commandBuffer,u=n.alpha*e.alpha,c=1,d=r.fillTint,f=r.strokeTint,p=0,g=0,v=0,y=2*Math.PI,m=[],x=0,w=!1,b=null,T=z.getTintAppendFloatAlphaAndSwap,S=t.blankTexture.glTexture,_=0;_<l.length;_++)switch(l[_]){case X.BEGIN_PATH:m.length=0,w=!(b=null);break;case X.CLOSE_PATH:w=!1,b&&b.points.length&&b.points.push(b.points[0]);break;case X.FILL_PATH:for(x=0;x<m.length;x++)r.setTexture2D(S),r.batchFillPath(m[x].points,h,o);break;case X.STROKE_PATH:for(x=0;x<m.length;x++)r.setTexture2D(S),r.batchStrokePath(m[x].points,c,w,h,o);break;case X.LINE_STYLE:c=l[++_];var A=T(l[++_],l[++_]*u);f.TL=A,f.TR=A,f.BL=A,f.BR=A;break;case X.FILL_STYLE:var C=T(l[++_],l[++_]*u);d.TL=C,d.TR=C,d.BL=C,d.BR=C;break;case X.GRADIENT_FILL_STYLE:var M=l[++_]*u;d.TL=T(l[++_],M),d.TR=T(l[++_],M),d.BL=T(l[++_],M),d.BR=T(l[++_],M);break;case X.GRADIENT_LINE_STYLE:c=l[++_];var P=l[++_]*u;f.TL=T(l[++_],P),f.TR=T(l[++_],P),f.BL=T(l[++_],P),f.BR=T(l[++_],P);break;case X.ARC:var E=0,k=l[++_],F=l[++_],L=l[++_],R=l[++_],O=l[++_],D=l[++_],B=l[++_];for(O-=R,D?O<-y?O=-y:0<O&&(O=O%y-y):y<O?O=y:O<0&&(O=y+O%y),null===b&&(b=new U(k+Math.cos(R)*L,F+Math.sin(R)*L,c),m.push(b),E+=.01);E<1+B;)v=O*E+R,p=k+Math.cos(v)*L,g=F+Math.sin(v)*L,b.points.push(new N(p,g,c)),E+=.01;v=O+R,p=k+Math.cos(v)*L,g=F+Math.sin(v)*L,b.points.push(new N(p,g,c));break;case X.FILL_RECT:r.setTexture2D(S),r.batchFillRect(l[++_],l[++_],l[++_],l[++_],h,o);break;case X.FILL_TRIANGLE:r.setTexture2D(S),r.batchFillTriangle(l[++_],l[++_],l[++_],l[++_],l[++_],l[++_],h,o);break;case X.STROKE_TRIANGLE:r.setTexture2D(S),r.batchStrokeTriangle(l[++_],l[++_],l[++_],l[++_],l[++_],l[++_],c,h,o);break;case X.LINE_TO:null!==b?b.points.push(new N(l[++_],l[++_],c)):(b=new U(l[++_],l[++_],c),m.push(b));break;case X.MOVE_TO:b=new U(l[++_],l[++_],c),m.push(b);break;case X.SAVE:V.push(h.copyToArray());break;case X.RESTORE:h.copyFromArray(V.pop());break;case X.TRANSLATE:k=l[++_],F=l[++_],h.translate(k,F);break;case X.SCALE:k=l[++_],F=l[++_],h.scale(k,F);break;case X.ROTATE:h.rotate(l[++_]);break;case X.SET_TEXTURE:var I=l[++_],Y=l[++_];r.currentFrame=I,r.setTexture2D(I.glTexture,0),r.tintEffect=Y,S=I.glTexture;break;case X.CLEAR_TEXTURE:r.currentFrame=t.blankTexture,r.tintEffect=2,S=t.blankTexture.glTexture}}}},function(t,e,i){var n=i(1),s=i(1);n=i(830),s=i(305),s=i(305),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var D=i(22);t.exports=function(t,e,i,n,s){var r=e.text,o=r.length,a=t.currentContext;if(0!==o&&D(t,a,e,n,s)){var h=e.frame,l=e.displayCallback,u=n.scrollX*e.scrollFactorX,c=n.scrollY*e.scrollFactorY,d=e.fontData.chars,f=e.fontData.lineHeight,p=0,g=0,v=0,y=0,m=null,x=0,w=0,b=0,T=0,S=0,_=0,A=null,C=0,M=e.frame.source.image,P=h.cutX,E=h.cutY,k=0,F=e.fontSize/e.fontData.size;0<e.cropWidth&&0<e.cropHeight&&(a.save(),a.beginPath(),a.rect(0,0,e.cropWidth,e.cropHeight),a.clip());for(var L=0;L<o;++L)if(F=e.fontSize/e.fontData.size,k=0,10!==(y=r.charCodeAt(L))){if(m=d[y]){if(x=P+m.x,w=E+m.y,b=m.width,T=m.height,S=v+m.xOffset+p-e.scrollX,_=m.yOffset+g-e.scrollY,null!==A){var R=m.kerning[C];S+=void 0!==R?R:0}if(l){var O=l({tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:L,charCode:y,x:S,y:_,scale:F,rotation:0,data:m.data});S=O.x,_=O.y,F=O.scale,k=O.rotation}S*=F,_*=F,S-=u,_-=c,n.roundPixels&&(S|=0,_|=0),a.save(),a.translate(S,_),a.rotate(k),a.scale(F,F),a.drawImage(M,x,w,b,T,0,0,b,T),a.restore(),p+=m.xAdvance,v+=1,A=m,C=y}}else v=p=0,g+=f,A=null;0<e.cropWidth&&0<e.cropHeight&&a.restore(),a.restore()}}},function(t,e,i){var pt=i(10);t.exports=function(t,e,i,n,s){var r=e.text,o=r.length;if(0!==o){var a=this.pipeline;t.setPipeline(a,e);var h=0<e.cropWidth||0<e.cropHeight;h&&(a.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var l=a._tempMatrix1,u=a._tempMatrix2,c=a._tempMatrix3,d=a._tempMatrix4;u.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),l.copyFrom(n.matrix),s?(l.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),u.e=e.x,u.f=e.y):(u.e-=n.scrollX*e.scrollFactorX,u.f-=n.scrollY*e.scrollFactorY),l.multiply(u,c);var f=e.frame,p=f.glTexture,g=f.cutX,v=f.cutY,y=p.width,m=p.height,x=e._isTinted&&e.tintFill,w=pt.getTintAppendFloatAlpha(e._tintTL,n.alpha*e._alphaTL),b=pt.getTintAppendFloatAlpha(e._tintTR,n.alpha*e._alphaTR),T=pt.getTintAppendFloatAlpha(e._tintBL,n.alpha*e._alphaBL),S=pt.getTintAppendFloatAlpha(e._tintBR,n.alpha*e._alphaBR);a.setTexture2D(p,0);var _,A,C=0,M=0,P=0,E=0,k=e.letterSpacing,F=0,L=0,R=0,O=0,D=e.scrollX,B=e.scrollY,I=e.fontData,Y=I.chars,X=I.lineHeight,z=e.fontSize/I.size,N=0,U=e._align,V=0,G=0;e.getTextBounds(!1);var W=e._bounds.lines;1===U?G=(W.longest-W.lengths[0])/2:2===U&&(G=W.longest-W.lengths[0]);for(var H=n.roundPixels,j=e.displayCallback,q=e.callbackData,K=0;K<o;K++)if(10!==(P=r.charCodeAt(K))){if(_=Y[P]){F=g+_.x,L=v+_.y,R=_.width,O=_.height;var J=_.xOffset+C-D,Z=_.yOffset+M-B;if(null!==A){var Q=_.kerning[E];J+=void 0!==Q?Q:0}if(C+=_.xAdvance+k,A=_,E=P,0!==R&&0!==O&&32!==P){if(z=e.fontSize/e.fontData.size,N=0,j){q.color=0,q.tint.topLeft=w,q.tint.topRight=b,q.tint.bottomLeft=T,q.tint.bottomRight=S,q.index=K,q.charCode=P,q.x=J,q.y=Z,q.scale=z,q.rotation=N,q.data=_.data;var $=j(q);J=$.x,Z=$.y,z=$.scale,N=$.rotation,S=$.color?(w=$.color,b=$.color,T=$.color,$.color):(w=$.tint.topLeft,b=$.tint.topRight,T=$.tint.bottomLeft,$.tint.bottomRight),w=pt.getTintAppendFloatAlpha(w,n.alpha*e._alphaTL),b=pt.getTintAppendFloatAlpha(b,n.alpha*e._alphaTR),T=pt.getTintAppendFloatAlpha(T,n.alpha*e._alphaBL),S=pt.getTintAppendFloatAlpha(S,n.alpha*e._alphaBR)}J*=z,Z*=z,J-=e.displayOriginX,Z-=e.displayOriginY,J+=G,d.applyITRS(J,Z,N,z,z),c.multiply(d,u);var tt=F/y,et=L/m,it=(F+R)/y,nt=(L+O)/m,st=R,rt=O,ot=u.e,at=u.f,ht=rt*u.c+u.e,lt=rt*u.d+u.f,ut=st*u.a+rt*u.c+u.e,ct=st*u.b+rt*u.d+u.f,dt=st*u.a+u.e,ft=st*u.b+u.f;H&&(ot|=0,at|=0,ht|=0,lt|=0,ut|=0,ct|=0,dt|=0,ft|=0),a.batchQuad(ot,at,ht,lt,ut,ct,dt,ft,tt,et,it,nt,w,b,T,S,x)}}}else V++,1===U?G=(W.longest-W.lengths[V])/2:2===U&&(G=W.longest-W.lengths[V]),C=0,M+=X,A=null;h&&(a.flush(),t.popScissor())}}},function(t,e,i){var n=i(1),s=i(1);n=i(833),s=i(832),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.list;if(0!==r.length){var o=e.localTransform;s?(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e._alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c<r.length;c++){var d=r[c];if(d.willRender(n)){var f=d._alpha,p=d._blendMode,g=d.scrollFactorX,v=d.scrollFactorY;d.setScrollFactor(g*l,v*u),d.setAlpha(f*h),a&&d.setBlendMode(e._blendMode),d.renderCanvas(t,d,i,n,o),d.setAlpha(f),d.setScrollFactor(g,v),d.setBlendMode(p)}}}}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.list;if(0!==r.length){var o=e.localTransform;s?(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e._alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c<r.length;c++){var d=r[c];if(d.willRender(n)){var f=d._alpha,p=d.scrollFactorX,g=d.scrollFactorY;a||d.blendMode===t.currentBlendMode||t.setBlendMode(d.blendMode),d.setScrollFactor(p*l,g*u),d.setAlpha(f*h),d.renderWebGL(t,d,i,n,o),d.setAlpha(f),d.setScrollFactor(p,g)}}}}},function(t,e,i){var n=i(1),s=i(1);n=i(836),s=i(835),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){this.parent=t,this.x=e,this.y=i,this.frame=n,this.data={},this._visible=s,this._alpha=1,this.flipX=!1,this.flipY=!1},setFrame:function(t){return this.frame=void 0===t?this.parent.frame:this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this._visible=t,this.parent.dirty=!0}},alpha:{get:function(){return this._alpha},set:function(t){this._alpha=t,this.parent.dirty=!0}}});t.exports=n},function(t,e){t.exports=function(t,e,i,n,s){var r=e.getRenderList();if(0!==r.length){var o=t.currentContext,a=n.alpha*e.alpha;if(0!==a){o.globalCompositeOperation=t.blendModes[e.blendMode];var h=e.x-n.scrollX*e.scrollFactorX,l=e.y-n.scrollY*e.scrollFactorY;o.save(),s&&s.copyToContext(o);for(var u=n.roundPixels,c=0;c<r.length;c++){var d=r[c],f=d.flipX||d.flipY,p=d.frame,g=p.canvasData,v=p.x,y=p.y,m=1,x=1,w=d.alpha*a;0!==w&&(o.globalAlpha=w,f?(d.flipX&&(m=-1,v-=g.width),d.flipY&&(x=-1,y-=g.height),o.save(),o.translate(d.x+h,d.y+l),o.scale(m,x),o.drawImage(p.source.image,g.x,g.y,g.width,g.height,v,y,g.width,g.height),o.restore()):(u&&(v|=0,y|=0),o.drawImage(p.source.image,g.x,g.y,g.width,g.height,v+d.x+h,y+d.y+l,g.width,g.height)))}o.restore()}}}},function(t,e,i){var k=i(10);t.exports=function(t,e,i,n,s){var r=e.getRenderList();if(0!==r.length){var o=this.pipeline;t.setPipeline(o,e);var a=n.scrollX*e.scrollFactorX,h=n.scrollY*e.scrollFactorY,l=o._tempMatrix1;l.copyFrom(n.matrix),s&&(l.multiplyWithOffset(s,-a,-h),h=a=0);for(var u=e.x-a,c=e.y-h,d=-1,f=n.alpha*e.alpha,p=n.roundPixels,g=0;g<r.length;g++){var v=r[g],y=v.frame,m=v.alpha*f;if(0!==m){var x=y.width,w=y.height,b=u+v.x+y.x,T=c+v.y+y.y;v.flipX&&(x*=-1,b+=y.width),v.flipY&&(w*=-1,T+=y.height);var S=b+x,_=T+w,A=l.getX(b,T),C=l.getY(b,T),M=l.getX(S,_),P=l.getY(S,_),E=k.getTintAppendFloatAlpha(16777215,m);y.sourceIndex!==d&&(o.setTexture2D(y.glTexture,0),d=y.sourceIndex),p&&(A|=0,C|=0,M|=0,P|=0),o.batchQuad(A,C,A,P,M,P,M,C,y.u0,y.v0,y.u1,y.v1,E,E,E,E,!1)&&(d=-1)}}}}},function(t,e,i){var n=i(1),s=i(1);n=i(840),s=i(839),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var D=i(22);t.exports=function(t,e,i,n,s){var r=e._text,o=r.length,a=t.currentContext;if(0!==o&&D(t,a,e,n,s)){var h=e.frame,l=e.fontData.chars,u=e.fontData.lineHeight,c=e._letterSpacing,d=0,f=0,p=0,g=null,v=0,y=0,m=0,x=0,w=0,b=0,T=null,S=0,_=e.frame.source.image,A=h.cutX,C=h.cutY,M=e._fontSize/e.fontData.size,P=e._align,E=0,k=0;e.getTextBounds(!1);var F=e._bounds.lines;1===P?k=(F.longest-F.lengths[0])/2:2===P&&(k=F.longest-F.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);for(var L=n.roundPixels,R=0;R<o;R++)if(10!==(p=r.charCodeAt(R))){if(g=l[p]){if(v=A+g.x,y=C+g.y,m=g.width,x=g.height,w=g.xOffset+d,b=g.yOffset+f,null!==T){var O=g.kerning[S];w+=void 0!==O?O:0}w*=M,b*=M,w+=k,d+=g.xAdvance+c,T=g,S=p,0!==m&&0!==x&&32!==p&&(L&&(w|=0,b|=0),a.save(),a.translate(w,b),a.scale(M,M),a.drawImage(_,v,y,m,x,0,0,m,x),a.restore())}}else E++,1===P?k=(F.longest-F.lengths[E])/2:2===P&&(k=F.longest-F.lengths[E]),d=0,f+=u,T=null;a.restore()}}},function(t,e,i){var ot=i(10);t.exports=function(t,e,i,n,s){var r=e._text,o=r.length;if(0!==o){var a=this.pipeline;t.setPipeline(a,e);var h=a._tempMatrix1,l=a._tempMatrix2,u=a._tempMatrix3;l.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),h.copyFrom(n.matrix),s?(h.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),l.e=e.x,l.f=e.y):(l.e-=n.scrollX*e.scrollFactorX,l.f-=n.scrollY*e.scrollFactorY),h.multiply(l,u);var c=e.frame,d=c.glTexture,f=c.cutX,p=c.cutY,g=d.width,v=d.height,y=e._isTinted&&e.tintFill,m=ot.getTintAppendFloatAlpha(e._tintTL,n.alpha*e._alphaTL),x=ot.getTintAppendFloatAlpha(e._tintTR,n.alpha*e._alphaTR),w=ot.getTintAppendFloatAlpha(e._tintBL,n.alpha*e._alphaBL),b=ot.getTintAppendFloatAlpha(e._tintBR,n.alpha*e._alphaBR);a.setTexture2D(d,0);var T,S,_=0,A=0,C=0,M=0,P=e._letterSpacing,E=0,k=0,F=0,L=0,R=e.fontData,O=R.chars,D=R.lineHeight,B=e._fontSize/R.size,I=e._align,Y=0,X=0;e.getTextBounds(!1);var z=e._bounds.lines;1===I?X=(z.longest-z.lengths[0])/2:2===I&&(X=z.longest-z.lengths[0]);for(var N=n.roundPixels,U=0;U<o;U++)if(10!==(C=r.charCodeAt(U))){if(T=O[C]){E=f+T.x,k=p+T.y,F=T.width,L=T.height;var V=T.xOffset+_,G=T.yOffset+A;if(null!==S){var W=T.kerning[M];V+=void 0!==W?W:0}if(_+=T.xAdvance+P,S=T,M=C,0!==F&&0!==L&&32!==C){V*=B,G*=B,V-=e.displayOriginX,G-=e.displayOriginY;var H=E/g,j=k/v,q=(E+F)/g,K=(k+L)/v,J=(V+=X)+F*B,Z=G+L*B,Q=u.getX(V,G),$=u.getY(V,G),tt=u.getX(V,Z),et=u.getY(V,Z),it=u.getX(J,Z),nt=u.getY(J,Z),st=u.getX(J,G),rt=u.getY(J,G);N&&(Q|=0,$|=0,tt|=0,et|=0,it|=0,nt|=0,st|=0,rt|=0),a.batchQuad(Q,$,tt,et,it,nt,st,rt,H,j,q,K,m,x,w,b,y)}}}else Y++,1===I?X=(z.longest-z.lengths[Y])/2:2===I&&(X=z.longest-z.lengths[Y]),_=0,A+=D,S=null}}},function(t,e,i){var n=i(1),s=i(1);n=i(843),s=i(842),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var u=i(310);t.exports=function(t,e,i,n,s,r,o){var a=t.sys.textures.getFrame(i,n),h=t.sys.cache.xml.get(s);if(a&&h){var l=u(h,r,o,a);return t.sys.cache.bitmapFont.add(e,{data:l,texture:i,frame:n}),!0}return!1}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null}});for(var n=t.text,s=n.length,r=Number.MAX_VALUE,o=Number.MAX_VALUE,a=0,h=0,l=t.fontData.chars,u=t.fontData.lineHeight,c=t.letterSpacing,d=0,f=0,p=0,g=null,v=0,y=0,m=t.fontSize/t.fontData.size,x=m*t.scaleX,w=m*t.scaleY,b=null,T=0,S=[],_=Number.MAX_VALUE,A=0,C=0,M=0,P=0;P<s;P++)if(10!==(p=n.charCodeAt(P))){if(g=l[p]){if(v=d,y=f,null!==b){var E=g.kerning[T];v+=void 0!==E?E:0}v<r&&(r=v),y<o&&(o=y);var k=v+g.xAdvance,F=y+u;a<k&&(a=k),h<F&&(h=F),d+=g.xAdvance+c,b=g,T=p,M=k*m}}else d=0,f+=u,b=null,S[C]=M,A<M&&(A=M),M<_&&(_=M),C++,M=0;S[C]=M,A<M&&(A=M),M<_&&(_=M);var L=i.local,R=i.global,O=i.lines;return L.x=r*m,L.y=o*m,L.width=a*m,L.height=h*m,R.x=t.x-t.displayOriginX+r*x,R.y=t.y-t.displayOriginY+o*w,R.width=a*x,R.height=h*w,O.shortest=_,O.longest=A,O.lengths=S,e&&(L.x=Math.round(L.x),L.y=Math.round(L.y),L.width=Math.round(L.width),L.height=Math.round(L.height),R.x=Math.round(R.x),R.y=Math.round(R.y),R.width=Math.round(R.width),R.height=Math.round(R.height),O.shortest=Math.round(_),O.longest=Math.round(A)),i}},function(t,e,i){var n=i(0),s=i(15),r=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){var t=this.systems.events;t.on("preupdate",this.preUpdate,this),t.on("update",this.update,this),t.once("shutdown",this.shutdown,this)},add:function(t){return-1===this._list.indexOf(t)&&-1===this._pendingInsertion.indexOf(t)&&this._pendingInsertion.push(t),t},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,n;for(i=0;i<t;i++){n=this._pendingRemoval[i];var s=this._list.indexOf(n);-1<s&&this._list.splice(s,1)}this._list=this._list.concat(this._pendingInsertion.splice(0)),this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){for(var i=0;i<this._list.length;i++){var n=this._list[i];n.active&&n.preUpdate.call(n,t,e)}},remove:function(t){var e=this._list.indexOf(t);return-1!==e&&this._list.splice(e,1),t},removeAll:function(){for(var t=this._list.length;t--;)this.remove(this._list[t]);return this},shutdown:function(){for(var t=this._list.length;t--;)this._list[t].destroy(!0);for(t=this._pendingRemoval.length;t--;)this._pendingRemoval[t].destroy(!0);for(t=this._pendingInsertion.length;t--;)this._pendingInsertion[t].destroy(!0);this._list.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var e=this.systems.events;e.off("preupdate",this.preUpdate,this),e.off("update",this.update,this),e.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null},length:{get:function(){return this._list.length}}});s.register("UpdateList",r,"updateList"),t.exports=r},function(t,e){t.exports=function(t,e,i){if(e!==i){var n=t.indexOf(e),s=t.indexOf(i);if(n<0||s<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[s]=e,t}}},function(t,e,i){var a=i(62);t.exports=function(t,e,i,n,s){if(void 0===n&&(n=0),void 0===s&&(s=t.length),a(t,n,s))for(var r=n;r<s;r++){var o=t[r];o.hasOwnProperty(e)&&(o[e]=i)}return t}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&0<i&&(t.splice(i,1),t.unshift(e)),e}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),s=t.indexOf(i);return-1!==n&&-1===s&&(t[n]=i,!0)}},function(t,e,i){var s=i(91);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return s(t,n)}},function(t,e,i){var l=i(62);t.exports=function(t,e,i,n,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),l(t,e,i)){var r=i-e,o=t.splice(e,r);if(n)for(var a=0;a<o.length;a++){var h=o[a];n.call(s,h)}return o}return[]}},function(t,e,i){var r=i(91);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var s=r(t,e);return i&&i.call(n,s),s}},function(t,e,i){var o=i(314);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var n=[],s=Math.max(o((e-t)/(i||1)),0),r=0;r<s;r++)n.push(t),t+=i;return n}},function(t,e){t.exports=function(t,e,i,n){for(var s=[],r=t;r<=e;r++)if(i||n){var o=i?i+r.toString():r.toString();n&&(o=o.concat(n)),s.push(o)}else s.push(r);return s}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i<t.length-2){var n=t[i+1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(0<i){var n=t[i-1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e,i){var a=i(62);t.exports=function(t,e,i,n,s){if(void 0===n&&(n=0),void 0===s&&(s=t.length),a(t,n,s))for(var r=n;r<s;r++){var o=t[r];if(!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o}return null}},function(t,e,i){var h=i(62);t.exports=function(t,e,i,n,s){void 0===n&&(n=0),void 0===s&&(s=t.length);var r=[];if(h(t,n,s))for(var o=n;o<s;o++){var a=t[o];(!e||e&&void 0===i&&a.hasOwnProperty(e)||e&&void 0!==i&&a[e]===i)&&r.push(a)}return r}},function(t,e,i){var a=i(62);t.exports=function(t,e,i,n,s){if(void 0===n&&(n=0),void 0===s&&(s=t.length),a(t,n,s)){var r,o=[null];for(r=5;r<arguments.length;r++)o.push(arguments[r]);for(r=n;r<s;r++)o[0]=t[r],e.apply(i,o)}return t}},function(t,e){t.exports=function(t,e,i){var n,s=[null];for(n=3;n<arguments.length;n++)s.push(arguments[n]);for(n=0;n<t.length;n++)s[0]=t[n],e.apply(i,s);return t}},function(t,e,i){var a=i(62);t.exports=function(t,e,i,n,s){void 0===n&&(n=0),void 0===s&&(s=t.length);var r=0;if(a(t,n,s))for(var o=n;o<s;o++)t[o][e]===i&&r++;return r}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i<t.length&&(t.splice(i,1),t.push(e)),e}},function(t,e){t.exports=function(t,e,i,n,s,r){if(void 0===i&&(i=0),void 0===r&&(r=t),0<n){var o=n-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(r,e),e):null;for(var a=e.length-1;0<=a;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;0<n&&o<a&&(e.splice(o),a=o);for(var h=a-1;0<=h;h--){var l=e[h];t.splice(i,0,l),s&&s.call(r,l)}return e}},function(t,e){t.exports=function(t,e,i,n,s){if(void 0===s&&(s=t),0<i){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(s,e),e):null;for(var o=e.length-1;0<=o;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;0<i&&r<o&&(e.splice(r),o=r);for(var a=0;a<o;a++){var h=e[a];t.push(h),n&&n.call(s,h)}return e}},function(t,e,i){var n=i(111);t.exports=function(t){return n(t,-90)}},function(t,e,i){var n=i(111);t.exports=function(t){return n(t,90)}},function(t,e,i){var n=i(111);t.exports=function(t){return n(t,180)}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].reverse();return t}},function(t,e,i){var o=i(179),a=i(163);t.exports=function(t){var e="";if(!a(t))return e;for(var i=0;i<t.length;i++){for(var n=0;n<t[i].length;n++){var s=t[i][n].toString();e+="undefined"!==s?o(s,2):"?",n<t[i].length-1&&(e+=" |")}if(i<t.length-1){e+="\n";for(var r=0;r<t[i].length;r++)e+="---",r<t[i].length-1&&(e+="+");e+="\n"}}return e}},function(t,e,i){t.exports={CheckMatrix:i(163),MatrixToString:i(873),ReverseColumns:i(872),ReverseRows:i(871),Rotate180:i(870),RotateLeft:i(869),RotateMatrix:i(111),RotateRight:i(868),TransposeMatrix:i(315)}},function(t,e,i){var n=i(0),s=i(112),r=i(15),o=i(110),a=new n({Extends:s,initialize:function(t){s.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.systems.events.once("destroy",this.destroy,this)},start:function(){this.systems.events.once("shutdown",this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(o.inplace(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},sortGameObjects:function(t){return void 0===t&&(t=this.list),this.scene.sys.depthSort(),t.sort(this.sortIndexHandler.bind(this))},getTopGameObject:function(t){return this.sortGameObjects(t),t[t.length-1]},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list.length;t--;)this.list[t].destroy(!0);this.list.length=0,this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("DisplayList",a,"displayList"),t.exports=a},function(t,e,i){var n={DisplayList:i(875),GameObjectCreator:i(13),GameObjectFactory:i(5),UpdateList:i(847),Components:i(14),BuildGameObject:i(28),BuildGameObjectAnimation:i(311),GameObject:i(19),BitmapText:i(109),Blitter:i(161),Container:i(160),DynamicBitmapText:i(159),Graphics:i(158),Group:i(88),Image:i(87),Particles:i(823),PathFollower:i(296),RenderTexture:i(154),RetroFont:i(814),Sprite:i(61),Text:i(153),TileSprite:i(152),Zone:i(125),Shape:i(27),Arc:i(293),Curve:i(292),Ellipse:i(291),Grid:i(290),IsoBox:i(289),IsoTriangle:i(288),Line:i(287),Polygon:i(286),Rectangle:i(281),Star:i(280),Triangle:i(279),Factories:{Blitter:i(769),Container:i(768),DynamicBitmapText:i(767),Graphics:i(766),Group:i(765),Image:i(764),Particles:i(763),PathFollower:i(762),RenderTexture:i(761),Sprite:i(760),StaticBitmapText:i(759),Text:i(758),TileSprite:i(757),Zone:i(756),Arc:i(755),Curve:i(754),Ellipse:i(753),Grid:i(752),IsoBox:i(751),IsoTriangle:i(750),Line:i(749),Polygon:i(748),Rectangle:i(747),Star:i(746),Triangle:i(745)},Creators:{Blitter:i(744),Container:i(743),DynamicBitmapText:i(742),Graphics:i(741),Group:i(740),Image:i(739),Particles:i(738),RenderTexture:i(737),Sprite:i(736),StaticBitmapText:i(735),Text:i(734),TileSprite:i(733),Zone:i(732)}};n.Mesh=i(108),n.Quad=i(149),n.Factories.Mesh=i(728),n.Factories.Quad=i(727),n.Creators.Mesh=i(726),n.Creators.Quad=i(725),n.Light=i(276),i(275),i(724),t.exports=n},function(t,e){t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")}),e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit("hidden"):i.emit("visible")},!1),window.onblur=function(){i.emit("blur")},window.onfocus=function(){i.emit("focus")},window.focus&&t.config.autoFocus&&(window.focus(),t.canvas.addEventListener("mousedown",function(){window.focus()},{passive:!0})),t.canvas&&(t.canvas.onmouseout=function(){t.isOver=!1,i.emit("mouseout")},t.canvas.onmouseover=function(){t.isOver=!0,i.emit("mouseover")})}},function(t,e,i){var n=i(0),s=i(4),r=i(1),o=i(341),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=this.frame=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=Math.min(this._target,this.deltaHistory[e]);this.delta=0,this.deltaIndex=0,this._coolDown=this.panicMax},start:function(t){if(this.started)return this;this.started=!0,this.running=!0;for(var e=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=this._target;this.resetDelta(),this.startTime=window.performance.now(),this.callback=t,this.raf.start(this.step.bind(this),this.forceSetTimeOut)},step:function(t){this.frame++;var e=t-this.lastTime;e<0&&(e=0),this.rawDelta=e;var i=this.deltaIndex,n=this.deltaHistory,s=this.deltaSmoothingMax,r=e;(0<this._coolDown||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;a<s;a++)o+=n[a];o/=s,this.delta=o,this.time+=this.rawDelta,t>this.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t},tick:function(){this.step(window.performance.now())},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime=window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step(window.performance.now())},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e){var p=0,g=function(t,e,i,n){var s=p-n.y-n.height;t.add(i,e,n.x,s,n.width,n.height)};t.exports=function(t,e,i){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height),p=n.height;for(var s=i.split("\n"),r=/^[ ]*(- )*(\w+)+[: ]+(.*)/,o="",a="",h={x:0,y:0,width:0,height:0},l=0;l<s.length;l++){var u=s[l].match(r);if(u){var c="- "===u[1],d=u[2],f=u[3];if(c&&(a!==o&&(g(t,e,a,h),o=a),h={x:0,y:0,width:0,height:0}),"name"!==d)switch(d){case"x":case"y":case"width":case"height":h[d]=parseInt(f,10)}else a=f}}return a!==o&&g(t,e,a,h),t}},function(t,e,i){var X=i(2);t.exports=function(t,e,i){var n=X(i,"frameWidth",null),s=X(i,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var r,o=X(i,"startFrame",0),a=X(i,"endFrame",-1),h=X(i,"margin",0),l=X(i,"spacing",0),u=e.cutX,c=e.cutY,d=e.cutWidth,f=e.cutHeight,p=e.realWidth,g=e.realHeight,v=Math.floor((p-h+l)/(n+l)),y=Math.floor((g-h+l)/(s+l)),m=v*y,x=e.x,w=n-x,b=n-(p-d-x),T=e.y,S=s-T,_=s-(g-f-T);(m<o||o<-m)&&(o=0),o<0&&(o=m+o),-1!==a&&(m=o+(a+1));for(var A=h,C=h,M=0,P=e.sourceIndex,E=0;E<y;E++){for(var k=0===E,F=E===y-1,L=0;L<v;L++){var R=0===L,O=L===v-1;if(r=t.add(M,P,u+A,c+C,n,s),R||k||O||F){var D=R?x:0,B=k?T:0,I=n,Y=s;R?I=w:O&&(I=b),k?Y=S:F&&(Y=_),r.cutWidth=I,r.cutHeight=Y,r.setTrim(n,s,D,B,I,Y)}A+=l,A+=R?w:O||n,M++}A=h,C+=l,C+=k?S:F?_:s}return t}},function(t,e,i){var T=i(2);t.exports=function(t,e,i,n,s,r,o){var a=T(o,"frameWidth",null),h=T(o,"frameHeight",a);if(null===a)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var l=t.source[e];t.add("__BASE",e,0,0,l.width,l.height);var u=T(o,"startFrame",0),c=T(o,"endFrame",-1),d=T(o,"margin",0),f=T(o,"spacing",0),p=Math.floor((s-d+f)/(a+f))*Math.floor((r-d+f)/(h+f));0===p&&console.warn("SpriteSheet frame dimensions will result in zero frames."),(p<u||u<-p)&&(u=0),u<0&&(u=p+u),-1!==c&&(p=u+(c+1));for(var g=d,v=d,y=0,m=0,x=0;x<p;x++){m=y=0;var w=g+a,b=v+h;s<w&&(y=w-s),r<b&&(m=b-r),t.add(x,e,i+g,n+v,a-y,h-m),(g+=a+f)+a>s&&(g=d,v+=h+f)}return t}},function(t,e,i){var l=i(63);t.exports=function(t,e,i){if(i.frames){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);var s,r=i.frames;for(var o in r){var a=r[o];s=t.add(o,e,a.frame.x,a.frame.y,a.frame.w,a.frame.h),a.trimmed&&s.setTrim(a.sourceSize.w,a.sourceSize.h,a.spriteSourceSize.x,a.spriteSourceSize.y,a.spriteSourceSize.w,a.spriteSourceSize.h),a.rotated&&(s.rotated=!0,s.updateUVsInverted()),s.customData=l(a)}for(var h in i)"frames"!==h&&(Array.isArray(i[h])?t.customData[h]=i[h].slice(0):t.customData[h]=i[h]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){var l=i(63);t.exports=function(t,e,i){if(i.frames||i.textures){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s,r=Array.isArray(i.textures)?i.textures[e].frames:i.frames,o=0;o<r.length;o++){var a=r[o];s=t.add(a.filename,e,a.frame.x,a.frame.y,a.frame.w,a.frame.h),a.trimmed&&s.setTrim(a.sourceSize.w,a.sourceSize.h,a.spriteSourceSize.x,a.spriteSourceSize.y,a.spriteSourceSize.w,a.spriteSourceSize.h),a.rotated&&(s.rotated=!0,s.updateUVsInverted()),a.anchor&&(s.customPivot=!0,s.pivotX=a.anchor.x,s.pivotY=a.anchor.y),s.customData=l(a)}for(var h in i)"frames"!==h&&(Array.isArray(i[h])?t.customData[h]=i[h].slice(0):t.customData[h]=i[h]);return t}console.warn("Invalid Texture Atlas JSON Array")}},function(t,e){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},function(t,e){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s,r=i.getElementsByTagName("SubTexture"),o=0;o<r.length;o++){var a=r[o].attributes,h=a.name.value,l=parseInt(a.x.value,10),u=parseInt(a.y.value,10),c=parseInt(a.width.value,10),d=parseInt(a.height.value,10);if(s=t.add(h,e,l,u,c,d),a.frameX){var f=Math.abs(parseInt(a.frameX.value,10)),p=Math.abs(parseInt(a.frameY.value,10)),g=parseInt(a.frameWidth.value,10),v=parseInt(a.frameHeight.value,10);s.setTrim(c,d,f,p,g,v)}}return t}console.warn("Invalid Texture Atlas XML given")}},function(t,e,i){var n=i(0),h=i(37),s=i(117),r=i(165),o=new n({Extends:r,initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.add("__BASE",0,0,0,n,s),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=n,this.height=s,this.imageData=this.context.getImageData(0,0,n,s),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},getPixel:function(t,e,i){i||(i=new h);var n=~~(t+e*this.width);n*=4;var s=this.data[n],r=this.data[++n],o=this.data[++n],a=this.data[++n];return i.setTo(s,r,o,a)},refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(){return this.context.clearRect(0,0,this.width,this.height),this.update()},setSize:function(t,e){return void 0===e&&(e=t),t===this.width&&e===this.height||(this.canvas.width=t,this.canvas.height=e,this._source.width=t,this._source.height=e,this._source.isPowerOf2=s(t,e),this.frames.__BASE.setSize(t,e,0,0),this.refresh()),this}});t.exports=o},function(t,e,i){t.exports={game:"game",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e,i){var n=i(2);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){var r=i(2),o=i(327);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=r(t.settings,"physics",!1);if(e||i){var n=[];if(e&&n.push(o(e+"Physics")),i)for(var s in i)s=o(s.concat("Physics")),-1===n.indexOf(s)&&n.push(s);return n}}},function(t,e,i){var l=i(26);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===l.CANVAS?i="Canvas":e.renderType===l.HEADLESS&&(i="Headless");var n,s=e.audio,r=t.device.audio;if(n=!r.webAudio||s&&s.disableWebAudio?s&&s.noAudio||!r.webAudio&&!r.audioData?"No Audio":"HTML5 Audio":"Web Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+l.VERSION+" / https://phaser.io");else{var o,a="",h=[a];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach(function(t){a=a.concat("%c "),h.push("background: "+t),o=t}),h[h.length-1]="color: "+e.bannerTextColor+"; background: "+o):(a=a.concat("%c "),h.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),h.push("background: #fff"),e.gameTitle&&(a=a.concat(e.gameTitle),e.gameVersion&&(a=a.concat(" v"+e.gameVersion)),e.hidePhaser||(a=a.concat(" / "))),e.hidePhaser||(a=a.concat("Phaser v"+l.VERSION+" ("+i+" | "+n+")")),a=a.concat(" %c "+e.gameURL),h[0]=a,console.log.apply(console,h)}}}},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform mat4 uModelMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{","    gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);","","    outTexCoord = inTexCoord;","    outTint = inTint;","    outTintEffect = inTintEffect;","}","",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main()","{","    vec4 texture = texture2D(uMainSampler, outTexCoord);","    vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);","    vec4 color = texture;","","    if (outTintEffect == 0.0)","    {","        //  Multiply texture tint","        color = texture * texel;","    }","    else if (outTintEffect == 1.0)","    {","        //  Solid color + texture alpha","        color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);","        color.a = texture.a * texel.a;","    }","    else if (outTintEffect == 2.0)","    {","        //  Solid color, no texture","        color = texel;","    }","","    gl_FragColor = color;","}",""].join("\n")},function(t,e){var i={modelMatrixDirty:!1,viewMatrixDirty:!1,projectionMatrixDirty:!1,modelMatrix:null,viewMatrix:null,projectionMatrix:null,mvpInit:function(){return this.modelMatrixDirty=!0,this.viewMatrixDirty=!0,this.projectionMatrixDirty=!0,this.modelMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this},mvpUpdate:function(){var t=this.program;return this.modelMatrixDirty&&(this.renderer.setMatrix4(t,"uModelMatrix",!1,this.modelMatrix),this.modelMatrixDirty=!1),this.viewMatrixDirty&&(this.renderer.setMatrix4(t,"uViewMatrix",!1,this.viewMatrix),this.viewMatrixDirty=!1),this.projectionMatrixDirty&&(this.renderer.setMatrix4(t,"uProjectionMatrix",!1,this.projectionMatrix),this.projectionMatrixDirty=!1),this},modelIdentity:function(){var t=this.modelMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.modelMatrixDirty=!0,this},modelScale:function(t,e,i){var n=this.modelMatrix;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this.modelMatrixDirty=!0,this},modelTranslate:function(t,e,i){var n=this.modelMatrix;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this.modelMatrixDirty=!0,this},modelRotateX:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this.modelMatrixDirty=!0,this},modelRotateY:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this.modelMatrixDirty=!0,this},modelRotateZ:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this.modelMatrixDirty=!0,this},viewIdentity:function(){var t=this.viewMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.viewMatrixDirty=!0,this},viewScale:function(t,e,i){var n=this.viewMatrix;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this.viewMatrixDirty=!0,this},viewTranslate:function(t,e,i){var n=this.viewMatrix;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this.viewMatrixDirty=!0,this},viewRotateX:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this.viewMatrixDirty=!0,this},viewRotateY:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this.viewMatrixDirty=!0,this},viewRotateZ:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this.viewMatrixDirty=!0,this},viewLoad2D:function(t){var e=this.viewMatrix;return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=0,e[4]=t[2],e[5]=t[3],e[6]=0,e[7]=0,e[8]=t[4],e[9]=t[5],e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this.viewMatrixDirty=!0,this},viewLoad:function(t){var e=this.viewMatrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this.viewMatrixDirty=!0,this},projIdentity:function(){var t=this.projectionMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.projectionMatrixDirty=!0,this},projOrtho:function(t,e,i,n,s,r){var o=this.projectionMatrix,a=1/(t-e),h=1/(i-n),l=1/(s-r);return o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this.projectionMatrixDirty=!0,this},projPersp:function(t,e,i,n){var s=this.projectionMatrix,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this.projectionMatrixDirty=!0,this}};t.exports=i},function(t,e){t.exports=["#define SHADER_NAME PHASER_FORWARD_DIFFUSE_FS","","precision mediump float;","","struct Light","{","    vec2 position;","    vec3 color;","    float intensity;","    float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{","    vec3 finalColor = vec3(0.0, 0.0, 0.0);","    vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.rgb * outTint.a, outTint.a);","    vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;","    vec3 normal = normalize(vec3(normalMap * 2.0 - 1.0));","    vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;","","    for (int index = 0; index < kMaxLights; ++index)","    {","        Light light = uLights[index];","        vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);","        vec3 lightNormal = normalize(lightDir);","        float distToSurf = length(lightDir) * uCamera.w;","        float diffuseFactor = max(dot(normal, lightNormal), 0.0);","        float radius = (light.radius / res.x * uCamera.w) * uCamera.w;","        float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);","        vec3 diffuse = light.color * diffuseFactor;","        finalColor += (attenuation * diffuse) * light.intensity;","    }","","    vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);","    gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main()","{","    gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main()","{","    vec2 uv = gl_FragCoord.xy / uResolution;","    vec4 mainColor = texture2D(uMainSampler, uv);","    vec4 maskColor = texture2D(uMaskSampler, uv);","    float alpha = mainColor.a;","","    if (!uInvertMaskAlpha)","    {","        alpha *= (maskColor.a);","    }","    else","    {","        alpha *= (1.0 - maskColor.a);","    }","","    gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n")},function(t,e,s){var r=s(348),o=s(24),a=s(26),h=s(168);t.exports=function(t){var e,i,n=t.config;if(n.renderType!==a.HEADLESS)if(n.renderType===a.CANVAS||n.renderType!==a.CANVAS&&!h.webGL){if(!h.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");n.renderType=a.CANVAS}else n.renderType=a.WEBGL;n.antialias||o.disableSmoothing(),n.canvas?(t.canvas=n.canvas,t.canvas.width=t.config.width,t.canvas.height=t.config.height):t.canvas=o.create(t,n.width*n.resolution,n.height*n.resolution,n.renderType),n.canvasStyle&&(t.canvas.style=n.canvasStyle),n.antialias||r.setCrisp(t.canvas),t.canvas.style.width=(n.width*n.zoom).toString()+"px",t.canvas.style.height=(n.height*n.zoom).toString()+"px",n.renderType!==a.HEADLESS&&(e=s(426),i=s(423),n.renderType===a.WEBGL?t.renderer=new i(t):(t.renderer=new e(t),t.context=t.renderer.gameContext))}},function(t,e){var s={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){var t,e=["requestFullscreen","requestFullScreen","webkitRequestFullscreen","webkitRequestFullScreen","msRequestFullscreen","msRequestFullScreen","mozRequestFullScreen","mozRequestFullscreen"],i=document.createElement("div");for(t=0;t<e.length;t++)if(i[e[t]]){s.available=!0,s.request=e[t];break}var n=["cancelFullScreen","exitFullscreen","webkitCancelFullScreen","webkitExitFullscreen","msCancelFullScreen","msExitFullscreen","mozCancelFullScreen","mozExitFullscreen"];if(s.available)for(t=0;t<n.length;t++)if(document[n[t]]){s.cancel=n[t];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&(s.keyboard=!0),s}()},function(t,e){var i={h264Video:!1,hlsVideo:!1,mp4Video:!1,oggVideo:!1,vp9Video:!1,webmVideo:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.oggVideo=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264Video=!0,i.mp4Video=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webmVideo=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9Video=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hlsVideo=!0))}catch(t){}return i}()},function(t,e,i){var s=i(118),r={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(r.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(r.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(r.mp3=!0),t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(r.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(r.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(r.webm=!0),""!==t.canPlayType('audio/mp4;codecs="ec-3"')))if(s.edge)r.dolby=!0;else if(s.safari&&9<=s.safariVersion&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),n=parseInt(RegExp.$2,10);(10===i&&11<=n||10<i)&&(r.dolby=!0)}}catch(t){}return r}()},function(t,e,i){var n=i(92),s=i(118),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&1<=navigator.maxTouchPoints)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),n.cocoonJS||("onwheel"in window||s.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll")),r)},function(t,e,i){var n=i(0),a=i(26),h=i(340),l=i(2),u=i(4),c=i(8),d=i(16),f=i(1),p=i(167),g=i(178),s=new n({initialize:function(t){void 0===t&&(t={}),this.width=u(t,"width",1024),this.height=u(t,"height",768),this.zoom=u(t,"zoom",1),this.resolution=u(t,"resolution",1),this.parent=u(t,"parent",null),this.scaleMode=u(t,"scaleMode",0),this.expandParent=u(t,"expandParent",!1),this.minWidth=u(t,"minWidth",0),this.maxWidth=u(t,"maxWidth",0),this.minHeight=u(t,"minHeight",0),this.maxHeight=u(t,"maxHeight",0);var e=u(t,"scale",null);e&&(this.width=u(e,"width",this.width),this.height=u(e,"height",this.height),this.zoom=u(e,"zoom",this.zoom),this.resolution=u(e,"resolution",this.resolution),this.parent=u(e,"parent",this.parent),this.scaleMode=u(e,"mode",this.scaleMode),this.expandParent=u(e,"mode",this.expandParent),this.minWidth=u(e,"min.width",this.minWidth),this.maxWidth=u(e,"max.width",this.maxWidth),this.minHeight=u(e,"min.height",this.minHeight),this.maxHeight=u(e,"max.height",this.maxHeight)),this.renderType=u(t,"type",a.AUTO),this.canvas=u(t,"canvas",null),this.context=u(t,"context",null),this.canvasStyle=u(t,"canvasStyle",null),this.sceneConfig=u(t,"scene",null),this.seed=u(t,"seed",[(Date.now()*Math.random()).toString()]),d.RND.init(this.seed),this.gameTitle=u(t,"title",""),this.gameURL=u(t,"url","https://phaser.io"),this.gameVersion=u(t,"version",""),this.autoFocus=u(t,"autoFocus",!0),this.domCreateContainer=u(t,"dom.createContainer",!1),this.domBehindCanvas=u(t,"dom.behindCanvas",!1),this.inputKeyboard=u(t,"input.keyboard",!0),this.inputKeyboardEventTarget=u(t,"input.keyboard.target",window),this.inputMouse=u(t,"input.mouse",!0),this.inputMouseEventTarget=u(t,"input.mouse.target",null),this.inputMouseCapture=u(t,"input.mouse.capture",!0),this.inputTouch=u(t,"input.touch",h.input.touch),this.inputTouchEventTarget=u(t,"input.touch.target",null),this.inputTouchCapture=u(t,"input.touch.capture",!0),this.inputActivePointers=u(t,"input.activePointers",1),this.inputGamepad=u(t,"input.gamepad",!1),this.inputGamepadEventTarget=u(t,"input.gamepad.target",window),this.disableContextMenu=u(t,"disableContextMenu",!1),this.audio=u(t,"audio"),this.hideBanner=!1===u(t,"banner",null),this.hidePhaser=u(t,"banner.hidePhaser",!1),this.bannerTextColor=u(t,"banner.text","#ffffff"),this.bannerBackgroundColor=u(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=u(t,"fps",null);var i=u(t,"render",t);this.autoResize=u(i,"autoResize",!0),this.antialias=u(i,"antialias",!0),this.roundPixels=u(i,"roundPixels",!1),this.pixelArt=u(i,"pixelArt",!1),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=u(i,"transparent",!1),this.clearBeforeRender=u(i,"clearBeforeRender",!0),this.premultipliedAlpha=u(i,"premultipliedAlpha",!0),this.preserveDrawingBuffer=u(i,"preserveDrawingBuffer",!1),this.failIfMajorPerformanceCaveat=u(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=u(i,"powerPreference","default"),this.batchSize=u(i,"batchSize",2e3),this.maxLights=u(i,"maxLights",10);var n=u(t,"backgroundColor",0);this.backgroundColor=g(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=u(t,"callbacks.preBoot",f),this.postBoot=u(t,"callbacks.postBoot",f),this.physics=u(t,"physics",{}),this.defaultPhysicsSystem=u(this.physics,"default",!1),this.loaderBaseURL=u(t,"loader.baseURL",""),this.loaderPath=u(t,"loader.path",""),this.loaderMaxParallelDownloads=u(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=u(t,"loader.crossOrigin",void 0),this.loaderResponseType=u(t,"loader.responseType",""),this.loaderAsync=u(t,"loader.async",!0),this.loaderUser=u(t,"loader.user",""),this.loaderPassword=u(t,"loader.password",""),this.loaderTimeout=u(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var s=u(t,"plugins",null),r=p.DefaultScene;s&&(Array.isArray(s)?this.defaultPlugins=s:c(s)&&(this.installGlobalPlugins=l(s,"global",[]),this.installScenePlugins=l(s,"scene",[]),Array.isArray(s.default)?r=s.default:Array.isArray(s.defaultMerge)&&(r=r.concat(s.defaultMerge)))),this.defaultPlugins=r;var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=u(t,"images.default",o+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=u(t,"images.missing",o+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=a.WEBGL:window.FORCE_CANVAS&&(this.renderType=a.CANVAS))}});t.exports=s},function(t,e,i){var n=i(169),s=i(381),r=i(379),o=i(24),a=i(0),h=i(903),l=i(898),u=i(123),c=i(891),d=i(340),f=i(344),p=i(11),g=i(338),v=i(15),y=i(331),m=i(329),x=i(325),w=i(318),b=i(878),T=i(877),S=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new p,this.anims=new s(this),this.textures=new w(this),this.cache=new r(this),this.registry=new u(this),this.input=new g(this,this.config),this.scene=new m(this,this.config.sceneConfig),this.device=d,this.sound=x.create(this),this.loop=new b(this,this.config.fps),this.plugins=new y(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isOver=!0,f(this.boot.bind(this))},boot:function(){v.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),l(this),c(this),n(this.canvas,this.config.parent),this.events.emit("boot"),this.events.once("texturesready",this.texturesReady,this)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit("ready"),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),T(this);var t=this.events;t.on("hidden",this.onHidden,this),t.on("visible",this.onVisible,this),t.on("blur",this.onBlur,this),t.on("focus",this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e);var n=this.renderer;n.preRender(),i.emit("prerender",n,t,e),this.scene.render(n),n.postRender(),i.emit("postrender",n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit("prestep",t,e),i.emit("step",t,e),this.scene.update(t,e),i.emit("poststep",t,e),i.emit("prerender"),i.emit("postrender")},onHidden:function(){this.loop.pause(),this.events.emit("pause")},onVisible:function(){this.loop.resume(),this.events.emit("resume")},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},resize:function(t,e){this.config.width=t,this.config.height=e,this.renderer.resize(t,e),this.input.resize(),this.scene.resize(t,e),this.events.emit("resize",t,e)},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit("destroy"),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=S},function(t,e,i){var n=i(0),s=i(11),r=i(15),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){t.exports={EventEmitter:i(905)}},function(t,e){var i,n,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(i===setTimeout)return setTimeout(e,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,l=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length&&f())}function f(){if(!u){var t=a(d);u=!0;for(var e=l.length;e;){for(h=l,l=[];++c<e;)h&&h[c].run();c=-1,e=l.length}h=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new p(t,e)),1!==l.length||u||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=g,s.addListener=g,s.once=g,s.off=g,s.removeListener=g,s.removeAllListeners=g,s.emit=g,s.prependListener=g,s.prependOnceListener=g,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(t,e,i){var n={AddToDOM:i(169),DOMContentLoaded:i(344),ParseXML:i(343),RemoveFromDOM:i(342),RequestAnimationFrame:i(341)};t.exports=n},function(t,e,i){t.exports={BitmapMask:i(394),GeometryMask:i(393)}},function(t,e,i){var r=i(346);t.exports=function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s="#"),"#"===s?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+r(n)+r(t)+r(e)+r(i)}},function(t,e,i){var n=i(170),s=i(37);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var l=i(119),o=function(t,e,i,n,s,r,o,a){void 0===o&&(o=100),void 0===a&&(a=0);var h=a/o;return{r:l(t,n,h),g:l(e,s,h),b:l(i,r,h)}};t.exports={RGBWithRGB:o,ColorWithRGB:function(t,e,i,n,s,r){return void 0===s&&(s=100),void 0===r&&(r=0),o(t.r,t.g,t.b,e,i,n,s,r)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),o(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var s=i(176);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},function(t,e,i){var h=i(37),l=i(345);t.exports=function(t,e,i){var n=i,s=i,r=i;if(0!==e){var o=i<.5?i*(1+e):i+e-i*e,a=2*i-o;n=l(a,o,t+1/3),s=l(a,o,t),r=l(a,o,t-1/3)}return(new h).setGLTo(n,s,r,1)}},function(t,e){t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return 16777215<t&&(e.a=t>>>24),e}},function(t,e){t.exports=function(e,i){return void 0===i&&(i="none"),["-webkit-","-khtml-","-moz-","-ms-",""].forEach(function(t){e.style[t+"user-select"]=i}),e.style["-webkit-touch-callout"]=i,e.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",e}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},function(t,e,i){t.exports={CanvasInterpolation:i(348),CanvasPool:i(24),Smoothing:i(120),TouchAction:i(917),UserSelect:i(916)}},function(t,e){t.exports=function(t){return t.height*t.originY}},function(t,e){t.exports=function(t){return t.width*t.originX}},function(t,e,i){t.exports={CenterOn:i(411),GetBottom:i(48),GetCenterX:i(75),GetCenterY:i(72),GetLeft:i(46),GetOffsetX:i(920),GetOffsetY:i(919),GetRight:i(44),GetTop:i(42),SetBottom:i(47),SetCenterX:i(74),SetCenterY:i(73),SetLeft:i(45),SetRight:i(43),SetTop:i(41)}},function(t,e,i){var s=i(44),r=i(42),o=i(47),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,s(e)+i),o(t,r(e)-n),t}},function(t,e,i){var s=i(46),r=i(42),o=i(47),a=i(45);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,s(e)-i),o(t,r(e)-n),t}},function(t,e,i){var s=i(75),r=i(42),o=i(47),a=i(74);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,s(e)+i),o(t,r(e)-n),t}},function(t,e,i){var s=i(44),r=i(42),o=i(45),a=i(41);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,s(e)+i),a(t,r(e)-n),t}},function(t,e,i){var s=i(72),r=i(44),o=i(73),a=i(45);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)+i),o(t,s(e)+n),t}},function(t,e,i){var s=i(48),r=i(44),o=i(47),a=i(45);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)+i),o(t,s(e)+n),t}},function(t,e,i){var s=i(46),r=i(42),o=i(43),a=i(41);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,s(e)-i),a(t,r(e)-n),t}},function(t,e,i){var s=i(72),r=i(46),o=i(73),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)-i),o(t,s(e)+n),t}},function(t,e,i){var s=i(48),r=i(46),o=i(47),a=i(43);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),a(t,r(e)-i),o(t,s(e)+n),t}},function(t,e,i){var s=i(48),r=i(44),o=i(43),a=i(41);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,r(e)+i),a(t,s(e)+n),t}},function(t,e,i){var s=i(48),r=i(46),o=i(45),a=i(41);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,r(e)-i),a(t,s(e)+n),t}},function(t,e,i){var s=i(48),r=i(75),o=i(74),a=i(41);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),o(t,r(e)+i),a(t,s(e)+n),t}},function(t,e,i){t.exports={BottomCenter:i(933),BottomLeft:i(932),BottomRight:i(931),LeftBottom:i(930),LeftCenter:i(929),LeftTop:i(928),RightBottom:i(927),RightCenter:i(926),RightTop:i(925),TopCenter:i(924),TopLeft:i(923),TopRight:i(922)}},function(t,e,i){t.exports={BottomCenter:i(415),BottomLeft:i(414),BottomRight:i(413),Center:i(412),LeftCenter:i(410),QuickSet:i(416),RightCenter:i(409),TopCenter:i(408),TopLeft:i(407),TopRight:i(406)}},function(t,e,i){var n=i(193),s=i(20),r={In:i(935),To:i(934)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={Align:i(936),Bounds:i(921),Canvas:i(918),Color:i(347),Masks:i(909)}},function(t,e,i){var n=i(0),s=i(123),r=i(15),o=new n({Extends:s,initialize:function(t){s.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.events=this.systems.events,this.events.once("destroy",this.destroy,this)},start:function(){this.events.once("shutdown",this.shutdown,this)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){s.prototype.destroy.call(this),this.events.off("start",this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",o,"data"),t.exports=o},function(t,e,i){t.exports={DataManager:i(123),DataManagerPlugin:i(938)}},function(t,e,i){var n=i(0),s=i(3),r=new n({initialize:function(t,e){this.active=!1,this.p0=new s(t,e)},getPoint:function(t,e){return void 0===e&&(e=new s),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},function(t,e,i){var n=i(0),u=i(355),l=i(353),s=i(5),r=i(352),o=i(940),a=i(351),h=i(9),c=i(349),d=i(3),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new r(e,t)),this},cubicBezierTo:function(t,e,i,n,s,r){var o,a,h,l=this.getEndPoint();return h=t instanceof d?(o=t,a=e,i):(o=new d(i,n),a=new d(s,r),new d(t,e)),this.add(new u(l,o,a,h))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return r=t instanceof d?(s=t,e):(s=new d(i,n),new d(t,e)),this.add(new a(o,s,r))},draw:function(t,e){for(var i=0;i<this.curves.length;i++){var n=this.curves[i];n.active&&n.draw(t,e)}return t},ellipseTo:function(t,e,i,n,s,r){var o=new l(0,0,t,e,i,n,s,r),a=this.getEndPoint(this._tmpVec2A),h=o.getStartPoint(this._tmpVec2B);return a.subtract(h),o.x=a.x,o.y=a.y,this.add(o)},fromJSON:function(t){this.curves=[],this.cacheLengths=[],this.startPoint.set(t.x,t.y),this.autoClose=t.autoClose;for(var e=0;e<t.curves.length;e++){var i=t.curves[e];switch(i.type){case"LineCurve":this.add(r.fromJSON(i));break;case"EllipseCurve":this.add(l.fromJSON(i));break;case"SplineCurve":this.add(c.fromJSON(i));break;case"CubicBezierCurve":this.add(u.fromJSON(i));break;case"QuadraticBezierCurve":this.add(a.fromJSON(i))}}return this},getBounds:function(t,e){void 0===t&&(t=new h),void 0===e&&(e=16),t.x=Number.MAX_VALUE,t.y=Number.MAX_VALUE;for(var i=new h,n=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,r=0;r<this.curves.length;r++){var o=this.curves[r];o.active&&(o.getBounds(i,e),t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),n=Math.max(n,i.right),s=Math.max(s,i.bottom))}return t.right=n,t.bottom=s,t},getCurveLengths:function(){if(this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0;i<this.curves.length;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t},getEndPoint:function(t){return void 0===t&&(t=new d),0<this.curves.length?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s<n.length;){if(n[s]>=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n<this.curves.length;n++){var s=this.curves[n];if(s.active)for(var r=s.getResolution(t),o=s.getPoints(r),a=0;a<o.length;a++){var h=o[a];e&&e.equals(h)||(i.push(h),e=h)}}return this.autoClose&&1<i.length&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new r([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return this.add(new o(t,e))},toJSON:function(){for(var t=[],e=0;e<this.curves.length;e++)t.push(this.curves[e].toJSON());return{type:"Path",x:this.startPoint.x,y:this.startPoint.y,autoClose:this.autoClose,curves:t}},updateArcLengths:function(){this.cacheLengths=[],this.getCurveLengths()},destroy:function(){this.curves.length=0,this.cacheLengths.length=0,this.startPoint=void 0}});s.register("path",function(t,e){return new f(t,e)}),t.exports=f},function(t,e,i){t.exports={Path:i(941),CubicBezier:i(355),Curve:i(70),Ellipse:i(353),Line:i(352),QuadraticBezier:i(351),Spline:i(349)}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},function(t,e){t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},function(t,e){t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},function(t,e,i){t.exports={ARNE16:i(356),C64:i(946),CGA:i(945),JMP:i(944),MSX:i(943)}},function(t,e,i){t.exports={GenerateTexture:i(357),Palettes:i(947)}},function(t,e,i){var a=i(378),n=i(0),v=i(2),s=i(15),h=i(39),r=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.baseScale=1,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.systems.events.once("destroy",this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on("update",this.update,this),e.once("shutdown",this.shutdown,this)},add:function(t,e,i,n,s,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),void 0===s&&(s=!1),void 0===r&&(r="");var o=new a(t,e,i,n);return o.setName(r),o.setScene(this.scene),o.setRoundPixels(this.roundPixels),o.id=this.getNextID(),this.cameras.push(o),s&&(this.main=o),o},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var n=!1,s=0;s<t.length;s++){var r=t[s];r&&r.id===e&&(n=!0)}if(!n)return e;e<<=1}return 0},getTotal:function(t){void 0===t&&(t=!1);for(var e=0,i=this.cameras,n=0;n<i.length;n++){var s=i[n];(!t||t&&s.visible)&&e++}return e},fromJSON:function(t){Array.isArray(t)||(t=[t]);for(var e=this.scene.sys.game.config.width,i=this.scene.sys.game.config.height,n=0;n<t.length;n++){var s=t[n],r=v(s,"x",0),o=v(s,"y",0),a=v(s,"width",e),h=v(s,"height",i),l=this.add(r,o,a,h);l.name=v(s,"name",""),l.zoom=v(s,"zoom",1),l.rotation=v(s,"rotation",0),l.scrollX=v(s,"scrollX",0),l.scrollY=v(s,"scrollY",0),l.roundPixels=v(s,"roundPixels",!1),l.visible=v(s,"visible",!0);var u=v(s,"backgroundColor",!1);u&&l.setBackgroundColor(u);var c=v(s,"bounds",null);if(c){var d=v(c,"x",0),f=v(c,"y",0),p=v(c,"width",e),g=v(c,"height",i);l.setBounds(d,f,p,g)}}return this},getCamera:function(t){for(var e=this.cameras,i=0;i<e.length;i++)if(e[i].name===t)return e[i];return null},getCamerasBelowPointer:function(t){for(var e=this.cameras,i=t.x,n=t.y,s=[],r=0;r<e.length;r++){var o=e[r];o.visible&&o.inputEnabled&&h(o,i,n)&&s.unshift(o)}return s},remove:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0,n=this.cameras,s=0;s<t.length;s++){var r=n.indexOf(t[s]);-1!==r&&(e&&n[r].destroy(),n.splice(r,1),i++)}return!this.main&&n[0]&&(this.main=n[0]),i},render:function(t,e,i){for(var n=this.scene,s=this.cameras,r=this.baseScale,o=t.config.resolution,a=0;a<this.cameras.length;a++){var h=s[a];h.visible&&0<h.alpha&&(h.preRender(r,o),t.render(n,e,i,h))}},resetAll:function(){for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();return this.cameras=[],this.main=this.add(),this.main},update:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].update(t,e)},resize:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].setSize(t,e)},shutdown:function(){this.main=void 0;for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();this.cameras=[];var e=this.systems.events;e.off("update",this.update,this),e.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});s.register("CameraManager",r,"cameras"),t.exports=r},function(t,e,i){var n=i(23),s=i(0),a=i(174),r=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r){void 0===e&&(e=1e3),void 0===i&&(i=a.Linear),void 0===n&&(n=!1),void 0===s&&(s=null),void 0===r&&(r=this.camera.scene);var o=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=o.zoom,this.destination=t,"string"==typeof i&&a.hasOwnProperty(i)?this.ease=a[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=s,this._onUpdateScope=r,this.camera.emit("camerazoomstart",this.camera,this,e,t)),o},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._elapsed<this.duration?(this.camera.zoom=this.source+(this.destination-this.source)*this.ease(this.progress),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.camera.zoom)):(this.camera.zoom=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.destination),this.effectComplete()))},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit("camerazoomcomplete",this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=r},function(t,e,i){var o=i(23),n=i(0),s=i(3),r=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new s,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=s,this.camera.emit("camerashakestart",this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=o(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration){var i=this.intensity,n=this.camera._cw,s=this.camera._ch,r=this.camera.zoom;this._offsetX=(Math.random()*i.x*n*2-i.x*n)*r,this._offsetY=(Math.random()*i.y*s*2-i.y*s)*r,this.camera.roundPixels&&(this._offsetX|=0,this._offsetY|=0)}else this.effectComplete()},effectComplete:function(){this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit("camerashakecomplete",this.camera,this)},reset:function(){this.isRunning=!1,this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.intensity=null}});t.exports=r},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:1<=t?1:1/e*(1+(e*t|0))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e,i){var a=i(23),n=i(0),s=i(3),h=i(174),r=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new s,this.current=new s,this.destination=new s,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,o){void 0===i&&(i=1e3),void 0===n&&(n=h.Linear),void 0===s&&(s=!1),void 0===r&&(r=null),void 0===o&&(o=this.camera.scene);var a=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(a.scrollX,a.scrollY),this.destination.set(t,e),a.getScroll(t,e,this.current),"string"==typeof n&&h.hasOwnProperty(n)?this.ease=h[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=r,this._onUpdateScope=o,this.camera.emit("camerapanstart",this.camera,this,i,t,e)),a},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=a(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed<this.duration){var s=this.ease(i);n.getScroll(this.destination.x,this.destination.y,this.current);var r=this.source.x+(this.current.x-this.source.x)*s,o=this.source.y+(this.current.y-this.source.y)*s;n.setScroll(r,o),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,r,o)}else n.centerOn(this.destination.x,this.destination.y),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,n.scrollX,n.scrollY),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit("camerapancomplete",this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=r},function(t,e,i){var n=i(23),s=new(i(0))({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,o){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===n&&(n=255),void 0===s&&(s=!1),void 0===r&&(r=null),void 0===o&&(o=this.camera.scene),!s&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=n,this.alpha=1,this._elapsed=0,this._onUpdate=r,this._onUpdateScope=o,this.camera.emit("cameraflashstart",this.camera,this,t,e,i,n)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=1-this.progress:this.effectComplete())},postRenderCanvas:function(t){if(!this.isRunning)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e._cx,e._cy,e._cw,e._ch),!0},postRenderWebGL:function(t,e){if(!this.isRunning)return!1;var i=this.camera,n=this.red/255,s=this.blue/255,r=this.green/255;return t.drawFillRect(i._cx,i._cy,i._cw,i._ch,e(n,r,s,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit("cameraflashcomplete",this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=s},function(t,e,i){var n=i(23),s=new(i(0))({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,o,a){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!r&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a;var h=t?"camerafadeoutstart":"camerafadeinstart";return this.camera.emit(h,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=this.direction?this.progress:1-this.progress:this.effectComplete())},postRenderCanvas:function(t){if(!this.isRunning&&!this.isComplete)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e._cx,e._cy,e._cw,e._ch),!0},postRenderWebGL:function(t,e){if(!this.isRunning&&!this.isComplete)return!1;var i=this.camera,n=this.red/255,s=this.blue/255,r=this.green/255;return t.drawFillRect(i._cx,i._cy,i._cw,i._ch,e(n,r,s,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.isComplete=!0;var t=this.direction?"camerafadeoutcomplete":"camerafadeincomplete";this.camera.emit(t,this.camera,this)},reset:function(){this.isRunning=!1,this.isComplete=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=s},function(t,e,i){t.exports={Camera:i(378),CameraManager:i(949),Effects:i(370)}},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.accelX=0,this.accelY=0;var e=s(t,"acceleration",null);this.accelY="number"==typeof e?this.accelX=e:(this.accelX=s(t,"acceleration.x",0),s(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=s(t,"drag",null);this.dragY="number"==typeof i?this.dragX=i:(this.dragX=s(t,"drag.x",0),s(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var n=s(t,"maxSpeed",null);this.maxSpeedY="number"==typeof n?this.maxSpeedX=n:(this.maxSpeedX=s(t,"maxSpeed.x",0),s(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;0<this._speedX?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,0<this._speedX&&(this._speedX=0)),0<this._speedY?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,0<this._speedY&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.1&&(e.zoom=.1))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){var n=i(0),s=i(4),r=new n({initialize:function(t){this.camera=s(t,"camera",null),this.left=s(t,"left",null),this.right=s(t,"right",null),this.up=s(t,"up",null),this.down=s(t,"down",null),this.zoomIn=s(t,"zoomIn",null),this.zoomOut=s(t,"zoomOut",null),this.zoomSpeed=s(t,"zoomSpeed",.01),this.speedX=0,this.speedY=0;var e=s(t,"speed",null);this.speedY="number"==typeof e?this.speedX=e:(this.speedX=s(t,"speed.x",0),s(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<.1&&(e.zoom=.1)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed)}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={FixedKeyControl:i(989),SmoothedKeyControl:i(988)}},function(t,e,i){t.exports={Controls:i(990),Scene2D:i(987)}},function(t,e,i){t.exports={BaseCache:i(380),CacheManager:i(379)}},function(t,e,i){t.exports={Animation:i(384),AnimationFrame:i(382),AnimationManager:i(381)}},function(t,e,i){var r=i(53);t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=0;n<t.length;n++){var s=t[n];s.x=r(s.x,e.left-i,e.right+i),s.y=r(s.y,e.top-i,e.bottom+i)}return t}},function(t,e){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].visible=!t[e].visible;return t}},function(t,e){t.exports=function(t,e,i,n,s){void 0===s&&(s=!1);var r,o=Math.abs(n-i)/t.length;if(s)for(r=0;r<t.length;r++)t[r][e]+=r*o;else for(r=0;r<t.length;r++)t[r][e]=r*o;return t}},function(t,e,i){var a=i(181);t.exports=function(t,e,i,n,s){void 0===s&&(s=!1);var r,o=Math.abs(n-i)/t.length;if(s)for(r=0;r<t.length;r++)t[r][e]+=a(r*o,i,n);else for(r=0;r<t.length;r++)t[r][e]=a(r*o,i,n);return t}},function(t,e,i){var a=i(182);t.exports=function(t,e,i,n,s){void 0===s&&(s=!1);var r,o=Math.abs(n-i)/t.length;if(s)for(r=0;r<t.length;r++)t[r][e]+=a(r*o,i,n);else for(r=0;r<t.length;r++)t[r][e]=a(r*o,i,n);return t}},function(t,e,i){var n=i(122);t.exports=function(t){return n(t)}},function(t,e,i){var d=i(3);t.exports=function(t,e,i,n,s){var r,o,a,h,l,u;if(void 0===n&&(n=0),void 0===s&&(s=new d),1<t.length)if(0===n){var c=t.length-1;for(r=t[c].x,o=t[c].y,a=c-1;0<=a;a--)h=(u=t[a]).x,l=u.y,u.x=r,u.y=o,r=h,o=l;t[c].x=e,t[c].y=i}else{for(r=t[0].x,o=t[0].y,a=1;a<t.length;a++)h=(u=t[a]).x,l=u.y,u.x=r,u.y=o,r=h,o=l;t[0].x=e,t[0].y=i}else r=t[0].x,o=t[0].y,t[0].x=e,t[0].y=i;return s.x=r,s.y=o,s}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"y",e,i,n,s)}},function(t,e,i){var a=i(25);t.exports=function(t,e,i,n,s,r,o){return null!=i||(i=e),a(t,"x",e,n,r,o),a(t,"y",i,s,r,o)}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"x",e,i,n,s)}},function(t,e,i){var s=i(25);t.exports=function(t,e,i,n){return s(t,"visible",e,0,i,n)}},function(t,e){t.exports=function(t,e,i,n,s){for(var r=0;r<t.length;r++)t[r].setTint(e,i,n,s);return t}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"scaleY",e,i,n,s)}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"scaleX",e,i,n,s)}},function(t,e,i){var a=i(25);t.exports=function(t,e,i,n,s,r,o){return null!=i||(i=e),a(t,"scaleX",e,n,r,o),a(t,"scaleY",i,s,r,o)}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"rotation",e,i,n,s)}},function(t,e,i){var a=i(25);t.exports=function(t,e,i,n,s,r,o){return null!=i||(i=e),a(t,"originX",e,n,r,o),a(t,"originY",i,s,r,o)}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++)t[n].setInteractive(e,i);return t}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"depth",e,i,n,s)}},function(t,e,i){var s=i(25);t.exports=function(t,e,i,n){return s(t,"blendMode",e,0,i,n)}},function(t,e,i){var r=i(25);t.exports=function(t,e,i,n,s){return r(t,"alpha",e,i,n,s)}},function(t,e,i){var r=i(32);t.exports=function(t,e,i,n,s){return r(t,"scaleY",e,i,n,s)}},function(t,e,i){var a=i(32);t.exports=function(t,e,i,n,s,r,o){return null!=i||(i=e),a(t,"scaleX",e,n,r,o),a(t,"scaleY",i,s,r,o)}},function(t,e,i){var r=i(32);t.exports=function(t,e,i,n,s){return r(t,"scaleX",e,i,n,s)}},function(t,e,i){var a=i(183);t.exports=function(t,e,i,n){var s=e.x,r=e.y;if(0===n)return t;for(var o=0;o<t.length;o++)a(t[o],s,r,i,n);return t}},function(t,e,i){var a=i(183),h=i(52);t.exports=function(t,e,i){for(var n=e.x,s=e.y,r=0;r<t.length;r++){var o=t[r];a(o,n,s,i,Math.max(1,h(o.x,o.y,n,s)))}return t}},function(t,e,i){var r=i(32);t.exports=function(t,e,i,n,s){return r(t,"rotation",e,i,n,s)}},function(t,e,i){var n=i(184);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(187);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(188);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(185);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(191);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++)t[n].anims.play(e,i);return t}},function(t,e,i){var c=i(385);t.exports=function(t,e,i){var n=c({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),s=c({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),r=c({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);n.pop(),s.pop(),r.pop();for(var o=(n=n.concat(s,r)).length/t.length,a=0,h=0;h<t.length;h++){var l=t[h],u=n[Math.floor(a)];l.x=u.x,l.y=u.y,a+=o}return t}},function(t,e,i){var r=i(388),o=i(387),a=i(386);t.exports=function(t,e,i){void 0===i&&(i=0);var n=r(e,!1,t.length);0<i?o(n,i):i<0&&a(n,Math.abs(i));for(var s=0;s<t.length;s++)t[s].x=n[s].x,t[s].y=n[s].y;return t}},function(t,e,i){var o=i(189);t.exports=function(t,e){for(var i=o(e,t.length),n=0;n<t.length;n++){var s=t[n],r=i[n];s.x=r.x,s.y=r.y}return t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=e.width/2,a=e.height/2,h=0;h<t.length;h++)t[h].x=e.x+o*Math.cos(s),t[h].y=e.y+a*Math.sin(s),s+=r;return t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=0;o<t.length;o++)t[o].x=e.x+e.radius*Math.cos(s),t[o].y=e.y+e.radius*Math.sin(s),s+=r;return t}},function(t,e,i){var r=i(32);t.exports=function(t,e,i,n,s){return r(t,"y",e,i,n,s)}},function(t,e,i){var a=i(32);t.exports=function(t,e,i,n,s,r,o){return null!=i||(i=e),a(t,"x",e,n,r,o),a(t,"y",i,s,r,o)}},function(t,e,i){var r=i(32);t.exports=function(t,e,i,n,s){return r(t,"x",e,i,n,s)}},function(t,e,i){var r=i(32);t.exports=function(t,e,i,n,s){return r(t,"alpha",e,i,n,s)}},function(t,e){var s=function(t){return(t>>16)+(65280&t)+((255&t)<<16)},i={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,i,n){return void 0===t&&(t=16777215),void 0===e&&(n=i=e=t),this._tintTL=s(t),this._tintTR=s(e),this._tintBL=s(i),this._tintBR=s(n),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=s(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=s(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=s(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=s(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=i},function(t,e){t.exports={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}}},function(t,e){t.exports={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}}},function(t,e){t.exports={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.frame.realWidth},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return this.scaleY*this.frame.realHeight},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e,i){var n=i(94),s={_scaleMode:n.DEFAULT,scaleMode:{get:function(){return this._scaleMode},set:function(t){t!==n.LINEAR&&t!==n.NEAREST||(this._scaleMode=t)}},setScaleMode:function(t){return this.scaleMode=t,this}};t.exports=s},function(t,e){var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=Math.round(this.originX*this.width),this._displayOriginY=Math.round(this.originY*this.height),this}};t.exports=i},function(t,e,i){var u=i(9),n=i(396),s=i(3),r={getCenter:function(t){return void 0===t&&(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new s),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t),t},getTopRight:function(t,e){return t||(t=new s),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t),t},getBottomLeft:function(t,e){return t||(t=new s),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t),t},getBottomRight:function(t,e){return t||(t=new s),void 0===e&&(e=!1),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t),t},getBounds:function(t){var e,i,n,s,r,o,a,h;if(void 0===t&&(t=new u),this.parentContainer){var l=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),l.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),l.transformPoint(t.x,t.y,t),n=t.x,s=t.y,this.getBottomLeft(t),l.transformPoint(t.x,t.y,t),r=t.x,o=t.y,this.getBottomRight(t),l.transformPoint(t.x,t.y,t),a=t.x,h=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,s=t.y,this.getBottomLeft(t),r=t.x,o=t.y,this.getBottomRight(t),a=t.x,h=t.y;return t.x=Math.min(e,n,r,a),t.y=Math.min(i,s,o,h),t.width=Math.max(e,n,r,a)-t.x,t.height=Math.max(i,s,o,h)-t.y,t}};t.exports=r},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){t.exports={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var s=t;this.frame.setCropUVs(this._crop,s.x,s.y,s.width,s.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}}},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e,i){var p=i(416),g=i(193),v=i(2),n=i(1),y=new(i(125))({sys:{queueDepthSort:n,events:{once:n}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=v(e,"width",-1),n=v(e,"height",-1),s=v(e,"cellWidth",1),r=v(e,"cellHeight",s),o=v(e,"position",g.TOP_LEFT),a=v(e,"x",0),h=v(e,"y",0),l=0,u=0,c=i*s,d=n*r;y.setPosition(a,h),y.setSize(s,r);for(var f=0;f<t.length;f++)if(p(t[f],y,o),-1===i)u+=r,y.y+=r,u===d&&(u=0,y.x+=s,y.y=h);else if(-1===n)l+=s,y.x+=s,l===c&&(l=0,y.x=a,y.y+=r);else if(l+=s,y.x+=s,l===c&&(l=0,u+=r,y.x=a,y.y+=r,u===d))break;return t}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=i;n<t.length;n++){var s=t[n],r=!0;for(var o in e)s[o]!==e[o]&&(r=!1);if(r)return s}return null}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=i;n<t.length;n++){var s=t[n],r=!0;for(var o in e)s[o]!==e[o]&&(r=!1);if(r)return s}return null}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];e.call(i,s)}return t}},function(t,e,i){var r=i(32);t.exports=function(t,e,i,n,s){return r(t,"angle",e,i,n,s)}},function(t,e){if("function"!=typeof window.Uint32Array&&"object"!=typeof window.Uint32Array){var i=function(t){var e=new Array;window[t]=function(t){if("number"==typeof t){Array.call(this,t),this.length=t;for(var e=0;e<this.length;e++)this[e]=0}else for(Array.call(this,t.length),this.length=t.length,e=0;e<this.length;e++)this[e]=t[e]},window[t].prototype=e,window[t].constructor=window[t]};i("Float32Array"),i("Uint32Array"),i("Uint16Array"),i("Int16Array"),i("ArrayBuffer")}},function(t,e,i){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var n=Date.now(),i=["ms","moz","webkit","o"],s=0;s<i.length&&!t.requestAnimationFrame;++s)t.requestAnimationFrame=t[i[s]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[i[s]+"CancelAnimationFrame"]||t[i[s]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),i=16+n-e;return i<0&&(i=0),n=e,setTimeout(function(){n=Date.now(),t(performance.now())},i)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(this,i(200))},function(t,e){!function(){if("performance"in window==0&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==0){var t=Date.now();performance.timing&&performance.timing.navigationStart&&(t=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-t}}}()},function(t,e){Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)})},function(t,e){window.console||(window.console={},window.console.log=window.console.assert=function(){},window.console.warn=window.console.assert=function(){})},function(t,e){!function(){function i(t){t&&(t.setTargetAtTime||(t.setTargetAtTime=t.setTargetValueAtTime))}window.hasOwnProperty("webkitAudioContext")&&!window.hasOwnProperty("AudioContext")&&(window.AudioContext=webkitAudioContext,AudioContext.prototype.hasOwnProperty("createGain")||(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),AudioContext.prototype.hasOwnProperty("createDelay")||(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode),AudioContext.prototype.hasOwnProperty("createScriptProcessor")||(AudioContext.prototype.createScriptProcessor=AudioContext.prototype.createJavaScriptNode),AudioContext.prototype.hasOwnProperty("createPeriodicWave")||(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable),AudioContext.prototype.internal_createGain=AudioContext.prototype.createGain,AudioContext.prototype.createGain=function(){var t=this.internal_createGain();return i(t.gain),t},AudioContext.prototype.internal_createDelay=AudioContext.prototype.createDelay,AudioContext.prototype.createDelay=function(t){var e=t?this.internal_createDelay(t):this.internal_createDelay();return i(e.delayTime),e},AudioContext.prototype.internal_createBufferSource=AudioContext.prototype.createBufferSource,AudioContext.prototype.createBufferSource=function(){var n=this.internal_createBufferSource();return n.start?(n.internal_start=n.start,n.start=function(t,e,i){void 0!==i?n.internal_start(t||0,e,i):n.internal_start(t||0,e||0)}):n.start=function(t,e,i){e||i?this.noteGrainOn(t||0,e,i):this.noteOn(t||0)},n.stop?(n.internal_stop=n.stop,n.stop=function(t){n.internal_stop(t||0)}):n.stop=function(t){this.noteOff(t||0)},i(n.playbackRate),n},AudioContext.prototype.internal_createDynamicsCompressor=AudioContext.prototype.createDynamicsCompressor,AudioContext.prototype.createDynamicsCompressor=function(){var t=this.internal_createDynamicsCompressor();return i(t.threshold),i(t.knee),i(t.ratio),i(t.reduction),i(t.attack),i(t.release),t},AudioContext.prototype.internal_createBiquadFilter=AudioContext.prototype.createBiquadFilter,AudioContext.prototype.createBiquadFilter=function(){var t=this.internal_createBiquadFilter();return i(t.frequency),i(t.detune),i(t.Q),i(t.gain),t},AudioContext.prototype.hasOwnProperty("createOscillator")&&(AudioContext.prototype.internal_createOscillator=AudioContext.prototype.createOscillator,AudioContext.prototype.createOscillator=function(){var e=this.internal_createOscillator();return e.start?(e.internal_start=e.start,e.start=function(t){e.internal_start(t||0)}):e.start=function(t){this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},e.setPeriodicWave||(e.setPeriodicWave=e.setWaveTable),i(e.frequency),i(e.detune),e})),window.hasOwnProperty("webkitOfflineAudioContext")&&!window.hasOwnProperty("OfflineAudioContext")&&(window.OfflineAudioContext=webkitOfflineAudioContext)}()},function(t,e){Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)})},function(t,e){Array.prototype.forEach||(Array.prototype.forEach=function(t){"use strict";if(null==this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var n=2<=arguments.length?arguments[1]:void 0,s=0;s<i;s++)s in e&&t.call(n,e[s],s,e)})},function(t,e,i){i(1058),i(1057),i(1056),i(1055),i(1054),i(1053),i(1052),i(1051)},function(t,e,i){var o=i(126),n=i(0),f=i(33),p=i(137),g=i(1061),v=i(11),y=i(2),m=i(4),s=i(67),r=i(195),a=i(504),h=i(499),x=i(81),l=new n({Extends:v,initialize:function(t,e){v.call(this),this.scene=t,this.engine=g.create(e),this.localWorld=this.engine.world;var i=m(e,"gravity",null);if(i&&this.setGravity(i.x,i.y,i.scale),this.walls={left:null,right:null,top:null,bottom:null},y(e,"setBounds",!1)){var n=e.setBounds;if("boolean"==typeof n)this.setBounds();else{var s=y(n,"x",0),r=y(n,"y",0),o=y(n,"width",t.sys.game.config.width),a=y(n,"height",t.sys.game.config.height),h=y(n,"thickness",64),l=y(n,"left",!0),u=y(n,"right",!0),c=y(n,"top",!0),d=y(n,"bottom",!0);this.setBounds(s,r,o,a,h,l,u,c,d)}}this.enabled=m(e,"enabled",!0),this.correction=m(e,"correction",1),this.getDelta=m(e,"getDelta",this.update60Hz),this.autoUpdate=m(e,"autoUpdate",!0),this.drawDebug=m(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:y(e,"debugShowBody",!0),debugShowStaticBody:y(e,"debugShowStaticBody",!0),debugShowVelocity:y(e,"debugShowVelocity",!0),bodyDebugColor:y(e,"debugBodyColor",16711935),bodyDebugFillColor:y(e,"bodyDebugFillColor",14919651),staticBodyDebugColor:y(e,"debugBodyColor",255),velocityDebugColor:y(e,"debugVelocityColor",65280),debugShowJoint:y(e,"debugShowJoint",!0),jointDebugColor:y(e,"debugJointColor",0),debugWireframes:y(e,"debugWireframes",!0),debugShowInternalEdges:y(e,"debugShowInternalEdges",!1),debugShowConvexHulls:y(e,"debugShowConvexHulls",!1),debugConvexHullColor:y(e,"debugConvexHullColor",11184810),debugShowSleeping:y(e,"debugShowSleeping",!1)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy()},setEventsProxy:function(){var s=this,t=this.engine;r.on(t,"beforeUpdate",function(t){s.emit("beforeupdate",t)}),r.on(t,"afterUpdate",function(t){s.emit("afterupdate",t)}),r.on(t,"collisionStart",function(t){var e,i,n=t.pairs;0<n.length&&(e=n[0].bodyA,i=n[0].bodyB),s.emit("collisionstart",t,e,i)}),r.on(t,"collisionActive",function(t){var e,i,n=t.pairs;0<n.length&&(e=n[0].bodyA,i=n[0].bodyB),s.emit("collisionactive",t,e,i)}),r.on(t,"collisionEnd",function(t){var e,i,n=t.pairs;0<n.length&&(e=n[0].bodyA,i=n[0].bodyB),s.emit("collisionend",t,e,i)})},setBounds:function(t,e,i,n,s,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),void 0===s&&(s=128),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e,s,n),this.updateWall(o,"right",t+i,e,s,n),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];this.walls[e]=t?(o&&h.remove(this.localWorld,o),i+=s/2,n+=r/2,this.create(i,n,s,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&h.remove(this.localWorld,o),null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,n,s){var r=o.rectangle(t,e,i,n,s);return h.add(this.localWorld,r),r},add:function(t){return h.add(this.localWorld,t),this},remove:function(t,e){var i=t.body?t.body:t;return p.removeBody(this.localWorld,i,e),this},removeConstraint:function(t,e){return p.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i<t.length;i++)new a(this,t[i],e);return this},nextGroup:function(t){return s.nextGroup(t)},nextCategory:function(){return s.nextCategory()},pause:function(){return this.enabled=!1,this.emit("pause"),this},resume:function(){return this.enabled=!0,this.emit("resume"),this},update:function(t,e){this.enabled&&this.autoUpdate&&g.update(this.engine,this.getDelta(t,e),this.correction)},step:function(t,e){g.update(this.engine,t,e)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},postUpdate:function(){if(this.drawDebug){this.debugGraphic.clear();var t=p.allBodies(this.localWorld);this.defaults.debugWireframes?(this.defaults.debugShowConvexHulls&&this.renderConvexHulls(t),this.renderWireframes(t)):this.renderBodies(t),this.defaults.debugShowJoint&&this.renderJoints()}},renderConvexHulls:function(t){var e=this.debugGraphic;e.lineStyle(1,this.defaults.debugConvexHullColor),e.beginPath();for(var i=0;i<t.length;i++){var n=t[i];if(n.render.visible&&1!==n.parts.length){e.moveTo(n.vertices[0].x,n.vertices[0].y);for(var s=1;s<n.vertices.length;s++)e.lineTo(n.vertices[s].x,n.vertices[s].y);e.lineTo(n.vertices[0].x,n.vertices[0].y)}}e.strokePath()},renderWireframes:function(t){var e=this.debugGraphic,i=this.defaults.debugShowInternalEdges;e.lineStyle(1,this.defaults.bodyDebugColor),e.beginPath();for(var n=0;n<t.length;n++){var s=t[n];if(s.render.visible)for(var r=1<s.parts.length?1:0;r<s.parts.length;r++){var o=s.parts[r],a=o.vertices.length;e.moveTo(o.vertices[0].x,o.vertices[0].y);for(var h=1;h<a;h++)!o.vertices[h-1].isInternal||i?e.lineTo(o.vertices[h].x,o.vertices[h].y):e.moveTo(o.vertices[h].x,o.vertices[h].y),o.vertices[h].isInternal&&!i&&e.moveTo(o.vertices[(h+1)%a].x,o.vertices[(h+1)%a].y);e.lineTo(o.vertices[0].x,o.vertices[0].y)}}e.strokePath()},renderBodies:function(t){var e,i,n,s,r=this.debugGraphic,o=this.defaults.debugShowInternalEdges||!this.defaults.debugWireframes,a=this.defaults.debugShowSleeping,h=this.defaults.debugWireframes;for(n=0;n<t.length;n++)if((e=t[n]).render.visible)for(s=1<e.parts.length?1:0;s<e.parts.length;s++)if((i=e.parts[s]).render.visible){if(a&&e.isSleeping?(r.lineStyle(1,this.defaults.bodyDebugColor,.5*i.render.opacity),r.fillStyle(this.defaults.bodyDebugColor,.5*i.render.opacity)):(r.lineStyle(1,this.defaults.bodyDebugColor,i.render.opacity),r.fillStyle(this.defaults.bodyDebugColor,i.render.opacity)),i.circleRadius)r.beginPath(),r.arc(i.position.x,i.position.y,i.circleRadius,0,2*Math.PI);else{r.beginPath(),r.moveTo(i.vertices[0].x,i.vertices[0].y);for(var l=i.vertices.length,u=1;u<l;u++)!i.vertices[u-1].isInternal||o?r.lineTo(i.vertices[u].x,i.vertices[u].y):r.moveTo(i.vertices[u].x,i.vertices[u].y),i.vertices[u].isInternal&&!o&&r.moveTo(i.vertices[(u+1)%i.vertices.length].x,i.vertices[(u+1)%i.vertices.length].y);r.lineTo(i.vertices[0].x,i.vertices[0].y),r.closePath()}h?r.strokePath():r.fillPath()}},renderJoints:function(){var t=this.debugGraphic;t.lineStyle(2,this.defaults.jointDebugColor);for(var e=p.allConstraints(this.localWorld),i=0;i<e.length;i++){var n=e[i];if(n.render.visible&&n.pointA&&n.pointB){n.render.lineWidth&&t.lineStyle(n.render.lineWidth,f.colorToNumber(n.render.strokeStyle));var s,r,o=n.bodyA,a=n.bodyB;if(s=o?x.add(o.position,n.pointA):n.pointA,"pin"===n.render.type)t.beginPath(),t.arc(s.x,s.y,3,0,2*Math.PI),t.closePath();else{if(r=a?x.add(a.position,n.pointB):n.pointB,t.beginPath(),t.moveTo(s.x,s.y),"spring"===n.render.type)for(var h,l=x.sub(r,s),u=x.perp(x.normalise(l)),c=Math.ceil(f.clamp(n.length/5,12,20)),d=1;d<c;d+=1)h=d%2==0?1:-1,t.lineTo(s.x+l.x*(d/c)+u.x*h*4,s.y+l.y*(d/c)+u.y*h*4);t.lineTo(r.x,r.y)}n.render.lineWidth&&t.strokePath(),n.render.anchors&&(t.fillStyle(f.colorToNumber(n.render.strokeStyle)),t.beginPath(),t.arc(s.x,s.y,6,0,2*Math.PI),t.arc(r.x,r.y,6,0,2*Math.PI),t.closePath(),t.fillPath())}}},fromPath:function(t,n){return void 0===n&&(n=[]),t.replace(/L?\s*([\-\d\.e]+)[\s,]*([\-\d\.e]+)*/gi,function(t,e,i){n.push({x:parseFloat(e),y:parseFloat(i)})}),n},shutdown:function(){r.off(this.engine),this.removeAllListeners(),h.clear(this.localWorld,!1),g.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=l},function(t,e,i){var p={};t.exports=p;var r=i(499),g=i(222),v=i(1062),y=i(1063),m=i(1088),o=i(1064),x=i(195),w=i(137),b=i(194),a=i(33),h=i(67);p.create=function(t,e){e=a.isElement(t)?e:t,t=a.isElement(t)?t:null,e=e||{},(t||e.render)&&a.warn("Engine.create: engine.render is deprecated (see docs)");var i={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:o}},n=a.extend(i,e);if(t||n.render){var s={element:t,controller:Render};n.render=a.extend(s,n.render)}return n.render&&n.render.controller&&(n.render=n.render.controller.create(n.render)),n.render&&(n.render.engine=n),n.world=e.world||r.create(n.world),n.pairs=y.create(),n.broadphase=n.broadphase.controller.create(n.broadphase),n.metrics=n.metrics||{extended:!1},n.metrics=m.create(n.metrics),n},p.update=function(t,e,i){e=e||1e3/60,i=i||1;var n,s=t.world,r=t.timing,o=t.broadphase,a=[];r.timestamp+=e*r.timeScale;var h={timestamp:r.timestamp};x.trigger(t,"beforeUpdate",h);var l=w.allBodies(s),u=w.allConstraints(s);for(m.reset(t.metrics),t.enableSleeping&&g.update(l,r.timeScale),p._bodiesApplyGravity(l,s.gravity),p._bodiesUpdate(l,e,r.timeScale,i,s.bounds),b.preSolveAll(l),n=0;n<t.constraintIterations;n++)b.solveAll(u,r.timeScale);b.postSolveAll(l),a=o.controller?(s.isModified&&o.controller.clear(o),o.controller.update(o,l,t,s.isModified),o.pairsList):l,s.isModified&&w.setModified(s,!1,!1,!0);var c=o.detector(a,t),d=t.pairs,f=r.timestamp;for(y.update(d,c,f),y.removeOld(d,f),t.enableSleeping&&g.afterCollisions(d.list,r.timeScale),0<d.collisionStart.length&&x.trigger(t,"collisionStart",{pairs:d.collisionStart}),v.preSolvePosition(d.list),n=0;n<t.positionIterations;n++)v.solvePosition(d.list,l,r.timeScale);for(v.postSolvePosition(l),b.preSolveAll(l),n=0;n<t.constraintIterations;n++)b.solveAll(u,r.timeScale);for(b.postSolveAll(l),v.preSolveVelocity(d.list),n=0;n<t.velocityIterations;n++)v.solveVelocity(d.list,r.timeScale);return 0<d.collisionActive.length&&x.trigger(t,"collisionActive",{pairs:d.collisionActive}),0<d.collisionEnd.length&&x.trigger(t,"collisionEnd",{pairs:d.collisionEnd}),m.update(t.metrics,t),p._bodiesClearForces(l),x.trigger(t,"afterUpdate",h),t},p.merge=function(t,e){if(a.extend(t,e),e.world){t.world=e.world,p.clear(t);for(var i=w.allBodies(t.world),n=0;n<i.length;n++){var s=i[n];g.set(s,!1),s.id=a.nextId()}}},p.clear=function(t){var e=t.world;y.clear(t.pairs);var i=t.broadphase;if(i.controller){var n=w.allBodies(e);i.controller.clear(i),i.controller.update(i,n,t,!0)}},p._bodiesClearForces=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.force.x=0,i.force.y=0,i.torque=0}},p._bodiesApplyGravity=function(t,e){var i=void 0!==e.scale?e.scale:.001;if((0!==e.x||0!==e.y)&&0!==i)for(var n=0;n<t.length;n++){var s=t[n];s.ignoreGravity||s.isStatic||s.isSleeping||(s.force.y+=s.mass*e.y*i,s.force.x+=s.mass*e.x*i)}},p._bodiesUpdate=function(t,e,i,n,s){for(var r=0;r<t.length;r++){var o=t[r];o.isStatic||o.isSleeping||h.update(o,e,i,n)}}},function(t,e,i){var X={};t.exports=X;var r=i(76),z=i(81),N=i(33),o=i(80);X._restingThresh=4,X._restingThreshTangent=6,X._positionDampen=.9,X._positionWarming=.8,X._frictionNormalMultiplier=5,X.preSolvePosition=function(t){var e,i,n;for(e=0;e<t.length;e++)(i=t[e]).isActive&&(n=i.activeContacts.length,i.collision.parentA.totalContacts+=n,i.collision.parentB.totalContacts+=n)},X.solvePosition=function(t,e,i){var n,s,r,o,a,h,l,u,c,d,f,p,g,v,y,m,x=i*X._positionDampen;for(n=0;n<e.length;n++){var w=e[n];w.previousPositionImpulse.x=w.positionImpulse.x,w.previousPositionImpulse.y=w.positionImpulse.y}for(n=0;n<t.length;n++)(o=t[n]).isActive&&!o.isSensor&&(h=(a=o.collision).parentA,l=a.parentB,u=a.normal,f=h.previousPositionImpulse,p=l.previousPositionImpulse,d=a.penetration,v=p.x-f.x+d.x,y=p.y-f.y+d.y,c=(s=u.x)*v+(r=u.y)*y,o.separation=c,m=(c-o.slop)*x,(h.isStatic||l.isStatic)&&(m*=2),h.isStatic||h.isSleeping||(g=m/h.totalContacts,h.positionImpulse.x+=s*g,h.positionImpulse.y+=r*g),l.isStatic||l.isSleeping||(g=m/l.totalContacts,l.positionImpulse.x-=s*g,l.positionImpulse.y-=r*g))},X.postSolvePosition=function(t){for(var e=0;e<t.length;e++){var i=t[e];if((i.totalContacts=0)!==i.positionImpulse.x||0!==i.positionImpulse.y){for(var n=0;n<i.parts.length;n++){var s=i.parts[n];r.translate(s.vertices,i.positionImpulse),o.update(s.bounds,s.vertices,i.velocity),s.position.x+=i.positionImpulse.x,s.position.y+=i.positionImpulse.y}i.positionPrev.x+=i.positionImpulse.x,i.positionPrev.y+=i.positionImpulse.y,z.dot(i.positionImpulse,i.velocity)<0?(i.positionImpulse.x=0,i.positionImpulse.y=0):(i.positionImpulse.x*=X._positionWarming,i.positionImpulse.y*=X._positionWarming)}}},X.preSolveVelocity=function(t){var e,i,n,s,r,o,a,h,l,u,c,d,f,p,g=z._temp[0],v=z._temp[1];for(e=0;e<t.length;e++)if((n=t[e]).isActive&&!n.isSensor)for(s=n.activeContacts,o=(r=n.collision).parentA,a=r.parentB,h=r.normal,l=r.tangent,i=0;i<s.length;i++)c=(u=s[i]).vertex,d=u.normalImpulse,f=u.tangentImpulse,0===d&&0===f||(g.x=h.x*d+l.x*f,g.y=h.y*d+l.y*f,o.isStatic||o.isSleeping||(p=z.sub(c,o.position,v),o.positionPrev.x+=g.x*o.inverseMass,o.positionPrev.y+=g.y*o.inverseMass,o.anglePrev+=z.cross(p,g)*o.inverseInertia),a.isStatic||a.isSleeping||(p=z.sub(c,a.position,v),a.positionPrev.x-=g.x*a.inverseMass,a.positionPrev.y-=g.y*a.inverseMass,a.anglePrev-=z.cross(p,g)*a.inverseInertia))},X.solveVelocity=function(t,e){for(var i=e*e,n=z._temp[0],s=z._temp[1],r=z._temp[2],o=z._temp[3],a=z._temp[4],h=z._temp[5],l=0;l<t.length;l++){var u=t[l];if(u.isActive&&!u.isSensor){var c=u.collision,d=c.parentA,f=c.parentB,p=c.normal,g=c.tangent,v=u.activeContacts,y=1/v.length;d.velocity.x=d.position.x-d.positionPrev.x,d.velocity.y=d.position.y-d.positionPrev.y,f.velocity.x=f.position.x-f.positionPrev.x,f.velocity.y=f.position.y-f.positionPrev.y,d.angularVelocity=d.angle-d.anglePrev,f.angularVelocity=f.angle-f.anglePrev;for(var m=0;m<v.length;m++){var x=v[m],w=x.vertex,b=z.sub(w,d.position,s),T=z.sub(w,f.position,r),S=z.add(d.velocity,z.mult(z.perp(b),d.angularVelocity),o),_=z.add(f.velocity,z.mult(z.perp(T),f.angularVelocity),a),A=z.sub(S,_,h),C=z.dot(p,A),M=z.dot(g,A),P=Math.abs(M),E=N.sign(M),k=(1+u.restitution)*C,F=N.clamp(u.separation+C,0,1)*X._frictionNormalMultiplier,L=M,R=1/0;P>u.friction*u.frictionStatic*F*i&&(R=P,L=N.clamp(u.friction*E*i,-R,R));var O=z.cross(b,p),D=z.cross(T,p),B=y/(d.inverseMass+f.inverseMass+d.inverseInertia*O*O+f.inverseInertia*D*D);if(k*=B,L*=B,C<0&&C*C>X._restingThresh*i)x.normalImpulse=0;else{var I=x.normalImpulse;x.normalImpulse=Math.min(x.normalImpulse+k,0),k=x.normalImpulse-I}if(M*M>X._restingThreshTangent*i)x.tangentImpulse=0;else{var Y=x.tangentImpulse;x.tangentImpulse=N.clamp(x.tangentImpulse+L,-R,R),L=x.tangentImpulse-Y}n.x=p.x*k+g.x*L,n.y=p.y*k+g.y*L,d.isStatic||d.isSleeping||(d.positionPrev.x+=n.x*d.inverseMass,d.positionPrev.y+=n.y*d.inverseMass,d.anglePrev+=z.cross(b,n)*d.inverseInertia),f.isStatic||f.isSleeping||(f.positionPrev.x-=n.x*f.inverseMass,f.positionPrev.y-=n.y*f.inverseMass,f.anglePrev-=z.cross(T,n)*f.inverseInertia)}}}}},function(t,e,i){var l={};t.exports=l;var d=i(418),n=i(33);l._pairMaxIdleLife=1e3,l.create=function(t){return n.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},l.update=function(t,e,i){var n,s,r,o,a=t.list,h=t.table,l=t.collisionStart,u=t.collisionEnd,c=t.collisionActive;for(l.length=0,u.length=0,c.length=0,o=0;o<a.length;o++)a[o].confirmedActive=!1;for(o=0;o<e.length;o++)(n=e[o]).collided&&((r=h[s=d.id(n.bodyA,n.bodyB)])?(r.isActive?c.push(r):l.push(r),d.update(r,n,i),r.confirmedActive=!0):(r=d.create(n,i),h[s]=r,l.push(r),a.push(r)));for(o=0;o<a.length;o++)(r=a[o]).isActive&&!r.confirmedActive&&(d.setActive(r,!1,i),u.push(r))},l.removeOld=function(t,e){var i,n,s,r,o=t.list,a=t.table,h=[];for(r=0;r<o.length;r++)(n=(i=o[r]).collision).bodyA.isSleeping||n.bodyB.isSleeping?i.timeUpdated=e:e-i.timeUpdated>l._pairMaxIdleLife&&h.push(r);for(r=0;r<h.length;r++)delete a[(i=o[s=h[r]-r]).id],o.splice(s,1)},l.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},function(t,e,i){var m={};t.exports=m;var a=i(418),n=i(503),h=i(33);m.create=function(t){var e={controller:m,detector:n.collisions,buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return h.extend(e,t)},m.update=function(t,e,i,n){var s,r,o,a,h,l=i.world,u=t.buckets,c=!1,d=i.metrics;for(d.broadphaseTests=0,s=0;s<e.length;s++){var f=e[s];if((!f.isSleeping||n)&&!(f.bounds.max.x<l.bounds.min.x||f.bounds.min.x>l.bounds.max.x||f.bounds.max.y<l.bounds.min.y||f.bounds.min.y>l.bounds.max.y)){var p=m._getRegion(t,f);if(!f.region||p.id!==f.region.id||n){d.broadphaseTests+=1,f.region&&!n||(f.region=p);var g=m._regionUnion(p,f.region);for(r=g.startCol;r<=g.endCol;r++)for(o=g.startRow;o<=g.endRow;o++){a=u[h=m._getBucketId(r,o)];var v=r>=p.startCol&&r<=p.endCol&&o>=p.startRow&&o<=p.endRow,y=r>=f.region.startCol&&r<=f.region.endCol&&o>=f.region.startRow&&o<=f.region.endRow;!v&&y&&y&&a&&m._bucketRemoveBody(t,a,f),(f.region===p||v&&!y||n)&&(a||(a=m._createBucket(u,h)),m._bucketAddBody(t,a,f))}f.region=p,c=!0}}}c&&(t.pairsList=m._createActivePairsList(t))},m.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},m._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),n=Math.max(t.endCol,e.endCol),s=Math.min(t.startRow,e.startRow),r=Math.max(t.endRow,e.endRow);return m._createRegion(i,n,s,r)},m._getRegion=function(t,e){var i=e.bounds,n=Math.floor(i.min.x/t.bucketWidth),s=Math.floor(i.max.x/t.bucketWidth),r=Math.floor(i.min.y/t.bucketHeight),o=Math.floor(i.max.y/t.bucketHeight);return m._createRegion(n,s,r,o)},m._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},m._getBucketId=function(t,e){return"C"+t+"R"+e},m._createBucket=function(t,e){return t[e]=[]},m._bucketAddBody=function(t,e,i){for(var n=0;n<e.length;n++){var s=e[n];if(!(i.id===s.id||i.isStatic&&s.isStatic)){var r=a.id(i,s),o=t.pairs[r];o?o[2]+=1:t.pairs[r]=[i,s,1]}}e.push(i)},m._bucketRemoveBody=function(t,e,i){e.splice(h.indexOf(e,i),1);for(var n=0;n<e.length;n++){var s=e[n],r=a.id(i,s),o=t.pairs[r];o&&(o[2]-=1)}},m._createActivePairsList=function(t){var e,i,n=[];e=h.keys(t.pairs);for(var s=0;s<e.length;s++)0<(i=t.pairs[e[s]])[2]?n.push(i):delete t.pairs[e[s]];return n}},function(t,e,i){var n={};t.exports=n;var s=i(500),r=i(33);n.name="matter-js",n.version="0.14.2",n.uses=[],n.used=[],n.use=function(){s.use(n,Array.prototype.slice.call(arguments))},n.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(n,t,e)},n.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(n,t,e)}},function(t,e,i){var a=i(427),n=i(0),s=i(419),h=i(19),l=i(2),r=i(186),o=i(61),u=i(3),c=new n({Extends:o,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity,r],initialize:function(t,e,i,n,s,r){h.call(this,t.scene,"Image"),this.anims=new a(this),this.setTexture(n,s),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var o=l(r,"shape",null);o?this.setBody(o,r):this.setRectangle(this.width,this.height,r),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=c},function(t,e,i){var n=i(0),s=i(419),a=i(19),h=i(2),r=i(87),o=i(186),l=i(3),u=new n({Extends:r,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity,o],initialize:function(t,e,i,n,s,r){a.call(this,t.scene,"Image"),this.setTexture(n,s),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var o=h(r,"shape",null);o?this.setBody(o,r):this.setRectangle(this.width,this.height,r),this.setPosition(e,i),this.initPipeline("TextureTintPipeline")}});t.exports=u},function(t,e,i){var f={};t.exports=f;var m=i(137),g=i(194),v=i(33),x=i(67),p=i(126);f.stack=function(t,e,i,n,s,r,o){for(var a,h=m.create({label:"Stack"}),l=t,u=e,c=0,d=0;d<n;d++){for(var f=0,p=0;p<i;p++){var g=o(l,u,p,d,a,c);if(g){var v=g.bounds.max.y-g.bounds.min.y,y=g.bounds.max.x-g.bounds.min.x;f<v&&(f=v),x.translate(g,{x:.5*y,y:.5*v}),l=g.bounds.max.x+s,m.addBody(h,g),a=g,c+=1}else l+=s}u+=f+r,l=t}return h},f.chain=function(t,e,i,n,s,r){for(var o=t.bodies,a=1;a<o.length;a++){var h=o[a-1],l=o[a],u=h.bounds.max.y-h.bounds.min.y,c=h.bounds.max.x-h.bounds.min.x,d=l.bounds.max.y-l.bounds.min.y,f={bodyA:h,pointA:{x:c*e,y:u*i},bodyB:l,pointB:{x:(l.bounds.max.x-l.bounds.min.x)*n,y:d*s}},p=v.extend(f,r);m.addConstraint(t,g.create(p))}return t.label+=" Chain",t},f.mesh=function(t,e,i,n,s){var r,o,a,h,l,u=t.bodies;for(r=0;r<i;r++){for(o=1;o<e;o++)a=u[o-1+r*e],h=u[o+r*e],m.addConstraint(t,g.create(v.extend({bodyA:a,bodyB:h},s)));if(0<r)for(o=0;o<e;o++)a=u[o+(r-1)*e],h=u[o+r*e],m.addConstraint(t,g.create(v.extend({bodyA:a,bodyB:h},s))),n&&0<o&&(l=u[o-1+(r-1)*e],m.addConstraint(t,g.create(v.extend({bodyA:l,bodyB:h},s)))),n&&o<e-1&&(l=u[o+1+(r-1)*e],m.addConstraint(t,g.create(v.extend({bodyA:l,bodyB:h},s))))}return t.label+=" Mesh",t},f.pyramid=function(h,t,l,u,c,e,d){return f.stack(h,t,l,u,c,e,function(t,e,i,n,s,r){var o=Math.min(u,Math.ceil(l/2)),a=s?s.bounds.max.x-s.bounds.min.x:0;if(!(o<n||i<(n=o-n)||l-1-n<i))return 1===r&&x.translate(s,{x:(i+(l%2==1?1:-1))*a,y:0}),d(h+(s?i*a:0)+i*c,e,i,n,s,r)})},f.newtonsCradle=function(t,e,i,n,s){for(var r=m.create({label:"Newtons Cradle"}),o=0;o<i;o++){var a=p.circle(t+o*(1.9*n),e+s,n,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),h=g.create({pointA:{x:t+o*(1.9*n),y:e},bodyB:a});m.addBody(r,a),m.addConstraint(r,h)}return r},f.car=function(t,e,i,n,s){var r=x.nextGroup(!0),o=.5*-i+20,a=.5*i-20,h=m.create({label:"Car"}),l=p.rectangle(t,e,i,n,{collisionFilter:{group:r},chamfer:{radius:.5*n},density:2e-4}),u=p.circle(t+o,e+0,s,{collisionFilter:{group:r},friction:.8}),c=p.circle(t+a,e+0,s,{collisionFilter:{group:r},friction:.8}),d=g.create({bodyB:l,pointB:{x:o,y:0},bodyA:u,stiffness:1,length:0}),f=g.create({bodyB:l,pointB:{x:a,y:0},bodyA:c,stiffness:1,length:0});return m.addBody(h,l),m.addBody(h,u),m.addBody(h,c),m.addConstraint(h,d),m.addConstraint(h,f),h},f.softBody=function(t,e,i,n,s,r,o,a,h,l){h=v.extend({inertia:1/0},h),l=v.extend({stiffness:.2,render:{type:"line",anchors:!1}},l);var u=f.stack(t,e,i,n,s,r,function(t,e){return p.circle(t,e,a,h)});return f.mesh(u,i,n,o,l),u.label="Soft Body",u}},function(t,e){function h(t,e,i){i=i||0;var n,s,r,o,a,h,l,u=[0,0];return n=t[1][1]-t[0][1],s=t[0][0]-t[1][0],r=n*t[0][0]+s*t[0][1],o=e[1][1]-e[0][1],a=e[0][0]-e[1][0],h=o*e[0][0]+a*e[0][1],v(l=n*a-o*s,0,i)||(u[0]=(a*r-s*h)/l,u[1]=(n*h-o*r)/l),u}function s(t,e,i,n){var s=e[0]-t[0],r=e[1]-t[1],o=n[0]-i[0],a=n[1]-i[1];if(o*r-a*s==0)return!1;var h=(s*(i[1]-t[1])+r*(t[0]-i[0]))/(o*r-a*s),l=(o*(t[1]-i[1])+a*(i[0]-t[0]))/(a*s-o*r);return 0<=h&&h<=1&&0<=l&&l<=1}function l(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function _(t,e,i){return 0<l(t,e,i)}function A(t,e,i){return 0<=l(t,e,i)}function C(t,e,i){return l(t,e,i)<0}function M(t,e,i){return l(t,e,i)<=0}t.exports={decomp:function(t){var e=function t(e){for(var i=[],n=[],s=[],r=[],o=Number.MAX_VALUE,a=0;a<e.length;++a)if(F(e,a))for(var h=0;h<e.length;++h)if(p(e,a,h)){n=t(g(e,a,h,r)),s=t(g(e,h,a,r));for(var l=0;l<s.length;l++)n.push(s[l]);n.length<o&&(o=(i=n).length,i.push([E(e,a),E(e,h)]))}return i}(t);return 0<e.length?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],s=0;s<i.length;s++)for(var r=i[s],o=0;o<n.length;o++){var a=n[o],h=t(a,r);if(h){n.splice(o,1),n.push(h[0],h[1]);break}}return n}var r=i,s=e.indexOf(r[0]),o=e.indexOf(r[1]);return-1!==s&&-1!==o&&[g(e,s,o),g(e,o,s)]}(t,e):[t]},quickDecomp:function t(e,i,n,s,r,o,a){o=o||100,a=a||0,r=r||25,i=void 0!==i?i:[],n=n||[],s=s||[];var h=[0,0],l=[0,0],u=[0,0],c=0,d=0,f=0,p=0,g=0,v=0,y=0,m=[],x=[],w=e,b=e;if(b.length<3)return i;if(o<++a)return console.warn("quickDecomp: max level ("+o+") reached."),i;for(var T=0;T<e.length;++T)if(F(w,T)){n.push(w[T]),c=d=Number.MAX_VALUE;for(var S=0;S<e.length;++S)_(E(w,T-1),E(w,T),E(w,S))&&M(E(w,T-1),E(w,T),E(w,S-1))&&(u=R(E(w,T-1),E(w,T),E(w,S),E(w,S-1)),C(E(w,T+1),E(w,T),u)&&(f=P(w[T],u))<d&&(d=f,l=u,v=S)),_(E(w,T+1),E(w,T),E(w,S+1))&&M(E(w,T+1),E(w,T),E(w,S))&&(u=R(E(w,T+1),E(w,T),E(w,S),E(w,S+1)),_(E(w,T-1),E(w,T),u)&&(f=P(w[T],u))<c&&(c=f,h=u,g=S));if(v===(g+1)%e.length)u[0]=(l[0]+h[0])/2,u[1]=(l[1]+h[1])/2,s.push(u),T<g?(k(m,w,T,g+1),m.push(u),x.push(u),0!==v&&k(x,w,v,w.length),k(x,w,0,T+1)):(0!==T&&k(m,w,T,w.length),k(m,w,0,g+1),m.push(u),x.push(u),k(x,w,v,T+1));else{if(g<v&&(g+=e.length),p=Number.MAX_VALUE,g<v)return i;for(var S=v;S<=g;++S)A(E(w,T-1),E(w,T),E(w,S))&&M(E(w,T+1),E(w,T),E(w,S))&&(f=P(E(w,T),E(w,S)))<p&&L(w,T,S)&&(p=f,y=S%e.length);T<y?(k(m,w,T,y+1),0!==y&&k(x,w,y,b.length),k(x,w,0,T+1)):(0!==T&&k(m,w,T,b.length),k(m,w,0,y+1),k(x,w,y,T+1))}return m.length<x.length?(t(m,i,n,s,r,o,a),t(x,i,n,s,r,o,a)):(t(x,i,n,s,r,o,a),t(m,i,n,s,r,o,a)),i}return i.push(e),i},isSimple:function(t){var e,i=t;for(e=0;e<i.length-1;e++)for(var n=0;n<e-1;n++)if(s(i[e],i[e+1],i[n],i[n+1]))return!1;for(e=1;e<i.length-2;e++)if(s(i[0],i[i.length-1],i[e],i[e+1]))return!1;return!0},removeCollinearPoints:function(t,e){for(var i=0,n=t.length-1;3<t.length&&0<=n;--n)r(E(t,n-1),E(t,n),E(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;1<=i;--i)for(var n=t[i],s=i-1;0<=s;--s)r=n,o=t[s],a=e,v(r[0],o[0],a)&&v(r[1],o[1],a)&&t.splice(i,1);var r,o,a},makeCCW:function(t){for(var e=0,i=t,n=1;n<t.length;++n)(i[n][1]<i[e][1]||i[n][1]===i[e][1]&&i[n][0]>i[e][0])&&(e=n);return!_(E(t,e-1),E(t,e),E(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(var n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var u=[],c=[];function r(t,e,i,n){if(n){var s=u,r=c;s[0]=e[0]-t[0],s[1]=e[1]-t[1],r[0]=i[0]-e[0],r[1]=i[1]-e[1];var o=s[0]*r[0]+s[1]*r[1],a=Math.sqrt(s[0]*s[0]+s[1]*s[1]),h=Math.sqrt(r[0]*r[0]+r[1]*r[1]);return Math.acos(o/(a*h))<n}return 0===l(t,e,i)}function P(t,e){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function E(t,e){var i=t.length;return t[e<0?e%i+i:e%i]}function k(t,e,i,n){for(var s=i;s<n;s++)t.push(e[s])}function F(t,e){return C(E(t,e-1),E(t,e),E(t,e+1))}var d=[],f=[];function p(t,e,i){var n,s,r=d,o=f;if(A(E(t,e+1),E(t,e),E(t,i))&&M(E(t,e-1),E(t,e),E(t,i)))return!1;s=P(E(t,e),E(t,i));for(var a=0;a!==t.length;++a)if((a+1)%t.length!==e&&a!==e&&A(E(t,e),E(t,i),E(t,a+1))&&M(E(t,e),E(t,i),E(t,a))&&(r[0]=E(t,e),r[1]=E(t,i),o[0]=E(t,a),o[1]=E(t,a+1),n=h(r,o),P(E(t,e),n)<s))return!1;return!0}function L(t,e,i){for(var n=0;n!==t.length;++n)if(n!==e&&n!==i&&(n+1)%t.length!==e&&(n+1)%t.length!==i&&s(E(t,e),E(t,i),E(t,n),E(t,n+1)))return!1;return!0}function g(t,e,i,n){var s=n||[];if(s.length=0,e<i)for(var r=e;r<=i;r++)s.push(t[r]);else{for(r=0;r<=i;r++)s.push(t[r]);for(r=e;r<t.length;r++)s.push(t[r])}return s}function R(t,e,i,n,s){s=s||0;var r=e[1]-t[1],o=t[0]-e[0],a=r*t[0]+o*t[1],h=n[1]-i[1],l=i[0]-n[0],u=h*i[0]+l*i[1],c=r*l-h*o;return v(c,0,s)?[0,0]:[(l*a-o*u)/c,(r*u-h*a)/c]}function v(t,e,i){return i=i||0,Math.abs(t-e)<=i}},function(t,e,i){var h=i(126),n=i(0),d=i(1068),o=i(194),s=i(1104),f=i(1067),a=i(1066),r=i(504),l=i(1090),u=new n({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,n,s){var r=h.rectangle(t,e,i,n,s);return this.world.add(r),r},trapezoid:function(t,e,i,n,s,r){var o=h.trapezoid(t,e,i,n,s,r);return this.world.add(o),o},circle:function(t,e,i,n,s){var r=h.circle(t,e,i,n,s);return this.world.add(r),r},polygon:function(t,e,i,n,s){var r=h.polygon(t,e,i,n,s);return this.world.add(r),r},fromVertices:function(t,e,i,n,s,r,o){var a=h.fromVertices(t,e,i,n,s,r,o);return this.world.add(a),a},imageStack:function(n,s,t,e,i,r,o,a,h){void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h={});var l=this.world,u=this.sys.displayList;h.addToWorld=!1;var c=d.stack(t,e,i,r,o,a,function(t,e){var i=new f(l,t,e,n,s,h);return u.add(i),i.body});return l.add(c),c},stack:function(t,e,i,n,s,r,o){var a=d.stack(t,e,i,n,s,r,o);return this.world.add(a),a},pyramid:function(t,e,i,n,s,r,o){var a=d.pyramid(t,e,i,n,s,r,o);return this.world.add(a),a},chain:function(t,e,i,n,s,r){return d.chain(t,e,i,n,s,r)},mesh:function(t,e,i,n,s){return d.mesh(t,e,i,n,s)},newtonsCradle:function(t,e,i,n,s){var r=d.newtonsCradle(t,e,i,n,s);return this.world.add(r),r},car:function(t,e,i,n,s){var r=d.car(t,e,i,n,s);return this.world.add(r),r},softBody:function(t,e,i,n,s,r,o,a,h,l){var u=d.softBody(t,e,i,n,s,r,o,a,h,l);return this.world.add(u),u},joint:function(t,e,i,n,s){return this.constraint(t,e,i,n,s)},spring:function(t,e,i,n,s){return this.constraint(t,e,i,n,s)},constraint:function(t,e,i,n,s){void 0===n&&(n=1),void 0===s&&(s={}),s.bodyA="body"===t.type?t:t.body,s.bodyB="body"===e.type?e:e.body,s.length=i,s.stiffness=n;var r=o.create(s);return this.world.add(r),r},worldConstraint:function(t,e,i,n){void 0===i&&(i=1),void 0===n&&(n={}),n.bodyB="body"===t.type?t:t.body,n.length=e,n.stiffness=i;var s=o.create(n);return this.world.add(s),s},mouseSpring:function(t){return this.pointerConstraint(t)},pointerConstraint:function(t){void 0===t&&(t={}),t.hasOwnProperty("render")||(t.render={visible:!1});var e=new l(this.scene,this.world,t);return this.world.add(e.constraint),e},image:function(t,e,i,n,s){var r=new f(this.world,t,e,i,n,s);return this.sys.displayList.add(r),r},tileBody:function(t,e){return new r(this.world,t,e)},sprite:function(t,e,i,n,s){var r=new a(this.world,t,e,i,n,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),r},gameObject:function(t,e){return s(this.world,t,e)},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=u},function(t,e,i){var r=i(1077),n=i(0),a=i(224),f=i(1076),p=i(11),g=i(2),d=i(85),v=i(95),s=i(1108),o=i(29),h=i(223),l=new n({Extends:p,initialize:function(t,e){p.call(this),this.scene=t,this.bodies=new v,this.gravity=g(e,"gravity",0),this.cellSize=g(e,"cellSize",64),this.collisionMap=new f,this.timeScale=g(e,"timeScale",1),this.maxStep=g(e,"maxStep",.05),this.enabled=!0,this.drawDebug=g(e,"debug",!1),this.debugGraphic;var i=g(e,"maxVelocity",100);if(this.defaults={debugShowBody:g(e,"debugShowBody",!0),debugShowVelocity:g(e,"debugShowVelocity",!0),bodyDebugColor:g(e,"debugBodyColor",16711935),velocityDebugColor:g(e,"debugVelocityColor",65280),maxVelocityX:g(e,"maxVelocityX",i),maxVelocityY:g(e,"maxVelocityY",i),minBounceVelocity:g(e,"minBounceVelocity",40),gravityFactor:g(e,"gravityFactor",1),bounciness:g(e,"bounciness",0)},this.walls={left:null,right:null,top:null,bottom:null},this.delta=0,this._lastId=0,g(e,"setBounds",!1)){var n=e.setBounds;if("boolean"==typeof n)this.setBounds();else{var s=g(n,"x",0),r=g(n,"y",0),o=g(n,"width",t.sys.game.config.width),a=g(n,"height",t.sys.game.config.height),h=g(n,"thickness",64),l=g(n,"left",!0),u=g(n,"right",!0),c=g(n,"top",!0),d=g(n,"bottom",!0);this.setBounds(s,r,o,a,h,l,u,c,d)}}this.drawDebug&&this.createDebugGraphic()},setCollisionMap:function(t,e){if("string"==typeof t){var i=this.scene.cache.tilemap.get(t);if(!i||i.format!==o.WELTMEISTER)return console.warn("The specified key does not correspond to a Weltmeister tilemap: "+t),null;for(var n,s=i.data.layer,r=0;r<s.length;r++)if("collision"===s[r].name){n=s[r];break}void 0===e&&(e=n.tilesize),this.collisionMap=new f(e,n.data)}else Array.isArray(t)?this.collisionMap=new f(e,t):console.warn("Invalid Weltmeister collision map data: "+t);return this.collisionMap},setCollisionMapFromTilemapLayer:function(t,e){void 0===e&&(e={});for(var i=g(e,"slopeProperty",null),n=g(e,"slopeMap",null),s=g(e,"defaultCollidingSlope",null),r=g(e,"defaultNonCollidingSlope",0),o=t.layer,a=o.baseTileWidth,h=[],l=0;l<o.height;l++){h[l]=[];for(var u=0;u<o.width;u++){var c=o.data[l][u];c&&c.collides?null!==i&&d(c.properties,i)?h[l][u]=parseInt(c.properties[i],10):null!==n&&d(n,c.index)?h[l][u]=n[c.index]:h[l][u]=null!==s?s:c.index:h[l][u]=r}}return this.collisionMap=new f(a,h),this.collisionMap},setBounds:function(t,e,i,n,s,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.game.config.width),void 0===n&&(n=this.scene.sys.game.config.height),void 0===s&&(s=64),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e,s,n),this.updateWall(o,"right",t+i,e,s,n),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?o?o.resetSize(i,n,s,r):(this.walls[e]=this.create(i,n,s,r),this.walls[e].name=e,this.walls[e].gravityFactor=0,this.walls[e].collides=a.FIXED):(o&&this.bodies.remove(o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},getNextID:function(){return this._lastId++},create:function(t,e,i,n){var s=new r(this,t,e,i,n);return this.bodies.set(s),s},remove:function(t){this.bodies.delete(t)},pause:function(){return this.enabled=!1,this.emit("pause"),this},resume:function(){return this.enabled=!0,this.emit("resume"),this},update:function(t,e){if(this.enabled&&0!==this.bodies.size){var i,n,s=Math.min(e/1e3,this.maxStep)*this.timeScale;this.delta=s;var r=this.bodies.entries,o=r.length,a={},h=this.cellSize;for(i=0;i<o;i++)(n=r[i]).enabled&&n.update(s);for(i=0;i<o;i++)(n=r[i])&&!n.skipHash()&&this.checkHash(n,a,h);if(this.drawDebug){var l=this.debugGraphic;for(l.clear(),i=0;i<o;i++)(n=r[i])&&n.willDrawDebug()&&n.drawDebug(l)}}},checkHash:function(t,e,i){for(var n={},s=Math.floor(t.pos.x/i),r=Math.floor(t.pos.y/i),o=Math.floor((t.pos.x+t.size.x)/i)+1,a=Math.floor((t.pos.y+t.size.y)/i)+1,h=s;h<o;h++)for(var l=r;l<a;l++)if(e[h])if(e[h][l]){for(var u=e[h][l],c=0;c<u.length;c++)t.touches(u[c])&&!n[u[c].id]&&(n[u[c].id]=!0,this.checkBodies(t,u[c]));u.push(t)}else e[h][l]=[t];else e[h]={},e[h][l]=[t]},checkBodies:function(t,e){t.collides===a.FIXED&&e.collides===a.FIXED||(t.checkAgainst&e.type&&t.check(e),e.checkAgainst&t.type&&e.check(t),t.collides&&e.collides&&t.collides+e.collides>a.ACTIVE&&s(this,t,e))},setCollidesNever:function(t){for(var e=0;e<t.length;e++)t[e].collides=a.NEVER;return this},setLite:function(t){for(var e=0;e<t.length;e++)t[e].collides=a.LITE;return this},setPassive:function(t){for(var e=0;e<t.length;e++)t[e].collides=a.PASSIVE;return this},setActive:function(t){for(var e=0;e<t.length;e++)t[e].collides=a.ACTIVE;return this},setFixed:function(t){for(var e=0;e<t.length;e++)t[e].collides=a.FIXED;return this},setTypeNone:function(t){for(var e=0;e<t.length;e++)t[e].type=h.NONE;return this},setTypeA:function(t){for(var e=0;e<t.length;e++)t[e].type=h.A;return this},setTypeB:function(t){for(var e=0;e<t.length;e++)t[e].type=h.B;return this},setAvsB:function(t){for(var e=0;e<t.length;e++)t[e].type=h.A,t[e].checkAgainst=h.B;return this},setBvsA:function(t){for(var e=0;e<t.length;e++)t[e].type=h.B,t[e].checkAgainst=h.A;return this},setCheckAgainstNone:function(t){for(var e=0;e<t.length;e++)t[e].checkAgainst=h.NONE;return this},setCheckAgainstA:function(t){for(var e=0;e<t.length;e++)t[e].checkAgainst=h.A;return this},setCheckAgainstB:function(t){for(var e=0;e<t.length;e++)t[e].checkAgainst=h.B;return this},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners(),this.scene=null,this.bodies.clear(),this.bodies=null,this.collisionMap=null}});t.exports=l},function(t,e,i){var n=i(0),s=i(506),r=i(61),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),((this.body.parent=this).body.gameObject=this).size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(0),s=i(506),r=i(87),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),((this.body.parent=this).body.gameObject=this).size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(0),s=i(506),r=new n({Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){this.body=t.create(e,i,n,s),(this.body.parent=this).size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=r},function(t,e,i){var n=i(0),s=i(1074),r=i(1073),o=i(1072),a=new n({initialize:function(t){this.world=t,this.sys=t.scene.sys},body:function(t,e,i,n){return new s(this.world,t,e,i,n)},existing:function(t){var e=t.x-t.frame.centerX,i=t.y-t.frame.centerY,n=t.width,s=t.height;return t.body=this.world.create(e,i,n,s),(t.body.parent=t).body.gameObject=t},image:function(t,e,i,n){var s=new r(this.world,t,e,i,n);return this.sys.displayList.add(s),s},sprite:function(t,e,i,n){var s=new o(this.world,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),s},destroy:function(){this.world=null,this.sys=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1122),r=new n({initialize:function(t,e){void 0===t&&(t=32),this.tilesize=t,this.data=Array.isArray(e)?e:[],this.width=Array.isArray(e)?e[0].length:0,this.height=Array.isArray(e)?e.length:0,this.lastSlope=55,this.tiledef=s},trace:function(t,e,i,n,s,r){var o={collision:{x:!1,y:!1,slope:!1},pos:{x:t+i,y:e+n},tile:{x:0,y:0}};if(!this.data)return o;var a=Math.ceil(Math.max(Math.abs(i),Math.abs(n))/this.tilesize);if(1<a)for(var h=i/a,l=n/a,u=0;u<a&&(h||l)&&(this.step(o,t,e,h,l,s,r,i,n,u),t=o.pos.x,e=o.pos.y,o.collision.x&&(i=h=0),o.collision.y&&(n=l=0),!o.collision.slope);u++);else this.step(o,t,e,i,n,s,r,i,n,0);return o},step:function(t,e,i,n,s,r,o,a,h,l){var u,c,d=0,f=this.tilesize,p=this.width,g=this.height;if(n){var v=0<n?r:0,y=n<0?f:0,m=Math.max(Math.floor(i/f),0),x=Math.min(Math.ceil((i+o)/f),g);u=Math.floor((t.pos.x+v)/f);var w=Math.floor((e+v)/f);if((0<l||u===w||w<0||p<=w)&&(w=-1),0<=u&&u<p)for(c=m;c<x&&!(-1!==w&&1<(d=this.data[c][w])&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,w,c));c++)if(1===(d=this.data[c][u])||d>this.lastSlope||1<d&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(1<d&&d<=this.lastSlope&&t.collision.slope)break;t.collision.x=!0,t.tile.x=d,t.pos.x=u*f-v+y,e=t.pos.x,a=0;break}}if(s){var b=0<s?o:0,T=s<0?f:0,S=Math.max(Math.floor(t.pos.x/f),0),_=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+b)/f);var A=Math.floor((i+b)/f);if((0<l||c===A||A<0||g<=A)&&(A=-1),0<=c&&c<g)for(u=S;u<_&&!(-1!==A&&1<(d=this.data[A][u])&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,A));u++)if(1===(d=this.data[c][u])||d>this.lastSlope||1<d&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(1<d&&d<=this.lastSlope&&t.collision.slope)break;t.collision.y=!0,t.tile.y=d,t.pos.y=c*f-b+T;break}}},checkDef:function(t,e,i,n,s,r,o,a,h,l){var u=this.tiledef[e];if(!u)return!1;var c=this.tilesize,d=(h+u[0])*c,f=(l+u[1])*c,p=(u[2]-u[0])*c,g=(u[3]-u[1])*c,v=u[4],y=i+s+(g<0?o:0)-d,m=n+r+(0<p?a:0)-f;if(0<p*m-g*y){if(s*-g+r*p<0)return v;var x=Math.sqrt(p*p+g*g),w=g/x,b=-p/x,T=y*w+m*b,S=w*T,_=b*T;return s*s+r*r<=S*S+_*_?v||p*(m-r)-g*(y-s)<.5:(t.pos.x=i+s-S,t.pos.y=n+r-_,t.collision.slope={x:p,y:g,nx:w,ny:b},!0)}return!1}});t.exports=r},function(t,e,i){var n=i(0),r=i(224),o=i(1124),a=i(223),h=i(1123),s=new n({initialize:function(t,e,i,n,s){void 0===n&&(n=16),void 0===s&&(s=n),this.world=t,this.gameObject=null,this.enabled=!0,this.parent,this.id=t.getNextID(),this.name="",this.size={x:n,y:s},this.offset={x:0,y:0},this.pos={x:e,y:i},this.last={x:e,y:i},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:t.defaults.maxVelocityX,y:t.defaults.maxVelocityY},this.standing=!1,this.gravityFactor=t.defaults.gravityFactor,this.bounciness=t.defaults.bounciness,this.minBounceVelocity=t.defaults.minBounceVelocity,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=a.NONE,this.checkAgainst=a.NONE,this.collides=r.NEVER,this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.updateCallback,this.slopeStanding={min:.767944870877505,max:2.3736477827122884}},reset:function(t,e){this.pos={x:t,y:e},this.last={x:t,y:e},this.vel={x:0,y:0},this.accel={x:0,y:0},this.friction={x:0,y:0},this.maxVel={x:100,y:100},this.standing=!1,this.gravityFactor=1,this.bounciness=0,this.minBounceVelocity=40,this.accelGround=0,this.accelAir=0,this.jumpSpeed=0,this.type=a.NONE,this.checkAgainst=a.NONE,this.collides=r.NEVER},update:function(t){var e=this.pos;this.last.x=e.x,this.last.y=e.y,this.vel.y+=this.world.gravity*t*this.gravityFactor,this.vel.x=o(t,this.vel.x,this.accel.x,this.friction.x,this.maxVel.x),this.vel.y=o(t,this.vel.y,this.accel.y,this.friction.y,this.maxVel.y);var i=this.vel.x*t,n=this.vel.y*t,s=this.world.collisionMap.trace(e.x,e.y,i,n,this.size.x,this.size.y);this.handleMovementTrace(s)&&h(this,s);var r=this.gameObject;r&&(r.x=e.x-this.offset.x+r.displayOriginX*r.scaleX,r.y=e.y-this.offset.y+r.displayOriginY*r.scaleY),this.updateCallback&&this.updateCallback(this)},drawDebug:function(t){var e=this.pos;if(this.debugShowBody&&(t.lineStyle(1,this.debugBodyColor,1),t.strokeRect(e.x,e.y,this.size.x,this.size.y)),this.debugShowVelocity){var i=e.x+this.size.x/2,n=e.y+this.size.y/2;t.lineStyle(1,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.vel.x,n+this.vel.y)}},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},skipHash:function(){return!this.enabled||0===this.type&&0===this.checkAgainst&&0===this.collides},touches:function(t){return!(this.pos.x>=t.pos.x+t.size.x||this.pos.x+this.size.x<=t.pos.x||this.pos.y>=t.pos.y+t.size.y||this.pos.y+this.size.y<=t.pos.y)},resetSize:function(t,e,i,n){return this.pos.x=t,this.pos.y=e,this.size.x=i,this.size.y=n,this},toJSON:function(){return{name:this.name,size:{x:this.size.x,y:this.size.y},pos:{x:this.pos.x,y:this.pos.y},vel:{x:this.vel.x,y:this.vel.y},accel:{x:this.accel.x,y:this.accel.y},friction:{x:this.friction.x,y:this.friction.y},maxVel:{x:this.maxVel.x,y:this.maxVel.y},gravityFactor:this.gravityFactor,bounciness:this.bounciness,minBounceVelocity:this.minBounceVelocity,type:this.type,checkAgainst:this.checkAgainst,collides:this.collides}},fromJSON:function(){},check:function(){},collideWith:function(t,e){this.parent&&this.parent._collideCallback&&this.parent._collideCallback.call(this.parent._callbackScope,this,t,e)},handleMovementTrace:function(){return!0},destroy:function(){this.world.remove(this),this.enabled=!1,this.world=null,this.gameObject=null,this.parent=null}});t.exports=s},,function(t,e,i){t.exports={BitmapMaskPipeline:i(421),ForwardDiffuseLightPipeline:i(420),TextureTintPipeline:i(196)}},function(t,e,i){t.exports={Utils:i(10),WebGLPipeline:i(197),WebGLRenderer:i(423),Pipelines:i(1079),BYTE:0,SHORT:1,UNSIGNED_BYTE:2,UNSIGNED_SHORT:3,FLOAT:4}},function(t,e,i){t.exports={Canvas:i(425),WebGL:i(422)}},function(t,e,i){t.exports={CanvasRenderer:i(426),GetBlendModes:i(424),SetTransform:i(22)}},function(t,e,i){t.exports={Canvas:i(1082),Snapshot:i(1081),WebGL:i(1080)}},function(t,e,i){var a=i(501),h={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.13.1",silent:!0,install:function(t){t.after("Engine.update",function(){h.Engine.update(this)})},Engine:{update:function(t){for(var e=t.world,i=a.Composite.allBodies(e),n=a.Composite.allComposites(e),s=0;s<i.length;s+=1){var r=i[s];r.plugin.wrap&&h.Body.wrap(r,r.plugin.wrap)}for(s=0;s<n.length;s+=1){var o=n[s];o.plugin.wrap&&h.Composite.wrap(o,o.plugin.wrap)}}},Bounds:{wrap:function(t,e){var i=null,n=null;if(void 0!==e.min.x&&void 0!==e.max.x&&(t.min.x>e.max.x?i=e.min.x-t.max.x:t.max.x<e.min.x&&(i=e.max.x-t.min.x)),void 0!==e.min.y&&void 0!==e.max.y&&(t.min.y>e.max.y?n=e.min.y-t.max.y:t.max.y<e.min.y&&(n=e.max.y-t.min.y)),null!==i||null!==n)return{x:i||0,y:n||0}}},Body:{wrap:function(t,e){var i=h.Bounds.wrap(t.bounds,e);return i&&a.Body.translate(t,i),i}},Composite:{bounds:function(t){for(var e=a.Composite.allBodies(t),i=[],n=0;n<e.length;n+=1){var s=e[n];i.push(s.bounds.min,s.bounds.max)}return a.Bounds.create(i)},wrap:function(t,e){var i=h.Bounds.wrap(h.Composite.bounds(t),e);return i&&a.Composite.translate(t,i),i}}};t.exports=h},function(t,e,i){var c=i(501),a={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.13.1",silent:!0,install:function(t){t.after("Body.create",function(){a.Body.init(this)}),t.before("Engine.update",function(t){a.Engine.update(t)})},Body:{init:function(t){t.plugin.attractors=t.plugin.attractors||[]}},Engine:{update:function(t){for(var e=t.world,i=c.Composite.allBodies(e),n=0;n<i.length;n+=1){var s=i[n],r=s.plugin.attractors;if(r&&0<r.length)for(var o=n+1;o<i.length;o+=1)for(var a=i[o],h=0;h<r.length;h+=1){var l=r[h],u=l;c.Common.isFunction(l)&&(u=l(s,a)),u&&c.Body.applyForce(a,a.position,u)}}}},Attractors:{gravityConstant:.001,gravity:function(t,e){var i=c.Vector.sub(e.position,t.position),n=c.Vector.magnitudeSquared(i)||1e-4,s=c.Vector.normalise(i),r=-a.Attractors.gravityConstant*(t.mass*e.mass/n),o=c.Vector.mult(s,r);c.Body.applyForce(t,t.position,c.Vector.neg(o)),c.Body.applyForce(e,e.position,o)}}};t.exports=a},function(t,e,i){var n=i(0),s=i(1070),r=i(2),o=i(4),a=i(1085),h=i(1065),l=i(1084),u=i(96),c=i(500),d=i(15),f=i(1060),p=i(76),g=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this.verts=p,o(this.config,"plugins.attractors",!1)&&(c.register(a),c.use(h,a)),o(this.config,"plugins.wrap",!1)&&(c.register(l),c.use(h,l)),t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.world=new f(this.scene,this.config),this.add=new s(this.world),this.systems.events.once("destroy",this.destroy,this)},start:function(){this.world||(this.world=new f(this.scene,this.config),this.add=new s(this.world));var t=this.systems.events;t.on("update",this.world.update,this.world),t.on("postupdate",this.world.postUpdate,this.world),t.once("shutdown",this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return u(r(e,"matter",{}),r(t,"matter",{}))},enableAttractorPlugin:function(){return c.register(a),c.use(h,a),this},enableWrapPlugin:function(){return c.register(l),c.use(h,l),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(t,e){this.world.step(t,e)},shutdown:function(){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("postupdate",this.world.postUpdate,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});d.register("MatterPhysics",g,"matterPhysics"),t.exports=g},function(t,e,i){var x={};t.exports=x,i(80);var w=i(33);x.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||w.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,n,s,r,o,a,h,l,u,c,d,f=[],p=0,g=0,v=0;e=e||15;var y=function(t,e,i){var n=i%2==1&&1<i;if(!u||t!=u.x||e!=u.y){d=u&&n?(c=u.x,u.y):c=0;var s={x:c+t,y:d+e};!n&&u||(u=s),f.push(s),g=c+t,v=d+e}},m=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":g=t.x,v=t.y;break;case"H":g=t.x;break;case"V":v=t.y}y(g,v,t.pathSegType)}};for(x._svgPathToAbsolute(t),s=t.getTotalLength(),a=[],i=0;i<t.pathSegList.numberOfItems;i+=1)a.push(t.pathSegList.getItem(i));for(h=a.concat();p<s;){if((o=a[t.getPathSegAtLength(p)])!=l){for(;h.length&&h[0]!=o;)m(h.shift());l=o}switch(o.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":r=t.getPointAtLength(p),y(r.x,r.y,0)}p+=e}for(i=0,n=h.length;i<n;++i)m(h[i]);return f},x._svgPathToAbsolute=function(t){for(var e,i,n,s,r,o,a=t.pathSegList,h=0,l=0,u=a.numberOfItems,c=0;c<u;++c){var d=a.getItem(c),f=d.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(f))"x"in d&&(h=d.x),"y"in d&&(l=d.y);else switch("x1"in d&&(n=h+d.x1),"x2"in d&&(r=h+d.x2),"y1"in d&&(s=l+d.y1),"y2"in d&&(o=l+d.y2),"x"in d&&(h+=d.x),"y"in d&&(l+=d.y),f){case"m":a.replaceItem(t.createSVGPathSegMovetoAbs(h,l),c);break;case"l":a.replaceItem(t.createSVGPathSegLinetoAbs(h,l),c);break;case"h":a.replaceItem(t.createSVGPathSegLinetoHorizontalAbs(h),c);break;case"v":a.replaceItem(t.createSVGPathSegLinetoVerticalAbs(l),c);break;case"c":a.replaceItem(t.createSVGPathSegCurvetoCubicAbs(h,l,n,s,r,o),c);break;case"s":a.replaceItem(t.createSVGPathSegCurvetoCubicSmoothAbs(h,l,r,o),c);break;case"q":a.replaceItem(t.createSVGPathSegCurvetoQuadraticAbs(h,l,n,s),c);break;case"t":a.replaceItem(t.createSVGPathSegCurvetoQuadraticSmoothAbs(h,l),c);break;case"a":a.replaceItem(t.createSVGPathSegArcAbs(h,l,d.r1,d.r2,d.angle,d.largeArcFlag,d.sweepFlag),c);break;case"z":case"Z":h=e,l=i}"M"!=f&&"m"!=f||(e=h,i=l)}}},function(t,e,i){var n={};t.exports=n;var s=i(137),r=i(33);n.create=function(t){return r.extend({extended:!1,narrowDetections:0,narrowphaseTests:0,narrowReuse:0,narrowReuseCount:0,midphaseTests:0,broadphaseTests:0,narrowEff:1e-4,midEff:1e-4,broadEff:1e-4,collisions:0,buckets:0,bodies:0,pairs:0},!1,t)},n.reset=function(t){t.extended&&(t.narrowDetections=0,t.narrowphaseTests=0,t.narrowReuse=0,t.narrowReuseCount=0,t.midphaseTests=0,t.broadphaseTests=0,t.narrowEff=0,t.midEff=0,t.broadEff=0,t.collisions=0,t.buckets=0,t.pairs=0,t.bodies=0)},n.update=function(t,e){if(t.extended){var i=e.world,n=s.allBodies(i);t.collisions=t.narrowDetections,t.pairs=e.pairs.list.length,t.bodies=n.length,t.midEff=(t.narrowDetections/(t.midphaseTests||1)).toFixed(2),t.narrowEff=(t.narrowDetections/(t.narrowphaseTests||1)).toFixed(2),t.broadEff=(1-t.broadphaseTests/(n.length||1)).toFixed(2),t.narrowReuse=(t.narrowReuseCount/(t.narrowphaseTests||1)).toFixed(2)}}},function(t,e,i){var d={};t.exports=d;var f=i(81),h=i(502),l=i(80),p=i(126),a=i(76);d.collides=function(t,e){for(var i=[],n=0;n<e.length;n++){var s=e[n];if(l.overlaps(s.bounds,t.bounds))for(var r=1===s.parts.length?0:1;r<s.parts.length;r++){var o=s.parts[r];if(l.overlaps(o.bounds,t.bounds)){var a=h.collides(o,t);if(a.collided){i.push(a);break}}}}return i},d.ray=function(t,e,i,n){n=n||1e-100;for(var s=f.angle(e,i),r=f.magnitude(f.sub(e,i)),o=.5*(i.x+e.x),a=.5*(i.y+e.y),h=p.rectangle(o,a,r,n,{angle:s}),l=d.collides(h,t),u=0;u<l.length;u+=1){var c=l[u];c.body=c.bodyB=c.bodyA}return l},d.region=function(t,e,i){for(var n=[],s=0;s<t.length;s++){var r=t[s],o=l.overlaps(r.bounds,e);(o&&!i||!o&&i)&&n.push(r)}return n},d.point=function(t,e){for(var i=[],n=0;n<t.length;n++){var s=t[n];if(l.contains(s.bounds,e))for(var r=1===s.parts.length?0:1;r<s.parts.length;r++){var o=s.parts[r];if(l.contains(o.bounds,e)&&a.contains(o.vertices,e)){i.push(s);break}}}return i}},function(t,e,i){var o=i(80),n=i(0),a=i(137),s=i(194),h=i(503),r=i(2),l=i(96),u=i(222),c=i(3),d=i(76),f=new n({initialize:function(t,e,i){void 0===i&&(i={}),this.scene=t,this.world=e;var n=r(i,"camera",null);n?(this.camera=n,delete i.camera):this.camera=t.sys.cameras.main,this.pointer=null,this.active=!0,this.position=new c,this.constraint=s.create(l(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},damping:0,length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on("beforeupdate",this.update,this),t.sys.input.on("pointerdown",this.onDown,this),t.sys.input.on("pointerup",this.onUp,this)},onDown:function(t){this.pointer=t},onUp:function(){this.pointer=null},getBodyPart:function(t,e){for(var i=this.constraint,n=1<t.parts.length?1:0;n<t.parts.length;n++){var s=t.parts[n];if(d.contains(s.vertices,e))return i.bodyB=t,i.pointA.x=e.x,i.pointA.y=e.y,i.pointB.x=e.x-t.position.x,i.pointB.y=e.y-t.position.y,i.angleB=t.angle,u.set(t,!1),!0}return!1},update:function(){if(this.active){var t=this.pointer,e=this.constraint;if(t){var i=this.position;if(this.camera.getWorldPoint(t.x,t.y,i),e.bodyB)u.set(e.bodyB,!1),e.pointA.x=i.x,e.pointA.y=i.y;else for(var n=a.allBodies(this.world.localWorld),s=0;s<n.length;s++){var r=n[s];if(!r.ignorePointer&&o.contains(r.bounds,i)&&h.canCollide(r.collisionFilter,e.collisionFilter)&&this.getBodyPart(r,i))break}}else e.bodyB&&(e.bodyB=null)}},destroy:function(){this.world.removeConstraint(this.constraint),this.constraint=null,this.world.off("beforeupdate",this.update),this.scene.sys.input.off("pointerdown",this.onDown,this),this.scene.sys.input.off("pointerup",this.onUp,this)}});t.exports=f},function(t,e,i){var n=i(67),s={setAngularVelocity:function(t){return n.setAngularVelocity(this.body,t),this},setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),n.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),n.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),n.setVelocity(this.body,this._tempVec2),this}};t.exports=s},function(t,e,i){var r=i(67),n=i(16),s=i(199),o=i(198),a={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),r.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),r.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(t){var e=1/this._scaleX;this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,r.scale(this.body,e,this._scaleY),r.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){var e=1/this._scaleY;this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,r.scale(this.body,this._scaleX,e),r.scale(this.body,this._scaleX,t)}},angle:{get:function(){return o(this.body.angle*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=s(t),r.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),r.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=s(t),r.setAngle(this.body,t),this},setFixedRotation:function(){return r.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,r.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=t);var n=1/this._scaleX,s=1/this._scaleY;return this._scaleX=t,this._scaleY=e,r.scale(this.body,n,s,i),r.scale(this.body,t,e,i),this}};t.exports=a},function(t,e,i){var n=i(195),s={setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;n.on(this.body,"sleepStart",function(t){e.emit("sleepstart",t,this)})}else n.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;n.on(this.body,"sleepEnd",function(t){e.emit("sleepend",t,this)})}else n.off(this.body,"sleepEnd");return this}};t.exports=s},function(t,e,i){var o=i(126),p=i(67),g=i(80),v=i(33),d=i(2),y=i(81),m=i(76),n={parseBody:function(t,e,i,n,s){for(var r=d(s,"fixtures",[]),o=[],a=0;a<r.length;a++)for(var h=this.parseFixture(r[a]),l=0;l<h.length;l++)o.push(h[l]);var u=v.extend({},!1,s);delete u.fixtures,delete u.type;var c=p.create(u);return p.setParts(c,o),c.render.sprite.xOffset=c.position.x/i,c.render.sprite.yOffset=c.position.y/n,p.setPosition(c,{x:t,y:e}),c},parseFixture:function(t){var e,i=v.extend({},!1,t);if(delete i.circle,delete i.vertices,t.circle){var n=d(t.circle,"x"),s=d(t.circle,"y"),r=d(t.circle,"radius");e=[o.circle(n,s,r,i)]}else t.vertices&&(e=this.parseVertices(t.vertices,i));return e},parseVertices:function(t,e){var i,n,s,r,o,a=[];for(e=e||{},r=0;r<t.length;r+=1)a.push(p.create(v.extend({position:m.centre(t[r]),vertices:t[r]},e)));for(i=0;i<a.length;i++){var h=a[i];for(n=i+1;n<a.length;n++){var l=a[n];if(g.overlaps(h.bounds,l.bounds)){var u=h.vertices,c=l.vertices;for(s=0;s<h.vertices.length;s++)for(o=0;o<l.vertices.length;o++){var d=y.magnitudeSquared(y.sub(u[(s+1)%u.length],c[o])),f=y.magnitudeSquared(y.sub(u[s],c[(o+1)%c.length]));d<5&&f<5&&(u[s].isInternal=!0,c[o].isInternal=!0)}}}}return a}};t.exports=n},function(t,e,i){var y=i(126),m=i(67),x=i(2),w=i(1094),b=i(76),n={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,n){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},n)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body),this.body=t;for(var i=0;i<t.parts.length;i++)t.parts[i].gameObject=this;var n=this;return t.destroy=function(){n.world.remove(n.body),n.body.gameObject=null},e&&this.world.add(t),this._originComponent&&this.setOrigin(t.render.sprite.xOffset,t.render.sprite.yOffset),this},setBody:function(t,e){if(!t)return this;var i;"string"==typeof t&&(t={type:t});var n=x(t,"type","rectangle"),s=x(t,"x",this._tempVec2.x),r=x(t,"y",this._tempVec2.y),o=x(t,"width",this.width),a=x(t,"height",this.height);switch(n){case"rectangle":i=y.rectangle(s,r,o,a,e);break;case"circle":var h=x(t,"radius",Math.max(o,a)/2),l=x(t,"maxSides",25);i=y.circle(s,r,h,e,l);break;case"trapezoid":var u=x(t,"slope",.5);i=y.trapezoid(s,r,o,a,u,e);break;case"polygon":var c=x(t,"sides",5),d=x(t,"radius",Math.max(o,a)/2);i=y.polygon(s,r,c,d,e);break;case"fromVertices":case"fromVerts":var f=x(t,"verts",null);if(f)if("string"==typeof f&&(f=b.fromPath(f)),this.body&&!this.body.hasOwnProperty("temp"))m.setVertices(this.body,f),i=this.body;else{var p=x(t,"flagInternal",!1),g=x(t,"removeCollinear",.01),v=x(t,"minimumArea",10);i=y.fromVertices(s,r,f,e,p,g,v)}break;case"fromPhysicsEditor":i=w.parseBody(s,r,o,a,t)}return i&&this.setExistingBody(i,t.addToWorld),this}};t.exports=n},function(t,e){t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},function(t,e,i){var n=i(67),s={setStatic:function(t){return n.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=s},function(t,e,i){var n=i(67),s=i(3),r={setMass:function(t){return n.setMass(this.body,t),this},setDensity:function(t){return n.setDensity(this.body,t),this},centerOfMass:{get:function(){return new s(this.body.render.sprite.xOffset*this.width,this.body.render.sprite.yOffset*this.height)}}};t.exports=r},function(t,e){t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},function(t,e){t.exports={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}}},function(t,e,i){var n=i(67),s={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),n.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return n.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=s},function(t,e){var i={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i<t.length;i++)e|=t[i];else e=t;return this.body.collisionFilter.mask=e,this}};t.exports=i},function(t,e){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},function(t,e,i){var o=i(419),a=i(2),h=i(3);t.exports=function(t,n,e){void 0===e&&(e={});var i=n.x,s=n.y;n.body={temp:!0,position:{x:i,y:s}},[o.Bounce,o.Collision,o.Force,o.Friction,o.Gravity,o.Mass,o.Sensor,o.SetBody,o.Sleep,o.Static,o.Transform,o.Velocity].forEach(function(t){for(var e in t)(i=t[e]).get&&"function"==typeof i.get||i.set&&"function"==typeof i.set?Object.defineProperty(n,e,{get:t[e].get,set:t[e].set}):Object.defineProperty(n,e,{value:t[e]});var i}),n.world=t,n._tempVec2=new h(i,s);var r=a(e,"shape",null);return r||(r="rectangle"),n.setBody(r,e),n}},function(t,e,i){t.exports={Factory:i(1070),Image:i(1067),Matter:i(501),MatterPhysics:i(1086),PolyDecomp:i(1069),Sprite:i(1066),TileBody:i(504),World:i(1060)}},function(t,e){t.exports=function(t,e,i,n){var s,r,o=e.pos.y+e.size.y-i.pos.y;if(n){var a=e===n?i:e;n.vel.y=-n.vel.y*n.bounciness+a.vel.y,s=0,n===e&&Math.abs(n.vel.y-a.vel.y)<n.minBounceVelocity&&(n.standing=!0,s=a.vel.x*t.delta);var h=t.collisionMap.trace(n.pos.x,n.pos.y,s,n===e?-o:o,n.size.x,n.size.y);n.pos.y=h.pos.y,n.pos.x=h.pos.x}else if(t.gravity&&(i.standing||0<e.vel.y))r=t.collisionMap.trace(e.pos.x,e.pos.y,0,-(e.pos.y+e.size.y-i.pos.y),e.size.x,e.size.y),e.pos.y=r.pos.y,0<e.bounciness&&e.vel.y>e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0);else{var l=(e.vel.y-i.vel.y)/2;e.vel.y=-l,i.vel.y=l,s=i.vel.x*t.delta,r=t.collisionMap.trace(e.pos.x,e.pos.y,s,-o/2,e.size.x,e.size.y),e.pos.y=r.pos.y;var u=t.collisionMap.trace(i.pos.x,i.pos.y,0,o/2,i.size.x,i.size.y);i.pos.y=u.pos.y}}},function(t,e){t.exports=function(t,e,i,n){var s=e.pos.x+e.size.x-i.pos.x;if(n){var r=e===n?i:e;n.vel.x=-n.vel.x*n.bounciness+r.vel.x;var o=t.collisionMap.trace(n.pos.x,n.pos.y,n===e?-s:s,0,n.size.x,n.size.y);n.pos.x=o.pos.x}else{var a=(e.vel.x-i.vel.x)/2;e.vel.x=-a,i.vel.x=a;var h=t.collisionMap.trace(e.pos.x,e.pos.y,-s/2,0,e.size.x,e.size.y);e.pos.x=Math.floor(h.pos.x);var l=t.collisionMap.trace(i.pos.x,i.pos.y,s/2,0,i.size.x,i.size.y);i.pos.x=Math.ceil(l.pos.x)}}},function(t,e,i){var s=i(224),r=i(1107),o=i(1106);t.exports=function(t,e,i){var n=null;e.collides===s.LITE||i.collides===s.FIXED?n=e:i.collides!==s.LITE&&e.collides!==s.FIXED||(n=i),e.last.x+e.size.x>i.last.x&&e.last.x<i.last.x+i.size.x?(e.last.y<i.last.y?o(t,e,i,n):o(t,i,e,n),e.collideWith(i,"y"),i.collideWith(e,"y"),t.emit("collide",e,i,"y")):e.last.y+e.size.y>i.last.y&&e.last.y<i.last.y+i.size.y&&(e.last.x<i.last.x?r(t,e,i,n):r(t,i,e,n),e.collideWith(i,"x"),i.collideWith(e,"x"),t.emit("collide",e,i,"x"))}},function(t,e,i){var n=i(0),s=i(1075),r=i(2),o=i(96),a=i(15),h=i(1071),l=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once("boot",this.boot,this),t.sys.events.on("start",this.start,this)},boot:function(){this.world=new h(this.scene,this.config),this.add=new s(this.world),this.systems.events.once("destroy",this.destroy,this)},start:function(){this.world||(this.world=new h(this.scene,this.config),this.add=new s(this.world));var t=this.systems.events;t.on("update",this.world.update,this.world),t.once("shutdown",this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return o(r(e,"impact",{}),r(t,"impact",{}))},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},shutdown:function(){var t=this.systems.events;t.off("update",this.world.update,this.world),t.off("shutdown",this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off("start",this.start,this),this.scene=null,this.systems=null}});a.register("ImpactPhysics",l,"impactPhysics"),t.exports=l},function(t,e){t.exports={setVelocityX:function(t){return this.vel.x=t,this},setVelocityY:function(t){return this.vel.y=t,this},setVelocity:function(t,e){return void 0===e&&(e=t),this.vel.x=t,this.vel.y=e,this},setMaxVelocity:function(t,e){return void 0===e&&(e=t),this.maxVel.x=t,this.maxVel.y=e,this}}},function(t,e){t.exports={setGameObject:function(t,e){return void 0===e&&(e=!0),t?(this.body.gameObject=t,e&&this.syncGameObject()):this.body.gameObject=null,this},syncGameObject:function(){var t=this.body.gameObject;return t&&this.setBodySize(t.width*t.scaleX,t.height*t.scaleY),this}}},function(t,e){t.exports={setOffset:function(t,e,i,n){return this.body.offset.x=t,this.body.offset.y=e,i&&this.setBodySize(i,n),this}}},function(t,e){t.exports={setGravity:function(t){return this.body.gravityFactor=t,this},gravity:{get:function(){return this.body.gravityFactor},set:function(t){this.body.gravityFactor=t}}}},function(t,e){t.exports={setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setFriction:function(t,e){return this.friction.x=t,this.friction.y=e,this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e,i){var n=i(224),s={_collideCallback:null,_callbackScope:null,setCollideCallback:function(t,e){return this._collideCallback=t,e&&(this._callbackScope=e),this},setCollidesNever:function(){return this.body.collides=n.NEVER,this},setLiteCollision:function(){return this.body.collides=n.LITE,this},setPassiveCollision:function(){return this.body.collides=n.PASSIVE,this},setActiveCollision:function(){return this.body.collides=n.ACTIVE,this},setFixedCollision:function(){return this.body.collides=n.FIXED,this},collides:{get:function(){return this.body.collides},set:function(t){this.body.collides=t}}};t.exports=s},function(t,e,i){var n=i(223),s={setAvsB:function(){return this.setTypeA(),this.setCheckAgainstB()},setBvsA:function(){return this.setTypeB(),this.setCheckAgainstA()},setCheckAgainstNone:function(){return this.body.checkAgainst=n.NONE,this},setCheckAgainstA:function(){return this.body.checkAgainst=n.A,this},setCheckAgainstB:function(){return this.body.checkAgainst=n.B,this},checkAgainst:{get:function(){return this.body.checkAgainst},set:function(t){this.body.checkAgainst=t}}};t.exports=s},function(t,e){t.exports={setBounce:function(t){return this.body.bounciness=t,this},setMinBounceVelocity:function(t){return this.body.minBounceVelocity=t,this},bounce:{get:function(){return this.body.bounciness},set:function(t){this.body.bounciness=t}}}},function(t,e,i){var n=i(223),s={getBodyType:function(){return this.body.type},setTypeNone:function(){return this.body.type=n.NONE,this},setTypeA:function(){return this.body.type=n.A,this},setTypeB:function(){return this.body.type=n.B,this}};t.exports=s},function(t,e){var i={setBodySize:function(t,e){return void 0===e&&(e=t),this.body.size.x=Math.round(t),this.body.size.y=Math.round(e),this},setBodyScale:function(t,e){void 0===e&&(e=t);var i=this.body.gameObject;return i?(i.setScale(t,e),this.setBodySize(i.width*i.scaleX,i.height*i.scaleY)):this.setBodySize(this.body.size.x*t,this.body.size.y*e)}};t.exports=i},function(t,e){t.exports={setAccelerationX:function(t){return this.accel.x=t,this},setAccelerationY:function(t){return this.accel.y=t,this},setAcceleration:function(t,e){return this.accel.x=t,this.accel.y=e,this}}},function(t,e){t.exports={2:[0,1,1,0,!0],3:[0,1,1,.5,!0],4:[0,.5,1,0,!0],5:[0,1,1,2/3,!0],6:[0,2/3,1,1/3,!0],7:[0,1/3,1,0,!0],8:[.5,1,0,0,!0],9:[1,0,.5,1,!0],10:[.5,1,1,0,!0],11:[0,0,.5,1,!0],12:[0,0,1,0,!1],13:[1,1,0,0,!0],14:[1,.5,0,0,!0],15:[1,1,0,.5,!0],16:[1,1/3,0,0,!0],17:[1,2/3,0,1/3,!0],18:[1,1,0,2/3,!0],19:[1,1,.5,0,!0],20:[.5,0,0,1,!0],21:[0,1,.5,0,!0],22:[.5,0,1,1,!0],23:[1,1,0,1,!1],24:[0,0,1,1,!0],25:[0,0,1,.5,!0],26:[0,.5,1,1,!0],27:[0,0,1,1/3,!0],28:[0,1/3,1,2/3,!0],29:[0,2/3,1,1,!0],30:[1/3,1,0,0,!0],31:[1,0,2/3,1,!0],32:[2/3,1,1,0,!0],33:[0,0,1/3,1,!0],34:[1,0,1,1,!1],35:[1,0,0,1,!0],36:[1,.5,0,1,!0],37:[1,0,0,.5,!0],38:[1,2/3,0,1,!0],39:[1,1/3,0,2/3,!0],40:[1,0,0,1/3,!0],41:[2/3,1,1/3,0,!0],42:[2/3,0,1/3,1,!0],43:[1/3,1,2/3,0,!0],44:[1/3,0,2/3,1,!0],45:[0,1,0,0,!1],52:[1,1,2/3,0,!0],53:[1/3,0,0,1,!0],54:[0,1,1/3,0,!0],55:[2/3,0,1,1,!0]}},function(t,e){t.exports=function(t,e){if(t.standing=!1,e.collision.y&&(0<t.bounciness&&Math.abs(t.vel.y)>t.minBounceVelocity?t.vel.y*=-t.bounciness:(0<t.vel.y&&(t.standing=!0),t.vel.y=0)),e.collision.x&&(0<t.bounciness&&Math.abs(t.vel.x)>t.minBounceVelocity?t.vel.x*=-t.bounciness:t.vel.x=0),e.collision.slope){var i=e.collision.slope;if(0<t.bounciness){var n=t.vel.x*i.nx+t.vel.y*i.ny;t.vel.x=(t.vel.x-i.nx*n*2)*t.bounciness,t.vel.y=(t.vel.y-i.ny*n*2)*t.bounciness}else{var s=i.x*i.x+i.y*i.y,r=(t.vel.x*i.x+t.vel.y*i.y)/s;t.vel.x=i.x*r,t.vel.y=i.y*r;var o=Math.atan2(i.x,i.y);o>t.slopeStanding.min&&o<t.slopeStanding.max&&(t.standing=!0)}}t.pos.x=e.pos.x,t.pos.y=e.pos.y}},function(t,e,i){var o=i(23);t.exports=function(t,e,i,n,s){if(i)return o(e+i*t,-s,s);if(n){var r=n*t;return 0<e-r?e-r:e+r<0?e+r:0}return o(e,-s,s)}},function(t,e,i){t.exports={Body:i(1077),COLLIDES:i(224),CollisionMap:i(1076),Factory:i(1075),Image:i(1073),ImpactBody:i(1074),ImpactPhysics:i(1109),Sprite:i(1072),TYPE:i(223),World:i(1071)}},function(t,e,i){t.exports={Arcade:i(528),Impact:i(1125),Matter:i(1105)}},function(s,t,r){(function(t){r(1059);var e=r(26),i=r(20),n={Actions:r(417),Animation:r(993),Cache:r(992),Cameras:r(991),Class:r(0),Create:r(948),Curves:r(942),Data:r(939),Display:r(937),DOM:r(908),Events:r(906),Game:r(904),GameObjects:r(876),Geom:r(274),Input:r(616),Loader:r(593),Math:r(570),Physics:r(1126),Plugins:r(498),Renderer:r(1083),Scene:r(328),Scenes:r(496),Sound:r(494),Structs:r(493),Textures:r(492),Tilemaps:r(490),Time:r(441),Tweens:r(439),Utils:r(435)};n=i(!1,n,e),s.exports=n,t.Phaser=n}).call(this,r(200))}])},function(t,e,i){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return t.call(this,{key:"MainScene"})||this}return s(e,t),e.prototype.init=function(){this.score={wins:0,losses:0},this.words=[{key:"building",setXY:{x:100,y:240},german:"Gebäude"},{key:"house",setXY:{x:240,y:280},setScale:{x:.8,y:.8},german:"Hause"},{key:"car",setXY:{x:400,y:300},german:"Auto"},{key:"tree",setXY:{x:550,y:250},german:"Baum"}]},e.prototype.showNextQuestion=function(){this.nextWord=Phaser.Math.RND.pick(this.words),this.nextWord.sound.play(),this.textWord.setText(this.nextWord.german),this.updateScore()},e.prototype.processAnswer=function(t){return this.nextWord.german===t?(this.correctSound.play(),!0):(this.wrongSound.play(),!1)},e.prototype.updateScore=function(){this.textScore.setText("Wins: "+this.score.wins+" | Losses: "+this.score.losses)},e.prototype.preload=function(){this.load.audio("buildingAudio",["./assets/audio/gebaude.mp3"]),this.load.audio("houseAudio",["./assets/audio/hause.mp3"]),this.load.audio("carAudio",["./assets/audio/auto.mp3"]),this.load.audio("treeAudio",["./assets/audio/baum.mp3"]),this.load.audio("correct",["./assets/audio/correct.mp3"]),this.load.audio("wrong",["./assets/audio/wrong.mp3"]),this.load.image("background-city","./assets/image/background-city.png"),this.load.image("car","./assets/image/car.png"),this.load.image("house","./assets/image/house.png"),this.load.image("building","./assets/image/building.png"),this.load.image("tree","./assets/image/tree.png")},e.prototype.create=function(){var n=this,t=this.sys.game.config.width;this.backgroundCity=this.add.sprite(0,0,"background-city").setOrigin(0,0),this.backgroundCity.setInteractive(),this.correctSound=this.sound.add("correct"),this.wrongSound=this.sound.add("wrong"),this.items=this.add.group(this.words);for(var s=this.items.getChildren(),e=function(e){var i=s[e];i.setInteractive(),i.setData("resizeCorrectTween",r.tweens.add({targets:i,scaleX:1.5,scaleY:1.5,duration:300,yoyo:!0,paused:!0})),i.setData("resizeWrongTween",r.tweens.add({targets:i,scaleX:1.5,scaleY:1.5,angle:90,duration:300,yoyo:!0,paused:!0})),i.setData("alphaTween",r.tweens.add({targets:i,alpha:.7,duration:200,paused:!0})),i.on("pointerdown",function(t){n.processAnswer(n.words[e].german)?(i.getData("resizeCorrectTween").restart(),n.score.wins+=1):(i.getData("resizeWrongTween").restart(),n.score.losses+=1),n.showNextQuestion()},r),i.on("pointerover",function(t){i.getData("alphaTween").restart()},r),i.on("pointerout",function(t){i.getData("alphaTween").stop(),i.alpha=1},r),r.words[e].sound=r.sound.add(r.words[e].key+"Audio")},r=this,i=0;i<s.length;i++)e(i);this.textWord=this.add.text(30,20,"",{font:"28px Arial",fill:"#FFFFFF"}),this.textScore=this.add.text(t-180,20,"",{font:"18px Arial",fill:"#FFFFFF"}),this.showNextQuestion()},e}(Phaser.Scene);e.MainScene=r}]);