(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{147:function(t,e,n){t.exports={uiScreen:"_3R5EC",title:"_1ps0h",image:"_3EqVr",subtitle:"_1Z69t",inputSearch:"_24eya",searchError:"_32vIL",terms:"_kjeW",row:"_3hYs8",select:"_3ecUt"}},148:function(t,e,n){},154:function(t,e,n){t.exports={popupOverlay:"_11Bb8"}},155:function(t,e,n){t.exports={searchDialog:"_33XuH",message:"_28yGm",buttons:"_1OXJP"}},25:function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var r=n(4),o=n(9);class s{constructor(t,e,n,r){this._name=t,this._size=e,this._path=n,this._archiveRef=r}get name(){return this._name}get size(){return this._size}extract(){return this._archiveRef.extractSingleFile(this._path)}}class i{static init(t={}){return i._options={workerUrl:"../dist/worker-bundle.js",...t},i._options}static open(t,e=null){e=e||i._options||i.init()&&console.warn("Automatically initializing using options: ",i._options);return new i(t,e).open()}constructor(t,e){this._worker=n(48)(),this._worker.addEventListener("message",this._workerMsg.bind(this)),this._callbacks=[],this._content={},this._processed=0,this._file=t}async open(){return await this._postMessage({type:"HELLO"},(t,e,n)=>{"READY"===n.type&&t()}),await this._postMessage({type:"OPEN",file:this._file},(t,e,n)=>{"OPENED"===n.type&&t(this)})}close(){this._worker.terminate(),this._worker=null}hasEncryptedData(){return this._postMessage({type:"CHECK_ENCRYPTION"},(t,e,n)=>{"ENCRYPTION_STATUS"===n.type&&t(n.status)})}usePassword(t){return this._postMessage({type:"SET_PASSPHRASE",passphrase:t},(t,e,n)=>{"PASSPHRASE_STATUS"===n.type&&t(n.status)})}getFilesObject(){return this._processed>0?Promise.resolve().then(()=>this._content):this._postMessage({type:"LIST_FILES"},(t,e,n)=>{if("ENTRY"===n.type){const t=n.entry,[e,r]=this._getProp(this._content,t.path);return"FILE"===t.type&&(e[r]=new s(t.fileName,t.size,t.path,this)),!0}"END"===n.type&&(this._processed=1,t(this._cloneContent(this._content)))})}getFilesArray(){return this.getFilesObject().then(t=>this._objectToArray(t))}extractSingleFile(t){if(null===this._worker)throw new Error("Archive already closed");return this._postMessage({type:"EXTRACT_SINGLE_FILE",target:t},(t,e,n)=>{if("FILE"===n.type){t(new File([n.entry.fileData],n.entry.fileName,{type:"application/octet-stream"}))}})}extractFiles(t){return this._processed>1?Promise.resolve().then(()=>this._content):this._postMessage({type:"EXTRACT_FILES"},(e,n,r)=>{if("ENTRY"===r.type){const[e,n]=this._getProp(this._content,r.entry.path);return"FILE"===r.entry.type&&(e[n]=new File([r.entry.fileData],r.entry.fileName,{type:"application/octet-stream"}),void 0!==t&&setTimeout(t.bind(null,{file:e[n],path:r.entry.path}))),!0}"END"===r.type&&(this._processed=2,this._worker.terminate(),e(this._cloneContent(this._content)))})}_cloneContent(t){if(t instanceof File||t instanceof s||null===t)return t;const e={};for(const n of Object.keys(t))e[n]=this._cloneContent(t[n]);return e}_objectToArray(t,e=""){const n=[];for(const r of Object.keys(t))t[r]instanceof File||t[r]instanceof s||null===t[r]?n.push({file:t[r]||r,path:e}):n.push(...this._objectToArray(t[r],`${e}${r}/`));return n}_getProp(t,e){const n=e.split("/");""===n[n.length-1]&&n.pop();let r=t,o=null;for(const t of n)r[t]=r[t]||{},o=r,r=r[t];return[o,n[n.length-1]]}_postMessage(t,e){return this._worker.postMessage(t),new Promise((t,n)=>{this._callbacks.push(this._msgHandler.bind(this,e,t,n))})}_msgHandler(t,e,n,r){if("BUSY"===r.type)n("worker is busy");else{if("ERROR"!==r.type)return t(e,n,r);n(r.error)}}_workerMsg({data:t}){(0,this._callbacks[this._callbacks.length-1])(t)||this._callbacks.pop()}}var a=[],l=function(t,e,n,r){return new(n||(n=Promise))((function(o,s){function i(t){try{l(r.next(t))}catch(t){s(t)}}function a(t){try{l(r.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,a)}l((r=r.apply(t,e||[])).next())}))},u=function(t,e){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0;n--){var r=Math.floor(Math.random()*(n+1));e=[t[r],t[n]],t[n]=e[0],t[r]=e[1]}}var m=new(function(){function t(){}return t.prototype.getROM=function(t){var e;return l(this,void 0,void 0,(function(){var n;return u(this,(function(o){switch(o.label){case 0:return this._token===t&&this._rom?[2,this._rom]:(this._token=t,n=this,[4,Object(r.request)({method:"GET",url:"https://europe-west3-retro-games-257212.cloudfunctions.net/session/"+t})]);case 1:if(n._rom=o.sent(),!(null===(e=this._rom)||void 0===e?void 0:e.url))throw new Error("invalid token");return[2,this.loadRom(this._rom)]}}))}))},t.prototype.loadRom=function(t){return l(this,void 0,void 0,(function(){var e,n;return u(this,(function(r){switch(r.label){case 0:return e=this,[4,h(t.url)];case 1:return e._rom=r.sent(),this._rom.platform=t.platform,Object(o.f)(this._rom.platform)&&(n=Object(o.d)(this._rom.name),this._rom.platform=c[n]||n),this._rom.platform=this._rom.platform.toLowerCase(),[2,this._rom]}}))}))},t.prototype.loadSearchRom=function(t){return l(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return this._token="local",[4,this.loadRom(t)];case 1:return e.sent(),[2]}}))}))},t.prototype.loadLocalFile=function(t){return l(this,void 0,void 0,(function(){var e,n,r,s,i;return u(this,(function(a){switch(a.label){case 0:return e=t.name.split(".")[0],"zip"!==(n=Object(o.d)(t.name))&&"7z"!==n&&"rar"!==n?[3,2]:(r=this,[4,p(t)]);case 1:return r._rom=a.sent(),n=Object(o.d)(this._rom.name),[3,4];case 2:return s=this,i={name:e},[4,f(t)];case 3:s._rom=(i.data=a.sent(),i),a.label=4;case 4:return this._rom.platform=c[n]||n,this._token="local",[2]}}))}))},t.prototype.getPopularRequests=function(){return l(this,void 0,void 0,(function(){return u(this,(function(t){return d(a),[2,a.slice(0,10)]}))}))},t.prototype.getRandomRequest=function(){return l(this,void 0,void 0,(function(){return u(this,(function(t){return d(a),[2,a[0]]}))}))},t}())},301:function(t,e,n){"use strict";n.r(e),n.d(e,"UiComponent",(function(){return S}));var r=n(4),o=n.n(r),s=n(147),i=n.n(s);function a(){return o()("div",{class:i.a.uiScreen},o()("div",{class:"container is-fluid"},"RETRO GAMES EMULATOR",o()("div",{class:"columns is-centered"},o()("div",{class:"column has-text-centered"},o()("div",{class:i.a.image})),o()("div",{class:"column is-size-2 is-size-4-mobile"},"Meet RetroGamesBot - a game console emulator that doesn't require jailbreak nor installation. You can play directly from your smartphone.")),o()("div",{class:"columns has-text-centered is-size-4 is-size-5-mobile"},o()("div",{class:"column"},"To play your favorite retro games just load the game file (ROM):",o()("br",null),o()("button",{class:"nes-btn",onclick:this.buttonLoadRomHandler.bind(this)},"LOAD ROM")),o()("div",{class:"column has-text-left"},"Supported platforms:",o()("br",null),"- Nintendo Entertainment System",o()("br",null),"- Super Nintendo Entertainment System",o()("br",null),"- Sega Master System",o()("br",null),"- Sega Genesis/Mega Drive",o()("br",null),"- Game Boy",o()("br",null),"- Game Boy Color",o()("br",null),"- Game Boy Advance",o()("br",null),"- Atari 2600",o()("br",null),"- Atari 7800 ProSystem",o()("br",null),"- Atari Jaguar",o()("br",null),"- SuperGrafx",o()("br",null),"- Neo Geo Pocket"))))}n(148);var l=n(5),u=n(25),c=n(8),h=n.n(c),p=(n(149),n(151),n(9)),f=n(154),d=n.n(f),m=function(){function t(){}return t.show=function(t,e){return void 0===e&&(e={}),new Promise((function(n){var s=document.createElement("div");s.classList.add(d.a.popupOverlay),e.onclose||(e.onclose=function(t){Object(r.mount)(s,null),Object(r.redraw)(),setTimeout(s.remove.bind(s),100),n(t)}),document.body.appendChild(s),Object(r.mount)(s,{view:function(){return o()(t,e)}}),Object(r.redraw)()}))},t}(),b=n(155),y=n.n(b),_=n(156),v=n.n(_);function g(){return r("div",{class:v()(y.a.searchDialog,"nes-dialog","is-dark")},r("p",{class:"title"},"WARNING"),r("div",{class:y.a.message},"I use public search engines (basically, I google for you), so please make sure the game you're looking for is legally available. I can't assess what kind of game you're want me to find, therefore the search result may be fraudulent, illegal or corrupted - use it at your own risk (you are responsible for any harm or damage that you suffer as a result)",r("br",null),r("br",null),r("a",{href:"/terms",target:"_blank"},"Terms and Conditions"),r("br",null)),r("br",null),r("div",{class:y.a.buttons},r("button",{class:"nes-btn",onclick:this.buttonCancelHandler.bind(this)},"Cancel"),r("button",{class:"nes-btn is-primary",onclick:this.buttonConfirmHandler.bind(this)},"Confirm")))}var w=function(){function t(){}return t.prototype.oninit=function(t){this._onclose=t.attrs.onclose},t.prototype.buttonCancelHandler=function(){this._onclose()},t.prototype.buttonConfirmHandler=function(){this._onclose(!0)},t.prototype.view=function(){return g.call(this)},t}(),E=function(t,e,n,r){return new(n||(n=Promise))((function(o,s){function i(t){try{l(r.next(t))}catch(t){s(t)}}function a(t){try{l(r.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,a)}l((r=r.apply(t,e||[])).next())}))},k=function(t,e){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]