Uploaded website source

This commit is contained in:
2026-05-05 01:28:40 -05:00
parent c6d589b4f0
commit 832f508120
33 changed files with 65362 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
name: Update TierTagger Data
on:
schedule:
- cron: '0 * * * *' # Every hour
workflow_dispatch: # Allow manual trigger from GitHub UI
jobs:
update-tier-data:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Fetch tier data from eaglertiers.com
run: |
curl -sf --max-time 30 "https://eaglertiers.com/api/players/all" -o tier_data.json || {
echo "Fetch failed, keeping existing file"
exit 0
}
- name: Commit if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add tier_data.json
git diff --staged --quiet || git commit -m "chore: update tier data [skip ci]"
git push

View File

@@ -0,0 +1 @@
modernclient.online

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 starifiedmc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,70 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>Modern Client Launcher</title>
<meta name="description" content="Modern Client Launcher" />
<link rel="icon" type="image/png" href="favicon.png" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&family=JetBrains+Mono:wght@400;600;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles.css?v=20260319" />
</head>
<body>
<div id="app" class="app" @mousemove="onMouseMove">
<div class="bg-layer bg-image"></div>
<a
class="discord-btn in-up delay-1"
:class="{show: ready}"
href="https://discord.gg/bTnDKTmD3q"
target="_blank"
rel="noopener noreferrer"
aria-label="Join Discord">
<img src="assets/buttons/discord.png?v=20260319" alt="Discord" draggable="false" />
</a>
<header class="header in-up" :class="{show: ready}">
<img class="main-logo" src="assets/title/modernclient_title.png?v=20260319" alt="Modern Client" draggable="false" />
</header>
<main class="launcher card in-up delay-1" :class="{show: ready}">
<div class="launcher-center">
<p class="hotfix-title">Beta 2.0.1 Update!</p>
<p class="eyebrow">Select Build</p>
<div class="dropdown" @click="openDropdown = !openDropdown" @keydown.enter.prevent="openDropdown = !openDropdown" tabindex="0">
<button class="dropdown-btn mc-btn" type="button">
<strong>{{ selectedBuild.label }}</strong>
<span class="arrow" :class="{open: openDropdown}"></span>
</button>
<div class="dropdown-menu" v-show="openDropdown">
<button
v-for="option in buildOptions"
:key="option.value"
type="button"
class="mc-btn"
:class="{active: option.value === selectedBuild.value}"
@click.stop="selectBuild(option)">
{{ option.label }}
</button>
</div>
</div>
<button class="btn primary mc-btn launch-btn" type="button" @click="launchSelectedBuild">Launch</button>
</div>
</main>
<div class="beta-warning in-up delay-2" :class="{show: ready}">
Warning! Modern Client is currently in Beta Testing, if you would like to give feedback on the client please check out the discord server at the top right of the website!
</div>
</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
<script src="script.js?v=20260319"></script>
</body>
</html>

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="und" style="width:100%;height:100%;background-color:black;">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Eaglercraft 1.12 test directory HTML page">
<meta name="keywords" content="eaglercraft, eaglercraftx, minecraft, 1.12, 1.12.2">
<title>Eaglercraft 1.12.2</title>
<meta property="og:locale" content="en-US">
<meta property="og:type" content="website">
<meta property="og:title" content="Eaglercraft 1.12.2">
<meta property="og:description" content="test directory HTML page">
<link type="image/png" rel="shortcut icon" href="favicon.png">
<script type="text/javascript" src="classes.js?v=2.0.3"></script>
<script type="text/javascript">
"use strict";
window.addEventListener("load", function() {
if(window.location.href.indexOf("file:") === 0) {
alert("HTTP please, do not open this file locally, run a local HTTP server and load it via HTTP");
}else {
var relayId = Math.floor(Math.random() * 3);
window.eaglercraftXOpts = {
demoMode: false,
container: "game_frame",
assetsURI: "assets.epk?v=2.0.3",
localesURI: "lang/",
worldsDB: "worlds",
logInvalidCerts: true,
crashOnUncaughtExceptions: true
};
main();
}
});
</script>
</head>
<body style="margin:0px;width:100%;height:100%;overflow:hidden;background-color:black;" id="game_frame">
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,59 @@
const { createApp } = Vue;
createApp({
data() {
return {
ready: false,
openDropdown: false,
buildOptions: [
{ value: 'js', label: 'JavaScript Build' },
{ value: 'wasm', label: 'WASM Build' }
],
selectedBuild: { value: 'wasm', label: 'WASM Build' },
};
},
methods: {
selectBuild(option) {
this.selectedBuild = option;
this.openDropdown = false;
},
launchSelectedBuild() {
const route = this.selectedBuild.value === 'wasm' ? './wasm/' : './js/';
window.location.assign(route);
},
onMouseMove(event) {
const w = window.innerWidth || 1;
const h = window.innerHeight || 1;
this._targetX = event.clientX / w;
this._targetY = event.clientY / h;
}
},
mounted() {
requestAnimationFrame(() => { this.ready = true; });
// Smooth parallax — lerp current position toward mouse target each frame,
// matching the lazy inertia of the in-game main menu background.
let curX = 0.5, curY = 0.5;
this._targetX = 0.5;
this._targetY = 0.5;
const bgEl = document.querySelector('.bg-image');
const LERP = 0.055; // lower = more lag, higher = snappier
const MAX_X = 28, MAX_Y = 22;
const tick = () => {
curX += (this._targetX - curX) * LERP;
curY += (this._targetY - curY) * LERP;
const tx = (curX - 0.5) * MAX_X;
const ty = (curY - 0.5) * MAX_Y;
if (bgEl) bgEl.style.transform = `translate(${tx}px, ${ty}px) scale(1.15)`;
requestAnimationFrame(tick);
};
requestAnimationFrame(tick);
document.addEventListener('click', (e) => {
const dropdown = document.querySelector('.dropdown');
if (!dropdown) return;
if (!dropdown.contains(e.target)) this.openDropdown = false;
});
}
}).mount('#app');

View File

