@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
1,544 lines (1,514 loc) • 7.51 MB
JavaScript
import { createRequire as __createRequire } from 'node:module';
import { fileURLToPath as __fileURLToPath } from 'node:url';
import { dirname as __pathDirname } from 'node:path';
const require = __createRequire(import.meta.url);
const __filename = __fileURLToPath(import.meta.url);
const __dirname = __pathDirname(__filename);
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
var __esm = (fn, res) => function __init() {
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
};
var __commonJS = (cb, mod2) => function __require2() {
return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
};
var __export = (target, all3) => {
for (var name in all3)
__defProp(target, name, { get: all3[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
mod2
));
// node_modules/is-docker/index.js
var require_is_docker = __commonJS({
"node_modules/is-docker/index.js"(exports, module) {
"use strict";
var fs17 = __require("fs");
var isDocker;
function hasDockerEnv() {
try {
fs17.statSync("/.dockerenv");
return true;
} catch (_) {
return false;
}
}
function hasDockerCGroup() {
try {
return fs17.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
} catch (_) {
return false;
}
}
module.exports = () => {
if (isDocker === void 0) {
isDocker = hasDockerEnv() || hasDockerCGroup();
}
return isDocker;
};
}
});
// node_modules/is-wsl/index.js
var require_is_wsl = __commonJS({
"node_modules/is-wsl/index.js"(exports, module) {
"use strict";
var os4 = __require("os");
var fs17 = __require("fs");
var isDocker = require_is_docker();
var isWsl = () => {
if (process.platform !== "linux") {
return false;
}
if (os4.release().toLowerCase().includes("microsoft")) {
if (isDocker()) {
return false;
}
return true;
}
try {
return fs17.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isDocker() : false;
} catch (_) {
return false;
}
};
if (process.env.__IS_WSL_TEST__) {
module.exports = isWsl;
} else {
module.exports = isWsl();
}
}
});
// node_modules/define-lazy-prop/index.js
var require_define_lazy_prop = __commonJS({
"node_modules/define-lazy-prop/index.js"(exports, module) {
"use strict";
module.exports = (object3, propertyName, fn) => {
const define2 = (value) => Object.defineProperty(object3, propertyName, { value, enumerable: true, writable: true });
Object.defineProperty(object3, propertyName, {
configurable: true,
enumerable: true,
get() {
const result = fn();
define2(result);
return result;
},
set(value) {
define2(value);
}
});
return object3;
};
}
});
// node_modules/open/index.js
var require_open = __commonJS({
"node_modules/open/index.js"(exports, module) {
var path10 = __require("path");
var childProcess = __require("child_process");
var { promises: fs17, constants: fsConstants } = __require("fs");
var isWsl = require_is_wsl();
var isDocker = require_is_docker();
var defineLazyProperty = require_define_lazy_prop();
var localXdgOpenPath = path10.join(__dirname, "xdg-open");
var { platform: platform4, arch } = process;
var getWslDrivesMountPoint = /* @__PURE__ */ (() => {
const defaultMountPoint = "/mnt/";
let mountPoint;
return async function() {
if (mountPoint) {
return mountPoint;
}
const configFilePath = "/etc/wsl.conf";
let isConfigFileExists = false;
try {
await fs17.access(configFilePath, fsConstants.F_OK);
isConfigFileExists = true;
} catch {
}
if (!isConfigFileExists) {
return defaultMountPoint;
}
const configContent = await fs17.readFile(configFilePath, { encoding: "utf8" });
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
if (!configMountPoint) {
return defaultMountPoint;
}
mountPoint = configMountPoint.groups.mountPoint.trim();
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
return mountPoint;
};
})();
var pTryEach = async (array2, mapper) => {
let latestError;
for (const item of array2) {
try {
return await mapper(item);
} catch (error2) {
latestError = error2;
}
}
throw latestError;
};
var baseOpen = async (options) => {
options = {
wait: false,
background: false,
newInstance: false,
allowNonzeroExitCode: false,
...options
};
if (Array.isArray(options.app)) {
return pTryEach(options.app, (singleApp) => baseOpen({
...options,
app: singleApp
}));
}
let { name: app4, arguments: appArguments = [] } = options.app || {};
appArguments = [...appArguments];
if (Array.isArray(app4)) {
return pTryEach(app4, (appName) => baseOpen({
...options,
app: {
name: appName,
arguments: appArguments
}
}));
}
let command;
const cliArguments = [];
const childProcessOptions = {};
if (platform4 === "darwin") {
command = "open";
if (options.wait) {
cliArguments.push("--wait-apps");
}
if (options.background) {
cliArguments.push("--background");
}
if (options.newInstance) {
cliArguments.push("--new");
}
if (app4) {
cliArguments.push("-a", app4);
}
} else if (platform4 === "win32" || isWsl && !isDocker()) {
const mountPoint = await getWslDrivesMountPoint();
command = isWsl ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
cliArguments.push(
"-NoProfile",
"-NonInteractive",
"\u2013ExecutionPolicy",
"Bypass",
"-EncodedCommand"
);
if (!isWsl) {
childProcessOptions.windowsVerbatimArguments = true;
}
const encodedArguments = ["Start"];
if (options.wait) {
encodedArguments.push("-Wait");
}
if (app4) {
encodedArguments.push(`"\`"${app4}\`""`, "-ArgumentList");
if (options.target) {
appArguments.unshift(options.target);
}
} else if (options.target) {
encodedArguments.push(`"${options.target}"`);
}
if (appArguments.length > 0) {
appArguments = appArguments.map((arg) => `"\`"${arg}\`""`);
encodedArguments.push(appArguments.join(","));
}
options.target = Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
} else {
if (app4) {
command = app4;
} else {
const isBundled = !__dirname || __dirname === "/";
let exeLocalXdgOpen = false;
try {
await fs17.access(localXdgOpenPath, fsConstants.X_OK);
exeLocalXdgOpen = true;
} catch {
}
const useSystemXdgOpen = process.versions.electron || platform4 === "android" || isBundled || !exeLocalXdgOpen;
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
}
if (appArguments.length > 0) {
cliArguments.push(...appArguments);
}
if (!options.wait) {
childProcessOptions.stdio = "ignore";
childProcessOptions.detached = true;
}
}
if (options.target) {
cliArguments.push(options.target);
}
if (platform4 === "darwin" && appArguments.length > 0) {
cliArguments.push("--args", ...appArguments);
}
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
if (options.wait) {
return new Promise((resolve7, reject) => {
subprocess.once("error", reject);
subprocess.once("close", (exitCode) => {
if (options.allowNonzeroExitCode && exitCode > 0) {
reject(new Error(`Exited with code ${exitCode}`));
return;
}
resolve7(subprocess);
});
});
}
subprocess.unref();
return subprocess;
};
var open2 = (target, options) => {
if (typeof target !== "string") {
throw new TypeError("Expected a `target`");
}
return baseOpen({
...options,
target
});
};
var openApp = (name, options) => {
if (typeof name !== "string") {
throw new TypeError("Expected a `name`");
}
const { arguments: appArguments = [] } = options || {};
if (appArguments !== void 0 && appArguments !== null && !Array.isArray(appArguments)) {
throw new TypeError("Expected `appArguments` as Array type");
}
return baseOpen({
...options,
app: {
name,
arguments: appArguments
}
});
};
function detectArchBinary(binary) {
if (typeof binary === "string" || Array.isArray(binary)) {
return binary;
}
const { [arch]: archBinary } = binary;
if (!archBinary) {
throw new Error(`${arch} is not supported`);
}
return archBinary;
}
function detectPlatformBinary({ [platform4]: platformBinary }, { wsl }) {
if (wsl && isWsl) {
return detectArchBinary(wsl);
}
if (!platformBinary) {
throw new Error(`${platform4} is not supported`);
}
return detectArchBinary(platformBinary);
}
var apps = {};
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
darwin: "google chrome",
win32: "chrome",
linux: ["google-chrome", "google-chrome-stable"]
}, {
wsl: {
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
}
}));
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
darwin: "firefox",
win32: "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
linux: "firefox"
}, {
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
}));
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
darwin: "microsoft edge",
win32: "msedge",
linux: "microsoft-edge"
}, {
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
}));
open2.apps = apps;
open2.openApp = openApp;
module.exports = open2;
}
});
// node_modules/electron-squirrel-startup/node_modules/ms/index.js
var require_ms = __commonJS({
"node_modules/electron-squirrel-startup/node_modules/ms/index.js"(exports, module) {
var s = 1e3;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var y = d * 365.25;
module.exports = function(val, options) {
options = options || {};
var type = typeof val;
if (type === "string" && val.length > 0) {
return parse6(val);
} else if (type === "number" && isNaN(val) === false) {
return options.long ? fmtLong(val) : fmtShort(val);
}
throw new Error(
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
);
};
function parse6(str) {
str = String(str);
if (str.length > 100) {
return;
}
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
str
);
if (!match) {
return;
}
var n = parseFloat(match[1]);
var type = (match[2] || "ms").toLowerCase();
switch (type) {
case "years":
case "year":
case "yrs":
case "yr":
case "y":
return n * y;
case "days":
case "day":
case "d":
return n * d;
case "hours":
case "hour":
case "hrs":
case "hr":
case "h":
return n * h;
case "minutes":
case "minute":
case "mins":
case "min":
case "m":
return n * m;
case "seconds":
case "second":
case "secs":
case "sec":
case "s":
return n * s;
case "milliseconds":
case "millisecond":
case "msecs":
case "msec":
case "ms":
return n;
default:
return void 0;
}
}
function fmtShort(ms) {
if (ms >= d) {
return Math.round(ms / d) + "d";
}
if (ms >= h) {
return Math.round(ms / h) + "h";
}
if (ms >= m) {
return Math.round(ms / m) + "m";
}
if (ms >= s) {
return Math.round(ms / s) + "s";
}
return ms + "ms";
}
function fmtLong(ms) {
return plural(ms, d, "day") || plural(ms, h, "hour") || plural(ms, m, "minute") || plural(ms, s, "second") || ms + " ms";
}
function plural(ms, n, name) {
if (ms < n) {
return;
}
if (ms < n * 1.5) {
return Math.floor(ms / n) + " " + name;
}
return Math.ceil(ms / n) + " " + name + "s";
}
}
});
// node_modules/electron-squirrel-startup/node_modules/debug/src/debug.js
var require_debug = __commonJS({
"node_modules/electron-squirrel-startup/node_modules/debug/src/debug.js"(exports, module) {
exports = module.exports = createDebug.debug = createDebug["default"] = createDebug;
exports.coerce = coerce2;
exports.disable = disable;
exports.enable = enable;
exports.enabled = enabled;
exports.humanize = require_ms();
exports.names = [];
exports.skips = [];
exports.formatters = {};
var prevTime;
function selectColor(namespace) {
var hash = 0, i;
for (i in namespace) {
hash = (hash << 5) - hash + namespace.charCodeAt(i);
hash |= 0;
}
return exports.colors[Math.abs(hash) % exports.colors.length];
}
function createDebug(namespace) {
function debug() {
if (!debug.enabled) return;
var self2 = debug;
var curr = +/* @__PURE__ */ new Date();
var ms = curr - (prevTime || curr);
self2.diff = ms;
self2.prev = prevTime;
self2.curr = curr;
prevTime = curr;
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i];
}
args[0] = exports.coerce(args[0]);
if ("string" !== typeof args[0]) {
args.unshift("%O");
}
var index = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
if (match === "%%") return match;
index++;
var formatter = exports.formatters[format];
if ("function" === typeof formatter) {
var val = args[index];
match = formatter.call(self2, val);
args.splice(index, 1);
index--;
}
return match;
});
exports.formatArgs.call(self2, args);
var logFn = debug.log || exports.log || console.log.bind(console);
logFn.apply(self2, args);
}
debug.namespace = namespace;
debug.enabled = exports.enabled(namespace);
debug.useColors = exports.useColors();
debug.color = selectColor(namespace);
if ("function" === typeof exports.init) {
exports.init(debug);
}
return debug;
}
function enable(namespaces) {
exports.save(namespaces);
exports.names = [];
exports.skips = [];
var split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
var len = split.length;
for (var i = 0; i < len; i++) {
if (!split[i]) continue;
namespaces = split[i].replace(/\*/g, ".*?");
if (namespaces[0] === "-") {
exports.skips.push(new RegExp("^" + namespaces.substr(1) + "$"));
} else {
exports.names.push(new RegExp("^" + namespaces + "$"));
}
}
}
function disable() {
exports.enable("");
}
function enabled(name) {
var i, len;
for (i = 0, len = exports.skips.length; i < len; i++) {
if (exports.skips[i].test(name)) {
return false;
}
}
for (i = 0, len = exports.names.length; i < len; i++) {
if (exports.names[i].test(name)) {
return true;
}
}
return false;
}
function coerce2(val) {
if (val instanceof Error) return val.stack || val.message;
return val;
}
}
});
// node_modules/electron-squirrel-startup/node_modules/debug/src/browser.js
var require_browser = __commonJS({
"node_modules/electron-squirrel-startup/node_modules/debug/src/browser.js"(exports, module) {
exports = module.exports = require_debug();
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = "undefined" != typeof chrome && "undefined" != typeof chrome.storage ? chrome.storage.local : localstorage();
exports.colors = [
"lightseagreen",
"forestgreen",
"goldenrod",
"dodgerblue",
"darkorchid",
"crimson"
];
function useColors() {
if (typeof window !== "undefined" && window.process && window.process.type === "renderer") {
return true;
}
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
}
exports.formatters.j = function(v) {
try {
return JSON.stringify(v);
} catch (err2) {
return "[UnexpectedJSONParseError]: " + err2.message;
}
};
function formatArgs(args) {
var useColors2 = this.useColors;
args[0] = (useColors2 ? "%c" : "") + this.namespace + (useColors2 ? " %c" : " ") + args[0] + (useColors2 ? "%c " : " ") + "+" + exports.humanize(this.diff);
if (!useColors2) return;
var c = "color: " + this.color;
args.splice(1, 0, c, "color: inherit");
var index = 0;
var lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, function(match) {
if ("%%" === match) return;
index++;
if ("%c" === match) {
lastC = index;
}
});
args.splice(lastC, 0, c);
}
function log() {
return "object" === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);
}
function save(namespaces) {
try {
if (null == namespaces) {
exports.storage.removeItem("debug");
} else {
exports.storage.debug = namespaces;
}
} catch (e) {
}
}
function load() {
var r;
try {
r = exports.storage.debug;
} catch (e) {
}
if (!r && typeof process !== "undefined" && "env" in process) {
r = process.env.DEBUG;
}
return r;
}
exports.enable(load());
function localstorage() {
try {
return window.localStorage;
} catch (e) {
}
}
}
});
// node_modules/electron-squirrel-startup/node_modules/debug/src/node.js
var require_node = __commonJS({
"node_modules/electron-squirrel-startup/node_modules/debug/src/node.js"(exports, module) {
var tty = __require("tty");
var util4 = __require("util");
exports = module.exports = require_debug();
exports.init = init;
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.colors = [6, 2, 3, 4, 5, 1];
exports.inspectOpts = Object.keys(process.env).filter(function(key) {
return /^debug_/i.test(key);
}).reduce(function(obj, key) {
var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function(_, k) {
return k.toUpperCase();
});
var val = process.env[key];
if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
else if (val === "null") val = null;
else val = Number(val);
obj[prop] = val;
return obj;
}, {});
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
if (1 !== fd && 2 !== fd) {
util4.deprecate(function() {
}, "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")();
}
var stream4 = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd);
function useColors() {
return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd);
}
exports.formatters.o = function(v) {
this.inspectOpts.colors = this.useColors;
return util4.inspect(v, this.inspectOpts).split("\n").map(function(str) {
return str.trim();
}).join(" ");
};
exports.formatters.O = function(v) {
this.inspectOpts.colors = this.useColors;
return util4.inspect(v, this.inspectOpts);
};
function formatArgs(args) {
var name = this.namespace;
var useColors2 = this.useColors;
if (useColors2) {
var c = this.color;
var prefix = " \x1B[3" + c + ";1m" + name + " \x1B[0m";
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
args.push("\x1B[3" + c + "m+" + exports.humanize(this.diff) + "\x1B[0m");
} else {
args[0] = (/* @__PURE__ */ new Date()).toUTCString() + " " + name + " " + args[0];
}
}
function log() {
return stream4.write(util4.format.apply(util4, arguments) + "\n");
}
function save(namespaces) {
if (null == namespaces) {
delete process.env.DEBUG;
} else {
process.env.DEBUG = namespaces;
}
}
function load() {
return process.env.DEBUG;
}
function createWritableStdioStream(fd2) {
var stream5;
var tty_wrap = process.binding("tty_wrap");
switch (tty_wrap.guessHandleType(fd2)) {
case "TTY":
stream5 = new tty.WriteStream(fd2);
stream5._type = "tty";
if (stream5._handle && stream5._handle.unref) {
stream5._handle.unref();
}
break;
case "FILE":
var fs17 = __require("fs");
stream5 = new fs17.SyncWriteStream(fd2, { autoClose: false });
stream5._type = "fs";
break;
case "PIPE":
case "TCP":
var net2 = __require("net");
stream5 = new net2.Socket({
fd: fd2,
readable: false,
writable: true
});
stream5.readable = false;
stream5.read = null;
stream5._type = "pipe";
if (stream5._handle && stream5._handle.unref) {
stream5._handle.unref();
}
break;
default:
throw new Error("Implement me. Unknown stream file type!");
}
stream5.fd = fd2;
stream5._isStdio = true;
return stream5;
}
function init(debug) {
debug.inspectOpts = {};
var keys = Object.keys(exports.inspectOpts);
for (var i = 0; i < keys.length; i++) {
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
}
}
exports.enable(load());
}
});
// node_modules/electron-squirrel-startup/node_modules/debug/src/index.js
var require_src = __commonJS({
"node_modules/electron-squirrel-startup/node_modules/debug/src/index.js"(exports, module) {
if (typeof process !== "undefined" && process.type === "renderer") {
module.exports = require_browser();
} else {
module.exports = require_node();
}
}
});
// node_modules/electron-squirrel-startup/index.js
var require_electron_squirrel_startup = __commonJS({
"node_modules/electron-squirrel-startup/index.js"(exports, module) {
var path10 = __require("path");
var spawn4 = __require("child_process").spawn;
var debug = require_src()("electron-squirrel-startup");
var app4 = __require("electron").app;
var run = function(args, done) {
var updateExe = path10.resolve(path10.dirname(process.execPath), "..", "Update.exe");
debug("Spawning `%s` with args `%s`", updateExe, args);
spawn4(updateExe, args, {
detached: true
}).on("close", done);
};
var check2 = function() {
if (process.platform === "win32") {
var cmd = process.argv[1];
debug("processing squirrel command `%s`", cmd);
var target = path10.basename(process.execPath);
if (cmd === "--squirrel-install" || cmd === "--squirrel-updated") {
run(["--createShortcut=" + target], app4.quit);
return true;
}
if (cmd === "--squirrel-uninstall") {
run(["--removeShortcut=" + target], app4.quit);
return true;
}
if (cmd === "--squirrel-obsolete") {
app4.quit();
return true;
}
}
return false;
};
module.exports = check2();
}
});
// src/app/ICreatorToolsData.ts
var ICreatorToolsData_exports = {};
__export(ICreatorToolsData_exports, {
CreatorToolsEditPreference: () => CreatorToolsEditPreference,
CreatorToolsEditorViewMode: () => CreatorToolsEditorViewMode,
DedicatedServerMode: () => DedicatedServerMode,
MinecraftFlavor: () => MinecraftFlavor,
MinecraftGameConnectionMode: () => MinecraftGameConnectionMode,
MinecraftTrack: () => MinecraftTrack,
RemoteServerAccessLevel: () => RemoteServerAccessLevel,
ThemePreference: () => ThemePreference,
WindowState: () => WindowState
});
var CreatorToolsEditorViewMode, CreatorToolsEditPreference, MinecraftTrack, MinecraftFlavor, DedicatedServerMode, MinecraftGameConnectionMode, WindowState, ThemePreference, RemoteServerAccessLevel;
var init_ICreatorToolsData = __esm({
"src/app/ICreatorToolsData.ts"() {
"use strict";
CreatorToolsEditorViewMode = /* @__PURE__ */ ((CreatorToolsEditorViewMode2) => {
CreatorToolsEditorViewMode2[CreatorToolsEditorViewMode2["itemsOnLeft"] = 0] = "itemsOnLeft";
CreatorToolsEditorViewMode2[CreatorToolsEditorViewMode2["itemsOnRight"] = 1] = "itemsOnRight";
CreatorToolsEditorViewMode2[CreatorToolsEditorViewMode2["itemsOnLeftAndMinecraftToolbox"] = 2] = "itemsOnLeftAndMinecraftToolbox";
CreatorToolsEditorViewMode2[CreatorToolsEditorViewMode2["itemsOnRightAndMinecraftToolbox"] = 3] = "itemsOnRightAndMinecraftToolbox";
CreatorToolsEditorViewMode2[CreatorToolsEditorViewMode2["toolboxFocus"] = 4] = "toolboxFocus";
CreatorToolsEditorViewMode2[CreatorToolsEditorViewMode2["mainFocus"] = 5] = "mainFocus";
CreatorToolsEditorViewMode2[CreatorToolsEditorViewMode2["itemsFocus"] = 6] = "itemsFocus";
CreatorToolsEditorViewMode2[CreatorToolsEditorViewMode2["codeLanding"] = 7] = "codeLanding";
return CreatorToolsEditorViewMode2;
})(CreatorToolsEditorViewMode || {});
CreatorToolsEditPreference = /* @__PURE__ */ ((CreatorToolsEditPreference3) => {
CreatorToolsEditPreference3[CreatorToolsEditPreference3["summarized"] = 0] = "summarized";
CreatorToolsEditPreference3[CreatorToolsEditPreference3["editors"] = 1] = "editors";
CreatorToolsEditPreference3[CreatorToolsEditPreference3["raw"] = 2] = "raw";
return CreatorToolsEditPreference3;
})(CreatorToolsEditPreference || {});
MinecraftTrack = /* @__PURE__ */ ((MinecraftTrack3) => {
MinecraftTrack3[MinecraftTrack3["main"] = 0] = "main";
MinecraftTrack3[MinecraftTrack3["preview"] = 1] = "preview";
MinecraftTrack3[MinecraftTrack3["edu"] = 2] = "edu";
MinecraftTrack3[MinecraftTrack3["eduPreview"] = 3] = "eduPreview";
return MinecraftTrack3;
})(MinecraftTrack || {});
MinecraftFlavor = /* @__PURE__ */ ((MinecraftFlavor2) => {
MinecraftFlavor2[MinecraftFlavor2["none"] = 0] = "none";
MinecraftFlavor2[MinecraftFlavor2["remote"] = 1] = "remote";
MinecraftFlavor2[MinecraftFlavor2["processHostedProxy"] = 2] = "processHostedProxy";
MinecraftFlavor2[MinecraftFlavor2["minecraftGameProxy"] = 3] = "minecraftGameProxy";
MinecraftFlavor2[MinecraftFlavor2["deploymentStorage"] = 4] = "deploymentStorage";
return MinecraftFlavor2;
})(MinecraftFlavor || {});
DedicatedServerMode = /* @__PURE__ */ ((DedicatedServerMode2) => {
DedicatedServerMode2[DedicatedServerMode2["auto"] = 0] = "auto";
DedicatedServerMode2[DedicatedServerMode2["source"] = 1] = "source";
DedicatedServerMode2[DedicatedServerMode2["direct"] = 2] = "direct";
return DedicatedServerMode2;
})(DedicatedServerMode || {});
MinecraftGameConnectionMode = /* @__PURE__ */ ((MinecraftGameConnectionMode3) => {
MinecraftGameConnectionMode3[MinecraftGameConnectionMode3["localMinecraft"] = 0] = "localMinecraft";
MinecraftGameConnectionMode3[MinecraftGameConnectionMode3["localMinecraftPreview"] = 1] = "localMinecraftPreview";
MinecraftGameConnectionMode3[MinecraftGameConnectionMode3["remoteMinecraft"] = 2] = "remoteMinecraft";
return MinecraftGameConnectionMode3;
})(MinecraftGameConnectionMode || {});
WindowState = /* @__PURE__ */ ((WindowState2) => {
WindowState2[WindowState2["regular"] = 0] = "regular";
WindowState2[WindowState2["minimized"] = 1] = "minimized";
WindowState2[WindowState2["maximized"] = 2] = "maximized";
WindowState2[WindowState2["docked"] = 3] = "docked";
return WindowState2;
})(WindowState || {});
ThemePreference = /* @__PURE__ */ ((ThemePreference3) => {
ThemePreference3[ThemePreference3["deviceDefault"] = 0] = "deviceDefault";
ThemePreference3[ThemePreference3["dark"] = 1] = "dark";
ThemePreference3[ThemePreference3["light"] = 2] = "light";
return ThemePreference3;
})(ThemePreference || {});
RemoteServerAccessLevel = /* @__PURE__ */ ((RemoteServerAccessLevel3) => {
RemoteServerAccessLevel3[RemoteServerAccessLevel3["none"] = 0] = "none";
RemoteServerAccessLevel3[RemoteServerAccessLevel3["displayReadOnly"] = 1] = "displayReadOnly";
RemoteServerAccessLevel3[RemoteServerAccessLevel3["fullReadOnly"] = 2] = "fullReadOnly";
RemoteServerAccessLevel3[RemoteServerAccessLevel3["updateState"] = 3] = "updateState";
RemoteServerAccessLevel3[RemoteServerAccessLevel3["admin"] = 4] = "admin";
return RemoteServerAccessLevel3;
})(RemoteServerAccessLevel || {});
}
});
// src/storage/IFile.ts
var init_IFile = __esm({
"src/storage/IFile.ts"() {
"use strict";
}
});
// src/app/IProjectData.ts
var init_IProjectData = __esm({
"src/app/IProjectData.ts"() {
"use strict";
}
});
// src/app/IProjectItemData.ts
var MaxItemTypes;
var init_IProjectItemData = __esm({
"src/app/IProjectItemData.ts"() {
"use strict";
MaxItemTypes = 166;
}
});
// src/dataform/IField.ts
var init_IField = __esm({
"src/dataform/IField.ts"() {
"use strict";
}
});
// node_modules/jsonify/lib/parse.js
var require_parse = __commonJS({
"node_modules/jsonify/lib/parse.js"(exports, module) {
"use strict";
var at;
var ch;
var escapee = {
'"': '"',
"\\": "\\",
"/": "/",
b: "\b",
f: "\f",
n: "\n",
r: "\r",
t: " "
};
var text;
function error2(m) {
throw {
name: "SyntaxError",
message: m,
at,
text
};
}
function next(c) {
if (c && c !== ch) {
error2("Expected '" + c + "' instead of '" + ch + "'");
}
ch = text.charAt(at);
at += 1;
return ch;
}
function number3() {
var num;
var str = "";
if (ch === "-") {
str = "-";
next("-");
}
while (ch >= "0" && ch <= "9") {
str += ch;
next();
}
if (ch === ".") {
str += ".";
while (next() && ch >= "0" && ch <= "9") {
str += ch;
}
}
if (ch === "e" || ch === "E") {
str += ch;
next();
if (ch === "-" || ch === "+") {
str += ch;
next();
}
while (ch >= "0" && ch <= "9") {
str += ch;
next();
}
}
num = Number(str);
if (!isFinite(num)) {
error2("Bad number");
}
return num;
}
function string3() {
var hex;
var i;
var str = "";
var uffff;
if (ch === '"') {
while (next()) {
if (ch === '"') {
next();
return str;
} else if (ch === "\\") {
next();
if (ch === "u") {
uffff = 0;
for (i = 0; i < 4; i += 1) {
hex = parseInt(next(), 16);
if (!isFinite(hex)) {
break;
}
uffff = uffff * 16 + hex;
}
str += String.fromCharCode(uffff);
} else if (typeof escapee[ch] === "string") {
str += escapee[ch];
} else {
break;
}
} else {
str += ch;
}
}
}
error2("Bad string");
}
function white() {
while (ch && ch <= " ") {
next();
}
}
function word() {
switch (ch) {
case "t":
next("t");
next("r");
next("u");
next("e");
return true;
case "f":
next("f");
next("a");
next("l");
next("s");
next("e");
return false;
case "n":
next("n");
next("u");
next("l");
next("l");
return null;
default:
error2("Unexpected '" + ch + "'");
}
}
function array2() {
var arr = [];
if (ch === "[") {
next("[");
white();
if (ch === "]") {
next("]");
return arr;
}
while (ch) {
arr.push(value());
white();
if (ch === "]") {
next("]");
return arr;
}
next(",");
white();
}
}
error2("Bad array");
}
function object3() {
var key;
var obj = {};
if (ch === "{") {
next("{");
white();
if (ch === "}") {
next("}");
return obj;
}
while (ch) {
key = string3();
white();
next(":");
if (Object.prototype.hasOwnProperty.call(obj, key)) {
error2('Duplicate key "' + key + '"');
}
obj[key] = value();
white();
if (ch === "}") {
next("}");
return obj;
}
next(",");
white();
}
}
error2("Bad object");
}
function value() {
white();
switch (ch) {
case "{":
return object3();
case "[":
return array2();
case '"':
return string3();
case "-":
return number3();
default:
return ch >= "0" && ch <= "9" ? number3() : word();
}
}
module.exports = function(source, reviver) {
var result;
text = source;
at = 0;
ch = " ";
result = value();
white();
if (ch) {
error2("Syntax error");
}
return typeof reviver === "function" ? (function walk(holder, key) {
var k;
var v;
var val = holder[key];
if (val && typeof val === "object") {
for (k in value) {
if (Object.prototype.hasOwnProperty.call(val, k)) {
v = walk(val, k);
if (typeof v === "undefined") {
delete val[k];
} else {
val[k] = v;
}
}
}
}
return reviver.call(holder, key, val);
})({ "": result }, "") : result;
};
}
});
// node_modules/jsonify/lib/stringify.js
var require_stringify = __commonJS({
"node_modules/jsonify/lib/stringify.js"(exports, module) {
"use strict";
var escapable = /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
var gap;
var indent;
var meta = {
// table of character substitutions
"\b": "\\b",
" ": "\\t",
"\n": "\\n",
"\f": "\\f",
"\r": "\\r",
'"': '\\"',
"\\": "\\\\"
};
var rep;
function quote(string3) {
escapable.lastIndex = 0;
return escapable.test(string3) ? '"' + string3.replace(escapable, function(a) {
var c = meta[a];
return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' : '"' + string3 + '"';
}
function str(key, holder) {
var i;
var k;
var v;
var length;
var mind = gap;
var partial2;
var value = holder[key];
if (value && typeof value === "object" && typeof value.toJSON === "function") {
value = value.toJSON(key);
}
if (typeof rep === "function") {
value = rep.call(holder, key, value);
}
switch (typeof value) {
case "string":
return quote(value);
case "number":
return isFinite(value) ? String(value) : "null";
case "boolean":
case "null":
return String(value);
case "object":
if (!value) {
return "null";
}
gap += indent;
partial2 = [];
if (Object.prototype.toString.apply(value) === "[object Array]") {
length = value.length;
for (i = 0; i < length; i += 1) {
partial2[i] = str(i, value) || "null";
}
v = partial2.length === 0 ? "[]" : gap ? "[\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial2.join(",") + "]";
gap = mind;
return v;
}
if (rep && typeof rep === "object") {
length = rep.length;
for (i = 0; i < length; i += 1) {
k = rep[i];
if (typeof k === "string") {
v = str(k, value);
if (v) {
partial2.push(quote(k) + (gap ? ": " : ":") + v);
}
}
}
} else {
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial2.push(quote(k) + (gap ? ": " : ":") + v);
}
}
}
}
v = partial2.length === 0 ? "{}" : gap ? "{\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial2.join(",") + "}";
gap = mind;
return v;
default:
}
}
module.exports = function(value, replacer, space) {
var i;
gap = "";
indent = "";
if (typeof space === "number") {
for (i = 0; i < space; i += 1) {
indent += " ";
}
} else if (typeof space === "string") {
indent = space;
}
rep = replacer;
if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
throw new Error("JSON.stringify");
}
return str("", { "": value });
};
}
});
// node_modules/jsonify/index.js
var require_jsonify = __commonJS({
"node_modules/jsonify/index.js"(exports) {
"use strict";
exports.parse = require_parse();
exports.stringify = require_stringify();
}
});
// node_modules/isarray/index.js
var require_isarray = __commonJS({
"node_modules/isarray/index.js"(exports, module) {
var toString4 = {}.toString;
module.exports = Array.isArray || function(arr) {
return toString4.call(arr) == "[object Array]";
};
}
});
// node_modules/object-keys/isArguments.js
var require_isArguments = __commonJS({
"node_modules/object-keys/isArguments.js"(exports, module) {
"use strict";
var toStr = Object.prototype.toString;
module.exports = function isArguments(value) {
var str = toStr.call(value);
var isArgs = str === "[object Arguments]";
if (!isArgs) {
isArgs = str !== "[object Array]" && value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && toStr.call(value.callee) === "[object Function]";
}
return isArgs;
};
}
});
// node_modules/object-keys/implementation.js
var require_implementation = __commonJS({
"node_modules/object-keys/implementation.js"(exports, module) {
"use strict";
var keysShim;
if (!Object.keys) {
has = Object.prototype.hasOwnProperty;
toStr = Object.prototype.toString;
isArgs = require_isArguments();
isEnumerable = Object.prototype.propertyIsEnumerable;
hasDontEnumBug = !isEnumerable.call({ toString: null }, "toString");
hasProtoEnumBug = isEnumerable.call(function() {
}, "prototype");
dontEnums = [
"toString",
"toLocaleString",
"valueOf",
"hasOwnProperty",
"isPrototypeOf",
"propertyIsEnumerable",
"constructor"
];
equalsConstructorPrototype = function(o) {
var ctor = o.constructor;
return ctor && ctor.prototype === o;
};
excludedKeys = {
$applicationCache: true,
$console: true,
$external: true,
$frame: true,
$frameElement: true,
$frames: true,
$innerHeight: true,
$innerWidth: true,
$onmozfullscreenchange: true,
$onmozfullscreenerror: true,
$outerHeight: true,
$outerWidth: true,
$pageXOffset: true,
$pageYOffset: true,
$parent: true,
$scrollLeft: true,
$scrollTop: true,
$scrollX: true,
$scrollY: true,
$self: true,
$webkitIndexedDB: true,
$webkitStorageInfo: true,
$window: true
};
hasAutomationEqualityBug = (function() {
if (typeof window === "undefined") {
return false;
}
for (var k in window) {
try {
if (!excludedKeys["$" + k] && has.call(window, k) && window[k] !== null && typeof window[k] === "object") {
try {
equalsConstructorPrototype(window[k]);
} catch (e) {
return true;
}
}
} catch (e) {
return true;
}
}
return false;
})();
equalsConstructorPrototypeIfNotBuggy = function(o) {
if (typeof window === "undefined" || !hasAutomationEqualityBug) {
return equalsConstructorPrototype(o);
}
try {
return equalsConstructorPrototype(o);
} catch (e) {
return false;
}
};
keysShim = function keys(object3) {
var isObject3 = object3 !== null && typeof object3 === "object";
var isFunction3 = toStr.call(object3) === "[object Function]";
var isArguments = isArgs(object3);
var isString2 = isObject3 && toStr.call(object3) === "[object String]";
var theKeys = [];
if (!isObject3 && !isFunction3 && !isArguments) {
throw new TypeError("Object.keys called on a non-object");
}
var skipProto = hasProtoEnumBug && isFunction3;
if (isString2 && object3.length > 0 && !has.call(object3, 0)) {
for (var i = 0; i < object3.length; ++i) {
theKeys.push(String(i));
}
}
if (isArguments && object3.length > 0) {
for (var j = 0; j < object3.length; ++j) {
theKeys.push(String(j));
}
} else {
for (var name in object3) {
if (!(skipProto && name === "prototype") && has.call(object3, name)) {
theKeys.push(String(name));
}
}
}
if (hasDontEnumBug) {
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object3);
for (var k = 0; k < dontEnums.length; ++k) {
if (!(skipConstructor && dontEnums[k] === "constructor") && has.call(object3, dontEnums[k])) {
theKeys.push(dontEnums[k]);
}
}
}
return theKeys;
};
}
var has;
var toStr;
var isArgs;
var isEnumerable;
var hasDontEnumBug;
var hasProtoEnumBug;
var dontEnums;
var equalsConstructorPrototype;
var excludedKeys;
var hasAutomationEqualityBug;
var equalsConstructorPrototypeIfNotBuggy;
module.exports = keysShim;
}
});
// node_modules/object-keys/index.js
var require_object_keys = __commonJS({
"node_modules/object-keys/index.js"(exports, module) {
"use strict";
var slice = Array.prototype.slice;
var isArgs = require_isArguments();
var origKeys = Object.keys;
var keysShim = origKeys ? function keys(o) {
return origKeys(o);
} : require_implementation();
var originalKeys = Object.keys;
keysShim.shim = function shimObjectKeys() {
if (Object.keys) {
var keysWorksWithArguments = (function() {
var args = Object.keys(arguments);
return args && args.length === arguments.length;
})(1, 2);
if (!keysWorksWithArguments) {
Object.keys = function keys(object3) {
if (isArgs(object3)) {
return originalKeys(slice.call(object3));
}
return originalKeys(object3);
};
}
} else {
Object.keys = keysShim;
}
return Object.keys || keysShim;
};
module.exports = keysShim;
}
});
// node_modules/es-object-atoms/index.js
var require_es_object_atoms = __commonJS({
"node_modules/es-object-atoms/index.js"(exports, module) {
"use strict";
module.exports = Object;
}
});
// node_modules/es-errors/index.js
var require_es_errors = __commonJS({
"node_modules/es-errors/index.js"(exports, module) {
"use strict";
module.exports = Error;
}
});
// node_modules/es-errors/eval.js
var require_eval = __commonJS({
"node_modules/es-errors/eval.js"(exports, module) {
"use strict";
module.exports = EvalError;
}
});
// node_modules/es-errors/range.js
var require_range = __commonJS({
"node_modules/es-errors/range.js"(exports, module) {
"use strict";
module.exports = RangeError;
}
});
// node_modules/es-errors/ref.js
var require_ref = __commonJS({
"node_modules/es-errors/ref.js"(exports, module) {
"use strict";
module.exports = ReferenceError;
}
});
// node_modules/es-errors/syntax.js
var require_syntax = __commonJS({
"node_modules/es-errors/syntax.js"(exports, module) {
"use strict";
module.exports = SyntaxError;
}
});
// node_modules/es-errors/type.js
var require_type = __commonJS({
"node_modules/es-errors/type.js"(exports, module) {
"use strict";
module.exports = TypeError;
}
});
// node_modules/es-errors/uri.js
var require_uri = __commo