parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:x(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),v}},r}function r(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(f){return void r(f)}c.done?e(u):Promise.resolve(u).then(n,o)}function n(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,u,"next",t)}function u(t){r(a,o,i,c,u,"throw",t)}c(void 0)})}}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}function i(t,e){return(i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=f();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c(this,r)}}function c(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){for(var r=0;rscreen.availWidth&&!document.body.classList.contains("ignore-landscape-warning"))return e=setInterval(function(){(screen.availHeight0&&t(n.pop())},1e3)},1e4)}else n.push(a)}function a(e){var n=document.createElement("div");n.className="notification-content";var a=document.createElement("p");a.innerHTML=e,n.appendChild(a);var i=document.createElement("i");i.className="alert fas fa-exclamation-triangle",n.appendChild(i),t([i,n])}function i(e){var n=document.createElement("div");n.className="notification-content";var a=document.createElement("p");a.innerHTML=e,n.appendChild(a);var i=document.createElement("i");i.className="warning fas fa-exclamation-triangle",n.appendChild(i),t([i,n])}function c(e){var n=document.createElement("div");n.className="notification-content";var a=document.createElement("p");a.innerHTML=e,n.appendChild(a);var i=document.createElement("i");i.className="info fas fa-info-circle",n.appendChild(i),t([i,n])}function o(e){var n=document.createElement("div");n.className="notification-content";var a=document.createElement("p");a.innerHTML=e,n.appendChild(a);var i=document.createElement("i");i.className="success fas fa-check-circle",n.appendChild(i),t([i,n])} },{}],"W7Xq":[function(require,module,exports) { "use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(){return(e="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var a=i(t,e);if(a){var s=Object.getOwnPropertyDescriptor(a,e);return s.get?s.get.call(arguments.length<3?t:n):s.value}}).apply(this,arguments)}function i(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e)}function a(t,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function s(t){var e=h();return function(){var i,n=l(t);if(e){var a=l(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return r(this,i)}}function r(e,i){if(i&&("object"===t(i)||"function"==typeof i))return i;if(void 0!==i)throw new TypeError("Derived constructors may only return object or undefined");return o(e)}function o(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){return f(t)||g(t,e)||d(t,e)||c()}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(t,e){if(t){if("string"==typeof t)return y(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i1&&void 0!==arguments[1])||arguments[1];["end","cancel"].includes(t.type)&&this.touchCount--;var i="start"==t.type;i!==this.isActive&&0==this.touchCount&&(this.isActive=i,e&&this.gamepad.handleTouchEventCallbacks(this.createTouchEventObject(this.isActive?"touchstart":"touchend"))),"start"==t.type&&this.touchCount++}},{key:"createTouchEventObject",value:function(t){return{id:this.id,action:t,type:this.type}}}]),i}(),L=function(t){n(i,D);var e=s(i);function i(t){var n;v(this,i);var a=Object.assign({keyboardButton:null,altText:null,altTextAlign:"left",shape:"round"},t);return k(o(n=e.call(this,t)),"shape",void 0),k(o(n),"altText",void 0),k(o(n),"altTextAlign",void 0),k(o(n),"type","GamepadButton"),n.keyboardButton=a.keyboardButton,n.shape=a.shape,n.altText=a.altText,n.altTextAlign=a.altTextAlign,n}return b(i,[{key:"init",value:function(){null!==this.keyboardButton&&this.gamepad.registerKeybinding(this.keyboardButton,this)}},{key:"draw",value:function(t){if(this.path=new Path2D,"round"===this.shape)this.path.arc(this.getX(t),this.getY(t),10*this.getScaleY(t),0,4*Math.PI,!0);else if("square"===this.shape){var e=20*this.getScaleY(t);this.path.rect(this.getX(t)-e/2,this.getY(t)-e/2,e,e)}this.isActive?t.fillStyle="rgba(80, 80, 80, 1)":t.fillStyle="rgba(100, 100, 100, 0.8)",t.fill(this.path);var i="".concat(Math.floor((8*this.getScaleY(t)).toString()),"px 'Press Start 2P'");if(t.font=i,t.textBaseline="middle",t.textAlign="center",t.fillStyle="rgba(255, 255, 255, 1)",t.fillText(this.id,this.getX(t),this.getY(t)),null!==this.altText&&this.gamepad.showAltText){t.beginPath(),t.font="".concat(Math.floor((3*this.getScaleY(t)).toString()),"px 'Press Start 2P'"),t.textBaseline="middle",t.textAlign="center",t.fillStyle="rgba(150, 150, 150, 1)";var n=this.getX(t),a=this.getY(t);switch(this.altTextAlign){case"left":n-=13*this.getScaleY(t);break;case"right":n+=13*this.getScaleY(t);break;case"top":a-=13*this.getScaleY(t);break;case"bottom":a+=13*this.getScaleY(t)}t.fillText(this.altText,n,a)}}}]),i}();exports.GamepadButton=L;var K=new WeakMap,q=new WeakMap,W=new WeakMap,G=function(t){n(a,D);var i=s(a);function a(t){var e;v(this,a);var n=Object.assign({lockX:!1,lockY:!1,autoCenter:!0,bindUp:null,bindLeft:null,bindRight:null,bindDown:null},t);return k(o(e=i.call(this,t)),"type","GamepadJoystick"),k(o(e),"mouseX",0),k(o(e),"mouseY",0),k(o(e),"cR",0),k(o(e),"cX",0),k(o(e),"cY",0),w(o(e),K,{writable:!0,value:void 0}),w(o(e),q,{writable:!0,value:void 0}),w(o(e),W,{writable:!0,value:{}}),X(o(e),K,n.lockX),X(o(e),q,n.lockY),e.bindUp=n.bindUp,e.bindLeft=n.bindLeft,e.bindRight=n.bindRight,e.bindDown=n.bindDown,e}return b(a,[{key:"init",value:function(){null!==this.bindUp&&this.gamepad.registerKeybinding(this.bindUp,this),null!==this.bindLeft&&this.gamepad.registerKeybinding(this.bindLeft,this),null!==this.bindRight&&this.gamepad.registerKeybinding(this.bindRight,this),null!==this.bindDown&&this.gamepad.registerKeybinding(this.bindDown,this)}},{key:"isKeyPressed",value:function(t){return null!==t&&Y(this,W).hasOwnProperty(t)&&Y(this,W)[t]>0}},{key:"createTouchEventObject",value:function(t){return{id:this.id,action:t,type:this.type,x:Math.round(this.mouseX/this.cR*100),y:Math.round(this.mouseY/this.cR*100)}}},{key:"setActive",value:function(t){e(l(a.prototype),"setActive",this).call(this,t,!1),t.hasOwnProperty("key")&&(Y(this,W).hasOwnProperty(t.key)||(Y(this,W)[t.key]=0),["start"].includes(t.type)&&Y(this,W)[t.key]++,["end","cancel"].includes(t.type)&&Y(this,W)[t.key]--);var i=this.cR;Y(this,K)||(t.hasOwnProperty("x")&&(this.mouseX=this.cX-this.gamepad.stage.screenToCanvasX(t.x),this.mouseX=Math.min(Math.abs(this.mouseX),i)*Math.sign(this.mouseX),this.mouseX*=-1),this.isKeyPressed(this.bindLeft)&&(this.mouseX=-i),this.isKeyPressed(this.bindRight)&&(this.mouseX=i),this.isKeyPressed(this.bindLeft)&&this.isKeyPressed(this.bindRight)&&(this.mouseX=0),this.isActive||(this.mouseX=0)),Y(this,q)||(t.hasOwnProperty("y")&&(this.mouseY=this.cY-this.gamepad.stage.screenToCanvasY(t.y),this.mouseY=Math.min(Math.abs(this.mouseY),i)*Math.sign(this.mouseY)),this.isKeyPressed(this.bindUp)&&(this.mouseY=i),this.isKeyPressed(this.bindDown)&&(this.mouseY=-i),this.isKeyPressed(this.bindUp)&&this.isKeyPressed(this.bindDown)&&(this.mouseY=0),this.isActive||(this.mouseY=0));var n="touchmove";this.isActive&&1==this.touchCount&&"start"===t.type&&(n="touchstart"),this.isActive||(n="touchend"),this.gamepad.handleTouchEventCallbacks(this.createTouchEventObject(n))}},{key:"draw",value:function(t){this.cX=this.getX(t),this.cY=this.getY(t),this.cR=25*this.getScaleY(t),this.path=new Path2D,this.path.arc(this.cX,this.cY,this.cR,0,4*Math.PI,!0),this.isActive?t.fillStyle="rgba(85, 85, 85, 0.8)":t.fillStyle="rgba(100, 100, 100, 0.8)",t.fill(this.path),t.beginPath(),t.arc(this.cX+this.mouseX,this.cY-this.mouseY,15*this.getScaleY(t),0,4*Math.PI,!0),t.fillStyle="rgba(130, 130, 130, 1)",t.fill()}}]),a}();exports.GamepadJoystick=G;var U=new WeakMap,_=new WeakMap,z=new WeakMap,V=new WeakMap,J=new WeakMap,H=new WeakMap,N=function(){function t(){v(this,t),k(this,"stage",void 0),w(this,U,{writable:!0,value:void 0}),w(this,_,{writable:!0,value:void 0}),w(this,z,{writable:!0,value:{}}),w(this,V,{writable:!0,value:{}}),w(this,J,{writable:!0,value:{}}),w(this,H,{writable:!0,value:[]}),k(this,"showDebug",!1),k(this,"showAltText",!0),k(this,"enableVibration",!0),this.stage=new I("GamePad",document.querySelector(".gamepad-wrapper")),this.addEventListeners()}return b(t,[{key:"addEventListeners",value:function(){var t=this,e=["keydown","keyup"];for(var i in e)document.addEventListener(e[i],function(e){return t.handleKeyEvent(e)},!1);for(var i in e=["touchstart","touchend","touchcancel","touchmove"])this.stage.canvas.addEventListener(e[i],function(e){return t.handleTouchEvent(e)},!1);for(var i in e=["mousedown","mouseup","mousemove"])this.stage.canvas.addEventListener(e[i],function(e){return t.handleMouseEvent(e)},!1)}},{key:"registerKeybinding",value:function(t,e){Y(this,V)[t]=e}},{key:"handleKeyEvent",value:function(t){if(Y(this,J).hasOwnProperty(t.keyCode)||(Y(this,J)[t.keyCode]={pressed:!1}),Y(this,V).hasOwnProperty(t.key)){var e="Key ".concat(t.key),i=Y(this,V)[t.key],n={touchId:e,key:t.key,type:{keydown:"start",keyup:"end"}[t.type]};switch(t.type){case"keydown":if(Y(this,J)[t.keyCode].pressed)return;Y(this,J)[t.keyCode].pressed=!0,Y(this,z)[e]={},Y(this,z)[e].target=i,Y(this,z)[e].hasOwnProperty("target")&&null!=Y(this,z)[e].target&&Y(this,z)[e].target.setActive(n);break;case"keyup":if(!Y(this,J)[t.keyCode].pressed)return;Y(this,J)[t.keyCode].pressed=!1,Y(this,z)[e].hasOwnProperty("target")&&null!=Y(this,z)[e].target&&Y(this,z)[e].target.setActive(n),delete Y(this,z)[e]}}this.stage.touches=Y(this,z),this.debugTouches()}},{key:"handleMouseEvent",value:function(t){this.processGamepadTouchEvent({x:t.clientX,y:t.clientY,touchId:"mouse",type:{mousedown:"start",mouseup:"end",mousemove:"move"}[t.type]})}},{key:"handleTouchEvent",value:function(t){t.preventDefault();for(var e={touchstart:"start",touchend:"end",touchcancel:"end",touchmove:"move"},i=0;ie.length)&&(t=e.length);for(var o=0,n=new Array(t);o