// ==UserScript==
// @name Infinite Craft Helper
// @namespace mikarific.com
// @match https://neal.fun/infinite-craft/*
// @version 2.1.4
// @author Mikarific
// @description A script that adds various useful features to Infinite Craft.
// @icon https://i.imgur.com/WlkWOkU.png
// @grant GM.getValue
// @grant GM.setValue
// @grant GM.xmlHttpRequest
// @grant unsafeWindow
// @run-at document-end
// @noframes
// @inject-into page
// @sandbox raw
// @connect *
// @supportURL https://discord.gg/NSMut3Wx3Y
// @homepageURL https://discord.gg/NSMut3Wx3Y
// @license MIT
//
// Created with love using Gorilla
// ==/UserScript==
(function () {
'use strict';
const whiteFavicon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAQAAAAi5ZK2AAAFUWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS41LjAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyIKICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL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wRtvL8hrXpPM/9eb39r0fnLBLTBbV0lj1a7WcqYThbAAQEBAQEBAQEBAQEBAQEBARkRnlXNneAtXqh+ur6QgBYAAtgASyABbAAFsACWBPAIuNFa/2v72vU+mB82wI1oZTsAxbOmtOwqwzr70vv6TpRRJs4omp0nE17pS6lDbGPn5EoLhc6WmN2WGoOjFR73yMMgkp3Vkr8MpYDS/pLzc+yxc4hmRsWKgYZ4M2wClM2b1LpE30/fibqvcAasuppjWENhJhYdbTEwumC54bV1qcQolQ3COhhFaIY7iRDLauf+qlVfnijsBKqigKr2aFT3P9kj6qWZlgplpVc034alZTfr3G5eXawKpEJwTYAy5ov5dGaimYAI/I1Day2uom8KwervfdxrUIyrCRavXjAigfaJ5NGxDGsPFKHuccmxUc7KzuDoez7stiOYesBKxtEIlNJGY1hca06LAfXeA9cuLfBbwhWOTQCpLBiGyyJEB5uKqD9BxDrV+wBsEZDgFRzK6y8az5tI+sk6UeJ7cGymA7URtIKi3fNx3RsBcACWAALYM0Eiw8FB8MqR8/YHSxsS55khSW60fAxYaq0j9gVrMg2G7HCqrp/UEtKoX3ByuWZcwAs+dGV2UzfFyw2alqkJEZYo7mh7HSQ+jJrJ+b7gtW6opjkx6tI5PI6MNnR0BRTdbRY58bYF6xu4H+sVOB7K6mo2Z+FJJ9V+4zmYvXY0PnIAF7gHcLqk+RJrtLM6ikVw23TuPMq967SRyPcG6yxD77tQy4ffIXNPnjFU7ofWGNarXYew1KYVJJGH9HKon3C+qm35KpW3GI6SOuGpWLJqiknynh7pgMRzYLwwPgZ/RclbesSCdLe19a6Xbsuk+GKNE4bjVflvS/xsSLNor2JOYRh0ESIMaABeWzyP4JsqD8BLIAFsEAAFsACWADrgLD+D5yZ8abDhoarAAAAAElFTkSuQmCC';
function semverCompare(current, latest) {
if (current.startsWith(latest + '-'))
return -1;
if (latest.startsWith(current + '-'))
return 1;
return current.localeCompare(latest, undefined, { numeric: true, sensitivity: 'case', caseFirst: 'upper' }) === -1;
}
function init$d(elements) {
GM.xmlHttpRequest({
method: 'GET',
url: `https://github.com/Mikarific/InfiniteCraftHelper/raw/main/gorilla.json`,
onload: (response) => {
if (response.status === 200) {
const responseJSON = JSON.parse(response.responseText);
if (semverCompare(GM.info.script.version, responseJSON.version)) {
const outdatedModal = document.createElement('dialog');
outdatedModal.classList.add('modal');
elements.container.appendChild(outdatedModal);
const outdatedHeader = document.createElement('div');
outdatedHeader.classList.add('modal-header');
const outdatedTitle = document.createElement('h1');
outdatedTitle.classList.add('modal-title');
outdatedTitle.appendChild(document.createTextNode('Infinite Craft Helper is out of date!'));
outdatedHeader.appendChild(outdatedTitle);
const closeButtonContainer = document.createElement('div');
closeButtonContainer.classList.add('close-button-container');
const closeButton = document.createElement('img');
closeButton.src = closeIcon.trim();
closeButton.classList.add('close-button');
closeButtonContainer.appendChild(closeButton);
outdatedHeader.appendChild(closeButtonContainer);
outdatedModal.appendChild(outdatedHeader);
const versionText = document.createElement('div');
versionText.classList.add('modal-text');
versionText.appendChild(document.createTextNode(`You are on v${GM.info.script.version}! The latest verion is v${responseJSON.version}!`));
outdatedModal.appendChild(versionText);
const buttonContainer = document.createElement('div');
buttonContainer.classList.add('modal-button-container');
const updateButton = document.createElement('a');
updateButton.classList.add('item');
updateButton.href = responseJSON.downloadURL;
updateButton.appendChild(document.createTextNode('Update'));
buttonContainer.appendChild(updateButton);
const continueButton = document.createElement('button');
continueButton.classList.add('item');
continueButton.appendChild(document.createTextNode('Continue Anyways'));
buttonContainer.appendChild(continueButton);
outdatedModal.appendChild(buttonContainer);
outdatedModal.showModal();
closeButton.addEventListener('click', (e) => {
outdatedModal.close();
});
continueButton.addEventListener('click', (e) => {
outdatedModal.close();
});
}
}
},
});
}
function init$c(elements) {
if (elements.favicon !== null) {
const whiteFaviconLink = elements.favicon.cloneNode();
elements.favicon.media = '(prefers-color-scheme:light)';
whiteFaviconLink.media = '(prefers-color-scheme:dark)';
whiteFaviconLink.href = whiteFavicon.trim();
elements.favicon.after(whiteFaviconLink);
}
}
const css = `
.dark-mode .site-title, .dark-mode .instruction-icon, .dark-mode .settings-button, .dark-mode .setting > img, .dark-mode .close-button {
filter: invert(1);
}
.dark-mode {
scrollbar-color: var(--border-color) #262626;
}
.item {
margin: 4px;
cursor: pointer;
padding: 8px 8px 7px;
border-radius: 5px;
display: inline-block;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
border: 1px solid var(--border-color);
transition: background .15s linear;
background: var(--item-bg);
line-height: 1em;
color: var(--text-color);
white-space: nowrap;
}
.item:hover {
background: var(--instance-bg-hover);
border: 1px solid var(--instance-border-hover);
}
@media screen and (min-width: 1150px) {
.item {
font-size: 16.4px;
padding: 9px 10px 8px;
}
}
.pinned {
max-width: 900px;
margin-left: auto;
margin-right: auto;
padding: 9px;
border: 0px;
border-bottom: 1px;
border-style: solid;
border-color: var(--border-color);
}
.pinned-title {
margin: 4px;
font-size: 15px;
font-family: Roboto, sans-serif;
color: var(--text-color);
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
pointer-events: none;
}
.sidebar {
width: var(--sidebar-size) !important;
}
.resize-bar {
position: absolute;
height: 100%;
width: 5px;
right: calc(var(--sidebar-size) - 3px);
z-index: 10;
cursor: ew-resize;
}
.sidebar-header {
display: flex;
position: sticky;
height: auto !important;
top: 0px;
background-color: var(--background-color) !important;
max-width: 900px;
margin-left: auto;
margin-right: auto;
padding: 9px;
border: 0px;
border-bottom: 1px;
border-style: solid;
border-color: var(--border-color);
z-index: 1;
}
.sidebar-search {
width: 100%;
}
.sidebar-input {
height: 40px !important;
margin: 4px;
border-radius: 5px;
border: 1px solid var(--border-color) !important;
font-family: Roboto, sans-serif;
background-size: 21px 21px !important;
background-position: 10px 10px !important;
color: var(--text-color);
}
.settings-details {
display: flex;
margin: 4px;
height: 40px;
border: 1px solid var(--border-color);
border-radius: 5px;
}
.settings-summary {
display: flex;
list-style: none;
}
.settings-button {
height: 40px;
padding: 8px 8px 7px;
cursor: pointer;
opacity: .8;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
aspect-ratio: 1/1;
}
.settings-button:hover {
transform: scale(1.05)
}
.settings-content {
display: flex;
flex-direction: column;
gap: 5px;
position: absolute;
right: 13px;
padding: 8px 8px 7px;
border: 1px solid var(--border-color);
border-radius: 5px;
background-color: var(--background-color);
}
.setting {
display: flex;
gap: 5px;
justify-content: flex-end;
cursor: pointer;
padding: 8px 8px 7px;
border: 1px solid var(--border-color);
border-radius: 5px;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
line-height: 1em;
font-family: Roboto, sans-serif;
font-size: 15.4px;
color: var(--text-color);
}
.setting:hover {
background: var(--instance-bg-hover);
border: 1px solid var(--instance-border-hover);
}
.setting > img {
height: 1em;
opacity: .8;
aspect-ratio: 1 / 1;
}
#import-save {
display: none;
}
.logo {
width: 85px !important;
right: calc(var(--sidebar-size) + 15px) !important;
}
.version {
position: fixed;
top: 85px;
right: calc(var(--sidebar-size) + 15px);
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
pointer-events: none;
color: var(--text-color);
font-family: Roboto, sans-serif;
font-size: 11px;
}
.side-controls {
right: calc(var(--sidebar-size) + 9px) !important;
z-index: 1;
}
.random, .discoveries-icon {
width: 21px;
cursor: pointer;
opacity: .8;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.random:hover, .discoveries-icon:hover {
transform: scale(1.05);
}
.modal {
max-width: 75%;
max-height: 75%;
margin: auto;
padding-top: 0px;
border: 1px solid var(--border-color);
border-radius: 5px;
background-color: var(--background-color);
}
.modal::backdrop {
background-color: rgb(0 0 0 / .5);
}
.modal-header {
position: sticky;
top: 0;
display: flex;
gap: 1rem;
padding-top: 16px;
padding-bottom: 16px;
justify-content: space-between;
background-color: var(--background-color);
}
.modal-title {
font-size: 20px;
font-family: Roboto, sans-serif;
line-height: 35px;
color: var(--text-color);
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.modal-text {
font-size: 15px;
font-family: Roboto, sans-serif;
color: var(--text-color);
text-align: center;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
pointer-events: none;
}
.display-item {
margin: 4px;
padding: 8px 8px 7px;
border-radius: 5px;
display: inline-block;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
border: 1px solid var(--border-color);
background: var(--item-bg);
line-height: 1em;
white-space: nowrap;
color: var(--text-color);
}
@media screen and (min-width: 1150px) {
.display-item {
font-size: 16.4px;
padding: 9px 10px 8px;
}
}
.recipe {
display: flex;
align-items: center;
color: var(--text-color);
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.modal-button-container {
display: flex;
align-items: center;
justify-content: center;
padding-top: 16px;
color: var(--text-color);
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.modal-button-container > .item {
font-family: Roboto, sans-serif;
font-size: 15.4px;
text-decoration: auto;
}
.close-button-container {
display: flex;
border: 1px solid var(--border-color);
border-radius: 5px;
}
.close-button {
height: 35px;
padding: 8px 8px 7px;
cursor: pointer;
opacity: .8;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.close-button:hover {
transform: scale(1.05)
}
.instance-emoji {
pointer-events: none;
}
`;
function init$b(elements) {
elements.styles.appendChild(document.createTextNode(css.trim()));
document.getElementsByTagName('head')[0].appendChild(elements.styles);
}
function setMiddleClickOnMutations(mutations, elements) {
for (const mutation of mutations) {
if (mutation.addedNodes.length > 0) {
for (const node of mutation.addedNodes) {
node.addEventListener('mousedown', (e) => {
e.preventDefault();
if (e instanceof MouseEvent &&
e.button === 1 &&
e.target instanceof HTMLElement &&
(e.target.classList.contains('instance') ||
e.target.classList.contains('instance-discovered-text') ||
e.target.classList.contains('instance-discovered-emoji'))) {
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].playInstanceSound();
const targetElement = e.target.classList.contains('instance-discovered-emoji')
? e.target.parentElement?.parentElement
: e.target.classList.contains('instance-discovered-text')
? e.target.parentElement
: e.target;
const { x, y, width, height } = targetElement.getBoundingClientRect();
const data = {
id: unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.instanceId++,
text: targetElement.childNodes[1].textContent?.trim(),
emoji: targetElement.childNodes[0].textContent?.trim(),
discovered: targetElement.classList.contains('instance-discovered'),
disabled: false,
left: x,
top: y,
offsetX: 0.5,
offsetY: 0.5,
hasMoved: false,
fromPanel: false,
};
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance = cloneInto(data, unsafeWindow);
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.instances.push(unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance);
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].$nextTick(exportFunction(() => {
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].setInstancePosition(unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance, e.clientX - width / 2, e.clientY - height / 2);
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].setInstanceZIndex(unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance, data.id);
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance.elem.addEventListener('mouseup', exportFunction((e) => {
if (!unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance.hasMoved) {
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance.hasMoved =
true;
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].calcInstanceSize(unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance);
}
}, unsafeWindow));
}, unsafeWindow));
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.mouseDown = true;
}
});
}
}
}
}
const craftsModal = document.createElement('dialog');
const craftsTitle = document.createElement('h1');
const craftsContainer = document.createElement('div');
let recipes = {};
async function init$a(elements) {
craftsModal.classList.add('modal');
elements.container.appendChild(craftsModal);
const craftsHeader = document.createElement('div');
craftsHeader.classList.add('modal-header');
craftsTitle.classList.add('modal-title');
craftsTitle.appendChild(document.createTextNode('Crafts'));
craftsHeader.appendChild(craftsTitle);
const closeButtonContainer = document.createElement('div');
closeButtonContainer.classList.add('close-button-container');
const closeButton = document.createElement('img');
closeButton.src = closeIcon.trim();
closeButton.classList.add('close-button');
closeButtonContainer.appendChild(closeButton);
craftsHeader.appendChild(closeButtonContainer);
craftsModal.appendChild(craftsHeader);
craftsContainer.classList.add('crafts-container');
craftsModal.appendChild(craftsContainer);
recipes = JSON.parse((await GM.getValue('recipes')) ?? '{}');
delete recipes['Nothing'];
for (const recipeKey of Object.keys(recipes)) {
for (let i = recipes[recipeKey].length - 1; i >= 0; i--) {
if (recipes[recipeKey][i] === undefined ||
recipes[recipeKey][i] === null ||
recipes[recipeKey][i].length < 2 ||
recipes[recipeKey][i][0].text === recipeKey ||
recipes[recipeKey][i][1].text === recipeKey) {
recipes[recipeKey].splice(i, 1);
}
}
}
await GM.setValue('recipes', JSON.stringify(recipes));
closeButton.addEventListener('click', (e) => {
craftsModal.close();
});
}
async function addElementToCrafts(first, second, result, loading = false) {
const ingredients = [first, second].sort((a, b) => {
return a.text.localeCompare(b.text);
});
if (recipes[result] === undefined)
recipes[result] = [];
if (recipes[result].find((recipe) => recipe[0].text === ingredients[0].text && recipe[1].text === ingredients[1].text) !== undefined)
return;
recipes[result].push([
{
text: ingredients[0].text,
emoji: ingredients[0].emoji ?? '⬜',
},
{
text: ingredients[1].text,
emoji: ingredients[1].emoji ?? '⬜',
},
]);
if (!loading)
await GM.setValue('recipes', JSON.stringify(recipes));
}
function openCraftsForElement(element) {
craftsTitle.innerHTML = '';
const titleEmoji = document.createElement('span');
titleEmoji.classList.add('display-item-emoji');
titleEmoji.appendChild(document.createTextNode(element.emoji ?? '⬜'));
craftsTitle.appendChild(titleEmoji);
craftsTitle.appendChild(document.createTextNode(` ${element.text} `));
craftsContainer.innerHTML = '';
const elementRecipes = recipes[element.text];
if (elementRecipes === undefined) {
const recipesEmpty = document.createElement('div');
recipesEmpty.classList.add('modal-text');
recipesEmpty.appendChild(document.createTextNode("I don't know how to craft this element!"));
craftsContainer.appendChild(recipesEmpty);
}
else {
const recipeKeys = Object.keys(recipes);
for (const elementRecipe of elementRecipes) {
const recipeDiv = document.createElement('div');
recipeDiv.classList.add('recipe');
const firstDiv = document.createElement('div');
recipeKeys.includes(elementRecipe[0].text)
? firstDiv.classList.add('item')
: firstDiv.classList.add('display-item');
const firstEmoji = document.createElement('span');
recipeKeys.includes(elementRecipe[0].text)
? firstEmoji.classList.add('item-emoji')
: firstEmoji.classList.add('display-item-emoji');
firstEmoji.appendChild(document.createTextNode(elementRecipe[0].emoji ?? '⬜'));
firstDiv.appendChild(firstEmoji);
firstDiv.appendChild(document.createTextNode(` ${elementRecipe[0].text} `));
if (recipeKeys.includes(elementRecipe[0].text)) {
firstDiv.addEventListener('click', () => {
openCraftsForElement(elementRecipe[0]);
});
}
recipeDiv.appendChild(firstDiv);
recipeDiv.appendChild(document.createTextNode('+'));
const secondDiv = document.createElement('div');
recipeKeys.includes(elementRecipe[1].text)
? secondDiv.classList.add('item')
: secondDiv.classList.add('display-item');
const secondEmoji = document.createElement('span');
recipeKeys.includes(elementRecipe[1].text)
? secondEmoji.classList.add('item-emoji')
: secondEmoji.classList.add('display-item-emoji');
secondEmoji.appendChild(document.createTextNode(elementRecipe[1].emoji ?? '⬜'));
secondDiv.appendChild(secondEmoji);
secondDiv.appendChild(document.createTextNode(` ${elementRecipe[1].text} `));
if (recipeKeys.includes(elementRecipe[1].text)) {
secondDiv.addEventListener('click', () => {
openCraftsForElement(elementRecipe[1]);
});
}
recipeDiv.appendChild(secondDiv);
recipeDiv.appendChild(document.createTextNode('='));
const resultDiv = document.createElement('div');
resultDiv.classList.add('display-item');
const resultEmoji = document.createElement('span');
resultEmoji.classList.add('display-item-emoji');
resultEmoji.appendChild(document.createTextNode(element.emoji ?? '⬜'));
resultDiv.appendChild(resultEmoji);
resultDiv.appendChild(document.createTextNode(` ${element.text} `));
recipeDiv.appendChild(resultDiv);
craftsContainer.appendChild(recipeDiv);
}
}
craftsModal.showModal();
}
async function resetCrafts() {
recipes = {};
await GM.setValue('recipes', '{}');
}
const discoveriesModal = document.createElement('dialog');
const discoveriesHeader = document.createElement('div');
const discoveriesEmpty = document.createElement('div');
function init$9(elements) {
const discoveriesImage = document.createElement('img');
discoveriesImage.src = discoveriesIcon.trim();
discoveriesImage.classList.add('discoveries-icon');
elements.sideControls.appendChild(discoveriesImage);
discoveriesModal.classList.add('modal');
elements.container.appendChild(discoveriesModal);
discoveriesHeader.classList.add('modal-header');
const discoveriesTitle = document.createElement('h1');
discoveriesTitle.classList.add('modal-title');
discoveriesTitle.appendChild(document.createTextNode('Your First Discoveries'));
discoveriesHeader.appendChild(discoveriesTitle);
const closeButtonContainer = document.createElement('div');
closeButtonContainer.classList.add('close-button-container');
const closeButton = document.createElement('img');
closeButton.src = closeIcon.trim();
closeButton.classList.add('close-button');
closeButtonContainer.appendChild(closeButton);
discoveriesHeader.appendChild(closeButtonContainer);
discoveriesModal.appendChild(discoveriesHeader);
discoveriesEmpty.classList.add('modal-text');
discoveriesEmpty.appendChild(document.createTextNode("You don't have any first discoveries!"));
discoveriesModal.appendChild(discoveriesEmpty);
const discoveredElements = cloneInto(unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.elements, unsafeWindow).filter((el) => el.discovered === true);
for (const discoveredElement of discoveredElements) {
addElementToDiscoveries(discoveredElement);
}
discoveriesImage.addEventListener('click', (e) => {
discoveriesModal.showModal();
});
closeButton.addEventListener('click', (e) => {
discoveriesModal.close();
});
}
function addElementToDiscoveries(element) {
const recipeKeys = Object.keys(recipes);
const elementDiv = document.createElement('div');
recipeKeys.includes(element.text) ? elementDiv.classList.add('item') : elementDiv.classList.add('display-item');
const elementEmoji = document.createElement('span');
recipeKeys.includes(element.text)
? elementEmoji.classList.add('item-emoji')
: elementEmoji.classList.add('display-item-emoji');
elementEmoji.appendChild(document.createTextNode(element.emoji ?? '⬜'));
elementDiv.appendChild(elementEmoji);
elementDiv.appendChild(document.createTextNode(` ${element.text} `));
if (recipeKeys.includes(element.text)) {
elementDiv.addEventListener('click', () => {
openCraftsForElement(element);
});
}
discoveriesModal.appendChild(elementDiv);
discoveriesEmpty.style.display = 'none';
}
function resetDiscoveries() {
discoveriesModal.innerHTML = '';
discoveriesModal.appendChild(discoveriesHeader);
discoveriesModal.appendChild(discoveriesEmpty);
discoveriesEmpty.style.display = '';
}
let contributeToDatabase = false;
function init$8(elements) {
const settingsDetails = document.createElement('details');
settingsDetails.classList.add('settings-details');
elements.sidebarHeader.appendChild(settingsDetails);
const settingsSummary = document.createElement('summary');
settingsSummary.classList.add('settings-summary');
settingsDetails.appendChild(settingsSummary);
const settingsButton = document.createElement('img');
settingsButton.src = settingsIcon.trim();
settingsButton.classList.add('settings-button');
settingsSummary.appendChild(settingsButton);
settingsDetails.appendChild(elements.settingsContent);
document.addEventListener('click', function (e) {
const target = e.target;
if (!settingsDetails.contains(target)) {
settingsDetails.removeAttribute('open');
}
});
contributeToDatabase = localStorage.getItem('contributeToDatabase') === 'false' ? false : true;
const contributeContainer = document.createElement('div');
contributeContainer.classList.add('setting');
const contributeText = document.createTextNode('Share Crafts?');
contributeContainer.appendChild(contributeText);
const contributeImage = document.createElement('img');
if (!contributeToDatabase) {
contributeImage.src = dontContributeIcon.trim();
}
else {
contributeImage.src = contributeIcon.trim();
}
contributeContainer.appendChild(contributeImage);
elements.settingsContent.appendChild(contributeContainer);
contributeContainer.addEventListener('click', (e) => {
if (!contributeToDatabase) {
contributeToDatabase = true;
contributeImage.src = contributeIcon.trim();
localStorage.setItem('contributeToDatabase', 'true');
}
else {
contributeToDatabase = false;
contributeImage.src = dontContributeIcon.trim();
localStorage.setItem('contributeToDatabase', 'false');
}
});
}
const pinnedContainer = document.createElement('div');
const pinnedTitle = document.createElement('div');
let pinnedElements = [];
async function init$7(elements) {
pinnedContainer.classList.add('pinned');
pinnedTitle.classList.add('pinned-title');
pinnedTitle.appendChild(document.createTextNode('Pinned Elements'));
pinnedContainer.appendChild(pinnedTitle);
pinnedElements = JSON.parse((await GM.getValue('pinned')) ?? '[]');
if (pinnedElements.length === 0)
pinnedContainer.style.display = 'none';
for (const pinnedElement of pinnedElements) {
const elementDiv = document.createElement('div');
elementDiv.classList.add('item');
const elementEmoji = document.createElement('span');
elementEmoji.classList.add('item-emoji');
elementEmoji.appendChild(document.createTextNode(pinnedElement.emoji ?? '⬜'));
elementDiv.appendChild(elementEmoji);
elementDiv.appendChild(document.createTextNode(` ${pinnedElement.text} `));
elementDiv.addEventListener('mousedown', (e) => {
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].selectElement(e, cloneInto(pinnedElement, unsafeWindow));
});
pinnedContainer.appendChild(elementDiv);
}
elements.items.before(pinnedContainer);
}
async function pinElement(element, loading = false) {
if (pinnedElements.find((el) => el.text === element.text) === undefined) {
if (!loading)
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].playInstanceSound();
const elementDiv = document.createElement('div');
elementDiv.classList.add('item');
const elementEmoji = document.createElement('span');
elementEmoji.classList.add('item-emoji');
elementEmoji.appendChild(document.createTextNode(element.emoji ?? '⬜'));
elementDiv.appendChild(elementEmoji);
elementDiv.appendChild(document.createTextNode(` ${element.text} `));
elementDiv.addEventListener('mousedown', (e) => {
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].selectElement(e, element);
});
pinnedContainer.appendChild(elementDiv);
if (pinnedElements.length === 0)
pinnedContainer.style.display = '';
pinnedElements.push(element);
if (!loading)
await GM.setValue('pinned', JSON.stringify(pinnedElements));
}
else {
if (!loading)
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.deleteSound.play();
const elementDiv = Array.from(pinnedContainer.querySelectorAll('.item')).find((el) => el.childNodes[1].textContent?.trim() === element.text);
elementDiv?.remove();
if (pinnedElements.length === 1)
pinnedContainer.style.display = 'none';
pinnedElements = pinnedElements.filter((el) => el !== element);
if (!loading)
await GM.setValue('pinned', JSON.stringify(pinnedElements));
}
}
async function resetPinnedElements() {
pinnedContainer.innerHTML = '';
pinnedContainer.appendChild(pinnedTitle);
pinnedContainer.style.display = 'none';
pinnedElements = [];
await GM.setValue('pinned', '[]');
}
function init$6(elements) {
// Detect when fetch is monkeypatched because a certain someone made a tool to upload fake recipes.
const iframe = document.createElement('iframe');
document.body.appendChild(iframe);
const cleanFetch = iframe.contentWindow?.fetch?.toString() ?? '';
iframe.remove();
// New Element Crafted
const getCraftResponse = unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].getCraftResponse;
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].getCraftResponse = exportFunction((...args) => new window.Promise(async (resolve) => {
const response = await getCraftResponse(...args);
const args0 = args[0].wrappedJSObject === undefined ? args[0] : args[0].wrappedJSObject;
const args1 = args[1].wrappedJSObject === undefined ? args[1] : args[1].wrappedJSObject;
const ingredients = args0.text.localeCompare(args1.text, 'en') === -1 ? [args0, args1] : [args1, args0];
const first = ingredients[0];
const second = ingredients[1];
const result = {
text: response.result,
emoji: response.emoji,
discovered: response.isNew,
};
if (first.text === '')
return resolve(response);
if (second.text === '')
return resolve(response);
if (result.text === '' || result.text === 'Nothing')
return resolve(response);
if (contributeToDatabase && unsafeWindow.fetch.toString() === cleanFetch) {
GM.xmlHttpRequest({
method: 'POST',
url: `https://infinitecraft.mikarific.com/recipe`,
data: JSON.stringify({
first: {
text: first.text,
emoji: first.emoji,
},
second: {
text: second.text,
emoji: second.emoji,
},
result: {
text: result.text,
emoji: result.emoji,
},
}),
headers: {
'Content-Type': 'application/json',
Origin: 'https://neal.fun/infinite-craft/',
},
});
}
addElementToCrafts({
text: first.text,
emoji: first.emoji,
}, {
text: second.text,
emoji: second.emoji,
}, result.text);
if (result.discovered) {
addElementToDiscoveries(result);
}
console.log(`${first.text} + ${second.text} = ${result.text}`);
resolve(response);
}), unsafeWindow);
const selectElement = unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].selectElement;
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].selectElement = exportFunction((e, element) => {
element = element.wrappedJSObject === undefined ? element : element.wrappedJSObject;
if (e.button === 2) {
openCraftsForElement(element);
return;
}
if (e.altKey) {
pinElement(element);
return;
}
return selectElement(e, element);
}, unsafeWindow);
const instanceObserver = new MutationObserver((mutations) => {
setMiddleClickOnMutations(mutations);
});
instanceObserver.observe(elements.instances, { childList: true, subtree: true });
const oldResetButton = document.querySelector('.reset');
const resetButton = oldResetButton.cloneNode(true);
oldResetButton.parentNode?.replaceChild(resetButton, oldResetButton);
resetButton.addEventListener('click', async () => {
const confirmation = confirm('Are you sure? This will delete all your progress!');
if (confirmation) {
localStorage.removeItem('infinite-craft-data');
await resetPinnedElements();
await resetCrafts();
location.reload();
}
});
}
let sidebarSize = 0;
let resizing = false;
function onResize() {
sidebarSize =
window.innerWidth > 800 ? Math.min(Math.min(Math.max(sidebarSize, 305), 900), window.innerWidth - 100) : 0;
document.documentElement.style.setProperty('--sidebar-size', `${sidebarSize}px`);
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.sidebarSize = sidebarSize;
for (const instance of unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.instances) {
instance.width || unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].calcInstanceSize(instance),
instance.left + instance.width + 10 > window.innerWidth - sidebarSize &&
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].setInstancePosition(instance, window.innerWidth - sidebarSize - instance.width - 10, instance.top),
instance.top + instance.height + 10 > window.innerHeight &&
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].setInstancePosition(instance, instance.left, window.innerHeight - instance.height - 10);
}
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].checkControlsBlur();
}
function init$5(elements) {
sidebarSize =
window.innerWidth > 800
? unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.sidebarSize > 310
? 350
: 305
: 0;
document.documentElement.style.setProperty('--sidebar-size', `${sidebarSize}px`);
const resizeBar = document.createElement('div');
resizeBar.classList.add('resize-bar');
elements.sidebar.after(resizeBar);
resizeBar.addEventListener('mousedown', () => {
resizing = true;
});
window.addEventListener('mousemove', (e) => {
if (resizing) {
sidebarSize =
window.innerWidth > 800
? Math.min(Math.min(Math.max(window.innerWidth - e.clientX, 305), 900), window.innerWidth - 100)
: 13;
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.sidebarSize = sidebarSize;
document.documentElement.style.setProperty('--sidebar-size', `${sidebarSize}px`);
onResize();
}
});
window.addEventListener('mouseup', () => {
resizing = false;
});
window.removeEventListener('resize', unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].onResize);
window.addEventListener('resize', onResize);
}
function init$4(elements) {
const uploadContainer = document.createElement('label');
uploadContainer.setAttribute('for', 'import-save');
uploadContainer.classList.add('setting');
const uploadInput = document.createElement('input');
uploadInput.type = 'file';
uploadInput.id = 'import-save';
uploadContainer.appendChild(uploadInput);
const uploadText = document.createTextNode('Import Save File');
uploadContainer.appendChild(uploadText);
const uploadImage = document.createElement('img');
uploadImage.src = uploadIcon.trim();
uploadContainer.appendChild(uploadImage);
elements.settingsContent.appendChild(uploadContainer);
uploadInput.addEventListener('change', async () => {
const file = uploadInput.files !== null ? uploadInput.files[0] : null;
if (file === null || file.type !== 'application/json')
return;
const fileContents = JSON.parse(await file.text());
if (!Object.keys(fileContents).includes('elements'))
return;
const saveFile = [];
for (const element of fileContents.elements) {
if (!Object.keys(element).includes('text'))
continue;
const toPush = {
text: element.text,
discovered: !Object.keys(element).includes('discovered')
? Object.keys(fileContents).includes('discoveries')
? fileContents.discoveries.includes(element.text)
: false
: element.discovered,
};
if (Object.keys(element).includes('emoji'))
toPush.emoji = element.emoji;
saveFile.push(toPush);
}
localStorage.setItem('infinite-craft-data', JSON.stringify({
elements: saveFile,
}));
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.elements = cloneInto(saveFile, unsafeWindow);
await resetCrafts();
if (Object.keys(fileContents).includes('recipes')) {
for (const recipeKey of Object.keys(fileContents.recipes)) {
if (recipeKey !== 'Nothing') {
for (const recipe of fileContents.recipes[recipeKey]) {
if (recipe[0].text !== recipeKey && recipe[1].text !== recipeKey) {
addElementToCrafts({
text: recipe[0].text,
emoji: recipe[0].emoji,
}, {
text: recipe[1].text,
emoji: recipe[1].emoji,
}, recipeKey, true);
}
}
}
}
await GM.setValue('recipes', JSON.stringify(fileContents.recipes));
}
await resetDiscoveries();
const discoveredElements = cloneInto(unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.elements, unsafeWindow).filter((el) => el.discovered === true);
for (const discoveredElement of discoveredElements) {
addElementToDiscoveries(discoveredElement);
}
await resetPinnedElements();
if (Object.keys(fileContents).includes('pinned')) {
for (let pinnedElement of fileContents.pinned) {
pinElement(cloneInto(pinnedElement, unsafeWindow), true);
}
await GM.setValue('pinned', JSON.stringify(fileContents.pinned));
}
});
const downloadContainer = document.createElement('div');
downloadContainer.classList.add('setting');
const downloadText = document.createTextNode('Export Save File');
downloadContainer.appendChild(downloadText);
const downloadImage = document.createElement('img');
downloadImage.src = downloadIcon.trim();
downloadContainer.appendChild(downloadImage);
elements.settingsContent.appendChild(downloadContainer);
downloadContainer.addEventListener('click', (e) => {
const saveFile = JSON.parse(localStorage.getItem('infinite-craft-data') ?? '');
saveFile.pinned = pinnedElements;
saveFile.recipes = recipes;
const downloadLink = document.createElement('a');
downloadLink.download = 'infinitecraft.json';
downloadLink.href = URL.createObjectURL(new Blob([JSON.stringify(saveFile, null, '\t')], {
type: 'application/json',
}));
downloadLink.dataset.downloadurl = ['application/json', downloadLink.download, downloadLink.href].join(':');
downloadLink.style.display = 'none';
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
setTimeout(function () {
URL.revokeObjectURL(downloadLink.href);
}, 1500);
});
}
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Marin Atanasov
*
* 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.
*/
const characterMap = {
À: 'A',
Á: 'A',
Â: 'A',
Ã: 'A',
Ä: 'A',
Å: 'A',
Ấ: 'A',
Ắ: 'A',
Ẳ: 'A',
Ẵ: 'A',
Ặ: 'A',
Æ: 'AE',
Ầ: 'A',
Ằ: 'A',
Ȃ: 'A',
Ả: 'A',
Ạ: 'A',
Ẩ: 'A',
Ẫ: 'A',
Ậ: 'A',
Ç: 'C',
Ḉ: 'C',
È: 'E',
É: 'E',
Ê: 'E',
Ë: 'E',
Ế: 'E',
Ḗ: 'E',
Ề: 'E',
Ḕ: 'E',
Ḝ: 'E',
Ȇ: 'E',
Ẻ: 'E',
Ẽ: 'E',
Ẹ: 'E',
Ể: 'E',
Ễ: 'E',
Ệ: 'E',
Ì: 'I',
Í: 'I',
Î: 'I',
Ï: 'I',
Ḯ: 'I',
Ȋ: 'I',
Ỉ: 'I',
Ị: 'I',
Ð: 'D',
Ñ: 'N',
Ò: 'O',
Ó: 'O',
Ô: 'O',
Õ: 'O',
Ö: 'O',
Ø: 'O',
Ố: 'O',
Ṍ: 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'e',
Ȉ: 'I',
ȉ: 'i',
Ȍ: 'O',
ȍ: 'o',
Ȑ: 'R',
ȑ: 'r',
Ȕ: 'U',
ȕ: 'u',
B̌: 'B',
b̌: 'b',
Č̣: 'C',
č̣: 'c',
Ê̌: 'E',
ê̌: 'e',
F̌: 'F',
f̌: 'f',
Ǧ: 'G',
ǧ: 'g',
Ȟ: 'H',
ȟ: 'h',
J̌: 'J',
ǰ: 'j',
Ǩ: 'K',
ǩ: 'k',
M̌: 'M',
m̌: 'm',
P̌: 'P',
p̌: 'p',
Q̌: 'Q',
q̌: 'q',
Ř̩: 'R',
ř̩: 'r',
Ṧ: 'S',
ṧ: 's',
V̌: 'V',
v̌: 'v',
W̌: 'W',
w̌: 'w',
X̌: 'X',
x̌: 'x',
Y̌: 'Y',
y̌: 'y',
A̧: 'A',
a̧: 'a',
B̧: 'B',
b̧: 'b',
Ḑ: 'D',
ḑ: 'd',
Ȩ: 'E',
ȩ: 'e',
Ɛ̧: 'E',
ɛ̧: 'e',
Ḩ: 'H',
ḩ: 'h',
I̧: 'I',
i̧: 'i',
Ɨ̧: 'I',
ɨ̧: 'i',
M̧: 'M',
m̧: 'm',
O̧: 'O',
o̧: 'o',
Q̧: 'Q',
q̧: 'q',
U̧: 'U',
u̧: 'u',
X̧: 'X',
x̧: 'x',
Z̧: 'Z',
z̧: 'z',
й: 'и',
Й: 'И',
ё: 'е',
Ё: 'Е',
};
const removeAccentsRegex = new RegExp(Object.keys(characterMap).join('|'), 'g');
function removeAccents(string) {
return string.replace(removeAccentsRegex, (char) => {
return characterMap[char];
});
}
const rankings = {
CASE_SENSITIVE_EQUAL: 7,
EQUAL: 6,
STARTS_WITH: 5,
WORD_STARTS_WITH: 4,
CONTAINS: 3,
ACRONYM: 2,
MATCHES: 1,
NO_MATCH: 0,
};
const defaultBaseSortFn = (a, b) => String(a.rankedValue).localeCompare(String(b.rankedValue));
function matchSorter(items, value, options = {}) {
const { keys, threshold = rankings.MATCHES, baseSort = defaultBaseSortFn, sorter = (matchedItems) => matchedItems.sort((a, b) => sortRankedValues(a, b, baseSort)), } = options;
const matchedItems = items.reduce(reduceItemsToRanked, []);
return sorter(matchedItems).map(({ item }) => item);
function reduceItemsToRanked(matches, item, index) {
const rankingInfo = getHighestRanking(item, keys, value, options);
const { rank, keyThreshold = threshold } = rankingInfo;
if (rank >= keyThreshold) {
matches.push({ ...rankingInfo, item, index });
}
return matches;
}
}
matchSorter.rankings = rankings;
function getHighestRanking(item, keys, value, options) {
if (!keys) {
const stringItem = item;
return {
rankedValue: stringItem,
rank: getMatchRanking(stringItem, value, options),
keyIndex: -1,
keyThreshold: options.threshold,
};
}
const valuesToRank = getAllValuesToRank(item, keys);
return valuesToRank.reduce(({ rank, rankedValue, keyIndex, keyThreshold }, { itemValue, attributes }, i) => {
let newRank = getMatchRanking(itemValue, value, options);
let newRankedValue = rankedValue;
const { minRanking, maxRanking, threshold } = attributes;
if (newRank < minRanking && newRank >= rankings.MATCHES) {
newRank = minRanking;
}
else if (newRank > maxRanking) {
newRank = maxRanking;
}
if (newRank > rank) {
rank = newRank;
keyIndex = i;
keyThreshold = threshold;
newRankedValue = itemValue;
}
return { rankedValue: newRankedValue, rank, keyIndex, keyThreshold };
}, {
rankedValue: item,
rank: rankings.NO_MATCH,
keyIndex: -1,
keyThreshold: options.threshold,
});
}
function getMatchRanking(testString, stringToRank, options) {
testString = prepareValueForComparison(testString, options);
stringToRank = prepareValueForComparison(stringToRank, options);
if (stringToRank.length > testString.length) {
return rankings.NO_MATCH;
}
if (testString === stringToRank) {
return rankings.CASE_SENSITIVE_EQUAL;
}
testString = testString.toLowerCase();
stringToRank = stringToRank.toLowerCase();
if (testString === stringToRank) {
return rankings.EQUAL;
}
if (testString.startsWith(stringToRank)) {
return rankings.STARTS_WITH;
}
if (testString.includes(` ${stringToRank}`)) {
return rankings.WORD_STARTS_WITH;
}
if (testString.includes(stringToRank)) {
return rankings.CONTAINS;
}
else if (stringToRank.length === 1) {
return rankings.NO_MATCH;
}
if (getAcronym(testString).includes(stringToRank)) {
return rankings.ACRONYM;
}
return getClosenessRanking(testString, stringToRank);
}
function getAcronym(string) {
let acronym = '';
const wordsInString = string.split(' ');
for (const wordInString of wordsInString) {
const splitByHyphenWords = wordInString.split('-');
for (const splitByHyphenWord of splitByHyphenWords) {
acronym += splitByHyphenWord.substr(0, 1);
}
}
return acronym;
}
function getClosenessRanking(testString, stringToRank) {
let matchingInOrderCharCount = 0;
let charNumber = 0;
function findMatchingCharacter(matchChar, string, index) {
for (let j = index, J = string.length; j < J; j++) {
const stringChar = string[j];
if (stringChar === matchChar) {
matchingInOrderCharCount += 1;
return j + 1;
}
}
return -1;
}
function getRanking(spread) {
const spreadPercentage = 1 / spread;
const inOrderPercentage = matchingInOrderCharCount / stringToRank.length;
const ranking = rankings.MATCHES + inOrderPercentage * spreadPercentage;
return ranking;
}
const firstIndex = findMatchingCharacter(stringToRank[0], testString, 0);
if (firstIndex < 0) {
return rankings.NO_MATCH;
}
charNumber = firstIndex;
for (let i = 1, I = stringToRank.length; i < I; i++) {
const matchChar = stringToRank[i];
charNumber = findMatchingCharacter(matchChar, testString, charNumber);
const found = charNumber > -1;
if (!found) {
return rankings.NO_MATCH;
}
}
const spread = charNumber - firstIndex;
return getRanking(spread);
}
function sortRankedValues(a, b, baseSort) {
const aFirst = -1;
const bFirst = 1;
const { rank: aRank, keyIndex: aKeyIndex } = a;
const { rank: bRank, keyIndex: bKeyIndex } = b;
const same = aRank === bRank;
if (same) {
if (aKeyIndex === bKeyIndex) {
return baseSort(a, b);
}
else {
return aKeyIndex < bKeyIndex ? aFirst : bFirst;
}
}
else {
return aRank > bRank ? aFirst : bFirst;
}
}
function prepareValueForComparison(value, { keepDiacritics }) {
value = `${value}`;
if (!keepDiacritics) {
value = removeAccents(value);
}
return value;
}
function getItemValues(item, key) {
if (typeof key === 'object') {
key = key.key;
}
let value;
if (typeof key === 'function') {
value = key(item);
}
else if (item == null) {
value = null;
}
else if (Object.hasOwn(item, key)) {
value = item[key];
}
else if (key.includes('.')) {
return getNestedValues(key, item);
}
else {
value = null;
}
if (value == null) {
return [];
}
if (Array.isArray(value)) {
return value;
}
return [String(value)];
}
function getNestedValues(path, item) {
const keys = path.split('.');
let values = [item];
for (let i = 0, I = keys.length; i < I; i++) {
const nestedKey = keys[i];
let nestedValues = [];
for (let j = 0, J = values.length; j < J; j++) {
const nestedItem = values[j];
if (nestedItem == null)
continue;
if (Object.hasOwn(nestedItem, nestedKey)) {
const nestedValue = nestedItem[nestedKey];
if (nestedValue != null) {
nestedValues.push(nestedValue);
}
}
else if (nestedKey === '*') {
nestedValues = nestedValues.concat(nestedItem);
}
}
values = nestedValues;
}
if (Array.isArray(values[0])) {
const result = [];
return result.concat(...values);
}
return values;
}
function getAllValuesToRank(item, keys) {
const allValues = [];
for (let j = 0, J = keys.length; j < J; j++) {
const key = keys[j];
const attributes = getKeyAttributes(key);
const itemValues = getItemValues(item, key);
for (let i = 0, I = itemValues.length; i < I; i++) {
allValues.push({
itemValue: itemValues[i],
attributes,
});
}
}
return allValues;
}
const defaultKeyAttributes = {
maxRanking: Infinity,
minRanking: -Infinity,
};
function getKeyAttributes(key) {
if (typeof key === 'string') {
return defaultKeyAttributes;
}
return { ...defaultKeyAttributes, ...key };
}
function init$3(elements) {
elements.sidebarHeader.prepend(elements.searchBar);
window.addEventListener('keydown', () => {
if (document.activeElement !== elements.searchBar) {
elements.searchBar.focus();
}
});
elements.searchBar.addEventListener('input', (e) => {
if (e.inputType === 'insertText' &&
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.searchQuery.trim().length === 1) {
elements.sidebar.scrollTo(0, 0);
}
});
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._computedWatchers.sortedElements.getter =
exportFunction(() => {
const query = unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.searchQuery.trim();
if (query === '') {
const elements = [...unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.elements];
if (unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.showDiscoveredOnly) {
return cloneInto(elements.filter((el) => el.discovered), unsafeWindow);
}
if (unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.sortBy === 'name') {
return cloneInto(elements, unsafeWindow).sort((a, b) => a.text.localeCompare(b.text, undefined, { numeric: true }));
}
if (unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.sortBy === 'emoji') {
return cloneInto(elements, unsafeWindow).sort((a, b) => {
const emojiA = a.emoji ?? '⬜';
const emojiB = b.emoji ?? '⬜';
return emojiA.localeCompare(emojiB);
});
}
return unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.elements;
}
else {
return cloneInto(matchSorter(cloneInto(unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.elements, unsafeWindow), unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.searchQuery, {
keys: ['text'],
}), unsafeWindow);
}
}, unsafeWindow);
}
function init$2(elements) {
const randomImage = document.createElement('img');
randomImage.src = randomIcon.trim();
randomImage.classList.add('random');
elements.sideControls.appendChild(randomImage);
randomImage.addEventListener('click', (e) => {
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].playInstanceSound();
const randomElement = unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.elements[Math.floor(Math.random() * unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.elements.length)];
const data = {
id: unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.instanceId++,
text: randomElement.text,
emoji: randomElement.emoji,
discovered: randomElement.discovered,
disabled: false,
left: 0,
top: 0,
offsetX: 0.5,
offsetY: 0.5,
};
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance = cloneInto(data, unsafeWindow);
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.instances.push(unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance);
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].$nextTick(exportFunction(() => {
const randomPosition = Math.random() * Math.PI * 2;
const cos = 50 * Math.cos(randomPosition);
const sin = 50 * Math.sin(randomPosition);
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].setInstancePosition(unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance, (window.innerWidth - unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.sidebarSize) / 2 +
cos, window.innerHeight / 2 - 40 + sin);
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].setInstanceZIndex(unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance, data.id);
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].calcInstanceSize(unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.selectedInstance);
}, unsafeWindow));
});
}
function init$1(elements) {
elements.logo.src = logo.trim();
const versionNumber = document.createElement('p');
versionNumber.appendChild(document.createTextNode(`v${GM.info.script.version}`));
versionNumber.classList.add('version');
elements.logo.after(versionNumber);
}
let theme = 'shadow';
const shadowCSS = `
.container.dark-mode {
--border-color: #525252 !important;
--item-bg: #18181b !important;
--instance-bg: linear-gradient(180deg,#22252b,#18181b 80%) !important;
--instance-bg-hover: linear-gradient(180deg,#3d4249,#18181b 80%) !important;
--instance-border: #525252 !important;
--instance-border-hover: #a3a3a3 !important;
--sidebar-bg: #18181b !important;
--background-color: #18181b !important;
--discoveries-bg-active: #423a24 !important;
--text-color: #fff !important;
}
.dark-mode {
scrollbar-color: #525252 #262626 !important;
}
.dark-mode .sidebar-controls:after {
background: linear-gradient(180deg, rgba(24,24,27,0), rgba(24,24,27,.9)) !important;
}
`;
const shadowStyles = document.createElement('style');
shadowStyles.appendChild(document.createTextNode(shadowCSS.trim()));
async function init(elements) {
const oldTheme = localStorage.getItem('theme');
if (oldTheme !== null && oldTheme === 'light')
theme = 'light';
localStorage.removeItem('theme');
const storedTheme = await GM.getValue('theme');
if (storedTheme === 'light')
theme = 'light';
if (storedTheme === 'dark')
theme = 'dark';
await GM.setValue('theme', theme);
if (theme === 'light' && unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.isDarkMode) {
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].toggleDarkMode();
}
else if (theme === 'shadow' && !unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.isDarkMode) {
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].toggleDarkMode();
}
else if (theme === 'dark' && !unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0]._data.isDarkMode) {
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].toggleDarkMode();
}
if (theme === 'shadow') {
document.getElementsByTagName('head')[0].appendChild(shadowStyles);
}
const darkModeIcon = elements.darkModeIcon.cloneNode(true);
darkModeIcon.src = shadowIcon;
if (theme === 'light')
darkModeIcon.src = '/infinite-craft/dark-mode.svg';
if (theme === 'dark')
darkModeIcon.src = '/infinite-craft/dark-mode-on.svg';
elements.darkModeIcon.parentNode?.replaceChild(darkModeIcon, elements.darkModeIcon);
const toggleDarkMode = unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].toggleDarkMode;
unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].toggleDarkMode = exportFunction(async () => {
if (theme === 'light') {
toggleDarkMode();
darkModeIcon.src = shadowIcon;
document.getElementsByTagName('head')[0].appendChild(shadowStyles);
theme = 'shadow';
}
else if (theme === 'shadow') {
darkModeIcon.src = '/infinite-craft/dark-mode-on.svg';
shadowStyles.remove();
theme = 'dark';
}
else if (theme === 'dark') {
toggleDarkMode();
darkModeIcon.src = '/infinite-craft/dark-mode.svg';
theme = 'light';
}
await GM.setValue('theme', theme);
}, unsafeWindow);
darkModeIcon.addEventListener('click', unsafeWindow.$nuxt.$root.$children[1].$children[0].$children[0].toggleDarkMode);
}
window.addEventListener('load', async () => {
const sidebarHeader = document.createElement('div');
sidebarHeader.classList.add('sidebar-header');
const settingsContent = document.createElement('div');
settingsContent.classList.add('settings-content');
const elements = {
favicon: document.querySelector('link[rel="icon"]'),
container: document.querySelector('.container'),
instances: document.querySelector('.instances'),
styles: document.createElement('style'),
sideControls: document.querySelector('.side-controls'),
darkModeIcon: document.querySelector('.dark-mode-icon'),
sidebar: document.querySelector('.sidebar'),
sidebarHeader: sidebarHeader,
searchBar: document.querySelector('.sidebar-search'),
settingsContent: settingsContent,
items: document.querySelector('.items'),
getItems: () => {
return Array.from(document.querySelectorAll('.items div.item'));
},
instruction: document.querySelector('.instruction'),
sort: document.querySelector('.sort'),
particles: document.querySelector('.particles'),
logo: document.querySelector('.logo'),
};
elements.items.before(elements.sidebarHeader);
init$d(elements);
init$c(elements);
init$b(elements);
init$6(elements);
init$8(elements);
init$5(elements);
init$4(elements);
init$3(elements);
init$7(elements);
init$2(elements);
await init$a(elements);
init$9(elements);
init$1(elements);
init(elements);
}, false);
window.addEventListener('contextmenu', (e) => {
e.preventDefault();
});
})();