!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;en;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&&a0&&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:""});