text: !function t(e,n,i){function r(t){if(n[t])return n[t].exports;if(e[t])return o(t,r);throw new Error('cannot find module "'+t+'"')}function o(r,o){var a=n[r]={exports:{}},s=e[r],u=s[2],p=s[0];return p.call(a.exports,function(t){var n=e[r][1][t];return o(n?n:t)},a,a.exports,t,e,n,i),u&&(n[u]=n[r]),n[r].exports}var a=function(){return this}();for(var s in i)i[s]?a[i[s]]=r(s):r(s);return r.duo=!0,r.cache=n,r.modules=e,r}({1:[function(t,e,n){!function(){function i(){this.paused=!1,this.playing=!1}var r=t("kallaspriit/HTML5-JavaScript-Gamepad-Controller-Library@c38f53b:/gamepad.js"),o=t("http://s3.amazonaws.com/es6-promises/promise-1.0.0.js");i.version="0.0.1",i.authenticate=function(){return new o(function(t){t({})})},i.beginPlaying=function(){return new o(function(t){t()})},i.connect=function(){return new o(function(t){t({})})},i.getGamepads=function(){return new o(function(){return r})},i.getWebRTCMobileGamepads=function(){return new o(function(t){t([])})},i.getWebSocketMobileGamepads=function(){return new o(function(t){t([])})},i.getFriends=function(){return new o(function(t){t([])})},i.getFriendsPlaying=function(){return new o(function(t){t([])})},i.endPlaying=function(){return new o(function(t,e){return this.playing?(t(),void 0):e({reason:"User must first be playing the game."})})},i.pause=function(){return new o(function(t){this.paused=!0,t()})},i.postFriend=function(){return new o(function(t){t()})},i.retrieve=function(){return new o(function(t){t()})},i.store=function(){return new o(function(t){t()})},i.unpause=function(){return new o(function(t,e){return this.paused?(t(),void 0):e({reason:"User must first have paused the game."})})},i.updateScore=function(){return new o(function(t){t()})},function(t,i){"function"==typeof define&&define.amd?define(i):"object"==typeof n?e.exports=i():t.galaxy=i()}(this,function(){return i})}()},{"kallaspriit/HTML5-JavaScript-Gamepad-Controller-Library@c38f53b:/gamepad.js":2}],2:[function(t,e){!function(t){"use strict";var e=function(){},n={getType:function(){return"null"},isSupported:function(){return!1},update:e},i=function(t){var n=this,i=window;this.update=e,this.requestAnimationFrame=t||i.requestAnimationFrame||i.webkitRequestAnimationFrame||i.mozRequestAnimationFrame,this.tickFunction=function(){n.update(),n.startTicker()},this.startTicker=function(){n.requestAnimationFrame.apply(i,[n.tickFunction])}};i.prototype.start=function(t){this.update=t||e,this.startTicker()};var r=function(){};r.prototype.update=e,r.prototype.start=function(t){this.update=t||e};var o=function(t,e){this.listener=t,this.gamepadGetter=e,this.knownGamepads=[]};o.factory=function(t){var e=n,i=window&&window.navigator;return i&&("undefined"!=typeof i.getGamepads?e=new o(t,function(){return i.getGamepads()}):"undefined"!=typeof i.webkitGamepads?e=new o(t,function(){return i.webkitGamepads()}):"undefined"!=typeof i.webkitGetGamepads&&(e=new o(t,function(){return i.webkitGetGamepads()}))),e},o.getType=function(){return"WebKit"},o.prototype.getType=function(){return o.getType()},o.prototype.isSupported=function(){return!0},o.prototype.update=function(){var t,e,n=this,i=Array.prototype.slice.call(this.gamepadGetter(),0);for(e=this.knownGamepads.length-1;e>=0;e--)t=this.knownGamepads[e],i.indexOf(t)<0&&(this.knownGamepads.splice(e,1),this.listener._disconnect(t));for(e=0;e<i.length;e++)t=i[e],t&&n.knownGamepads.indexOf(t)<0&&(n.knownGamepads.push(t),n.listener._connect(t))};var a=function(t){this.listener=t,window.addEventListener("gamepadconnected",function(e){t._connect(e.gamepad)}),window.addEventListener("gamepaddisconnected",function(e){t._disconnect(e.gamepad)})};a.factory=function(t){var e=n;return window&&"undefined"!=typeof window.addEventListener&&(e=new a(t)),e},a.getType=function(){return"Firefox"},a.prototype.getType=function(){return a.getType()},a.prototype.isSupported=function(){var t=window&&window.navigator;return-1!==t.userAgent.indexOf("Firefox")},a.prototype.update=e;var s=function(t){this.updateStrategy=t||new i,this.gamepads=[],this.listeners={},this.platform=n,this.deadzone=.03,this.maximizeThreshold=.97};s.UpdateStrategies={AnimFrameUpdateStrategy:i,ManualUpdateStrategy:r},s.PlatformFactories=[a.factory,o.factory],s.Type={N64:"n64",PLAYSTATION:"playstation",LOGITECH:"logitech",XBOX:"xbox",UNKNOWN:"unknown"},s.Event={CONNECTED:"connected",UNSUPPORTED:"unsupported",DISCONNECTED:"disconnected",TICK:"tick",BUTTON_DOWN:"button-down",BUTTON_UP:"button-up",AXIS_CHANGED:"axis-changed"},s.StandardButtons=["FACE_1","FACE_2","FACE_3","FACE_4","LEFT_TOP_SHOULDER","RIGHT_TOP_SHOULDER","LEFT_BOTTOM_SHOULDER","RIGHT_BOTTOM_SHOULDER","SELECT_BACK","START_FORWARD","LEFT_STICK","RIGHT_STICK","DPAD_UP","DPAD_DOWN","DPAD_LEFT","DPAD_RIGHT","HOME"],s.StandardAxes=["LEFT_STICK_X","LEFT_STICK_Y","RIGHT_STICK_X","RIGHT_STICK_Y"];var u=function(t,e,n){return e<t.length?t[e]:n+(e-t.length+1)};s.StandardMapping={env:{},buttons:{byButton:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]},axes:{byAxis:[0,1,2,3]}},s.Mappings=[{env:{platform:a.getType(),type:s.Type.N64},buttons:{byButton:[2,1,3,0,4,5,-1,-1,8,9,-1,-1,12,13,14,15,-1]},axes:{byAxis:[1,2,-1,-1]}},{env:{platform:o.getType(),type:s.Type.N64},buttons:{byButton:[2,1,3,0,4,5,-1,-1,8,9,-1,-1,12,13,14,15,-1]},axes:{byAxis:[0,1,-1,-1]}},{env:{platform:a.getType(),type:s.Type.XBOX},buttons:{byButton:[0,1,2,3,4,5,15,16,9,8,6,7,11,12,13,14,10]},axes:{byAxis:[0,1,2,3]}},{env:{platform:a.getType(),type:s.Type.PLAYSTATION},buttons:{byButton:[14,13,15,12,10,11,8,9,0,3,1,2,4,6,7,5,16]},axes:{byAxis:[0,1,2,3]}},{env:{platform:o.getType(),type:s.Type.LOGITECH},buttons:{byButton:[1,2,0,3,4,5,6,7,8,9,10,11,11,12,13,14,10]},axes:{byAxis:[0,1,2,3]}},{env:{platform:a.getType(),type:s.Type.LOGITECH},buttons:{byButton:[0,1,2,3,4,5,-1,-1,6,7,8,9,11,12,13,14,10],byAxis:[-1,-1,-1,-1,-1,-1,[2,0,1],[2,0,-1]]},axes:{byAxis:[0,1,3,4]}}],s.prototype.init=function(){var t=s.resolvePlatform(this),e=this;return this.platform=t,this.updateStrategy.start(function(){e._update()}),t.isSupported()},s.prototype.bind=function(t,e){return"undefined"==typeof this.listeners[t]&&(this.listeners[t]=[]),this.listeners[t].push(e),this},s.prototype.unbind=function(t,e){if("undefined"==typeof t)return this.listeners={},void 0;if("undefined"==typeof e)return this.listeners[t]=[],void 0;if("undefined"==typeof this.listeners[t])return!1;for(var n=0;n<this.listeners[t].length;n++)if(this.listeners[t][n]===e)return this.listeners[t].splice(n,1),!0;return!1},s.prototype.count=function(){return this.gamepads.length},s.prototype._fire=function(t,e){if("undefined"!=typeof this.listeners[t])for(var n=0;n<this.listeners[t].length;n++)this.listeners[t][n].apply(this.listeners[t][n],[e])},s.getNullPlatform=function(){return Object.create(n)},s.resolvePlatform=function(t){var e,i=n;for(e=0;!i.isSupported()&&e<s.PlatformFactories.length;e++)i=s.PlatformFactories[e](t);return i},s.prototype._connect=function(t){var e,n,i=this._resolveMapping(t);for(t.state={},t.lastState={},t.updater=[],e=i.buttons.byButton.length,n=0;e>n;n++)this._addButtonUpdater(t,i,n);for(e=i.axes.byAxis.length,n=0;e>n;n++)this._addAxisUpdater(t,i,n);this.gamepads[t.index]=t,this._fire(s.Event.CONNECTED,t)},s.prototype._addButtonUpdater=function(t,n,i){var r=e,o=u(s.StandardButtons,i,"EXTRA_BUTTON_"),a=this._createButtonGetter(t,n.buttons,i),p=this,f={gamepad:t,control:o};t.state[o]=0,t.lastState[o]=0,r=function(){var e=a(),n=t.lastState[o],i=e>.5,r=n>.5;t.state[o]=e,i&&!r?p._fire(s.Event.BUTTON_DOWN,Object.create(f)):!i&&r&&p._fire(s.Event.BUTTON_UP,Object.create(f)),0!==e&&1!==e&&e!==n&&p._fireAxisChangedEvent(t,o,e),t.lastState[o]=e},t.updater.push(r)},s.prototype._addAxisUpdater=function(t,n,i){var r=e,o=u(s.StandardAxes,i,"EXTRA_AXIS_"),a=this._createAxisGetter(t,n.axes,i),p=this;t.state[o]=0,t.lastState[o]=0,r=function(){var e=a(),n=t.lastState[o];t.state[o]=e,e!==n&&p._fireAxisChangedEvent(t,o,e),t.lastState[o]=e},t.updater.push(r)},s.prototype._fireAxisChangedEvent=function(t,e,n){var i={gamepad:t,axis:e,value:n};this._fire(s.Event.AXIS_CHANGED,i)},s.prototype._createButtonGetter=function(){var t=function(){return 0},e=function(e,n,i){var r=t;return i>n?r=function(){var t=i-n,r=e();return r=(r-n)/t,0>r?0:r}:n>i&&(r=function(){var t=n-i,r=e();return r=(r-i)/t,r>1?0:1-r}),r},n=function(t){return"[object Array]"===Object.prototype.toString.call(t)};return function(i,r,o){var a,s=t,u=this;return a=r.byButton[o],-1!==a?"number"==typeof a&&a<i.buttons.length&&(s=function(){var t=i.buttons[a];return"number"==typeof t?t:"number"==typeof t.value?t.value:0}):r.byAxis&&o<r.byAxis.length&&(a=r.byAxis[o],n(a)&&3==a.length&&a[0]<i.axes.length&&(s=function(){var t=i.axes[a[0]];return u._applyDeadzoneMaximize(t)},s=e(s,a[1],a[2]))),s}}(),s.prototype._createAxisGetter=function(){var t=function(){return 0};return function(e,n,i){var r,o=t,a=this;return r=n.byAxis[i],-1!==r&&"number"==typeof r&&r<e.axes.length&&(o=function(){var t=e.axes[r];return a._applyDeadzoneMaximize(t)}),o}}(),s.prototype._disconnect=function(t){var e,n=[];for("undefined"!=typeof this.gamepads[t.index]&&delete this.gamepads[t.index],e=0;e<this.gamepads.length;e++)"undefined"!=typeof this.gamepads[e]&&(n[e]=this.gamepads[e]);this.gamepads=n,this._fire(s.Event.DISCONNECTED,t)},s.prototype._resolveControllerType=function(t){return t=t.toLowerCase().replace(/\s+/g," ").replace(/^\s+|\s+$/g,""),-1!==t.indexOf("playstation")?s.Type.PLAYSTATION:-1!==t.indexOf("logitech")||-1!==t.indexOf("wireless gamepad")?s.Type.LOGITECH:-1!==t.indexOf("xbox")||-1!==t.indexOf("360")?s.Type.XBOX:-1!==t.indexOf("79-6-generic")&&-1!==t.indexOf("joystick")||-1!==t.indexOf("vendor: 0079 product: 0006")&&-1!==t.indexOf("generic usb joystick")?s.Type.N64:s.Type.UNKNOWN},s.prototype._resolveMapping=function(t){var e,n,i=s.Mappings,r=null,o={platform:this.platform.getType(),type:this._resolveControllerType(t.id)};for(e=0;!r&&e<i.length;e++)n=i[e],s.envMatchesFilter(n.env,o)&&(r=n);return r||s.StandardMapping},s.envMatchesFilter=function(t,e){var n,i=!0;for(n in t)t[n]!==e[n]&&(i=!1);return i},s.prototype._update=function(){this.platform.update(),this.gamepads.forEach(function(t){t&&t.updater.forEach(function(t){t()})}),this.gamepads.length>0&&this._fire(s.Event.TICK,this.gamepads)},s.prototype._applyDeadzoneMaximize=function(t,e,n){return e="undefined"!=typeof e?e:this.deadzone,n="undefined"!=typeof n?n:this.maximizeThreshold,t>=0?e>t?t=0:t>n&&(t=1):t>-e?t=0:-n>t&&(t=-1),t},t.Gamepad=s}("undefined"!=typeof e&&e.exports||window)},{}]},{},{1:""});