EmulatorJS/data/emu-min.js
Ethan O'Brien 4da87d0e6b Version 1.1.2
Co-authored-by: Allan Niles <74841470+allancoding@users.noreply.github.com>
Co-authored-by: ElectronicsArchiver <85485984+ElectronicsArchiver@users.noreply.github.com>
Co-authored-by: GreyHope <hello@greyhope.uk>
Co-authored-by: Kyle Steffel <cheesykyle@users.noreply.github.com>
2022-05-05 14:45:00 -05:00

1 line
No EOL
554 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var EJS=function(n){window.EJS_MODULES=n;var o={},a=[];function i(e){if(o[e])return o[e].exports;a.push(e);var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return window.aba=function(){return a.sort(function(e,t){return t<e?1:-1})},Array.isArray,i.m=n,i.c=o,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=396)}([null,null,null,null,null,null,function(e,t,n){!function(e){"use strict";function o(){}function t(e){var t=this,n=window;this.update=o,this.requestAnimationFrame=e||n.requestAnimationFrame||n.webkitRequestAnimationFrame||n.mozRequestAnimationFrame,this.tickFunction=function(){t.update(),t.startTicker()},this.startTicker=function(){t.requestAnimationFrame.apply(n,[t.tickFunction])}}function n(){}function a(e,t){this.listener=e,this.gamepadGetter=t,this.knownGamepads=[]}function i(t){this.listener=t,window.addEventListener("gamepadconnected",function(e){t._connect(e.gamepad)}),window.addEventListener("gamepaddisconnected",function(e){t._disconnect(e.gamepad)})}function l(e){this.updateStrategy=e||new t,this.gamepads=[],this.listeners={},this.platform=r,this.deadzone=.03,this.maximizeThreshold=.97}var r={getType:function(){return"null"},isSupported:function(){return!1},update:o};t.prototype.start=function(e){this.update=e||o,this.startTicker()},n.prototype.update=o,n.prototype.start=function(e){this.update=e||o},a.factory=function(e){var t=r,n=window&&window.navigator;return n&&(void 0!==n.getGamepads?t=new a(e,function(){return n.getGamepads()}):void 0!==n.webkitGamepads?t=new a(e,function(){return n.webkitGamepads()}):void 0!==n.webkitGetGamepads&&(t=new a(e,function(){return n.webkitGetGamepads()}))),t},a.getType=function(){return"WebKit"},a.prototype.getType=function(){return a.getType()},a.prototype.isSupported=function(){return!0},a.prototype.update=function(){for(var e,t=Array.prototype.slice.call(this.gamepadGetter(),0),n=this.knownGamepads.length-1;0<=n;n--)e=this.knownGamepads[n],t.indexOf(e)<0&&(this.knownGamepads.splice(n,1),this.listener._disconnect(e));for(n=0;n<t.length;n++)(e=t[n])&&this.knownGamepads.indexOf(e)<0&&(this.knownGamepads.push(e),this.listener._connect(e))},i.factory=function(e){var t=r;return t=window&&void 0!==window.addEventListener?new i(e):t},i.getType=function(){return"Firefox"},i.prototype.getType=function(){return i.getType()},i.prototype.isSupported=function(){return-1!==(window&&window.navigator).userAgent.indexOf("Firefox")},i.prototype.update=o;l.UpdateStrategies={AnimFrameUpdateStrategy:t,ManualUpdateStrategy:n},l.PlatformFactories=[i.factory,a.factory],l.Type={N64:"n64",PLAYSTATION:"playstation",LOGITECH:"logitech",XBOX:"xbox",ECKA:"ecka",UNKNOWN:"unknown"},l.Event={CONNECTED:"connected",UNSUPPORTED:"unsupported",DISCONNECTED:"disconnected",TICK:"tick",BUTTON_DOWN:"button-down",BUTTON_UP:"button-up",AXIS_CHANGED:"axis-changed"},l.StandardButtons=["BUTTON_1","BUTTON_2","BUTTON_3","BUTTON_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"],l.StandardAxes=["LEFT_STICK_X","LEFT_STICK_Y","RIGHT_STICK_X","RIGHT_STICK_Y"];function d(e,t,n){return t<e.length?e[t]:n+(t-e.length+1)}var u;function s(){return 0}l.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]}},l.Mappings=[{env:{platform:i.getType(),type:l.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:a.getType(),type:l.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:i.getType(),type:l.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:i.getType(),type:l.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:a.getType(),type:l.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:i.getType(),type:l.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]}},{env:{platform:a.getType(),type:l.Type.ECKA},buttons:{byButton:[2,1,3,0,4,5,6,7,8,9,10,11,11,12,13,14,10],byAxis:[-1,-1,-1,-1,-1,-1,[2,0,1],[2,0,-1]]},axes:{byAxis:[0,1,3,4]}},{env:{platform:a.getType(),type:l.Type.UNKNOWN},buttons:{byButton:[0,1,2,3,4,5,-1,-1,6,7,8,9,11,12,13,14,15,16,17,10]},axes:{byAxis:[0,1,2,5]}}],l.prototype.init=function(){var e=l.resolvePlatform(this),t=this;return this.platform=e,this.updateStrategy.start(function(){t._update()}),this.buttonState=[],this.extraButtonState=[],e.isSupported()},l.prototype.bind=function(e,t){return void 0===this.listeners[e]&&(this.listeners[e]=[]),this.listeners[e].push(t),this},l.prototype.unbind=function(e,t){if(void 0!==e){if(void 0!==t){if(void 0===this.listeners[e])return!1;for(var n=0;n<this.listeners[e].length;n++)if(this.listeners[e][n]===t)return this.listeners[e].splice(n,1),!0;return!1}this.listeners[e]=[]}else this.listeners={}},l.prototype.count=function(){return this.gamepads.length},l.prototype._fire=function(e,n){if(void 0!==this.listeners[e]){for(var t=0;t<this.listeners[e].length;t++)this.listeners[e][t].apply(this.listeners[e][t],[n]);var o=this;n.gamepad&&n.gamepad.extra_buttons&&n.gamepad.extra_buttons.forEach(function(e,t){o.extraButtonState[n.gamepad.index]||(o.extraButtonState[n.gamepad.index]=[]),o.extraButtonState[n.gamepad.index][t]=e})}},l.getNullPlatform=function(){return Object.create(r)},l.resolvePlatform=function(e){for(var t=r,n=0;!t.isSupported()&&n<l.PlatformFactories.length;n++)t=l.PlatformFactories[n](e);return t},l.prototype._connect=function(e){var t,n,o=this._resolveMapping(e);for(e.state={},e.lastState={},e.updater=[],this.buttonState[e.index]||(this.buttonState[e.index]=[]),this.extraButtonState[e.index]||(this.extraButtonState[e.index]=[]),t=o.buttons.byButton.length,n=0;n<t;n++)this._addButtonUpdater(e,o,n);for(t=o.axes.byAxis.length,n=0;n<t;n++)this._addAxisUpdater(e,o,n);if(this.gamepads[e.index]=e,!this.gamepads[e.index].extra_buttons)for(this.gamepads[e.index].extra_buttons=[],n=e.buttons.length;n<16;n++)this.extraButtonState[e.index][n]?this.gamepads[e.index].extra_buttons[n]=this.extraButtonState[e.index][n]:this.gamepads[e.index].extra_buttons[n]={pressed:!1,value:0};this._fire(l.Event.CONNECTED,e)},l.prototype._addButtonUpdater=function(a,e,t){var i=d(l.StandardButtons,t,"EXTRA_BUTTON_"),r=this._createButtonGetter(a,e.buttons,t),s=this,c={gamepad:a,control:i,index:t,gamepadIndex:a.index};a.state[i]=0,a.lastState[i]=0,null==this.buttonState[a.index][i]&&(this.buttonState[a.index][i]=0),a.updater.push(function(){var e=r(),t=a.lastState[i],n=.5<e,o=.5<t;a.state[i]=e,n&&!o?s._fire(l.Event.BUTTON_DOWN,Object.create(c)):(!n&&o||s.buttonState[a.index][i]!=e)&&s._fire(l.Event.BUTTON_UP,Object.create(c)),0!==e&&1!==e&&e!==t&&s._fireAxisChangedEvent(a,i,e),a.lastState[i]=e,s.buttonState[a.index][i]=e})},l.prototype._addAxisUpdater=function(n,e,t){var o=d(l.StandardAxes,t,"EXTRA_AXIS_"),a=this._createAxisGetter(n,e.axes,t),i=this;n.state[o]=0,n.lastState[o]=0,null==this.buttonState[n.index][o]&&(this.buttonState[n.index][o]=0),n.updater.push(function(){var e=a(),t=i.buttonState[n.index][o];(n.state[o]=e)!==t&&i._fireAxisChangedEvent(n,o,e),n.lastState[o]=e,i.buttonState[n.index][o]=e})},l.prototype._fireAxisChangedEvent=function(e,t,n){this._fire(l.Event.AXIS_CHANGED,{gamepad:e,axis:t,value:n})},l.prototype._createButtonGetter=(u=function(){return 0},function(t,e,n){var o,a,i,r,s=u,c=this;return-1!==(o=e.byButton[n])?"number"==typeof o&&o<t.buttons.length&&(s=function(){var e=t.buttons[o];return"number"==typeof e?e:"number"==typeof e.value?e.value:0}):e.byAxis&&n<e.byAxis.length&&(e=o=e.byAxis[n],"[object Array]"===Object.prototype.toString.call(e)&&3==o.length&&o[0]<t.axes.length&&(a=s=function(){var e=t.axes[o[0]];return c._applyDeadzoneMaximize(e)},i=o[1],r=o[2],n=u,i<r?n=function(){var e=r-i;return(e=(a()-i)/e)<0?0:e}:r<i&&(n=function(){var e=i-r;return 1<(e=(a()-r)/e)?0:1-e}),s=n)),s}),l.prototype._createAxisGetter=function(t,e,n){var o,a=s,i=this;return a=-1!==(o=e.byAxis[n])&&"number"==typeof o&&o<t.axes.length?function(){var e=t.axes[o];return i._applyDeadzoneMaximize(e)}:a},l.prototype._disconnect=function(e){var t,n=[];for(void 0!==this.gamepads[e.index]&&delete this.gamepads[e.index],t=0;t<this.gamepads.length;t++)void 0!==this.gamepads[t]&&(n[t]=this.gamepads[t]);this.gamepads=n,this._fire(l.Event.DISCONNECTED,e)},l.prototype._resolveControllerType=function(e){return-1!==(e=e.toLowerCase().replace(/\s+/g," ").replace(/^\s+|\s+$/g,"")).indexOf("playstation")?l.Type.PLAYSTATION:-1!==e.indexOf("logitech")||-1!==e.indexOf("wireless gamepad")?l.Type.LOGITECH:-1!==e.indexOf("xbox")||-1!==e.indexOf("360")?l.Type.XBOX:-1!==e.indexOf("79-6-generic")&&-1!==e.indexOf("joystick")||-1!==e.indexOf("vendor: 0079 product: 0006")&&-1!==e.indexOf("generic usb joystick")?l.Type.N64:"usb joystick (vendor: 0e8f product: 0002)"===e?l.Type.ECKA:l.Type.UNKNOWN},l.prototype._resolveMapping=function(e){for(var t,n=l.Mappings,o=null,a={platform:this.platform.getType(),type:this._resolveControllerType(e.id)},i=0;!o&&i<n.length;i++)t=n[i],l.envMatchesFilter(t.env,a)&&(o=t);return o||l.StandardMapping},l.envMatchesFilter=function(e,t){var n,o=!0;for(n in e)e[n]!==t[n]&&(o=!1);return o},l.prototype._update=function(){this.platform.update(),this.gamepads.forEach(function(e){e&&e.updater.forEach(function(e){e()})}),0<this.gamepads.length&&this._fire(l.Event.TICK,this.gamepads)},l.prototype._applyDeadzoneMaximize=function(e,t,n){return t=void 0!==t?t:this.deadzone,n=void 0!==n?n:this.maximizeThreshold,0<=e?e<t?e=0:n<e&&(e=1):-t<e?e=0:e<-n&&(e=-1),e},e.Gamepad=l}(e.exports||window)},null,null,null,null,function(e,t,n){var o,a;o=this,a=function(){return n=[function(e,t,n){"use strict";function o(e){return e=r.call(e),a[e]||(a[e]=e.slice(8,-1).toLowerCase())}var a,i=n(4),r=Object.prototype.toString;a=Object.create(null);function s(t){return t=t.toLowerCase(),function(e){return o(e)===t}}function c(e){return Array.isArray(e)}function l(e){return void 0===e}var d=s("ArrayBuffer");function u(e){return null!==e&&"object"==typeof e}function f(e){if("object"!==o(e))return!1;e=Object.getPrototypeOf(e);return null===e||e===Object.prototype}var n=s("Date"),p=s("File"),h=s("Blob"),m=s("FileList");function g(e){return"[object Function]"===r.call(e)}var b=s("URLSearchParams");function y(e,t){if(null!=e)if(c(e="object"!=typeof e?[e]:e))for(var n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.call(null,e[a],a,e)}var v;v="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array);e.exports={isArray:c,isArrayBuffer:d,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return e&&("function"==typeof FormData&&e instanceof FormData||"[object FormData]"===r.call(e)||g(e.toString)&&"[object FormData]"===e.toString())},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:f,isUndefined:l,isDate:n,isFile:p,isBlob:h,isFunction:g,isStream:function(e){return u(e)&&g(e.pipe)},isURLSearchParams:b,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:y,merge:function n(){var o={};function e(e,t){f(o[t])&&f(e)?o[t]=n(o[t],e):f(e)?o[t]=n({},e):c(e)?o[t]=e.slice():o[t]=e}for(var t=0,a=arguments.length;t<a;t++)y(arguments[t],e);return o},extend:function(n,e,o){return y(e,function(e,t){n[t]=o&&"function"==typeof e?i(e,o):e}),n},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return e=65279===e.charCodeAt(0)?e.slice(1):e},inherits:function(e,t,n,o){e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n){var o,a,i,r={};t=t||{};do{for(a=(o=Object.getOwnPropertyNames(e)).length;0<a--;)r[i=o[a]]||(t[i]=e[i],r[i]=!0)}while((e=Object.getPrototypeOf(e))&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:s,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;e=e.indexOf(t,n);return-1!==e&&e===n},toArray:function(e){if(!e)return null;var t=e.length;if(l(t))return null;for(var n=new Array(t);0<t--;)n[t]=e[t];return n},isTypedArray:function(e){return v&&e instanceof v},isFileList:m}},function(e,t,n){"use strict";var s=n(0);function c(e,t,n,o,a){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),a&&(this.response=a)}s.inherits(c,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var l=c.prototype,o={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){o[e]={value:e}}),Object.defineProperties(c,o),Object.defineProperty(l,"isAxiosError",{value:!0}),c.from=function(e,t,n,o,a,i){var r=Object.create(l);return s.toFlatObject(e,r,function(e){return e!==Error.prototype}),c.call(r,e.message,t,n,o,a),r.name=e.name,i&&Object.assign(r,i),r},e.exports=c},function(e,t,n){"use strict";var o=n(1);function a(e){o.call(this,null==e?"canceled":e,o.ERR_CANCELED),this.name="CanceledError"}n(0).inherits(a,o,{__CANCEL__:!0}),e.exports=a},function(e,t,n){"use strict";var s=n(0),c=n(19),o=n(1),a=n(6),l=n(7),i={"Content-Type":"application/x-www-form-urlencoded"};function d(e,t){!s.isUndefined(e)&&s.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var r,u={transitional:a,adapter:r="undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)?n(8):r,transformRequest:[function(e,t){if(c(t,"Accept"),c(t,"Content-Type"),s.isFormData(e)||s.isArrayBuffer(e)||s.isBuffer(e)||s.isStream(e)||s.isFile(e)||s.isBlob(e))return e;if(s.isArrayBufferView(e))return e.buffer;if(s.isURLSearchParams(e))return d(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var n,o,a=s.isObject(e),i=t&&t["Content-Type"];{if((n=s.isFileList(e))||a&&"multipart/form-data"===i)return o=this.env&&this.env.FormData,l(n?{"files[]":e}:e,o&&new o);if(a||"application/json"===i){d(t,"application/json");var r=e;if(s.isString(r))try{return(0,JSON.parse)(r),s.trim(r)}catch(r){if("SyntaxError"!==r.name)throw r}return(0,JSON.stringify)(r)}return e}}],transformResponse:[function(e){var t=this.transitional||u.transitional,n=t&&t.silentJSONParsing,t=t&&t.forcedJSONParsing,n=!n&&"json"===this.responseType;if(n||t&&s.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw o.from(e,o.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:n(27)},validateStatus:function(e){return 200<=e&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};s.forEach(["delete","get","head"],function(e){u.headers[e]={}}),s.forEach(["post","put","patch"],function(e){u.headers[e]=s.merge(i)}),e.exports=u},function(e,t,n){"use strict";e.exports=function(n,o){return function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];return n.apply(o,e)}}},function(e,t,n){"use strict";var a=n(0);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var o,n=n?n(t):a.isURLSearchParams(t)?t.toString():(o=[],a.forEach(t,function(e,t){null!=e&&(a.isArray(e)?t+="[]":e=[e],a.forEach(e,function(e){a.isDate(e)?e=e.toISOString():a.isObject(e)&&(e=JSON.stringify(e)),o.push(i(t)+"="+i(e))}))}),o.join("&"));return n&&(-1!==(t=e.indexOf("#"))&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n),e}},function(e,t,n){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},function(e,t,n){"use strict";var s=n(0);e.exports=function(e,i){i=i||new FormData;var t=[];function r(e){return null===e?"":s.isDate(e)?e.toISOString():s.isArrayBuffer(e)||s.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}return function o(e,a){if(s.isPlainObject(e)||s.isArray(e)){if(-1!==t.indexOf(e))throw Error("Circular reference detected in "+a);t.push(e),s.forEach(e,function(e,t){if(!s.isUndefined(e)){var n=a?a+"."+t:t;if(e&&!a&&"object"==typeof e)if(s.endsWith(t,"{}"))e=JSON.stringify(e);else if(s.endsWith(t,"[]")&&(t=s.toArray(e)))return void t.forEach(function(e){s.isUndefined(e)||i.append(n,r(e))});o(e,n)}}),t.pop()}else i.append(a,r(e))}(e),i}},function(e,t,n){"use strict";var f=n(0),p=n(20),h=n(21),m=n(5),g=n(9),b=n(24),y=n(25),v=n(6),w=n(1),x=n(2),_=n(26);e.exports=function(u){return new Promise(function(t,n){var e,o=u.data,a=u.headers,i=u.responseType;function r(){u.cancelToken&&u.cancelToken.unsubscribe(e),u.signal&&u.signal.removeEventListener("abort",e)}f.isFormData(o)&&f.isStandardBrowserEnv()&&delete a["Content-Type"];var s=new XMLHttpRequest,c=(u.auth&&(c=u.auth.username||"",d=u.auth.password?unescape(encodeURIComponent(u.auth.password)):"",a.Authorization="Basic "+btoa(c+":"+d)),g(u.baseURL,u.url));function l(){var e;s&&(e="getAllResponseHeaders"in s?b(s.getAllResponseHeaders()):null,e={data:i&&"text"!==i&&"json"!==i?s.response:s.responseText,status:s.status,statusText:s.statusText,headers:e,config:u,request:s},p(function(e){t(e),r()},function(e){n(e),r()},e),s=null)}s.open(u.method.toUpperCase(),m(c,u.params,u.paramsSerializer),!0),s.timeout=u.timeout,"onloadend"in s?s.onloadend=l:s.onreadystatechange=function(){s&&4===s.readyState&&(0!==s.status||s.responseURL&&0===s.responseURL.indexOf("file:"))&&setTimeout(l)},s.onabort=function(){s&&(n(new w("Request aborted",w.ECONNABORTED,u,s)),s=null)},s.onerror=function(){n(new w("Network Error",w.ERR_NETWORK,u,s,s)),s=null},s.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",t=u.transitional||v;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),n(new w(e,t.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,u,s)),s=null},f.isStandardBrowserEnv()&&(d=(u.withCredentials||y(c))&&u.xsrfCookieName?h.read(u.xsrfCookieName):void 0)&&(a[u.xsrfHeaderName]=d),"setRequestHeader"in s&&f.forEach(a,function(e,t){void 0===o&&"content-type"===t.toLowerCase()?delete a[t]:s.setRequestHeader(t,e)}),f.isUndefined(u.withCredentials)||(s.withCredentials=!!u.withCredentials),i&&"json"!==i&&(s.responseType=u.responseType),"function"==typeof u.onDownloadProgress&&s.addEventListener("progress",u.onDownloadProgress),"function"==typeof u.onUploadProgress&&s.upload&&s.upload.addEventListener("progress",u.onUploadProgress),(u.cancelToken||u.signal)&&(e=function(e){s&&(n(!e||e.type?new x:e),s.abort(),s=null)},u.cancelToken&&u.cancelToken.subscribe(e),u.signal&&(u.signal.aborted?e():u.signal.addEventListener("abort",e)));var o=o||null,d=_(c);d&&-1===["http","https","file"].indexOf(d)?n(new w("Unsupported protocol "+d+":",w.ERR_BAD_REQUEST,u)):s.send(o)})}},function(e,t,n){"use strict";var o=n(22),a=n(23);e.exports=function(e,t){return e&&!o(t)?a(e,t):t}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";var l=n(0);e.exports=function(t,n){n=n||{};var o={};function a(e,t){return l.isPlainObject(e)&&l.isPlainObject(t)?l.merge(e,t):l.isPlainObject(t)?l.merge({},t):l.isArray(t)?t.slice():t}function i(e){return l.isUndefined(n[e])?l.isUndefined(t[e])?void 0:a(void 0,t[e]):a(t[e],n[e])}function e(e){if(!l.isUndefined(n[e]))return a(void 0,n[e])}function r(e){return l.isUndefined(n[e])?l.isUndefined(t[e])?void 0:a(void 0,t[e]):a(void 0,n[e])}function s(e){return e in n?a(t[e],n[e]):e in t?a(void 0,t[e]):void 0}var c={url:e,method:e,data:e,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:s};return l.forEach(Object.keys(t).concat(Object.keys(n)),function(e){var t=c[e]||i,n=t(e);l.isUndefined(n)&&t!==s||(o[e]=n)}),o}},function(e,t){e.exports={version:"0.27.2"}},function(e,t,n){e.exports=n(14)},function(e,t,n){"use strict";var a=n(0),i=n(4),r=n(15),s=n(11),o=function t(n){var e=new r(n),o=i(r.prototype.request,e);return a.extend(o,r.prototype,e),a.extend(o,e),o.create=function(e){return t(s(n,e))},o}(n(3));o.Axios=r,o.CanceledError=n(2),o.CancelToken=n(29),o.isCancel=n(10),o.VERSION=n(12).version,o.toFormData=n(7),o.AxiosError=n(1),o.Cancel=o.CanceledError,o.all=function(e){return Promise.all(e)},o.spread=n(30),o.isAxiosError=n(31),e.exports=o,e.exports.default=o},function(e,t,n){"use strict";var o=n(0),a=n(5),i=n(16),u=n(17),f=n(11),r=n(9),p=n(28),h=p.validators;function s(e){this.defaults=e,this.interceptors={request:new i,response:new i}}s.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=f(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional,o=(void 0!==n&&p.assertOptions(n,{silentJSONParsing:h.transitional(h.boolean),forcedJSONParsing:h.transitional(h.boolean),clarifyTimeoutError:h.transitional(h.boolean)},!1),[]),a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))});var i,r=[];if(this.interceptors.response.forEach(function(e){r.push(e.fulfilled,e.rejected)}),!a){var s=[u,void 0];for(Array.prototype.unshift.apply(s,o),s=s.concat(r),i=Promise.resolve(t);s.length;)i=i.then(s.shift(),s.shift());return i}for(var c=t;o.length;){var l=o.shift(),d=o.shift();try{c=l(c)}catch(e){d(e);break}}try{i=u(c)}catch(e){return Promise.reject(e)}for(;r.length;)i=i.then(r.shift(),r.shift());return i},s.prototype.getUri=function(e){e=f(this.defaults,e);var t=r(e.baseURL,e.url);return a(t,e.params,e.paramsSerializer)},o.forEach(["delete","get","head","options"],function(n){s.prototype[n]=function(e,t){return this.request(f(t||{},{method:n,url:e,data:(t||{}).data}))}}),o.forEach(["post","put","patch"],function(a){function e(o){return function(e,t,n){return this.request(f(n||{},{method:a,headers:o?{"Content-Type":"multipart/form-data"}:{},url:e,data:t}))}}s.prototype[a]=e(),s.prototype[a+"Form"]=e(!0)}),e.exports=s},function(e,t,n){"use strict";var o=n(0);function a(){this.handlers=[]}a.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},a.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},a.prototype.forEach=function(t){o.forEach(this.handlers,function(e){null!==e&&t(e)})},e.exports=a},function(e,t,n){"use strict";var o=n(0),a=n(18),i=n(10),r=n(3),s=n(2);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s}e.exports=function(t){return c(t),t.headers=t.headers||{},t.data=a.call(t,t.data,t.headers,t.transformRequest),t.headers=o.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),o.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||r.adapter)(t).then(function(e){return c(t),e.data=a.call(t,e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(c(t),e&&e.response&&(e.response.data=a.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(e,t,n){"use strict";var a=n(0),i=n(3);e.exports=function(t,n,e){var o=this||i;return a.forEach(e,function(e){t=e.call(o,t,n)}),t}},function(e,t,n){"use strict";var a=n(0);e.exports=function(n,o){a.forEach(n,function(e,t){t!==o&&t.toUpperCase()===o.toUpperCase()&&(n[o]=e,delete n[t])})}},function(e,t,n){"use strict";var a=n(1);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(new a("Request failed with status code "+n.status,[a.ERR_BAD_REQUEST,a.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}},function(e,t,n){"use strict";var s=n(0);e.exports=s.isStandardBrowserEnv()?{write:function(e,t,n,o,a,i){var r=[];r.push(e+"="+encodeURIComponent(t)),s.isNumber(n)&&r.push("expires="+new Date(n).toGMTString()),s.isString(o)&&r.push("path="+o),s.isString(a)&&r.push("domain="+a),!0===i&&r.push("secure"),document.cookie=r.join("; ")},read:function(e){e=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var a=n(0),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,o={};return e&&a.forEach(e.split("\n"),function(e){n=e.indexOf(":"),t=a.trim(e.substr(0,n)).toLowerCase(),n=a.trim(e.substr(n+1)),!t||o[t]&&0<=i.indexOf(t)||(o[t]="set-cookie"===t?(o[t]||[]).concat([n]):o[t]?o[t]+", "+n:n)}),o}},function(e,t,n){"use strict";var o,a,i,r=n(0);function s(e){return a&&(i.setAttribute("href",e),e=i.href),i.setAttribute("href",e),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}e.exports=r.isStandardBrowserEnv()?(a=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a"),o=s(window.location.href),function(e){e=r.isString(e)?s(e):e;return e.protocol===o.protocol&&e.host===o.host}):function(){return!0}},function(e,t,n){"use strict";e.exports=function(e){e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return e&&e[1]||""}},function(e,t){e.exports=null},function(e,t,n){"use strict";var r=n(12).version,c=n(1),o={},s=(["object","boolean","number","function","string","symbol"].forEach(function(t,n){o[t]=function(e){return typeof e===t||"a"+(n<1?"n ":" ")+t}}),{});o.transitional=function(o,a,n){function i(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(e,t,n){if(!1===o)throw new c(i(t," has been removed"+(a?" in "+a:"")),c.ERR_DEPRECATED);return a&&!s[t]&&(s[t]=!0,console.warn(i(t," has been deprecated since v"+a+" and will be removed in the near future"))),!o||o(e,t,n)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new c("options must be an object",c.ERR_BAD_OPTION_VALUE);for(var o=Object.keys(e),a=o.length;0<a--;){var i=o[a],r=t[i];if(r){var s=e[i],r=void 0===s||r(s,i,e);if(!0!==r)throw new c("option "+i+" must be "+r,c.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new c("Unknown option "+i,c.ERR_BAD_OPTION)}},validators:o}},function(e,t,n){"use strict";var a=n(2);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});var t,o=this;this.promise.then(function(e){if(o._listeners){for(var t=o._listeners.length,n=0;n<t;n++)o._listeners[n](e);o._listeners=null}}),this.promise.then=function(e){var t,e=new Promise(function(e){o.subscribe(e),t=e}).then(e);return e.cancel=function(){o.unsubscribe(t)},e},e(function(e){o.reason||(o.reason=new a(e),t(o.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},o.prototype.unsubscribe=function(e){this._listeners&&-1!==(e=this._listeners.indexOf(e))&&this._listeners.splice(e,1)},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},e.exports=o},function(e,t,n){"use strict";e.exports=function(t){return function(e){return t.apply(null,e)}}},function(e,t,n){"use strict";var o=n(0);e.exports=function(e){return o.isObject(e)&&!0===e.isAxiosError}}],o={},a.m=n,a.c=o,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)a.d(n,o,function(e){return t[e]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=13);function a(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,a),t.l=!0,t.exports}var n,o},"object"==typeof exports&&"object"==typeof e?e.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?exports.a=a():o.a=a()},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,function(e,t){var n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,function(e,t){var n,o,e=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function r(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return(n=setTimeout)(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{o="function"==typeof clearTimeout?clearTimeout:i}catch(e){o=i}var s,c=[],l=!1,d=-1;function u(){l&&s&&(l=!1,s.length?c=s.concat(c):d=-1,c.length&&f())}function f(){if(!l){var e=r(u);l=!0;for(var t=c.length;t;){for(s=c,c=[];++d<t;)s&&s[d].run();d=-1,t=c.length}s=null,l=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===i||!o)&&clearTimeout)return(o=clearTimeout)(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}e.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||l||r(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=h,e.addListener=h,e.once=h,e.off=h,e.removeListener=h,e.removeAllListeners=h,e.emit=h,e.prependListener=h,e.prependOnceListener=h,e.listeners=function(e){return[]},e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},function(e,t,n){function o(e){if(e){var t,n=e;for(t in o.prototype)n[t]=o.prototype[t];return n}}(e.exports=o).prototype.on=o.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},o.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},o.prototype.off=o.prototype.removeListener=o.prototype.removeAllListeners=o.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,o=this._callbacks["$"+e];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var a=0;a<o.length;a++)if((n=o[a])===t||n.fn===t){o.splice(a,1);break}return this},o.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var o=0,a=(n=n.slice(0)).length;o<a;++o)n[o].apply(this,t);return this},o.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},o.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,m,t){var o,n=t(382),i=t(151),f=t(384),r=t(385),g=t(386),a=("undefined"!=typeof ArrayBuffer&&(o=t(387)),"undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent)),s="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),b=a||s,y=(m.protocol=3,m.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6}),c=n(y),p={type:"error",data:"parser error"},v=t(388);function l(e,t,n){for(var a=new Array(e.length),o=r(e.length,n),i=0;i<e.length;i++)!function(n,e,o){t(e,function(e,t){a[n]=t,o(e,a)})}(i,e[i],o)}m.encodePacket=function(e,t,n,o){"function"==typeof t&&(o=t,t=!1),"function"==typeof n&&(o=n,n=null);var a=void 0===e.data?void 0:e.data.buffer||e.data;if("undefined"!=typeof ArrayBuffer&&a instanceof ArrayBuffer){var i=e,r=o;if(!t)return m.encodeBase64Packet(i,r);var s=i.data,c=new Uint8Array(s),l=new Uint8Array(1+s.byteLength);l[0]=y[i.type];for(var d=0;d<c.length;d++)l[d+1]=c[d];return r(l.buffer)}if(void 0!==v&&a instanceof v){s=e,i=t,r=o;if(!i)return m.encodeBase64Packet(s,r);if(b){var u=s,f=i,p=r;if(!f)return m.encodeBase64Packet(u,p);var h=new FileReader;return h.onload=function(){m.encodePacket({type:u.type,data:h.result},f,!0,p)},h.readAsArrayBuffer(u.data)}return(i=new Uint8Array(1))[0]=y[s.type],r(new v([i.buffer,s.data]))}if(a&&a.base64)return o("b"+m.packets[e.type]+e.data.data);t=y[e.type];return void 0!==e.data&&(t+=n?g.encode(String(e.data),{strict:!1}):String(e.data)),o(""+t)},m.encodeBase64Packet=function(t,n){var o,a,i="b"+m.packets[t.type];if(void 0!==v&&t.data instanceof v)return(a=new FileReader).onload=function(){var e=a.result.split(",")[1];n(i+e)},a.readAsDataURL(t.data);try{o=String.fromCharCode.apply(null,new Uint8Array(t.data))}catch(e){for(var r=new Uint8Array(t.data),s=new Array(r.length),c=0;c<r.length;c++)s[c]=r[c];o=String.fromCharCode.apply(null,s)}return i+=btoa(o),n(i)},m.decodePacket=function(e,t,n){if(void 0===e)return p;if("string"==typeof e){if("b"===e.charAt(0))return m.decodeBase64Packet(e.substr(1),t);if(n&&!1===(e=function(e){try{e=g.decode(e,{strict:!1})}catch(e){return!1}return e}(e)))return p;var o=e.charAt(0);return Number(o)==o&&c[o]?1<e.length?{type:c[o],data:e.substring(1)}:{type:c[o]}:p}o=new Uint8Array(e)[0],n=f(e,1);return v&&"blob"===t&&(n=new v([n])),{type:c[o],data:n}},m.decodeBase64Packet=function(e,t){var n=c[e.charAt(0)];if(!o)return{type:n,data:{base64:!0,data:e.substr(1)}};e=o.decode(e.substr(1));return{type:n,data:e="blob"===t&&v?new v([e]):e}},m.encodePayload=function(e,n,o){"function"==typeof n&&(o=n,n=null);var a=i(e);return n&&a?v&&!b?m.encodePayloadAsBlob(e,o):m.encodePayloadAsArrayBuffer(e,o):e.length?void l(e,function(e,t){m.encodePacket(e,!!a&&n,!1,function(e){t(null,e.length+":"+e)})},function(e,t){return o(t.join(""))}):o("0:")},m.decodePayload=function(e,t,n){if("string"!=typeof e)return m.decodePayloadAsBinary(e,t,n);if("function"==typeof t&&(n=t,t=null),""===e)return n(p,0,1);for(var o,a,i="",r=0,s=e.length;r<s;r++){var c=e.charAt(r);if(":"===c){if(""===i||i!=(o=Number(i)))return n(p,0,1);if(i!=(a=e.substr(r+1,o)).length)return n(p,0,1);if(a.length){if(a=m.decodePacket(a,t,!1),p.type===a.type&&p.data===a.data)return n(p,0,1);if(!1===n(a,r+o,s))return}r+=o,i=""}else i+=c}return""!==i?n(p,0,1):void 0},m.encodePayloadAsArrayBuffer=function(e,o){if(!e.length)return o(new ArrayBuffer(0));l(e,function(e,t){m.encodePacket(e,!0,!0,function(e){return t(null,e)})},function(e,t){var n=t.reduce(function(e,t){return e+(e="string"==typeof t?t.length:t.byteLength).toString().length+e+2},0),r=new Uint8Array(n),s=0;return t.forEach(function(e){var t="string"==typeof e,n=e;if(t){for(var o=new Uint8Array(e.length),a=0;a<e.length;a++)o[a]=e.charCodeAt(a);n=o.buffer}r[s++]=t?0:1;for(var i=n.byteLength.toString(),a=0;a<i.length;a++)r[s++]=parseInt(i[a]);for(r[s++]=255,o=new Uint8Array(n),a=0;a<o.length;a++)r[s++]=o[a]}),o(r.buffer)})},m.encodePayloadAsBlob=function(e,n){l(e,function(e,r){m.encodePacket(e,!0,!0,function(e){var t=new Uint8Array(1);if(t[0]=1,"string"==typeof e){for(var n=new Uint8Array(e.length),o=0;o<e.length;o++)n[o]=e.charCodeAt(o);e=n.buffer,t[0]=0}for(var a=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),i=new Uint8Array(a.length+1),o=0;o<a.length;o++)i[o]=parseInt(a[o]);i[a.length]=255,v&&(t=new v([t.buffer,i.buffer,e]),r(null,t))})},function(e,t){return n(new v(t))})},m.decodePayloadAsBinary=function(e,n,o){"function"==typeof n&&(o=n,n=null);for(var t=e,a=[];0<t.byteLength;){for(var i=new Uint8Array(t),r=0===i[0],s="",c=1;255!==i[c];c++){if(310<s.length)return o(p,0,1);s+=i[c]}var t=f(t,2+s.length),s=parseInt(s),l=f(t,0,s);if(r)try{l=String.fromCharCode.apply(null,new Uint8Array(l))}catch(e){for(var d=new Uint8Array(l),l="",c=0;c<d.length;c++)l+=String.fromCharCode(d[c])}a.push(l),t=f(t,s)}var u=a.length;a.forEach(function(e,t){o(m.decodePacket(e,n,!0),t,u)})}},function(e,t,n){var i=n(373),o=n(105),r=n(148),s=n(74)("socket.io-client"),c=(e.exports=t=a,t.managers={});function a(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var e=i(e),n=e.source,o=e.id,a=e.path,a=c[o]&&a in c[o].nsps,a=t.forceNew||t["force new connection"]||!1===t.multiplex||a?(s("ignoring socket cache for %s",n),r(n,t)):(c[o]||(s("new io instance for %s",n),c[o]=r(n,t)),c[o]);return e.query&&!t.query&&(t.query=e.query),a.socket(e.path,t)}t.protocol=o.protocol,t.connect=a,t.Manager=n(148),t.Socket=n(154)},null,null,null,null,function(e,t,n){var o;!function(){"use strict";void 0!==(o="function"==typeof(o=function(){function u(e){throw e}function f(){}function e(e,t){for(var n in void 0===t&&"function"==typeof e&&(t=e),"[object Object]"!=Object.prototype.toString.call(e)&&(e={}),a)this[n]=(void 0!==e[n]?e:a)[n];this.dbName=this.storePrefix+this.storeName,this.dbVersion=parseInt(this.dbVersion,10)||1,t&&(this.onStoreReady=t);var o="object"==typeof window?window:self,t=this.implementationPreference.filter(function(e){return e in o});this.implementation=t[0],this.idb=o[this.implementation],this.keyRange=o.IDBKeyRange||o.webkitIDBKeyRange||o.mozIDBKeyRange,this.consts={READ_ONLY:"readonly",READ_WRITE:"readwrite",VERSION_CHANGE:"versionchange",NEXT:"next",NEXT_NO_DUPLICATE:"nextunique",PREV:"prev",PREV_NO_DUPLICATE:"prevunique"},this.openDB()}var a={storeName:"Store",storePrefix:"IDBWrapper-",dbVersion:1,keyPath:"id",autoIncrement:!0,onStoreReady:function(){},onError:u,indexes:[],implementationPreference:["indexedDB","webkitIndexedDB","mozIndexedDB","shimIndexedDB"]},t={constructor:e,version:"1.7.2",db:null,dbName:null,dbVersion:null,store:null,storeName:null,storePrefix:null,keyPath:null,autoIncrement:null,indexes:null,implementationPreference:null,implementation:"",onStoreReady:null,onError:null,_insertIdCount:0,openDB:function(){var e=this.idb.open(this.dbName,this.dbVersion),a=!1;e.onerror=function(e){var t;("error"in(t=e).target?"VersionError"==t.target.error.name:"errorCode"in t.target&&12==t.target.errorCode)?this.onError(new Error("The version number provided is lower than the existing one.")):(e=e.target.error||(t="IndexedDB unknown error occurred when opening DB "+this.dbName+" version "+this.dbVersion,"errorCode"in e.target&&(t+=" with error code "+e.target.errorCode),new Error(t)),this.onError(e))}.bind(this),e.onsuccess=function(e){var o;a||(this.db?this.onStoreReady():(this.db=e.target.result,"string"!=typeof this.db.version?this.db.objectStoreNames.contains(this.storeName)?(e=this.db.transaction([this.storeName],this.consts.READ_ONLY),this.store=e.objectStore(this.storeName),o=Array.prototype.slice.call(this.getIndexList()),this.indexes.forEach(function(e){var t,n=e.name;if(!n)return a=!0,void this.onError(new Error("Cannot create index: No index name given."));this.normalizeIndexData(e),this.hasIndex(n)?(t=this.store.index(n),this.indexComplies(t,e)||(a=!0,this.onError(new Error('Cannot modify index "'+n+'" for current version. Please bump version number to '+(this.dbVersion+1)+"."))),o.splice(o.indexOf(n),1)):(a=!0,this.onError(new Error('Cannot create new index "'+n+'" for current version. Please bump version number to '+(this.dbVersion+1)+".")))},this),o.length&&(a=!0,this.onError(new Error('Cannot delete index(es) "'+o.toString()+'" for current version. Please bump version number to '+(this.dbVersion+1)+"."))),a||this.onStoreReady()):this.onError(new Error("Object store couldn't be created.")):this.onError(new Error("The IndexedDB implementation in this browser is outdated. Please upgrade your browser."))))}.bind(this),e.onupgradeneeded=function(e){this.db=e.target.result,this.db.objectStoreNames.contains(this.storeName)?this.store=e.target.transaction.objectStore(this.storeName):(e={autoIncrement:this.autoIncrement},null!==this.keyPath&&(e.keyPath=this.keyPath),this.store=this.db.createObjectStore(this.storeName,e));var o=Array.prototype.slice.call(this.getIndexList());this.indexes.forEach(function(e){var t,n=e.name;n||(a=!0,this.onError(new Error("Cannot create index: No index name given."))),this.normalizeIndexData(e),this.hasIndex(n)?(t=this.store.index(n),this.indexComplies(t,e)||(this.store.deleteIndex(n),this.store.createIndex(n,e.keyPath,{unique:e.unique,multiEntry:e.multiEntry})),o.splice(o.indexOf(n),1)):this.store.createIndex(n,e.keyPath,{unique:e.unique,multiEntry:e.multiEntry})},this),o.length&&o.forEach(function(e){this.store.deleteIndex(e)},this)}.bind(this)},deleteDatabase:function(e,t){var n;this.idb.deleteDatabase?(this.db.close(),(n=this.idb.deleteDatabase(this.dbName)).onsuccess=e,n.onerror=t):t(new Error("Browser does not support IndexedDB deleteDatabase!"))},put:function(e,t,n,o){null!==this.keyPath&&(o=n,n=t,t=e),o=o||u,n=n||f;var a=!1,i=null,r=this.db.transaction([this.storeName],this.consts.READ_WRITE);return r.oncomplete=function(){(a?n:o)(i)},r.onabort=o,r.onerror=o,(t=null!==this.keyPath?(this._addIdPropertyIfNeeded(t),r.objectStore(this.storeName).put(t)):r.objectStore(this.storeName).put(t,e)).onsuccess=function(e){a=!0,i=e.target.result},t.onerror=o,r},get:function(e,t,n){n=n||u,t=t||f;var o=!1,a=null,i=this.db.transaction([this.storeName],this.consts.READ_ONLY),e=(i.oncomplete=function(){(o?t:n)(a)},i.onabort=n,i.onerror=n,i.objectStore(this.storeName).get(e));return e.onsuccess=function(e){o=!0,a=e.target.result},e.onerror=n,i},remove:function(e,t,n){n=n||u,t=t||f;var o=!1,a=null,i=this.db.transaction([this.storeName],this.consts.READ_WRITE),e=(i.oncomplete=function(){(o?t:n)(a)},i.onabort=n,i.onerror=n,i.objectStore(this.storeName).delete(e));return e.onsuccess=function(e){o=!0,a=e.target.result},e.onerror=n,i},batch:function(e,t,i){if(i=i||u,t=t||f,"[object Array]"!=Object.prototype.toString.call(e))i(new Error("dataArray argument must be of type Array."));else if(0===e.length)return t(!0);function r(){0!=--n||s||(o=s=!0)}var n=e.length,s=!1,o=!1,c=this.db.transaction([this.storeName],this.consts.READ_WRITE);c.oncomplete=function(){(o?t:i)(o)},c.onabort=i,c.onerror=i;return e.forEach(function(e){function t(e){c.abort(),s||(s=!0,i(e,o,a))}var n,o=e.type,a=e.key,e=e.value;"remove"==o?((n=c.objectStore(this.storeName).delete(a)).onsuccess=r,n.onerror=t):"put"==o&&((n=null!==this.keyPath?(this._addIdPropertyIfNeeded(e),c.objectStore(this.storeName).put(e)):c.objectStore(this.storeName).put(e,a)).onsuccess=r,n.onerror=t)},this),c},putBatch:function(e,t,n){e=e.map(function(e){return{type:"put",value:e}});return this.batch(e,t,n)},upsertBatch:function(t,e,n,o){"function"==typeof e&&(o=n=e,e={}),o=o||u,n=n||f,e=e||{},"[object Array]"!=Object.prototype.toString.call(t)&&o(new Error("dataArray argument must be of type Array."));function a(e){t[l++][i]=e.target.result,0!=--r||s||(c=s=!0)}var i=e.keyField||this.keyPath,r=t.length,s=!1,c=!1,l=0,d=this.db.transaction([this.storeName],this.consts.READ_WRITE);d.oncomplete=function(){c?n(t):o(!1)},d.onabort=o,d.onerror=o;return t.forEach(function(e){var t=e.key,e=null!==this.keyPath?(this._addIdPropertyIfNeeded(e),d.objectStore(this.storeName).put(e)):d.objectStore(this.storeName).put(e,t);e.onsuccess=a,e.onerror=function(e){d.abort(),s||(s=!0,o(e))}},this),d},removeBatch:function(e,t,n){e=e.map(function(e){return{type:"remove",key:e}});return this.batch(e,t,n)},getBatch:function(e,t,n,o){if(n=n||u,t=t||f,o=o||"sparse","[object Array]"!=Object.prototype.toString.call(e))n(new Error("keyArray argument must be of type Array."));else if(0===e.length)return t([]);function a(e){e.target.result||"dense"==o?i.push(e.target.result):"sparse"==o&&i.length++,0==--r&&(s=!0,c=i)}var i=[],r=e.length,s=!1,c=null,l=this.db.transaction([this.storeName],this.consts.READ_ONLY);l.oncomplete=function(){(s?t:n)(c)},l.onabort=n,l.onerror=n;return e.forEach(function(e){e=l.objectStore(this.storeName).get(e);e.onsuccess=a,e.onerror=function(e){n(c=e),l.abort()}},this),l},getAll:function(e,t){t=t||u,e=e||f;var n=this.db.transaction([this.storeName],this.consts.READ_ONLY),o=n.objectStore(this.storeName);return o.getAll?this._getAllNative(n,o,e,t):this._getAllCursor(n,o,e,t),n},_getAllNative:function(e,t,n,o){var a=!1,i=null,e=(e.oncomplete=function(){(a?n:o)(i)},e.onabort=o,e.onerror=o,t.getAll());e.onsuccess=function(e){a=!0,i=e.target.result},e.onerror=o},_getAllCursor:function(e,t,n,o){var a=[],i=!1,r=null,e=(e.oncomplete=function(){(i?n:o)(r)},e.onabort=o,e.onerror=o,t.openCursor());e.onsuccess=function(e){e=e.target.result;e?(a.push(e.value),e.continue()):(i=!0,r=a)},e.onError=o},clear:function(e,t){t=t||u,e=e||f;var n=!1,o=null,a=this.db.transaction([this.storeName],this.consts.READ_WRITE),i=(a.oncomplete=function(){(n?e:t)(o)},a.onabort=t,a.onerror=t,a.objectStore(this.storeName).clear());return i.onsuccess=function(e){n=!0,o=e.target.result},i.onerror=t,a},_addIdPropertyIfNeeded:function(e){void 0===e[this.keyPath]&&(e[this.keyPath]=this._insertIdCount+++Date.now())},getIndexList:function(){return this.store.indexNames},hasIndex:function(e){return this.store.indexNames.contains(e)},normalizeIndexData:function(e){e.keyPath=e.keyPath||e.name,e.unique=!!e.unique,e.multiEntry=!!e.multiEntry},indexComplies:function(i,r){return["keyPath","unique","multiEntry"].every(function(e){if("multiEntry"==e&&void 0===i[e]&&!1===r[e])return!0;if("keyPath"!=e||"[object Array]"!=Object.prototype.toString.call(r[e]))return r[e]==i[e];var t=r.keyPath,n=i.keyPath;if("string"==typeof n)return t.toString()==n;if("function"!=typeof n.contains&&"function"!=typeof n.indexOf)return!1;if(n.length!==t.length)return!1;for(var o=0,a=t.length;o<a;o++)if(!(n.contains&&n.contains(t[o])||n.indexOf(-1!==t[o])))return!1;return!0})},iterate:function(n,o){var e="desc"==(o=s({index:null,order:"ASC",autoContinue:!0,filterDuplicates:!1,keyRange:null,writeAccess:!1,onEnd:null,onError:u,limit:1/0,offset:0,allowItemRejection:!1},o||{})).order.toLowerCase()?"PREV":"NEXT",a=(o.filterDuplicates&&(e+="_NO_DUPLICATE"),!1),i=this.db.transaction([this.storeName],this.consts[o.writeAccess?"READ_WRITE":"READ_ONLY"]),t=i.objectStore(this.storeName),r=(o.index&&(t=t.index(o.index)),0),t=(i.oncomplete=function(){a?o.onEnd?o.onEnd():n(null):o.onError(null)},i.onabort=o.onError,i.onerror=o.onError,t.openCursor(o.keyRange,this.consts[e]));return t.onerror=o.onError,t.onsuccess=function(e){var t,e=e.target.result;e?o.offset?(e.advance(o.offset),o.offset=0):(t=n(e.value,e,i),o.allowItemRejection&&!1===t||r++,o.autoContinue&&(r+o.offset<o.limit?e.continue():a=!0)):a=!0},i},query:function(e,n){var o=[],a=0;return(n=n||{}).autoContinue=!0,n.writeAccess=!1,n.allowItemRejection=!!n.filter,n.onEnd=function(){e(o,a)},this.iterate(function(e){a++;var t=!n.filter||n.filter(e);return!1!==t&&o.push(e),t},n)},count:function(e,t){var n=(t=s({index:null,keyRange:null},t||{})).onError||u,o=!1,a=null,i=this.db.transaction([this.storeName],this.consts.READ_ONLY),r=(i.oncomplete=function(){(o?e:n)(a)},i.onabort=n,i.onerror=n,i.objectStore(this.storeName)),r=(r=t.index?r.index(t.index):r).count(t.keyRange);return r.onsuccess=function(e){o=!0,a=e.target.result},r.onError=n,i},makeKeyRange:function(e){var t,n=void 0!==e.lower,o=void 0!==e.upper;switch(!0){case void 0!==e.only:t=this.keyRange.only(e.only);break;case n&&o:t=this.keyRange.bound(e.lower,e.upper,e.excludeLower,e.excludeUpper);break;case n:t=this.keyRange.lowerBound(e.lower,e.excludeLower);break;case o:t=this.keyRange.upperBound(e.upper,e.excludeUpper);break;default:throw new Error('Cannot create KeyRange. Provide one or both of "lower" or "upper" value, or an "only" value.')}return t}},i={};function s(e,t){var n,o;for(n in t)(o=t[n])!==i[n]&&o!==e[n]&&(e[n]=o);return e}return e.prototype=t,e.version=t.version,e})?o.call(t,n,t,e):o)&&(e.exports=o)}()},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,function(e,o,t){!function o(a,i,r){function s(t,e){if(!i[t]){if(!a[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}n=i[t]={exports:{}};a[t][0].call(n.exports,function(e){return s(a[t][1][e]||e)},n,n.exports,o,a,i,r)}return i[t].exports}for(var c="function"==typeof require&&require,e=0;e<r.length;e++)s(r[e]);return s}({1:[function(e,t,n){o.Buffer=e("buffer").Buffer},{buffer:3}],2:[function(e,t,n){"use strict";n.byteLength=function(e){var e=d(e),t=e[0],e=e[1];return 3*(t+e)/4-e},n.toByteArray=function(e){for(var t,n=d(e),o=n[0],n=n[1],a=new l(3*(o+n)/4-n),i=0,r=0<n?o-4:o,s=0;s<r;s+=4)t=c[e.charCodeAt(s)]<<18|c[e.charCodeAt(s+1)]<<12|c[e.charCodeAt(s+2)]<<6|c[e.charCodeAt(s+3)],a[i++]=t>>16&255,a[i++]=t>>8&255,a[i++]=255&t;return 2===n&&(t=c[e.charCodeAt(s)]<<2|c[e.charCodeAt(s+1)]>>4,a[i++]=255&t),1===n&&(t=c[e.charCodeAt(s)]<<10|c[e.charCodeAt(s+1)]<<4|c[e.charCodeAt(s+2)]>>2,a[i++]=t>>8&255,a[i++]=255&t),a},n.fromByteArray=function(e){for(var t,n=e.length,o=n%3,a=[],i=0,r=n-o;i<r;i+=16383)a.push(function(e,t,n){for(var o,a=[],i=t;i<n;i+=3)o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),a.push(s[(o=o)>>18&63]+s[o>>12&63]+s[o>>6&63]+s[63&o]);return a.join("")}(e,i,r<i+16383?r:i+16383));return 1==o?(t=e[n-1],a.push(s[t>>2]+s[t<<4&63]+"==")):2==o&&(t=(e[n-2]<<8)+e[n-1],a.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"=")),a.join("")};for(var s=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,i=o.length;a<i;++a)s[a]=o[a],c[o.charCodeAt(a)]=a;function d(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("=");return[e=-1===e?t:e,e===t?0:4-e%4]}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],3:[function(O,e,M){!function(e){!function(){"use strict";var T=O("base64-js"),i=O("ieee754"),t=(M.Buffer=u,M.SlowBuffer=function(e){return u.alloc(+(e=+e!=e?0:e))},M.INSPECT_MAX_BYTES=50,2147483647);function d(e){if(t<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return e.__proto__=u.prototype,e}function u(e,t,n){if("number"!=typeof e)return o(e,t,n);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return r(e)}function o(e,t,n){if("string"==typeof e){var o=e,a=t;if(!u.isEncoding(a="string"==typeof a&&""!==a?a:"utf8"))throw new TypeError("Unknown encoding: "+a);var i=0|h(o,a),r=d(i);return r=(o=r.write(o,a))!==i?r.slice(0,o):r}if(ArrayBuffer.isView(e))return f(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)){a=e,i=t,o=n;if(i<0||a.byteLength<i)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<i+(o||0))throw new RangeError('"length" is outside of buffer bounds');return(a=void 0===i&&void 0===o?new Uint8Array(a):void 0===o?new Uint8Array(a,i):new Uint8Array(a,i,o)).__proto__=u.prototype,a}if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);var s,c,l=u.isBuffer(s=e)?(0!==(c=d(l=0|p(s.length))).length&&s.copy(c,0,0,l),c):void 0!==s.length?"number"!=typeof s.length||k(s.length)?d(0):f(s):"Buffer"===s.type&&Array.isArray(s.data)?f(s.data):void 0;if(l)return l;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function r(e){return a(e),d(e<0?0:0|p(e))}function f(e){for(var t=e.length<0?0:0|p(e.length),n=d(t),o=0;o<t;o+=1)n[o]=255&e[o];return n}function p(e){if(t<=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,o=2<arguments.length&&!0===arguments[2];if(!o&&0===n)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return _(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return S(e).length;default:if(a)return o?-1:_(e).length;t=(""+t).toLowerCase(),a=!0}}function n(e,t,n){var o=e[t];e[t]=e[n],e[n]=o}function s(e,t,n,o,a){if(0===e.length)return-1;if("string"==typeof n?(o=n,n=0):2147483647<n?n=2147483647:n<-2147483648&&(n=-2147483648),(n=(n=k(n=+n)?a?0:e.length-1:n)<0?e.length+n:n)>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=u.from(t,o)),u.isBuffer(t))return 0===t.length?-1:c(e,t,n,o,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(a?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,n):c(e,[t],n,o,a);throw new TypeError("val must be string, number or Buffer")}function c(e,t,n,o,a){var i=1,r=e.length,s=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;r/=i=2,s/=2,n/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(a)for(var l=-1,d=n;d<r;d++)if(c(e,d)===c(t,-1===l?0:d-l)){if(d-(l=-1===l?d:l)+1===s)return l*i}else-1!==l&&(d-=d-l),l=-1;else for(d=n=r<n+s?r-s:n;0<=d;d--){for(var u=!0,f=0;f<s;f++)if(c(e,d+f)!==c(t,f)){u=!1;break}if(u)return d}return-1}function y(e,t,n,o){return E(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,o)}function C(e,t,n){n=Math.min(e.length,n);for(var o=[],a=t;a<n;){var i,r,s,c,l=e[a],d=null,u=239<l?4:223<l?3:191<l?2:1;if(a+u<=n)switch(u){case 1:l<128&&(d=l);break;case 2:128==(192&(i=e[a+1]))&&127<(c=(31&l)<<6|63&i)&&(d=c);break;case 3:i=e[a+1],r=e[a+2],128==(192&i)&&128==(192&r)&&2047<(c=(15&l)<<12|(63&i)<<6|63&r)&&(c<55296||57343<c)&&(d=c);break;case 4:i=e[a+1],r=e[a+2],s=e[a+3],128==(192&i)&&128==(192&r)&&128==(192&s)&&65535<(c=(15&l)<<18|(63&i)<<12|(63&r)<<6|63&s)&&c<1114112&&(d=c)}null===d?(d=65533,u=1):65535<d&&(d-=65536,o.push(d>>>10&1023|55296),d=56320|1023&d),o.push(d),a+=u}var f=o,p=f.length;if(p<=g)return String.fromCharCode.apply(String,f);for(var h="",m=0;m<p;)h+=String.fromCharCode.apply(String,f.slice(m,m+=g));return h}M.kMaxLength=t,(u.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),u.poolSize=8192,u.from=o,u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,u.alloc=function(e,t,n){return t=t,n=n,a(e=e),!(e<=0)&&void 0!==t?"string"==typeof n?d(e).fill(t,n):d(e).fill(t):d(e)},u.allocUnsafe=r,u.allocUnsafeSlow=r,u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(A(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),A(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,o=t.length,a=0,i=Math.min(n,o);a<i;++a)if(e[a]!==t[a]){n=e[a],o=t[a];break}return n<o?-1:o<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);if(void 0===t)for(a=t=0;a<e.length;++a)t+=e[a].length;for(var n=u.allocUnsafe(t),o=0,a=0;a<e.length;++a){var i=e[a];if(A(i,Uint8Array)&&(i=u.from(i)),!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)n(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)n(this,t,t+3),n(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)n(this,t,t+7),n(this,t+1,t+6),n(this,t+2,t+5),n(this,t+3,t+4);return this},u.prototype.toLocaleString=u.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):function(e,t,n){var o,a=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((n=void 0===n||n>this.length?this.length:n)<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var i=this,r=t,s=n,c=i.length;(!s||s<0||c<s)&&(s=c);for(var l="",d=r=!r||r<0?0:r;d<s;++d)l+=function(e){return e<16?"0"+e.toString(16):e.toString(16)}(i[d]);return l;case"utf8":case"utf-8":return C(this,t,n);case"ascii":var u=this,c=t,f=n,p="";f=Math.min(u.length,f);for(var h=c;h<f;++h)p+=String.fromCharCode(127&u[h]);return p;case"latin1":case"binary":var m=this,r=t,g=n,b="";g=Math.min(m.length,g);for(var y=r;y<g;++y)b+=String.fromCharCode(m[y]);return b;case"base64":return v=this,o=n,0===(w=t)&&o===v.length?T.fromByteArray(v):T.fromByteArray(v.slice(w,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var v=t,w=n,x=this.slice(v,w),_="",S=0;S<x.length;S+=2)_+=String.fromCharCode(x[S]+256*x[S+1]);return _;default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}.apply(this,arguments)},u.prototype.equals=function(e){if(u.isBuffer(e))return this===e||0===u.compare(this,e);throw new TypeError("Argument must be a Buffer")},u.prototype.inspect=function(){var e="",t=M.INSPECT_MAX_BYTES,e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim();return this.length>t&&(e+=" ... "),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,o,a){if(A(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===n&&(n=e?e.length:0),void 0===o&&(o=0),void 0===a&&(a=this.length),(t=void 0===t?0:t)<0||n>e.length||o<0||a>this.length)throw new RangeError("out of range index");if(a<=o&&n<=t)return 0;if(a<=o)return-1;if(n<=t)return 1;if(this===e)return 0;for(var i=(a>>>=0)-(o>>>=0),r=(n>>>=0)-(t>>>=0),s=Math.min(i,r),c=this.slice(o,a),l=e.slice(t,n),d=0;d<s;++d)if(c[d]!==l[d]){i=c[d],r=l[d];break}return i<r?-1:r<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return s(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return s(this,e,t,n,!1)},u.prototype.write=function(e,t,n,o){if(void 0===t)o="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)o=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===o&&(o="utf8")):(o=n,n=void 0)}var a=this.length-t;if((void 0===n||a<n)&&(n=a),0<e.length&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");o=o||"utf8";for(var i,r,s,c,l,d=!1;;)switch(o){case"hex":var u=this,f=e,p=t,h=n,m=(p=Number(p)||0,u.length-p);(!h||(h=Number(h))>m)&&(h=m),(m=f.length)/2<h&&(h=m/2);for(var g=0;g<h;++g){var b=parseInt(f.substr(2*g,2),16);if(k(b))return g;u[p+g]=b}return g;case"utf8":case"utf-8":return m=t,l=n,E(_(e,(c=this).length-m),c,m,l);case"ascii":return y(this,e,t,n);case"latin1":case"binary":return y(this,e,t,n);case"base64":return c=this,l=t,s=n,E(S(e),c,l,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s=t,r=n,E(function(e,t){for(var n,o,a=[],i=0;i<e.length&&!((t-=2)<0);++i)o=(n=e.charCodeAt(i))>>8,a.push(n%256),a.push(o);return a}(e,(i=this).length-s),i,s,r);default:if(d)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),d=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var g=4096;function l(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(n<e+t)throw new RangeError("Trying to access beyond buffer length")}function m(e,t,n,o,a,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(a<t||t<i)throw new RangeError('"value" argument is out of bounds');if(n+o>e.length)throw new RangeError("Index out of range")}function b(e,t,n,o){if(n+o>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function v(e,t,n,o,a){return t=+t,n>>>=0,a||b(e,0,n,4),i.write(e,t,n,o,23,4),n+4}function w(e,t,n,o,a){return t=+t,n>>>=0,a||b(e,0,n,8),i.write(e,t,n,o,52,8),n+8}u.prototype.slice=function(e,t){var n=this.length,n=((e=~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),t<e&&(t=e),this.subarray(e,t));return n.__proto__=u.prototype,n},u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||l(e,t,this.length);for(var o=this[e],a=1,i=0;++i<t&&(a*=256);)o+=this[e+i]*a;return o},u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||l(e,t,this.length);for(var o=this[e+--t],a=1;0<t&&(a*=256);)o+=this[e+--t]*a;return o},u.prototype.readUInt8=function(e,t){return e>>>=0,t||l(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||l(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||l(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||l(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||l(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||l(e,t,this.length);for(var o=this[e],a=1,i=0;++i<t&&(a*=256);)o+=this[e+i]*a;return o>=(a*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||l(e,t,this.length);for(var o=t,a=1,i=this[e+--o];0<o&&(a*=256);)i+=this[e+--o]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||l(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||l(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},u.prototype.readInt16BE=function(e,t){e>>>=0,t||l(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||l(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||l(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||l(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||l(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||l(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||l(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,o){e=+e,t>>>=0,n>>>=0,o||m(this,e,t,n,Math.pow(2,8*n)-1,0);var a=1,i=0;for(this[t]=255&e;++i<n&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,o){e=+e,t>>>=0,n>>>=0,o||m(this,e,t,n,Math.pow(2,8*n)-1,0);var a=n-1,i=1;for(this[t+a]=255&e;0<=--a&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||m(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||m(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||m(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||m(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||m(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,n,o){e=+e,t>>>=0,o||m(this,e,t,n,(o=Math.pow(2,8*n-1))-1,-o);var a=0,i=1,r=0;for(this[t]=255&e;++a<n&&(i*=256);)e<0&&0===r&&0!==this[t+a-1]&&(r=1),this[t+a]=(e/i>>0)-r&255;return t+n},u.prototype.writeIntBE=function(e,t,n,o){e=+e,t>>>=0,o||m(this,e,t,n,(o=Math.pow(2,8*n-1))-1,-o);var a=n-1,i=1,r=0;for(this[t+a]=255&e;0<=--a&&(i*=256);)e<0&&0===r&&0!==this[t+a+1]&&(r=1),this[t+a]=(e/i>>0)-r&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||m(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||m(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||m(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||m(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||m(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,n){return v(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return v(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return w(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return w(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,o){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n=n||0,o||0===o||(o=this.length),t>=e.length&&(t=e.length),(o=0<o&&o<n?n:o)===n)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length);var a=(o=e.length-t<o-n?e.length-t+n:o)-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,o);else if(this===e&&n<t&&t<o)for(var i=a-1;0<=i;--i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,o),t);return a},u.prototype.fill=function(e,t,n,o){if("string"==typeof e){if("string"==typeof t?(o=t,t=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!u.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var a;1===e.length&&(a=e.charCodeAt(0),("utf8"===o&&a<128||"latin1"===o)&&(e=a))}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(e=e||0))for(i=t;i<n;++i)this[i]=e;else{var r=u.isBuffer(e)?e:u.from(e,o),s=r.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=r[i%s]}return this};var x=/[^+/0-9A-Za-z-_]/g;function _(e,t){var n;t=t||1/0;for(var o=e.length,a=null,i=[],r=0;r<o;++r){if(55295<(n=e.charCodeAt(r))&&n<57344){if(!a){if(56319<n){-1<(t-=3)&&i.push(239,191,189);continue}if(r+1===o){-1<(t-=3)&&i.push(239,191,189);continue}a=n;continue}if(n<56320){-1<(t-=3)&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&-1<(t-=3)&&i.push(239,191,189);if(a=null,n<128){if(--t<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function S(e){return T.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function E(e,t,n,o){for(var a=0;a<o&&!(a+n>=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function k(e){return e!=e}}.call(this)}.call(this,O("buffer").Buffer)},{"base64-js":2,buffer:3,ieee754:4}],4:[function(e,t,n){n.read=function(e,t,n,o,a){var i,r,s=8*a-o-1,c=(1<<s)-1,l=c>>1,d=-7,u=n?a-1:0,f=n?-1:1,a=e[t+u];for(u+=f,i=a&(1<<-d)-1,a>>=-d,d+=s;0<d;i=256*i+e[t+u],u+=f,d-=8);for(r=i&(1<<-d)-1,i>>=-d,d+=o;0<d;r=256*r+e[t+u],u+=f,d-=8);if(0===i)i=1-l;else{if(i===c)return r?NaN:1/0*(a?-1:1);r+=Math.pow(2,o),i-=l}return(a?-1:1)*r*Math.pow(2,i-o)},n.write=function(e,t,n,o,a,i){var r,s,c=8*i-a-1,l=(1<<c)-1,d=l>>1,u=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=o?0:i-1,p=o?1:-1,i=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,r=l):(r=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-r))<1&&(r--,o*=2),2<=(t+=1<=r+d?u/o:u*Math.pow(2,1-d))*o&&(r++,o/=2),l<=r+d?(s=0,r=l):1<=r+d?(s=(t*o-1)*Math.pow(2,a),r+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,a),r=0));8<=a;e[n+f]=255&s,f+=p,s/=256,a-=8);for(r=r<<a|s,c+=a;0<c;e[n+f]=255&r,f+=p,r/=256,c-=8);e[n+f-p]|=128*i}},{}]},{},[1])},function(e,t,n){e.exports=n(77)},function(e,t){t.encode=function(e){var t,n="";for(t in e)e.hasOwnProperty(t)&&(n.length&&(n+="&"),n+=encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return n},t.decode=function(e){for(var t={},n=e.split("&"),o=0,a=n.length;o<a;o++){var i=n[o].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}},function(e,t){e.exports=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(n,a,o){!function(t){function e(){var e;try{e=a.storage.debug}catch(e){}return e=!e&&void 0!==t&&"env"in t?t.env.DEBUG:e}(a=n.exports=o(389)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},a.formatArgs=function(e){var t,n,o=this.useColors;e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+a.humanize(this.diff),o&&(o="color: "+this.color,e.splice(1,0,o,"color: inherit"),e[n=t=0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(t++,"%c"===e&&(n=t))}),e.splice(n,0,o))},a.save=function(e){try{null==e?a.storage.removeItem("debug"):a.storage.debug=e}catch(e){}},a.load=e,a.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},a.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),a.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],a.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},a.enable(e())}.call(this,o(49))},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,function(e,t){var a=36e5,i=864e5;function r(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}e.exports=function(e,t){t=t||{};var n=typeof e;if(!("string"==n&&0<e.length)){if("number"==n&&!1===isNaN(e))return t.long?r(n=e,i,"day")||r(n,a,"hour")||r(n,6e4,"minute")||r(n,1e3,"second")||n+" ms":i<=(t=e)?Math.round(t/i)+"d":a<=t?Math.round(t/a)+"h":6e4<=t?Math.round(t/6e4)+"m":1e3<=t?Math.round(t/1e3)+"s":t+"ms";throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}n=e;if(!(100<(n=String(n)).length)){n=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(n);if(n){var o=parseFloat(n[1]);switch((n[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*a;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*o;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}},function(e,r,t){var s=t(375)("socket.io-parser"),n=t(50),o=t(377),a=t(147);function i(){}r.protocol=4,r.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],r.CONNECT=0,r.DISCONNECT=1,r.EVENT=2,r.ACK=3,r.ERROR=4,r.BINARY_EVENT=5,r.BINARY_ACK=6,r.Encoder=i,r.Decoder=d;var c=r.ERROR+'"encode error"';function l(e){var t=""+e.type;if(r.BINARY_EVENT!==e.type&&r.BINARY_ACK!==e.type||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data){var n=function(e){try{return JSON.stringify(e)}catch(e){return!1}}(e.data);if(!1===n)return c;t+=n}return s("encoded %j as %s",e,t),t}function d(){this.reconstructor=null}function u(e){this.reconPack=e,this.buffers=[]}function f(e){return{type:r.ERROR,data:"parser error: "+e}}i.prototype.encode=function(e,t){var n;s("encoding packet %j",e),r.BINARY_EVENT===e.type||r.BINARY_ACK===e.type?(n=t,o.removeBlobs(e,function(e){var e=o.deconstructPacket(e),t=l(e.packet),e=e.buffers;e.unshift(t),n(e)})):t([l(e)])},n(d.prototype),d.prototype.add=function(e){var t;if("string"==typeof e)t=function(e){var t=0,n={type:Number(e.charAt(0))};if(null==r.types[n.type])return f("unknown packet type "+n.type);if(r.BINARY_EVENT===n.type||r.BINARY_ACK===n.type){for(var o="";"-"!==e.charAt(++t)&&(o+=e.charAt(t),t!=e.length););if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1))for(n.nsp="";++t&&","!==(a=e.charAt(t))&&(n.nsp+=a,t!==e.length););else n.nsp="/";var a,i=e.charAt(t+1);if(""!==i&&Number(i)==i){for(n.id="";++t;){if(null==(a=e.charAt(t))||Number(a)!=a){--t;break}if(n.id+=e.charAt(t),t===e.length)break}n.id=Number(n.id)}if(e.charAt(++t)){i=function(e){try{return JSON.parse(e)}catch(e){return!1}}(e.substr(t));if(!1===i||n.type!==r.ERROR&&!Array.isArray(i))return f("invalid payload");n.data=i}return s("decoded %s as %j",e,n),n}(e),r.BINARY_EVENT===t.type||r.BINARY_ACK===t.type?(this.reconstructor=new u(t),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",t)):this.emit("decoded",t);else{if(!a(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,this.emit("decoded",t))}},d.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},u.prototype.takeBinaryData=function(e){return this.buffers.push(e),this.buffers.length===this.reconPack.attachments?(e=o.reconstructPacket(this.reconPack,this.buffers),this.finishedReconstruction(),e):null},u.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(e,t,n){var o=n(380);e.exports=function(e){var t=e.xdomain,n=e.xscheme,e=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||o))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!n&&e)return new XDomainRequest}catch(e){}if(!t)try{return new self[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}},function(e,t,n){var o=n(51);function a(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.isReactNative=e.isReactNative,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}n(50)((e.exports=a).prototype),a.prototype.onError=function(e,t){e=new Error(e);return e.type="TransportError",e.description=t,this.emit("error",e),this},a.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},a.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},a.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},a.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},a.prototype.onData=function(e){e=o.decodePacket(e,this.socket.binaryType);this.onPacket(e)},a.prototype.onPacket=function(e){this.emit("packet",e)},a.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(n,o,e){!function(e){var t;void 0!==(t="function"==typeof(t=function(){"use strict";function c(e,t,n){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){a(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&t.status<=299}function s(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(e){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}var l="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof e&&e.global===e?e:void 0,a=l.saveAs||("object"!=typeof window||window!==l?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,n){var o=l.URL||l.webkitURL,a=document.createElement("a");t=t||e.name||"download",a.download=t,a.rel="noopener","string"==typeof e?(a.href=e,a.origin===location.origin?s(a):r(a.href)?c(e,t,n):s(a,a.target="_blank")):(a.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(a.href)},4e4),setTimeout(function(){s(a)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){var o,a,i;t=t||e.name||"download","string"!=typeof e?navigator.msSaveOrOpenBlob((a=e,void 0===(i=n)?i={autoBom:!1}:"object"!=typeof i&&(console.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\ufeff",a],{type:a.type}):a),t):r(e)?c(e,t,n):((o=document.createElement("a")).href=e,o.target="_blank",setTimeout(function(){s(o)}))}:function(e,t,n,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return c(e,t,n);var a,i,r,t="application/octet-stream"===e.type,n=/constructor/i.test(l.HTMLElement)||l.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);(s||t&&n)&&"object"==typeof FileReader?((a=new FileReader).onloadend=function(){var e=a.result,e=s?e:e.replace(/^data:[^;]*;/,"data:attachment/file;");o?o.location.href=e:location=e,o=null},a.readAsDataURL(e)):(i=l.URL||l.webkitURL,r=i.createObjectURL(e),o?o.location=r:location.href=r,o=null,setTimeout(function(){i.revokeObjectURL(r)},4e4))});l.saveAs=a.saveAs=a,n.exports=a})?t.apply(o,[]):t)&&(n.exports=t)}.call(this,e(31))},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(t,e){!function(e){t.exports=e}.call(this,{})},function(e,t){var s=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,c=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(e){var t=e,n=e.indexOf("["),o=e.indexOf("]");-1!=n&&-1!=o&&(e=e.substring(0,n)+e.substring(n,o).replace(/:/g,";")+e.substring(o,e.length));for(var a=s.exec(e||""),i={},r=14;r--;)i[c[r]]=a[r]||"";return-1!=n&&-1!=o&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i}},null,function(e,t,n){!function(t){e.exports=function(e){return n&&t.isBuffer(e)||o&&(e instanceof ArrayBuffer||a(e))};var n="function"==typeof t&&"function"==typeof t.isBuffer,o="function"==typeof ArrayBuffer,a=function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}.call(this,n(73).Buffer)},function(e,t,n){var c=n(378),i=n(154),o=n(50),a=n(105),l=n(155),r=n(156),d=n(74)("socket.io-client:manager"),s=n(153),u=n(394),f=Object.prototype.hasOwnProperty;function p(e,t){if(!(this instanceof p))return new p(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new u({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];e=t.parser||a;this.encoder=new e.Encoder,this.decoder=new e.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}(e.exports=p).prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)f.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},p.prototype.updateSocketIds=function(){for(var e in this.nsps)f.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},p.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},o(p.prototype),p.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},p.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},p.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},p.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},p.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},p.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},p.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},p.prototype.open=p.prototype.connect=function(n,e){if(d("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;d("opening %s",this.uri),this.engine=c(this.uri,this.opts);var t,o,a=this.engine,i=this,r=(this.readyState="opening",this.skipReconnect=!1,l(a,"open",function(){i.onopen(),n&&n()})),s=l(a,"error",function(e){var t;d("connect_error"),i.cleanup(),i.readyState="closed",i.emitAll("connect_error",e),n?((t=new Error("Connection error")).data=e,n(t)):i.maybeReconnectOnOpen()});return!1!==this._timeout&&(t=this._timeout,d("connect attempt will timeout after %d",t),o=setTimeout(function(){d("connect attempt timed out after %d",t),r.destroy(),a.close(),a.emit("error","timeout"),i.emitAll("connect_timeout",t)},t),this.subs.push({destroy:function(){clearTimeout(o)}})),this.subs.push(r),this.subs.push(s),this},p.prototype.onopen=function(){d("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(l(e,"data",r(this,"ondata"))),this.subs.push(l(e,"ping",r(this,"onping"))),this.subs.push(l(e,"pong",r(this,"onpong"))),this.subs.push(l(e,"error",r(this,"onerror"))),this.subs.push(l(e,"close",r(this,"onclose"))),this.subs.push(l(this.decoder,"decoded",r(this,"ondecoded")))},p.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},p.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},p.prototype.ondata=function(e){this.decoder.add(e)},p.prototype.ondecoded=function(e){this.emit("packet",e)},p.prototype.onerror=function(e){d("error",e),this.emitAll("error",e)},p.prototype.socket=function(e,t){var n,o=this.nsps[e];function a(){~s(n.connecting,o)||n.connecting.push(o)}return o||(o=new i(this,e,t),this.nsps[e]=o,n=this,o.on("connecting",a),o.on("connect",function(){o.id=n.generateId(e)}),this.autoConnect&&a()),o},p.prototype.destroy=function(e){e=s(this.connecting,e);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},p.prototype.packet=function(n){d("writing packet %j",n);var o=this;n.query&&0===n.type&&(n.nsp+="?"+n.query),o.encoding?o.packetBuffer.push(n):(o.encoding=!0,this.encoder.encode(n,function(e){for(var t=0;t<e.length;t++)o.engine.write(e[t],n.options);o.encoding=!1,o.processPacketQueue()}))},p.prototype.processPacketQueue=function(){var e;0<this.packetBuffer.length&&!this.encoding&&(e=this.packetBuffer.shift(),this.packet(e))},p.prototype.cleanup=function(){d("cleanup");for(var e=this.subs.length,t=0;t<e;t++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},p.prototype.close=p.prototype.disconnect=function(){d("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},p.prototype.onclose=function(e){d("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},p.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e,t,n=this;this.backoff.attempts>=this._reconnectionAttempts?(d("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1):(e=this.backoff.duration(),d("will wait %dms before reconnect attempt",e),this.reconnecting=!0,t=setTimeout(function(){n.skipReconnect||(d("attempting reconnect"),n.emitAll("reconnect_attempt",n.backoff.attempts),n.emitAll("reconnecting",n.backoff.attempts),n.skipReconnect||n.open(function(e){e?(d("reconnect attempt error"),n.reconnecting=!1,n.reconnect(),n.emitAll("reconnect_error",e.data)):(d("reconnect success"),n.onreconnect())}))},e),this.subs.push({destroy:function(){clearTimeout(t)}}))},p.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},function(e,t,n){var r=n(106),s=n(381),c=n(390),n=n(391);t.polling=function(e){var t,n,o=!1,a=!1,i=!1!==e.jsonp;if("undefined"!=typeof location&&(t="https:"===location.protocol,n=(n=location.port)||(t?443:80),o=e.hostname!==location.hostname||n!==e.port,a=e.secure!==t),e.xdomain=o,e.xscheme=a,"open"in new r(e)&&!e.forceJSONP)return new s(e);if(i)return new c(e);throw new Error("JSONP disabled")},t.websocket=n},function(e,t,n){var o=n(107),a=n(75),i=n(51),r=n(76),s=n(152),c=n(77)("engine.io-client:polling"),l=(e.exports=d,null!=new(n(106))({xdomain:!1}).responseType);function d(e){var t=e&&e.forceBase64;l&&!t||(this.supportsBinary=!1),o.call(this,e)}r(d,o),d.prototype.name="polling",d.prototype.doOpen=function(){this.poll()},d.prototype.pause=function(e){var t,n=this;function o(){c("paused"),n.readyState="paused",e()}this.readyState="pausing",this.polling||!this.writable?(t=0,this.polling&&(c("we are currently polling - waiting to pause"),t++,this.once("pollComplete",function(){c("pre-pause polling complete"),--t||o()})),this.writable||(c("we are currently writing - waiting to pause"),t++,this.once("drain",function(){c("pre-pause writing complete"),--t||o()}))):o()},d.prototype.poll=function(){c("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},d.prototype.onData=function(e){var o=this;c("polling got data %s",e),i.decodePayload(e,this.socket.binaryType,function(e,t,n){if("opening"===o.readyState&&o.onOpen(),"close"===e.type)return o.onClose(),!1;o.onPacket(e)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():c('ignoring poll - transport state "%s"',this.readyState))},d.prototype.doClose=function(){var e=this;function t(){c("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(c("transport open - closing"),t()):(c("transport not open - deferring close"),this.once("open",t))},d.prototype.write=function(e){function t(){n.writable=!0,n.emit("drain")}var n=this;this.writable=!1;i.encodePayload(e,this.supportsBinary,function(e){n.doWrite(e,t)})},d.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=s()),this.supportsBinary||e.sid||(e.b64=1),e=a.encode(e),this.port&&("https"==t&&443!==Number(this.port)||"http"==t&&80!==Number(this.port))&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e}},function(t,e,n){!function(i){var e=Object.prototype.toString,r="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===e.call(Blob),s="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===e.call(File);t.exports=function e(t){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(var n=0,o=t.length;n<o;n++)if(e(t[n]))return!0;return!1}if("function"==typeof i&&i.isBuffer&&i.isBuffer(t)||"function"==typeof ArrayBuffer&&t instanceof ArrayBuffer||r&&t instanceof Blob||s&&t instanceof File)return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&e(t[a]))return!0;return!1}}.call(this,n(73).Buffer)},function(e,t,n){"use strict";var o,a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),i=64,r={},s=0,c=0;function l(e){for(var t="";t=a[e%i]+t,0<(e=Math.floor(e/i)););return t}function d(){var e=l(+new Date);return e!==o?(s=0,o=e):e+"."+l(s++)}for(;c<i;c++)r[a[c]]=c;d.encode=l,d.decode=function(e){var t=0;for(c=0;c<e.length;c++)t=t*i+r[e.charAt(c)];return t},e.exports=d},function(e,t){var o=[].indexOf;e.exports=function(e,t){if(o)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}},function(e,t,n){var a=n(105),o=n(50),i=n(393),r=n(155),s=n(156),c=n(74)("socket.io-client:socket"),l=n(75),d=n(151),u=(e.exports=p,{connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1}),f=o.prototype.emit;function p(e,t,n){this.io=e,this.nsp=t,(this.json=this).ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}o(p.prototype),p.prototype.subEvents=function(){var e;this.subs||(e=this.io,this.subs=[r(e,"open",s(this,"onopen")),r(e,"packet",s(this,"onpacket")),r(e,"close",s(this,"onclose"))])},p.prototype.open=p.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},p.prototype.send=function(){var e=i(arguments);return e.unshift("message"),this.emit.apply(this,e),this},p.prototype.emit=function(e){if(u.hasOwnProperty(e))return f.apply(this,arguments),this;var t=i(arguments),n={type:(void 0!==this.flags.binary?this.flags.binary:d(t))?a.BINARY_EVENT:a.EVENT,data:t,options:{}};return n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),this.flags={},this},p.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},p.prototype.onopen=function(){var e;c("transport is open - connecting"),"/"!==this.nsp&&(this.query?(e="object"==typeof this.query?l.encode(this.query):this.query,c("sending connect packet with query %s",e),this.packet({type:a.CONNECT,query:e})):this.packet({type:a.CONNECT}))},p.prototype.onclose=function(e){c("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},p.prototype.onpacket=function(e){var t=e.nsp===this.nsp,n=e.type===a.ERROR&&"/"===e.nsp;if(t||n)switch(e.type){case a.CONNECT:this.onconnect();break;case a.EVENT:case a.BINARY_EVENT:this.onevent(e);break;case a.ACK:case a.BINARY_ACK:this.onack(e);break;case a.DISCONNECT:this.ondisconnect();break;case a.ERROR:this.emit("error",e.data)}},p.prototype.onevent=function(e){var t=e.data||[];c("emitting event %j",t),null!=e.id&&(c("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?f.apply(this,t):this.receiveBuffer.push(t)},p.prototype.ack=function(t){var n=this,o=!1;return function(){var e;o||(o=!0,e=i(arguments),c("sending ack %j",e),n.packet({type:d(e)?a.BINARY_ACK:a.ACK,id:t,data:e}))}},p.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(c("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):c("bad ack %s",e.id)},p.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},p.prototype.emitBuffered=function(){for(var e=0;e<this.receiveBuffer.length;e++)f.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},p.prototype.ondisconnect=function(){c("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},p.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},p.prototype.close=p.prototype.disconnect=function(){return this.connected&&(c("performing disconnect (%s)",this.nsp),this.packet({type:a.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},p.prototype.compress=function(e){return this.flags.compress=e,this},p.prototype.binary=function(e){return this.flags.binary=e,this}},function(e,t){e.exports=function(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}}},function(e,t){var o=[].slice;e.exports=function(e,t){if("function"!=typeof(t="string"==typeof t?e[t]:t))throw new Error("bind() requires a function");var n=o.call(arguments,2);return function(){return t.apply(e,n.concat(o.call(arguments)))}}},function(e,t,n){var o;!function(){"use strict";var i={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"==o||"number"==o)e.push(this&&this[n]||n);else if(Array.isArray(n))e.push(r.apply(this,n));else if("object"==o)for(var a in n)i.call(n,a)&&n[a]&&e.push(this&&this[a]||a)}}return e.join(" ")}e.exports?e.exports=r.default=r:void 0!==(o=function(){return r}.apply(t,[]))&&(e.exports=o)}()},function(e,t,n){var o=n(366);"string"==typeof o&&(o=[[e.i,o,""]]);n(368)(o,{hmr:!0,transform:void 0,insertInto:void 0}),o.locals&&(e.exports=o.locals)},function(e,t,n){var o;function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(){function e(){}function c(e,t){return this.identifier=t.identifier,this.position=t.position,this.frontPosition=t.frontPosition,this.collection=e,this.defaults={size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:.5,mode:"dynamic",zone:document.body,lockX:!1,lockY:!1},this.config(t),"dynamic"===this.options.mode&&(this.options.restOpacity=0),this.id=c.id,c.id+=1,this.buildEl().stylize(),this.instance={el:this.ui.el,on:this.on.bind(this),off:this.off.bind(this),show:this.show.bind(this),hide:this.hide.bind(this),add:this.addToDom.bind(this),remove:this.removeFromDom.bind(this),destroy:this.destroy.bind(this),resetDirection:this.resetDirection.bind(this),computeDirection:this.computeDirection.bind(this),trigger:this.trigger.bind(this),position:this.position,frontPosition:this.frontPosition,ui:this.ui,identifier:this.identifier,id:this.id,options:this.options},this.instance}function o(e,t){var n=this;return n.nipples=[],n.idles=[],n.actives=[],n.ids=[],n.pressureIntervals={},n.manager=e,n.id=o.id,o.id+=1,n.defaults={zone:document.body,multitouch:!1,maxNumberOfNipples:10,mode:"dynamic",position:{top:0,left:0},catchDistance:200,size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:.5,lockX:!1,lockY:!1},n.config(t),"static"!==n.options.mode&&"semi"!==n.options.mode||(n.options.multitouch=!1),n.options.multitouch||(n.options.maxNumberOfNipples=1),n.updateBox(),n.prepareNipples(),n.bindings(),n.begin(),n.nipples}function t(e){var t,o=this;return o.ids={},o.index=0,o.collections=[],o.config(e),o.prepareCollections(),u.bindEvt(window,"resize",function(e){clearTimeout(t),t=setTimeout(function(){var t,n=u.getScroll();o.collections.forEach(function(e){e.forEach(function(e){t=e.el.getBoundingClientRect(),e.position={x:n.x+t.left,y:n.y+t.top}})})},100)}),o.collections}var a,n=!!("ontouchstart"in window),i=!!window.PointerEvent,r=!!window.MSPointerEvent,s={start:"mousedown",move:"mousemove",end:"mouseup"},l={},u=(i?a={start:"pointerdown",move:"pointermove",end:"pointerup, pointercancel"}:r?a={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:n?(a={start:"touchstart",move:"touchmove",end:"touchend, touchcancel"},l=s):a=s,{distance:function(e,t){var n=t.x-e.x,t=t.y-e.y;return Math.sqrt(n*n+t*t)},angle:function(e,t){var n=t.x-e.x,t=t.y-e.y;return u.degrees(Math.atan2(t,n))},findCoord:function(e,t,n){var o={x:0,y:0};return n=u.radians(n),o.x=e.x-t*Math.cos(n),o.y=e.y-t*Math.sin(n),o},radians:function(e){return e*(Math.PI/180)},degrees:function(e){return e*(180/Math.PI)},bindEvt:function(e,t,n){for(var o,a=t.split(/[ ,]+/g),i=0;i<a.length;i+=1)o=a[i],e.addEventListener?e.addEventListener(o,n,!1):e.attachEvent&&e.attachEvent(o,n)},unbindEvt:function(e,t,n){for(var o,a=t.split(/[ ,]+/g),i=0;i<a.length;i+=1)o=a[i],e.removeEventListener?e.removeEventListener(o,n):e.detachEvent&&e.detachEvent(o,n)},trigger:function(e,t,n){t=new CustomEvent(t,n);e.dispatchEvent(t)},prepareEvent:function(e){return e.preventDefault(),e.type.match(/^touch/)?e.changedTouches:e},getScroll:function(){return{x:void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,y:void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop}},applyPosition:function(e,t){t.top||t.right||t.bottom||t.left?(e.style.top=t.top,e.style.right=t.right,e.style.bottom=t.bottom,e.style.left=t.left):(e.style.left=t.x+"px",e.style.top=t.y+"px")},getTransitionStyle:function(e,t,n){var o,a=u.configStylePropertyObject(e);for(o in a)if(a.hasOwnProperty(o))if("string"==typeof t)a[o]=t+" "+n;else{for(var i="",r=0,s=t.length;r<s;r+=1)i+=t[r]+" "+n+", ";a[o]=i.slice(0,-2)}return a},getVendorStyle:function(e,t){var n,o=u.configStylePropertyObject(e);for(n in o)o.hasOwnProperty(n)&&(o[n]=t);return o},configStylePropertyObject:function(t){var n={};return n[t]="",["webkit","Moz","o"].forEach(function(e){n[e+t.charAt(0).toUpperCase()+t.slice(1)]=""}),n},extend:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},safeExtend:function(e,t){var n,o={};for(n in e)e.hasOwnProperty(n)&&t.hasOwnProperty(n)?o[n]=t[n]:e.hasOwnProperty(n)&&(o[n]=e[n]);return o},map:function(e,t){if(e.length)for(var n=0,o=e.length;n<o;n+=1)t(e[n]);else t(e)}}),d=(e.prototype.on=function(e,t){var n,o=this,a=e.split(/[ ,]+/g);o._handlers_=o._handlers_||{};for(var i=0;i<a.length;i+=1)n=a[i],o._handlers_[n]=o._handlers_[n]||[],o._handlers_[n].push(t);return o},e.prototype.off=function(e,t){var n=this;return n._handlers_=n._handlers_||{},void 0===e?n._handlers_={}:void 0===t?n._handlers_[e]=null:n._handlers_[e]&&0<=n._handlers_[e].indexOf(t)&&n._handlers_[e].splice(n._handlers_[e].indexOf(t),1),n},e.prototype.trigger=function(e,t){var n,o=this,a=e.split(/[ ,]+/g);o._handlers_=o._handlers_||{};for(var i=0;i<a.length;i+=1)n=a[i],o._handlers_[n]&&o._handlers_[n].length&&o._handlers_[n].forEach(function(e){e.call(o,{type:n,target:o},t)})},e.prototype.config=function(e){this.options=this.defaults||{},e&&(this.options=u.safeExtend(this.options,e))},e.prototype.bindEvt=function(e,t){var n=this;return n._domHandlers_=n._domHandlers_||{},n._domHandlers_[t]=function(){"function"==typeof n["on"+t]?n["on"+t].apply(n,arguments):console.warn('[WARNING] : Missing "on'+t+'" handler.')},u.bindEvt(e,a[t],n._domHandlers_[t]),l[t]&&u.bindEvt(e,l[t],n._domHandlers_[t]),n},e.prototype.unbindEvt=function(e,t){var n=this;return n._domHandlers_=n._domHandlers_||{},u.unbindEvt(e,a[t],n._domHandlers_[t]),l[t]&&u.unbindEvt(e,l[t],n._domHandlers_[t]),delete n._domHandlers_[t],this},c.prototype=new e,(c.constructor=c).id=0,c.prototype.buildEl=function(e){return this.ui={},this.options.dataOnly||(this.ui.el=document.createElement("div"),this.ui.back=document.createElement("div"),this.ui.front=document.createElement("div"),this.ui.el.className="nipple collection_"+this.collection.id,this.ui.back.className="back",this.ui.front.className="front",this.ui.el.setAttribute("id","nipple_"+this.collection.id+"_"+this.id),this.ui.el.appendChild(this.ui.back),this.ui.el.appendChild(this.ui.front)),this},c.prototype.stylize=function(){if(this.options.dataOnly)return this;var e=this.options.fadeTime+"ms",t=u.getVendorStyle("borderRadius","50%"),e=u.getTransitionStyle("transition","opacity",e),n={};return n.el={position:"absolute",opacity:this.options.restOpacity,display:"block",zIndex:999},n.back={position:"absolute",display:"block",width:this.options.size+"px",height:this.options.size+"px",marginLeft:-this.options.size/2+"px",marginTop:-this.options.size/2+"px",background:this.options.color,opacity:".5"},n.front={width:this.options.size/2+"px",height:this.options.size/2+"px",position:"absolute",display:"block",marginLeft:-this.options.size/4+"px",marginTop:-this.options.size/4+"px",background:this.options.color,opacity:".5"},u.extend(n.el,e),u.extend(n.back,t),u.extend(n.front,t),this.applyStyles(n),this},c.prototype.applyStyles=function(e){for(var t in this.ui)if(this.ui.hasOwnProperty(t))for(var n in e[t])this.ui[t].style[n]=e[t][n];return this},c.prototype.addToDom=function(){return this.options.dataOnly||document.body.contains(this.ui.el)||this.options.zone.appendChild(this.ui.el),this},c.prototype.removeFromDom=function(){return this.options.dataOnly||!document.body.contains(this.ui.el)||this.options.zone.removeChild(this.ui.el),this},c.prototype.destroy=function(){clearTimeout(this.removeTimeout),clearTimeout(this.showTimeout),clearTimeout(this.restTimeout),this.trigger("destroyed",this.instance),this.removeFromDom(),this.off()},c.prototype.show=function(e){var t=this;return t.options.dataOnly||(clearTimeout(t.removeTimeout),clearTimeout(t.showTimeout),clearTimeout(t.restTimeout),t.addToDom(),t.restCallback(),setTimeout(function(){t.ui.el.style.opacity=1},0),t.showTimeout=setTimeout(function(){t.trigger("shown",t.instance),"function"==typeof e&&e.call(this)},t.options.fadeTime)),t},c.prototype.hide=function(t){var n=this;return n.options.dataOnly||(n.ui.el.style.opacity=n.options.restOpacity,clearTimeout(n.removeTimeout),clearTimeout(n.showTimeout),clearTimeout(n.restTimeout),n.removeTimeout=setTimeout(function(){var e="dynamic"===n.options.mode?"none":"block";n.ui.el.style.display=e,"function"==typeof t&&t.call(n),n.trigger("hidden",n.instance)},n.options.fadeTime),n.options.restJoystick&&n.restPosition()),n},c.prototype.restPosition=function(e){var t=this,n=(t.frontPosition={x:0,y:0},t.options.fadeTime+"ms"),o={},n=(o.front=u.getTransitionStyle("transition",["top","left"],n),{front:{}});n.front={left:t.frontPosition.x+"px",top:t.frontPosition.y+"px"},t.applyStyles(o),t.applyStyles(n),t.restTimeout=setTimeout(function(){"function"==typeof e&&e.call(t),t.restCallback()},t.options.fadeTime)},c.prototype.restCallback=function(){var e={};e.front=u.getTransitionStyle("transition","none",""),this.applyStyles(e),this.trigger("rested",this.instance)},c.prototype.resetDirection=function(){this.direction={x:!1,y:!1,angle:!1}},c.prototype.computeDirection=function(e){var t,n,o,a=e.angle.radian,i=Math.PI/4,r=Math.PI/2;if(i<a&&a<3*i&&!e.lockX?t="up":-i<a&&a<=i&&!e.lockY?t="left":3*-i<a&&a<=-i&&!e.lockX?t="down":e.lockY||(t="right"),e.lockY||(n=-r<a&&a<r?"left":"right"),e.lockX||(o=0<a?"up":"down"),e.force>this.options.threshold){var s={};for(c in this.direction)this.direction.hasOwnProperty(c)&&(s[c]=this.direction[c]);var c,l={};for(c in this.direction={x:n,y:o,angle:t},e.direction=this.direction,s)s[c]===this.direction[c]&&(l[c]=!0);if(l.x&&l.y&&l.angle)return e;l.x&&l.y||this.trigger("plain",e),l.x||this.trigger("plain:"+n,e),l.y||this.trigger("plain:"+o,e),l.angle||this.trigger("dir dir:"+t,e)}return e},o.prototype=new e,(o.constructor=o).id=0,o.prototype.prepareNipples=function(){var e=this,o=e.nipples;o.on=e.on.bind(e),o.off=e.off.bind(e),o.options=e.options,o.destroy=e.destroy.bind(e),o.ids=e.ids,o.id=e.id,o.processOnMove=e.processOnMove.bind(e),o.processOnEnd=e.processOnEnd.bind(e),o.get=function(e){if(void 0===e)return o[0];for(var t=0,n=o.length;t<n;t+=1)if(o[t].identifier===e)return o[t];return!1}},o.prototype.bindings=function(){this.bindEvt(this.options.zone,"start"),this.options.zone.style.touchAction="none",this.options.zone.style.msTouchAction="none"},o.prototype.begin=function(){var e=this.options;"static"===e.mode&&((e=this.createNipple(e.position,this.manager.getIdentifier())).add(),this.idles.push(e))},o.prototype.createNipple=function(e,t){var n,o=this,a=u.getScroll(),i={},r=o.options,s=(e.x&&e.y?i={x:e.x-(a.x+o.box.left),y:e.y-(a.y+o.box.top)}:(e.top||e.right||e.bottom||e.left)&&((s=document.createElement("DIV")).style.display="hidden",s.style.top=e.top,s.style.right=e.right,s.style.bottom=e.bottom,s.style.left=e.left,s.style.position="absolute",r.zone.appendChild(s),n=s.getBoundingClientRect(),r.zone.removeChild(s),i=e,e={x:n.left+a.x,y:n.top+a.y}),new c(o,{color:r.color,size:r.size,threshold:r.threshold,fadeTime:r.fadeTime,dataOnly:r.dataOnly,restJoystick:r.restJoystick,restOpacity:r.restOpacity,mode:r.mode,identifier:t,position:e,zone:r.zone,frontPosition:{x:0,y:0}}));return r.dataOnly||(u.applyPosition(s.ui.el,i),u.applyPosition(s.ui.front,s.frontPosition)),o.nipples.push(s),o.trigger("added "+s.identifier+":added",s),o.manager.trigger("added "+s.identifier+":added",s),o.bindNipple(s),s},o.prototype.updateBox=function(){this.box=this.options.zone.getBoundingClientRect()},o.prototype.bindNipple=function(e){function t(e,t){n=e.type+" "+t.id+":"+e.type,o.trigger(n,t)}var n,o=this;e.on("destroyed",o.onDestroyed.bind(o)),e.on("shown hidden rested dir plain",t),e.on("dir:up dir:right dir:down dir:left",t),e.on("plain:up plain:right plain:down plain:left",t)},o.prototype.pressureFn=function(t,n,e){var o=this,a=0;clearInterval(o.pressureIntervals[e]),o.pressureIntervals[e]=setInterval(function(){var e=t.force||t.pressure||t.webkitForce||0;e!==a&&(n.trigger("pressure",e),o.trigger("pressure "+n.identifier+":pressure",e),a=e)}.bind(o),100)},o.prototype.onstart=function(e){var t=this,n=t.options;return e=u.prepareEvent(e),t.updateBox(),u.map(e,function(e){t.actives.length<n.maxNumberOfNipples&&t.processOnStart(e)}),t.manager.bindDocument(),!1},o.prototype.processOnStart=function(t){function e(e){e.trigger("start",e),n.trigger("start "+e.id+":start",e),e.show(),0<i&&n.pressureFn(t,e,e.identifier),n.processOnMove(t)}var n=this,o=n.options,a=n.manager.getIdentifier(t),i=t.force||t.pressure||t.webkitForce||0,r={x:t.pageX,y:t.pageY},s=n.getOrCreate(a,r);s.identifier!==a&&n.manager.removeIdentifier(s.identifier),s.identifier=a;if(0<=(a=n.idles.indexOf(s))&&n.idles.splice(a,1),n.actives.push(s),n.ids.push(s.identifier),"semi"!==o.mode)e(s);else{if(!(u.distance(r,s.position)<=o.catchDistance))return s.destroy(),void n.processOnStart(t);e(s)}return s},o.prototype.getOrCreate=function(e,t){var n,o=this,a=o.options;return/(semi|static)/.test(a.mode)?(n=o.idles[0])?(o.idles.splice(0,1),n):"semi"===a.mode?o.createNipple(t,e):(console.warn("Coudln't find the needed nipple."),!1):o.createNipple(t,e)},o.prototype.processOnMove=function(e){var t=this,n=t.options,o=t.manager.getIdentifier(e),a=t.nipples.get(o);if(!a)return console.error("Found zombie joystick with ID "+o),void t.manager.removeIdentifier(o);a.identifier=o;var o=a.options.size/2,i={x:e.pageX,y:e.pageY},r=u.distance(i,a.position),s=u.angle(i,a.position),c=u.radians(s),l=r/o,o=(i=o<r?u.findCoord(a.position,r=o,s):i).x-a.position.x,d=i.y-a.position.y,o=(n.lockX&&(d=0),n.lockY&&(o=0),a.frontPosition={x:o,y:d},n.dataOnly||u.applyPosition(a.ui.front,a.frontPosition),{identifier:a.identifier,position:i,force:l,pressure:e.force||e.pressure||e.webkitForce||0,distance:r,angle:{radian:c,degree:s},instance:a,lockX:n.lockX,lockY:n.lockY});(o=a.computeDirection(o)).angle={radian:u.radians(180-s),degree:180-s},a.trigger("move",o),t.trigger("move "+a.id+":move",o)},o.prototype.processOnEnd=function(e){var t=this,n=t.options,e=t.manager.getIdentifier(e),o=t.nipples.get(e),e=t.manager.removeIdentifier(o.identifier);o&&(n.dataOnly||o.hide(function(){"dynamic"===n.mode&&(o.trigger("removed",o),t.trigger("removed "+o.id+":removed",o),t.manager.trigger("removed "+o.id+":removed",o),o.destroy())}),clearInterval(t.pressureIntervals[o.identifier]),o.resetDirection(),o.trigger("end",o),t.trigger("end "+o.id+":end",o),0<=t.ids.indexOf(o.identifier)&&t.ids.splice(t.ids.indexOf(o.identifier),1),0<=t.actives.indexOf(o)&&t.actives.splice(t.actives.indexOf(o),1),/(semi|static)/.test(n.mode)?t.idles.push(o):0<=t.nipples.indexOf(o)&&t.nipples.splice(t.nipples.indexOf(o),1),t.manager.unbindDocument(),/(semi|static)/.test(n.mode)&&(t.manager.ids[e.id]=e.identifier))},o.prototype.onDestroyed=function(e,t){var n=this;0<=n.nipples.indexOf(t)&&n.nipples.splice(n.nipples.indexOf(t),1),0<=n.actives.indexOf(t)&&n.actives.splice(n.actives.indexOf(t),1),0<=n.idles.indexOf(t)&&n.idles.splice(n.idles.indexOf(t),1),0<=n.ids.indexOf(t.identifier)&&n.ids.splice(n.ids.indexOf(t.identifier),1),n.manager.removeIdentifier(t.identifier),n.manager.unbindDocument()},o.prototype.destroy=function(){var e,t=this;for(e in t.unbindEvt(t.options.zone,"start"),t.nipples.forEach(function(e){e.destroy()}),t.pressureIntervals)t.pressureIntervals.hasOwnProperty(e)&&clearInterval(t.pressureIntervals[e]);t.trigger("destroyed",t.nipples),t.manager.unbindDocument(),t.off()},t.prototype=new e,(t.constructor=t).prototype.prepareCollections=function(){var e=this;e.collections.create=e.create.bind(e),e.collections.on=e.on.bind(e),e.collections.off=e.off.bind(e),e.collections.destroy=e.destroy.bind(e),e.collections.get=function(t){var n;return e.collections.every(function(e){return!(n=e.get(t))}),n}},t.prototype.create=function(e){return this.createCollection(e)},t.prototype.createCollection=function(e){e=new o(this,e);return this.bindCollection(e),this.collections.push(e),e},t.prototype.bindCollection=function(e){function t(e,t){n=e.type+" "+t.id+":"+e.type,o.trigger(n,t)}var n,o=this;e.on("destroyed",o.onDestroyed.bind(o)),e.on("shown hidden rested dir plain",t),e.on("dir:up dir:right dir:down dir:left",t),e.on("plain:up plain:right plain:down plain:left",t)},t.prototype.bindDocument=function(){this.binded||(this.bindEvt(document,"move").bindEvt(document,"end"),this.binded=!0)},t.prototype.unbindDocument=function(e){Object.keys(this.ids).length&&!0!==e||(this.unbindEvt(document,"move").unbindEvt(document,"end"),this.binded=!1)},t.prototype.getIdentifier=function(e){var t;return e?void 0===(t=void 0===e.identifier?e.pointerId:e.identifier)&&(t=this.latest||0):t=this.index,void 0===this.ids[t]&&(this.ids[t]=this.index,this.index+=1),this.latest=t,this.ids[t]},t.prototype.removeIdentifier=function(e){var t,n={};for(t in this.ids)if(this.ids[t]===e){n.id=t,n.identifier=this.ids[t],delete this.ids[t];break}return n},t.prototype.onmove=function(e){return this.onAny("move",e),!1},t.prototype.onend=function(e){return this.onAny("end",e),!1},t.prototype.oncancel=function(e){return this.onAny("end",e),!1},t.prototype.onAny=function(e,t){var n,o=this,a="processOn"+e.charAt(0).toUpperCase()+e.slice(1);t=u.prepareEvent(t);return u.map(t,function(e){n=o.getIdentifier(e),u.map(o.collections,function(e,t,n){0<=n.ids.indexOf(t)&&(n[a](e),e._found_=!0)}.bind(null,e,n)),e._found_||o.removeIdentifier(n)}),!1},t.prototype.destroy=function(){var e=this;e.unbindDocument(!0),e.ids={},e.index=0,e.collections.forEach(function(e){e.destroy()}),e.off()},t.prototype.onDestroyed=function(e,t){if(this.collections.indexOf(t)<0)return!1;this.collections.splice(this.collections.indexOf(t),1)},new t);return{create:function(e){return d.create(e)},factory:d}},"object"==a(t)&&void 0!==e?e.exports=o():void 0!==(t="function"==typeof(o=o)?o.apply(t,[]):o)&&(e.exports=t)},function(e,t,S){!function(y,v,w){var x;function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(){"use strict";function o(t){return function(e){return new g(!0).update(e)[t]()}}function a(t){var n=require("crypto"),o=require("buffer").Buffer;return function(e){if("string"==typeof e)return n.createHash("md5").update(e,"utf8").digest("hex");if(null==e)throw l;return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===o?n.createHash("md5").update(new o(e)).digest("hex"):t(e)}}var e,t,l="input is invalid type",n="object"===("undefined"==typeof window?"undefined":_(window)),i=n?window:{},n=!(n=i.JS_MD5_NO_WINDOW?!1:n)&&"object"===("undefined"==typeof self?"undefined":_(self)),r=!i.JS_MD5_NO_NODE_JS&&"object"===(void 0===y?"undefined":_(y))&&y.versions&&y.versions.node,n=(r?i=v:n&&(i=self),!i.JS_MD5_NO_COMMON_JS&&"object"===_(w)&&w.exports),s=S(144),d=!i.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),u=[128,32768,8388608,-2147483648],f=[0,8,16,24],p=["hex","array","digest","buffer","arrayBuffer","base64"],h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),m=[];d&&(e=new ArrayBuffer(68),t=new Uint8Array(e),m=new Uint32Array(e)),!i.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!d||!i.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===_(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});function g(e){e?(m[0]=m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0,this.blocks=m,this.buffer8=t):d?(e=new ArrayBuffer(68),this.buffer8=new Uint8Array(e),this.blocks=new Uint32Array(e)):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}g.prototype.update=function(e){if(!this.finalized){var t,n=_(e);if("string"!==n){if("object"!==n)throw l;if(null===e)throw l;if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||d&&ArrayBuffer.isView(e)))throw l;t=!0}for(var o,a,i=0,r=e.length,s=this.blocks,c=this.buffer8;i<r;){if(this.hashed&&(this.hashed=!1,s[0]=s[16],s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),t)if(d)for(a=this.start;i<r&&a<64;++i)c[a++]=e[i];else for(a=this.start;i<r&&a<64;++i)s[a>>2]|=e[i]<<f[3&a++];else if(d)for(a=this.start;i<r&&a<64;++i)(o=e.charCodeAt(i))<128?c[a++]=o:(o<2048?c[a++]=192|o>>6:(o<55296||57344<=o?c[a++]=224|o>>12:(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),c[a++]=240|o>>18,c[a++]=128|o>>12&63),c[a++]=128|o>>6&63),c[a++]=128|63&o);else for(a=this.start;i<r&&a<64;++i)(o=e.charCodeAt(i))<128?s[a>>2]|=o<<f[3&a++]:(o<2048?s[a>>2]|=(192|o>>6)<<f[3&a++]:(o<55296||57344<=o?s[a>>2]|=(224|o>>12)<<f[3&a++]:(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),s[a>>2]|=(240|o>>18)<<f[3&a++],s[a>>2]|=(128|o>>12&63)<<f[3&a++]),s[a>>2]|=(128|o>>6&63)<<f[3&a++]),s[a>>2]|=(128|63&o)<<f[3&a++]);this.lastByteIndex=a,this.bytes+=a-this.start,64<=a?(this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return 4294967295<this.bytes&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},g.prototype.finalize=function(){var e,t;this.finalized||(this.finalized=!0,(e=this.blocks)[(t=this.lastByteIndex)>>2]|=u[3&t],56<=t&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash())},g.prototype.hash=function(){var e,t,n,o,a,i=this.blocks,r=this.first?((r=((e=((e=i[0]-680876937)<<7|e>>>25)-271733879<<0)^(t=((t=(-271733879^(n=((n=(-1732584194^2004318071&e)+i[1]-117830708)<<12|n>>>20)+e<<0)&(-271733879^e))+i[2]-1126478375)<<17|t>>>15)+n<<0)&(n^e))+i[3]-1316259209)<<22|r>>>10)+t<<0:(e=this.h0,r=this.h1,t=this.h2,((r+=((e=((e+=((n=this.h3)^r&(t^n))+i[0]-680876936)<<7|e>>>25)+r<<0)^(t=((t+=(r^(n=((n+=(t^e&(r^t))+i[1]-389564586)<<12|n>>>20)+e<<0)&(e^r))+i[2]+606105819)<<17|t>>>15)+n<<0)&(n^e))+i[3]-1044525330)<<22|r>>>10)+t<<0);r=((r+=((e=((e+=(n^r&(t^n))+i[4]-176418897)<<7|e>>>25)+r<<0)^(t=((t+=(r^(n=((n+=(t^e&(r^t))+i[5]+1200080426)<<12|n>>>20)+e<<0)&(e^r))+i[6]-1473231341)<<17|t>>>15)+n<<0)&(n^e))+i[7]-45705983)<<22|r>>>10)+t<<0,r=((r+=((e=((e+=(n^r&(t^n))+i[8]+1770035416)<<7|e>>>25)+r<<0)^(t=((t+=(r^(n=((n+=(t^e&(r^t))+i[9]-1958414417)<<12|n>>>20)+e<<0)&(e^r))+i[10]-42063)<<17|t>>>15)+n<<0)&(n^e))+i[11]-1990404162)<<22|r>>>10)+t<<0,r=((r+=((e=((e+=(n^r&(t^n))+i[12]+1804603682)<<7|e>>>25)+r<<0)^(t=((t+=(r^(n=((n+=(t^e&(r^t))+i[13]-40341101)<<12|n>>>20)+e<<0)&(e^r))+i[14]-1502002290)<<17|t>>>15)+n<<0)&(n^e))+i[15]+1236535329)<<22|r>>>10)+t<<0,r=((r+=((n=((n+=(r^t&((e=((e+=(t^n&(r^t))+i[1]-165796510)<<5|e>>>27)+r<<0)^r))+i[6]-1069501632)<<9|n>>>23)+e<<0)^e&((t=((t+=(e^r&(n^e))+i[11]+643717713)<<14|t>>>18)+n<<0)^n))+i[0]-373897302)<<20|r>>>12)+t<<0,r=((r+=((n=((n+=(r^t&((e=((e+=(t^n&(r^t))+i[5]-701558691)<<5|e>>>27)+r<<0)^r))+i[10]+38016083)<<9|n>>>23)+e<<0)^e&((t=((t+=(e^r&(n^e))+i[15]-660478335)<<14|t>>>18)+n<<0)^n))+i[4]-405537848)<<20|r>>>12)+t<<0,r=((r+=((n=((n+=(r^t&((e=((e+=(t^n&(r^t))+i[9]+568446438)<<5|e>>>27)+r<<0)^r))+i[14]-1019803690)<<9|n>>>23)+e<<0)^e&((t=((t+=(e^r&(n^e))+i[3]-187363961)<<14|t>>>18)+n<<0)^n))+i[8]+1163531501)<<20|r>>>12)+t<<0,r=((r+=((n=((n+=(r^t&((e=((e+=(t^n&(r^t))+i[13]-1444681467)<<5|e>>>27)+r<<0)^r))+i[2]-51403784)<<9|n>>>23)+e<<0)^e&((t=((t+=(e^r&(n^e))+i[7]+1735328473)<<14|t>>>18)+n<<0)^n))+i[12]-1926607734)<<20|r>>>12)+t<<0,r=((r+=((a=(n=((n+=((o=r^t)^(e=((e+=(o^n)+i[5]-378558)<<4|e>>>28)+r<<0))+i[8]-2022574463)<<11|n>>>21)+e<<0)^e)^(t=((t+=(a^r)+i[11]+1839030562)<<16|t>>>16)+n<<0))+i[14]-35309556)<<23|r>>>9)+t<<0,r=((r+=((a=(n=((n+=((o=r^t)^(e=((e+=(o^n)+i[1]-1530992060)<<4|e>>>28)+r<<0))+i[4]+1272893353)<<11|n>>>21)+e<<0)^e)^(t=((t+=(a^r)+i[7]-155497632)<<16|t>>>16)+n<<0))+i[10]-1094730640)<<23|r>>>9)+t<<0,r=((r+=((a=(n=((n+=((o=r^t)^(e=((e+=(o^n)+i[13]+681279174)<<4|e>>>28)+r<<0))+i[0]-358537222)<<11|n>>>21)+e<<0)^e)^(t=((t+=(a^r)+i[3]-722521979)<<16|t>>>16)+n<<0))+i[6]+76029189)<<23|r>>>9)+t<<0,r=((r+=((a=(n=((n+=((o=r^t)^(e=((e+=(o^n)+i[9]-640364487)<<4|e>>>28)+r<<0))+i[12]-421815835)<<11|n>>>21)+e<<0)^e)^(t=((t+=(a^r)+i[15]+530742520)<<16|t>>>16)+n<<0))+i[2]-995338651)<<23|r>>>9)+t<<0,r=((r+=((n=((n+=(r^((e=((e+=(t^(r|~n))+i[0]-198630844)<<6|e>>>26)+r<<0)|~t))+i[7]+1126891415)<<10|n>>>22)+e<<0)^((t=((t+=(e^(n|~r))+i[14]-1416354905)<<15|t>>>17)+n<<0)|~e))+i[5]-57434055)<<21|r>>>11)+t<<0,r=((r+=((n=((n+=(r^((e=((e+=(t^(r|~n))+i[12]+1700485571)<<6|e>>>26)+r<<0)|~t))+i[3]-1894986606)<<10|n>>>22)+e<<0)^((t=((t+=(e^(n|~r))+i[10]-1051523)<<15|t>>>17)+n<<0)|~e))+i[1]-2054922799)<<21|r>>>11)+t<<0,r=((r+=((n=((n+=(r^((e=((e+=(t^(r|~n))+i[8]+1873313359)<<6|e>>>26)+r<<0)|~t))+i[15]-30611744)<<10|n>>>22)+e<<0)^((t=((t+=(e^(n|~r))+i[6]-1560198380)<<15|t>>>17)+n<<0)|~e))+i[13]+1309151649)<<21|r>>>11)+t<<0,r=((r+=((n=((n+=(r^((e=((e+=(t^(r|~n))+i[4]-145523070)<<6|e>>>26)+r<<0)|~t))+i[11]-1120210379)<<10|n>>>22)+e<<0)^((t=((t+=(e^(n|~r))+i[2]+718787259)<<15|t>>>17)+n<<0)|~e))+i[9]-343485551)<<21|r>>>11)+t<<0,this.first?(this.h0=e+1732584193<<0,this.h1=r-271733879<<0,this.h2=t-1732584194<<0,this.h3=n+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+r<<0,this.h2=this.h2+t<<0,this.h3=this.h3+n<<0)},g.prototype.toString=g.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,o=this.h3;return c[e>>4&15]+c[15&e]+c[e>>12&15]+c[e>>8&15]+c[e>>20&15]+c[e>>16&15]+c[e>>28&15]+c[e>>24&15]+c[t>>4&15]+c[15&t]+c[t>>12&15]+c[t>>8&15]+c[t>>20&15]+c[t>>16&15]+c[t>>28&15]+c[t>>24&15]+c[n>>4&15]+c[15&n]+c[n>>12&15]+c[n>>8&15]+c[n>>20&15]+c[n>>16&15]+c[n>>28&15]+c[n>>24&15]+c[o>>4&15]+c[15&o]+c[o>>12&15]+c[o>>8&15]+c[o>>20&15]+c[o>>16&15]+c[o>>28&15]+c[o>>24&15]},g.prototype.array=g.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,o=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255]},g.prototype.buffer=g.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},g.prototype.base64=function(){for(var e,t,n,o="",a=this.array(),i=0;i<15;)e=a[i++],t=a[i++],n=a[i++],o+=h[e>>>2]+h[63&(e<<4|t>>>4)]+h[63&(t<<2|n>>>6)]+h[63&n];return e=a[i],o+(h[e>>>2]+h[e<<4&63]+"==")};var b=function(){var t=o("hex");(t=r?a(t):t).create=function(){return new g},t.update=function(e){return t.create().update(e)};for(var e=0;e<p.length;++e){var n=p[e];t[n]=o(n)}return t}();n?w.exports=b:(i.md5=b,!s||void 0!==(x=function(){return b}.call(b,S,b,w))&&(w.exports=x))}()}.call(this,S(49),S(31),S(143)(e))},function(e,r,Ge){"use strict";!function(g,Ie,Le){var e=Ge(52),De=Ge.n(e);function ze(e){return(ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Be(){var r=this,a=new t,n=(r.chunks={},r.users={},r.readAsArrayBuffer=function(t,n,e){var o={file:t,earlyCallback:function(e){n(s(e,{currentPosition:-1}))},extra:e||{userid:0}};t.extra&&Object.keys(t.extra).length&&Object.keys(t.extra).forEach(function(e){o.extra[e]=t.extra[e]}),a.readAsArrayBuffer(r,o)},r.getNextChunk=function(e,t,n){void 0!==e.currentPosition&&(a=e.currentPosition,e=e.uuid);var o=r.chunks[e];if(o){var a,i=o[a=void 0!==n?(r.users[n+""]||(r.users[n+""]={fileUUID:e,userid:n,currentPosition:-1}),void 0!==a&&(r.users[n+""].currentPosition=a),r.users[n+""].currentPosition++,r.users[n+""].currentPosition):(void 0!==a&&(r.chunks[e].currentPosition=a),r.chunks[e].currentPosition++,r.chunks[e].currentPosition)];if(!i)return delete r.chunks[e],void r.convertToArrayBuffer({chunkMissing:!0,currentPosition:a,uuid:e},t);i=s(i),void 0!==n&&(i.remoteUserId=n+""),i.start&&r.onBegin(i),i.end&&r.onEnd(i),r.onProgress(i),r.convertToArrayBuffer(i,function(e){i.currentPosition!=i.maxChunks?t(e,!1):t(e,!0)})}},new o(r));function s(e,t){if(null==e||"object"!=ze(e))return e;if(e.constructor!=Object&&e.constructor!=Array)return e;if(e.constructor==Date||e.constructor==RegExp||e.constructor==Function||e.constructor==String||e.constructor==Number||e.constructor==Boolean)return new e.constructor(e);for(var n in t=t||new e.constructor,e)t[n]=void 0===t[n]?s(e[n],null):t[n];return t}r.addChunk=function(e,t){e&&n.receive(e,function(e){r.convertToArrayBuffer({readyForNextChunk:!0,currentPosition:e.currentPosition,uuid:e.uuid},t)})},r.chunkMissing=function(e){delete n.chunks[e.uuid],delete n.chunksWaiters[e.uuid]},r.onBegin=function(){},r.onEnd=function(){},r.onProgress=function(){},r.convertToObject=i.ConvertToObject,r.convertToArrayBuffer=i.ConvertToArrayBuffer,r.setMultipleUsers=function(){}}function t(){this.readAsArrayBuffer=function(t,n){var e,a,i,r,s,c,l,d,u,f,p,h,o=n.earlyCallback;delete n.earlyCallback,a=(a=function(e){t.chunks[e.uuid]||(t.chunks[e.uuid]={currentPosition:-1}),n.extra=n.extra||{userid:0},e.userid=n.userid||n.extra.userid||0,e.extra=n.extra,(t.chunks[e.uuid][e.currentPosition]=e).end&&o&&(o(e.uuid),o=null),200<e.maxChunks&&200==e.currentPosition&&o&&(o(e.uuid),o=null)})||function(e){postMessage(e)},(i=(e=n).file).uuid||(i.uuid=(100*Math.random()).toString().replace(/\./g,"")),r=e.chunkSize||15e3,e.extra&&e.extra.chunkSize&&(r=e.extra.chunkSize),c=0,e=r,l=Math.floor(Math.min(1e8,e)/r)*r,d=Math.ceil(i.size/r),i.maxChunks=d,f=[],a({currentPosition:u=0,uuid:i.uuid,maxChunks:d,size:i.size,name:i.name,type:i.type,lastModifiedDate:(i.lastModifiedDate||new Date).toString(),start:!0}),(h=new FileReader).onloadend=function(e){if(e.target.readyState==FileReader.DONE){i.name;var t=e.target.result;s=Math.ceil(t.byteLength/r);for(var n=0;n<s;n++){var o=n*r;f[u]=t.slice(o,Math.min(o+r,t.byteLength)),a({uuid:i.uuid,buffer:f[u],currentPosition:u,maxChunks:d,size:i.size,name:i.name,lastModifiedDate:(i.lastModifiedDate||new Date).toString(),type:i.type}),u++}(++c+1)*l<i.size?(p=i.slice(c*l,(c+1)*l),h.readAsArrayBuffer(p)):c*l<i.size?(p=i.slice(c*l,i.size),h.readAsArrayBuffer(p)):(i.url=URL.createObjectURL(i),a({currentPosition:u,uuid:i.uuid,maxChunks:d,size:i.size,name:i.name,lastModifiedDate:(i.lastModifiedDate||new Date).toString(),url:URL.createObjectURL(i),type:i.type,end:!0}))}},u+=1,p=i.slice(c*l,(c+1)*l),h.readAsArrayBuffer(p)}}function Ue(){var i=this,r=function(){};function n(e,n,t){e=e||function(){};var o,a=document.createElement("input"),t=(a.type="file",n&&(a.multiple=!0),t&&(a.webkitdirectory=!0),a.accept=i.accept,a.onclick=function(){a.clickStarted=!0},document.body.onfocus=function(){setTimeout(function(){a.clickStarted&&(a.clickStarted=!1,a.value||r())},500)},a.onchange=function(){if(n){if(!a.files.length)return void console.error("No file selected.");var t=[];return Array.from(a.files).forEach(function(e){e.url=e.webkitRelativePath,t.push(e)}),void e(t)}a.files[0]?(e(a.files[0]),a.parentNode.removeChild(a)):console.error("No file selected.")},a.style.display="none",(document.body||document.documentElement).appendChild(a),a);"function"==typeof t.click?t.click():"function"==typeof t.change?t.change():(void 0!==document.createEvent("Event")&&"function"==typeof(o=document.createEvent("Event")).initEvent&&"function"==typeof t.dispatchEvent?o.initEvent("click",!0,!0):o=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0}),t.dispatchEvent(o))}i.selectSingleFile=function(e,t){t&&(r=t),n(e)},i.selectMultipleFiles=function(e,t){t&&(r=t),n(e,!0)},i.selectDirectory=function(e,t){t&&(r=t),n(e,!0,!0)},i.accept="*.*"}function o(r){var s=this;s.chunks={},s.chunksWaiters={},s.receive=function t(n,o){var a,i,e;n.uuid?(n.start&&!s.chunks[n.uuid]&&(s.chunks[n.uuid]={},r.onBegin&&r.onBegin(n)),!n.end&&n.buffer&&(s.chunks[n.uuid][n.currentPosition]=n.buffer),n.end&&(a=s.chunks[n.uuid],i=[],Object.keys(a).forEach(function(e,t){i.push(a[e])}),(e=Fe(e=new Blob(i,{type:n.type}),n)).url=URL.createObjectURL(e),e.uuid=n.uuid,e.size||console.error("Something went wrong. Blob Size is 0."),r.onEnd&&r.onEnd(e),delete s.chunks[n.uuid],delete s.chunksWaiters[n.uuid]),n.buffer&&r.onProgress&&r.onProgress(n),n.end||(o(n),s.chunksWaiters[n.uuid]=function(){setTimeout(function e(){n.buffer&&s.chunks[n.uuid]&&(n.currentPosition==n.maxChunks||s.chunks[n.uuid][n.currentPosition]||(o(n),setTimeout(e,5e3)))},5e3)},s.chunksWaiters[n.uuid]())):r.convertToObject(n,function(e){t(e)})}}var i={ConvertToArrayBuffer:function(e,t){a.pack(e,function(e){t(e.buffer)})},ConvertToObject:function(e,t){a.unpack(e,t)}};function Fe(e,t){if(e=e||{},!t)return e;for(var n in t)try{e[n]=t[n]}catch(e){}return e}function b(e,t){var n,o,a=0,i=e.getUint8(t,!1),r=(t+=y,i!==x.ARRAY&&i!==x.OBJECT||(c=e.getUint16(t,!1),t+=v),n=e.getUint32(t,!1),t+=w,_[i]),s=null===r?0:window[r+"Array"].BYTES_PER_ELEMENT;switch(i){case x.NULL:case x.UNDEFINED:p=null;break;case x.STRING:for(var c=n/s,l=[],a=0;a<c;a++){var d=e.getUint16(t,!1);t+=s,l.push(String.fromCharCode(d))}p=l.join("");break;case x.NUMBER:p=e.getFloat64(t,!1),t+=s;break;case x.BOOLEAN:p=1===e.getUint8(t,!1),t+=s;break;case x.INT8ARRAY:case x.INT16ARRAY:case x.INT32ARRAY:case x.UINT8ARRAY:case x.UINT16ARRAY:case x.UINT32ARRAY:case x.FLOAT32ARRAY:case x.FLOAT64ARRAY:case x.ARRAYBUFFER:o=e.buffer.slice(t,t+n),t+=n,p=i===x.ARRAYBUFFER?o:new window[r+"Array"](o);break;case x.BLOB:var u,f,p=window.Blob?(t=(f=b(e,(u=b(e,t)).cursor)).cursor,new Blob([f.value],{type:u.value})):(o=e.buffer.slice(t,t+n),t+=n,new g(o));break;case x.ARRAY:for(p=[],a=0;a<c;a++)t=(o=b(e,t)).cursor,p.push(o.value);break;case x.OBJECT:for(p={},a=0;a<c;a++){var h=b(e,t),m=b(e,h.cursor);t=m.cursor,p[h.value]=m.value}break;default:throw"TypeError: Type not supported."}return{value:p,cursor:t}}function f(e,a){for(var i=e.length,r=[],s=0,c=0,t=0;t<e.length;t++)!function(o){n(e[o],function(e){if(r[o]=e,c+=e[0].header_size+e[0].byte_length,++s===i){for(var t=[],n=0;n<r.length;n++)t=t.concat(r[n]);a(t,c)}})}(t)}var y=Uint8Array.BYTES_PER_ELEMENT,v=Uint16Array.BYTES_PER_ELEMENT,w=Uint32Array.BYTES_PER_ELEMENT,x={NULL:0,UNDEFINED:1,STRING:2,NUMBER:3,BOOLEAN:4,ARRAY:5,OBJECT:6,INT8ARRAY:7,INT16ARRAY:8,INT32ARRAY:9,UINT8ARRAY:10,UINT16ARRAY:11,UINT32ARRAY:12,FLOAT32ARRAY:13,FLOAT64ARRAY:14,ARRAYBUFFER:15,BLOB:16,FILE:16,BUFFER:17},_=[null,null,"Uint16","Float64","Uint8",null,null,"Int8","Int16","Int32","Uint8","Uint16","Uint32","Float32","Float64","Uint8","Uint8","Uint8"],n=function(n,o){var a=y+w,e=0,i=0,t=n,r=function(e){var t=void 0;if(void 0===e)t=x.UNDEFINED;else if(null===e)t=x.NULL;else{var n=e.constructor.name,o=e.constructor.toString().match(/\w+/g)[1];if(void 0!==n&&void 0!==x[n.toUpperCase()])t=x[n.toUpperCase()];else if(void 0!==o&&void 0!==x[o.toUpperCase()])t=x[o.toUpperCase()];else switch(ze(e)){case"string":t=x.STRING;break;case"number":t=x.NUMBER;break;case"boolean":t=x.BOOLEAN;break;case"object":e instanceof Array?t=x.ARRAY:e instanceof Int8Array?t=x.INT8ARRAY:e instanceof Int16Array?t=x.INT16ARRAY:e instanceof Int32Array?t=x.INT32ARRAY:e instanceof Uint8Array?t=x.UINT8ARRAY:e instanceof Uint16Array?t=x.UINT16ARRAY:e instanceof Uint32Array?t=x.UINT32ARRAY:e instanceof Float32Array?t=x.FLOAT32ARRAY:e instanceof Float64Array?t=x.FLOAT64ARRAY:e instanceof ArrayBuffer?t=x.ARRAYBUFFER:e instanceof Blob?t=x.BLOB:e instanceof g?t=x.BUFFER:e instanceof Object&&(t=x.OBJECT)}}return t}(n),s=null==_[r]?0:window[_[r]+"Array"].BYTES_PER_ELEMENT;switch(r){case x.UNDEFINED:case x.NULL:break;case x.NUMBER:case x.BOOLEAN:e=s;break;case x.STRING:e+=(i=n.length)*s;break;case x.INT8ARRAY:case x.INT16ARRAY:case x.INT32ARRAY:case x.UINT8ARRAY:case x.UINT16ARRAY:case x.UINT32ARRAY:case x.FLOAT32ARRAY:case x.FLOAT64ARRAY:e+=(i=n.length)*s;break;case x.ARRAY:return void f(n,function(e,t){o([{type:r,length:n.length,header_size:a+v,byte_length:t,value:null}].concat(e))});case x.OBJECT:var c,l=[];for(c in n)n.hasOwnProperty(c)&&(l.push(c),l.push(n[c]),i++);return void f(l,function(e,t){o([{type:r,length:i,header_size:a+v,byte_length:t,value:null}].concat(e))});case x.ARRAYBUFFER:e+=n.byteLength;break;case x.BLOB:var d=n.type,u=new FileReader;return u.onload=function(e){f([d,e.target.result],function(e,t){o([{type:r,length:i,header_size:a,byte_length:t,value:null}].concat(e))})},u.onerror=function(e){throw"FileReader Error: "+e},void u.readAsArrayBuffer(n);case x.BUFFER:e+=n.length;break;default:throw'TypeError: Type "'+n.constructor.name+'" not supported.'}o([{type:r,length:i,header_size:a,byte_length:e,value:t}].concat([]))},a={pack:function(e,t){try{n(e,function(e){t(function(e){for(var t=0,n=0,o=0,a=new ArrayBuffer(e[0].byte_length+e[0].header_size),i=new DataView(a),n=0;n<e.length;n++){e[n].header_size;var r=e[n].type,s=e[n].length,c=e[n].value,l=e[n].byte_length,d=_[r],u=null===d?0:window[d+"Array"].BYTES_PER_ELEMENT;switch(r===x.BUFFER?i.setUint8(t,x.BLOB,!1):i.setUint8(t,r,!1),t+=y,r!==x.ARRAY&&r!==x.OBJECT||(i.setUint16(t,s,!1),t+=v),i.setUint32(t,l,!1),t+=w,r){case x.NULL:case x.UNDEFINED:break;case x.STRING:for(o=0;o<s;o++,t+=u)i.setUint16(t,c.charCodeAt(o),!1);break;case x.NUMBER:case x.BOOLEAN:i["set"+d](t,c,!1),t+=u;break;case x.INT8ARRAY:case x.INT16ARRAY:case x.INT32ARRAY:case x.UINT8ARRAY:case x.UINT16ARRAY:case x.UINT32ARRAY:case x.FLOAT32ARRAY:case x.FLOAT64ARRAY:new Uint8Array(i.buffer,t,l).set(new Uint8Array(c.buffer)),t+=l;break;case x.ARRAYBUFFER:case x.BUFFER:new Uint8Array(i.buffer,t,l).set(new Uint8Array(c)),t+=l;break;case x.BLOB:case x.ARRAY:case x.OBJECT:break;default:throw"TypeError: Unexpected type found."}}return i}(e))})}catch(e){throw e}},unpack:function(e,t){try{t(function(e){e=e instanceof DataView?e:new DataView(e);return b(e,0).value}(e))}catch(e){throw e}}};r.a=function(L,D){function n(i,e){function r(e){return!e.audio&&!e.video&&!e.screen&&e.data}var t="",t=(t=(t=(t=(t+="?userid="+i.userid)+("&sessionid="+i.sessionid))+("&msgEvent="+i.socketMessageEvent))+("&socketCustomEvent="+i.socketCustomEvent))+("&autoCloseEntireSession="+!!i.autoCloseEntireSession);!0===i.session.broadcast&&(t+="&oneToMany=true"),t+="&maxParticipantsAllowed="+i.maxParticipantsAllowed,i.enableScalableBroadcast&&(t=t+"&enableScalableBroadcast=true"+("&maxRelayLimitPerUser="+(i.maxRelayLimitPerUser||2))),t+="&extra="+JSON.stringify(i.extra||{}),i.socketCustomParameters&&(t+=i.socketCustomParameters);try{De.a.sockets={}}catch(e){}if(i.socketURL||(i.socketURL="/"),"/"!=i.socketURL.substr(i.socketURL.length-1,1))throw'"socketURL" MUST end with a slash.';i.enableLogs&&("/"==i.socketURL?console.info("socket.io url is: ",location.origin+"/"):console.info("socket.io url is: ",i.socketURL));try{i.socket=De()(i.socketURL+t)}catch(e){i.socket=De.a.connect(i.socketURL+t,i.socketOptions)}var s=i.multiPeersHandler;function c(e,t){i.peersBackup[e]||(i.peersBackup[e]={userid:e,extra:{}}),i.peersBackup[e].extra=t}i.socket.on("extra-data-updated",function(e,t){i.peers[e]&&(i.peers[e].extra=t,i.onExtraDataUpdated({userid:e,extra:t}),c(e,t))}),i.socket.on(i.socketMessageEvent,function e(t){if(t.remoteUserId==i.userid)if(i.peers[t.sender]&&i.peers[t.sender].extra!=t.message.extra&&(i.peers[t.sender].extra=t.extra,i.onExtraDataUpdated({userid:t.sender,extra:t.extra}),c(t.sender,t.extra)),t.message.streamSyncNeeded&&i.peers[t.sender]){var n=i.streamEvents[t.message.streamid];if(n&&n.stream){var o=t.message.action;if("ended"===o||"inactive"===o||"stream-removed"===o)return i.peersBackup[n.userid]&&(n.extra=i.peersBackup[n.userid].extra),void i.onstreamended(n);var a="both"!=t.message.type?t.message.type:null;"function"==typeof n.stream[o]&&n.stream[o](a)}}else if("dropPeerConnection"!==t.message){if(t.message.allParticipants)return-1===t.message.allParticipants.indexOf(t.sender)&&t.message.allParticipants.push(t.sender),void t.message.allParticipants.forEach(function(e){s[i.peers[e]?"renegotiatePeer":"createNewPeer"](e,{localPeerSdpConstraints:{OfferToReceiveAudio:i.sdpConstraints.mandatory.OfferToReceiveAudio,OfferToReceiveVideo:i.sdpConstraints.mandatory.OfferToReceiveVideo},remotePeerSdpConstraints:{OfferToReceiveAudio:i.session.oneway?!!i.session.audio:i.sdpConstraints.mandatory.OfferToReceiveAudio,OfferToReceiveVideo:i.session.oneway?!!i.session.video||!!i.session.screen:i.sdpConstraints.mandatory.OfferToReceiveVideo},isOneWay:!!i.session.oneway||"one-way"===i.direction,isDataOnly:r(i.session)})});if(t.message.newParticipant)t.message.newParticipant==i.userid||i.peers[t.message.newParticipant]||s.createNewPeer(t.message.newParticipant,t.message.userPreferences||{localPeerSdpConstraints:{OfferToReceiveAudio:i.sdpConstraints.mandatory.OfferToReceiveAudio,OfferToReceiveVideo:i.sdpConstraints.mandatory.OfferToReceiveVideo},remotePeerSdpConstraints:{OfferToReceiveAudio:i.session.oneway?!!i.session.audio:i.sdpConstraints.mandatory.OfferToReceiveAudio,OfferToReceiveVideo:i.session.oneway?!!i.session.video||!!i.session.screen:i.sdpConstraints.mandatory.OfferToReceiveVideo},isOneWay:!!i.session.oneway||"one-way"===i.direction,isDataOnly:r(i.session)});else if(t.message.readyForOffer&&(i.attachStreams.length&&(i.waitingForLocalMedia=!1),i.waitingForLocalMedia))setTimeout(function(){e(t)},1);else if(t.message.newParticipationRequest&&t.sender!==i.userid){i.peers[t.sender]&&i.deletePeer(t.sender);n={extra:t.extra||{},localPeerSdpConstraints:t.message.remotePeerSdpConstraints||{OfferToReceiveAudio:i.sdpConstraints.mandatory.OfferToReceiveAudio,OfferToReceiveVideo:i.sdpConstraints.mandatory.OfferToReceiveVideo},remotePeerSdpConstraints:t.message.localPeerSdpConstraints||{OfferToReceiveAudio:i.session.oneway?!!i.session.audio:i.sdpConstraints.mandatory.OfferToReceiveAudio,OfferToReceiveVideo:i.session.oneway?!!i.session.video||!!i.session.screen:i.sdpConstraints.mandatory.OfferToReceiveVideo},isOneWay:void 0!==t.message.isOneWay?t.message.isOneWay:!!i.session.oneway||"one-way"===i.direction,isDataOnly:void 0!==t.message.isDataOnly?t.message.isDataOnly:r(i.session),dontGetRemoteStream:void 0!==t.message.isOneWay?t.message.isOneWay:!!i.session.oneway||"one-way"===i.direction,dontAttachLocalStream:!!t.message.dontGetRemoteStream,connectionDescription:t,successCallback:function(){}};i.onNewParticipant(t.sender,n)}else{if(t.message.changedUUID&&i.peers[t.message.oldUUID]&&(i.peers[t.message.newUUID]=i.peers[t.message.oldUUID],delete i.peers[t.message.oldUUID]),t.message.userLeft)return s.onUserLeft(t.sender),void(t.message.autoCloseEntireSession&&i.leave());s.addNegotiatedMessage(t.message,t.sender)}}else i.deletePeer(t.sender)});var n=!1;i.socket.resetProps=function(){n=!1},i.socket.on("connect",function(){n||(n=!0,i.enableLogs&&console.info("socket.io connection is opened."),setTimeout(function(){i.socket.emit("extra-data-updated",i.extra)},1e3),e&&e(i.socket))}),i.socket.on("disconnect",function(){i.enableLogs&&console.warn("socket.io connection is closed"),i.close()}),i.socket.on("user-disconnected",function(e){e!==i.userid&&(i.onUserStatusChanged({userid:e,status:"offline",extra:i.peers[e]&&i.peers[e].extra||{}}),i.deletePeer(e))}),i.socket.on("user-connected",function(e){e!==i.userid&&i.onUserStatusChanged({userid:e,status:"online",extra:i.peers[e]&&i.peers[e].extra||{}})}),i.socket.on("closed-entire-session",function(e,t){i.leave(),i.onEntireSessionClosed({sessionid:e,userid:e,extra:t})}),i.socket.on("userid-already-taken",function(e,t){i.onUserIdAlreadyTaken(e,t)}),i.socket.on("logs",function(e){i.enableLogs&&console.debug("server-logs",e)}),i.socket.on("number-of-broadcast-viewers-updated",function(e){i.onNumberOfBroadcastViewersUpdated(e)}),i.socket.on("set-isInitiator-true",function(e){e==i.sessionid&&(i.isInitiator=!0)})}function z(a){var i=this,o=["getAllParticipants","getLength","selectFirst","streams","send","forEach"];function r(){a.fbr=new Be,a.fbr.onProgress=function(e){a.onFileProgress(e)},a.fbr.onBegin=function(e){a.onFileStart(e)},a.fbr.onEnd=function(e){a.onFileEnd(e)}}a.peers={getLength:function(){var e,t=0;for(e in this)-1==o.indexOf(e)&&t++;return t},selectFirst:function(){var e,t;for(t in this)-1==o.indexOf(t)&&(e=this[t]);return e},getAllParticipants:function(e){var t,n=[];for(t in this)-1==o.indexOf(t)&&t!=e&&n.push(t);return n},forEach:function(t){this.getAllParticipants().forEach(function(e){t(a.peers[e])})},send:function(t,e){var n=this;if(!q(t.size)&&!q(t.type)){if(a.enableFileSharing)return void i.shareFile(t,e);"string"!=typeof t&&(t=JSON.stringify(t))}if("text"===t.type||t instanceof ArrayBuffer||t instanceof DataView){if("text"===t.type&&(t=JSON.stringify(t)),e){var o=a.peers[e];if(o)return o.channels.length?void o.channels.forEach(function(e){e.send(t)}):(a.peers[e].createDataChannel(),a.renegotiate(e),void setTimeout(function(){n.send(t,e)},3e3))}this.getAllParticipants().forEach(function(e){if(!n[e].channels.length)return a.peers[e].createDataChannel(),a.renegotiate(e),void setTimeout(function(){n[e].channels.forEach(function(e){e.send(t)})},3e3);n[e].channels.forEach(function(e){e.send(t)})})}else ke.send({text:t,channel:this,connection:a,remoteUserId:e})}},this.uuid=a.userid,this.getLocalConfig=function(e,n,t){return{streamsToShare:(t=t||{}).streamsToShare||{},rtcMultiConnection:a,connectionDescription:t.connectionDescription,userid:n,localPeerSdpConstraints:t.localPeerSdpConstraints,remotePeerSdpConstraints:t.remotePeerSdpConstraints,dontGetRemoteStream:!!t.dontGetRemoteStream,dontAttachLocalStream:!!t.dontAttachLocalStream,renegotiatingPeer:!!t.renegotiatingPeer,peerRef:t.peerRef,channels:t.channels||[],onLocalSdp:function(e){i.onNegotiationNeeded(e,n)},onLocalCandidate:function(e){(e=ve.processCandidates(a,e))&&i.onNegotiationNeeded(e,n)},remoteSdp:e,onDataChannelMessage:function(e){var t;!a.fbr&&a.enableFileSharing&&r(),"string"!=typeof e&&a.enableFileSharing?(t=this,e instanceof ArrayBuffer||e instanceof DataView?a.fbr.convertToObject(e,function(e){t.onDataChannelMessage(e)}):e.readyForNextChunk?a.fbr.getNextChunk(e,function(t,e){a.peers[n].channels.forEach(function(e){e.send(t)})},n):e.chunkMissing?a.fbr.chunkMissing(e):a.fbr.addChunk(e,function(e){a.peers[n].peer.channel.send(e)})):i.onDataChannelMessage(e,n)},onDataChannelError:function(e){i.onDataChannelError(e,n)},onDataChannelOpened:function(e){i.onDataChannelOpened(e,n)},onDataChannelClosed:function(e){i.onDataChannelClosed(e,n)},onRemoteStream:function(e){a.peers[n]&&a.peers[n].streams.push(e),i.onGettingRemoteMedia(e,n)},onRemoteStreamRemoved:function(e){i.onRemovingRemoteMedia(e,n)},onPeerStateChanged:function(e){i.onPeerStateChanged(e),"new"===e.iceConnectionState&&i.onNegotiationStarted(n,e),"connected"===e.iceConnectionState&&i.onNegotiationCompleted(n,e),-1!==e.iceConnectionState.search(/closed|failed/gi)&&(i.onUserLeft(n),i.disconnectWith(n))}}},this.createNewPeer=function(e,t){if(!(a.maxParticipantsAllowed<=a.getAllParticipants().length)){if(t=t||{},a.isInitiator&&a.session.audio&&"two-way"===a.session.audio&&!t.streamsToShare&&(t.isOneWay=!1,t.isDataOnly=!1,t.session=a.session),!t.isOneWay&&!t.isDataOnly)return t.isOneWay=!0,void this.onNegotiationNeeded({enableMedia:!0,userPreferences:t},e);t=a.setUserPreferences(t,e);t=this.getLocalConfig(null,e,t);a.peers[e]=new he(t)}},this.createAnsweringPeer=function(e,t,n){n=a.setUserPreferences(n||{},t);e=this.getLocalConfig(e,t,n);a.peers[t]=new he(e)},this.renegotiatePeer=function(e,t,n){a.peers[e]?((t=t||{}).renegotiatingPeer=!0,t.peerRef=a.peers[e].peer,t.channels=a.peers[e].channels,n=this.getLocalConfig(n,e,t),a.peers[e]=new he(n)):a.enableLogs&&console.error("Peer ("+e+") does not exist. Renegotiation skipped.")},this.replaceTrack=function(t,n,o){if(!a.peers[n])throw"This peer ("+n+") does not exist.";var e=a.peers[n].peer;e.getSenders&&"function"==typeof e.getSenders&&e.getSenders().length?e.getSenders().forEach(function(e){o&&"video"===e.track.kind&&(a.peers[n].peer.lastVideoTrack=e.track,e.replaceTrack(t)),o||"audio"!==e.track.kind||(a.peers[n].peer.lastAudioTrack=e.track,e.replaceTrack(t))}):(console.warn("RTPSender.replaceTrack is NOT supported."),this.renegotiatePeer(n))},this.onNegotiationNeeded=function(e,t){},this.addNegotiatedMessage=function(e,t){return e.type&&e.sdp?("answer"==e.type&&a.peers[t]&&a.peers[t].addRemoteSdp(e),"offer"==e.type&&(e.renegotiatingPeer?this.renegotiatePeer(t,null,e):this.createAnsweringPeer(e,t)),void(a.enableLogs&&console.log("Remote peer's sdp:",e.sdp))):e.candidate?(a.peers[t]&&a.peers[t].addRemoteCandidate(e),void(a.enableLogs&&console.log("Remote peer's candidate pairs:",e.candidate))):(e.enableMedia&&(a.session=e.userPreferences.session||a.session,a.session.oneway&&a.attachStreams.length&&(a.attachStreams=[]),e.userPreferences.isDataOnly&&a.attachStreams.length&&(a.attachStreams.length=[]),n={},a.attachStreams.forEach(function(e){n[e.streamid]={isAudio:!!e.isAudio,isVideo:!!e.isVideo,isScreen:!!e.isScreen}}),e.userPreferences.streamsToShare=n,i.onNegotiationNeeded({readyForOffer:!0,userPreferences:e.userPreferences},t)),void(e.readyForOffer&&a.onReadyForOffer(t,e.userPreferences)));var n},this.onGettingRemoteMedia=function(e,t){},this.onRemovingRemoteMedia=function(e,t){},this.onGettingLocalMedia=function(e){},this.onLocalMediaError=function(e,t){a.onMediaError(e,t)},this.shareFile=function(e,n){r(),a.fbr.readAsArrayBuffer(e,function(t){var e=a.getAllParticipants();(e=n?[n]:e).forEach(function(e){a.fbr.getNextChunk(t,function(t){a.peers[e].channels.forEach(function(e){e.send(t)})},e)})},{userid:a.userid,chunkSize:"Firefox"===DetectRTC.browser.name?15e3:a.chunkSize||0})};var n=new Ce(a);this.onDataChannelMessage=function(e,t){n.receive(JSON.parse(e),t,a.peers[t]?a.peers[t].extra:{})},this.onDataChannelClosed=function(e,t){e.userid=t,e.extra=a.peers[t]?a.peers[t].extra:{},a.onclose(e)},this.onDataChannelError=function(e,t){e.userid=t,event.extra=a.peers[t]?a.peers[t].extra:{},a.onerror(e)},this.onDataChannelOpened=function(e,t){a.peers[t].channels.length?a.peers[t].channels=[e]:(a.peers[t].channels.push(e),a.onopen({userid:t,extra:a.peers[t]?a.peers[t].extra:{},channel:e}))},this.onPeerStateChanged=function(e){a.onPeerStateChanged(e)},this.onNegotiationStarted=function(e,t){},this.onNegotiationCompleted=function(e,t){},this.getRemoteStreams=function(e){return e=e||a.peers.getAllParticipants()[0],a.peers[e]?a.peers[e].streams:[]}}function B(e,t,n){"undefined"!=typeof CustomEvent&&(t=new CustomEvent(t,{arguments:n,__exposedProps__:n}),e.dispatchEvent(t))}function U(t,n){n.stream&&n.stream&&n.stream.addEventListener&&(n.stream.addEventListener("mute",function(e){(e=t.streamEvents[n.streamid]).session={audio:"audio"===e.muteType,video:"video"===e.muteType},t.onmute(e)},!1),n.stream.addEventListener("unmute",function(e){(e=t.streamEvents[n.streamid]).session={audio:"audio"===e.unmuteType,video:"video"===e.unmuteType},t.onunmute(e)},!1))}function f(){if(window.crypto&&window.crypto.getRandomValues&&-1===navigator.userAgent.indexOf("Safari")){for(var e=window.crypto.getRandomValues(new Uint32Array(3)),t="",n=0,o=e.length;n<o;n++)t+=e[n].toString(36);return t}return(Math.random()*(new Date).getTime()).toString(36).replace(/\./g,"")}function F(n,t,o){if(o.autoCreateMediaElement){var a,e=!1,i=(_(n,"video").length||n.isVideo||n.isScreen||(e=!0),"Firefox"===DetectRTC.browser.name&&(o.session.video||o.session.screen)&&(e=!1),document.createElement(e?"audio":"video"));i.srcObject=n;try{i.setAttributeNode(document.createAttribute("autoplay")),i.setAttributeNode(document.createAttribute("playsinline")),i.setAttributeNode(document.createAttribute("controls"))}catch(e){i.setAttribute("autoplay",!0),i.setAttribute("playsinline",!0),i.setAttribute("controls",!0)}"Firefox"===DetectRTC.browser.name&&(a="ended","oninactive"in i&&(a="inactive"),i.addEventListener(a,function(){var t,e;currentUserMediaRequest.remove(n.idInstance),"local"===n.type&&(a="ended","oninactive"in n&&(a="inactive"),k.onSyncNeeded(n.streamid,a),o.attachStreams.forEach(function(e,t){n.streamid===e.streamid&&delete o.attachStreams[t]}),t=[],o.attachStreams.forEach(function(e){e&&t.push(e)}),o.attachStreams=t,(e=o.streamEvents[n.streamid])?o.onstreamended(e):this.parentNode&&this.parentNode.removeChild(this))},!1));var r,e=i.play();void 0!==e?(r=!1,setTimeout(function(){r||(r=!0,t(i))},1e3),e.then(function(){r||(r=!0,t(i))}).catch(function(e){r||(r=!0,t(i))})):t(i)}else t({})}function G(e,t){window.removeEventListener(e,t),window.addEventListener(e,t,!1)}function V(e){var t=[];return e.forEach(function(e){e&&t.push(e)}),t}function c(e){return!e.audio&&!e.video&&!e.screen&&e.data}function q(e){return void 0===e}(t=void 0!==Ie?Ie:null)&&"undefined"==typeof window&&void 0!==Ie&&(Ie.navigator={userAgent:"Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45",getUserMedia:function(){}},Ie.console||(Ie.console={}),void 0===Ie.console.debug&&(Ie.console.debug=Ie.console.info=Ie.console.error=Ie.console.log=Ie.console.log||function(){console.log(arguments)}),"undefined"==typeof document&&(t.document={},document.createElement=document.captureStream=document.mozCaptureStream=function(){var e={getContext:function(){return e},play:function(){},pause:function(){},drawImage:function(){},toDataURL:function(){return""}};return e},document.addEventListener=document.removeEventListener=t.addEventListener=t.removeEventListener=function(){},t.HTMLVideoElement=t.HTMLMediaElement=function(){}),void 0===De.a&&(t.io=function(){return{on:function(e,t){t=t||function(){},"connect"===e&&t()},emit:function(e,t,n){n=n||function(){},"open-room"!==e&&"join-room"!==e||n(!0,t.sessionid,null)}}}),"undefined"==typeof location&&(t.location={protocol:"file:",href:"",hash:"",origin:"self"}),"undefined"==typeof screen&&(t.screen={width:0,height:0}),"undefined"==typeof URL&&(t.URL={createObjectURL:function(){return""},revokeObjectURL:function(){return""}}),t.window=Ie);var e,t="Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45",s=("object"===(void 0===Le?"undefined":ze(Le))&&"object"===ze(Le.versions)&&Le.versions.node&&!Le.browser&&(e=Le.versions.node.toString().replace("v",""),t="Nodejs/"+e+" (NodeOS) AppleWebKit/"+e+" (KHTML, like Gecko) Nodejs/"+e+" Nodejs/"+e),e=void 0!==Ie?Ie:window,"undefined"==typeof window&&("undefined"==typeof window&&void 0!==Ie&&(Ie.navigator={userAgent:t,getUserMedia:function(){}},e.window=Ie),"undefined"==typeof location&&(e.location={protocol:"file:",href:"",hash:""}),"undefined"==typeof screen&&(e.screen={width:0,height:0})),window.navigator),t=(void 0!==s?(void 0!==s.webkitGetUserMedia&&(s.getUserMedia=s.webkitGetUserMedia),void 0!==s.mozGetUserMedia&&(s.getUserMedia=s.mozGetUserMedia)):s={getUserMedia:function(){},userAgent:t},!!/Android|webOS|iPhone|iPad|iPod|BB10|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i.test(s.userAgent||"")),H=!(-1===s.userAgent.indexOf("Edge")||!s.msSaveOrOpenBlob&&!s.msSaveBlob),W=!!window.opera||0<=s.userAgent.indexOf(" OPR/"),Y=void 0!==window.InstallTrigger,X=/^((?!chrome|android).)*safari/i.test(s.userAgent),J=!!window.chrome&&!W,K="undefined"!=typeof document&&!!document.documentMode&&!H;function $(e,t){var n=0,o=!1,a=window.setInterval(function(){e()&&(window.clearInterval(a),t(o)),50<n++&&(window.clearInterval(a),t(o=!0))},10)}var o,Q,a={Android:function(){return s.userAgent.match(/Android/i)},BlackBerry:function(){return s.userAgent.match(/BlackBerry|BB10/i)},iOS:function(){return s.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return s.userAgent.match(/Opera Mini/i)},Windows:function(){return s.userAgent.match(/IEMobile/i)},any:function(){return a.Android()||a.BlackBerry()||a.iOS()||a.Opera()||a.Windows()},getOsName:function(){var e="Unknown OS";return a.Android()&&(e="Android"),a.BlackBerry()&&(e="BlackBerry"),a.iOS()&&(e="iOS"),a.Opera()&&(e="Opera Mini"),e=a.Windows()?"Windows":e}},i="Unknown OS",r="Unknown OS Version",l=((y=function(){for(var e,t=s.appVersion,n=s.userAgent,o="-",a=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}],i=0;e=a[i];i++)if(e.r.test(n)){o=e.s;break}var r="-";switch(/Windows/.test(o)&&(/Windows (.*)/.test(o)&&(r=/Windows (.*)/.exec(o)[1]),o="Windows"),o){case"Mac OS X":/Mac OS X (10[\.\_\d]+)/.test(n)&&(r=/Mac OS X (10[\.\_\d]+)/.exec(n)[1]);break;case"Android":/Android ([\.\_\d]+)/.test(n)&&(r=/Android ([\.\_\d]+)/.exec(n)[1]);break;case"iOS":/OS (\d+)_(\d+)_?(\d+)?/.test(n)&&(r=(r=/OS (\d+)_(\d+)_?(\d+)?/.exec(t))[1]+"."+r[2]+"."+(0|r[3]))}return{osName:o,osVersion:r}}())&&y.osName&&"-"!=y.osName?(i=y.osName,r=y.osVersion):a.any()&&"Android"==(i=a.getOsName())&&(r=!!(y=(l=(l||s.userAgent).toLowerCase()).match(/android\s([0-9\.]*)/))&&y[1]),"object"===(void 0===Le?"undefined":ze(Le))&&"object"===ze(Le.versions)&&Le.versions.node),Z=("Unknown OS"===i&&l&&(i="Nodejs",r=Le.versions.node.toString().replace("v","")),!1),ee=!1,te=(["captureStream","mozCaptureStream","webkitCaptureStream"].forEach(function(e){"undefined"!=typeof document&&"function"==typeof document.createElement&&(!Z&&e in document.createElement("canvas")&&(Z=!0),!ee&&e in document.createElement("video")&&(ee=!0))}),/^(192\.168\.|169\.254\.|10\.|172\.(1[6-9]|2\d|3[01]))/),ne=/([0-9]{1,3}(\.[0-9]{1,3}){3})/,oe=/[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7}/,d=[],u=[],p=[],h=[],ae=(s.mediaDevices&&s.mediaDevices.enumerateDevices&&(s.enumerateDevices=function(e){var t=s.mediaDevices.enumerateDevices();t&&t.then?s.mediaDevices.enumerateDevices().then(e).catch(function(){e([])}):e([])}),!1),ie=((void 0!==C&&"getSources"in C||s.mediaDevices&&s.mediaDevices.enumerateDevices)&&(ae=!0),!1),re=!1,se=!1,m=!1,g=!1,b=window.DetectRTC||{};b.browser=function(){s.appVersion;var e,t,n=s.userAgent,o=s.appName,a=""+parseFloat(s.appVersion),i=parseInt(s.appVersion,10);if(X&&!J&&-1!==n.indexOf("CriOS")&&(J=!(X=!1)),W){o="Opera";try{i=(a=s.userAgent.split("OPR/")[1].split(" ")[0]).split(".")[0]}catch(e){a="0.0.0.0",i=0}}else K?(a=0<(e=n.indexOf("rv:"))?n.substring(e+3):(e=n.indexOf("MSIE"),n.substring(e+5)),o="IE"):J?(e=n.indexOf("Chrome"),o="Chrome",a=n.substring(e+7)):X?(e=n.indexOf("Safari"),o="Safari",a=n.substring(e+7),-1!==(e=n.indexOf("Version"))&&(a=n.substring(e+8)),-1!==s.userAgent.indexOf("Version/")&&(a=s.userAgent.split("Version/")[1].split(" ")[0])):Y?(e=n.indexOf("Firefox"),o="Firefox",a=n.substring(e+8)):(t=n.lastIndexOf(" ")+1)<(e=n.lastIndexOf("/"))&&(o=n.substring(t,e),a=n.substring(e+1),o.toLowerCase()===o.toUpperCase()&&(o=s.appName));return H&&(o="Edge",a=s.userAgent.split("Edge/")[1]),-1!==(t=a.search(/[; \)]/))&&(a=a.substring(0,t)),i=parseInt(""+a,10),isNaN(i)&&(a=""+parseFloat(s.appVersion),i=parseInt(s.appVersion,10)),{fullVersion:a,version:i,name:o,isPrivateBrowsing:!1}}();try{if(window.webkitRequestFileSystem)window.webkitRequestFileSystem(window.TEMPORARY,1,function(){o=!1},function(e){o=!0});else if(window.indexedDB&&/Firefox/.test(window.navigator.userAgent)){try{(Q=window.indexedDB.open("test")).onerror=function(){return!0}}catch(e){o=!0}void 0===o&&$(function(){return"done"===Q.readyState},function(e){e||(o=!Q.result)})}else if(function(){var e=window.navigator.userAgent.toLowerCase();if(0!==e.indexOf("msie")||0!==e.indexOf("trident"))return e=/(?:msie|rv:)\s?([\d\.]+)/.exec(e),e&&10<=parseInt(e[1],10)}()){o=!1;try{window.indexedDB||(o=!0)}catch(e){o=!0}}else if(window.localStorage&&/Safari/.test(window.navigator.userAgent)){try{window.localStorage.setItem("test",1)}catch(e){o=!0}void 0===o&&(o=!1,window.localStorage.removeItem("test"))}}catch(e){o=!1}$(function(){return void 0!==o},function(e){var t;t=o,b.browser.isPrivateBrowsing=!!t}),b.browser["is"+b.browser.name]=!0,b.osName=i,b.osVersion=r,"object"===(void 0===Le?"undefined":ze(Le))&&"object"===ze(Le.versions)&&Le.versions["node-webkit"];var ce=!1,y=(["RTCPeerConnection","webkitRTCPeerConnection","mozRTCPeerConnection","RTCIceGatherer"].forEach(function(e){ce||e in window&&(ce=!0)}),b.isWebRTCSupported=ce,b.isORTCSupported="undefined"!=typeof RTCIceGatherer,!1),v=((b.browser.isChrome&&35<=b.browser.version||b.browser.isFirefox&&34<=b.browser.version||b.browser.isEdge&&17<=b.browser.version||"Android"===b.osName&&b.browser.isChrome)&&(y=!0),/^(https:|chrome-extension:)$/g.test(location.protocol||"")||("undefined"!=typeof document&&"string"==typeof document.domain&&document.domain.search&&-1===document.domain.search(/localhost|127.0./g)&&(b.browser.isChrome||b.browser.isEdge||b.browser.isOpera)||b.browser.isFirefox)&&(y=!1),b.isScreenCapturingSupported=y,{isSupported:!1,isCreateMediaStreamSourceSupported:!1}),l=(["AudioContext","webkitAudioContext","mozAudioContext","msAudioContext"].forEach(function(e){v.isSupported||e in window&&(v.isSupported=!0,window[e]&&"createMediaStreamSource"in window[e].prototype&&(v.isCreateMediaStreamSourceSupported=!0))}),b.isAudioContextSupported=v.isSupported,b.isCreateMediaStreamSourceSupported=v.isCreateMediaStreamSourceSupported,!1),i=(b.browser.isChrome&&31<b.browser.version&&(l=!0),b.isRtpDataChannelsSupported=l,!1),r=((b.browser.isFirefox&&28<b.browser.version||b.browser.isChrome&&25<b.browser.version||b.browser.isOpera&&11<=b.browser.version)&&(i=!0),b.isSctpDataChannelsSupported=i,b.isMobileDevice=t,!1),w=((s.getUserMedia||s.mediaDevices&&s.mediaDevices.getUserMedia)&&(r=!0),b.browser.isChrome&&46<=b.browser.version&&!/^(https:|chrome-extension:)$/g.test(location.protocol||"")&&"undefined"!=typeof document&&"string"==typeof document.domain&&document.domain.search&&-1===document.domain.search(/localhost|127.0./g)&&(r="Requires HTTPs"),"Nodejs"===b.osName&&(r=!1),b.isGetUserMediaSupported=r,y="",screen.width&&(y+=(screen.width||"")+" x "+(screen.height||"")),b.displayResolution=y,b.displayAspectRatio=((l=screen.width)/(t=function e(t,n){return 0==n?t:e(n,t%n)}(l,i=screen.height))/(i/t)).toFixed(2),b.isCanvasSupportsStreamCapturing=Z,b.isVideoSupportsStreamCapturing=ee,"Chrome"==b.browser.name&&53<=b.browser.version&&(b.isCanvasSupportsStreamCapturing||(b.isCanvasSupportsStreamCapturing="Requires chrome flag: enable-experimental-web-platform-features"),b.isVideoSupportsStreamCapturing||(b.isVideoSupportsStreamCapturing="Requires chrome flag: enable-experimental-web-platform-features")),b.DetectLocalIPAddress=function(n,e){if(b.isWebRTCSupported){var o=!0,a=!0;if("undefined"!=typeof document&&"function"==typeof document.getElementById){var i={};if(!(r=window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection)){var t=document.getElementById("iframe");if(!t)return;var t=t.contentWindow,r=t.RTCPeerConnection||t.mozRTCPeerConnection||t.webkitRTCPeerConnection}if(r){var t=null,s=new r({iceServers:[{urls:"stun:stun.l.google.com:19302"}]},t="Chrome"===b.browser&&b.browser.version<58?{optional:[{RtpDataChannels:!0}]}:t);if(e&&(s.addStream?s.addStream(e):s.addTrack&&e.getTracks()[0]&&s.addTrack(e.getTracks()[0],e)),s.onicecandidate=function(e){e.candidate&&c(e.candidate.candidate)},!e)try{s.createDataChannel("sctp",{})}catch(e){}b.isPromisesSupported?s.createOffer().then(function(e){s.setLocalDescription(e).then(l)}):s.createOffer(function(e){s.setLocalDescription(e,l,function(){})},function(){})}}function c(e){var t=ne.exec(e);t&&(t=t[1],e.match(te),void 0===i[t]&&((e=t).match(te)?n("Local: "+e,o=!1,a):e.match(oe)?n("Public: "+e,o,a=!1):n("Public: "+e,o,a)),i[t]=!0)}function l(){s.localDescription.sdp.split("\n").forEach(function(e){0===e.indexOf("a=candidate:")&&c(e)})}}},b.isWebSocketsSupported="WebSocket"in window&&2===window.WebSocket.CLOSING,b.isWebSocketsBlocked=!b.isWebSocketsSupported,"Nodejs"===b.osName&&(b.isWebSocketsSupported=!0,b.isWebSocketsBlocked=!1),b.checkWebSocketsSupport=function(t){t=t||function(){};try{var e,n=new WebSocket("wss://echo.websocket.org:443/");n.onopen=function(){b.isWebSocketsBlocked=!1,e=(new Date).getTime(),n.send("ping")},n.onmessage=function(){b.WebsocketLatency=(new Date).getTime()-e+"ms",t(),n.close(),n=null},n.onerror=function(){b.isWebSocketsBlocked=!0,t()}}catch(e){b.isWebSocketsBlocked=!0,t()}},b.load=function(e){var t,o;t=e=e||function(){},ae?(!s.enumerateDevices&&window.MediaStreamTrack&&window.MediaStreamTrack.getSources&&(s.enumerateDevices=window.MediaStreamTrack.getSources.bind(window.MediaStreamTrack)),!s.enumerateDevices&&s.enumerateDevices&&(s.enumerateDevices=s.enumerateDevices.bind(s)),s.enumerateDevices?(d=[],u=[],p=[],g=m=se=re=ie=!(h=[]),o={},s.enumerateDevices(function(e){e.forEach(function(e){var t,n={};for(t in e)try{"function"!=typeof e[t]&&(n[t]=e[t])}catch(e){}o[n.deviceId+n.label+n.kind]||("audio"===n.kind&&(n.kind="audioinput"),"video"===n.kind&&(n.kind="videoinput"),n.deviceId||(n.deviceId=n.id),n.id||(n.id=n.deviceId),n.label?("videoinput"!==n.kind||g||(g=!0),"audioinput"!==n.kind||m||(m=!0)):(n.isCustomLabel=!0,"videoinput"===n.kind?n.label="Camera "+(h.length+1):"audioinput"===n.kind?n.label="Microphone "+(u.length+1):"audiooutput"===n.kind?n.label="Speaker "+(p.length+1):n.label="Please invoke getUserMedia once.",void 0!==b&&b.browser.isChrome&&46<=b.browser.version&&!/^(https:|chrome-extension:)$/g.test(location.protocol||"")&&"undefined"!=typeof document&&"string"==typeof document.domain&&document.domain.search&&-1===document.domain.search(/localhost|127.0./g)&&(n.label="HTTPs is required to get label of this "+n.kind+" device.")),"audioinput"===n.kind&&(ie=!0,-1===u.indexOf(n)&&u.push(n)),"audiooutput"===n.kind&&(re=!0,-1===p.indexOf(n)&&p.push(n)),"videoinput"===n.kind&&(se=!0,-1===h.indexOf(n)&&h.push(n)),d.push(n),o[n.deviceId+n.label+n.kind]=n)}),void 0!==b&&(b.MediaDevices=d,b.hasMicrophone=ie,b.hasSpeakers=re,b.hasWebcam=se,b.isWebsiteHasWebcamPermissions=g,b.isWebsiteHasMicrophonePermissions=m,b.audioInputDevices=u,b.audioOutputDevices=p,b.videoInputDevices=h),t&&t()})):t&&t()):t&&t()},b.MediaDevices=void 0!==d?d:[],b.hasMicrophone=ie,b.hasSpeakers=re,b.hasWebcam=se,b.isWebsiteHasWebcamPermissions=g,b.isWebsiteHasMicrophonePermissions=m,b.audioInputDevices=u,b.audioOutputDevices=p,b.videoInputDevices=h,r=!1,"undefined"!=typeof document&&"function"==typeof document.createElement&&"setSinkId"in document.createElement("video")&&(r=!0),b.isSetSinkIdSupported=r,y=!1,b.browser.isFirefox&&"undefined"!=typeof mozRTCPeerConnection?"getSenders"in mozRTCPeerConnection.prototype&&(y=!0):b.browser.isChrome&&"undefined"!=typeof webkitRTCPeerConnection&&"getSenders"in webkitRTCPeerConnection.prototype&&(y=!0),b.isRTPSenderReplaceTracksSupported=y,l=!1,b.browser.isFirefox&&38<b.browser.version&&(l=!0),b.isRemoteStreamProcessingSupported=l,i=!1,void 0!==C&&"applyConstraints"in C.prototype&&(i=!0),b.isApplyConstraintsSupported=i,t=!1,b.browser.isFirefox&&43<=b.browser.version&&(t=!0),b.isMultiMonitorScreenCapturingSupported=t,b.isPromisesSupported=!!("Promise"in window),b.version="1.3.7",void 0===b&&(window.DetectRTC={}),void 0===(r=window.MediaStream)&&"undefined"!=typeof webkitMediaStream&&(r=webkitMediaStream),b.MediaStream=void 0!==r&&"function"==typeof r&&Object.keys(r.prototype),b.MediaStreamTrack=void 0!==C&&Object.keys(C.prototype),y=window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection,b.RTCPeerConnection=void 0!==y&&Object.keys(y.prototype),window.DetectRTC=b,"function"==typeof define&&Ge(144)&&define("DetectRTC",[],function(){return b}),"undefined"!=typeof cordova&&(DetectRTC.isMobileDevice=!0,DetectRTC.browser.name="Chrome"),navigator&&navigator.userAgent&&-1!==navigator.userAgent.indexOf("Crosswalk")&&(DetectRTC.isMobileDevice=!0,DetectRTC.browser.name="Chrome"),window.addEventListener||(window.addEventListener=function(e,t,n){e.attachEvent&&e.attachEvent("on"+t,n)}),window.attachEventListener=function(e,t,n,o){e.addEventListener(t,n,o)},window.MediaStream);function x(e,t){return!(e.session.audio&&"two-way"===e.session.audio||("Firefox"!==DetectRTC.browser.name||!1===t)&&("Chrome"!==DetectRTC.browser.name||DetectRTC.browser.version<50||!0!==typeof t&&(void 0!==t||!e.session.audio||!e.session.screen||e.session.video)))}function le(e){return"Firefox"===DetectRTC.browser.name||"Chrome"===DetectRTC.browser.name&&{mandatory:{chromeMediaSource:e.mandatory.chromeMediaSource,chromeMediaSourceId:e.mandatory.chromeMediaSourceId}}}function _(e,t){return e&&e.getTracks?e.getTracks().filter(function(e){return e.kind===(t||"audio")}):[]}function de(){var e;"undefined"!=typeof cordova&&void 0!==cordova.plugins&&void 0!==cordova.plugins.iosrtc&&(e=cordova.plugins.iosrtc,window.webkitRTCPeerConnection=e.RTCPeerConnection,window.RTCSessionDescription=e.RTCSessionDescription,window.RTCIceCandidate=e.RTCIceCandidate,window.MediaStream=e.MediaStream,window.MediaStreamTrack=e.MediaStreamTrack,navigator.getUserMedia=navigator.webkitGetUserMedia=e.getUserMedia,e.debug.enable("iosrtc*"),"function"==typeof e.selectAudioOutput&&e.selectAudioOutput(window.iOSDefaultAudioOutputDevice||"speaker"),e.registerGlobals())}void 0===(w=void 0===w&&"undefined"!=typeof webkitMediaStream?webkitMediaStream:w)||"stop"in w.prototype||(w.prototype.stop=function(){this.getTracks().forEach(function(e){e.stop()})}),window.iOSDefaultAudioOutputDevice=window.iOSDefaultAudioOutputDevice||"speaker",document.addEventListener("deviceready",de,!1),de();var S,T={};function ue(e){return{OfferToReceiveAudio:!!e.OfferToReceiveAudio,OfferToReceiveVideo:!!e.OfferToReceiveVideo}}void 0!==window.RTCPeerConnection?S=window.RTCPeerConnection:"undefined"!=typeof mozRTCPeerConnection?S=mozRTCPeerConnection:"undefined"!=typeof webkitRTCPeerConnection&&(S=webkitRTCPeerConnection);var fe=window.RTCSessionDescription||window.mozRTCSessionDescription,pe=window.RTCIceCandidate||window.mozRTCIceCandidate,C=window.MediaStreamTrack;function he(n){if(void 0!==window.RTCPeerConnection?S=window.RTCPeerConnection:"undefined"!=typeof mozRTCPeerConnection?S=mozRTCPeerConnection:"undefined"!=typeof webkitRTCPeerConnection&&(S=webkitRTCPeerConnection),fe=window.RTCSessionDescription||window.mozRTCSessionDescription,pe=window.RTCIceCandidate||window.mozRTCIceCandidate,C=window.MediaStreamTrack,!S)throw"WebRTC 1.0 (RTCPeerConnection) API are NOT available in this browser.";var o=n.rtcMultiConnection,a=(this.extra=(n.remoteSdp||o).extra,this.userid=n.userid,this.streams=[],this.channels=n.channels||[],this.connectionDescription=n.connectionDescription,this.addStream=function(e){o.addStream(e,a.userid)},this.removeStream=function(e){o.removeStream(e,a.userid)},this);n.remoteSdp&&(this.connectionDescription=n.remoteSdp.connectionDescription);var i,r={},e=(T.sdpConstraints=ue({OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}),!!n.renegotiatingPeer),t=(n.remoteSdp&&(e=!!n.remoteSdp.renegotiatingPeer),[]);if(o.attachStreams.forEach(function(e){e&&t.push(e)}),e)i=n.peerRef;else{var s="all";!o.candidates.turn&&!o.candidates.relay||o.candidates.stun||o.candidates.reflexive||o.candidates.host||(s="relay");try{var c={iceServers:o.iceServers,iceTransportPolicy:o.iceTransportPolicy||s};void 0!==o.iceCandidatePoolSize&&(c.iceCandidatePoolSize=o.iceCandidatePoolSize),void 0!==o.bundlePolicy&&(c.bundlePolicy=o.bundlePolicy),void 0!==o.rtcpMuxPolicy&&(c.rtcpMuxPolicy=o.rtcpMuxPolicy),"Chrome"===DetectRTC.browser.name&&(c.sdpSemantics=o.sdpSemantics||"unified-plan"),o.iceServers&&o.iceServers.length||(c=null,o.optionalArgument=null),i=new S(c,o.optionalArgument)}catch(e){try{c={iceServers:o.iceServers},i=new S(c)}catch(e){i=new S}}}!i.getRemoteStreams&&i.getReceivers&&(i.getRemoteStreams=function(){var t=new w;return i.getReceivers().forEach(function(e){t.addTrack(e.track)}),[t]}),!i.getLocalStreams&&i.getSenders&&(i.getLocalStreams=function(){var t=new w;return i.getSenders().forEach(function(e){t.addTrack(e.track)}),[t]}),i.onicecandidate=function(e){e.candidate?o.trickleIce&&n.onLocalCandidate({candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid,sdpMLineIndex:e.candidate.sdpMLineIndex}):o.trickleIce||(e=i.localDescription,n.onLocalSdp({type:e.type,sdp:e.sdp,remotePeerSdpConstraints:n.remotePeerSdpConstraints||!1,renegotiatingPeer:!!n.renegotiatingPeer||!1,connectionDescription:a.connectionDescription,dontGetRemoteStream:!!n.dontGetRemoteStream,extra:o?o.extra:{},streamsToShare:u}))},t.forEach(function(t){n.remoteSdp&&n.remoteSdp.remotePeerSdpConstraints&&n.remoteSdp.remotePeerSdpConstraints.dontGetRemoteStream||n.dontAttachLocalStream||(t=o.beforeAddingStream(t,a))&&(i.getLocalStreams().forEach(function(e){t&&e.id==t.id&&(t=null)}),t&&t.getTracks&&t.getTracks().forEach(function(e){try{i.addTrack(e,t)}catch(e){}}))}),i.oniceconnectionstatechange=i.onsignalingstatechange=function(){var e=a.extra;o.peers[a.userid]&&(e=o.peers[a.userid].extra||e),i&&(n.onPeerStateChanged({iceConnectionState:i.iceConnectionState,iceGatheringState:i.iceGatheringState,signalingState:i.signalingState,extra:e,userid:a.userid}),i&&i.iceConnectionState&&-1!==i.iceConnectionState.search(/closed|failed/gi)&&a.streams instanceof Array&&a.streams.forEach(function(e){e=o.streamEvents[e.id]||{streamid:e.id,stream:e,type:"remote"};o.onstreamended(e)}))};var s={OfferToReceiveAudio:!!t.length,OfferToReceiveVideo:!!t.length},l=(n.localPeerSdpConstraints&&(s=n.localPeerSdpConstraints),T.sdpConstraints=ue(s),{}),c=(i.ontrack=function(t){var e;t&&"track"===t.type&&(t.stream=t.streams[t.streams.length-1],t.stream.id||(t.stream.id=t.track.id),l[t.stream.id]&&"Safari"!==DetectRTC.browser.name?t.track&&(t.track.onended=function(){i.onremovestream(t)}):(l[t.stream.id]=t.stream.id,e={},n.remoteSdp&&n.remoteSdp.streamsToShare?e=n.remoteSdp.streamsToShare:n.streamsToShare&&(e=n.streamsToShare),(e=e[t.stream.id])?(t.stream.isAudio=e.isAudio,t.stream.isVideo=e.isVideo,t.stream.isScreen=e.isScreen):(t.stream.isVideo=!!_(t.stream,"video").length,t.stream.isAudio=!t.stream.isVideo,t.stream.isScreen=!1),t.stream.streamid=t.stream.id,r[t.stream.id]=t.stream,n.onRemoteStream(t.stream),t.stream.getTracks().forEach(function(e){e.onended=function(){i.onremovestream(t)}}),t.stream.onremovetrack=function(){i.onremovestream(t)}))},i.onremovestream=function(e){e.stream.streamid=e.stream.id,r[e.stream.id]&&delete r[e.stream.id],n.onRemoteStreamRemoved(e.stream)},"function"!=typeof i.removeStream&&(i.removeStream=function(t){t.getTracks().forEach(function(e){i.removeTrack(e,t)})}),this.addRemoteCandidate=function(e){i.addIceCandidate(new pe(e))},this.addRemoteSdp=function(t,n){n=n||function(){},"Safari"!==DetectRTC.browser.name&&(t.sdp=o.processSdp(t.sdp)),i.setRemoteDescription(new fe(t)).then(n,function(e){o.enableLogs&&console.error("setRemoteDescription failed","\n",e,"\n",t.sdp),n()}).catch(function(e){o.enableLogs&&console.error("setRemoteDescription failed","\n",e,"\n",t.sdp),n()})},!0);function d(t){t.binaryType="arraybuffer",t.onmessage=function(e){n.onDataChannelMessage(e.data)},t.onopen=function(){n.onDataChannelOpened(t)},t.onerror=function(e){n.onDataChannelError(e)},t.onclose=function(e){n.onDataChannelClosed(e)},t.internalSend=t.send,t.send=function(e){"open"===t.readyState&&t.internalSend(e)},i.channel=t}n.remoteSdp&&(c=!1),this.createDataChannel=function(){d(i.createDataChannel("sctp",{}))},!0!==o.session.data||e||(c?this.createDataChannel():i.ondatachannel=function(e){d(e.channel)}),this.enableDisableVideoEncoding=function(e){var t,n;i.getSenders().forEach(function(e){t||"video"!==e.track.kind||(t=e)}),t&&t.getParameters&&((n=t.getParameters()).encodings[1]&&(n.encodings[1].active=!!e),n.encodings[2]&&(n.encodings[2].active=!!e),t.setParameters(n))},n.remoteSdp&&(n.remoteSdp.remotePeerSdpConstraints&&(s=n.remoteSdp.remotePeerSdpConstraints),T.sdpConstraints=ue(s),this.addRemoteSdp(n.remoteSdp,function(){f("createAnswer")})),"two-way"!=o.session.audio&&"two-way"!=o.session.video&&"two-way"!=o.session.screen||(T.sdpConstraints=ue({OfferToReceiveAudio:"two-way"==o.session.audio||n.remoteSdp&&n.remoteSdp.remotePeerSdpConstraints&&n.remoteSdp.remotePeerSdpConstraints.OfferToReceiveAudio,OfferToReceiveVideo:"two-way"==o.session.video||"two-way"==o.session.screen||n.remoteSdp&&n.remoteSdp.remotePeerSdpConstraints&&n.remoteSdp.remotePeerSdpConstraints.OfferToReceiveAudio}));var u={};function f(e){i[e](T.sdpConstraints).then(function(e){"Safari"!==DetectRTC.browser.name&&(e.sdp=o.processSdp(e.sdp)),i.setLocalDescription(e).then(function(){o.trickleIce&&(n.onLocalSdp({type:e.type,sdp:e.sdp,remotePeerSdpConstraints:n.remotePeerSdpConstraints||!1,renegotiatingPeer:!!n.renegotiatingPeer||!1,connectionDescription:a.connectionDescription,dontGetRemoteStream:!!n.dontGetRemoteStream,extra:o?o.extra:{},streamsToShare:u}),o.onSettingLocalDescription(a))},function(e){o.enableLogs&&console.error("setLocalDescription error",e)})},function(e){o.enableLogs&&console.error("sdp-error",e)})}i.getLocalStreams().forEach(function(e){u[e.streamid]={isAudio:!!e.isAudio,isVideo:!!e.isVideo,isScreen:!!e.isScreen}}),c&&f("createOffer"),i.nativeClose=i.close,i.close=function(){if(i){try{i.nativeClose!==i.close&&i.nativeClose()}catch(e){}i=null,a.peer=null}},this.peer=i}var E={removeVPX:function(e){var t=be(e);return e=ge(e,"vp9",t,!0),ge(e,"vp8",t,!0)},disableNACK:function(e){if(e&&"string"==typeof e)return(e=(e=(e=e.replace("a=rtcp-fb:126 nack\r\n","")).replace("a=rtcp-fb:126 nack pli\r\n","a=rtcp-fb:126 pli\r\n")).replace("a=rtcp-fb:97 nack\r\n","")).replace("a=rtcp-fb:97 nack pli\r\n","a=rtcp-fb:97 pli\r\n");throw"Invalid arguments."},prioritize:function(o,e){if(e&&e.getSenders&&e.getSenders().length){if(!o||"string"!=typeof o)throw"Invalid arguments.";e.getSenders().forEach(function(e){for(var t=e.getParameters(),n=0;n<t.codecs.length;n++)if(t.codecs[n].mimeType==o){t.codecs.unshift(t.codecs.splice(n,1));break}e.setParameters(t)})}},removeNonG722:function(e){return e.replace(/m=audio ([0-9]+) RTP\/SAVPF ([0-9 ]*)/g,"m=audio $1 RTP/SAVPF 9")},setApplicationSpecificBandwidth:function(e,t,n){return e=e,n=n,!(t=t)||void 0!==Se&&Se||(n&&(t.screen?t.screen<300&&console.warn("It seems that you are using wrong bandwidth value for screen. Screen sharing is expected to fail."):console.warn("It seems that you are not using bandwidth for screen. Screen sharing is expected to fail.")),t.screen&&n&&(e=(e=e.replace(/b=AS([^\r\n]+\r\n)/g,"")).replace(/a=mid:video\r\n/g,"a=mid:video\r\nb=AS:"+t.screen+"\r\n")),(t.audio||t.video)&&(e=e.replace(/b=AS([^\r\n]+\r\n)/g,"")),t.audio&&(e=e.replace(/a=mid:audio\r\n/g,"a=mid:audio\r\nb=AS:"+t.audio+"\r\n")),t.screen?e=e.replace(/a=mid:video\r\n/g,"a=mid:video\r\nb=AS:"+t.screen+"\r\n"):t.video&&(e=e.replace(/a=mid:video\r\n/g,"a=mid:video\r\nb=AS:"+t.video+"\r\n"))),e},setVideoBitrates:function(e,t){var n,o,a=void 0,t=(a=t||{}).min,a=a.max,i=e.split("\r\n"),r=A(i,"a=rtpmap","VP8/90000");return(n=r?ye(i[r]):n)?((r=A(i,"a=rtpmap","rtx/90000"))&&(o=ye(i[r])),r&&null!==(r=A(i,"a=fmtp:"+o.toString()))&&(o="\r\n",i[r]=i[r].concat(o+="a=fmtp:"+n+" x-google-min-bitrate="+(t||"228")+"; x-google-max-bitrate="+(a||"228")),e=i.join("\r\n")),e):e},setOpusAttributes:function(e,t){var n=void 0,t=(n=t||{},e.split("\r\n")),o=A(t,"a=rtpmap","opus/48000");if(!(a=o?ye(t[o]):a))return e;if(null===(o=A(t,"a=fmtp:"+a.toString())))return e;var a="",a=(a+="; stereo="+(void 0!==n.stereo?n.stereo:"1"))+("; sprop-stereo="+(void 0!==n["sprop-stereo"]?n["sprop-stereo"]:"1"));return void 0!==n.maxaveragebitrate&&(a+="; maxaveragebitrate="+(n.maxaveragebitrate||1048576)),void 0!==n.maxplaybackrate&&(a+="; maxplaybackrate="+(n.maxplaybackrate||1048576)),void 0!==n.cbr&&(a+="; cbr="+(void 0!==n.cbr?n.cbr:"1")),void 0!==n.useinbandfec&&(a+="; useinbandfec="+n.useinbandfec),void 0!==n.usedtx&&(a+="; usedtx="+n.usedtx),void 0!==n.maxptime&&(a+="\r\na=maxptime:"+n.maxptime),t[o]=t[o].concat(a),t.join("\r\n")},preferVP9:function(e){return me(e,"vp9")},preferCodec:me,forceStereoAudio:function(e){for(var t=e.split("\r\n"),n=null,o=0;o<t.length;o++)if(-1!==t[o].search("opus/48000")){var a=extractSdp(t[o],/:(\d+) opus\/48000/i);break}for(o=0;o<t.length;o++)if(-1!==t[o].search("a=fmtp")&&extractSdp(t[o],/a=fmtp:(\d+)/)===a){n=o;break}return null===n?e:(t[n]=t[n].concat("; stereo=1; sprop-stereo=1"),t.join("\r\n"))}};function me(e,t){var n=be(e);return!n.videoCodecNumbers||"vp8"===t&&n.vp8LineNumber===n.videoCodecNumbers[0]||"vp9"===t&&n.vp9LineNumber===n.videoCodecNumbers[0]||"h264"===t&&n.h264LineNumber===n.videoCodecNumbers[0]?e:ge(e,t,n)}function ge(e,t,n,o){var a="";if("vp8"===t){if(!n.vp8LineNumber)return e;a=n.vp8LineNumber}if("vp9"===t){if(!n.vp9LineNumber)return e;a=n.vp9LineNumber}if("h264"===t){if(!n.h264LineNumber)return e;a=n.h264LineNumber}var t=n.videoCodecNumbersOriginal.split("SAVPF")[0]+"SAVPF ",i=o?[]:[a];return n.videoCodecNumbers.forEach(function(e){e!==a&&i.push(e)}),t+=i.join(" "),e.replace(n.videoCodecNumbersOriginal,t)}function be(e){var n={};return e.split("\n").forEach(function(t){0===t.indexOf("m=video")&&(n.videoCodecNumbers=[],t.split("SAVPF")[1].split(" ").forEach(function(e){(e=e.trim())&&e.length&&(n.videoCodecNumbers.push(e),n.videoCodecNumbersOriginal=t)})),-1===t.indexOf("VP8/90000")||n.vp8LineNumber||(n.vp8LineNumber=t.replace("a=rtpmap:","").split(" ")[0]),-1===t.indexOf("VP9/90000")||n.vp9LineNumber||(n.vp9LineNumber=t.replace("a=rtpmap:","").split(" ")[0]),-1===t.indexOf("H264/90000")||n.h264LineNumber||(n.h264LineNumber=t.replace("a=rtpmap:","").split(" ")[0])}),n}function A(e,t,n){for(var o=e,a=t,i=n,r=o.length,s=0;s<r;++s)if(0===o[s].indexOf(a)&&(!i||-1!==o[s].toLowerCase().indexOf(i.toLowerCase())))return s;return null}function ye(e){var t=new RegExp("a=rtpmap:(d+) w+/d+"),e=e.match(t);return e&&2===e.length?e[1]:null}window.BandwidthHandler=E;var ve={processCandidates:function(e,t){var n=t.candidate,o=e.candidates,a=o.stun,i=o.turn;if(q(o.reflexive)||(a=o.reflexive),q(o.relay)||(i=o.relay),(o.host||!n.match(/typ host/g))&&(i||!n.match(/typ relay/g))&&(a||!n.match(/typ srflx/g))){o=e.iceProtocols;if((o.udp||!n.match(/ udp /g))&&(o.tcp||!n.match(/ tcp /g)))return e.enableLogs&&console.debug("Your candidate pairs:",n),{candidate:n,sdpMid:t.sdpMid,sdpMLineIndex:t.sdpMLineIndex}}}},l=function(e){return[{urls:["stun:webrtcweb.com:7788"],username:"muazkh",credential:"muazkh"},{urls:["turn:webrtcweb.com:7788","turn:webrtcweb.com:8877","turn:webrtcweb.com:4455"],username:"muazkh",credential:"muazkh"},{urls:["stun:stun.l.google.com:19302","stun:stun1.l.google.com:19302","stun:stun2.l.google.com:19302","stun:stun.l.google.com:19302?transport=udp"]}]};function we(a){if(!0!==currentUserMediaRequest.mutex){currentUserMediaRequest.mutex=!0;var t,n,o,i=JSON.stringify(a.localMediaConstraints);if(currentUserMediaRequest.streams[i])r(currentUserMediaRequest.streams[i].stream,!0);else{if(/BB10|BlackBerry/i.test(navigator.userAgent||"")||void 0===navigator.mediaDevices||"function"!=typeof navigator.mediaDevices.getUserMedia)return navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia,void navigator.getUserMedia(a.localMediaConstraints,function(e){e.streamid=e.streamid||e.id||f(),e.idInstance=i,r(e)},function(e){a.onLocalMediaError(e,a.localMediaConstraints)});void 0===navigator.mediaDevices&&(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia,o=function(){},navigator.mediaDevices={getUserMedia:function(e){return navigator.getUserMedia(e,function(e){e(stream),t=stream},function(e){o(e),n=e}),{then:function(e){if(!t)return{then:function(e){n?e(n):o=e}};e(t)}}}}),navigator.mediaDevices.getUserMedia(a.localMediaConstraints).then(function(e){e.streamid=e.streamid||e.id||f(),e.idInstance=i,r(e)}).catch(function(e){a.onLocalMediaError(e,a.localMediaConstraints)})}}else currentUserMediaRequest.queueRequests.push(a);function r(e,t){o=a.localMediaConstraints,n=e,o.mandatory&&o.mandatory.chromeMediaSource||o.mozMediaSource||o.mediaSource?n.isScreen=!0:o.video?n.isVideo=!0:o.audio&&(n.isAudio=!0);var n,o="ended";"oninactive"in e&&(o="inactive"),e.addEventListener(o,function(){delete currentUserMediaRequest.streams[i],currentUserMediaRequest.mutex=!1,currentUserMediaRequest.queueRequests.indexOf(a)&&(delete currentUserMediaRequest.queueRequests[currentUserMediaRequest.queueRequests.indexOf(a)],currentUserMediaRequest.queueRequests=V(currentUserMediaRequest.queueRequests))},!1),currentUserMediaRequest.streams[i]={stream:e},currentUserMediaRequest.mutex=!1,currentUserMediaRequest.queueRequests.length&&we(currentUserMediaRequest.queueRequests.shift()),a.onGettingLocalMedia(e,t)}}window.currentUserMediaRequest={streams:[],mutex:!1,queueRequests:[],remove:function(e){this.mutex=!1;var t=this.streams[e];t&&(t=t.stream.currentUserMediaRequestOptions,this.queueRequests.indexOf(t)&&(delete this.queueRequests[this.queueRequests.indexOf(t)],this.queueRequests=V(this.queueRequests)),this.streams[e].stream=null,delete this.streams[e])}};var k={setHandlers:function(o,a,i){var e;o&&o.addEventListener&&(void 0!==a&&1!=a||(e="ended","oninactive"in o&&(e="inactive"),o.addEventListener(e,function(){k.onSyncNeeded(this.streamid,e)},!1)),o.mute=function(e,t){e=xe(e),void 0!==t&&(a=t),void 0!==e&&"audio"!=e||_(o,"audio").forEach(function(e){e.enabled=!1,i.streamEvents[o.streamid].isAudioMuted=!0}),void 0!==e&&"video"!=e||_(o,"video").forEach(function(e){e.enabled=!1}),void 0!==a&&1!=a||k.onSyncNeeded(o.streamid,"mute",e),i.streamEvents[o.streamid].muteType=e||"both",B(o,"mute",e)},o.unmute=function(e,t){var n;e=xe(e),void 0!==t&&(a=t),i.streamEvents[o.streamid].mediaElement&&((n=i.streamEvents[o.streamid].mediaElement).volume=0,function e(t,n,o,a){n<=(a=(a||0)+1)||setTimeout(function(){o(),e(t,n,o,a)},t)}(200,5,function(){try{n.volume+=.2}catch(e){n.volume=1}})),void 0!==e&&"audio"!=e||_(o,"audio").forEach(function(e){e.enabled=!0,i.streamEvents[o.streamid].isAudioMuted=!1}),void 0!==e&&"video"!=e||(_(o,"video").forEach(function(e){e.enabled=!0}),void 0!==e&&"video"==e&&i.streamEvents[o.streamid].isAudioMuted&&function e(t){t=t||0,++t<100&&i.streamEvents[o.streamid].isAudioMuted&&(o.mute("audio"),setTimeout(function(){e(t)},50))}()),void 0!==a&&1!=a||k.onSyncNeeded(o.streamid,"unmute",e),i.streamEvents[o.streamid].unmuteType=e||"both",B(o,"unmute",e)})},onSyncNeeded:function(e,t,n){}};function xe(e){if(e)return"string"==typeof e||void 0===e?e:e.audio&&e.video?null:e.audio?"audio":e.video?"video":void 0}window.addEventListener("message",function(e){if(e.origin==window.location.origin){e=e.data;if("PermissionDeniedError"==e){if(R="PermissionDeniedError",M)return void M("PermissionDeniedError");throw new Error("PermissionDeniedError")}"rtcmulticonnection-extension-loaded"==e&&(R="desktop"),e.sourceId&&M&&M(O=e.sourceId,!0===e.canRequestAudioTrack)}});var O,M,R="screen";function _e(e){if(e){if("desktop"==R)return e(!0);window.postMessage("are-you-there","*"),setTimeout(function(){e("screen"!=R)},2e3)}}var Se=void 0!==window.InstallTrigger;window.opera||navigator.userAgent.indexOf(" OPR/");function Te(e,t){if(Se)return t("not-chrome");2!=arguments.length&&(t=e,e="ajhifddimkapgcifgcodmmfdlknahffk");var n=document.createElement("img");n.src="chrome-extension://"+e+"/icon.png",n.onload=function(){R="screen",window.postMessage("are-you-there","*"),setTimeout(function(){t("screen"==R?"installed-disabled":"installed-enabled")},2e3)},n.onerror=function(){t("not-installed")}}function Ce(r){var s={};return{receive:function(e,t,n){var o,a,i=e.uuid;s[i]||(s[i]=[]),s[i].push(e.message),e.last&&(o=s[i].join(""),a={data:o=e.isobject?JSON.parse(o):o,userid:t,extra:n,latency:(new Date).getTime()-e.sendingTime},r.autoTranslateText?(a.original=a.data,r.Translator.TranslateText(a.data,function(e){a.data=e,r.onmessage(a)})):r.onmessage(a),delete s[i])}}}window.chrome;var P,j,Ee,N,Ae,ke={send:function(e){var a=e.connection,i=e.channel,r=e.remoteUserId,e=e.text,s=a.chunkSize||1e3,c="",l=!1,d=("string"!=typeof e&&(l=!0,e=JSON.stringify(e)),f()),u=(new Date).getTime();!function e(t,n){var o={type:"text",uuid:d,sendingTime:u};t&&(n=t,o.packets=parseInt(n.length/s)),n.length>s?o.message=n.slice(0,s):(o.message=n,o.last=!0,o.isobject=l),i.send(o,r),(c=n.slice(o.message.length)).length&&setTimeout(function(){e(null,c)},a.chunkInterval||100)}(e)}},i={handle:function(n){var o={};n.onFileStart=function(e){var t=document.createElement("div");if(t.title=e.name,t.innerHTML="<label>0%</label> <progress></progress>",e.remoteUserId&&(t.innerHTML+=" (Sharing with:"+e.remoteUserId+")"),n.filesContainer||(n.filesContainer=document.body||document.documentElement),n.filesContainer.insertBefore(t,n.filesContainer.firstChild),!e.remoteUserId)return o[e.uuid]={div:t,progress:t.querySelector("progress"),label:t.querySelector("label")},void(o[e.uuid].progress.max=e.maxChunks);o[e.uuid]||(o[e.uuid]={}),o[e.uuid][e.remoteUserId]={div:t,progress:t.querySelector("progress"),label:t.querySelector("label")},o[e.uuid][e.remoteUserId].progress.max=e.maxChunks},n.onFileProgress=function(e){var t=o[e.uuid];!t||e.remoteUserId&&!(t=o[e.uuid][e.remoteUserId])||(t.progress.value=e.currentPosition||e.maxChunks||t.progress.max,e=t.progress,t=t.label,-1!==e.position&&(e=+e.position.toFixed(2).split(".")[1]||100,t.innerHTML=e+"%"))},n.onFileEnd=function(e){var t=o[e.uuid];t?e.remoteUserId&&!(t=o[e.uuid][e.remoteUserId])||(t=t.div,-1!=e.type.indexOf("image")?t.innerHTML='<a href="'+e.url+'" download="'+e.name+'">Download <strong style="color:red;">'+e.name+'</strong> </a><br /><img src="'+e.url+'" title="'+e.name+'" style="max-width: 80%;">':t.innerHTML='<a href="'+e.url+'" download="'+e.name+'">Download <strong style="color:red;">'+e.name+'</strong> </a><br /><iframe src="'+e.url+'" title="'+e.name+'" style="width: 80%;border: 0;height: inherit;margin-top:1em;"></iframe>'):console.error("No such progress-helper element exist.",e)}}},t={handle:function(a){a.autoTranslateText=!1,a.language="en",a.googKey="AIzaSyCgB5hmFY74WYB-EoWkhr9cAGr6TiTHrEE",a.Translator={TranslateText:function(e,t){var n=document.createElement("script"),e=(n.type="text/javascript",encodeURIComponent(e)),o="method"+a.token(),o=(window[o]=function(e){e.data&&e.data.translations[0]&&t?t(e.data.translations[0].translatedText):e.error&&"Daily Limit Exceeded"===e.error.message?console.error('Text translation failed. Error message: "Daily Limit Exceeded."'):e.error?console.error(e.error.message):console.error(e)},"https://www.googleapis.com/language/translate/v2?key="+a.googKey+"&target="+(a.language||"en-US")+"&callback=window."+o+"&q="+e);n.src=o,document.getElementsByTagName("head")[0].appendChild(n)},getListOfLanguages:function(t){var n=new XMLHttpRequest,e=(n.onreadystatechange=function(){var e;n.readyState==XMLHttpRequest.DONE&&((e=JSON.parse(n.responseText))&&e.data&&e.data.languages?t(e.data.languages):e.error&&"Daily Limit Exceeded"===e.error.message?console.error('Text translation failed. Error message: "Daily Limit Exceeded."'):e.error?console.error(e.error.message):console.error(e))},"https://www.googleapis.com/language/translate/v2/languages?key="+a.googKey+"&target=en");n.open("GET",e,!0),n.send(null)}}}};function I(t){if(P.socketAutoReConnect=!0,P.socket)t&&t(P.socket);else{if(void 0===n)if("undefined"!=typeof FirebaseConnection)window.SocketConnection=FirebaseConnection;else{if("undefined"==typeof PubNubConnection)throw"SocketConnection.js seems missed.";window.SocketConnection=PubNubConnection}new n(P,function(e){t&&t(P.socket)})}}function Oe(n,o){P.socket.emit("join-room",{sessionid:P.sessionid,session:P.session,mediaConstraints:P.mediaConstraints,sdpConstraints:P.sdpConstraints,streams:Re(),extra:P.extra,password:void 0!==P.password&&"object"!==ze(P.password)?P.password:""},function(e,t){if(!0===e){if(P.enableLogs&&console.log("isRoomJoined: ",e," roomid: ",P.sessionid),P.peers[P.sessionid])return;j.onNegotiationNeeded(n)}!1===e&&P.enableLogs&&console.warn("isRoomJoined: ",t," roomid: ",P.sessionid),o(e,P.sessionid,t)})}function Me(n){P.enableLogs&&console.log("Sending open-room signal to socket.io"),P.waitingForLocalMedia=!1,P.socket.emit("open-room",{sessionid:P.sessionid,session:P.session,mediaConstraints:P.mediaConstraints,sdpConstraints:P.sdpConstraints,streams:Re(),extra:P.extra,identifier:P.publicRoomIdentifier,password:void 0!==P.password&&"object"!==ze(P.password)?P.password:""},function(e,t){!0===e&&(P.enableLogs&&console.log("isRoomOpened: ",e," roomid: ",P.sessionid),n(e,P.sessionid)),!1===e&&(P.enableLogs&&console.warn("isRoomOpened: ",t," roomid: ",P.sessionid),n(e,P.sessionid,t))})}function Re(){try{return P.streamEvents.selectAll("local").map(function(e){return{streamid:e.streamid,tracks:e.stream.getTracks().length}})}catch(e){return[]}}function Pe(e,n){var t,o;P.dontCaptureUserMedia||e.isDataOnly?n():(t={},e.localPeerSdpConstraints.OfferToReceiveAudio&&(t.audio=P.mediaConstraints.audio),e.localPeerSdpConstraints.OfferToReceiveVideo&&(t.video=P.mediaConstraints.video),(o=e.session||P.session).oneway&&"two-way"!==o.audio&&"two-way"!==o.video&&"two-way"!==o.screen?n():((o=o.oneway&&o.audio&&"two-way"===o.audio?{audio:!0}:o).audio||o.video||o.screen)&&(o.screen?"Edge"===DetectRTC.browser.name?navigator.getDisplayMedia({video:!0,audio:x(P)}).then(function(e){e.isScreen=!0,j.onGettingLocalMedia(e),!o.audio&&!o.video||x(P)?n(e):P.invokeGetUserMedia(null,n)},function(e){console.error("Unable to capture screen on Edge. HTTPs and version 17+ is required.")}):P.getScreenConstraints(function(e,t){P.invokeGetUserMedia({audio:!!x(P)&&le(t),video:t,isScreen:!0},!o.audio&&!o.video||x(P)?n:P.invokeGetUserMedia(null,n))}):(o.audio||o.video)&&P.invokeGetUserMedia(null,n,o)))}function je(e,t){e?(t.audio&&_(e,"audio").forEach(function(e){e.applyConstraints(t.audio)}),t.video&&_(e,"video").forEach(function(e){e.applyConstraints(t.video)})):P.enableLogs&&console.error("No stream to applyConstraints.")}function Ne(t,e,n){e?j.replaceTrack(t,e,n):P.peers.getAllParticipants().forEach(function(e){j.replaceTrack(t,e,n)})}D=D||{useDefaultDevices:!0},(P=this).channel=P.sessionid=(L||location.href.replace(/\/|:|#|\?|\$|\^|%|\.|`|~|!|\+|@|\[|\||]|\|*. /g,"").split("\n").join("").split("\r").join(""))+"",j=new z(P),Ee={},j.onGettingLocalMedia=function(t,a){if(a=a||function(){},Ee[t.streamid])a();else{Ee[t.streamid]=!0;try{t.type="local"}catch(e){}P.setStreamEndHandler(t),F(t,function(e){e.id=t.streamid,e.muted=!0,e.volume=0,-1===P.attachStreams.indexOf(t)&&P.attachStreams.push(t),void 0!==k&&k.setHandlers(t,!0,P),P.streamEvents[t.streamid]={stream:t,type:"local",mediaElement:e,userid:P.userid,extra:P.extra,streamid:t.streamid,isAudioMuted:!0};try{var n=P,o=P.streamEvents[t.streamid];if(o.stream&&_(o.stream,"audio").length){if(!n||!o)throw"Both arguments are required.";if(n.onspeaking&&n.onsilence){if("undefined"==typeof hark)throw"hark.js not found.";hark(o.stream,{onspeaking:function(){n.onspeaking(o)},onsilence:function(){n.onsilence(o)},onvolumechange:function(e,t){n.onvolumechange&&n.onvolumechange(Fe({volume:e,threshold:t},o))}})}}U(P,P.streamEvents[t.streamid]),P.onstream(P.streamEvents[t.streamid])}catch(e){}a()},P)}},j.onGettingRemoteMedia=function(t,n){try{t.type="remote"}catch(e){}P.setStreamEndHandler(t,"remote-stream"),F(t,function(e){e.id=t.streamid,void 0!==k&&k.setHandlers(t,!1,P),P.streamEvents[t.streamid]={stream:t,type:"remote",userid:n,extra:P.peers[n]?P.peers[n].extra:{},mediaElement:e,streamid:t.streamid},U(P,P.streamEvents[t.streamid]),P.onstream(P.streamEvents[t.streamid])},P)},j.onRemovingRemoteMedia=function(e,t){var n=(n=P.streamEvents[e.streamid])||{stream:e,type:"remote",userid:t,extra:P.peers[t]?P.peers[t].extra:{},streamid:e.streamid,mediaElement:P.streamEvents[e.streamid]?P.streamEvents[e.streamid].mediaElement:null};P.peersBackup[n.userid]&&(n.extra=P.peersBackup[n.userid].extra),P.onstreamended(n),delete P.streamEvents[e.streamid]},j.onNegotiationNeeded=function(e,t,n){n=n||function(){};var o={remoteUserId:t=t||e.remoteUserId,message:e=e||"",sender:P.userid};e.remoteUserId&&e.message&&e.sender&&(o=e),I(function(){P.socket.emit(P.socketMessageEvent,o,n)})},j.onUserLeft=function(e){P.deletePeer(e)},j.disconnectWith=function(e,t){P.socket&&P.socket.emit("disconnect-with",e,t||function(){}),P.deletePeer(e)},P.socketOptions={transport:"polling"},P.openOrJoin=function(e,r){r=r||function(){},P.checkPresence(e,function(e,t){var n,o,a,i;e?(P.sessionid=t,e=!!P.session.oneway,n=c(P.session),o={OfferToReceiveAudio:P.sdpConstraints.mandatory.OfferToReceiveAudio,OfferToReceiveVideo:P.sdpConstraints.mandatory.OfferToReceiveVideo},a={OfferToReceiveAudio:e?!!P.session.audio:P.sdpConstraints.mandatory.OfferToReceiveAudio,OfferToReceiveVideo:e?!!P.session.video||!!P.session.screen:P.sdpConstraints.mandatory.OfferToReceiveVideo},Pe((i={remoteUserId:P.sessionid,message:{newParticipationRequest:!0,isOneWay:e,isDataOnly:n,localPeerSdpConstraints:a,remotePeerSdpConstraints:o},sender:P.userid}).message,function(){Oe(i,r)})):(P.waitingForLocalMedia=!0,P.isInitiator=!0,P.sessionid=t||P.sessionid,c(P.session)?Me(r):P.captureUserMedia(function(){Me(r)}))})},P.waitingForLocalMedia=!1,P.open=function(e,t){t=t||function(){},P.waitingForLocalMedia=!0,P.isInitiator=!0,P.sessionid=e||P.sessionid,I(function(){c(P.session)?Me(t):P.captureUserMedia(function(){Me(t)})})},P.peersBackup={},P.deletePeer=function(e){if(e&&P.peers[e]){var t={userid:e,extra:P.peers[e]?P.peers[e].extra:{}};if(P.peersBackup[t.userid]&&(t.extra=P.peersBackup[t.userid].extra),P.onleave(t),P.peers[e]){P.peers[e].streams.forEach(function(e){e.stop()});t=P.peers[e].peer;if(t&&"closed"!==t.iceConnectionState)try{t.close()}catch(e){}P.peers[e]&&(P.peers[e].peer=null,delete P.peers[e])}}},P.rejoin=function(e){var t;!P.isInitiator&&e&&Object.keys(e).length&&(t={},P.peers[e.remoteUserId]&&(t=P.peers[e.remoteUserId].extra,P.deletePeer(e.remoteUserId)),e&&e.remoteUserId&&(P.join(e.remoteUserId),P.onReConnecting({userid:e.remoteUserId,extra:t})))},P.join=function(e,t){P.sessionid=!!e&&(e.sessionid||e.remoteUserId||e)||P.sessionid,P.sessionid+="";var n=!1,o=!1,a=!1,i=!1,r=((e&&e.session||!e||"string"==typeof e)&&(a=!!(e=e&&e.session||P.session).oneway,i=c(e),o={OfferToReceiveAudio:P.sdpConstraints.mandatory.OfferToReceiveAudio,OfferToReceiveVideo:P.sdpConstraints.mandatory.OfferToReceiveVideo},n={OfferToReceiveAudio:a?!!P.session.audio:P.sdpConstraints.mandatory.OfferToReceiveAudio,OfferToReceiveVideo:a?!!P.session.video||!!P.session.screen:P.sdpConstraints.mandatory.OfferToReceiveVideo}),function(){}),s=("function"==typeof(t=t||{})&&(r=t,t={}),void 0!==t.localPeerSdpConstraints&&(n=t.localPeerSdpConstraints),void 0!==t.remotePeerSdpConstraints&&(o=t.remotePeerSdpConstraints),void 0!==t.isOneWay&&(a=t.isOneWay),void 0!==t.isDataOnly&&(i=t.isDataOnly),{remoteUserId:P.sessionid,message:{newParticipationRequest:!0,isOneWay:a,isDataOnly:i,localPeerSdpConstraints:n,remotePeerSdpConstraints:o},sender:P.userid});return Pe(s.message,function(){I(function(){Oe(s,r)})}),s},P.publicRoomIdentifier="",P.getUserMedia=P.captureUserMedia=function(o,a){o=o||function(){};var i=a||P.session;P.dontCaptureUserMedia||c(i)?o():(i.audio||i.video||i.screen)&&(i.screen?"Edge"===DetectRTC.browser.name?navigator.getDisplayMedia({video:!0,audio:x(P)}).then(function(e){if(e.isScreen=!0,j.onGettingLocalMedia(e),!i.audio&&!i.video||x(P))o(e);else{var t,n={};for(t in i)"screen"!==t&&(n[t]=i[t]);P.invokeGetUserMedia(a,o,n)}},function(e){console.error("Unable to capture screen on Edge. HTTPs and version 17+ is required.")}):P.getScreenConstraints(function(e,t){if(e)throw e;P.invokeGetUserMedia({audio:!!x(P)&&le(t),video:t,isScreen:!0},function(e){if(!i.audio&&!i.video||x(P))o(e);else{var t,n={};for(t in i)"screen"!==t&&(n[t]=i[t]);P.invokeGetUserMedia(a,o,n)}})}):(i.audio||i.video)&&P.invokeGetUserMedia(a,o,i))},P.onbeforeunload=function(e,t){P.closeBeforeUnload&&(P.peers.getAllParticipants().forEach(function(e){j.onNegotiationNeeded({userLeft:!0},e),P.peers[e]&&P.peers[e].peer&&P.peers[e].peer.close(),delete P.peers[e]}),t||P.closeSocket(),P.isInitiator=!1)},window.ignoreBeforeUnload?P.closeBeforeUnload=!1:(P.closeBeforeUnload=!0,window.addEventListener("beforeunload",P.onbeforeunload,!1)),P.userid=f(),P.changeUserId=function(e,t){t=t||function(){},P.userid=e||f(),P.socket.emit("changed-uuid",P.userid,t)},P.extra={},P.attachStreams=[],P.session={audio:!0,video:!0},P.enableFileSharing=!1,P.bandwidth={screen:!1,audio:!1,video:!1},P.codecs={audio:"opus",video:"VP9"},P.processSdp=function(e){return function(){var t=!1;try{if("undefined"==typeof RTCRtpTransceiver)return;if(!("currentDirection"in RTCRtpTransceiver.prototype))return;var e=new S;try{e.addTransceiver("audio"),t=!0}catch(e){}e.close()}catch(e){t=!1}return t&&function(){var t=!1;try{var e=new S({sdpSemantics:"unified-plan"});try{var n=e.getConfiguration(),t="unified-plan"==n.sdpSemantics||(n.sdpSemantics,!1)}catch(e){t=!1}}catch(e){t=!1}return t}()}()||"Safari"!==DetectRTC.browser.name&&("VP8"===P.codecs.video.toUpperCase()&&(e=E.preferCodec(e,"vp8")),"VP9"===P.codecs.video.toUpperCase()&&(e=E.preferCodec(e,"vp9")),"H264"===P.codecs.video.toUpperCase()&&(e=E.preferCodec(e,"h264")),"G722"===P.codecs.audio&&(e=E.removeNonG722(e)),"Firefox"!==DetectRTC.browser.name&&((P.bandwidth.video||P.bandwidth.screen)&&(e=E.setApplicationSpecificBandwidth(e,P.bandwidth,!!P.session.screen)),P.bandwidth.video&&(e=E.setVideoBitrates(e,{min:8*P.bandwidth.video*1024,max:8*P.bandwidth.video*1024})),P.bandwidth.audio&&(e=E.setOpusAttributes(e,{maxaveragebitrate:8*P.bandwidth.audio*1024,maxplaybackrate:8*P.bandwidth.audio*1024,stereo:1,maxptime:3})))),e},void 0!==E&&(P.BandwidthHandler=P.CodecsHandler=E),P.mediaConstraints={audio:{mandatory:{},optional:P.bandwidth.audio?[{bandwidth:8*P.bandwidth.audio*1024||1048576}]:[]},video:{mandatory:{},optional:P.bandwidth.video?[{bandwidth:8*P.bandwidth.video*1024||1048576},{facingMode:"user"}]:[{facingMode:"user"}]}},"Firefox"===DetectRTC.browser.name&&(P.mediaConstraints={audio:!0,video:!0}),D.useDefaultDevices||DetectRTC.isMobileDevice||DetectRTC.load(function(){var t,n;if(DetectRTC.MediaDevices.forEach(function(e){"audioinput"===e.kind&&!1!==P.mediaConstraints.audio&&(t=e),"videoinput"===e.kind&&!1!==P.mediaConstraints.video&&(n=e)}),t){if("Firefox"===DetectRTC.browser.name)return void(!0!==P.mediaConstraints.audio?P.mediaConstraints.audio.deviceId=t.id:P.mediaConstraints.audio={deviceId:t.id});1==P.mediaConstraints.audio&&(P.mediaConstraints.audio={mandatory:{},optional:[]}),P.mediaConstraints.audio.optional||(P.mediaConstraints.audio.optional=[]);var e=[{sourceId:t.id}];P.mediaConstraints.audio.optional=e.concat(P.mediaConstraints.audio.optional)}n&&("Firefox"===DetectRTC.browser.name?!0!==P.mediaConstraints.video?P.mediaConstraints.video.deviceId=n.id:P.mediaConstraints.video={deviceId:n.id}:(1==P.mediaConstraints.video&&(P.mediaConstraints.video={mandatory:{},optional:[]}),P.mediaConstraints.video.optional||(P.mediaConstraints.video.optional=[]),e=[{sourceId:n.id}],P.mediaConstraints.video.optional=e.concat(P.mediaConstraints.video.optional)))}),P.sdpConstraints={mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0},optional:[{VoiceActivityDetection:!1}]},P.sdpSemantics=null,P.iceCandidatePoolSize=null,P.bundlePolicy=null,P.rtcpMuxPolicy=null,P.iceTransportPolicy=null,P.optionalArgument={optional:[{DtlsSrtpKeyAgreement:!0},{googImprovedWifiBwe:!0},{googScreencastMinBitrate:300},{googIPv6:!0},{googDscp:!0},{googCpuUnderuseThreshold:55},{googCpuOveruseThreshold:85},{googSuspendBelowMinBitrate:!0},{googCpuOveruseDetection:!0}],mandatory:{}},P.iceServers=l(P),P.candidates={host:!0,stun:!0,turn:!0},P.iceProtocols={tcp:!0,udp:!0},P.onopen=function(e){P.enableLogs&&console.info("Data connection has been opened between you & ",e.userid)},P.onclose=function(e){P.enableLogs&&console.warn("Data connection has been closed between you & ",e.userid)},P.onerror=function(e){P.enableLogs&&console.error(e.userid,"data-error",e)},P.onmessage=function(e){P.enableLogs&&console.debug("data-message",e.userid,e.data)},P.send=function(e,t){P.peers.send(e,t)},P.close=P.disconnect=P.leave=function(){P.onbeforeunload(!1,!0)},P.closeEntireSession=function(t){t=t||function(){},P.socket.emit("close-entire-session",function e(){P.getAllParticipants().length?setTimeout(e,100):(P.onEntireSessionClosed({sessionid:P.sessionid,userid:P.userid,extra:P.extra}),P.changeUserId(null,function(){P.close(),t()}))})},P.onEntireSessionClosed=function(e){P.enableLogs&&console.info("Entire session is closed: ",e.sessionid,e.extra)},P.onstream=function(e){var t=P.videosContainer,t=(t.insertBefore(e.mediaElement,t.firstChild),e.mediaElement.play());void 0===t?setTimeout(function(){e.mediaElement.play()},2e3):t.catch(function(){}).then(function(){setTimeout(function(){e.mediaElement.play()},2e3)})},P.onstreamended=function(e){e.mediaElement||(e.mediaElement=document.getElementById(e.streamid)),e.mediaElement&&e.mediaElement.parentNode&&e.mediaElement.parentNode.removeChild(e.mediaElement)},P.direction="many-to-many",P.removeStream=function(t,n){var o;P.attachStreams.forEach(function(e){e.id===t&&(o=e)}),o?(P.peers.getAllParticipants().forEach(function(e){if(!n||e===n){e=P.peers[e];try{e.peer.removeStream(o)}catch(e){}}}),P.renegotiate()):console.warn("No such stream exist.",t)},P.addStream=function(n,t){if(n.getTracks)return-1===P.attachStreams.indexOf(n)&&(n.streamid||(n.streamid=n.id),P.attachStreams.push(n)),void P.renegotiate(t);function o(e){n.streamCallback&&n.streamCallback(e),P.renegotiate(t)}c(n)?P.renegotiate(t):(n.audio||n.video||n.screen)&&(n.screen?"Edge"===DetectRTC.browser.name?navigator.getDisplayMedia({video:!0,audio:x(P)}).then(function(e){e.isScreen=!0,j.onGettingLocalMedia(e),!n.audio&&!n.video||x(P)?o(e):P.invokeGetUserMedia(null,function(e){o(e)})},function(e){console.error("Unable to capture screen on Edge. HTTPs and version 17+ is required.")}):P.getScreenConstraints(function(e,t){if(e)return"PermissionDeniedError"===e?(n.streamCallback&&n.streamCallback(null),void(P.enableLogs&&console.error("User rejected to share his screen."))):alert(e);P.invokeGetUserMedia({audio:!!x(P)&&le(t),video:t,isScreen:!0},function(e){!n.audio&&!n.video||x(P)?o(e):P.invokeGetUserMedia(null,function(e){o(e)})})}):(n.audio||n.video)&&P.invokeGetUserMedia(null,o))},P.invokeGetUserMedia=function(n,o,e){e=e||P.session,we({onGettingLocalMedia:function(e){var t=n.video;t&&(t.mediaSource||t.mozMediaSource||t.mandatory&&t.mandatory.chromeMediaSource)&&(e.isScreen=!0),e.isScreen||(e.isVideo=!!_(e,"video").length,e.isAudio=!e.isVideo&&_(e,"audio").length),j.onGettingLocalMedia(e,function(){"function"==typeof o&&o(e)})},onLocalMediaError:function(e,t){j.onLocalMediaError(e,t)},localMediaConstraints:(n=n||P.mediaConstraints)||{audio:!!e.audio&&n.audio,video:!!e.video&&n.video}})},P.applyConstraints=function(t,e){var n;C&&C.prototype.applyConstraints?e?je(n=P.streamEvents[e]?P.streamEvents[e].stream:n,t):P.attachStreams.forEach(function(e){je(e,t)}):alert("track.applyConstraints is NOT supported in your browser.")},P.replaceTrack=function(n,t,o){if(n=n||{},S.prototype.getSenders)if(n instanceof C)Ne(n,t,o);else{if(n instanceof w)return _(n,"video").length&&Ne(_(n,"video")[0],t,!0),void(_(n,"audio").length&&Ne(_(n,"audio")[0],t,!1));if(c(n))throw"connection.replaceTrack requires audio and/or video and/or screen.";(n.audio||n.video||n.screen)&&(n.screen?"Edge"===DetectRTC.browser.name?navigator.getDisplayMedia({video:!0,audio:x(P)}).then(function(e){e.isScreen=!0,j.onGettingLocalMedia(e),!n.audio&&!n.video||x(P)?a(e):P.invokeGetUserMedia(null,a)},function(e){console.error("Unable to capture screen on Edge. HTTPs and version 17+ is required.")}):P.getScreenConstraints(function(e,t){if(e)return alert(e);P.invokeGetUserMedia({audio:!!x(P)&&le(t),video:t,isScreen:!0},!n.audio&&!n.video||x(P)?a:P.invokeGetUserMedia(null,a))}):(n.audio||n.video)&&P.invokeGetUserMedia(null,a))}else P.addStream(n);function a(e){P.replaceTrack(e,t,o||n.video||n.screen)}},P.resetTrack=function(e,n){(e="string"==typeof(e=e||P.getAllParticipants())?[e]:e).forEach(function(e){var t=P.peers[e].peer;void 0!==n&&!0!==n||!t.lastVideoTrack||P.replaceTrack(t.lastVideoTrack,e,!0),void 0!==n&&!1!==n||!t.lastAudioTrack||P.replaceTrack(t.lastAudioTrack,e,!1)})},P.renegotiate=function(e){e?j.renegotiatePeer(e):P.peers.getAllParticipants().forEach(function(e){j.renegotiatePeer(e)})},P.setStreamEndHandler=function(o,a){var e;o&&o.addEventListener&&(a=!!a,!o.alreadySetEndHandler)&&(o.alreadySetEndHandler=!0,e="ended","oninactive"in o&&(e="inactive"),o.addEventListener(e,function(){o.idInstance&&currentUserMediaRequest.remove(o.idInstance),a||(t=[],P.attachStreams.forEach(function(e){e.id!=o.id&&t.push(e)}),P.attachStreams=t);var e,t,n=(n=P.streamEvents[o.streamid])||{stream:o,streamid:o.streamid,type:a?"remote":"local",userid:P.userid,extra:P.extra,mediaElement:P.streamEvents[o.streamid]?P.streamEvents[o.streamid].mediaElement:null};a&&P.peers[n.userid]&&(e=P.peers[n.userid].peer,t=[],e.getRemoteStreams().forEach(function(e){e.id!=o.id&&t.push(e)}),P.peers[n.userid].streams=t),n.userid===P.userid&&"remote"===n.type||(P.peersBackup[n.userid]&&(n.extra=P.peersBackup[n.userid].extra),P.onstreamended(n),delete P.streamEvents[o.streamid])},!1))},P.onMediaError=function(e,t){P.enableLogs&&console.error(e,t)},P.autoCloseEntireSession=!1,P.filesContainer=P.videosContainer=document.body||document.documentElement,P.isInitiator=!1,P.shareFile=j.shareFile,i.handle(P),t.handle(P),P.token=f,P.onNewParticipant=function(e,t){P.acceptParticipationRequest(e,t)},P.acceptParticipationRequest=function(e,t){t.successCallback&&(t.successCallback(),delete t.successCallback),j.createNewPeer(e,t)},void 0!==k&&(P.StreamsHandler=k),P.onleave=function(e){},P.invokeSelectFileDialog=function(e){var t=new Ue;t.accept="*.*",t.selectSingleFile(e)},P.onmute=function(e){var t;e&&e.mediaElement&&("both"===e.muteType||"video"===e.muteType?(e.mediaElement.src=null,void 0!==(t=e.mediaElement.pause())?t.then(function(){e.mediaElement.poster=e.snapshot||"https://cdn.webrtc-experiment.com/images/muted.png"}):e.mediaElement.poster=e.snapshot||"https://cdn.webrtc-experiment.com/images/muted.png"):"audio"===e.muteType&&(e.mediaElement.muted=!0))},P.onunmute=function(e){e&&e.mediaElement&&e.stream&&("both"===e.unmuteType||"video"===e.unmuteType?(e.mediaElement.poster=null,e.mediaElement.srcObject=e.stream,e.mediaElement.play()):"audio"===e.unmuteType&&(e.mediaElement.muted=!1))},P.onExtraDataUpdated=function(e){e.status="online",P.onUserStatusChanged(e,!0)},P.getAllParticipants=function(e){return P.peers.getAllParticipants(e)},void 0!==k&&(k.onSyncNeeded=function(t,n,o){P.peers.getAllParticipants().forEach(function(e){j.onNegotiationNeeded({streamid:t,action:n,streamSyncNeeded:!0,type:o||"both"},e)})}),P.connectSocket=function(e){I(e)},P.closeSocket=function(){try{De.a.sockets={}}catch(e){}P.socket&&("function"==typeof P.socket.disconnect&&P.socket.disconnect(),"function"==typeof P.socket.resetProps&&P.socket.resetProps(),P.socket=null)},P.getSocket=function(e){return!e&&P.enableLogs&&console.warn("getSocket.callback paramter is required."),e=e||function(){},P.socket?e(P.socket):I(function(){e(P.socket)}),P.socket},P.getRemoteStreams=j.getRemoteStreams,Ae=["selectFirst","selectAll","forEach"],P.streamEvents={selectFirst:function(e){return P.streamEvents.selectAll(e)[0]},selectAll:function(n){"video"==(n="audio"==(n="screen"==(n="remote"==(n="local"==(n=n||{local:!0,remote:!0,isScreen:!0,isAudio:!0,isVideo:!0})?{local:!0}:n)?{remote:!0}:n)?{isScreen:!0}:n)?{isAudio:!0}:n)&&(n={isVideo:!0});var o=[];return Object.keys(P.streamEvents).forEach(function(e){var t=P.streamEvents[e];-1===Ae.indexOf(e)&&(e=!0,n.local&&"local"===t.type&&(e=!1),n.remote&&"remote"===t.type&&(e=!1),n.isScreen&&t.stream.isScreen&&(e=!1),n.isVideo&&t.stream.isVideo&&(e=!1),n.isAudio&&t.stream.isAudio&&(e=!1),!1===(e=n.userid&&t.userid===n.userid?!1:e)&&o.push(t))}),o}},P.socketURL="/",P.socketMessageEvent="RTCMultiConnection-Message",P.socketCustomEvent="RTCMultiConnection-Custom-Message",P.DetectRTC=DetectRTC,P.setCustomSocketEvent=function(e){e&&(P.socketCustomEvent=e),P.socket&&P.socket.emit("set-custom-socket-event-listener",P.socketCustomEvent)},P.getNumberOfBroadcastViewers=function(e,t){P.socket&&e&&t&&P.socket.emit("get-number-of-users-in-specific-broadcast",e,t)},P.onNumberOfBroadcastViewersUpdated=function(e){P.enableLogs&&P.isInitiator&&console.info("Number of broadcast (",e.broadcastId,") viewers",e.numberOfBroadcastViewers)},P.onUserStatusChanged=function(e,t){P.enableLogs&&!t&&console.info(e.userid,e.status)},P.getUserMediaHandler=we,P.multiPeersHandler=j,P.enableLogs=!0,P.setCustomSocketHandler=function(e){void 0!==n&&(n=e)},P.chunkSize=4e4,P.maxParticipantsAllowed=1e3,P.disconnectWith=j.disconnectWith,P.checkPresence=function(e,o){e=e||P.sessionid,"SSEConnection"!==n.name?P.socket?P.socket.emit("check-presence",e+"",function(e,t,n){P.enableLogs&&console.log("checkPresence.isRoomExist: ",e," roomid: ",t),o(e,t,n)}):P.connectSocket(function(){P.checkPresence(e,o)}):SSEConnection.checkPresence(e,function(e,t,n){if(!P.socket)return e||(P.userid=t),void P.connectSocket(function(){o(e,t,n)});o(e,t)})},P.onReadyForOffer=function(e,t){P.multiPeersHandler.createNewPeer(e,t)},P.setUserPreferences=function(e){return P.dontAttachStream&&(e.dontAttachLocalStream=!0),P.dontGetRemoteStream&&(e.dontGetRemoteStream=!0),e},P.updateExtraData=function(){P.socket.emit("extra-data-updated",P.extra)},P.enableScalableBroadcast=!1,P.maxRelayLimitPerUser=3,P.dontCaptureUserMedia=!1,P.dontAttachStream=!1,P.dontGetRemoteStream=!1,P.onReConnecting=function(e){P.enableLogs&&console.info("ReConnecting with",e.userid,"...")},P.beforeAddingStream=function(e){return e},P.beforeRemovingStream=function(e){return e},P.checkIfChromeExtensionAvailable=_e,"undefined"!=typeof isFirefoxExtensionAvailable&&(P.checkIfChromeExtensionAvailable=isFirefoxExtensionAvailable),P.getChromeExtensionStatus=Te,P.getScreenConstraints=function(n,e){x(P,e)&&(e=!0);var o,a=function(e,t){e||(t=P.modifyScreenConstraints(t),n(e,t))};Se?a(null,{mozMediaSource:"window",mediaSource:"window"}):(o={mandatory:{chromeMediaSource:R,maxWidth:1920<screen.width?screen.width:1920,maxHeight:1080<screen.height?screen.height:1080},optional:[]},"desktop"!=R||O?("desktop"==R&&(o.mandatory.chromeMediaSourceId=O),a(null,o)):e?(e=function(e,t){o.mandatory.chromeMediaSourceId=e,t&&(o.canRequestAudioTrack=!0),a("PermissionDeniedError"==e?e:null,o)},O?e(O):(M=e,window.postMessage("audio-plus-tab","*"))):(e=function(e){o.mandatory.chromeMediaSourceId=e,a("PermissionDeniedError"==e?e:null,o)},O?e(O):(M=e,window.postMessage("get-sourceId","*"))))},P.modifyScreenConstraints=function(e){return e},P.onPeerStateChanged=function(e){P.enableLogs&&-1!==e.iceConnectionState.search(/closed|failed/gi)&&console.error("Peer connection is closed between you & ",e.userid,e.extra,"state:",e.iceConnectionState)},P.isOnline=!0,G("online",function(){P.isOnline=!0}),G("offline",function(){P.isOnline=!1}),P.isLowBandwidth=!1,navigator&&navigator.connection&&navigator.connection.type&&(P.isLowBandwidth=-1!==navigator.connection.type.toString().toLowerCase().search(/wifi|cell/g),P.isLowBandwidth)&&(P.bandwidth={audio:!1,video:!1,screen:!1},P.mediaConstraints.audio&&P.mediaConstraints.audio.optional&&P.mediaConstraints.audio.optional.length&&(N=[],P.mediaConstraints.audio.optional.forEach(function(e){void 0===e.bandwidth&&N.push(e)}),P.mediaConstraints.audio.optional=N),P.mediaConstraints.video&&P.mediaConstraints.video.optional&&P.mediaConstraints.video.optional.length&&(N=[],P.mediaConstraints.video.optional.forEach(function(e){void 0===e.bandwidth&&N.push(e)}),P.mediaConstraints.video.optional=N)),P.getExtraData=function(e,o){if(!e)throw"remoteUserId is required.";if(!o)return P.peers[e]?P.peers[e].extra:P.peersBackup[e]?P.peersBackup[e].extra:{};P.socket.emit("get-remote-user-extra-data",e,function(e,t,n){o(e,t,n)})},D.autoOpenOrJoin&&P.openOrJoin(P.sessionid),P.onUserIdAlreadyTaken=function(e,t){P.close(),P.closeSocket(),P.isInitiator=!1,P.userid=P.token(),P.join(P.sessionid),P.enableLogs&&console.warn("Userid already taken.",e,"Your new userid:",P.userid)},P.trickleIce=!0,P.version="3.6.5",P.onSettingLocalDescription=function(e){P.enableLogs&&console.info("Set local description for remote user",e.userid)},P.resetScreen=function(){O=null,DetectRTC&&DetectRTC.screen&&delete DetectRTC.screen.sourceId,currentUserMediaRequest={streams:[],mutex:!1,queueRequests:[]}},P.autoCreateMediaElement=!0,P.password=null,P.setPassword=function(e,t){t=t||function(){},P.socket?P.socket.emit("set-password",e,t):(P.password=e,t(!0,P.sessionid,null))},P.errors={ROOM_NOT_AVAILABLE:"Room not available",INVALID_PASSWORD:"Invalid password",USERID_NOT_AVAILABLE:"User ID does not exist",ROOM_PERMISSION_DENIED:"Room permission denied",ROOM_FULL:"Room full",DID_NOT_JOIN_ANY_ROOM:"Did not join any room yet",INVALID_SOCKET:"Invalid socket",PUBLIC_IDENTIFIER_MISSING:"publicRoomIdentifier is required",INVALID_ADMIN_CREDENTIAL:"Invalid username or password attempted"}}}.call(this,Ge(73).Buffer,Ge(31),Ge(49))},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,function(e,t,n){(t=e.exports=n(367)(!1)).push([e.i,"@keyframes ejs--c2532bfe04554193cc42b3be753700{0%{opacity:0.5;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes ejs--7cadf43f3d9eb17c7e3c36de84973b{from{opacity:0}to{opacity:1}}@keyframes ejs--9bd947b3e6427453595f083d740a7c{from{}to{box-shadow:1px 3px 15px 8px #222,0px 7px 10px 0px #111,inset 0px 0px 1px 0px rgba(250,250,250,0.2),inset 8px 5px 35px 0px rgba(0,0,0,0.5)}}:root{--ejs-primary-color: 26, 175, 255}.ejs--de6433374cb30211f10e148b320b2f{height:100%}.ejs--7a5f920ceffb2913f6dbda780573cf{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;height:100%;width:100%;direction:ltr;font-family:Avenir,\"Avenir Next\",\"Helvetica Neue\",\"Segoe UI\",Helvetica,Arial,sans-serif;font-size:14px;font-variant-numeric:tabular-nums;font-weight:500;line-height:1.7;max-width:100%;min-width:200px;position:relative;text-shadow:none;transition:box-shadow 0.3s ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ejs--7a5f920ceffb2913f6dbda780573cf a{color:#ddd;text-decoration:none}.ejs--7a5f920ceffb2913f6dbda780573cf button{font:inherit;line-height:inherit;width:auto}.ejs--7a5f920ceffb2913f6dbda780573cf ul{list-style:none;margin:0;padding:0}.ejs--7a5f920ceffb2913f6dbda780573cf:focus{outline:0}.ejs--7a5f920ceffb2913f6dbda780573cf *{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ejs--f3a002bba9836fe4ebfed357a45521{box-sizing:border-box}.ejs--f3a002bba9836fe4ebfed357a45521 *,.ejs--f3a002bba9836fe4ebfed357a45521 *::after,.ejs--f3a002bba9836fe4ebfed357a45521 *::before{box-sizing:inherit}.ejs--f3a002bba9836fe4ebfed357a45521 a,.ejs--f3a002bba9836fe4ebfed357a45521 button,.ejs--f3a002bba9836fe4ebfed357a45521 input,.ejs--f3a002bba9836fe4ebfed357a45521 label{touch-action:manipulation}.ejs--008adea3c1ef33a8fc94892a1e97e6 li{display:inline-block;background:#fff;border:1px solid #ccc;font-size:12px}.ejs--008adea3c1ef33a8fc94892a1e97e6 li a{color:#000}.ejs--85a95eb6bf74a40ab61b91a91e5bff{position:absolute;width:100%;height:100%;top:0;z-index:9999;background:rgba(0,0,0,0.3) !important;color:#fff;text-align:center}.ejs--d169a219343bc32dd4aecc3f6b7f25{position:absolute;width:300px;top:50%;margin-left:-150px;margin-top:-50px;left:50%;background:rgba(0,0,0,0.8) !important;padding:15px 0}.ejs--782e3572812f983b3a150eec177391{text-align:center;font-size:13px}.ejs--c426dd1d179aa351e6cec47e1d9438,.ejs--31e7e81db48819ee35ec6f50378a2e,.ejs--20d4eb2646d396f558a645dc0574f1,.ejs--4de05306c8b099bdeb4585571ac095{font-size:12px}.ejs--c7957d8666bb6b8fc7c3e9c021aaf8{background:rgba(16,16,16,0.9);border-radius:3px;font-size:13px;min-width:180px;padding:8px}.ejs--c7957d8666bb6b8fc7c3e9c021aaf8 li{padding:4px 11px;text-align:center}.ejs--c7957d8666bb6b8fc7c3e9c021aaf8 li a{color:#999;display:block;font-size:13px}.ejs--c7957d8666bb6b8fc7c3e9c021aaf8 li:hover{background:rgba(var(--ejs-primary-color), 1);border-radius:4px;box-shadow:0 0 0 5px rgba(var(--ejs-primary-color), 0.5);outline:0}.ejs--c7957d8666bb6b8fc7c3e9c021aaf8 li:hover a{color:#fff}.ejs--c7957d8666bb6b8fc7c3e9c021aaf8 li:last-child{border:0}.ejs--cbcfe0a1421cadac9a04c81d6431d6{display:block !important;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.ejs--cbcfe0a1421cadac9a04c81d6431d6 .ejs--f3a1903d935f6cf720d4a0498db62a:after{content:\"\";position:absolute;border-left:20px solid transparent;border-right:20px solid #a7a7a77d;border-top:20px solid #a7a7a77d;border-bottom:20px solid transparent;right:0}.ejs--cbcfe0a1421cadac9a04c81d6431d6 .ejs--f3a1903d935f6cf720d4a0498db62a a{right:4px;top:4px;position:absolute;border:none;padding:0;width:15px;height:15px;z-index:99}.ejs--cbcfe0a1421cadac9a04c81d6431d6 .ejs--f3a1903d935f6cf720d4a0498db62a a:before{content:\"\";border-bottom:1px solid #fff;transform:rotate(45deg) translateY(-45%);width:15px;height:15px;display:block;position:absolute;top:0;right:0}.ejs--cbcfe0a1421cadac9a04c81d6431d6 .ejs--f3a1903d935f6cf720d4a0498db62a a:after{content:\"\";border-bottom:1px solid #fff;width:15px;height:15px;display:block;position:absolute;right:0;background:transparent;top:0;transform:rotate(-45deg) translateY(-50%) translateX(0%)}a.ejs--73f9b4e94a7a1fe74e11107d5ab2ef{display:flex;justify-content:center;text-shadow:0px 1px 1px rgba(0,0,0,0.5);font-size:20px;line-height:45px;text-transform:uppercase;font-weight:bolder;position:relative;text-decoration:none;width:200px;height:45px;border:0;color:#fff !important;border-radius:35px;text-align:center;background-color:rgba(var(--ejs-primary-color), 1)}a.ejs--73f9b4e94a7a1fe74e11107d5ab2ef:active{box-shadow:0px 0px 0px 0px #222,0px 3px 7px 0px #111,inset 0px 1px 1px 0px rgba(250,250,250,0.2),inset 0px -10px 35px 5px rgba(0,0,0,0.5);top:1px}a.ejs--73f9b4e94a7a1fe74e11107d5ab2ef:hover{animation:ejs--9bd947b3e6427453595f083d740a7c 1.2s linear infinite alternate}.ejs--8732295ca5c4902a060d34706a8146{background:transparent;border:0;border-radius:3px;color:inherit;cursor:pointer;flex-shrink:0;overflow:visible;padding:7px;position:relative;transition:all 0.3s ease}.ejs--8732295ca5c4902a060d34706a8146 svg{display:block;fill:currentColor;height:18px;pointer-events:none;width:18px}.ejs--8732295ca5c4902a060d34706a8146:focus{outline:0}.ejs--8732295ca5c4902a060d34706a8146.ejs--a83b6c705e103e81a7762d0ed5e64b{box-shadow:0 0 0 5px rgba(var(--ejs-primary-color), 0.5);outline:0}.ejs--8732295ca5c4902a060d34706a8146:not(.ejs--b1238136ec472a92297159882cf4b8) .ejs--ec731619062226d943da67f5d83009,.ejs--8732295ca5c4902a060d34706a8146.ejs--b1238136ec472a92297159882cf4b8 .ejs--dc7068585e3d84fe0e676864c1439e,.ejs--8732295ca5c4902a060d34706a8146:not(.ejs--b1238136ec472a92297159882cf4b8) .ejs--0c6561f9155750b0aeeed6da5da7bf,.ejs--8732295ca5c4902a060d34706a8146.ejs--b1238136ec472a92297159882cf4b8 .ejs--13d64e30c1333cc99391af48ddabaa{display:none}.ejs--d5f430a99a1619b3434bf58e34a99c .ejs--8732295ca5c4902a060d34706a8146 svg{filter:drop-shadow(0 1px 1px rgba(0,0,0,0.15))}.ejs--d5f430a99a1619b3434bf58e34a99c .ejs--8732295ca5c4902a060d34706a8146.ejs--a83b6c705e103e81a7762d0ed5e64b,.ejs--d5f430a99a1619b3434bf58e34a99c .ejs--8732295ca5c4902a060d34706a8146:hover,.ejs--d5f430a99a1619b3434bf58e34a99c .ejs--8732295ca5c4902a060d34706a8146[aria-expanded='true']{background:rgba(var(--ejs-primary-color), 1);color:#fff}.ejs--d5f430a99a1619b3434bf58e34a99c .ejs--8732295ca5c4902a060d34706a8146[disabled],.ejs--d5f430a99a1619b3434bf58e34a99c .ejs--8732295ca5c4902a060d34706a8146[disabled]:hover{background:transparent;color:#4b4b4b}.ejs--f3a002bba9836fe4ebfed357a45521 ::-webkit-media-controls{display:none}.ejs--1acedc5ed6816abe96dd27d910fd74{align-items:center;display:flex;justify-content:flex-start;text-align:center}.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146,.ejs--1acedc5ed6816abe96dd27d910fd74 .ejs--f1aa376719b564cae0e653157cde14,.ejs--1acedc5ed6816abe96dd27d910fd74 .ejs--90d2780f99bcc76fdb6b0378a7238e,.ejs--1acedc5ed6816abe96dd27d910fd74 .ejs--c7bfb2d1b75a40fdaaf90624bea9e7,.ejs--1acedc5ed6816abe96dd27d910fd74 .ejs--36ceeeec0df37a9cf4bbe05fa204ec{margin-left:5px}.ejs--1acedc5ed6816abe96dd27d910fd74 .ejs--c7bfb2d1b75a40fdaaf90624bea9e7+.ejs--8732295ca5c4902a060d34706a8146,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146+.ejs--c7bfb2d1b75a40fdaaf90624bea9e7,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146+.ejs--8732295ca5c4902a060d34706a8146,.ejs--1acedc5ed6816abe96dd27d910fd74 .ejs--f1aa376719b564cae0e653157cde14+.ejs--8732295ca5c4902a060d34706a8146{margin-left:2px}.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child+[data-btn='pause']{margin-left:0}.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child+[data-btn='netplay']{margin-right:auto}.ejs--1acedc5ed6816abe96dd27d910fd74:empty{display:none}@media (min-width: 480px){.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146,.ejs--1acedc5ed6816abe96dd27d910fd74 .ejs--c7bfb2d1b75a40fdaaf90624bea9e7,.ejs--1acedc5ed6816abe96dd27d910fd74 .ejs--f1aa376719b564cae0e653157cde14,.ejs--1acedc5ed6816abe96dd27d910fd74 .ejs--90d2780f99bcc76fdb6b0378a7238e,.ejs--1acedc5ed6816abe96dd27d910fd74 .ejs--36ceeeec0df37a9cf4bbe05fa204ec{margin-left:10px}}.ejs--d5f430a99a1619b3434bf58e34a99c .ejs--1acedc5ed6816abe96dd27d910fd74{background:linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.7));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;bottom:0;color:#fff;left:0;padding:20px 5px 5px;position:absolute;right:0;transition:opacity 0.4s ease-in-out, transform 0.4s ease-in-out;z-index:3}@media (min-width: 480px){.ejs--d5f430a99a1619b3434bf58e34a99c .ejs--1acedc5ed6816abe96dd27d910fd74{padding:15px 10px 10px}}.ejs--d5f430a99a1619b3434bf58e34a99c.ejs--1b8cb7f2294b1eb5de5238daea3513 .ejs--1acedc5ed6816abe96dd27d910fd74{opacity:0;pointer-events:none;transform:translateY(100%)}.ejs--7a5f920ceffb2913f6dbda780573cf [data-btn='fullscreen']{display:none}.ejs--19409fe2057ab935a7e46abb5b4f49 [data-btn='fullscreen']{display:inline-block}.ejs--c7bfb2d1b75a40fdaaf90624bea9e7{display:flex;position:relative}.ejs--c7bfb2d1b75a40fdaaf90624bea9e7 .ejs--8732295ca5c4902a060d34706a8146 svg{transition:transform 0.3s ease}.ejs--c7bfb2d1b75a40fdaaf90624bea9e7 .ejs--8732295ca5c4902a060d34706a8146[aria-expanded='true'] svg{transform:rotate(90deg)}.ejs--c7bfb2d1b75a40fdaaf90624bea9e7 .ejs--8732295ca5c4902a060d34706a8146[aria-expanded='true'] .ejs--74c6d4176d27e37a19d2e9e61de8f4{display:none}.ejs--013213afedeeb6878089b1ca1b4e47{animation:ejs--c2532bfe04554193cc42b3be753700 0.2s ease;background:rgba(16,16,16,0.9);border-radius:4px;bottom:100%;box-shadow:0 1px 2px rgba(0,0,0,0.15);color:#4f5b5f;font-size:16px;margin-bottom:10px;position:absolute;right:-3px;text-align:left;white-space:nowrap;z-index:3}.ejs--013213afedeeb6878089b1ca1b4e47>div{overflow:hidden;transition:height 0.35s cubic-bezier(0.4, 0, 0.2, 1),width 0.35s cubic-bezier(0.4, 0, 0.2, 1)}.ejs--013213afedeeb6878089b1ca1b4e47::after{border:4px solid transparent;border-top-color:rgba(16,16,16,0.9);content:'';height:0;position:absolute;right:15px;top:100%;width:0}.ejs--013213afedeeb6878089b1ca1b4e47 [role='menu']{padding:7px}.ejs--013213afedeeb6878089b1ca1b4e47 [role='menuitem'],.ejs--013213afedeeb6878089b1ca1b4e47 [role='menuitemradio']{margin-top:2px}.ejs--013213afedeeb6878089b1ca1b4e47 [role='menuitem']:first-child,.ejs--013213afedeeb6878089b1ca1b4e47 [role='menuitemradio']:first-child{margin-top:0}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--8732295ca5c4902a060d34706a8146{align-items:center;color:#999;display:flex;font-size:13px;padding:4px 11px;user-select:none;width:100%}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--8732295ca5c4902a060d34706a8146>span{align-items:inherit;display:flex;width:100%}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--8732295ca5c4902a060d34706a8146::after{border:4px solid transparent;content:'';position:absolute;top:50%;transform:translateY(-50%)}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--0b4cdb4057d1a4623e60836ccc6275{padding-right:28px}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--0b4cdb4057d1a4623e60836ccc6275::after{border-left-color:rgba(79,91,95,0.8);right:5px}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--0b4cdb4057d1a4623e60836ccc6275.ejs--a83b6c705e103e81a7762d0ed5e64b::after,.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--0b4cdb4057d1a4623e60836ccc6275:hover::after{border-left-color:currentColor}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--a7ad9de0cb0ca672b6703c50de7db9{font-weight:500;margin:7px;margin-bottom:3px;padding-left:28px;position:relative;width:calc(100% - 14px)}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--a7ad9de0cb0ca672b6703c50de7db9::after{border-right-color:rgba(79,91,95,0.8);left:7px}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--a7ad9de0cb0ca672b6703c50de7db9::before{background:#b7c5cd;box-shadow:0 1px 0 #fff;content:'';height:1px;left:0;margin-top:4px;overflow:hidden;position:absolute;right:0;top:100%}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--a7ad9de0cb0ca672b6703c50de7db9.ejs--a83b6c705e103e81a7762d0ed5e64b::after,.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--a7ad9de0cb0ca672b6703c50de7db9:hover::after{border-right-color:currentColor}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--8732295ca5c4902a060d34706a8146[role='menuitemradio']{padding-left:7px}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--8732295ca5c4902a060d34706a8146[role='menuitemradio']::before,.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--8732295ca5c4902a060d34706a8146[role='menuitemradio']::after{border-radius:100%}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--8732295ca5c4902a060d34706a8146[role='menuitemradio']::before{background:rgba(204,204,204,0.1);content:'';display:block;flex-shrink:0;height:16px;margin-right:10px;transition:all 0.3s ease;width:16px}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--8732295ca5c4902a060d34706a8146[role='menuitemradio']::after{background:#fff;border:0;height:6px;left:12px;opacity:0;top:50%;transform:translateY(-50%) scale(0);transition:transform 0.3s ease, opacity 0.3s ease;width:6px}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--8732295ca5c4902a060d34706a8146[role='menuitemradio'][aria-checked='true']::before{background:rgba(var(--ejs-primary-color), 1)}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--8732295ca5c4902a060d34706a8146[role='menuitemradio'][aria-checked='true']::after{opacity:1;transform:translateY(-50%) scale(1)}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--8732295ca5c4902a060d34706a8146[role='menuitemradio'].ejs--a83b6c705e103e81a7762d0ed5e64b::before,.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--8732295ca5c4902a060d34706a8146[role='menuitemradio']:hover::before{background:rgba(0,0,0,0.1)}.ejs--013213afedeeb6878089b1ca1b4e47 .ejs--f91e90fe7cabc875aff9a431bf5389{align-items:center;display:flex;margin-left:auto;margin-right:-5px;overflow:hidden;padding-left:25px;pointer-events:none}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']{-webkit-appearance:none;background:transparent;border:0;border-radius:28px;color:rgba(var(--ejs-primary-color), 1);display:block;height:20px;margin:0;padding:0;transition:box-shadow 0.3s ease;width:100%}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']::-webkit-slider-runnable-track{background:transparent;border:0;border-radius:3px;height:6px;transition:box-shadow 0.3s ease;user-select:none;background-image:linear-gradient(to right, currentColor var(--value, 0%), transparent var(--value, 0%))}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']::-webkit-slider-thumb{background:#fff;border:0;border-radius:100%;box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2);height:14px;position:relative;transition:all 0.2s ease;width:14px;-webkit-appearance:none;margin-top:-4px}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']::-moz-range-track{background:transparent;border:0;border-radius:3px;height:6px;transition:box-shadow 0.3s ease;user-select:none}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']::-moz-range-thumb{background:#fff;border:0;border-radius:100%;box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2);height:14px;position:relative;transition:all 0.2s ease;width:14px}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']::-moz-range-progress{background:currentColor;border-radius:3px;height:6px}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']::-ms-track{background:transparent;border:0;border-radius:3px;height:6px;transition:box-shadow 0.3s ease;user-select:none;color:transparent}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']::-ms-fill-upper{background:transparent;border:0;border-radius:3px;height:6px;transition:box-shadow 0.3s ease;user-select:none}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']::-ms-fill-lower{background:transparent;border:0;border-radius:3px;height:6px;transition:box-shadow 0.3s ease;user-select:none;background:currentColor}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']::-ms-thumb{background:#fff;border:0;border-radius:100%;box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2);height:14px;position:relative;transition:all 0.2s ease;width:14px;margin-top:0}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']::-ms-tooltip{display:none}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']:focus{outline:0}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range']::-moz-focus-outer{border:0}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range'].ejs--a83b6c705e103e81a7762d0ed5e64b::-webkit-slider-runnable-track{box-shadow:0 0 0 5px rgba(var(--ejs-primary-color), 0.5);outline:0}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range'].ejs--a83b6c705e103e81a7762d0ed5e64b::-moz-range-track{box-shadow:0 0 0 5px rgba(var(--ejs-primary-color), 0.5);outline:0}.ejs--f3a002bba9836fe4ebfed357a45521 input[type='range'].ejs--a83b6c705e103e81a7762d0ed5e64b::-ms-track{box-shadow:0 0 0 5px rgba(var(--ejs-primary-color), 0.5);outline:0}.ejs--f3a002bba9836fe4ebfed357a45521.ejs--d5f430a99a1619b3434bf58e34a99c input[type='range']::-webkit-slider-runnable-track{background-color:rgba(255,255,255,0.25)}.ejs--f3a002bba9836fe4ebfed357a45521.ejs--d5f430a99a1619b3434bf58e34a99c input[type='range']::-moz-range-track{background-color:rgba(255,255,255,0.25)}.ejs--f3a002bba9836fe4ebfed357a45521.ejs--d5f430a99a1619b3434bf58e34a99c input[type='range']::-ms-track{background-color:rgba(255,255,255,0.25)}.ejs--f3a002bba9836fe4ebfed357a45521.ejs--d5f430a99a1619b3434bf58e34a99c input[type='range']:active::-webkit-slider-thumb{box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2),0 0 0 3px rgba(255,255,255,0.5)}.ejs--f3a002bba9836fe4ebfed357a45521.ejs--d5f430a99a1619b3434bf58e34a99c input[type='range']:active::-moz-range-thumb{box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2),0 0 0 3px rgba(255,255,255,0.5)}.ejs--f3a002bba9836fe4ebfed357a45521.ejs--d5f430a99a1619b3434bf58e34a99c input[type='range']:active::-ms-thumb{box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2),0 0 0 3px rgba(255,255,255,0.5)}.ejs--90d2780f99bcc76fdb6b0378a7238e{font-size:14px}.ejs--90d2780f99bcc76fdb6b0378a7238e+.ejs--90d2780f99bcc76fdb6b0378a7238e::before{content:'„4';margin-right:10px}@media (max-width: 767px){.ejs--90d2780f99bcc76fdb6b0378a7238e+.ejs--90d2780f99bcc76fdb6b0378a7238e{display:none}}.ejs--d5f430a99a1619b3434bf58e34a99c .ejs--90d2780f99bcc76fdb6b0378a7238e{text-shadow:0 1px 1px rgba(0,0,0,0.15)}.ejs--74c6d4176d27e37a19d2e9e61de8f4{background:rgba(255,255,255,0.9);border-radius:3px;bottom:100%;box-shadow:0 1px 2px rgba(0,0,0,0.15);color:#4f5b5f;font-size:14px;font-weight:500;left:50%;line-height:1.3;margin-bottom:10px;opacity:0;padding:5px 7.5px;pointer-events:none;position:absolute;transform:translate(-50%, 10px) scale(0.8);transform-origin:50% 100%;transition:transform 0.2s 0.1s ease, opacity 0.2s 0.1s ease;white-space:nowrap;z-index:2}.ejs--74c6d4176d27e37a19d2e9e61de8f4::before{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(255,255,255,0.9);bottom:-4px;content:'';height:0;left:50%;position:absolute;transform:translateX(-50%);width:0;z-index:2}.ejs--7a5f920ceffb2913f6dbda780573cf .ejs--8732295ca5c4902a060d34706a8146:hover .ejs--74c6d4176d27e37a19d2e9e61de8f4,.ejs--7a5f920ceffb2913f6dbda780573cf .ejs--8732295ca5c4902a060d34706a8146.ejs--a83b6c705e103e81a7762d0ed5e64b .ejs--74c6d4176d27e37a19d2e9e61de8f4,.ejs--6ea27aa07e60d1d6e4c9782740028a{opacity:1;transform:translate(-50%, 0) scale(1)}.ejs--7a5f920ceffb2913f6dbda780573cf .ejs--8732295ca5c4902a060d34706a8146:hover .ejs--74c6d4176d27e37a19d2e9e61de8f4{z-index:3}.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child .ejs--74c6d4176d27e37a19d2e9e61de8f4,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child+.ejs--8732295ca5c4902a060d34706a8146 .ejs--74c6d4176d27e37a19d2e9e61de8f4{left:0;transform:translate(0, 10px) scale(0.8);transform-origin:0 100%}.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child .ejs--74c6d4176d27e37a19d2e9e61de8f4::before,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child+.ejs--8732295ca5c4902a060d34706a8146 .ejs--74c6d4176d27e37a19d2e9e61de8f4::before{left:16px}.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:last-child .ejs--74c6d4176d27e37a19d2e9e61de8f4{left:auto;right:0;transform:translate(0, 10px) scale(0.8);transform-origin:100% 100%}.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:last-child .ejs--74c6d4176d27e37a19d2e9e61de8f4::before{left:auto;right:16px;transform:translateX(50%)}.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child:hover .ejs--74c6d4176d27e37a19d2e9e61de8f4,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child.ejs--a83b6c705e103e81a7762d0ed5e64b .ejs--74c6d4176d27e37a19d2e9e61de8f4,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child .ejs--6ea27aa07e60d1d6e4c9782740028a,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child+.ejs--8732295ca5c4902a060d34706a8146:hover .ejs--74c6d4176d27e37a19d2e9e61de8f4,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child+.ejs--8732295ca5c4902a060d34706a8146.ejs--a83b6c705e103e81a7762d0ed5e64b .ejs--74c6d4176d27e37a19d2e9e61de8f4,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:first-child+.ejs--8732295ca5c4902a060d34706a8146 .ejs--6ea27aa07e60d1d6e4c9782740028a,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:last-child:hover .ejs--74c6d4176d27e37a19d2e9e61de8f4,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:last-child.ejs--a83b6c705e103e81a7762d0ed5e64b .ejs--74c6d4176d27e37a19d2e9e61de8f4,.ejs--1acedc5ed6816abe96dd27d910fd74>.ejs--8732295ca5c4902a060d34706a8146:last-child .ejs--6ea27aa07e60d1d6e4c9782740028a{transform:translate(0, 0) scale(1)}.ejs--d5f430a99a1619b3434bf58e34a99c{background:#000;color:#bcbcbc;overflow:hidden}.ejs--d5f430a99a1619b3434bf58e34a99c.ejs--da54136ccf8c6b0b16d98e8b8e8b88{overflow:visible}.ejs--057800d021995e1347ec07cb748672{background:#333;border-radius:inherit;height:100%;overflow:hidden;position:relative;text-align:center;z-index:0}.ejs--057800d021995e1347ec07cb748672>*{height:100% !important}.ejs--057800d021995e1347ec07cb748672 canvas{height:100% !important;width:auto !important;max-width:100% !important}.ejs--64f1256f556fb94454b930cb3ea7f2 .ejs--057800d021995e1347ec07cb748672 canvas{height:auto !important;width:100% !important}.ejs--7da7949f602347007818e6d192eb23 .ejs--057800d021995e1347ec07cb748672{background-color:transparent}.ejs--f1aa376719b564cae0e653157cde14{flex:1;left:7px;margin-right:14px;position:relative}.ejs--f1aa376719b564cae0e653157cde14 input[type='range'],.ejs--f8d706413436fd119cf01aaf5a9d9d{margin-left:-7px;margin-right:-7px;width:calc(100% + 14px)}.ejs--f1aa376719b564cae0e653157cde14 input[type='range']{position:relative;z-index:2}.ejs--f1aa376719b564cae0e653157cde14 .ejs--74c6d4176d27e37a19d2e9e61de8f4{font-size:14px;left:0}.ejs--f8d706413436fd119cf01aaf5a9d9d{-webkit-appearance:none;background:transparent;border:0;border-radius:100px;height:6px;left:0;margin-top:-3px;padding:0;position:absolute;top:50%}.ejs--f8d706413436fd119cf01aaf5a9d9d::-webkit-progress-bar{background:transparent;transition:width 0.2s ease}.ejs--f8d706413436fd119cf01aaf5a9d9d::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:6px}.ejs--f8d706413436fd119cf01aaf5a9d9d::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:6px;transition:width 0.2s ease}.ejs--f8d706413436fd119cf01aaf5a9d9d::-ms-fill{border-radius:100px;transition:width 0.2s ease}.ejs--d5f430a99a1619b3434bf58e34a99c .ejs--f8d706413436fd119cf01aaf5a9d9d{box-shadow:0 1px 1px rgba(0,0,0,0.15);color:rgba(255,255,255,0.25)}.ejs--bd0222e58d71b0a304d6037dfcffd5 .ejs--f8d706413436fd119cf01aaf5a9d9d{color:rgba(183,197,205,0.66)}.ejs--d5f430a99a1619b3434bf58e34a99c.ejs--2521e1257996f264de36e77cc9c5ee .ejs--f8d706413436fd119cf01aaf5a9d9d{background-color:rgba(255,255,255,0.25)}.ejs--bd0222e58d71b0a304d6037dfcffd5.ejs--2521e1257996f264de36e77cc9c5ee .ejs--f8d706413436fd119cf01aaf5a9d9d{background-color:rgba(183,197,205,0.66)}.ejs--36ceeeec0df37a9cf4bbe05fa204ec{max-width:120px;align-items:center;display:flex;flex:1;position:relative}.ejs--36ceeeec0df37a9cf4bbe05fa204ec input[type='range']{margin-left:5px;position:relative;z-index:2}@media (min-width: 480px){.ejs--36ceeeec0df37a9cf4bbe05fa204ec{max-width:90px}}@media (min-width: 768px){.ejs--36ceeeec0df37a9cf4bbe05fa204ec{max-width:110px}}.ejs--d31688f864f56d6426ebbf2217d6ee{height:100%;overflow:hidden;position:absolute;top:0;width:100%}.ejs--5e71fd80268afbb1d588e40b993508{background:rgba(0,0,0,0.8);height:100%;overflow:auto;position:relative;text-align:center;z-index:9999}.ejs--5e71fd80268afbb1d588e40b993508 h4{color:#ccc;font-size:24px;margin:0;padding:10px}.ejs--1e0f0672f67d0e96592314c9ed78b0{display:block}.ejs--d7e6a6a8f38bfaa256fe5d709a8258{background:transparent;display:block;position:absolute;top:0;width:100%;z-index:10001}.ejs--b183f581b5336c4908ad258d3e1cc7{display:block}.ejs--b183f581b5336cashrqd258d3e1cc7{display:block}.ejs--158ea9dd34e3e7af2d837f8b05babb{display:block}.ejs--3f0897a8158ba363a0ee0afe4da7c5{display:block}.ejs--38cc09882a55e98c76168dbe838aa0{height:100%;margin:0 auto;max-width:800px;overflow:hidden;position:relative;width:100%}.ejs--3f0897a8158ba363a0ee0afe4da7c5 input[type='text']{background-color:#fff;border:1px solid #000;font-size:12px;font-weight:700}.ejs--f3a002bba9836fe4ebfed357a45521 ::-webkit-scrollbar{width:8px;height:16px;background-color:transparent}.ejs--f3a002bba9836fe4ebfed357a45521 ::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.3);border-radius:10px;background-color:transparent}.ejs--f3a002bba9836fe4ebfed357a45521 ::-webkit-scrollbar-thumb{border-radius:0;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.3);background-color:#f5f5f5}.ejs--f3a002bba9836fe4ebfed357a45521{scrollbar-face-color:#F5F5F5;scrollbar-highlight-color:transparent;scrollbar-3dlight-color:transparent;scrollbar-darkshadow-color:transparent;scrollbar-Shadow-color:transparent;scrollbar-arrow-color:#fff;scrollbar-track-color:transparent;scrollbar-width:thin;scrollbar-color:transparent #f5f5f5}.ejs--5e71fd80268afbb1d588e40b993508 *{color:#bcbcbc !important;border:unset}.ejs--5e71fd80268afbb1d588e40b993508 a:focus{background:inherit}.ejs--5e71fd80268afbb1d588e40b993508 input,.ejs--5e71fd80268afbb1d588e40b993508 textarea{color:#000 !important}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--b373c9d5029d49324fb8ac3ece96c1{float:none}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--a5e2629abb9a5bcbc8b2c1307922d2{height:calc(100% - 130px);overflow:auto}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--a5e2629abb9a5bcbc8b2c1307922d2 a{border:none}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--580e3c22e63f8a1eb29694fd0b141b{margin-top:10px}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--580e3c22e63f8a1eb29694fd0b141b a{border-radius:.25rem;font-size:.875rem;padding-left:1rem;padding-right:1rem;padding-top:.5rem;padding-bottom:.5rem;display:inline-block;background-color:rgba(var(--ejs-primary-color), 1);margin:0 10px;color:#fff !important}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--580e3c22e63f8a1eb29694fd0b141b a.ejs--ad20569e1449d7b8e99e6465960456{background-color:#929292}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--8e7922427f460a31935084b7acfb1a{opacity:1}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--8e7922427f460a31935084b7acfb1a li{display:inline-block;float:none}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--8e7922427f460a31935084b7acfb1a li.ejs--68d337c212ec6a5bc43125440d422b{border-bottom:1px solid #fff;background-color:#ffffff}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--8e7922427f460a31935084b7acfb1a li a{padding:2px 5px;color:#bcbcbc !important}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--8e7922427f460a31935084b7acfb1a li.ejs--68d337c212ec6a5bc43125440d422b a{color:#000 !important}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--31eb28817642bb1bfe0a2c422108bb{opacity:1}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--f932566a0af5314da834324c901978{opacity:1}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--f932566a0af5314da834324c901978 div.ejs--c233fb69cbef43078bc39e9d1efac8:hover{background-color:#2d2d2d}.ejs--d169a219343bc32dd4aecc3f6b7f25{opacity:1}.ejs--ad20569e1449d7b8e99e6465960456{float:none}.ejs--ad20569e1449d7b8e99e6465963825{float:none}.ejs--ad20569e1449d7b8e99e6468571053{float:none}.ejs--bdb54e9fc47f9805b506b746e897bf{float:none}.ejs--67d03ee7480b871ad6507d6319a839{float:none}.ejs--c2d931157456c1d438d40a2f66af2c{float:none}.ejs--5e71fd80268afbb1d588e40b993508 .ejs--f932566a0af5314da834324c901978 a.ejs--6604c83041a275a78837c452a71dd8,.ejs--99150e15f962c63c689cadc81ef40d{float:none;padding:0.1rem 0.5rem;background-color:rgba(var(--ejs-primary-color), 1);color:#fff !important;border-radius:0.25rem;cursor:pointer}.ejs--71527b6509aa48afce3ce1a11c02f0{float:none}.ejs--7ad35768e3f6b9faf97db01d5b60ae{float:none}.ejs--9c403e5e107a3e4374ba244b636400{float:none}.ejs--d6a46533fa6e510a571af5c28b440a{float:none}.ejs--d6a46533fa6e510a571af5c28b440a table{font-size:0.8rem;padding:0 10px}.ejs--d6a46533fa6e510a571af5c28b440a thead{background-color:rgba(50,50,50,0.66)}.ejs--d6a46533fa6e510a571af5c28b440a tbody tr:hover{background-color:#2d2d2d}.ejs--d6a46533fa6e510a571af5c28b440a tbody td{padding:10px 0}.ejs--d6a46533fa6e510a571af5c28b440a tbody td svg{width:12px;vertical-align:middle}.ejs--d6a46533fa6e510a571af5c28b440a table td:nth-child(2),.ejs--d6a46533fa6e510a571af5c28b440a table td:nth-child(3){text-align:center;width:80px}.ejs--57ca9b3853cc7de731483cfcc95a59{float:none}.ejs--0885d5e25e19127b6b516014426a1b{float:none}.ejs--25023d28756fdb9dfbbfb6dccb8677{float:none}.ejs--75b3a8d35aacc6424ed7422fdeaaaa{float:none}.ejs--eefdf28d69ed2d20f197308981bb61{float:none}.ejs--eefdf28d69ed2d20f197308981bb61 table{font-size:0.8rem;padding:0 10px}.ejs--eefdf28d69ed2d20f197308981bb61 thead,.ejs--eefdf28d69ed2d20f197308981bb61 tbody,.ejs--eefdf28d69ed2d20f197308981bb61 tfoot,.ejs--d6a46533fa6e510a571af5c28b440a thead,.ejs--d6a46533fa6e510a571af5c28b440a tbody,.ejs--d6a46533fa6e510a571af5c28b440a tfoot{background:transparent;text-align:left}.ejs--eefdf28d69ed2d20f197308981bb61 tbody tr:hover{background-color:#2d2d2d}.ejs--eefdf28d69ed2d20f197308981bb61 tr td:nth-child(1),.ejs--eefdf28d69ed2d20f197308981bb61 tr td:nth-child(3){width:80px}.ejs--9e670880bb57e824400fa00f09aaad,.ejs--2b4e3c245b7b25dfdac5e09155a68e,.ejs--572b0b3a0345a6b01b01a15a02842c,.ejs--a7d7f80c8999469c991ea452a85dd9{float:none}.ejs--2b4e3c245b7b25dfdac5e09155a68e{max-width:320px;margin:0 auto;text-align:left;width:100%}.ejs--952c974392296e7f643d51db380157{height:100%;overflow:hidden;position:absolute;top:0;width:100%}.ejs--0d7e216cf12ae73705b5d5bb0452fc{float:none}.ejs--c0a5e71f6613caab66d6ae15a5a00f{color:rgba(255,255,255,0.8);font-size:0.8rem;padding:5px;text-align:left;text-shadow:1px 1px 1px #000}.ejs--2440e3b831017ff8327c939e2a4413{display:none;position:fixed;bottom:30px;width:100%;position:absolute;bottom:80px}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--b8d8b771d0bbb94e2bbd03054f53fd{position:absolute;bottom:250px;width:100%}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--c83d70cb63c933edc073c7fe92e32b{position:absolute;bottom:50px;width:125px;height:125px;left:10px}@media (min-width: 480px){.ejs--2440e3b831017ff8327c939e2a4413{bottom:50px}}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--6e7015634623fd6a82e6a7d3488c84{position:absolute;font-size:20px;width:50px;height:50px;text-align:center;line-height:50px;border:1px solid #ccc;border-radius:50%;font-size:30px;font-weight:bold;background-color:rgba(255,255,255,0.15);user-select:none}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--49fa47c86a131e4ca8fb268bfdde89{position:absolute;bottom:10px;height:30px;width:124px;left:50%;margin-left:-62px}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--49fa47c86a131e4ca8fb268bfdde89 .ejs--6e7015634623fd6a82e6a7d3488c84{width:60px;height:30px;font-size:12px;font-weight:bolder;border-radius:5px;border:1px solid #ccc;line-height:30px;text-align:center;text-transform:uppercase}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--7d2b19f77fd0ccabf94dc1ca39ae18{position:absolute;bottom:50px;width:130px;height:130px;right:10px}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--7d2b19f77fd0ccabf94dc1ca39ae18 .ejs--6e7015634623fd6a82e6a7d3488c84{width:50px;height:50px;text-align:center;line-height:50px;border:1px solid #ccc;border-radius:50%;font-size:30px;font-weight:bold;transition:all 0.2s}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--6e7015634623fd6a82e6a7d3488c84.ejs--d708d9d486f1eca73a593d5c09f8ad{background-color:#000000ad}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--6e7015634623fd6a82e6a7d3488c84 img{width:100%}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--76fa7567879f97f5991c50ac600735{left:30px}.ejs--82fa3531556f97f5991c50ac600735{left:-35px}.ejs--fbd492618ebsd464fbcd1c9185cd14{left:95px}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--fbd499578ebef494fbcd1c9114cd1d{left:40px}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--b4c6d9bdbbd3dcfc8fa82689ecf448{left:40px;top:80px}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--87c940c15830daa967b08e67e9b87e{left:0;top:40px}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--b7c456c7dd7a616a55965bb134323b{left:81px;top:40px}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--7930ee9bb7ae2fa6e2f7b5568f1e98,.ejs--2440e3b831017ff8327c939e2a4413 .ejs--2226100d4c5408c2699e942aabb31c{height:31px;text-align:center;border:1px solid #ccc;border-radius:5px;line-height:31px}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--7930ee9bb7ae2fa6e2f7b5568f1e98{left:10px}.ejs--2440e3b831017ff8327c939e2a4413 .ejs--2226100d4c5408c2699e942aabb31c{right:10px}.ejs--eefec939452eb92fad035932d0f47c{float:none}.ejs--f1f43b27384834c8c22c6f81d0c5ae{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.6);display:flex;justify-content:center;align-items:center}.ejs--c4ee33766a01ed0356c3ec07898e96{background-color:rgba(0,0,0,0.8);border:1px solid rgba(238,238,238,0.2);padding:30px;min-width:200px;max-width:500px;max-height:100vh;border-radius:4px;overflow-y:auto;box-sizing:border-box}.ejs--a073f32023da1ced805c5f95a4e81c{display:flex;justify-content:space-between;align-items:center}.ejs--ed44f59bb8cd49177586b140658c6c{background-color:transparent;padding:0}.ejs--81470ba5e6a6d68014839ad4d9a977{margin-top:0 !important;margin-bottom:0 !important;font-weight:600 !important;font-size:1.25rem;line-height:1.25 !important;color:rgba(var(--ejs-primary-color), 1) !important}.ejs--c3c85789c2a7f56d8b26dba75b7e1f{background:transparent;border:0}.ejs--a073f32023da1ced805c5f95a4e81c .ejs--c3c85789c2a7f56d8b26dba75b7e1f:before{content:\"¹5\"}.ejs--db44f5520e6f4fd0dd34b478bb9ee8{margin-top:2rem;margin-bottom:2rem;line-height:1.5;color:rgba(0,0,0,0.8);text-align:left}.ejs--db44f5520e6f4fd0dd34b478bb9ee8 input,.ejs--db44f5520e6f4fd0dd34b478bb9ee8 select,.ejs--db44f5520e6f4fd0dd34b478bb9ee8 textarea{font-size:1rem;padding:0.4rem;max-width:100%}.ejs--319bcec5dee9444e1a2a53d6503b7c{color:#fff !important;font-size:.875rem;padding-left:1rem;padding-right:1rem;padding-top:.5rem;padding-bottom:.5rem;background-color:#929292;color:rgba(0,0,0,0.8);border-radius:.25rem;border-style:none;border-width:0;cursor:pointer;-webkit-appearance:button;text-transform:none;overflow:visible;line-height:1.15;margin:0;will-change:transform;-moz-osx-font-smoothing:grayscale;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);transition:-webkit-transform .25s ease-out;transition:transform .25s ease-out;transition:transform .25s ease-out,-webkit-transform .25s ease-out}.ejs--319bcec5dee9444e1a2a53d6503b7c:focus,.ejs--319bcec5dee9444e1a2a53d6503b7c:hover{-webkit-transform:scale(1.05);transform:scale(1.05)}.ejs--eaf3c1cba25d415d92ac48d7db34dd{background-color:rgba(var(--ejs-primary-color), 1)}.ejs--940087708c06b6129ce2bfa45f1d89{color:#f00 !important}@keyframes ejs--9d7aa2bd5ee276be085e5b2a0bbc2e{from{opacity:0}to{opacity:1}}@keyframes ejs--184b7558ffeb569c1790654537477b{from{opacity:1}to{opacity:0}}@keyframes ejs--8b069266f76099cc6bc220f6ea56cc{from{transform:translateY(15%)}to{transform:translateY(0)}}@keyframes ejs--379a464ad0e66ea5fc601e5f2fd73e{from{transform:translateY(0)}to{transform:translateY(-10%)}}.ejs--bef295f3125e9ba83d4f3677264bae{display:none}.ejs--bef295f3125e9ba83d4f3677264bae.ejs--60c17e0d149099f207b06f27edae6a{position:absolute;top:0;display:block;height:100%;width:100%}.ejs--bef295f3125e9ba83d4f3677264bae[aria-hidden=\"false\"] .ejs--f1f43b27384834c8c22c6f81d0c5ae{animation:ejs--9d7aa2bd5ee276be085e5b2a0bbc2e 0.3s cubic-bezier(0, 0, 0.2, 1)}.ejs--bef295f3125e9ba83d4f3677264bae[aria-hidden=\"false\"] .ejs--c4ee33766a01ed0356c3ec07898e96{animation:ejs--8b069266f76099cc6bc220f6ea56cc 0.3s cubic-bezier(0, 0, 0.2, 1)}.ejs--bef295f3125e9ba83d4f3677264bae[aria-hidden=\"true\"] .ejs--f1f43b27384834c8c22c6f81d0c5ae{animation:ejs--184b7558ffeb569c1790654537477b 0.3s cubic-bezier(0, 0, 0.2, 1)}.ejs--bef295f3125e9ba83d4f3677264bae[aria-hidden=\"true\"] .ejs--c4ee33766a01ed0356c3ec07898e96{animation:ejs--379a464ad0e66ea5fc601e5f2fd73e 0.3s cubic-bezier(0, 0, 0.2, 1)}.ejs--bef295f3125e9ba83d4f3677264bae .ejs--c4ee33766a01ed0356c3ec07898e96,.ejs--bef295f3125e9ba83d4f3677264bae .ejs--f1f43b27384834c8c22c6f81d0c5ae{will-change:transform}.ejs--4c3e63d4005bd8a0468e9c74a35f62{padding-left:2.25rem;position:relative;padding:0.2em 0;clear:both}.ejs--4c3e63d4005bd8a0468e9c74a35f62:hover{background-color:rgba(0,0,0,0.8)}.ejs--4c3e63d4005bd8a0468e9c74a35f62 input[type=checkbox]{position:absolute;z-index:-1;opacity:0;box-sizing:border-box;width:auto}.ejs--4c3e63d4005bd8a0468e9c74a35f62 label{position:relative;margin-bottom:0;vertical-align:top;word-break:break-word}.ejs--4c3e63d4005bd8a0468e9c74a35f62 label::before{position:absolute;top:.325rem;display:block;height:1rem;content:\"\";background-color:#fff;border:#adb5bd solid 1px;left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.ejs--4c3e63d4005bd8a0468e9c74a35f62 label::after{position:absolute;display:block;content:\"\";background-repeat:no-repeat;background-position:center center;top:calc(.325rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out}.ejs--4c3e63d4005bd8a0468e9c74a35f62 input:checked+label::before{color:#fff;border-color:rgba(var(--ejs-primary-color), 1);background-color:rgba(var(--ejs-primary-color), 1)}.ejs--4c3e63d4005bd8a0468e9c74a35f62 input:checked+label::after{background-color:#fff;-webkit-transform:translateX(0.75rem);transform:translateX(0.75rem)}.ejs--90bcdd71cd0d2307e9ee0dffa916da{position:absolute;padding:0.1rem 0.5rem;background-color:rgba(var(--ejs-primary-color), 1);color:#fff !important;border-radius:0.25rem;cursor:pointer;right:.025rem}.ejs--7a5f920ceffb2913f6dbda780573cf:fullscreen{background:#000;border-radius:0 !important;height:100%;margin:0;width:100%}.ejs--7a5f920ceffb2913f6dbda780573cf:fullscreen canvas{height:100% !important;max-width:100%;min-width:0;width:auto}.ejs--7a5f920ceffb2913f6dbda780573cf:fullscreen .ejs--057800d021995e1347ec07cb748672{height:100%;width:100%}.ejs--7a5f920ceffb2913f6dbda780573cf:fullscreen .ejs--8732295ca5c4902a060d34706a8146 .ejs--2b3dd6e2e26c0f0dc4ac5779dedd5e{display:block}.ejs--7a5f920ceffb2913f6dbda780573cf:fullscreen .ejs--8732295ca5c4902a060d34706a8146 .ejs--2b3dd6e2e26c0f0dc4ac5779dedd5e+svg{display:none}.ejs--7a5f920ceffb2913f6dbda780573cf:-webkit-full-screen{background:#000;border-radius:0 !important;height:100%;margin:0;width:100%}.ejs--7a5f920ceffb2913f6dbda780573cf:-webkit-full-screen canvas{height:100% !important;max-width:100%;min-width:0;width:auto}.ejs--7a5f920ceffb2913f6dbda780573cf:-webkit-full-screen .ejs--057800d021995e1347ec07cb748672{height:100%;width:100%}.ejs--7a5f920ceffb2913f6dbda780573cf:-webkit-full-screen .ejs--8732295ca5c4902a060d34706a8146 .ejs--2b3dd6e2e26c0f0dc4ac5779dedd5e{display:block}.ejs--7a5f920ceffb2913f6dbda780573cf:-webkit-full-screen .ejs--8732295ca5c4902a060d34706a8146 .ejs--2b3dd6e2e26c0f0dc4ac5779dedd5e+svg{display:none}.ejs--7a5f920ceffb2913f6dbda780573cf:-moz-full-screen{background:#000;border-radius:0 !important;height:100%;margin:0;width:100%}.ejs--7a5f920ceffb2913f6dbda780573cf:-moz-full-screen canvas{height:100% !important;max-width:100%;min-width:0;width:auto}.ejs--7a5f920ceffb2913f6dbda780573cf:-moz-full-screen .ejs--057800d021995e1347ec07cb748672{height:100%;width:100%}.ejs--7a5f920ceffb2913f6dbda780573cf:-moz-full-screen .ejs--8732295ca5c4902a060d34706a8146 .ejs--2b3dd6e2e26c0f0dc4ac5779dedd5e{display:block}.ejs--7a5f920ceffb2913f6dbda780573cf:-moz-full-screen .ejs--8732295ca5c4902a060d34706a8146 .ejs--2b3dd6e2e26c0f0dc4ac5779dedd5e+svg{display:none}.ejs--7a5f920ceffb2913f6dbda780573cf:-ms-fullscreen{background:#000;border-radius:0 !important;height:100%;margin:0;width:100%}.ejs--7a5f920ceffb2913f6dbda780573cf:-ms-fullscreen canvas{height:100% !important;max-width:100%;min-width:0;width:auto}.ejs--7a5f920ceffb2913f6dbda780573cf:-ms-fullscreen .ejs--057800d021995e1347ec07cb748672{height:100%;width:100%}.ejs--7a5f920ceffb2913f6dbda780573cf:-ms-fullscreen .ejs--8732295ca5c4902a060d34706a8146 .ejs--2b3dd6e2e26c0f0dc4ac5779dedd5e{display:block}.ejs--7a5f920ceffb2913f6dbda780573cf:-ms-fullscreen .ejs--8732295ca5c4902a060d34706a8146 .ejs--2b3dd6e2e26c0f0dc4ac5779dedd5e+svg{display:none}.ejs--412041671de21945d3e028b6ae84c9{background:#000;border-radius:0 !important;height:100%;margin:0;width:100%;bottom:0;left:0;position:fixed;right:0;top:0;z-index:10000000}.ejs--412041671de21945d3e028b6ae84c9 canvas{height:100% !important;max-width:100%;min-width:0;width:auto}.ejs--412041671de21945d3e028b6ae84c9 .ejs--057800d021995e1347ec07cb748672{height:100%;width:100%}.ejs--412041671de21945d3e028b6ae84c9 .ejs--8732295ca5c4902a060d34706a8146 .ejs--2b3dd6e2e26c0f0dc4ac5779dedd5e{display:block}.ejs--412041671de21945d3e028b6ae84c9 .ejs--8732295ca5c4902a060d34706a8146 .ejs--2b3dd6e2e26c0f0dc4ac5779dedd5e+svg{display:none}.ejs--7a5f920ceffb2913f6dbda780573cf.ejs--64f1256f556fb94454b930cb3ea7f2:fullscreen canvas{width:100%;height:auto !important}.ejs--7a5f920ceffb2913f6dbda780573cf.ejs--64f1256f556fb94454b930cb3ea7f2:-webkit-full-screen canvas{width:100%;height:auto !important}.ejs--7a5f920ceffb2913f6dbda780573cf.ejs--64f1256f556fb94454b930cb3ea7f2:-moz-full-screen{width:100%;height:auto !important}.ejs--7a5f920ceffb2913f6dbda780573cf.ejs--64f1256f556fb94454b930cb3ea7f2:-ms-fullscreen{width:100%;height:auto !important}.ejs--33643265135cf89e6c0a0d9866d6f1{transition:none !important}.ejs--6f0e996cd15e5fb6be0256918531d7{clip:rect(1px, 1px, 1px, 1px);overflow:hidden;border:0 !important;height:1px !important;padding:0 !important;position:absolute !important;width:1px !important}.ejs--7a5f920ceffb2913f6dbda780573cf [hidden]{display:none !important}",""]),t.locals={"ejs-wrapper":"ejs--de6433374cb30211f10e148b320b2f",ejs:"ejs--7a5f920ceffb2913f6dbda780573cf","ejs--full-ui":"ejs--f3a002bba9836fe4ebfed357a45521","controls-tabs":"ejs--008adea3c1ef33a8fc94892a1e97e6",overlay:"ejs--85a95eb6bf74a40ab61b91a91e5bff","key-setting-popup":"ejs--d169a219343bc32dd4aecc3f6b7f25","loading-info":"ejs--782e3572812f983b3a150eec177391",p1:"ejs--c426dd1d179aa351e6cec47e1d9438",p2:"ejs--31e7e81db48819ee35ec6f50378a2e",p3:"ejs--20d4eb2646d396f558a645dc0574f1",p4:"ejs--4de05306c8b099bdeb4585571ac095",ejs__contextmenu:"ejs--c7957d8666bb6b8fc7c3e9c021aaf8",ad:"ejs--cbcfe0a1421cadac9a04c81d6431d6","close-ad":"ejs--f3a1903d935f6cf720d4a0498db62a","start-game":"ejs--73f9b4e94a7a1fe74e11107d5ab2ef",pulse:"ejs--9bd947b3e6427453595f083d740a7c",ejs__control:"ejs--8732295ca5c4902a060d34706a8146","ejs__tab-focus":"ejs--a83b6c705e103e81a7762d0ed5e64b","ejs__control--pressed":"ejs--b1238136ec472a92297159882cf4b8","icon--pressed":"ejs--ec731619062226d943da67f5d83009","icon--not-pressed":"ejs--dc7068585e3d84fe0e676864c1439e","label--pressed":"ejs--0c6561f9155750b0aeeed6da5da7bf","label--not-pressed":"ejs--13d64e30c1333cc99391af48ddabaa","ejs--video":"ejs--d5f430a99a1619b3434bf58e34a99c",ejs__controls:"ejs--1acedc5ed6816abe96dd27d910fd74",ejs__progress:"ejs--f1aa376719b564cae0e653157cde14",ejs__time:"ejs--90d2780f99bcc76fdb6b0378a7238e",ejs__menu:"ejs--c7bfb2d1b75a40fdaaf90624bea9e7",ejs__volume:"ejs--36ceeeec0df37a9cf4bbe05fa204ec","ejs--hide-controls":"ejs--1b8cb7f2294b1eb5de5238daea3513","ejs--fullscreen-enabled":"ejs--19409fe2057ab935a7e46abb5b4f49",ejs__tooltip:"ejs--74c6d4176d27e37a19d2e9e61de8f4",ejs__menu__container:"ejs--013213afedeeb6878089b1ca1b4e47","ejs-popup":"ejs--c2532bfe04554193cc42b3be753700","ejs__control--forward":"ejs--0b4cdb4057d1a4623e60836ccc6275","ejs__control--back":"ejs--a7ad9de0cb0ca672b6703c50de7db9",ejs__menu__value:"ejs--f91e90fe7cabc875aff9a431bf5389","ejs__tooltip--visible":"ejs--6ea27aa07e60d1d6e4c9782740028a","ejs--menu-open":"ejs--da54136ccf8c6b0b16d98e8b8e8b88","ejs__video-wrapper":"ejs--057800d021995e1347ec07cb748672",portrait:"ejs--64f1256f556fb94454b930cb3ea7f2","game-started":"ejs--7da7949f602347007818e6d192eb23",ejs__progress__buffer:"ejs--f8d706413436fd119cf01aaf5a9d9d","ejs--audio":"ejs--bd0222e58d71b0a304d6037dfcffd5","ejs--loading":"ejs--2521e1257996f264de36e77cc9c5ee",ejs__dialogs:"ejs--d31688f864f56d6426ebbf2217d6ee",ejs__dialog:"ejs--5e71fd80268afbb1d588e40b993508",ejs__cache__container:"ejs--1e0f0672f67d0e96592314c9ed78b0",ejs__loading__container:"ejs--d7e6a6a8f38bfaa256fe5d709a8258","ejs__load-state__container":"ejs--b183f581b5336c4908ad258d3e1cc7",ejs__screenRecord__container:"ejs--b183f581b5336cashrqd258d3e1cc7",ejs__netplay__container:"ejs--158ea9dd34e3e7af2d837f8b05babb",ejs__gamepad__container:"ejs--3f0897a8158ba363a0ee0afe4da7c5","dialog-container":"ejs--38cc09882a55e98c76168dbe838aa0","dialog-title":"ejs--b373c9d5029d49324fb8ac3ece96c1","dialog-content":"ejs--a5e2629abb9a5bcbc8b2c1307922d2","dialog-buttons":"ejs--580e3c22e63f8a1eb29694fd0b141b","btn-cancel":"ejs--ad20569e1449d7b8e99e6465960456","btn-reset":"ejs--ad20569e1449d7b8e99e6465963825","btn-clear":"ejs--ad20569e1449d7b8e99e6468571053",tabs:"ejs--8e7922427f460a31935084b7acfb1a",active:"ejs--68d337c212ec6a5bc43125440d422b","tabs-content":"ejs--31eb28817642bb1bfe0a2c422108bb","tabs-panel":"ejs--f932566a0af5314da834324c901978","button-container":"ejs--c233fb69cbef43078bc39e9d1efac8","btn-submit":"ejs--bdb54e9fc47f9805b506b746e897bf","btn-create-room":"ejs--67d03ee7480b871ad6507d6319a839","btn-quit":"ejs--c2d931157456c1d438d40a2f66af2c",set:"ejs--6604c83041a275a78837c452a71dd8","btn-join-room":"ejs--99150e15f962c63c689cadc81ef40d","netplay-player-name":"ejs--71527b6509aa48afce3ce1a11c02f0","netplay-player-name-input":"ejs--7ad35768e3f6b9faf97db01d5b60ae","netplay-player-name-set":"ejs--9c403e5e107a3e4374ba244b636400","netplay-roomlist":"ejs--d6a46533fa6e510a571af5c28b440a","netplay-create-room":"ejs--57ca9b3853cc7de731483cfcc95a59","netplay-room-name-input":"ejs--0885d5e25e19127b6b516014426a1b","netplay-room-password-input":"ejs--25023d28756fdb9dfbbfb6dccb8677","netplay-create-room-set":"ejs--75b3a8d35aacc6424ed7422fdeaaaa","netplay-room":"ejs--eefdf28d69ed2d20f197308981bb61","cheats-add":"ejs--9e670880bb57e824400fa00f09aaad","cheats-list":"ejs--2b4e3c245b7b25dfdac5e09155a68e","cheat-code-input":"ejs--572b0b3a0345a6b01b01a15a02842c","cheat-name-input":"ejs--a7d7f80c8999469c991ea452a85dd9",ejs__widgets:"ejs--952c974392296e7f643d51db380157",ejs__widget:"ejs--0d7e216cf12ae73705b5d5bb0452fc",ejs__widget_netplay:"ejs--c0a5e71f6613caab66d6ae15a5a00f","virtual-gamepad":"ejs--2440e3b831017ff8327c939e2a4413",top:"ejs--b8d8b771d0bbb94e2bbd03054f53fd",left:"ejs--c83d70cb63c933edc073c7fe92e32b",buttons:"ejs--6e7015634623fd6a82e6a7d3488c84",center:"ejs--49fa47c86a131e4ca8fb268bfdde89",right:"ejs--7d2b19f77fd0ccabf94dc1ca39ae18",touch:"ejs--d708d9d486f1eca73a593d5c09f8ad",modal:"ejs--eefec939452eb92fad035932d0f47c",modal__overlay:"ejs--f1f43b27384834c8c22c6f81d0c5ae",modal__container:"ejs--c4ee33766a01ed0356c3ec07898e96",modal__header:"ejs--a073f32023da1ced805c5f95a4e81c",modal__footer:"ejs--ed44f59bb8cd49177586b140658c6c",modal__title:"ejs--81470ba5e6a6d68014839ad4d9a977",modal__close:"ejs--c3c85789c2a7f56d8b26dba75b7e1f",modal__content:"ejs--db44f5520e6f4fd0dd34b478bb9ee8",modal__btn:"ejs--319bcec5dee9444e1a2a53d6503b7c","modal__btn-primary":"ejs--eaf3c1cba25d415d92ac48d7db34dd",modal__errmsg:"ejs--940087708c06b6129ce2bfa45f1d89","micromodal-slide":"ejs--bef295f3125e9ba83d4f3677264bae","is-open":"ejs--60c17e0d149099f207b06f27edae6a",mmfadeIn:"ejs--9d7aa2bd5ee276be085e5b2a0bbc2e",mmslideIn:"ejs--8b069266f76099cc6bc220f6ea56cc",mmfadeOut:"ejs--184b7558ffeb569c1790654537477b",mmslideOut:"ejs--379a464ad0e66ea5fc601e5f2fd73e","ejs-switch":"ejs--4c3e63d4005bd8a0468e9c74a35f62","ejs-delete-cheat":"ejs--90bcdd71cd0d2307e9ee0dffa916da","icon--exit-fullscreen":"ejs--2b3dd6e2e26c0f0dc4ac5779dedd5e","ejs--fullscreen-fallback":"ejs--412041671de21945d3e028b6ae84c9","ejs--no-transition":"ejs--33643265135cf89e6c0a0d9866d6f1","ejs__sr-only":"ejs--6f0e996cd15e5fb6be0256918531d7","ejs-fade-in":"ejs--7cadf43f3d9eb17c7e3c36de84973b"}},function(e,t){e.exports=function(i){var r=[];return r.toString=function(){return this.map(function(e){n=e[1]||"";var t,n,o,a=(o=e[3])?i&&"function"==typeof btoa?(t="/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */",a=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"}),[n].concat(a).concat([t]).join("\n")):[n].join("\n"):n;return e[2]?"@media "+e[2]+"{"+a+"}":a}).join("")},r.i=function(e,t){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},o=0;o<this.length;o++){var a=this[o][0];"number"==typeof a&&(n[a]=!0)}for(o=0;o<e.length;o++){var i=e[o];"number"==typeof i[0]&&n[i[0]]||(t&&!i[2]?i[2]=t:t&&(i[2]="("+i[2]+") and ("+t+")"),r.push(i))}},r}},function(e,t,o){var n,a,i,c={},r=(n=function(){return window&&document&&document.all&&!window.atob},i={},function(e,t){if("function"==typeof e)return e();if(void 0===i[e]){t=function(e,t){return(t||document).querySelector(e)}.call(this,e,t);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}i[e]=t}return i[e]}),s=null,l=0,d=[],u=o(369);function f(e,t){for(var n=0;n<e.length;n++){var o=e[n],a=c[o.id];if(a){a.refs++;for(var i=0;i<a.parts.length;i++)a.parts[i](o.parts[i]);for(;i<o.parts.length;i++)a.parts.push(y(o.parts[i],t))}else{for(var r=[],i=0;i<o.parts.length;i++)r.push(y(o.parts[i],t));c[o.id]={id:o.id,refs:1,parts:r}}}}function p(e,t){for(var n=[],o={},a=0;a<e.length;a++){var i=e[a],r=t.base?i[0]+t.base:i[0],i={css:i[1],media:i[2],sourceMap:i[3]};o[r]?o[r].parts.push(i):n.push(o[r]={id:r,parts:[i]})}return n}function h(e,t){var n=r(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=d[d.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),d.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");o=r(e.insertAt.before,n);n.insertBefore(t,o)}}function m(e){null!==e.parentNode&&(e.parentNode.removeChild(e),0<=(e=d.indexOf(e))&&d.splice(e,1))}function g(e){var t,n=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce&&(t=o.nc)&&(e.attrs.nonce=t),b(n,e.attrs),h(e,n),n}function b(t,n){Object.keys(n).forEach(function(e){t.setAttribute(e,n[e])})}function y(t,e){var n,o,a,i,r;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}return a=e.singleton?(i=l++,n=s=s||g(e),o=x.bind(null,n,i,!1),x.bind(null,n,i,!0)):t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(i=e,r=document.createElement("link"),void 0===i.attrs.type&&(i.attrs.type="text/css"),i.attrs.rel="stylesheet",b(r,i.attrs),h(i,r),n=r,o=function(e,t,n){var o=n.css,n=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&n,t=((t.convertToAbsoluteUrls||a)&&(o=u(o)),n&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */"),new Blob([o],{type:"text/css"})),a=e.href;e.href=URL.createObjectURL(t),a&&URL.revokeObjectURL(a)}.bind(null,n,e),function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(e),o=function(e,t){var n=t.css,t=t.media;if(t&&e.setAttribute("media",t),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),function(){m(n)}),o(t),function(e){e?e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap||o(t=e):a()}}e.exports=function(e,r){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(r=r||{}).attrs="object"==typeof r.attrs?r.attrs:{},r.singleton||"boolean"==typeof r.singleton||(r.singleton=function(){return a=void 0===a?n.apply(this,arguments):a}()),r.insertInto||(r.insertInto="head"),r.insertAt||(r.insertAt="bottom");var s=p(e,r);return f(s,r),function(e){for(var t,n=[],o=0;o<s.length;o++){var a=s[o];(t=c[a.id]).refs--,n.push(t)}for(e&&f(p(e,r),r),o=0;o<n.length;o++)if(0===(t=n[o]).refs){for(var i=0;i<t.parts.length;i++)t.parts[i]();delete c[t.id]}}};v=[];var v,w=function(e,t){return v[e]=t,v.filter(Boolean).join("\n")};function x(e,t,n,o){var n=n?"":o.css;e.styleSheet?e.styleSheet.cssText=w(t,n):(o=document.createTextNode(n),(n=e.childNodes)[t]&&e.removeChild(n[t]),n.length?e.insertBefore(o,n[t]):e.appendChild(o))}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){t=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(t)?e:(e=0===t.indexOf("//")?t:0===t.indexOf("/")?n+t:o+t.replace(/^\.\//,""),"url("+JSON.stringify(e)+")")})}},function(e,t,n){"use strict";t.byteLength=function(e){var e=d(e),t=e[0],e=e[1];return 3*(t+e)/4-e},t.toByteArray=function(e){for(var t,n=d(e),o=n[0],n=n[1],a=new l(3*(o+n)/4-n),i=0,r=0<n?o-4:o,s=0;s<r;s+=4)t=c[e.charCodeAt(s)]<<18|c[e.charCodeAt(s+1)]<<12|c[e.charCodeAt(s+2)]<<6|c[e.charCodeAt(s+3)],a[i++]=t>>16&255,a[i++]=t>>8&255,a[i++]=255&t;return 2===n&&(t=c[e.charCodeAt(s)]<<2|c[e.charCodeAt(s+1)]>>4,a[i++]=255&t),1===n&&(t=c[e.charCodeAt(s)]<<10|c[e.charCodeAt(s+1)]<<4|c[e.charCodeAt(s+2)]>>2,a[i++]=t>>8&255,a[i++]=255&t),a},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,a=[],i=0,r=n-o;i<r;i+=16383)a.push(function(e,t,n){for(var o,a=[],i=t;i<n;i+=3)o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),a.push(s[(o=o)>>18&63]+s[o>>12&63]+s[o>>6&63]+s[63&o]);return a.join("")}(e,i,r<i+16383?r:i+16383));return 1==o?(t=e[n-1],a.push(s[t>>2]+s[t<<4&63]+"==")):2==o&&(t=(e[n-2]<<8)+e[n-1],a.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"=")),a.join("")};for(var s=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,i=o.length;a<i;++a)s[a]=o[a],c[o.charCodeAt(a)]=a;function d(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("=");return[e=-1===e?t:e,e===t?0:4-e%4]}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,o,a){var i,r,s=8*a-o-1,c=(1<<s)-1,l=c>>1,d=-7,u=n?a-1:0,f=n?-1:1,a=e[t+u];for(u+=f,i=a&(1<<-d)-1,a>>=-d,d+=s;0<d;i=256*i+e[t+u],u+=f,d-=8);for(r=i&(1<<-d)-1,i>>=-d,d+=o;0<d;r=256*r+e[t+u],u+=f,d-=8);if(0===i)i=1-l;else{if(i===c)return r?NaN:1/0*(a?-1:1);r+=Math.pow(2,o),i-=l}return(a?-1:1)*r*Math.pow(2,i-o)},t.write=function(e,t,n,o,a,i){var r,s,c=8*i-a-1,l=(1<<c)-1,d=l>>1,u=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=o?0:i-1,p=o?1:-1,i=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,r=l):(r=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-r))<1&&(r--,o*=2),2<=(t+=1<=r+d?u/o:u*Math.pow(2,1-d))*o&&(r++,o/=2),l<=r+d?(s=0,r=l):1<=r+d?(s=(t*o-1)*Math.pow(2,a),r+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,a),r=0));8<=a;e[n+f]=255&s,f+=p,s/=256,a-=8);for(r=r<<a|s,c+=a;0<c;e[n+f]=255&r,f+=p,r/=256,c-=8);e[n+f-p]|=128*i}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var o=n(145),a=n(74)("socket.io-client:url");e.exports=function(e,t){var n=e,e=(t=t||"undefined"!=typeof location&&location,"string"==typeof(e=null==e?t.protocol+"//"+t.host:e)&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(a("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),a("parse %s",e),n=o(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/",-1!==n.host.indexOf(":")?"["+n.host+"]":n.host);return n.id=n.protocol+"://"+e+":"+n.port,n.href=n.protocol+"://"+e+(t&&t.port===n.port?"":":"+n.port),n}},function(e,c,t){function n(e){var r;function s(){if(s.enabled){var o=s,e=+new Date,t=e-(r||e);o.diff=t,o.prev=r,o.curr=e,r=e;for(var a=new Array(arguments.length),n=0;n<a.length;n++)a[n]=arguments[n];a[0]=c.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var i=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,function(e,t){if("%%"===e)return e;i++;var n,t=c.formatters[t];return"function"==typeof t&&(n=a[i],e=t.call(o,n),a.splice(i,1),i--),e}),c.formatArgs.call(o,a),(s.log||c.log||console.log.bind(console)).apply(o,a)}}return s.namespace=e,s.enabled=c.enabled(e),s.useColors=c.useColors(),s.color=function(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return c.colors[Math.abs(n)%c.colors.length]}(e),s.destroy=o,"function"==typeof c.init&&c.init(s),c.instances.push(s),s}function o(){var e=c.instances.indexOf(this);return-1!==e&&(c.instances.splice(e,1),!0)}(c=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},c.disable=function(){c.enable("")},c.enable=function(e){c.save(e),c.names=[],c.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),n=t.length,o=0;o<n;o++)t[o]&&("-"===(e=t[o].replace(/\*/g,".*?"))[0]?c.skips.push(new RegExp("^"+e.substr(1)+"$")):c.names.push(new RegExp("^"+e+"$")));for(o=0;o<c.instances.length;o++){var a=c.instances[o];a.enabled=c.enabled(a.namespace)}},c.enabled=function(e){if("*"===e[e.length-1])return!0;for(var t=0,n=c.skips.length;t<n;t++)if(c.skips[t].test(e))return!1;for(t=0,n=c.names.length;t<n;t++)if(c.names[t].test(e))return!0;return!1},c.humanize=t(104),c.instances=[],c.names=[],c.skips=[],c.formatters={}},function(e,t,n){e.exports=n(77)},function(e,c,t){function n(e){var r;function s(){if(s.enabled){var o=s,e=+new Date,t=e-(r||e);o.diff=t,o.prev=r,o.curr=e,r=e;for(var a=new Array(arguments.length),n=0;n<a.length;n++)a[n]=arguments[n];a[0]=c.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var i=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,function(e,t){if("%%"===e)return e;i++;var n,t=c.formatters[t];return"function"==typeof t&&(n=a[i],e=t.call(o,n),a.splice(i,1),i--),e}),c.formatArgs.call(o,a),(s.log||c.log||console.log.bind(console)).apply(o,a)}}return s.namespace=e,s.enabled=c.enabled(e),s.useColors=c.useColors(),s.color=function(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return c.colors[Math.abs(n)%c.colors.length]}(e),s.destroy=o,"function"==typeof c.init&&c.init(s),c.instances.push(s),s}function o(){var e=c.instances.indexOf(this);return-1!==e&&(c.instances.splice(e,1),!0)}(c=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},c.disable=function(){c.enable("")},c.enable=function(e){c.save(e),c.names=[],c.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),n=t.length,o=0;o<n;o++)t[o]&&("-"===(e=t[o].replace(/\*/g,".*?"))[0]?c.skips.push(new RegExp("^"+e.substr(1)+"$")):c.names.push(new RegExp("^"+e+"$")));for(o=0;o<c.instances.length;o++){var a=c.instances[o];a.enabled=c.enabled(a.namespace)}},c.enabled=function(e){if("*"===e[e.length-1])return!0;for(var t=0,n=c.skips.length;t<n;t++)if(c.skips[t].test(e))return!1;for(t=0,n=c.names.length;t<n;t++)if(c.names[t].test(e))return!0;return!1},c.humanize=t(104),c.instances=[],c.names=[],c.skips=[],c.formatters={}},function(e,t,n){var d=n(147),n=Object.prototype.toString,u="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===n.call(Blob),f="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===n.call(File);t.deconstructPacket=function(e){var t=[],n=e.data;return e.data=function e(t,n){if(!t)return t;var o,a;if(d(t))return o={_placeholder:!0,num:n.length},n.push(t),o;if(Array.isArray(t)){for(var i=new Array(t.length),r=0;r<t.length;r++)i[r]=e(t[r],n);return i}if("object"!=typeof t||t instanceof Date)return t;for(a in i={},t)i[a]=e(t[a],n);return i}(n,t),e.attachments=t.length,{packet:e,buffers:t}},t.reconstructPacket=function(e,t){return e.data=function e(t,n){if(!t)return t;if(t&&t._placeholder)return n[t.num];if(Array.isArray(t))for(var o=0;o<t.length;o++)t[o]=e(t[o],n);else if("object"==typeof t)for(var a in t)t[a]=e(t[a],n);return t}(e.data,t),e.attachments=void 0,e},t.removeBlobs=function(e,s){var c=0,l=e;!function e(t,n,o){if(!t)return t;if(u&&t instanceof Blob||f&&t instanceof File){c++;var a=new FileReader;a.onload=function(){o?o[n]=this.result:l=this.result,--c||s(l)},a.readAsArrayBuffer(t)}else if(Array.isArray(t))for(var i=0;i<t.length;i++)e(t[i],i,t);else if("object"==typeof t&&!d(t))for(var r in t)e(t[r],r,t)}(l),c||s(l)}},function(e,t,n){e.exports=n(379),e.exports.parser=n(51)},function(e,t,n){var o=n(149),a=n(50),u=n(77)("engine.io-client:socket"),i=n(153),r=n(51),s=n(145),c=n(75);function f(e,t){if(!(this instanceof f))return new f(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=s(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=s(t.host).host),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=c.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.transportOptions=t.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate&&(t.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized||t.rejectUnauthorized,this.forceNode=!!t.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),"undefined"!=typeof self&&!this.isReactNative||(t.extraHeaders&&0<Object.keys(t.extraHeaders).length&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}(e.exports=f).priorWebsocketSuccess=!1,a(f.prototype),f.protocol=r.protocol,(f.Socket=f).Transport=n(107),f.transports=n(149),f.parser=n(51),f.prototype.createTransport=function(e){u('creating transport "%s"',e);var t=function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}(this.query),n=(t.EIO=4,t.transport=e,this.transportOptions[e]||{});return this.id&&(t.sid=this.id),new o[e]({query:t,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0,isReactNative:this.isReactNative})},f.prototype.open=function(){var e,t;if(this.rememberUpgrade&&f.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return t=this,void setTimeout(function(){t.emit("error","No transports available")},0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},f.prototype.setTransport=function(e){u("setting transport %s",e.name);var t=this;this.transport&&(u("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),(this.transport=e).on("drain",function(){t.onDrain()}).on("packet",function(e){t.onPacket(e)}).on("error",function(e){t.onError(e)}).on("close",function(){t.onClose("transport close")})},f.prototype.probe=function(n){u('probing transport "%s"',n);var o=this.createTransport(n,{probe:1}),t=!1,a=this;function e(){var e;a.onlyBinaryUpgrades&&(e=!this.supportsBinary&&a.transport.supportsBinary,t=t||e),t||(u('probe transport "%s" opened',n),o.send([{type:"ping",data:"probe"}]),o.once("packet",function(e){t||("pong"===e.type&&"probe"===e.data?(u('probe transport "%s" pong',n),a.upgrading=!0,a.emit("upgrading",o),o&&(f.priorWebsocketSuccess="websocket"===o.name,u('pausing current transport "%s"',a.transport.name),a.transport.pause(function(){t||"closed"!==a.readyState&&(u("changing transport and sending upgrade packet"),d(),a.setTransport(o),o.send([{type:"upgrade"}]),a.emit("upgrade",o),o=null,a.upgrading=!1,a.flush())}))):(u('probe transport "%s" failed',n),(e=new Error("probe error")).transport=o.name,a.emit("upgradeError",e)))}))}function i(){t||(t=!0,d(),o.close(),o=null)}function r(e){var t=new Error("probe error: "+e);t.transport=o.name,i(),u('probe transport "%s" failed because of error: %s',n,e),a.emit("upgradeError",t)}function s(){r("transport closed")}function c(){r("socket closed")}function l(e){o&&e.name!==o.name&&(u('"%s" works - aborting "%s"',e.name,o.name),i())}function d(){o.removeListener("open",e),o.removeListener("error",r),o.removeListener("close",s),a.removeListener("close",c),a.removeListener("upgrading",l)}f.priorWebsocketSuccess=!1,o.once("open",e),o.once("error",r),o.once("close",s),this.once("close",c),this.once("upgrading",l),o.open()},f.prototype.onOpen=function(){if(u("socket open"),this.readyState="open",f.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){u("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},f.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(u('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else u('packet received with socket readyState "%s"',this.readyState)},f.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},f.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout(function(){"closed"!==t.readyState&&t.onClose("ping timeout")},e||t.pingInterval+t.pingTimeout)},f.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout(function(){u("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)},e.pingInterval)},f.prototype.ping=function(){var e=this;this.sendPacket("ping",function(){e.emit("ping")})},f.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),(this.prevBufferLen=0)===this.writeBuffer.length?this.emit("drain"):this.flush()},f.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(u("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},f.prototype.write=f.prototype.send=function(e,t,n){return this.sendPacket("message",e,t,n),this},f.prototype.sendPacket=function(e,t,n,o){"function"==typeof t&&(o=t,t=void 0),"function"==typeof n&&(o=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState&&((n=n||{}).compress=!1!==n.compress,this.emit("packetCreate",e={type:e,data:t,options:n}),this.writeBuffer.push(e),o&&this.once("flush",o),this.flush())},f.prototype.close=function(){var e;function t(){e.onClose("forced close"),u("socket closing - telling transport to close"),e.transport.close()}function n(){e.removeListener("upgrade",n),e.removeListener("upgradeError",n),t()}function o(){e.once("upgrade",n),e.once("upgradeError",n)}return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",(e=this).writeBuffer.length?this.once("drain",function(){(this.upgrading?o:t)()}):(this.upgrading?o:t)()),this},f.prototype.onError=function(e){u("socket error %j",e),f.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},f.prototype.onClose=function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(u('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)},f.prototype.filterUpgrades=function(e){for(var t=[],n=0,o=e.length;n<o;n++)~i(this.transports,e[n])&&t.push(e[n]);return t}},function(t,e){try{t.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){t.exports=!1}},function(e,t,n){var a=n(106),o=n(150),i=n(50),r=n(76),s=n(77)("engine.io-client:polling-xhr");function c(){}function l(e){var t,n;o.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,"undefined"!=typeof location&&(t="https:"===location.protocol,n=(n=location.port)||(t?443:80),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t)}function d(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}function u(){for(var e in d.requests)d.requests.hasOwnProperty(e)&&d.requests[e].abort()}e.exports=l,e.exports.Request=d,r(l,o),l.prototype.supportsBinary=!0,l.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new d(e)},l.prototype.doWrite=function(e,t){var e=this.request({method:"POST",data:e,isBinary:"string"!=typeof e&&void 0!==e}),n=this;e.on("success",t),e.on("error",function(e){n.onError("xhr post error",e)}),this.sendXhr=e},l.prototype.doPoll=function(){s("xhr poll");var e=this.request(),t=this;e.on("data",function(e){t.onData(e)}),e.on("error",function(e){t.onError("xhr poll error",e)}),this.pollXhr=e},i(d.prototype),d.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR},t=(e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,this.xhr=new a(e)),n=this;try{s("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var o in t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(o)&&t.setRequestHeader(o,this.extraHeaders[o])}catch(e){}if("POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=!0),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){n.onLoad()},t.onerror=function(){n.onError(t.responseText)}):t.onreadystatechange=function(){if(2===t.readyState)try{var e=t.getResponseHeader("Content-Type");n.supportsBinary&&"application/octet-stream"===e&&(t.responseType="arraybuffer")}catch(e){}4===t.readyState&&(200===t.status||1223===t.status?n.onLoad():setTimeout(function(){n.onError(t.status)},0))},s("xhr data %s",this.data),t.send(this.data)}catch(e){return void setTimeout(function(){n.onError(e)},0)}"undefined"!=typeof document&&(this.index=d.requestsCount++,d.requests[this.index]=this)},d.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},d.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},d.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},d.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=c:this.xhr.onreadystatechange=c,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete d.requests[this.index],this.xhr=null}},d.prototype.onLoad=function(){var e,t;try{try{t=this.xhr.getResponseHeader("Content-Type")}catch(e){}e="application/octet-stream"===t&&this.xhr.response||this.xhr.responseText}catch(e){this.onError(e)}null!=e&&this.onData(e)},d.prototype.hasXDR=function(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR},d.prototype.abort=function(){this.cleanup()},d.requestsCount=0,d.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",u):"function"==typeof addEventListener&&(n="onpagehide"in self?"pagehide":"unload",addEventListener(n,u,!1)))},function(e,t){e.exports=Object.keys||function(e){var t,n=[],o=Object.prototype.hasOwnProperty;for(t in e)o.call(e,t)&&n.push(t);return n}},function(e,t){},function(e,t){e.exports=function(e,t,n){var o=e.byteLength;if(t=t||0,n=n||o,e.slice)return e.slice(t,n);if(t<0&&(t+=o),n<0&&(n+=o),o<n&&(n=o),o<=t||n<=t||0===o)return new ArrayBuffer(0);for(var a=new Uint8Array(e),i=new Uint8Array(n-t),r=t,s=0;r<n;r++,s++)i[s]=a[r];return i.buffer}},function(e,t){function r(){}e.exports=function(e,n,o){var a=!1;return o=o||r,0===(i.count=e)?n():i;function i(e,t){if(i.count<=0)throw new Error("after called too many times");--i.count,e?(a=!0,n(e),n=o):0!==i.count||a||n(null,t)}}},function(e,t){var d,u,f,p=String.fromCharCode;function h(e){for(var t,n,o=[],a=0,i=e.length;a<i;)55296<=(t=e.charCodeAt(a++))&&t<=56319&&a<i?56320==(64512&(n=e.charCodeAt(a++)))?o.push(((1023&t)<<10)+(1023&n)+65536):(o.push(t),a--):o.push(t);return o}function m(e,t){if(!(55296<=e&&e<=57343))return 1;if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function s(e,t){return p(e>>t&63|128)}function g(){if(u<=f)throw Error("Invalid byte index");var e=255&d[f];if(f++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}e.exports={version:"2.1.2",encode:function(e,t){for(var n=!1!==(t=t||{}).strict,o=h(e),a=o.length,i=-1,r="";++i<a;)r+=function(e,t){if(0==(4294967168&e))return p(e);var n="";return 0==(4294965248&e)?n=p(e>>6&31|192):0==(4294901760&e)?(m(e,t)||(e=65533),n=p(e>>12&15|224),n+=s(e,6)):0==(4292870144&e)&&(n=p(e>>18&7|240),n=(n+=s(e,12))+s(e,6)),n+p(63&e|128)}(o[i],n);return r},decode:function(e,t){var n=!1!==(t=t||{}).strict;d=h(e),u=d.length,f=0;for(var o,a=[];!1!==(o=function(e){var t,n;if(u<f)throw Error("Invalid byte index");if(f==u)return!1;if(t=255&d[f],f++,0==(128&t))return t;if(192==(224&t)){if(128<=(n=(31&t)<<6|g()))return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if(2048<=(n=(15&t)<<12|g()<<6|g()))return m(n,e)?n:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&65536<=(n=(7&t)<<18|g()<<12|g()<<6|g())&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}(n));)a.push(o);for(var i,r=a,s=r.length,c=-1,l="";++c<s;)65535<(i=r[c])&&(l+=p((i-=65536)>>>10&1023|55296),i=56320|1023&i),l+=p(i);return l}}},function(e,t){!function(){"use strict";for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=new Uint8Array(256),e=0;e<i.length;e++)d[i.charCodeAt(e)]=e;t.encode=function(e){for(var t=new Uint8Array(e),n=t.length,o="",a=0;a<n;a+=3)o=(o=(o=(o+=i[t[a]>>2])+i[(3&t[a])<<4|t[a+1]>>4])+i[(15&t[a+1])<<2|t[a+2]>>6])+i[63&t[a+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o},t.decode=function(e){for(var t,n,o,a,i=.75*e.length,r=e.length,s=0,i=("="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--),new ArrayBuffer(i)),c=new Uint8Array(i),l=0;l<r;l+=4)t=d[e.charCodeAt(l)],n=d[e.charCodeAt(l+1)],o=d[e.charCodeAt(l+2)],a=d[e.charCodeAt(l+3)],c[s++]=t<<2|n>>4,c[s++]=(15&n)<<4|o>>2,c[s++]=(3&o)<<6|63&a;return i}}()},function(e,t){var o=void 0!==o?o:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,n=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),a=n&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),i=o&&o.prototype.append&&o.prototype.getBlob;function r(e){return e.map(function(e){var t,n;return e.buffer instanceof ArrayBuffer?(t=e.buffer,e.byteLength!==t.byteLength&&((n=new Uint8Array(e.byteLength)).set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=n.buffer),t):e})}function s(e,t){t=t||{};var n=new o;return r(e).forEach(function(e){n.append(e)}),t.type?n.getBlob(t.type):n.getBlob()}function c(e,t){return new Blob(r(e),t||{})}"undefined"!=typeof Blob&&(s.prototype=Blob.prototype,c.prototype=Blob.prototype),e.exports=n?a?Blob:c:i?s:void 0},function(e,c,t){function n(e){var r;function s(){if(s.enabled){var o=s,e=+new Date,t=e-(r||e);o.diff=t,o.prev=r,o.curr=e,r=e;for(var a=new Array(arguments.length),n=0;n<a.length;n++)a[n]=arguments[n];a[0]=c.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var i=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,function(e,t){if("%%"===e)return e;i++;var n,t=c.formatters[t];return"function"==typeof t&&(n=a[i],e=t.call(o,n),a.splice(i,1),i--),e}),c.formatArgs.call(o,a),(s.log||c.log||console.log.bind(console)).apply(o,a)}}return s.namespace=e,s.enabled=c.enabled(e),s.useColors=c.useColors(),s.color=function(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return c.colors[Math.abs(n)%c.colors.length]}(e),s.destroy=o,"function"==typeof c.init&&c.init(s),c.instances.push(s),s}function o(){var e=c.instances.indexOf(this);return-1!==e&&(c.instances.splice(e,1),!0)}(c=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},c.disable=function(){c.enable("")},c.enable=function(e){c.save(e),c.names=[],c.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),n=t.length,o=0;o<n;o++)t[o]&&("-"===(e=t[o].replace(/\*/g,".*?"))[0]?c.skips.push(new RegExp("^"+e.substr(1)+"$")):c.names.push(new RegExp("^"+e+"$")));for(o=0;o<c.instances.length;o++){var a=c.instances[o];a.enabled=c.enabled(a.namespace)}},c.enabled=function(e){if("*"===e[e.length-1])return!0;for(var t=0,n=c.skips.length;t<n;t++)if(c.skips[t].test(e))return!1;for(t=0,n=c.names.length;t<n;t++)if(c.names[t].test(e))return!0;return!1},c.humanize=t(104),c.instances=[],c.names=[],c.skips=[],c.formatters={}},function(r,e,s){!function(n){var o=s(150),e=s(76);r.exports=t;var a,l=/\n/g,d=/\\n/g;function i(){}function t(e){o.call(this,e),this.query=this.query||{},a||(e="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:{},a=e.___eio=e.___eio||[]),this.index=a.length;var t=this;a.push(function(e){t.onData(e)}),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",function(){t.script&&(t.script.onerror=i)},!1)}e(t,o),t.prototype.supportsBinary=!1,t.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),o.prototype.doClose.call(this)},t.prototype.doPoll=function(){var t=this,e=document.createElement("script"),n=(this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)},document.getElementsByTagName("script")[0]);n?n.parentNode.insertBefore(e,n):(document.head||document.body).appendChild(e),this.script=e,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)},t.prototype.doWrite=function(e,t){var n,o,a,i,r=this;function s(){c(),t()}function c(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(e){r.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+r.iframeId+'">';n=document.createElement(e)}catch(e){(n=document.createElement("iframe")).name=r.iframeId,n.src="javascript:0"}n.id=r.iframeId,r.form.appendChild(n),r.iframe=n}this.form||(o=document.createElement("form"),a=document.createElement("textarea"),i=this.iframeId="eio_iframe_"+this.index,o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=i,o.method="POST",o.setAttribute("accept-charset","utf-8"),a.name="d",o.appendChild(a),document.body.appendChild(o),this.form=o,this.area=a),this.form.action=this.uri(),c(),e=e.replace(d,"\\\n"),this.area.value=e.replace(l,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===r.iframe.readyState&&s()}:this.iframe.onload=s}}.call(this,s(31))},function(u,e,f){!function(i){var t,n,o=f(107),r=f(51),a=f(75),e=f(76),s=f(152),c=f(77)("engine.io-client:websocket");if("undefined"!=typeof WebSocket)t=WebSocket;else if("undefined"!=typeof self)t=self.WebSocket||self.MozWebSocket;else try{n=f(392)}catch(e){}var l=t||n;function d(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=t&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(l=n),o.call(this,e)}e(u.exports=d,o),d.prototype.name="websocket",d.prototype.supportsBinary=!0,d.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new l(e,t):new l(e):new l(e,t,n)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},d.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},d.prototype.write=function(e){var o=this;this.writable=!1;for(var a=e.length,t=0,n=a;t<n;t++)!function(n){r.encodePacket(n,o.supportsBinary,function(e){var t;o.usingBrowserWebSocket||(t={},n.options&&(t.compress=n.options.compress),o.perMessageDeflate&&("string"==typeof e?i.byteLength(e):e.length)<o.perMessageDeflate.threshold&&(t.compress=!1));try{o.usingBrowserWebSocket?o.ws.send(e):o.ws.send(e,t)}catch(e){c("websocket closed before onclose event")}--a||(o.emit("flush"),setTimeout(function(){o.writable=!0,o.emit("drain")},0))})}(e[t])},d.prototype.onClose=function(){o.prototype.onClose.call(this)},d.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},d.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";return this.port&&("wss"==t&&443!==Number(this.port)||"ws"==t&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=s()),this.supportsBinary||(e.b64=1),(e=a.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e},d.prototype.check=function(){return!(!l||"__initialize"in l&&this.name===d.prototype.name)}}.call(this,f(73).Buffer)},null,function(e,t){e.exports=function(e,t){for(var n=[],o=(t=t||0)||0;o<e.length;o++)n[o-t]=e[o];return n}},function(e,t){function n(e){this.ms=(e=e||{}).min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=0<e.jitter&&e.jitter<=1?e.jitter:0,this.attempts=0}(e.exports=n).prototype.duration=function(){var e,t,n=this.ms*Math.pow(this.factor,this.attempts++);return this.jitter&&(e=Math.random(),t=Math.floor(e*this.jitter*n),n=0==(1&Math.floor(10*e))?n-t:n+t),0|Math.min(n,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}},null,function(y,v,e){"use strict";for(var w in window.EJS_RESET_VARS=[],window)window.EJS_RESET_VARS.push(w);e.r(v);function t(e){return null!=e?e.constructor:null}function n(e,t){return Boolean(e&&t&&e instanceof t)}function x(e){return null==e}function _(e){return t(e)===Object}function S(e){return t(e)===String}function T(e){return Array.isArray(e)}function C(e){return n(e,NodeList)}function E(e){return x(e)||(S(e)||T(e)||C(e))&&!e.length||_(e)&&!Object.keys(e).length}var A={volume:.5,muted:!1,i18n:{restart:"Restart",play:"Play",pause:"Pause",played:"Played",volume:"Volume",mute:"Mute (F9)",unmute:"Unmute (F9)",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",settings:"Settings",saveState:"Save State (Shift + F2)",loadState:"Load State (Shift + F4)",screenRecord:"Start Screen Recording",netplay:"Netplay",gamepad:"Control Settings",cheat:"Cheats",menuBack:"Go back to previous menu",normal:"Normal",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",playNow:"Play Now"},listeners:{play:null,pause:null,restart:null,rewind:null,mute:null,volume:null,fullscreen:null},events:["ready"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".ejs",controls:{container:null,wrapper:".jes__controls"},buttons:{play:'[data-btn="play"]',pause:'[data-btn="pause"]',mute:'[data-btn="mute"]',fullscreen:'[data-btn="fullscreen"]',settings:'[data-btn="settings"]',saveState:'[data-btn="save-state"]',loadState:'[data-btn="load-state"]',screenRecord:'[data-btn="screen-record"]',gamepad:'[data-btn="gamepad"]',netplay:'[data-btn="netplay"]',cheat:'[data-btn="cheat"]'},inputs:{volume:'[data-range="volume"]'}},classNames:{type:"ejs--video",video:"ejs__video-wrapper",poster:"ejs__poster",posterEnabled:"ejs__poster-enabled",control:"ejs__control",controlPressed:"ejs__control--pressed",playing:"ejs--playing",paused:"ejs--paused",stopped:"ejs--stopped",loading:"ejs--loading",hover:"ejs--hover",tooltip:"ejs__tooltip",hidden:"ejs__sr-only",hideControls:"ejs--hide-controls",isIos:"ejs--is-ios",isTouch:"ejs--is-touch",uiSupported:"ejs--full-ui",noTransition:"ejs--no-transition",menu:{value:"ejs__menu__value",badge:"ejs__badge",open:"ejs--menu-open"},fullscreen:{enabled:"ejs--fullscreen-enabled",fallback:"ejs--fullscreen-fallback"},tabFocus:"ejs__tab-focus"}},o=e(157),k=e.n(o),D={nullOrUndefined:x,object:_,number:function(e){return t(e)===Number&&!Number.isNaN(e)},string:S,boolean:function(e){return t(e)===Boolean},function:function(e){return t(e)===Function},array:T,weakMap:function(e){return n(e,WeakMap)},nodeList:C,element:function(e){return n(e,Element)},textNode:function(e){return t(e)===Text},event:function(e){return n(e,Event)},keyboardEvent:function(e){return n(e,KeyboardEvent)},cue:function(e){return n(e,window.TextTrackCue)||n(e,window.VTTCue)},track:function(e){return n(e,TextTrack)||!x(e)&&S(e.kind)},url:function(e){if(n(e,window.URL))return!0;var t=e;e.startsWith("http://")&&e.startsWith("https://")||(t="http://".concat(e));try{return!E(new URL(t).hostname)}catch(e){return!1}},empty:E},O=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function l(t,e,n){var o,a=this,i=3<arguments.length&&void 0!==arguments[3]&&arguments[3],r=!(4<arguments.length&&void 0!==arguments[4])||arguments[4],s=5<arguments.length&&void 0!==arguments[5]&&arguments[5];t&&"addEventListener"in t&&!D.empty(e)&&D.function(n)&&(e=e.split(" "),o=O?{passive:r,capture:s}:s,e.forEach(function(e){a&&a.eventListeners&&i&&a.eventListeners.push({element:t,type:e,callback:n,options:o}),t[i?"addEventListener":"removeEventListener"](e,n,o)}))}function z(e){l.call(this,e,1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",2<arguments.length?arguments[2]:void 0,!0,!(3<arguments.length&&void 0!==arguments[3])||arguments[3],4<arguments.length&&void 0!==arguments[4]&&arguments[4])}function M(e){l.call(this,e,1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",2<arguments.length?arguments[2]:void 0,!1,!(3<arguments.length&&void 0!==arguments[3])||arguments[3],4<arguments.length&&void 0!==arguments[4]&&arguments[4])}function te(a){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",r=2<arguments.length?arguments[2]:void 0,s=!(3<arguments.length&&void 0!==arguments[3])||arguments[3],c=4<arguments.length&&void 0!==arguments[4]&&arguments[4];l.call(this,a,i,function e(){M(a,i,e,s,c);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];r.apply(this,n)},!0,s,c)}function B(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};D.element(e)&&!D.empty(t)&&(t=new CustomEvent(t,{bubbles:n,detail:Object.assign({},o,{emulator:this})}),e.dispatchEvent(t))}var o=e(158),R=e.n(o);function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,a=!1,i=void 0;try{for(var r,s=e[Symbol.iterator]();!(o=(r=s.next()).done)&&(n.push(r.value),!t||n.length!==t);o=!0);}catch(e){a=!0,i=e}finally{try{o||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function j(e,a){e=e.length?e:[e];Array.from(e).reverse().forEach(function(e,t){var t=0<t?a.cloneNode(!0):a,n=e.parentNode,o=e.nextSibling;t.appendChild(e),o?n.insertBefore(t,o):n.appendChild(t)})}function N(n,e){D.element(n)&&!D.empty(e)&&Object.entries(e).filter(function(e){e=P(e,2)[1];return!D.nullOrUndefined(e)}).forEach(function(e){var e=P(e,2),t=e[0],e=e[1];return n.setAttribute(t,e)})}function U(e,t,n){e=document.createElement(e);return D.object(t)&&N(e,t),D.string(n)&&(e.innerText=n),e}function I(e){D.nodeList(e)||D.array(e)?Array.from(e).forEach(I):D.element(e)&&D.element(e.parentNode)&&e.parentNode.removeChild(e)}function L(e,t){if(!D.string(e)||D.empty(e))return{};var i={},r=t;return e.split(",").forEach(function(e){var t=e.trim(),n=t.replace(".",""),e=t.replace(/[[\]]/g,"").split("="),o=e[0],a=1<e.length?e[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":D.object(r)&&D.string(r.class)&&(r.class+=" ".concat(n)),i.class=n;break;case"#":i.id=t.replace("#","");break;case"[":i[o]=a}}),i}function F(e,t){D.element(e)&&((t=D.boolean(t=t)?t:!e.hidden)?e.setAttribute("hidden",""):e.removeAttribute("hidden"))}function G(e,t,n){return D.nodeList(e)?Array.from(e).map(function(e){return G(e,t,n)}):!!D.element(e)&&(e.classList[void 0!==n?n?"add":"remove":"toggle"](t),e.classList.contains(t))}function ne(e,t){return D.element(e)&&e.classList.contains(t)}function oe(e,t){var n={Element:Element};return(n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function s(e){return this.elements.container.querySelectorAll(e)}function V(e){return this.elements.container.querySelector(e)}function ae(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];D.element(e)&&(e.focus(),t&&G(e,this.config.classNames.tabFocus))}function q(e){return k.a.bind(R.a)(e)}ie=document.createElement("span"),o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(o).find(function(e){return void 0!==ie.style[e]});var ie,re=!!D.string(i)&&o[i];function se(e){setTimeout(function(){try{F(e,!0),e.offsetHeight,F(e,!1)}catch(e){}},0)}var H={isEdge:"Netscape"===navigator.appName&&-1<navigator.appVersion.indexOf("Edge"),isIE:!!document.documentMode,isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform),info:function(){var e=/(MSIE|(?!Gecko.+)Firefox|(?!AppleWebKit.+Chrome.+)Safari|(?!AppleWebKit.+)Chrome|AppleWebKit(?!.+Chrome|.+Safari)|Gecko(?!.+Firefox))(?: |\/)([\d\.apre]+)/.exec(navigator.userAgent);return{name:e[1].toLowerCase(),version:e[2]}}},W={rangeInput:((o=document.createElement("input")).type="range")===o.type,touch:"ontouchstart"in document.documentElement,transitions:!1!==re,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches,webgl:function(){var e={DETECTED:!1};if(!e.DETECTED){var t=document.createElement("canvas");if(t&&t.getContext)for(var n=["webgl2","experimental-webgl2","webgl","experimental-webgl"],o=0,a=n.length;o<a;++o){var i=n[o],r=t.getContext(i);if(r){e.WEBGL_CONTEXT=i,e.WEBGL_VERSION=r.getParameter(r.VERSION),e.WEBGL_VENDOR=r.getParameter(r.VENDOR),e.WEBGL_SL_VERSION=r.getParameter(r.SHADING_LANGUAGE_VERSION),e.MAX_TEXTURE_SIZE=r.getParameter(r.MAX_TEXTURE_SIZE);i=r.getExtension("WEBGL_debug_renderer_info");i&&(e.WEBGL_VENDOR=r.getParameter(i.UNMASKED_VENDOR_WEBGL),e.WEBGL_RENDERER=r.getParameter(i.UNMASKED_RENDERER_WEBGL)),e.DETECTED=!0;break}}}return e}(),wasm:"undefined"!=typeof WebAssembly&&D.object(WebAssembly),audioContext:"undefined"!=typeof AudioContext};function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length,n=new Array(1<e?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];if(!n.length)return t;var a=n.shift();return D.object(a)?(Object.keys(a).forEach(function(e){D.object(a[e])?(Object.keys(t).includes(e)||Object.assign(t,ce({},e,{})),Y(t[e],a[e])):Object.assign(t,ce({},e,a[e]))}),Y.apply(void 0,[t].concat(n))):t}function le(e,t,n){e=0<arguments.length&&void 0!==e?e:"",t=1<arguments.length&&void 0!==t?t:"",n=2<arguments.length&&void 0!==n?n:"";return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1"),"g"),n.toString())}var de=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(D.empty(e)||D.empty(t))return"";n=t.i18n;var n,o=e.split(".").reduce(function(e,t){return e&&e[t]},n);if(D.empty(o))return"";e={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(e).forEach(function(e){t=2;var e=function(e){if(Array.isArray(e))return e}(e=e)||function(e,t){var n=[],o=!0,a=!1,i=void 0;try{for(var r,s=e[Symbol.iterator]();!(o=(r=s.next()).done)&&(n.push(r.value),!t||n.length!==t);o=!0);}catch(e){a=!0,i=e}finally{try{o||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}(),t=e[0],e=e[1];o=le(o,t,e)}),o};function ue(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}i=[{key:"supported",get:function(){try{return"localStorage"in window&&(window.localStorage.getItem("___test")||window.localStorage.setItem("___test","___test"),!0)}catch(e){return!1}}}],ue((o=pe).prototype,[{key:"get",value:function(e){if(!pe.supported||!this.enabled)return null;var t=window.localStorage.getItem(this.key);if(D.empty(t))return null;t=JSON.parse(t);return D.string(e)&&e.length?t[e]:t}},{key:"set",value:function(e){var t;pe.supported&&this.enabled&&D.object(e)&&(t=this.get(),Y(t=D.empty(t)?{}:t,e),window.localStorage.setItem(this.key,JSON.stringify(t)))}}]),ue(o,i);var fe=pe;function pe(e,t){if(!(this instanceof pe))throw new TypeError("Cannot call a class as a function");this.enabled=!0,this.key=t}var o=e(108),he=e.n(o),a=e(6),i=e(159),me=e.n(i),ge={"2xScaleHQ.glslp":'shaders = 1\n\nshader0 = "2xScaleHQ.glsl"\nfilter_linear0 = false\nscale_type_0 = source\n',"4xScaleHQ.glslp":'shaders = 1\n\nshader0 = "4xScaleHQ.glsl"\nfilter_linear0 = false\nscale_type_0 = source\n',"crt-easymode.glslp":"shaders = 1\n\nshader0 = crt-easymode.glsl\nfilter_linear0 = false\nscale_type_0 = source\n","crt-aperture.glslp":"shaders = 1\n\nshader0 = crt-aperture.glsl\nfilter_linear0 = false\n","crt-geom.glslp":"shaders = 1\n\nshader0 = crt-geom.glsl\nfilter_linear0 = false\nscale_type_0 = source\n","2xScaleHQ.glsl":"/*\n2xGLSLHqFilter shader\n\nCopyright (C) 2005 guest(r) - guest.r@gmail.com\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n*/\n\n#if defined(VERTEX)\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING out\n#define COMPAT_ATTRIBUTE in\n#define COMPAT_TEXTURE texture\n#else\n#define COMPAT_VARYING varying \n#define COMPAT_ATTRIBUTE attribute \n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nCOMPAT_ATTRIBUTE vec4 VertexCoord;\nCOMPAT_ATTRIBUTE vec4 COLOR;\nCOMPAT_ATTRIBUTE vec4 TexCoord;\nCOMPAT_VARYING vec4 COL0;\nCOMPAT_VARYING vec4 TEX0;\nCOMPAT_VARYING vec4 t1;\nCOMPAT_VARYING vec4 t2;\nCOMPAT_VARYING vec4 t3;\nCOMPAT_VARYING vec4 t4;\n\nvec4 _oPosition1; \nuniform mat4 MVPMatrix;\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\n\n// compatibility #defines\n#define vTexCoord TEX0.xy\n#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize\n#define OutSize vec4(OutputSize, 1.0 / OutputSize)\n\nvoid main()\n{\ngl_Position = MVPMatrix * VertexCoord;\nTEX0.xy = TexCoord.xy;\nfloat x = 0.5 * SourceSize.z;\nfloat y = 0.5 * SourceSize.w;\nvec2 dg1 = vec2( x, y);\nvec2 dg2 = vec2(-x, y);\nvec2 dx = vec2(x, 0.0);\nvec2 dy = vec2(0.0, y);\nt1 = vec4(vTexCoord - dg1, vTexCoord - dy);\nt2 = vec4(vTexCoord - dg2, vTexCoord + dx);\nt3 = vec4(vTexCoord + dg1, vTexCoord + dy);\nt4 = vec4(vTexCoord + dg2, vTexCoord - dx);\n}\n\n#elif defined(FRAGMENT)\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING in\n#define COMPAT_TEXTURE texture\nout vec4 FragColor;\n#else\n#define COMPAT_VARYING varying\n#define FragColor gl_FragColor\n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\nuniform sampler2D Texture;\nCOMPAT_VARYING vec4 TEX0;\nCOMPAT_VARYING vec4 t1;\nCOMPAT_VARYING vec4 t2;\nCOMPAT_VARYING vec4 t3;\nCOMPAT_VARYING vec4 t4;\n\n// compatibility #defines\n#define Source Texture\n#define vTexCoord TEX0.xy\n\n#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize\n#define OutSize vec4(OutputSize, 1.0 / OutputSize)\n\nfloat mx = 0.325; // start smoothing wt.\nfloat k = -0.250; // wt. decrease factor\nfloat max_w = 0.25; // max filter weight\nfloat min_w =-0.05; // min filter weight\nfloat lum_add = 0.25; // affects smoothing\nvec3 dt = vec3(1.0);\n\nvoid main()\n{\nvec3 c00 = COMPAT_TEXTURE(Source, t1.xy).xyz; \nvec3 c10 = COMPAT_TEXTURE(Source, t1.zw).xyz; \nvec3 c20 = COMPAT_TEXTURE(Source, t2.xy).xyz; \nvec3 c01 = COMPAT_TEXTURE(Source, t4.zw).xyz; \nvec3 c11 = COMPAT_TEXTURE(Source, vTexCoord).xyz; \nvec3 c21 = COMPAT_TEXTURE(Source, t2.zw).xyz; \nvec3 c02 = COMPAT_TEXTURE(Source, t4.xy).xyz; \nvec3 c12 = COMPAT_TEXTURE(Source, t3.zw).xyz; \nvec3 c22 = COMPAT_TEXTURE(Source, t3.xy).xyz; \n\nfloat md1 = dot(abs(c00 - c22), dt);\nfloat md2 = dot(abs(c02 - c20), dt);\n\nfloat w1 = dot(abs(c22 - c11), dt) * md2;\nfloat w2 = dot(abs(c02 - c11), dt) * md1;\nfloat w3 = dot(abs(c00 - c11), dt) * md2;\nfloat w4 = dot(abs(c20 - c11), dt) * md1;\n\nfloat t1 = w1 + w3;\nfloat t2 = w2 + w4;\nfloat ww = max(t1, t2) + 0.0001;\n\nc11 = (w1 * c00 + w2 * c20 + w3 * c22 + w4 * c02 + ww * c11) / (t1 + t2 + ww);\n\nfloat lc1 = k / (0.12 * dot(c10 + c12 + c11, dt) + lum_add);\nfloat lc2 = k / (0.12 * dot(c01 + c21 + c11, dt) + lum_add);\n\nw1 = clamp(lc1 * dot(abs(c11 - c10), dt) + mx, min_w, max_w);\nw2 = clamp(lc2 * dot(abs(c11 - c21), dt) + mx, min_w, max_w);\nw3 = clamp(lc1 * dot(abs(c11 - c12), dt) + mx, min_w, max_w);\nw4 = clamp(lc2 * dot(abs(c11 - c01), dt) + mx, min_w, max_w);\nFragColor = vec4(w1 * c10 + w2 * c21 + w3 * c12 + w4 * c01 + (1.0 - w1 - w2 - w3 - w4) * c11, 1.0);\n} \n#endif\n","4xScaleHQ.glsl":"/*\n4xGLSLHqFilter shader\n\nCopyright (C) 2005 guest(r) - guest.r@gmail.com\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n*/\n\n#if defined(VERTEX)\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING out\n#define COMPAT_ATTRIBUTE in\n#define COMPAT_TEXTURE texture\n#else\n#define COMPAT_VARYING varying \n#define COMPAT_ATTRIBUTE attribute \n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nCOMPAT_ATTRIBUTE vec4 VertexCoord;\nCOMPAT_ATTRIBUTE vec4 COLOR;\nCOMPAT_ATTRIBUTE vec4 TexCoord;\nCOMPAT_VARYING vec4 COL0;\nCOMPAT_VARYING vec4 TEX0;\nCOMPAT_VARYING vec4 t1;\nCOMPAT_VARYING vec4 t2;\nCOMPAT_VARYING vec4 t3;\nCOMPAT_VARYING vec4 t4;\nCOMPAT_VARYING vec4 t5;\nCOMPAT_VARYING vec4 t6;\n\nvec4 _oPosition1; \nuniform mat4 MVPMatrix;\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\n\n// compatibility #defines\n#define vTexCoord TEX0.xy\n#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize\n#define OutSize vec4(OutputSize, 1.0 / OutputSize)\n\nvoid main()\n{\ngl_Position = MVPMatrix * VertexCoord;\nTEX0.xy = TexCoord.xy;\nfloat x = 0.5 * SourceSize.z;\nfloat y = 0.5 * SourceSize.w;\nvec2 dg1 = vec2( x, y);\nvec2 dg2 = vec2(-x, y);\nvec2 sd1 = dg1 * 0.5;\nvec2 sd2 = dg2 * 0.5;\nvec2 ddx = vec2(x, 0.0);\nvec2 ddy = vec2(0.0, y);\nt1 = vec4(vTexCoord - sd1, vTexCoord - ddy);\nt2 = vec4(vTexCoord - sd2, vTexCoord + ddx);\nt3 = vec4(vTexCoord + sd1, vTexCoord + ddy);\nt4 = vec4(vTexCoord + sd2, vTexCoord - ddx);\nt5 = vec4(vTexCoord - dg1, vTexCoord - dg2);\nt6 = vec4(vTexCoord + dg1, vTexCoord + dg2);\n}\n\n#elif defined(FRAGMENT)\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING in\n#define COMPAT_TEXTURE texture\nout vec4 FragColor;\n#else\n#define COMPAT_VARYING varying\n#define FragColor gl_FragColor\n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\nuniform sampler2D Texture;\nCOMPAT_VARYING vec4 TEX0;\nCOMPAT_VARYING vec4 t1;\nCOMPAT_VARYING vec4 t2;\nCOMPAT_VARYING vec4 t3;\nCOMPAT_VARYING vec4 t4;\nCOMPAT_VARYING vec4 t5;\nCOMPAT_VARYING vec4 t6;\n\n// compatibility #defines\n#define Source Texture\n#define vTexCoord TEX0.xy\n\n#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize\n#define OutSize vec4(OutputSize, 1.0 / OutputSize)\n\nfloat mx = 1.0; // start smoothing wt.\nfloat k = -1.10; // wt. decrease factor\nfloat max_w = 0.75; // max filter weight\nfloat min_w = 0.03; // min filter weight\nfloat lum_add = 0.33; // affects smoothing\nvec3 dt = vec3(1.0);\n\nvoid main()\n{\nvec3 c = COMPAT_TEXTURE(Source, vTexCoord).xyz;\nvec3 i1 = COMPAT_TEXTURE(Source, t1.xy).xyz; \nvec3 i2 = COMPAT_TEXTURE(Source, t2.xy).xyz; \nvec3 i3 = COMPAT_TEXTURE(Source, t3.xy).xyz; \nvec3 i4 = COMPAT_TEXTURE(Source, t4.xy).xyz; \nvec3 o1 = COMPAT_TEXTURE(Source, t5.xy).xyz; \nvec3 o3 = COMPAT_TEXTURE(Source, t6.xy).xyz; \nvec3 o2 = COMPAT_TEXTURE(Source, t5.zw).xyz;\nvec3 o4 = COMPAT_TEXTURE(Source, t6.zw).xyz;\nvec3 s1 = COMPAT_TEXTURE(Source, t1.zw).xyz; \nvec3 s2 = COMPAT_TEXTURE(Source, t2.zw).xyz; \nvec3 s3 = COMPAT_TEXTURE(Source, t3.zw).xyz; \nvec3 s4 = COMPAT_TEXTURE(Source, t4.zw).xyz; \n\nfloat ko1=dot(abs(o1-c),dt);\nfloat ko2=dot(abs(o2-c),dt);\nfloat ko3=dot(abs(o3-c),dt);\nfloat ko4=dot(abs(o4-c),dt);\n\nfloat k1=min(dot(abs(i1-i3),dt),max(ko1,ko3));\nfloat k2=min(dot(abs(i2-i4),dt),max(ko2,ko4));\n\nfloat w1 = k2; if(ko3<ko1) w1*=ko3/ko1;\nfloat w2 = k1; if(ko4<ko2) w2*=ko4/ko2;\nfloat w3 = k2; if(ko1<ko3) w3*=ko1/ko3;\nfloat w4 = k1; if(ko2<ko4) w4*=ko2/ko4;\n\nc=(w1*o1+w2*o2+w3*o3+w4*o4+0.001*c)/(w1+w2+w3+w4+0.001);\nw1 = k*dot(abs(i1-c)+abs(i3-c),dt)/(0.125*dot(i1+i3,dt)+lum_add);\nw2 = k*dot(abs(i2-c)+abs(i4-c),dt)/(0.125*dot(i2+i4,dt)+lum_add);\nw3 = k*dot(abs(s1-c)+abs(s3-c),dt)/(0.125*dot(s1+s3,dt)+lum_add);\nw4 = k*dot(abs(s2-c)+abs(s4-c),dt)/(0.125*dot(s2+s4,dt)+lum_add);\n\nw1 = clamp(w1+mx,min_w,max_w); \nw2 = clamp(w2+mx,min_w,max_w);\nw3 = clamp(w3+mx,min_w,max_w); \nw4 = clamp(w4+mx,min_w,max_w);\n\nFragColor = vec4((w1*(i1+i3)+w2*(i2+i4)+w3*(s1+s3)+w4*(s2+s4)+c)/(2.0*(w1+w2+w3+w4)+1.0), 1.0);\n} \n#endif\n","crt-easymode.glsl":"#if defined(VERTEX)\n\n #if __VERSION__ >= 130\n #define COMPAT_VARYING out\n #define COMPAT_ATTRIBUTE in\n #define COMPAT_TEXTURE texture\n #else\n #define COMPAT_VARYING varying\n #define COMPAT_ATTRIBUTE attribute\n #define COMPAT_TEXTURE texture2D\n #endif\n \n #ifdef GL_ES\n #define COMPAT_PRECISION mediump\n #else\n #define COMPAT_PRECISION\n #endif\n COMPAT_VARYING float _frame_rotation;\n struct input_dummy {\n vec2 _video_size;\n vec2 _texture_size;\n vec2 _output_dummy_size;\n float _frame_count;\n float _frame_direction;\n float _frame_rotation;\n };\n vec4 _oPosition1;\n vec4 _r0005;\n COMPAT_ATTRIBUTE vec4 VertexCoord;\n COMPAT_ATTRIBUTE vec4 TexCoord;\n COMPAT_VARYING vec4 TEX0;\n \n uniform mat4 MVPMatrix;\n uniform int FrameDirection;\n uniform int FrameCount;\n uniform COMPAT_PRECISION vec2 OutputSize;\n uniform COMPAT_PRECISION vec2 TextureSize;\n uniform COMPAT_PRECISION vec2 InputSize;\n void main()\n {\n vec2 _oTex;\n _r0005 = VertexCoord.x*MVPMatrix[0];\n _r0005 = _r0005 + VertexCoord.y*MVPMatrix[1];\n _r0005 = _r0005 + VertexCoord.z*MVPMatrix[2];\n _r0005 = _r0005 + VertexCoord.w*MVPMatrix[3];\n _oPosition1 = _r0005;\n _oTex = TexCoord.xy;\n gl_Position = _r0005;\n TEX0.xy = TexCoord.xy;\n }\n #elif defined(FRAGMENT)\n \n #if __VERSION__ >= 130\n #define COMPAT_VARYING in\n #define COMPAT_TEXTURE texture\n out vec4 FragColor;\n #else\n #define COMPAT_VARYING varying\n #define FragColor gl_FragColor\n #define COMPAT_TEXTURE texture2D\n #endif\n \n #ifdef GL_ES\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n #endif\n #define COMPAT_PRECISION mediump\n #else\n #define COMPAT_PRECISION\n #endif\n COMPAT_VARYING float _frame_rotation;\n struct input_dummy {\n vec2 _video_size;\n vec2 _texture_size;\n vec2 _output_dummy_size;\n float _frame_count;\n float _frame_direction;\n float _frame_rotation;\n };\n vec4 _ret_0;\n float _TMP30;\n float _TMP29;\n float _TMP28;\n float _TMP13;\n float _TMP32;\n float _TMP11;\n float _TMP10;\n float _TMP31;\n float _TMP9;\n float _TMP8;\n float _TMP15;\n float _TMP14;\n float _TMP33;\n vec4 _TMP34;\n vec4 _TMP27;\n vec4 _TMP25;\n vec4 _TMP23;\n vec4 _TMP21;\n vec4 _TMP26;\n vec4 _TMP24;\n vec4 _TMP22;\n vec4 _TMP20;\n float _TMP4;\n vec4 _TMP3;\n vec4 _TMP2;\n float _TMP19;\n float _TMP18;\n float _TMP17;\n float _TMP16;\n vec4 _TMP1;\n vec2 _TMP0;\n uniform sampler2D Texture;\n input_dummy _IN1;\n float _TMP43;\n float _x_step0044;\n float _curve0044;\n float _a0048;\n float _val0052;\n float _a0052;\n vec4 _TMP57;\n vec4 _x0072;\n vec2 _c0086;\n vec4 _x0088;\n vec4 _x0094;\n vec2 _c0098;\n vec4 _x0100;\n vec2 _c0104;\n vec4 _x0106;\n vec4 _sample_min0110;\n vec4 _sample_max0110;\n vec4 _r0112;\n vec4 _TMP117;\n vec2 _co0124;\n vec2 _c0126;\n vec4 _x0128;\n vec4 _x0134;\n vec2 _c0138;\n vec4 _x0140;\n vec2 _c0144;\n vec4 _x0146;\n vec4 _sample_min0150;\n vec4 _sample_max0150;\n vec4 _r0152;\n vec4 _TMP157;\n float _TMP163;\n float _x_step0164;\n float _curve0164;\n float _a0168;\n float _val0172;\n float _a0172;\n float _TMP183;\n float _TMP189;\n float _x0190;\n float _a0196;\n float _x0198;\n vec2 _x0200;\n float _x0208;\n COMPAT_VARYING vec4 TEX0;\n \n uniform COMPAT_PRECISION vec2 OutputSize;\n uniform COMPAT_PRECISION vec2 TextureSize;\n uniform COMPAT_PRECISION vec2 InputSize;\n void main()\n {\n vec2 _dx1;\n vec2 _dy;\n vec2 _pix_co;\n vec2 _tex_co;\n vec2 _dist;\n vec3 _col2;\n vec3 _col21;\n vec4 _coeffs1;\n float _luma;\n float _bright;\n float _scan_weight;\n vec2 _mod_fac;\n int _dot_no;\n vec3 _mask_weight;\n vec3 _TMP37;\n _dx1 = vec2(1.00000000E+00/TextureSize.x, 0.00000000E+00);\n _dy = vec2(0.00000000E+00, 1.00000000E+00/TextureSize.y);\n _pix_co = TEX0.xy*TextureSize - vec2( 5.00000000E-01, 5.00000000E-01);\n _TMP0 = floor(_pix_co);\n _tex_co = (_TMP0 + vec2( 5.00000000E-01, 5.00000000E-01))/TextureSize;\n _dist = fract(_pix_co);\n _x_step0044 = float((_dist.x >= 5.00000000E-01));\n _a0048 = 2.50000000E-01 - (_dist.x - _x_step0044)*(_dist.x - _x_step0044);\n _TMP33 = inversesqrt(_a0048);\n _TMP14 = 1.00000000E+00/_TMP33;\n _a0052 = 5.00000000E-01 - _dist.x;\n _val0052 = float((_a0052 > 0.00000000E+00));\n _TMP15 = _val0052 - float((_a0052 < 0.00000000E+00));\n _curve0044 = 5.00000000E-01 - _TMP14*_TMP15;\n _TMP43 = _dist.x + 2.50000000E-01*(_curve0044 - _dist.x);\n _coeffs1 = 3.14159274E+00*vec4(1.00000000E+00 + _TMP43, _TMP43, 1.00000000E+00 - _TMP43, 2.00000000E+00 - _TMP43);\n _TMP1 = abs(_coeffs1);\n _TMP57 = max(_TMP1, vec4( 9.99999975E-06, 9.99999975E-06, 9.99999975E-06, 9.99999975E-06));\n _TMP16 = sin(_TMP57.x);\n _TMP17 = sin(_TMP57.y);\n _TMP18 = sin(_TMP57.z);\n _TMP19 = sin(_TMP57.w);\n _TMP2 = vec4(_TMP16, _TMP17, _TMP18, _TMP19);\n _x0072 = _TMP57/2.00000000E+00;\n _TMP16 = sin(_x0072.x);\n _TMP17 = sin(_x0072.y);\n _TMP18 = sin(_x0072.z);\n _TMP19 = sin(_x0072.w);\n _TMP3 = vec4(_TMP16, _TMP17, _TMP18, _TMP19);\n _coeffs1 = ((2.00000000E+00*_TMP2)*_TMP3)/(_TMP57*_TMP57);\n _TMP4 = dot(_coeffs1, vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _coeffs1 = _coeffs1/_TMP4;\n _c0086 = _tex_co - _dx1;\n _TMP20 = COMPAT_TEXTURE(Texture, _c0086);\n _x0088 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP20 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP21 = _TMP20*_x0088;\n _TMP22 = COMPAT_TEXTURE(Texture, _tex_co);\n _x0094 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP22 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP23 = _TMP22*_x0094;\n _c0098 = _tex_co + _dx1;\n _TMP24 = COMPAT_TEXTURE(Texture, _c0098);\n _x0100 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP24 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP25 = _TMP24*_x0100;\n _c0104 = _tex_co + 2.00000000E+00*_dx1;\n _TMP26 = COMPAT_TEXTURE(Texture, _c0104);\n _x0106 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP26 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP27 = _TMP26*_x0106;\n _r0112 = _coeffs1.x*_TMP21;\n _r0112 = _r0112 + _coeffs1.y*_TMP23;\n _r0112 = _r0112 + _coeffs1.z*_TMP25;\n _r0112 = _r0112 + _coeffs1.w*_TMP27;\n _sample_min0110 = min(_TMP23, _TMP25);\n _sample_max0110 = max(_TMP23, _TMP25);\n _TMP34 = min(_sample_max0110, _r0112);\n _TMP117 = max(_sample_min0110, _TMP34);\n _co0124 = _tex_co + _dy;\n _c0126 = _co0124 - _dx1;\n _TMP20 = COMPAT_TEXTURE(Texture, _c0126);\n _x0128 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP20 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP21 = _TMP20*_x0128;\n _TMP22 = COMPAT_TEXTURE(Texture, _co0124);\n _x0134 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP22 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP23 = _TMP22*_x0134;\n _c0138 = _co0124 + _dx1;\n _TMP24 = COMPAT_TEXTURE(Texture, _c0138);\n _x0140 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP24 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP25 = _TMP24*_x0140;\n _c0144 = _co0124 + 2.00000000E+00*_dx1;\n _TMP26 = COMPAT_TEXTURE(Texture, _c0144);\n _x0146 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP26 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP27 = _TMP26*_x0146;\n _r0152 = _coeffs1.x*_TMP21;\n _r0152 = _r0152 + _coeffs1.y*_TMP23;\n _r0152 = _r0152 + _coeffs1.z*_TMP25;\n _r0152 = _r0152 + _coeffs1.w*_TMP27;\n _sample_min0150 = min(_TMP23, _TMP25);\n _sample_max0150 = max(_TMP23, _TMP25);\n _TMP34 = min(_sample_max0150, _r0152);\n _TMP157 = max(_sample_min0150, _TMP34);\n _x_step0164 = float((_dist.y >= 5.00000000E-01));\n _a0168 = 2.50000000E-01 - (_dist.y - _x_step0164)*(_dist.y - _x_step0164);\n _TMP33 = inversesqrt(_a0168);\n _TMP14 = 1.00000000E+00/_TMP33;\n _a0172 = 5.00000000E-01 - _dist.y;\n _val0172 = float((_a0172 > 0.00000000E+00));\n _TMP15 = _val0172 - float((_a0172 < 0.00000000E+00));\n _curve0164 = 5.00000000E-01 - _TMP14*_TMP15;\n _TMP163 = _dist.y + (_curve0164 - _dist.y);\n _col2 = _TMP117.xyz + _TMP163*(_TMP157.xyz - _TMP117.xyz);\n _luma = dot(vec3( 2.12599993E-01, 7.15200007E-01, 7.22000003E-02), _col2);\n _TMP8 = max(_col2.y, _col2.z);\n _TMP9 = max(_col2.x, _TMP8);\n _bright = (_TMP9 + _luma)/2.00000000E+00;\n _TMP31 = min(6.49999976E-01, _bright);\n _TMP183 = max(3.49999994E-01, _TMP31);\n _x0190 = _bright*1.50000000E+00;\n _TMP31 = min(1.50000000E+00, _x0190);\n _TMP189 = max(1.50000000E+00, _TMP31);\n _a0196 = TEX0.y*2.00000000E+00*3.14159274E+00*TextureSize.y;\n _TMP10 = cos(_a0196);\n _x0198 = _TMP10*5.00000000E-01 + 5.00000000E-01;\n _TMP11 = pow(_x0198, _TMP189);\n _scan_weight = 1.00000000E+00 - _TMP11;\n _x0200 = (TEX0.xy*OutputSize*TextureSize)/InputSize;\n _mod_fac = floor(_x0200);\n _x0208 = _mod_fac.x/3.00000000E+00;\n _TMP32 = floor(_x0208);\n _TMP13 = _mod_fac.x - 3.00000000E+00*_TMP32;\n _dot_no = int(_TMP13);\n if (_dot_no == 0) {\n _mask_weight = vec3( 1.00000000E+00, 6.99999988E-01, 6.99999988E-01);\n } else {\n if (_dot_no == 1) {\n _mask_weight = vec3( 6.99999988E-01, 1.00000000E+00, 6.99999988E-01);\n } else {\n _mask_weight = vec3( 6.99999988E-01, 6.99999988E-01, 1.00000000E+00);\n }\n }\n if (InputSize.y >= 4.00000000E+02) {\n _scan_weight = 1.00000000E+00;\n }\n _col21 = _col2.xyz;\n _col2 = _col2*vec3(_scan_weight, _scan_weight, _scan_weight);\n _col2 = _col2 + _TMP183*(_col21 - _col2);\n _col2 = _col2*_mask_weight;\n _TMP28 = pow(_col2.x, 5.55555582E-01);\n _TMP29 = pow(_col2.y, 5.55555582E-01);\n _TMP30 = pow(_col2.z, 5.55555582E-01);\n _col2 = vec3(_TMP28, _TMP29, _TMP30);\n _TMP37 = _col2*1.20000005E+00;\n _ret_0 = vec4(_TMP37.x, _TMP37.y, _TMP37.z, 1.00000000E+00);\n FragColor = _ret_0;\n return;\n }\n #endif\n","crt-aperture.glsl":'\n/*\nCRT Shader by EasyMode\nLicense: GPL\n*/\n/*\n#pragma parameter SHARPNESS_IMAGE "Sharpness Image" 1.0 1.0 5.0 1.0\n#pragma parameter SHARPNESS_EDGES "Sharpness Edges" 3.0 1.0 5.0 1.0\n#pragma parameter GLOW_WIDTH "Glow Width" 0.5 0.05 0.65 0.05\n#pragma parameter GLOW_HEIGHT "Glow Height" 0.5 0.05 0.65 0.05\n#pragma parameter GLOW_HALATION "Glow Halation" 0.1 0.0 1.0 0.01\n#pragma parameter GLOW_DIFFUSION "Glow Diffusion" 0.05 0.0 1.0 0.01\n#pragma parameter MASK_COLORS "Mask Colors" 2.0 2.0 3.0 1.0\n#pragma parameter MASK_STRENGTH "Mask Strength" 0.3 0.0 1.0 0.05\n#pragma parameter MASK_SIZE "Mask Size" 1.0 1.0 9.0 1.0\n#pragma parameter SCANLINE_SIZE_MIN "Scanline Size Min." 0.5 0.5 1.5 0.05\n#pragma parameter SCANLINE_SIZE_MAX "Scanline Size Max." 1.5 0.5 1.5 0.05\n#pragma parameter GAMMA_INPUT "Gamma Input" 2.4 1.0 5.0 0.1\n#pragma parameter GAMMA_OUTPUT "Gamma Output" 2.4 1.0 5.0 0.1\n#pragma parameter BRIGHTNESS "Brightness" 1.5 0.0 2.0 0.05\n* */\n\n#define Coord TEX0\n\n#if defined(VERTEX)\n\n#if __VERSION__ >= 130\n#define OUT out\n#define IN in\n#define tex2D texture\n#else\n#define OUT varying \n#define IN attribute \n#define tex2D texture2D\n#endif\n\n#ifdef GL_ES\n#define PRECISION mediump\n#else\n#define PRECISION\n#endif\n\nIN vec4 VertexCoord;\nIN vec4 Color;\nIN vec2 TexCoord;\nOUT vec4 color;\nOUT vec2 Coord;\n\nuniform mat4 MVPMatrix;\nuniform PRECISION int FrameDirection;\nuniform PRECISION int FrameCount;\nuniform PRECISION vec2 OutputSize;\nuniform PRECISION vec2 TextureSize;\nuniform PRECISION vec2 InputSize;\n\nvoid main()\n{\ngl_Position = MVPMatrix * VertexCoord;\ncolor = Color;\nCoord = TexCoord;\n}\n\n#elif defined(FRAGMENT)\n\n#if __VERSION__ >= 130\n#define IN in\n#define tex2D texture\nout vec4 FragColor;\n#else\n#define IN varying\n#define FragColor gl_FragColor\n#define tex2D texture2D\n#endif\n\n#ifdef GL_ES\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n#define PRECISION mediump\n#else\n#define PRECISION\n#endif\n\nuniform PRECISION int FrameDirection;\nuniform PRECISION int FrameCount;\nuniform PRECISION vec2 OutputSize;\nuniform PRECISION vec2 TextureSize;\nuniform PRECISION vec2 InputSize;\nuniform sampler2D Texture;\nIN vec2 Coord;\n\n#ifdef PARAMETER_UNIFORM\nuniform PRECISION float SHARPNESS_IMAGE;\nuniform PRECISION float SHARPNESS_EDGES;\nuniform PRECISION float GLOW_WIDTH;\nuniform PRECISION float GLOW_HEIGHT;\nuniform PRECISION float GLOW_HALATION;\nuniform PRECISION float GLOW_DIFFUSION;\nuniform PRECISION float MASK_COLORS;\nuniform PRECISION float MASK_STRENGTH;\nuniform PRECISION float MASK_SIZE;\nuniform PRECISION float SCANLINE_SIZE_MIN;\nuniform PRECISION float SCANLINE_SIZE_MAX;\nuniform PRECISION float GAMMA_INPUT;\nuniform PRECISION float GAMMA_OUTPUT;\nuniform PRECISION float BRIGHTNESS;\n#else\n#define SHARPNESS_IMAGE 1.0\n#define SHARPNESS_EDGES 3.0\n#define GLOW_WIDTH 0.5\n#define GLOW_HEIGHT 0.5\n#define GLOW_HALATION 0.1\n#define GLOW_DIFFUSION 0.05\n#define MASK_COLORS 2.0\n#define MASK_STRENGTH 0.3\n#define MASK_SIZE 1.0\n#define SCANLINE_SIZE_MIN 0.5\n#define SCANLINE_SIZE_MAX 1.5\n#define GAMMA_INPUT 2.4\n#define GAMMA_OUTPUT 2.4\n#define BRIGHTNESS 1.5\n#endif\n\n#define FIX(c) max(abs(c), 1e-5)\n#define PI 3.141592653589\n#define saturate(c) clamp(c, 0.0, 1.0)\n#define TEX2D(c) pow(tex2D(tex, c).rgb, vec3(GAMMA_INPUT))\n\nmat3 get_color_matrix(sampler2D tex, vec2 co, vec2 dx)\n{\nreturn mat3(TEX2D(co - dx), TEX2D(co), TEX2D(co + dx));\n}\n\nvec3 blur(mat3 m, float dist, float rad)\n{\nvec3 x = vec3(dist - 1.0, dist, dist + 1.0) / rad;\nvec3 w = exp2(x * x * -1.0);\n\nreturn (m[0] * w.x + m[1] * w.y + m[2] * w.z) / (w.x + w.y + w.z);\n}\n\nvec3 filter_gaussian(sampler2D tex, vec2 co, vec2 tex_size)\n{\nvec2 dx = vec2(1.0 / tex_size.x, 0.0);\nvec2 dy = vec2(0.0, 1.0 / tex_size.y);\nvec2 pix_co = co * tex_size;\nvec2 tex_co = (floor(pix_co) + 0.5) / tex_size;\nvec2 dist = (fract(pix_co) - 0.5) * -1.0;\n\nmat3 line0 = get_color_matrix(tex, tex_co - dy, dx);\nmat3 line1 = get_color_matrix(tex, tex_co, dx);\nmat3 line2 = get_color_matrix(tex, tex_co + dy, dx);\nmat3 column = mat3(blur(line0, dist.x, GLOW_WIDTH),\n blur(line1, dist.x, GLOW_WIDTH),\n blur(line2, dist.x, GLOW_WIDTH));\n\nreturn blur(column, dist.y, GLOW_HEIGHT);\n}\n\nvec3 filter_lanczos(sampler2D tex, vec2 co, vec2 tex_size, float sharp)\n{\ntex_size.x *= sharp;\n\nvec2 dx = vec2(1.0 / tex_size.x, 0.0);\nvec2 pix_co = co * tex_size - vec2(0.5, 0.0);\nvec2 tex_co = (floor(pix_co) + vec2(0.5, 0.0)) / tex_size;\nvec2 dist = fract(pix_co);\nvec4 coef = PI * vec4(dist.x + 1.0, dist.x, dist.x - 1.0, dist.x - 2.0);\n\ncoef = FIX(coef);\ncoef = 2.0 * sin(coef) * sin(coef / 2.0) / (coef * coef);\ncoef /= dot(coef, vec4(1.0));\n\nvec4 col1 = vec4(TEX2D(tex_co), 1.0);\nvec4 col2 = vec4(TEX2D(tex_co + dx), 1.0);\n\nreturn (mat4(col1, col1, col2, col2) * coef).rgb;\n}\n\nvec3 get_scanline_weight(float x, vec3 col)\n{\nvec3 beam = mix(vec3(SCANLINE_SIZE_MIN), vec3(SCANLINE_SIZE_MAX), col);\nvec3 x_mul = 2.0 / beam;\nvec3 x_offset = x_mul * 0.5;\n\nreturn smoothstep(0.0, 1.0, 1.0 - abs(x * x_mul - x_offset)) * x_offset;\n}\n\nvec3 get_mask_weight(float x)\n{\nfloat i = mod(floor(x * OutputSize.x * TextureSize.x / (InputSize.x * MASK_SIZE)), MASK_COLORS);\n\nif (i == 0.0) return mix(vec3(1.0, 0.0, 1.0), vec3(1.0, 0.0, 0.0), MASK_COLORS - 2.0);\nelse if (i == 1.0) return vec3(0.0, 1.0, 0.0);\nelse return vec3(0.0, 0.0, 1.0);\n}\n\nvoid main()\n{\nvec3 col_glow = filter_gaussian(Texture, Coord, TextureSize);\nvec3 col_soft = filter_lanczos(Texture, Coord, TextureSize, SHARPNESS_IMAGE);\nvec3 col_sharp = filter_lanczos(Texture, Coord, TextureSize, SHARPNESS_EDGES);\nvec3 col = sqrt(col_sharp * col_soft);\n\ncol *= get_scanline_weight(fract(Coord.y * TextureSize.y), col_soft);\ncol_glow = saturate(col_glow - col);\ncol += col_glow * col_glow * GLOW_HALATION;\ncol = mix(col, col * get_mask_weight(Coord.x) * MASK_COLORS, MASK_STRENGTH);\ncol += col_glow * GLOW_DIFFUSION;\ncol = pow(col * BRIGHTNESS, vec3(1.0 / GAMMA_OUTPUT));\n\nFragColor = vec4(col, 1.0);\n}\n\n#endif\n',"crt-geom.glsl":'\n/*\nCRT-interlaced\n\nCopyright (C) 2010-2012 cgwg, Themaister and DOLLS\n\nThis program is free software; you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the Free\nSoftware Foundation; either version 2 of the License, or (at your option)\nany later version.\n\n(cgwg gave their consent to have the original version of this shader\ndistributed under the GPL in this message:\n\nhttp://board.byuu.org/viewtopic.php?p=26075#p26075\n\n"Feel free to distribute my shaders under the GPL. After all, the\nbarrel distortion code was taken from the Curvature shader, which is\nunder the GPL."\n)\nThis shader variant is pre-configured with screen curvature\n*/\n/*\n#pragma parameter CRTgamma "CRTGeom Target Gamma" 2.4 0.1 5.0 0.1\n#pragma parameter monitorgamma "CRTGeom Monitor Gamma" 2.2 0.1 5.0 0.1\n#pragma parameter d "CRTGeom Distance" 1.6 0.1 3.0 0.1\n#pragma parameter CURVATURE "CRTGeom Curvature Toggle" 1.0 0.0 1.0 1.0\n#pragma parameter R "CRTGeom Curvature Radius" 2.0 0.1 10.0 0.1\n#pragma parameter cornersize "CRTGeom Corner Size" 0.03 0.001 1.0 0.005\n#pragma parameter cornersmooth "CRTGeom Corner Smoothness" 1000.0 80.0 2000.0 100.0\n#pragma parameter x_tilt "CRTGeom Horizontal Tilt" 0.0 -0.5 0.5 0.05\n#pragma parameter y_tilt "CRTGeom Vertical Tilt" 0.0 -0.5 0.5 0.05\n#pragma parameter overscan_x "CRTGeom Horiz. Overscan %" 100.0 -125.0 125.0 1.0\n#pragma parameter overscan_y "CRTGeom Vert. Overscan %" 100.0 -125.0 125.0 1.0\n#pragma parameter DOTMASK "CRTGeom Dot Mask Toggle" 0.3 0.0 0.3 0.3\n#pragma parameter SHARPER "CRTGeom Sharpness" 1.0 1.0 3.0 1.0\n#pragma parameter scanline_weight "CRTGeom Scanline Weight" 0.3 0.1 0.5 0.05\n*/\n\n#ifndef PARAMETER_UNIFORM\n#define CRTgamma 2.4\n#define monitorgamma 2.2\n#define d 1.6\n#define CURVATURE 1.0\n#define R 2.0\n#define cornersize 0.03\n#define cornersmooth 1000.0\n#define x_tilt 0.0\n#define y_tilt 0.0\n#define overscan_x 100.0\n#define overscan_y 100.0\n#define DOTMASK 0.3\n#define SHARPER 1.0\n#define scanline_weight 0.3\n#endif\n\n#if defined(VERTEX)\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING out\n#define COMPAT_ATTRIBUTE in\n#define COMPAT_TEXTURE texture\n#else\n#define COMPAT_VARYING varying \n#define COMPAT_ATTRIBUTE attribute \n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nCOMPAT_ATTRIBUTE vec4 VertexCoord;\nCOMPAT_ATTRIBUTE vec4 COLOR;\nCOMPAT_ATTRIBUTE vec4 TexCoord;\nCOMPAT_VARYING vec4 COL0;\nCOMPAT_VARYING vec4 TEX0;\n\nvec4 _oPosition1; \nuniform mat4 MVPMatrix;\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\n\nCOMPAT_VARYING vec2 overscan;\nCOMPAT_VARYING vec2 aspect;\nCOMPAT_VARYING vec3 stretch;\nCOMPAT_VARYING vec2 sinangle;\nCOMPAT_VARYING vec2 cosangle;\nCOMPAT_VARYING vec2 one;\nCOMPAT_VARYING float mod_factor;\nCOMPAT_VARYING vec2 ilfac;\n\n#ifdef PARAMETER_UNIFORM\nuniform COMPAT_PRECISION float CRTgamma;\nuniform COMPAT_PRECISION float monitorgamma;\nuniform COMPAT_PRECISION float d;\nuniform COMPAT_PRECISION float CURVATURE;\nuniform COMPAT_PRECISION float R;\nuniform COMPAT_PRECISION float cornersize;\nuniform COMPAT_PRECISION float cornersmooth;\nuniform COMPAT_PRECISION float x_tilt;\nuniform COMPAT_PRECISION float y_tilt;\nuniform COMPAT_PRECISION float overscan_x;\nuniform COMPAT_PRECISION float overscan_y;\nuniform COMPAT_PRECISION float DOTMASK;\nuniform COMPAT_PRECISION float SHARPER;\nuniform COMPAT_PRECISION float scanline_weight;\n#endif\n\n#define FIX(c) max(abs(c), 1e-5);\n\nfloat intersect(vec2 xy)\n{\nfloat A = dot(xy,xy)+d*d;\nfloat B = 2.0*(R*(dot(xy,sinangle)-d*cosangle.x*cosangle.y)-d*d);\nfloat C = d*d + 2.0*R*d*cosangle.x*cosangle.y;\nreturn (-B-sqrt(B*B-4.0*A*C))/(2.0*A);\n}\n\nvec2 bkwtrans(vec2 xy)\n{\nfloat c = intersect(xy);\nvec2 point = vec2(c)*xy;\npoint -= vec2(-R)*sinangle;\npoint /= vec2(R);\nvec2 tang = sinangle/cosangle;\nvec2 poc = point/cosangle;\nfloat A = dot(tang,tang)+1.0;\nfloat B = -2.0*dot(poc,tang);\nfloat C = dot(poc,poc)-1.0;\nfloat a = (-B+sqrt(B*B-4.0*A*C))/(2.0*A);\nvec2 uv = (point-a*sinangle)/cosangle;\nfloat r = R*acos(a);\nreturn uv*r/sin(r/R);\n}\n\nvec2 fwtrans(vec2 uv)\n{\nfloat r = FIX(sqrt(dot(uv,uv)));\nuv *= sin(r/R)/r;\nfloat x = 1.0-cos(r/R);\nfloat D = d/R + x*cosangle.x*cosangle.y+dot(uv,sinangle);\nreturn d*(uv*cosangle-x*sinangle)/D;\n}\n\nvec3 maxscale()\n{\nvec2 c = bkwtrans(-R * sinangle / (1.0 + R/d*cosangle.x*cosangle.y));\nvec2 a = vec2(0.5,0.5)*aspect;\nvec2 lo = vec2(fwtrans(vec2(-a.x,c.y)).x, fwtrans(vec2(c.x,-a.y)).y)/aspect;\nvec2 hi = vec2(fwtrans(vec2(+a.x,c.y)).x, fwtrans(vec2(c.x,+a.y)).y)/aspect;\nreturn vec3((hi+lo)*aspect*0.5,max(hi.x-lo.x,hi.y-lo.y));\n}\n\nvoid main()\n{\n// START of parameters\n\n// gamma of simulated CRT\n//\tCRTgamma = 1.8;\n// gamma of display monitor (typically 2.2 is correct)\n//\tmonitorgamma = 2.2;\n// overscan (e.g. 1.02 for 2% overscan)\noverscan = vec2(1.00,1.00);\n// aspect ratio\naspect = vec2(1.0, 0.75);\n// lengths are measured in units of (approximately) the width\n// of the monitor simulated distance from viewer to monitor\n//\td = 2.0;\n// radius of curvature\n//\tR = 1.5;\n// tilt angle in radians\n// (behavior might be a bit wrong if both components are\n// nonzero)\nconst vec2 angle = vec2(0.0,0.0);\n// size of curved corners\n//\tcornersize = 0.03;\n// border smoothness parameter\n// decrease if borders are too aliased\n//\tcornersmooth = 1000.0;\n\n// END of parameters\n\nvec4 _oColor;\nvec2 _otexCoord;\ngl_Position = VertexCoord.x * MVPMatrix[0] + VertexCoord.y * MVPMatrix[1] + VertexCoord.z * MVPMatrix[2] + VertexCoord.w * MVPMatrix[3];\n_oPosition1 = gl_Position;\n_oColor = COLOR;\n_otexCoord = TexCoord.xy;\nCOL0 = COLOR;\nTEX0.xy = TexCoord.xy;\n\n// Precalculate a bunch of useful values we\'ll need in the fragment\n// shader.\nsinangle = sin(vec2(x_tilt, y_tilt)) + vec2(0.001);//sin(vec2(max(abs(x_tilt), 1e-3), max(abs(y_tilt), 1e-3)));\ncosangle = cos(vec2(x_tilt, y_tilt)) + vec2(0.001);//cos(vec2(max(abs(x_tilt), 1e-3), max(abs(y_tilt), 1e-3)));\nstretch = maxscale();\n\nilfac = vec2(1.0,clamp(floor(InputSize.y/200.0), 1.0, 2.0));\n\n// The size of one texel, in texture-coordinates.\nvec2 sharpTextureSize = vec2(SHARPER * TextureSize.x, TextureSize.y);\none = ilfac / sharpTextureSize;\n\n// Resulting X pixel-coordinate of the pixel we\'re drawing.\nmod_factor = TexCoord.x * TextureSize.x * OutputSize.x / InputSize.x;\n\n}\n\n#elif defined(FRAGMENT)\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING in\n#define COMPAT_TEXTURE texture\nout vec4 FragColor;\n#else\n#define COMPAT_VARYING varying\n#define FragColor gl_FragColor\n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nstruct output_dummy {\nvec4 _color;\n};\n\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\nuniform sampler2D Texture;\nCOMPAT_VARYING vec4 TEX0;\n\n// Comment the next line to disable interpolation in linear gamma (and\n// gain speed).\n#define LINEAR_PROCESSING\n\n// Enable screen curvature.\n// #define CURVATURE\n\n// Enable 3x oversampling of the beam profile\n#define OVERSAMPLE\n\n// Use the older, purely gaussian beam profile\n//#define USEGAUSSIAN\n\n// Macros.\n#define FIX(c) max(abs(c), 1e-5);\n#define PI 3.141592653589\n\n#ifdef LINEAR_PROCESSING\n# define TEX2D(c) pow(COMPAT_TEXTURE(Texture, (c)), vec4(CRTgamma))\n#else\n# define TEX2D(c) COMPAT_TEXTURE(Texture, (c))\n#endif\n\nCOMPAT_VARYING vec2 one;\nCOMPAT_VARYING float mod_factor;\nCOMPAT_VARYING vec2 ilfac;\nCOMPAT_VARYING vec2 overscan;\nCOMPAT_VARYING vec2 aspect;\nCOMPAT_VARYING vec3 stretch;\nCOMPAT_VARYING vec2 sinangle;\nCOMPAT_VARYING vec2 cosangle;\n\n#ifdef PARAMETER_UNIFORM\nuniform COMPAT_PRECISION float CRTgamma;\nuniform COMPAT_PRECISION float monitorgamma;\nuniform COMPAT_PRECISION float d;\nuniform COMPAT_PRECISION float CURVATURE;\nuniform COMPAT_PRECISION float R;\nuniform COMPAT_PRECISION float cornersize;\nuniform COMPAT_PRECISION float cornersmooth;\nuniform COMPAT_PRECISION float x_tilt;\nuniform COMPAT_PRECISION float y_tilt;\nuniform COMPAT_PRECISION float overscan_x;\nuniform COMPAT_PRECISION float overscan_y;\nuniform COMPAT_PRECISION float DOTMASK;\nuniform COMPAT_PRECISION float SHARPER;\nuniform COMPAT_PRECISION float scanline_weight;\n#endif\n\nfloat intersect(vec2 xy)\n{\nfloat A = dot(xy,xy)+d*d;\nfloat B = 2.0*(R*(dot(xy,sinangle)-d*cosangle.x*cosangle.y)-d*d);\nfloat C = d*d + 2.0*R*d*cosangle.x*cosangle.y;\nreturn (-B-sqrt(B*B-4.0*A*C))/(2.0*A);\n}\n\nvec2 bkwtrans(vec2 xy)\n{\nfloat c = intersect(xy);\nvec2 point = vec2(c)*xy;\npoint -= vec2(-R)*sinangle;\npoint /= vec2(R);\nvec2 tang = sinangle/cosangle;\nvec2 poc = point/cosangle;\nfloat A = dot(tang,tang)+1.0;\nfloat B = -2.0*dot(poc,tang);\nfloat C = dot(poc,poc)-1.0;\nfloat a = (-B+sqrt(B*B-4.0*A*C))/(2.0*A);\nvec2 uv = (point-a*sinangle)/cosangle;\nfloat r = FIX(R*acos(a));\nreturn uv*r/sin(r/R);\n}\n\nvec2 transform(vec2 coord)\n{\ncoord *= TextureSize / InputSize;\ncoord = (coord-vec2(0.5))*aspect*stretch.z+stretch.xy;\nreturn (bkwtrans(coord)/vec2(overscan_x / 100.0, overscan_y / 100.0)/aspect+vec2(0.5)) * InputSize / TextureSize;\n}\n\nfloat corner(vec2 coord)\n{\ncoord *= TextureSize / InputSize;\ncoord = (coord - vec2(0.5)) * vec2(overscan_x / 100.0, overscan_y / 100.0) + vec2(0.5);\ncoord = min(coord, vec2(1.0)-coord) * aspect;\nvec2 cdist = vec2(cornersize);\ncoord = (cdist - min(coord,cdist));\nfloat dist = sqrt(dot(coord,coord));\nreturn clamp((cdist.x-dist)*cornersmooth,0.0, 1.0);\n}\n\n// Calculate the influence of a scanline on the current pixel.\n//\n// \'distance\' is the distance in texture coordinates from the current\n// pixel to the scanline in question.\n// \'color\' is the colour of the scanline at the horizontal location of\n// the current pixel.\nvec4 scanlineWeights(float distance, vec4 color)\n{\n// "wid" controls the width of the scanline beam, for each RGB\n// channel The "weights" lines basically specify the formula\n// that gives you the profile of the beam, i.e. the intensity as\n// a function of distance from the vertical center of the\n// scanline. In this case, it is gaussian if width=2, and\n// becomes nongaussian for larger widths. Ideally this should\n// be normalized so that the integral across the beam is\n// independent of its width. That is, for a narrower beam\n// "weights" should have a higher peak at the center of the\n// scanline than for a wider beam.\n#ifdef USEGAUSSIAN\nvec4 wid = 0.3 + 0.1 * pow(color, vec4(3.0));\nvec4 weights = vec4(distance / wid);\nreturn 0.4 * exp(-weights * weights) / wid;\n#else\nvec4 wid = 2.0 + 2.0 * pow(color, vec4(4.0));\nvec4 weights = vec4(distance / scanline_weight);\nreturn 1.4 * exp(-pow(weights * inversesqrt(0.5 * wid), wid)) / (0.6 + 0.2 * wid);\n#endif\n}\n\nvoid main()\n{\n// Here\'s a helpful diagram to keep in mind while trying to\n// understand the code:\n//\n// | | | | |\n// -------------------------------\n// | | | | |\n// | 01 | 11 | 21 | 31 | <-- current scanline\n// | | @ | | |\n// -------------------------------\n// | | | | |\n// | 02 | 12 | 22 | 32 | <-- next scanline\n// | | | | |\n// -------------------------------\n// | | | | |\n//\n// Each character-cell represents a pixel on the output\n// surface, "@" represents the current pixel (always somewhere\n// in the bottom half of the current scan-line, or the top-half\n// of the next scanline). The grid of lines represents the\n// edges of the texels of the underlying texture.\n\n// Texture coordinates of the texel containing the active pixel.\nvec2 xy = (CURVATURE > 0.5) ? transform(TEX0.xy) : TEX0.xy;\n\nfloat cval = corner(xy);\n\n// Of all the pixels that are mapped onto the texel we are\n// currently rendering, which pixel are we currently rendering?\nvec2 ilvec = vec2(0.0,ilfac.y > 1.5 ? mod(float(FrameCount),2.0) : 0.0);\nvec2 ratio_scale = (xy * TextureSize - vec2(0.5) + ilvec)/ilfac;\n#ifdef OVERSAMPLE\nfloat filter_ = InputSize.y/OutputSize.y;//fwidth(ratio_scale.y);\n#endif\nvec2 uv_ratio = fract(ratio_scale);\n\n// Snap to the center of the underlying texel.\nxy = (floor(ratio_scale)*ilfac + vec2(0.5) - ilvec) / TextureSize;\n\n// Calculate Lanczos scaling coefficients describing the effect\n// of various neighbour texels in a scanline on the current\n// pixel.\nvec4 coeffs = PI * vec4(1.0 + uv_ratio.x, uv_ratio.x, 1.0 - uv_ratio.x, 2.0 - uv_ratio.x);\n\n// Prevent division by zero.\ncoeffs = FIX(coeffs);\n\n// Lanczos2 kernel.\ncoeffs = 2.0 * sin(coeffs) * sin(coeffs / 2.0) / (coeffs * coeffs);\n\n// Normalize.\ncoeffs /= dot(coeffs, vec4(1.0));\n\n// Calculate the effective colour of the current and next\n// scanlines at the horizontal location of the current pixel,\n// using the Lanczos coefficients above.\nvec4 col = clamp(mat4(\n TEX2D(xy + vec2(-one.x, 0.0)),\n TEX2D(xy),\n TEX2D(xy + vec2(one.x, 0.0)),\n TEX2D(xy + vec2(2.0 * one.x, 0.0))) * coeffs,\n 0.0, 1.0);\nvec4 col2 = clamp(mat4(\n TEX2D(xy + vec2(-one.x, one.y)),\n TEX2D(xy + vec2(0.0, one.y)),\n TEX2D(xy + one),\n TEX2D(xy + vec2(2.0 * one.x, one.y))) * coeffs,\n 0.0, 1.0);\n\n#ifndef LINEAR_PROCESSING\ncol = pow(col , vec4(CRTgamma));\ncol2 = pow(col2, vec4(CRTgamma));\n#endif\n\n// Calculate the influence of the current and next scanlines on\n// the current pixel.\nvec4 weights = scanlineWeights(uv_ratio.y, col);\nvec4 weights2 = scanlineWeights(1.0 - uv_ratio.y, col2);\n#ifdef OVERSAMPLE\nuv_ratio.y =uv_ratio.y+1.0/3.0*filter_;\nweights = (weights+scanlineWeights(uv_ratio.y, col))/3.0;\nweights2=(weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2))/3.0;\nuv_ratio.y =uv_ratio.y-2.0/3.0*filter_;\nweights=weights+scanlineWeights(abs(uv_ratio.y), col)/3.0;\nweights2=weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2)/3.0;\n#endif\n\nvec3 mul_res = (col * weights + col2 * weights2).rgb * vec3(cval);\n\n// dot-mask emulation:\n// Output pixels are alternately tinted green and magenta.\nvec3 dotMaskWeights = mix(\nvec3(1.0, 1.0 - DOTMASK, 1.0),\nvec3(1.0 - DOTMASK, 1.0, 1.0 - DOTMASK),\nfloor(mod(mod_factor, 2.0))\n);\n\nmul_res *= dotMaskWeights;\n\n// Convert the image gamma for display on our output device.\nmul_res = pow(mul_res, vec3(1.0 / monitorgamma));\n\n// Color the texel.\noutput_dummy _OUT;\n_OUT._color = vec4(mul_res, 1.0);\nFragColor = _OUT._color;\nreturn;\n} \n#endif\n\n'},o=e(57),be=e.n(o),i=e(11),X=e.n(i).a,J={addStyleHook:function(){G(this.elements.container,this.config.selectors.container.replace(".",""),!0),G(this.elements.container,this.config.classNames.uiSupported,!0),G(this.elements.container,this.config.classNames.hideControls,!0)},build:function(){this.listeners.media(),D.element(this.elements.controls)||(ee.inject.call(this),this.listeners.controls()),this.volume=null,this.muted=null,ee.updateVolume.call(this),G(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0},toggleControls:function(e){var n,t,o=this.elements.controls;o&&(n=0,t=s.call(this,".".concat(q({ejs__dialogs:!0})," > .").concat(q({ejs__dialog:!0}))),Array.from(t).forEach(function(e,t){!0!==e.hidden&&(n+=1)}),0<n?this.toggleControls(!1):this.toggleControls(Boolean(e||this.paused||o.pressed||o.hover)))}};function ye(e){return(ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if("object"===ye(e)&&e.files&&(e=e.files[0]),this.littleEndian=!1,this.offset=0,this._lastRead=null,"object"===ye(e)&&e.name&&e.size){if("function"!=typeof window.FileReader)throw new Error("Incompatible Browser");this.fileName=e.name,this.fileType=e.type,this.fileSize=e.size,this._fileReader=new FileReader,(this._fileReader.marcFile=this)._fileReader.addEventListener("load",function(){this.marcFile._u8array=new Uint8Array(this.result),this.marcFile._dataView=new DataView(this.result),t&&t.call()},!1),this._fileReader.readAsArrayBuffer(e)}else if("object"===ye(e)&&"string"==typeof e.fileName&&"boolean"==typeof e.littleEndian){this.fileName=e.fileName,this.fileType=e.fileType,this.fileSize=e.fileSize;var n=new ArrayBuffer(e);this._u8array=new Uint8Array(this.fileType),this._dataView=new DataView(this.fileType),e.copyToFile(this,0),t&&t.call()}else if("object"===ye(e)&&"number"==typeof e.byteLength)this.fileName="file.bin",this.fileType="application/octet-stream",this.fileSize=e.byteLength,void 0!==e.buffer&&(e=e.buffer),this._u8array=new Uint8Array(e),this._dataView=new DataView(e),t&&t.call();else{if("number"!=typeof e)throw new Error("Invalid source");this.fileName="file.bin",this.fileType="application/octet-stream",this.fileSize=e,n=new ArrayBuffer(e),this._u8array=new Uint8Array(n),this._dataView=new DataView(n),t&&t.call()}}r.IS_MACHINE_LITTLE_ENDIAN=(o=new ArrayBuffer(2),new DataView(o).setInt16(0,256,!0),256===new Int16Array(o)[0]),r.prototype.seek=function(e){this.offset=e},r.prototype.skip=function(e){this.offset+=e},r.prototype.isEOF=function(){return!(this.offset<this.fileSize)},r.prototype.slice=function(e,t){var n;return t=t||this.fileSize-e,void 0!==this._u8array.buffer.slice?((n=new r(0)).fileSize=t,n._u8array=new Uint8Array(this._u8array.buffer.slice(e,e+t))):(n=new r(t),this.copyToFile(n,e,t,0)),n.fileName=this.fileName,n.fileType=this.fileType,n.littleEndian=this.littleEndian,n},r.prototype.copyToFile=function(e,t,n,o){void 0===o&&(o=t),n=n||this.fileSize-t;for(var a=0;a<n;a++)e._u8array[o+a]=this._u8array[t+a]},r.prototype.save=function(){var t;try{t=new Blob([this._u8array],{type:this.fileType})}catch(e){if(window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,"InvalidStateError"!==e.name||!window.BlobBuilder)throw new Error("Incompatible Browser");var n=new BlobBuilder;n.append(this._u8array.buffer),t=n.getBlob(this.fileType)}saveAs(t,this.fileName)},r.prototype.readU8=function(){return this._lastRead=this._u8array[this.offset],this.offset++,this._lastRead},r.prototype.readU16=function(){return this.littleEndian?this._lastRead=this._u8array[this.offset]+(this._u8array[this.offset+1]<<8):this._lastRead=(this._u8array[this.offset]<<8)+this._u8array[this.offset+1],this.offset+=2,this._lastRead>>>0},r.prototype.readU24=function(){return this.littleEndian?this._lastRead=this._u8array[this.offset]+(this._u8array[this.offset+1]<<8)+(this._u8array[this.offset+2]<<16):this._lastRead=(this._u8array[this.offset]<<16)+(this._u8array[this.offset+1]<<8)+this._u8array[this.offset+2],this.offset+=3,this._lastRead>>>0},r.prototype.readU32=function(){return this.littleEndian?this._lastRead=this._u8array[this.offset]+(this._u8array[this.offset+1]<<8)+(this._u8array[this.offset+2]<<16)+(this._u8array[this.offset+3]<<24):this._lastRead=(this._u8array[this.offset]<<24)+(this._u8array[this.offset+1]<<16)+(this._u8array[this.offset+2]<<8)+this._u8array[this.offset+3],this.offset+=4,this._lastRead>>>0},r.prototype.readBytes=function(e){this._lastRead=new Array(e);for(var t=0;t<e;t++)this._lastRead[t]=this._u8array[this.offset+t];return this.offset+=e,this._lastRead},r.prototype.readString=function(e){this._lastRead="";for(var t=0;t<e&&this.offset+t<this.fileSize&&0<this._u8array[this.offset+t];t++)this._lastRead=this._lastRead+String.fromCharCode(this._u8array[this.offset+t]);return this.offset+=e,this._lastRead},r.prototype.writeU8=function(e){this._u8array[this.offset]=e,this.offset++},r.prototype.writeU16=function(e){this.littleEndian?(this._u8array[this.offset]=255&e,this._u8array[this.offset+1]=e>>8):(this._u8array[this.offset]=e>>8,this._u8array[this.offset+1]=255&e),this.offset+=2},r.prototype.writeU24=function(e){this.littleEndian?(this._u8array[this.offset]=255&e,this._u8array[this.offset+1]=(65280&e)>>8,this._u8array[this.offset+2]=(16711680&e)>>16):(this._u8array[this.offset]=(16711680&e)>>16,this._u8array[this.offset+1]=(65280&e)>>8,this._u8array[this.offset+2]=255&e),this.offset+=3},r.prototype.writeU32=function(e){this.littleEndian?(this._u8array[this.offset]=255&e,this._u8array[this.offset+1]=(65280&e)>>8,this._u8array[this.offset+2]=(16711680&e)>>16,this._u8array[this.offset+3]=(4278190080&e)>>24):(this._u8array[this.offset]=(4278190080&e)>>24,this._u8array[this.offset+1]=(16711680&e)>>16,this._u8array[this.offset+2]=(65280&e)>>8,this._u8array[this.offset+3]=255&e),this.offset+=4},r.prototype.writeBytes=function(e){for(var t=0;t<e.length;t++)this._u8array[this.offset+t]=e[t];this.offset+=e.length},r.prototype.writeString=function(e,t){t=t||e.length;for(var n=0;n<e.length&&n<t;n++)this._u8array[this.offset+n]=e.charCodeAt(n);for(;n<t;n++)this._u8array[this.offset+n]=0;this.offset+=t};var K=r,c=0;function d(){this.records=[],this.truncate=!1}function ve(e){var t=new d;e.seek(5);for(var n,o;!e.isEOF();){if(4542278===(n=e.readU24())){if(e.isEOF())break;if(e.offset+3===e.fileSize){t.truncate=e.readU24();break}}(o=e.readU16())===c?t.addRLERecord(n,e.readU16(),e.readU8()):t.addSimpleRecord(n,e.readBytes(o))}return t}d.prototype.addSimpleRecord=function(e,t){this.records.push({offset:e,type:1,length:t.length,data:t})},d.prototype.addRLERecord=function(e,t,n){this.records.push({offset:e,type:c,length:t,byte:n})},d.prototype.toString=function(){nSimpleRecords=0;for(var e=nRLERecords=0;e<this.records.length;e++)this.records[e].type===c?nRLERecords++:nSimpleRecords++;var t="Simple records: "+nSimpleRecords,t=(t+="\nRLE records: "+nRLERecords)+("\nTotal records: "+this.records.length);return this.truncate&&(t+="\nTruncate at: 0x"+this.truncate.toString(16)),t},d.prototype.export=function(e){for(var t=5,n=0;n<this.records.length;n++)this.records[n].type===c?t+=8:t+=5+this.records[n].data.length;for(t+=3,this.truncate&&(t+=3),(tempFile=new K(t)).fileName=e+".ips",tempFile.writeString("PATCH"),n=0;n<this.records.length;n++){var o=this.records[n];tempFile.writeU24(o.offset),o.type===c?(tempFile.writeU16(0),tempFile.writeU16(o.length),tempFile.writeU8(o.byte)):(tempFile.writeU16(o.data.length),tempFile.writeBytes(o.data))}return tempFile.writeString("EOF"),o.truncate&&tempFile.writeU24(o.truncate),tempFile},d.prototype.apply=function(e){var t;if(this.truncate)t=e.slice(0,this.truncate);else{for(var n=e.fileSize,o=0;o<this.records.length;o++){var a=this.records[o];a.type===c?a.offset+a.length>n&&(n=a.offset+a.length):a.offset+a.data.length>n&&(n=a.offset+a.data.length)}n===e.fileSize?t=e.slice(0,e.fileSize):(t=new K(n),e.copyToFile(t,0))}for(e.seek(0),o=0;o<this.records.length;o++)if(t.seek(this.records[o].offset),this.records[o].type===c)for(var i=0;i<this.records[o].length;i++)t.writeU8(this.records[o].byte);else t.writeBytes(this.records[o].data);return t},"0123456789abcdef".split("");var we=function(){for(var e=[],t=0;t<256;t++){for(var n=t,o=0;o<8;o++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n}return e}();function $(e,t,n){for(var o=t?new Uint8Array(e._u8array.buffer,t):e._u8array,a=-1,i=n?o.length-4:o.length,r=0;r<i;r++)a=a>>>8^we[255&(a^o[r])];return(-1^a)>>>0}var xe=1,_e=2,Se=3;function Te(){this.sourceSize=0,this.targetSize=0,this.metaData="",this.actions=[],this.sourceChecksum=0,this.targetChecksum=0,this.patchChecksum=0}function Ce(e){e.readVLV=Ee,e.littleEndian=!0;var t=new Te,n=(e.seek(4),t.sourceSize=e.readVLV(),t.targetSize=e.readVLV(),e.readVLV());n&&(t.metaData=e.readString(n));for(var o=e.fileSize-12;e.offset<o;){var a,i=e.readVLV(),i={type:3&i,length:1+(i>>2)};i.type===xe?i.bytes=e.readBytes(i.length):i.type!==_e&&i.type!==Se||(a=e.readVLV(),i.relativeOffset=(1&a?-1:1)*(a>>1)),t.actions.push(i)}if(t.sourceChecksum=e.readU32(),t.targetChecksum=e.readU32(),t.patchChecksum=e.readU32(),t.patchChecksum!==$(e,0,!0))throw new Error("error_crc_patch");return t}function Ee(){for(var e=0,t=1;;){var n=this.readU8();if(e+=(127&n)*t,128&n)break;e+=t<<=7}return this._lastRead=e}function Ae(e){for(;;){var t=127&e;if(0==(e>>=7)){this.writeU8(128|t);break}this.writeU8(t),e--}}function ke(e){for(var t=0;;){if(0==(e>>=7)){t++;break}t++,e--}return t}Te.prototype.toString=function(){var e="Source size: "+this.sourceSize;return(e=(e+="\nTarget size: "+this.targetSize)+("\nMetadata: "+this.metaData))+("\n#Actions: "+this.actions.length)},Te.prototype.validateSource=function(e,t){return this.sourceChecksum===$(e,t)},Te.prototype.apply=function(e,t){if(t&&!this.validateSource(e))throw new Error("error_crc_input");for(var n=new K(this.targetSize),o=0,a=0,i=0;i<this.actions.length;i++){var r=this.actions[i];if(0===r.type)e.copyToFile(n,n.offset,r.length),n.skip(r.length);else if(r.type===xe)n.writeBytes(r.bytes);else if(r.type===_e){o+=r.relativeOffset;for(var s=r.length;s--;)n.writeU8(e._u8array[o]),o++}else if(r.type===Se)for(a+=r.relativeOffset,s=r.length;s--;)n.writeU8(n._u8array[a]),a++}if(t&&this.targetChecksum!==$(n))throw new Error("error_crc_output");return n},Te.prototype.export=function(e){for(var t="BPS1".length,t=(t=(t=(t+=ke(this.sourceSize))+ke(this.targetSize))+ke(this.metaData.length))+this.metaData.length,n=0;n<this.actions.length;n++)t+=ke(((a=this.actions[n]).length-1<<2)+a.type),a.type===xe?t+=a.length:a.type!==_e&&a.type!==Se||(t+=ke((Math.abs(a.relativeOffset)<<1)+(a.relativeOffset<0?1:0)));var o=new K(t+=12);for(o.fileName=e+".bps",o.littleEndian=!0,o.writeVLV=Ae,o.writeString("BPS1"),o.writeVLV(this.sourceSize),o.writeVLV(this.targetSize),o.writeVLV(this.metaData.length),o.writeString(this.metaData,this.metaData.length),n=0;n<this.actions.length;n++){var a=this.actions[n];o.writeVLV((a.length-1<<2)+a.type),a.type===xe?o.writeBytes(a.bytes):a.type!==_e&&a.type!==Se||o.writeVLV((Math.abs(a.relativeOffset)<<1)+(a.relativeOffset<0?1:0))}return o.writeU32(this.sourceChecksum),o.writeU32(this.targetChecksum),o.writeU32(this.patchChecksum),o};var Oe="UPS1";function u(){this.records=[],this.sizeInput=0,this.sizeOutput=0,this.checksumInput=0,this.checksumOutput=0}function Me(e){for(;;){var t=127&e;if(0==(e>>=7)){this.writeU8(128|t);break}this.writeU8(t),--e}}function Re(){for(var e=0,t=1;;){var n=this.readU8();if(-1==n)throw new Error("Can't read UPS VLV at 0x"+(this.offset-1).toString(16));if(e+=(127&n)*t,0!=(128&n))break;e+=t<<=7}return e}function Pe(e){for(var t=0;t++,0!=(e>>=7);)--e;return t}function je(e){var t=new u;for(e.readVLV=Re,e.seek(Oe.length),t.sizeInput=e.readVLV(),t.sizeOutput=e.readVLV();e.offset<e.fileSize-12;){for(var n=e.readVLV(),o=[];e.readU8();)o.push(e._lastRead);t.addRecord(n,o)}return e.littleEndian=!0,t.checksumInput=e.readU32(),t.checksumOutput=e.readU32(),e.littleEndian=!1,t}u.prototype.addRecord=function(e,t){this.records.push({offset:e,XORdata:t})},u.prototype.toString=function(){var e="Records: "+(void 0).records.length;return(e=(e=(e+="\nInput file size: "+(void 0).sizeInput)+("\nOutput file size: "+(void 0).sizeOutput))+("\nInput file checksum: "+padZeroes((void 0).checksumInput,4)))+("\nOutput file checksum: "+padZeroes((void 0).checksumOutput,4))},u.prototype.export=function(e){for(var t=Oe.length,t=(t+=Pe(this.sizeInput))+Pe(this.sizeOutput),n=0;n<this.records.length;n++)t=(t+=Pe(this.records[n].offset))+(this.records[n].XORdata.length+1);for((tempFile=new K(t+=12)).writeVLV=Me,tempFile.fileName=e+".ups",tempFile.writeString(Oe),tempFile.writeVLV(this.sizeInput),tempFile.writeVLV(this.sizeOutput),n=0;n<this.records.length;n++)tempFile.writeVLV(this.records[n].offset),tempFile.writeBytes(this.records[n].XORdata),tempFile.writeU8(0);return tempFile.littleEndian=!0,tempFile.writeU32(this.checksumInput),tempFile.writeU32(this.checksumOutput),tempFile.writeU32($(tempFile,0,!0)),tempFile},u.prototype.validateSource=function(e,t){return $(e,t)===this.checksumInput},u.prototype.apply=function(e,t){t&&this.validateSource(e),tempFile=new K(this.sizeOutput),e.copyToFile(tempFile,0,this.sizeInput),e.seek(0);for(var n=0;n<this.records.length;n++){var o=this.records[n];tempFile.skip(o.offset),e.skip(o.offset);for(var a=0;a<o.XORdata.length;a++)tempFile.writeU8((e.isEOF()?0:e.readU8())^o.XORdata[a]);tempFile.skip(1),e.skip(1)}return t&&($(tempFile),this.checksumOutput),tempFile};var i=e(160),Ne=e.n(i),Q={_FS:{createPath:function(e,t,n,o){Q.FS&&("function"!=typeof Q.FS.createPath?Q.FS.mkdir(t):Q.FS.createPath(e,t,n,o))},createDataFile:function(e,t,n,o,a,i){var r,s;Q.FS&&("function"!=typeof Q.FS.createDataFile?(s=t,r=(r=e).endsWith("/")||s.startsWith("/")?r+s:r+"/"+s,Q.FS.writeFile(r,n)):Q.FS.createDataFile(e,t,n,o,a,i))},createFolder:function(e,t,n,o){var a,i;Q.FS&&("function"!=typeof Q.FS.createFolder?(i=t,a=(a=e).endsWith("/")||i.startsWith("/")?a+i:a+"/"+i,Q.FS.mkdir(a)):Q.FS.createFolder(e,t,n,o))}},romdb:null,supportBatterySave:!1,hash:"2b35cacf70ae",hash2:"f5cbb3f38c0bb20e4",hash3:"88cc8ad0c350400499a0",loading:null,gamePatch:null,saveFilenames:[],FS:null,Module:null,aspectRatio:4/3,memData:null,wasmData:null,coreFileData:{},coreFileName:"",coreFileVersion:"",isMobileDevice:!!/Android|webOS|iPhone|iPad|iPod|BB10|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i.test(navigator.userAgent||""),create:function(){var h=this;window.URL=window.URL||window.webkitURL;var e,o=!1,a=!1,i=!1,f=0,m=!1,p={psx:["bin","iso","cue","img","mdf","pbp","toc","cbn","m3u"],nds:["nds","bin"],nes:["fds","nes","unif","unf"],snes:["smc","fig","sfc","gd3","gd7","dx2","bsx","swc"],snes2002:["smc","fig","sfc","gd3","gd7","dx2","bsx","swc"],snes2005:["smc","fig","sfc","gd3","gd7","dx2","bsx","swc"],snes2010:["smc","fig","sfc","gd3","gd7","dx2","bsx","swc"],gb:["gb","gbc","dmg"],gba:["gb","gbc","gba"],vbanext:["gba"],vb:["vb","vboy","bin"],"3do":["iso","bin","cue"],lynx:["lnx"],jaguar:["j64","jag","rom","abs","cof","bin","prg"],a7800:["a78","bin"],a2600:["a26","bin"],ngp:["ngp","ngc"],n64:["n64","v64","z64","bin","u1","ndd"],pce:["pce","bin","iso","cue","ccd","img","chd"],sega:["mdx","md","smd","gen","bin","iso","cue","sms","gg","sg","68k","chd"],segacd:["mdx","md","smd","gen","bin","iso","cue","sms","gg","sg","68k","chd"],"32x":["32x","bin","gen","smd","md","cue","iso","sms"],saturn:["bin","cue","iso"],msx:["rom","mx1","mx2","dsk","cas"],bluemsx:["rom","ri","mx1","mx2","col","dsk","cas","sg","sc","m3u"],ws:["ws","wsc"],arcade:["zip"],"fba0.2.97.29":["zip"],mame2003:["zip"],mame:["zip"],dos:["zip"]},g={psx:"psx",nds:"nds",nes:"nes",snes:"snes",snes2002:"snes2002",snes2005:"snes2005",snes2010:"snes2010",gb:"gb",gbc:"gb",gba:"gba",vbanext:"vbanext",vb:"vb",n64:"n64","3do":"3do",segaMS:"sega",segaGG:"sega",segaMD:"sega",segaCD:"segacd",sega32x:"32x",segaSaturn:"saturn",ngp:"ngp",pce:"pce",msx:"bluemsx",atari2600:"a2600",atari7800:"a7800",lynx:"lynx",ws:"ws",arcade:"arcade","fba0.2.97.29":"fba0.2.97.29",jaguar:"jaguar",mame2003:"mame2003",dos:"dos"},b=this,y=b.system,v=b.customPaths&&"string"==typeof b.customPaths["extract7z.js"]?b.customPaths["extract7z.js"]:b.dataPath+"extract7z.js",w=b.customPaths&&"string"==typeof b.customPaths["extractzip.js"]?b.customPaths["extractzip.js"]:b.dataPath+"extractzip.js?v=1",x=b.customPaths&&"string"==typeof b.customPaths["libunrar.js"]?b.customPaths["libunrar.js"]:b.dataPath+"libunrar.js",_=U("canvas",{}),S=(this.game.appendChild(_),Q.loading=U("div",{class:this.config.classNames.loading}),this.elements.container.appendChild(Q.loading),{"loading-info":q({"loading-info":!0}),ad:q({ad:!0}),"close-ad":q({"close-ad":!0}),"start-game":q({"start-game":!0}),on:q({on:!0}),p1:q({p1:!0}),p2:q({p2:!0}),p3:q({p3:!0}),p4:q({p4:!0})}),r=("string"==typeof b.adUrl?(Q.loading.innerHTML='\n <div>\n <div class="'+S.ad+'" style="display:block !important;width:300px !important">\n <div class="'+S["close-ad"]+'" hidden><a href="#" onclick="return false"></a></div>\n <iframe scrolling="no" frameborder="no" style="width:300px !important;height:250px !important;display: block !important;" src="'+b.adUrl+'"></iframe>\n </div>\n <div class="'+S["loading-info"]+'" style="position: absolute;bottom: 20px;left: 50%;transform: translateX(-50%);">\n <div class="'+S.p1+'"></div>\n <div class="'+S.p2+'"></div>\n <div class="'+S.p3+'"></div>\n </div>\n <div style="position: absolute;bottom: 20px;left: 50%;transform: translateX(-50%);">\n <a href="#" onclick="return false" class="'+S["start-game"]+'">'+de("playNow",b.config)+"</a>\n </div>\n </div>",e=U("iframe",{src:b.adUrl,scrolling:"no",frameborder:"no",style:"width:300px !important;height:250px !important;display: block !important;"}),Q.loading.querySelector(".".concat(S.ad)).removeChild(Q.loading.querySelector(".".concat(S.ad," iframe"))),Q.loading.querySelector(".".concat(S.ad)).appendChild(e),W.webgl.DETECTED||(F(Q.loading.querySelector(".".concat(S["start-game"])),!0),Q.loading.querySelector(".".concat(S.p3)).innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">Failed to initialize WebGL.</strong>'),Q.loading.querySelector(".".concat(S.ad," iframe")).style.setProperty("display","block","important"),Q.loading.querySelector(".".concat(S.ad," iframe")).style.setProperty("visibility","visible","important"),Q.loading.querySelector(".".concat(S.ad)).style.setProperty("display","block","important"),Q.loading.querySelector(".".concat(S.ad)).style.setProperty("visibility","visible","important")):(Q.loading.innerHTML='\n <div>\n <div class="'.concat(S["loading-info"],'" style="position: absolute;bottom: 20px;left: 50%;transform: translateX(-50%);">\n <div class="').concat(S.p1,'"></div>\n <div class="').concat(S.p2,'"></div>\n <div class="').concat(S.p3,'"></div>\n </div>\n <div style="position: absolute;bottom: 20px;left: 50%;transform: translateX(-50%);">\n <a href="#" onclick="return false" class="').concat(S["start-game"],'">').concat(de("playNow",b.config),"</a>\n </div>\n </div>"),W.webgl.DETECTED||(F(Q.loading.querySelector(".".concat(S["start-game"])),!0),Q.loading.querySelector(".".concat(S.p3)).innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">Failed to initialize WebGL.</strong>')),window.URL||window.webkitURL),T=(X.a.interceptors.request.use(function(e){return e.headers["Content-Type"]="application/x-www-form-urlencoded","options"===e.method.toLowerCase()&&(e.method="get"),e},function(e){return Promise.reject(e)}),function(e){var t;return 80===e[0]&&75===e[1]&&3===e[2]&&4===e[3]||80===e[0]&&75===e[1]&&5===e[2]&&6===e[3]||80===e[0]&&75===e[1]&&7===e[2]&&8===e[3]?t="zip":55===e[0]&&122===e[1]&&188===e[2]&&175===e[3]&&39===e[4]&&28===e[5]?t="7z":82===e[0]&&97===e[1]&&114===e[2]&&33===e[3]&&26===e[4]&&7===e[5]&&0==e[6]&&(t="rar"),t}),C=function(e){var e=new Blob(['importScripts("'+e+'");'],{type:"application/javascript"}),n=window.URL.createObjectURL(e);return new Promise(function(e,t){e(new Worker(n))})},E=function(e,t){var n="",t=("rar"==t&&(n="\nvar dataToPass = [];\nModule = {\n monitorRunDependencies: function(left) {\n if (left == 0) {\n setTimeout(function() {\n unrar(dataToPass, null);\n }, 100);\n }\n },\n onRuntimeInitialized: function() {\n },\n locateFile: function(file) {\n return '".concat(e+".mem","';\n }\n};\nimportScripts(\"").concat(e,'");\nvar unrar = function(data, password) {\n var cb = function(fileName, fileSize, progress) {\n postMessage({"t":4,"current":progress,"total":fileSize, "name": fileName});\n };\n\n var rarContent = readRARContent(data.map(function(d) {\n return {\n name: d.name,\n content: new Uint8Array(d.content)\n }\n }), password, cb)\n var rec = function(entry) {\n if (entry.type === \'file\') {\n postMessage({"t":2,"file":entry.fullFileName,"size":entry.fileSize,"data":entry.fileContent});\n } else if (entry.type === \'dir\') {\n Object.keys(entry.ls).forEach(function(k) {\n rec(entry.ls[k]);\n })\n } else {\n throw "Unknown type";\n }\n }\n rec(rarContent);\n postMessage({"t":1});\n return rarContent;\n};\nonmessage = function(data) {\n dataToPass.push({name: \'test.rar\', content: data.data});\n};\n ')),new Blob([n],{type:"application/javascript"})),o=window.URL.createObjectURL(t);return new Promise(function(e,t){e(new Worker(o))})},A=null,d=null,c=null,u=null;try{A=new be.a({dbVersion:1,storePrefix:"ejs-",storeName:"system",keyPath:null,autoIncrement:!1,onStoreReady:function(){o=!0},onError:function(){o=!0}}),d=new be.a({dbVersion:1,storePrefix:"ejs-",storeName:"roms",keyPath:null,autoIncrement:!1,onStoreReady:function(){a=!0},onError:function(){a=!0}}),c=new be.a({dbVersion:1,storePrefix:"ejs-",storeName:"bios",keyPath:null,autoIncrement:!1,onStoreReady:function(){i=!0},onError:function(){i=!0}}),u=new be.a({dbVersion:1,storePrefix:"ejs-",storeName:"romsdata",keyPath:null,autoIncrement:!1,onStoreReady:function(){},onError:function(){}})}catch(e){i=a=o=!0,console.log(e)}z.call(b,b.elements.container,"start-game",function(e){b.started=!0,b.playing=!0,F(Q.loading.querySelector(".".concat(S["loading-info"])),!0),!Z||"undefined"!=Z.virtualGamepadContainer&&null!==Z.virtualGamepadContainer||J.toggleControls.call(b,!0);var t,n,o,a,i,r,s,c,l=q({"ejs__tooltip--visible":!0}),d=b.elements.buttons.gamepad.querySelector(".".concat(q({ejs__tooltip:!0}))),u=(G(d,l,!0),setTimeout(function(){G(d,l,!1)},5e3),"string"==typeof b.adUrl&&(F(Q.loading.querySelector(".".concat(S["close-ad"])),!1),setTimeout(function(){b.started&&Q.loading.querySelector(".".concat(S.ad))&&Q.loading.querySelector(".".concat(S.ad)).parentNode.removeChild(Q.loading.querySelector(".".concat(S.ad)))},1e4)),F(Q.loading.querySelector(".".concat(S["start-game"])),!0),Y(ee.defaultCoreOptionsValues.call(h),ee.storage.get("core-options")||{})),f=("n64"===b.system&&u&&Object.keys(u).forEach(function(e){"glupen64-aspect"===e&&"16:9"===u[e]&&(_.height=_.width/16*9,Q.aspectRatio=16/9)}),"arcade"!==h.system&&"fba0.2.97.29"!==h.system||u&&Object.keys(u).forEach(function(e){"fba-aspect"===e&&"PAR"===u[e]&&(_.height=_.width/16*9,Q.aspectRatio=16/9)}),"gba"===b.system&&(_.height=_.width/1.5,Q.aspectRatio=1.5),window.setTimeout(function(){},150),f=h,"undefined"!=typeof RI?(document.removeEventListener("mousemove",RI.eventHandler,!1),_.removeEventListener("mousedown",RI.canvasEventHandler,!1),_.removeEventListener("mouseup",RI.canvasEventHandler,!1),f.elements.container.addEventListener("mousemove",function(e){var t=0,n=0,o=e.offsetX-Q.Module.canvas.offsetLeft,a=e.offsetY-Q.Module.canvas.offsetTop;if("mousemove"===e.type){t=o<0?(o=0,-Q.Module.canvas.offsetWidth):o>Q.Module.canvas.offsetWidth?(o=Q.Module.canvas.offsetWidth,Q.Module.canvas.offsetWidth):o-RI.currentX,n=a<0?(a=0,-Q.Module.canvas.offsetHeight):a>Q.Module.canvas.offsetHeight?(a=Q.Module.canvas.offsetHeight,Q.Module.canvas.offsetHeight):a-RI.currentY,RI.currentX=o,RI.currentY=a;for(var i=0;i<RI.contexts.length;i+=1)HEAP32[RI.contexts[i].state+32>>2]=t,HEAP32[RI.contexts[i].state+36>>2]=n}},!1),f.elements.container.addEventListener("mousedown",RI.canvasEventHandler,!1),f.elements.container.addEventListener("mouseup",RI.canvasEventHandler,!1),f.elements.container.addEventListener("touchstart",t=function(e){if(e.targetTouches[0]){var t,n=0,o=0,a=e.target.getBoundingClientRect(),i=e.targetTouches[0].clientX-a.left,a=e.targetTouches[0].clientY-a.top,n=i<0?(i=0,-Q.Module.canvas.offsetWidth):i>Q.Module.canvas.offsetWidth?(i=Q.Module.canvas.offsetWidth,Q.Module.canvas.offsetWidth):i-RI.currentX,o=a<0?(a=0,-Q.Module.canvas.offsetHeight):a>Q.Module.canvas.offsetHeight?(a=Q.Module.canvas.offsetHeight,Q.Module.canvas.offsetHeight):a-RI.currentY;RI.currentX=i,RI.currentY=a;for(var r=0;r<RI.contexts.length;r+=1)HEAP32[RI.contexts[r].state+32>>2]=n,HEAP32[RI.contexts[r].state+36>>2]=o;switch(e.type){case"touchend":case"touchstart":if(0===e.button)t=40;else{if(2!==e.button)break;t=41}for(var s="touchend"===e.type?0:1,c=0;c<RI.contexts.length;c+=1)HEAP8[RI.contexts[c].state+t>>0]=s}}},!1),f.elements.container.addEventListener("touchend",t,!1)):(f=function(e){e=new MouseEvent(e.type,e);Q.Module.canvas.dispatchEvent(e)},V.call(h,".".concat(q({ejs__dialogs:!0}))).addEventListener("mousemove",f,!1),V.call(h,".".concat(q({ejs__dialogs:!0}))).addEventListener("mousedown",f,!1),V.call(h,".".concat(q({ejs__dialogs:!0}))).addEventListener("mouseup",f,!1)),"msx"===b.system&&"undefined"!=typeof RI&&(document.removeEventListener("keydown",RI.eventHandler,!1),document.removeEventListener("keyup",RI.eventHandler,!1),t=function(e){var t=e.keyCode,n=t>>3,o=1<<(7&t);switch(e.type){case"keyup":case"keydown":if(32<=n)throw"key code error! bad code: "+t;for(var a=0;a<RI.contexts.length;a++){var i=HEAP8[RI.contexts[a].state+n>>0];"keyup"===e.type?i&=~o:i|=o,HEAP8[RI.contexts[a].state+n>>0]=i}}},document.addEventListener("keydown",t,!1),document.addEventListener("keyup",t,!1)),setTimeout(function(){var a=H.info();null===Z.setVolume&&"undefined"!=typeof RA?(RA.queueAudio=function(){var e=b.volume,t=RA.bufIndex,n=RA.bufIndex?RA.buffers[RA.bufIndex-1].endTime:RA.context.currentTime,o=(RA.buffers[t].endTime=n+RA.buffers[t].duration,RA.context.createBufferSource());o.buffer=RA.buffers[t],1===(e=b.muted?0:e)?o.connect(RA.context.destination):(t=RA.context.createGain(),o.connect(t),t.connect(RA.context.destination),H.isEdge||"chrome"===a.name&&parseInt(a.version,10)<=60||"firefox"===a.name&&parseInt(a.version,10)<=56||"opera"===a.name&&parseInt(a.version,10)<=44?t.gain.value=e:"firefox"===a.name?t.gain.setValueAtTime(e,RA.context.currentTime):t.gain.setValueAtTime(e,RA.context.currentTime,0)),o.start(n),RA.bufIndex+=1,RA.bufOffset=0},H.isIos&&window.addEventListener("touchstart",function(){var e;RA.context&&(RA.context.resume(),(e=RA.context.createBufferSource()).connect(RA.context.destination),e.start())},!1)):Z.setVolume()},500),setTimeout(function(){b.elements.container.focus()},30),void 0===window.addRunDependency&&(window.Module=void 0),Q.FS.readFile(b.startName));f.length<=33554432&&".cue"!=b.startName.substr(-4)&&(o="snes"===b.system||["snes2002","snes2005","snes2010"].includes(b.system)?(n=f.length%1024,new K(n?f.slice?f.slice(n):f.subarray(n):f)):new K(f),a=Ne.a.create(),i=new FileReader,r=0,s=o._u8array.length,c=function(){var e;r<s?(e=Math.min(r+2097152,s),i.readAsArrayBuffer(new Blob([o._u8array.slice(r,e)])),r=e):(console.log(a.hex()),b.hash=a.hex(),"function"==typeof window.ejsromshash&&window.ejsromshash(b.hash))},i.onload=function(e){try{a.update(e.target.result),c()}catch(e){console.log(e)}},c())}),"string"==typeof b.adUrl&&z.call(b,Q.loading.querySelector(".".concat(S["close-ad"])),"click",function(e){e instanceof MouseEvent&&b.started&&Q.loading.querySelector(".".concat(S.ad))&&Q.loading.querySelector(".".concat(S.ad)).parentNode.removeChild(Q.loading.querySelector(".".concat(S.ad))),b.elements.container.focus()});function t(e){return F(Q.loading.querySelector(".".concat(S["start-game"])),!0),t=Q.loading.querySelector(".".concat(S.p1)),p=h,t.innerHTML=p.localization("Loading")+"...",n=setInterval(function(){var e,f;!0===o&&!0===a&&!0===i&&(window.Module={TOTAL_MEMORY:268435456,noInitialRun:!0,arguments:[],preRun:[],postRun:[],canvas:_,print:function(e){!0===window.EJS_DEBUG_XX&&console.log(e)},printErr:function(e){!0===window.EJS_DEBUG_XX&&console.log(e)},totalDependencies:0,monitorRunDependencies:function(e){},locateFile:function(e){var t,n=null;return e.includes(".worker.js")?(Object.keys(Q.coreFileData).includes(e)&&(n=Q.coreFileData[e]),t=new Blob([""],{type:"application/javascript"}),window.URL.createObjectURL(t)):e.includes(".js.mem")&&(n=Object.keys(Q.coreFileData).includes(e)?Q.coreFileData[e]:n)?(Q.memData=null,n.buffer):e},readAsync:function(e,t,n){var o;e instanceof ArrayBuffer?setTimeout(function(){t(e)},500):((o=new XMLHttpRequest).open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){200==o.status||0==o.status&&o.response?t(o.response):n()},o.onerror=n,o.send(null))}},e=Math.ceil((new Date).valueOf()/1e3),e=b.customPaths&&"string"==typeof b.customPaths["v.json"]?b.customPaths["v.json"]:b.dataPath+"v.json?t="+e,f=function(n,o){var e=b.customPaths&&"string"==typeof b.customPaths[n]?b.customPaths[n]:2===b.coreVer?b.dataPath+n+"?v="+o:b.dataPath+"old/"+n+"?v="+o;X.a.get(e,{onDownloadProgress:function(e){e=e.total?"".concat(Math.floor(e.loaded/e.total*100),"%"):"";t.innerHTML=p.localization("Download Game Core")+" ".concat(e)},responseType:"arraybuffer"}).then(function(e){var t,e=new Uint8Array(e.data);A.db&&A.put(n,{version:o,data:e}),2===b.coreVer?L(e):((t=e.slice?e.slice(12):e.subarray(12)).set([55,122,188,175,39,28,0,3],0),e=null,L(t))}).catch(function(e){void 0===e.response?t.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;"><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors">'+b.localization("CORS Error")+"</a></strong>":t.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+b.localization("Network Error")+"</strong>"})},X.a.get(e,{}).then(function(e){var t=g[p.system],e=e.data[p.system],n=e.version||1,o=Boolean(e.netplay),a=Boolean(e.state),i=Boolean(e.asmjs),r=Boolean(e.wasm),e=(2!==b.coreVer&&e.old&&(i=Boolean(e.old.asmjs),r=Boolean(e.old.wasm)),"nds"!=p.system||W.wasm||(a=!1),!1===b.statesSupported&&(a=!1),Q.coreFileVersion=n,Q.coreFileName=t,!1);if(["webgl2","experimental-webgl2"].includes(W.webgl.WEBGL_CONTEXT)&&(e=!0),"undefined"!=typeof EJS_N64_LEGACY&&1==EJS_N64_LEGACY&&(e=!1),"mame"==p.system){var s=p.mameCore;if(!s||null===s||2!==s.split("|").length)return void(c.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+p.localization("Missing mame config")+"</strong>");var c=s.split("|");Q.coreFileName="".concat(p.system,"-").concat(c[0]),a="1"===c[1],D.element(p.elements.buttons.saveState)&&F(p.elements.buttons.saveState,!a),D.element(p.elements.buttons.loadState)&&F(p.elements.buttons.loadState,!a),F(ee.contextMenu.querySelectorAll("ul li").item(2),!a),F(ee.contextMenu.querySelectorAll("ul li").item(3),!a),d=2===p.coreVer?"":p.system.concat("-old-").concat(c[0],"-wasm.data"),c[0]?(W.wasm&&r?m=!0:(c.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+p.localization("Webassembly support is not detected in this browser")+"</strong>",d=""),d&&(A.db?A.get(d,function(e){e&&e.version===n?2===b.coreVer?L(e.data):((e=e.data.slice?e.data.slice(12):e.data.subarray(12)).set([55,122,188,175,39,28,0,3],0),L(e)):f(d,n)}):f(d,n))):c.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+p.localization("Unsupported Game")+"</strong>"}else{var l,d=!1;if(W.wasm&&r?(l="wasm",d=!0,"n64"!==p.system||e||(l="legacy-wasm"),m=!0):i&&(d=!0,l="asmjs","n64"!==p.system||e||(l="legacy-asmjs")),!0!==(d="undefined"!=typeof EJS_CUSTOM_COREFILE?EJS_CUSTOM_COREFILE:d))return void(c.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+p.localization("Please upgrade your browser to the latest version")+"</strong>");d=2===p.coreVer?t+"-"+l+".data":t+"-old-"+l+".data","undefined"!=typeof EJS_CUSTOM_COREFILE&&(d=EJS_CUSTOM_COREFILE),A.db?A.get(d,function(e){!e||e.version!==n||"undefined"!=typeof EJS_DEBUG_XX&&!0===EJS_DEBUG_XX?f(d,n):2===b.coreVer?L(e.data):((e=e.data.slice?e.data.slice(12):e.data.subarray(12)).set([55,122,188,175,39,28,0,3],0),L(e))}):f(d,n)}if(2===p.coreVer)if(D.element(p.elements.buttons.gamepad)&&F(p.elements.buttons.gamepad,!0),Array.isArray(p.elements.buttons.play))for(var u=0;u<p.elements.buttons.play.length;u++)D.element(p.elements.buttons.play[u])&&F(p.elements.buttons.play[u],!0);else D.element(p.elements.buttons.play)&&F(p.elements.buttons.play,!0);o||D.element(p.elements.buttons.netplay)&&F(p.elements.buttons.netplay,!0),D.element(p.elements.buttons.saveState)&&F(p.elements.buttons.saveState,!a),D.element(p.elements.buttons.loadState)&&F(p.elements.buttons.loadState,!a),F(ee.contextMenu.querySelectorAll("ul li").item(2),!a),F(ee.contextMenu.querySelectorAll("ul li").item(3),!a),b.setStatesSupported(a)}).catch(function(e){void 0===e.response?t.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;"><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors">'+b.localization("CORS Error")+"</a></strong>":t.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+b.localization("Network Error")+"</strong>"}),clearInterval(n),Q.romdb=d)},500),!1;var t,p,n}var k=function(){d.db&&d.getAll(function(e){Array.isArray(e)&&10<e.length&&e.sort(function(e,t){return(t.lastaccess||0)-(e.lastaccess||0)}).forEach(function(e,t){10<t&&!Q.saveFilenames.includes(e.key)?(d.remove(e.key),u.db&&u.remove(e.key)):(delete e.data,d.put(e.key,e))})},function(){d.clear(),u.db&&u.clear()})},O=function(e){if(Q.gamePatch){var t=e.startName.split("/"),n=t.pop().split(".").pop(),o=(Q.gamePatch.split(".").pop(),Q.gamePatch.split("/").pop().split(".").shift()),t=(t="".concat(t.join("/"),"/").concat(o,".").concat(n)).replace(/\#/g,""),o=Q.gamePatch;if(Q.FS.rename(e.startName,t),e.startName=t,"snes"===e.system||["snes2002","snes2005","snes2010"].includes(e.system)){var a,i,r,s,n=new K(Q.FS.readFile(e.startName)),t=$(n),c=new K(Q.FS.readFile(o)),l=c.readString(6),d=n._u8array.length%1024;l.startsWith("PATCH")?(a=ve(c),0==d&&"B19ED489"===t.toString(16).toUpperCase()&&((i=new Uint8Array(n._u8array.length+512)).set(new Uint8Array(512),0),i.set(n._u8array,512),n=new K(i))):l.startsWith(Oe)?a=je(c):l.startsWith("BPS1")&&(a=Ce(c),0<d&&"A31BEAD4"===t.toString(16).toUpperCase()&&(i=n._u8array.slice?n._u8array.slice(d):n._u8array.subarray(d),n=new K(i)));try{(r=a.apply(n,!1))&&(0<(s=r._u8array.length%1024)&&(i=r._u8array.slice?r._u8array.slice(s):r._u8array.subarray(s),r=new K(i)),Q.FS.unlink(o),Q.FS.unlink(e.startName),Q.FS.writeFile(e.startName,r._u8array))}catch(e){}}else{var u,f,l=new K(Q.FS.readFile(e.startName)),c=new K(Q.FS.readFile(o)),t=c.readString(6);t.startsWith("PATCH")?u=ve(c):t.startsWith(Oe)?u=je(c):t.startsWith("BPS1")&&(u=Ce(c));try{(f=u.apply(l,!1))&&(Q.FS.unlink(o),Q.FS.unlink(e.startName),Q.FS.writeFile(e.startName,f._u8array))}catch(e){}}}},M=function(){m?(window.Module.TOTAL_MEMORY=268435456,["jaguar"].includes(h.system)&&(window.Module.TOTAL_MEMORY=268435456),["nds","nes","snes","arcade","mame"].includes(h.system)&&(window.Module.TOTAL_MEMORY=0),["snes2002","snes2005","snes2010"].includes(h.system)&&(window.Module.TOTAL_MEMORY=0),"gba"==h.system&&(window.Module.TOTAL_MEMORY=0),"3do"==h.system&&(window.Module.TOTAL_MEMORY=0),"n64"==h.system&&(window.Module.TOTAL_MEMORY=0)):("nes"===h.system&&(window.Module.TOTAL_MEMORY=134217728),window.Module.TOTAL_MEMORY=f+67108864,["arcade","mame","mame2003","fba0.2.97.29"].includes(h.system)&&(window.Module.TOTAL_MEMORY=f+268435456,Q.isMobileDevice&&(window.Module.TOTAL_MEMORY=314572800)),["n64","nds","jaguar"].includes(h.system)&&(window.Module.TOTAL_MEMORY=f+268435456,Q.isMobileDevice&&(window.Module.TOTAL_MEMORY=314572800)),"gba"==h.system&&(window.Module.TOTAL_MEMORY=268435456)),"undefined"!=typeof EJS_MEMORY&&(window.Module.TOTAL_MEMORY=EJS_MEMORY)},R=function(e,t){function r(){"string"==typeof s.loadStateOnStart&&fetch(s.loadStateOnStart).then(function(e){e.arrayBuffer().then(function(e){e=new Uint8Array(e);EJS_loadState(e)})})}function n(e){if(e.data){if(1===e.data.t){c.innerHTML="Game Data ready",e.target.terminate();try{M(),O(s),k(),!s.startName&&u&&(s.startName=u);var t=[s.startName,[Q.hash,Q.hash2,Q.hash3].join("")];"undefined"!=typeof EJS_DEBUG_XX&&!0===EJS_DEBUG_XX&&t.unshift("-v"),Q.Module.callMain(t),2===b.coreVer&&(Q.Module.resumeMainLoop(),Q.Module.setCanvasSize(800,600)),B.call(s,s.elements.container,"start-game")}catch(e){console.log(e),c.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">Failed to start game</strong>'}try{r()}catch(e){}}if(2===e.data.t){var n=e.data.file.split("/"),o=(a=n.pop()).split(".").pop(),a=a.replace(/\#/g,"");Q._FS.createPath("/",n.join("/"),!0,!0);for(var i=p[l].length-1;0<=i;--i)p[l][i]===o.toLowerCase()&&d<i&&(d=i,s.startName=["",n.join("/"),a].join("/"),s.startName=s.startName.replace(/\/+/,"/"));a&&(Q._FS.createDataFile("/".concat(n.join("/")),a,e.data.data,!0,!1),f+=e.data.data.length),u="/".concat(n.join("/"),"/").concat(a)}4===e.data.t&&0<e.data.total&&(t=Math.floor(e.data.current/e.data.total*100),e=e.data.name||"",t<=100&&0<t&&(c.innerHTML=h.localization("Decompress Game Data")+" ".concat(e," ").concat(t,"%")))}}var s=h,c=Q.loading.querySelector(".".concat(S.p3)),l=(e.split(".").pop(),g[y]),d=-1,u="",o=(window.EJS_terminate=function(){if(Q.Module.pauseMainLoop(),s&&s.eventListeners)for(var e in s)for(var t=0;t<s.eventListeners.length;t++)(n=s.eventListeners[t]).element.removeEventListener(n.type,n.callback,n.capture);if(window.EJS_RESET_VARS){var n=[],o=[];for(e in window)n.push(e);for(t=0;t<n.length;t++)window.EJS_RESET_VARS.includes(n[t])||o.push(n[t]);for(t=0;t<o.length;t++)window[o[t]]&&delete window[o[t]]}},!1);if(["arcade","mame","mame2003","fba0.2.97.29"].includes(s.system)||(a=t.slice?t.slice(0,10):t.subarray(0,10),"7z"===(a=T(a))?(C(v).then(function(e){e.onmessage=n,e.postMessage(t)}),o=!0):"zip"===a?(C(w).then(function(e){e.onmessage=n,e.postMessage(t)}),o=!0):"rar"==a&&(E(x,"rar").then(function(e){e.onmessage=n,e.postMessage(t)}),o=!0)),!o){var a=e.replace(/\#/g,"");try{f+=t.length,Q._FS.createDataFile("/",a,t,!0,!1)}catch(e){console.log(e)}M(),s.startName=a,O(s),k();try{var i=[s.startName,[Q.hash,Q.hash2,Q.hash3].join("")];"undefined"!=typeof EJS_DEBUG_XX&&!0===EJS_DEBUG_XX&&i.unshift("-v"),Q.Module.callMain(i),2===b.coreVer&&(Q.Module.resumeMainLoop(),Q.Module.setCanvasSize(800,600)),B.call(s,s.elements.container,"start-game")}catch(e){console.log(e),c.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">Failed to start game</strong>'}try{r()}catch(e){}}},s=function(){var t=h,n=Q.loading.querySelector(".".concat(S.p3)),e=h.config,o=(e.gameId,e.gameUrl),a=e.system,e=("vbanext"==a&&(a="gba"),o.split("/")),l=e[e.length-1];(l=-1<l.indexOf("?")?l.substr(0,l.indexOf("?")):l).split(".").pop(),n.innerHTML=h.localization("Download Game Data"),["arcade","mame","mame2003","fba0.2.97.29"].includes(t.system)&&t.config.gameParentUrl&&(n.innerHTML+=" (2/2)"),t.config.gamePatchUrl&&(n.innerHTML+=" (2/2)"),(o.startsWith("blob:")?new Promise(async function(e,t){e({headers:{"content-length":(await(await fetch(o)).blob()).size,"content-type":"text/plain"}})}):X.a.head(o,{})).then(function(e){function i(){(o.startsWith("blob:")?new Promise(async function(e,t){e({data:await(await fetch(o)).arrayBuffer()})}):X.a.get(o,{onDownloadProgress:function(e){e=e.total?"".concat(Math.floor(e.loaded/e.total*100),"%"):"";["arcade","mame","mame2003","fba0.2.97.29"].includes(t.system)&&t.config.gameParentUrl||t.config.gamePatchUrl?n.innerHTML=h.localization("Download Game Data")+" (2/2) ".concat(e):n.innerHTML=h.localization("Download Game Data")+" ".concat(e)},responseType:"arraybuffer"})).then(function(e){var t=new Uint8Array(e.data);if(h.config.gameUrl.startsWith("blob:")||h.config.gameUrl.startsWith("file:")||h.config.gameUrl.startsWith("chrome-extension:")||("file:"==window.location.protocol||"chrome-extension:"==window.location.protocol)&&1==h.config.gameUrl.split(":").length)R(l,t);else{if(c&&d.db)if(104857600<t.length)for(var n=Math.ceil(t.length/104857600),o=0;o<n;o+=1){var a=t.slice?t.slice(104857600*o,104857600*(o+1)):t.subarray(104857600*o,104857600*(o+1)),i="".concat(c);0<o&&(i="".concat(c,"-part-").concat(o)),Q.saveFilenames.push(i),d.put(i,{filename:l,filesize:t.length,filetype:s,key:i,lastaccess:(new Date).valueOf(),next:"".concat(c,"-part-").concat(o+1)}),u.db&&u.put(i,{filename:l,filesize:t.length,filetype:s,key:i,data:a})}else Q.saveFilenames.push(c),d.put(c,{filename:l,filesize:t.length,filetype:s,key:c,lastaccess:(new Date).valueOf()}),u.db&&u.put(c,{filename:l,filesize:t.length,filetype:s,key:c,data:t});R(l,t)}}).catch(function(e){void 0===e.response?n.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;"><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors">'+h.localization("CORS Error")+"</a></strong>":n.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+h.localization("Network Error")+"</strong>"})}var r=e.headers["content-length"],s=e.headers["content-type"],c=(e.headers["last-modified"],"".concat(a,"-").concat(l));u.db?u.get(c,function(t){if(t&&t.filename===l&&t.filesize-r==0&&t.filetype===s&&t.key)if(d.get(c,function(e){e.lastaccess=(new Date).valueOf(),d.put(e.key,e)}),104857600<t.filesize){var n=new Uint8Array(t.filesize);n.set(t.data);for(var e=Math.ceil(t.filesize/104857600),o=[],a=1;a<e;a+=1)o.push("".concat(c,"-part-").concat(a)),d.get("".concat(c,"-part-").concat(a),function(e){e.lastaccess=(new Date).valueOf(),d.put(e.key,e)});u.getBatch(o,function(e){e.filter(function(e){return e}).length!==o.length?i():(e.forEach(function(e,t){n.set(e.data,104857600*(t+1))}),R(t.filename,n))},function(){},"sparse")}else R(t.filename,t.data);else i()}):i()}).catch(function(e){void 0===e.response?n.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;"><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors">'+h.localization("CORS Error")+"</a></strong>":n.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+h.localization("Network Error")+"</strong>"})},P=function(){var e,r,t=Q.loading.querySelector(".".concat(S.p3)),n=h.config.gamePatchUrl;n?(e=n.split("/"),(r=-1<(r=e[e.length-1]).indexOf("?")?r.substr(0,r.indexOf("?")):r).split(".").pop(),t.innerHTML=h.localization("Download Game Data")+" (1/2)",X.a.get(n,{onDownloadProgress:function(e){t.innerHTML=h.localization("Download Game Data")+" (1/2) ";e=e.total?"".concat(Math.floor(e.loaded/e.total*100),"%"):"";t.innerHTML+=e},responseType:"arraybuffer"}).then(function(e){var t,n,a,o,e=new Uint8Array(e.data);function i(e){var t,n,o;e.data&&(1===e.data.t&&(e.target.terminate(),s()),2===e.data.t&&(n=(t=(o=e.data.file.split("/")).pop()).split(".").pop(),Q._FS.createPath("/",o.join("/"),!0,!0),Q._FS.createDataFile("/"+o.join("/"),t,e.data.data,!0,!1),f+=e.data.data.length,["ips","bps","ups"].includes(n)&&!Q.gamePatch&&(Q.gamePatch="/"+o.join("/")+"/"+t)),4===e.data.t&&0<e.data.total&&(n=Math.floor(e.data.current/e.data.total*100),o=e.data.name||"",n<=100&&0<n&&(a.innerHTML=h.localization("Decompress Game Patch")+" ".concat(o," ").concat(n,"%"))))}t=r,n=e,a=Q.loading.querySelector(".".concat(S.p3)),t.split(".").pop(),e=!1,o=n.slice?n.slice(0,10):n.subarray(0,10),"7z"===(o=T(o))?(C(v).then(function(e){e.onmessage=i,e.postMessage(n)}),e=!0):"zip"===o?(C(w).then(function(e){e.onmessage=i,e.postMessage(n)}),e=!0):"rar"==o&&(E(x,"rar").then(function(e){e.onmessage=messageCallBack,e.postMessage(n)}),e=!0),e||(f+=n.length,Q.gamePatch="/".concat(t),Q._FS.createDataFile("/",t,n,!0,!1),s())}).catch(function(e){void 0===e.response?w.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;"><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors">'+h.localization("CORS Error")+"</a></strong>":w.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+h.localization("Network Error")+"</strong>"})):s()},l=function(){var e,l,t=h,n=Q.loading.querySelector(".".concat(S.p3)),o=h.config.gameParentUrl;o&&["arcade","mame","mame2003","fba0.2.97.29"].includes(t.system)?(e=o.split("/"),(l=-1<(l=e[e.length-1]).indexOf("?")?l.substr(0,l.indexOf("?")):l).split(".").pop(),n.innerHTML=h.localization("Download Game Data")+" (1/2)",t.config.gamePatchUrl&&(n.innerHTML=h.localization("Download Game Data")+" (1/3)"),X.a.head(o,{}).then(function(e){function i(){X.a.get(o,{onDownloadProgress:function(e){e=e.total?"".concat(Math.floor(e.loaded/e.total*100),"%"):"";n.innerHTML=h.localization("Download Game Data")+" (1/2) ".concat(e)},responseType:"arraybuffer"}).then(function(e){var t=new Uint8Array(e.data);if(c&&d.db)if(104857600<t.length)for(var n=Math.ceil(t.length/104857600),o=0;o<n;o+=1){var a=t.slice?t.slice(104857600*o,104857600*(o+1)):t.subarray(104857600*o,104857600*(o+1)),i="".concat(c);0<o&&(i="".concat(c,"-part-").concat(o)),Q.saveFilenames.push(i),d.put(i,{filename:l,filesize:t.length,filetype:s,key:i,lastaccess:(new Date).valueOf(),next:"".concat(c,"-part-").concat(o+1)}),u.db&&u.put(i,{filename:l,filesize:t.length,filetype:s,key:i,data:a})}else Q.saveFilenames.push(c),d.put(c,{filename:l,filesize:t.length,filetype:s,key:c,lastaccess:(new Date).valueOf()}),u.db&&u.put(c,{filename:l,filesize:t.length,filetype:s,key:c,data:t});e=l.replace(/\#/g,"");try{f+=t.length,Q._FS.createDataFile("/",e,t,!0,!1),P()}catch(e){console.log(e)}}).catch(function(e){void 0===e.response?n.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;"><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors">'+h.localization("CORS Error")+"</a></strong>":n.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+h.localization("Network Error")+"</strong>"})}var r=e.headers["content-length"],s=e.headers["content-type"],c=(e.headers["last-modified"],"".concat(y,"-").concat(l));u.db?u.get(c,function(t){if(t&&t.filename===l&&t.filesize-r==0&&t.filetype===s&&t.key)if(104857600<t.filesize){var n=new Uint8Array(t.filesize);n.set(t.data);for(var e=Math.ceil(t.filesize/104857600),o=[],a=1;a<e;a+=1)o.push("".concat(c,"-part-").concat(a));u.getBatch(o,function(e){e.filter(function(e){return e}).length!==o?i():(e.forEach(function(e,t){n.set(e.data,104857600*(t+1))}),Q._FS.createDataFile("/",t.filename,n,!0,!1),P())},function(){},"sparse")}else Q._FS.createDataFile("/",t.filename,t.data,!0,!1),P();else i()}):i()}).catch(function(e){void 0===e.response?n.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;"><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors">'+h.localization("CORS Error")+"</a></strong>":n.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+h.localization("Network Error")+"</strong>"})):P()},j=function(e,t){function n(e){var t,n;e.data&&(1===e.data.t&&(a.innerHTML="BIOS ready",e.target.terminate(),l()),2===e.data.t&&((n=(t=e.data.file.split("/")).pop()).split(".").pop(),Q._FS.createPath("/",t.join("/"),!0,!0),Q._FS.createDataFile("/"+t.join("/"),n,e.data.data,!0,!1),f+=e.data.data.length),4===e.data.t&&0<e.data.total&&(t=Math.floor(e.data.current/e.data.total*100),n=e.data.name||"",t<=100&&0<t&&(a.innerHTML="Decompress BIOS ".concat(n," ").concat(t,"%"))))}var o=h,a=Q.loading.querySelector(".".concat(S.p2)),i=(e.split(".").pop(),!1),r=t.slice?t.slice(0,10):t.subarray(0,10),r=T(r);"7z"===r?(C(v).then(function(e){e.onmessage=n,e.postMessage(t)}),i=!0):"zip"!==r||["arcade","mame","mame2003","fba0.2.97.29"].includes(o.system)?"rar"===r&&(E(x,"rar").then(function(e){e.onmessage=messageCallBack,e.postMessage(t)}),i=!0):(C(w).then(function(e){e.onmessage=n,e.postMessage(t)}),i=!0),i||(f+=t.length,a.innerHTML="BIOS ready",Q._FS.createDataFile("/",e,t,!0,!1),l())},N=function(){Q.loading.querySelector(".".concat(S.p1)).innerHTML="Game Core ready";var a,i,r=h.config.biosUrl,s=h,e=(Z.bindFunction.call(h),Z.setGamepadDialog.call(h),Z.setCacheDialog.call(h),Z.setLoadingDialog.call(h),Z.setNetplayDialog.call(h),Z.setCheatDialog.call(h),Z.initGamepad.call(h),Z.initKeyboard.call(h),Z.listeners.call(h),Q._FS.createFolder("/","etc",!0,!0),Q.FS.mkdir("/data"),Q.FS.mkdir("/data/saves"),"undefined"!=typeof IDBFS?Q.FS.mount(IDBFS,{},"/data/saves"):Q.FS.mount(Q.FS.filesystems.IDBFS,{},"/data/saves"),Q.FS.mkdir("/shader"),Q.FS.syncfs(!0,function(e){}),Z.initShaders(),""),t=(e=(e=(e=(e=(e+="savefile_directory = /data/saves\n")+"video_vsync = true\n"+"screenshot_directory = /\n")+"video_shader = /shader/shader.glslp\n"+"video_shader_enable = true\n")+"video_font_enable = false\n"+"video_scale = 1.0\n")+"video_gpu_screenshot = false\n"+"audio_latency = 96\n",ee.defaultCoreOptionsValues.call(h)),n=(s.lightgun&&("nes"===h.system&&(e+='input_libretro_device_p2 = "258"\n'),"segaMS"!==h.system&&"segaMD"!==h.system&&"segaCD"!==h.system||(t.genesis_plus_gx_gun_cursor="yes",t.genesis_plus_gx_invert_mouse="yes",t.genesis_plus_gx_bram="per game",e+='input_libretro_device_p2 = "260"\n'),"snes"===h.system&&(e+='input_libretro_device_p2 = "260"\n'),["snes2002","snes2005","snes2010","snesnext"].includes(h.system)&&(e+='input_libretro_device_p2 = "260"\n')),s.mouse&&("snes"===h.system&&(e+="input_libretro_device_p1 = 2\n"),["snes2002","snes2005","snes2010","snesnext"].includes(h.system)&&(e+="input_libretro_device_p1 = 2\n")),s.multitap&&("snes"===h.system&&(e+="input_libretro_device_p2 = 257\n"),["snes2002","snes2005","snes2010","snesnext"].includes(h.system)&&(e+="input_libretro_device_p2 = 257\n")),"n64"===h.system&&(e+="input_libretro_device_p1 = 5\n"),s.system,e=e+"fastforward_ratio = 1.0\n"+"video_smooth = false\n",Y(t,ee.storage.get("core-options")||{})),o="";2===s.coreVer?(Q._FS.createDataFile("/etc","retroarch.cfg",e,!0,!0),Q._FS.createFolder("/home/web_user","retroarch",!0,!0),Q._FS.createFolder("/home/web_user/retroarch","userdata",!0,!0),Q._FS.createDataFile("/home/web_user/retroarch/userdata","retroarch.cfg",o,!0,!0)):(Q._FS.createDataFile("/etc","retroarch.cfg",e,!0,!0),Q._FS.createFolder("/home/web_user",".config",!0,!0),Q._FS.createFolder("/home/web_user/.config","retroarch",!0,!0),Q._FS.createDataFile("/home/web_user/.config/retroarch","retroarch-core-options.cfg",o,!0,!0)),n&&Object.keys(n).forEach(function(t){if(s.lightgun&&"nes"===s.system&&"system_type"===t)return!1;o+="".concat(t,' = "').concat(n[t],'"\n'),z.call(s,s.elements.container,"start-game",function(e){Z.setVariable(t,n[t])})}),r?(t=r.split("/"),(a=-1<(a=t[t.length-1]).indexOf("?")?a.substr(0,a.indexOf("?")):a).split(".").pop(),i=Q.loading.querySelector(".".concat(S.p2)),X.a.head(r,{}).then(function(e){function t(){X.a.get(r,{onDownloadProgress:function(e){e=e.total?"".concat(Math.floor(e.loaded/e.total*100),"%"):"";i.innerHTML="Download BIOS ".concat(e)},responseType:"arraybuffer"}).then(function(e){e=new Uint8Array(e.data);c.db&&c.put(y,{filename:a,filesize:e.length,filetype:o,data:e}),j(a,e)}).catch(function(e){void 0===e.response?i.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;"><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors">'+h.localization("CORS Error")+"</a></strong>":i.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+h.localization("Network Error")+"</strong>"})}var n=e.headers["content-length"],o=e.headers["content-type"],e=(e.headers["last-modified"],s.system);c.db?c.get(e,function(e){e&&e.filename===a&&e.filesize-n==0&&e.filetype===o?j(e.filename,e.data):t()}):t()}).catch(function(e){void 0===e.response?i.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;"><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors">'+h.localization("CORS Error")+"</a></strong>":i.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+h.localization("Network Error")+"</strong>"})):l()},I=function(e){e=e.byteLength?new Uint8Array(e):e;"undefined"!=typeof GLOBAL_BASE?Q.Module.HEAPU8.set(e,GLOBAL_BASE):"undefined"!=typeof Runtime&&Runtime.GLOBAL_BASE?Q.Module.HEAPU8.set(e,Runtime.GLOBAL_BASE):Q.Module.HEAPU8.set(e,8)},L=function(t){function n(e){var t,n;e.data&&(1===e.data.t&&(B.call(b,b.elements.container,"script-loaded"),e.target.terminate()),2===e.data.t&&(n=(t=e.data.file.split("/").pop()).split(".").pop(),Q.coreFileData[t]=e.data.data,"js"!==n||t.includes(".worker.js")||(a=e.data.data),"mem"===n&&(Q.memData=e.data.data),"wasm"===n&&(Q.wasmData=e.data.data)),4===e.data.t&&0<e.data.total&&(o.innerHTML=h.localization("Decompress Game Core")+" ".concat(Math.floor(e.data.current/e.data.total*100),"%")))}var o=Q.loading.querySelector(".".concat(S.p1)),a="";z.call(b,b.elements.container,"script-loaded",function(e){var t,n;null!==Q.wasmData?(window.Module.wasmBinary=Q.wasmData,M(),window.Module.monitorRunDependencies=function(e){0===e&&N()},window.Module.onRuntimeInitialized=function(){}):(M(),window.Module.monitorRunDependencies=function(e){console.log("monitorRunDependencies, ",e)},window.Module.onRuntimeInitialized=function(){Q.Module||(Q.Module=window.Module),Q.Module&&Q.Module.FS?Q.FS=Q.Module.FS:Q.FS=window.FS,console.log("onRuntimeInitialized"),N()}),n=window.Module,null!==Q.wasmData&&(n.wasmBinary=Q.wasmData),H.isIos&&null!==Q.wasmData?(t=new Blob([a],{type:"text/javascript"}),t=U("script",{src:r.createObjectURL(t)}),document.body.appendChild(t),t.onload=function(){void 0===window.addRunDependency&&"undefined"!=typeof EmulatorJS&&(Q.Module=EmulatorJS(n),EmulatorJS=void 0),null!==Q.memData&&I(Q.memData),Q.Module||(Q.Module=window.Module),Q.Module&&Q.Module.FS?Q.FS=Q.Module.FS:Q.FS=window.FS}):(a=function(e){for(var t=[],n=0;n<e.length;n+=1){var o=e[n];255<o&&(o&=255),t.push(String.fromCharCode(o))}return t.join("")}(a),window.eval(a),void 0===window.addRunDependency&&"undefined"!=typeof EmulatorJS&&(Q.Module=EmulatorJS(n),EmulatorJS=void 0),null!==Q.memData&&I(Q.memData),Q.Module||(Q.Module=window.Module),Q.Module&&Q.Module.FS?Q.FS=Q.Module.FS:Q.FS=window.FS,window.EJS_MODULE=Q.Module,window.ejs_loader=Q,window.ejs_media=Z),a=null});C(v).then(function(e){e.onmessage=n,e.postMessage(t)})};te(Q.loading.querySelector(".".concat(S["start-game"])),"click touchstart",t),!0===b.startOnLoad&&t()}},m=Q,Ie=e(161);function Le(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function De(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}ze=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],De(Ve.prototype,[{key:"registerTriggers",value:function(){for(var t=this,e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];n.forEach(function(e){e.addEventListener("click",function(){return t.showModal()})})}},{key:"showModal",value:function(){this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(q({"is-open":!0})),this.setFocusToFirstNode(),this.addEventListeners(),this.config.onShow(this.modal)}},{key:"closeModal",value:function(){var t=this.modal;this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.config.onClose(this.modal),this.config.awaitCloseAnimation?this.modal.addEventListener("animationend",function e(){t.classList.remove(q({"is-open":!0})),t.removeEventListener("animationend",e,!1)},!1):t.classList.remove(q({"is-open":!0}))}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){e.target.hasAttribute(this.config.closeTrigger)&&(this.closeModal(),e.preventDefault())}},{key:"onKeydown",value:function(e){this.config.closeByEsckey&&27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.maintainFocus(e)}},{key:"getFocusableNodes",value:function(){var t=this.modal.querySelectorAll(ze);return Object.keys(t).map(function(e){return t[e]})}},{key:"setFocusToFirstNode",value:function(){var e;this.config.disableFocus||(e=this.getFocusableNodes()).length&&e[0].focus()}},{key:"maintainFocus",value:function(e){var t,n=this.getFocusableNodes();this.modal.contains(document.activeElement)?(t=n.indexOf(document.activeElement),e.shiftKey&&0===t&&(n[n.length-1].focus(),e.preventDefault()),e.shiftKey||t!==n.length-1||(n[0].focus(),e.preventDefault())):n[0].focus()}}]),Be=Ve;var ze,Be,Ue,Fe,Ge,g={init:function(e){var n,o,t=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),e=Le(document.querySelectorAll("[".concat(t.openTrigger,"]"))),a=(n=t.openTrigger,o=[],e.forEach(function(e){var t=e.attributes[n].value;void 0===o[t]&&(o[t]=[]),o[t].push(e)}),o);if(!0!==t.debugMode||!1!==Ge(e,a))for(var i in a){var r=a[i];t.targetModal=i,t.triggers=Le(r),new Be(t)}},show:function(e,t){t=t||{};return t.targetModal=e,!0===t.debugMode&&!1===Fe(e)?Ue=null:(Ue=new Be(t)).showModal(),Ue},close:function(){Ue.closeModal()}},b={defaultControllers:{0:{0:{value:"88",value2:"1"},1:{value:"83",value2:"3"},2:{value:"16",value2:"8"},3:{value:"13",value2:"9"},4:{value:"38",value2:"12"},5:{value:"40",value2:"13"},6:{value:"37",value2:"14"},7:{value:"39",value2:"15"},8:{value:"90",value2:"0"},9:{value:"65",value2:"2"},10:{value:"81",value2:"4"},11:{value:"69",value2:"5"},12:{value:"82",value2:"6"},13:{value:"87",value2:"7"},14:{},15:{},16:{value:"72"},17:{value:"70"},18:{value:"71"},19:{value:"84"},20:{value:"76"},21:{value:"74"},22:{value:"75"},23:{value:"73"},24:{},25:{},26:{}},1:{},2:{},3:{}},controllers:{},virtualGamepadContainer:Ue=null,keyMap:{8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",19:"pause/break",20:"caps lock",27:"escape",32:"space",33:"page up",34:"page down",35:"end",36:"home",37:"left arrow",38:"up arrow",39:"right arrow",40:"down arrow",45:"insert",46:"delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",91:"left window key",92:"right window key",93:"select key",96:"numpad 0",97:"numpad 1",98:"numpad 2",99:"numpad 3",100:"numpad 4",101:"numpad 5",102:"numpad 6",103:"numpad 7",104:"numpad 8",105:"numpad 9",106:"multiply",107:"add",109:"subtract",110:"decimal point",111:"divide",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"num lock",145:"scroll lock",186:"semi-colon",187:"equal sign",188:"comma",189:"dash",190:"period",191:"forward slash",192:"grave accent",219:"open bracket",220:"back slash",221:"close braket",222:"single quote"},saveLoaddbDB:{put:function(t,n){var o=indexedDB.open("ejs-states",1);o.onerror=function(){},o.onsuccess=function(){var e=o.result.transaction(["states"],"readwrite").objectStore("states").put(n,t);e.onerror=function(){},e.onsuccess=function(){}},o.onupgradeneeded=function(){var e=o.result;e.objectStoreNames.contains("states")||e.createObjectStore("states")}},get:function(o){return new Promise(function(t,e){var n=indexedDB.open("ejs-states",1);n.onerror=function(){},n.onsuccess=function(){var e=n.result.transaction(["states"],"readwrite").objectStore("states").get(o);e.onsuccess=async function(e){e=e.target.result;e&&t(e)},e.onerror=function(){}},n.onupgradeneeded=function(){var e=n.result;e.objectStoreNames.contains("states")||e.createObjectStore("states")}})}},saveLoadDB:function(e){try{if(ee&&"function"==typeof ee.getCoreOptionsValues){var t=ee.getCoreOptionsValues()["save-state-location"],n=ee.getCoreOptionsValues()["save-state-slot"],o=this.config.gameUrl.split("/").pop();if(this.gameName&&(o=this.gameName),!this.gameName&&this.config.gameUrl.startsWith("blob:")||!window.indexedDB)return!1;var a=o+"-"+n;if(!t||"download"===t)return!1;if("save"===e)try{var i=b.saveState();b.saveLoaddbDB.put(a,i)}catch(e){return!1}else b.saveLoaddbDB.get(a).then(function(e){EJS_loadState(e)});return!0}return!1}catch(e){return!1}},gamepad:null,allowCheat:!0,connection:null,connected:!(Ge=function(e,t){if(e.length<=0&&(console.warn("MicroModal v".concat(version,": ❗Please specify at least one %c'micromodal-trigger'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<a href="#" data-micromodal-trigger="my-modal"></a>')),!t)return!0;for(var n in t)Fe(n);return!0}),playerName:"",players:[],waitingList:{},roomMaster:null,inputsData:{},coreOptionData:{},currentFrame:0,wait:!(Fe=function(e){if(!document.getElementById(e))return!1}),progressHelper:{},icons:{lock:'<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="lock" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="svg-inline--fa fa-lock fa-w-14 fa-3x"><path fill="currentColor" d="M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z" class=""></path></svg>'},disableInput:!1,disableControl:function(e){if(e){for(var t=0;t<24;t+=1)b.simulateInputFn(0,t,0),b.simulateInputFn(1,t,0),b.simulateInputFn(2,t,0),b.simulateInputFn(3,t,0);b.disableInput=!0}else b.disableInput=!1},loadRoomsListTimer:null,loadRoomsList:function(){},stopLoadRooms:function(){b.loadRoomsListTimer&&clearTimeout(b.loadRoomsListTimer)},openRoom:function(){},isPaused:null,setVolume:null,setVariable:null,simulateInput:null,simulateInputFn:null,toggleShader:null,saveState:null,screenRecord:null,loadState:null,quickSaveState:null,quickLoadState:null,changeStateSlot:null,getScreenData:null,getStateInfo:null,setCheat:null,resetCheat:null,getGameCoreOptions:null,classNames:{"dialog-container":q({"dialog-container":!0}),tabs:q({tabs:!0}),"dialog-title":q({"dialog-title":!0}),"dialog-content":q({"dialog-content":!0}),"dialog-buttons":q({"dialog-buttons":!0}),overlay:q({overlay:!0}),"key-setting-popup":q({"key-setting-popup":!0}),"tabs-panel":q({"tabs-panel":!0}),"tabs-content":q({"tabs-content":!0}),"button-container":q({"button-container":!0}),set:q({set:!0}),active:q({active:!0}),"btn-cancel":q({"btn-cancel":!0}),"btn-reset":q({"btn-reset":!0}),"btn-clear":q({"btn-clear":!0}),"btn-create":q({"btn-create":!0}),"btn-submit":q({"btn-submit":!0}),"btn-join-room":q({"btn-join-room":!0}),"btn-quit":q({"btn-quit":!0}),"btn-create-room":q({"btn-create-room":!0}),"netplay-player-name":q({"netplay-player-name":!0}),"netplay-roomlist":q({"netplay-roomlist":!0}),"netplay-room-name-input":q({"netplay-room-name-input":!0}),"netplay-room-password-input":q({"netplay-room-password-input":!0}),"netplay-create-room-set":q({"netplay-create-room-set":!0}),"netplay-room":q({"netplay-room":!0}),modal:q({modal:!0}),modal__overlay:q({modal__overlay:!0}),modal__container:q({modal__container:!0}),modal__header:q({modal__header:!0}),modal__title:q({modal__title:!0}),modal__close:q({modal__close:!0}),modal__content:q({modal__content:!0}),modal__btn:q({modal__btn:!0}),"modal__btn-primary":q({"modal__btn-primary":!0}),"micromodal-slide":q({"micromodal-slide":!0}),modal__errmsg:q({modal__errmsg:!0}),modal__footer:q({modal__footer:!0}),"cheats-add":q({"cheats-add":!0}),"cheats-list":q({"cheats-list":!0}),"cheat-code-input":q({"cheat-code-input":!0}),"cheat-name-input":q({"cheat-name-input":!0}),"ejs-switch":q({"ejs-switch":!0}),"ejs-delete-cheat":q({"ejs-delete-cheat":!0})},initShaders:function(){for(var e,t=ge,n=Object.keys(t),o=0;o<n.length;o+=1)e=t[n[o]],m.FS.writeFile("/shader/".concat(n[o]),e),ee.storage.get("shader")===n[o]&&m.FS.writeFile("/shader/shader.glslp",e)},setGamepadDialog:function(){var i,s=this,e=(s.elements.dialogs.gamepad.innerHTML='\n <div class="'+b.classNames["dialog-container"]+'">\n <div class="'+b.classNames["dialog-title"]+'">\n <h4>'+s.localization("Control Settings")+'</h4>\n </div>\n \n <ul class="'+b.classNames.tabs+'" id="controls-tabs">\n <li class="tabs-title" role="presentation"><a href="#" onclick="return false" role="tab" aria-controls="controls-0" aria-selected="false" id="controls-0-label">'+s.localization("Player 1")+'</a></li>\n <li class="tabs-title" role="presentation"><a href="#" onclick="return false" role="tab" aria-controls="controls-1" aria-selected="false" id="controls-1-label">'+s.localization("Player 2")+'</a></li>\n <li class="tabs-title" role="presentation"><a href="#" onclick="return false" role="tab" aria-controls="controls-2" aria-selected="false" id="controls-2-label">'+s.localization("Player 3")+'</a></li>\n <li class="tabs-title" role="presentation"><a href="#" onclick="return false" role="tab" aria-controls="controls-3" aria-selected="false" id="controls-3-label">'+s.localization("Player 4")+'</a></li>\n </ul>\n <div class="'+b.classNames["dialog-content"]+'">\n <div class="'+b.classNames["tabs-content"]+' controls">\n \n </div>\n </div>\n <div class="'+b.classNames["dialog-buttons"]+'">\n <a href="#" onclick="return false" class="'+b.classNames["btn-submit"]+'">'+s.localization("Update")+'</a>\n <a href="#" onclick="return false" class="'+b.classNames["btn-reset"]+'">'+s.localization("Reset")+'</a>\n <a href="#" onclick="return false" class="'+b.classNames["btn-clear"]+'">'+s.localization("Clear")+'</a>\n <a href="#" onclick="return false" class="'+b.classNames["btn-cancel"]+'">'+s.localization("Cancel")+'</a>\n </div>\n <div class="'+b.classNames.overlay+'" hidden>\n <div class="'+b.classNames["key-setting-popup"]+'">\n <span>[Select]</span><br />\n <div style="color:#fff !important">'+s.localization("Press keyboard or gamepad")+"</div>\n </div>\n </div>\n </div>\n ",'\n <div class="'.concat(b.classNames["tabs-panel"],'" id="controls-{index}" hidden>\n <div>\n <div style="">\n <div class="gamepad" style="font-size:12px">Connected gamepad: <span class="gamepad-name">n/a</span></div>\n </div>\n <div style="width:25%;float:left">&nbsp;</div>\n <div style="font-size:12px;width:50%;float:left">\n <div class="row">\n <div style="text-align:center;width:50%;float:left">'+s.localization("Gamepad")+'</div>\n <div style="text-align:center;width:50%;float:left">'+s.localization("Keyboard")+'</div>\n </div>\n </div>\n <div style="clear:both"></div>\n </div>\n </div>')),n='\n <div class="'.concat(b.classNames["button-container"],'" data-id="{id}" data-index="{index}" data-label="{label}" style="margin-bottom:10px">\n <div style="width:25%;float:left;font-size:12px">\n <label>{label}:</label>\n </div>\n <div style="width:50%;float:left">\n <div>\n <div style="width:50%;float:left;padding: 0 5px;">\n <input style="text-align:center;height:25px;width: 100%;" type="text" data-id="{id}" data-value="" data-type="2" data-index="{index}" readonly="" placeholder="">\n </div>\n <div style="width:50%;float:left;padding: 0 5px;">\n <input style="text-align:center;height:25px;width: 100%;" type="text" data-id="{id}" data-value="" data-type="1" data-index="{index}" readonly="" placeholder="">\n </div>\n <div style="clear:both"></div>\n </div>\n </div>\n <div style="width:25%;float:left">\n <a class="').concat(b.classNames.set,'" href="#" onclick="return false">'+s.localization("Set")+'</a>\n </div>\n <div style="clear:both"></div>\n </div>');i="nes"===s.system?{0:"B",2:"SELECT",3:"START",4:"UP",5:"DOWN",6:"LEFT",7:"RIGHT",8:"A",24:s.localization("QUICK SAVE STATE"),25:s.localization("QUICK LOAD STATE"),26:s.localization("CHANGE STATE SLOT")}:"snes"===s.system?{0:"B",1:"Y",2:"SELECT",3:"START",4:"UP",5:"DOWN",6:"LEFT",7:"RIGHT",8:"A",9:"X",10:"L",11:"R",24:s.localization("QUICK SAVE STATE"),25:s.localization("QUICK LOAD STATE"),26:s.localization("CHANGE STATE SLOT")}:"n64"===s.system?{0:"B",3:"START",4:"UP",5:"DOWN",6:"LEFT",7:"RIGHT",8:"A",10:"L",11:"R",12:"Z",19:"L STICK UP",18:"L STICK DOWN",17:"L STICK LEFT",16:"L STICK RIGHT",23:"R STICK UP",22:"R STICK DOWN",21:"R STICK LEFT",20:"R STICK RIGHT",24:s.localization("QUICK SAVE STATE"),25:s.localization("QUICK LOAD STATE"),26:s.localization("CHANGE STATE SLOT")}:"nds"===s.system?{0:"B",1:"Y",2:"SELECT",3:"START",4:"UP",5:"DOWN",6:"LEFT",7:"RIGHT",8:"A",9:"X",10:"L",11:"R",14:"Microphone",24:s.localization("QUICK SAVE STATE"),25:s.localization("QUICK LOAD STATE"),26:s.localization("CHANGE STATE SLOT")}:{0:"B",1:"Y",2:"SELECT",3:"START",4:"UP",5:"DOWN",6:"LEFT",7:"RIGHT",8:"A",9:"X",10:"L",11:"R",12:"L2",13:"R2",14:"L3",15:"R3",19:"L STICK UP",18:"L STICK DOWN",17:"L STICK LEFT",16:"L STICK RIGHT",23:"R STICK UP",22:"R STICK DOWN",21:"R STICK LEFT",20:"R STICK RIGHT",24:s.localization("QUICK SAVE STATE"),25:s.localization("QUICK LOAD STATE"),26:s.localization("CHANGE STATE SLOT")},["arcade","mame"].includes(s.system)&&(i[2]=s.localization("INSERT COIN")),!1===s.statesSupported&&(delete i[24],delete i[25],delete i[26]);for(var o=[2,3,4,5,6,7,8,0,9,1,10,11,12,13,14,15,19,18,17,16,23,22,21,20,24,25,26],t=0;t<=3;t+=1)!function(t){s.elements.dialogs.gamepad.querySelector(".".concat(b.classNames["tabs-content"])).innerHTML+=e.replace(/{index}/g,t),o.forEach(function(e){i[e]&&(s.elements.dialogs.gamepad.querySelector("#controls-".concat(t)).innerHTML+=n.replace(/{index}/g,t).replace(/{id}/g,e).replace(/{label}/g,i[e]))}),s.elements.dialogs.gamepad.querySelector('[data-id="16"][data-index="'.concat(t,'"][data-type="2"]'))&&(s.elements.dialogs.gamepad.querySelector('[data-id="16"][data-index="'.concat(t,'"][data-type="2"]')).style.backgroundColor="#ccc"),s.elements.dialogs.gamepad.querySelector('[data-id="17"][data-index="'.concat(t,'"][data-type="2"]'))&&(s.elements.dialogs.gamepad.querySelector('[data-id="17"][data-index="'.concat(t,'"][data-type="2"]')).style.backgroundColor="#ccc"),s.elements.dialogs.gamepad.querySelector('[data-id="18"][data-index="'.concat(t,'"][data-type="2"]'))&&(s.elements.dialogs.gamepad.querySelector('[data-id="18"][data-index="'.concat(t,'"][data-type="2"]')).style.backgroundColor="#ccc"),s.elements.dialogs.gamepad.querySelector('[data-id="19"][data-index="'.concat(t,'"][data-type="2"]'))&&(s.elements.dialogs.gamepad.querySelector('[data-id="19"][data-index="'.concat(t,'"][data-type="2"]')).style.backgroundColor="#ccc"),s.elements.dialogs.gamepad.querySelector('[data-id="20"][data-index="'.concat(t,'"][data-type="2"]'))&&(s.elements.dialogs.gamepad.querySelector('[data-id="20"][data-index="'.concat(t,'"][data-type="2"]')).style.backgroundColor="#ccc"),s.elements.dialogs.gamepad.querySelector('[data-id="21"][data-index="'.concat(t,'"][data-type="2"]'))&&(s.elements.dialogs.gamepad.querySelector('[data-id="21"][data-index="'.concat(t,'"][data-type="2"]')).style.backgroundColor="#ccc"),s.elements.dialogs.gamepad.querySelector('[data-id="22"][data-index="'.concat(t,'"][data-type="2"]'))&&(s.elements.dialogs.gamepad.querySelector('[data-id="22"][data-index="'.concat(t,'"][data-type="2"]')).style.backgroundColor="#ccc"),s.elements.dialogs.gamepad.querySelector('[data-id="23"][data-index="'.concat(t,'"][data-type="2"]'))&&(s.elements.dialogs.gamepad.querySelector('[data-id="23"][data-index="'.concat(t,'"][data-type="2"]')).style.backgroundColor="#ccc")}(t);Object.keys(b.controllers).forEach(function(o){b.controllers[o]&&Object.keys(b.controllers[o]).forEach(function(e){var t=s.elements.dialogs.gamepad.querySelector('[data-id="'.concat(e,'"][data-index="').concat(o,'"][data-type="1"]')),n=s.elements.dialogs.gamepad.querySelector('[data-id="'.concat(e,'"][data-index="').concat(o,'"][data-type="2"]'));if(!t||!n)return!1;e=b.controllers[o][e];e&&(e.type&&1!==parseInt(e.type,10)?n.value="":e.value&&(t.value=b.keyMap[e.value]||"",t.setAttribute("data-value",e.value)),e.value2&&(n.value=isNaN(e.value2)?e.value2:"button ".concat(parseInt(e.value2,10)+1),n.setAttribute("data-value",e.value2)))})}),z.call(this,s.elements.dialogs.gamepad.querySelector(".".concat(b.classNames["btn-submit"])),"click",function(e){var t=s.elements.dialogs.gamepad.querySelectorAll("input"),a={};return Array.from(t).forEach(function(e){var t,n=e.getAttribute("data-index"),o=e.getAttribute("data-value"),e=(2===parseInt(e.getAttribute("data-type"),10)&&(t=e.getAttribute("data-value")),e.getAttribute("data-id"));a[n]||(a[n]={}),a[n][e]||(a[n][e]={}),o&&(a[n][e].value=o),t&&(a[n][e].value2=t)}),ee.storage.set({controllers:a}),b.controllers=a,F(s.elements.dialogs.gamepad,!0),s.elements.container.focus(),e.stopPropagation(),!1}),z.call(this,s.elements.dialogs.gamepad.querySelector(".".concat(b.classNames["btn-reset"])),"click",function(e){b.controllers=JSON.parse(JSON.stringify(b.defaultControllers)),localStorage.removeItem(ee.storage.key);for(var t=s.elements.dialogs.gamepad.querySelectorAll("input"),n=0;n<t.length;n++){var o=t[n].getAttribute("data-index"),a=t[n].getAttribute("data-type"),i=t[n].getAttribute("data-id"),r=1==a?"value":"value2";b.defaultControllers[o]&&b.defaultControllers[o][i]&&b.defaultControllers[o][i][r]?(t[n].value=1==a?b.keyMap[b.defaultControllers[o][i][r]]:"button "+(parseInt(b.defaultControllers[o][i][r])+1),t[n].setAttribute("data-value",b.defaultControllers[o][i][r])):(t[n].value="",t[n].setAttribute("data-value",""))}}),z.call(this,s.elements.dialogs.gamepad.querySelector(".".concat(b.classNames["btn-clear"])),"click",function(e){var t,n={0:{},1:{},2:{},3:{}};for(t in i)n[0][t]={},n[1][t]={},n[2][t]={},n[3][t]={};b.controllers=n,localStorage.setItem(ee.storage.key,JSON.stringify({controllers:b.controllers}));for(var o=s.elements.dialogs.gamepad.querySelectorAll("input"),a=0;a<o.length;a++)o[a].value="",o[a].setAttribute("data-value","")}),z.call(this,s.elements.dialogs.gamepad.querySelector(".".concat(b.classNames["btn-cancel"])),"click",function(e){return F(s.elements.dialogs.gamepad,!0),s.elements.container.focus(),e.stopPropagation(),!1}),Array.from(s.elements.dialogs.gamepad.querySelectorAll(".".concat(b.classNames.tabs," li"))).forEach(function(n){z.call(s,n,"mousedown",function(e){G(s.elements.dialogs.gamepad.querySelectorAll(".".concat(b.classNames.tabs," li")),b.classNames.active,!1),G(n,b.classNames.active,!0);var t=n.querySelector("a").getAttribute("aria-controls");return Array.from(s.elements.dialogs.gamepad.querySelectorAll(".".concat(b.classNames["tabs-content"]," .").concat(b.classNames["tabs-panel"]))).forEach(function(e){F(e,!0)}),F(s.elements.dialogs.gamepad.querySelector(".".concat(b.classNames["tabs-content"]," #").concat(t)),!1),e.stopPropagation(),!1})}),B.call(s,s.elements.dialogs.gamepad.querySelector('[aria-controls="controls-0"]').parentNode,"mousedown");var r=s.elements.dialogs.gamepad.querySelector(".".concat(b.classNames.overlay));z.call(s,r,"mousedown",function(e){F(r,!0),e.stopPropagation()}),Array.from(s.elements.dialogs.gamepad.querySelectorAll(".".concat(b.classNames["button-container"]))).forEach(function(t){z.call(s,t,"mousedown",function(e){B.call(s,t.querySelector("a.".concat(b.classNames.set)),e.type,!0,{})})}),Array.from(s.elements.dialogs.gamepad.querySelectorAll(".".concat(b.classNames["tabs-panel"]," a.").concat(b.classNames.set))).forEach(function(a){z.call(s,a,"mousedown",function(e){var t=a.parentNode.parentNode,n=t.getAttribute("data-id"),o=t.getAttribute("data-index"),t=t.getAttribute("data-label"),t=(F(r,!1),r.setAttribute("data-id",n),r.setAttribute("data-index",o),"[ ".concat(t," ]"));b.gamepad.gamepads[o]&&n<16?t+='<br /><span style="font-size:12px">Gamepad:'.concat(b.gamepad.gamepads[o].id,"</span><br />"+s.localization("Press keyboard or gamepad")+"<br/>"+s.localization("Press escape (esc) to clear")):t+="<br />Press keyboard<br/>"+s.localization("Press escape (esc) to clear"),r.querySelector(".".concat(b.classNames["key-setting-popup"])).innerHTML=t,e.stopPropagation()})})},setCacheDialog:function(){var t=this;t.elements.dialogs.cache.innerHTML='\n <div class="'.concat(b.classNames["dialog-container"],'">\n <div class="').concat(b.classNames["dialog-title"],'">\n <h4>'+t.localization("Cache Manager")+'</h4>\n </div>\n <div class="').concat(b.classNames["dialog-content"],'">\n\n </div>\n <div class="').concat(b.classNames["dialog-buttons"],'">\n <a href="#" onclick="return false" class="').concat(b.classNames["btn-cancel"],'">'+t.localization("Close")+"</a>\n </div>\n </div>\n "),z.call(this,t.elements.dialogs.cache.querySelector(".".concat(b.classNames["btn-cancel"])),"click",function(e){return F(t.elements.dialogs.cache,!0),t.elements.container.focus(),e.stopPropagation(),!1}),z.call(this,t.elements.dialogs.cache.querySelector(".".concat(b.classNames["dialog-title"]," a")),"click",function(e){return m.romdb&&(m.romdb.clear(),t.elements.dialogs.cache.querySelector(".".concat(b.classNames["dialog-content"])).innerHTML='<div style="text-align:center">'+t.localization("Empty")+"</div>"),e.stopPropagation(),!1})},showLoading:function(e){g.show("modal-6ed698f3d04061f5",{closeByEsckey:!1}),e&&console.log(""),F(this.elements.dialogs.loading,!1)},hideLoading:function(){g.close(),F(this.elements.dialogs.loading,!0)},setLoadingDialog:function(){this.elements.dialogs.loading&&(this.elements.dialogs.loading.innerHTML='\n <div class="'.concat(b.classNames.modal," ").concat(b.classNames["micromodal-slide"],'" id="modal-6ed698f3d04061f5" aria-hidden="true">\n <div class="').concat(b.classNames.modal__overlay,'" tabindex="-1">\n <div class="').concat(b.classNames.modal__container,'" role="dialog" aria-modal="true" aria-labelledby="modal-6ed698f3d04061f5-title">\n '+this.localization("Loading")+"...\n </div>\n </div>\n </div>"))},setCheatDialog:function(){var i,r,o,s=this;s.elements.dialogs.cheat&&(s.elements.dialogs.cheat.innerHTML='\n <div class="'.concat(b.classNames["dialog-container"],'">\n <div class="').concat(b.classNames["dialog-title"],'">\n <h4>Cheats</h4>\n </div>\n <div class="').concat(b.classNames["dialog-content"],'">\n <div class="').concat(b.classNames["cheats-list"],'">\n \n </div>\n </div>\n <div class="').concat(b.classNames["dialog-buttons"],'">\n <a href="#" onclick="return false" class="').concat(b.classNames["cheats-add"],'">'+s.localization("Add Cheat")+'</a>\n <a href="#" onclick="return false" class="').concat(b.classNames["btn-submit"],'">'+s.localization("OK")+'</a>\n <a href="#" onclick="return false" class="').concat(b.classNames["btn-cancel"],'">Close</a>\n </div>\n </div>\n\n \n\n <div class="').concat(b.classNames.modal," ").concat(b.classNames["micromodal-slide"],'" id="modal-85cd7a1c543a484b" aria-hidden="true">\n <div class="').concat(b.classNames.modal__overlay,'" tabindex="-1" data-modal-close>\n <div class="').concat(b.classNames.modal__container,'" style="width:100%" role="dialog" aria-modal="true" aria-labelledby="modal-85cd7a1c543a484b-title">\n <div class="').concat(b.classNames.modal__header,'">\n <h2 class="').concat(b.classNames.modal__title,'" id="modal-85cd7a1c543a484b-title">\n '+s.localization("Add Cheat Code")+'\n </h2>\n <button class="').concat(b.classNames.modal__close,'" aria-label="Close modal" data-modal-close></button>\n </div>\n <main class="').concat(b.classNames.modal__content,'" id="modal-85cd7a1c543a484b-content">\n\n <div class="').concat(b.classNames.modal__errmsg,'"></div>\n <strong>'+s.localization("Code")+'</strong><br />\n <textarea style="width:100%;height:80px;" class="').concat(b.classNames["cheat-code-input"],'"></textarea><br />\n <strong>'+s.localization("Description")+'</strong><br />\n <input type="text" class="').concat(b.classNames["cheat-name-input"],'" /><br />\n\n </main>\n <footer class="').concat(b.classNames.modal__footer,'">\n <button class="').concat(b.classNames.modal__btn," ").concat(b.classNames["modal__btn-primary"],'">'+s.localization("Submit")+'</button>\n <button class="').concat(b.classNames.modal__btn,'" data-modal-close aria-label="Close">'+s.localization("Close")+"</button>\n </footer>\n </div>\n </div>\n </div>\n "),i=s.elements.dialogs.cheat.querySelector("#modal-85cd7a1c543a484b"),z.call(this,s.elements.dialogs.cheat.querySelector(".".concat(b.classNames["cheats-add"])),"click",function(e){return g.show("modal-85cd7a1c543a484b",{closeTrigger:"data-modal-close"}),!1}),r=s.elements.dialogs.cheat.querySelector(".".concat(b.classNames["cheats-list"])),z.call(this,i.querySelector(".".concat(b.classNames["modal__btn-primary"])),"click",function(e){var t,n,o=i.querySelector(".".concat(b.classNames["cheat-name-input"])).value,a=i.querySelector(".".concat(b.classNames["cheat-code-input"])).value;return o&&a&&(t=r.querySelectorAll("input:checked"),i.querySelector(".".concat(b.classNames["cheat-name-input"])).value="",i.querySelector(".".concat(b.classNames["cheat-code-input"])).value="",g.close(),n=s.cheats.length,s.cheats.push([o,a]),r.innerHTML+='<div class="'.concat(b.classNames["ejs-switch"],'">\n <input type="checkbox" value="').concat(n,'" id="ejs-cheat-switch-').concat(n,'">\n <label for="ejs-cheat-switch-').concat(n,'">').concat(o,'</label>\n <a href="#" data-idx="').concat(n,'" onclick="return false" class="').concat(b.classNames["ejs-delete-cheat"],'">&times;</a>\n </div>'),t.forEach(function(e,t){r.querySelector("#ejs-cheat-switch-".concat(t)).setAttribute("checked","checked")})),"localStorage"in window&&localStorage.setItem("".concat(s.system,"-").concat(s.startName,"-cheats"),JSON.stringify(s.cheats)),e.stopPropagation(),!1}),o=function(){if("localStorage"in window){var e=localStorage.getItem("".concat(s.system,"-").concat(s.startName,"-cheats"));try{e=JSON.parse(e)}catch(e){}e&&(s.cheats=e)}r.innerHTML="",s.cheats&&Array.isArray(s.cheats)&&s.cheats.forEach(function(e,t){var n=e[0];e[1],r.innerHTML+='<div class="'.concat(b.classNames["ejs-switch"],'">\n <input type="checkbox" value="').concat(t,'" id="ejs-cheat-switch-').concat(t,'">\n <label for="ejs-cheat-switch-').concat(t,'">').concat(n,'</label>\n <a href="#" data-idx="').concat(t,'" onclick="return false" class="').concat(b.classNames["ejs-delete-cheat"],'">&times;</a>\n </div>')})},z.call(s,r,"click",function(e){var t,n;return e.target&&e.target.classList.contains(b.classNames["ejs-delete-cheat"])&&e.target.getAttribute("data-idx")&&(t=e.target.getAttribute("data-idx"),s.cheats.splice(t,1),"localStorage"in window&&localStorage.setItem("".concat(s.system,"-").concat(s.startName,"-cheats"),JSON.stringify(s.cheats)),n=[],r.querySelectorAll("input").forEach(function(e,t){n[t]=!!r.querySelector("#ejs-cheat-switch-".concat(t,":checked"))}),n.splice(t,1),o(),n.forEach(function(e,t){e&&r.querySelector("#ejs-cheat-switch-".concat(t)).setAttribute("checked","checked")})),e.stopPropagation(),!1}),z.call(s,s.elements.container,"start-game",function(e){o()}),z.call(this,s.elements.dialogs.cheat.querySelector(".".concat(b.classNames["btn-cancel"])),"click",function(e){return F(s.elements.dialogs.cheat,!0),e.stopPropagation(),s.elements.container.focus(),!1}),z.call(this,s.elements.dialogs.cheat.querySelector(".".concat(b.classNames["btn-submit"])),"click",function(e){return b.resetCheat(),r.querySelectorAll("input:checked").forEach(function(e,t){e=s.cheats[e.value];e&&b.setCheat(t,1,e[1])}),F(s.elements.dialogs.cheat,!0),s.elements.container.focus(),!1}),"arcade"!==s.system&&"mame"!==s.system&&"mame2003"!==s.system&&"mame2010"!==s.system||(D.element(s.elements.buttons.cheat)&&F(s.elements.buttons.cheat,!0),b.allowCheat=!1),b.setCheat||(F(s.elements.buttons.cheat,!0),b.allowCheat=!1))},setNetplayDialog:function(){var n,i,o,a,l,s,c,d,e,r,u,f,p=this,h=this;h.elements.dialogs.netplay&&(h.elements.dialogs.netplay.innerHTML='\n <div class="'.concat(b.classNames["dialog-container"],'">\n <div class="').concat(b.classNames["dialog-title"],'">\n <h4>'+h.localization("Netplay")+'</h4>\n </div>\n <div class="').concat(b.classNames["dialog-content"],'">\n <div class="').concat(b.classNames["netplay-roomlist"],'" hidden>\n <strong>'+h.localization("Rooms")+'</strong>\n <table style="width:100%" cellspacing=0>\n <thead>\n <tr>\n <td>'+h.localization("Room Name")+"</td>\n <td>"+h.localization("Players")+'</td>\n <td></td>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td></td>\n <td></td>\n <td></td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <div class="').concat(b.classNames["netplay-room"],'" hidden>\n <strong>'+h.localization("Room Name")+"</strong>\n <div data-room-password>"+h.localization("Password")+': <span></span></div>\n <table style="width:100%" cellspacing="0">\n <thead>\n <tr>\n <td>'+h.localization("Player")+"</td>\n <td>"+h.localization("Name")+"</td>\n <td></td>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>1</td>\n <td>"+h.localization("Name")+" 1</td>\n <td></td>\n </tr>\n <tr>\n <td>2</td>\n <td>"+h.localization("Name")+" 2</td>\n <td></td>\n </tr>\n <tr>\n <td>3</td>\n <td>"+h.localization("Name")+" 3</td>\n <td></td>\n </tr>\n <tr>\n <td>4</td>\n <td>"+h.localization("Name")+' 4</td>\n <td></td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div class="').concat(b.classNames["dialog-buttons"],'">\n <a href="#" onclick="return false" class="').concat(b.classNames["btn-quit"],'">'+h.localization("Quit Room")+'</a>\n <a href="#" onclick="return false" class="').concat(b.classNames["btn-create-room"],'">'+h.localization("Create a Room")+'</a>\n <a href="#" onclick="return false" class="').concat(b.classNames["btn-cancel"],'">'+h.localization("Close")+'</a>\n </div>\n </div>\n\n \n <div class="').concat(b.classNames.modal," ").concat(b.classNames["micromodal-slide"],'" id="modal-9de6c4e9ce2b9361" aria-hidden="true">\n <div class="').concat(b.classNames.modal__overlay,'" tabindex="-1">\n <div class="').concat(b.classNames.modal__container,'" role="dialog" aria-modal="true" aria-labelledby="modal-9de6c4e9ce2b9361-title">\n <div class="').concat(b.classNames.modal__header,'">\n <h2 class="').concat(b.classNames.modal__title,'" id="modal-9de6c4e9ce2b9361-title">\n '+h.localization("Set Player Name")+'\n </h2>\n </div>\n <main class="').concat(b.classNames.modal__content,'" id="modal-9de6c4e9ce2b9361-content">\n\n <div class="').concat(b.classNames.modal__errmsg,'"></div>\n <strong>'+h.localization("Player Name")+'</strong><br />\n <input type="text" maxlength="10" class="').concat(b.classNames["netplay-player-name"],'" /><br />\n\n </main>\n <footer class="').concat(b.classNames.modal__footer,'">\n <button class="').concat(b.classNames.modal__btn," ").concat(b.classNames["modal__btn-primary"],'">'+h.localization("Submit")+'</button>\n </footer>\n </div>\n </div>\n </div>\n \n <div class="').concat(b.classNames.modal," ").concat(b.classNames["micromodal-slide"],'" id="modal-85cd7a1c543a484a" aria-hidden="true">\n <div class="').concat(b.classNames.modal__overlay,'" tabindex="-1" data-modal-close>\n <div class="').concat(b.classNames.modal__container,'" role="dialog" aria-modal="true" aria-labelledby="modal-85cd7a1c543a484a-title">\n <div class="').concat(b.classNames.modal__header,'">\n <h2 class="').concat(b.classNames.modal__title,'" id="modal-85cd7a1c543a484a-title">\n '+h.localization("Create a Room")+'\n </h2>\n <button class="').concat(b.classNames.modal__close,'" aria-label="Close modal" data-modal-close></button>\n </div>\n <main class="').concat(b.classNames.modal__content,'" id="modal-85cd7a1c543a484a-content">\n\n <div class="').concat(b.classNames.modal__errmsg,'"></div>\n <strong>'+h.localization("Room Name")+'</strong><br />\n <input type="text" maxlength="10" class="').concat(b.classNames["netplay-room-name-input"],'" /><br />\n <strong>Max Players</strong><br />\n <select data-max-players>\n <option value="2">2</option>\n <option value="3">3</option>\n <option value="4">4</option>\n </select>\n <br />\n <strong>'+h.localization("Password (optional)")+'</strong><br />\n <input type="text" maxlength="10" class="').concat(b.classNames["netplay-room-password-input"],'" /><br />\n\n </main>\n <footer class="').concat(b.classNames.modal__footer,'">\n <button class="').concat(b.classNames.modal__btn," ").concat(b.classNames["modal__btn-primary"],'">'+h.localization("Submit")+'</button>\n <button class="').concat(b.classNames.modal__btn,'" data-modal-close aria-label="Close">'+h.localization("Close")+'</button>\n </footer>\n </div>\n </div>\n </div>\n \n <div class="').concat(b.classNames.modal," ").concat(b.classNames["micromodal-slide"],'" id="modal-5aa765d61d8327de" aria-hidden="true">\n <div class="').concat(b.classNames.modal__overlay,'" tabindex="-1" data-modal-close>\n <div class="').concat(b.classNames.modal__container,'" role="dialog" aria-modal="true" aria-labelledby="modal-5aa765d61d8327de-title">\n <div class="').concat(b.classNames.modal__header,'">\n <h2 class="').concat(b.classNames.modal__title,'" id="modal-5aa765d61d8327de-title">\n '+h.localization("Password")+'\n </h2>\n <button class="').concat(b.classNames.modal__close,'" aria-label="Close modal" data-modal-close></button>\n </div>\n <main class="').concat(b.classNames.modal__content,'" id="modal-5aa765d61d8327de-content">\n\n <div class="').concat(b.classNames.modal__errmsg,'"></div>\n <input type="text" maxlength="10" class="').concat(b.classNames["netplay-room-password-input"],'" /><br />\n\n </main>\n <footer class="').concat(b.classNames.modal__footer,'">\n <button class="').concat(b.classNames.modal__btn," ").concat(b.classNames["modal__btn-primary"],'">'+h.localization("Submit")+'</button>\n <button class="').concat(b.classNames.modal__btn,'" data-modal-close aria-label="Close">'+h.localization("Close")+'</button>\n </footer>\n </div>\n </div>\n </div>\n \n \n <div class="').concat(b.classNames.modal," ").concat(b.classNames["micromodal-slide"],'" id="modal-7d8fd50ed642340b" aria-hidden="true">\n <div class="').concat(b.classNames.modal__overlay,'" tabindex="-1" data-modal-close>\n <div class="').concat(b.classNames.modal__container,'" role="dialog" aria-modal="true" aria-labelledby="modal-7d8fd50ed642340b-title">\n <div class="').concat(b.classNames.modal__header,'">\n <h2 class="').concat(b.classNames.modal__title,'" id="modal-7d8fd50ed642340b-title"></h2>\n <button class="').concat(b.classNames.modal__close,'" aria-label="Close modal" data-modal-close></button>\n </div>\n <main class="').concat(b.classNames.modal__content,'" id="modal-7d8fd50ed642340b-content">\n \n </main>\n <footer class="').concat(b.classNames.modal__footer,'">\n <button class="').concat(b.classNames.modal__btn," ").concat(b.classNames["modal__btn-primary"],'" data-modal-close>OK</button>\n </footer>\n </div>\n </div>\n </div>\n \n '),z.call(this,h.elements.dialogs.netplay.querySelector(".".concat(b.classNames["btn-cancel"])),"click",function(e){return F(h.elements.dialogs.netplay,!0),b.disableControl(!1),b.stopLoadRooms(),e.stopPropagation(),h.elements.container.focus(),!1}),window.setInterval(function(){var o="<ul>";b.players.forEach(function(e,t){var n=null;e?(b.connection.peers[e]?n=b.connection.peers[e].extra:b.connection.userid===e&&(n=b.connection.extra),o+="<li>".concat(t+1,". ").concat(n.name,"</li>")):o+="<li>".concat(t+1,". </li>")}),o+="</ul>",h.elements.widgets.netplay.innerHTML=o},500),n=h.elements.dialogs.netplay.querySelector("#modal-9de6c4e9ce2b9361"),i=h.elements.dialogs.netplay.querySelector("#modal-85cd7a1c543a484a"),o=h.elements.dialogs.netplay.querySelector("#modal-7d8fd50ed642340b"),a=h.elements.dialogs.netplay.querySelector("#modal-5aa765d61d8327de"),l={},b.connection=new Ie.a,(e=p.socketUrl).endsWith("/")||(e+="/"),b.connection.socketURL="/",b.connection.socketURL=e,b.connection.socketMessageEvent="emulatorjs-message",b.connection.socketCustomEvent="emulatorjs-custom-message",e=H.info(),b.connection.extra={name:b.playerName,game_id:h.config.gameId,browser_name:e.name,room_name:" ",domain:document.domain},b.connection.socketMessageEvent="netplay",b.connection.enableFileSharing=!0,b.connection.enableLogs=!1,b.connection.session={data:!0},b.connection.sdpConstraints.mandatory={OfferToReceiveAudio:!1,OfferToReceiveVideo:!1},b.connection.onclose=function(e){},b.connection.iceServers=[{urls:"turn:turn.emulatorjs.com:3478",credential:"dSnmrtehverella",username:"ejs"},{urls:["stun:stun.l.google.com:19302","stun:stun1.l.google.com:19302","stun:stun2.l.google.com:19302","stun:stun.l.google.com:19302?transport=udp"]}],b.connection.maxParticipantsAllowed=4,s=b.netPlayInitFrame=0,c=!1,Module.postMainLoop=function(){var e,t;if(b.currentFrame=parseInt(b.currentFrameNum(),10),b.connected)if(s+=1,b.connection.isInitiator)if(1<=s){for(var n=[],o=b.currentFrame-1;o<b.currentFrame;o+=1)b.inputsData[o]?b.inputsData[o].forEach(function(e,t){n.push("".concat(e.index,"|").concat(e.key,"|").concat(e.status,"|").concat(e.frame))}):n.push("-1|||".concat(o));b.connection.send(JSON.stringify({act:"sync-control",value:n})),s=0,b.currentFrame%100==0&&Object.keys(b.inputsData).forEach(function(e,t){e<b.currentFrame-50&&(b.inputsData[e]=null,delete b.inputsData[e])});return}else return;else{if(b.coreOptionData[b.currentFrame]&&(e=b.coreOptionData[b.currentFrame].key,t=b.coreOptionData[b.currentFrame].value,ee.updateCoreOptions.call(h,e,t),delete b.coreOptionData[b.currentFrame]),b.currentFrame<=0||b.inputsData[b.currentFrame])b.wait=!1,b.systemPause(0),m.Module.resumeMainLoop(),e=b.inputsData[b.currentFrame],b.inputsData[b.currentFrame]=null,delete b.inputsData[b.currentFrame],(e=e||[]).forEach(function(e,t){0<=e.index&&b.simulateInputFn(e.index,e.key,e.status)});else{b.wait=!0,b.systemPause(1),m.Module.pauseMainLoop();var a=!1,i=Object.keys(b.inputsData);0==i.length&&(a=!0);for(var r=0;r<i.length;r+=1)if(i[r]>b.currentFrame){console.log("lost",b.currentFrame),a=!0;break}a?b.wait||(!c||c<(new Date).valueOf()-3e3)&&(b.inputsData={},c=(new Date).valueOf(),b.connection.send(JSON.stringify({act:"sync-mem",value:b.connection.userid}),b.roomMaster)):(b.wait=!0,b.systemPause(1),m.Module.pauseMainLoop())}b.currentFrame%100==0&&Object.keys(b.inputsData).forEach(function(e,t){e<b.currentFrame-50&&(b.inputsData[e]=null,delete b.inputsData[e])})}},b.connection.onopen=function(n){b.connected=!0,b.connection.isInitiator&&(-1===b.players.indexOf(n.userid)&&(0<b.players.filter(function(e,t){return null==e}).length?b.players.forEach(function(e,t){null!=e||b.players.includes(n.userid)||(b.players[t]=n.userid)}):b.players.push(n.userid)),b.connection.send(JSON.stringify({act:"get-players-result",value:b.players,coreOptions:ee.coreOptionsValues,newuser:n.userid,master:b.connection.userid}))),ee.updateCoreOptionMenuItems.call(h)},b.connection.onFileStart=function(e){var t=e.name.split("-");"reset"!==t[0]&&0!=t[0]||(b.inputsData={},b.disableControl(!0)),b.progressHelper[e.remoteUserId]={},b.progressHelper[e.remoteUserId].max=e.maxChunks,b.showLoading.call(h),b.connection.isInitiator?(b.wait=!0,b.systemPause(1),m.Module.pauseMainLoop()):b.inputsData={}},b.connection.onFileProgress=function(e){var t=b.progressHelper[e.remoteUserId];t.current=e.currentPosition||e.maxChunks||t.max},d=!(b.connection.onFileEnd=function(e){b.hideLoading.call(h);var t=e.name.split("-"),n=t[0]>>0;"reset"===t[0]?(n=0,b.connection.isInitiator?(b.systemPause(0),b.disableControl(!1),h.playing=!0,m.Module.resumeMainLoop()):X.a.get(e.url,{responseType:"arraybuffer"}).then(function(e){b.inputsData={};e=new Uint8Array(e.data);b.loadState(e,n),b.wait=!1,b.systemPause(0),b.disableInput=!1,h.playing=!0,m.Module.resumeMainLoop()})):"game.state"===t[1]&&(b.connection.isInitiator?(b.openRoom(h),b.wait=!1,b.systemPause(0),m.Module.resumeMainLoop()):(b.netPlayInitFrame=n,X.a.get(e.url,{responseType:"arraybuffer"}).then(function(e){e=new Uint8Array(e.data);b.loadState(e,n),b.wait=!1,b.disableInput=!1,b.connection.send(JSON.stringify({act:"wait-end",value:b.connection.userid})),b.hideLoading.call(h),h.playing=!0,m.Module.resumeMainLoop()}))),b.connection.isInitiator||console.log("recv mem end",b.currentFrame,e.name)}),b.connection.onmessage=function(e){var t,r,n,e=e.data||e;try{t=JSON.parse(e)}catch(e){t=null}if(t){if("room-master"===t.act&&(b.roomMaster=t.value),t.act,"short-pause"!==t.act||d||(b.systemPause(1),m.Module.pauseMainLoop(),d=!0,b.wait=!0,setTimeout(function(){b.systemPause(0),m.Module.resumeMainLoop(),b.wait=!1,d=!1},48)),"sync-control"===t.act&&(e=t.value,h.playing||b.wait,r=b.connection.userid,b.players.indexOf(r),b.connection.isInitiator,e.forEach(function(e,t){var e=e.split("|"),n=e[0]>>0,o=e[1]>>0,a=e[2]>>0,e=e[3]>>0,i=b.currentFrame;b.inputsData[e]||(b.inputsData[e]=[]),-1!=n&&e===i&&b.simulateInputFn(n,o,a),b.connection.isInitiator?0<=n&&(b.inputsData[i]||(b.inputsData[i]=[]),-2!=o&&(b.inputsData[i].push({index:n,key:o,status:a,frame:i}),b.simulateInputFn(n,o,a)),d||e<=i-10&&(b.systemPause(1),m.Module.pauseMainLoop(),d=!0,b.wait=!0,setTimeout(function(){b.systemPause(0),m.Module.resumeMainLoop(),b.wait=!1,d=!1},48))):(""!==n&&b.inputsData[e].push({index:n,key:o,status:a,frame:e}),b.inputsData[b.currentFrame]&&m.Module.resumeMainLoop(),i+10<=e&&e>b.netPlayInitFrame+100&&b.connection.send(JSON.stringify({act:"short-pause",value:r}),b.roomMaster))})),t.act,t.act,"update-core-option"!==t.act||b.connection.isInitiator||(b.coreOptionData[t.frame]={key:t.key,value:t.value}),"restart-game"===t.act&&(b.inputsData={},b.connection.send(JSON.stringify({act:"sync-mem",value:b.connection.userid}),b.roomMaster)),"pause"===t.act&&m.Module.pauseMainLoop(),"resume"===t.act&&m.Module.resumeMainLoop(),"wait"===t.act&&(b.wait=!0,b.systemPause(1),t.value!==b.connection.userid&&(b.waitingList[t.value]=1),b.disableControl(!0)),"wait-end"===t.act&&(b.waitingList[t.value]&&delete b.waitingList[t.value],0===Object.keys(b.waitingList).length&&(b.wait=!1,b.systemPause(0),b.disableInput=!1)),"sync-mem"===t.act){b.wait=!0,b.systemPause(1);e=t.value;b.disableControl(!0),b.connection.send(JSON.stringify({act:"wait",value:e}));for(var o=b.getStateInfo().split("|"),a=o[0]>>0,i=new Uint8Array(a),s=o[1]>>0,c=0;c<a;c+=1)i[c]=m.Module.getValue(s+c);m._FS.createDataFile("/","game.state",i,!0,!0),m.Module.cwrap("load_state","number",["string","number"])("game.state",0),m.FS.unlink("game.state"),b.inputsData={};o=new File([i],"".concat(0,"-game.state"),{type:"",lastModified:new Date});b.connection.shareFile(o,e)}t.act,"get-players-result"===t.act&&(b.players=t.value,b.roomMaster=t.master,t.newuser===b.connection.userid)&&(n=ee.coreOptionsValues,t.coreOptions&&Object.keys(t.coreOptions).forEach(function(e){n[e]!==t.coreOptions[e]&&ee.updateCoreOptions.call(h,e,t.coreOptions[e])}),b.showLoading.call(h),b.disableControl(!0),setTimeout(function(){b.connection.send(JSON.stringify({act:"sync-mem",value:b.connection.userid}),b.roomMaster)},1),b.roomMaster&&b.connection.peers[b.roomMaster]&&(b.connection.extra.room_name=b.connection.peers[b.roomMaster].extra.room_name,b.connection.updateExtraData()),b.connection.peers[b.roomMaster]&&(l=b.connection.peers[b.roomMaster].extra),b.openRoom(h))}},b.connection.onUserStatusChanged=function(e){var t;"offline"===e.status&&0<=(t=b.players.indexOf(e.userid))&&(b.players[t]=null),e.status},b.connection.onExtraDataUpdated=function(e){e.userid===b.connection.userid&&(b.connection.extra=e.extra)},b.connection.onleave=function(e){var t;e.userid&&0<=(t=b.players.indexOf(e.userid))&&(b.players[t]=null),b.waitingList[e.userid]&&delete b.waitingList[e.userid],b.connection.isInitiator&&0===Object.keys(b.waitingList).length&&b.wait&&(b.wait=!1,b.systemPause(0),b.disableInput=!1,b.connection.send(JSON.stringify({act:"wait-end",value:b.connection.userid}))),b.openRoom(h),b.inputsData={},b.hideLoading.call(h)},b.connection.close=e=function(){try{b.connection.onbeforeunload()}catch(e){}b.connected=!1,b.connection.password=null,b.players=[],b.connection.peersBackup=[],b.waitingList={},b.inputsData={},b.hideLoading.call(h),F(h.elements.buttons.restart,!1),F(h.elements.buttons.loadState,!1),F(h.elements.buttons.saveState,!1),b.allowCheat&&F(h.elements.buttons.cheat,!1),F(ee.contextMenu.querySelectorAll("ul li").item(2),!1),F(ee.contextMenu.querySelectorAll("ul li").item(3),!1),Array.from(h.elements.buttons.play).forEach(function(e){F(e,!1)}),ee.updateCoreOptionMenuItems.call(h)},b.connection.disconnect=e,b.connection.leave=e,u=function(e,t,n){b.hideLoading.call(h),e?(b.stopLoadRooms(),F(h.elements.buttons.restart,!0),F(h.elements.buttons.loadState,!0),F(h.elements.buttons.saveState,!0),b.resetCheat(),F(h.elements.buttons.cheat,!0),F(ee.contextMenu.querySelectorAll("ul li").item(2),!0),F(ee.contextMenu.querySelectorAll("ul li").item(3),!0),Array.from(h.elements.buttons.play).forEach(function(e){F(e,!0)}),b.connection.socket&&b.connection.socket.on("set-isInitiator-true",function(e){e===b.connection.sessionid&&(b.connection.socket.emit("extra-data-updated",b.connection.extra),b.connection.send(JSON.stringify({act:"room-master",value:b.connection.userid})),b.roomMaster=b.connection.userid,b.systemPause(0),m.Module.resumeMainLoop(),ee.updateCoreOptionMenuItems.call(h),F(h.elements.buttons.restart,!1),F(h.elements.buttons.loadState,!1),F(h.elements.buttons.saveState,!1),Array.from(h.elements.buttons.play).forEach(function(e){F(e,!1)}))})):(g.close(),o.querySelector("#modal-7d8fd50ed642340b-content").innerHTML=n,g.show("modal-7d8fd50ed642340b",{closeTrigger:"data-modal-close"}))},f=function(e){var t=e.target.getAttribute("data-id");if("Y"===e.target.getAttribute("data-password"))g.show("modal-5aa765d61d8327de",{closeTrigger:"data-modal-close"}),a.setAttribute("data-id",t);else{b.showLoading.call(h),b.connection.userid=b.connection.token();try{b.connection.join(t,u)}catch(e){b.hideLoading.call(h),o.querySelector("#modal-7d8fd50ed642340b-content").innerHTML="Error",g.show("modal-7d8fd50ed642340b",{closeTrigger:"data-modal-close"})}}return e.stopPropagation(),!1},b.loadRoomsList=function(){F(h.elements.dialogs.netplay.querySelector(".".concat(b.classNames["netplay-roomlist"])),!1),F(h.elements.dialogs.netplay.querySelector(".".concat(b.classNames["netplay-room"])),!0),F(h.elements.dialogs.netplay.querySelector(".".concat(b.classNames["btn-create-room"])),!1),F(h.elements.dialogs.netplay.querySelector(".".concat(b.classNames["btn-quit"])),!0);var e=h.listUrl,c=(e.endsWith("/")||(e+="/"),h.elements.dialogs.netplay.querySelector(".".concat(b.classNames["netplay-roomlist"])).querySelector("tbody")),e=[e,"list?game_id=",h.config.gameId,"&domain=",document.domain].join("");X.a.get(e,{}).then(function(i){var r,s;i.data&&(r=[],s=[],c.querySelectorAll("tr").forEach(function(e){s.push(e.getAttribute("id"))}),Object.keys(i.data).forEach(function(e){var t=i.data[e],n=(r.push(e),s.includes(e)&&(n=c.querySelector('tr[id="'.concat(e,'"]')),c.removeChild(n)),document.createElement("tr")),o=(n.setAttribute("id",e),t.password?b.icons.lock:""),a=t.password?"Y":"N",e=t.current<t.max?'<span data-id="'.concat(e,'" data-password="').concat(a,'" class="').concat(b.classNames["btn-join-room"],'">Join</span>'):"",a=t.country||"?";n.innerHTML="<td>[".concat(a,"] ").concat(o," ").concat(t.room_name,"</td><td>").concat(t.current,"/").concat(t.max,"</td><td>").concat(e,"</td>"),z.call(p,n.querySelector(".".concat(b.classNames["btn-join-room"])),"click",f),c.appendChild(n)}),c.querySelectorAll("tr").forEach(function(e){r.includes(e.id)||c.removeChild(e)})),b.loadRoomsListTimer=setTimeout(b.loadRoomsList,2e3)}).catch(function(e){console.log("Network Error",e),b.loadRoomsListTimer=setTimeout(b.loadRoomsList,2e3)})},b.openRoom=function(e){b.stopLoadRooms(),F(e.elements.dialogs.netplay.querySelector(".".concat(b.classNames["netplay-roomlist"])),!0),F(e.elements.dialogs.netplay.querySelector(".".concat(b.classNames["netplay-room"])),!1),F(e.elements.dialogs.netplay.querySelector(".".concat(b.classNames["btn-create-room"])),!0),F(e.elements.dialogs.netplay.querySelector(".".concat(b.classNames["btn-quit"])),!1),b.resetCheat(),F(e.elements.buttons.cheat,!0);var e=e.elements.dialogs.netplay.querySelector(".".concat(b.classNames["netplay-room"])),t=e.querySelector("[data-room-password]"),o=(null===b.connection.password?F(t,!0):(F(t,!1),t.querySelector("span").innerText=b.connection.password),e.querySelector("tbody"));o.innerHTML="",e.querySelector("strong").innerText=l.room_name,b.players.forEach(function(e,t){var n=null;e&&(b.connection.peers[e]?n=b.connection.peers[e].extra:b.connection.userid===e&&(n=b.connection.extra),n&&n.name)&&((e=document.createElement("tr")).innerHTML="<td>".concat(t+1,"</td><td>").concat(n.name,"</td><td></td>"),o.appendChild(e))})},z.call(this,a.querySelector(".".concat(b.classNames["modal__btn-primary"])),"click",function(e){var t=a.querySelector(".".concat(b.classNames["netplay-room-password-input"])).value,t=(b.showLoading.call(h),b.connection.password=t,a.getAttribute("data-id"));b.connection.join(t,function(e,t,n){u(e,0,n),e&&a.classList.remove(q({"is-open":!0}))}),e.stopPropagation()}),z.call(this,n.querySelector(".".concat(b.classNames["modal__btn-primary"])),"click",function(e){var t=(t=n.querySelector(".".concat(b.classNames["netplay-player-name"])).value).replace(/<|>/g,"");n.querySelector(".".concat(b.classNames.modal__errmsg)).innerHTML="",t.trim()&&(b.playerName=t.trim(),b.connection.extra.name=t.trim(),g.close()),e.stopPropagation()}),z.call(this,i.querySelector(".".concat(b.classNames["modal__btn-primary"])),"click",function(e){var t=(t=i.querySelector(".".concat(b.classNames["netplay-room-name-input"])).value).replace(/<|>/g,""),n=i.querySelector("select[data-max-players] option:checked").value;4<(n=n<2?2:n)&&(n=4);for(var o=0;o<n;o++)b.players[o]=null;b.connection.maxParticipantsAllowed=n;var a=i.querySelector(".".concat(b.classNames["netplay-room-password-input"])).value;i.querySelector(".".concat(b.classNames.modal__errmsg)).innerHTML="",t.trim()?(b.connection.extra.room_name=t.trim(),""!==a.trim()&&(b.connection.password=a.trim()),b.showLoading.call(h),b.connection.open(b.connection.token(),function(e,t,n){b.hideLoading.call(h),e?(b.players[0]=b.connection.userid,b.roomMaster=b.connection.userid,r.closeModal(),b.stopLoadRooms(),l=b.connection.extra,b.openRoom(h),F(ee.contextMenu.querySelectorAll("ul li").item(2),!0),F(ee.contextMenu.querySelectorAll("ul li").item(3),!0)):i.querySelector(".".concat(b.classNames.modal__errmsg)).innerHTML=n})):r.closeModal(),e.stopPropagation()}),z.call(this,h.elements.dialogs.netplay.querySelector(".".concat(b.classNames["btn-create-room"])),"click",function(e){return r=g.show("modal-85cd7a1c543a484a",{closeTrigger:"data-modal-close",onClose:function(){h.elements.container.focus()}}),e.stopPropagation(),!1}),z.call(this,h.elements.dialogs.netplay.querySelector(".".concat(b.classNames["btn-quit"])),"click",function(e){return b.connection.close(),b.stopLoadRooms(),b.loadRoomsList(),b.inputsData={},e.stopPropagation(),!1})),window._0x378b5c=b},initKeyboard:function(){var i=this,r=this,s=this.elements.dialogs.gamepad.querySelector(".".concat(b.classNames.overlay));z.call(this,document.body,"keydown keyup",function(n){if(!(112<=n.which&&n.which<=123)){var e=!i.elements.dialogs.gamepad.hidden&&!s.hidden,o="keydown"===n.type;if(o&&e){var e=s.getAttribute("data-index"),t=s.getAttribute("data-id"),a=null;if(n.key&&"escape"===b.keyMap[n.keyCode])return(a=r.elements.dialogs.gamepad.querySelector('[data-id="'.concat(t,'"][data-index="').concat(e,'"][data-type="1"]'))).setAttribute("data-value",""),a.value=""(a=r.elements.dialogs.gamepad.querySelector('[data-id="'.concat(t,'"][data-index="').concat(e,'"][data-type="2"]'))).setAttribute("data-value",""),a.value="",void F(s,!0);e=s.getAttribute("data-index"),t=s.getAttribute("data-id"),a=null;n.key&&((a=r.elements.dialogs.gamepad.querySelector('[data-id="'.concat(t,'"][data-index="').concat(e,'"][data-type="1"]'))).setAttribute("data-value",n.keyCode),a.value=b.keyMap[n.keyCode]),F(s,!0)}else Object.keys(b.controllers).forEach(function(t){Object.keys(b.controllers[t]).forEach(function(e){parseInt(b.controllers[t][e].value,10)===n.keyCode&&["24","25","26"].includes(e)&&"keydown"==n.type&&!n.repeat&&("24"==e?b.quickSaveState():"25"==e?b.quickLoadState():"26"==e&&b.changeStateSlot()),parseInt(b.controllers[t][e].value,10)===n.keyCode&&(o?16<=e&&e<=23?b.simulateInput(t,e,32767):b.simulateInput(t,e,1):b.simulateInput(t,e,0))})})}}),document.body.addEventListener("keydown",function(e){var t=e.keyCode||e.which;[32,37,38,39,40,112,113,114,115,116,117,118,119,120,121,122,123].includes(t)&&e.srcElement===r.elements.container&&e.preventDefault(),e.srcElement.className.split(/ +/).includes(b.classNames.set)&&e.preventDefault()})},initGamepad:function(){var c=this,r=this,l=this.elements.dialogs.gamepad.querySelector(".".concat(b.classNames.overlay)),n=new a.Gamepad;(b.gamepad=n).init()&&(n.bind(a.Gamepad.Event.TICK,function(e){e.forEach(function(e){var t;e&&e.axes&&e.axes[9]&&((t=e.axes[9])<3.28571?1==t?(e.extra_buttons[12].pressed||(e.extra_buttons[12]={pressed:!0,value:1},n._fire(a.Gamepad.Event.BUTTON_DOWN,{index:12,gamepad:e,gamepadIndex:e.index})),e.extra_buttons[14].pressed||(e.extra_buttons[14]={pressed:!0,value:1},n._fire(a.Gamepad.Event.BUTTON_DOWN,{index:14,gamepad:e,gamepadIndex:e.index}))):t<=-.7142857&&-.714291<=t?(e.extra_buttons[12].pressed||(e.extra_buttons[12]={pressed:!0,value:1},n._fire(a.Gamepad.Event.BUTTON_DOWN,{index:12,gamepad:e,gamepadIndex:e.index})),e.extra_buttons[15].pressed||(e.extra_buttons[15]={pressed:!0,value:1},n._fire(a.Gamepad.Event.BUTTON_DOWN,{index:15,gamepad:e,gamepadIndex:e.index}))):.42856<=t&&t<=.42858?(e.extra_buttons[13].pressed||(e.extra_buttons[13]={pressed:!0,value:1},n._fire(a.Gamepad.Event.BUTTON_DOWN,{index:13,gamepad:e,gamepadIndex:e.index})),e.extra_buttons[14].pressed||(e.extra_buttons[14]={pressed:!0,value:1},n._fire(a.Gamepad.Event.BUTTON_DOWN,{index:14,gamepad:e,gamepadIndex:e.index}))):-.14287<=t&&t<=-.14285?(e.extra_buttons[13].pressed||(e.extra_buttons[13]={pressed:!0,value:1},n._fire(a.Gamepad.Event.BUTTON_DOWN,{index:13,gamepad:e,gamepadIndex:e.index})),e.extra_buttons[15].pressed||(e.extra_buttons[15]={pressed:!0,value:1},n._fire(a.Gamepad.Event.BUTTON_DOWN,{index:15,gamepad:e,gamepadIndex:e.index}))):t<=-1&&-1.01<=t?e.extra_buttons[12].pressed||(e.extra_buttons[12]={pressed:!0,value:1},n._fire(a.Gamepad.Event.BUTTON_DOWN,{index:12,gamepad:e,gamepadIndex:e.index})):.142857<=t&&t<=.142858?e.extra_buttons[13].pressed||(e.extra_buttons[13]={pressed:!0,value:1},n._fire(a.Gamepad.Event.BUTTON_DOWN,{index:13,gamepad:e,gamepadIndex:e.index})):.7142857<=t&&t<=.7142858?e.extra_buttons[14].pressed||(e.extra_buttons[14]={pressed:!0,value:1},n._fire(a.Gamepad.Event.BUTTON_DOWN,{index:14,gamepad:e,gamepadIndex:e.index})):t<=-.42857&&-.42858<=t&&(e.extra_buttons[15].pressed||(e.extra_buttons[15]={pressed:!0,value:1},n._fire(a.Gamepad.Event.BUTTON_DOWN,{index:15,gamepad:e,gamepadIndex:e.index}))):(e.extra_buttons[12].pressed&&(e.extra_buttons[12]={pressed:!1,value:0},n._fire(a.Gamepad.Event.BUTTON_UP,{index:12,gamepad:e,gamepadIndex:e.index})),e.extra_buttons[13].pressed&&(e.extra_buttons[13]={pressed:!1,value:0},n._fire(a.Gamepad.Event.BUTTON_UP,{index:13,gamepad:e,gamepadIndex:e.index})),e.extra_buttons[14].pressed&&(e.extra_buttons[14]={pressed:!1,value:0},n._fire(a.Gamepad.Event.BUTTON_UP,{index:14,gamepad:e,gamepadIndex:e.index})),e.extra_buttons[15].pressed&&(e.extra_buttons[15]={pressed:!1,value:0},n._fire(a.Gamepad.Event.BUTTON_UP,{index:15,gamepad:e,gamepadIndex:e.index}))))})}),n.bind(a.Gamepad.Event.BUTTON_DOWN,function(n){if(c.elements.dialogs.gamepad.hidden||l.hidden)Object.keys(b.controllers[n.gamepad.index.toString()]).forEach(function(e){var t=n.gamepad.index.toString();parseInt(b.controllers[t][e].value2,10)===parseInt(n.index,10)&&["24","25","26"].includes(e)&&("24"==e?b.quickSaveState():"25"==e?b.quickLoadState():"26"==e&&b.changeStateSlot()),parseInt(b.controllers[t][e].value2,10)===parseInt(n.index,10)&&parseInt(t,10)===parseInt(n.gamepad.index,10)&&b.simulateInput(t,e,1)});else{var e,t=parseInt(l.getAttribute("data-index"),10),o=l.getAttribute("data-id");if(n.gamepad.index===parseInt(t,10)){for(var a=0;a<32&&(!(e=(e=n.gamepad.buttons[a])?e:n.gamepad.extra_buttons[a])||!("number"==typeof e&&1===e||"number"==typeof e.value&&1===e.value));a+=1);var i=null;(i=r.elements.dialogs.gamepad.querySelector('[data-id="'.concat(o,'"][data-index="').concat(t,'"][data-type="2"]'))).setAttribute("data-value",n.index),i.value="button ".concat(n.index+1),F(l,!0)}}}),n.bind(a.Gamepad.Event.BUTTON_UP,function(n){Object.keys(b.controllers).forEach(function(t){Object.keys(b.controllers[t]).forEach(function(e){parseInt(b.controllers[t][e].value2,10)===parseInt(n.index,10)&&parseInt(t,10)===parseInt(n.gamepad.index,10)&&b.simulateInput(t,e,0)})})}),n.bind(a.Gamepad.Event.AXIS_CHANGED,function(e){var t,n=.5<(t=parseFloat(e.value))||t<.5?0<t?1:-1:0;if(c.elements.dialogs.gamepad.hidden||l.hidden){b.prevButtons||(b.prevButtons={});var o=!1,a=e.gamepad.index.toString();b.prevButtons[a]||(b.prevButtons[a]={}),b.prevButtons[a][e.axis]||(b.prevButtons[a][e.axis]=0),b.prevButtons[a].buttonID||(b.prevButtons[a].buttonID=0);for(var i=0;i<Object.keys(b.controllers[a]).length;i++){var r=Object.keys(b.controllers[a])[i];b.controllers[a][r].value2&&(b.controllers[a][r].value2.split(":")[0]===e.axis&&parseInt(b.controllers[a][r].value2.split(":")[1])===n&&["24","25","26"].includes(r)&&("24"==r?(o=!0,b.quickSaveState()):"25"==r?(o=!0,b.quickLoadState()):"26"==r&&b.changeStateSlot()),0==n?b.controllers[a][r].value2.split(":")[0]===e.axis&&(b.prevButtons[a][e.axis]=n,b.prevButtons[a].buttonID=r,b.simulateInput(a,r,0)):((1===b.prevButtons[a][e.axis]&&-1==n||-1===b.prevButtons[a][e.axis]&&1==n)&&b.simulateInput(a,b.prevButtons[a].buttonID,0),b.controllers[a][r].value2.split(":")[0]===e.axis&&parseInt(b.controllers[a][r].value2.split(":")[1])===n&&(b.prevButtons[a][e.axis]=n,b.prevButtons[a].buttonID=r,o=!0,b.simulateInput(a,r,1))))}if(o)return;if(!c.elements.dialogs.gamepad.hidden&&!l.hidden)return}else 0!=n&&(t=l.getAttribute("data-id"),s=parseInt(l.getAttribute("data-index"),10),(t=c.elements.dialogs.gamepad.querySelector('[data-id="'.concat(t,'"][data-index="').concat(s,'"][data-type="2"]'))).setAttribute("data-value",e.axis+":"+n),t.value=e.axis+":"+n,F(l,!0));Math.abs(e.value)<=.1&&(e.value=0);var s=e.gamepad.index;"LEFT_STICK_X"===e.axis&&(0<e.value?(b.simulateInput(s,16,32767*e.value),b.simulateInput(s,17,0)):(b.simulateInput(s,17,32767*e.value),b.simulateInput(s,16,0))),"LEFT_STICK_Y"===e.axis&&(0<e.value?(b.simulateInput(s,18,32767*e.value),b.simulateInput(s,19,0)):(b.simulateInput(s,19,32767*e.value),b.simulateInput(s,18,0))),"RIGHT_STICK_X"===e.axis&&(0<e.value?(b.simulateInput(s,20,32767*e.value),b.simulateInput(s,21,0)):(b.simulateInput(s,21,32767*e.value),b.simulateInput(s,20,0))),"RIGHT_STICK_Y"===e.axis&&(0<e.value?(b.simulateInput(s,22,32767*e.value),b.simulateInput(s,23,0)):(b.simulateInput(s,23,32767*e.value),b.simulateInput(s,22,0)))}),n.bind(a.Gamepad.Event.DISCONNECTED,function(e){[0,1,2,3].forEach(function(e){var t=n.gamepads[e];r.elements.dialogs.gamepad.querySelector("#controls-".concat(e," .gamepad-name")).innerHTML=t?t.id:"n/a"})}),n.bind(a.Gamepad.Event.CONNECTED,function(e){Object.keys(n.gamepads).forEach(function(e){var t=n.gamepads[e];r.elements.dialogs.gamepad.querySelector("#controls-".concat(e," .gamepad-name")).innerHTML=t?t.id:"n/a"})}))},setShader:function(e){"disabled"===e?(m.FS.unlink("/shader/shader.glslp",""),b.toggleShader&&b.toggleShader(0)):(b.toggleShader&&b.toggleShader(0),e="/shader/".concat(e),m.FS.writeFile("/shader/shader.glslp",function(e){if(!(e instanceof Int32Array))throw new Error("uintArrayToString: Only accepts Int32Array parameter");for(var t="",n=0,o=e.length;n<o;n+=1){var a=e[n];if(65535<a)throw new Error("Invalid value attempted to be serialised");t+=String.fromCharCode(a)}return t}(new Int32Array(m.FS.readFile(e)))),b.toggleShader&&b.toggleShader(1))},toggleVirtualGamepad:function(e){var t=this;if(null===b.virtualGamepadContainer){b.virtualGamepadContainer=U("div",{class:q({"ejs-virtual-gamepad":!0}),hidden:""}),this.elements.container.appendChild(b.virtualGamepadContainer);var n,o="height:31px;text-align:center;border:1px solid #ccc;border-radius:5px;line-height:31px;",a="";n=["snes","nds"].includes(t.system)?{order:["X","Y","A","B"],orderCSS:["left:40px;","top:40px;","left:81px;top:40px;","left:40px;top:80px;"],LandR:!0}:["gba","gb","vb","nes"].includes(t.system)?{order:["B","A"],orderCSS:["left:-10px;top:70px;","left:60px;top:70px;"],LandR:"gba"===t.system}:["n64"].includes(t.system)?{order:["B","A"],orderCSS:["left:-10px;top:95px;","left:40px;top:150px;"],LandR:!0}:{order:["Y","X","B","A"],orderCSS:["left:40px;","top:40px;","left:81px;top:40px;","left:40px;top:80px;"],LandR:!0},a=(a+='<div class="'+q({"virtual-gamepad":!0})+'" style="display: block;">')+('<div class="'+q({top:!0})+'">'),!0===n.LandR&&(a="n64"===t.system?(a=(a+='<div class="'+q({buttons:!0,b_l:!0})+'" style="left:10px;top:-40px;'+o+'">L</div>')+'<div class="'+q({buttons:!0,b_z:!0})+'" style="left:10px;'+o+'">Z</div>')+'<div class="'+q({buttons:!0,b_r:!0})+'" style="right:10px;top:-40px;'+o+'">R</div>':(a+='<div class="'+q({buttons:!0,b_l:!0})+'" style="left:10px;'+o+'">L</div>')+'<div class="'+q({buttons:!0,b_r:!0})+'" style="right:10px;'+o+'">R</div>'),a=(a=(a+="</div>")+('<div class="'+q({left:!0})+'"></div>'))+('<div class="'+q({center:!0})+'">'),a="n64"===t.system?(a+='<div class="'+q({buttons:!0,b_c:!0})+'" style="left:65px;">'+t.localization("Menu")+"</div>")+'<div class="'+q({buttons:!0,b_start:!0})+'" style="left:0px;">'+t.localization("Start")+"</div>":(a=(a+='<div class="'+q({buttons:!0,b_start:!0})+'" style="left:30px;">'+t.localization("Start")+"</div>")+'<div class="'+q({buttons:!0,b_c:!0})+'" style="left:95px;">'+t.localization("Menu")+"</div>")+'<div class="'+q({buttons:!0,b_select:!0})+'" style="left:-35px;">'+t.localization("Select")+"</div>",a=(a+="</div>")+('<div class="'+q({right:!0})+'">'),"n64"===t.system&&(a=(a=(a=(a+='<div class="'+q({buttons:!0,b_cu:!0})+'" style="left:25px;top:-65px;"></div>')+'<div class="'+q({buttons:!0,b_cd:!0})+'" style="left:25px;top:15px;"></div>')+'<div class="'+q({buttons:!0,b_cl:!0})+'" style="left:-15px;top:-25px;"></div>')+'<div class="'+q({buttons:!0,b_cr:!0})+'" style="left:65px;top:-25px;"></div>');for(var i=0;i<n.order.length;i++){var r={buttons:!0};r["b_"+n.order[i].toLowerCase()]=!0,a+='<div class="'+q(r)+'" style="'+n.orderCSS[i]+'">'+n.order[i]+"</div>"}b.virtualGamepadContainer.innerHTML=a+="</div></div>",F(b.virtualGamepadContainer,!e);o=me.a.create({zone:V.call(this,".".concat(q({"ejs-virtual-gamepad":!0})," .").concat(q({left:!0}))),mode:"static",position:{left:"50%",top:"50%"},color:"red"});function s(){var e;return"n64"!==t.system||"d-pad"===(e=ee&&"function"==typeof ee.getCoreOptionsValues?ee.getCoreOptionsValues()["joystick-input"]:e)?{downVal:1,4:4,5:5,6:6,7:7}:{downVal:32767,4:19,5:18,6:17,7:16}}o.on("end",function(e,t){b.syncInput(0,s()[4],0),b.syncInput(0,s()[5],0),b.syncInput(0,s()[6],0),b.syncInput(0,s()[7],0)}),o.on("move",function(e,t){t=t.angle.degree;30<=t&&t<150?b.syncInput(0,s()[4],s().downVal):window.setTimeout(function(){b.syncInput(0,s()[4],0)},30),210<=t&&t<330?b.syncInput(0,s()[5],s().downVal):window.setTimeout(function(){b.syncInput(0,s()[5],0)},30),120<=t&&t<240?b.syncInput(0,s()[6],s().downVal):window.setTimeout(function(){b.syncInput(0,s()[6],0)},30),300<=t||0<=t&&t<60?b.syncInput(0,s()[7],s().downVal):window.setTimeout(function(){b.syncInput(0,s()[7],0)},30)});var c,o=q({"virtual-gamepad":!0}),l=q({touch:!0});H.isIos||z.call(this,V.call(this,".".concat(o)),"touchmove",function(e){e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_a:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,8,0)},30)):(G(e.target,l,!0),b.syncInput(0,8,1)),e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_b:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,0,0)},30)):(G(e.target,l,!0),b.syncInput(0,0,1)),e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_x:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,9,0)},30)):(G(e.target,l,!0),b.syncInput(0,9,1)),e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_y:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,1,0)},30)):(G(e.target,l,!0),b.syncInput(0,1,1)),e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_l:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,10,0)},30)):(G(e.target,l,!0),b.syncInput(0,10,1)),e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_z:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,12,0)},30)):(G(e.target,l,!0),b.syncInput(0,12,1)),e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_r:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,11,0)},30)):(G(e.target,l,!0),b.syncInput(0,11,1)),e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_start:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,3,0)},30)):(G(e.target,l,!0),b.syncInput(0,3,1)),e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_cu:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,23,0)},30)):(G(e.target,l,!0),b.syncInput(0,23,32767)),e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_cd:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,22,0)},30)):(G(e.target,l,!0),b.syncInput(0,22,32767)),e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_cl:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,21,0)},30)):(G(e.target,l,!0),b.syncInput(0,21,32767)),e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_cr:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,20,0)},30)):(G(e.target,l,!0),b.syncInput(0,20,32767)),e.stopPropagation()}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_c:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?G(e.target,l,!1):(G(e.target,l,!0),clearTimeout(c),J.toggleControls.call(t,!0),c=setTimeout(function(){J.toggleControls.call(t,!1)},5e3))}),z.call(this,V.call(this,".".concat(o," .").concat(q({b_select:!0}))),"touchstart touchend mousedown mouseup mouseout",function(e){["touchend","mouseup","mouseout"].includes(e.type)?(G(e.target,l,!1),window.setTimeout(function(){b.syncInput(0,2,0)},30)):(G(e.target,l,!0),b.syncInput(0,2,1)),e.stopPropagation()})}else F(b.virtualGamepadContainer,!e)},setup:function(){var e,t,n,o=this;this.game?(b.playerName=o.config.playerName,G(this.elements.container,this.config.classNames.type,!0),this.elements.container.setAttribute("tabindex","0"),this.color&&(e=function(e){var t=e.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(4===t.length){for(var n="#",o=1;o<4;o+=1)n+=t.slice(o,o+1).concat(t.slice(o,o+1));t=n}for(var a=[],i=1;i<7;i+=2)a.push(parseInt("0x".concat(t.slice(i,i+2)),16));return a}return null}(this.color))&&this.elements.container.setAttribute("style","--ejs-primary-color: ".concat(e[0],", ").concat(e[1],", ").concat(e[2])),this.elements.wrapper=U("div",{class:this.config.classNames.video}),j(this.game,this.elements.wrapper),"video"!==o.game.tagName.toLocaleLowerCase()&&(t=this.config.volume,Object.defineProperty(o.game,"volume",{get:function(){return t},set:function(e){t=e,B.call(o,o.game,"volumechange")}}),n=o.storage.get("muted"),Object.defineProperty(o.game,"muted",{get:function(){return n},set:function(e){e=!!D.boolean(e)&&e;n=e,B.call(o,o.game,"volumechange")}})),window.addEventListener("beforeunload",function(e){if(o.started){var t=o.startName.split("/").pop().split("."),t=t.slice(0,t.length-1).join(".");m.FS.syncfs(function(e){});try{var n="srm";"nds"===o.system&&(n="dsv"),m.FS.unlink("/data/saves/".concat(t,".").concat(n))}catch(e){console.log("fail to save")}b.saveSavFiles(),m.FS.syncfs(function(e){})}},!0)):console.warn("No game element found!")},listeners:function(){var r=this;r.elements.buttons.restart&&z.call(r,r.elements.buttons.restart,"click",function(e){if(b.restartGame(),b.inputsData={},b.connected&&b.connection.isInitiator){for(var t=b.getStateInfo().split("|"),n=t[0]>>0,o=(t[2],new Uint8Array(n)),a=t[1]>>0,i=0;i<n;i+=1)o[i]=m.Module.getValue(a+i);t=new File([o],"0-game.state",{type:"",lastModified:new Date});b.connection.shareFile(t),b.inputsData={},b.wait=!0,b.systemPause(1),m.Module.pauseMainLoop(),b.disableControl(!0)}}),r.elements.buttons.screenRecord&&z.call(r,r.elements.buttons.screenRecord,"click",function(e){var o,a,i;r.recordData||(r.recordData={started:!1,data:[],stopped:!1}),r.recordData.started?r.recordData.started&&(r.recordData.recorder.stop(),r.recordData.stopped=!0):(o=MediaRecorder.isTypeSupported("video/webm; codecs=h264")?{mimeType:"video/webm; codecs=h264"}:MediaRecorder.isTypeSupported("video/webm; codecs=H264")?{mimeType:"video/webm; codecs=H264"}:MediaRecorder.isTypeSupported("video/webm; codecs=vp9")?{mimeType:"video/webm; codecs=vp9"}:MediaRecorder.isTypeSupported("video/webm; codecs=vp8")?{mimeType:"video/webm; codecs=vp8"}:MediaRecorder.isTypeSupported("video/webm; codecs=avc1")?{mimeType:"video/webm; codecs=avc1"}:MediaRecorder.isTypeSupported("video/webm; codecs=vp9.0")?{mimeType:"video/webm; codecs=vp9.0"}:MediaRecorder.isTypeSupported("video/webm; codecs=vp8.0")?{mimeType:"video/webm; codecs=vp8.0"}:{},m.Module.pauseMainLoop(),r.playing=!1,alert('please check "share system audio" to have audio in the recording. We only need the audio stream so your entire screen will not be recorded'),a=m.Module.canvas.captureStream(30),i=setTimeout(function(){r.playing=!0,m.Module.resumeMainLoop()},2e4),navigator.mediaDevices.getDisplayMedia({audio:!0,video:{mediaSource:"screen"}}).then(function(e){try{clearTimeout(i)}catch(e){}for(var t=e.getAudioTracks(),n=0;n<t.length;n++)a.addTrack(t[n]);e=a,r.elements.buttons.screenRecord.getElementsByClassName("ejs--74c6d4176d27e37a19d2e9e61de8f4")[0].innerHTML=r.localization("Stop Screen Recording"),r.recordData.stream=e,r.recordData.recorder=new MediaRecorder(r.recordData.stream,o),r.recordData.recorder.ondataavailable=function(e){var t;0<e.data.size&&r.recordData.data.push(e.data),r.recordData.stopped&&((e=document.createElement("a")).href=window.URL.createObjectURL(new Blob(r.recordData.data,{type:"video/webm"})),"string"==typeof r.gameName&&(t=r.gameName),e.download=t?"".concat(t,"-recording.webm"):"record.webm",e.click(),window.URL.revokeObjectURL(e.href),delete r.recordData,r.elements.buttons.screenRecord.getElementsByClassName("ejs--74c6d4176d27e37a19d2e9e61de8f4")[0].innerHTML=r.localization("Start Screen Recording"))},r.recordData.recorder.start(),r.recordData.started=!0,r.playing=!0,m.Module.resumeMainLoop()}))}),r.elements.buttons.play&&Array.from(r.elements.buttons.play).forEach(function(e){z.call(r,e,"click",function(e){r.playing?(r.playing=!1,m.Module.pauseMainLoop(),b.connected&&b.connection.isInitiator&&b.connection.send(JSON.stringify({act:"pause"})),B.call(r,r.elements.container,"pause",!1,{pause:!0})):(r.playing=!0,m.Module.resumeMainLoop(),b.connected&&b.connection.isInitiator&&b.connection.send(JSON.stringify({act:"resume"})),B.call(r,r.elements.container,"pause",!1,{pause:!1}))})}),r.elements.buttons.netplay&&z.call(r,r.elements.buttons.netplay,"click",function(e){b.disableControl(!0),F(r.elements.dialogs.netplay,!1),0<b.players.length?b.openRoom(r):(b.stopLoadRooms(),b.loadRoomsList()),b.playerName||g.show("modal-9de6c4e9ce2b9361",{closeByEsckey:!1})}),r.elements.buttons.cheat&&z.call(r,r.elements.buttons.cheat,"click",function(e){F(r.elements.dialogs.cheat,!1)}),z.call(r,r.elements.container,"savestate",function(e){var t;b.saveLoadDB.call(r,"save")||(t=e.detail.state,D.function(r.config.onsavestate)?r.config.onsavestate.call(null,{screenshot:e.detail.screenshot,state:t}):(e=new Blob([t]),t=(t=r.startName.split("/").pop().split(".")).slice(0,t.length-1).join("."),t=(t="string"==typeof r.gameName?r.gameName:t)?"".concat(t,".state"):"game.state",he()(e,t)),r.elements.container.focus())}),r.game.stateloadField=U("input"),r.game.stateloadField.type="file",r.game.stateloadField.onchange=function e(t){var n,t=t.target.files;0<t.length&&((n=new FileReader).file_name=t[0].name,n.onload=function(){var e=new Uint8Array(n.result);EJS_loadState(e)},n.readAsArrayBuffer(t[0])),r.game.stateloadField=U("input"),r.game.stateloadField.type="file",r.game.stateloadField.onchange=e},z.call(r,r.elements.container,"loadstate",function(e){b.saveLoadDB.call(r,"load")||(D.function(r.config.onloadstate)?r.config.onloadstate.call(null,r.loadState):r.game.stateloadField.click(),r.elements.container.focus())}),document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState?console.log("hidden"):console.log("active")})},bindFunction:function(){var t,r=this,s=r.system,c=(m.Module&&m.Module._set_volume&&(t=m.Module.cwrap("set_volume","null",["number"]),b.setVolume=function(){var e=0;r.volume<1&&(e=0===r.volume?-80:30*r.volume-30,t(e)),r.muted&&(e=-80),t(e)}),b.setVariable=m.Module.cwrap("set_variable","null",["string","string"]),b.simulateInputFn=m.Module.cwrap("simulate_input","null",["number","number","number"]),{0:null,1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null,9:null,10:null,11:null,12:null,13:null,14:null,15:null,16:null,17:null,18:null,19:null,20:null,21:null,22:null,23:null,24:null,25:null,26:null,27:null,28:null,29:null,30:null,31:null}),n=(b.simulateInput=function(e,t,n){var o,a,i;b.connected?r.playing&&!b.disableInput&&(a=b.connection.userid,o=b.roomMaster===a,a=b.players.indexOf(a),i=b.currentFrameNum(),e>>0==0&&(c[t]!==n&&(o?(b.inputsData[i]||(b.inputsData[i]=[]),b.inputsData[i].push({index:a,key:t,status:n,frame:i}),b.simulateInputFn(a,t,n)):b.connection.send(JSON.stringify({act:"sync-control",value:["".concat(a,"|").concat(t,"|").concat(n,"|").concat(i)]}),b.roomMaster)),c[t]=n)):b.disableInput||b.simulateInputFn(e,t,n)},b.syncInput=b.simulateInput,window.simulateInput=b.simulateInput,m.Module.cwrap("shader_enable","null",["number"])),l=(b.toggleShader=function(e){return n(e)},b.getStateInfo=m.Module.cwrap("get_state_info","string",[]),b.saveState=function(){var e=b.getStateInfo().split("|"),t=e[0]>>0;if(0<t)for(var n=new Uint8Array(t),o=e[1]>>0,a=0;a<t;a++)n[a]=m.Module.getValue(o+a);return n},m.Module.cwrap("load_state","number",["string","number"])),e=(b.loadState=function(e,t){try{m.FS.unlink("game.state")}catch(e){}if(m._FS.createDataFile("/","game.state",e,!0,!0),null===t&&(t=0),"arcade"===s?setTimeout(function(){b.getStateInfo(),l("game.state",t),m.FS.unlink("game.state")},10):(l("game.state",t),setTimeout(function(){m.FS.unlink("game.state")},100)),b.connected&&b.connection.isInitiator){for(var e=b.getStateInfo().split("|"),n=e[0]>>0,o=(e[2],new Uint8Array(n)),a=e[1]>>0,i=0;i<n;i+=1)o[i]=m.Module.getValue(a+i);e=new File([o],"0-game.state",{type:"",lastModified:new Date});b.connection.shareFile(e),b.inputsData={},b.wait=!0,b.systemPause(1),m.Module.pauseMainLoop(),b.disableControl(!0)}r.elements.container.focus()},m.Module._set_cheat&&(b.setCheat=m.Module.cwrap("set_cheat","number",["number","number","string"])),m.Module._reset_cheat&&(b.resetCheat=m.Module._reset_cheat),b.quickSaveState=function(){if(r.started&&!b.connected){if(!1===r.statesSupported)return r.elements.widgets.stateInfoDiv.innerHTML="CANNOT CURRENTLY SAVE STATE",clearTimeout(b.saveMsgTransitions),void(b.saveMsgTransitions=setTimeout(function(){r.elements.widgets.stateInfoDiv.innerHTML=""},1500));var t,e=(t=ee&&"function"==typeof ee.getCoreOptionsValues&&ee.getCoreOptionsValues()["save-state-slot"]||1)+"-quick.state";try{m.FS.unlink(e)}catch(e){}try{var n=b.saveState();m._FS.createDataFile("/",e,n,!0,!0),r.elements.widgets.stateInfoDiv.innerHTML="STATE SAVED TO SLOT "+t,clearTimeout(b.saveMsgTransitions),b.saveMsgTransitions=setTimeout(function(){r.elements.widgets.stateInfoDiv.innerHTML=""},1500)}catch(e){r.elements.widgets.stateInfoDiv.innerHTML="FAILED TO SAVE STATE TO SLOT "+t,clearTimeout(b.saveMsgTransitions),b.saveMsgTransitions=setTimeout(function(){r.elements.widgets.stateInfoDiv.innerHTML=""},1500)}}},b.saveMsgTransitions=null,b.quickLoadState=function(){if(r.started&&!b.connected){if(!1===r.statesSupported)return r.elements.widgets.stateInfoDiv.innerHTML="CANNOT CURRENTLY LOAD STATE",clearTimeout(b.saveMsgTransitions),void(b.saveMsgTransitions=setTimeout(function(){r.elements.widgets.stateInfoDiv.innerHTML=""},1500));var e,t=(e=ee&&"function"==typeof ee.getCoreOptionsValues&&ee.getCoreOptionsValues()["save-state-slot"]||1)+"-quick.state",n=!0;try{l(t,0),"arcade"===s&&setTimeout(function(){b.getStateInfo(),l(t,0)},10)}catch(e){n=!1}r.elements.widgets.stateInfoDiv.innerHTML=n?"LOADED STATE FROM SLOT "+e:"FAILED TO LOAD STATE FROM SLOT "+e,clearTimeout(b.saveMsgTransitions),b.saveMsgTransitions=setTimeout(function(){r.elements.widgets.stateInfoDiv.innerHTML=""},1500)}},b.changeStateSlot=function(e){var t;t=ee&&"function"==typeof ee.getCoreOptionsValues&&ee.getCoreOptionsValues()["save-state-slot"]||1,h.updateCoreOptions.call(r,"save-state-slot",t=9<(t="number"!=typeof e?t+1:e)?1:t),r.elements.widgets.stateInfoDiv.innerHTML="SET SAVE STATE SLOT TO "+t,clearTimeout(b.saveMsgTransitions),b.saveMsgTransitions=setTimeout(function(){r.elements.widgets.stateInfoDiv.innerHTML=""},1500)},window.EJS_loadState=function(t){b.loadState(t,0),setTimeout(function(){var e;b.connected&&(e=new File([t],"0-game.state",{type:"",lastModified:new Date}),b.connection.shareFile(e),b.inputsData={},b.wait=!0,b.systemPause(1),m.Module.pauseMainLoop(),b.disableControl(!0))},30)},m.Module.cwrap("cmd_take_screenshot","",[]));b.getScreenData=function(){return b.toggleShader(0),e(),b.toggleShader(1),m.FS.readFile("screenshot.png")},b.restartGame=m.Module.cwrap("system_restart","",[]),b.currentFrameNum=m.Module.cwrap("get_current_frame_count","",[]),b.saveSavFiles=m.Module.cwrap("cmd_savefiles","",[]),m.Module._get_core_options&&(b.getGameCoreOptions=m.Module.cwrap("get_core_options","string",[])),b.systemPause=function(e){return!1},b.controllers=ee.storage.get("controllers"),b.controllers||(b.controllers=JSON.parse(JSON.stringify(b.defaultControllers)))}},Z=b;function Ve(e){var t=e.targetModal,n=e.triggers,n=void 0===n?[]:n,o=e.onShow,o=void 0===o?function(){}:o,a=e.onClose,a=void 0===a?function(){}:a,i=e.openTrigger,i=void 0===i?"data-micromodal-trigger":i,r=e.closeTrigger,r=void 0===r?"data-micromodal-close":r,s=e.disableScroll,s=void 0!==s&&s,c=e.disableFocus,c=void 0!==c&&c,l=e.awaitCloseAnimation,l=void 0!==l&&l,d=e.debugMode,d=void 0!==d&&d,e=e.closeByEsckey,e=void 0===e||e;if(!(this instanceof Ve))throw new TypeError("Cannot call a class as a function");this.modal=document.getElementById(t),this.config={debugMode:d,disableScroll:s,openTrigger:i,closeTrigger:r,onShow:o,onClose:a,awaitCloseAnimation:l,disableFocus:c,closeByEsckey:e},0<n.length&&this.registerTriggers.apply(this,Le(n)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var h={storage:null,coreOptionsValues:{},contextMenu:null,normalOptions:{shader:{label:"Shader",options:{disabled:"Disabled","2xScaleHQ.glslp":"2xScaleHQ","4xScaleHQ.glslp":"4xScaleHQ","crt-easymode.glslp":"CRT easymode","crt-aperture.glslp":"CRT aperture","crt-geom.glslp":"CRT geom"},default:"disabled"},"virtual-gamepad":{label:"Virtual Gamepad",options:{disabled:"Disabled",enabled:"Enabled"},default:"enabled"}},defaultCoreOptionsValues:function(){var e={};switch(this.system){case"pce":e={pce_nospritelimit:"enabled"};break;case"jaguar":e={virtualjaguar_doom_res_hack:"enabled"};break;case"psx":e={pcsx_rearmed_memcard2:"enabled"};break;case"nds":e={}}return e},getCoreOptionsValues:function(){var e=h.storage.get("core-options");return e=D.empty(e)?{}:e},getCoreOptions:function(){var a={};switch(this.system){case"nes":a.fceumm_palette={label:this.localization("Color Palette"),options:{default:this.localization("Default"),asqrealc:"asqrealc","nintendo-vc":"nintendo-vc",rgb:"rgb","yuv-v3":"yuv-v3","unsaturated-final":"unsaturated-final","sony-cxa2025as-us":"sony-cxa2025as-us",pal:"pal","bmf-final2":"bmf-final2","bmf-final3":"bmf-final3","smooth-fbx":"smooth-fbx","composite-direct-fbx":"composite-direct-fbx","pvm-style-d93-fbx":"pvm-style-d93-fbx",nescap:"nescap","ntsc-hardware-fbx":"ntsc-hardware-fbx","nes-classic-fbx-fs":"nes-classic-fbx-fs",wavebeam:"wavebeam"},default:"default"},a.fceumm_nospritelimit={label:this.localization("No Sprite Limit"),options:{enabled:this.localization("Enabled"),disabled:this.localization("Disabled")},default:"disabled"},a.fceumm_sndquality={label:this.localization("Sound Quality"),options:{Low:this.localization("Low"),High:this.localization("High"),"Very High":this.localization("Very High")},default:"Low"},this.lightgun||(a.system_type={label:this.localization("4 Players Support"),options:{nes:"NES",famicom:"Famicom"},default:"nes",netplay:!0}),a.fceumm_turbo_enable={label:this.localization("Turbo Enable"),options:{None:this.localization("None"),"Player 1":this.localization("Player 1"),"Player 2":this.localization("Player 2"),Both:this.localization("Both")},default:"None",netplay:!0},a.fceumm_region={label:this.localization("Region"),options:{Auto:this.localization("Auto"),NTSC:"NTSC",PAL:"PAL",Dendy:"Dendy"},default:"Auto",netplay:!0};break;case"snes":a={snes9x_next_overclock:{label:this.localization("SuperFX Overclock"),options:{disabled:this.localization("Disabled")+"(10MHz)","40MHz":"40MHz","60MHz":"60MHz","80MHz":"80MHz","100MHz":"100MHz"},default:"disabled",netplay:!0}};break;case"snes2002":case"snes2005":case"snes2010":a={};break;case"gb":a={gambatte_gb_colorization:{label:this.localization("GB Colorization"),options:{disabled:this.localization("Disabled"),auto:this.localization("auto"),internal:this.localization("internal")},default:"disabled"},gambatte_gb_internal_palette:{label:this.localization("Internal Palette"),options:{"GBC - Blue":this.localization("GBC - Blue"),"GBC - Brown":this.localization("GBC - Brown"),"GBC - Dark Blue":this.localization("GBC - Dark Blue"),"GBC - Dark Brown":this.localization("GBC - Dark Brown"),"GBC - Dark Green":this.localization("GBC - Dark Green"),"GBC - Grayscale":this.localization("GBC - Grayscale"),"GBC - Green":this.localization("GBC - Green"),"GBC - Inverted":this.localization("GBC - Inverted"),"GBC - Orange":this.localization("GBC - Orange"),"GBC - Pastel Mix":this.localization("GBC - Pastel Mix"),"GBC - Red":this.localization("GBC - Red"),"GBC - Yellow":this.localization("GBC - Yellow")},default:"GBC - Blue"}};break;case"gba":a={mgba_solar_sensor_level:{label:this.localization("Solar sensor level"),options:["0","1","2","3","4","5","6","7","8","9","10"],default:"0"},mgba_frameskip:{label:this.localization("Frameskip"),options:["0","1","2","3","4","5","6","7","8","9","10"],default:"0"}};break;case"vbanext":a={vbanext_turboenable:{label:this.localization("Enable Turbo Buttons"),options:{disabled:this.localization("disabled"),enabled:this.localization("enabled")},default:"disabled"},vbanext_turbodelay:{label:this.localization("Turbo Delay in frames"),options:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"],default:"2"}};break;case"n64":a={"glupen64-aspect":{label:this.localization("Aspect Ratio (Need to refresh page)"),options:["4:3","16:9"],default:"4:3"},"glupen64-43screensize":{label:this.localization("4:3 Resolution"),options:["320x240","640x480","960x720","1280x960"],default:"320x240"},"glupen64-169screensize":{label:this.localization("16:9 Resolution"),options:["640x360","960x540","1280x720"],default:"640x360"},"glupen64-pak1":{label:this.localization("Player 1 Pak"),options:{none:this.localization("none"),memory:this.localization("memory"),rumble:this.localization("rumble")},default:"none",netplay:!0},"glupen64-pak2":{label:this.localization("Player 2 Pak"),options:{none:this.localization("none"),memory:this.localization("memory"),rumble:this.localization("rumble")},default:"none",netplay:!0},"glupen64-pak3":{label:this.localization("Player 3 Pak"),options:{none:this.localization("none"),memory:this.localization("memory"),rumble:this.localization("rumble")},default:"none",netplay:!0},"glupen64-pak4":{label:this.localization("Player 4 Pak"),options:{none:this.localization("none"),memory:this.localization("memory"),rumble:this.localization("rumble")},default:"none",netplay:!0}},!Z||"undefined"==Z.virtualGamepadContainer&&null===Z.virtualGamepadContainer||(a["joystick-input"]={label:this.localization("Joystick input keys"),options:{"d-pad":this.localization("d-pad"),"analog-stick":this.localization("Analog Stick")},default:"analog-stick",netplay:!0});break;case"nds":a={desmume_screens_layout:{label:this.localization("Screen layout"),options:{"top/bottom":this.localization("top/bottom"),"bottom/top":this.localization("bottom/top"),"left/right":this.localization("left/right"),"right/left":this.localization("right/left"),"top only":this.localization("top only"),"bottom only":this.localization("bottom only"),"quick switch":this.localization("quick switch"),"hybrid/top":this.localization("hybrid/top"),"hybrid/bottom":this.localization("hybrid/bottom")},default:"top/bottom"},screen_rotation:{label:this.localization("Screen Rotation"),options:{0:"0°",90:"90°",180:"180°",270:"270°"},default:0},desmume_frameskip:{label:this.localization("Frameskip"),options:["0","1","2","3","4","5","6","7","8","9"],default:"0"}},W.wasm||delete a.screen_rotation;break;case"vb":case"pce":a={};break;case"segaMS":case"segaGG":case"segaMD":case"segaCD":a={genesis_plus_gx_no_sprite_limit:{label:this.localization("No Sprite Limit"),options:{disabled:this.localization("disabled"),enabled:this.localization("enabled")},default:"disabled"},genesis_plus_gx_overclock:{label:this.localization("CPU speed"),options:["100%","125%","150%","175%","200%"],default:"100%",netplay:!0},genesis_plus_gx_sound_output:{label:this.localization("Sound output"),options:{stereo:this.localization("stereo"),mono:this.localization("mono")},default:"stereo"}};break;case"sega32x":a={picodrive_sprlim:{label:this.localization("No sprite limit"),options:{disabled:this.localization("disabled"),enabled:this.localization("enabled")},default:"disabled"}};break;case"segaSaturn":a={yabause_frameskip:{label:this.localization("Frameskip"),options:{disabled:this.localization("disabled"),enabled:this.localization("enabled")},default:"disabled"}};break;case"msx":a={bluemsx_nospritelimits:{label:this.localization("No Sprite Limit"),options:{OFF:this.localization("OFF"),ON:this.localization("ON")},default:"OFF"}};break;case"ws":case"ngp":a={};break;case"jaguar":a={virtualjaguar_usefastblitter:{label:this.localization("Fast Blitter"),options:{disabled:this.localization("disabled"),enabled:this.localization("enabled")},default:"disabled"},virtualjaguar_bios:{label:this.localization("Bios"),options:{disabled:this.localization("disabled"),enabled:this.localization("enabled")},default:"disabled"}};break;case"psx":a={pcsx_rearmed_frameskip:{label:this.localization("Frameskip"),options:[0,1,2,3],default:0,netplay:!0},pcsx_rearmed_memcard2:{label:this.localization("Enable second memory card"),options:{disabled:this.localization("disabled"),enabled:this.localization("enabled")},default:"enabled",netplay:!0},pcsx_rearmed_pad1type:{label:this.localization("Pad 1 Type"),options:{default:this.localization("default"),none:this.localization("none"),standard:this.localization("standard"),analog:this.localization("analog"),negcon:this.localization("negcon")},default:"default",netplay:!0},pcsx_rearmed_pad2type:{label:this.localization("Pad 2 Type"),options:{default:this.localization("default"),none:this.localization("none"),standard:this.localization("standard"),analog:this.localization("analog"),negcon:this.localization("negcon")},default:"default",netplay:!0},pcsx_rearmed_pad3type:{label:this.localization("Pad 3 Type"),options:{default:this.localization("default"),none:this.localization("none"),standard:this.localization("standard"),analog:this.localization("analog"),negcon:this.localization("negcon")},default:"default",netplay:!0},pcsx_rearmed_pad4type:{label:this.localization("Pad 4 Type"),options:{default:this.localization("default"),none:this.localization("none"),standard:this.localization("standard"),analog:this.localization("analog"),negcon:this.localization("negcon")},default:"default",netplay:!0},pcsx_rearmed_vibration:{label:this.localization("Enable Vibration"),options:{disabled:this.localization("disabled"),enabled:this.localization("enabled")},default:"enabled",netplay:!0},pcsx_rearmed_neon_interlace_enable:{label:this.localization("Enable interlacing mode(s)"),options:{disabled:this.localization("disabled"),enabled:this.localization("enabled")},default:"disabled",netplay:!0},pcsx_rearmed_neon_enhancement_enable:{label:this.localization("Enhanced resolution (slow)"),options:{disabled:this.localization("disabled"),enabled:this.localization("enabled")},default:"disabled",netplay:!0},pcsx_rearmed_neon_enhancement_no_main:{label:this.localization("Enhanced resolution speed hack"),options:{disabled:this.localization("disabled"),enabled:this.localization("enabled")},default:"disabled",netplay:!0}};break;case"arcade":case"fba0.2.97.29":a={"fba-aspect":{label:this.localization("Aspect ratio"),options:["DAR","PAR"],default:"DAR"},"fba-frameskip":{label:this.localization("Frameskip"),options:["0","1","2","3","4","5"],default:"0",netplay:!0},"fba-cpu-speed-adjust":{label:this.localization("CPU overclock"),options:["100","110","120","130","140","150","160","170","180","190","200"],default:"100",netplay:!0},"fba-diagnostic-input":{label:this.localization("Diagnostic Input"),options:["None","Hold Start","Start + A + B","Hold Start + A + B","Start + L + R","Hold Start + L + R","Hold Select","Select + A + B","Hold Select + A + B","Select + L + R","Hold Select + L + R"],default:"None",netplay:!0},"fba-neogeo-mode":{label:this.localization("Force Neo Geo mode"),options:["MVS","AES","UNIBIOS","DIPSWITCH"],default:"MVS",netplay:!0}};break;case"mame2003":case"mame2010":case"mame":case"dos":a={};break;default:a={},console.warn("Unsupported emulator")}return 2===this.coreVer&&(a={}),!0===this.statesSupported&&(a["save-state-slot"]={label:this.localization("Save State Slot"),options:[1,2,3,4,5,6,7,8,9],default:1}),!0!==this.statesSupported||!window.indexedDB||"string"!=typeof this.gameName&&this.config.gameUrl.startsWith("blob:")||(a["save-state-location"]={label:this.localization("Save State Location"),options:{download:this.localization("download"),"keep in browser":this.localization("keep in browser")},default:"download"}),Z.getGameCoreOptions&&Z.getGameCoreOptions().split("\n").forEach(function(e,t){var n,e=e.split("; "),o=e[0];0===o.indexOf("fba-dipswitch-")&&(e=e[1].split("|"),n=o.replace(/_/g," ").replace(/.+\-(.+)/,"$1"),a[o]={label:n,options:e.slice(1,-1),default:e[0].replace("(Default) ",""),netplay:!0})}),a},supportNetPlay:function(){if(this.lightgun||this.mouse)return!1;var e=window.RTCPeerConnection||window.webkitPeerConnection00||window.webkitRTCPeerConnection||window.mozRTCPeerConnection,t=window.mozRTCIceCandidate||window.RTCIceCandidate,n=window.mozRTCSessionDescription||window.RTCSessionDescription;return!!(e&&t&&n)&&!!(e&&"createDataChannel"in e.prototype)},isNetPlay:function(){},findElements:function(){try{return this.elements.controls=V.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:s.call(this,this.config.selectors.buttons.play),pause:V.call(this,this.config.selectors.buttons.pause),restart:V.call(this,this.config.selectors.buttons.restart),mute:V.call(this,this.config.selectors.buttons.mute),settings:V.call(this,this.config.selectors.buttons.settings),fullscreen:V.call(this,this.config.selectors.buttons.fullscreen),saveState:V.call(this,this.config.selectors.buttons.saveState),screenRecord:V.call(this,this.config.selectors.buttons.screenRecord),loadState:V.call(this,this.config.selectors.buttons.loadState),gamepad:V.call(this,this.config.selectors.buttons.gamepad),netplay:V.call(this,this.config.selectors.buttons.netplay),cheat:V.call(this,this.config.selectors.buttons.cheat)},this.elements.inputs={volume:V.call(this,this.config.selectors.inputs.volume)},!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),!1}},createIcon:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg"),t=(N(n,Y(t,{role:"presentation",focusable:"false"})),document.createElement("div"));t.innerHTML="<svg>".concat(this.icons[e],"</svg>");for(var o=t.childNodes[0].childNodes,a=0;a<o.length;a+=1)n.appendChild(o[a]);return n},createLabel:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=de(e,this.config),n={};return n[t.class]=!0,n[this.config.classNames.hidden]=!0,U("span",Object.assign({},t,{class:[t.class,this.config.classNames.tooltip].filter(Boolean).join(" ")}),e)},createBadge:function(e){if(D.empty(e))return null;var t=U("span",{class:this.config.classNames.menu.value});return t.appendChild(U("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var n,o,a,i,r=U("button"),t=Object.assign({},t),s=function(e){return(e=function(e){e=le((0<arguments.length&&void 0!==e?e:"").toString(),"-"," ");return e=le(e,"_"," "),le(function(e){return(0<arguments.length&&void 0!==e?e:"").toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}(e)," ","")}(e=(0<arguments.length&&void 0!==e?e:"").toString())).charAt(0).toLowerCase()+e.slice(1)}(e),c=!1,l=("type"in t||(t.type="button"),q({ejs__control:!0}));switch("class"in t?t.class.includes(l)||(t.class+=" ".concat(l)):t.class=l,e){case"play":c=!0,o=n="play",i=a="pause";break;case"mute":c=!0,n="mute",a="unmute",o="volume",i="muted";break;case"fullscreen":c=!0,n="enterFullscreen",a="exitFullscreen",o="enter-fullscreen",i="exit-fullscreen";break;default:n=s,o=e}return c?(r.appendChild(h.createIcon.call(this,i,{class:q({"icon--pressed":!0})})),r.appendChild(h.createIcon.call(this,o,{class:q({"icon--not-pressed":!0})})),r.appendChild(h.createLabel.call(this,a,{class:q({"icon--pressed":!0})})),r.appendChild(h.createLabel.call(this,n,{class:q({"icon--not-pressed":!0})}))):(r.appendChild(h.createIcon.call(this,o)),r.appendChild(h.createLabel.call(this,n))),Y(t,L(this.config.selectors.buttons[s],t)),N(r,t),"play"===s?(D.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(r)):this.elements.buttons[s]=r,r},createRange:function(e,t){t=U("input",Y(L(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.1,value:0,autocomplete:"off",role:"slider","aria-label":de(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=t,h.updateRangeFill.call(this,t),t},bindMenuItemShortcuts:function(o,a){var i=this;z(o,"keydown keyup",function(e){var t,n;[32,38,39,40].includes(e.which)&&(e.preventDefault(),e.stopPropagation(),"keydown"!==e.type)&&(!(n=oe(o,'[role="menuitemradio"]'))&&[32,39].includes(e.which)?h.showMenuPanel.call(i,a,!0):32!==e.which&&(40===e.which||n&&39===e.which?(t=o.nextElementSibling,D.element(t)||(t=o.parentNode.firstElementChild)):(t=o.previousElementSibling,D.element(t)||(t=o.parentNode.lastElementChild)),ae.call(i,t,!0)))},!1),z(o,"keyup",function(e){13===e.which&&h.focusFirstMenuItem.call(i,null,!0)})},createMenuItem:function(e){var t=this,n=e.value,o=e.list,a=e.type,i=e.title,r=e.badge,r=void 0===r?null:r,e=e.checked,e=void 0!==e&&e,s=L(this.config.selectors.inputs[a]),c=U("button",Y(s,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(s.class||"").trim(),"aria-checked":e,value:n})),s=U("span"),l=(s.innerHTML=i,D.element(r)&&s.appendChild(r),c.appendChild(s),Object.defineProperty(c,"checked",{enumerable:!0,get:function(){return"true"===c.getAttribute("aria-checked")},set:function(e){e&&Array.from(c.parentNode.children).filter(function(e){return oe(e,'[role="menuitemradio"]')}).forEach(function(e){return e.setAttribute("aria-checked","false")}),c.setAttribute("aria-checked",e?"true":"false")}}),h.getCoreOptions.call(this));this.listeners.bind(c,"click keyup",function(e){D.keyboardEvent(e)&&32!==e.which||(e.preventDefault(),e.stopPropagation(),c.checked=!0,Object.keys(h.normalOptions).includes(a)&&h.updateNormalOptions.call(t,a,n),Object.keys(l).includes(a)&&(l[a].netplay&&Z.connected?Z.connection.isInitiator&&(h.updateCoreOptions.call(t,a,n),Z.connection.send(JSON.stringify({act:"update-core-option",key:a,value:n,frame:Z.currentFrame}))):h.updateCoreOptions.call(t,a,n)),h.showMenuPanel.call(t,"home",D.keyboardEvent(e)))},a,!1),h.bindMenuItemShortcuts.call(this,c,a),o.appendChild(c)},updateVolume:function(){D.element(this.elements.inputs.volume)&&h.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),D.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume)},setRange:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;D.element(e)&&(e.value=t,h.updateRangeFill.call(this,e))},updateRangeFill:function(e){var t,e=D.event(e)?e.target:e;D.element(e)&&"range"===e.getAttribute("type")&&(oe(e,this.config.selectors.inputs.volume)?(t=100*e.value,e.setAttribute("aria-valuenow",t),e.setAttribute("aria-valuetext","".concat(t.toFixed(1),"%"))):e.setAttribute("aria-valuenow",e.value),H.isWebkit&&e.style.setProperty("--value","".concat(e.value/e.max*100,"%")))},toggleMenuButton:function(e,t){F(this.elements.settings.buttons[e],!t)},updateNormalOptions:function(e,t){this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=h.normalOptions[e].options[t];var n={};n[e]=t,h.storage.set(n),"shader"===e&&Z.setShader(t),"virtual-gamepad"===e&&Z.toggleVirtualGamepad.call(this,"enabled"===t)},updateCoreOptions:function(e,t){if("nds"==this.system&&!W.wasm)return!0;if(h.coreOptionsValues[e]=t,"psx"===this.system&&m.Module.pauseMainLoop(),Z.setVariable(e,t),"psx"===this.system&&(setTimeout(function(){m.Module.resumeMainLoop()},100),setTimeout(function(){m.Module.resumeMainLoop()},200)),"nds"===this.system&&W.wasm){var n=this.elements.wrapper.querySelector("canvas");if("screen_rotation"===e)switch(n.style.transform="rotate("+t+"deg)",t){case"0":Z.setVariable("desmume_input_rotation","0");break;case"90":Z.setVariable("desmume_input_rotation","270");break;case"180":Z.setVariable("desmume_input_rotation","180");break;case"270":Z.setVariable("desmume_input_rotation","90")}}"arcade"!==this.system&&"fba0.2.97.29"!==this.system||((n=this.elements.wrapper.querySelector("canvas")).height="fba-aspect"===e&&"PAR"===t?n.width/16*9:n.width/4*3);var n=h.getCoreOptions.call(this),o=h.storage.get("core-options");(o=D.empty(o)?{}:o)[e]=t,h.storage.set({"core-options":o}),this.elements.settings.buttons[e]&&(o=this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)),D.object(n[e].options)?o.innerHTML=n[e].options[t]:o.innerHTML=t)},setOptionMenuItem:function(l,d){var u=this,f=this.elements.settings.panels.home.querySelector('[role="menu"]'),p=this.elements.settings.popup.children[0];Object.keys(l).forEach(function(t){var n=t,e=U("button",Y(L(u.config.selectors.buttons.settings),{type:"button",class:q({ejs__control:!0,"ejs__control--forward":!0}),role:"menuitem",item:t,"aria-haspopup":!0}));z(e,"click",function(){h.showMenuPanel.call(u,n,!1)});var o,a=U("span",null,l[t].label),i=U("span",{class:u.config.classNames.menu.value}),i=(D.object(d)&&(o=d[n]),D.empty(o)&&(o=l[n].default),D.object(l[n].options)?i.innerHTML=l[n].options[o]:i.innerHTML=o,a.appendChild(i),e.appendChild(a),f.appendChild(e),U("div",{"data-pane":escape(n),hidden:""})),a=U("button",{type:"button",class:q({ejs__control:!0,"ejs__control--back":!0})}),r=(a.appendChild(U("span",{"aria-hidden":!0},l[t].label)),a.appendChild(U("span",{class:q({"ejs__sr-only":!0})},de("menuBack",u.config))),z(i,"keydown",function(e){37===e.which&&(e.preventDefault(),e.stopPropagation(),h.showMenuPanel.call(u,"home",!0))},!1),z(a,"click",function(){h.showMenuPanel.call(u,"home",!1)}),i.appendChild(a),i.appendChild(U("div",{role:"menu"})),p.appendChild(i),u.elements.settings.buttons[n]=e,(u.elements.settings.panels[n]=i).querySelector('[role="menu"]')),s=r;if(D.element(s))for(var c=s.childNodes.length;0<c;)s.removeChild(s.lastChild),--c;D.object(l[t].options)?Object.keys(l[t].options).forEach(function(e){h.createMenuItem.call(u,{value:e,list:r,type:n,title:l[t].options[e],badge:null,checked:Boolean(o===e)})}):D.array(l[t].options)&&l[t].options.forEach(function(e){h.createMenuItem.call(u,{value:e,list:r,type:n,title:e,badge:null,checked:Boolean(o===e)})})})},setNormalOptionsMenu:function(){var t=this,o=this,e={};e.orientation=h.storage.get("orientation"),e.shader=h.storage.get("shader"),o.touch?(e["virtual-gamepad"]=h.storage.get("virtual-gamepad"),z.call(o,o.elements.container,"start-game",function(){"enabled"!==e["virtual-gamepad"]&&!D.empty(e["virtual-gamepad"])||Z.toggleVirtualGamepad.call(o,!0)})):delete h.normalOptions["virtual-gamepad"],h.setOptionMenuItem.call(this,h.normalOptions,e),z.call(o,o.elements.container,"start-game",function(){var n=t,a={},e=(Z.getGameCoreOptions&&Z.getGameCoreOptions().split("\n").forEach(function(e,t){var n,e=e.split("; "),o=e[0];0===o.indexOf("fba-dipswitch-")&&(e=e[1].split("|"),n=o.replace(/_/g," ").replace(/.+\-(.+)/,"$1"),a[o]={label:n,options:e.slice(1,-1),default:e[0].replace("(Default) ",""),netplay:!0})}),h.storage.get("core-options"));h.coreOptionsValues=e||{},h.setOptionMenuItem.call(o,a,h.coreOptionsValues),Object.keys(h.coreOptionsValues).forEach(function(e,t){h.updateCoreOptions.call(n,e,h.coreOptionsValues[e])}),"nds"==o.system&&(m.Module._fast_forward_2?m.Module._fast_forward_2(1):m.Module._fast_forward&&m.Module._fast_forward(1))})},updateCoreOptionMenuItems:function(){var t=this.elements.settings.panels.home.querySelector('[role="menu"]'),n=h.getCoreOptions.call(this);Z.connected&&!Z.connection.isInitiator?Object.keys(n).forEach(function(e){n[e].netplay&&t.querySelector('[item="'.concat(e,'"]')).setAttribute("disabled","")}):Object.keys(n).forEach(function(e){t.querySelector('[item="'.concat(e,'"]')).removeAttribute("disabled")})},setCoreOptionsMenu:function(){this.elements.settings.panels.home.querySelector('[role="menu"]'),this.elements.settings.popup.children[0];var e=h.getCoreOptions.call(this),t=h.storage.get("core-options");h.coreOptionsValues=t||{},h.setOptionMenuItem.call(this,e,t)},checkMenu:function(){var e=this.elements.settings.buttons;D.empty(e)||Object.values(e).some(function(e){return!e.hidden}),F(this.elements.settings.menu,!1)},focusFirstMenuItem:function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];this.elements.settings.popup.hidden||(e=(e=D.element(e=e)?e:Object.values(this.elements.settings.panels).find(function(e){return!e.hidden})).querySelector('[role^="menuitem"]'),ae.call(this,e,t))},toggleMenu:function(e){var t=this.elements.settings.popup,n=this.elements.buttons.settings;if(D.element(t)&&D.element(n)){var o=t.hidden,a=o;if(D.boolean(e))a=e;else if(D.keyboardEvent(e)&&27===e.which)a=!1;else if(D.event(e)){var i=t.contains(e.target);if(i||!i&&e.target!==n&&a)return}n.setAttribute("aria-expanded",a),F(t,!a),G(this.elements.container,this.config.classNames.menu.open,a),a&&D.keyboardEvent(e)?h.focusFirstMenuItem.call(this,null,!0):a||o||ae.call(this,n,D.keyboardEvent(e))}},getMenuSize:function(e){var t=e.cloneNode(!0),e=(t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t),t.scrollWidth),n=t.scrollHeight;return I(t),{width:e,height:n}},showLoadStatePanel:function(){},showMenuPanel:function(){var n,e,t,o=this,a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",i=1<arguments.length&&void 0!==arguments[1]&&arguments[1],a=V.call(this,'[data-pane="'.concat(escape(a),'"]'));D.element(a)&&(n=a.parentNode,e=Array.from(n.children).find(function(e){return!e.hidden}),W.transitions&&!W.reducedMotion&&(n.style.width="".concat(e.scrollWidth,"px"),n.style.height="".concat(e.scrollHeight,"px"),t=h.getMenuSize.call(this,a),z.call(this,n,re,function e(t){t.target===n&&["width","height"].includes(t.propertyName)&&(n.style.width="",n.style.height="",M.call(o,n,re,e))}),n.style.width="".concat(t.width,"px"),n.style.height="".concat(t.height,"px")),F(e,!0),F(a,!1),h.focusFirstMenuItem.call(this,a,i))},setLoadState:function(e,t){e.appendChild(h.createButton.call(this,"load-state",{"aria-haspopup":!0,"aria-expanded":!1}));var e=U("div",{class:q({ejs__dialog:!0,"ejs__load-state__container":!0}),hidden:""}),n=U("div");e.appendChild(n),V.call(this,".".concat(q({ejs__dialogs:!0}))).appendChild(e),this.elements.dialogs.loadState=e},setScreenRecord:function(e,t){var n;window.MediaRecorder&&(n=h.createButton.call(this,"screen-record",{"aria-haspopup":!0,"aria-expanded":!1,style:"margin-right:auto;"}),e.appendChild(n),e=U("div",{class:q({ejs__dialog:!0,ejs__screenRecord__container:!0}),hidden:""}),n=U("div"),e.appendChild(n),V.call(this,".".concat(q({ejs__dialogs:!0}))).appendChild(e),this.elements.dialogs.screenRecord=e)},setGamepad:function(e,t){var n=h.createButton.call(this,"gamepad",{"aria-haspopup":!0,"aria-expanded":!1,style:"margin-right:auto;"}),e=(e.appendChild(n),U("div",{class:q({ejs__dialog:!0,ejs__gamepad__container:!0}),hidden:""})),n=U("div");e.appendChild(n),V.call(this,".".concat(q({ejs__dialogs:!0}))).appendChild(e),this.elements.dialogs.gamepad=e},setCheat:function(e,t){var n=h.createButton.call(this,"cheat",{"aria-haspopup":!0,"aria-expanded":!1,style:"margin-right:auto;"}),e=(e.appendChild(n),U("div",{class:q({ejs__dialog:!0,ejs__cheat__container:!0}),hidden:""})),n=U("div");e.appendChild(n),V.call(this,".".concat(q({ejs__dialogs:!0}))).appendChild(e),this.elements.dialogs.cheat=e},setStateInfoBarWidget:function(){var e=U("div",{class:q({ejs__widget:!0})}),t=U("div");t.style="color: red;font-size: 17px;padding:10px;text-align:left;text-shadow:1px 1px 1px #000",e.appendChild(t),V.call(this,".".concat(q({ejs__widgets:!0}))).appendChild(e),this.elements.widgets.stateInfo=e,this.elements.widgets.stateInfoDiv=t},setNetplayWidgets:function(){var e=U("div",{class:q({ejs__widget:!0,ejs__widget_netplay:!0})}),t=U("div");e.appendChild(t),V.call(this,".".concat(q({ejs__widgets:!0}))).appendChild(e),this.elements.widgets.netplay=e},setNetplay:function(e,t){e.appendChild(h.createButton.call(this,"netplay",{"aria-haspopup":!0,"aria-expanded":!1}));var e=U("div",{class:q({ejs__dialog:!0,ejs__netplay__container:!0}),hidden:""}),n=U("div");e.appendChild(n),V.call(this,".".concat(q({ejs__dialogs:!0}))).appendChild(e),this.elements.dialogs.netplay=e,h.setNetplayWidgets.call(this)},toggleContextMenu:function(e,t){var n,o;ne(e.target,q({ejs__dialogs:!0}))&&(n=h.contextMenu.timer,this.started&&(o=V.call(this,".".concat(q({ejs__contextmenu:!0})," ul")),t?(h.contextMenu.style.display="block",h.contextMenu.style.left="".concat(e.layerX,"px"),h.contextMenu.style.top="".concat(e.layerY,"px"),t=s.call(this,".".concat(q({ejs__contextmenu:!0})," ul li")),Array.from(t).forEach(function(e,t){}),null===o.getAttribute("menu")&&((e=U("li",{})).appendChild(U("a",{target:"_blank",href:"https://github.com/ethanaobrien/emulatorjs"},"EmulatorJS v".concat(this.version))),o.appendChild(e),o.setAttribute("menu","")),n&&clearTimeout(n),n=setTimeout(function(){},4e3),h.contextMenu.timer=n):h.contextMenu.style.display="none"))},create:function(e){var o=this,t=(h.storage=new fe(this,"ejs_".concat(this.system,"_settings")),U("div",L(this.config.selectors.controls.wrapper))),a=(h.contextMenu=U("div",{class:q({ejs__contextmenu:!0}),style:"position: absolute; display:none;z-index:9"}),["<ul>","</ul>"]),i=[];function n(e,t,n){"function"==typeof n?i.push(n):i.push(function(){});n=a.length-1;t?a.splice(n,0,'<li hidden><a href="#" onclick="return false">'+e+"</a></li>"):a.splice(n,0,'<li><a href="#" onclick="return false">'+e+"</a></li>")}n(o.localization("Take Screenshot"),!1,function(e){var t=b.getScreenData(),n=(n="string"==typeof o.gameName?o.gameName:n)?"".concat(n,"-screenshot.png"):"game.png";return he()(new Blob([t]),n),!1}),n(o.localization("Cache Manage"),!0,function(e){var n;return m.romdb&&(F(o.elements.dialogs.cache,!1),(n=o.elements.dialogs.cache.querySelector(".".concat(b.classNames["dialog-content"]))).innerHTML="<div>"+o.localization("Loading")+"</div>",m.romdb.getAll(function(e){var t,l;e?(t=U("table",{style:"width:100%;padding-left:10px;text-align:left"}),l=U("tbody"),0<e.length?(n.innerHTML="",e.forEach(function(e,t){if(e.key&&!/-part-\d+$/.test(e.key)){for(var n=Math.ceil(e.filesize/104857600),o=[e.key],a=1;a<n;a+=1)o.push("".concat(e.key,"-part-").concat(a));var i=U("tr"),r=U("td"),s=U("td"),c=U("td");r.innerHTML=e.filename,s.innerHTML=function(e){for(var t=-1;t++,1024<(e/=1024););return Math.max(e,.1).toFixed(1)+[" kB"," MB"," GB"," TB","PB","EB","ZB","YB"][t]}(e.filesize),c.innerHTML='<a href="#" onclick="return false">Remove</a>',i.appendChild(r),i.appendChild(s),i.appendChild(c),l.appendChild(i),c.querySelector("a").onclick=function(e){m.romdb.removeBatch(o);try{l.removeChild(i)}catch(e){}return e.stopPropagation(),!1}}}),t.appendChild(l),n.appendChild(t)):n.innerHTML='<div style="text-align:center">'+o.localization("Empty")+"</div>"):n.innerHTML='<div style="text-align:center">'+o.localization("Empty")+"</div>"},function(){})),!1}),n(o.localization("Quick Save")+" (F2)",!1,function(e){b.quickSaveState(),ee.contextMenu.style.display="none"}),n(o.localization("Quick Load")+" (F4)",!1,function(e){b.quickLoadState(),ee.contextMenu.style.display="none"}),h.contextMenu.innerHTML=a.join("");for(var r=h.contextMenu.getElementsByTagName("li"),s=0;s<r.length;s++)z.call(o,r[s],"click",i[s]);this.elements.container.appendChild(h.contextMenu);var c=U("div",{class:q({ejs__dialog:!0,ejs__cache__container:!0}),hidden:""}),c=(V.call(this,".".concat(q({ejs__dialogs:!0}))).appendChild(c),this.elements.dialogs.cache=c,U("div",{class:q({ejs__dialog:!0,ejs__loading__container:!0}),hidden:""})),c=(V.call(this,".".concat(q({ejs__dialogs:!0}))).appendChild(c),this.elements.dialogs.loading=c,t.appendChild(h.createButton.call(this,"restart")),t.appendChild(h.createButton.call(this,"play")),t.appendChild(h.createButton.call(this,"save-state",{"aria-expanded":!1})),h.setLoadState.call(this,t,e),h.setScreenRecord.call(this,t,e),h.supportNetPlay.call(this,t)&&0<parseInt(this.config.gameId,10)&&h.setNetplay.call(this,t,e),h.setGamepad.call(this,t,e),h.setStateInfoBarWidget.call(this,t,e),h.setCheat.call(this,t,e),t.appendChild(U("span",{style:"flex:1"})),U("div",{class:q({ejs__volume:!0})})),e=(c.appendChild(h.createButton.call(this,"mute")),{max:1,step:.01,value:this.config.volume}),e=(c.appendChild(h.createRange.call(this,"volume",Y(e,{}))),this.elements.volume=c,t.appendChild(c),U("div",{class:q({ejs__menu:!0})})),c=(e.appendChild(h.createButton.call(this,"settings",{"aria-haspopup":!0,"aria-expanded":!1})),U("div",{class:q({ejs__menu__container:!0}),hidden:""})),l=U("div"),d=U("div",{"data-pane":"home"}),u=U("div",{role:"menu"}),f=(d.appendChild(u),l.appendChild(d),this.elements.settings.panels.home=d,c.appendChild(l),e.appendChild(c),t.appendChild(e),this.elements.settings.popup=c,this.elements.settings.menu=e,t.appendChild(h.createButton.call(this,"fullscreen")),this);return t.addEventListener("mousedown",function(){f.onButtonDiv=!0}),this.elements.controls=t,h.setNormalOptionsMenu.call(this),h.setCoreOptionsMenu.call(this),t},inject:function(){var n=this,e=(this.icons={"enter-fullscreen":'<path d="M10 3h3.6l-4 4L11 8.4l4-4V8h2V1h-7zM7 9.6l-4 4V10H1v7h7v-2H4.4l4-4z"/>',"exit-fullscreen":'<path d="M1 12h3.6l-4 4L2 17.4l4-4V17h2v-7H1zM16 .6l-4 4V1h-2v7h7V6h-3.6l4-4z"/>',gamepad:'<svg viewBox="0 0 640 512"><path fill="currentColor" d="M480 96H160C71.6 96 0 167.6 0 256s71.6 160 160 160c44.8 0 85.2-18.4 114.2-48h91.5c29 29.6 69.5 48 114.2 48 88.4 0 160-71.6 160-160S568.4 96 480 96zM256 276c0 6.6-5.4 12-12 12h-52v52c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-52H76c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h52v-52c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h52c6.6 0 12 5.4 12 12v40zm184 68c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zm80-80c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48z"/></svg>',"load-state":'<svg viewBox="0 0 576 512"><path fill="currentColor" d="M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"/></svg>',muted:'<path d="M12.4 12.5l2.1-2.1 2.1 2.1 1.4-1.4L15.9 9 18 6.9l-1.4-1.4-2.1 2.1-2.1-2.1L11 6.9 13.1 9 11 11.1zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"/>',netplay:'<svg viewBox="0 0 512 512"><path fill="currentColor" d="M364.215 192h131.43c5.439 20.419 8.354 41.868 8.354 64s-2.915 43.581-8.354 64h-131.43c5.154-43.049 4.939-86.746 0-128zM185.214 352c10.678 53.68 33.173 112.514 70.125 151.992.221.001.44.008.661.008s.44-.008.661-.008c37.012-39.543 59.467-98.414 70.125-151.992H185.214zm174.13-192h125.385C452.802 84.024 384.128 27.305 300.95 12.075c30.238 43.12 48.821 96.332 58.394 147.925zm-27.35 32H180.006c-5.339 41.914-5.345 86.037 0 128h151.989c5.339-41.915 5.345-86.037-.001-128zM152.656 352H27.271c31.926 75.976 100.6 132.695 183.778 147.925-30.246-43.136-48.823-96.35-58.393-147.925zm206.688 0c-9.575 51.605-28.163 104.814-58.394 147.925 83.178-15.23 151.852-71.949 183.778-147.925H359.344zm-32.558-192c-10.678-53.68-33.174-112.514-70.125-151.992-.221 0-.44-.008-.661-.008s-.44.008-.661.008C218.327 47.551 195.872 106.422 185.214 160h141.572zM16.355 192C10.915 212.419 8 233.868 8 256s2.915 43.581 8.355 64h131.43c-4.939-41.254-5.154-84.951 0-128H16.355zm136.301-32c9.575-51.602 28.161-104.81 58.394-147.925C127.872 27.305 59.198 84.024 27.271 160h125.385z"/></svg>',pause:'<path d="M6 1H3c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zM12 1c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1h-3z"/>',play:'<path d="M15.562 8.1L3.87.225C3.052-.337 2 .225 2 1.125v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"/>',restart:'<path d="M9.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C6 2.6 4.9 3.2 4 4.1 1.3 6.8 1.3 11.2 4 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L16 1.9l-6.3-.7z"/>',"save-state":'<svg viewBox="0 0 448 512"><path fill="currentColor" d="M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"/></svg>',"screen-record":'<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px",viewBox="0 0 39.989 39.989" style="enable-background:new 0 0 39.989 39.989;" xml:space="preserve"><path id="XMLID_155_" d="M19.994,0C8.952,0,0,8.952,0,19.995c0,11.043,8.952,19.994,19.994,19.994s19.995-8.952,19.995-19.994,C39.989,8.952,31.037,0,19.994,0z M19.994,27.745c-4.28,0-7.75-3.47-7.75-7.75s3.47-7.75,7.75-7.75s7.75,3.47,7.75,7.75,S24.275,27.745,19.994,27.745z"/></svg>',settings:'<path d="M16.135 7.784a2 2 0 0 1-1.23-2.969c.322-.536.225-.998-.094-1.316l-.31-.31c-.318-.318-.78-.415-1.316-.094a2 2 0 0 1-2.969-1.23C10.065 1.258 9.669 1 9.219 1h-.438c-.45 0-.845.258-.997.865a2 2 0 0 1-2.969 1.23c-.536-.322-.999-.225-1.317.093l-.31.31c-.318.318-.415.781-.093 1.317a2 2 0 0 1-1.23 2.969C1.26 7.935 1 8.33 1 8.781v.438c0 .45.258.845.865.997a2 2 0 0 1 1.23 2.969c-.322.536-.225.998.094 1.316l.31.31c.319.319.782.415 1.316.094a2 2 0 0 1 2.969 1.23c.151.607.547.865.997.865h.438c.45 0 .845-.258.997-.865a2 2 0 0 1 2.969-1.23c.535.321.997.225 1.316-.094l.31-.31c.318-.318.415-.781.094-1.316a2 2 0 0 1 1.23-2.969c.607-.151.865-.547.865-.997v-.438c0-.451-.26-.846-.865-.997zM9 12a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"/>',volume:'<path d="M15.5999996,3.3 C15.1999996,2.9 14.5999996,2.9 14.1999996,3.3 C13.7999996,3.7 13.7999996,4.3 14.1999996,4.7 C15.3999996,5.9 15.9999996,7.4 15.9999996,9 C15.9999996,10.6 15.3999996,12.1 14.1999996,13.3 C13.7999996,13.7 13.7999996,14.3 14.1999996,14.7 C14.3999996,14.9 14.6999996,15 14.8999996,15 C15.1999996,15 15.3999996,14.9 15.5999996,14.7 C17.0999996,13.2 17.9999996,11.2 17.9999996,9 C17.9999996,6.8 17.0999996,4.8 15.5999996,3.3 L15.5999996,3.3 Z"></path>\n <path d="M11.2819745,5.28197449 C10.9060085,5.65794047 10.9060085,6.22188944 11.2819745,6.59785542 C12.0171538,7.33303477 12.2772954,8.05605449 12.2772954,9.00000021 C12.2772954,9.93588462 11.851678,10.9172014 11.2819745,11.4869049 C10.9060085,11.8628709 10.9060085,12.4268199 11.2819745,12.8027859 C11.4271642,12.9479755 11.9176724,13.0649528 12.2998149,12.9592565 C12.4124479,12.9281035 12.5156669,12.8776063 12.5978555,12.8027859 C13.773371,11.732654 14.1311161,10.1597914 14.1312523,9.00000021 C14.1312723,8.8299555 14.1286311,8.66015647 14.119665,8.4897429 C14.0674781,7.49784946 13.8010171,6.48513613 12.5978554,5.28197449 C12.2218894,4.9060085 11.6579405,4.9060085 11.2819745,5.28197449 Z"></path>\n <path d="M3.78571429,6.00820648 L0.714285714,6.00820648 C0.285714286,6.00820648 0,6.30901277 0,6.76022222 L0,11.2723167 C0,11.7235261 0.285714286,12.0243324 0.714285714,12.0243324 L3.78571429,12.0243324 L7.85714286,15.8819922 C8.35714286,16.1827985 9,15.8819922 9,15.2803796 L9,2.75215925 C9,2.15054666 8.35714286,1.77453879 7.85714286,2.15054666 L3.78571429,6.00820648 Z"></path>',cheat:'<svg viewBox="0 0 496 512"><path fill="currentColor" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm4 72.6c-20.8 25-51.5 39.4-84 39.4s-63.2-14.3-84-39.4c-8.5-10.2-23.7-11.5-33.8-3.1-10.2 8.5-11.5 23.6-3.1 33.8 30 36 74.1 56.6 120.9 56.6s90.9-20.6 120.9-56.6c8.5-10.2 7.1-25.3-3.1-33.8-10.1-8.4-25.3-7.1-33.8 3.1z" class=""></path></svg>'},this.id=Math.floor(1e4*Math.random()),null),t=(this.elements.controls=null,{id:this.id}),o=!0;D.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this.props)),this.config.controls||(this.config.controls=[]),D.element(this.config.controls)||D.string(this.config.controls)?e=this.config.controls:(e=h.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality}),o=!1);function a(e){var n=e;return Object.entries(t).forEach(function(e){t=2;var e=function(e){if(Array.isArray(e))return e}(e=e)||function(e,t){var n=[],o=!0,a=!1,i=void 0;try{for(var r,s=e[Symbol.iterator]();!(o=(r=s.next()).done)&&(n.push(r.value),!t||n.length!==t);o=!0);}catch(e){a=!0,i=e}finally{try{o||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}(),t=e[0],e=e[1];n=le(n,"{".concat(t,"}"),e)}),n}var i,r;o&&(D.string(this.config.controls)?e=a(e):D.element(e)&&(e.innerHTML=a(e.innerHTML))),D.string(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),(i=D.element(i)?i:this.elements.container)[D.element(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),D.element(this.elements.controls)||h.findElements.call(this),D.empty(this.elements.buttons)||(r=function(e){var t=n.config.classNames.controlPressed;Object.defineProperty(e,"pressed",{enumerable:!0,get:function(){return ne(e,t)},set:function(){G(e,t,0<arguments.length&&void 0!==arguments[0]&&arguments[0])}})},Object.values(this.elements.buttons).filter(Boolean).forEach(function(e){D.array(e)||D.nodeList(e)?Array.from(e).filter(Boolean).forEach(r):r(e)})),window.navigator.userAgent.includes("Edge")&&se(i)}},ee=h;function qe(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function He(){var e;this.enabled&&(e=this.player.elements.buttons.fullscreen,D.element(e)&&(e.pressed=this.active),B.call(this.player,this.target,this.active?"enterfullscreen":"exitfullscreen",!0),H.isIos||function(){var n,o,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];D.element(e)&&(e=s.call(this,"button:not(:disabled), input:not(:disabled), [tabindex]"),n=e[0],o=e[e.length-1],l.call(this,this.elements.container,"keydown",function(e){var t;"Tab"===e.key&&9===e.keyCode&&((t=document.activeElement)!==o||e.shiftKey?t===n&&e.shiftKey&&(o.focus(),e.preventDefault()):(n.focus(),e.preventDefault()))},t,!1))}.call(this.player,this.target,this.active))}function We(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];e?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",G(this.target,this.player.config.classNames.fullscreen.fallback,e),He.call(this)}o=[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(D.function(document.exitFullscreen))return"";var t="";return["webkit","moz","ms"].some(function(e){return!(!D.function(document["".concat(e,"ExitFullscreen")])&&!D.function(document["".concat(e,"CancelFullScreen")])||(t=e,0))}),t}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}],qe((i=f).prototype,[{key:"update",value:function(){this.enabled,G(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}},{key:"enter",value:function(){this.enabled&&(f.native?this.prefix?D.empty(this.prefix)||this.target["".concat(this.prefix,"Request").concat(this.property)]():this.target.requestFullscreen():We.call(this,!0))}},{key:"exit",value:function(){var e;this.enabled&&(f.native?this.prefix?D.empty(this.prefix)||(e="moz"===this.prefix?"Cancel":"Exit",document["".concat(this.prefix).concat(e).concat(this.property)]()):(document.cancelFullScreen||document.exitFullscreen).call(document):We.call(this,!1))}},{key:"toggle",value:function(){this.active?this.exit():this.enter()}},{key:"enabled",get:function(){return f.native}},{key:"active",get:function(){return!!this.enabled&&(f.native?(this.prefix?document["".concat(this.prefix).concat(this.property,"Element")]:document.fullscreenElement)===this.target:ne(this.target,this.player.config.classNames.fullscreen.fallback))}},{key:"target",get:function(){return H.isEdge?this.player.game:this.player.elements.container}}]),qe(i,o);var Ye=f;function f(e){var t=this;if(!(this instanceof f))throw new TypeError("Cannot call a class as a function");this.player=e,this.prefix=f.prefix,this.property=f.property,this.scrollPosition={x:0,y:0},z.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),function(){He.call(t)}),this.update()}Je.prototype={toggleMenu:function(e){ee.toggleMenu.call(this.emulator,e)},firstTouch:function(){var e=this.emulator,t=e.elements;e.touch=!0,G(t.container,e.config.classNames.isTouch,!0)},setTabFocus:function(e){var t=this.emulator,n=t.elements,o=t;clearTimeout(this.focusTimer),"keydown"===e.type&&9!==e.which||("keydown"===e.type&&(this.lastKeyDown=e.timeStamp),t=e.timeStamp-this.lastKeyDown<=20,"focus"===e.type&&!t||(e=o.config.classNames.tabFocus,G(s.call(o,".".concat(e)),e,!1),this.focusTimer=setTimeout(function(){var e=document.activeElement;n.container.contains(e)&&G(document.activeElement,o.config.classNames.tabFocus,!0)},10)))},global:function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],t=this.emulator;l.call(t,document.body,"click",this.toggleMenu,e),te.call(t,document.body,"touchstart",this.firstTouch),l.call(t,document.body,"keydown focus blur",this.setTabFocus,e,!1,!0),z.call(t,document.body,"keyup",function(e){t.started&&(113===e.which&&(e.shiftKey?null===t.elements.buttons.saveState.getAttribute("hidden")&&B.call(t,t.elements.buttons.saveState,"click"):Z.quickSaveState()),115===e.which&&(e.shiftKey?null===t.elements.buttons.loadState.getAttribute("hidden")&&B.call(t,t.elements.buttons.loadState,"click"):Z.quickLoadState()),120===e.which&&B.call(t,t.elements.buttons.mute,"click"))})},container:function(){var n,o=this.emulator,a=o.elements,i=o,r=null;z.call(i,a.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen start-game",function(e){var t=a.controls;t&&"enterfullscreen"===e.type&&(t.pressed=!1,t.hover=!1);if(["touchstart","touchmove","mousemove","start-game"].includes(e.type)){if("nds"==o.system&&"mousemove"==e.type&&m&&m.Module&&m.Module.canvas&&(document.pointerLockElement===m.Module.canvas||document.mozPointerLockElement===m.Module.canvas))return void J.toggleControls.call(i,!1);!Z||"undefined"!=Z.virtualGamepadContainer&&null!==Z.virtualGamepadContainer||(J.toggleControls.call(i,!0),t=i.touch?3e3:2e3,clearTimeout(n),n=setTimeout(function(){return J.toggleControls.call(i,!1)},t),a.controls.setAttribute("data-timer",n))}}),z.call(i,window,"resize",function(e){var t=i.elements.container.clientHeight,n=s.call(i,".".concat(q({ejs__menu__container:!0}),' [role="menu"]'));Array.from(n).forEach(function(e){e.style.maxHeight="".concat(t-95,"px"),e.style.overflow="auto"}),m.Module&&m.Module.canvas,i.elements.container.clientWidth/i.elements.container.clientHeight<1.3?G(i.elements.container,q({portrait:!0}),!0):G(i.elements.container,q({portrait:!0}),!1)}),B.call(i,window,"resize"),z.call(i,i.elements.container,"enterfullscreen",function(e){var t;2===i.coreVer&&m.Module&&(t=50,clearInterval(r),r=setInterval(function(){m.Module.setCanvasSize(window.innerWidth,window.innerHeight),t<0&&clearInterval(r),t--},100)),setTimeout(function(){B.call(i,window,"resize")},300)}),z.call(i,i.elements.container,"exitfullscreen",function(e){2===i.coreVer&&m.Module&&(clearInterval(r),m.Module.setCanvasSize(800,600)),setTimeout(function(){B.call(i,window,"resize")},300)}),z.call(i,i.elements.container,"start-game",function(e){var t=window.document.createEvent("UIEvents");t.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(t),G(i.elements.container,q({"game-started":!0}),!0)}),z.call(i,i.elements.container,"blur",function(e){var t=e.currentTarget;setTimeout(function(){t.contains(document.activeElement)||B.call(i,i.elements,"blurgame")},0)}),z.call(i,i.elements.container,"focus",function(e){var t=e.currentTarget;setTimeout(function(){t.contains(document.activeElement)&&B.call(i,i.elements,"focusgame")},0)})},media:function(){var t=this.emulator,n=t.elements,o=t,e=(z.call(o,o.game,"volumechange",function(e){return ee.updateVolume.call(o,e)}),z.call(o,n.container,"contextmenu",function(e){o.touch||o.lightgun||ee.toggleContextMenu.call(o,e,!0),e.preventDefault()},!1),z.call(o,n.container,"mousewheel",function(e){e.stopPropagation()},!1),z.call(o,n.container,"mousedown",function(e){"nds"==t.system&&m&&m.Module&&m.Module.canvas&&!m.isMobileDevice&&document.pointerLockElement!==m.Module.canvas&&document.mozPointerLockElement!==m.Module.canvas&&t.started&&!t.connected&&setTimeout(function(){!0!==t.onButtonDiv&&(m.Module.canvas.requestPointerLock=m.Module.canvas.requestPointerLock||m.Module.canvas.mozRequestPointerLock,m.Module.canvas.requestPointerLock()),t.onButtonDiv=!1},100),o.touch||ee.toggleContextMenu.call(o,e,!1)},!1),z.call(o,o.game,"volumechange",function(){o.storage.set({volume:o.volume,muted:o.muted}),Z.setVolume&&Z.setVolume()}),o.config.events.concat(["keyup","keydown"]).join(" "));z.call(o,o.game,e,function(e){var t=e.detail,t=void 0===t?{}:t;"error"===e.type&&(t=o.game.error),B.call(o,n.container,e.type,!0,t)})},proxy:function(e,t,n){var o=this.emulator,n=o.config.listeners[n],a=!0;(a=D.function(n)?n.call(o,e):a)&&D.function(t)&&t.call(o,e)},bind:function(e,t,n,o){var a=this,i=!(4<arguments.length&&void 0!==arguments[4])||arguments[4],r=this.emulator,s=r.config.listeners[o],s=D.function(s);z.call(r,e,t,function(e){return a.proxy(e,n,o)},i&&!s)},controls:function(){var e,a=this,i=this.emulator,t=i.elements,n=H.isIE?"change":"input";this.bind(t.buttons.mute,"click",function(){i.muted=!i.muted},"mute"),this.bind(t.buttons.fullscreen,"click",function(){i.fullscreen.toggle()},"fullscreen"),this.bind(t.buttons.gamepad,"click",function(){J.toggleControls.call(i,!1),F(t.dialogs.gamepad,!1)},"mute"),this.bind(t.buttons.saveState,"click",function(){B.call(i,i.elements.container,"savestate-start",!1,{});var e=Z.saveState(),t=Z.getScreenData();B.call(i,i.elements.container,"savestate",!1,{state:e,screenshot:t})},"mute"),this.bind(t.buttons.loadState,"click",function(){B.call(i,i.elements.container,"loadstate",!1,{})},"mute"),this.bind(t.buttons.settings,"click",function(e){e.stopPropagation(),ee.toggleMenu.call(i,e)}),this.bind(t.buttons.settings,"keyup",function(e){var t=e.which;[13,32].includes(t)&&(13!==t?(e.preventDefault(),e.stopPropagation(),ee.toggleMenu.call(i,e)):ee.focusFirstMenuItem.call(i,null,!0))},null,!1),this.bind(t.settings.menu,"keydown",function(e){27===e.which&&ee.toggleMenu.call(i,e)}),H.isIos&&(e=s.call(i,'input[type="range"]'),Array.from(e).forEach(function(e){return a.bind(e,n,function(e){return se(e.target)})})),H.isWebkit&&Array.from(s.call(i,'input[type="range"]')).forEach(function(e){a.bind(e,"input",function(e){return ee.updateRangeFill.call(i,e.target)})}),this.bind(t.inputs.volume,n,function(e){i.volume=e.target.value},"volume"),this.bind(t.controls,"mouseenter mouseleave",function(e){"mouseleave"===e.type&&null===e.toElement?t.controls.hover=!0:t.controls.hover=!i.touch&&"mouseenter"===e.type}),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",function(e){["mousedown","touchstart"].includes(e.type)?(t.controls.pressed=!0,e=t.controls.getAttribute("data-timer2"),clearTimeout(e)):(e=setTimeout(function(){t.controls.pressed=!1},4e3),t.controls.setAttribute("data-timer2",e))}),this.bind(t.controls,"focusin focusout",function(e){var t=i.config,n=i.elements,e="focusin"===e.type,o=n.controls.getAttribute("data-timer");G(n.controls,t.classNames.noTransition,e),J.toggleControls.call(i,e),e&&(setTimeout(function(){G(n.controls,t.classNames.noTransition,!1)},0),e=a.touch?3e3:4e3,clearTimeout(o),o=setTimeout(function(){return J.toggleControls.call(i,!1)},e),n.controls.setAttribute("data-timer",o))}),this.bind(t.inputs.volume,"wheel",function(e){var t=e.webkitDirectionInvertedFromDevice,n=function(e,t){if(Array.isArray(e))return e;var n=[],o=!0,a=!1,i=void 0;try{for(var r,s=e[Symbol.iterator]();!(o=(r=s.next()).done)&&(n.push(r.value),!t||n.length!==t);o=!0);}catch(e){a=!0,i=e}finally{try{o||null==s.return||s.return()}finally{if(a)throw i}}return n}([e.deltaX,-e.deltaY].map(function(e){return t?-e:e}),2),o=n[0],n=n[1],o=Math.sign(Math.abs(o)>Math.abs(n)?o:n),n=(i.increaseVolume(o/50),i.game.volume);(1===o&&n<1||-1===o&&0<n)&&e.preventDefault()},"volume",!1),this.bind(t.controls,"contextmenu",function(e){e.stopPropagation()}),this.bind(t.contextMenu,"contextmenu",function(e){e.stopPropagation()})}};var Xe=Je;function Je(e){if(!(this instanceof Je))throw new TypeError("Cannot call a class as a function");this.emulator=e,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}function Ke(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}e=[{key:"setup",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=null;return D.string(e)?n=Array.from(document.querySelectorAll(e)):D.nodeList(e)?n=Array.from(e):D.array(e)&&(n=e.filter(D.element)),D.empty(n)?null:n.map(function(e){return new p(e,t)})}}],Ke((i=p).prototype,[{key:"restart",value:function(){this.currentTime=0}},{key:"increaseVolume",value:function(e){var t=this.game.muted?0:this.volume;this.volume=t+(D.number(e)?e:0)}},{key:"decreaseVolume",value:function(e){this.increaseVolume(-e)}},{key:"toggleControls",value:function(e){return!!this.started&&((e=G(this.elements.container,this.config.classNames.hideControls,void 0===e?void 0:!e))&&ee.toggleMenu.call(this,!1),!e)}},{key:"setStatesSupported",value:function(e){this.statesSupported=e}},{key:"loadState",value:function(e){Z.loadState(e,0)}},{key:"on",value:function(e,t){z.call(this,this.elements.container,e,t)}},{key:"once",value:function(e,t){te.call(this,this.elements.container,e,t)}},{key:"off",value:function(e,t){M(this.elements.container,e,t)}},{key:"playing",set:function(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];Array.from(this.elements.buttons.play||[]).forEach(function(e){e.pressed=t}),this.paused=!t},get:function(){return Boolean(this.ready&&!this.paused)}},{key:"volume",set:function(e){var t=e;D.string(t)&&(t=Number(t)),D.number(t)||(t=this.storage.get("volume")),D.number(t)||(t=this.config.volume),this.config.volume=t=(t=1<t?1:t)<0?0:t,this.game.volume=t,!D.empty(e)&&this.muted&&0<t&&(this.muted=!1)},get:function(){return Number(this.game.volume)}},{key:"muted",set:function(e){D.boolean(e)||(e=this.storage.get("muted")),D.boolean(e)||(e=this.config.muted),this.config.muted=e,this.game.muted=e},get:function(){return Boolean(this.game.muted)}}]),Ke(i,e);o=p;function p(e,t){function o(e,t){for(var n,o=window.location.pathname.split("/").pop(),a=window.location.pathname.substring(0,window.location.pathname.length-o.length).split("/"),i=e.split("/"),r=[],s=0;s<a.length;s++)""!=a[s]&&r.push(a[s]);if(!(e.startsWith("/")||e.includes("://")||e.includes("http:")||e.includes("https:")||e.includes("file:")||e.includes("blob:"))){for(var c=0;c<i.length;c++)""!=i[c]&&"."!=i[c]&&(".."==i[c]?0<r.length&&(r=("/"===(n=r.join("/"))?"/":n.substring(0,n.length-n.split("/").pop().length)).split("/")):r.push(i[c]));(e=r.join("/")).startsWith("/")||(e="/"+e),e=window.location.protocol+"//"+window.location.host+e}return!(e=e.startsWith("/")?window.location.protocol+"//"+window.location.host+e:e).endsWith("/")&&t&&(e+="/"),e}var n,a,i=this,r=(function(e){if(!(e instanceof p))throw new TypeError("Cannot call a class as a function")}(this),this.version="1.1.2",this.system="",this.adUrl=null,this.gameName=null,this.loadStateOnStart=!1,this.statesSupported=!0,this.mameCore=null,this.startOnLoad=!1,this.dataPath="",this.customPaths=null,this.hash="",this.lightgun=!1,this.mouse=!1,this.multitap=!1,this.ready=!1,this.paused=!0,this.started=!1,this.touch=W.touch,this.game=e,D.string(this.game)&&(this.game=document.querySelectorAll(this.game)),(window.jQuery&&this.game instanceof jQuery||D.nodeList(this.game)||D.array(this.game))&&(this.game=this.game[0]),this.game=this.game,this.game.innerHTML="",this.config=Y({},A,p.defaults,t||{}),this.coreVer=function(e,t){if(!0===t&&window.WebAssembly)return["nes","snes","gb","nds"].includes(e)?2:1;return 1}(this.config.system,this.config.useBeta),this.lightgun=this.config.lightgun,this.loadStateOnStart=this.config.loadStateOnStart||!1,this.adUrl=this.config.adUrl||null,this.gameName=this.config.gameName||null,this.mouse=this.config.mouse,this.multitap=this.config.multitap,this.cheats=this.config.cheats,this.cheats||(this.cheats=[]),e=this.config.oldNetplayServer,"string"==typeof(r=this.config.netplayUrl)?r:!0===e?"https://ws.emulatorjs.com/":"https://emuserver.emulatorjs.ga/");this.listUrl=r,this.socketUrl=r,this.mameCore=this.config.mameCore||null,this.color=this.config.color,this.startOnLoad=this.config.startOnLoad||!1,this.statesSupported=this.config.statesSupported||!0,this.customPaths=function(e){if(!e)return{};var t,n={};for(t in e)"string"==typeof e[t]&&(n[t]=o(e[t]));return n}(this.config.paths),this.dataPath="string"!=typeof(e=this.config.dataPath)?(r=window.location.href,a=(n=r).split("/").pop(),n=n.substring(0,n.length-a.length),"/"==r?window.location.protocol+"//"+window.location.host+"/":((n=n.startsWith("/")?window.location.protocol+"//"+window.location.host+n:n).endsWith("/")||(n+="/"),n)):o(e,!0),async function(e,t,n){var o={};if(n&&"string"==typeof n&&"en-US"!==n){t=t&&"string"==typeof t[n+".json"]?t[n+".json"]:e+"localization/"+n+".json";try{var a=await(await fetch(t)).text(),o=JSON.parse(a);A.i18n=o.i18n,h.normalOptions=o.normalOptions}catch(e){console.warn("error setting localization",e)}}return function(e){return"string"==typeof o[e]?o[e]:e}}(this.dataPath,this.customPaths,this.config.lang).then(function(e){this.localization=e,this.config=Y({},A,p.defaults,t||{}),Object.keys(this.config.classNames).forEach(function(n){var e=i;D.object(e.config.classNames[n])?Object.keys(e.config.classNames[n]).forEach(function(e){var t={};t[i.config.classNames[n][e]]=!0,i.config.classNames[n][e]=q(t)}):((e={})[i.config.classNames[n]]=!0,i.config.classNames[n]=q(e))}),this.config.selectors.controls.wrapper=".".concat(q({ejs__controls:!0})),this.config.selectors.container=".".concat(q({ejs:!0})),this.system=this.config.system,this.elements={container:null,buttons:{},display:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}},dialogs:{gamepad:null,loading:null,netplay:null},widgets:{}},this.fullscreen={active:!1},this.game.emulator?console.warn("Target already setup"):(this.config.mute=!0,this.eventListeners=[],this.listeners=new Xe(this),this.storage=new fe(this,"ejs_settings"),this.game.emulator=this,D.element(this.elements.container)||(this.elements.container=U("div"),j(this.game,this.elements.container)),e=U("div",{class:q({ejs__widgets:!0})}),this.elements.container.appendChild(e),e=U("div",{class:q({ejs__dialogs:!0})}),this.elements.container.appendChild(e),J.addStyleHook.call(this),Z.setup.call(this),J.build.call(this),this.listeners.container(),this.listeners.global(),this.fullscreen=new Ye(this),m.create.call(this),(e=document.createElement("script")).src=this.customPaths&&"string"==typeof this.customPaths["webrtc-adapter.js"]?this.customPaths["webrtc-adapter.js"]:this.dataPath+"webrtc-adapter.js",document.body.appendChild(e))}.bind(this))}o.defaults={},v.default=o}]).default;