let t = -1,
e = "x",
n = "",
r = "white",
i = -1,
o = "";
async function l(t) {
const e = `/r/blockhash/${t}`,
n = await fetch(e);
if (!n.ok) {
if (404 === n.status) return null;
throw new Error("Invalid response")
}
return await n.json()
}
function c() {
return fetch("/r/blockheight").then((t => {
if (!t.ok) throw new Error("Invalid response");
return t.json()
})).catch((t => {
console.error("Error fetching block height:", t)
}))
}
async function f() {
const t = await c();
t != i && (i = t, o = await l(i), currentAlignment = o.toLowerCase().charAt(o.length - 1), r = currentAlignment == n ? "#FF9900" : "white", h = !0)
}
let h = !0;
var a = document.getElementById("R"),
u = a.getContext("2d"),
s = "ᚠᚢᚦᚨᚱᚲᚺᚹᚷᛞᛟᚾᛁᛏᛃᛒᛈᛖᛇᛗᛉᛚᛊᛜ",
w = "012345678889a9b9c9ddeeff",
d = 800;
a.width = d + d / 5, a.height = d + d / 5, u.textAlign = "center", u.textBaseline = "middle", u.fillStyle = "white", u.lineWidth = 3, u.strokeStyle = "white";
var x = d / 8,
g = d / x,
m = [];
function y() {
m = [];
for (let t = 0; t < g; t++)
for (let e = 0; e < g; e++) m.push({
x: t * x,
y: e * x,
rune: C()
})
}
function C() {
return s[Math.floor(Math.random() * s.length)]
}
function S() {
u.strokeRect(d / 10, d / 15, d, d), u.font = "32px 'Courier New', Courier, monospace", u.fillStyle = "white", m.forEach((t => {
u.fillText(t.rune, t.x + d / 10 + x / 2, t.y + d / 15 + x / 2)
}))
}
function k() {
u.font = "bold 60px 'Courier New', Courier, monospace", u.fillStyle = "white", u.fillText("RSIC", d / 5, d + d / 8), u.fillText(t, (d + d / 5) / 2, d + d / 8), u.fillStyle = r, u.fillText(e, d + d / 20, d + d / 8), u.fillStyle = "white"
}
function p() {
m.forEach((t => {
t.rune = C()
})), h = !0
}
function b() {
setTimeout((() => {
p(), b(), f()
}), 1e3)
}