securityos/public/Program Files/EmulatorJs/emulator.min.js

2 lines
257 KiB
JavaScript
Raw Permalink Normal View History

2024-09-06 15:32:35 +00:00
var EJS=function(a){window.EJS_MODULES=a;var n={},o=[];function i(e){if(n[e])return n[e].exports;o.push(e);var t=n[e]={i:e,l:!1,exports:{}};return a[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return window.getUsedModules=function(){return o.sort(function(e,t){return t<e?1:-1})},window.getUnusedModules=function(){for(var e=[],t=getUsedModules(),n=0;n<a.length;n++)null===a[n]||t.includes(n)||e.push(n);return e},Array.isArray,i.m=a,i.c=n,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 a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));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=161)}([function(e){e.exports=function(e,t,n){console.warn(e),e&&e.response&&0===e.response.status?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">'+n.localization("CORS Error")+"</a></strong>":t.innerHTML='<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+n.localization("Network Error")+"</strong>"}},null,null,null,null,null,function(e){function t(){if(!(navigator.getGamepads||navigator.webkitGetGamepads))throw new Error("get gamepads not found!");if(this.rAF=window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.requestAnimationFrame,!this.rAF)throw new Error("request animation frame was not found!");this.loop()}t.prototype={gamepads:[],rAF:null,getGamepads:function(){return navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[]},loop:async function(){this.updateGamepadState(),this.rAF.call(null,this.loop.bind(this))},updateGamepadState:function(){for(var n=this.getGamepads(),a=0;a<n.length;a++)if(n[a]){for(var e=!1,o=0;o<this.gamepads.length;o++)if(this.gamepads[o]&&this.gamepads[o].index===n[a].index){if(e=!0,"function"==typeof this.onaxischanged)for(var t,i=0;i<this.gamepads[o].axes.length;i++)n[a].axes[i]===this.gamepads[o].axes[i]||(t=function(){switch(i){case 0:return"LEFT_STICK_X";case 1:return"LEFT_STICK_Y";case 2:return"RIGHT_STICK_X";case 3:return"RIGHT_STICK_Y";default:return""}}())&&this.onaxischanged({axis:t,value:n[a].axes[i],index:a,gamepadIndex:n[a].index});for(i=0;i<this.gamepads[o].buttons.length;i++){let e=1==this.gamepads[o].buttons[i],t=("object"==typeof this.gamepads[o].buttons[i]&&(e=this.gamepads[o].buttons[i].pressed),1==n[a].buttons[i]);"object"==typeof n[a].buttons[i]&&(t=n[a].buttons[i].pressed),e!==t&&(t?"function"==typeof this.onbuttondown&&this.onbuttondown({index:i,gamepadIndex:n[a].index}):"function"==typeof this.onbuttonup&&this.onbuttonup({index:i,gamepadIndex:n[a].index}))}this.gamepads[o]=n[a]}e||(this.gamepads.push(n[a]),"function"==typeof this.onconnected&&this.onconnected())}for(o=0;o<this.gamepads.length;o++)if(this.gamepads[o]){for(var s=!1,a=0;a<n.length;a++)n[a]&&this.gamepads[o].index===n[a].index&&(s=!0);s||(this.gamepads.splice(o,1),o--,"function"==typeof this.ondisconnected&&this.ondisconnected())}},on:function(e,t){this["on"+e.toLowerCase()]=t}},e.exports=t},null,null,null,null,function(e,t,n){function a(a,o){try{a=new URL(a)}catch(e){}return a&&!["http:","https:"].includes(a.protocol)?new Promise(async function(e,t){if("HEAD"===o.method)e({headers:{}});else{try{var n=await fetch(a);if(o.type&&"arraybuffer"===o.type.toLowerCase())n=await n.arrayBuffer();else{n=await n.text();try{n=JSON.parse(n)}catch(e){}}}catch(e){t(e)}e({data:n,headers:{}})}}):new Promise(function(t,e){var n=new XMLHttpRequest;n.onload=function(){if(n.readySta