@@ -0,0 +1,301 @@
:root {
--bg: #0f131c;
--panel: #1b1f28;
--panel-2: #232937;
--text: #f2f5ff;
--muted: #aab3c7;
--gold: #e1b741;
--line: #2f3647;
}
* { box-sizing: border-box; image-rendering: pixelated; }
html, body {
margin: 0;
min-height: 100%;
background: var(--bg);
color: var(--text);
font-family: "JetBrains Mono", monospace;
}
.app {
position: relative;
min-height: 100vh;
overflow: hidden;
padding: 1.2rem 1.25rem 2.5rem;
}
.bg-layer {
position: absolute;
inset: -10%;
pointer-events: none;
}
.bg-image {
background-image: url("assets/background/modernclient_main_menu.png?v=20260319");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
transform: scale(1.15);
filter: blur(5px) brightness(0.72);
will-change: transform;
}
.header {
position: relative;
z-index: 1;
max-width: 1050px;
margin: 0 auto 0.4rem;
display: flex;
justify-content: center;
align-items: center;
min-height: 140px;
}
.main-logo {
width: min(560px, 88vw);
height: auto;
filter: drop-shadow(0 0 10px rgba(225, 183, 65, 0.45)) drop-shadow(0 0 22px rgba(225, 183, 65, 0.25));
}
.discord-btn {
position: fixed;
right: 16px;
top: 16px;
z-index: 30;
width: 58px;
height: 58px;
border-radius: 14px;
border: 1px solid #3a4155;
background: rgba(27, 31, 40, 0.92);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.42);
display: inline-flex;
align-items: center;
justify-content: center;
overflow: hidden;
transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.discord-btn:hover {
transform: translateY(-2px) scale(1.06);
border-color: #e1b741;
box-shadow: 0 14px 24px rgba(0, 0, 0, 0.52);
}
.discord-btn img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
image-rendering: auto;
}
.card {
position: relative;
z-index: 1;
max-width: 1050px;
margin: 0 auto 1rem;
border: 1px solid var(--line);
background: linear-gradient(180deg, rgba(35, 41, 55, 0.9), rgba(27, 31, 40, 0.96));
border-radius: 0;
box-shadow: 0 14px 38px rgba(0, 0, 0, 0.42);
}
.launcher {
display: flex;
justify-content: center;
padding: 1.2rem;
}
.launcher-center {
width: min(520px, 100%);
display: flex;
flex-direction: column;
align-items: center;
}
.hotfix-title {
margin: 0 0 0.5rem;
font-family: "Press Start 2P", monospace;
font-size: 0.78rem;
font-weight: 700;
color: #ffecb3;
text-align: center;
}
.eyebrow {
margin: 0 0 0.6rem;
color: var(--gold);
text-transform: none;
font-size: 0.95rem;
letter-spacing: 0;
font-family: "JetBrains Mono", monospace;
font-weight: 400;
}
.dropdown {
position: relative;
width: min(380px, 100%);
outline: none;
}
.mc-btn {
border: 1px solid #3a4155;
border-radius: 0;
background: #1b1f28;
color: var(--text);
position: relative;
transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.mc-btn::before {
content: "";
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 2px;
background: #e1b741;
}
.mc-btn:hover {
transform: scale(1.03);
background: #2a2f3a;
box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}
.dropdown-btn {
width: 100%;
padding: 0.75rem 0.9rem;
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
font-family: "Press Start 2P", monospace;
font-size: 0.72rem;
}
.arrow { transition: transform 0.2s ease; }
.arrow.open { transform: rotate(180deg); }
.dropdown-menu {
position: absolute;
top: calc(100% + 0.4rem);
left: 0;
width: 100%;
border: 1px solid #3a4155;
background: #111620;
border-radius: 0;
overflow: hidden;
z-index: 15;
animation: pop 0.18s ease;
}
@keyframes pop {
from { opacity: 0; transform: translateY(-6px) scale(0.98); }
to { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-menu button {
width: 100%;
border: 0;
border-bottom: 1px solid #222a38;
text-align: left;
padding: 0.7rem 0.8rem;
cursor: pointer;
font-family: "Press Start 2P", monospace;
font-size: 0.68rem;
}
.dropdown-menu button:last-child { border-bottom: 0; }
.dropdown-menu button:hover { background: #2b3448; }
.dropdown-menu button.active {
background: #2b3448;
color: var(--gold);
}
.actions {
margin-top: 1.1rem;
display: flex;
gap: 0.65rem;
flex-wrap: wrap;
}
.btn {
padding: 0.78rem 1.2rem;
cursor: pointer;
font-family: "Press Start 2P", monospace;
font-size: 0.72rem;
}
.btn.primary {
border-color: #cfa63b;
background: #1b1f28;
color: #ffecb3;
}
.launch-btn {
margin-top: 1.2rem;
width: min(340px, 100%);
min-height: 48px;
font-size: 0.9rem;
}
.in-up {
opacity: 0;
transform: translateY(18px);
transition: opacity 0.42s ease, transform 0.42s ease;
}
.in-up.delay-1 { transition-delay: 0.08s; }
.in-up.delay-2 { transition-delay: 0.16s; }
.in-up.show {
opacity: 1;
transform: translateY(0);
}
.beta-warning {
position: fixed;
left: 50%;
bottom: 16px;
transform: translateX(-50%) translateY(10px);
width: min(980px, calc(100vw - 32px));
z-index: 25;
border: 1px solid #3a4155;
border-radius: 0;
background: #1b1f28;
color: #ffecb3;
font-family: "Press Start 2P", monospace;
font-size: 0.6rem;
line-height: 1.45;
padding: 10px 12px;
box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
}
.beta-warning.in-up {
opacity: 0;
transform: translateX(-50%) translateY(10px);
}
.beta-warning.in-up.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
.beta-warning::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 2px;
background: #e1b741;
}
@media (max-width: 880px) {
.main-logo { width: min(500px, 94vw); }
.beta-warning {
font-size: 0.52rem;
line-height: 1.35;
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -0,0 +1,211 @@
(function(){'use strict';const da=["DEBUG","INFO","WARN","ERROR"];var ea="main",fa=null;function ja(a,b,d){if(!(1>a)){var c="EagRuntimeJS: ["+(new Date).toLocaleTimeString()+"]["+ea+"/"+(da[a]||"UNKNOWN")+"] ";a:{if(0<d.length){for(var g=[],h=0;h<d.length;++h){var v=b.indexOf("{}");if(-1!=v)g.push(b.substring(0,v)),g.push(d[h]),b=b.substring(v+2);else break}if(0<g.length){g.push(b);d=g.join("");break a}}d=b}b=c+d;3<=a?console.error(b):console.log(b);fa&&fa(b,3<=a)}}function e(a,...b){ja(1,a,b)}
function ka(a,...b){ja(2,a,b)}function k(a,...b){ja(3,a,b)}function la(a,b){if(b){if(b.message?ja(3,'{}: {} - "{}"',[a,b.name,b.message]):ja(3,"{}: {}",[a,b.name]),"string"===typeof b.stack)for(b=ma(b.stack),a=0;a<b.length;++a)ja(3," at "+b[a],[])}else ja(3,"{}: <null>",[a])}function na(a){return function(){k("Unsupported function called: {}.{}",a);return 0}}function D(a,b){a[b]=na(b)}function pa(a){return new Promise(function(b){setTimeout(b,a)})}
class ra{constructor(){this.G=this.o=null;this.u=0}K(){return this.u}push(a){this.G&&(this.G._next=a);this.G=a;this.o||(this.o=a);++this.u}j(){if(this.o){const a=this.o;(this.o=a._next||null)?a._next=null:this.G=null;--this.u;return a}return null}};var sa={},H={},ta={},ua={},xa={},J={},ya={},K={},Aa={},Ba={},Ca={},N={},Da={},Ea={},Ga={},Ha=null,Ia=null,Ja=null,Ka=null,Na=null,Oa=null,Pa=null,Qa=null,O=null,Ra=null,Sa=null,S=null,T=null,Ta=null,Ua=!1,Va=0,Ya=null,Za=!1,$a=null,ab=null,bb=!1;const cb=[];var db=null,eb="_eaglercraftX",fb=!1,hb=!1,ib=!1,jb=!0,kb=!1,lb=!1,mb=!0,nb=!0,ob=!1;
function pb(){"string"===typeof O.localStorageNamespace&&(eb=O.localStorageNamespace);"boolean"===typeof O.openDebugConsoleOnLaunch&&(fb=O.openDebugConsoleOnLaunch);"boolean"===typeof O.fixDebugConsoleUnloadListener&&(hb=O.fixDebugConsoleUnloadListener);"boolean"===typeof O.forceWebViewSupport&&(ib=O.forceWebViewSupport);"boolean"===typeof O.enableWebViewCSP&&(jb=O.enableWebViewCSP);"boolean"===typeof O.forceWebGL1&&(kb=O.forceWebGL1);"boolean"===typeof O.forceWebGL2&&(lb=O.forceWebGL2);"boolean"===
typeof O.allowExperimentalWebGL1&&(mb=O.allowExperimentalWebGL1);"boolean"===typeof O.useWebGLExt&&(nb=O.useWebGLExt);"boolean"===typeof O.useDelayOnSwap&&(ob=O.useDelayOnSwap)}
async function qb(){function a(){try{v=new AudioContext,b(),d()}catch(w){la("Could not initialize audio context",w)}}function b(){if(!I){I=!0;var w=function(){d()};window.addEventListener("keydown",w);S.addEventListener("mousedown",w);S.addEventListener("touchstart",w);S.addEventListener("pointerdown",w);document.addEventListener("visibilitychange",w)}}function d(){if(v&&"suspended"===v.state)try{var w=v.resume();w&&"function"===typeof w.catch&&w.catch(function(){})}catch(C){}}pb();fa=Lb;"yes"!==
window.__isEaglerX188UnloadListenerSet&&(window.onbeforeunload=function(){window.__curEaglerX188UnloadListenerCB&&window.__curEaglerX188UnloadListenerCB();return!1},window.__isEaglerX188UnloadListenerSet="yes");e("Initializing EagRuntime JS context...");await Mb();Nb();Ob();Pb();Qb();Rb();Sb();D(Ga,"sendPacket");D(Ga,"getAvailablePackets");D(Ga,"getNextPacket");D(Ga,"setCrashCallback");D(Ga,"isTabAboutToClose");Sa.classList.add("_eaglercraftX_root_element");Sa.style.overflow="hidden";for(var c=null,
g;g=Sa.lastChild;)c||=g,Sa.removeChild(g);S=document.createElement("div");S.classList.add("_eaglercraftX_wrapper_element");S.style.position="relative";S.style.width="100%";S.style.height="100%";S.style.overflow="hidden";S.style.backgroundColor="black";Sa.appendChild(S);c&&(c.style.position="absolute",c.style.top="0px",c.style.left="0px",c.style.right="0px",c.style.bottom="0px",c.style.zIndex="2",c.classList.add("_eaglercraftX_early_splash_element"),S.appendChild(c));await pa(10);g=window.devicePixelRatio;
c=g*S.clientWidth|0;g=g*S.clientHeight|0;e("Initializing audio context");if("function"===typeof document.exitPointerLock){var h=navigator.userAgent;null!==h?(h=h.toLowerCase(),Za=-1!==h.indexOf("mobi")||-1!==h.indexOf("tablet")):Za=!1}else Za=!0;var v=null,I=!1;!Za&&navigator.userActivation&&navigator.userActivation.hasBeenActive?a():(h=document.createElement("div"),h.classList.add("_eaglercraftX_press_any_key_image"),h.style.position="absolute",h.style.top="0px",h.style.left="0px",h.style.right=
"0px",h.style.bottom="0px",h.style.width="100%",h.style.height="100%",h.style.zIndex="3",h.style.touchAction="pan-x pan-y",h.style.background='center / contain no-repeat url("'+Oa+'"), left / 1000000% 100% no-repeat url("'+Oa+'") white',h.style.setProperty("image-rendering","pixelated"),S.appendChild(h),await new Promise(function(w,C){function E(){if(!P){P=!0;Za?S.removeChild(Q):(window.removeEventListener("keydown",E),S.removeEventListener("mousedown",E),S.removeEventListener("touchstart",E));try{a()}catch(t){C(t);
return}w()}}var P=!1;if(Za){var Q=document.createElement("div");Q.classList.add("_eaglercraftX_mobile_press_any_key");Q.setAttribute("style","position:absolute;background-color:white;font-family:sans-serif;top:10%;left:10%;right:10%;bottom:10%;border:5px double black;padding:calc(5px + 7vh) 15px;text-align:center;font-size:20px;user-select:none;z-index:10;");Q.innerHTML='<h3 style="margin-block-start:0px;margin-block-end:0px;margin:20px 5px;">Mobile Browser Detected</h3><p style="margin-block-start:0px;margin-block-end:0px;margin:20px 5px;">Warning: EaglercraftX WASM-GC requires a lot of memory and may not be stable on most mobile devices!</p><p style="margin-block-start:0px;margin-block-end:0px;margin:20px 2px;"><button style="font: 24px sans-serif;font-weight:bold;" class="_eaglercraftX_mobile_launch_client">Launch EaglercraftX</button></p><p style="margin-block-start:0px;margin-block-end:0px;margin:25px 5px;">(Tablets and phones with large screens work best)</p>';
Q.querySelector("._eaglercraftX_mobile_launch_client").addEventListener("click",E);S.appendChild(Q)}else window.addEventListener("keydown",E),S.addEventListener("mousedown",E),S.addEventListener("touchstart",E)}),S.removeChild(h));v?(d(),Tb(v)):Ub();e("Creating main canvas");T=document.createElement("canvas");T.classList.add("_eaglercraftX_canvas_element");T.style.width="100%";T.style.height="100%";T.style.zIndex="1";T.style.touchAction="pan-x pan-y";T.style.setProperty("-webkit-touch-callout","none");
T.style.setProperty("-webkit-tap-highlight-color","rgba(255, 255, 255, 0)");T.style.setProperty("image-rendering","pixelated");T.width=c;T.height=g;S.appendChild(T);await Vb();e("Creating WebGL context");S.addEventListener("webglcontextcreationerror",function(w){k("[WebGL Error]: {}",w.statusMessage)});c={antialias:!1,depth:!1,powerPreference:"high-performance",desynchronized:!0,preserveDrawingBuffer:!1,premultipliedAlpha:!1,alpha:!1};h=!1;if(lb){e("Note: Forcing WebGL 2.0 context");g=300;var x=T.getContext("webgl2",
c);if(!x)return Wb("WebGL 2.0 is not supported on this device!"),!1}else if(kb){if(e("Note: Forcing WebGL 1.0 context"),g=200,x=T.getContext("webgl",c),!x)if(mb){if(h=!0,x=T.getContext("experimental-webgl",c),!x)return Wb("WebGL is not supported on this device!"),!1}else return Wb("WebGL is not supported on this device!"),!1}else if(g=300,x=T.getContext("webgl2",c),!x&&(g=200,x=T.getContext("webgl",c),!x))if(mb){if(h=!0,x=T.getContext("experimental-webgl",c),!x)return Wb("WebGL is not supported on this device!"),
!1}else return Wb("WebGL is not supported on this device!"),!1;h&&alert('WARNING: Detected "experimental" WebGL 1.0 support, certain graphics API features may be missing, and therefore EaglercraftX may malfunction and crash!');Va=g;Ta=x;Ua=h;Xb(x,g);e("OpenGL Version: {}",K.glGetString(7938));e("OpenGL Renderer: {}",K.glGetString(7937));c=K.dumpActiveExtensions();if(0===c.length)e("Unlocked the following OpenGL ES extensions: (NONE)");else for(c.sort(),e("Unlocked the following OpenGL ES extensions:"),
g=0;g<c.length;++g)e(" - {}",c[g]);K.glClearColor(0,0,0,1);K.glClear(16384);await pa(20);e("EagRuntime JS context initialization complete");return!0}
async function Yb(){pb();fa=function(a,b){postMessage({ch:"~!LOGGER",txt:a,err:b})};e("Initializing EagRuntime worker JS context...");await Mb();D(H,"setClipboard");D(H,"getClipboard");D(H,"displayFileChooser");D(H,"fileChooserHasResult");D(H,"getFileChooserResult");D(H,"clearFileChooserResult");D(H,"downloadFileWithNameU8");D(H,"downloadFileWithNameA");D(H,"downloadScreenshot");D(H,"showDebugConsole");D(H,"addLogMessage");D(H,"isShowingDebugConsole");D(H,"getFaviconURL");Ub();D(J,"keyboardLayoutSupported");
D(J,"iterateKeyboardLayout");D(J,"updateCanvasSize");D(J,"updatePlatformAndSleep");D(J,"isVSyncSupported");D(J,"mouseSetGrabbed");D(J,"isMouseGrabSupported");D(J,"isMouseGrabbed");D(J,"isPointerLocked");D(J,"supportsFullscreen");D(J,"toggleFullscreen");D(J,"isFullscreen");D(J,"touchSetOpenKeyboardZone");D(J,"touchCloseDeviceKeyboard");D(J,"touchIsDeviceKeyboardOpenMAYBE");D(J,"gamepadSupported");D(J,"isVisualViewport");D(K,"getCapBits");D(K,"glEnable");D(K,"glDisable");D(K,"glClearColor");D(K,"glClearDepth");
D(K,"glClear");D(K,"glDepthFunc");D(K,"glDepthMask");D(K,"glCullFace");D(K,"glViewport");D(K,"glBlendFunc");D(K,"glBlendFuncSeparate");D(K,"glBlendEquation");D(K,"glBlendColor");D(K,"glColorMask");D(K,"glDrawBuffers");D(K,"glReadBuffer");D(K,"glReadPixels");D(K,"glPolygonOffset");D(K,"glLineWidth");D(K,"glGenBuffers");D(K,"glGenTextures");D(K,"glCreateProgram");D(K,"glCreateShader");D(K,"glCreateFramebuffer");D(K,"glCreateRenderbuffer");D(K,"glGenQueries");D(K,"glDeleteBuffers");D(K,"glDeleteTextures");
D(K,"glDeleteProgram");D(K,"glDeleteShader");D(K,"glDeleteFramebuffer");D(K,"glDeleteRenderbuffer");D(K,"glDeleteQueries");D(K,"glBindBuffer");D(K,"glBufferData");D(K,"glBufferSubData");D(K,"glEnableVertexAttribArray");D(K,"glDisableVertexAttribArray");D(K,"glVertexAttribPointer");D(K,"glActiveTexture");D(K,"glBindTexture");D(K,"glTexParameterf");D(K,"glTexParameteri");D(K,"glTexImage3D");D(K,"glTexImage2D");D(K,"glTexSubImage2D");D(K,"glCopyTexSubImage2D");D(K,"glTexStorage2D");D(K,"glPixelStorei");
D(K,"glGenerateMipmap");D(K,"glShaderSource");D(K,"glCompileShader");D(K,"glGetShaderi");D(K,"glGetShaderInfoLog");D(K,"glUseProgram");D(K,"glAttachShader");D(K,"glDetachShader");D(K,"glLinkProgram");D(K,"glGetProgrami");D(K,"glGetProgramInfoLog");D(K,"glDrawArrays");D(K,"glDrawElements");D(K,"glBindAttribLocation");D(K,"glGetAttribLocation");D(K,"glGetUniformLocation");D(K,"glGetUniformBlockIndex");D(K,"glBindBufferRange");D(K,"glUniformBlockBinding");D(K,"glUniform1f");D(K,"glUniform2f");D(K,"glUniform3f");
D(K,"glUniform4f");D(K,"glUniform1i");D(K,"glUniform2i");D(K,"glUniform3i");D(K,"glUniform4i");D(K,"glUniformMatrix2fv");D(K,"glUniformMatrix3fv");D(K,"glUniformMatrix4fv");D(K,"glUniformMatrix3x2fv");D(K,"glUniformMatrix4x2fv");D(K,"glUniformMatrix4x3fv");D(K,"glBindFramebuffer");D(K,"glCheckFramebufferStatus");D(K,"glBlitFramebuffer");D(K,"glRenderbufferStorage");D(K,"glFramebufferTexture2D");D(K,"glFramebufferTextureLayer");D(K,"glBindRenderbuffer");D(K,"glFramebufferRenderbuffer");D(K,"glGetInteger");
D(K,"glGetError");D(K,"getAllExtensions");D(K,"dumpActiveExtensions");D(K,"glGetString");D(K,"glGenVertexArrays");D(K,"glDeleteVertexArrays");D(K,"glBindVertexArray");D(K,"glVertexAttribDivisor");D(K,"glDrawArraysInstanced");D(K,"glDrawElementsInstanced");D(K,"isContextLost");D(Ba,"getMic");D(Ba,"setDataAvailableHandler");D(Ba,"setClipDataHandler");D(Ba,"stopClipDataHandler");D(Ba,"resetClipData");D(Ba,"getClipChunkCount");D(Ba,"exportClip");D(Ca,"isSupported");D(Ca,"createRTCPeerConnection");D(N,
"supported");D(N,"clientLANReadyState");D(N,"clientLANCloseConnection");D(N,"clientLANSendPacket");D(N,"clientLANReadPacket");D(N,"clientLANAvailable");D(N,"clientLANSetICEServersAndConnect");D(N,"clearLANClientState");D(N,"clientLANAwaitICECandidate");D(N,"clientLANAwaitDescription");D(N,"clientLANAwaitChannel");D(N,"clientLANClosed");D(N,"clientLANSetICECandidate");D(N,"clientLANSetDescription");D(N,"clientLANClosed");D(N,"serverLANInitializeServer");D(N,"serverLANCloseServer");D(N,"serverLANCreatePeer");
D(Da,"checkSupported");D(Da,"checkCSPSupported");D(Da,"sendStringMessage");D(Da,"sendBinaryMessage");D(Da,"beginShowing");D(Da,"resize");D(Da,"endShowing");D(Ea,"startIntegratedServer");D(Ea,"sendPacket");D(Ea,"getAvailablePackets");D(Ea,"getNextPacket");D(Ea,"killWorker");D(Ea,"showCrashReportOverlay");D(Ea,"hideCrashReportOverlay");Zb();e("EagRuntime worker JS context initialization complete")}
function $b(a){Ya=a.buffer;e("WebAssembly direct memory resized to {} MiB",.01*(Ya.byteLength/1024/10.24|0));new Uint8Array(Ya);new Int8Array(Ya);new Uint16Array(Ya);new Int16Array(Ya);new Uint32Array(Ya);new Int32Array(Ya);new Float32Array(Ya)}const ac=new ra;function W(a,b,d){ac.push({eventType:a<<5|b,eventObj:d,_next:null})}let bc=/.+:wasm-function\[[0-9]+]:0x([0-9a-f]+).*/;
function ma(a){if(!a)return null;const b=[];for(let d of a.split("\n")){if(Ka&&(a=bc.exec(d),null!==a&&2<=a.length&&(a=parseInt(a[1],16),!isNaN(a))))try{const c=Ka([a]);if(0<c.length){for(let g of c)b.push(""+g.className+"."+g.method+"("+g.file+":"+g.line+")");continue}}catch(c){}d=d.trim();d.startsWith("at ")&&(d=d.substring(3));b.push(d)}return b}
function cc(a){const b=a?ma(a.stack):null;a="Native Browser Exception\n----------------------------------\n Line: "+(a&&"string"===typeof a.fileName?a.fileName:"unknown")+":"+(a&&"number"===typeof a.lineNumber?a.lineNumber:"unknown")+":"+(a&&"number"===typeof a.columnNumber?a.columnNumber:"unknown")+"\n Type: "+(a&&"string"===typeof a.name?a.name:"unknown")+"\n Desc: "+(a&&"string"===typeof a.message?a.message:"null")+"\n----------------------------------\n\nDeobfuscated stack trace:\n at "+
(b?b.join("\n at "):"null")+"\n\nThis exception was not handled by the WASM binary\n";if("undefined"!==typeof window)dc(a,!0);else if(ec){k("\n{}",a);try{ec(a,!0)}catch(d){console.log(d)}}else k("\n{}",a)}
function dc(a,b){k("Game crashed!");var d="Game Crashed! I have fallen and I can't get up!\n\n"+a+"\n\n",c='eaglercraft.version = "'+cb[0]+'"\neaglercraft.minecraft = "'+cb[2]+'"\neaglercraft.brand = "'+cb[1]+'"\n\n'+fc()+"\nwindow.eaglercraftXOpts = "+JSON.stringify(O)+"\n\ncurrentTime = "+(new Date).toLocaleString()+"\n\n"+gc("userAgent")+gc("vendor")+gc("language")+gc("hardwareConcurrency")+gc("deviceMemory")+gc("platform")+gc("product")+hc()+"\n"+ic("localStorage")+ic("sessionStorage")+ic("indexedDB")+
"\nrootElement.clientWidth = "+(S?S.clientWidth:"undefined")+"\nrootElement.clientHeight = "+(S?S.clientHeight:"undefined")+"\n"+ic("innerWidth")+ic("innerHeight")+ic("outerWidth")+ic("outerHeight")+ic("devicePixelRatio")+jc("availWidth")+jc("availHeight")+jc("colorDepth")+jc("pixelDepth")+"\n"+kc()+"\n",g=d+c;const h=[];try{"object"===typeof O&&"object"===typeof O.hooks&&"function"===typeof O.hooks.crashReportShow&&O.hooks.crashReportShow(g,function(v){h.push(v)})}catch(v){la("Uncaught exception invoking crash report hook",
v)}if(bb){k("");k("An additional crash report was supressed:");g=a.split(/[\r\n]+/);for(a=0;a<g.length;++a)k(" {}",g[a]);if(0<h.length)for(a=0;a<h.length;++a)if(g=h[a]){k("");k(" ----------[ CRASH HOOK ]----------");g=g.split(/[\r\n]+/);for(a=0;a<g.length;++a)k(" {}",g[a]);k(" ----------------------------------")}}else{bb=!0;if(0<h.length){g=d+"Got the following messages from the crash report hook registered in eaglercraftXOpts:\n\n";for(a=0;a<h.length;++a)g+="----------[ CRASH HOOK ]----------\n"+
h[a]+"\n----------------------------------\n\n";g+=c}(c=S||Sa)?(b&&k("\n{}",g),b=document.createElement("img"),a=document.createElement("div"),b.setAttribute("style","z-index:100;position:absolute;top:10px;left:calc(50% - 151px);"),b.src=Pa,a.setAttribute("style","z-index:100;position:absolute;top:135px;left:10%;right:10%;bottom:50px;background-color:white;border:1px solid #cccccc;overflow-x:hidden;overflow-y:scroll;overflow-wrap:break-word;white-space:pre-wrap;font: 14px monospace;padding:10px;"),
a.classList.add("_eaglercraftX_crash_element"),c.appendChild(b),c.appendChild(a),a.appendChild(document.createTextNode(g)),db&&db(),window.__curEaglerX188UnloadListenerCB=null):(alert("Root element not found, crash report was printed to console"),k("\n{}",g))}}
function Wb(a){if(!bb){bb=!0;var b=S||Sa;k("Compatibility error: {}",a);if(b){var d=document.createElement("img"),c=document.createElement("div");d.setAttribute("style","z-index:100;position:absolute;top:10px;left:calc(50% - 151px);");d.src=Pa;c.setAttribute("style","z-index:100;position:absolute;top:135px;left:10%;right:10%;bottom:50px;background-color:white;border:1px solid #cccccc;overflow-x:hidden;overflow-y:scroll;font:18px sans-serif;padding:40px;");c.classList.add("_eaglercraftX_incompatible_element");
b.appendChild(d);b.appendChild(c);c.innerHTML='<h2><svg style="vertical-align:middle;margin:0px 16px 8px 8px;" xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none"><path stroke="#000000" stroke-width="3" stroke-linecap="square" d="M1.5 8.5v34h45v-28m-3-3h-10v-3m-3-3h-10m15 6h-18v-3m-3-3h-10"/><path stroke="#000000" stroke-width="2" stroke-linecap="square" d="M12 21h0m0 4h0m4 0h0m0-4h0m-2 2h0m20-2h0m0 4h0m4 0h0m0-4h0m-2 2h0"/><path stroke="#000000" stroke-width="2" stroke-linecap="square" d="M20 30h0 m2 2h0 m2 2h0 m2 2h0 m2 -2h0 m2 -2h0 m2 -2h0"/></svg>+ This device is incompatible with Eaglercraft&ensp;:(</h2><div style="margin-left:40px;"><p style="font-size:1.2em;"><b style="font-size:1.1em;">Issue:</b> <span style="color:#BB0000;" id="_eaglercraftX_crashReason"></span><br /></p><p style="margin-left:10px;font:0.9em monospace;" id="_eaglercraftX_crashUserAgent"></p><p style="margin-left:10px;font:0.9em monospace;" id="_eaglercraftX_crashWebGL"></p><p style="margin-left:10px;font:0.9em monospace;">Current Date: '+
(new Date).toLocaleString()+'</p><p><br /><span style="font-size:1.1em;border-bottom:1px dashed #AAAAAA;padding-bottom:5px;">Things you can try:</span></p><ol><li><span style="font-weight:bold;">Just try using Eaglercraft on a different device</span>, it isn\'t a bug it\'s common sense</li><li style="margin-top:7px;">If this screen just appeared randomly, try restarting your browser or device</li><li style="margin-top:7px;">If you are not using Chrome/Edge, try installing the latest Google Chrome</li><li style="margin-top:7px;">If your browser is out of date, please update it to the latest version</li></ol></div>';
c.querySelector("#_eaglercraftX_crashReason").appendChild(document.createTextNode(a));try{var g=window.navigator.userAgent}catch(v){g="<error>"}c.querySelector("#_eaglercraftX_crashUserAgent").appendChild(document.createTextNode(g));db&&db();window.__curEaglerX188UnloadListenerCB=null;a="No GL_RENDERER string could be queried";try{const v=document.createElement("canvas");v.width=64;v.height=64;const I=v.getContext("webgl");if(I){if(I.getExtension("WEBGL_debug_renderer_info"))var h=I.getParameter(37446);
else(h=I.getParameter(WebGLRenderingContext.RENDERER))&&(h+=" [masked]");h&&(a=h)}}catch(v){}c.querySelector("#_eaglercraftX_crashWebGL").appendChild(document.createTextNode(a))}else alert("Compatibility error: "+a)}}var lc=null;
function fc(){if(lc)return lc;try{var a=Ta,b=Ua;if(!a){b=!1;var d=document.createElement("canvas");d.width=64;d.height=64;a=d.getContext("webgl2");a||(a=d.getContext("webgl"),a||(b=!0,a=d.getContext("experimental-webgl")))}return a?(d="",0<Va&&(d+="webgl.version = "+a.getParameter(7938)+"\n"),d=a.getExtension("WEBGL_debug_renderer_info")?d+("webgl.renderer = "+a.getParameter(37446)+"\nwebgl.vendor = "+a.getParameter(37445)+"\n"):d+("webgl.renderer = "+a.getParameter(7937)+" [masked]\nwebgl.vendor = "+
a.getParameter(7936)+" [masked]\n"),0<Va?(d+="\nwebgl.version.id = "+Va+"\nwebgl.experimental = "+b,200===Va?d+="\nwebgl.ext.ANGLE_instanced_arrays = "+!!a.getExtension("ANGLE_instanced_arrays")+"\nwebgl.ext.EXT_color_buffer_half_float = "+!!a.getExtension("EXT_color_buffer_half_float")+"\nwebgl.ext.EXT_shader_texture_lod = "+!!a.getExtension("EXT_shader_texture_lod")+"\nwebgl.ext.OES_fbo_render_mipmap = "+!!a.getExtension("OES_fbo_render_mipmap")+"\nwebgl.ext.OES_texture_float = "+!!a.getExtension("OES_texture_float")+
"\nwebgl.ext.OES_texture_half_float = "+!!a.getExtension("OES_texture_half_float")+"\nwebgl.ext.OES_texture_half_float_linear = "+!!a.getExtension("OES_texture_half_float_linear"):300<=Va&&(d+="\nwebgl.ext.EXT_color_buffer_float = "+!!a.getExtension("EXT_color_buffer_float")+"\nwebgl.ext.EXT_color_buffer_half_float = "+!!a.getExtension("EXT_color_buffer_half_float")+"\nwebgl.ext.OES_texture_float_linear = "+!!a.getExtension("OES_texture_float_linear")),d+="\nwebgl.ext.EXT_texture_filter_anisotropic = "+
!!a.getExtension("EXT_texture_filter_anisotropic")+"\n"):d+="webgl.ext.ANGLE_instanced_arrays = "+!!a.getExtension("ANGLE_instanced_arrays")+"\nwebgl.ext.EXT_color_buffer_float = "+!!a.getExtension("EXT_color_buffer_float")+"\nwebgl.ext.EXT_color_buffer_half_float = "+!!a.getExtension("EXT_color_buffer_half_float")+"\nwebgl.ext.EXT_shader_texture_lod = "+!!a.getExtension("EXT_shader_texture_lod")+"\nwebgl.ext.OES_fbo_render_mipmap = "+!!a.getExtension("OES_fbo_render_mipmap")+"\nwebgl.ext.OES_texture_float = "+
!!a.getExtension("OES_texture_float")+"\nwebgl.ext.OES_texture_float_linear = "+!!a.getExtension("OES_texture_float_linear")+"\nwebgl.ext.OES_texture_half_float = "+!!a.getExtension("OES_texture_half_float")+"\nwebgl.ext.OES_texture_half_float_linear = "+!!a.getExtension("OES_texture_half_float_linear")+"\nwebgl.ext.EXT_texture_filter_anisotropic = "+!!a.getExtension("EXT_texture_filter_anisotropic")+"\n",lc=d):lc="Failed to query GPU info!\n"}catch(c){return lc="ERROR: could not query webgl info - "+
c+"\n"}}function gc(a){try{var b=window.navigator[a]}catch(d){b="<error>"}return"window.navigator."+a+" = "+b+"\n"}function hc(){try{var a=[];if("object"===typeof navigator.plugins){var b=navigator.plugins.length;if(0<b)for(var d=0;d<b;++d){var c=navigator.plugins[d];a.push({name:c.name,filename:c.filename,desc:c.description})}}var g=JSON.stringify(a)}catch(h){g="<error>"}return"window.navigator.plugins = "+g+"\n"}
function jc(a){try{var b=window.screen[a]}catch(d){b="<error>"}return"window.screen."+a+" = "+b+"\n"}function kc(){try{var a=window.location.href}catch(b){a="<error>"}return"window.location.href = "+a+"\n"}function ic(a){try{var b=window[a]}catch(d){b="<error>"}return"window."+a+" = "+b+"\n"};function mc(a,b,d){const c=document.createElement("a");c.style.position="absolute";c.style.left="0px";c.style.top="0px";c.style.zIndex="-100";c.style.color="transparent";c.innerText="Download File";c.href=b;c.target="_blank";c.download=a;S.appendChild(c);setTimeout(function(){c.click();setTimeout(function(){S.removeChild(c)},50);d&&setTimeout(d,6E4)},50)}var nc=0,oc=null,pc=null,qc=null,rc=null;
function Lb(a,b){if(qc)rc&&rc(a,b);else for(a={msg:a,err:b,next:null},pc&&(pc.next=a),oc||=a,pc=a,++nc;256<nc;)--nc,oc&&=oc.next}
function Nb(){function a(q){let p=!1;try{const y=document.createElement("textarea");y.value=q;y.setAttribute("readonly","readonly");y.style.position="fixed";y.style.left="-10000px";y.style.top="0";y.style.opacity="0";document.body.appendChild(y);y.focus();y.select();p=document.execCommand("copy");document.body.removeChild(y)}catch(y){}return!!p}function b(){x=!1;w=null;null!==E?(S.removeChild(E),C=E=null):null!==C&&(S.removeChild(C),C=null)}function d(q){try{window.localStorage&&window.localStorage.setItem(m,
q?"true":"false")}catch(p){}}function c(){try{if(window.localStorage){const q=window.localStorage.getItem(m);return q&&"true"===q.toLowerCase()}return!1}catch(q){return!1}}function g(){if(qc)qc.focus();else{var q=Math.round(1E3*window.devicePixelRatio);const p=Math.round(400*window.devicePixelRatio);if(qc=window.open("","_blank","top="+Math.round((window.screen.height-p)/2)+",left="+Math.round((window.screen.width-q)/2)+",width="+q+",height="+p+",menubar=0,status=0,titlebar=0,toolbar=0")){qc.focus();
P=qc.document;P.write('<!DOCTYPE html><html><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Debug Console</title><link type="image/png" rel="shortcut icon" href="'+Qa+'" /></head><body style="overflow-x:hidden;overflow-y:scroll;padding:0px;"><p id="loggerMessageContainer" style="overflow-wrap:break-word;white-space:pre-wrap;font:14px monospace;padding:10px;"></p></body></html>');P.close();Q=P.body;t=P.getElementById("loggerMessageContainer");
for(q=oc;q;)h(q.msg+"\n",q.err?"#DD0000":"#000000"),q=q.next;pc=oc=null;nc=0;v();q=()=>{null!=qc&&(qc=null,d(!1))};qc.addEventListener("beforeunload",q);qc.addEventListener("unload",q)}else k("Logger popup was blocked!"),window.alert("ERROR: Popup blocked!\n\nPlease make sure you have popups enabled for this site!")}}function h(q,p){var y=P.createElement("span");y.innerText=q;y.style.color=p;t.appendChild(y);for(q=t.children;2048<q.length;)q[0].remove()}function v(){setTimeout(()=>{qc.scrollTo(0,
Q.scrollHeight||Q.clientHeight)},1)}let I="";H.setClipboard=function(q){I=q;try{if(a(q))return!0;if(window.navigator.clipboard&&window.isSecureContext)return window.navigator.clipboard.writeText(q).then(function(){I=q}).catch(function(){k("Clipboard API write failed!")}),!0}catch(p){k("Failed to set clipboard data!")}return!1};H.getClipboard=new WebAssembly.Suspending(async function(){var q=null;try{window.navigator.clipboard&&window.isSecureContext&&(q=await navigator.clipboard.readText())}catch(p){k("Failed to read clipboard data!")}(null===
q||void 0===q||0===q.length)&&0<I.length&&(q=I);return q});var x=!1,w=null,C=null,E=null;H.displayFileChooser=function(q,p){b();if(Za){const f=E=document.createElement("div");f.classList.add("_eaglercraftX_mobile_file_chooser_popup");f.style.position="absolute";f.style.backgroundColor="white";f.style.fontFamily="sans-serif";f.style.top="10%";f.style.left="10%";f.style.right="10%";f.style.border="5px double black";f.style.padding="15px";f.style.textAlign="left";f.style.fontSize="20px";f.style.userSelect=
"none";f.style.zIndex="150";var y=document.createElement("h3");y.appendChild(document.createTextNode("File Chooser"));f.appendChild(y);y=document.createElement("p");const u=C=document.createElement("input");u.type="file";u.accept=null===q?"."+p:q;u.multiple=!1;y.appendChild(u);f.appendChild(y);q=document.createElement("p");p=document.createElement("button");p.classList.add("_eaglercraftX_mobile_file_chooser_btn_cancel");p.style.fontSize="1.0em";p.addEventListener("click",function(){E===f&&(S.removeChild(f),
C=E=null)});p.appendChild(document.createTextNode("Cancel"));q.appendChild(p);q.appendChild(document.createTextNode(" "));p=document.createElement("button");p.classList.add("_eaglercraftX_mobile_file_chooser_btn_done");p.style.fontSize="1.0em";p.style.fontWeight="bold";p.addEventListener("click",function(){if(E===f){if(0<u.files.length){const A=u.files[0];A.arrayBuffer().then(function(F){x=!0;w={fileName:A.name,fileData:F}}).catch(function(){x=!0;w=null})}else x=!0,w=null;S.removeChild(f);C=E=null}});
p.appendChild(document.createTextNode("Done"));q.appendChild(p);f.appendChild(q);S.appendChild(f)}else{const f=C=document.createElement("input");f.type="file";f.style.position="absolute";f.style.left="0px";f.style.top="0px";f.style.zIndex="-100";f.accept=null===q?"."+p:q;f.multiple=!1;f.addEventListener("change",function(){if(C===f){if(0<f.files.length){const u=f.files[0];u.arrayBuffer().then(function(A){x=!0;w={fileName:u.name,fileData:A}}).catch(function(){x=!0;w=null})}else x=!0,w=null;S.removeChild(f);
C=null}});S.appendChild(f);window.setTimeout(function(){f.click()},50)}};H.fileChooserHasResult=function(){return x};H.getFileChooserResult=function(){x=!1;const q=w;w=null;return q};H.clearFileChooserResult=b;H.downloadFileWithNameU8=function(q,p){const y=URL.createObjectURL(new Blob([p],{type:"application/octet-stream"}));mc(q,y,function(){URL.revokeObjectURL(y)})};H.downloadFileWithNameA=function(q,p){const y=URL.createObjectURL(new Blob([p],{type:"application/octet-stream"}));mc(q,y,function(){URL.revokeObjectURL(y)})};
H.downloadScreenshot=function(q,p){mc(q,p.toDataURL("image/png"),null)};var P=null,Q=null,t=null;const m=eb+"showDebugConsole",z=hb?"beforeunload":"unload";try{window.addEventListener(z,()=>{if(qc){var q=qc;t=Q=P=qc=null;q.close()}})}catch(q){}(fb||c())&&g();rc=function(q,p){var y=qc.innerHeight+qc.pageYOffset>=Q.offsetHeight;h(q+"\n",p?"#DD0000":"#000000");y&&v()};H.showDebugConsole=function(){d(!0);g()};H.addLogMessage=Lb;H.isShowingDebugConsole=function(){return!!qc};H.getFaviconURL=function(){return Qa}}
;ta.getEPKFileData=function(a){const b=Na[a];Na[a]=null;return b};ta.getEPKFileCount=function(){return Na.length};
if("undefined"!==typeof window){ta.loadImageFile0=new WebAssembly.Suspending(function(a,b){return new Promise(function(d){const c=URL.createObjectURL(new Blob([a],{type:b}));if(c){const g=document.createElement("img");g.addEventListener("load",function(){URL.revokeObjectURL(c);d({width:g.width,height:g.height,img:g})});g.addEventListener("error",function(){URL.revokeObjectURL(c);d(null)});g.src=c}else d(null)})});var sc=null,tc=null;ta.loadImageFile1=function(a,b){const d=a.width,c=a.height;if(a=
a.img)sc||=document.createElement("canvas"),sc.width<d&&(sc.width=d),sc.height<c&&(sc.height=c),tc||(tc=sc.getContext("2d",{willReadFrequently:!0}),tc.imageSmoothingEnabled=!1),tc.clearRect(0,0,d,c),tc.drawImage(a,0,0,d,c),b.set(tc.getImageData(0,0,d,c).data,0)}}else D(ta,"loadImageFile0"),D(ta,"loadImageFile1");function Tb(a){ua.getContext=function(){return a};ua.registerIsEndedHandler=function(b,d){d.selfEndHandler||(d.selfEndHandler=function(){d.isEnded=!0});b.addEventListener("ended",d.selfEndHandler)};ua.releaseIsEndedHandler=function(b,d){d.selfEndHandler&&b.removeEventListener("ended",d.selfEndHandler)};ua.decodeAudioBrowser=new WebAssembly.Suspending(function(b,d){return new Promise(function(c){const g=new Uint8Array(b.length);g.set(b,0);a.decodeAudioData(g.buffer,c,function(){k("Failed to load audio: {}",
d);c(null)})})})}function Ub(){ua.getContext=function(){return null};D(ua,"registerIsEndedHandler");D(ua,"releaseIsEndedHandler");D(ua,"decodeAudioBrowser")};function uc(a){return"string"===typeof a?a:"undefined"===typeof a?null:"string"===typeof a[0]?a[0]:null}function vc(a){return"undefined"===typeof a?null:"undefined"===typeof a.data?null:a.data}
xa.openDB=new WebAssembly.Suspending(function(a){return new Promise(function(b){if("undefined"===typeof indexedDB)b({failedInit:!0,failedLocked:!1,failedError:"IndexedDB not supported",database:null});else{try{var d=indexedDB.open(a,1)}catch(g){b({failedInit:!0,failedLocked:!1,failedError:"Exception opening database",database:null});return}var c=b;d.addEventListener("success",function(){c&&c({failedInit:!1,failedLocked:!1,failedError:null,database:d.result});c=null});d.addEventListener("blocked",
function(){c&&c({failedInit:!1,failedLocked:!0,failedError:"Database is locked",database:null});c=null});d.addEventListener("error",function(){c&&c({failedInit:!0,failedLocked:!1,failedError:"Opening database failed",database:null});c=null});d.addEventListener("upgradeneeded",function(){d.result.createObjectStore("filesystem",{keyPath:["path"]})})}})});
function wc(a,b){return new Promise(function(d){const c=a.transaction("filesystem","readwrite").objectStore("filesystem").delete([b]);c.addEventListener("success",function(){d(!0)});c.addEventListener("error",function(){d(!1)})})}xa.eaglerDelete=new WebAssembly.Suspending(wc);
function xc(a,b){return new Promise(function(d){const c=a.transaction("filesystem","readonly").objectStore("filesystem").get([b]);c.addEventListener("success",function(){d(vc(c.result))});c.addEventListener("error",function(){d(null)})})}xa.eaglerRead=new WebAssembly.Suspending(xc);
function yc(a,b,d){return new Promise(function(c){const g=a.transaction("filesystem","readwrite").objectStore("filesystem").put({path:b,data:d});g.addEventListener("success",function(){c(!0)});g.addEventListener("error",function(){c(!1)})})}xa.eaglerWrite=new WebAssembly.Suspending(yc);
xa.eaglerExists=new WebAssembly.Suspending(function(a,b){return new Promise(function(d){const c=a.transaction("filesystem","readonly").objectStore("filesystem").count([b]);c.addEventListener("success",function(){d(0<c.result)});c.addEventListener("error",function(){d(!1)})})});xa.eaglerMove=new WebAssembly.Suspending(async function(a,b,d){const c=await xc(a,b);return c&&await yc(a,d,c)?await wc(a,b):!1});
xa.eaglerCopy=new WebAssembly.Suspending(async function(a,b,d){return(b=await xc(a,b))&&await yc(a,d,b)});xa.eaglerSize=new WebAssembly.Suspending(function(a,b){return new Promise(function(d){const c=a.transaction("filesystem","readonly").objectStore("filesystem").get([b]);c.addEventListener("success",function(){const g=vc(c.result);d(g?g.byteLength:-1)});c.addEventListener("error",function(){d(-1)})})});
function zc(a){if(0===a.length)return-1;for(var b=0,d=0,c=a.length;d<c;++d)47===a.charCodeAt(d)&&++b;return b}
xa.eaglerIterate=new WebAssembly.Suspending(function(a,b,d){return new Promise(function(c){const g=[],h=a.transaction("filesystem","readonly").objectStore("filesystem").openCursor(),v=0===b.length,I=d?-1:zc(b);h.addEventListener("success",function(){const x=h.result;if(null===x||null===x.key)c({length:g.length,getRow:function(C){return g[C]}});else{var w=uc(x.key);null!=w&&(!v&&!w.startsWith(b)||!d&&zc(w)!==I||g.push(w));x.continue()}});h.addEventListener("error",function(){c(null)})})});async function Vb(){function a(){var l=window.devicePixelRatio;.01>l&&(l=1);Q=P=0;for(var B=T;B&&!isNaN(B.offsetLeft)&&!isNaN(B.offsetTop);)P+=B.offsetLeft-B.scrollLeft,Q+=B.offsetTop-B.scrollTop,B=B.offsetParent;B=S.clientWidth*l|0;var X=S.clientHeight*l|0,R=0,aa=0,qa=B,oa=X;if(Y){oa=window.visualViewport;var ba=oa.scale;R=oa.pageLeft*l*ba;aa=oa.pageTop*l*ba;qa=oa.width*l*ba;oa=oa.height*l*ba;1>qa&&(qa=1);1>oa&&(oa=1);0>R?(qa+=R,R=0):R>=B&&(R=B-1);0>aa?(oa+=aa,aa=0):aa>=X&&(aa=X-1);R+qa>B&&(qa=B-
R);aa+oa>X&&(oa=X-aa)}ba={eventTypeMask:0};L!==l&&(L=l,ba.eventTypeMask|=4,ba.windowDPI=l);if(A!==B||F!==X)A=B,F=X,ba.eventTypeMask|=1,ba.windowWidth=B,ba.windowHeight=X;if(U!==R||Z!==aa||La!==qa||gb!==oa)U=R,Z=aa,La=qa,gb=oa,ba.eventTypeMask|=2,ba.visualViewportX=R,ba.visualViewportY=aa,ba.visualViewportW=qa,ba.visualViewportH=oa;0!==ba.eventTypeMask&&W(0,9,ba)}function b(l){const B=l.length,X=Array(B);for(var R=0;R<B;++R){const aa=l.item(R);X[R]={pointX:aa.pageX-P,pointY:aa.pageY-Q,radius:.5*(aa.radiusX+
aa.radiusY),force:aa.force,pointUID:aa.identifier}}return X}function d(l,B){return{eventType:l,keyCode:B.code||null,keyName:B.key||null,legacyCode:"number"===typeof B.which?B.which:"number"===typeof B.keyCode?B.keyCode:0,location:B.location,mods:(B.ctrlKey?1:0)|(B.shiftKey?2:0)|(B.metaKey?4:0)}}function c(){return new Promise(function(l){if(-1!==M)throw Error("Main thread is already waiting for VSync!");const B=[!1];window.requestAnimationFrame(function(){B[0]||(B[0]=!0,-1!==M&&(window.clearTimeout(M),
M=-1),l())});M=window.setTimeout(function(){B[0]||(B[0]=!0,M=-1,l())},20)})}function g(l){return new Promise(function(B){setTimeout(B,l)})}function h(l){if(0<l&&1E3>=l){const X=1E3/l;if(0===ha)ha=performance.now()+X;else{l=performance.now();var B=ha-l|0;if(0<B)return!ob&&Ac?Bc().then(function(){var R=performance.now(),aa=ha-R|0;if(0<aa)return g(aa).then(function(){var qa=performance.now();(ha+=X)<qa&&(ha=qa)});(ha+=X)<R&&(ha=R)}):g(B).then(function(){var R=performance.now();(ha+=X)<R&&(ha=R)});(ha+=
X)<l&&(ha=l)}}else ha=0;return ob?Cc(0):Bc()}function v(l){if(Fa){za=!!l;var B=performance.now()|0;if(l){Ma=!0;try{T.requestPointerLock()}catch(X){}-1!==va&&window.clearTimeout(va);va=-1;3E3>B-Wa&&(va=window.setTimeout(function(){try{T.requestPointerLock()}catch(X){}},3100-(B-Wa)))}else if(-1!==va&&window.clearTimeout(va),va=-1,!Ma)try{document.exitPointerLock()}catch(X){}}}function I(){if(ia)if(n.matches){if(r)try{navigator.keyboard.unlock()}catch(l){}try{document.exitFullscreen()}catch(l){}}else{if(r)try{navigator.keyboard.lock()}catch(l){}try{T.requestFullscreen()}catch(l){}}}
function x(){C()?w():m?(m.blur(),m.value="",setTimeout(function(){m&&(t?t.removeChild(m):m.remove(),m=null);t&&(S.removeChild(t),t=null)},10)):(t&&(S.removeChild(t),t=null),t=document.createElement("form"),t.setAttribute("autocomplete","off"),t.classList.add("_eaglercraftX_text_input_wrapper"),t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.right="0px",t.style.bottom="0px",t.style.zIndex="-100",t.style.margin="0px",t.style.padding="0px",t.style.border="none",t.addEventListener("submit",
function(l){l.preventDefault();l.stopPropagation();l=l.timeStamp;l&&(0!==y&&10>l-y||0!==f&&10>l-f||0!==u&&10>l-u)||(p||(e("Note: Generating return keystroke from submit event on form, this browser probably doesn't generate keydown/beforeinput/input when enter/return is pressed on the on-screen keyboard"),p=!0),W(0,3,{eventType:0,absoluteCode:28,absoluteChar:10}))}),m=document.createElement("input"),m.type="password",m.value=" ",m.classList.add("_eaglercraftX_text_input_element"),m.setAttribute("autocomplete",
"off"),m.style.position="absolute",m.style.top="0px",m.style.left="0px",m.style.right="0px",m.style.bottom="0px",m.style.zIndex="-100",m.style.margin="0px",m.style.padding="0px",m.style.border="none",m.style.setProperty("-webkit-touch-callout","default"),m.addEventListener("beforeinput",function(l){if(m===l.target){z||(e("Note: Caught beforeinput event from on-screen keyboard, browser probably does not generate global keydown/keyup events on text fields, or does not respond to cancelling keydown"),
z=!0);var B=l.timeStamp;if(B){if(0!==y&&10>B-y)return;f=B}l.preventDefault();l.stopPropagation();switch(l.inputType){case "insertParagraph":case "insertLineBreak":W(0,3,{eventType:0,absoluteCode:28,absoluteChar:10});break;case "deleteWordBackward":case "deleteSoftLineBackward":case "deleteHardLineBackward":case "deleteEntireSoftLine":case "deleteContentBackward":case "deleteContent":W(0,3,{eventType:0,absoluteCode:14,absoluteChar:0});break;case "deleteWordForward":case "deleteSoftLineForward":case "deleteHardLineForward":case "deleteContentForward":W(0,
3,{eventType:0,absoluteCode:211,absoluteChar:0});break;case "insertText":case "insertCompositionText":case "insertReplacementText":(l=l.data)&&0<l.length&&W(0,3,{eventType:1,codepoints:l});break;case "insertFromPaste":case "insertFromPasteAsQuotation":case "insertFromDrop":case "insertFromYank":case "insertLink":(l=l.data)&&0<l.length&&W(0,4,l);break;case "historyUndo":case "historyRedo":case "deleteByDrag":case "deleteByCut":break;default:e('Ignoring InputEvent.inputType "{}" from on-screen keyboard',
l.inputType)}}}),m.addEventListener("input",function(l){if(m===l.target){q||(e("Note: Caught legacy input events from on-screen keyboard, browser could be outdated and doesn't support beforeinput event, or does not respond to cancelling beforeinput"),q=!0);if(l=l.timeStamp){if(0!==y&&10>l-y||0!==f&&10>l-f)return;u=l}l=m.value;var B=l.length;0===B?W(0,3,{eventType:0,absoluteCode:14,absoluteChar:0}):1===B?W(0,3,{eventType:1,codepoints:l}):(l=l.trim(),B=l.length,0===B?W(0,3,{eventType:0,absoluteCode:57,
absoluteChar:32}):W(0,3,{eventType:1,codepoints:l.charAt(B-1)}));m.value=" ";m.setSelectionRange(1,1)}}),m.addEventListener("focus",function(l){m===l.target&&(m.value=" ",m.setSelectionRange(1,1))}),m.addEventListener("select",function(l){m===l.target&&(l.preventDefault(),l.stopPropagation(),m.value=" ",m.setSelectionRange(1,1))}),t.appendChild(m),S.appendChild(t),m.value=" ",m.focus(),m.select(),m.setSelectionRange(1,1))}function w(){if(m){m.blur();m.value="";const l=m,B=t;window.setTimeout(function(){null!==
B?(B.removeChild(l),B.remove()):l.remove()},10);t=m=null}else t&&(S?S.removeChild(t):t.remove(),t=null)}function C(){return!!m&&document.activeElement===m}var E=null,P=0,Q=0,t=null,m=null,z=!1,q=!1,p=!1,y=0,f=0,u=0,A=-1,F=-1,L=-1,Y=!1,U=-1,Z=-1,La=-1,gb=-1,Fa=!1,za=!1,Ma=!1,Wa=0,va=-1,ia=!1,n=null,r=!1,G=!1,M=-1,V=!1,ca=null,wa=null,Xa=null,rb=null,sb=null,tb=null,ub=null,vb=null,wb=null,xb=null,yb=null,zb=null,Ab=null,Bb=null,Cb=null,Db=null,Eb=null,Fb=null,Gb=null,Hb=null,Ib=null,Jb=null,Kb=null;
E=document.createElement("div");E.classList.add("_eaglercraftX_keyboard_open_zone");E.style.display="none";E.style.position="absolute";E.style.backgroundColor="transparent";E.style.top="0px";E.style.left="0px";E.style.width="0px";E.style.height="0px";E.style.zIndex="100";E.style.touchAction="pan-x pan-y";E.style.setProperty("-webkit-touch-callout","none");E.style.setProperty("-webkit-tap-highlight-color","rgba(255, 255, 255, 0)");S.appendChild(E);a();S.addEventListener("contextmenu",ca=function(l){l.target!==
Dc&&(l.preventDefault(),l.stopPropagation())});T.addEventListener("mousedown",wa=function(l){l.preventDefault();l.stopPropagation();Fa&&za&&document.pointerLockElement!==T?v(1):W(0,0,{eventType:0,posX:l.offsetX,posY:l.offsetY,button:l.button})});T.addEventListener("mouseup",Xa=function(l){l.preventDefault();l.stopPropagation();W(0,0,{eventType:1,posX:l.offsetX,posY:l.offsetY,button:l.button})});T.addEventListener("mousemove",rb=function(l){l.preventDefault();l.stopPropagation();W(0,0,{eventType:2,
posX:l.offsetX,posY:l.offsetY,movementX:l.movementX,movementY:l.movementY})});T.addEventListener("mouseenter",sb=function(){W(0,7,null)});T.addEventListener("mouseleave",tb=function(){W(0,8,null)});T.addEventListener("touchstart",ub=function(l){l.preventDefault();l.stopPropagation();W(0,2,{eventType:0,changedTouches:b(l.changedTouches),targetTouches:b(l.targetTouches)});w()});T.addEventListener("touchend",vb=function(l){l.preventDefault();l.stopPropagation();W(0,2,{eventType:2,changedTouches:b(l.changedTouches),
targetTouches:b(l.targetTouches)})});T.addEventListener("touchmove",wb=function(l){l.preventDefault();l.stopPropagation();W(0,2,{eventType:1,changedTouches:b(l.changedTouches),targetTouches:b(l.targetTouches)})});T.addEventListener("touchcancel",xb=function(l){W(0,2,{eventType:2,changedTouches:b(l.changedTouches),targetTouches:b(l.targetTouches)})});T.addEventListener("wheel",Fb=function(l){l.preventDefault();l.stopPropagation();W(0,0,{eventType:3,posX:l.offsetX,posY:l.offsetY,wheel:l.deltaY})});
window.addEventListener("blur",Hb=function(){W(0,6,null)});window.addEventListener("focus",Gb=function(){W(0,5,null)});window.addEventListener("keydown",Ab=function(l){Ec||(l.preventDefault(),l.stopPropagation());"F11"!==l.key||l.repeat?(W(0,1,d(l.repeat?2:0,l)),l.timeStamp&&"Unidentified"!==l.key&&(y=l.timeStamp)):I()});window.addEventListener("keyup",Bb=function(l){Ec||(l.preventDefault(),l.stopPropagation());W(0,1,d(1,l))});E.addEventListener("touchstart",Cb=function(l){l.preventDefault();l.stopPropagation()});
E.addEventListener("touchend",Db=function(l){l.preventDefault();l.stopPropagation();x()});E.addEventListener("touchmove",Eb=function(l){l.preventDefault();l.stopPropagation()});(Fa="function"===typeof document.exitPointerLock)?(document.addEventListener("pointerlockchange",Ib=function(){window.setTimeout(function(){const l=document.pointerLockElement===T;l||za&&(Wa=performance.now()|0);za=l},60);Ma=!1}),document.addEventListener("pointerlockerror",Jb=function(){Ma=!1})):k("Pointer lock is not supported on this browser");
(ia="function"===typeof document.exitFullscreen)?(n=window.matchMedia("(display-mode: fullscreen)"),(r=!(!navigator.keyboard||!navigator.keyboard.lock))&&n.addEventListener("change",Kb=function(){n.matches||navigator.keyboard.unlock()})):k("Fullscreen is not supported on this browser");if("undefined"!==typeof window.visualViewport)if("body"===Sa.tagName.toLowerCase())Y=!0;else{const l=document.body;10>=Math.abs(l.clientWidth-S.clientWidth)&&10>=Math.abs(l.clientHeight-S.clientHeight)&&(Y=!0)}else Y=
!1;Y&&e("Note: Detected game is embedded in body, some screens may be resized to window.visualViewport instead for a better mobile experience");try{await c(),G=!0}catch(l){G=!1}G||k("VSync is not supported on this browser");(V="function"===typeof navigator.getGamepads)?(window.addEventListener("gamepadconnected",yb=function(){W(0,10,{eventType:0})}),window.addEventListener("gamepaddisconnected",zb=function(l){W(0,10,{eventType:1,gamepad:l.gamepad})})):k("Gamepad detected as unsupported!");J.keyboardLayoutSupported=
function(){return!(!navigator.keyboard||!navigator.keyboard.getLayoutMap)};J.iterateKeyboardLayout=new WebAssembly.Suspending(async function(){const l=[];try{const B=await navigator.keyboard.getLayoutMap();B&&B.forEach&&B.forEach(function(X,R){l.push({key:X,value:R})})}catch(B){}return l});J.updateCanvasSize=function(l,B){T.width!==l&&(T.width=l);T.height!==B&&(T.height=B)};var ha=0;J.updatePlatformAndSleep=new WebAssembly.Suspending(function(l,B){a();if("string"!==typeof document.visibilityState||
"visible"===document.visibilityState)return G&&B?(ha=0,c()):0>=l?(ha=0,ob?Cc(0):Bc()):h(l);ha=0;return g(50)});J.isVSyncSupported=function(){return G};J.mouseSetGrabbed=v;J.isMouseGrabSupported=function(){return Fa};J.isMouseGrabbed=function(){return za};J.isPointerLocked=function(){return Fa&&(Ma||document.pointerLockElement===T)};J.supportsFullscreen=function(){return ia};J.toggleFullscreen=I;J.isFullscreen=function(){return ia&&n.matches};J.touchSetOpenKeyboardZone=function(l,B,X,R){0!==X&&0!==
R?(E.style.display="block",E.style.top=""+(F-B-R)/L+"px",E.style.left=""+l/L+"px",E.style.width=""+X/L+"px",E.style.height=""+R/L+"px"):(E.style.display="none",E.style.top="0px",E.style.left="0px",E.style.width="0px",E.style.height="0px")};J.touchCloseDeviceKeyboard=w;J.touchIsDeviceKeyboardOpenMAYBE=C;J.gamepadSupported=function(){return V};J.isVisualViewport=function(){return Y};db=function(){try{ca&&(S.removeEventListener("contextmenu",ca),ca=null),wa&&(T.removeEventListener("mousedown",wa),wa=
null),Xa&&(T.removeEventListener("mouseup",Xa),Xa=null),rb&&(T.removeEventListener("mousemove",rb),rb=null),sb&&(T.removeEventListener("mouseenter",sb),sb=null),tb&&(T.removeEventListener("mouseleave",tb),tb=null),ub&&(T.removeEventListener("touchstart",ub),ub=null),vb&&(T.removeEventListener("touchend",vb),vb=null),wb&&(T.removeEventListener("touchmove",wb),wb=null),xb&&(T.removeEventListener("touchcancel",xb),xb=null),yb&&(window.removeEventListener("gamepadconnected",yb),yb=null),zb&&(window.removeEventListener("gamepaddisconnected",
zb),zb=null),Ab&&(window.removeEventListener("keydown",Ab),Ab=null),Bb&&(window.removeEventListener("keyup",Bb),Bb=null),Cb&&(E.removeEventListener("touchstart",Cb),Cb=null),Db&&(E.removeEventListener("touchend",Db),Db=null),Eb&&(E.removeEventListener("touchmove",Eb),Eb=null),Fb&&(T.removeEventListener("wheel",Fb),Fb=null),Gb&&(window.removeEventListener("focus",Gb),Gb=null),Hb&&(window.removeEventListener("blur",Hb),Hb=null),Ib&&(document.removeEventListener("pointerlockchange",Ib),Ib=null),Jb&&
(document.removeEventListener("pointerlockerror",Jb),Jb=null),Kb&&(n.removeEventListener("change",Kb),Kb=null)}catch(l){k("Failed to remove event listeners! {}",l)}db=null}};(function(){function a(){this._socket.close()}function b(f){this._socket.send(f)}function d(f){this._socket.send(f)}function c(){return this._frameCountStr+this._frameCountBin}function g(){const f=this._queue;return f?(f._next===f&&f._prev===f?this._queue=null:(this._queue=f._next,f._prev._next=f._next,f._next._prev=f._prev),f._next=null,f._prev=null,0===f.type?--this._frameCountStr:--this._frameCountBin,f):null}function h(){var f=this._frameCountStr+this._frameCountBin;if(0===f)return null;f=Array(f);
var u=0,A=this._queue;const F=A;do{f[u++]=A;var L=A._next;A._next=null;A._prev=null;A=L}while(A!==F);this._queue=null;this._frameCountBin=this._frameCountStr=0;return f}function v(){this._queue=null;this._frameCountBin=this._frameCountStr=0}function I(f,u){var A=f._queue;if(!A)return null;const F=A;do{var L=A._next;if(A.type===u)return u=A._prev,L===A&&u===A?f._queue=null:(A===F&&(f._queue=L),u._next=L,L._prev=u),A._next=null,A._prev=null,A;A=L}while(A!==F);return null}function x(f,u,A){var F=0,L=
f._queue,Y=L;do{var U=L._next;L.type===u&&(A[F++]=L);L=U}while(L!==Y);A.length=F;for(Y=0;Y<F;++Y)L=A[Y],U=L._next,u=L._prev,U===L&&u===L?f._queue=null:(L===f._queue&&(f._queue=U),u._next=U,U._prev=u)}function w(){return this._frameCountStr}function C(){if(0===this._frameCountStr)return null;const f=I(this,0);f?--this._frameCountStr:this._frameCountStr=0;return f}function E(){var f=this._frameCountStr;if(0===f)return null;f=Array(f);x(this,0,f);this._frameCountStr=0;return f}function P(){const f=this._frameCountStr;
if(0===f)return null;x(this,0,Array(f));this._frameCountStr=0}function Q(){return this._frameCountBin}function t(){if(0===this._frameCountBin)return null;const f=I(this,1);f?--this._frameCountBin:this._frameCountBin=0;return f}function m(){var f=this._frameCountBin;if(0===f)return null;f=Array(f);x(this,1,f);this._frameCountBin=0;return f}function z(){const f=this._frameCountBin;if(0===f)return null;x(this,1,Array(f));this._frameCountBin=0}function q(f){this._enableStringFrames=f}function p(f){this._enableBinaryFrames=
f}function y(f){const u="string"===typeof f;if(u){if(!this._enableStringFrames)return}else if(!this._enableBinaryFrames)return;f={type:u?0:1,data:f,timestamp:performance.now(),_next:null,_prev:null};const A=this._queue;if(A){const F=A._prev;F._next=f;f._prev=F;f._next=A;A._prev=f}else this._queue=f,f._next=f,f._prev=f;u?++this._frameCountStr:++this._frameCountBin}ya.createWebSocketHandle=function(f){let u;try{u=new WebSocket(f)}catch(F){return k("Failed to create WebSocket: {}",f),la("Exception Caught",
F),null}u.binaryType="arraybuffer";const A={state:1,_socket:u,_queue:null,_frameCountStr:0,_frameCountBin:0,_addRecievedFrame:y,_enableStringFrames:!0,_enableBinaryFrames:!0,closeSocket:a,sendStringFrame:b,sendBinaryFrame:d,availableFrames:c,getNextFrame:g,getAllFrames:h,clearFrames:v,availableStringFrames:w,getNextStringFrame:C,getAllStringFrames:E,clearStringFrames:P,availableBinaryFrames:Q,getNextBinaryFrame:t,getAllBinaryFrames:m,clearBinaryFrames:z,setEnableStringFrames:q,setEnableBinaryFrames:p};
u.addEventListener("open",function(){A.state=2});u.addEventListener("message",function(F){A._addRecievedFrame(F.data)});u.addEventListener("close",function(){3!==A.state&&(A.state=0)});u.addEventListener("error",function(){1===A.state&&(A.state=3)});return A}})();function Xb(a,b){var d=nb;const c=d&&200===b?a.getExtension("OES_vertex_array_object"):null,g=d&&200===b?a.getExtension("ANGLE_instanced_arrays"):null,h=d&&200===b&&null!==g,v=d&&(310===b||300===b)&&null!==a.getExtension("EXT_color_buffer_float"),I=d&&!v&&(310===b||300===b||200===b)&&null!==a.getExtension("EXT_color_buffer_half_float"),x=d&&200===b&&null!==a.getExtension("EXT_shader_texture_lod"),w=d&&200===b&&null!==a.getExtension("OES_fbo_render_mipmap"),C=d&&200===b&&null!==c,E=d&&200===b&&null!==
a.getExtension("OES_texture_float"),P=d&&300<=b&&null!==a.getExtension("OES_texture_float_linear"),Q=d&&200===b&&null!==a.getExtension("OES_texture_half_float"),t=d&&200===b&&null!==a.getExtension("OES_texture_half_float_linear");d=d&&null!==a.getExtension("EXT_texture_filter_anisotropic");const m=null!==a.getExtension("WEBGL_debug_renderer_info"),z=300<=b?0:200===b&&C?1:-1,q=300<=b?0:200===b&&h?1:-1,p=[b,z,q,0,0];if(300<=b||w)p[3]|=4;if(300<=b||x)p[3]|=8;300<=b&&(p[3]|=16);(320<=b||(300<=b||E)&&
(v||I))&&(p[3]|=32);(320<=b||(300<=b||Q)&&v)&&(p[3]|=64);d&&(p[3]|=128);(300<=b||t)&&(p[4]|=1);300<=b&&P&&(p[4]|=2);K.getCapBits=function(f){return p[f]};K.glEnable=a.enable.bind(a);K.glDisable=a.disable.bind(a);K.glClearColor=a.clearColor.bind(a);K.glClearDepth=a.clearDepth.bind(a);K.glClear=a.clear.bind(a);K.glDepthFunc=a.depthFunc.bind(a);K.glDepthMask=a.depthMask.bind(a);K.glCullFace=a.cullFace.bind(a);K.glViewport=a.viewport.bind(a);K.glBlendFunc=a.blendFunc.bind(a);K.glBlendFuncSeparate=a.blendFuncSeparate.bind(a);
K.glBlendEquation=a.blendEquation.bind(a);K.glBlendColor=a.blendColor.bind(a);K.glColorMask=a.colorMask.bind(a);K.glDrawBuffers=300<=b?a.drawBuffers.bind(a):na("glDrawBuffers");K.glReadBuffer=300<=b?a.readBuffer.bind(a):na("glReadBuffer");K.glReadPixels=a.readPixels.bind(a);K.glPolygonOffset=a.polygonOffset.bind(a);K.glLineWidth=a.lineWidth.bind(a);K.glGenBuffers=a.createBuffer.bind(a);K.glGenTextures=a.createTexture.bind(a);K.glCreateProgram=a.createProgram.bind(a);K.glCreateShader=a.createShader.bind(a);
K.glCreateFramebuffer=a.createFramebuffer.bind(a);K.glCreateRenderbuffer=a.createRenderbuffer.bind(a);K.glGenQueries=300<=b?a.createQuery.bind(a):na("glGenQueries");K.glDeleteBuffers=a.deleteBuffer.bind(a);K.glDeleteTextures=a.deleteTexture.bind(a);K.glDeleteProgram=a.deleteProgram.bind(a);K.glDeleteShader=a.deleteShader.bind(a);K.glDeleteFramebuffer=a.deleteFramebuffer.bind(a);K.glDeleteRenderbuffer=a.deleteRenderbuffer.bind(a);K.glDeleteQueries=300<=b?a.deleteQuery.bind(a):na("glDeleteQueries");
K.glBindBuffer=a.bindBuffer.bind(a);K.glBufferData=a.bufferData.bind(a);K.glBufferSubData=a.bufferSubData.bind(a);K.glEnableVertexAttribArray=a.enableVertexAttribArray.bind(a);K.glDisableVertexAttribArray=a.disableVertexAttribArray.bind(a);K.glVertexAttribPointer=a.vertexAttribPointer.bind(a);K.glActiveTexture=a.activeTexture.bind(a);K.glBindTexture=a.bindTexture.bind(a);K.glTexParameterf=a.texParameterf.bind(a);K.glTexParameteri=a.texParameteri.bind(a);K.glTexImage3D=300<=b?a.texImage3D.bind(a):
na("glTexImage3D");K.glTexImage2D=a.texImage2D.bind(a);K.glTexSubImage2D=a.texSubImage2D.bind(a);K.glCopyTexSubImage2D=a.copyTexSubImage2D.bind(a);K.glTexStorage2D=300<=b?a.texStorage2D.bind(a):na("glTexStorage2D");K.glPixelStorei=a.pixelStorei.bind(a);K.glGenerateMipmap=a.generateMipmap.bind(a);K.glShaderSource=a.shaderSource.bind(a);K.glCompileShader=a.compileShader.bind(a);K.glGetShaderi=a.getShaderParameter.bind(a);K.glGetShaderInfoLog=a.getShaderInfoLog.bind(a);K.glUseProgram=a.useProgram.bind(a);
K.glAttachShader=a.attachShader.bind(a);K.glDetachShader=a.detachShader.bind(a);K.glLinkProgram=a.linkProgram.bind(a);K.glGetProgrami=a.getProgramParameter.bind(a);K.glGetProgramInfoLog=a.getProgramInfoLog.bind(a);K.glDrawArrays=a.drawArrays.bind(a);K.glDrawElements=a.drawElements.bind(a);K.glBindAttribLocation=a.bindAttribLocation.bind(a);K.glGetAttribLocation=a.getAttribLocation.bind(a);K.glGetUniformLocation=a.getUniformLocation.bind(a);K.glGetUniformBlockIndex=300<=b?a.getUniformBlockIndex.bind(a):
na("glGetUniformBlockIndex");K.glBindBufferRange=300<=b?a.bindBufferRange.bind(a):na("glBindBufferRange");K.glUniformBlockBinding=300<=b?a.uniformBlockBinding.bind(a):na("glUniformBlockBinding");K.glUniform1f=a.uniform1f.bind(a);K.glUniform2f=a.uniform2f.bind(a);K.glUniform3f=a.uniform3f.bind(a);K.glUniform4f=a.uniform4f.bind(a);K.glUniform1i=a.uniform1i.bind(a);K.glUniform2i=a.uniform2i.bind(a);K.glUniform3i=a.uniform3i.bind(a);K.glUniform4i=a.uniform4i.bind(a);K.glUniformMatrix2fv=a.uniformMatrix2fv.bind(a);
K.glUniformMatrix3fv=a.uniformMatrix3fv.bind(a);K.glUniformMatrix4fv=a.uniformMatrix4fv.bind(a);K.glUniformMatrix3x2fv=300<=b?a.uniformMatrix3x2fv.bind(a):na("glUniformMatrix3x2fv");K.glUniformMatrix4x2fv=300<=b?a.uniformMatrix4x2fv.bind(a):na("glUniformMatrix4x2fv");K.glUniformMatrix4x3fv=300<=b?a.uniformMatrix4x3fv.bind(a):na("glUniformMatrix4x3fv");K.glBindFramebuffer=a.bindFramebuffer.bind(a);K.glCheckFramebufferStatus=a.checkFramebufferStatus.bind(a);K.glBlitFramebuffer=300<=b?a.blitFramebuffer.bind(a):
na("glBlitFramebuffer");K.glRenderbufferStorage=a.renderbufferStorage.bind(a);K.glFramebufferTexture2D=a.framebufferTexture2D.bind(a);K.glFramebufferTextureLayer=300<=b?a.framebufferTextureLayer.bind(a):na("glFramebufferTextureLayer");K.glBindRenderbuffer=a.bindRenderbuffer.bind(a);K.glFramebufferRenderbuffer=a.framebufferRenderbuffer.bind(a);K.glGetError=a.getError.bind(a);K.getAllExtensions=a.getSupportedExtensions.bind(a);K.isContextLost=a.isContextLost.bind(a);const y=[];h&&y.push("ANGLE_instanced_arrays");
v&&y.push("EXT_color_buffer_float");I&&y.push("EXT_color_buffer_half_float");x&&y.push("EXT_shader_texture_lod");w&&y.push("OES_fbo_render_mipmap");C&&y.push("OES_vertex_array_object");E&&y.push("OES_texture_float");P&&y.push("OES_texture_float_linear");Q&&y.push("OES_texture_half_float");t&&y.push("OES_texture_half_float_linear");d&&y.push("EXT_texture_filter_anisotropic");m&&y.push("WEBGL_debug_renderer_info");K.dumpActiveExtensions=function(){return y};K.glGetInteger=function(f){f=a.getParameter(f);
return"number"===typeof f?f:0};K.glGetString=function(f){if(m)switch(f){case 7936:f=a.getParameter(37445);null==f&&(f=a.getParameter(7936));break;case 7937:f=a.getParameter(37446);null==f&&(f=a.getParameter(7937));break;default:f=a.getParameter(f)}else f=a.getParameter(f);return"string"===typeof f?f:null};switch(z){case 0:K.glGenVertexArrays=a.createVertexArray.bind(a);K.glDeleteVertexArrays=a.deleteVertexArray.bind(a);K.glBindVertexArray=a.bindVertexArray.bind(a);break;case 1:K.glGenVertexArrays=
c.createVertexArrayOES.bind(c);K.glDeleteVertexArrays=c.deleteVertexArrayOES.bind(c);K.glBindVertexArray=c.bindVertexArrayOES.bind(c);break;default:D(K,"glGenVertexArrays"),D(K,"glDeleteVertexArrays"),D(K,"glBindVertexArray")}switch(q){case 0:K.glVertexAttribDivisor=a.vertexAttribDivisor.bind(a);K.glDrawArraysInstanced=a.drawArraysInstanced.bind(a);K.glDrawElementsInstanced=a.drawElementsInstanced.bind(a);break;case 1:K.glVertexAttribDivisor=g.vertexAttribDivisorANGLE.bind(g);K.glDrawArraysInstanced=
g.drawArraysInstancedANGLE.bind(g);K.glDrawElementsInstanced=g.drawElementsInstancedANGLE.bind(g);break;default:D(K,"glVertexAttribDivisor"),D(K,"glDrawArraysInstanced"),D(K,"glDrawElementsInstanced")}};var Ac=!1;const Fc=new MessageChannel;var Gc=null;Fc.port2.addEventListener("message",function(){Gc()});async function Mb(){Fc.port1.start();Fc.port2.start();Gc=function(){Gc=null};Fc.port1.postMessage(0);Gc?await new Promise(function(a){setTimeout(function(){Gc?k("Immediate continue hack is not supported"):Ac=!0;a()},25)}):k("Immediate continue hack is not supported")}Aa.getRootElement=function(){return Sa};Aa.getParentElement=function(){return S};Aa.getCanvasElement=function(){return T};
Aa.getEaglercraftXOpts=function(){return O};Aa.getEventCount=ac.K.bind(ac);Aa.getNextEvent=ac.j.bind(ac);
Aa.queueAsyncDownload=function(a,b,d){try{fetch(a,{cache:b?"force-cache":"no-store",mode:"cors"}).then(function(c){return c.arrayBuffer()}).then(function(c){W(1,0,{requestId:d,arrayBuffer:c})}).catch(function(c){k("Failed to complete async download: {}",a);la("Exception Caught",c);W(1,0,{requestId:d,arrayBuffer:null})})}catch(c){k("Failed to fetch: {}",a),la("Exception Caught",c),W(1,0,{requestId:d,arrayBuffer:null})}};
Aa.download=new WebAssembly.Suspending(function(a,b){return new Promise(function(d){try{fetch(a,{cache:b?"force-cache":"no-store",mode:"cors"}).then(function(c){return c.arrayBuffer()}).then(function(c){d(c)}).catch(function(c){k("Failed to complete download: {}",a);la("Exception Caught",c);d(null)})}catch(c){k("Failed to fetch: {}",a),la("Exception Caught",c),d(null)}})});Aa.writeCrashReport=function(a){dc(a,!1)};Aa.steadyTimeMillis=performance.now.bind(performance);
function Cc(a){return new Promise(function(b){setTimeout(b,a)})}Aa.sleep=new WebAssembly.Suspending(Cc);function Hc(a){Ac?(Gc=a,Fc.port1.postMessage(0)):setTimeout(a,0)}function Bc(){return new Promise(Hc)}Aa.immediateContinue=new WebAssembly.Suspending(Bc);Aa.immediateContinueSupported=function(){return Ac};Aa.setCrashReportString=function(a,b){cb[a]=b};var Ic="undefined"!==typeof window,Jc=null,Kc=[],Lc=[],Mc="video/webm",Nc=!1,Oc=null,Pc=15E3;
function Qc(){return new Promise(function(a){if("navigator"in window&&"mediaDevices"in window.navigator&&"getUserMedia"in window.navigator.mediaDevices)try{window.navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(function(b){a(b)}).catch(function(b){k("getUserMedia Error! (async)");la("Exception Caught",b);a(null)})}catch(b){k("getUserMedia Error!"),a(null)}else k("No getUserMedia!"),a(null)})}async function Rc(){return Ic?null===Jc&&(Jc=await Qc(),null===Jc)?(Ic=!1,null):Jc:null}
function Ob(){function a(b){const d=new Date;return b.replace("${date}",d.getFullYear()+"-"+("0"+(d.getMonth()+1)).slice(-2)+"-"+("0"+d.getDate()).slice(-2)+" "+("0"+d.getHours()).slice(-2)+"-"+("0"+d.getMinutes()).slice(-2)+"-"+("0"+d.getSeconds()).slice(-2))}Ba.getMic=new WebAssembly.Suspending(Rc);Ba.setDataAvailableHandler=function(b,d,c){const g=performance.now();b.addEventListener("dataavailable",function(h){if(d)Sc(h.data,performance.now()-g|0,function(v){const I=URL.createObjectURL(v);mc(a(c),
I,function(){URL.revokeObjectURL(I)})},{U:function(v){e(v)}});else{const v=URL.createObjectURL(h.data);mc(a(c),v,function(){URL.revokeObjectURL(v)})}})};Ba.setClipDataHandler=function(b,d){function c(){Oc&&clearTimeout(Oc);Oc=setTimeout(function(){Oc=null;Nc&&"recording"===b.state&&b.stop()},Pc)}Kc=[];Lc=[];Mc=b.mimeType||"video/webm";Nc=!0;Pc=Math.max(5E3,250*d);b.addEventListener("dataavailable",function(g){g&&g.data&&0<g.data.size&&(Lc.push(g.data),b.mimeType&&(Mc=b.mimeType))});b.addEventListener("stop",
function(){if(0<Lc.length){var g=new Blob(Lc,{type:Mc});if(0<g.size)for(Kc.push(g);5<Kc.length;)Kc.shift();Lc=[]}Nc&&setTimeout(function(){if(Nc)try{b.start(),c()}catch(h){Nc=!1}},50)});c()};Ba.stopClipDataHandler=function(){Nc=!1;Oc&&(clearTimeout(Oc),Oc=null)};Ba.resetClipData=function(){Nc=!1;Oc&&(clearTimeout(Oc),Oc=null);Kc=[];Lc=[];Mc="video/webm"};Ba.getClipChunkCount=function(){return Lc.length+Kc.length};Ba.exportClip=function(b,d,c,g){Mc.startsWith("video/webm")&&".mp4"===g.slice(-4)&&(g=
g.slice(0,-4)+".webm");if(0<Lc.length&&(b=new Blob(0<d&&Lc.length>d+1?[Lc[0]].concat(Lc.slice(-d)):Lc,{type:Mc}),0<b.size)){var h=URL.createObjectURL(b);mc(g,h,function(){URL.revokeObjectURL(h)});return!0}if(0===Kc.length)return!1;b=Kc[Kc.length-1];h=URL.createObjectURL(b);mc(g,h,function(){URL.revokeObjectURL(h)});return!0}};function Pb(){function a(g){try{const h=JSON.parse(g);this._peerConnection.setRemoteDescription(h).then(()=>{h.hasOwnProperty("type")&&"offer"===h.type&&this._peerConnection.createAnswer().then(v=>{this._peerConnection.setLocalDescription(v).then(()=>{W(2,1,{objId:this.objId,data:JSON.stringify(v)})}).catch(I=>{k('Failed to set local description for "{}"! {}',this.objId,I.message);W(2,3,{objId:this.objId})})}).catch(v=>{k('Failed to create answer for "{}"! {}',this.objId,v.message);W(2,3,{objId:this.objId})})}).catch(v=>
{k('Failed to set remote description for "{}"! {}',this.objId,v.message);W(2,3,{objId:this.objId})})}catch(h){k(h.message),W(2,3,{objId:this.objId})}}function b(g){try{this._peerConnection.addIceCandidate(new RTCIceCandidate(JSON.parse(g))).catch(h=>{k('Failed to parse ice candidate for "{}"! {}',this.objId,h.message);W(2,3,{objId:this.objId})})}catch(h){k(h.message),W(2,3,{objId:this.objId})}}function d(){this._peerConnection.close()}Ca.isSupported=function(){return"undefined"!==typeof navigator.mediaDevices&&
"undefined"!==typeof navigator.mediaDevices.getUserMedia&&"srcObject"in HTMLAudioElement.prototype};let c=0;Ca.createRTCPeerConnection=function(g,h,v){try{const x=c++;var I;const w=new RTCPeerConnection({iceServers:JSON.parse(g),optional:[{DtlsSrtpKeyAgreement:!0}]});w.addEventListener("icecandidate",C=>{C.candidate&&W(2,0,{objId:x,data:JSON.stringify({sdpMLineIndex:""+C.candidate.sdpMLineIndex,candidate:C.candidate.candidate})})});w.addEventListener("track",C=>{C=C.streams[0];I._aud=document.createElement("audio");
I._aud.autoplay=!0;I._aud.muted=!0;I._aud.srcObject=C;W(2,2,{objId:x,stream:C})});v.getTracks().forEach(function(C){w.addTrack(C,v)});h&&w.createOffer().then(C=>{w.setLocalDescription(C).then(()=>{W(2,1,{objId:x,data:JSON.stringify(C)})}).catch(E=>{k('Failed to set local description for "{}"! {}',x,E.message);W(2,3,{objId:x})})}).catch(C=>{k('Failed to set create offer for "{}"! {}',x,C.message);W(2,3,{objId:x})});w.addEventListener("connectionstatechange",()=>{const C=w.connectionState;"disconnected"!==
C&&"failed"!==C||W(2,3,{objId:x})});return I={objId:x,_peerConnection:w,setRemoteDescription:a,addRemoteICECandidate:b,closeHandle:d}}catch(x){return k(x.message),null}}};function Qb(){const a=new ra;let b;b={iceServers:[],g:null,h:null,readyState:1,v:null,description:null,D:!1,C:!0,disconnect:function(c){if(b.h){try{b.h.close()}catch(g){}b.h=null}if(b.g){try{b.g.close()}catch(g){}b.g=null}c||(b.C=!0);b.readyState=0}};N.supported=function(){return"undefined"!==typeof RTCPeerConnection};N.clientLANReadyState=function(){return b.readyState};N.clientLANCloseConnection=function(){b.disconnect(!1)};N.clientLANSendPacket=function(c){if(null!==b.h&&"open"===b.h.readyState)try{b.h.send(c)}catch(g){b.disconnect(!1)}else b.disconnect(!1)};
N.clientLANReadPacket=function(){const c=a.j();return c?new Uint8Array(c.data):null};N.clientLANAvailable=function(){return a.u};N.clientLANSetICEServersAndConnect=function(c){b.iceServers.length=0;for(let g of c)c=g.split(";"),1===c.length?b.iceServers.push({urls:c[0]}):3===c.length&&b.iceServers.push({urls:c[0],username:c[1],credential:c[2]});2!==b.readyState&&1!==b.readyState||b.disconnect(!0);try{if(b.h){try{b.h.close()}catch(g){}b.h=null}if(b.g)try{b.g.close()}catch(g){}b.g=new RTCPeerConnection({iceServers:b.iceServers,
optional:[{DtlsSrtpKeyAgreement:!0}]});b.readyState=1}catch(g){la("Could not create LAN client RTCPeerConnection!",g);b.readyState=-2;return}try{const g=[];b.g.addEventListener("icecandidate",v=>{if(v.candidate){if(0===g.length){const I=[0,0],x=()=>{if(null!==b.g&&"disconnected"!==b.g.connectionState){const w=++I[1];I[0]!==g.length&&3>w?(I[0]=g.length,setTimeout(x,2E3)):(b.v=JSON.stringify(g),g.length=0)}};setTimeout(x,2E3)}g.push({sdpMLineIndex:v.candidate.sdpMLineIndex,candidate:v.candidate.candidate})}});
b.h=b.g.createDataChannel("lan");b.h.binaryType="arraybuffer";let h;h=()=>{0<g.length?setTimeout(h,10):(b.C=!1,b.D=!0)};b.h.addEventListener("open",h);b.h.addEventListener("message",v=>{a.push({data:v.data,_next:null})});b.g.createOffer().then(v=>{b.g.setLocalDescription(v).then(()=>{b.description=JSON.stringify(v)}).catch(I=>{k("Failed to set local description! {}",I.message);b.readyState=-1;b.disconnect(!1)})}).catch(v=>{k("Failed to set create offer! {}",v.message);b.readyState=-1;b.disconnect(!1)});
b.g.addEventListener("connectionstatechange",()=>{var v=b.g.connectionState;"disconnected"===v?b.disconnect(!1):"connected"===v?b.readyState=2:"failed"===v&&(b.readyState=-1,b.disconnect(!1))})}catch(g){if(b.h){try{b.h.close()}catch(h){}b.h=null}if(b.g){try{b.g.close()}catch(h){}b.g=null}la("Could not create LAN client RTCDataChannel!",g);b.readyState=-2}};N.clearLANClientState=function(){b.v=b.description=null;b.D=!1;b.C=!0};N.clientLANAwaitICECandidate=function(){if(null===b.v)return null;const c=
b.v;b.v=null;return c};N.clientLANAwaitDescription=function(){if(null===b.description)return null;const c=b.description;b.description=null;return c};N.clientLANAwaitChannel=function(){return b.D?(b.D=!1,!0):!1};N.clientLANClosed=function(){return b.C};N.clientLANSetICECandidate=function(c){try{const g=JSON.parse(c);for(c=0;c<g.length;++c)b.g.addIceCandidate(new RTCIceCandidate(g[c]))}catch(g){la("Uncaught exception setting remote ICE candidates",g),b.readyState=-1,b.disconnect(!1)}};N.clientLANSetDescription=
function(c){try{b.g.setRemoteDescription(JSON.parse(c))}catch(g){la("Uncaught exception setting remote description",g),b.readyState=-1,b.disconnect(!1)}};let d;d={iceServers:[],A:new Map,F:new Map,disconnect:function(c){const g=d.A.get(c);if(g){d.A.delete(c);g.l&&d.F.delete(g.l);try{g.disconnect()}catch(h){}g.s(4,null)}}};N.serverLANInitializeServer=function(c){d.iceServers.length=0;for(let g of c)c=g.split(";"),1===c.length?d.iceServers.push({urls:c[0]}):3===c.length&&d.iceServers.push({urls:c[0],
username:c[1],credential:c[2]})};N.serverLANCloseServer=function(){for(let c of Object.values(d.A))if(c){try{c.disconnect()}catch(g){}c.s(4,null)}d.A.clear()};N.serverLANCreatePeer=function(c){try{const g=new ra;let h;h={i:c,g:new RTCPeerConnection({iceServers:d.iceServers,optional:[{DtlsSrtpKeyAgreement:!0}]}),h:null,l:null,s:function(x,w){g.push({type:x,data:w,_next:null})},disconnect:function(){h.h&&h.h.close();h.g.close()}};d.A.set(h.i,h);const v=[];h.g.addEventListener("icecandidate",x=>{if(x.candidate){if(0===
v.length){const w=[0,0],C=()=>{if(null!==h.g&&"disconnected"!==h.g.connectionState){const E=++w[1];w[0]!==v.length&&3>E?(w[0]=v.length,setTimeout(C,2E3)):(h.s(0,JSON.stringify(v)),v.length=0)}};setTimeout(C,2E3)}v.push({sdpMLineIndex:x.candidate.sdpMLineIndex,candidate:x.candidate.candidate})}});let I;I=x=>{0<v.length?setTimeout(I,10,x):x.channel&&(x=x.channel,null!==h.h?x.close():(h.h=x,h.s(2,null),h.h.addEventListener("message",w=>{w=w.data;h.l?ab(h.l,w):h.s(3,new Uint8Array(w))})))};h.g.addEventListener("datachannel",
I);h.g.addEventListener("connectionstatechange",()=>{const x=h.g.connectionState;"disconnected"!==x&&"failed"!==x||d.disconnect(h.i)});return{peerId:h.i,countAvailableEvents:function(){return g.u},nextEvent:function(){return g.j()},writePacket:function(x){let w=!1;if(null!==h.h&&"open"===h.h.readyState)try{h.h.send(x)}catch(C){w=!0}else w=!0;w&&d.disconnect(h.i)},handleRemoteICECandidates:function(x){try{const w=JSON.parse(x);for(let C of w)h.g.addIceCandidate(new RTCIceCandidate(C))}catch(w){k('Failed to parse ice candidate for "{}"! {}',
h.i,w.message),d.disconnect(h.i)}},handleRemoteDescription:function(x){try{const w=JSON.parse(x);h.g.setRemoteDescription(w).then(()=>{w.hasOwnProperty("type")&&"offer"===w.type&&h.g.createAnswer().then(C=>{h.g.setLocalDescription(C).then(()=>{h.s(1,JSON.stringify(C))}).catch(E=>{k('Failed to set local description for "{}"! {}',h.i,E.message);d.disconnect(h.i)})}).catch(C=>{k('Failed to create answer for "{}"! {}',h.i,C.message);d.disconnect(h.i)})}).catch(C=>{k('Failed to set remote description for "{}"! {}',
h.i,C.message);d.disconnect(h.i)})}catch(w){k('Failed to parse remote description for "{}"! {}',h.i,w.message),d.disconnect(h.i)}},mapIPC:function(x){h.l?x||(d.F.delete(h.l),h.l=null):x&&(h.l=x,d.F.set(x,h))},disconnect:function(){d.disconnect(h.i)}}}catch(g){return la("Failed to create WebRTC LAN peer!",g),null}};$a=function(c,g){if(c=d.F.get(c)){let h=!1;if(c.h&&"open"===c.h.readyState)try{c.h.send(g)}catch(v){h=!0}else h=!0;h&&d.disconnect(c.i);return!0}return!1}};function Rb(){function a(f,u){f.allow=u;return f.allow===u}function b(f,u){const A=f.sandbox;for(var F=0;F<u.length;++F)A.add(u[F]);for(F=0;F<u.length;++F)if(!A.contains(u[F]))return!1;for(F=0;F<A.length;++F)if(!u.find(L=>L===A[F]))return!1;return!0}function d(f){if(E)p=document.createElement("iframe"),p.allow="",p.referrerPolicy="strict-origin",p.sandbox.add("allow-downloads"),f.scriptEnabled&&(p.sandbox.add("allow-scripts"),p.sandbox.add("allow-pointer-lock"));else{p=document.createElement("iframe");
p.referrerPolicy="strict-origin";var u=["allow-downloads"];f.scriptEnabled&&(u.push("allow-scripts"),u.push("allow-pointer-lock"));if(!a(p,"")||!b(p,u)){k("Caught safety exception while opening webview!");null!==p&&(p.remove(),p=null);k("Things you can try:");k("1. Set window.eaglercraftXOpts.forceWebViewSupport to true");k("2. Set window.eaglercraftXOpts.enableWebViewCSP to false");k("(these settings may compromise security)");c();q.innerHTML='<div style="padding-top:13vh;"><h1 style="text-align:center;"><img width="48" height="48" style="vertical-align:middle;" src="'+
Qa+'">&emsp;IFrame Safety Error</h1><h4 style="text-align:center;">The content cannot be displayed safely!</h4><h4 style="text-align:center;">Check console for more details</h4></div>';return}}p.j=!0;p.o="lazy";u=!1;if(1===f.contentMode){if(P&&C)if("string"===typeof p.csp){var A="default-src 'none';",F=f.strictCSPEnable?"":t?" https:":" http: https:";A=f.scriptEnabled?A+(" script-src 'unsafe-eval' 'unsafe-inline' data: blob:"+F+"; style-src 'unsafe-eval' 'unsafe-inline' data: blob:")+(F+"; img-src data: blob:")+
(F+"; font-src data: blob:")+(F+"; child-src data: blob:")+(F+"; frame-src data: blob:; media-src data: mediastream: blob:")+(F+"; connect-src data: blob:")+(F+"; worker-src data: blob:")+(F+";"):A+(" style-src data: 'unsafe-inline'"+F+"; img-src data:")+(F+"; font-src data:")+(F+"; media-src data:")+(F+";");p.csp=A}else ka("This browser does not support CSP attribute on iframes! (try Chrome)"),u=!0;else u=!0;u&&f.strictCSPEnable&&ka("Strict CSP was requested for this webview, but that feature is not available!")}else u=
!0;p.style.border="none";p.style.backgroundColor="white";p.style.width="100%";p.style.height="100%";p.classList.add("_eaglercraftX_webview_iframe_element");z.appendChild(p);1===f.contentMode?(A=x.decode(f.blob),f.blob=null,p.srcdoc=A):p.src=f.uri;const L=m,Y=p;let U=!1;p.addEventListener("mouseover",function(){L!==m||Y!==p||U||(U=!0,p.contentWindow.focus())});p.addEventListener("mouseout",function(){L===m&&Y===p&&U&&(U=!1,window.focus())});f.scriptEnabled&&f.serverMessageAPIEnabled&&(y=function(Z){if(L===
m&&Y===p&&Z.source===Y.contentWindow){Z=Z.data;if("object"===typeof Z&&1===Z.ver&&"string"===typeof Z.channel&&0<Z.channel.length){if("boolean"===typeof Z.open){W(3,0,{eventType:Z.open?0:1,channelName:Z.channel});return}if("string"===typeof Z.data){W(3,1,{eventType:0,channelName:Z.channel,eventData:Z.data});return}if(Z.data instanceof ArrayBuffer){W(3,1,{eventType:1,channelName:Z.channel,eventData:Z.data});return}}ka("WebView sent an invalid message!")}else ka("Recieved message from on dead IFrame handler: (#{}) {}",
L,Y.src)});e('WebView is loading: "{}"',1===f.contentMode?"about:srcdoc":p.src);e("JavaScript: {}, Strict CSP: {}, Message API: {}",f.scriptEnabled,f.strictCSPEnable&&!u,f.serverMessageAPIEnabled)}function c(){null!==q&&(++m,q.remove(),q=null);q=document.createElement("div");q.style.backgroundColor="white";q.style.width="100%";q.style.height="100%";q.classList.add("_eaglercraftX_webview_permission_screen");z.appendChild(q)}function g(f){c();q.innerHTML='<div style="padding-top:13vh;"><div style="margin:auto;max-width:450px;border:6px double black;text-align:center;padding:20px;"><h2><img width="32" height="32" style="vertical-align:middle;" src="'+
Qa+'">&emsp;Allow JavaScript</h2><p style="font-family:monospace;text-decoration:underline;word-wrap:break-word;" class="_eaglercraftX_permission_target_url"></p><h4 style="line-height:1.4em;">Strict CSP: '+(1!==f.contentMode?'<span style="color:red;">Impossible</span>':C&&P?f.strictCSPEnable?'<span style="color:green;">Enabled</span>':'<span style="color:red;">Disabled</span>':'<span style="color:red;">Unsupported</span>')+"&ensp;|&ensp;Message API: "+(f.serverMessageAPIEnabled?'<span style="color:red;">Enabled</span>':
'<span style="color:green;">Disabled</span>')+'</h4><p><input class="_eaglercraftX_remember_javascript" type="checkbox" checked> Remember my choice</p><p><button style="font-size:1.5em;" class="_eaglercraftX_allow_javascript">Allow</button>&emsp;<button style="font-size:1.5em;" class="_eaglercraftX_block_javascript">Block</button></p></div></div>';const u=m;if(1!==f.contentMode){const A=f.url;q.querySelector("._eaglercraftX_permission_target_url").innerText=255<A.length()?A.substring(0,253)+"...":
A}q.querySelector("._eaglercraftX_allow_javascript").addEventListener("click",function(){if(m===u&&null!==q){const A=q.querySelector("._eaglercraftX_remember_javascript");null!==A&&A.checked&&W(3,2,null);q.remove();q=null;++m;d(f)}});q.querySelector("._eaglercraftX_block_javascript").addEventListener("click",function(){if(m===u&&null!==q){const A=q.querySelector("._eaglercraftX_remember_javascript");null!==A&&A.checked&&W(3,3,null);h(f)}})}function h(f){c();q.innerHTML='<div style="padding-top:13vh;"><h1 style="text-align:center;"><img width="48" height="48" style="vertical-align:middle;" src="'+
Qa+'">&emsp;Content Blocked</h1><h4 style="text-align:center;">You chose to block JavaScript execution for this embed</h4><p style="text-align:center;"><button style="font-size:1.0em;" class="_eaglercraftX_re_evaluate_javascript">Re-evaluate</button></p></div>';const u=m;q.querySelector("._eaglercraftX_re_evaluate_javascript").addEventListener("click",function(){m===u&&null!==q&&(W(3,4,null),g(f))})}function v(f,u,A,F){if(z){const L=window.devicePixelRatio;z.style.top=""+u/L+"px";z.style.left=""+
f/L+"px";z.style.width=""+(A/L-10)+"px";z.style.height=""+(F/L-10)+"px"}}function I(){++m;p&&(p.remove(),p=null);y=null;q&&(q.remove(),q=null);z&&(z.remove(),z=null);window.focus()}const x=new TextDecoder("utf-8");var w=!1,C=!1,E=ib,P=jb;if(E)C=w=!0;else{C=w=!1;try{var Q=document.createElement("iframe");w=null!=Q&&"string"===typeof Q.allow&&"object"===typeof Q.sandbox;C=P&&w&&"string"===typeof Q.csp}catch(f){k("Error checking iframe support"),k(f)}}w?!C&&P&&ka("This browser does not support CSP attribute on iframes! (try Chrome)"):
k("This browser does not meet the safety requirements for webview support, this feature will be disabled");const t=location.protocol&&"https:"===location.protocol.toLowerCase();var m=0,z=null,q=null,p=null,y=null;window.addEventListener("message",function(f){y&&f.source!==window&&y(f)});Da.checkSupported=function(){return w};Da.checkCSPSupported=function(){return C};Da.sendStringMessage=function(f,u){try{var A;null!=p&&null!=(A=p.contentWindow)?A.postMessage({ver:1,channel:f,type:"string",data:u},
"*"):k("Server tried to send the WebView a message, but the message channel is not open!")}catch(F){la("Failed to send string message to WebView!",F)}};Da.sendBinaryMessage=function(f,u){try{var A;if(null!=p&&null!=(A=p.contentWindow)){const F=new Uint8Array(u.length);F.set(u,0);A.postMessage({ver:1,channel:f,type:"binary",data:F.buffer},"*")}else k("Server tried to send the WebView a message, but the message channel is not open!")}catch(F){la("Failed to send string message to WebView!",F)}};Da.beginShowing=
function(f,u,A,F,L,Y){if(w)try{switch(null!==z&&I(),z=document.createElement("div"),z.classList.add("_eaglercraftX_webview_container_element"),z.style.border="5px solid #333333",z.style.zIndex="11",z.style.position="absolute",z.style.backgroundColor="#DDDDDD",z.style.fontFamily="sans-serif",v(A,F,L,Y),S.appendChild(z),f){case 0:d(u);break;case 1:if(1===u.contentMode){const U=new Uint8Array(u.blob.length);U.set(u.blob,0);u.blob=U}g(u);break;case 2:if(1===u.contentMode){const U=new Uint8Array(u.blob.length);
U.set(u.blob,0);u.blob=U}h(u)}}catch(U){la("Failed to begin showing WebView!",U)}};Da.resize=v;Da.endShowing=I};var Dc=null,Ec=!1;
function Sb(){var a=null;const b=new ra;var d=null;Ea.startIntegratedServer=new WebAssembly.Suspending(async function(){d||=URL.createObjectURL(new Blob(['"use strict"; (function(ctx, globals) {globals.__eaglerXOnMessage = function(o) {globals.__eaglerXOnMessage = function(oo) { console.error("Dropped IPC packet that was sent too early!"); };const eagRuntimeJSURL = URL.createObjectURL(new Blob([ o.eagruntimeJS ], { type: "text/javascript;charset=utf-8" }));ctx.getEaglercraftXOpts = function() { return o.eaglercraftXOpts; };ctx.getEagRuntimeJSURL = function() { return eagRuntimeJSURL; };ctx.getClassesWASMURL = function() { return o.classesWASM; };ctx.getClassesDeobfWASMURL = function() { return o.classesDeobfWASM; };ctx.getClassesTEADBGURL = function() { return o.classesTEADBG; };ctx.getEPKFiles = function() { return null; };ctx.getRootElement = function() { return null; };ctx.getMainArgs = function() { return ["_worker_process_"]; };ctx.getImageURL = function(idx) { return null; };ctx.runMain = function(mainFunc) { mainFunc(); };importScripts(eagRuntimeJSURL);};addEventListener("message", function(evt) { globals.__eaglerXOnMessage(evt.data); });})(self.__eaglercraftXLoaderContext = {}, self);'],{type:"text/javascript;charset=utf8"}));
try{a=new Worker(d)}catch(h){return la("Failed to create worker",h),!1}a.addEventListener("error",function(h){la("Worker Error",h.error)});a.addEventListener("message",function(h){const v=h.data.ch;v?"~!LOGGER"===v?Lb(h.data.txt,h.data.err):(h=h.data.dat)?$a(v,h)||b.push({ch:v,data:new Uint8Array(h),_next:null}):k("Recieved IPC packet with null buffer"):k("Recieved IPC packet with null channel")});const c=new Int8Array(Ja.length);c.set(Ja,0);try{var g=await fetch(Ra,{cache:"force-cache"}).then(h=>
h.arrayBuffer())}catch(h){la("Failed to fetch eagruntime.js contents",h);try{a.terminate()}catch(v){}return!1}a.postMessage({eaglercraftXOpts:O,eagruntimeJS:g,classesWASM:Ha,classesDeobfWASM:Ia,classesTEADBG:c.buffer});return!0});Ea.sendPacket=function(c,g){if(a){const h=new Uint8Array(g.length);h.set(g,0);a.postMessage({ch:c,dat:h.buffer},[h.buffer])}};ab=function(c,g){a&&a.postMessage({ch:c,dat:g},[g])};Ea.getAvailablePackets=b.K.bind(b);Ea.getNextPacket=b.j.bind(b);Ea.killWorker=function(){a&&
(a.terminate(),a=null)};Ea.showCrashReportOverlay=function(c,g,h,v,I){Dc||(Dc=document.createElement("div"),Dc.setAttribute("style","z-index:99;position:absolute;background-color:black;color:white;overflow-x:hidden;overflow-y:scroll;overflow-wrap:break-word;white-space:pre-wrap;font:18px sans-serif;padding:20px;display:none;"),Dc.classList.add("_eaglercraftX_integratedserver_crash_element"),S.appendChild(Dc));Dc.innerText="";Dc.innerText="CURRENT DATE: "+(new Date).toLocaleString()+"\n\n"+c;c=window.devicePixelRatio;
Dc.style.top=""+h/c+"px";Dc.style.left=""+g/c+"px";Dc.style.width=""+(v/c-20)+"px";Dc.style.height=""+(I/c-20)+"px";Dc.style.display="block";Ec=!0};Ea.hideCrashReportOverlay=function(){Dc&&(Dc.style.display="none");Ec=!1};window.__curEaglerX188UnloadListenerCB=function(){a&&a.postMessage({ch:"~!WASM_AUTOSAVE"})}};var ec=null,Tc=!1;
function Zb(){const a=new ra;self.__eaglerXOnMessage=function(b){const d=b.ch;b=b.dat;d?"~!WASM_AUTOSAVE"===d?Tc=!0:b?a.push({ch:d,data:new Uint8Array(b),_next:null}):k("Recieved IPC packet with null buffer"):k("Recieved IPC packet with null channel")};Ga.sendPacket=function(b,d){const c=new Uint8Array(d.length);c.set(d,0);postMessage({ch:b,dat:c.buffer},[c.buffer])};Ga.getAvailablePackets=a.K.bind(a);Ga.getNextPacket=a.j.bind(a);Ga.setCrashCallback=function(){return{call:function(b){ec=b}}};Ga.isTabAboutToClose=
function(){const b=Tc;Tc=!1;return b}};sa.getByteBufferView=function(a,b){return new Int8Array(Ya,a,b)};sa.getUnsignedByteBufferView=function(a,b){return new Uint8Array(Ya,a,b)};sa.getUnsignedClampedByteBufferView=function(a,b){return new Uint8ClampedArray(Ya,a,b)};sa.getShortBufferView=function(a,b){return new Int16Array(Ya,a,b)};sa.getUnsignedShortBufferView=function(a,b){return new Uint16Array(Ya,a,b)};sa.getIntBufferView=function(a,b){return new Int32Array(Ya,a,b)};sa.getFloatBufferView=function(a,b){return new Float32Array(Ya,a,b)};const Uc={172351395:{name:"EBML",type:"Container"},646:{name:"EBMLVersion",type:"Uint"},759:{name:"EBMLReadVersion",type:"Uint"},754:{name:"EBMLMaxIDLength",type:"Uint"},755:{name:"EBMLMaxSizeLength",type:"Uint"},642:{name:"DocType",type:"String"},647:{name:"DocTypeVersion",type:"Uint"},645:{name:"DocTypeReadVersion",type:"Uint"},108:{name:"Void",type:"Binary"},63:{name:"CRC-32",type:"Binary"},190023271:{name:"SignatureSlot",type:"Container"},16010:{name:"SignatureAlgo",type:"Uint"},16026:{name:"SignatureHash",
type:"Uint"},16037:{name:"SignaturePublicKey",type:"Binary"},16053:{name:"Signature",type:"Binary"},15963:{name:"SignatureElements",type:"Container"},15995:{name:"SignatureElementList",type:"Container"},9522:{name:"SignedElement",type:"Binary"},139690087:{name:"Segment",type:"Container"},21863284:{name:"SeekHead",type:"Container"},3515:{name:"Seek",type:"Container"},5035:{name:"SeekID",type:"Binary"},5036:{name:"SeekPosition",type:"Uint"},88713574:{name:"Info",type:"Container"},13220:{name:"SegmentUID",
type:"Binary"},13188:{name:"SegmentFilename",type:"String"},1882403:{name:"PrevUID",type:"Binary"},1868715:{name:"PrevFilename",type:"String"},2013475:{name:"NextUID",type:"Binary"},1999803:{name:"NextFilename",type:"String"},1092:{name:"SegmentFamily",type:"Binary"},10532:{name:"ChapterTranslate",type:"Container"},10748:{name:"ChapterTranslateEditionUID",type:"Uint"},10687:{name:"ChapterTranslateCodec",type:"Uint"},10661:{name:"ChapterTranslateID",type:"Binary"},710577:{name:"TimecodeScale",type:"Uint"},
1161:{name:"Duration",type:"Float"},1121:{name:"DateUTC",type:"Date"},15273:{name:"Title",type:"String"},3456:{name:"MuxingApp",type:"String"},5953:{name:"WritingApp",type:"String"},103:{name:"Timecode",type:"Uint"},6228:{name:"SilentTracks",type:"Container"},6359:{name:"SilentTrackNumber",type:"Uint"},39:{name:"Position",type:"Uint"},43:{name:"PrevSize",type:"Uint"},35:{name:"SimpleBlock",type:"Binary"},32:{name:"BlockGroup",type:"Container"},33:{name:"Block",type:"Binary"},34:{name:"BlockVirtual",
type:"Binary"},13729:{name:"BlockAdditions",type:"Container"},38:{name:"BlockMore",type:"Container"},110:{name:"BlockAddID",type:"Uint"},37:{name:"BlockAdditional",type:"Binary"},27:{name:"BlockDuration",type:"Uint"},122:{name:"ReferencePriority",type:"Uint"},123:{name:"ReferenceBlock",type:"Int"},125:{name:"ReferenceVirtual",type:"Int"},36:{name:"CodecState",type:"Binary"},13730:{name:"DiscardPadding",type:"Int"},14:{name:"Slices",type:"Container"},104:{name:"TimeSlice",type:"Container"},76:{name:"LaceNumber",
type:"Uint"},77:{name:"FrameNumber",type:"Uint"},75:{name:"BlockAdditionID",type:"Uint"},78:{name:"Delay",type:"Uint"},79:{name:"SliceDuration",type:"Uint"},72:{name:"ReferenceFrame",type:"Container"},73:{name:"ReferenceOffset",type:"Uint"},74:{name:"ReferenceTimeCode",type:"Uint"},47:{name:"EncryptedBlock",type:"Binary"},106212971:{name:"Tracks",type:"Container"},46:{name:"TrackEntry",type:"Container"},87:{name:"TrackNumber",type:"Uint"},13253:{name:"TrackUID",type:"Uint"},3:{name:"TrackType",type:"Uint"},
57:{name:"FlagEnabled",type:"Uint"},8:{name:"FlagDefault",type:"Uint"},5546:{name:"FlagForced",type:"Uint"},28:{name:"FlagLacing",type:"Uint"},11751:{name:"MinCache",type:"Uint"},11768:{name:"MaxCache",type:"Uint"},254851:{name:"DefaultDuration",type:"Uint"},216698:{name:"DefaultDecodedFieldDuration",type:"Uint"},209231:{name:"TrackTimecodeScale",type:"Float"},4991:{name:"TrackOffset",type:"Int"},5614:{name:"MaxBlockAdditionID",type:"Uint"},4974:{name:"Name",type:"String"},177564:{name:"Language",
type:"String"},6:{name:"CodecID",type:"String"},9122:{name:"CodecPrivate",type:"Binary"},362120:{name:"CodecName",type:"String"},13382:{name:"AttachmentLink",type:"Uint"},1742487:{name:"CodecSettings",type:"String"},1785920:{name:"CodecInfoURL",type:"String"},438848:{name:"CodecDownloadURL",type:"String"},42:{name:"CodecDecodeAll",type:"Uint"},12203:{name:"TrackOverlay",type:"Uint"},5802:{name:"CodecDelay",type:"Uint"},5819:{name:"SeekPreRoll",type:"Uint"},9764:{name:"TrackTranslate",type:"Container"},
9980:{name:"TrackTranslateEditionUID",type:"Uint"},9919:{name:"TrackTranslateCodec",type:"Uint"},9893:{name:"TrackTranslateTrackID",type:"Binary"},96:{name:"Video",type:"Container"},26:{name:"FlagInterlaced",type:"Uint"},5048:{name:"StereoMode",type:"Uint"},5056:{name:"AlphaMode",type:"Uint"},5049:{name:"OldStereoMode",type:"Uint"},48:{name:"PixelWidth",type:"Uint"},58:{name:"PixelHeight",type:"Uint"},5290:{name:"PixelCropBottom",type:"Uint"},5307:{name:"PixelCropTop",type:"Uint"},5324:{name:"PixelCropLeft",
type:"Uint"},5341:{name:"PixelCropRight",type:"Uint"},5296:{name:"DisplayWidth",type:"Uint"},5306:{name:"DisplayHeight",type:"Uint"},5298:{name:"DisplayUnit",type:"Uint"},5299:{name:"AspectRatioType",type:"Uint"},963876:{name:"ColourSpace",type:"Binary"},1029411:{name:"GammaValue",type:"Float"},230371:{name:"FrameRate",type:"Float"},97:{name:"Audio",type:"Container"},53:{name:"SamplingFrequency",type:"Float"},14517:{name:"OutputSamplingFrequency",type:"Float"},31:{name:"Channels",type:"Uint"},15739:{name:"ChannelPositions",
type:"Binary"},8804:{name:"BitDepth",type:"Uint"},98:{name:"TrackOperation",type:"Container"},99:{name:"TrackCombinePlanes",type:"Container"},100:{name:"TrackPlane",type:"Container"},101:{name:"TrackPlaneUID",type:"Uint"},102:{name:"TrackPlaneType",type:"Uint"},105:{name:"TrackJoinBlocks",type:"Container"},109:{name:"TrackJoinUID",type:"Uint"},64:{name:"TrickTrackUID",type:"Uint"},65:{name:"TrickTrackSegmentUID",type:"Binary"},70:{name:"TrickTrackFlag",type:"Uint"},71:{name:"TrickMasterTrackUID",
type:"Uint"},68:{name:"TrickMasterTrackSegmentUID",type:"Binary"},11648:{name:"ContentEncodings",type:"Container"},8768:{name:"ContentEncoding",type:"Container"},4145:{name:"ContentEncodingOrder",type:"Uint"},4146:{name:"ContentEncodingScope",type:"Uint"},4147:{name:"ContentEncodingType",type:"Uint"},4148:{name:"ContentCompression",type:"Container"},596:{name:"ContentCompAlgo",type:"Uint"},597:{name:"ContentCompSettings",type:"Binary"},4149:{name:"ContentEncryption",type:"Container"},2017:{name:"ContentEncAlgo",
type:"Uint"},2018:{name:"ContentEncKeyID",type:"Binary"},2019:{name:"ContentSignature",type:"Binary"},2020:{name:"ContentSigKeyID",type:"Binary"},2021:{name:"ContentSigAlgo",type:"Uint"},2022:{name:"ContentSigHashAlgo",type:"Uint"},206814059:{name:"Cues",type:"Container"},59:{name:"CuePoint",type:"Container"},51:{name:"CueTime",type:"Uint"},55:{name:"CueTrackPositions",type:"Container"},119:{name:"CueTrack",type:"Uint"},113:{name:"CueClusterPosition",type:"Uint"},112:{name:"CueRelativePosition",type:"Uint"},
50:{name:"CueDuration",type:"Uint"},4984:{name:"CueBlockNumber",type:"Uint"},106:{name:"CueCodecState",type:"Uint"},91:{name:"CueReference",type:"Container"},22:{name:"CueRefTime",type:"Uint"},23:{name:"CueRefCluster",type:"Uint"},4959:{name:"CueRefNumber",type:"Uint"},107:{name:"CueRefCodecState",type:"Uint"},155296873:{name:"Attachments",type:"Container"},8615:{name:"AttachedFile",type:"Container"},1662:{name:"FileDescription",type:"String"},1646:{name:"FileName",type:"String"},1632:{name:"FileMimeType",
type:"String"},1628:{name:"FileData",type:"Binary"},1710:{name:"FileUID",type:"Uint"},1653:{name:"FileReferral",type:"Binary"},1633:{name:"FileUsedStartTime",type:"Uint"},1634:{name:"FileUsedEndTime",type:"Uint"},4433776:{name:"Chapters",type:"Container"},1465:{name:"EditionEntry",type:"Container"},1468:{name:"EditionUID",type:"Uint"},1469:{name:"EditionFlagHidden",type:"Uint"},1499:{name:"EditionFlagDefault",type:"Uint"},1501:{name:"EditionFlagOrdered",type:"Uint"},54:{name:"ChapterAtom",type:"Container"},
13252:{name:"ChapterUID",type:"Uint"},5716:{name:"ChapterStringUID",type:"String"},17:{name:"ChapterTimeStart",type:"Uint"},18:{name:"ChapterTimeEnd",type:"Uint"},24:{name:"ChapterFlagHidden",type:"Uint"},1432:{name:"ChapterFlagEnabled",type:"Uint"},11879:{name:"ChapterSegmentUID",type:"Binary"},11964:{name:"ChapterSegmentEditionUID",type:"Uint"},9155:{name:"ChapterPhysicalEquiv",type:"Uint"},15:{name:"ChapterTrack",type:"Container"},9:{name:"ChapterTrackNumber",type:"Uint"},0:{name:"ChapterDisplay",
type:"Container"},5:{name:"ChapString",type:"String"},892:{name:"ChapLanguage",type:"String"},894:{name:"ChapCountry",type:"String"},10564:{name:"ChapProcess",type:"Container"},10581:{name:"ChapProcessCodecID",type:"Uint"},1293:{name:"ChapProcessPrivate",type:"Binary"},10513:{name:"ChapProcessCommand",type:"Container"},10530:{name:"ChapProcessTime",type:"Uint"},10547:{name:"ChapProcessData",type:"Binary"},39109479:{name:"Tags",type:"Container"},13171:{name:"Tag",type:"Container"},9152:{name:"Targets",
type:"Container"},10442:{name:"TargetTypeValue",type:"Uint"},9162:{name:"TargetType",type:"String"},9157:{name:"TagTrackUID",type:"Uint"},9161:{name:"TagEditionUID",type:"Uint"},9156:{name:"TagChapterUID",type:"Uint"},9158:{name:"TagAttachmentUID",type:"Uint"},10184:{name:"SimpleTag",type:"Container"},1443:{name:"TagName",type:"String"},1146:{name:"TagLanguage",type:"String"},1156:{name:"TagDefault",type:"Uint"},1159:{name:"TagString",type:"String"},1157:{name:"TagBinary",type:"Binary"}};
function Vc(a,b){a.prototype=Object.create(b.prototype);a.prototype.constructor=a}function Wc(a,b){this.name=a||"Unknown";this.type=b||"Unknown"}Wc.prototype.j=function(){};Wc.prototype.m=function(){};function Xc(a,b){Wc.call(this,a,b||"Uint")}Vc(Xc,Wc);Xc.prototype.j=function(){this.data="";for(var a=0;a<this.source.length;a++){var b=this.source[a].toString(16);this.data+=1===b.length%2?"0"+b:b}};
Xc.prototype.m=function(){var a=this.data.length/2;this.source=new Uint8Array(a);for(var b=0;b<a;b++)this.source[b]=parseInt(this.data.substr(2*b,2),16)};Xc.prototype.L=function(){return parseInt(this.data,16)};Xc.prototype.H=function(a){a=a.toString(16);this.data=1===a.length%2?"0"+a:a;this.m()};function Yc(a,b){Wc.call(this,a,b||"Float")}Vc(Yc,Wc);Yc.prototype.j=function(){var a=this.source.reverse();this.data=(new (this.source&&4===this.source.length?Float32Array:Float64Array)(a.buffer))[0]};
Yc.prototype.m=function(){var a=new (this.source&&4===this.source.length?Float32Array:Float64Array)([this.data]);this.source=(new Uint8Array(a.buffer)).reverse()};Yc.prototype.L=function(){return this.data};Yc.prototype.H=function(a){this.data=a;this.m()};function Zc(a,b){Wc.call(this,a,b||"Container")}Vc(Zc,Wc);function $c(a){var b=a.source[a.offset++],d=8-b.toString(2).length;b-=1<<7-d;for(var c=0;c<d;c++)b*=256,b+=a.source[a.offset++];return b}
Zc.prototype.j=function(){this.data=[];for(this.offset=0;this.offset<this.source.length;this.offset=b){var a=$c(this);var b=$c(this);b=Math.min(this.offset+b,this.source.length);var d=this.source.slice(this.offset,b),c=Uc[a]||{name:"Unknown",type:"Unknown"},g=Wc;switch(c.type){case "Container":g=Zc;break;case "Uint":g=Xc;break;case "Float":g=Yc}g=c=new g(c.name,c.type);g.source=d;g.j();this.data.push({id:a,$:a.toString(16),data:c})}};
function ad(a,b,d){for(var c=1,g=128;b>=g&&8>c;c++,g*=128);if(!d)for(b=g+b,d=c-1;0<=d;d--)g=b%256,a.source[a.offset+d]=g,b=(b-g)/256;a.offset+=c}function bd(a,b){for(var d=a.offset=0;d<a.data.length;d++){var c=a.data[d],g=c.data.source,h=g.length;ad(a,c.id,b);ad(a,h,b);b||a.source.set(g,a.offset);a.offset+=h}return a.offset}Zc.prototype.m=function(){var a=bd(this,"draft");this.source=new Uint8Array(a);bd(this,null)};
function cd(a,b){for(var d=0;d<a.data.length;d++){var c=a.data[d];if(c.id===b)return c.data}return null}function dd(a){Zc.call(this,"File","File");this.source=a;this.j()}Vc(dd,Zc);
function ed(a,b,d){d=d&&d.U;void 0===d?d=function(I){console.log(I)}:d||=function(){};var c=cd(a,139690087);if(!c)return d("[fix-webm-duration] Segment section is missing"),!1;var g=cd(c,88713574);if(!g)return d("[fix-webm-duration] Info section is missing"),!1;var h=cd(g,710577);if(!h)return d("[fix-webm-duration] TimecodeScale section is missing"),!1;var v=cd(g,1161);if(v)if(0>=v.L())d("[fix-webm-duration] Duration section is present, but the value is empty"),v.H(b);else return d("[fix-webm-duration] Duration section is present"),
!1;else d("[fix-webm-duration] Duration section is missing"),v=new Yc("Duration","Float"),v.H(b),g.data.push({id:1161,data:v});h.H(1E6);g.m();c.m();a.m();return!0}function Sc(a,b,d,c){try{var g=new FileReader;g.onloadend=function(){try{var h=new dd(new Uint8Array(g.result));ed(h,b,c)&&(a=new Blob([h.source.buffer],{type:a.type||"video/webm"}))}catch(v){}d(a)};g.readAsArrayBuffer(a)}catch(h){d(a)}};var fd;
(function(){function a(t){let m=C.get(t);"undefined"===typeof m&&(m=new Function("return "+t+";"),C.set(t,m));return m()}function b(t){let m={exports:null,B:null,I:null};d(t);c(t);g(t,m);h(t,m);t.teavmMath=Math;return{O(z){m.exports=z},Y(z){m.B=z},X(z){m.I=z}}}function d(t){t.teavmDate={currentTimeMillis:()=>(new Date).getTime(),dateToString:m=>(new Date(m)).toString(),getYear:m=>(new Date(m)).getFullYear(),setYear:(m,z)=>{m=new Date(m);m.setFullYear(z);return m.getTime()},getMonth:m=>(new Date(m)).getMonth(),setMonth:(m,
z)=>{m=new Date(m);m.setMonth(z);return m.getTime()},getDate:m=>(new Date(m)).getDate(),setDate:(m,z)=>{m=new Date(m);m.setDate(z);return m.getTime()},create:(m,z,q,p,y,f)=>(new Date(m,z,q,p,y,f)).getTime(),createFromUTC:(m,z,q,p,y,f)=>Date.UTC(m,z,q,p,y,f)}}function c(t){let m=[],z=[];t.teavmConsole={putcharStderr:function(q){10===q?(q=String.fromCharCode(...m),console.error(q),fa&&fa(q,!0),m.length=0):m.push(q)},putcharStdout:function(q){10===q?(q=String.fromCharCode(...z),console.log(q),fa&&fa(q,
!1),z.length=0):z.push(q)}}}function g(t,m){let z=new FinalizationRegistry(p=>{let y=m.exports["teavm.reportGarbageCollectedValue"];"undefined"!==typeof y&&m.I(function(){y(p.V,p.W)})}),q=new FinalizationRegistry(p=>{let y=m.exports["teavm.reportGarbageCollectedString"];"function"===typeof y&&m.I(function(){y(p)})});t.teavm={createWeakRef:(p,y,f)=>{null!==f&&z.register(p,{W:y,V:f});return new WeakRef(p)},deref:p=>p.deref(),createStringWeakRef:(p,y)=>{q.register(p,y);return new WeakRef(p)},stringDeref:p=>
p.deref(),takeStackTrace:()=>{var p=Error().stack;let y=[];for(let f of p.split("\n"))p=E.exec(f),null!==p&&2<=p.length&&y.push(parseInt(p[1],16));return{getStack:function(){let f;if(m.B)try{f=m.B(y)}catch(u){console.warn("Could not deobfuscate stack",u)}f||=y.map(u=>({className:"java.lang.Throwable$FakeClass",method:"fakeMethod",file:"Throwable.java",line:u}));return f}}},decorateException:p=>{new Q(m,p)}}}function h(t,m){function z(n){return n}function q(n){var r=n.charAt(0);var G=""+(p(r)?r:"_");
for(r=1;r<n.length;++r){let V=n.charAt(r);var M=V;M=p(M)||"0"<=M&&"9">=M;G+=M?V:"_"}return G}function p(n){return"A"<=n&&"Z">=n||"a"<=n&&"z">=n||"_"===n||"$"===n}function y(n,r,G){null===n?(new Function("value",r+" = value;"))(G):n[r]=G}function f(n){m.exports["teavm.js.throwException"](P in n?n[P]:m.exports["teavm.js.wrapException"](n))}function u(n){a:{if(n instanceof WebAssembly.Exception){var r=m.exports["teavm.javaException"];var G=m.exports["teavm.getJsException"];if(n.is(r)){n=n.getArg(r,0);
r=m.exports["teavm.js.extractException"](n);if(null!==r){G=r;break a}G=G(n);"undefined"===typeof G&&(G=new Q(m,n));break a}}G=n}throw G;}function A(n){var r=[];for(let G=0;G<n.length;++G)r.push("p"+G);r=0===r.length?"":r.join(", ");r=(new Function("rethrowJavaAsJs","fn",`return function(${r}) {\n`+" try {\n"+` return fn(${r});\n`+" } catch (e) {\n rethrowJavaAsJs(e);\n }\n};"))(u,n);r.__impl=n;r.__rethrow=u;return r}function F(n,r){return(new Function("constructor",`return function ${n}(marker, javaObject) {\n`+
" return constructor.call(this, marker, javaObject);\n}\n"))(r)}function L(n){try{return n()}catch(r){f(r)}}let Y=Symbol("javaObject"),U=Symbol("functions"),Z=Symbol("functionOrigin"),La=Symbol("wrapperCallMarker"),gb=new WeakMap,Fa=new WeakMap,za=new Map,Ma=new FinalizationRegistry(n=>za.delete(n)),Wa=new WeakMap,va=2463534242;t.teavmJso={emptyString:()=>"",stringFromCharCode:n=>String.fromCharCode(n),concatStrings:(n,r)=>n+r,stringLength:n=>n.length,charAt:(n,r)=>n.charCodeAt(r),emptyArray:()=>
[],appendToArray:(n,r)=>n.push(r),unwrapBoolean:n=>n?1:0,wrapBoolean:n=>!!n,getProperty:function(n,r){try{return null!==n?n[r]:a(r)}catch(G){f(G)}},setProperty:y,setPropertyPure:y,global:n=>{try{return a(n)}catch(r){f(r)}},createClass:(n,r,G)=>{n=q(n||"JavaObject");let M;M=null===r?function(ca){this[Y]=ca;this[U]=null}:function(ca){r.call(this,ca)};let V=F(n,function(ca,wa){if(ca===La)M.call(this,wa);else{if(null===G)throw Error("This class can't be instantiated directly");try{return G.apply(null,
arguments)}catch(Xa){u(Xa)}}});V.prototype=Object.create(r||Object.prototype);V.prototype.constructor=V;n=F(n,function(ca){return V.call(this,La,ca)});n[La]=V;n.prototype=V.prototype;return n},exportClass:n=>n[La],defineMethod:(n,r,G)=>{let M=[];for(let V=1;V<G.length;++V)M.push("p"+V);n.prototype[r]=(new Function("rethrowJavaAsJs","fn",`return function(${0===M.length?"":M.join(", ")}) {\n`+" try {\n"+` return fn(${["this",M].join(", ")});\n`+" } catch (e) {\n rethrowJavaAsJs(e);\n }\n};"))(u,
G)},defineStaticMethod:(n,r,G)=>{n[r]=A(G)},defineFunction:A,defineProperty:(n,r,G,M)=>{let V={get(){try{return G(this)}catch(ca){u(ca)}}};null!==M&&(V.set=function(ca){try{M(this,ca)}catch(wa){u(wa)}});Object.defineProperty(n.prototype,r,V)},defineStaticProperty:(n,r,G,M)=>{let V={get(){try{return G()}catch(ca){u(ca)}}};null!==M&&(V.set=function(ca){try{M(ca)}catch(wa){u(wa)}});Object.defineProperty(n,r,V)},javaObjectToJS:(n,r)=>{if(null===n)return null;var G=gb.get(n);if("undefined"!=typeof G&&
(G=G.deref(),"undefined"!==typeof G))return G;r=new r(n);gb.set(n,new WeakRef(r));return r},unwrapJavaObject:n=>n[Y],asFunction:(n,r)=>{let G=n[U];null===G&&(G=Object.create(null),n[U]=G);let M=G[r];"function"!==typeof M&&(M=function(){return n[r].apply(n,arguments)},M[Z]=n,G[r]=M);return M},functionAsObject:(n,r)=>{let G=n[Z];if("undefined"!==typeof G){let M=G[U];if(void 0!==M&&M[r]===n)return G}return{[r]:function(...M){try{return n(...M)}catch(V){u(V)}}}},wrapObject:n=>{if(null===n)return null;
if("object"===typeof n||"function"===typeof n){var r=n[Y];if("object"===typeof r)return r;r=Fa.get(n);if(void 0!==r&&(r=r.deref(),void 0!==r))return r;r=m.exports["teavm.jso.createWrapper"](n);Fa.set(n,new WeakRef(r));return r}r=za.get(n);if(void 0!==r&&(r=r.deref(),void 0!==r))return r;r=m.exports["teavm.jso.createWrapper"](n);za.set(n,new WeakRef(r));Ma.register(r,n);return r},isPrimitive:(n,r)=>typeof n===r,instanceOf:(n,r)=>n instanceof r,instanceOfOrNull:(n,r)=>null===n||n instanceof r,sameRef:(n,
r)=>n===r,hashCode:n=>{if("object"===typeof n||"function"===typeof n||"symbol"===typeof n){var r=Wa.get(n);if("number"===typeof r)return r;r=va;r^=r<<13;r^=r>>>17;va=r^=r<<5;Wa.set(n,r);return r}return"number"===typeof n?n|0:"bigint"===typeof n?BigInt.asIntN(32,n):"boolean"===typeof n?n?1:0:0},apply:(n,r,G)=>{try{return null===n?a(r)(...G):n[r](...G)}catch(M){f(M)}},concatArray:(n,r)=>n.concat(r),getJavaException:n=>n[P]};for(var ia of"wrapByte wrapShort wrapChar wrapInt wrapFloat wrapDouble unwrapByte unwrapShort unwrapChar unwrapInt unwrapFloat unwrapDouble".split(" "))t.teavmJso[ia]=
z;ia=[];for(let n=0;32>n;++n){let r=0===ia.length?"":ia.join(", "),G=[...ia,"body"].join(", ");t.teavmJso["createFunction"+n]=(new Function("wrapCallFromJavaToJs",...ia,"body",`return new Function('wrapCallFromJavaToJs', ${G}).bind(this, wrapCallFromJavaToJs);`)).bind(null,L);t.teavmJso["bindFunction"+n]=(M,...V)=>M.bind(null,...V);t.teavmJso["callFunction"+n]=(new Function("rethrowJsAsJava","fn",...ia,"try {\n"+` return fn(${r});\n`+"} catch (e) {\n rethrowJsAsJava(e);\n}")).bind(null,f);t.teavmJso["callMethod"+
n]=(new Function("rethrowJsAsJava","getGlobalName","instance","method",...ia,"try {\n return instance !== null\n"+` ? instance[method](${r})\n`+` : getGlobalName(method)(${r});\n`+"} catch (e) {\n rethrowJsAsJava(e);\n}")).bind(null,f,a);t.teavmJso["construct"+n]=(new Function("rethrowJsAsJava","constructor",...ia,"try {\n"+` return new constructor(${r});\n`+"} catch (e) {\n rethrowJsAsJava(e);\n}")).bind(null,f);t.teavmJso["arrayOf"+n]=new Function(...ia,"return ["+r+"]");
ia.push("p"+(n+1))}}async function v(t){try{const m={},z=b(m),q=t.path instanceof WebAssembly.Module?t.path:await WebAssembly.compileStreaming(fetch(t.path)),p=new WebAssembly.Instance(q,m);z.O(p.exports);return{module:q,instance:p}}catch(m){return console.warn("Could not load deobfuscator",m),null}}function I(t,m,z){let q=null,p=!1;return y=>{if(!p){p=!0;if(null!==m)try{q=z.exports.createFromExternalFile.value(m)}catch(f){console.warn("Could not load create deobfuscator",f)}if(null==q&&null!==t)try{q=
z.exports.createForModule.value(t)}catch(f){console.warn("Could not create deobfuscator from module data",f)}}return null!==q?q.deobfuscate(y):[]}}async function x(t,m){if(!m.enabled||"auto"!==t&&"external"!==t)return null;if(m.J instanceof ArrayBuffer)return new Int8Array(m.J);t=await fetch(m.J);return t.ok?new Int8Array(await t.arrayBuffer()):null}function w(t){const m=new ra;t.teavm.pollAsyncCallbacks=function(){for(var z;z=m.j();)z.fn()};return function(z){m.push({fn:z,_next:null})}}let C=new Map,
E=/.+:wasm-function\[[0-9]+]:0x([0-9a-f]+).*/,P=Symbol("javaException");class Q extends Error{constructor(t,m){super();this.j=t;this[P]=m;t.exports["teavm.setJsException"](m,this)}get message(){var t=this.j.exports["teavm.exceptionMessage"];return"function"===typeof t&&(t=t(this[P]),null!=t)?t:"(could not fetch message)"}}fd={load:async function(t,m){m||={};var z=m.B||{};let [q,p,y]=await Promise.all([z.enabled?v(z):Promise.resolve(null),t instanceof WebAssembly.Module?Promise.resolve(t):WebAssembly.compileStreaming(fetch(t)),
x(z.T,z)]);z={};t=b(z);"undefined"!==typeof m.M&&m.M(z);t.X(w(z));m=await WebAssembly.instantiate(p,z);z={};t.O(m.exports);if(q){let f=I(null,y,q.instance);null!==f&&(t.Y(f),z.deobfuscator=f)}t={exports:z,instance:m,N:{P:p,S:q?q.module:null}};for(let f in m.exports){let u=m.exports[f];u instanceof WebAssembly.Global?Object.defineProperty(z,f,{get:()=>u.value}):"function"===typeof u&&(z[f]=u)}z.memory=m.exports["teavm.memory"];z.R=y;return t},Z:b,aa:function(t){return new Proxy(t,{get(m,z){return new WebAssembly.Global({value:"externref",
mutable:!1},m[z])}})}}})();async function gd(){try{Error.stackTraceLimit=1024;O=self.__eaglercraftXLoaderContext.getEaglercraftXOpts();Ra=self.__eaglercraftXLoaderContext.getEagRuntimeJSURL();const a=self.__eaglercraftXLoaderContext.getClassesWASMURL(),b=self.__eaglercraftXLoaderContext.getClassesDeobfWASMURL(),d=self.__eaglercraftXLoaderContext.getClassesTEADBGURL();Na=self.__eaglercraftXLoaderContext.getEPKFiles();Sa=self.__eaglercraftXLoaderContext.getRootElement();self.__eaglercraftXLoaderContext.getImageURL(0);Oa=self.__eaglercraftXLoaderContext.getImageURL(1);
Pa=self.__eaglercraftXLoaderContext.getImageURL(2);Qa=self.__eaglercraftXLoaderContext.getImageURL(3);const c=self.__eaglercraftXLoaderContext.getMainArgs();delete self.__eaglercraftXLoaderContext;if("_worker_process_"!==c[0]){if(!await qb())return}else ea="worker",await Yb();e("Loading EaglercraftX WASM GC binary...");const g=await fd.load(a,{B:{enabled:!0,path:b,T:"external",J:d},M:function(h){h.WASMGCBufferAllocator=sa;h.platformApplication=H;h.platformAssets=ta;h.platformAudio=ua;h.platformFilesystem=
xa;h.platformInput=J;h.platformNetworking=ya;h.platformOpenGL=K;h.platformRuntime=Aa;h.platformScreenRecord=Ba;h.platformVoiceClient=Ca;h.platformWebRTC=N;h.platformWebView=Da;h.clientPlatformSingleplayer=Ea;h.serverPlatformSingleplayer=Ga;h.teavm.notifyHeapResized=function(){$b(g.exports.memory)}}});Ha=g.N.P;Ia=g.N.S;Ja=g.exports.R;$b(g.exports.memory);Ka=g.exports.deobfuscator;e("Calling entry point with args: {}",JSON.stringify(c));try{await WebAssembly.promising(g.exports.main.__impl)(c)}catch(h){g.exports.main.__rethrow(h)}finally{ka("Main function has returned!")}}catch(a){cc(a)}}
"object"===typeof self.__eaglercraftXLoaderContext?self.__eaglercraftXLoaderContext.runMain(gd):console.error("???");}).call(this);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
client-version-integer=0
client-package-name=net.lax1dude.eaglercraft.v1_8.client
client-origin-name=Eaglercraft
client-origin-version=u0
client-origin-vendor=PeytonPlayz585
client-fork-name=Eaglercraft
client-fork-version=u0
client-fork-vendor=PeytonPlayz585

View File

@@ -0,0 +1,22 @@
loader-js-file=loader.js
loader-wasm-file=loader.wasm
eagruntime-js-file=eagruntime.js
classes-wasm-file=classes.wasm
classes-deobf-teadbg-file=classes.wasm.teadbg
classes-deobf-wasm-file=classes.wasm-deobfuscator.wasm
assets-epk-0-file=assets.epk
assets-epk-0-path=/
assets-epk-1-file=../../javascript/lang
assets-epk-1-path=/assets/minecraft/lang/
splash-logo-image-file=splash.png
splash-logo-image-mime=image/png
press-any-key-image-file=pressAnyKey.png
press-any-key-image-mime=image/png
crash-logo-image-file=crashLogo.png
crash-logo-image-mime=image/png
favicon-image-file=favicon.png
favicon-image-mime=image/png
jspi-unavailable-file=enableJSPIScreen.html
offline-download-template=OfflineDownloadTemplate.txt
offline-download-script=../javascript_dist/bootstrap.js
offline-download-name=Eaglercraft_1.12.2_WASM_Offline_Download.html

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,120 @@
<!DOCTYPE html>
<html style="width:100%;height:100%;background-color:black;">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="description" content="Eaglercraft 1.12 WASM-GC test directory HTML page" />
<meta name="keywords" content="eaglercraftminecraft, 1.12, 1.12.2" />
<title>Eaglercraft 1.12 WASM-GC</title>
<meta property="og:locale" content="en-US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Eaglercraft 1.12 WASM-GC" />
<meta property="og:description" content="test directory HTML page" />
<link type="image/png" rel="shortcut icon" href="favicon.png" />
<script type="text/javascript">
"use strict";
window.addEventListener("load", async function() {
if(window.location.href.indexOf("file:") === 0) {
alert("HTTP please, do not open this file locally, run a local HTTP server and load it via HTTP");
}else if(typeof WebAssembly.Suspending === "undefined") {
alert("JSPI is not enabled, please enable it in chrome://flags");
}else {
const splash = document.createElement("div");
splash.style.width = "100%";
splash.style.height = "100%";
splash.style.imageRendering = "pixelated";
splash.style.background = "center / contain no-repeat url(splash.png), 0px 0px / 1000000% 1000000% no-repeat url(splash.png) white";
document.body.appendChild(splash);
console.log("Downloading assets.epk...");
var assetsEPK;
try {
assetsEPK = new Uint8Array(await fetch("assets.epk?v=2.0.3").then(resp => resp.arrayBuffer()));
}catch(ex) {
alert("Could not download assets.epk!");
console.error("Could not download assets.epk!");
console.error(ex);
return;
}
console.log("Downloaded " + assetsEPK.length + " byte file");
const relayId = Math.floor(Math.random() * 3);
const eaglercraftXOpts = {
demoMode: false,
localesURI: "lang/",
worldsDB: "worlds",
servers: [
{ addr: "ws://localhost:8081/", name: "Local test server" }
],
relays: [
{ addr: "wss://relay.deev.is/", comment: "lax1dude relay #1", primary: relayId === 0 },
{ addr: "wss://relay.lax1dude.net/", comment: "lax1dude relay #2", primary: relayId === 1 },
{ addr: "wss://relay.shhnowisnottheti.me/", comment: "ayunami relay #1", primary: relayId === 2 }
]
};
window.__eaglercraftXLoaderContext = {
getEaglercraftXOpts: function() {
return eaglercraftXOpts;
},
getEagRuntimeJSURL: function() {
return "eagruntime.js?v=2.0.3";
},
getClassesWASMURL: function() {
return "classes.wasm?v=2.0.3";
},
getClassesDeobfWASMURL: function() {
return "classes.wasm-deobfuscator.wasm?v=2.0.3";
},
getClassesTEADBGURL: function() {
return "classes.wasm.teadbg?v=2.0.3";
},
getEPKFiles: function() {
return [{
name: "assets.epk",
path: "",
data: assetsEPK
}];
},
getRootElement: function() {
return document.body;
},
getMainArgs: function() {
return [];
},
getImageURL: function(idx) {
switch(idx) {
case 0:
return "splash.png";
case 1:
return "pressAnyKey.png";
case 2:
return "crashLogo.png";
case 3:
return "favicon.png";
default:
return null;
}
},
runMain: function(fn) {
setTimeout(fn, 10);
}
};
var q = window.location.search;
if((typeof q === "string") && q[0] === "?" && (typeof URLSearchParams !== "undefined")) {
q = new URLSearchParams(q);
var s = q.get("server");
if(s) eaglercraftXOpts.joinServer = s;
}
const scriptElement = document.createElement("script");
scriptElement.type = "text/javascript";
scriptElement.src = "eagruntime.js?v=2.0.3";
document.head.appendChild(scriptElement);
}
});
</script>
</head>
<body style="margin:0px;width:100%;height:100%;overflow:hidden;background-color:black;" id="game_frame"></body>
</html>

View File

@@ -0,0 +1,24 @@
(function(){'use strict';var e;e||=typeof Module != 'undefined' ? Module : {};var aa="object"==typeof window,g="undefined"!=typeof WorkerGlobalScope,k="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&"renderer"!=process.type,ba=window.__eaglercraftXLoaderContextPre.loaderWASMURL;e.locateFile=function(a){return"loader.wasm"===a?ba:a};
var r=window.__eaglercraftXLoaderContextPre.rootElement,ca=window.__eaglercraftXLoaderContextPre.eaglercraftXOpts,t=window.__eaglercraftXLoaderContextPre.theEPWFileBuffer,da=window.__eaglercraftXLoaderContextPre.splashURL;delete window.__eaglercraftXLoaderContextPre;var v=[null];
function w(){for(var a=null,b;b=r.lastChild;)a||=b,r.removeChild(b);b=document.createElement("div");b.classList.add("_eaglercraftX_wrapper_element");b.setAttribute("style","position:relative;width:100%;height:100%;overflow:hidden;");a&&(a.classList.add("_eaglercraftX_early_splash_element"),a.style.position="absolute",a.style.top="0px",a.style.left="0px",a.style.right="0px",a.style.bottom="0px",a.style.zIndex="2",b.appendChild(a));r.appendChild(b);return b}function x(){e=y=z=A=B=null}
var C=Object.assign({},e),D=[],E="./this.program",F=(a,b)=>{throw b;},G="",H,J;
if(k){var fs=require("fs"),ea=require("path");G=__dirname+"/";J=a=>{a=L(a)?new URL(a):ea.normalize(a);return fs.readFileSync(a)};H=a=>{a=L(a)?new URL(a):ea.normalize(a);return new Promise((b,d)=>{fs.readFile(a,void 0,(c,f)=>{c?d(c):b(f.buffer)})})};!e.thisProgram&&1<process.argv.length&&(E=process.argv[1].replace(/\\/g,"/"));D=process.argv.slice(2);"undefined"!=typeof module&&(module.exports=e);F=(a,b)=>{process.exitCode=a;throw b;}}else if(aa||g)g?G=self.location.href:"undefined"!=typeof document&&
document.currentScript&&(G=document.currentScript.src),G=G.startsWith("blob:")?"":G.substr(0,G.replace(/[?#].*/,"").lastIndexOf("/")+1),g&&(J=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),H=a=>L(a)?new Promise((b,d)=>{var c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=()=>{200==c.status||0==c.status&&c.response?b(c.response):d(c.status)};c.onerror=d;c.send(null)}):fetch(a,{credentials:"same-origin"}).then(b=>
b.ok?b.arrayBuffer():Promise.reject(Error(b.status+" : "+b.url)));e.print||console.log.bind(console);var M=e.printErr||console.error.bind(console);Object.assign(e,C);C=null;e.arguments&&(D=e.arguments);e.thisProgram&&(E=e.thisProgram);var N=e.wasmBinary,y,O=!1,z,A,B;
function fa(){var a=y.buffer;e.HEAP8=new Int8Array(a);e.HEAP16=new Int16Array(a);e.HEAPU8=z=new Uint8Array(a);e.HEAPU16=new Uint16Array(a);e.HEAP32=A=new Int32Array(a);e.HEAPU32=B=new Uint32Array(a);e.HEAPF32=new Float32Array(a);e.HEAPF64=new Float64Array(a)}var ha=[],ia=[],ja=[],ka=[];function la(){var a=e.preRun.shift();ha.unshift(a)}var P=0,Q=null,R=null,ma=a=>a.startsWith("data:application/octet-stream;base64,"),L=a=>a.startsWith("file://"),S;
function na(a){if(a==S&&N)return new Uint8Array(N);if(J)return J(a);throw"both async and sync fetching of the wasm failed";}function oa(a){return N?Promise.resolve().then(()=>na(a)):H(a).then(b=>new Uint8Array(b),()=>na(a))}function pa(a,b,d){return oa(a).then(c=>WebAssembly.instantiate(c,b)).then(d,c=>{M(`failed to asynchronously prepare wasm: ${c}`);e.onAbort?.(c);c="Aborted("+c+")";M(c);O=!0;throw new WebAssembly.RuntimeError(c+". Build with -sASSERTIONS for more info.");})}
function qa(a,b){var d=S;N||"function"!=typeof WebAssembly.instantiateStreaming||ma(d)||L(d)||k||"function"!=typeof fetch?pa(d,a,b):fetch(d,{credentials:"same-origin"}).then(c=>WebAssembly.instantiateStreaming(c,a).then(b,function(f){M(`wasm streaming compile failed: ${f}`);M("falling back to ArrayBuffer instantiation");return pa(d,a,b)}))}class ra{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}
var T=a=>{for(;0<a.length;)a.shift()(e)},sa=e.noExitRuntime||!0,U="undefined"!=typeof TextDecoder?new TextDecoder:void 0,W=(a=0)=>{for(var b=z,d=a+NaN,c=a;b[c]&&!(c>=d);)++c;if(16<c-a&&b.buffer&&U)return U.decode(b.subarray(a,c));for(d="";a<c;){var f=b[a++];if(f&128){var u=b[a++]&63;if(192==(f&224))d+=String.fromCharCode((f&31)<<6|u);else{var m=b[a++]&63;f=224==(f&240)?(f&15)<<12|u<<6|m:(f&7)<<18|u<<12|m<<6|b[a++]&63;65536>f?d+=String.fromCharCode(f):(f-=65536,d+=String.fromCharCode(55296|f>>10,56320|
f&1023))}}else d+=String.fromCharCode(f)}return d},ta=a=>{sa||(e.onExit?.(a),O=!0);F(a,new ra(a))},ua={k:(a,b,d)=>z.copyWithin(a,b,b+d),c:function(a){console.error("LoaderMain: [ERROR] "+(a?W(a):""))},b:function(a){console.log("LoaderMain: [INFO] "+(a?W(a):""))},j:a=>{var b=z.length;a>>>=0;if(67108864<a)return!1;for(var d=1;4>=d;d*=2){var c=b*(1+.2/d);c=Math.min(c,a+100663296);a:{c=(Math.min(67108864,65536*Math.ceil(Math.max(a,c)/65536))-y.buffer.byteLength+65535)/65536|0;try{y.grow(c);fa();var f=
1;break a}catch(u){}f=void 0}if(f)return!0}return!1},n:function(){return t.byteLength},i:function(){return"undefined"!==typeof WebAssembly.Suspending},f:function(a,b){const d=v.length;v.push(U.decode(new Uint8Array(t,a,b)));return d},e:function(a){const b=v.length;v.push(new Uint8Array(a));return b},d:function(a,b,d){z.set(new Uint8Array(t,b,d),a)},g:function(a,b,d,c){v[a].set(new Uint8Array(t,d,c),b)},l:function(a,b,d,c){v[a].set(new Uint8Array(z.buffer,b,c),d)},a:function(a){t=v=null;setTimeout(x,
20);const b=w(),d=document.createElement("div");d.setAttribute("style","z-index:100;position:absolute;top:10%;left:10%;right:10%;bottom:10%;background-color:white;border:2px solid #cccccc;overflow-x:hidden;overflow-y:scroll;");d.classList.add("_eaglercraftX_loader_failed_container");a=a?W(a):"";console.error("LoaderMain: [FAILED] "+a);const c=document.createElement("h2");c.style.color="#AA0000";c.style.padding="25px";c.style.fontFamily="sans-serif";c.style.marginBlock="0px";c.appendChild(document.createTextNode(a));
d.appendChild(c);a=document.createElement("h4");a.style.color="#AA0000";a.style.padding="25px";a.style.fontFamily="sans-serif";a.style.marginBlock="0px";a.appendChild(document.createTextNode("Try again later"));d.appendChild(a);b.appendChild(d)},h:function(a){var b=a>>2;a=v[A[b]];var d=v[A[b+1]];a=a?URL.createObjectURL(new Blob([a],{type:d||"image/png"})):null;b=(b=v[A[b+2]])?U.decode(b):"<h1>Failed to load error screen</h1>";t=v=null;setTimeout(x,20);d=w();var c=document.createElement("img");c.setAttribute("style",
"z-index:100;position:absolute;top:10px;left:calc(50% - 151px);");c.src=a;d.appendChild(c);a=document.createElement("div");a.setAttribute("style","z-index:100;position:absolute;top:135px;left:10%;right:10%;bottom:50px;background-color:white;border:2px solid #cccccc;");a.classList.add("_eaglercraftX_jspi_unsupported_container");c=document.createElement("iframe");c.classList.add("_eaglercraftX_jspi_unsupported_frame");c.setAttribute("style","border:none;width:100%;height:100%;");c.srcdoc=b;a.appendChild(c);
d.appendChild(a)},m:function(a){a>>=2;const b=URL.createObjectURL(new Blob([v[A[a]]],{type:"text/javascript;charset=utf-8"})),d=URL.createObjectURL(new Blob([v[A[a+1]]],{type:"application/wasm"})),c=URL.createObjectURL(new Blob([v[A[a+2]]],{type:"application/octet-stream"})),f=URL.createObjectURL(new Blob([v[A[a+3]]],{type:"application/wasm"})),u=URL.createObjectURL(new Blob([v[A[a+4]]],{type:v[A[a+5]]})),m=URL.createObjectURL(new Blob([v[A[a+6]]],{type:v[A[a+7]]})),V=URL.createObjectURL(new Blob([v[A[a+
8]]],{type:v[A[a+9]]})),I=A[a+10],q=Array(I);for(var h=0,l;h<I;++h)l=a+11+3*h,q[h]={data:v[A[l]],name:v[A[l+1]],path:v[A[l+2]]};t=v=null;setTimeout(x,20);window.__eaglercraftXLoaderContext={getEaglercraftXOpts:function(){return ca},getEagRuntimeJSURL:function(){return b},getClassesWASMURL:function(){return d},getClassesDeobfWASMURL:function(){return f},getClassesTEADBGURL:function(){return c},getEPKFiles:function(){return q},getRootElement:function(){return r},getMainArgs:function(){return[]},getImageURL:function(p){switch(p){case 0:return da;
case 1:return u;case 2:return m;case 3:return V;default:return null}},runMain:function(p){setTimeout(p,10)}};a=document.createElement("script");a.type="text/javascript";a.src=b;document.head.appendChild(a)}},X=function(){function a(d){X=d.exports;y=X.o;fa();ia.unshift(X.p);P--;e.monitorRunDependencies?.(P);0==P&&(null!==Q&&(clearInterval(Q),Q=null),R&&(d=R,R=null,d()));return X}P++;e.monitorRunDependencies?.(P);var b={a:ua};if(e.instantiateWasm)try{return e.instantiateWasm(b,a)}catch(d){return M(`Module.instantiateWasm callback failed with error: ${d}`),
!1}S??=ma("loader.wasm")?"loader.wasm":e.locateFile?e.locateFile("loader.wasm",G):G+"loader.wasm";qa(b,function(d){a(d.instance)});return{}}(),va=e._main=(a,b)=>(va=e._main=X.q)(a,b),Y=a=>(Y=X.s)(a),Z;R=function wa(){Z||xa();Z||(R=wa)};
function ya(a=[]){var b=va;a.unshift(E);var d=a.length,c=Y(4*(d+1)),f=c;a.forEach(m=>{for(var V=B,I=f>>2,q=0,h=0;h<m.length;++h){var l=m.charCodeAt(h);127>=l?q++:2047>=l?q+=2:55296<=l&&57343>=l?(q+=4,++h):q+=3}var p=q+1;h=q=Y(p);l=z;if(0<p){p=h+p-1;for(var K=0;K<m.length;++K){var n=m.charCodeAt(K);if(55296<=n&&57343>=n){var Aa=m.charCodeAt(++K);n=65536+((n&1023)<<10)|Aa&1023}if(127>=n){if(h>=p)break;l[h++]=n}else{if(2047>=n){if(h+1>=p)break;l[h++]=192|n>>6}else{if(65535>=n){if(h+2>=p)break;l[h++]=
224|n>>12}else{if(h+3>=p)break;l[h++]=240|n>>18;l[h++]=128|n>>12&63}l[h++]=128|n>>6&63}l[h++]=128|n&63}}l[h]=0}V[I]=q;f+=4});B[f>>2]=0;try{var u=b(d,c);ta(u)}catch(m){m instanceof ra||"unwind"==m||F(1,m)}}
function xa(){var a=D;function b(){if(!Z&&(Z=!0,e.calledRun=!0,!O)){T(ia);T(ja);e.onRuntimeInitialized?.();za&&ya(a);if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var d=e.postRun.shift();ka.unshift(d)}T(ka)}}if(!(0<P)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)la();T(ha);0<P||(e.setStatus?(e.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>e.setStatus(""),1);b()},1)):b())}}
if(e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();var za=!0;e.noInitialRun&&(za=!1);xa();}).call(this);

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB