diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css
index 17d3f26..d30fb57 100644
--- a/dist/BlueMarble-For-GreasyFork.user.css
+++ b/dist/BlueMarble-For-GreasyFork.user.css
@@ -726,6 +726,9 @@ input[type=file] {
rgba(186, 246, 255, 0.12),
transparent 22%);
}
+#bm-window-filter .bm-filter-color-toggle {
+ cursor: pointer;
+}
#bm-window-filter .bm-filter-color:hover,
#bm-window-filter .bm-filter-color:focus-within {
transform: translateY(-2px);
@@ -737,6 +740,14 @@ input[type=file] {
rgba(186, 246, 255, 0.1));
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 24px rgba(0, 0, 0, 0.1);
}
+#bm-window-filter .bm-filter-color-toggle:focus-visible {
+ outline: none;
+ border-color: rgba(116, 231, 255, 0.62);
+ box-shadow:
+ 0 0 0 3px rgba(116, 231, 255, 0.15),
+ inset 0 1px 0 rgba(255, 255, 255, 0.2),
+ 0 10px 24px rgba(0, 0, 0, 0.1);
+}
#bm-window-filter .bm-filter-container-rgb {
display: block;
width: fit-content;
@@ -1204,4 +1215,4 @@ input[type=file] {
/* src/main.css */
-/* Build Hash: af601d626afd */
+/* Build Hash: 741f270e99de */
diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js
index 1c896d1..268dc2c 100644
--- a/dist/BlueMarble-For-GreasyFork.user.js
+++ b/dist/BlueMarble-For-GreasyFork.user.js
@@ -1718,7 +1718,7 @@
// src/WindowSettings.js
var closeIcon = '';
- var _WindowSettings_instances, errorOverrideFailure_fn;
+ var _WindowSettings_instances, getWindowState_fn, closeWindow_fn, clampWindowPosition_fn, restoreWindowPosition_fn, saveWindowPosition_fn, initializeWindowPositionPersistence_fn, errorOverrideFailure_fn;
var WindowSettings = class extends Overlay {
/** Constructor for the Settings window
* @param {string} name - The name of the userscript
@@ -1732,6 +1732,7 @@
this.window = null;
this.windowID = "bm-window-settings";
this.windowParent = document.body;
+ this.windowStateKey = "windowSettings";
}
/** Spawns a Settings window.
* If another settings window already exists, we DON'T spawn another!
@@ -1740,7 +1741,7 @@
*/
buildWindow() {
if (document.querySelector(`#${this.windowID}`)) {
- document.querySelector(`#${this.windowID}`).remove();
+ __privateMethod(this, _WindowSettings_instances, closeWindow_fn).call(this);
return;
}
this.window = this.addDiv({ "id": this.windowID, "class": "bm-window" }).addDragbar().addButton({ "class": "bm-button-circle", "innerHTML": minimizeIconExpanded, "aria-label": 'Minimize window "Settings"', "data-button-status": "expanded" }, (instance, button) => {
@@ -1749,9 +1750,7 @@
button.click();
};
}).buildElement().addDiv().buildElement().addDiv({ "class": "bm-flex-center" }).addButton({ "class": "bm-button-circle", "innerHTML": closeIcon, "aria-label": 'Close window "Settings"' }, (instance, button) => {
- button.onclick = () => {
- document.querySelector(`#${this.windowID}`)?.remove();
- };
+ button.onclick = () => __privateMethod(this, _WindowSettings_instances, closeWindow_fn).call(this);
button.ontouchend = () => {
button.click();
};
@@ -1759,7 +1758,7 @@
this.buildHighlight();
this.buildTemplate();
}).buildElement().buildElement().buildElement().buildOverlay(this.windowParent);
- this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`);
+ __privateMethod(this, _WindowSettings_instances, initializeWindowPositionPersistence_fn).call(this);
}
/** Builds the highlight section of the window.
* This should be overriden by {@link SettingsManager}
@@ -1777,6 +1776,104 @@
}
};
_WindowSettings_instances = new WeakSet();
+ /** Retrieves the persisted settings window state object.
+ * @returns {Object | null}
+ * @since 0.95.0
+ */
+ getWindowState_fn = function() {
+ var _a, _b;
+ if (!this.userSettings) {
+ return null;
+ }
+ (_a = this.userSettings)[_b = this.windowStateKey] ?? (_a[_b] = {});
+ return this.userSettings[this.windowStateKey];
+ };
+ /** Immediately closes the settings window and saves its position.
+ * @since 0.95.0
+ */
+ closeWindow_fn = function() {
+ const windowElement = document.querySelector(`#${this.windowID}`);
+ __privateMethod(this, _WindowSettings_instances, saveWindowPosition_fn).call(this, windowElement);
+ windowElement?.remove();
+ };
+ /** Returns a viewport-safe position for the settings window.
+ * @param {HTMLElement} windowElement
+ * @param {number} x
+ * @param {number} y
+ * @returns {{x: number, y: number}}
+ * @since 0.95.0
+ */
+ clampWindowPosition_fn = function(windowElement, x, y) {
+ const margin = 8;
+ const maxX = Math.max(margin, window.innerWidth - windowElement.offsetWidth - margin);
+ const maxY = Math.max(margin, window.innerHeight - windowElement.offsetHeight - margin);
+ return {
+ x: Math.min(Math.max(Math.round(Number(x) || margin), margin), maxX),
+ y: Math.min(Math.max(Math.round(Number(y) || margin), margin), maxY)
+ };
+ };
+ /** Restores the persisted position for the settings window.
+ * @param {HTMLElement} windowElement
+ * @since 0.95.0
+ */
+ restoreWindowPosition_fn = function(windowElement) {
+ const windowState = __privateMethod(this, _WindowSettings_instances, getWindowState_fn).call(this);
+ if (!windowState || !windowElement) {
+ return;
+ }
+ requestAnimationFrame(() => {
+ if (!windowElement.isConnected) {
+ return;
+ }
+ const x = Number(windowState.x);
+ const y = Number(windowState.y);
+ if (!Number.isFinite(x) || !Number.isFinite(y)) {
+ return;
+ }
+ const clampedPosition = __privateMethod(this, _WindowSettings_instances, clampWindowPosition_fn).call(this, windowElement, x, y);
+ windowElement.style.left = "0px";
+ windowElement.style.top = "0px";
+ windowElement.style.right = "";
+ windowElement.style.transform = `translate(${clampedPosition.x}px, ${clampedPosition.y}px)`;
+ if (clampedPosition.x != x || clampedPosition.y != y) {
+ windowState.x = clampedPosition.x;
+ windowState.y = clampedPosition.y;
+ void this.saveUserStorageNow?.();
+ }
+ });
+ };
+ /** Saves the current position of the settings window.
+ * @param {HTMLElement} windowElement
+ * @since 0.95.0
+ */
+ saveWindowPosition_fn = function(windowElement) {
+ const windowState = __privateMethod(this, _WindowSettings_instances, getWindowState_fn).call(this);
+ if (!windowState || !windowElement?.isConnected) {
+ return;
+ }
+ const rect = windowElement.getBoundingClientRect();
+ const clampedPosition = __privateMethod(this, _WindowSettings_instances, clampWindowPosition_fn).call(this, windowElement, rect.left, rect.top);
+ windowElement.style.left = "0px";
+ windowElement.style.top = "0px";
+ windowElement.style.right = "";
+ windowElement.style.transform = `translate(${clampedPosition.x}px, ${clampedPosition.y}px)`;
+ windowState.x = clampedPosition.x;
+ windowState.y = clampedPosition.y;
+ void this.saveUserStorageNow?.();
+ };
+ /** Enables position persistence for the settings window.
+ * @since 0.95.0
+ */
+ initializeWindowPositionPersistence_fn = function() {
+ const windowElement = document.querySelector(`#${this.windowID}.bm-window`);
+ if (!windowElement) {
+ return;
+ }
+ __privateMethod(this, _WindowSettings_instances, restoreWindowPosition_fn).call(this, windowElement);
+ this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`, {
+ onEnd: ({ element }) => __privateMethod(this, _WindowSettings_instances, saveWindowPosition_fn).call(this, element)
+ });
+ };
/** Displays an error when a settings category fails to load.
* @param {string} name - The name of the category
* @since 0.91.11
@@ -2351,7 +2448,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
var closeIcon2 = '';
var fullscreenIcon = '';
var windowedIcon = '';
- var _WindowFilter_instances, getWindowState_fn, prefersWindowedMode_fn, setWindowModePreference_fn, syncSortFormControls_fn, closeWindow_fn, startAutoRefresh_fn, stopAutoRefresh_fn, cleanupWindowPersistence_fn, clampWindowDimension_fn, clampWindowPosition_fn, restoreWindowState_fn, saveWindowState_fn, scheduleWindowStateSave_fn, initializeWindowedPersistence_fn, buildColorList_fn, sortColorList_fn, selectColorList_fn, calculatePixelStatistics_fn;
+ var _WindowFilter_instances, getWindowState_fn2, prefersWindowedMode_fn, setWindowModePreference_fn, syncSortFormControls_fn, closeWindow_fn2, startAutoRefresh_fn, stopAutoRefresh_fn, cleanupWindowPersistence_fn, clampWindowDimension_fn, clampWindowPosition_fn2, restoreWindowState_fn, saveWindowState_fn, scheduleWindowStateSave_fn, initializeWindowedPersistence_fn, buildColorList_fn, sortColorList_fn, selectColorList_fn, syncColorToggleLabel_fn, toggleColorVisibility_fn, initializeColorBlockToggle_fn, calculatePixelStatistics_fn;
var WindowFilter = class extends Overlay {
/** Constructor for the color filter window
* @param {*} executor - The executing class
@@ -2411,7 +2508,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
*/
buildWindow() {
if (document.querySelector(`#${this.windowID}`)) {
- __privateMethod(this, _WindowFilter_instances, closeWindow_fn).call(this);
+ __privateMethod(this, _WindowFilter_instances, closeWindow_fn2).call(this);
return;
}
this.window = this.addDiv({ "id": this.windowID, "class": "bm-window" }, (instance, div) => {
@@ -2423,14 +2520,14 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
}).buildElement().addDiv().buildElement().addDiv({ "class": "bm-flex-center" }).addButton({ "class": "bm-button-circle", "innerHTML": windowedIcon, "aria-label": 'Switch to windowed mode for "Color Filter"' }, (instance, button) => {
button.onclick = () => {
__privateMethod(this, _WindowFilter_instances, setWindowModePreference_fn).call(this, true);
- __privateMethod(this, _WindowFilter_instances, closeWindow_fn).call(this);
+ __privateMethod(this, _WindowFilter_instances, closeWindow_fn2).call(this);
this.buildWindowed();
};
button.ontouchend = () => {
button.click();
};
}).buildElement().addButton({ "class": "bm-button-circle", "innerHTML": closeIcon2, "aria-label": 'Close window "Color Filter"' }, (instance, button) => {
- button.onclick = () => __privateMethod(this, _WindowFilter_instances, closeWindow_fn).call(this);
+ button.onclick = () => __privateMethod(this, _WindowFilter_instances, closeWindow_fn2).call(this);
button.ontouchend = () => {
button.click();
};
@@ -2469,7 +2566,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
*/
buildWindowed() {
if (document.querySelector(`#${this.windowID}`)) {
- __privateMethod(this, _WindowFilter_instances, closeWindow_fn).call(this);
+ __privateMethod(this, _WindowFilter_instances, closeWindow_fn2).call(this);
return;
}
this.window = this.addDiv({
@@ -2490,14 +2587,14 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
}).buildElement().addDiv().addSpan({ "id": "bm-filter-windowed-color-totals", "class": "bm-dragbar-text", "style": "font-weight: 700;" }).buildElement().buildElement().addDiv({ "class": "bm-flex-center" }).addButton({ "class": "bm-button-circle", "innerHTML": fullscreenIcon, "aria-label": 'Switch to fullscreen mode for "Color Filter"' }, (instance, button) => {
button.onclick = () => {
__privateMethod(this, _WindowFilter_instances, setWindowModePreference_fn).call(this, false);
- __privateMethod(this, _WindowFilter_instances, closeWindow_fn).call(this);
+ __privateMethod(this, _WindowFilter_instances, closeWindow_fn2).call(this);
this.buildWindow();
};
button.ontouchend = () => {
button.click();
};
}).buildElement().addButton({ "class": "bm-button-circle", "innerHTML": closeIcon2, "aria-label": 'Close window "Color Filter"' }, (instance, button) => {
- button.onclick = () => __privateMethod(this, _WindowFilter_instances, closeWindow_fn).call(this);
+ button.onclick = () => __privateMethod(this, _WindowFilter_instances, closeWindow_fn2).call(this);
button.ontouchend = () => {
button.click();
};
@@ -2609,7 +2706,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
* @returns {Object | null}
* @since 0.92.0
*/
- getWindowState_fn = function() {
+ getWindowState_fn2 = function() {
var _a, _b;
if (!this.settingsManager) {
return null;
@@ -2623,7 +2720,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
* @since 0.92.1
*/
prefersWindowedMode_fn = function() {
- const windowState = __privateMethod(this, _WindowFilter_instances, getWindowState_fn).call(this);
+ const windowState = __privateMethod(this, _WindowFilter_instances, getWindowState_fn2).call(this);
if (windowState?.mode == "windowed") {
return true;
}
@@ -2637,7 +2734,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
* @since 0.92.0
*/
setWindowModePreference_fn = function(shouldBeWindowed) {
- const windowState = __privateMethod(this, _WindowFilter_instances, getWindowState_fn).call(this);
+ const windowState = __privateMethod(this, _WindowFilter_instances, getWindowState_fn2).call(this);
if (windowState) {
windowState.mode = shouldBeWindowed ? "windowed" : "fullscreen";
}
@@ -2667,7 +2764,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
/** Immediately closes the filter window and cleans up persistence observers.
* @since 0.92.0
*/
- closeWindow_fn = function() {
+ closeWindow_fn2 = function() {
const windowElement = document.querySelector(`#${this.windowID}`);
if (windowElement?.classList.contains("bm-windowed")) {
__privateMethod(this, _WindowFilter_instances, saveWindowState_fn).call(this, windowElement);
@@ -2734,7 +2831,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
* @returns {{x: number, y: number}}
* @since 0.92.0
*/
- clampWindowPosition_fn = function(windowElement, x, y) {
+ clampWindowPosition_fn2 = function(windowElement, x, y) {
const margin = 8;
const maxX = Math.max(margin, window.innerWidth - windowElement.offsetWidth - margin);
const maxY = Math.max(margin, window.innerHeight - windowElement.offsetHeight - margin);
@@ -2748,7 +2845,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
* @since 0.92.0
*/
restoreWindowState_fn = function(windowElement) {
- const windowState = __privateMethod(this, _WindowFilter_instances, getWindowState_fn).call(this);
+ const windowState = __privateMethod(this, _WindowFilter_instances, getWindowState_fn2).call(this);
if (!windowState || !windowElement) {
return;
}
@@ -2773,7 +2870,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
if (!Number.isFinite(x) || !Number.isFinite(y)) {
return;
}
- const clampedPosition = __privateMethod(this, _WindowFilter_instances, clampWindowPosition_fn).call(this, windowElement, x, y);
+ const clampedPosition = __privateMethod(this, _WindowFilter_instances, clampWindowPosition_fn2).call(this, windowElement, x, y);
windowElement.style.left = "0px";
windowElement.style.top = "0px";
windowElement.style.right = "";
@@ -2790,7 +2887,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
* @since 0.92.0
*/
saveWindowState_fn = function(windowElement) {
- const windowState = __privateMethod(this, _WindowFilter_instances, getWindowState_fn).call(this);
+ const windowState = __privateMethod(this, _WindowFilter_instances, getWindowState_fn2).call(this);
if (!windowState || !windowElement?.isConnected || !windowElement.classList.contains("bm-windowed")) {
return;
}
@@ -2806,7 +2903,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
if (Math.round(rect.height) != height) {
windowElement.style.height = `${height}px`;
}
- const clampedPosition = __privateMethod(this, _WindowFilter_instances, clampWindowPosition_fn).call(this, windowElement, rect.left, rect.top);
+ const clampedPosition = __privateMethod(this, _WindowFilter_instances, clampWindowPosition_fn2).call(this, windowElement, rect.left, rect.top);
windowElement.style.left = "0px";
windowElement.style.top = "0px";
windowElement.style.right = "";
@@ -2897,7 +2994,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
"data-total": colorTotal,
"data-percent": colorPercent.slice(-1) == "%" ? colorPercent.slice(0, -1) : "0",
"data-incorrect": colorIncorrect || 0
- }).addDiv({ "class": "bm-filter-container-rgb", "style": `background-color: rgb(${color.rgb?.map((channel) => Number(channel) || 0).join(",")});${color.premium ? styleBackgroundStar : ""}` }).addButton(
+ }, (instance, div) => __privateMethod(this, _WindowFilter_instances, initializeColorBlockToggle_fn).call(this, div, color)).addDiv({ "class": "bm-filter-container-rgb", "style": `background-color: rgb(${color.rgb?.map((channel) => Number(channel) || 0).join(",")});${color.premium ? styleBackgroundStar : ""}` }).addButton(
{
"class": "bm-button-trans " + bgEffectForButtons,
"data-state": isColorHidden ? "hidden" : "shown",
@@ -2906,26 +3003,14 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
"style": `color: ${textColorForPaletteColorBackground};`
},
(instance, button) => {
- button.onclick = () => {
- button.style.textDecoration = "none";
- button.disabled = true;
- if (button.dataset["state"] == "shown") {
- button.innerHTML = this.eyeClosed;
- button.dataset["state"] = "hidden";
- button.ariaLabel = `Show the color ${color.name || ""} on templates.`;
- this.templateManager.setColorFiltered(color.id, true);
- } else {
- button.innerHTML = this.eyeOpen;
- button.dataset["state"] = "shown";
- button.ariaLabel = `Hide the color ${color.name || ""} on templates.`;
- this.templateManager.setColorFiltered(color.id, false);
- }
- button.disabled = false;
- button.style.textDecoration = "";
+ button.onclick = (event) => {
+ event.stopPropagation();
+ __privateMethod(this, _WindowFilter_instances, toggleColorVisibility_fn).call(this, button, color);
};
if (!color.id) {
button.disabled = true;
}
+ __privateMethod(this, _WindowFilter_instances, syncColorToggleLabel_fn).call(this, button, color);
}
).buildElement().addSmall({ "textContent": `#${color.id.toString().padStart(2, 0)}`, "style": `color: ${color.id == -1 || color.id == 0 ? "white" : textColorForPaletteColorBackground}` }).buildElement().addHeader(2, { "textContent": color.name, "style": `color: ${color.id == -1 || color.id == 0 ? "white" : textColorForPaletteColorBackground}` }).buildElement().addSmall({ "class": "bm-filter-color-pxl-cnt", "textContent": `${colorCorrectLocalized} / ${colorTotalLocalized}`, "style": `color: ${color.id == -1 || color.id == 0 ? "white" : textColorForPaletteColorBackground}; flex: 1 1 auto; text-align: right;` }).buildElement().buildElement().buildElement();
} else {
@@ -2938,7 +3023,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
"data-total": colorTotal,
"data-percent": colorPercent.slice(-1) == "%" ? colorPercent.slice(0, -1) : "0",
"data-incorrect": colorIncorrect || 0
- }).addDiv({ "class": "bm-flex-center", "style": "flex-direction: column;" }).addDiv({ "class": "bm-filter-container-rgb", "style": `background-color: rgb(${color.rgb?.map((channel) => Number(channel) || 0).join(",")});` }).addButton(
+ }, (instance, div) => __privateMethod(this, _WindowFilter_instances, initializeColorBlockToggle_fn).call(this, div, color)).addDiv({ "class": "bm-flex-center", "style": "flex-direction: column;" }).addDiv({ "class": "bm-filter-container-rgb", "style": `background-color: rgb(${color.rgb?.map((channel) => Number(channel) || 0).join(",")});` }).addButton(
{
"class": "bm-button-trans " + bgEffectForButtons,
"data-state": isColorHidden ? "hidden" : "shown",
@@ -2947,26 +3032,14 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
"style": `color: ${textColorForPaletteColorBackground};`
},
(instance, button) => {
- button.onclick = () => {
- button.style.textDecoration = "none";
- button.disabled = true;
- if (button.dataset["state"] == "shown") {
- button.innerHTML = this.eyeClosed;
- button.dataset["state"] = "hidden";
- button.ariaLabel = `Show the color ${color.name || ""} on templates.`;
- this.templateManager.setColorFiltered(color.id, true);
- } else {
- button.innerHTML = this.eyeOpen;
- button.dataset["state"] = "shown";
- button.ariaLabel = `Hide the color ${color.name || ""} on templates.`;
- this.templateManager.setColorFiltered(color.id, false);
- }
- button.disabled = false;
- button.style.textDecoration = "";
+ button.onclick = (event) => {
+ event.stopPropagation();
+ __privateMethod(this, _WindowFilter_instances, toggleColorVisibility_fn).call(this, button, color);
};
if (!color.id) {
button.disabled = true;
}
+ __privateMethod(this, _WindowFilter_instances, syncColorToggleLabel_fn).call(this, button, color);
}
).buildElement().buildElement().addSmall({ "textContent": color.id == -2 ? "???????" : colorValueHex }).buildElement().buildElement().addDiv({ "class": "bm-flex-between" }).addHeader(2, { "textContent": (color.premium ? "\u2605 " : "") + color.name }).buildElement().addDiv({ "class": "bm-flex-between", "style": "gap: 1.5ch;" }).addSmall({ "textContent": `#${color.id.toString().padStart(2, 0)}` }).buildElement().addSmall({ "class": "bm-filter-color-pxl-cnt", "textContent": `${colorCorrectLocalized} / ${colorTotalLocalized}` }).buildElement().buildElement().addP({ "class": "bm-filter-color-pxl-desc", "textContent": `${typeof colorIncorrect == "number" && !isNaN(colorIncorrect) ? colorIncorrect : "???"} incorrect pixel${colorIncorrect == 1 ? "" : "s"}. Completed: ${colorPercent}` }).buildElement().buildElement().buildElement();
}
@@ -3030,6 +3103,67 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`);
button.click();
}
};
+ /** Updates the color toggle labels on the icon and the clickable color block.
+ * @param {HTMLButtonElement} button - The color visibility button
+ * @param {Object} color - Palette color metadata
+ * @since 0.95.0
+ */
+ syncColorToggleLabel_fn = function(button, color) {
+ const ariaLabel = button.dataset["state"] == "hidden" ? `Show the color ${color.name || ""} on templates.` : `Hide the color ${color.name || ""} on templates.`;
+ button.ariaLabel = ariaLabel;
+ button.closest(".bm-filter-color")?.setAttribute("aria-label", ariaLabel);
+ };
+ /** Toggles a color from the clickable color block or its icon.
+ * @param {HTMLButtonElement} button - The color visibility button
+ * @param {Object} color - Palette color metadata
+ * @since 0.95.0
+ */
+ toggleColorVisibility_fn = function(button, color) {
+ if (!button || button.disabled || !color.id) {
+ return;
+ }
+ button.style.textDecoration = "none";
+ button.disabled = true;
+ if (button.dataset["state"] == "shown") {
+ button.innerHTML = this.eyeClosed;
+ button.dataset["state"] = "hidden";
+ this.templateManager.setColorFiltered(color.id, true);
+ } else {
+ button.innerHTML = this.eyeOpen;
+ button.dataset["state"] = "shown";
+ this.templateManager.setColorFiltered(color.id, false);
+ }
+ __privateMethod(this, _WindowFilter_instances, syncColorToggleLabel_fn).call(this, button, color);
+ button.disabled = false;
+ button.style.textDecoration = "";
+ };
+ /** Makes a color block toggleable by pointer or keyboard.
+ * @param {HTMLElement} colorElement - The color block element
+ * @param {Object} color - Palette color metadata
+ * @since 0.95.0
+ */
+ initializeColorBlockToggle_fn = function(colorElement, color) {
+ if (!colorElement || !color.id) {
+ return;
+ }
+ colorElement.classList.add("bm-filter-color-toggle");
+ colorElement.tabIndex = 0;
+ colorElement.setAttribute("role", "button");
+ colorElement.onclick = (event) => {
+ if (event.target instanceof Element && event.target.closest("button, a, input, select, textarea")) {
+ return;
+ }
+ const button = colorElement.querySelector(".bm-filter-container-rgb button");
+ __privateMethod(this, _WindowFilter_instances, toggleColorVisibility_fn).call(this, button, color);
+ };
+ colorElement.onkeydown = (event) => {
+ if (event.key != "Enter" && event.key != " ") {
+ return;
+ }
+ event.preventDefault();
+ colorElement.click();
+ };
+ };
/** Calculates all pixel statistics used in the color filter.
* @since 0.90.34
*/
@@ -4518,4 +4652,4 @@ Time Since Blink: ${String(Math.floor(elapsed / 6e4)).padStart(2, "0")}:${String
}
})();
-// Build Hash: f31122a513fd
+// Build Hash: f552d070dbe3
diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js
index 5ba7c72..35dcd60 100644
--- a/dist/BlueMarble-Standalone.user.js
+++ b/dist/BlueMarble-Standalone.user.js
@@ -38,6 +38,6 @@
The "Blue Marble" image is owned by NASA.
*/
-(()=>{var t=t=>{throw TypeError(t)},e=(e,i,s)=>i.has(e)?t("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,s),i=(e,i,s)=>(((e,i)=>{i.has(e)||t("Cannot access private method")})(e,i),s);function s(t){return new Promise(e=>setTimeout(e,t))}function n(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let i="";const s=e.length;for(;t>0;)i=e[t%s]+i,t=Math.floor(t/s);return i}function d(t,e){let i=0;const s=e.length;for(const n of t){const t=e.indexOf(n);-1==t&&c(`Invalid character '${n}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*s+t}return i}function u(t){let e="";for(let i=0;i(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,y=[{id:0,premium:!1,name:"Transparent",rgb:[0,0,0]},{id:1,premium:!1,name:"Black",rgb:[0,0,0]},{id:2,premium:!1,name:"Dark Gray",rgb:[60,60,60]},{id:3,premium:!1,name:"Gray",rgb:[120,120,120]},{id:4,premium:!1,name:"Light Gray",rgb:[210,210,210]},{id:5,premium:!1,name:"White",rgb:[255,255,255]},{id:6,premium:!1,name:"Deep Red",rgb:[96,0,24]},{id:7,premium:!1,name:"Red",rgb:[237,28,36]},{id:8,premium:!1,name:"Orange",rgb:[255,127,39]},{id:9,premium:!1,name:"Gold",rgb:[246,170,9]},{id:10,premium:!1,name:"Yellow",rgb:[249,221,59]},{id:11,premium:!1,name:"Light Yellow",rgb:[255,250,188]},{id:12,premium:!1,name:"Dark Green",rgb:[14,185,104]},{id:13,premium:!1,name:"Green",rgb:[19,230,123]},{id:14,premium:!1,name:"Light Green",rgb:[135,255,94]},{id:15,premium:!1,name:"Dark Teal",rgb:[12,129,110]},{id:16,premium:!1,name:"Teal",rgb:[16,174,166]},{id:17,premium:!1,name:"Light Teal",rgb:[19,225,190]},{id:18,premium:!1,name:"Dark Blue",rgb:[40,80,158]},{id:19,premium:!1,name:"Blue",rgb:[64,147,228]},{id:20,premium:!1,name:"Cyan",rgb:[96,247,242]},{id:21,premium:!1,name:"Indigo",rgb:[107,80,246]},{id:22,premium:!1,name:"Light Indigo",rgb:[153,177,251]},{id:23,premium:!1,name:"Dark Purple",rgb:[120,12,153]},{id:24,premium:!1,name:"Purple",rgb:[170,56,185]},{id:25,premium:!1,name:"Light Purple",rgb:[224,159,249]},{id:26,premium:!1,name:"Dark Pink",rgb:[203,0,122]},{id:27,premium:!1,name:"Pink",rgb:[236,31,128]},{id:28,premium:!1,name:"Light Pink",rgb:[243,141,169]},{id:29,premium:!1,name:"Dark Brown",rgb:[104,70,52]},{id:30,premium:!1,name:"Brown",rgb:[149,104,42]},{id:31,premium:!1,name:"Beige",rgb:[248,178,119]},{id:32,premium:!0,name:"Medium Gray",rgb:[170,170,170]},{id:33,premium:!0,name:"Dark Red",rgb:[165,14,30]},{id:34,premium:!0,name:"Light Red",rgb:[250,128,114]},{id:35,premium:!0,name:"Dark Orange",rgb:[228,92,26]},{id:36,premium:!0,name:"Light Tan",rgb:[214,181,148]},{id:37,premium:!0,name:"Dark Goldenrod",rgb:[156,132,49]},{id:38,premium:!0,name:"Goldenrod",rgb:[197,173,49]},{id:39,premium:!0,name:"Light Goldenrod",rgb:[232,212,95]},{id:40,premium:!0,name:"Dark Olive",rgb:[74,107,58]},{id:41,premium:!0,name:"Olive",rgb:[90,148,74]},{id:42,premium:!0,name:"Light Olive",rgb:[132,197,115]},{id:43,premium:!0,name:"Dark Cyan",rgb:[15,121,159]},{id:44,premium:!0,name:"Light Cyan",rgb:[187,250,242]},{id:45,premium:!0,name:"Light Blue",rgb:[125,199,255]},{id:46,premium:!0,name:"Dark Indigo",rgb:[77,49,184]},{id:47,premium:!0,name:"Dark Slate Blue",rgb:[74,66,132]},{id:48,premium:!0,name:"Slate Blue",rgb:[122,113,196]},{id:49,premium:!0,name:"Light Slate Blue",rgb:[181,174,241]},{id:50,premium:!0,name:"Light Brown",rgb:[219,164,99]},{id:51,premium:!0,name:"Dark Beige",rgb:[209,128,81]},{id:52,premium:!0,name:"Light Beige",rgb:[255,197,165]},{id:53,premium:!0,name:"Dark Peach",rgb:[155,82,73]},{id:54,premium:!0,name:"Peach",rgb:[209,128,120]},{id:55,premium:!0,name:"Light Peach",rgb:[250,182,164]},{id:56,premium:!0,name:"Dark Tan",rgb:[123,99,82]},{id:57,premium:!0,name:"Tan",rgb:[156,132,107]},{id:58,premium:!0,name:"Dark Slate",rgb:[51,57,65]},{id:59,premium:!0,name:"Slate",rgb:[109,117,141]},{id:60,premium:!0,name:"Light Slate",rgb:[179,185,209]},{id:61,premium:!0,name:"Dark Stone",rgb:[109,100,63]},{id:62,premium:!0,name:"Stone",rgb:[148,140,107]},{id:63,premium:!0,name:"Light Stone",rgb:[205,197,158]}],$='',v=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-r",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}N(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}L(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},s=()=>{}){return s(this,i(this,g,w).call(this,"h"+t,{},e)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}j(t={},e=()=>{}){const s={};t.textContent?(s.textContent=t.textContent,delete t.textContent):t.innerHTML&&(s.innerHTML=t.innerHTML,delete t.textContent);const n=i(this,g,w).call(this,"label",s),o=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(o,n.firstChild),this.D(),e(this,n,o),this}Y(t={},e=()=>{}){const s=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,s,i(this,g,w).call(this,"select",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const s=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${s}`;const n={textContent:"?",className:"bm-10",onclick:()=>{this.ht(this.v,s)}};return e(this,i(this,g,w).call(this,"button",n,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const s=t.textContent??"";delete t.textContent;const n=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:s});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=s}),e(this,n,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-S"},t)),this}gt(t=Date.now(),e=500,s={},n=()=>{}){const o="bm--",a=s?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,s);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),i=Math.floor(e/3600),s=Math.floor(e%60),n=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${i}H${n}M${s}S`),l.textContent=String(i).padStart(2,"0")+":"+String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")},e),n(this,l),this}ht(t,e,i=!1){const s=document.getElementById(t.replace(/^#/,""));s&&(s instanceof HTMLInputElement?s.value=e:i?s.textContent=e:s.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-W"),i=t.closest(".bm-S"),s=e?.querySelector("h1"),n=e?.querySelector(".bm-m");if(!e||!i||!n)return t.disabled=!1,void(t.style.textDecoration="");const o=e=>{let i,s=!1;const o=()=>{s||(s=!0,clearTimeout(i),n.removeEventListener("transitionend",a),e(),t.disabled=!1,t.style.textDecoration="")},a=t=>{t.target==n&&"height"==t.propertyName&&o()};n.addEventListener("transitionend",a),i=setTimeout(o,360)};if(e.parentElement.append(e),"expanded"==t.dataset.buttonStatus){e.dataset.widthBeforeMinimize=e.style.width,e.dataset.heightBeforeMinimize=e.style.height,e.dataset.minHeightBeforeMinimize=e.style.minHeight,n.style.height=n.scrollHeight+"px",n.offsetHeight,e.style.width||(e.style.width=e.scrollWidth+"px"),o(()=>{n.style.display="none"}),n.style.height="0",(e.style.height||e.classList.contains("bm-N"))&&(e.style.minHeight="0px",e.style.height=(()=>{const t=getComputedStyle(e),s=t=>parseFloat(t)||0,n="border-box"==t.boxSizing?s(t.paddingTop)+s(t.paddingBottom)+s(t.borderTopWidth)+s(t.borderBottomWidth):0;return Math.ceil(i.getBoundingClientRect().height+n+2)})()+"px");const a=s?.cloneNode(!0)??document.createElement("h1"),r=a.textContent;t.nextElementSibling.appendChild(a),t.innerHTML='',t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${r}"`}else{const s=i.querySelector("h1"),a=s.textContent;s.remove(),n.style.display="",n.style.height="0",e.style.width=e.dataset.widthBeforeMinimize??"",e.style.minHeight=e.dataset.minHeightBeforeMinimize??"",e.style.height=e.dataset.heightBeforeMinimize??"",n.offsetHeight,o(()=>{n.style.height="",delete e.dataset.widthBeforeMinimize,delete e.dataset.heightBeforeMinimize,delete e.dataset.minHeightBeforeMinimize}),n.style.height=n.scrollHeight+"px",t.innerHTML=$,t.dataset.buttonStatus="expanded",t.ariaLabel=`Minimize window "${a}"`}}xt(t,e,i={}){const s=document.querySelector(t),n=document.querySelector(e),o=i?.yt??(()=>{});if(!s||!n)return void this.$t(`Can not drag! ${s?"":"moveMe"} ${s||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let a,r=!1,l=0,c=null,h=0,m=0,d=0,u=0,b=null;const p=()=>{if(r){const t=Math.abs(h-d),e=Math.abs(m-u);(t>.5||e>.5)&&(h=d,m=u,s.style.transform=`translate(${h}px, ${m}px)`,s.style.left="0px",s.style.top="0px",s.style.right=""),c=requestAnimationFrame(p)}},f=(t,e)=>{r=!0,b=s.getBoundingClientRect(),a=t-b.left,l=e-b.top;const i=window.getComputedStyle(s).transform;if(i&&"none"!==i){const t=new DOMMatrix(i);h=t.m41,m=t.m42}else h=b.left,m=b.top;d=h,u=m,document.body.style.userSelect="none",n.classList.add("bm-M"),document.addEventListener("mousemove",w),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("mouseup",g),document.addEventListener("touchend",g),document.addEventListener("touchcancel",g),c&&cancelAnimationFrame(c),p()},g=()=>{r=!1,c&&(cancelAnimationFrame(c),c=null),document.body.style.userSelect="",n.classList.remove("bm-M"),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",x),document.removeEventListener("mouseup",g),document.removeEventListener("touchend",g),document.removeEventListener("touchcancel",g),o({element:s,x:h,y:m}),b=null},w=t=>{r&&b&&(d=t.clientX-a,u=t.clientY-l)},x=t=>{if(r&&b){const e=t.touches[0];if(!e)return;d=e.clientX-a,u=e.clientY-l,t.preventDefault()}};n.addEventListener("mousedown",function(t){t.preventDefault(),f(t.clientX,t.clientY)}),n.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(f(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}vt(t,e,i={}){const s=document.querySelector(t),n=document.querySelector(e),o=i?.yt??(()=>{});if(!s||!n)return void this.$t(`Can not resize! ${s?"":"resizeMe"} ${s||n?"":"and "}${n?"":"iResizeThings "}was not found!`);let a=!1,r=0,l=0,c=0,h=0,m=0,d=0,u=0,b=0,p=null;const f=()=>Number.isFinite(i?.maxWidth)?i.maxWidth:window.innerWidth-16,g=()=>Number.isFinite(i?.maxHeight)?i.maxHeight:window.innerHeight-16,w=Number.isFinite(i?.minWidth)?i.minWidth:200,x=Number.isFinite(i?.minHeight)?i.minHeight:160,y=(t,e,i)=>Math.min(Math.max(t,e),Math.max(e,i)),$=()=>{if(a){const t=Math.abs(m-u),e=Math.abs(d-b);(t>.5||e>.5)&&(m=u,d=b,s.style.width=`${m}px`,s.style.height=`${d}px`),p=requestAnimationFrame($)}},v=(t,e)=>{a=!0,r=t,l=e,c=s.offsetWidth,h=s.offsetHeight,m=c,d=h,u=c,b=h,document.body.style.userSelect="none",n.classList.add("bm-2g"),document.addEventListener("mousemove",C),document.addEventListener("touchmove",T,{passive:!1}),document.addEventListener("mouseup",M),document.addEventListener("touchend",M),document.addEventListener("touchcancel",M),p&&cancelAnimationFrame(p),$()},M=()=>{a=!1,p&&(cancelAnimationFrame(p),p=null),document.body.style.userSelect="",n.classList.remove("bm-2g"),document.removeEventListener("mousemove",C),document.removeEventListener("touchmove",T),document.removeEventListener("mouseup",M),document.removeEventListener("touchend",M),document.removeEventListener("touchcancel",M),o({element:s,width:m,height:d})},C=t=>{a&&(u=y(c+(t.clientX-r),w,f()),b=y(h+(t.clientY-l),x,g()))},T=t=>{if(!a)return;const e=t?.touches?.[0];e&&(u=y(c+(e.clientX-r),w,f()),b=y(h+(e.clientY-l),x,g()),t.preventDefault())};n.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),v(t.clientX,t.clientY)}),n.addEventListener("touchstart",t=>{const e=t?.touches?.[0];e&&(t.preventDefault(),t.stopPropagation(),v(e.clientX,e.clientY))},{passive:!1})}Mt(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}$t(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},s={}){const n=document.createElement(t);this.M?(this.C?.appendChild(n),this.T.push(this.C),this.C=n):(this.M=n,this.C=n);for(const[t,s]of Object.entries(e))i(this,g,x).call(this,n,t,s);for(const[t,e]of Object.entries(s))i(this,g,x).call(this,n,t,e);return n},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var M,C,T,S,k,D,N,L=class extends v{constructor(t,i){super(t,i),e(this,M),this.window=null,this.Ct="bm-l",this.Tt=document.body}St(){document.querySelector(`#${this.Ct}`)?document.querySelector(`#${this.Ct}`).remove():(this.window=this.L({id:this.Ct,class:"bm-W"}).ft().lt({class:"bm-s",innerHTML:$,"aria-label":'Minimize window "Settings"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().L().D().L({class:"bm-D"}).lt({class:"bm-s",innerHTML:'',"aria-label":'Close window "Settings"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ct}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().L({class:"bm-m"}).L({class:"bm-L bm-h"}).W(1,{textContent:"Settings"}).D().D().F().D().H({textContent:"Settings take 5 seconds to save."}).D().L({class:"bm-L bm-H"},(t,e)=>{this.kt(),this.Dt()}).D().D().D().N(this.Tt),this.xt(`#${this.Ct}.bm-W`,`#${this.Ct} .bm-S`))}kt(){i(this,M,C).call(this,"Pixel Highlight")}Dt(){i(this,M,C).call(this,"Template")}};M=new WeakSet,C=function(t){this.window=this.L({class:"bm-L"}).W(2,{textContent:t}).D().F().D().H({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},T=new WeakSet,S=function(t,e){t.disabled=!0;const i=t.dataset.status,s=this.Nt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let n=[2,0,0];const o=s;switch(i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",n=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",n=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",n=[0,...e];break}const a=s.findIndex(([,t,e])=>t==n[1]&&e==n[2]);0!=n[0]?-1!=a?o[a]=n:o.push(n):-1!=a&&o.splice(a,1),this.Nt.highlight=o,t.disabled=!1},k=async function(t){const e=document.querySelectorAll(".bm-3 button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const n=document.querySelector(".bm-n")?.childNodes??[];for(let t=0;t{const[s,n,o,a]=e.split(",").map(Number);(n>>24==0?0:n.get(e)??-2;const a=o.get(s);o.set(s,a?a+1:1)}return console.log(o),o};var O=class{constructor(){this.Xt=Math.ceil(80/1300*window.innerWidth),this._t=y.slice(1)}qt(t){const e=document.createElement("div");for(let t=0;t{t.parentNode.childElementCount<=1?t.parentNode.remove():t.remove()},e.appendChild(t)}t.appendChild(e)}},I=class extends HTMLElement{};customElements.define("confetti-piece",I);var B,P,A,z,W,F,U,V,G,R,j,E,Y,J,X,_,q,Z,K,Q,tt,et,it,st,nt,ot='',at='',rt=class extends v{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.Ct="bm-t",this.Zt="bm-E",this.Tt=document.body,this.$=t.$??null,this.Kt="ftr-oWin",this.Qt="windowFilter",this.te=null,this.ee=null,this.ie=null,this.se=null,this.ne=1e4,this.oe=360,this.ae=220,this.re=1e3,this.le=1400,this.ce=t.p?.ce,this.he='',this.me='';const{palette:i,Jt:s}=this.ce.de;this.palette=i,this.ue=0,this.be=0,this.pe=new Map,this.fe=new Map,this.ge=0,this.we=0,this.timeRemaining=0,this.xe="",this.sortPrimary="total",this.sortSecondary="descending",this.showUnused=!1}ye(){i(this,B,A).call(this)?this.$e():this.St()}St(){if(document.querySelector(`#${this.Ct}`))return void i(this,B,F).call(this);this.window=this.L({id:this.Ct,class:"bm-W"},(t,e)=>{}).ft().lt({class:"bm-s",innerHTML:$,"aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().L().D().L({class:"bm-D"}).lt({class:"bm-s",innerHTML:at,"aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{i(this,B,z).call(this,!0),i(this,B,F).call(this),this.$e()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-s",innerHTML:ot,"aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>i(this,B,F).call(this),e.ontouchend=()=>{e.click()}}).D().D().D().L({class:"bm-m"}).L({class:"bm-L bm-h bm-1N"}).W(1,{textContent:"Color Filter"}).D().D().F().D().L({class:"bm-L bm-x bm-h bm-1F",style:"gap: 1.5ch;"}).lt({class:"bm-1u",textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,Z).call(this,!1)}).D().lt({class:"bm-1u",textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,Z).call(this,!0)}).D().D().F().D().L({class:"bm-L bm-H bm-1r"}).L({class:"bm-L bm-1A",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).L({class:"bm-L bm-1s"}).I({id:"bm-i",innerHTML:"Tiles Loaded: 0 / ???"}).D().U().D().I({id:"bm-d",innerHTML:"Correct Pixels: ???"}).D().U().D().I({id:"bm-j",innerHTML:"Total Pixels: ???"}).D().U().D().I({id:"bm-7",innerHTML:"Complete: ??? (???)"}).D().U().D().I({id:"bm-8",innerHTML:"??? ???"}).D().D().L({class:"bm-L bm-20"}).H({innerHTML:`Press the ${at.replace("