@evitcastudio/kit 3.3.0 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bundle/cli/cli.js +1635 -1513
- package/lib/bundle/cli/kit-game-templates/multi/package.json +0 -2
- package/lib/bundle/cli/kit-game-templates/single/package.json +0 -2
- package/lib/cli/app-bundler.d.ts.map +1 -1
- package/lib/cli/app-bundler.js +44 -6
- package/lib/cli/create.d.ts.map +1 -1
- package/lib/cli/create.js +7 -6
- package/lib/cli/doctor.d.ts.map +1 -1
- package/lib/cli/doctor.js +57 -30
- package/lib/cli/host.d.ts.map +1 -1
- package/lib/cli/host.js +19 -12
- package/lib/cli/init.d.ts.map +1 -1
- package/lib/cli/init.js +20 -17
- package/lib/cli/resource-builder.d.ts.map +1 -1
- package/lib/cli/resource-builder.js +11 -8
- package/lib/cli/theme.d.ts +36 -0
- package/lib/cli/theme.d.ts.map +1 -0
- package/lib/cli/theme.js +41 -0
- package/package.json +1 -1
package/lib/bundle/cli/cli.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// @bun
|
|
3
3
|
|
|
4
4
|
/*!
|
|
5
|
-
* @evitcastudio/kit@3.3.
|
|
6
|
-
* Compiled Wed, 09 Sep 2026
|
|
5
|
+
* @evitcastudio/kit@3.3.2 git+https://github.com/EvitcaStudio/Kit.git
|
|
6
|
+
* Compiled Wed, 09 Sep 2026 21:02:08 UTC
|
|
7
7
|
* Copyright (c) 2026 Jared Bates, Evitca Studio, "doubleactii"
|
|
8
8
|
*
|
|
9
9
|
* @evitcastudio/kit is licensed under the MIT License.
|
|
@@ -1945,775 +1945,291 @@ var {
|
|
|
1945
1945
|
import { promises as fs2, existsSync as existsSync2 } from "fs";
|
|
1946
1946
|
import { join as join4, extname as extname3, basename as basename3, resolve as resolve3, relative as relative3 } from "path";
|
|
1947
1947
|
|
|
1948
|
-
// node_modules/
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
1948
|
+
// node_modules/chokidar/index.js
|
|
1949
|
+
import { EventEmitter } from "events";
|
|
1950
|
+
import { stat as statcb, Stats } from "fs";
|
|
1951
|
+
import { readdir as readdir2, stat as stat3 } from "fs/promises";
|
|
1952
|
+
import * as sp2 from "path";
|
|
1953
|
+
|
|
1954
|
+
// node_modules/chokidar/node_modules/readdirp/index.js
|
|
1955
|
+
import { lstat, readdir, realpath, stat } from "fs/promises";
|
|
1956
|
+
import { join as pjoin, resolve as presolve, sep as psep } from "path";
|
|
1957
|
+
import { Readable } from "stream";
|
|
1958
|
+
var EntryTypes = {
|
|
1959
|
+
FILE_TYPE: "files",
|
|
1960
|
+
DIR_TYPE: "directories",
|
|
1961
|
+
FILE_DIR_TYPE: "files_directories",
|
|
1962
|
+
EVERYTHING_TYPE: "all"
|
|
1963
|
+
};
|
|
1964
|
+
var defaultOptions = {
|
|
1965
|
+
root: ".",
|
|
1966
|
+
fileFilter: (_entryInfo) => true,
|
|
1967
|
+
directoryFilter: (_entryInfo) => true,
|
|
1968
|
+
type: EntryTypes.FILE_TYPE,
|
|
1969
|
+
lstat: false,
|
|
1970
|
+
depth: 2147483648,
|
|
1971
|
+
alwaysStat: false,
|
|
1972
|
+
highWaterMark: 256
|
|
1973
|
+
};
|
|
1974
|
+
Object.freeze(defaultOptions);
|
|
1975
|
+
var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
|
|
1976
|
+
var NORMAL_FLOW_ERRORS = new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
|
|
1977
|
+
var ALL_TYPES = [
|
|
1978
|
+
EntryTypes.DIR_TYPE,
|
|
1979
|
+
EntryTypes.EVERYTHING_TYPE,
|
|
1980
|
+
EntryTypes.FILE_DIR_TYPE,
|
|
1981
|
+
EntryTypes.FILE_TYPE
|
|
1982
|
+
];
|
|
1983
|
+
var DIR_TYPES = new Set([
|
|
1984
|
+
EntryTypes.DIR_TYPE,
|
|
1985
|
+
EntryTypes.EVERYTHING_TYPE,
|
|
1986
|
+
EntryTypes.FILE_DIR_TYPE
|
|
1987
|
+
]);
|
|
1988
|
+
var FILE_TYPES = new Set([
|
|
1989
|
+
EntryTypes.EVERYTHING_TYPE,
|
|
1990
|
+
EntryTypes.FILE_DIR_TYPE,
|
|
1991
|
+
EntryTypes.FILE_TYPE
|
|
1992
|
+
]);
|
|
1993
|
+
var isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);
|
|
1994
|
+
var wantBigintFsStats = process.platform === "win32";
|
|
1995
|
+
var emptyFn = (_entryInfo) => true;
|
|
1996
|
+
var normalizeFilter = (filter) => {
|
|
1997
|
+
if (filter === undefined)
|
|
1998
|
+
return emptyFn;
|
|
1999
|
+
if (typeof filter === "function")
|
|
2000
|
+
return filter;
|
|
2001
|
+
if (typeof filter === "string") {
|
|
2002
|
+
const fl = filter.trim();
|
|
2003
|
+
return (entry) => entry.basename === fl;
|
|
2004
|
+
}
|
|
2005
|
+
if (Array.isArray(filter)) {
|
|
2006
|
+
const trItems = filter.map((item) => item.trim());
|
|
2007
|
+
return (entry) => trItems.some((f) => entry.basename === f);
|
|
2004
2008
|
}
|
|
2009
|
+
return emptyFn;
|
|
2005
2010
|
};
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2011
|
+
|
|
2012
|
+
class ReaddirpStream extends Readable {
|
|
2013
|
+
parents;
|
|
2014
|
+
reading;
|
|
2015
|
+
parent;
|
|
2016
|
+
_stat;
|
|
2017
|
+
_maxDepth;
|
|
2018
|
+
_wantsDir;
|
|
2019
|
+
_wantsFile;
|
|
2020
|
+
_wantsEverything;
|
|
2021
|
+
_root;
|
|
2022
|
+
_isDirent;
|
|
2023
|
+
_statsProp;
|
|
2024
|
+
_rdOptions;
|
|
2025
|
+
_fileFilter;
|
|
2026
|
+
_directoryFilter;
|
|
2027
|
+
_relStart;
|
|
2028
|
+
constructor(options = {}) {
|
|
2029
|
+
super({
|
|
2030
|
+
objectMode: true,
|
|
2031
|
+
autoDestroy: true,
|
|
2032
|
+
highWaterMark: options.highWaterMark ?? defaultOptions.highWaterMark
|
|
2024
2033
|
});
|
|
2034
|
+
const opts = { ...defaultOptions, ...options };
|
|
2035
|
+
const root = opts.root ?? defaultOptions.root;
|
|
2036
|
+
const type = opts.type ?? defaultOptions.type;
|
|
2037
|
+
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
2038
|
+
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
2039
|
+
const statMethod = opts.lstat ? lstat : stat;
|
|
2040
|
+
if (wantBigintFsStats) {
|
|
2041
|
+
this._stat = (path) => statMethod(path, { bigint: true });
|
|
2042
|
+
} else {
|
|
2043
|
+
this._stat = statMethod;
|
|
2044
|
+
}
|
|
2045
|
+
this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
|
|
2046
|
+
this._wantsDir = DIR_TYPES.has(type);
|
|
2047
|
+
this._wantsFile = FILE_TYPES.has(type);
|
|
2048
|
+
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
|
|
2049
|
+
this._root = presolve(root);
|
|
2050
|
+
this._relStart = this._root.endsWith(psep) ? this._root.length : this._root.length + 1;
|
|
2051
|
+
this._isDirent = !opts.alwaysStat;
|
|
2052
|
+
this._statsProp = this._isDirent ? "dirent" : "stats";
|
|
2053
|
+
this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
|
|
2054
|
+
const rootDir = { path: this._root, depth: 1 };
|
|
2055
|
+
rootDir.pending = this._exploreDir(this._root, 1);
|
|
2056
|
+
this.parents = [rootDir];
|
|
2057
|
+
this.reading = false;
|
|
2058
|
+
this.parent = undefined;
|
|
2025
2059
|
}
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2060
|
+
async _read(batch) {
|
|
2061
|
+
if (this.reading)
|
|
2062
|
+
return;
|
|
2063
|
+
this.reading = true;
|
|
2064
|
+
try {
|
|
2065
|
+
while (!this.destroyed && batch > 0) {
|
|
2066
|
+
const par = this.parent;
|
|
2067
|
+
const fil = par && par.files;
|
|
2068
|
+
if (fil && fil.length > 0) {
|
|
2069
|
+
const { path, depth } = par;
|
|
2070
|
+
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path));
|
|
2071
|
+
const awaited = this._isDirent ? slice : await Promise.all(slice);
|
|
2072
|
+
for (const entry of awaited) {
|
|
2073
|
+
if (!entry)
|
|
2074
|
+
continue;
|
|
2075
|
+
if (this.destroyed)
|
|
2076
|
+
return;
|
|
2077
|
+
let entryType = this._getEntryType(entry);
|
|
2078
|
+
if (typeof entryType !== "string")
|
|
2079
|
+
entryType = await entryType;
|
|
2080
|
+
if (entryType === "directory" && this._directoryFilter(entry)) {
|
|
2081
|
+
if (depth <= this._maxDepth) {
|
|
2082
|
+
this.parents.push({ path: entry.fullPath, depth: depth + 1 });
|
|
2083
|
+
}
|
|
2084
|
+
if (this._wantsDir) {
|
|
2085
|
+
this.push(entry);
|
|
2086
|
+
batch--;
|
|
2087
|
+
}
|
|
2088
|
+
} else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
|
|
2089
|
+
if (this._wantsFile) {
|
|
2090
|
+
this.push(entry);
|
|
2091
|
+
batch--;
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2044
2094
|
}
|
|
2045
|
-
|
|
2046
|
-
|
|
2095
|
+
} else {
|
|
2096
|
+
const parent = this.parents.pop();
|
|
2097
|
+
if (!parent) {
|
|
2098
|
+
this.push(null);
|
|
2099
|
+
break;
|
|
2047
2100
|
}
|
|
2048
|
-
|
|
2101
|
+
const dir = parent.pending ?? this._exploreDir(parent.path, parent.depth);
|
|
2102
|
+
const next = this.parents[this.parents.length - 1];
|
|
2103
|
+
if (next && !next.pending) {
|
|
2104
|
+
next.pending = this._exploreDir(next.path, next.depth);
|
|
2105
|
+
}
|
|
2106
|
+
this.parent = await dir;
|
|
2107
|
+
if (this.destroyed)
|
|
2108
|
+
return;
|
|
2049
2109
|
}
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
}
|
|
2054
|
-
|
|
2055
|
-
value(hex) {
|
|
2056
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
2057
|
-
if (!matches) {
|
|
2058
|
-
return [0, 0, 0];
|
|
2059
|
-
}
|
|
2060
|
-
let [colorString] = matches;
|
|
2061
|
-
if (colorString.length === 3) {
|
|
2062
|
-
colorString = [...colorString].map((character) => character + character).join("");
|
|
2063
|
-
}
|
|
2064
|
-
const integer = Number.parseInt(colorString, 16);
|
|
2065
|
-
return [
|
|
2066
|
-
integer >> 16 & 255,
|
|
2067
|
-
integer >> 8 & 255,
|
|
2068
|
-
integer & 255
|
|
2069
|
-
];
|
|
2070
|
-
},
|
|
2071
|
-
enumerable: false
|
|
2072
|
-
},
|
|
2073
|
-
hexToAnsi256: {
|
|
2074
|
-
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
2075
|
-
enumerable: false
|
|
2076
|
-
},
|
|
2077
|
-
ansi256ToAnsi: {
|
|
2078
|
-
value(code) {
|
|
2079
|
-
if (code < 8) {
|
|
2080
|
-
return 30 + code;
|
|
2081
|
-
}
|
|
2082
|
-
if (code < 16) {
|
|
2083
|
-
return 90 + (code - 8);
|
|
2084
|
-
}
|
|
2085
|
-
let red;
|
|
2086
|
-
let green;
|
|
2087
|
-
let blue;
|
|
2088
|
-
if (code >= 232) {
|
|
2089
|
-
red = ((code - 232) * 10 + 8) / 255;
|
|
2090
|
-
green = red;
|
|
2091
|
-
blue = red;
|
|
2092
|
-
} else {
|
|
2093
|
-
code -= 16;
|
|
2094
|
-
const remainder = code % 36;
|
|
2095
|
-
red = Math.floor(code / 36) / 5;
|
|
2096
|
-
green = Math.floor(remainder / 6) / 5;
|
|
2097
|
-
blue = remainder % 6 / 5;
|
|
2098
|
-
}
|
|
2099
|
-
const value = Math.max(red, green, blue) * 2;
|
|
2100
|
-
if (value === 0) {
|
|
2101
|
-
return 30;
|
|
2102
|
-
}
|
|
2103
|
-
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
2104
|
-
if (value === 2) {
|
|
2105
|
-
result += 60;
|
|
2106
|
-
}
|
|
2107
|
-
return result;
|
|
2108
|
-
},
|
|
2109
|
-
enumerable: false
|
|
2110
|
-
},
|
|
2111
|
-
rgbToAnsi: {
|
|
2112
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
2113
|
-
enumerable: false
|
|
2114
|
-
},
|
|
2115
|
-
hexToAnsi: {
|
|
2116
|
-
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
2117
|
-
enumerable: false
|
|
2118
|
-
}
|
|
2119
|
-
});
|
|
2120
|
-
return styles;
|
|
2121
|
-
}
|
|
2122
|
-
var ansiStyles = assembleStyles();
|
|
2123
|
-
var ansi_styles_default = ansiStyles;
|
|
2124
|
-
|
|
2125
|
-
// node_modules/chalk/source/vendor/supports-color/index.js
|
|
2126
|
-
import process2 from "process";
|
|
2127
|
-
import os from "os";
|
|
2128
|
-
import tty from "tty";
|
|
2129
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
2130
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
2131
|
-
const position = argv.indexOf(prefix + flag);
|
|
2132
|
-
const terminatorPosition = argv.indexOf("--");
|
|
2133
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
2134
|
-
}
|
|
2135
|
-
var { env } = process2;
|
|
2136
|
-
var flagForceColor;
|
|
2137
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
2138
|
-
flagForceColor = 0;
|
|
2139
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
2140
|
-
flagForceColor = 1;
|
|
2141
|
-
}
|
|
2142
|
-
function envForceColor() {
|
|
2143
|
-
if ("FORCE_COLOR" in env) {
|
|
2144
|
-
if (env.FORCE_COLOR === "true") {
|
|
2145
|
-
return 1;
|
|
2146
|
-
}
|
|
2147
|
-
if (env.FORCE_COLOR === "false") {
|
|
2148
|
-
return 0;
|
|
2110
|
+
}
|
|
2111
|
+
} catch (error) {
|
|
2112
|
+
this.destroy(error);
|
|
2113
|
+
} finally {
|
|
2114
|
+
this.reading = false;
|
|
2149
2115
|
}
|
|
2150
|
-
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
2151
|
-
}
|
|
2152
|
-
}
|
|
2153
|
-
function translateLevel(level) {
|
|
2154
|
-
if (level === 0) {
|
|
2155
|
-
return false;
|
|
2156
|
-
}
|
|
2157
|
-
return {
|
|
2158
|
-
level,
|
|
2159
|
-
hasBasic: true,
|
|
2160
|
-
has256: level >= 2,
|
|
2161
|
-
has16m: level >= 3
|
|
2162
|
-
};
|
|
2163
|
-
}
|
|
2164
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
2165
|
-
const noFlagForceColor = envForceColor();
|
|
2166
|
-
if (noFlagForceColor !== undefined) {
|
|
2167
|
-
flagForceColor = noFlagForceColor;
|
|
2168
|
-
}
|
|
2169
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
2170
|
-
if (forceColor === 0) {
|
|
2171
|
-
return 0;
|
|
2172
2116
|
}
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2117
|
+
async _exploreDir(path, depth) {
|
|
2118
|
+
let files;
|
|
2119
|
+
try {
|
|
2120
|
+
files = await readdir(path, this._rdOptions);
|
|
2121
|
+
} catch (error) {
|
|
2122
|
+
this._onError(error);
|
|
2179
2123
|
}
|
|
2124
|
+
return { files, depth, path };
|
|
2180
2125
|
}
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
if (env.TERM === "dumb") {
|
|
2189
|
-
return min;
|
|
2190
|
-
}
|
|
2191
|
-
if (process2.platform === "win32") {
|
|
2192
|
-
const osRelease = os.release().split(".");
|
|
2193
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
2194
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
2126
|
+
_formatEntry(dirent, path) {
|
|
2127
|
+
const basename = this._isDirent ? dirent.name : dirent;
|
|
2128
|
+
const fullPath = pjoin(path, basename);
|
|
2129
|
+
const entry = { path: fullPath.slice(this._relStart), fullPath, basename };
|
|
2130
|
+
if (this._isDirent) {
|
|
2131
|
+
entry.dirent = dirent;
|
|
2132
|
+
return entry;
|
|
2195
2133
|
}
|
|
2196
|
-
return
|
|
2134
|
+
return this._stat(fullPath).then((stats) => {
|
|
2135
|
+
entry.stats = stats;
|
|
2136
|
+
return entry;
|
|
2137
|
+
}, (err) => {
|
|
2138
|
+
this._onError(err);
|
|
2139
|
+
return;
|
|
2140
|
+
});
|
|
2197
2141
|
}
|
|
2198
|
-
|
|
2199
|
-
if (
|
|
2200
|
-
|
|
2201
|
-
}
|
|
2202
|
-
|
|
2203
|
-
return 1;
|
|
2142
|
+
_onError(err) {
|
|
2143
|
+
if (isNormalFlowError(err) && !this.destroyed) {
|
|
2144
|
+
this.emit("warn", err);
|
|
2145
|
+
} else {
|
|
2146
|
+
this.destroy(err);
|
|
2204
2147
|
}
|
|
2205
|
-
return min;
|
|
2206
|
-
}
|
|
2207
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
2208
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
2209
2148
|
}
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2149
|
+
_getEntryType(entry) {
|
|
2150
|
+
if (!entry || !(this._statsProp in entry)) {
|
|
2151
|
+
return "";
|
|
2152
|
+
}
|
|
2153
|
+
const stats = entry[this._statsProp];
|
|
2154
|
+
if (stats.isFile())
|
|
2155
|
+
return "file";
|
|
2156
|
+
if (stats.isDirectory())
|
|
2157
|
+
return "directory";
|
|
2158
|
+
if (stats.isSymbolicLink())
|
|
2159
|
+
return this._getSymlinkEntryType(entry);
|
|
2160
|
+
return "";
|
|
2215
2161
|
}
|
|
2216
|
-
|
|
2217
|
-
const
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2162
|
+
async _getSymlinkEntryType(entry) {
|
|
2163
|
+
const full = entry.fullPath;
|
|
2164
|
+
try {
|
|
2165
|
+
const entryRealPath = await realpath(full);
|
|
2166
|
+
const entryRealPathStats = await lstat(entryRealPath);
|
|
2167
|
+
if (entryRealPathStats.isFile()) {
|
|
2168
|
+
return "file";
|
|
2221
2169
|
}
|
|
2222
|
-
|
|
2223
|
-
|
|
2170
|
+
if (entryRealPathStats.isDirectory()) {
|
|
2171
|
+
const len = entryRealPath.length;
|
|
2172
|
+
if (full.startsWith(entryRealPath) && full[len] === psep) {
|
|
2173
|
+
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
2174
|
+
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
2175
|
+
this._onError(recursiveError);
|
|
2176
|
+
return "";
|
|
2177
|
+
}
|
|
2178
|
+
return "directory";
|
|
2224
2179
|
}
|
|
2180
|
+
} catch (error) {
|
|
2181
|
+
this._onError(error);
|
|
2225
2182
|
}
|
|
2183
|
+
return "";
|
|
2226
2184
|
}
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
2231
|
-
return 1;
|
|
2232
|
-
}
|
|
2233
|
-
if ("COLORTERM" in env) {
|
|
2234
|
-
return 1;
|
|
2185
|
+
_includeAsFile(entry) {
|
|
2186
|
+
const stats = entry && entry[this._statsProp];
|
|
2187
|
+
return stats && this._wantsEverything && !stats.isDirectory();
|
|
2235
2188
|
}
|
|
2236
|
-
return min;
|
|
2237
2189
|
}
|
|
2238
|
-
function
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2190
|
+
function readdirp(root, options = {}) {
|
|
2191
|
+
let type = options.entryType || options.type;
|
|
2192
|
+
if (type === "both")
|
|
2193
|
+
type = EntryTypes.FILE_DIR_TYPE;
|
|
2194
|
+
if (!root) {
|
|
2195
|
+
throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
|
|
2196
|
+
} else if (typeof root !== "string") {
|
|
2197
|
+
throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
|
|
2198
|
+
} else if (type && !ALL_TYPES.includes(type)) {
|
|
2199
|
+
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
|
|
2200
|
+
}
|
|
2201
|
+
const opts = { ...options, root };
|
|
2202
|
+
if (type)
|
|
2203
|
+
opts.type = type;
|
|
2204
|
+
return new ReaddirpStream(opts);
|
|
2244
2205
|
}
|
|
2245
|
-
var supportsColor = {
|
|
2246
|
-
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
2247
|
-
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
2248
|
-
};
|
|
2249
|
-
var supports_color_default = supportsColor;
|
|
2250
|
-
|
|
2251
|
-
// node_modules/chalk/source/utilities.js
|
|
2252
|
-
function stringReplaceAll(string, substring, replacer) {
|
|
2253
|
-
let index = string.indexOf(substring);
|
|
2254
|
-
if (index === -1) {
|
|
2255
|
-
return string;
|
|
2256
|
-
}
|
|
2257
|
-
const substringLength = substring.length;
|
|
2258
|
-
let endIndex = 0;
|
|
2259
|
-
let returnValue = "";
|
|
2260
|
-
do {
|
|
2261
|
-
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
2262
|
-
endIndex = index + substringLength;
|
|
2263
|
-
index = string.indexOf(substring, endIndex);
|
|
2264
|
-
} while (index !== -1);
|
|
2265
|
-
returnValue += string.slice(endIndex);
|
|
2266
|
-
return returnValue;
|
|
2267
|
-
}
|
|
2268
|
-
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
2269
|
-
let endIndex = 0;
|
|
2270
|
-
let returnValue = "";
|
|
2271
|
-
do {
|
|
2272
|
-
const gotCR = string[index - 1] === "\r";
|
|
2273
|
-
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
|
|
2274
|
-
` : `
|
|
2275
|
-
`) + postfix;
|
|
2276
|
-
endIndex = index + 1;
|
|
2277
|
-
index = string.indexOf(`
|
|
2278
|
-
`, endIndex);
|
|
2279
|
-
} while (index !== -1);
|
|
2280
|
-
returnValue += string.slice(endIndex);
|
|
2281
|
-
return returnValue;
|
|
2282
|
-
}
|
|
2283
|
-
|
|
2284
|
-
// node_modules/chalk/source/index.js
|
|
2285
|
-
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
2286
|
-
var GENERATOR = Symbol("GENERATOR");
|
|
2287
|
-
var STYLER = Symbol("STYLER");
|
|
2288
|
-
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
2289
|
-
var levelMapping = [
|
|
2290
|
-
"ansi",
|
|
2291
|
-
"ansi",
|
|
2292
|
-
"ansi256",
|
|
2293
|
-
"ansi16m"
|
|
2294
|
-
];
|
|
2295
|
-
var styles2 = Object.create(null);
|
|
2296
|
-
var applyOptions = (object, options = {}) => {
|
|
2297
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
2298
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
2299
|
-
}
|
|
2300
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
2301
|
-
object.level = options.level === undefined ? colorLevel : options.level;
|
|
2302
|
-
};
|
|
2303
|
-
var chalkFactory = (options) => {
|
|
2304
|
-
const chalk = (...strings) => strings.join(" ");
|
|
2305
|
-
applyOptions(chalk, options);
|
|
2306
|
-
Object.setPrototypeOf(chalk, createChalk.prototype);
|
|
2307
|
-
return chalk;
|
|
2308
|
-
};
|
|
2309
|
-
function createChalk(options) {
|
|
2310
|
-
return chalkFactory(options);
|
|
2311
|
-
}
|
|
2312
|
-
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
2313
|
-
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
2314
|
-
styles2[styleName] = {
|
|
2315
|
-
get() {
|
|
2316
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
2317
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
2318
|
-
return builder;
|
|
2319
|
-
}
|
|
2320
|
-
};
|
|
2321
|
-
}
|
|
2322
|
-
styles2.visible = {
|
|
2323
|
-
get() {
|
|
2324
|
-
const builder = createBuilder(this, this[STYLER], true);
|
|
2325
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
2326
|
-
return builder;
|
|
2327
|
-
}
|
|
2328
|
-
};
|
|
2329
|
-
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
2330
|
-
if (model === "rgb") {
|
|
2331
|
-
if (level === "ansi16m") {
|
|
2332
|
-
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
2333
|
-
}
|
|
2334
|
-
if (level === "ansi256") {
|
|
2335
|
-
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
2336
|
-
}
|
|
2337
|
-
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
2338
|
-
}
|
|
2339
|
-
if (model === "hex") {
|
|
2340
|
-
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
2341
|
-
}
|
|
2342
|
-
return ansi_styles_default[type][model](...arguments_);
|
|
2343
|
-
};
|
|
2344
|
-
var usedModels = ["rgb", "hex", "ansi256"];
|
|
2345
|
-
for (const model of usedModels) {
|
|
2346
|
-
styles2[model] = {
|
|
2347
|
-
get() {
|
|
2348
|
-
const { level } = this;
|
|
2349
|
-
return function(...arguments_) {
|
|
2350
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
2351
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
2352
|
-
};
|
|
2353
|
-
}
|
|
2354
|
-
};
|
|
2355
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
2356
|
-
styles2[bgModel] = {
|
|
2357
|
-
get() {
|
|
2358
|
-
const { level } = this;
|
|
2359
|
-
return function(...arguments_) {
|
|
2360
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
2361
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
2362
|
-
};
|
|
2363
|
-
}
|
|
2364
|
-
};
|
|
2365
|
-
}
|
|
2366
|
-
var proto = Object.defineProperties(() => {
|
|
2367
|
-
}, {
|
|
2368
|
-
...styles2,
|
|
2369
|
-
level: {
|
|
2370
|
-
enumerable: true,
|
|
2371
|
-
get() {
|
|
2372
|
-
return this[GENERATOR].level;
|
|
2373
|
-
},
|
|
2374
|
-
set(level) {
|
|
2375
|
-
this[GENERATOR].level = level;
|
|
2376
|
-
}
|
|
2377
|
-
}
|
|
2378
|
-
});
|
|
2379
|
-
var createStyler = (open, close, parent) => {
|
|
2380
|
-
let openAll;
|
|
2381
|
-
let closeAll;
|
|
2382
|
-
if (parent === undefined) {
|
|
2383
|
-
openAll = open;
|
|
2384
|
-
closeAll = close;
|
|
2385
|
-
} else {
|
|
2386
|
-
openAll = parent.openAll + open;
|
|
2387
|
-
closeAll = close + parent.closeAll;
|
|
2388
|
-
}
|
|
2389
|
-
return {
|
|
2390
|
-
open,
|
|
2391
|
-
close,
|
|
2392
|
-
openAll,
|
|
2393
|
-
closeAll,
|
|
2394
|
-
parent
|
|
2395
|
-
};
|
|
2396
|
-
};
|
|
2397
|
-
var createBuilder = (self, _styler, _isEmpty) => {
|
|
2398
|
-
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
2399
|
-
Object.setPrototypeOf(builder, proto);
|
|
2400
|
-
builder[GENERATOR] = self;
|
|
2401
|
-
builder[STYLER] = _styler;
|
|
2402
|
-
builder[IS_EMPTY] = _isEmpty;
|
|
2403
|
-
return builder;
|
|
2404
|
-
};
|
|
2405
|
-
var applyStyle = (self, string) => {
|
|
2406
|
-
if (self.level <= 0 || !string) {
|
|
2407
|
-
return self[IS_EMPTY] ? "" : string;
|
|
2408
|
-
}
|
|
2409
|
-
let styler = self[STYLER];
|
|
2410
|
-
if (styler === undefined) {
|
|
2411
|
-
return string;
|
|
2412
|
-
}
|
|
2413
|
-
const { openAll, closeAll } = styler;
|
|
2414
|
-
if (string.includes("\x1B")) {
|
|
2415
|
-
while (styler !== undefined) {
|
|
2416
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
2417
|
-
styler = styler.parent;
|
|
2418
|
-
}
|
|
2419
|
-
}
|
|
2420
|
-
const lfIndex = string.indexOf(`
|
|
2421
|
-
`);
|
|
2422
|
-
if (lfIndex !== -1) {
|
|
2423
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
2424
|
-
}
|
|
2425
|
-
return openAll + string + closeAll;
|
|
2426
|
-
};
|
|
2427
|
-
Object.defineProperties(createChalk.prototype, styles2);
|
|
2428
|
-
var chalk = createChalk();
|
|
2429
|
-
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
2430
|
-
var source_default = chalk;
|
|
2431
|
-
|
|
2432
|
-
// node_modules/chokidar/index.js
|
|
2433
|
-
import { EventEmitter } from "events";
|
|
2434
|
-
import { stat as statcb, Stats } from "fs";
|
|
2435
|
-
import { readdir as readdir2, stat as stat3 } from "fs/promises";
|
|
2436
|
-
import * as sp2 from "path";
|
|
2437
2206
|
|
|
2438
|
-
// node_modules/
|
|
2439
|
-
import {
|
|
2440
|
-
import {
|
|
2441
|
-
import {
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2207
|
+
// node_modules/chokidar/handler.js
|
|
2208
|
+
import { watch as fs_watch, unwatchFile, watchFile } from "fs";
|
|
2209
|
+
import { realpath as fsrealpath, lstat as lstat2, open, stat as stat2 } from "fs/promises";
|
|
2210
|
+
import { type as osType } from "os";
|
|
2211
|
+
import * as sp from "path";
|
|
2212
|
+
var STR_DATA = "data";
|
|
2213
|
+
var STR_END = "end";
|
|
2214
|
+
var STR_CLOSE = "close";
|
|
2215
|
+
var EMPTY_FN = () => {
|
|
2447
2216
|
};
|
|
2448
|
-
var
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
EntryTypes.FILE_DIR_TYPE,
|
|
2465
|
-
EntryTypes.FILE_TYPE
|
|
2466
|
-
];
|
|
2467
|
-
var DIR_TYPES = new Set([
|
|
2468
|
-
EntryTypes.DIR_TYPE,
|
|
2469
|
-
EntryTypes.EVERYTHING_TYPE,
|
|
2470
|
-
EntryTypes.FILE_DIR_TYPE
|
|
2471
|
-
]);
|
|
2472
|
-
var FILE_TYPES = new Set([
|
|
2473
|
-
EntryTypes.EVERYTHING_TYPE,
|
|
2474
|
-
EntryTypes.FILE_DIR_TYPE,
|
|
2475
|
-
EntryTypes.FILE_TYPE
|
|
2476
|
-
]);
|
|
2477
|
-
var isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);
|
|
2478
|
-
var wantBigintFsStats = process.platform === "win32";
|
|
2479
|
-
var emptyFn = (_entryInfo) => true;
|
|
2480
|
-
var normalizeFilter = (filter) => {
|
|
2481
|
-
if (filter === undefined)
|
|
2482
|
-
return emptyFn;
|
|
2483
|
-
if (typeof filter === "function")
|
|
2484
|
-
return filter;
|
|
2485
|
-
if (typeof filter === "string") {
|
|
2486
|
-
const fl = filter.trim();
|
|
2487
|
-
return (entry) => entry.basename === fl;
|
|
2488
|
-
}
|
|
2489
|
-
if (Array.isArray(filter)) {
|
|
2490
|
-
const trItems = filter.map((item) => item.trim());
|
|
2491
|
-
return (entry) => trItems.some((f) => entry.basename === f);
|
|
2492
|
-
}
|
|
2493
|
-
return emptyFn;
|
|
2494
|
-
};
|
|
2495
|
-
|
|
2496
|
-
class ReaddirpStream extends Readable {
|
|
2497
|
-
parents;
|
|
2498
|
-
reading;
|
|
2499
|
-
parent;
|
|
2500
|
-
_stat;
|
|
2501
|
-
_maxDepth;
|
|
2502
|
-
_wantsDir;
|
|
2503
|
-
_wantsFile;
|
|
2504
|
-
_wantsEverything;
|
|
2505
|
-
_root;
|
|
2506
|
-
_isDirent;
|
|
2507
|
-
_statsProp;
|
|
2508
|
-
_rdOptions;
|
|
2509
|
-
_fileFilter;
|
|
2510
|
-
_directoryFilter;
|
|
2511
|
-
_relStart;
|
|
2512
|
-
constructor(options = {}) {
|
|
2513
|
-
super({
|
|
2514
|
-
objectMode: true,
|
|
2515
|
-
autoDestroy: true,
|
|
2516
|
-
highWaterMark: options.highWaterMark ?? defaultOptions.highWaterMark
|
|
2517
|
-
});
|
|
2518
|
-
const opts = { ...defaultOptions, ...options };
|
|
2519
|
-
const root = opts.root ?? defaultOptions.root;
|
|
2520
|
-
const type = opts.type ?? defaultOptions.type;
|
|
2521
|
-
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
2522
|
-
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
2523
|
-
const statMethod = opts.lstat ? lstat : stat;
|
|
2524
|
-
if (wantBigintFsStats) {
|
|
2525
|
-
this._stat = (path) => statMethod(path, { bigint: true });
|
|
2526
|
-
} else {
|
|
2527
|
-
this._stat = statMethod;
|
|
2528
|
-
}
|
|
2529
|
-
this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
|
|
2530
|
-
this._wantsDir = DIR_TYPES.has(type);
|
|
2531
|
-
this._wantsFile = FILE_TYPES.has(type);
|
|
2532
|
-
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
|
|
2533
|
-
this._root = presolve(root);
|
|
2534
|
-
this._relStart = this._root.endsWith(psep) ? this._root.length : this._root.length + 1;
|
|
2535
|
-
this._isDirent = !opts.alwaysStat;
|
|
2536
|
-
this._statsProp = this._isDirent ? "dirent" : "stats";
|
|
2537
|
-
this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
|
|
2538
|
-
const rootDir = { path: this._root, depth: 1 };
|
|
2539
|
-
rootDir.pending = this._exploreDir(this._root, 1);
|
|
2540
|
-
this.parents = [rootDir];
|
|
2541
|
-
this.reading = false;
|
|
2542
|
-
this.parent = undefined;
|
|
2543
|
-
}
|
|
2544
|
-
async _read(batch) {
|
|
2545
|
-
if (this.reading)
|
|
2546
|
-
return;
|
|
2547
|
-
this.reading = true;
|
|
2548
|
-
try {
|
|
2549
|
-
while (!this.destroyed && batch > 0) {
|
|
2550
|
-
const par = this.parent;
|
|
2551
|
-
const fil = par && par.files;
|
|
2552
|
-
if (fil && fil.length > 0) {
|
|
2553
|
-
const { path, depth } = par;
|
|
2554
|
-
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path));
|
|
2555
|
-
const awaited = this._isDirent ? slice : await Promise.all(slice);
|
|
2556
|
-
for (const entry of awaited) {
|
|
2557
|
-
if (!entry)
|
|
2558
|
-
continue;
|
|
2559
|
-
if (this.destroyed)
|
|
2560
|
-
return;
|
|
2561
|
-
let entryType = this._getEntryType(entry);
|
|
2562
|
-
if (typeof entryType !== "string")
|
|
2563
|
-
entryType = await entryType;
|
|
2564
|
-
if (entryType === "directory" && this._directoryFilter(entry)) {
|
|
2565
|
-
if (depth <= this._maxDepth) {
|
|
2566
|
-
this.parents.push({ path: entry.fullPath, depth: depth + 1 });
|
|
2567
|
-
}
|
|
2568
|
-
if (this._wantsDir) {
|
|
2569
|
-
this.push(entry);
|
|
2570
|
-
batch--;
|
|
2571
|
-
}
|
|
2572
|
-
} else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
|
|
2573
|
-
if (this._wantsFile) {
|
|
2574
|
-
this.push(entry);
|
|
2575
|
-
batch--;
|
|
2576
|
-
}
|
|
2577
|
-
}
|
|
2578
|
-
}
|
|
2579
|
-
} else {
|
|
2580
|
-
const parent = this.parents.pop();
|
|
2581
|
-
if (!parent) {
|
|
2582
|
-
this.push(null);
|
|
2583
|
-
break;
|
|
2584
|
-
}
|
|
2585
|
-
const dir = parent.pending ?? this._exploreDir(parent.path, parent.depth);
|
|
2586
|
-
const next = this.parents[this.parents.length - 1];
|
|
2587
|
-
if (next && !next.pending) {
|
|
2588
|
-
next.pending = this._exploreDir(next.path, next.depth);
|
|
2589
|
-
}
|
|
2590
|
-
this.parent = await dir;
|
|
2591
|
-
if (this.destroyed)
|
|
2592
|
-
return;
|
|
2593
|
-
}
|
|
2594
|
-
}
|
|
2595
|
-
} catch (error) {
|
|
2596
|
-
this.destroy(error);
|
|
2597
|
-
} finally {
|
|
2598
|
-
this.reading = false;
|
|
2599
|
-
}
|
|
2600
|
-
}
|
|
2601
|
-
async _exploreDir(path, depth) {
|
|
2602
|
-
let files;
|
|
2603
|
-
try {
|
|
2604
|
-
files = await readdir(path, this._rdOptions);
|
|
2605
|
-
} catch (error) {
|
|
2606
|
-
this._onError(error);
|
|
2607
|
-
}
|
|
2608
|
-
return { files, depth, path };
|
|
2609
|
-
}
|
|
2610
|
-
_formatEntry(dirent, path) {
|
|
2611
|
-
const basename = this._isDirent ? dirent.name : dirent;
|
|
2612
|
-
const fullPath = pjoin(path, basename);
|
|
2613
|
-
const entry = { path: fullPath.slice(this._relStart), fullPath, basename };
|
|
2614
|
-
if (this._isDirent) {
|
|
2615
|
-
entry.dirent = dirent;
|
|
2616
|
-
return entry;
|
|
2617
|
-
}
|
|
2618
|
-
return this._stat(fullPath).then((stats) => {
|
|
2619
|
-
entry.stats = stats;
|
|
2620
|
-
return entry;
|
|
2621
|
-
}, (err) => {
|
|
2622
|
-
this._onError(err);
|
|
2623
|
-
return;
|
|
2624
|
-
});
|
|
2625
|
-
}
|
|
2626
|
-
_onError(err) {
|
|
2627
|
-
if (isNormalFlowError(err) && !this.destroyed) {
|
|
2628
|
-
this.emit("warn", err);
|
|
2629
|
-
} else {
|
|
2630
|
-
this.destroy(err);
|
|
2631
|
-
}
|
|
2632
|
-
}
|
|
2633
|
-
_getEntryType(entry) {
|
|
2634
|
-
if (!entry || !(this._statsProp in entry)) {
|
|
2635
|
-
return "";
|
|
2636
|
-
}
|
|
2637
|
-
const stats = entry[this._statsProp];
|
|
2638
|
-
if (stats.isFile())
|
|
2639
|
-
return "file";
|
|
2640
|
-
if (stats.isDirectory())
|
|
2641
|
-
return "directory";
|
|
2642
|
-
if (stats.isSymbolicLink())
|
|
2643
|
-
return this._getSymlinkEntryType(entry);
|
|
2644
|
-
return "";
|
|
2645
|
-
}
|
|
2646
|
-
async _getSymlinkEntryType(entry) {
|
|
2647
|
-
const full = entry.fullPath;
|
|
2648
|
-
try {
|
|
2649
|
-
const entryRealPath = await realpath(full);
|
|
2650
|
-
const entryRealPathStats = await lstat(entryRealPath);
|
|
2651
|
-
if (entryRealPathStats.isFile()) {
|
|
2652
|
-
return "file";
|
|
2653
|
-
}
|
|
2654
|
-
if (entryRealPathStats.isDirectory()) {
|
|
2655
|
-
const len = entryRealPath.length;
|
|
2656
|
-
if (full.startsWith(entryRealPath) && full[len] === psep) {
|
|
2657
|
-
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
2658
|
-
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
2659
|
-
this._onError(recursiveError);
|
|
2660
|
-
return "";
|
|
2661
|
-
}
|
|
2662
|
-
return "directory";
|
|
2663
|
-
}
|
|
2664
|
-
} catch (error) {
|
|
2665
|
-
this._onError(error);
|
|
2666
|
-
}
|
|
2667
|
-
return "";
|
|
2668
|
-
}
|
|
2669
|
-
_includeAsFile(entry) {
|
|
2670
|
-
const stats = entry && entry[this._statsProp];
|
|
2671
|
-
return stats && this._wantsEverything && !stats.isDirectory();
|
|
2672
|
-
}
|
|
2673
|
-
}
|
|
2674
|
-
function readdirp(root, options = {}) {
|
|
2675
|
-
let type = options.entryType || options.type;
|
|
2676
|
-
if (type === "both")
|
|
2677
|
-
type = EntryTypes.FILE_DIR_TYPE;
|
|
2678
|
-
if (!root) {
|
|
2679
|
-
throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
|
|
2680
|
-
} else if (typeof root !== "string") {
|
|
2681
|
-
throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
|
|
2682
|
-
} else if (type && !ALL_TYPES.includes(type)) {
|
|
2683
|
-
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
|
|
2684
|
-
}
|
|
2685
|
-
const opts = { ...options, root };
|
|
2686
|
-
if (type)
|
|
2687
|
-
opts.type = type;
|
|
2688
|
-
return new ReaddirpStream(opts);
|
|
2689
|
-
}
|
|
2690
|
-
|
|
2691
|
-
// node_modules/chokidar/handler.js
|
|
2692
|
-
import { watch as fs_watch, unwatchFile, watchFile } from "fs";
|
|
2693
|
-
import { realpath as fsrealpath, lstat as lstat2, open, stat as stat2 } from "fs/promises";
|
|
2694
|
-
import { type as osType } from "os";
|
|
2695
|
-
import * as sp from "path";
|
|
2696
|
-
var STR_DATA = "data";
|
|
2697
|
-
var STR_END = "end";
|
|
2698
|
-
var STR_CLOSE = "close";
|
|
2699
|
-
var EMPTY_FN = () => {
|
|
2700
|
-
};
|
|
2701
|
-
var pl = process.platform;
|
|
2702
|
-
var isWindows = pl === "win32";
|
|
2703
|
-
var isMacos = pl === "darwin";
|
|
2704
|
-
var isLinux = pl === "linux";
|
|
2705
|
-
var isFreeBSD = pl === "freebsd";
|
|
2706
|
-
var isIBMi = osType() === "OS400";
|
|
2707
|
-
var EVENTS = {
|
|
2708
|
-
ALL: "all",
|
|
2709
|
-
READY: "ready",
|
|
2710
|
-
ADD: "add",
|
|
2711
|
-
CHANGE: "change",
|
|
2712
|
-
ADD_DIR: "addDir",
|
|
2713
|
-
UNLINK: "unlink",
|
|
2714
|
-
UNLINK_DIR: "unlinkDir",
|
|
2715
|
-
RAW: "raw",
|
|
2716
|
-
ERROR: "error"
|
|
2217
|
+
var pl = process.platform;
|
|
2218
|
+
var isWindows = pl === "win32";
|
|
2219
|
+
var isMacos = pl === "darwin";
|
|
2220
|
+
var isLinux = pl === "linux";
|
|
2221
|
+
var isFreeBSD = pl === "freebsd";
|
|
2222
|
+
var isIBMi = osType() === "OS400";
|
|
2223
|
+
var EVENTS = {
|
|
2224
|
+
ALL: "all",
|
|
2225
|
+
READY: "ready",
|
|
2226
|
+
ADD: "add",
|
|
2227
|
+
CHANGE: "change",
|
|
2228
|
+
ADD_DIR: "addDir",
|
|
2229
|
+
UNLINK: "unlink",
|
|
2230
|
+
UNLINK_DIR: "unlinkDir",
|
|
2231
|
+
RAW: "raw",
|
|
2232
|
+
ERROR: "error"
|
|
2717
2233
|
};
|
|
2718
2234
|
var EV = EVENTS;
|
|
2719
2235
|
var THROTTLE_MODE_WATCH = "watch";
|
|
@@ -4093,11 +3609,17 @@ function v4(options, buf, offset) {
|
|
|
4093
3609
|
return native_default.randomUUID();
|
|
4094
3610
|
}
|
|
4095
3611
|
options = options || {};
|
|
4096
|
-
const rnds = options.random
|
|
3612
|
+
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
3613
|
+
if (rnds.length < 16) {
|
|
3614
|
+
throw new Error("Random bytes length must be >= 16");
|
|
3615
|
+
}
|
|
4097
3616
|
rnds[6] = rnds[6] & 15 | 64;
|
|
4098
3617
|
rnds[8] = rnds[8] & 63 | 128;
|
|
4099
3618
|
if (buf) {
|
|
4100
3619
|
offset = offset || 0;
|
|
3620
|
+
if (offset < 0 || offset + 16 > buf.length) {
|
|
3621
|
+
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
3622
|
+
}
|
|
4101
3623
|
for (let i = 0;i < 16; ++i) {
|
|
4102
3624
|
buf[offset + i] = rnds[i];
|
|
4103
3625
|
}
|
|
@@ -8880,749 +8402,1275 @@ var inflate$2 = (strm, flush) => {
|
|
|
8880
8402
|
if (copy > state.length) {
|
|
8881
8403
|
copy = state.length;
|
|
8882
8404
|
}
|
|
8883
|
-
from_source = state.window;
|
|
8405
|
+
from_source = state.window;
|
|
8406
|
+
} else {
|
|
8407
|
+
from_source = output;
|
|
8408
|
+
from = put - state.offset;
|
|
8409
|
+
copy = state.length;
|
|
8410
|
+
}
|
|
8411
|
+
if (copy > left) {
|
|
8412
|
+
copy = left;
|
|
8413
|
+
}
|
|
8414
|
+
left -= copy;
|
|
8415
|
+
state.length -= copy;
|
|
8416
|
+
do {
|
|
8417
|
+
output[put++] = from_source[from++];
|
|
8418
|
+
} while (--copy);
|
|
8419
|
+
if (state.length === 0) {
|
|
8420
|
+
state.mode = LEN;
|
|
8421
|
+
}
|
|
8422
|
+
break;
|
|
8423
|
+
case LIT:
|
|
8424
|
+
if (left === 0) {
|
|
8425
|
+
break inf_leave;
|
|
8426
|
+
}
|
|
8427
|
+
output[put++] = state.length;
|
|
8428
|
+
left--;
|
|
8429
|
+
state.mode = LEN;
|
|
8430
|
+
break;
|
|
8431
|
+
case CHECK:
|
|
8432
|
+
if (state.wrap) {
|
|
8433
|
+
while (bits < 32) {
|
|
8434
|
+
if (have === 0) {
|
|
8435
|
+
break inf_leave;
|
|
8436
|
+
}
|
|
8437
|
+
have--;
|
|
8438
|
+
hold |= input[next++] << bits;
|
|
8439
|
+
bits += 8;
|
|
8440
|
+
}
|
|
8441
|
+
_out -= left;
|
|
8442
|
+
strm.total_out += _out;
|
|
8443
|
+
state.total += _out;
|
|
8444
|
+
if (state.wrap & 4 && _out) {
|
|
8445
|
+
strm.adler = state.check = state.flags ? crc32_1(state.check, output, _out, put - _out) : adler32_1(state.check, output, _out, put - _out);
|
|
8446
|
+
}
|
|
8447
|
+
_out = left;
|
|
8448
|
+
if (state.wrap & 4 && (state.flags ? hold : zswap32(hold)) !== state.check) {
|
|
8449
|
+
strm.msg = "incorrect data check";
|
|
8450
|
+
state.mode = BAD;
|
|
8451
|
+
break;
|
|
8452
|
+
}
|
|
8453
|
+
hold = 0;
|
|
8454
|
+
bits = 0;
|
|
8455
|
+
}
|
|
8456
|
+
state.mode = LENGTH;
|
|
8457
|
+
case LENGTH:
|
|
8458
|
+
if (state.wrap && state.flags) {
|
|
8459
|
+
while (bits < 32) {
|
|
8460
|
+
if (have === 0) {
|
|
8461
|
+
break inf_leave;
|
|
8462
|
+
}
|
|
8463
|
+
have--;
|
|
8464
|
+
hold += input[next++] << bits;
|
|
8465
|
+
bits += 8;
|
|
8466
|
+
}
|
|
8467
|
+
if (state.wrap & 4 && hold !== (state.total & 4294967295)) {
|
|
8468
|
+
strm.msg = "incorrect length check";
|
|
8469
|
+
state.mode = BAD;
|
|
8470
|
+
break;
|
|
8471
|
+
}
|
|
8472
|
+
hold = 0;
|
|
8473
|
+
bits = 0;
|
|
8474
|
+
}
|
|
8475
|
+
state.mode = DONE;
|
|
8476
|
+
case DONE:
|
|
8477
|
+
ret = Z_STREAM_END$1;
|
|
8478
|
+
break inf_leave;
|
|
8479
|
+
case BAD:
|
|
8480
|
+
ret = Z_DATA_ERROR$1;
|
|
8481
|
+
break inf_leave;
|
|
8482
|
+
case MEM:
|
|
8483
|
+
return Z_MEM_ERROR$1;
|
|
8484
|
+
case SYNC:
|
|
8485
|
+
default:
|
|
8486
|
+
return Z_STREAM_ERROR$1;
|
|
8487
|
+
}
|
|
8488
|
+
}
|
|
8489
|
+
strm.next_out = put;
|
|
8490
|
+
strm.avail_out = left;
|
|
8491
|
+
strm.next_in = next;
|
|
8492
|
+
strm.avail_in = have;
|
|
8493
|
+
state.hold = hold;
|
|
8494
|
+
state.bits = bits;
|
|
8495
|
+
if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH$1)) {
|
|
8496
|
+
if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))
|
|
8497
|
+
;
|
|
8498
|
+
}
|
|
8499
|
+
_in -= strm.avail_in;
|
|
8500
|
+
_out -= strm.avail_out;
|
|
8501
|
+
strm.total_in += _in;
|
|
8502
|
+
strm.total_out += _out;
|
|
8503
|
+
state.total += _out;
|
|
8504
|
+
if (state.wrap & 4 && _out) {
|
|
8505
|
+
strm.adler = state.check = state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out);
|
|
8506
|
+
}
|
|
8507
|
+
strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
|
|
8508
|
+
if ((_in === 0 && _out === 0 || flush === Z_FINISH$1) && ret === Z_OK$1) {
|
|
8509
|
+
ret = Z_BUF_ERROR;
|
|
8510
|
+
}
|
|
8511
|
+
return ret;
|
|
8512
|
+
};
|
|
8513
|
+
var inflateEnd = (strm) => {
|
|
8514
|
+
if (inflateStateCheck(strm)) {
|
|
8515
|
+
return Z_STREAM_ERROR$1;
|
|
8516
|
+
}
|
|
8517
|
+
let state = strm.state;
|
|
8518
|
+
if (state.window) {
|
|
8519
|
+
state.window = null;
|
|
8520
|
+
}
|
|
8521
|
+
strm.state = null;
|
|
8522
|
+
return Z_OK$1;
|
|
8523
|
+
};
|
|
8524
|
+
var inflateGetHeader = (strm, head) => {
|
|
8525
|
+
if (inflateStateCheck(strm)) {
|
|
8526
|
+
return Z_STREAM_ERROR$1;
|
|
8527
|
+
}
|
|
8528
|
+
const state = strm.state;
|
|
8529
|
+
if ((state.wrap & 2) === 0) {
|
|
8530
|
+
return Z_STREAM_ERROR$1;
|
|
8531
|
+
}
|
|
8532
|
+
state.head = head;
|
|
8533
|
+
head.done = false;
|
|
8534
|
+
return Z_OK$1;
|
|
8535
|
+
};
|
|
8536
|
+
var inflateSetDictionary = (strm, dictionary) => {
|
|
8537
|
+
const dictLength = dictionary.length;
|
|
8538
|
+
let state;
|
|
8539
|
+
let dictid;
|
|
8540
|
+
let ret;
|
|
8541
|
+
if (inflateStateCheck(strm)) {
|
|
8542
|
+
return Z_STREAM_ERROR$1;
|
|
8543
|
+
}
|
|
8544
|
+
state = strm.state;
|
|
8545
|
+
if (state.wrap !== 0 && state.mode !== DICT) {
|
|
8546
|
+
return Z_STREAM_ERROR$1;
|
|
8547
|
+
}
|
|
8548
|
+
if (state.mode === DICT) {
|
|
8549
|
+
dictid = 1;
|
|
8550
|
+
dictid = adler32_1(dictid, dictionary, dictLength, 0);
|
|
8551
|
+
if (dictid !== state.check) {
|
|
8552
|
+
return Z_DATA_ERROR$1;
|
|
8553
|
+
}
|
|
8554
|
+
}
|
|
8555
|
+
ret = updatewindow(strm, dictionary, dictLength, dictLength);
|
|
8556
|
+
if (ret) {
|
|
8557
|
+
state.mode = MEM;
|
|
8558
|
+
return Z_MEM_ERROR$1;
|
|
8559
|
+
}
|
|
8560
|
+
state.havedict = 1;
|
|
8561
|
+
return Z_OK$1;
|
|
8562
|
+
};
|
|
8563
|
+
var inflateReset_1 = inflateReset;
|
|
8564
|
+
var inflateReset2_1 = inflateReset2;
|
|
8565
|
+
var inflateResetKeep_1 = inflateResetKeep;
|
|
8566
|
+
var inflateInit_1 = inflateInit;
|
|
8567
|
+
var inflateInit2_1 = inflateInit2;
|
|
8568
|
+
var inflate_2$1 = inflate$2;
|
|
8569
|
+
var inflateEnd_1 = inflateEnd;
|
|
8570
|
+
var inflateGetHeader_1 = inflateGetHeader;
|
|
8571
|
+
var inflateSetDictionary_1 = inflateSetDictionary;
|
|
8572
|
+
var inflateInfo = "pako inflate (from Nodeca project)";
|
|
8573
|
+
var inflate_1$2 = {
|
|
8574
|
+
inflateReset: inflateReset_1,
|
|
8575
|
+
inflateReset2: inflateReset2_1,
|
|
8576
|
+
inflateResetKeep: inflateResetKeep_1,
|
|
8577
|
+
inflateInit: inflateInit_1,
|
|
8578
|
+
inflateInit2: inflateInit2_1,
|
|
8579
|
+
inflate: inflate_2$1,
|
|
8580
|
+
inflateEnd: inflateEnd_1,
|
|
8581
|
+
inflateGetHeader: inflateGetHeader_1,
|
|
8582
|
+
inflateSetDictionary: inflateSetDictionary_1,
|
|
8583
|
+
inflateInfo
|
|
8584
|
+
};
|
|
8585
|
+
function GZheader() {
|
|
8586
|
+
this.text = 0;
|
|
8587
|
+
this.time = 0;
|
|
8588
|
+
this.xflags = 0;
|
|
8589
|
+
this.os = 0;
|
|
8590
|
+
this.extra = null;
|
|
8591
|
+
this.extra_len = 0;
|
|
8592
|
+
this.name = "";
|
|
8593
|
+
this.comment = "";
|
|
8594
|
+
this.hcrc = 0;
|
|
8595
|
+
this.done = false;
|
|
8596
|
+
}
|
|
8597
|
+
var gzheader = GZheader;
|
|
8598
|
+
var toString = Object.prototype.toString;
|
|
8599
|
+
var {
|
|
8600
|
+
Z_NO_FLUSH,
|
|
8601
|
+
Z_FINISH,
|
|
8602
|
+
Z_OK,
|
|
8603
|
+
Z_STREAM_END,
|
|
8604
|
+
Z_NEED_DICT,
|
|
8605
|
+
Z_STREAM_ERROR,
|
|
8606
|
+
Z_DATA_ERROR,
|
|
8607
|
+
Z_MEM_ERROR
|
|
8608
|
+
} = constants$2;
|
|
8609
|
+
function Inflate$1(options) {
|
|
8610
|
+
this.options = common.assign({
|
|
8611
|
+
chunkSize: 1024 * 64,
|
|
8612
|
+
windowBits: 15,
|
|
8613
|
+
to: ""
|
|
8614
|
+
}, options || {});
|
|
8615
|
+
const opt = this.options;
|
|
8616
|
+
if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) {
|
|
8617
|
+
opt.windowBits = -opt.windowBits;
|
|
8618
|
+
if (opt.windowBits === 0) {
|
|
8619
|
+
opt.windowBits = -15;
|
|
8620
|
+
}
|
|
8621
|
+
}
|
|
8622
|
+
if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options && options.windowBits)) {
|
|
8623
|
+
opt.windowBits += 32;
|
|
8624
|
+
}
|
|
8625
|
+
if (opt.windowBits > 15 && opt.windowBits < 48) {
|
|
8626
|
+
if ((opt.windowBits & 15) === 0) {
|
|
8627
|
+
opt.windowBits |= 15;
|
|
8628
|
+
}
|
|
8629
|
+
}
|
|
8630
|
+
this.err = 0;
|
|
8631
|
+
this.msg = "";
|
|
8632
|
+
this.ended = false;
|
|
8633
|
+
this.chunks = [];
|
|
8634
|
+
this.strm = new zstream;
|
|
8635
|
+
this.strm.avail_out = 0;
|
|
8636
|
+
let status = inflate_1$2.inflateInit2(this.strm, opt.windowBits);
|
|
8637
|
+
if (status !== Z_OK) {
|
|
8638
|
+
throw new Error(messages[status]);
|
|
8639
|
+
}
|
|
8640
|
+
this.header = new gzheader;
|
|
8641
|
+
inflate_1$2.inflateGetHeader(this.strm, this.header);
|
|
8642
|
+
if (opt.dictionary) {
|
|
8643
|
+
if (typeof opt.dictionary === "string") {
|
|
8644
|
+
opt.dictionary = strings.string2buf(opt.dictionary);
|
|
8645
|
+
} else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") {
|
|
8646
|
+
opt.dictionary = new Uint8Array(opt.dictionary);
|
|
8647
|
+
}
|
|
8648
|
+
if (opt.raw) {
|
|
8649
|
+
status = inflate_1$2.inflateSetDictionary(this.strm, opt.dictionary);
|
|
8650
|
+
if (status !== Z_OK) {
|
|
8651
|
+
throw new Error(messages[status]);
|
|
8652
|
+
}
|
|
8653
|
+
}
|
|
8654
|
+
}
|
|
8655
|
+
}
|
|
8656
|
+
Inflate$1.prototype.push = function(data, flush_mode) {
|
|
8657
|
+
const strm = this.strm;
|
|
8658
|
+
const chunkSize = this.options.chunkSize;
|
|
8659
|
+
const dictionary = this.options.dictionary;
|
|
8660
|
+
let status, _flush_mode, last_avail_out;
|
|
8661
|
+
if (this.ended)
|
|
8662
|
+
return false;
|
|
8663
|
+
if (flush_mode === ~~flush_mode)
|
|
8664
|
+
_flush_mode = flush_mode;
|
|
8665
|
+
else
|
|
8666
|
+
_flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;
|
|
8667
|
+
if (toString.call(data) === "[object ArrayBuffer]") {
|
|
8668
|
+
strm.input = new Uint8Array(data);
|
|
8669
|
+
} else {
|
|
8670
|
+
strm.input = data;
|
|
8671
|
+
}
|
|
8672
|
+
strm.next_in = 0;
|
|
8673
|
+
strm.avail_in = strm.input.length;
|
|
8674
|
+
for (;; ) {
|
|
8675
|
+
if (strm.avail_out === 0) {
|
|
8676
|
+
strm.output = new Uint8Array(chunkSize);
|
|
8677
|
+
strm.next_out = 0;
|
|
8678
|
+
strm.avail_out = chunkSize;
|
|
8679
|
+
}
|
|
8680
|
+
status = inflate_1$2.inflate(strm, _flush_mode);
|
|
8681
|
+
if (status === Z_NEED_DICT && dictionary) {
|
|
8682
|
+
status = inflate_1$2.inflateSetDictionary(strm, dictionary);
|
|
8683
|
+
if (status === Z_OK) {
|
|
8684
|
+
status = inflate_1$2.inflate(strm, _flush_mode);
|
|
8685
|
+
} else if (status === Z_DATA_ERROR) {
|
|
8686
|
+
status = Z_NEED_DICT;
|
|
8687
|
+
}
|
|
8688
|
+
}
|
|
8689
|
+
while (strm.avail_in > 0 && status === Z_STREAM_END && strm.state.wrap > 0 && data[strm.next_in] !== 0) {
|
|
8690
|
+
inflate_1$2.inflateReset(strm);
|
|
8691
|
+
status = inflate_1$2.inflate(strm, _flush_mode);
|
|
8692
|
+
}
|
|
8693
|
+
switch (status) {
|
|
8694
|
+
case Z_STREAM_ERROR:
|
|
8695
|
+
case Z_DATA_ERROR:
|
|
8696
|
+
case Z_NEED_DICT:
|
|
8697
|
+
case Z_MEM_ERROR:
|
|
8698
|
+
this.onEnd(status);
|
|
8699
|
+
this.ended = true;
|
|
8700
|
+
return false;
|
|
8701
|
+
}
|
|
8702
|
+
last_avail_out = strm.avail_out;
|
|
8703
|
+
if (strm.next_out) {
|
|
8704
|
+
if (strm.avail_out === 0 || status === Z_STREAM_END) {
|
|
8705
|
+
if (this.options.to === "string") {
|
|
8706
|
+
let next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
|
|
8707
|
+
let tail = strm.next_out - next_out_utf8;
|
|
8708
|
+
let utf8str = strings.buf2string(strm.output, next_out_utf8);
|
|
8709
|
+
strm.next_out = tail;
|
|
8710
|
+
strm.avail_out = chunkSize - tail;
|
|
8711
|
+
if (tail)
|
|
8712
|
+
strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0);
|
|
8713
|
+
this.onData(utf8str);
|
|
8714
|
+
} else {
|
|
8715
|
+
this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));
|
|
8716
|
+
}
|
|
8717
|
+
}
|
|
8718
|
+
}
|
|
8719
|
+
if (status === Z_OK && last_avail_out === 0)
|
|
8720
|
+
continue;
|
|
8721
|
+
if (status === Z_STREAM_END) {
|
|
8722
|
+
status = inflate_1$2.inflateEnd(this.strm);
|
|
8723
|
+
this.onEnd(status);
|
|
8724
|
+
this.ended = true;
|
|
8725
|
+
return true;
|
|
8726
|
+
}
|
|
8727
|
+
if (strm.avail_in === 0)
|
|
8728
|
+
break;
|
|
8729
|
+
}
|
|
8730
|
+
return true;
|
|
8731
|
+
};
|
|
8732
|
+
Inflate$1.prototype.onData = function(chunk) {
|
|
8733
|
+
this.chunks.push(chunk);
|
|
8734
|
+
};
|
|
8735
|
+
Inflate$1.prototype.onEnd = function(status) {
|
|
8736
|
+
if (status === Z_OK) {
|
|
8737
|
+
if (this.options.to === "string") {
|
|
8738
|
+
this.result = this.chunks.join("");
|
|
8739
|
+
} else {
|
|
8740
|
+
this.result = common.flattenChunks(this.chunks);
|
|
8741
|
+
}
|
|
8742
|
+
}
|
|
8743
|
+
this.chunks = [];
|
|
8744
|
+
this.err = status;
|
|
8745
|
+
this.msg = this.strm.msg;
|
|
8746
|
+
};
|
|
8747
|
+
function inflate$1(input, options) {
|
|
8748
|
+
const inflator = new Inflate$1(options);
|
|
8749
|
+
inflator.push(input);
|
|
8750
|
+
if (inflator.err)
|
|
8751
|
+
throw inflator.msg || messages[inflator.err];
|
|
8752
|
+
return inflator.result;
|
|
8753
|
+
}
|
|
8754
|
+
function inflateRaw$1(input, options) {
|
|
8755
|
+
options = options || {};
|
|
8756
|
+
options.raw = true;
|
|
8757
|
+
return inflate$1(input, options);
|
|
8758
|
+
}
|
|
8759
|
+
var Inflate_1$1 = Inflate$1;
|
|
8760
|
+
var inflate_2 = inflate$1;
|
|
8761
|
+
var inflateRaw_1$1 = inflateRaw$1;
|
|
8762
|
+
var ungzip$1 = inflate$1;
|
|
8763
|
+
var constants = constants$2;
|
|
8764
|
+
var inflate_1$1 = {
|
|
8765
|
+
Inflate: Inflate_1$1,
|
|
8766
|
+
inflate: inflate_2,
|
|
8767
|
+
inflateRaw: inflateRaw_1$1,
|
|
8768
|
+
ungzip: ungzip$1,
|
|
8769
|
+
constants
|
|
8770
|
+
};
|
|
8771
|
+
var { Deflate, deflate, deflateRaw, gzip } = deflate_1$1;
|
|
8772
|
+
var { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1;
|
|
8773
|
+
var Deflate_1 = Deflate;
|
|
8774
|
+
var deflate_1 = deflate;
|
|
8775
|
+
var deflateRaw_1 = deflateRaw;
|
|
8776
|
+
var gzip_1 = gzip;
|
|
8777
|
+
var Inflate_1 = Inflate;
|
|
8778
|
+
var inflate_1 = inflate;
|
|
8779
|
+
var inflateRaw_1 = inflateRaw;
|
|
8780
|
+
var ungzip_1 = ungzip;
|
|
8781
|
+
var constants_1 = constants$2;
|
|
8782
|
+
var pako = {
|
|
8783
|
+
Deflate: Deflate_1,
|
|
8784
|
+
deflate: deflate_1,
|
|
8785
|
+
deflateRaw: deflateRaw_1,
|
|
8786
|
+
gzip: gzip_1,
|
|
8787
|
+
Inflate: Inflate_1,
|
|
8788
|
+
inflate: inflate_1,
|
|
8789
|
+
inflateRaw: inflateRaw_1,
|
|
8790
|
+
ungzip: ungzip_1,
|
|
8791
|
+
constants: constants_1
|
|
8792
|
+
};
|
|
8793
|
+
|
|
8794
|
+
class VYI {
|
|
8795
|
+
static version = "4.1.0";
|
|
8796
|
+
static logger = new Logger;
|
|
8797
|
+
icons = new Map;
|
|
8798
|
+
name = "failed-to-find-vyi-name";
|
|
8799
|
+
formatVersion = 1;
|
|
8800
|
+
constructor(pVyiData) {
|
|
8801
|
+
VYI.logger.registerType("Vyi-module", "#ff6600");
|
|
8802
|
+
if (pVyiData) {
|
|
8803
|
+
this.parse(pVyiData);
|
|
8804
|
+
}
|
|
8805
|
+
}
|
|
8806
|
+
parse(pVyiData) {
|
|
8807
|
+
if (!pVyiData)
|
|
8808
|
+
return this;
|
|
8809
|
+
try {
|
|
8810
|
+
let vyi;
|
|
8811
|
+
if (typeof pVyiData === "string") {
|
|
8812
|
+
try {
|
|
8813
|
+
vyi = JSON.parse(pVyiData);
|
|
8814
|
+
} catch (pError) {
|
|
8815
|
+
if (!pVyiData.includes(".vyr") && !pVyiData.includes(".vyi")) {
|
|
8816
|
+
vyi = pVyiData;
|
|
8817
|
+
if (!vyi) {
|
|
8818
|
+
throw new Error("Non vyi data found from binary string");
|
|
8819
|
+
}
|
|
8884
8820
|
} else {
|
|
8885
|
-
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
state.length -= copy;
|
|
8894
|
-
do {
|
|
8895
|
-
output[put++] = from_source[from++];
|
|
8896
|
-
} while (--copy);
|
|
8897
|
-
if (state.length === 0) {
|
|
8898
|
-
state.mode = LEN;
|
|
8899
|
-
}
|
|
8900
|
-
break;
|
|
8901
|
-
case LIT:
|
|
8902
|
-
if (left === 0) {
|
|
8903
|
-
break inf_leave;
|
|
8904
|
-
}
|
|
8905
|
-
output[put++] = state.length;
|
|
8906
|
-
left--;
|
|
8907
|
-
state.mode = LEN;
|
|
8908
|
-
break;
|
|
8909
|
-
case CHECK:
|
|
8910
|
-
if (state.wrap) {
|
|
8911
|
-
while (bits < 32) {
|
|
8912
|
-
if (have === 0) {
|
|
8913
|
-
break inf_leave;
|
|
8914
|
-
}
|
|
8915
|
-
have--;
|
|
8916
|
-
hold |= input[next++] << bits;
|
|
8917
|
-
bits += 8;
|
|
8918
|
-
}
|
|
8919
|
-
_out -= left;
|
|
8920
|
-
strm.total_out += _out;
|
|
8921
|
-
state.total += _out;
|
|
8922
|
-
if (state.wrap & 4 && _out) {
|
|
8923
|
-
strm.adler = state.check = state.flags ? crc32_1(state.check, output, _out, put - _out) : adler32_1(state.check, output, _out, put - _out);
|
|
8924
|
-
}
|
|
8925
|
-
_out = left;
|
|
8926
|
-
if (state.wrap & 4 && (state.flags ? hold : zswap32(hold)) !== state.check) {
|
|
8927
|
-
strm.msg = "incorrect data check";
|
|
8928
|
-
state.mode = BAD;
|
|
8929
|
-
break;
|
|
8930
|
-
}
|
|
8931
|
-
hold = 0;
|
|
8932
|
-
bits = 0;
|
|
8933
|
-
}
|
|
8934
|
-
state.mode = LENGTH;
|
|
8935
|
-
case LENGTH:
|
|
8936
|
-
if (state.wrap && state.flags) {
|
|
8937
|
-
while (bits < 32) {
|
|
8938
|
-
if (have === 0) {
|
|
8939
|
-
break inf_leave;
|
|
8821
|
+
try {
|
|
8822
|
+
vyi = JSON.parse(pVyiData);
|
|
8823
|
+
} catch (e) {
|
|
8824
|
+
const isNodeEnv = typeof window === "undefined";
|
|
8825
|
+
if (isNodeEnv) {
|
|
8826
|
+
vyi = this.readFileAndGetVYI(pVyiData);
|
|
8827
|
+
} else {
|
|
8828
|
+
throw new Error("Invalid string input - not valid JSON or file path");
|
|
8940
8829
|
}
|
|
8941
|
-
have--;
|
|
8942
|
-
hold += input[next++] << bits;
|
|
8943
|
-
bits += 8;
|
|
8944
|
-
}
|
|
8945
|
-
if (state.wrap & 4 && hold !== (state.total & 4294967295)) {
|
|
8946
|
-
strm.msg = "incorrect length check";
|
|
8947
|
-
state.mode = BAD;
|
|
8948
|
-
break;
|
|
8949
8830
|
}
|
|
8950
|
-
hold = 0;
|
|
8951
|
-
bits = 0;
|
|
8952
8831
|
}
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
|
|
8832
|
+
}
|
|
8833
|
+
} else if (pVyiData instanceof VYI) {
|
|
8834
|
+
vyi = pVyiData.export();
|
|
8835
|
+
} else if (pVyiData instanceof Object && !Array.isArray(pVyiData) && !(pVyiData instanceof ArrayBuffer || pVyiData instanceof Uint8Array)) {
|
|
8836
|
+
vyi = pVyiData;
|
|
8837
|
+
} else if (pVyiData instanceof ArrayBuffer || pVyiData instanceof Uint8Array) {
|
|
8838
|
+
vyi = this.handleBinaryData(pVyiData);
|
|
8839
|
+
} else {
|
|
8840
|
+
throw new Error("Error processing: Invalid input type provided.");
|
|
8841
|
+
}
|
|
8842
|
+
if (!vyi || (!vyi.v || !vyi.i) && !vyi.icons) {
|
|
8843
|
+
throw new Error("Non vyi data found.");
|
|
8844
|
+
}
|
|
8845
|
+
this.processVyiData(vyi);
|
|
8846
|
+
} catch (pError) {
|
|
8847
|
+
VYI.logger.prefix("Vyi-module").error(`${pError.message}`);
|
|
8848
|
+
}
|
|
8849
|
+
return this;
|
|
8850
|
+
}
|
|
8851
|
+
readFile(pVyiData) {
|
|
8852
|
+
try {
|
|
8853
|
+
const encoder = new TextEncoder;
|
|
8854
|
+
const binaryData = encoder.encode(pVyiData);
|
|
8855
|
+
const decompressed = pako.inflate(binaryData, { to: "string" });
|
|
8856
|
+
return JSON.parse(decompressed);
|
|
8857
|
+
} catch (error) {
|
|
8858
|
+
console.error("File reading failed:", error);
|
|
8859
|
+
return null;
|
|
8860
|
+
}
|
|
8861
|
+
}
|
|
8862
|
+
readFileAndGetVYI(pURL) {
|
|
8863
|
+
const fs = () => ({});
|
|
8864
|
+
const data = fs.readFileSync(pURL);
|
|
8865
|
+
return this.handleBinaryData(data);
|
|
8866
|
+
}
|
|
8867
|
+
async fetchAndParseJSON(pURL) {
|
|
8868
|
+
try {
|
|
8869
|
+
const response = await fetch(pURL);
|
|
8870
|
+
const jsonData = await response.json();
|
|
8871
|
+
return jsonData;
|
|
8872
|
+
} catch (pError) {
|
|
8873
|
+
throw new Error(`Failed to fetch or parse JSON from URL: ${pError}`);
|
|
8874
|
+
}
|
|
8875
|
+
}
|
|
8876
|
+
handleBinaryData(pBinaryData) {
|
|
8877
|
+
const byteArray = pBinaryData instanceof ArrayBuffer ? new Uint8Array(pBinaryData) : pBinaryData;
|
|
8878
|
+
try {
|
|
8879
|
+
const decompressed = pako.inflate(byteArray, { to: "string" });
|
|
8880
|
+
if (!decompressed)
|
|
8881
|
+
return null;
|
|
8882
|
+
return JSON.parse(decompressed);
|
|
8883
|
+
} catch (pError) {
|
|
8884
|
+
try {
|
|
8885
|
+
const decodedText = new TextDecoder().decode(byteArray);
|
|
8886
|
+
if (!decodedText)
|
|
8887
|
+
return null;
|
|
8888
|
+
return JSON.parse(decodedText);
|
|
8889
|
+
} catch (pDecodeError) {
|
|
8890
|
+
console.error("Decoding failed:", pDecodeError);
|
|
8891
|
+
return null;
|
|
8965
8892
|
}
|
|
8966
8893
|
}
|
|
8967
|
-
strm.next_out = put;
|
|
8968
|
-
strm.avail_out = left;
|
|
8969
|
-
strm.next_in = next;
|
|
8970
|
-
strm.avail_in = have;
|
|
8971
|
-
state.hold = hold;
|
|
8972
|
-
state.bits = bits;
|
|
8973
|
-
if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH$1)) {
|
|
8974
|
-
if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out))
|
|
8975
|
-
;
|
|
8976
8894
|
}
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8895
|
+
processVyiData(pVyi) {
|
|
8896
|
+
this.icons.clear();
|
|
8897
|
+
const icons = pVyi.i || pVyi.icons;
|
|
8898
|
+
this.formatVersion = pVyi.v ?? "format not found";
|
|
8899
|
+
if (Array.isArray(icons)) {
|
|
8900
|
+
icons.forEach((pIconData) => {
|
|
8901
|
+
if (!Array.isArray(pIconData) && typeof pIconData === "object") {
|
|
8902
|
+
const convertedIconData = this.convertOldIconData(pIconData);
|
|
8903
|
+
this.addIcon(convertedIconData);
|
|
8904
|
+
} else {
|
|
8905
|
+
this.addIcon(pIconData);
|
|
8906
|
+
}
|
|
8907
|
+
});
|
|
8908
|
+
} else {
|
|
8909
|
+
VYI.logger.prefix("Vyi-module").error("Invalid .vyi file! Cannot parse icons.");
|
|
8910
|
+
}
|
|
8911
|
+
}
|
|
8912
|
+
convertOldIconData(pOldData) {
|
|
8913
|
+
const frames = Array.isArray(pOldData.frames) ? pOldData.frames.map((f) => [f.data, f.delay]) : [];
|
|
8914
|
+
const states = Array.isArray(pOldData.states) ? pOldData.states.map((s) => {
|
|
8915
|
+
const stateFrames = Array.isArray(s.frames) ? s.frames.map((f) => [f.data, f.delay]) : [];
|
|
8916
|
+
return [s.name, s.data, s.delay || 100, stateFrames];
|
|
8917
|
+
}) : [];
|
|
8918
|
+
return [
|
|
8919
|
+
pOldData.name || "",
|
|
8920
|
+
pOldData.w || 32,
|
|
8921
|
+
pOldData.h || 32,
|
|
8922
|
+
pOldData.delay || 100,
|
|
8923
|
+
pOldData.data || "",
|
|
8924
|
+
frames,
|
|
8925
|
+
states
|
|
8926
|
+
];
|
|
8984
8927
|
}
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8928
|
+
addIcon(pIconData) {
|
|
8929
|
+
if (!pIconData) {
|
|
8930
|
+
VYI.logger.prefix("Vyi-module").error("No icon data passed!");
|
|
8931
|
+
return;
|
|
8932
|
+
}
|
|
8933
|
+
if (!(pIconData instanceof Icon) && !Array.isArray(pIconData)) {
|
|
8934
|
+
VYI.logger.prefix("Vyi-module").error("Invalid icon data type passed!");
|
|
8935
|
+
return;
|
|
8936
|
+
}
|
|
8937
|
+
const icon = pIconData instanceof Icon ? pIconData : new Icon(pIconData);
|
|
8938
|
+
this.icons.set(icon.id, icon);
|
|
8939
|
+
icon.setVyi(this);
|
|
8940
|
+
return icon;
|
|
8988
8941
|
}
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8942
|
+
removeIcon(pIcon) {
|
|
8943
|
+
if (!pIcon)
|
|
8944
|
+
return;
|
|
8945
|
+
if (pIcon instanceof Icon) {
|
|
8946
|
+
if (this.icons.delete(pIcon.id)) {
|
|
8947
|
+
pIcon.removeVyi();
|
|
8948
|
+
}
|
|
8949
|
+
}
|
|
8994
8950
|
}
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8951
|
+
removeIconByName(pName) {
|
|
8952
|
+
const icon = this.getIcon(pName);
|
|
8953
|
+
if (icon) {
|
|
8954
|
+
this.removeIcon(icon);
|
|
8955
|
+
}
|
|
8998
8956
|
}
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
return Z_STREAM_ERROR$1;
|
|
8957
|
+
removeIconById(pId) {
|
|
8958
|
+
const icon = this.getIconById(pId);
|
|
8959
|
+
if (icon) {
|
|
8960
|
+
this.removeIcon(icon);
|
|
8961
|
+
}
|
|
9005
8962
|
}
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
return
|
|
8963
|
+
getIconNames() {
|
|
8964
|
+
const iconNames = this.getIcons().map((pIcon) => pIcon.name);
|
|
8965
|
+
return iconNames;
|
|
9009
8966
|
}
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
8967
|
+
getIcon(pName) {
|
|
8968
|
+
if (typeof pName === "string") {
|
|
8969
|
+
const icons = this.getIcons();
|
|
8970
|
+
for (let i = icons.length - 1;i >= 0; i--) {
|
|
8971
|
+
const icon = icons[i];
|
|
8972
|
+
if (icon.getName() === pName) {
|
|
8973
|
+
return icon;
|
|
8974
|
+
}
|
|
8975
|
+
}
|
|
8976
|
+
} else {
|
|
8977
|
+
VYI.logger.prefix("Vyi-module").error("Invalid name type used!");
|
|
8978
|
+
}
|
|
9021
8979
|
}
|
|
9022
|
-
|
|
9023
|
-
|
|
9024
|
-
return Z_STREAM_ERROR$1;
|
|
8980
|
+
getIconCount() {
|
|
8981
|
+
return this.icons.size;
|
|
9025
8982
|
}
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
8983
|
+
getIconById(pId) {
|
|
8984
|
+
if (!pId)
|
|
8985
|
+
return;
|
|
8986
|
+
const icon = this.icons.get(pId) || this.getIcons().find((pIcon) => pIcon.states.has(pId))?.getStateById(pId);
|
|
8987
|
+
return icon;
|
|
8988
|
+
}
|
|
8989
|
+
getIcons() {
|
|
8990
|
+
return Array.from(this.icons.values());
|
|
8991
|
+
}
|
|
8992
|
+
rename(pName) {
|
|
8993
|
+
if (typeof pName === "string") {
|
|
8994
|
+
this.name = pName;
|
|
8995
|
+
} else {
|
|
8996
|
+
VYI.logger.prefix("Vyi-module").error("Invalid name type used!");
|
|
9031
8997
|
}
|
|
9032
8998
|
}
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
8999
|
+
getName() {
|
|
9000
|
+
return this.name;
|
|
9001
|
+
}
|
|
9002
|
+
export(pCompressed) {
|
|
9003
|
+
const vyi = {
|
|
9004
|
+
v: this.formatVersion,
|
|
9005
|
+
i: this.getIcons().map((pIcon) => pIcon.export())
|
|
9006
|
+
};
|
|
9007
|
+
if (pCompressed) {
|
|
9008
|
+
const binaryData = new TextEncoder().encode(JSON.stringify(vyi));
|
|
9009
|
+
const compressed = pako.deflate(binaryData);
|
|
9010
|
+
return compressed;
|
|
9011
|
+
}
|
|
9012
|
+
return vyi;
|
|
9037
9013
|
}
|
|
9038
|
-
state.havedict = 1;
|
|
9039
|
-
return Z_OK$1;
|
|
9040
|
-
};
|
|
9041
|
-
var inflateReset_1 = inflateReset;
|
|
9042
|
-
var inflateReset2_1 = inflateReset2;
|
|
9043
|
-
var inflateResetKeep_1 = inflateResetKeep;
|
|
9044
|
-
var inflateInit_1 = inflateInit;
|
|
9045
|
-
var inflateInit2_1 = inflateInit2;
|
|
9046
|
-
var inflate_2$1 = inflate$2;
|
|
9047
|
-
var inflateEnd_1 = inflateEnd;
|
|
9048
|
-
var inflateGetHeader_1 = inflateGetHeader;
|
|
9049
|
-
var inflateSetDictionary_1 = inflateSetDictionary;
|
|
9050
|
-
var inflateInfo = "pako inflate (from Nodeca project)";
|
|
9051
|
-
var inflate_1$2 = {
|
|
9052
|
-
inflateReset: inflateReset_1,
|
|
9053
|
-
inflateReset2: inflateReset2_1,
|
|
9054
|
-
inflateResetKeep: inflateResetKeep_1,
|
|
9055
|
-
inflateInit: inflateInit_1,
|
|
9056
|
-
inflateInit2: inflateInit2_1,
|
|
9057
|
-
inflate: inflate_2$1,
|
|
9058
|
-
inflateEnd: inflateEnd_1,
|
|
9059
|
-
inflateGetHeader: inflateGetHeader_1,
|
|
9060
|
-
inflateSetDictionary: inflateSetDictionary_1,
|
|
9061
|
-
inflateInfo
|
|
9062
|
-
};
|
|
9063
|
-
function GZheader() {
|
|
9064
|
-
this.text = 0;
|
|
9065
|
-
this.time = 0;
|
|
9066
|
-
this.xflags = 0;
|
|
9067
|
-
this.os = 0;
|
|
9068
|
-
this.extra = null;
|
|
9069
|
-
this.extra_len = 0;
|
|
9070
|
-
this.name = "";
|
|
9071
|
-
this.comment = "";
|
|
9072
|
-
this.hcrc = 0;
|
|
9073
|
-
this.done = false;
|
|
9074
9014
|
}
|
|
9075
|
-
var
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9015
|
+
var WORKER_CODE = `/*!
|
|
9016
|
+
* vyi@4.1.0 https://github.com/EvitcaStudio/vyi
|
|
9017
|
+
* Compiled Sun, 21 Jun 2026 10:57:24 UTC
|
|
9018
|
+
* Copyright (c) 2026 Evitca Studio, "doubleactii"
|
|
9019
|
+
*
|
|
9020
|
+
* vyi is privately licensed.
|
|
9021
|
+
*/
|
|
9022
|
+
var a0=((Q)=>typeof require!=="undefined"?require:typeof Proxy!=="undefined"?new Proxy(Q,{get:(W,J)=>(typeof require!=="undefined"?require:W)[J]}):Q)(function(Q){if(typeof require!=="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+Q+'" is not supported')});/*!
|
|
9023
|
+
* logger@1.0.0 https://github.com/EvitcaStudio/Logger
|
|
9024
|
+
* Compiled Mon, 10 Nov 2025 05:36:23 UTC
|
|
9025
|
+
* Copyright (c) 2025 Evitca Studio, "doubleactii"
|
|
9026
|
+
*
|
|
9027
|
+
* logger is privately licensed.
|
|
9028
|
+
*/class eQ{RESET;BRIGHT;DIM;UNDERSCORE;BLINK;REVERSE;HIDDEN;FG_BLACK;FG_RED;FG_GREEN;FG_YELLOW;FG_BLUE;FG_MAGENTA;FG_CYAN;FG_WHITE;FG_GRAY;BG_BLACK;BG_RED;BG_GREEN;BG_YELLOW;BG_BLUE;BG_MAGENTA;BG_CYAN;BG_WHITE;BG_GRAY;TYPE_SPACER_LENGTH;types;currentType;SPACE_CHAR;FG_COLORS;BG_COLORS;constructor(Q){this.RESET="\\x1B[0m",this.BRIGHT="\\x1B[1m",this.DIM="\\x1B[2m",this.UNDERSCORE="\\x1B[4m",this.BLINK="\\x1B[5m",this.REVERSE="\\x1B[7m",this.HIDDEN="\\x1B[8m",this.FG_BLACK="\\x1B[30m",this.FG_RED="\\x1B[31m",this.FG_GREEN="\\x1B[32m",this.FG_YELLOW="\\x1B[33m",this.FG_BLUE="\\x1B[34m",this.FG_MAGENTA="\\x1B[35m",this.FG_CYAN="\\x1B[36m",this.FG_WHITE="\\x1B[37m",this.FG_GRAY="\\x1B[90m",this.BG_BLACK="\\x1B[40m",this.BG_RED="\\x1B[41m",this.BG_GREEN="\\x1B[42m",this.BG_YELLOW="\\x1B[43m",this.BG_BLUE="\\x1B[44m",this.BG_MAGENTA="\\x1B[45m",this.BG_CYAN="\\x1B[46m",this.BG_WHITE="\\x1B[47m",this.BG_GRAY="\\x1B[100m",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let W=0;W<=255;W++)this.FG_COLORS[W]="\\x1B[38;5;"+W+"m";this.BG_COLORS={};for(let W=0;W<=255;W++)this.BG_COLORS[W]="\\x1B[48;5;"+W+"m";if(Array.isArray(Q))this.registerTypes(Q)}prefix(Q){if(typeof Q==="string")this.currentType=Q;return this}message(Q="log",...W){let J=this.currentType?this.currentType:"";if(J.length===0)console[Q](...W);else{let G=J.length>=this.TYPE_SPACER_LENGTH,q=this.types[J.toLowerCase()]?this.types[J.toLowerCase()]:this.types.default,z=q.includes("\\x1B");if(!z)q=\`color: \${q}\`;if(typeof globalThis.window!=="undefined")if(z)console[Q](q+J+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-J.length,G?1:0))+"|"+this.RESET,...W);else console[Q]("%c"+J+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-J.length,G?1:0))+"|",q,...W);else console[Q](q+J+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-J.length,G?1:0))+"|"+this.RESET,...W)}this.currentType=""}log(...Q){this.message("log",...Q)}info(...Q){this.message("info",...Q)}error(...Q){this.message("error",...Q)}warn(...Q){this.message("warn",...Q)}assert(...Q){console.assert(...Q)}debug(...Q){this.message("debug",...Q)}count(Q){console.count(Q)}countReset(Q){console.countReset(Q)}table(Q,W){console.table(Q,W)}time(Q="default"){this.message("time",Q)}timeLog(Q="default",...W){this.message("timeLog",Q,...W)}timeEnd(Q="default"){this.message("timeEnd",Q)}trace(...Q){this.message("trace",...Q)}group(Q=""){this.message("group",Q)}groupCollapsed(Q=""){this.message("groupCollapsed",Q)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(Q,W){if(this.types[Q.toLowerCase()])return;if(typeof Q==="string"&&typeof W==="string")this.types[Q.toLowerCase()]=W}registerTypes(Q){if(Array.isArray(Q))for(let W=0;W<Q.length;W++)this.registerType(Q[W].type,Q[W].ansi)}unregisterType(Q){let W=Q.toLowerCase();if(this.types[W])delete this.types[W]}}class n{delay=100;dataURL="";index=0;parent=null;static defaultDelay=100;constructor(Q){if(Q)this.parse(Q)}parse(Q){if(!Q)return;let W=Q[0],J=Q[1]?Q[1]:this.parent?this.parent.getDelay():null;if(this.setDataURL(W),J)this.setDelay(J)}setParent(Q){if(!Q||this.parent)return;if(Q instanceof T){if(this.parent=Q,!this.getDelay())this.setDelay(this.parent.getDelay())}}removeParent(){this.parent=null}setDelay(Q){if(typeof Q==="number")this.delay=Q;else w.logger.prefix("Vyi-module").error("Invalid delay type!");return this}getDelay(){return this.delay}getIndex(){return this.index}setDataURL(Q){if(typeof Q==="string")this.dataURL=Q.replace(/^data:image\\/[a-z]+;base64,/,"");else w.logger.prefix("Vyi-module").error("Invalid data url type!");return this}getDataURL(){return this.dataURL}getWidth(){if(!this.parent)return;return this.parent.width}getHeight(){if(!this.parent)return;return this.parent.height}getSize(){if(!this.parent)return;return{width:this.parent.width,height:this.parent.height}}getVyi(){return this?.parent?.vyi}getParent(){return this.parent}export(){let Q=[this.getDataURL()];if(this.getDelay()!==n.defaultDelay)Q[1]=this.getDelay()||n.defaultDelay;return Q}}/*!
|
|
9029
|
+
* icon-point@2.1.0 https://github.com/EvitcaStudio/IconPoint
|
|
9030
|
+
* Compiled Mon, 10 Nov 2025 09:52:21 UTC
|
|
9031
|
+
* Copyright (c) 2025 Evitca Studio, "doubleactii"
|
|
9032
|
+
*
|
|
9033
|
+
* icon-point is privately licensed.
|
|
9034
|
+
*//*!
|
|
9035
|
+
* logger@1.0.0 https://github.com/EvitcaStudio/Logger
|
|
9036
|
+
* Compiled Mon, 10 Nov 2025 05:36:23 UTC
|
|
9037
|
+
* Copyright (c) 2025 Evitca Studio, "doubleactii"
|
|
9038
|
+
*
|
|
9039
|
+
* logger is privately licensed.
|
|
9040
|
+
*/class SJ{RESET;BRIGHT;DIM;UNDERSCORE;BLINK;REVERSE;HIDDEN;FG_BLACK;FG_RED;FG_GREEN;FG_YELLOW;FG_BLUE;FG_MAGENTA;FG_CYAN;FG_WHITE;FG_GRAY;BG_BLACK;BG_RED;BG_GREEN;BG_YELLOW;BG_BLUE;BG_MAGENTA;BG_CYAN;BG_WHITE;BG_GRAY;TYPE_SPACER_LENGTH;types;currentType;SPACE_CHAR;FG_COLORS;BG_COLORS;constructor(Q){this.RESET="\\x1B[0m",this.BRIGHT="\\x1B[1m",this.DIM="\\x1B[2m",this.UNDERSCORE="\\x1B[4m",this.BLINK="\\x1B[5m",this.REVERSE="\\x1B[7m",this.HIDDEN="\\x1B[8m",this.FG_BLACK="\\x1B[30m",this.FG_RED="\\x1B[31m",this.FG_GREEN="\\x1B[32m",this.FG_YELLOW="\\x1B[33m",this.FG_BLUE="\\x1B[34m",this.FG_MAGENTA="\\x1B[35m",this.FG_CYAN="\\x1B[36m",this.FG_WHITE="\\x1B[37m",this.FG_GRAY="\\x1B[90m",this.BG_BLACK="\\x1B[40m",this.BG_RED="\\x1B[41m",this.BG_GREEN="\\x1B[42m",this.BG_YELLOW="\\x1B[43m",this.BG_BLUE="\\x1B[44m",this.BG_MAGENTA="\\x1B[45m",this.BG_CYAN="\\x1B[46m",this.BG_WHITE="\\x1B[47m",this.BG_GRAY="\\x1B[100m",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let W=0;W<=255;W++)this.FG_COLORS[W]="\\x1B[38;5;"+W+"m";this.BG_COLORS={};for(let W=0;W<=255;W++)this.BG_COLORS[W]="\\x1B[48;5;"+W+"m";if(Array.isArray(Q))this.registerTypes(Q)}prefix(Q){if(typeof Q==="string")this.currentType=Q;return this}message(Q="log",...W){let J=this.currentType?this.currentType:"";if(J.length===0)console[Q](...W);else{let G=J.length>=this.TYPE_SPACER_LENGTH,q=this.types[J.toLowerCase()]?this.types[J.toLowerCase()]:this.types.default,z=q.includes("\\x1B");if(!z)q=\`color: \${q}\`;if(typeof globalThis.window!=="undefined")if(z)console[Q](q+J+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-J.length,G?1:0))+"|"+this.RESET,...W);else console[Q]("%c"+J+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-J.length,G?1:0))+"|",q,...W);else console[Q](q+J+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-J.length,G?1:0))+"|"+this.RESET,...W)}this.currentType=""}log(...Q){this.message("log",...Q)}info(...Q){this.message("info",...Q)}error(...Q){this.message("error",...Q)}warn(...Q){this.message("warn",...Q)}assert(...Q){console.assert(...Q)}debug(...Q){this.message("debug",...Q)}count(Q){console.count(Q)}countReset(Q){console.countReset(Q)}table(Q,W){console.table(Q,W)}time(Q="default"){this.message("time",Q)}timeLog(Q="default",...W){this.message("timeLog",Q,...W)}timeEnd(Q="default"){this.message("timeEnd",Q)}trace(...Q){this.message("trace",...Q)}group(Q=""){this.message("group",Q)}groupCollapsed(Q=""){this.message("groupCollapsed",Q)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(Q,W){if(this.types[Q.toLowerCase()])return;if(typeof Q==="string"&&typeof W==="string")this.types[Q.toLowerCase()]=W}registerTypes(Q){if(Array.isArray(Q))for(let W=0;W<Q.length;W++)this.registerType(Q[W].type,Q[W].ansi)}unregisterType(Q){let W=Q.toLowerCase();if(this.types[W])delete this.types[W]}}class E{static defaultOffset={x:0,y:0};static defaultAnchor={x:0.5,y:0.5};static version="2.1.0";static logger=new SJ;iconPoint={x:0,y:0};originalPoint={x:0,y:0};positionalPoint;point={x:0,y:0};bounds={width:32,height:32};id;constructor(Q,W,J,j){let{width:G,height:q}=W;this.bounds.width=G,this.bounds.height=q,this.positionalPoint=Q,this.originalPoint={...J},this.id=j||"",E.logger.registerType("IconPointModule","#ff6600"),this.setPoint(J)}getPoint(Q=0,W=E.defaultOffset,J=E.defaultAnchor){let j=this.positionalPoint.x+W.x+this.bounds.width*J.x,G=this.positionalPoint.y+W.y+this.bounds.height*J.y,q=this.positionalPoint.x+W.x-1+this.iconPoint.x,z=this.positionalPoint.y+W.y-1+this.iconPoint.y,U=q-j,Y=z-G,X=U*Math.cos(Q)-Y*-Math.sin(Q),K=U*-Math.sin(Q)+Y*Math.cos(Q),P=X+j,k=K+G;return this.point.x=P,this.point.y=k,this.point}getPointFromExternalPoint(Q,W=0,J=E.defaultOffset,j=E.defaultAnchor){let G=Q.x+J.x+this.bounds.width*j.x,q=Q.y+J.y+this.bounds.height*j.y,z=Q.x+J.x-1+this.iconPoint.x,U=Q.y+J.y-1+this.iconPoint.y,Y=z-G,X=U-q,K=Y*Math.cos(W)-X*-Math.sin(W),P=Y*-Math.sin(W)+X*Math.cos(W),k=K+G,V=P+q;return this.point.x=k,this.point.y=V,this.point}setPoint(Q){let{x:W,y:J,isNormalized:j}=Q;this.iconPoint.x=j?W*this.bounds.width:W,this.iconPoint.y=j?J*this.bounds.height:J}resetPoint(){this.setPoint(this.originalPoint)}updateBounds(Q){let{width:W,height:J}=Q;this.bounds.width=W,this.bounds.height=J}transformX(Q){let W=Math.abs(Q*this.bounds.width);this.iconPoint.x=W-this.originalPoint.x}transformY(Q){let W=Math.abs(Q*this.bounds.height);this.iconPoint.y=W-this.originalPoint.y}transform(Q){this.transformX(Q.x),this.transformY(Q.y)}getId(){return this.id}export(){return{...this.bounds,...this.iconPoint,id:this.id}}}class tQ{bounds={};add(Q,W){this.bounds[Q]=W}remove(Q){delete this.bounds[Q]}update(Q,W){if(this.bounds[Q])this.bounds[Q]={...this.bounds[Q],...W}}rename(Q,W){if(this.bounds[Q])this.bounds[W]=this.bounds[Q],delete this.bounds[Q]}get(Q){return this.bounds[Q]}getAll(){return{...this.bounds}}getIdsByShape(Q){return Object.keys(this.bounds).filter((W)=>this.bounds[W].type===Q)}exportAll(){return this.getAll()}clearAll(){this.bounds={}}loadBounds(Q){this.clearAll(),Object.entries(Q).forEach(([W,J])=>{this.add(W,J)})}}class T{states=new Map;frames=new Map;width=32;height=32;dataURL="";delay=100;name="";parent=null;vyi=null;id="";static reservedIds=new Set;iconPoints=new Set;boundsManager=new tQ;static reservedIconPointIds=new Set(["center","top-left","top-right","bottom-left","bottom-right","top-middle","bottom-middle","left-middle","right-middle"]);static generateId(){let Q=()=>{return Math.floor(Math.random()*4294967295).toString(16).padStart(8,"0")},W=Q();while(this.reservedIds.has(W))W=Q();return this.reservedIds.add(W),W}constructor(Q){if(Q)this.parse(Q);this.assignId()}setParent(Q){if(!Q||this.parent)return;if(Q instanceof T)this.parent=Q}removeParent(){if(this.parent)this.parent=null,this.vyi=null}setVyi(Q){if(!Q)return;if(Q instanceof w){if(this.vyi=Q,this.getStateCount()>0)this.getStates().forEach((j)=>{j.setParent(this),j.setVyi(Q)});this.getFrames().forEach((J)=>J.setParent(this))}}removeVyi(){this.vyi=null}assignId(){this.id=T.generateId()}getId(){return this.id}getVyi(){return this.vyi}getParent(){return this.parent}getStateCount(){return this.states.size}getFrameCount(){return this.frames.size}parse(Q){if(!Q)return;let W=Q[0],J=Q[1],j=Q[2],G=Q[3],q=Q[4],z=Q[5],U=Q[6],Y=Q[7],X=Q[8];if(this.rename(W),this.setSize(J,j),this.setDelay(G),this.setDataURL(q),Array.isArray(z))z.forEach((K)=>{this.addFrame(K)});if(Array.isArray(U))U.forEach((K)=>{let P=new T(void 0),k=K[0],V=K[1],Z=K[2],M=K[3],$=K[4];if(P.rename(k),P.setSize(J,j),P.setDelay(Z),P.setDataURL(V),Array.isArray(M))M.forEach((C)=>{P.addFrame(C)});if($&&typeof $==="object")P.boundsManager.loadBounds($);this.addState(P)});if(Array.isArray(Y))Y.forEach((K)=>{let{x:P,y:k,width:V,height:Z,id:M}=K;if(T.reservedIconPointIds.has(M))return;this.addIconPoint({x:0,y:0},{width:V,height:Z},{x:P,y:k},M)});if(X&&typeof X==="object")this.boundsManager.loadBounds(X);this.resetInitialIconPoints()}resetInitialIconPoints(){let Q=this.getWidth(),W=this.getHeight();Array.from(T.reservedIconPointIds).forEach((k)=>{let V=Array.from(this.iconPoints).find((Z)=>Z.getId()===k);if(!V)return;this.iconPoints.delete(V)});let J={x:1,y:1},j=new E(J,{width:Q,height:W},{x:Math.round(Q/2),y:Math.round(W/2)},"center"),G=new E(J,{width:Q,height:W},{x:1,y:1},"top-left"),q=new E(J,{width:Q,height:W},{x:Q,y:1},"top-right"),z=new E(J,{width:Q,height:W},{x:1,y:W},"bottom-left"),U=new E(J,{width:Q,height:W},{x:Q,y:W},"bottom-right"),Y=new E(J,{width:Q,height:W},{x:Math.round(Q/2),y:1},"top-middle"),X=new E(J,{width:Q,height:W},{x:Math.round(Q/2),y:W},"bottom-middle"),K=new E(J,{width:Q,height:W},{x:1,y:Math.round(W/2)},"left-middle"),P=new E(J,{width:Q,height:W},{x:Q,y:Math.round(W/2)},"right-middle");this.iconPoints.add(j),this.iconPoints.add(G),this.iconPoints.add(q),this.iconPoints.add(z),this.iconPoints.add(U),this.iconPoints.add(Y),this.iconPoints.add(X),this.iconPoints.add(K),this.iconPoints.add(P)}addIconPoint(Q,W,J,j){if(T.reservedIconPointIds.has(j)){w.logger.prefix("Vyi-module").error(\`The id \${j} is reserved and cannot be used for additional icon points.\`);return}let G=new E(Q,W,J,j);return this.iconPoints.add(G),G}removeIconPoint(Q){for(let W of this.iconPoints)if(W.getId()===Q&&!T.reservedIconPointIds.has(Q)){this.iconPoints.delete(W);break}}getIconPointExportById(Q){for(let W of this.iconPoints)if(W.getId()===Q)return W.export();return}getIconPointsExport(){let Q=[];return this.iconPoints.forEach((W)=>Q.push(W.export())),Q}getIconPointById(Q){for(let W of this.iconPoints)if(W.getId()===Q)return W;return}getIconPoints(){let Q=[];return this.iconPoints.forEach((W)=>Q.push(W)),Q}getBoundsExport(){return this.boundsManager.exportAll()}getBoundsById(Q){return this.boundsManager.get(Q)}getIdsByShape(Q){return this.boundsManager.getIdsByShape(Q)}setBounds(Q,W){return this.boundsManager.add(Q,W),this}removeBounds(Q){return this.boundsManager.remove(Q),this}updateBounds(Q,W){return this.boundsManager.update(Q,W),this}setSize(Q,W){if(typeof Q==="number")this.width=Q;if(typeof W==="number")this.height=W;return this}getWidth(){return this.width}getHeight(){return this.height}getSize(){return{width:this.width,height:this.height}}setDataURL(Q){if(typeof Q==="string")this.dataURL=Q.replace(/^data:image\\/[a-z]+;base64,/,"");else w.logger.prefix("Vyi-module").error("Invalid data url type!");return this}getDataURL(){return this.dataURL}setDelay(Q){if(typeof Q==="number")this.delay=Q;else w.logger.prefix("Vyi-module").error("Invalid delay type!");return this}getDelay(){return this.delay}rename(Q){if(typeof Q==="string")try{this.name=decodeURIComponent(Q)}catch{this.name=Q}else w.logger.prefix("Vyi-module").error("Invalid type for pName!");return this}getName(){return this.name}setAllFrameDelays(Q){if(typeof Q==="number")this.setDelay(Q),this.getFrames().forEach((W)=>W.setDelay(Q));else w.logger.prefix("Vyi-module").error("Invalid type for pDelay!");return this}addFrame(Q){if(!Q){w.logger.prefix("Vyi-module").error("No frame data passed!");return}if(!(Q instanceof n)&&!Array.isArray(Q)){w.logger.prefix("Vyi-module").error("Invalid frame data type passed!");return}let W=Q instanceof n?Q:new n(Q);return W.setParent(this),this.frames.set(this.frames.size,W),this.indexFrames(),W}removeFrame(Q){if(!Q)return this;if(Q instanceof n){if(this.frames.delete(Q.index))Q.removeParent(),this.indexFrames()}return this}removeFrameByIndex(Q){let W=this.getFrame(Q);if(W)this.removeFrame(W);return this}indexFrames(){let Q=this.getFrames();this.frames.clear(),Q.forEach((W,J)=>{W.index=J,this.frames.set(J,W)})}reorderFrame(Q,W){if(typeof Q==="number"&&typeof W==="number"){let J=this.getFrame(W),j=Q===-1?this:this.getFrame(Q);if(j&&J){let G=j.getDataURL(),q=j.getDelay(),z=J.getDataURL(),U=J.getDelay();j.setDataURL(z),j.setDelay(U),J.setDataURL(G),J.setDelay(q)}else w.logger.prefix("Vyi-module").error("There was no frame found at pCurrentIndex, or there was no frame found at pIndex!")}else w.logger.prefix("Vyi-module").error("Invalid type used!");return this}getFrame(Q){return this.frames.get(Q)}getFrames(){return Array.from(this.frames.values())}getFramesData(){return this.getFrames().map((W)=>W.export())}addState(Q){if(!Q){w.logger.prefix("Vyi-module").error("No icon data passed!");return}if(!(Q instanceof T)&&!Array.isArray(Q)){w.logger.prefix("Vyi-module").error("Invalid icon data type passed!");return}let W=Q instanceof T?Q:new T(this.convertStateDataToIconData(Q));if(W.getWidth()!==this.getWidth()||W.getHeight()!==this.getHeight()){w.logger.prefix("Vyi-module").error("State dimensions do not match parent!");return}if(W.setParent(this),this.vyi)W.setVyi(this.vyi);return this.states.set(W.id,W),W}removeState(Q){if(Q instanceof T){if(this.states.delete(Q.id))Q.removeParent()}return this}removeStateByName(Q){let W=this.getState(Q);if(W)this.removeState(W);return this}removeStateById(Q){let W=this.getStateById(Q);if(W)this.removeState(W);return this}getState(Q){if(typeof Q==="string"){let W=this.getStates();for(let J=W.length-1;J>=0;J--){let j=W[J];if(j.getName()===Q)return j}return}else{w.logger.prefix("Vyi-module").error("Invalid name type used!");return}}getStateById(Q){if(!Q)return;return this.states.get(Q)}getStates(){return Array.from(this.states.values())}getStateNames(){return this.getStates().map((Q)=>Q.getName())}getStatesData(){return this.getStates().map((W)=>W.exportAsState())}exportAsState(){let Q=[this.getName(),this.getDataURL(),this.getDelay(),this.getFrames().map((J)=>J.export())],W=this.getBoundsExport();if(Object.keys(W).length>0)Q[4]=W;return Q}convertStateDataToIconData(Q){return[Q[0],this.getWidth(),this.getHeight(),Q[2],Q[1],Q[3]]}export(){let Q=[this.getName(),this.getWidth(),this.getHeight(),this.getDelay(),this.getDataURL(),this.getFramesData()];if(this.states.size>0)Q[6]=this.getStatesData();return Q[7]=this.getIconPointsExport(),Q[8]=this.getBoundsExport(),Q}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function HQ(Q){let W=Q.length;while(--W>=0)Q[W]=0}var e0=0,H0=1,t0=2,s0=3,Q5=258,vJ=29,yQ=256,RQ=yQ+1+vJ,YQ=30,gJ=19,P0=2*RQ+1,WQ=15,sQ=16,J5=7,RJ=256,B0=16,C0=17,$0=18,FJ=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),pQ=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),W5=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),L0=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),j5=512,r=new Array((RQ+2)*2);HQ(r);var NQ=new Array(YQ*2);HQ(NQ);var xQ=new Array(j5);HQ(xQ);var OQ=new Array(Q5-s0+1);HQ(OQ);var xJ=new Array(vJ);HQ(xJ);var lQ=new Array(YQ);HQ(lQ);function QJ(Q,W,J,j,G){this.static_tree=Q,this.extra_bits=W,this.extra_base=J,this.elems=j,this.max_length=G,this.has_stree=Q&&Q.length}var N0,v0,g0;function JJ(Q,W){this.dyn_tree=Q,this.max_code=0,this.stat_desc=W}var R0=(Q)=>{return Q<256?xQ[Q]:xQ[256+(Q>>>7)]},MQ=(Q,W)=>{Q.pending_buf[Q.pending++]=W&255,Q.pending_buf[Q.pending++]=W>>>8&255},f=(Q,W,J)=>{if(Q.bi_valid>sQ-J)Q.bi_buf|=W<<Q.bi_valid&65535,MQ(Q,Q.bi_buf),Q.bi_buf=W>>sQ-Q.bi_valid,Q.bi_valid+=J-sQ;else Q.bi_buf|=W<<Q.bi_valid&65535,Q.bi_valid+=J},p=(Q,W,J)=>{f(Q,J[W*2],J[W*2+1])},x0=(Q,W)=>{let J=0;do J|=Q&1,Q>>>=1,J<<=1;while(--W>0);return J>>>1},q5=(Q)=>{if(Q.bi_valid===16)MQ(Q,Q.bi_buf),Q.bi_buf=0,Q.bi_valid=0;else if(Q.bi_valid>=8)Q.pending_buf[Q.pending++]=Q.bi_buf&255,Q.bi_buf>>=8,Q.bi_valid-=8},G5=(Q,W)=>{let{dyn_tree:J,max_code:j}=W,G=W.stat_desc.static_tree,q=W.stat_desc.has_stree,z=W.stat_desc.extra_bits,U=W.stat_desc.extra_base,Y=W.stat_desc.max_length,X,K,P,k,V,Z,M=0;for(k=0;k<=WQ;k++)Q.bl_count[k]=0;J[Q.heap[Q.heap_max]*2+1]=0;for(X=Q.heap_max+1;X<P0;X++){if(K=Q.heap[X],k=J[J[K*2+1]*2+1]+1,k>Y)k=Y,M++;if(J[K*2+1]=k,K>j)continue;if(Q.bl_count[k]++,V=0,K>=U)V=z[K-U];if(Z=J[K*2],Q.opt_len+=Z*(k+V),q)Q.static_len+=Z*(G[K*2+1]+V)}if(M===0)return;do{k=Y-1;while(Q.bl_count[k]===0)k--;Q.bl_count[k]--,Q.bl_count[k+1]+=2,Q.bl_count[Y]--,M-=2}while(M>0);for(k=Y;k!==0;k--){K=Q.bl_count[k];while(K!==0){if(P=Q.heap[--X],P>j)continue;if(J[P*2+1]!==k)Q.opt_len+=(k-J[P*2+1])*J[P*2],J[P*2+1]=k;K--}}},O0=(Q,W,J)=>{let j=new Array(WQ+1),G=0,q,z;for(q=1;q<=WQ;q++)G=G+J[q-1]<<1,j[q]=G;for(z=0;z<=W;z++){let U=Q[z*2+1];if(U===0)continue;Q[z*2]=x0(j[U]++,U)}},X5=()=>{let Q,W,J,j,G,q=new Array(WQ+1);J=0;for(j=0;j<vJ-1;j++){xJ[j]=J;for(Q=0;Q<1<<FJ[j];Q++)OQ[J++]=j}OQ[J-1]=j,G=0;for(j=0;j<16;j++){lQ[j]=G;for(Q=0;Q<1<<pQ[j];Q++)xQ[G++]=j}G>>=7;for(;j<YQ;j++){lQ[j]=G<<7;for(Q=0;Q<1<<pQ[j]-7;Q++)xQ[256+G++]=j}for(W=0;W<=WQ;W++)q[W]=0;Q=0;while(Q<=143)r[Q*2+1]=8,Q++,q[8]++;while(Q<=255)r[Q*2+1]=9,Q++,q[9]++;while(Q<=279)r[Q*2+1]=7,Q++,q[7]++;while(Q<=287)r[Q*2+1]=8,Q++,q[8]++;O0(r,RQ+1,q);for(Q=0;Q<YQ;Q++)NQ[Q*2+1]=5,NQ[Q*2]=x0(Q,5);N0=new QJ(r,FJ,yQ+1,RQ,WQ),v0=new QJ(NQ,pQ,0,YQ,WQ),g0=new QJ(new Array(0),W5,0,gJ,J5)},M0=(Q)=>{let W;for(W=0;W<RQ;W++)Q.dyn_ltree[W*2]=0;for(W=0;W<YQ;W++)Q.dyn_dtree[W*2]=0;for(W=0;W<gJ;W++)Q.bl_tree[W*2]=0;Q.dyn_ltree[RJ*2]=1,Q.opt_len=Q.static_len=0,Q.sym_next=Q.matches=0},w0=(Q)=>{if(Q.bi_valid>8)MQ(Q,Q.bi_buf);else if(Q.bi_valid>0)Q.pending_buf[Q.pending++]=Q.bi_buf;Q.bi_buf=0,Q.bi_valid=0},TJ=(Q,W,J,j)=>{let G=W*2,q=J*2;return Q[G]<Q[q]||Q[G]===Q[q]&&j[W]<=j[J]},WJ=(Q,W,J)=>{let j=Q.heap[J],G=J<<1;while(G<=Q.heap_len){if(G<Q.heap_len&&TJ(W,Q.heap[G+1],Q.heap[G],Q.depth))G++;if(TJ(W,j,Q.heap[G],Q.depth))break;Q.heap[J]=Q.heap[G],J=G,G<<=1}Q.heap[J]=j},yJ=(Q,W,J)=>{let j,G,q=0,z,U;if(Q.sym_next!==0)do if(j=Q.pending_buf[Q.sym_buf+q++]&255,j+=(Q.pending_buf[Q.sym_buf+q++]&255)<<8,G=Q.pending_buf[Q.sym_buf+q++],j===0)p(Q,G,W);else{if(z=OQ[G],p(Q,z+yQ+1,W),U=FJ[z],U!==0)G-=xJ[z],f(Q,G,U);if(j--,z=R0(j),p(Q,z,J),U=pQ[z],U!==0)j-=lQ[z],f(Q,j,U)}while(q<Q.sym_next);p(Q,RJ,W)},ZJ=(Q,W)=>{let J=W.dyn_tree,j=W.stat_desc.static_tree,G=W.stat_desc.has_stree,q=W.stat_desc.elems,z,U,Y=-1,X;Q.heap_len=0,Q.heap_max=P0;for(z=0;z<q;z++)if(J[z*2]!==0)Q.heap[++Q.heap_len]=Y=z,Q.depth[z]=0;else J[z*2+1]=0;while(Q.heap_len<2)if(X=Q.heap[++Q.heap_len]=Y<2?++Y:0,J[X*2]=1,Q.depth[X]=0,Q.opt_len--,G)Q.static_len-=j[X*2+1];W.max_code=Y;for(z=Q.heap_len>>1;z>=1;z--)WJ(Q,J,z);X=q;do z=Q.heap[1],Q.heap[1]=Q.heap[Q.heap_len--],WJ(Q,J,1),U=Q.heap[1],Q.heap[--Q.heap_max]=z,Q.heap[--Q.heap_max]=U,J[X*2]=J[z*2]+J[U*2],Q.depth[X]=(Q.depth[z]>=Q.depth[U]?Q.depth[z]:Q.depth[U])+1,J[z*2+1]=J[U*2+1]=X,Q.heap[1]=X++,WJ(Q,J,1);while(Q.heap_len>=2);Q.heap[--Q.heap_max]=Q.heap[1],G5(Q,W),O0(J,Y,Q.bl_count)},DJ=(Q,W,J)=>{let j,G=-1,q,z=W[1],U=0,Y=7,X=4;if(z===0)Y=138,X=3;W[(J+1)*2+1]=65535;for(j=0;j<=J;j++){if(q=z,z=W[(j+1)*2+1],++U<Y&&q===z)continue;else if(U<X)Q.bl_tree[q*2]+=U;else if(q!==0){if(q!==G)Q.bl_tree[q*2]++;Q.bl_tree[B0*2]++}else if(U<=10)Q.bl_tree[C0*2]++;else Q.bl_tree[$0*2]++;if(U=0,G=q,z===0)Y=138,X=3;else if(q===z)Y=6,X=3;else Y=7,X=4}},EJ=(Q,W,J)=>{let j,G=-1,q,z=W[1],U=0,Y=7,X=4;if(z===0)Y=138,X=3;for(j=0;j<=J;j++){if(q=z,z=W[(j+1)*2+1],++U<Y&&q===z)continue;else if(U<X)do p(Q,q,Q.bl_tree);while(--U!==0);else if(q!==0){if(q!==G)p(Q,q,Q.bl_tree),U--;p(Q,B0,Q.bl_tree),f(Q,U-3,2)}else if(U<=10)p(Q,C0,Q.bl_tree),f(Q,U-3,3);else p(Q,$0,Q.bl_tree),f(Q,U-11,7);if(U=0,G=q,z===0)Y=138,X=3;else if(q===z)Y=6,X=3;else Y=7,X=4}},U5=(Q)=>{let W;DJ(Q,Q.dyn_ltree,Q.l_desc.max_code),DJ(Q,Q.dyn_dtree,Q.d_desc.max_code),ZJ(Q,Q.bl_desc);for(W=gJ-1;W>=3;W--)if(Q.bl_tree[L0[W]*2+1]!==0)break;return Q.opt_len+=3*(W+1)+5+5+4,W},z5=(Q,W,J,j)=>{let G;f(Q,W-257,5),f(Q,J-1,5),f(Q,j-4,4);for(G=0;G<j;G++)f(Q,Q.bl_tree[L0[G]*2+1],3);EJ(Q,Q.dyn_ltree,W-1),EJ(Q,Q.dyn_dtree,J-1)},K5=(Q)=>{let W=4093624447,J;for(J=0;J<=31;J++,W>>>=1)if(W&1&&Q.dyn_ltree[J*2]!==0)return 0;if(Q.dyn_ltree[18]!==0||Q.dyn_ltree[20]!==0||Q.dyn_ltree[26]!==0)return 1;for(J=32;J<yQ;J++)if(Q.dyn_ltree[J*2]!==0)return 1;return 0},IJ=!1,V5=(Q)=>{if(!IJ)X5(),IJ=!0;Q.l_desc=new JJ(Q.dyn_ltree,N0),Q.d_desc=new JJ(Q.dyn_dtree,v0),Q.bl_desc=new JJ(Q.bl_tree,g0),Q.bi_buf=0,Q.bi_valid=0,M0(Q)},A0=(Q,W,J,j)=>{if(f(Q,(e0<<1)+(j?1:0),3),w0(Q),MQ(Q,J),MQ(Q,~J),J)Q.pending_buf.set(Q.window.subarray(W,W+J),Q.pending);Q.pending+=J},k5=(Q)=>{f(Q,H0<<1,3),p(Q,RJ,r),q5(Q)},Y5=(Q,W,J,j)=>{let G,q,z=0;if(Q.level>0){if(Q.strm.data_type===2)Q.strm.data_type=K5(Q);if(ZJ(Q,Q.l_desc),ZJ(Q,Q.d_desc),z=U5(Q),G=Q.opt_len+3+7>>>3,q=Q.static_len+3+7>>>3,q<=G)G=q}else G=q=J+5;if(J+4<=G&&W!==-1)A0(Q,W,J,j);else if(Q.strategy===4||q===G)f(Q,(H0<<1)+(j?1:0),3),yJ(Q,r,NQ);else f(Q,(t0<<1)+(j?1:0),3),z5(Q,Q.l_desc.max_code+1,Q.d_desc.max_code+1,z+1),yJ(Q,Q.dyn_ltree,Q.dyn_dtree);if(M0(Q),j)w0(Q)},F5=(Q,W,J)=>{if(Q.pending_buf[Q.sym_buf+Q.sym_next++]=W,Q.pending_buf[Q.sym_buf+Q.sym_next++]=W>>8,Q.pending_buf[Q.sym_buf+Q.sym_next++]=J,W===0)Q.dyn_ltree[J*2]++;else Q.matches++,W--,Q.dyn_ltree[(OQ[J]+yQ+1)*2]++,Q.dyn_dtree[R0(W)*2]++;return Q.sym_next===Q.sym_end},Z5=V5,H5=A0,P5=Y5,B5=F5,C5=k5,$5={_tr_init:Z5,_tr_stored_block:H5,_tr_flush_block:P5,_tr_tally:B5,_tr_align:C5},L5=(Q,W,J,j)=>{let G=Q&65535|0,q=Q>>>16&65535|0,z=0;while(J!==0){z=J>2000?2000:J,J-=z;do G=G+W[j++]|0,q=q+G|0;while(--z);G%=65521,q%=65521}return G|q<<16|0},wQ=L5,N5=()=>{let Q,W=[];for(var J=0;J<256;J++){Q=J;for(var j=0;j<8;j++)Q=Q&1?3988292384^Q>>>1:Q>>>1;W[J]=Q}return W},v5=new Uint32Array(N5()),g5=(Q,W,J,j)=>{let G=v5,q=j+J;Q^=-1;for(let z=j;z<q;z++)Q=Q>>>8^G[(Q^W[z])&255];return Q^-1},D=g5,GQ={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},zQ={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:R5,_tr_stored_block:HJ,_tr_flush_block:x5,_tr_tally:t,_tr_align:O5}=$5,{Z_NO_FLUSH:s,Z_PARTIAL_FLUSH:M5,Z_FULL_FLUSH:w5,Z_FINISH:c,Z_BLOCK:bJ,Z_OK:I,Z_STREAM_END:fJ,Z_STREAM_ERROR:l,Z_DATA_ERROR:A5,Z_BUF_ERROR:jJ,Z_DEFAULT_COMPRESSION:S5,Z_FILTERED:T5,Z_HUFFMAN_ONLY:uQ,Z_RLE:y5,Z_FIXED:D5,Z_DEFAULT_STRATEGY:E5,Z_UNKNOWN:I5,Z_DEFLATED:rQ}=zQ,b5=9,f5=15,u5=8,h5=29,c5=256,PJ=c5+1+h5,m5=30,d5=19,p5=2*PJ+1,l5=15,v=3,e=258,_=e+v+1,_5=32,FQ=42,OJ=57,BJ=69,CJ=73,$J=91,LJ=103,jQ=113,$Q=666,b=1,PQ=2,XQ=3,BQ=4,i5=3,qQ=(Q,W)=>{return Q.msg=GQ[W],W},uJ=(Q)=>{return Q*2-(Q>4?9:0)},a=(Q)=>{let W=Q.length;while(--W>=0)Q[W]=0},r5=(Q)=>{let W,J,j,G=Q.w_size;W=Q.hash_size,j=W;do J=Q.head[--j],Q.head[j]=J>=G?J-G:0;while(--W);W=G,j=W;do J=Q.prev[--j],Q.prev[j]=J>=G?J-G:0;while(--W)},o5=(Q,W,J)=>(W<<Q.hash_shift^J)&Q.hash_mask,QQ=o5,u=(Q)=>{let W=Q.state,J=W.pending;if(J>Q.avail_out)J=Q.avail_out;if(J===0)return;if(Q.output.set(W.pending_buf.subarray(W.pending_out,W.pending_out+J),Q.next_out),Q.next_out+=J,W.pending_out+=J,Q.total_out+=J,Q.avail_out-=J,W.pending-=J,W.pending===0)W.pending_out=0},h=(Q,W)=>{x5(Q,Q.block_start>=0?Q.block_start:-1,Q.strstart-Q.block_start,W),Q.block_start=Q.strstart,u(Q.strm)},x=(Q,W)=>{Q.pending_buf[Q.pending++]=W},CQ=(Q,W)=>{Q.pending_buf[Q.pending++]=W>>>8&255,Q.pending_buf[Q.pending++]=W&255},NJ=(Q,W,J,j)=>{let G=Q.avail_in;if(G>j)G=j;if(G===0)return 0;if(Q.avail_in-=G,W.set(Q.input.subarray(Q.next_in,Q.next_in+G),J),Q.state.wrap===1)Q.adler=wQ(Q.adler,W,G,J);else if(Q.state.wrap===2)Q.adler=D(Q.adler,W,G,J);return Q.next_in+=G,Q.total_in+=G,G},S0=(Q,W)=>{let{max_chain_length:J,strstart:j}=Q,G,q,z=Q.prev_length,U=Q.nice_match,Y=Q.strstart>Q.w_size-_?Q.strstart-(Q.w_size-_):0,X=Q.window,K=Q.w_mask,P=Q.prev,k=Q.strstart+e,V=X[j+z-1],Z=X[j+z];if(Q.prev_length>=Q.good_match)J>>=2;if(U>Q.lookahead)U=Q.lookahead;do{if(G=W,X[G+z]!==Z||X[G+z-1]!==V||X[G]!==X[j]||X[++G]!==X[j+1])continue;j+=2,G++;do;while(X[++j]===X[++G]&&X[++j]===X[++G]&&X[++j]===X[++G]&&X[++j]===X[++G]&&X[++j]===X[++G]&&X[++j]===X[++G]&&X[++j]===X[++G]&&X[++j]===X[++G]&&j<k);if(q=e-(k-j),j=k-e,q>z){if(Q.match_start=W,z=q,q>=U)break;V=X[j+z-1],Z=X[j+z]}}while((W=P[W&K])>Y&&--J!==0);if(z<=Q.lookahead)return z;return Q.lookahead},ZQ=(Q)=>{let W=Q.w_size,J,j,G;do{if(j=Q.window_size-Q.lookahead-Q.strstart,Q.strstart>=W+(W-_)){if(Q.window.set(Q.window.subarray(W,W+W-j),0),Q.match_start-=W,Q.strstart-=W,Q.block_start-=W,Q.insert>Q.strstart)Q.insert=Q.strstart;r5(Q),j+=W}if(Q.strm.avail_in===0)break;if(J=NJ(Q.strm,Q.window,Q.strstart+Q.lookahead,j),Q.lookahead+=J,Q.lookahead+Q.insert>=v){G=Q.strstart-Q.insert,Q.ins_h=Q.window[G],Q.ins_h=QQ(Q,Q.ins_h,Q.window[G+1]);while(Q.insert)if(Q.ins_h=QQ(Q,Q.ins_h,Q.window[G+v-1]),Q.prev[G&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=G,G++,Q.insert--,Q.lookahead+Q.insert<v)break}}while(Q.lookahead<_&&Q.strm.avail_in!==0)},T0=(Q,W)=>{let J=Q.pending_buf_size-5>Q.w_size?Q.w_size:Q.pending_buf_size-5,j,G,q,z=0,U=Q.strm.avail_in;do{if(j=65535,q=Q.bi_valid+42>>3,Q.strm.avail_out<q)break;if(q=Q.strm.avail_out-q,G=Q.strstart-Q.block_start,j>G+Q.strm.avail_in)j=G+Q.strm.avail_in;if(j>q)j=q;if(j<J&&(j===0&&W!==c||W===s||j!==G+Q.strm.avail_in))break;if(z=W===c&&j===G+Q.strm.avail_in?1:0,HJ(Q,0,0,z),Q.pending_buf[Q.pending-4]=j,Q.pending_buf[Q.pending-3]=j>>8,Q.pending_buf[Q.pending-2]=~j,Q.pending_buf[Q.pending-1]=~j>>8,u(Q.strm),G){if(G>j)G=j;Q.strm.output.set(Q.window.subarray(Q.block_start,Q.block_start+G),Q.strm.next_out),Q.strm.next_out+=G,Q.strm.avail_out-=G,Q.strm.total_out+=G,Q.block_start+=G,j-=G}if(j)NJ(Q.strm,Q.strm.output,Q.strm.next_out,j),Q.strm.next_out+=j,Q.strm.avail_out-=j,Q.strm.total_out+=j}while(z===0);if(U-=Q.strm.avail_in,U){if(U>=Q.w_size)Q.matches=2,Q.window.set(Q.strm.input.subarray(Q.strm.next_in-Q.w_size,Q.strm.next_in),0),Q.strstart=Q.w_size,Q.insert=Q.strstart;else{if(Q.window_size-Q.strstart<=U){if(Q.strstart-=Q.w_size,Q.window.set(Q.window.subarray(Q.w_size,Q.w_size+Q.strstart),0),Q.matches<2)Q.matches++;if(Q.insert>Q.strstart)Q.insert=Q.strstart}Q.window.set(Q.strm.input.subarray(Q.strm.next_in-U,Q.strm.next_in),Q.strstart),Q.strstart+=U,Q.insert+=U>Q.w_size-Q.insert?Q.w_size-Q.insert:U}Q.block_start=Q.strstart}if(Q.high_water<Q.strstart)Q.high_water=Q.strstart;if(z)return BQ;if(W!==s&&W!==c&&Q.strm.avail_in===0&&Q.strstart===Q.block_start)return PQ;if(q=Q.window_size-Q.strstart,Q.strm.avail_in>q&&Q.block_start>=Q.w_size){if(Q.block_start-=Q.w_size,Q.strstart-=Q.w_size,Q.window.set(Q.window.subarray(Q.w_size,Q.w_size+Q.strstart),0),Q.matches<2)Q.matches++;if(q+=Q.w_size,Q.insert>Q.strstart)Q.insert=Q.strstart}if(q>Q.strm.avail_in)q=Q.strm.avail_in;if(q)NJ(Q.strm,Q.window,Q.strstart,q),Q.strstart+=q,Q.insert+=q>Q.w_size-Q.insert?Q.w_size-Q.insert:q;if(Q.high_water<Q.strstart)Q.high_water=Q.strstart;if(q=Q.bi_valid+42>>3,q=Q.pending_buf_size-q>65535?65535:Q.pending_buf_size-q,J=q>Q.w_size?Q.w_size:q,G=Q.strstart-Q.block_start,G>=J||(G||W===c)&&W!==s&&Q.strm.avail_in===0&&G<=q)j=G>q?q:G,z=W===c&&Q.strm.avail_in===0&&j===G?1:0,HJ(Q,Q.block_start,j,z),Q.block_start+=j,u(Q.strm);return z?XQ:b},qJ=(Q,W)=>{let J,j;for(;;){if(Q.lookahead<_){if(ZQ(Q),Q.lookahead<_&&W===s)return b;if(Q.lookahead===0)break}if(J=0,Q.lookahead>=v)Q.ins_h=QQ(Q,Q.ins_h,Q.window[Q.strstart+v-1]),J=Q.prev[Q.strstart&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=Q.strstart;if(J!==0&&Q.strstart-J<=Q.w_size-_)Q.match_length=S0(Q,J);if(Q.match_length>=v)if(j=t(Q,Q.strstart-Q.match_start,Q.match_length-v),Q.lookahead-=Q.match_length,Q.match_length<=Q.max_lazy_match&&Q.lookahead>=v){Q.match_length--;do Q.strstart++,Q.ins_h=QQ(Q,Q.ins_h,Q.window[Q.strstart+v-1]),J=Q.prev[Q.strstart&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=Q.strstart;while(--Q.match_length!==0);Q.strstart++}else Q.strstart+=Q.match_length,Q.match_length=0,Q.ins_h=Q.window[Q.strstart],Q.ins_h=QQ(Q,Q.ins_h,Q.window[Q.strstart+1]);else j=t(Q,0,Q.window[Q.strstart]),Q.lookahead--,Q.strstart++;if(j){if(h(Q,!1),Q.strm.avail_out===0)return b}}if(Q.insert=Q.strstart<v-1?Q.strstart:v-1,W===c){if(h(Q,!0),Q.strm.avail_out===0)return XQ;return BQ}if(Q.sym_next){if(h(Q,!1),Q.strm.avail_out===0)return b}return PQ},VQ=(Q,W)=>{let J,j,G;for(;;){if(Q.lookahead<_){if(ZQ(Q),Q.lookahead<_&&W===s)return b;if(Q.lookahead===0)break}if(J=0,Q.lookahead>=v)Q.ins_h=QQ(Q,Q.ins_h,Q.window[Q.strstart+v-1]),J=Q.prev[Q.strstart&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=Q.strstart;if(Q.prev_length=Q.match_length,Q.prev_match=Q.match_start,Q.match_length=v-1,J!==0&&Q.prev_length<Q.max_lazy_match&&Q.strstart-J<=Q.w_size-_){if(Q.match_length=S0(Q,J),Q.match_length<=5&&(Q.strategy===T5||Q.match_length===v&&Q.strstart-Q.match_start>4096))Q.match_length=v-1}if(Q.prev_length>=v&&Q.match_length<=Q.prev_length){G=Q.strstart+Q.lookahead-v,j=t(Q,Q.strstart-1-Q.prev_match,Q.prev_length-v),Q.lookahead-=Q.prev_length-1,Q.prev_length-=2;do if(++Q.strstart<=G)Q.ins_h=QQ(Q,Q.ins_h,Q.window[Q.strstart+v-1]),J=Q.prev[Q.strstart&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=Q.strstart;while(--Q.prev_length!==0);if(Q.match_available=0,Q.match_length=v-1,Q.strstart++,j){if(h(Q,!1),Q.strm.avail_out===0)return b}}else if(Q.match_available){if(j=t(Q,0,Q.window[Q.strstart-1]),j)h(Q,!1);if(Q.strstart++,Q.lookahead--,Q.strm.avail_out===0)return b}else Q.match_available=1,Q.strstart++,Q.lookahead--}if(Q.match_available)j=t(Q,0,Q.window[Q.strstart-1]),Q.match_available=0;if(Q.insert=Q.strstart<v-1?Q.strstart:v-1,W===c){if(h(Q,!0),Q.strm.avail_out===0)return XQ;return BQ}if(Q.sym_next){if(h(Q,!1),Q.strm.avail_out===0)return b}return PQ},n5=(Q,W)=>{let J,j,G,q,z=Q.window;for(;;){if(Q.lookahead<=e){if(ZQ(Q),Q.lookahead<=e&&W===s)return b;if(Q.lookahead===0)break}if(Q.match_length=0,Q.lookahead>=v&&Q.strstart>0){if(G=Q.strstart-1,j=z[G],j===z[++G]&&j===z[++G]&&j===z[++G]){q=Q.strstart+e;do;while(j===z[++G]&&j===z[++G]&&j===z[++G]&&j===z[++G]&&j===z[++G]&&j===z[++G]&&j===z[++G]&&j===z[++G]&&G<q);if(Q.match_length=e-(q-G),Q.match_length>Q.lookahead)Q.match_length=Q.lookahead}}if(Q.match_length>=v)J=t(Q,1,Q.match_length-v),Q.lookahead-=Q.match_length,Q.strstart+=Q.match_length,Q.match_length=0;else J=t(Q,0,Q.window[Q.strstart]),Q.lookahead--,Q.strstart++;if(J){if(h(Q,!1),Q.strm.avail_out===0)return b}}if(Q.insert=0,W===c){if(h(Q,!0),Q.strm.avail_out===0)return XQ;return BQ}if(Q.sym_next){if(h(Q,!1),Q.strm.avail_out===0)return b}return PQ},a5=(Q,W)=>{let J;for(;;){if(Q.lookahead===0){if(ZQ(Q),Q.lookahead===0){if(W===s)return b;break}}if(Q.match_length=0,J=t(Q,0,Q.window[Q.strstart]),Q.lookahead--,Q.strstart++,J){if(h(Q,!1),Q.strm.avail_out===0)return b}}if(Q.insert=0,W===c){if(h(Q,!0),Q.strm.avail_out===0)return XQ;return BQ}if(Q.sym_next){if(h(Q,!1),Q.strm.avail_out===0)return b}return PQ};function d(Q,W,J,j,G){this.good_length=Q,this.max_lazy=W,this.nice_length=J,this.max_chain=j,this.func=G}var LQ=[new d(0,0,0,0,T0),new d(4,4,8,4,qJ),new d(4,5,16,8,qJ),new d(4,6,32,32,qJ),new d(4,4,16,16,VQ),new d(8,16,32,32,VQ),new d(8,16,128,128,VQ),new d(8,32,128,256,VQ),new d(32,128,258,1024,VQ),new d(32,258,258,4096,VQ)],e5=(Q)=>{Q.window_size=2*Q.w_size,a(Q.head),Q.max_lazy_match=LQ[Q.level].max_lazy,Q.good_match=LQ[Q.level].good_length,Q.nice_match=LQ[Q.level].nice_length,Q.max_chain_length=LQ[Q.level].max_chain,Q.strstart=0,Q.block_start=0,Q.lookahead=0,Q.insert=0,Q.match_length=Q.prev_length=v-1,Q.match_available=0,Q.ins_h=0};function t5(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=rQ,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(p5*2),this.dyn_dtree=new Uint16Array((2*m5+1)*2),this.bl_tree=new Uint16Array((2*d5+1)*2),a(this.dyn_ltree),a(this.dyn_dtree),a(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(l5+1),this.heap=new Uint16Array(2*PJ+1),a(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*PJ+1),a(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var DQ=(Q)=>{if(!Q)return 1;let W=Q.state;if(!W||W.strm!==Q||W.status!==FQ&&W.status!==OJ&&W.status!==BJ&&W.status!==CJ&&W.status!==$J&&W.status!==LJ&&W.status!==jQ&&W.status!==$Q)return 1;return 0},y0=(Q)=>{if(DQ(Q))return qQ(Q,l);Q.total_in=Q.total_out=0,Q.data_type=I5;let W=Q.state;if(W.pending=0,W.pending_out=0,W.wrap<0)W.wrap=-W.wrap;return W.status=W.wrap===2?OJ:W.wrap?FQ:jQ,Q.adler=W.wrap===2?0:1,W.last_flush=-2,R5(W),I},D0=(Q)=>{let W=y0(Q);if(W===I)e5(Q.state);return W},s5=(Q,W)=>{if(DQ(Q)||Q.state.wrap!==2)return l;return Q.state.gzhead=W,I},E0=(Q,W,J,j,G,q)=>{if(!Q)return l;let z=1;if(W===S5)W=6;if(j<0)z=0,j=-j;else if(j>15)z=2,j-=16;if(G<1||G>b5||J!==rQ||j<8||j>15||W<0||W>9||q<0||q>D5||j===8&&z!==1)return qQ(Q,l);if(j===8)j=9;let U=new t5;return Q.state=U,U.strm=Q,U.status=FQ,U.wrap=z,U.gzhead=null,U.w_bits=j,U.w_size=1<<U.w_bits,U.w_mask=U.w_size-1,U.hash_bits=G+7,U.hash_size=1<<U.hash_bits,U.hash_mask=U.hash_size-1,U.hash_shift=~~((U.hash_bits+v-1)/v),U.window=new Uint8Array(U.w_size*2),U.head=new Uint16Array(U.hash_size),U.prev=new Uint16Array(U.w_size),U.lit_bufsize=1<<G+6,U.pending_buf_size=U.lit_bufsize*4,U.pending_buf=new Uint8Array(U.pending_buf_size),U.sym_buf=U.lit_bufsize,U.sym_end=(U.lit_bufsize-1)*3,U.level=W,U.strategy=q,U.method=J,D0(Q)},Q8=(Q,W)=>{return E0(Q,W,rQ,f5,u5,E5)},J8=(Q,W)=>{if(DQ(Q)||W>bJ||W<0)return Q?qQ(Q,l):l;let J=Q.state;if(!Q.output||Q.avail_in!==0&&!Q.input||J.status===$Q&&W!==c)return qQ(Q,Q.avail_out===0?jJ:l);let j=J.last_flush;if(J.last_flush=W,J.pending!==0){if(u(Q),Q.avail_out===0)return J.last_flush=-1,I}else if(Q.avail_in===0&&uJ(W)<=uJ(j)&&W!==c)return qQ(Q,jJ);if(J.status===$Q&&Q.avail_in!==0)return qQ(Q,jJ);if(J.status===FQ&&J.wrap===0)J.status=jQ;if(J.status===FQ){let G=rQ+(J.w_bits-8<<4)<<8,q=-1;if(J.strategy>=uQ||J.level<2)q=0;else if(J.level<6)q=1;else if(J.level===6)q=2;else q=3;if(G|=q<<6,J.strstart!==0)G|=_5;if(G+=31-G%31,CQ(J,G),J.strstart!==0)CQ(J,Q.adler>>>16),CQ(J,Q.adler&65535);if(Q.adler=1,J.status=jQ,u(Q),J.pending!==0)return J.last_flush=-1,I}if(J.status===OJ)if(Q.adler=0,x(J,31),x(J,139),x(J,8),!J.gzhead){if(x(J,0),x(J,0),x(J,0),x(J,0),x(J,0),x(J,J.level===9?2:J.strategy>=uQ||J.level<2?4:0),x(J,i5),J.status=jQ,u(Q),J.pending!==0)return J.last_flush=-1,I}else{if(x(J,(J.gzhead.text?1:0)+(J.gzhead.hcrc?2:0)+(!J.gzhead.extra?0:4)+(!J.gzhead.name?0:8)+(!J.gzhead.comment?0:16)),x(J,J.gzhead.time&255),x(J,J.gzhead.time>>8&255),x(J,J.gzhead.time>>16&255),x(J,J.gzhead.time>>24&255),x(J,J.level===9?2:J.strategy>=uQ||J.level<2?4:0),x(J,J.gzhead.os&255),J.gzhead.extra&&J.gzhead.extra.length)x(J,J.gzhead.extra.length&255),x(J,J.gzhead.extra.length>>8&255);if(J.gzhead.hcrc)Q.adler=D(Q.adler,J.pending_buf,J.pending,0);J.gzindex=0,J.status=BJ}if(J.status===BJ){if(J.gzhead.extra){let G=J.pending,q=(J.gzhead.extra.length&65535)-J.gzindex;while(J.pending+q>J.pending_buf_size){let U=J.pending_buf_size-J.pending;if(J.pending_buf.set(J.gzhead.extra.subarray(J.gzindex,J.gzindex+U),J.pending),J.pending=J.pending_buf_size,J.gzhead.hcrc&&J.pending>G)Q.adler=D(Q.adler,J.pending_buf,J.pending-G,G);if(J.gzindex+=U,u(Q),J.pending!==0)return J.last_flush=-1,I;G=0,q-=U}let z=new Uint8Array(J.gzhead.extra);if(J.pending_buf.set(z.subarray(J.gzindex,J.gzindex+q),J.pending),J.pending+=q,J.gzhead.hcrc&&J.pending>G)Q.adler=D(Q.adler,J.pending_buf,J.pending-G,G);J.gzindex=0}J.status=CJ}if(J.status===CJ){if(J.gzhead.name){let G=J.pending,q;do{if(J.pending===J.pending_buf_size){if(J.gzhead.hcrc&&J.pending>G)Q.adler=D(Q.adler,J.pending_buf,J.pending-G,G);if(u(Q),J.pending!==0)return J.last_flush=-1,I;G=0}if(J.gzindex<J.gzhead.name.length)q=J.gzhead.name.charCodeAt(J.gzindex++)&255;else q=0;x(J,q)}while(q!==0);if(J.gzhead.hcrc&&J.pending>G)Q.adler=D(Q.adler,J.pending_buf,J.pending-G,G);J.gzindex=0}J.status=$J}if(J.status===$J){if(J.gzhead.comment){let G=J.pending,q;do{if(J.pending===J.pending_buf_size){if(J.gzhead.hcrc&&J.pending>G)Q.adler=D(Q.adler,J.pending_buf,J.pending-G,G);if(u(Q),J.pending!==0)return J.last_flush=-1,I;G=0}if(J.gzindex<J.gzhead.comment.length)q=J.gzhead.comment.charCodeAt(J.gzindex++)&255;else q=0;x(J,q)}while(q!==0);if(J.gzhead.hcrc&&J.pending>G)Q.adler=D(Q.adler,J.pending_buf,J.pending-G,G)}J.status=LJ}if(J.status===LJ){if(J.gzhead.hcrc){if(J.pending+2>J.pending_buf_size){if(u(Q),J.pending!==0)return J.last_flush=-1,I}x(J,Q.adler&255),x(J,Q.adler>>8&255),Q.adler=0}if(J.status=jQ,u(Q),J.pending!==0)return J.last_flush=-1,I}if(Q.avail_in!==0||J.lookahead!==0||W!==s&&J.status!==$Q){let G=J.level===0?T0(J,W):J.strategy===uQ?a5(J,W):J.strategy===y5?n5(J,W):LQ[J.level].func(J,W);if(G===XQ||G===BQ)J.status=$Q;if(G===b||G===XQ){if(Q.avail_out===0)J.last_flush=-1;return I}if(G===PQ){if(W===M5)O5(J);else if(W!==bJ){if(HJ(J,0,0,!1),W===w5){if(a(J.head),J.lookahead===0)J.strstart=0,J.block_start=0,J.insert=0}}if(u(Q),Q.avail_out===0)return J.last_flush=-1,I}}if(W!==c)return I;if(J.wrap<=0)return fJ;if(J.wrap===2)x(J,Q.adler&255),x(J,Q.adler>>8&255),x(J,Q.adler>>16&255),x(J,Q.adler>>24&255),x(J,Q.total_in&255),x(J,Q.total_in>>8&255),x(J,Q.total_in>>16&255),x(J,Q.total_in>>24&255);else CQ(J,Q.adler>>>16),CQ(J,Q.adler&65535);if(u(Q),J.wrap>0)J.wrap=-J.wrap;return J.pending!==0?I:fJ},W8=(Q)=>{if(DQ(Q))return l;let W=Q.state.status;return Q.state=null,W===jQ?qQ(Q,A5):I},j8=(Q,W)=>{let J=W.length;if(DQ(Q))return l;let j=Q.state,G=j.wrap;if(G===2||G===1&&j.status!==FQ||j.lookahead)return l;if(G===1)Q.adler=wQ(Q.adler,W,J,0);if(j.wrap=0,J>=j.w_size){if(G===0)a(j.head),j.strstart=0,j.block_start=0,j.insert=0;let Y=new Uint8Array(j.w_size);Y.set(W.subarray(J-j.w_size,J),0),W=Y,J=j.w_size}let{avail_in:q,next_in:z,input:U}=Q;Q.avail_in=J,Q.next_in=0,Q.input=W,ZQ(j);while(j.lookahead>=v){let Y=j.strstart,X=j.lookahead-(v-1);do j.ins_h=QQ(j,j.ins_h,j.window[Y+v-1]),j.prev[Y&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=Y,Y++;while(--X);j.strstart=Y,j.lookahead=v-1,ZQ(j)}return j.strstart+=j.lookahead,j.block_start=j.strstart,j.insert=j.lookahead,j.lookahead=0,j.match_length=j.prev_length=v-1,j.match_available=0,Q.next_in=z,Q.input=U,Q.avail_in=q,j.wrap=G,I},q8=Q8,G8=E0,X8=D0,U8=y0,z8=s5,K8=J8,V8=W8,k8=j8,Y8="pako deflate (from Nodeca project)",vQ={deflateInit:q8,deflateInit2:G8,deflateReset:X8,deflateResetKeep:U8,deflateSetHeader:z8,deflate:K8,deflateEnd:V8,deflateSetDictionary:k8,deflateInfo:Y8},F8=(Q,W)=>{return Object.prototype.hasOwnProperty.call(Q,W)},Z8=function(Q){let W=Array.prototype.slice.call(arguments,1);while(W.length){let J=W.shift();if(!J)continue;if(typeof J!=="object")throw new TypeError(J+"must be non-object");for(let j in J)if(F8(J,j))Q[j]=J[j]}return Q},H8=(Q)=>{let W=0;for(let j=0,G=Q.length;j<G;j++)W+=Q[j].length;let J=new Uint8Array(W);for(let j=0,G=0,q=Q.length;j<q;j++){let z=Q[j];J.set(z,G),G+=z.length}return J},oQ={assign:Z8,flattenChunks:H8},I0=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(Q){I0=!1}var AQ=new Uint8Array(256);for(let Q=0;Q<256;Q++)AQ[Q]=Q>=252?6:Q>=248?5:Q>=240?4:Q>=224?3:Q>=192?2:1;AQ[254]=AQ[254]=1;var P8=(Q)=>{if(typeof TextEncoder==="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(Q);let W,J,j,G,q,z=Q.length,U=0;for(G=0;G<z;G++){if(J=Q.charCodeAt(G),(J&64512)===55296&&G+1<z){if(j=Q.charCodeAt(G+1),(j&64512)===56320)J=65536+(J-55296<<10)+(j-56320),G++}U+=J<128?1:J<2048?2:J<65536?3:4}W=new Uint8Array(U);for(q=0,G=0;q<U;G++){if(J=Q.charCodeAt(G),(J&64512)===55296&&G+1<z){if(j=Q.charCodeAt(G+1),(j&64512)===56320)J=65536+(J-55296<<10)+(j-56320),G++}if(J<128)W[q++]=J;else if(J<2048)W[q++]=192|J>>>6,W[q++]=128|J&63;else if(J<65536)W[q++]=224|J>>>12,W[q++]=128|J>>>6&63,W[q++]=128|J&63;else W[q++]=240|J>>>18,W[q++]=128|J>>>12&63,W[q++]=128|J>>>6&63,W[q++]=128|J&63}return W},B8=(Q,W)=>{if(W<65534){if(Q.subarray&&I0)return String.fromCharCode.apply(null,Q.length===W?Q:Q.subarray(0,W))}let J="";for(let j=0;j<W;j++)J+=String.fromCharCode(Q[j]);return J},C8=(Q,W)=>{let J=W||Q.length;if(typeof TextDecoder==="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(Q.subarray(0,W));let j,G,q=new Array(J*2);for(G=0,j=0;j<J;){let z=Q[j++];if(z<128){q[G++]=z;continue}let U=AQ[z];if(U>4){q[G++]=65533,j+=U-1;continue}z&=U===2?31:U===3?15:7;while(U>1&&j<J)z=z<<6|Q[j++]&63,U--;if(U>1){q[G++]=65533;continue}if(z<65536)q[G++]=z;else z-=65536,q[G++]=55296|z>>10&1023,q[G++]=56320|z&1023}return B8(q,G)},$8=(Q,W)=>{if(W=W||Q.length,W>Q.length)W=Q.length;let J=W-1;while(J>=0&&(Q[J]&192)===128)J--;if(J<0)return W;if(J===0)return W;return J+AQ[Q[J]]>W?J:W},SQ={string2buf:P8,buf2string:C8,utf8border:$8};function L8(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var b0=L8,f0=Object.prototype.toString,{Z_NO_FLUSH:N8,Z_SYNC_FLUSH:v8,Z_FULL_FLUSH:g8,Z_FINISH:R8,Z_OK:_Q,Z_STREAM_END:x8,Z_DEFAULT_COMPRESSION:O8,Z_DEFAULT_STRATEGY:M8,Z_DEFLATED:w8}=zQ;function EQ(Q){this.options=oQ.assign({level:O8,method:w8,chunkSize:16384,windowBits:15,memLevel:8,strategy:M8},Q||{});let W=this.options;if(W.raw&&W.windowBits>0)W.windowBits=-W.windowBits;else if(W.gzip&&W.windowBits>0&&W.windowBits<16)W.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b0,this.strm.avail_out=0;let J=vQ.deflateInit2(this.strm,W.level,W.method,W.windowBits,W.memLevel,W.strategy);if(J!==_Q)throw new Error(GQ[J]);if(W.header)vQ.deflateSetHeader(this.strm,W.header);if(W.dictionary){let j;if(typeof W.dictionary==="string")j=SQ.string2buf(W.dictionary);else if(f0.call(W.dictionary)==="[object ArrayBuffer]")j=new Uint8Array(W.dictionary);else j=W.dictionary;if(J=vQ.deflateSetDictionary(this.strm,j),J!==_Q)throw new Error(GQ[J]);this._dict_set=!0}}EQ.prototype.push=function(Q,W){let J=this.strm,j=this.options.chunkSize,G,q;if(this.ended)return!1;if(W===~~W)q=W;else q=W===!0?R8:N8;if(typeof Q==="string")J.input=SQ.string2buf(Q);else if(f0.call(Q)==="[object ArrayBuffer]")J.input=new Uint8Array(Q);else J.input=Q;J.next_in=0,J.avail_in=J.input.length;for(;;){if(J.avail_out===0)J.output=new Uint8Array(j),J.next_out=0,J.avail_out=j;if((q===v8||q===g8)&&J.avail_out<=6){this.onData(J.output.subarray(0,J.next_out)),J.avail_out=0;continue}if(G=vQ.deflate(J,q),G===x8){if(J.next_out>0)this.onData(J.output.subarray(0,J.next_out));return G=vQ.deflateEnd(this.strm),this.onEnd(G),this.ended=!0,G===_Q}if(J.avail_out===0){this.onData(J.output);continue}if(q>0&&J.next_out>0){this.onData(J.output.subarray(0,J.next_out)),J.avail_out=0;continue}if(J.avail_in===0)break}return!0};EQ.prototype.onData=function(Q){this.chunks.push(Q)};EQ.prototype.onEnd=function(Q){if(Q===_Q)this.result=oQ.flattenChunks(this.chunks);this.chunks=[],this.err=Q,this.msg=this.strm.msg};function MJ(Q,W){let J=new EQ(W);if(J.push(Q,!0),J.err)throw J.msg||GQ[J.err];return J.result}function A8(Q,W){return W=W||{},W.raw=!0,MJ(Q,W)}function S8(Q,W){return W=W||{},W.gzip=!0,MJ(Q,W)}var T8=EQ,y8=MJ,D8=A8,E8=S8,I8=zQ,b8={Deflate:T8,deflate:y8,deflateRaw:D8,gzip:E8,constants:I8},hQ=16209,f8=16191,u8=function Q(W,J){let j,G,q,z,U,Y,X,K,P,k,V,Z,M,$,C,O,L,F,R,y,H,A,g,B,N=W.state;j=W.next_in,g=W.input,G=j+(W.avail_in-5),q=W.next_out,B=W.output,z=q-(J-W.avail_out),U=q+(W.avail_out-257),Y=N.dmax,X=N.wsize,K=N.whave,P=N.wnext,k=N.window,V=N.hold,Z=N.bits,M=N.lencode,$=N.distcode,C=(1<<N.lenbits)-1,O=(1<<N.distbits)-1;Q:do{if(Z<15)V+=g[j++]<<Z,Z+=8,V+=g[j++]<<Z,Z+=8;L=M[V&C];J:for(;;){if(F=L>>>24,V>>>=F,Z-=F,F=L>>>16&255,F===0)B[q++]=L&65535;else if(F&16){if(R=L&65535,F&=15,F){if(Z<F)V+=g[j++]<<Z,Z+=8;R+=V&(1<<F)-1,V>>>=F,Z-=F}if(Z<15)V+=g[j++]<<Z,Z+=8,V+=g[j++]<<Z,Z+=8;L=$[V&O];W:for(;;){if(F=L>>>24,V>>>=F,Z-=F,F=L>>>16&255,F&16){if(y=L&65535,F&=15,Z<F){if(V+=g[j++]<<Z,Z+=8,Z<F)V+=g[j++]<<Z,Z+=8}if(y+=V&(1<<F)-1,y>Y){W.msg="invalid distance too far back",N.mode=hQ;break Q}if(V>>>=F,Z-=F,F=q-z,y>F){if(F=y-F,F>K){if(N.sane){W.msg="invalid distance too far back",N.mode=hQ;break Q}}if(H=0,A=k,P===0){if(H+=X-F,F<R){R-=F;do B[q++]=k[H++];while(--F);H=q-y,A=B}}else if(P<F){if(H+=X+P-F,F-=P,F<R){R-=F;do B[q++]=k[H++];while(--F);if(H=0,P<R){F=P,R-=F;do B[q++]=k[H++];while(--F);H=q-y,A=B}}}else if(H+=P-F,F<R){R-=F;do B[q++]=k[H++];while(--F);H=q-y,A=B}while(R>2)B[q++]=A[H++],B[q++]=A[H++],B[q++]=A[H++],R-=3;if(R){if(B[q++]=A[H++],R>1)B[q++]=A[H++]}}else{H=q-y;do B[q++]=B[H++],B[q++]=B[H++],B[q++]=B[H++],R-=3;while(R>2);if(R){if(B[q++]=B[H++],R>1)B[q++]=B[H++]}}}else if((F&64)===0){L=$[(L&65535)+(V&(1<<F)-1)];continue W}else{W.msg="invalid distance code",N.mode=hQ;break Q}break}}else if((F&64)===0){L=M[(L&65535)+(V&(1<<F)-1)];continue J}else if(F&32){N.mode=f8;break Q}else{W.msg="invalid literal/length code",N.mode=hQ;break Q}break}}while(j<G&&q<U);R=Z>>3,j-=R,Z-=R<<3,V&=(1<<Z)-1,W.next_in=j,W.next_out=q,W.avail_in=j<G?5+(G-j):5-(j-G),W.avail_out=q<U?257+(U-q):257-(q-U),N.hold=V,N.bits=Z;return},kQ=15,hJ=852,cJ=592,mJ=0,GJ=1,dJ=2,h8=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),c8=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),m8=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),d8=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),p8=(Q,W,J,j,G,q,z,U)=>{let Y=U.bits,X=0,K=0,P=0,k=0,V=0,Z=0,M=0,$=0,C=0,O=0,L,F,R,y,H,A=null,g,B=new Uint16Array(kQ+1),N=new Uint16Array(kQ+1),JQ=null,AJ,bQ,fQ;for(X=0;X<=kQ;X++)B[X]=0;for(K=0;K<j;K++)B[W[J+K]]++;V=Y;for(k=kQ;k>=1;k--)if(B[k]!==0)break;if(V>k)V=k;if(k===0)return G[q++]=20971520,G[q++]=20971520,U.bits=1,0;for(P=1;P<k;P++)if(B[P]!==0)break;if(V<P)V=P;$=1;for(X=1;X<=kQ;X++)if($<<=1,$-=B[X],$<0)return-1;if($>0&&(Q===mJ||k!==1))return-1;N[1]=0;for(X=1;X<kQ;X++)N[X+1]=N[X]+B[X];for(K=0;K<j;K++)if(W[J+K]!==0)z[N[W[J+K]]++]=K;if(Q===mJ)A=JQ=z,g=20;else if(Q===GJ)A=h8,JQ=c8,g=257;else A=m8,JQ=d8,g=0;if(O=0,K=0,X=P,H=q,Z=V,M=0,R=-1,C=1<<V,y=C-1,Q===GJ&&C>hJ||Q===dJ&&C>cJ)return 1;for(;;){if(AJ=X-M,z[K]+1<g)bQ=0,fQ=z[K];else if(z[K]>=g)bQ=JQ[z[K]-g],fQ=A[z[K]-g];else bQ=96,fQ=0;L=1<<X-M,F=1<<Z,P=F;do F-=L,G[H+(O>>M)+F]=AJ<<24|bQ<<16|fQ|0;while(F!==0);L=1<<X-1;while(O&L)L>>=1;if(L!==0)O&=L-1,O+=L;else O=0;if(K++,--B[X]===0){if(X===k)break;X=W[J+z[K]]}if(X>V&&(O&y)!==R){if(M===0)M=V;H+=P,Z=X-M,$=1<<Z;while(Z+M<k){if($-=B[Z+M],$<=0)break;Z++,$<<=1}if(C+=1<<Z,Q===GJ&&C>hJ||Q===dJ&&C>cJ)return 1;R=O&y,G[R]=V<<24|Z<<16|H-q|0}}if(O!==0)G[H+O]=X-M<<24|4194304|0;return U.bits=V,0},gQ=p8,l8=0,u0=1,h0=2,{Z_FINISH:pJ,Z_BLOCK:_8,Z_TREES:cQ,Z_OK:UQ,Z_STREAM_END:i8,Z_NEED_DICT:r8,Z_STREAM_ERROR:m,Z_DATA_ERROR:c0,Z_MEM_ERROR:m0,Z_BUF_ERROR:o8,Z_DEFLATED:lJ}=zQ,nQ=16180,_J=16181,iJ=16182,rJ=16183,oJ=16184,nJ=16185,aJ=16186,eJ=16187,tJ=16188,sJ=16189,iQ=16190,i=16191,XJ=16192,Q0=16193,UJ=16194,J0=16195,W0=16196,j0=16197,q0=16198,mQ=16199,dQ=16200,G0=16201,X0=16202,U0=16203,z0=16204,K0=16205,zJ=16206,V0=16207,k0=16208,S=16209,d0=16210,p0=16211,n8=852,a8=592,e8=15,t8=e8,Y0=(Q)=>{return(Q>>>24&255)+(Q>>>8&65280)+((Q&65280)<<8)+((Q&255)<<24)};function s8(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var KQ=(Q)=>{if(!Q)return 1;let W=Q.state;if(!W||W.strm!==Q||W.mode<nQ||W.mode>p0)return 1;return 0},l0=(Q)=>{if(KQ(Q))return m;let W=Q.state;if(Q.total_in=Q.total_out=W.total=0,Q.msg="",W.wrap)Q.adler=W.wrap&1;return W.mode=nQ,W.last=0,W.havedict=0,W.flags=-1,W.dmax=32768,W.head=null,W.hold=0,W.bits=0,W.lencode=W.lendyn=new Int32Array(n8),W.distcode=W.distdyn=new Int32Array(a8),W.sane=1,W.back=-1,UQ},_0=(Q)=>{if(KQ(Q))return m;let W=Q.state;return W.wsize=0,W.whave=0,W.wnext=0,l0(Q)},i0=(Q,W)=>{let J;if(KQ(Q))return m;let j=Q.state;if(W<0)J=0,W=-W;else if(J=(W>>4)+5,W<48)W&=15;if(W&&(W<8||W>15))return m;if(j.window!==null&&j.wbits!==W)j.window=null;return j.wrap=J,j.wbits=W,_0(Q)},r0=(Q,W)=>{if(!Q)return m;let J=new s8;Q.state=J,J.strm=Q,J.window=null,J.mode=nQ;let j=i0(Q,W);if(j!==UQ)Q.state=null;return j},Q1=(Q)=>{return r0(Q,t8)},F0=!0,KJ,VJ,J1=(Q)=>{if(F0){KJ=new Int32Array(512),VJ=new Int32Array(32);let W=0;while(W<144)Q.lens[W++]=8;while(W<256)Q.lens[W++]=9;while(W<280)Q.lens[W++]=7;while(W<288)Q.lens[W++]=8;gQ(u0,Q.lens,0,288,KJ,0,Q.work,{bits:9}),W=0;while(W<32)Q.lens[W++]=5;gQ(h0,Q.lens,0,32,VJ,0,Q.work,{bits:5}),F0=!1}Q.lencode=KJ,Q.lenbits=9,Q.distcode=VJ,Q.distbits=5},o0=(Q,W,J,j)=>{let G,q=Q.state;if(q.window===null)q.wsize=1<<q.wbits,q.wnext=0,q.whave=0,q.window=new Uint8Array(q.wsize);if(j>=q.wsize)q.window.set(W.subarray(J-q.wsize,J),0),q.wnext=0,q.whave=q.wsize;else{if(G=q.wsize-q.wnext,G>j)G=j;if(q.window.set(W.subarray(J-j,J-j+G),q.wnext),j-=G,j)q.window.set(W.subarray(J-j,J),0),q.wnext=j,q.whave=q.wsize;else{if(q.wnext+=G,q.wnext===q.wsize)q.wnext=0;if(q.whave<q.wsize)q.whave+=G}}return 0},W1=(Q,W)=>{let J,j,G,q,z,U,Y,X,K,P,k,V,Z,M,$=0,C,O,L,F,R,y,H,A,g=new Uint8Array(4),B,N,JQ=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(KQ(Q)||!Q.output||!Q.input&&Q.avail_in!==0)return m;if(J=Q.state,J.mode===i)J.mode=XJ;z=Q.next_out,G=Q.output,Y=Q.avail_out,q=Q.next_in,j=Q.input,U=Q.avail_in,X=J.hold,K=J.bits,P=U,k=Y,A=UQ;Q:for(;;)switch(J.mode){case nQ:if(J.wrap===0){J.mode=XJ;break}while(K<16){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.wrap&2&&X===35615){if(J.wbits===0)J.wbits=15;J.check=0,g[0]=X&255,g[1]=X>>>8&255,J.check=D(J.check,g,2,0),X=0,K=0,J.mode=_J;break}if(J.head)J.head.done=!1;if(!(J.wrap&1)||(((X&255)<<8)+(X>>8))%31){Q.msg="incorrect header check",J.mode=S;break}if((X&15)!==lJ){Q.msg="unknown compression method",J.mode=S;break}if(X>>>=4,K-=4,H=(X&15)+8,J.wbits===0)J.wbits=H;if(H>15||H>J.wbits){Q.msg="invalid window size",J.mode=S;break}J.dmax=1<<J.wbits,J.flags=0,Q.adler=J.check=1,J.mode=X&512?sJ:i,X=0,K=0;break;case _J:while(K<16){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.flags=X,(J.flags&255)!==lJ){Q.msg="unknown compression method",J.mode=S;break}if(J.flags&57344){Q.msg="unknown header flags set",J.mode=S;break}if(J.head)J.head.text=X>>8&1;if(J.flags&512&&J.wrap&4)g[0]=X&255,g[1]=X>>>8&255,J.check=D(J.check,g,2,0);X=0,K=0,J.mode=iJ;case iJ:while(K<32){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.head)J.head.time=X;if(J.flags&512&&J.wrap&4)g[0]=X&255,g[1]=X>>>8&255,g[2]=X>>>16&255,g[3]=X>>>24&255,J.check=D(J.check,g,4,0);X=0,K=0,J.mode=rJ;case rJ:while(K<16){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.head)J.head.xflags=X&255,J.head.os=X>>8;if(J.flags&512&&J.wrap&4)g[0]=X&255,g[1]=X>>>8&255,J.check=D(J.check,g,2,0);X=0,K=0,J.mode=oJ;case oJ:if(J.flags&1024){while(K<16){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.length=X,J.head)J.head.extra_len=X;if(J.flags&512&&J.wrap&4)g[0]=X&255,g[1]=X>>>8&255,J.check=D(J.check,g,2,0);X=0,K=0}else if(J.head)J.head.extra=null;J.mode=nJ;case nJ:if(J.flags&1024){if(V=J.length,V>U)V=U;if(V){if(J.head){if(H=J.head.extra_len-J.length,!J.head.extra)J.head.extra=new Uint8Array(J.head.extra_len);J.head.extra.set(j.subarray(q,q+V),H)}if(J.flags&512&&J.wrap&4)J.check=D(J.check,j,V,q);U-=V,q+=V,J.length-=V}if(J.length)break Q}J.length=0,J.mode=aJ;case aJ:if(J.flags&2048){if(U===0)break Q;V=0;do if(H=j[q+V++],J.head&&H&&J.length<65536)J.head.name+=String.fromCharCode(H);while(H&&V<U);if(J.flags&512&&J.wrap&4)J.check=D(J.check,j,V,q);if(U-=V,q+=V,H)break Q}else if(J.head)J.head.name=null;J.length=0,J.mode=eJ;case eJ:if(J.flags&4096){if(U===0)break Q;V=0;do if(H=j[q+V++],J.head&&H&&J.length<65536)J.head.comment+=String.fromCharCode(H);while(H&&V<U);if(J.flags&512&&J.wrap&4)J.check=D(J.check,j,V,q);if(U-=V,q+=V,H)break Q}else if(J.head)J.head.comment=null;J.mode=tJ;case tJ:if(J.flags&512){while(K<16){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.wrap&4&&X!==(J.check&65535)){Q.msg="header crc mismatch",J.mode=S;break}X=0,K=0}if(J.head)J.head.hcrc=J.flags>>9&1,J.head.done=!0;Q.adler=J.check=0,J.mode=i;break;case sJ:while(K<32){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}Q.adler=J.check=Y0(X),X=0,K=0,J.mode=iQ;case iQ:if(J.havedict===0)return Q.next_out=z,Q.avail_out=Y,Q.next_in=q,Q.avail_in=U,J.hold=X,J.bits=K,r8;Q.adler=J.check=1,J.mode=i;case i:if(W===_8||W===cQ)break Q;case XJ:if(J.last){X>>>=K&7,K-=K&7,J.mode=zJ;break}while(K<3){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}switch(J.last=X&1,X>>>=1,K-=1,X&3){case 0:J.mode=Q0;break;case 1:if(J1(J),J.mode=mQ,W===cQ){X>>>=2,K-=2;break Q}break;case 2:J.mode=W0;break;case 3:Q.msg="invalid block type",J.mode=S}X>>>=2,K-=2;break;case Q0:X>>>=K&7,K-=K&7;while(K<32){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if((X&65535)!==(X>>>16^65535)){Q.msg="invalid stored block lengths",J.mode=S;break}if(J.length=X&65535,X=0,K=0,J.mode=UJ,W===cQ)break Q;case UJ:J.mode=J0;case J0:if(V=J.length,V){if(V>U)V=U;if(V>Y)V=Y;if(V===0)break Q;G.set(j.subarray(q,q+V),z),U-=V,q+=V,Y-=V,z+=V,J.length-=V;break}J.mode=i;break;case W0:while(K<14){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.nlen=(X&31)+257,X>>>=5,K-=5,J.ndist=(X&31)+1,X>>>=5,K-=5,J.ncode=(X&15)+4,X>>>=4,K-=4,J.nlen>286||J.ndist>30){Q.msg="too many length or distance symbols",J.mode=S;break}J.have=0,J.mode=j0;case j0:while(J.have<J.ncode){while(K<3){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}J.lens[JQ[J.have++]]=X&7,X>>>=3,K-=3}while(J.have<19)J.lens[JQ[J.have++]]=0;if(J.lencode=J.lendyn,J.lenbits=7,B={bits:J.lenbits},A=gQ(l8,J.lens,0,19,J.lencode,0,J.work,B),J.lenbits=B.bits,A){Q.msg="invalid code lengths set",J.mode=S;break}J.have=0,J.mode=q0;case q0:while(J.have<J.nlen+J.ndist){for(;;){if($=J.lencode[X&(1<<J.lenbits)-1],C=$>>>24,O=$>>>16&255,L=$&65535,C<=K)break;if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(L<16)X>>>=C,K-=C,J.lens[J.have++]=L;else{if(L===16){N=C+2;while(K<N){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(X>>>=C,K-=C,J.have===0){Q.msg="invalid bit length repeat",J.mode=S;break}H=J.lens[J.have-1],V=3+(X&3),X>>>=2,K-=2}else if(L===17){N=C+3;while(K<N){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}X>>>=C,K-=C,H=0,V=3+(X&7),X>>>=3,K-=3}else{N=C+7;while(K<N){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}X>>>=C,K-=C,H=0,V=11+(X&127),X>>>=7,K-=7}if(J.have+V>J.nlen+J.ndist){Q.msg="invalid bit length repeat",J.mode=S;break}while(V--)J.lens[J.have++]=H}}if(J.mode===S)break;if(J.lens[256]===0){Q.msg="invalid code -- missing end-of-block",J.mode=S;break}if(J.lenbits=9,B={bits:J.lenbits},A=gQ(u0,J.lens,0,J.nlen,J.lencode,0,J.work,B),J.lenbits=B.bits,A){Q.msg="invalid literal/lengths set",J.mode=S;break}if(J.distbits=6,J.distcode=J.distdyn,B={bits:J.distbits},A=gQ(h0,J.lens,J.nlen,J.ndist,J.distcode,0,J.work,B),J.distbits=B.bits,A){Q.msg="invalid distances set",J.mode=S;break}if(J.mode=mQ,W===cQ)break Q;case mQ:J.mode=dQ;case dQ:if(U>=6&&Y>=258){if(Q.next_out=z,Q.avail_out=Y,Q.next_in=q,Q.avail_in=U,J.hold=X,J.bits=K,u8(Q,k),z=Q.next_out,G=Q.output,Y=Q.avail_out,q=Q.next_in,j=Q.input,U=Q.avail_in,X=J.hold,K=J.bits,J.mode===i)J.back=-1;break}J.back=0;for(;;){if($=J.lencode[X&(1<<J.lenbits)-1],C=$>>>24,O=$>>>16&255,L=$&65535,C<=K)break;if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(O&&(O&240)===0){F=C,R=O,y=L;for(;;){if($=J.lencode[y+((X&(1<<F+R)-1)>>F)],C=$>>>24,O=$>>>16&255,L=$&65535,F+C<=K)break;if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}X>>>=F,K-=F,J.back+=F}if(X>>>=C,K-=C,J.back+=C,J.length=L,O===0){J.mode=K0;break}if(O&32){J.back=-1,J.mode=i;break}if(O&64){Q.msg="invalid literal/length code",J.mode=S;break}J.extra=O&15,J.mode=G0;case G0:if(J.extra){N=J.extra;while(K<N){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}J.length+=X&(1<<J.extra)-1,X>>>=J.extra,K-=J.extra,J.back+=J.extra}J.was=J.length,J.mode=X0;case X0:for(;;){if($=J.distcode[X&(1<<J.distbits)-1],C=$>>>24,O=$>>>16&255,L=$&65535,C<=K)break;if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if((O&240)===0){F=C,R=O,y=L;for(;;){if($=J.distcode[y+((X&(1<<F+R)-1)>>F)],C=$>>>24,O=$>>>16&255,L=$&65535,F+C<=K)break;if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}X>>>=F,K-=F,J.back+=F}if(X>>>=C,K-=C,J.back+=C,O&64){Q.msg="invalid distance code",J.mode=S;break}J.offset=L,J.extra=O&15,J.mode=U0;case U0:if(J.extra){N=J.extra;while(K<N){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}J.offset+=X&(1<<J.extra)-1,X>>>=J.extra,K-=J.extra,J.back+=J.extra}if(J.offset>J.dmax){Q.msg="invalid distance too far back",J.mode=S;break}J.mode=z0;case z0:if(Y===0)break Q;if(V=k-Y,J.offset>V){if(V=J.offset-V,V>J.whave){if(J.sane){Q.msg="invalid distance too far back",J.mode=S;break}}if(V>J.wnext)V-=J.wnext,Z=J.wsize-V;else Z=J.wnext-V;if(V>J.length)V=J.length;M=J.window}else M=G,Z=z-J.offset,V=J.length;if(V>Y)V=Y;Y-=V,J.length-=V;do G[z++]=M[Z++];while(--V);if(J.length===0)J.mode=dQ;break;case K0:if(Y===0)break Q;G[z++]=J.length,Y--,J.mode=dQ;break;case zJ:if(J.wrap){while(K<32){if(U===0)break Q;U--,X|=j[q++]<<K,K+=8}if(k-=Y,Q.total_out+=k,J.total+=k,J.wrap&4&&k)Q.adler=J.check=J.flags?D(J.check,G,k,z-k):wQ(J.check,G,k,z-k);if(k=Y,J.wrap&4&&(J.flags?X:Y0(X))!==J.check){Q.msg="incorrect data check",J.mode=S;break}X=0,K=0}J.mode=V0;case V0:if(J.wrap&&J.flags){while(K<32){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.wrap&4&&X!==(J.total&4294967295)){Q.msg="incorrect length check",J.mode=S;break}X=0,K=0}J.mode=k0;case k0:A=i8;break Q;case S:A=c0;break Q;case d0:return m0;case p0:default:return m}if(Q.next_out=z,Q.avail_out=Y,Q.next_in=q,Q.avail_in=U,J.hold=X,J.bits=K,J.wsize||k!==Q.avail_out&&J.mode<S&&(J.mode<zJ||W!==pJ)){if(o0(Q,Q.output,Q.next_out,k-Q.avail_out));}if(P-=Q.avail_in,k-=Q.avail_out,Q.total_in+=P,Q.total_out+=k,J.total+=k,J.wrap&4&&k)Q.adler=J.check=J.flags?D(J.check,G,k,Q.next_out-k):wQ(J.check,G,k,Q.next_out-k);if(Q.data_type=J.bits+(J.last?64:0)+(J.mode===i?128:0)+(J.mode===mQ||J.mode===UJ?256:0),(P===0&&k===0||W===pJ)&&A===UQ)A=o8;return A},j1=(Q)=>{if(KQ(Q))return m;let W=Q.state;if(W.window)W.window=null;return Q.state=null,UQ},q1=(Q,W)=>{if(KQ(Q))return m;let J=Q.state;if((J.wrap&2)===0)return m;return J.head=W,W.done=!1,UQ},G1=(Q,W)=>{let J=W.length,j,G,q;if(KQ(Q))return m;if(j=Q.state,j.wrap!==0&&j.mode!==iQ)return m;if(j.mode===iQ){if(G=1,G=wQ(G,W,J,0),G!==j.check)return c0}if(q=o0(Q,W,J,J),q)return j.mode=d0,m0;return j.havedict=1,UQ},X1=_0,U1=i0,z1=l0,K1=Q1,V1=r0,k1=W1,Y1=j1,F1=q1,Z1=G1,H1="pako inflate (from Nodeca project)",o={inflateReset:X1,inflateReset2:U1,inflateResetKeep:z1,inflateInit:K1,inflateInit2:V1,inflate:k1,inflateEnd:Y1,inflateGetHeader:F1,inflateSetDictionary:Z1,inflateInfo:H1};function P1(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var B1=P1,n0=Object.prototype.toString,{Z_NO_FLUSH:C1,Z_FINISH:$1,Z_OK:TQ,Z_STREAM_END:kJ,Z_NEED_DICT:YJ,Z_STREAM_ERROR:L1,Z_DATA_ERROR:Z0,Z_MEM_ERROR:N1}=zQ;function IQ(Q){this.options=oQ.assign({chunkSize:65536,windowBits:15,to:""},Q||{});let W=this.options;if(W.raw&&W.windowBits>=0&&W.windowBits<16){if(W.windowBits=-W.windowBits,W.windowBits===0)W.windowBits=-15}if(W.windowBits>=0&&W.windowBits<16&&!(Q&&Q.windowBits))W.windowBits+=32;if(W.windowBits>15&&W.windowBits<48){if((W.windowBits&15)===0)W.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b0,this.strm.avail_out=0;let J=o.inflateInit2(this.strm,W.windowBits);if(J!==TQ)throw new Error(GQ[J]);if(this.header=new B1,o.inflateGetHeader(this.strm,this.header),W.dictionary){if(typeof W.dictionary==="string")W.dictionary=SQ.string2buf(W.dictionary);else if(n0.call(W.dictionary)==="[object ArrayBuffer]")W.dictionary=new Uint8Array(W.dictionary);if(W.raw){if(J=o.inflateSetDictionary(this.strm,W.dictionary),J!==TQ)throw new Error(GQ[J])}}}IQ.prototype.push=function(Q,W){let J=this.strm,j=this.options.chunkSize,G=this.options.dictionary,q,z,U;if(this.ended)return!1;if(W===~~W)z=W;else z=W===!0?$1:C1;if(n0.call(Q)==="[object ArrayBuffer]")J.input=new Uint8Array(Q);else J.input=Q;J.next_in=0,J.avail_in=J.input.length;for(;;){if(J.avail_out===0)J.output=new Uint8Array(j),J.next_out=0,J.avail_out=j;if(q=o.inflate(J,z),q===YJ&&G){if(q=o.inflateSetDictionary(J,G),q===TQ)q=o.inflate(J,z);else if(q===Z0)q=YJ}while(J.avail_in>0&&q===kJ&&J.state.wrap>0&&Q[J.next_in]!==0)o.inflateReset(J),q=o.inflate(J,z);switch(q){case L1:case Z0:case YJ:case N1:return this.onEnd(q),this.ended=!0,!1}if(U=J.avail_out,J.next_out){if(J.avail_out===0||q===kJ)if(this.options.to==="string"){let Y=SQ.utf8border(J.output,J.next_out),X=J.next_out-Y,K=SQ.buf2string(J.output,Y);if(J.next_out=X,J.avail_out=j-X,X)J.output.set(J.output.subarray(Y,Y+X),0);this.onData(K)}else this.onData(J.output.length===J.next_out?J.output:J.output.subarray(0,J.next_out))}if(q===TQ&&U===0)continue;if(q===kJ)return q=o.inflateEnd(this.strm),this.onEnd(q),this.ended=!0,!0;if(J.avail_in===0)break}return!0};IQ.prototype.onData=function(Q){this.chunks.push(Q)};IQ.prototype.onEnd=function(Q){if(Q===TQ)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=oQ.flattenChunks(this.chunks);this.chunks=[],this.err=Q,this.msg=this.strm.msg};function wJ(Q,W){let J=new IQ(W);if(J.push(Q),J.err)throw J.msg||GQ[J.err];return J.result}function v1(Q,W){return W=W||{},W.raw=!0,wJ(Q,W)}var g1=IQ,R1=wJ,x1=v1,O1=wJ,M1=zQ,w1={Inflate:g1,inflate:R1,inflateRaw:x1,ungzip:O1,constants:M1},{Deflate:A1,deflate:S1,deflateRaw:T1,gzip:y1}=b8,{Inflate:D1,inflate:E1,inflateRaw:I1,ungzip:b1}=w1,f1=A1,u1=S1,h1=T1,c1=y1,m1=D1,d1=E1,p1=I1,l1=b1,_1=zQ,aQ={Deflate:f1,deflate:u1,deflateRaw:h1,gzip:c1,Inflate:m1,inflate:d1,inflateRaw:p1,ungzip:l1,constants:_1};class w{static version="4.1.0";static logger=new eQ;icons=new Map;name="failed-to-find-vyi-name";formatVersion=1;constructor(Q){if(w.logger.registerType("Vyi-module","#ff6600"),Q)this.parse(Q)}parse(Q){if(!Q)return this;try{let W;if(typeof Q==="string")try{W=JSON.parse(Q)}catch(J){if(!Q.includes(".vyr")&&!Q.includes(".vyi")){if(W=Q,!W)throw new Error("Non vyi data found from binary string")}else try{W=JSON.parse(Q)}catch(j){if(typeof window==="undefined")W=this.readFileAndGetVYI(Q);else throw new Error("Invalid string input - not valid JSON or file path")}}else if(Q instanceof w)W=Q.export();else if(Q instanceof Object&&!Array.isArray(Q)&&!(Q instanceof ArrayBuffer||Q instanceof Uint8Array))W=Q;else if(Q instanceof ArrayBuffer||Q instanceof Uint8Array)W=this.handleBinaryData(Q);else throw new Error("Error processing: Invalid input type provided.");if(!W||(!W.v||!W.i)&&!W.icons)throw new Error("Non vyi data found.");this.processVyiData(W)}catch(W){w.logger.prefix("Vyi-module").error(\`\${W.message}\`)}return this}readFile(Q){try{let J=new TextEncoder().encode(Q),j=aQ.inflate(J,{to:"string"});return JSON.parse(j)}catch(W){return console.error("File reading failed:",W),null}}readFileAndGetVYI(Q){let J=(()=>({})).readFileSync(Q);return this.handleBinaryData(J)}async fetchAndParseJSON(Q){try{return await(await fetch(Q)).json()}catch(W){throw new Error(\`Failed to fetch or parse JSON from URL: \${W}\`)}}handleBinaryData(Q){let W=Q instanceof ArrayBuffer?new Uint8Array(Q):Q;try{let J=aQ.inflate(W,{to:"string"});if(!J)return null;return JSON.parse(J)}catch(J){try{let j=new TextDecoder().decode(W);if(!j)return null;return JSON.parse(j)}catch(j){return console.error("Decoding failed:",j),null}}}processVyiData(Q){this.icons.clear();let W=Q.i||Q.icons;if(this.formatVersion=Q.v??"format not found",Array.isArray(W))W.forEach((J)=>{if(!Array.isArray(J)&&typeof J==="object"){let j=this.convertOldIconData(J);this.addIcon(j)}else this.addIcon(J)});else w.logger.prefix("Vyi-module").error("Invalid .vyi file! Cannot parse icons.")}convertOldIconData(Q){let W=Array.isArray(Q.frames)?Q.frames.map((j)=>[j.data,j.delay]):[],J=Array.isArray(Q.states)?Q.states.map((j)=>{let G=Array.isArray(j.frames)?j.frames.map((q)=>[q.data,q.delay]):[];return[j.name,j.data,j.delay||100,G]}):[];return[Q.name||"",Q.w||32,Q.h||32,Q.delay||100,Q.data||"",W,J]}addIcon(Q){if(!Q){w.logger.prefix("Vyi-module").error("No icon data passed!");return}if(!(Q instanceof T)&&!Array.isArray(Q)){w.logger.prefix("Vyi-module").error("Invalid icon data type passed!");return}let W=Q instanceof T?Q:new T(Q);return this.icons.set(W.id,W),W.setVyi(this),W}removeIcon(Q){if(!Q)return;if(Q instanceof T){if(this.icons.delete(Q.id))Q.removeVyi()}}removeIconByName(Q){let W=this.getIcon(Q);if(W)this.removeIcon(W)}removeIconById(Q){let W=this.getIconById(Q);if(W)this.removeIcon(W)}getIconNames(){return this.getIcons().map((W)=>W.name)}getIcon(Q){if(typeof Q==="string"){let W=this.getIcons();for(let J=W.length-1;J>=0;J--){let j=W[J];if(j.getName()===Q)return j}}else w.logger.prefix("Vyi-module").error("Invalid name type used!")}getIconCount(){return this.icons.size}getIconById(Q){if(!Q)return;return this.icons.get(Q)||this.getIcons().find((J)=>J.states.has(Q))?.getStateById(Q)}getIcons(){return Array.from(this.icons.values())}rename(Q){if(typeof Q==="string")this.name=Q;else w.logger.prefix("Vyi-module").error("Invalid name type used!")}getName(){return this.name}export(Q){let W={v:this.formatVersion,i:this.getIcons().map((J)=>J.export())};if(Q){let J=new TextEncoder().encode(JSON.stringify(W));return aQ.deflate(J)}return W}}self.onmessage=function(Q){let{id:W,type:J,data:j}=Q.data;try{if(J==="parse"){let q=new w(j).export();self.postMessage({id:W,success:!0,data:q})}}catch(G){let q=G instanceof Error?G.message:"Unknown error";console.error("Worker error:",G),self.postMessage({id:W,success:!1,error:q})}};
|
|
9041
|
+
`;
|
|
9042
|
+
var WORKER_BLOB = new Blob([WORKER_CODE], { type: "application/javascript" });
|
|
9043
|
+
var WORKER_SCRIPT_URL = URL.createObjectURL(WORKER_BLOB);
|
|
9044
|
+
|
|
9045
|
+
class WorkerPool {
|
|
9046
|
+
static instance = null;
|
|
9047
|
+
workers = [];
|
|
9048
|
+
availableWorkers = [];
|
|
9049
|
+
maxWorkers;
|
|
9050
|
+
messageId = 0;
|
|
9051
|
+
pendingMessages = new Map;
|
|
9052
|
+
waitQueue = [];
|
|
9053
|
+
constructor(maxWorkers = navigator.hardwareConcurrency || 4) {
|
|
9054
|
+
this.maxWorkers = maxWorkers;
|
|
9055
|
+
this.initializeWorkers();
|
|
9056
|
+
}
|
|
9057
|
+
static getInstance(maxWorkers) {
|
|
9058
|
+
if (!WorkerPool.instance) {
|
|
9059
|
+
WorkerPool.instance = new WorkerPool(maxWorkers);
|
|
9098
9060
|
}
|
|
9061
|
+
return WorkerPool.instance;
|
|
9099
9062
|
}
|
|
9100
|
-
|
|
9101
|
-
|
|
9063
|
+
static destroy() {
|
|
9064
|
+
if (WorkerPool.instance) {
|
|
9065
|
+
WorkerPool.instance.terminate();
|
|
9066
|
+
WorkerPool.instance = null;
|
|
9067
|
+
}
|
|
9102
9068
|
}
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9069
|
+
initializeWorkers() {
|
|
9070
|
+
for (let i = 0;i < this.maxWorkers; i++) {
|
|
9071
|
+
const worker = this.createWorker();
|
|
9072
|
+
this.workers.push(worker);
|
|
9073
|
+
this.availableWorkers.push(worker);
|
|
9106
9074
|
}
|
|
9107
9075
|
}
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9076
|
+
createWorker() {
|
|
9077
|
+
const worker = new Worker(WORKER_SCRIPT_URL, { type: "module" });
|
|
9078
|
+
worker.onmessage = (event) => {
|
|
9079
|
+
const { id, success, data, error } = event.data;
|
|
9080
|
+
const pending = this.pendingMessages.get(id);
|
|
9081
|
+
if (pending) {
|
|
9082
|
+
this.pendingMessages.delete(id);
|
|
9083
|
+
if (success) {
|
|
9084
|
+
pending.resolve(data);
|
|
9085
|
+
} else {
|
|
9086
|
+
pending.reject(new Error(error));
|
|
9087
|
+
}
|
|
9088
|
+
}
|
|
9089
|
+
};
|
|
9090
|
+
worker.onerror = (error) => {
|
|
9091
|
+
console.error("Worker error:", error);
|
|
9092
|
+
for (const [id, pending] of this.pendingMessages) {
|
|
9093
|
+
pending.reject(new Error(`Worker error: ${error.message}`));
|
|
9094
|
+
}
|
|
9095
|
+
this.pendingMessages.clear();
|
|
9096
|
+
};
|
|
9097
|
+
return worker;
|
|
9117
9098
|
}
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
if (typeof opt.dictionary === "string") {
|
|
9122
|
-
opt.dictionary = strings.string2buf(opt.dictionary);
|
|
9123
|
-
} else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") {
|
|
9124
|
-
opt.dictionary = new Uint8Array(opt.dictionary);
|
|
9099
|
+
async getWorker() {
|
|
9100
|
+
if (this.availableWorkers.length > 0) {
|
|
9101
|
+
return this.availableWorkers.pop();
|
|
9125
9102
|
}
|
|
9126
|
-
if (
|
|
9127
|
-
|
|
9128
|
-
if (status !== Z_OK) {
|
|
9129
|
-
throw new Error(messages[status]);
|
|
9130
|
-
}
|
|
9103
|
+
if (this.workers.length === 0) {
|
|
9104
|
+
throw new Error("Workers have been terminated. Create a new VyiWorker instance to continue.");
|
|
9131
9105
|
}
|
|
9106
|
+
return new Promise((resolve3) => {
|
|
9107
|
+
this.waitQueue.push(resolve3);
|
|
9108
|
+
});
|
|
9132
9109
|
}
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
if (this.ended)
|
|
9140
|
-
return false;
|
|
9141
|
-
if (flush_mode === ~~flush_mode)
|
|
9142
|
-
_flush_mode = flush_mode;
|
|
9143
|
-
else
|
|
9144
|
-
_flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;
|
|
9145
|
-
if (toString.call(data) === "[object ArrayBuffer]") {
|
|
9146
|
-
strm.input = new Uint8Array(data);
|
|
9147
|
-
} else {
|
|
9148
|
-
strm.input = data;
|
|
9149
|
-
}
|
|
9150
|
-
strm.next_in = 0;
|
|
9151
|
-
strm.avail_in = strm.input.length;
|
|
9152
|
-
for (;; ) {
|
|
9153
|
-
if (strm.avail_out === 0) {
|
|
9154
|
-
strm.output = new Uint8Array(chunkSize);
|
|
9155
|
-
strm.next_out = 0;
|
|
9156
|
-
strm.avail_out = chunkSize;
|
|
9110
|
+
returnWorker(worker) {
|
|
9111
|
+
if (this.waitQueue.length > 0) {
|
|
9112
|
+
const resolve3 = this.waitQueue.shift();
|
|
9113
|
+
resolve3(worker);
|
|
9114
|
+
} else if (this.workers.includes(worker)) {
|
|
9115
|
+
this.availableWorkers.push(worker);
|
|
9157
9116
|
}
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9117
|
+
}
|
|
9118
|
+
async sendMessage(worker, type, data) {
|
|
9119
|
+
const id = `${this.messageId++}`;
|
|
9120
|
+
return new Promise((resolve3, reject) => {
|
|
9121
|
+
this.pendingMessages.set(id, { resolve: resolve3, reject });
|
|
9122
|
+
worker.postMessage({ id, type, data });
|
|
9123
|
+
setTimeout(() => {
|
|
9124
|
+
if (this.pendingMessages.has(id)) {
|
|
9125
|
+
this.pendingMessages.delete(id);
|
|
9126
|
+
reject(new Error("Worker message timeout"));
|
|
9127
|
+
}
|
|
9128
|
+
}, 30000);
|
|
9129
|
+
});
|
|
9130
|
+
}
|
|
9131
|
+
terminate() {
|
|
9132
|
+
for (const worker of this.workers) {
|
|
9133
|
+
worker.terminate();
|
|
9166
9134
|
}
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9135
|
+
this.workers = [];
|
|
9136
|
+
this.availableWorkers = [];
|
|
9137
|
+
for (const [id, pending] of this.pendingMessages) {
|
|
9138
|
+
pending.reject(new Error("Worker terminated"));
|
|
9170
9139
|
}
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9140
|
+
this.pendingMessages.clear();
|
|
9141
|
+
}
|
|
9142
|
+
}
|
|
9143
|
+
|
|
9144
|
+
// src/cli/app-bundler.ts
|
|
9145
|
+
import { promises as fs, existsSync } from "fs";
|
|
9146
|
+
import { join as join3, dirname as dirname3, extname as extname2 } from "path";
|
|
9147
|
+
|
|
9148
|
+
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
9149
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
9150
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
9151
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
9152
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
9153
|
+
var styles = {
|
|
9154
|
+
modifier: {
|
|
9155
|
+
reset: [0, 0],
|
|
9156
|
+
bold: [1, 22],
|
|
9157
|
+
dim: [2, 22],
|
|
9158
|
+
italic: [3, 23],
|
|
9159
|
+
underline: [4, 24],
|
|
9160
|
+
overline: [53, 55],
|
|
9161
|
+
inverse: [7, 27],
|
|
9162
|
+
hidden: [8, 28],
|
|
9163
|
+
strikethrough: [9, 29]
|
|
9164
|
+
},
|
|
9165
|
+
color: {
|
|
9166
|
+
black: [30, 39],
|
|
9167
|
+
red: [31, 39],
|
|
9168
|
+
green: [32, 39],
|
|
9169
|
+
yellow: [33, 39],
|
|
9170
|
+
blue: [34, 39],
|
|
9171
|
+
magenta: [35, 39],
|
|
9172
|
+
cyan: [36, 39],
|
|
9173
|
+
white: [37, 39],
|
|
9174
|
+
blackBright: [90, 39],
|
|
9175
|
+
gray: [90, 39],
|
|
9176
|
+
grey: [90, 39],
|
|
9177
|
+
redBright: [91, 39],
|
|
9178
|
+
greenBright: [92, 39],
|
|
9179
|
+
yellowBright: [93, 39],
|
|
9180
|
+
blueBright: [94, 39],
|
|
9181
|
+
magentaBright: [95, 39],
|
|
9182
|
+
cyanBright: [96, 39],
|
|
9183
|
+
whiteBright: [97, 39]
|
|
9184
|
+
},
|
|
9185
|
+
bgColor: {
|
|
9186
|
+
bgBlack: [40, 49],
|
|
9187
|
+
bgRed: [41, 49],
|
|
9188
|
+
bgGreen: [42, 49],
|
|
9189
|
+
bgYellow: [43, 49],
|
|
9190
|
+
bgBlue: [44, 49],
|
|
9191
|
+
bgMagenta: [45, 49],
|
|
9192
|
+
bgCyan: [46, 49],
|
|
9193
|
+
bgWhite: [47, 49],
|
|
9194
|
+
bgBlackBright: [100, 49],
|
|
9195
|
+
bgGray: [100, 49],
|
|
9196
|
+
bgGrey: [100, 49],
|
|
9197
|
+
bgRedBright: [101, 49],
|
|
9198
|
+
bgGreenBright: [102, 49],
|
|
9199
|
+
bgYellowBright: [103, 49],
|
|
9200
|
+
bgBlueBright: [104, 49],
|
|
9201
|
+
bgMagentaBright: [105, 49],
|
|
9202
|
+
bgCyanBright: [106, 49],
|
|
9203
|
+
bgWhiteBright: [107, 49]
|
|
9204
|
+
}
|
|
9205
|
+
};
|
|
9206
|
+
var modifierNames = Object.keys(styles.modifier);
|
|
9207
|
+
var foregroundColorNames = Object.keys(styles.color);
|
|
9208
|
+
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
9209
|
+
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
9210
|
+
function assembleStyles() {
|
|
9211
|
+
const codes = new Map;
|
|
9212
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
9213
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
9214
|
+
styles[styleName] = {
|
|
9215
|
+
open: `\x1B[${style[0]}m`,
|
|
9216
|
+
close: `\x1B[${style[1]}m`
|
|
9217
|
+
};
|
|
9218
|
+
group[styleName] = styles[styleName];
|
|
9219
|
+
codes.set(style[0], style[1]);
|
|
9179
9220
|
}
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9221
|
+
Object.defineProperty(styles, groupName, {
|
|
9222
|
+
value: group,
|
|
9223
|
+
enumerable: false
|
|
9224
|
+
});
|
|
9225
|
+
}
|
|
9226
|
+
Object.defineProperty(styles, "codes", {
|
|
9227
|
+
value: codes,
|
|
9228
|
+
enumerable: false
|
|
9229
|
+
});
|
|
9230
|
+
styles.color.close = "\x1B[39m";
|
|
9231
|
+
styles.bgColor.close = "\x1B[49m";
|
|
9232
|
+
styles.color.ansi = wrapAnsi16();
|
|
9233
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
9234
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
9235
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
9236
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
9237
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
9238
|
+
Object.defineProperties(styles, {
|
|
9239
|
+
rgbToAnsi256: {
|
|
9240
|
+
value(red, green, blue) {
|
|
9241
|
+
if (red === green && green === blue) {
|
|
9242
|
+
if (red < 8) {
|
|
9243
|
+
return 16;
|
|
9244
|
+
}
|
|
9245
|
+
if (red > 248) {
|
|
9246
|
+
return 231;
|
|
9247
|
+
}
|
|
9248
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
9249
|
+
}
|
|
9250
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
9251
|
+
},
|
|
9252
|
+
enumerable: false
|
|
9253
|
+
},
|
|
9254
|
+
hexToRgb: {
|
|
9255
|
+
value(hex) {
|
|
9256
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
9257
|
+
if (!matches) {
|
|
9258
|
+
return [0, 0, 0];
|
|
9259
|
+
}
|
|
9260
|
+
let [colorString] = matches;
|
|
9261
|
+
if (colorString.length === 3) {
|
|
9262
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
9263
|
+
}
|
|
9264
|
+
const integer = Number.parseInt(colorString, 16);
|
|
9265
|
+
return [
|
|
9266
|
+
integer >> 16 & 255,
|
|
9267
|
+
integer >> 8 & 255,
|
|
9268
|
+
integer & 255
|
|
9269
|
+
];
|
|
9270
|
+
},
|
|
9271
|
+
enumerable: false
|
|
9272
|
+
},
|
|
9273
|
+
hexToAnsi256: {
|
|
9274
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
9275
|
+
enumerable: false
|
|
9276
|
+
},
|
|
9277
|
+
ansi256ToAnsi: {
|
|
9278
|
+
value(code) {
|
|
9279
|
+
if (code < 8) {
|
|
9280
|
+
return 30 + code;
|
|
9281
|
+
}
|
|
9282
|
+
if (code < 16) {
|
|
9283
|
+
return 90 + (code - 8);
|
|
9284
|
+
}
|
|
9285
|
+
let red;
|
|
9286
|
+
let green;
|
|
9287
|
+
let blue;
|
|
9288
|
+
if (code >= 232) {
|
|
9289
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
9290
|
+
green = red;
|
|
9291
|
+
blue = red;
|
|
9192
9292
|
} else {
|
|
9193
|
-
|
|
9293
|
+
code -= 16;
|
|
9294
|
+
const remainder = code % 36;
|
|
9295
|
+
red = Math.floor(code / 36) / 5;
|
|
9296
|
+
green = Math.floor(remainder / 6) / 5;
|
|
9297
|
+
blue = remainder % 6 / 5;
|
|
9194
9298
|
}
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
if (status === Z_OK) {
|
|
9215
|
-
if (this.options.to === "string") {
|
|
9216
|
-
this.result = this.chunks.join("");
|
|
9217
|
-
} else {
|
|
9218
|
-
this.result = common.flattenChunks(this.chunks);
|
|
9299
|
+
const value = Math.max(red, green, blue) * 2;
|
|
9300
|
+
if (value === 0) {
|
|
9301
|
+
return 30;
|
|
9302
|
+
}
|
|
9303
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
9304
|
+
if (value === 2) {
|
|
9305
|
+
result += 60;
|
|
9306
|
+
}
|
|
9307
|
+
return result;
|
|
9308
|
+
},
|
|
9309
|
+
enumerable: false
|
|
9310
|
+
},
|
|
9311
|
+
rgbToAnsi: {
|
|
9312
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
9313
|
+
enumerable: false
|
|
9314
|
+
},
|
|
9315
|
+
hexToAnsi: {
|
|
9316
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
9317
|
+
enumerable: false
|
|
9219
9318
|
}
|
|
9220
|
-
}
|
|
9221
|
-
|
|
9222
|
-
this.err = status;
|
|
9223
|
-
this.msg = this.strm.msg;
|
|
9224
|
-
};
|
|
9225
|
-
function inflate$1(input, options) {
|
|
9226
|
-
const inflator = new Inflate$1(options);
|
|
9227
|
-
inflator.push(input);
|
|
9228
|
-
if (inflator.err)
|
|
9229
|
-
throw inflator.msg || messages[inflator.err];
|
|
9230
|
-
return inflator.result;
|
|
9231
|
-
}
|
|
9232
|
-
function inflateRaw$1(input, options) {
|
|
9233
|
-
options = options || {};
|
|
9234
|
-
options.raw = true;
|
|
9235
|
-
return inflate$1(input, options);
|
|
9319
|
+
});
|
|
9320
|
+
return styles;
|
|
9236
9321
|
}
|
|
9237
|
-
var
|
|
9238
|
-
var
|
|
9239
|
-
var inflateRaw_1$1 = inflateRaw$1;
|
|
9240
|
-
var ungzip$1 = inflate$1;
|
|
9241
|
-
var constants = constants$2;
|
|
9242
|
-
var inflate_1$1 = {
|
|
9243
|
-
Inflate: Inflate_1$1,
|
|
9244
|
-
inflate: inflate_2,
|
|
9245
|
-
inflateRaw: inflateRaw_1$1,
|
|
9246
|
-
ungzip: ungzip$1,
|
|
9247
|
-
constants
|
|
9248
|
-
};
|
|
9249
|
-
var { Deflate, deflate, deflateRaw, gzip } = deflate_1$1;
|
|
9250
|
-
var { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1;
|
|
9251
|
-
var Deflate_1 = Deflate;
|
|
9252
|
-
var deflate_1 = deflate;
|
|
9253
|
-
var deflateRaw_1 = deflateRaw;
|
|
9254
|
-
var gzip_1 = gzip;
|
|
9255
|
-
var Inflate_1 = Inflate;
|
|
9256
|
-
var inflate_1 = inflate;
|
|
9257
|
-
var inflateRaw_1 = inflateRaw;
|
|
9258
|
-
var ungzip_1 = ungzip;
|
|
9259
|
-
var constants_1 = constants$2;
|
|
9260
|
-
var pako = {
|
|
9261
|
-
Deflate: Deflate_1,
|
|
9262
|
-
deflate: deflate_1,
|
|
9263
|
-
deflateRaw: deflateRaw_1,
|
|
9264
|
-
gzip: gzip_1,
|
|
9265
|
-
Inflate: Inflate_1,
|
|
9266
|
-
inflate: inflate_1,
|
|
9267
|
-
inflateRaw: inflateRaw_1,
|
|
9268
|
-
ungzip: ungzip_1,
|
|
9269
|
-
constants: constants_1
|
|
9270
|
-
};
|
|
9322
|
+
var ansiStyles = assembleStyles();
|
|
9323
|
+
var ansi_styles_default = ansiStyles;
|
|
9271
9324
|
|
|
9272
|
-
|
|
9273
|
-
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9325
|
+
// node_modules/chalk/source/vendor/supports-color/index.js
|
|
9326
|
+
import process2 from "process";
|
|
9327
|
+
import os from "os";
|
|
9328
|
+
import tty from "tty";
|
|
9329
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
9330
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
9331
|
+
const position = argv.indexOf(prefix + flag);
|
|
9332
|
+
const terminatorPosition = argv.indexOf("--");
|
|
9333
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
9334
|
+
}
|
|
9335
|
+
var { env } = process2;
|
|
9336
|
+
var flagForceColor;
|
|
9337
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
9338
|
+
flagForceColor = 0;
|
|
9339
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
9340
|
+
flagForceColor = 1;
|
|
9341
|
+
}
|
|
9342
|
+
function envForceColor() {
|
|
9343
|
+
if ("FORCE_COLOR" in env) {
|
|
9344
|
+
if (env.FORCE_COLOR === "true") {
|
|
9345
|
+
return 1;
|
|
9282
9346
|
}
|
|
9283
|
-
|
|
9284
|
-
|
|
9285
|
-
if (!pVyiData)
|
|
9286
|
-
return this;
|
|
9287
|
-
try {
|
|
9288
|
-
let vyi;
|
|
9289
|
-
if (typeof pVyiData === "string") {
|
|
9290
|
-
try {
|
|
9291
|
-
vyi = JSON.parse(pVyiData);
|
|
9292
|
-
} catch (pError) {
|
|
9293
|
-
if (!pVyiData.includes(".vyr") && !pVyiData.includes(".vyi")) {
|
|
9294
|
-
vyi = pVyiData;
|
|
9295
|
-
if (!vyi) {
|
|
9296
|
-
throw new Error("Non vyi data found from binary string");
|
|
9297
|
-
}
|
|
9298
|
-
} else {
|
|
9299
|
-
try {
|
|
9300
|
-
vyi = JSON.parse(pVyiData);
|
|
9301
|
-
} catch (e) {
|
|
9302
|
-
const isNodeEnv = typeof window === "undefined";
|
|
9303
|
-
if (isNodeEnv) {
|
|
9304
|
-
vyi = this.readFileAndGetVYI(pVyiData);
|
|
9305
|
-
} else {
|
|
9306
|
-
throw new Error("Invalid string input - not valid JSON or file path");
|
|
9307
|
-
}
|
|
9308
|
-
}
|
|
9309
|
-
}
|
|
9310
|
-
}
|
|
9311
|
-
} else if (pVyiData instanceof VYI) {
|
|
9312
|
-
vyi = pVyiData.export();
|
|
9313
|
-
} else if (pVyiData instanceof Object && !Array.isArray(pVyiData) && !(pVyiData instanceof ArrayBuffer || pVyiData instanceof Uint8Array)) {
|
|
9314
|
-
vyi = pVyiData;
|
|
9315
|
-
} else if (pVyiData instanceof ArrayBuffer || pVyiData instanceof Uint8Array) {
|
|
9316
|
-
vyi = this.handleBinaryData(pVyiData);
|
|
9317
|
-
} else {
|
|
9318
|
-
throw new Error("Error processing: Invalid input type provided.");
|
|
9319
|
-
}
|
|
9320
|
-
if (!vyi || (!vyi.v || !vyi.i) && !vyi.icons) {
|
|
9321
|
-
throw new Error("Non vyi data found.");
|
|
9322
|
-
}
|
|
9323
|
-
this.processVyiData(vyi);
|
|
9324
|
-
} catch (pError) {
|
|
9325
|
-
VYI.logger.prefix("Vyi-module").error(`${pError.message}`);
|
|
9347
|
+
if (env.FORCE_COLOR === "false") {
|
|
9348
|
+
return 0;
|
|
9326
9349
|
}
|
|
9327
|
-
return
|
|
9350
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
9328
9351
|
}
|
|
9329
|
-
|
|
9330
|
-
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9352
|
+
}
|
|
9353
|
+
function translateLevel(level) {
|
|
9354
|
+
if (level === 0) {
|
|
9355
|
+
return false;
|
|
9356
|
+
}
|
|
9357
|
+
return {
|
|
9358
|
+
level,
|
|
9359
|
+
hasBasic: true,
|
|
9360
|
+
has256: level >= 2,
|
|
9361
|
+
has16m: level >= 3
|
|
9362
|
+
};
|
|
9363
|
+
}
|
|
9364
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
9365
|
+
const noFlagForceColor = envForceColor();
|
|
9366
|
+
if (noFlagForceColor !== undefined) {
|
|
9367
|
+
flagForceColor = noFlagForceColor;
|
|
9339
9368
|
}
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
return this.handleBinaryData(data);
|
|
9369
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
9370
|
+
if (forceColor === 0) {
|
|
9371
|
+
return 0;
|
|
9344
9372
|
}
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
const jsonData = await response.json();
|
|
9349
|
-
return jsonData;
|
|
9350
|
-
} catch (pError) {
|
|
9351
|
-
throw new Error(`Failed to fetch or parse JSON from URL: ${pError}`);
|
|
9373
|
+
if (sniffFlags) {
|
|
9374
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
9375
|
+
return 3;
|
|
9352
9376
|
}
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
const byteArray = pBinaryData instanceof ArrayBuffer ? new Uint8Array(pBinaryData) : pBinaryData;
|
|
9356
|
-
try {
|
|
9357
|
-
const decompressed = pako.inflate(byteArray, { to: "string" });
|
|
9358
|
-
if (!decompressed)
|
|
9359
|
-
return null;
|
|
9360
|
-
return JSON.parse(decompressed);
|
|
9361
|
-
} catch (pError) {
|
|
9362
|
-
try {
|
|
9363
|
-
const decodedText = new TextDecoder().decode(byteArray);
|
|
9364
|
-
if (!decodedText)
|
|
9365
|
-
return null;
|
|
9366
|
-
return JSON.parse(decodedText);
|
|
9367
|
-
} catch (pDecodeError) {
|
|
9368
|
-
console.error("Decoding failed:", pDecodeError);
|
|
9369
|
-
return null;
|
|
9370
|
-
}
|
|
9377
|
+
if (hasFlag("color=256")) {
|
|
9378
|
+
return 2;
|
|
9371
9379
|
}
|
|
9372
9380
|
}
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
const icons = pVyi.i || pVyi.icons;
|
|
9376
|
-
this.formatVersion = pVyi.v ?? "format not found";
|
|
9377
|
-
if (Array.isArray(icons)) {
|
|
9378
|
-
icons.forEach((pIconData) => {
|
|
9379
|
-
if (!Array.isArray(pIconData) && typeof pIconData === "object") {
|
|
9380
|
-
const convertedIconData = this.convertOldIconData(pIconData);
|
|
9381
|
-
this.addIcon(convertedIconData);
|
|
9382
|
-
} else {
|
|
9383
|
-
this.addIcon(pIconData);
|
|
9384
|
-
}
|
|
9385
|
-
});
|
|
9386
|
-
} else {
|
|
9387
|
-
VYI.logger.prefix("Vyi-module").error("Invalid .vyi file! Cannot parse icons.");
|
|
9388
|
-
}
|
|
9381
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
9382
|
+
return 1;
|
|
9389
9383
|
}
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
const states = Array.isArray(pOldData.states) ? pOldData.states.map((s) => {
|
|
9393
|
-
const stateFrames = Array.isArray(s.frames) ? s.frames.map((f) => [f.data, f.delay]) : [];
|
|
9394
|
-
return [s.name, s.data, s.delay || 100, stateFrames];
|
|
9395
|
-
}) : [];
|
|
9396
|
-
return [
|
|
9397
|
-
pOldData.name || "",
|
|
9398
|
-
pOldData.w || 32,
|
|
9399
|
-
pOldData.h || 32,
|
|
9400
|
-
pOldData.delay || 100,
|
|
9401
|
-
pOldData.data || "",
|
|
9402
|
-
frames,
|
|
9403
|
-
states
|
|
9404
|
-
];
|
|
9384
|
+
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
9385
|
+
return 0;
|
|
9405
9386
|
}
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
return;
|
|
9410
|
-
}
|
|
9411
|
-
if (!(pIconData instanceof Icon) && !Array.isArray(pIconData)) {
|
|
9412
|
-
VYI.logger.prefix("Vyi-module").error("Invalid icon data type passed!");
|
|
9413
|
-
return;
|
|
9414
|
-
}
|
|
9415
|
-
const icon = pIconData instanceof Icon ? pIconData : new Icon(pIconData);
|
|
9416
|
-
this.icons.set(icon.id, icon);
|
|
9417
|
-
icon.setVyi(this);
|
|
9418
|
-
return icon;
|
|
9387
|
+
const min = forceColor || 0;
|
|
9388
|
+
if (env.TERM === "dumb") {
|
|
9389
|
+
return min;
|
|
9419
9390
|
}
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
if (this.icons.delete(pIcon.id)) {
|
|
9425
|
-
pIcon.removeVyi();
|
|
9426
|
-
}
|
|
9391
|
+
if (process2.platform === "win32") {
|
|
9392
|
+
const osRelease = os.release().split(".");
|
|
9393
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
9394
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
9427
9395
|
}
|
|
9396
|
+
return 1;
|
|
9428
9397
|
}
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
this.removeIcon(icon);
|
|
9398
|
+
if ("CI" in env) {
|
|
9399
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env))) {
|
|
9400
|
+
return 3;
|
|
9433
9401
|
}
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
const icon = this.getIconById(pId);
|
|
9437
|
-
if (icon) {
|
|
9438
|
-
this.removeIcon(icon);
|
|
9402
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env)) || env.CI_NAME === "codeship") {
|
|
9403
|
+
return 1;
|
|
9439
9404
|
}
|
|
9405
|
+
return min;
|
|
9440
9406
|
}
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
return iconNames;
|
|
9407
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
9408
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
9444
9409
|
}
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
const icons = this.getIcons();
|
|
9448
|
-
for (let i = icons.length - 1;i >= 0; i--) {
|
|
9449
|
-
const icon = icons[i];
|
|
9450
|
-
if (icon.getName() === pName) {
|
|
9451
|
-
return icon;
|
|
9452
|
-
}
|
|
9453
|
-
}
|
|
9454
|
-
} else {
|
|
9455
|
-
VYI.logger.prefix("Vyi-module").error("Invalid name type used!");
|
|
9456
|
-
}
|
|
9410
|
+
if (env.COLORTERM === "truecolor") {
|
|
9411
|
+
return 3;
|
|
9457
9412
|
}
|
|
9458
|
-
|
|
9459
|
-
return
|
|
9413
|
+
if (env.TERM === "xterm-kitty") {
|
|
9414
|
+
return 3;
|
|
9460
9415
|
}
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
return;
|
|
9464
|
-
const icon = this.icons.get(pId) || this.getIcons().find((pIcon) => pIcon.states.has(pId))?.getStateById(pId);
|
|
9465
|
-
return icon;
|
|
9416
|
+
if (env.TERM === "xterm-ghostty") {
|
|
9417
|
+
return 3;
|
|
9466
9418
|
}
|
|
9467
|
-
|
|
9468
|
-
return
|
|
9419
|
+
if (env.TERM === "wezterm") {
|
|
9420
|
+
return 3;
|
|
9469
9421
|
}
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9422
|
+
if ("TERM_PROGRAM" in env) {
|
|
9423
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
9424
|
+
switch (env.TERM_PROGRAM) {
|
|
9425
|
+
case "iTerm.app": {
|
|
9426
|
+
return version >= 3 ? 3 : 2;
|
|
9427
|
+
}
|
|
9428
|
+
case "Apple_Terminal": {
|
|
9429
|
+
return 2;
|
|
9430
|
+
}
|
|
9475
9431
|
}
|
|
9476
9432
|
}
|
|
9477
|
-
|
|
9478
|
-
return
|
|
9433
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
9434
|
+
return 2;
|
|
9479
9435
|
}
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
if (pCompressed) {
|
|
9486
|
-
const binaryData = new TextEncoder().encode(JSON.stringify(vyi));
|
|
9487
|
-
const compressed = pako.deflate(binaryData);
|
|
9488
|
-
return compressed;
|
|
9489
|
-
}
|
|
9490
|
-
return vyi;
|
|
9436
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
9437
|
+
return 1;
|
|
9438
|
+
}
|
|
9439
|
+
if ("COLORTERM" in env) {
|
|
9440
|
+
return 1;
|
|
9491
9441
|
}
|
|
9442
|
+
return min;
|
|
9443
|
+
}
|
|
9444
|
+
function createSupportsColor(stream, options = {}) {
|
|
9445
|
+
const level = _supportsColor(stream, {
|
|
9446
|
+
streamIsTTY: stream && stream.isTTY,
|
|
9447
|
+
...options
|
|
9448
|
+
});
|
|
9449
|
+
return translateLevel(level);
|
|
9450
|
+
}
|
|
9451
|
+
var supportsColor = {
|
|
9452
|
+
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
9453
|
+
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
9454
|
+
};
|
|
9455
|
+
var supports_color_default = supportsColor;
|
|
9456
|
+
|
|
9457
|
+
// node_modules/chalk/source/utilities.js
|
|
9458
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
9459
|
+
let index = string.indexOf(substring);
|
|
9460
|
+
if (index === -1) {
|
|
9461
|
+
return string;
|
|
9462
|
+
}
|
|
9463
|
+
const substringLength = substring.length;
|
|
9464
|
+
let endIndex = 0;
|
|
9465
|
+
let returnValue = "";
|
|
9466
|
+
do {
|
|
9467
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
9468
|
+
endIndex = index + substringLength;
|
|
9469
|
+
index = string.indexOf(substring, endIndex);
|
|
9470
|
+
} while (index !== -1);
|
|
9471
|
+
returnValue += string.slice(endIndex);
|
|
9472
|
+
return returnValue;
|
|
9473
|
+
}
|
|
9474
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
9475
|
+
let endIndex = 0;
|
|
9476
|
+
let returnValue = "";
|
|
9477
|
+
do {
|
|
9478
|
+
const gotCR = string[index - 1] === "\r";
|
|
9479
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
|
|
9480
|
+
` : `
|
|
9481
|
+
`) + postfix;
|
|
9482
|
+
endIndex = index + 1;
|
|
9483
|
+
index = string.indexOf(`
|
|
9484
|
+
`, endIndex);
|
|
9485
|
+
} while (index !== -1);
|
|
9486
|
+
returnValue += string.slice(endIndex);
|
|
9487
|
+
return returnValue;
|
|
9492
9488
|
}
|
|
9493
|
-
var WORKER_CODE = `/*!
|
|
9494
|
-
* vyi@4.1.0 https://github.com/EvitcaStudio/vyi
|
|
9495
|
-
* Compiled Sun, 21 Jun 2026 10:57:24 UTC
|
|
9496
|
-
* Copyright (c) 2026 Evitca Studio, "doubleactii"
|
|
9497
|
-
*
|
|
9498
|
-
* vyi is privately licensed.
|
|
9499
|
-
*/
|
|
9500
|
-
var a0=((Q)=>typeof require!=="undefined"?require:typeof Proxy!=="undefined"?new Proxy(Q,{get:(W,J)=>(typeof require!=="undefined"?require:W)[J]}):Q)(function(Q){if(typeof require!=="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+Q+'" is not supported')});/*!
|
|
9501
|
-
* logger@1.0.0 https://github.com/EvitcaStudio/Logger
|
|
9502
|
-
* Compiled Mon, 10 Nov 2025 05:36:23 UTC
|
|
9503
|
-
* Copyright (c) 2025 Evitca Studio, "doubleactii"
|
|
9504
|
-
*
|
|
9505
|
-
* logger is privately licensed.
|
|
9506
|
-
*/class eQ{RESET;BRIGHT;DIM;UNDERSCORE;BLINK;REVERSE;HIDDEN;FG_BLACK;FG_RED;FG_GREEN;FG_YELLOW;FG_BLUE;FG_MAGENTA;FG_CYAN;FG_WHITE;FG_GRAY;BG_BLACK;BG_RED;BG_GREEN;BG_YELLOW;BG_BLUE;BG_MAGENTA;BG_CYAN;BG_WHITE;BG_GRAY;TYPE_SPACER_LENGTH;types;currentType;SPACE_CHAR;FG_COLORS;BG_COLORS;constructor(Q){this.RESET="\\x1B[0m",this.BRIGHT="\\x1B[1m",this.DIM="\\x1B[2m",this.UNDERSCORE="\\x1B[4m",this.BLINK="\\x1B[5m",this.REVERSE="\\x1B[7m",this.HIDDEN="\\x1B[8m",this.FG_BLACK="\\x1B[30m",this.FG_RED="\\x1B[31m",this.FG_GREEN="\\x1B[32m",this.FG_YELLOW="\\x1B[33m",this.FG_BLUE="\\x1B[34m",this.FG_MAGENTA="\\x1B[35m",this.FG_CYAN="\\x1B[36m",this.FG_WHITE="\\x1B[37m",this.FG_GRAY="\\x1B[90m",this.BG_BLACK="\\x1B[40m",this.BG_RED="\\x1B[41m",this.BG_GREEN="\\x1B[42m",this.BG_YELLOW="\\x1B[43m",this.BG_BLUE="\\x1B[44m",this.BG_MAGENTA="\\x1B[45m",this.BG_CYAN="\\x1B[46m",this.BG_WHITE="\\x1B[47m",this.BG_GRAY="\\x1B[100m",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let W=0;W<=255;W++)this.FG_COLORS[W]="\\x1B[38;5;"+W+"m";this.BG_COLORS={};for(let W=0;W<=255;W++)this.BG_COLORS[W]="\\x1B[48;5;"+W+"m";if(Array.isArray(Q))this.registerTypes(Q)}prefix(Q){if(typeof Q==="string")this.currentType=Q;return this}message(Q="log",...W){let J=this.currentType?this.currentType:"";if(J.length===0)console[Q](...W);else{let G=J.length>=this.TYPE_SPACER_LENGTH,q=this.types[J.toLowerCase()]?this.types[J.toLowerCase()]:this.types.default,z=q.includes("\\x1B");if(!z)q=\`color: \${q}\`;if(typeof globalThis.window!=="undefined")if(z)console[Q](q+J+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-J.length,G?1:0))+"|"+this.RESET,...W);else console[Q]("%c"+J+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-J.length,G?1:0))+"|",q,...W);else console[Q](q+J+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-J.length,G?1:0))+"|"+this.RESET,...W)}this.currentType=""}log(...Q){this.message("log",...Q)}info(...Q){this.message("info",...Q)}error(...Q){this.message("error",...Q)}warn(...Q){this.message("warn",...Q)}assert(...Q){console.assert(...Q)}debug(...Q){this.message("debug",...Q)}count(Q){console.count(Q)}countReset(Q){console.countReset(Q)}table(Q,W){console.table(Q,W)}time(Q="default"){this.message("time",Q)}timeLog(Q="default",...W){this.message("timeLog",Q,...W)}timeEnd(Q="default"){this.message("timeEnd",Q)}trace(...Q){this.message("trace",...Q)}group(Q=""){this.message("group",Q)}groupCollapsed(Q=""){this.message("groupCollapsed",Q)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(Q,W){if(this.types[Q.toLowerCase()])return;if(typeof Q==="string"&&typeof W==="string")this.types[Q.toLowerCase()]=W}registerTypes(Q){if(Array.isArray(Q))for(let W=0;W<Q.length;W++)this.registerType(Q[W].type,Q[W].ansi)}unregisterType(Q){let W=Q.toLowerCase();if(this.types[W])delete this.types[W]}}class n{delay=100;dataURL="";index=0;parent=null;static defaultDelay=100;constructor(Q){if(Q)this.parse(Q)}parse(Q){if(!Q)return;let W=Q[0],J=Q[1]?Q[1]:this.parent?this.parent.getDelay():null;if(this.setDataURL(W),J)this.setDelay(J)}setParent(Q){if(!Q||this.parent)return;if(Q instanceof T){if(this.parent=Q,!this.getDelay())this.setDelay(this.parent.getDelay())}}removeParent(){this.parent=null}setDelay(Q){if(typeof Q==="number")this.delay=Q;else w.logger.prefix("Vyi-module").error("Invalid delay type!");return this}getDelay(){return this.delay}getIndex(){return this.index}setDataURL(Q){if(typeof Q==="string")this.dataURL=Q.replace(/^data:image\\/[a-z]+;base64,/,"");else w.logger.prefix("Vyi-module").error("Invalid data url type!");return this}getDataURL(){return this.dataURL}getWidth(){if(!this.parent)return;return this.parent.width}getHeight(){if(!this.parent)return;return this.parent.height}getSize(){if(!this.parent)return;return{width:this.parent.width,height:this.parent.height}}getVyi(){return this?.parent?.vyi}getParent(){return this.parent}export(){let Q=[this.getDataURL()];if(this.getDelay()!==n.defaultDelay)Q[1]=this.getDelay()||n.defaultDelay;return Q}}/*!
|
|
9507
|
-
* icon-point@2.1.0 https://github.com/EvitcaStudio/IconPoint
|
|
9508
|
-
* Compiled Mon, 10 Nov 2025 09:52:21 UTC
|
|
9509
|
-
* Copyright (c) 2025 Evitca Studio, "doubleactii"
|
|
9510
|
-
*
|
|
9511
|
-
* icon-point is privately licensed.
|
|
9512
|
-
*//*!
|
|
9513
|
-
* logger@1.0.0 https://github.com/EvitcaStudio/Logger
|
|
9514
|
-
* Compiled Mon, 10 Nov 2025 05:36:23 UTC
|
|
9515
|
-
* Copyright (c) 2025 Evitca Studio, "doubleactii"
|
|
9516
|
-
*
|
|
9517
|
-
* logger is privately licensed.
|
|
9518
|
-
*/class SJ{RESET;BRIGHT;DIM;UNDERSCORE;BLINK;REVERSE;HIDDEN;FG_BLACK;FG_RED;FG_GREEN;FG_YELLOW;FG_BLUE;FG_MAGENTA;FG_CYAN;FG_WHITE;FG_GRAY;BG_BLACK;BG_RED;BG_GREEN;BG_YELLOW;BG_BLUE;BG_MAGENTA;BG_CYAN;BG_WHITE;BG_GRAY;TYPE_SPACER_LENGTH;types;currentType;SPACE_CHAR;FG_COLORS;BG_COLORS;constructor(Q){this.RESET="\\x1B[0m",this.BRIGHT="\\x1B[1m",this.DIM="\\x1B[2m",this.UNDERSCORE="\\x1B[4m",this.BLINK="\\x1B[5m",this.REVERSE="\\x1B[7m",this.HIDDEN="\\x1B[8m",this.FG_BLACK="\\x1B[30m",this.FG_RED="\\x1B[31m",this.FG_GREEN="\\x1B[32m",this.FG_YELLOW="\\x1B[33m",this.FG_BLUE="\\x1B[34m",this.FG_MAGENTA="\\x1B[35m",this.FG_CYAN="\\x1B[36m",this.FG_WHITE="\\x1B[37m",this.FG_GRAY="\\x1B[90m",this.BG_BLACK="\\x1B[40m",this.BG_RED="\\x1B[41m",this.BG_GREEN="\\x1B[42m",this.BG_YELLOW="\\x1B[43m",this.BG_BLUE="\\x1B[44m",this.BG_MAGENTA="\\x1B[45m",this.BG_CYAN="\\x1B[46m",this.BG_WHITE="\\x1B[47m",this.BG_GRAY="\\x1B[100m",this.TYPE_SPACER_LENGTH=13,this.types={default:this.FG_WHITE},this.currentType="",this.SPACE_CHAR=" ",this.FG_COLORS={};for(let W=0;W<=255;W++)this.FG_COLORS[W]="\\x1B[38;5;"+W+"m";this.BG_COLORS={};for(let W=0;W<=255;W++)this.BG_COLORS[W]="\\x1B[48;5;"+W+"m";if(Array.isArray(Q))this.registerTypes(Q)}prefix(Q){if(typeof Q==="string")this.currentType=Q;return this}message(Q="log",...W){let J=this.currentType?this.currentType:"";if(J.length===0)console[Q](...W);else{let G=J.length>=this.TYPE_SPACER_LENGTH,q=this.types[J.toLowerCase()]?this.types[J.toLowerCase()]:this.types.default,z=q.includes("\\x1B");if(!z)q=\`color: \${q}\`;if(typeof globalThis.window!=="undefined")if(z)console[Q](q+J+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-J.length,G?1:0))+"|"+this.RESET,...W);else console[Q]("%c"+J+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-J.length,G?1:0))+"|",q,...W);else console[Q](q+J+this.SPACE_CHAR.repeat(Math.max(this.TYPE_SPACER_LENGTH-J.length,G?1:0))+"|"+this.RESET,...W)}this.currentType=""}log(...Q){this.message("log",...Q)}info(...Q){this.message("info",...Q)}error(...Q){this.message("error",...Q)}warn(...Q){this.message("warn",...Q)}assert(...Q){console.assert(...Q)}debug(...Q){this.message("debug",...Q)}count(Q){console.count(Q)}countReset(Q){console.countReset(Q)}table(Q,W){console.table(Q,W)}time(Q="default"){this.message("time",Q)}timeLog(Q="default",...W){this.message("timeLog",Q,...W)}timeEnd(Q="default"){this.message("timeEnd",Q)}trace(...Q){this.message("trace",...Q)}group(Q=""){this.message("group",Q)}groupCollapsed(Q=""){this.message("groupCollapsed",Q)}groupEnd(){console.groupEnd()}clear(){console.clear()}registerType(Q,W){if(this.types[Q.toLowerCase()])return;if(typeof Q==="string"&&typeof W==="string")this.types[Q.toLowerCase()]=W}registerTypes(Q){if(Array.isArray(Q))for(let W=0;W<Q.length;W++)this.registerType(Q[W].type,Q[W].ansi)}unregisterType(Q){let W=Q.toLowerCase();if(this.types[W])delete this.types[W]}}class E{static defaultOffset={x:0,y:0};static defaultAnchor={x:0.5,y:0.5};static version="2.1.0";static logger=new SJ;iconPoint={x:0,y:0};originalPoint={x:0,y:0};positionalPoint;point={x:0,y:0};bounds={width:32,height:32};id;constructor(Q,W,J,j){let{width:G,height:q}=W;this.bounds.width=G,this.bounds.height=q,this.positionalPoint=Q,this.originalPoint={...J},this.id=j||"",E.logger.registerType("IconPointModule","#ff6600"),this.setPoint(J)}getPoint(Q=0,W=E.defaultOffset,J=E.defaultAnchor){let j=this.positionalPoint.x+W.x+this.bounds.width*J.x,G=this.positionalPoint.y+W.y+this.bounds.height*J.y,q=this.positionalPoint.x+W.x-1+this.iconPoint.x,z=this.positionalPoint.y+W.y-1+this.iconPoint.y,U=q-j,Y=z-G,X=U*Math.cos(Q)-Y*-Math.sin(Q),K=U*-Math.sin(Q)+Y*Math.cos(Q),P=X+j,k=K+G;return this.point.x=P,this.point.y=k,this.point}getPointFromExternalPoint(Q,W=0,J=E.defaultOffset,j=E.defaultAnchor){let G=Q.x+J.x+this.bounds.width*j.x,q=Q.y+J.y+this.bounds.height*j.y,z=Q.x+J.x-1+this.iconPoint.x,U=Q.y+J.y-1+this.iconPoint.y,Y=z-G,X=U-q,K=Y*Math.cos(W)-X*-Math.sin(W),P=Y*-Math.sin(W)+X*Math.cos(W),k=K+G,V=P+q;return this.point.x=k,this.point.y=V,this.point}setPoint(Q){let{x:W,y:J,isNormalized:j}=Q;this.iconPoint.x=j?W*this.bounds.width:W,this.iconPoint.y=j?J*this.bounds.height:J}resetPoint(){this.setPoint(this.originalPoint)}updateBounds(Q){let{width:W,height:J}=Q;this.bounds.width=W,this.bounds.height=J}transformX(Q){let W=Math.abs(Q*this.bounds.width);this.iconPoint.x=W-this.originalPoint.x}transformY(Q){let W=Math.abs(Q*this.bounds.height);this.iconPoint.y=W-this.originalPoint.y}transform(Q){this.transformX(Q.x),this.transformY(Q.y)}getId(){return this.id}export(){return{...this.bounds,...this.iconPoint,id:this.id}}}class tQ{bounds={};add(Q,W){this.bounds[Q]=W}remove(Q){delete this.bounds[Q]}update(Q,W){if(this.bounds[Q])this.bounds[Q]={...this.bounds[Q],...W}}rename(Q,W){if(this.bounds[Q])this.bounds[W]=this.bounds[Q],delete this.bounds[Q]}get(Q){return this.bounds[Q]}getAll(){return{...this.bounds}}getIdsByShape(Q){return Object.keys(this.bounds).filter((W)=>this.bounds[W].type===Q)}exportAll(){return this.getAll()}clearAll(){this.bounds={}}loadBounds(Q){this.clearAll(),Object.entries(Q).forEach(([W,J])=>{this.add(W,J)})}}class T{states=new Map;frames=new Map;width=32;height=32;dataURL="";delay=100;name="";parent=null;vyi=null;id="";static reservedIds=new Set;iconPoints=new Set;boundsManager=new tQ;static reservedIconPointIds=new Set(["center","top-left","top-right","bottom-left","bottom-right","top-middle","bottom-middle","left-middle","right-middle"]);static generateId(){let Q=()=>{return Math.floor(Math.random()*4294967295).toString(16).padStart(8,"0")},W=Q();while(this.reservedIds.has(W))W=Q();return this.reservedIds.add(W),W}constructor(Q){if(Q)this.parse(Q);this.assignId()}setParent(Q){if(!Q||this.parent)return;if(Q instanceof T)this.parent=Q}removeParent(){if(this.parent)this.parent=null,this.vyi=null}setVyi(Q){if(!Q)return;if(Q instanceof w){if(this.vyi=Q,this.getStateCount()>0)this.getStates().forEach((j)=>{j.setParent(this),j.setVyi(Q)});this.getFrames().forEach((J)=>J.setParent(this))}}removeVyi(){this.vyi=null}assignId(){this.id=T.generateId()}getId(){return this.id}getVyi(){return this.vyi}getParent(){return this.parent}getStateCount(){return this.states.size}getFrameCount(){return this.frames.size}parse(Q){if(!Q)return;let W=Q[0],J=Q[1],j=Q[2],G=Q[3],q=Q[4],z=Q[5],U=Q[6],Y=Q[7],X=Q[8];if(this.rename(W),this.setSize(J,j),this.setDelay(G),this.setDataURL(q),Array.isArray(z))z.forEach((K)=>{this.addFrame(K)});if(Array.isArray(U))U.forEach((K)=>{let P=new T(void 0),k=K[0],V=K[1],Z=K[2],M=K[3],$=K[4];if(P.rename(k),P.setSize(J,j),P.setDelay(Z),P.setDataURL(V),Array.isArray(M))M.forEach((C)=>{P.addFrame(C)});if($&&typeof $==="object")P.boundsManager.loadBounds($);this.addState(P)});if(Array.isArray(Y))Y.forEach((K)=>{let{x:P,y:k,width:V,height:Z,id:M}=K;if(T.reservedIconPointIds.has(M))return;this.addIconPoint({x:0,y:0},{width:V,height:Z},{x:P,y:k},M)});if(X&&typeof X==="object")this.boundsManager.loadBounds(X);this.resetInitialIconPoints()}resetInitialIconPoints(){let Q=this.getWidth(),W=this.getHeight();Array.from(T.reservedIconPointIds).forEach((k)=>{let V=Array.from(this.iconPoints).find((Z)=>Z.getId()===k);if(!V)return;this.iconPoints.delete(V)});let J={x:1,y:1},j=new E(J,{width:Q,height:W},{x:Math.round(Q/2),y:Math.round(W/2)},"center"),G=new E(J,{width:Q,height:W},{x:1,y:1},"top-left"),q=new E(J,{width:Q,height:W},{x:Q,y:1},"top-right"),z=new E(J,{width:Q,height:W},{x:1,y:W},"bottom-left"),U=new E(J,{width:Q,height:W},{x:Q,y:W},"bottom-right"),Y=new E(J,{width:Q,height:W},{x:Math.round(Q/2),y:1},"top-middle"),X=new E(J,{width:Q,height:W},{x:Math.round(Q/2),y:W},"bottom-middle"),K=new E(J,{width:Q,height:W},{x:1,y:Math.round(W/2)},"left-middle"),P=new E(J,{width:Q,height:W},{x:Q,y:Math.round(W/2)},"right-middle");this.iconPoints.add(j),this.iconPoints.add(G),this.iconPoints.add(q),this.iconPoints.add(z),this.iconPoints.add(U),this.iconPoints.add(Y),this.iconPoints.add(X),this.iconPoints.add(K),this.iconPoints.add(P)}addIconPoint(Q,W,J,j){if(T.reservedIconPointIds.has(j)){w.logger.prefix("Vyi-module").error(\`The id \${j} is reserved and cannot be used for additional icon points.\`);return}let G=new E(Q,W,J,j);return this.iconPoints.add(G),G}removeIconPoint(Q){for(let W of this.iconPoints)if(W.getId()===Q&&!T.reservedIconPointIds.has(Q)){this.iconPoints.delete(W);break}}getIconPointExportById(Q){for(let W of this.iconPoints)if(W.getId()===Q)return W.export();return}getIconPointsExport(){let Q=[];return this.iconPoints.forEach((W)=>Q.push(W.export())),Q}getIconPointById(Q){for(let W of this.iconPoints)if(W.getId()===Q)return W;return}getIconPoints(){let Q=[];return this.iconPoints.forEach((W)=>Q.push(W)),Q}getBoundsExport(){return this.boundsManager.exportAll()}getBoundsById(Q){return this.boundsManager.get(Q)}getIdsByShape(Q){return this.boundsManager.getIdsByShape(Q)}setBounds(Q,W){return this.boundsManager.add(Q,W),this}removeBounds(Q){return this.boundsManager.remove(Q),this}updateBounds(Q,W){return this.boundsManager.update(Q,W),this}setSize(Q,W){if(typeof Q==="number")this.width=Q;if(typeof W==="number")this.height=W;return this}getWidth(){return this.width}getHeight(){return this.height}getSize(){return{width:this.width,height:this.height}}setDataURL(Q){if(typeof Q==="string")this.dataURL=Q.replace(/^data:image\\/[a-z]+;base64,/,"");else w.logger.prefix("Vyi-module").error("Invalid data url type!");return this}getDataURL(){return this.dataURL}setDelay(Q){if(typeof Q==="number")this.delay=Q;else w.logger.prefix("Vyi-module").error("Invalid delay type!");return this}getDelay(){return this.delay}rename(Q){if(typeof Q==="string")try{this.name=decodeURIComponent(Q)}catch{this.name=Q}else w.logger.prefix("Vyi-module").error("Invalid type for pName!");return this}getName(){return this.name}setAllFrameDelays(Q){if(typeof Q==="number")this.setDelay(Q),this.getFrames().forEach((W)=>W.setDelay(Q));else w.logger.prefix("Vyi-module").error("Invalid type for pDelay!");return this}addFrame(Q){if(!Q){w.logger.prefix("Vyi-module").error("No frame data passed!");return}if(!(Q instanceof n)&&!Array.isArray(Q)){w.logger.prefix("Vyi-module").error("Invalid frame data type passed!");return}let W=Q instanceof n?Q:new n(Q);return W.setParent(this),this.frames.set(this.frames.size,W),this.indexFrames(),W}removeFrame(Q){if(!Q)return this;if(Q instanceof n){if(this.frames.delete(Q.index))Q.removeParent(),this.indexFrames()}return this}removeFrameByIndex(Q){let W=this.getFrame(Q);if(W)this.removeFrame(W);return this}indexFrames(){let Q=this.getFrames();this.frames.clear(),Q.forEach((W,J)=>{W.index=J,this.frames.set(J,W)})}reorderFrame(Q,W){if(typeof Q==="number"&&typeof W==="number"){let J=this.getFrame(W),j=Q===-1?this:this.getFrame(Q);if(j&&J){let G=j.getDataURL(),q=j.getDelay(),z=J.getDataURL(),U=J.getDelay();j.setDataURL(z),j.setDelay(U),J.setDataURL(G),J.setDelay(q)}else w.logger.prefix("Vyi-module").error("There was no frame found at pCurrentIndex, or there was no frame found at pIndex!")}else w.logger.prefix("Vyi-module").error("Invalid type used!");return this}getFrame(Q){return this.frames.get(Q)}getFrames(){return Array.from(this.frames.values())}getFramesData(){return this.getFrames().map((W)=>W.export())}addState(Q){if(!Q){w.logger.prefix("Vyi-module").error("No icon data passed!");return}if(!(Q instanceof T)&&!Array.isArray(Q)){w.logger.prefix("Vyi-module").error("Invalid icon data type passed!");return}let W=Q instanceof T?Q:new T(this.convertStateDataToIconData(Q));if(W.getWidth()!==this.getWidth()||W.getHeight()!==this.getHeight()){w.logger.prefix("Vyi-module").error("State dimensions do not match parent!");return}if(W.setParent(this),this.vyi)W.setVyi(this.vyi);return this.states.set(W.id,W),W}removeState(Q){if(Q instanceof T){if(this.states.delete(Q.id))Q.removeParent()}return this}removeStateByName(Q){let W=this.getState(Q);if(W)this.removeState(W);return this}removeStateById(Q){let W=this.getStateById(Q);if(W)this.removeState(W);return this}getState(Q){if(typeof Q==="string"){let W=this.getStates();for(let J=W.length-1;J>=0;J--){let j=W[J];if(j.getName()===Q)return j}return}else{w.logger.prefix("Vyi-module").error("Invalid name type used!");return}}getStateById(Q){if(!Q)return;return this.states.get(Q)}getStates(){return Array.from(this.states.values())}getStateNames(){return this.getStates().map((Q)=>Q.getName())}getStatesData(){return this.getStates().map((W)=>W.exportAsState())}exportAsState(){let Q=[this.getName(),this.getDataURL(),this.getDelay(),this.getFrames().map((J)=>J.export())],W=this.getBoundsExport();if(Object.keys(W).length>0)Q[4]=W;return Q}convertStateDataToIconData(Q){return[Q[0],this.getWidth(),this.getHeight(),Q[2],Q[1],Q[3]]}export(){let Q=[this.getName(),this.getWidth(),this.getHeight(),this.getDelay(),this.getDataURL(),this.getFramesData()];if(this.states.size>0)Q[6]=this.getStatesData();return Q[7]=this.getIconPointsExport(),Q[8]=this.getBoundsExport(),Q}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function HQ(Q){let W=Q.length;while(--W>=0)Q[W]=0}var e0=0,H0=1,t0=2,s0=3,Q5=258,vJ=29,yQ=256,RQ=yQ+1+vJ,YQ=30,gJ=19,P0=2*RQ+1,WQ=15,sQ=16,J5=7,RJ=256,B0=16,C0=17,$0=18,FJ=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),pQ=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),W5=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),L0=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),j5=512,r=new Array((RQ+2)*2);HQ(r);var NQ=new Array(YQ*2);HQ(NQ);var xQ=new Array(j5);HQ(xQ);var OQ=new Array(Q5-s0+1);HQ(OQ);var xJ=new Array(vJ);HQ(xJ);var lQ=new Array(YQ);HQ(lQ);function QJ(Q,W,J,j,G){this.static_tree=Q,this.extra_bits=W,this.extra_base=J,this.elems=j,this.max_length=G,this.has_stree=Q&&Q.length}var N0,v0,g0;function JJ(Q,W){this.dyn_tree=Q,this.max_code=0,this.stat_desc=W}var R0=(Q)=>{return Q<256?xQ[Q]:xQ[256+(Q>>>7)]},MQ=(Q,W)=>{Q.pending_buf[Q.pending++]=W&255,Q.pending_buf[Q.pending++]=W>>>8&255},f=(Q,W,J)=>{if(Q.bi_valid>sQ-J)Q.bi_buf|=W<<Q.bi_valid&65535,MQ(Q,Q.bi_buf),Q.bi_buf=W>>sQ-Q.bi_valid,Q.bi_valid+=J-sQ;else Q.bi_buf|=W<<Q.bi_valid&65535,Q.bi_valid+=J},p=(Q,W,J)=>{f(Q,J[W*2],J[W*2+1])},x0=(Q,W)=>{let J=0;do J|=Q&1,Q>>>=1,J<<=1;while(--W>0);return J>>>1},q5=(Q)=>{if(Q.bi_valid===16)MQ(Q,Q.bi_buf),Q.bi_buf=0,Q.bi_valid=0;else if(Q.bi_valid>=8)Q.pending_buf[Q.pending++]=Q.bi_buf&255,Q.bi_buf>>=8,Q.bi_valid-=8},G5=(Q,W)=>{let{dyn_tree:J,max_code:j}=W,G=W.stat_desc.static_tree,q=W.stat_desc.has_stree,z=W.stat_desc.extra_bits,U=W.stat_desc.extra_base,Y=W.stat_desc.max_length,X,K,P,k,V,Z,M=0;for(k=0;k<=WQ;k++)Q.bl_count[k]=0;J[Q.heap[Q.heap_max]*2+1]=0;for(X=Q.heap_max+1;X<P0;X++){if(K=Q.heap[X],k=J[J[K*2+1]*2+1]+1,k>Y)k=Y,M++;if(J[K*2+1]=k,K>j)continue;if(Q.bl_count[k]++,V=0,K>=U)V=z[K-U];if(Z=J[K*2],Q.opt_len+=Z*(k+V),q)Q.static_len+=Z*(G[K*2+1]+V)}if(M===0)return;do{k=Y-1;while(Q.bl_count[k]===0)k--;Q.bl_count[k]--,Q.bl_count[k+1]+=2,Q.bl_count[Y]--,M-=2}while(M>0);for(k=Y;k!==0;k--){K=Q.bl_count[k];while(K!==0){if(P=Q.heap[--X],P>j)continue;if(J[P*2+1]!==k)Q.opt_len+=(k-J[P*2+1])*J[P*2],J[P*2+1]=k;K--}}},O0=(Q,W,J)=>{let j=new Array(WQ+1),G=0,q,z;for(q=1;q<=WQ;q++)G=G+J[q-1]<<1,j[q]=G;for(z=0;z<=W;z++){let U=Q[z*2+1];if(U===0)continue;Q[z*2]=x0(j[U]++,U)}},X5=()=>{let Q,W,J,j,G,q=new Array(WQ+1);J=0;for(j=0;j<vJ-1;j++){xJ[j]=J;for(Q=0;Q<1<<FJ[j];Q++)OQ[J++]=j}OQ[J-1]=j,G=0;for(j=0;j<16;j++){lQ[j]=G;for(Q=0;Q<1<<pQ[j];Q++)xQ[G++]=j}G>>=7;for(;j<YQ;j++){lQ[j]=G<<7;for(Q=0;Q<1<<pQ[j]-7;Q++)xQ[256+G++]=j}for(W=0;W<=WQ;W++)q[W]=0;Q=0;while(Q<=143)r[Q*2+1]=8,Q++,q[8]++;while(Q<=255)r[Q*2+1]=9,Q++,q[9]++;while(Q<=279)r[Q*2+1]=7,Q++,q[7]++;while(Q<=287)r[Q*2+1]=8,Q++,q[8]++;O0(r,RQ+1,q);for(Q=0;Q<YQ;Q++)NQ[Q*2+1]=5,NQ[Q*2]=x0(Q,5);N0=new QJ(r,FJ,yQ+1,RQ,WQ),v0=new QJ(NQ,pQ,0,YQ,WQ),g0=new QJ(new Array(0),W5,0,gJ,J5)},M0=(Q)=>{let W;for(W=0;W<RQ;W++)Q.dyn_ltree[W*2]=0;for(W=0;W<YQ;W++)Q.dyn_dtree[W*2]=0;for(W=0;W<gJ;W++)Q.bl_tree[W*2]=0;Q.dyn_ltree[RJ*2]=1,Q.opt_len=Q.static_len=0,Q.sym_next=Q.matches=0},w0=(Q)=>{if(Q.bi_valid>8)MQ(Q,Q.bi_buf);else if(Q.bi_valid>0)Q.pending_buf[Q.pending++]=Q.bi_buf;Q.bi_buf=0,Q.bi_valid=0},TJ=(Q,W,J,j)=>{let G=W*2,q=J*2;return Q[G]<Q[q]||Q[G]===Q[q]&&j[W]<=j[J]},WJ=(Q,W,J)=>{let j=Q.heap[J],G=J<<1;while(G<=Q.heap_len){if(G<Q.heap_len&&TJ(W,Q.heap[G+1],Q.heap[G],Q.depth))G++;if(TJ(W,j,Q.heap[G],Q.depth))break;Q.heap[J]=Q.heap[G],J=G,G<<=1}Q.heap[J]=j},yJ=(Q,W,J)=>{let j,G,q=0,z,U;if(Q.sym_next!==0)do if(j=Q.pending_buf[Q.sym_buf+q++]&255,j+=(Q.pending_buf[Q.sym_buf+q++]&255)<<8,G=Q.pending_buf[Q.sym_buf+q++],j===0)p(Q,G,W);else{if(z=OQ[G],p(Q,z+yQ+1,W),U=FJ[z],U!==0)G-=xJ[z],f(Q,G,U);if(j--,z=R0(j),p(Q,z,J),U=pQ[z],U!==0)j-=lQ[z],f(Q,j,U)}while(q<Q.sym_next);p(Q,RJ,W)},ZJ=(Q,W)=>{let J=W.dyn_tree,j=W.stat_desc.static_tree,G=W.stat_desc.has_stree,q=W.stat_desc.elems,z,U,Y=-1,X;Q.heap_len=0,Q.heap_max=P0;for(z=0;z<q;z++)if(J[z*2]!==0)Q.heap[++Q.heap_len]=Y=z,Q.depth[z]=0;else J[z*2+1]=0;while(Q.heap_len<2)if(X=Q.heap[++Q.heap_len]=Y<2?++Y:0,J[X*2]=1,Q.depth[X]=0,Q.opt_len--,G)Q.static_len-=j[X*2+1];W.max_code=Y;for(z=Q.heap_len>>1;z>=1;z--)WJ(Q,J,z);X=q;do z=Q.heap[1],Q.heap[1]=Q.heap[Q.heap_len--],WJ(Q,J,1),U=Q.heap[1],Q.heap[--Q.heap_max]=z,Q.heap[--Q.heap_max]=U,J[X*2]=J[z*2]+J[U*2],Q.depth[X]=(Q.depth[z]>=Q.depth[U]?Q.depth[z]:Q.depth[U])+1,J[z*2+1]=J[U*2+1]=X,Q.heap[1]=X++,WJ(Q,J,1);while(Q.heap_len>=2);Q.heap[--Q.heap_max]=Q.heap[1],G5(Q,W),O0(J,Y,Q.bl_count)},DJ=(Q,W,J)=>{let j,G=-1,q,z=W[1],U=0,Y=7,X=4;if(z===0)Y=138,X=3;W[(J+1)*2+1]=65535;for(j=0;j<=J;j++){if(q=z,z=W[(j+1)*2+1],++U<Y&&q===z)continue;else if(U<X)Q.bl_tree[q*2]+=U;else if(q!==0){if(q!==G)Q.bl_tree[q*2]++;Q.bl_tree[B0*2]++}else if(U<=10)Q.bl_tree[C0*2]++;else Q.bl_tree[$0*2]++;if(U=0,G=q,z===0)Y=138,X=3;else if(q===z)Y=6,X=3;else Y=7,X=4}},EJ=(Q,W,J)=>{let j,G=-1,q,z=W[1],U=0,Y=7,X=4;if(z===0)Y=138,X=3;for(j=0;j<=J;j++){if(q=z,z=W[(j+1)*2+1],++U<Y&&q===z)continue;else if(U<X)do p(Q,q,Q.bl_tree);while(--U!==0);else if(q!==0){if(q!==G)p(Q,q,Q.bl_tree),U--;p(Q,B0,Q.bl_tree),f(Q,U-3,2)}else if(U<=10)p(Q,C0,Q.bl_tree),f(Q,U-3,3);else p(Q,$0,Q.bl_tree),f(Q,U-11,7);if(U=0,G=q,z===0)Y=138,X=3;else if(q===z)Y=6,X=3;else Y=7,X=4}},U5=(Q)=>{let W;DJ(Q,Q.dyn_ltree,Q.l_desc.max_code),DJ(Q,Q.dyn_dtree,Q.d_desc.max_code),ZJ(Q,Q.bl_desc);for(W=gJ-1;W>=3;W--)if(Q.bl_tree[L0[W]*2+1]!==0)break;return Q.opt_len+=3*(W+1)+5+5+4,W},z5=(Q,W,J,j)=>{let G;f(Q,W-257,5),f(Q,J-1,5),f(Q,j-4,4);for(G=0;G<j;G++)f(Q,Q.bl_tree[L0[G]*2+1],3);EJ(Q,Q.dyn_ltree,W-1),EJ(Q,Q.dyn_dtree,J-1)},K5=(Q)=>{let W=4093624447,J;for(J=0;J<=31;J++,W>>>=1)if(W&1&&Q.dyn_ltree[J*2]!==0)return 0;if(Q.dyn_ltree[18]!==0||Q.dyn_ltree[20]!==0||Q.dyn_ltree[26]!==0)return 1;for(J=32;J<yQ;J++)if(Q.dyn_ltree[J*2]!==0)return 1;return 0},IJ=!1,V5=(Q)=>{if(!IJ)X5(),IJ=!0;Q.l_desc=new JJ(Q.dyn_ltree,N0),Q.d_desc=new JJ(Q.dyn_dtree,v0),Q.bl_desc=new JJ(Q.bl_tree,g0),Q.bi_buf=0,Q.bi_valid=0,M0(Q)},A0=(Q,W,J,j)=>{if(f(Q,(e0<<1)+(j?1:0),3),w0(Q),MQ(Q,J),MQ(Q,~J),J)Q.pending_buf.set(Q.window.subarray(W,W+J),Q.pending);Q.pending+=J},k5=(Q)=>{f(Q,H0<<1,3),p(Q,RJ,r),q5(Q)},Y5=(Q,W,J,j)=>{let G,q,z=0;if(Q.level>0){if(Q.strm.data_type===2)Q.strm.data_type=K5(Q);if(ZJ(Q,Q.l_desc),ZJ(Q,Q.d_desc),z=U5(Q),G=Q.opt_len+3+7>>>3,q=Q.static_len+3+7>>>3,q<=G)G=q}else G=q=J+5;if(J+4<=G&&W!==-1)A0(Q,W,J,j);else if(Q.strategy===4||q===G)f(Q,(H0<<1)+(j?1:0),3),yJ(Q,r,NQ);else f(Q,(t0<<1)+(j?1:0),3),z5(Q,Q.l_desc.max_code+1,Q.d_desc.max_code+1,z+1),yJ(Q,Q.dyn_ltree,Q.dyn_dtree);if(M0(Q),j)w0(Q)},F5=(Q,W,J)=>{if(Q.pending_buf[Q.sym_buf+Q.sym_next++]=W,Q.pending_buf[Q.sym_buf+Q.sym_next++]=W>>8,Q.pending_buf[Q.sym_buf+Q.sym_next++]=J,W===0)Q.dyn_ltree[J*2]++;else Q.matches++,W--,Q.dyn_ltree[(OQ[J]+yQ+1)*2]++,Q.dyn_dtree[R0(W)*2]++;return Q.sym_next===Q.sym_end},Z5=V5,H5=A0,P5=Y5,B5=F5,C5=k5,$5={_tr_init:Z5,_tr_stored_block:H5,_tr_flush_block:P5,_tr_tally:B5,_tr_align:C5},L5=(Q,W,J,j)=>{let G=Q&65535|0,q=Q>>>16&65535|0,z=0;while(J!==0){z=J>2000?2000:J,J-=z;do G=G+W[j++]|0,q=q+G|0;while(--z);G%=65521,q%=65521}return G|q<<16|0},wQ=L5,N5=()=>{let Q,W=[];for(var J=0;J<256;J++){Q=J;for(var j=0;j<8;j++)Q=Q&1?3988292384^Q>>>1:Q>>>1;W[J]=Q}return W},v5=new Uint32Array(N5()),g5=(Q,W,J,j)=>{let G=v5,q=j+J;Q^=-1;for(let z=j;z<q;z++)Q=Q>>>8^G[(Q^W[z])&255];return Q^-1},D=g5,GQ={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},zQ={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:R5,_tr_stored_block:HJ,_tr_flush_block:x5,_tr_tally:t,_tr_align:O5}=$5,{Z_NO_FLUSH:s,Z_PARTIAL_FLUSH:M5,Z_FULL_FLUSH:w5,Z_FINISH:c,Z_BLOCK:bJ,Z_OK:I,Z_STREAM_END:fJ,Z_STREAM_ERROR:l,Z_DATA_ERROR:A5,Z_BUF_ERROR:jJ,Z_DEFAULT_COMPRESSION:S5,Z_FILTERED:T5,Z_HUFFMAN_ONLY:uQ,Z_RLE:y5,Z_FIXED:D5,Z_DEFAULT_STRATEGY:E5,Z_UNKNOWN:I5,Z_DEFLATED:rQ}=zQ,b5=9,f5=15,u5=8,h5=29,c5=256,PJ=c5+1+h5,m5=30,d5=19,p5=2*PJ+1,l5=15,v=3,e=258,_=e+v+1,_5=32,FQ=42,OJ=57,BJ=69,CJ=73,$J=91,LJ=103,jQ=113,$Q=666,b=1,PQ=2,XQ=3,BQ=4,i5=3,qQ=(Q,W)=>{return Q.msg=GQ[W],W},uJ=(Q)=>{return Q*2-(Q>4?9:0)},a=(Q)=>{let W=Q.length;while(--W>=0)Q[W]=0},r5=(Q)=>{let W,J,j,G=Q.w_size;W=Q.hash_size,j=W;do J=Q.head[--j],Q.head[j]=J>=G?J-G:0;while(--W);W=G,j=W;do J=Q.prev[--j],Q.prev[j]=J>=G?J-G:0;while(--W)},o5=(Q,W,J)=>(W<<Q.hash_shift^J)&Q.hash_mask,QQ=o5,u=(Q)=>{let W=Q.state,J=W.pending;if(J>Q.avail_out)J=Q.avail_out;if(J===0)return;if(Q.output.set(W.pending_buf.subarray(W.pending_out,W.pending_out+J),Q.next_out),Q.next_out+=J,W.pending_out+=J,Q.total_out+=J,Q.avail_out-=J,W.pending-=J,W.pending===0)W.pending_out=0},h=(Q,W)=>{x5(Q,Q.block_start>=0?Q.block_start:-1,Q.strstart-Q.block_start,W),Q.block_start=Q.strstart,u(Q.strm)},x=(Q,W)=>{Q.pending_buf[Q.pending++]=W},CQ=(Q,W)=>{Q.pending_buf[Q.pending++]=W>>>8&255,Q.pending_buf[Q.pending++]=W&255},NJ=(Q,W,J,j)=>{let G=Q.avail_in;if(G>j)G=j;if(G===0)return 0;if(Q.avail_in-=G,W.set(Q.input.subarray(Q.next_in,Q.next_in+G),J),Q.state.wrap===1)Q.adler=wQ(Q.adler,W,G,J);else if(Q.state.wrap===2)Q.adler=D(Q.adler,W,G,J);return Q.next_in+=G,Q.total_in+=G,G},S0=(Q,W)=>{let{max_chain_length:J,strstart:j}=Q,G,q,z=Q.prev_length,U=Q.nice_match,Y=Q.strstart>Q.w_size-_?Q.strstart-(Q.w_size-_):0,X=Q.window,K=Q.w_mask,P=Q.prev,k=Q.strstart+e,V=X[j+z-1],Z=X[j+z];if(Q.prev_length>=Q.good_match)J>>=2;if(U>Q.lookahead)U=Q.lookahead;do{if(G=W,X[G+z]!==Z||X[G+z-1]!==V||X[G]!==X[j]||X[++G]!==X[j+1])continue;j+=2,G++;do;while(X[++j]===X[++G]&&X[++j]===X[++G]&&X[++j]===X[++G]&&X[++j]===X[++G]&&X[++j]===X[++G]&&X[++j]===X[++G]&&X[++j]===X[++G]&&X[++j]===X[++G]&&j<k);if(q=e-(k-j),j=k-e,q>z){if(Q.match_start=W,z=q,q>=U)break;V=X[j+z-1],Z=X[j+z]}}while((W=P[W&K])>Y&&--J!==0);if(z<=Q.lookahead)return z;return Q.lookahead},ZQ=(Q)=>{let W=Q.w_size,J,j,G;do{if(j=Q.window_size-Q.lookahead-Q.strstart,Q.strstart>=W+(W-_)){if(Q.window.set(Q.window.subarray(W,W+W-j),0),Q.match_start-=W,Q.strstart-=W,Q.block_start-=W,Q.insert>Q.strstart)Q.insert=Q.strstart;r5(Q),j+=W}if(Q.strm.avail_in===0)break;if(J=NJ(Q.strm,Q.window,Q.strstart+Q.lookahead,j),Q.lookahead+=J,Q.lookahead+Q.insert>=v){G=Q.strstart-Q.insert,Q.ins_h=Q.window[G],Q.ins_h=QQ(Q,Q.ins_h,Q.window[G+1]);while(Q.insert)if(Q.ins_h=QQ(Q,Q.ins_h,Q.window[G+v-1]),Q.prev[G&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=G,G++,Q.insert--,Q.lookahead+Q.insert<v)break}}while(Q.lookahead<_&&Q.strm.avail_in!==0)},T0=(Q,W)=>{let J=Q.pending_buf_size-5>Q.w_size?Q.w_size:Q.pending_buf_size-5,j,G,q,z=0,U=Q.strm.avail_in;do{if(j=65535,q=Q.bi_valid+42>>3,Q.strm.avail_out<q)break;if(q=Q.strm.avail_out-q,G=Q.strstart-Q.block_start,j>G+Q.strm.avail_in)j=G+Q.strm.avail_in;if(j>q)j=q;if(j<J&&(j===0&&W!==c||W===s||j!==G+Q.strm.avail_in))break;if(z=W===c&&j===G+Q.strm.avail_in?1:0,HJ(Q,0,0,z),Q.pending_buf[Q.pending-4]=j,Q.pending_buf[Q.pending-3]=j>>8,Q.pending_buf[Q.pending-2]=~j,Q.pending_buf[Q.pending-1]=~j>>8,u(Q.strm),G){if(G>j)G=j;Q.strm.output.set(Q.window.subarray(Q.block_start,Q.block_start+G),Q.strm.next_out),Q.strm.next_out+=G,Q.strm.avail_out-=G,Q.strm.total_out+=G,Q.block_start+=G,j-=G}if(j)NJ(Q.strm,Q.strm.output,Q.strm.next_out,j),Q.strm.next_out+=j,Q.strm.avail_out-=j,Q.strm.total_out+=j}while(z===0);if(U-=Q.strm.avail_in,U){if(U>=Q.w_size)Q.matches=2,Q.window.set(Q.strm.input.subarray(Q.strm.next_in-Q.w_size,Q.strm.next_in),0),Q.strstart=Q.w_size,Q.insert=Q.strstart;else{if(Q.window_size-Q.strstart<=U){if(Q.strstart-=Q.w_size,Q.window.set(Q.window.subarray(Q.w_size,Q.w_size+Q.strstart),0),Q.matches<2)Q.matches++;if(Q.insert>Q.strstart)Q.insert=Q.strstart}Q.window.set(Q.strm.input.subarray(Q.strm.next_in-U,Q.strm.next_in),Q.strstart),Q.strstart+=U,Q.insert+=U>Q.w_size-Q.insert?Q.w_size-Q.insert:U}Q.block_start=Q.strstart}if(Q.high_water<Q.strstart)Q.high_water=Q.strstart;if(z)return BQ;if(W!==s&&W!==c&&Q.strm.avail_in===0&&Q.strstart===Q.block_start)return PQ;if(q=Q.window_size-Q.strstart,Q.strm.avail_in>q&&Q.block_start>=Q.w_size){if(Q.block_start-=Q.w_size,Q.strstart-=Q.w_size,Q.window.set(Q.window.subarray(Q.w_size,Q.w_size+Q.strstart),0),Q.matches<2)Q.matches++;if(q+=Q.w_size,Q.insert>Q.strstart)Q.insert=Q.strstart}if(q>Q.strm.avail_in)q=Q.strm.avail_in;if(q)NJ(Q.strm,Q.window,Q.strstart,q),Q.strstart+=q,Q.insert+=q>Q.w_size-Q.insert?Q.w_size-Q.insert:q;if(Q.high_water<Q.strstart)Q.high_water=Q.strstart;if(q=Q.bi_valid+42>>3,q=Q.pending_buf_size-q>65535?65535:Q.pending_buf_size-q,J=q>Q.w_size?Q.w_size:q,G=Q.strstart-Q.block_start,G>=J||(G||W===c)&&W!==s&&Q.strm.avail_in===0&&G<=q)j=G>q?q:G,z=W===c&&Q.strm.avail_in===0&&j===G?1:0,HJ(Q,Q.block_start,j,z),Q.block_start+=j,u(Q.strm);return z?XQ:b},qJ=(Q,W)=>{let J,j;for(;;){if(Q.lookahead<_){if(ZQ(Q),Q.lookahead<_&&W===s)return b;if(Q.lookahead===0)break}if(J=0,Q.lookahead>=v)Q.ins_h=QQ(Q,Q.ins_h,Q.window[Q.strstart+v-1]),J=Q.prev[Q.strstart&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=Q.strstart;if(J!==0&&Q.strstart-J<=Q.w_size-_)Q.match_length=S0(Q,J);if(Q.match_length>=v)if(j=t(Q,Q.strstart-Q.match_start,Q.match_length-v),Q.lookahead-=Q.match_length,Q.match_length<=Q.max_lazy_match&&Q.lookahead>=v){Q.match_length--;do Q.strstart++,Q.ins_h=QQ(Q,Q.ins_h,Q.window[Q.strstart+v-1]),J=Q.prev[Q.strstart&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=Q.strstart;while(--Q.match_length!==0);Q.strstart++}else Q.strstart+=Q.match_length,Q.match_length=0,Q.ins_h=Q.window[Q.strstart],Q.ins_h=QQ(Q,Q.ins_h,Q.window[Q.strstart+1]);else j=t(Q,0,Q.window[Q.strstart]),Q.lookahead--,Q.strstart++;if(j){if(h(Q,!1),Q.strm.avail_out===0)return b}}if(Q.insert=Q.strstart<v-1?Q.strstart:v-1,W===c){if(h(Q,!0),Q.strm.avail_out===0)return XQ;return BQ}if(Q.sym_next){if(h(Q,!1),Q.strm.avail_out===0)return b}return PQ},VQ=(Q,W)=>{let J,j,G;for(;;){if(Q.lookahead<_){if(ZQ(Q),Q.lookahead<_&&W===s)return b;if(Q.lookahead===0)break}if(J=0,Q.lookahead>=v)Q.ins_h=QQ(Q,Q.ins_h,Q.window[Q.strstart+v-1]),J=Q.prev[Q.strstart&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=Q.strstart;if(Q.prev_length=Q.match_length,Q.prev_match=Q.match_start,Q.match_length=v-1,J!==0&&Q.prev_length<Q.max_lazy_match&&Q.strstart-J<=Q.w_size-_){if(Q.match_length=S0(Q,J),Q.match_length<=5&&(Q.strategy===T5||Q.match_length===v&&Q.strstart-Q.match_start>4096))Q.match_length=v-1}if(Q.prev_length>=v&&Q.match_length<=Q.prev_length){G=Q.strstart+Q.lookahead-v,j=t(Q,Q.strstart-1-Q.prev_match,Q.prev_length-v),Q.lookahead-=Q.prev_length-1,Q.prev_length-=2;do if(++Q.strstart<=G)Q.ins_h=QQ(Q,Q.ins_h,Q.window[Q.strstart+v-1]),J=Q.prev[Q.strstart&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=Q.strstart;while(--Q.prev_length!==0);if(Q.match_available=0,Q.match_length=v-1,Q.strstart++,j){if(h(Q,!1),Q.strm.avail_out===0)return b}}else if(Q.match_available){if(j=t(Q,0,Q.window[Q.strstart-1]),j)h(Q,!1);if(Q.strstart++,Q.lookahead--,Q.strm.avail_out===0)return b}else Q.match_available=1,Q.strstart++,Q.lookahead--}if(Q.match_available)j=t(Q,0,Q.window[Q.strstart-1]),Q.match_available=0;if(Q.insert=Q.strstart<v-1?Q.strstart:v-1,W===c){if(h(Q,!0),Q.strm.avail_out===0)return XQ;return BQ}if(Q.sym_next){if(h(Q,!1),Q.strm.avail_out===0)return b}return PQ},n5=(Q,W)=>{let J,j,G,q,z=Q.window;for(;;){if(Q.lookahead<=e){if(ZQ(Q),Q.lookahead<=e&&W===s)return b;if(Q.lookahead===0)break}if(Q.match_length=0,Q.lookahead>=v&&Q.strstart>0){if(G=Q.strstart-1,j=z[G],j===z[++G]&&j===z[++G]&&j===z[++G]){q=Q.strstart+e;do;while(j===z[++G]&&j===z[++G]&&j===z[++G]&&j===z[++G]&&j===z[++G]&&j===z[++G]&&j===z[++G]&&j===z[++G]&&G<q);if(Q.match_length=e-(q-G),Q.match_length>Q.lookahead)Q.match_length=Q.lookahead}}if(Q.match_length>=v)J=t(Q,1,Q.match_length-v),Q.lookahead-=Q.match_length,Q.strstart+=Q.match_length,Q.match_length=0;else J=t(Q,0,Q.window[Q.strstart]),Q.lookahead--,Q.strstart++;if(J){if(h(Q,!1),Q.strm.avail_out===0)return b}}if(Q.insert=0,W===c){if(h(Q,!0),Q.strm.avail_out===0)return XQ;return BQ}if(Q.sym_next){if(h(Q,!1),Q.strm.avail_out===0)return b}return PQ},a5=(Q,W)=>{let J;for(;;){if(Q.lookahead===0){if(ZQ(Q),Q.lookahead===0){if(W===s)return b;break}}if(Q.match_length=0,J=t(Q,0,Q.window[Q.strstart]),Q.lookahead--,Q.strstart++,J){if(h(Q,!1),Q.strm.avail_out===0)return b}}if(Q.insert=0,W===c){if(h(Q,!0),Q.strm.avail_out===0)return XQ;return BQ}if(Q.sym_next){if(h(Q,!1),Q.strm.avail_out===0)return b}return PQ};function d(Q,W,J,j,G){this.good_length=Q,this.max_lazy=W,this.nice_length=J,this.max_chain=j,this.func=G}var LQ=[new d(0,0,0,0,T0),new d(4,4,8,4,qJ),new d(4,5,16,8,qJ),new d(4,6,32,32,qJ),new d(4,4,16,16,VQ),new d(8,16,32,32,VQ),new d(8,16,128,128,VQ),new d(8,32,128,256,VQ),new d(32,128,258,1024,VQ),new d(32,258,258,4096,VQ)],e5=(Q)=>{Q.window_size=2*Q.w_size,a(Q.head),Q.max_lazy_match=LQ[Q.level].max_lazy,Q.good_match=LQ[Q.level].good_length,Q.nice_match=LQ[Q.level].nice_length,Q.max_chain_length=LQ[Q.level].max_chain,Q.strstart=0,Q.block_start=0,Q.lookahead=0,Q.insert=0,Q.match_length=Q.prev_length=v-1,Q.match_available=0,Q.ins_h=0};function t5(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=rQ,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(p5*2),this.dyn_dtree=new Uint16Array((2*m5+1)*2),this.bl_tree=new Uint16Array((2*d5+1)*2),a(this.dyn_ltree),a(this.dyn_dtree),a(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(l5+1),this.heap=new Uint16Array(2*PJ+1),a(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*PJ+1),a(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var DQ=(Q)=>{if(!Q)return 1;let W=Q.state;if(!W||W.strm!==Q||W.status!==FQ&&W.status!==OJ&&W.status!==BJ&&W.status!==CJ&&W.status!==$J&&W.status!==LJ&&W.status!==jQ&&W.status!==$Q)return 1;return 0},y0=(Q)=>{if(DQ(Q))return qQ(Q,l);Q.total_in=Q.total_out=0,Q.data_type=I5;let W=Q.state;if(W.pending=0,W.pending_out=0,W.wrap<0)W.wrap=-W.wrap;return W.status=W.wrap===2?OJ:W.wrap?FQ:jQ,Q.adler=W.wrap===2?0:1,W.last_flush=-2,R5(W),I},D0=(Q)=>{let W=y0(Q);if(W===I)e5(Q.state);return W},s5=(Q,W)=>{if(DQ(Q)||Q.state.wrap!==2)return l;return Q.state.gzhead=W,I},E0=(Q,W,J,j,G,q)=>{if(!Q)return l;let z=1;if(W===S5)W=6;if(j<0)z=0,j=-j;else if(j>15)z=2,j-=16;if(G<1||G>b5||J!==rQ||j<8||j>15||W<0||W>9||q<0||q>D5||j===8&&z!==1)return qQ(Q,l);if(j===8)j=9;let U=new t5;return Q.state=U,U.strm=Q,U.status=FQ,U.wrap=z,U.gzhead=null,U.w_bits=j,U.w_size=1<<U.w_bits,U.w_mask=U.w_size-1,U.hash_bits=G+7,U.hash_size=1<<U.hash_bits,U.hash_mask=U.hash_size-1,U.hash_shift=~~((U.hash_bits+v-1)/v),U.window=new Uint8Array(U.w_size*2),U.head=new Uint16Array(U.hash_size),U.prev=new Uint16Array(U.w_size),U.lit_bufsize=1<<G+6,U.pending_buf_size=U.lit_bufsize*4,U.pending_buf=new Uint8Array(U.pending_buf_size),U.sym_buf=U.lit_bufsize,U.sym_end=(U.lit_bufsize-1)*3,U.level=W,U.strategy=q,U.method=J,D0(Q)},Q8=(Q,W)=>{return E0(Q,W,rQ,f5,u5,E5)},J8=(Q,W)=>{if(DQ(Q)||W>bJ||W<0)return Q?qQ(Q,l):l;let J=Q.state;if(!Q.output||Q.avail_in!==0&&!Q.input||J.status===$Q&&W!==c)return qQ(Q,Q.avail_out===0?jJ:l);let j=J.last_flush;if(J.last_flush=W,J.pending!==0){if(u(Q),Q.avail_out===0)return J.last_flush=-1,I}else if(Q.avail_in===0&&uJ(W)<=uJ(j)&&W!==c)return qQ(Q,jJ);if(J.status===$Q&&Q.avail_in!==0)return qQ(Q,jJ);if(J.status===FQ&&J.wrap===0)J.status=jQ;if(J.status===FQ){let G=rQ+(J.w_bits-8<<4)<<8,q=-1;if(J.strategy>=uQ||J.level<2)q=0;else if(J.level<6)q=1;else if(J.level===6)q=2;else q=3;if(G|=q<<6,J.strstart!==0)G|=_5;if(G+=31-G%31,CQ(J,G),J.strstart!==0)CQ(J,Q.adler>>>16),CQ(J,Q.adler&65535);if(Q.adler=1,J.status=jQ,u(Q),J.pending!==0)return J.last_flush=-1,I}if(J.status===OJ)if(Q.adler=0,x(J,31),x(J,139),x(J,8),!J.gzhead){if(x(J,0),x(J,0),x(J,0),x(J,0),x(J,0),x(J,J.level===9?2:J.strategy>=uQ||J.level<2?4:0),x(J,i5),J.status=jQ,u(Q),J.pending!==0)return J.last_flush=-1,I}else{if(x(J,(J.gzhead.text?1:0)+(J.gzhead.hcrc?2:0)+(!J.gzhead.extra?0:4)+(!J.gzhead.name?0:8)+(!J.gzhead.comment?0:16)),x(J,J.gzhead.time&255),x(J,J.gzhead.time>>8&255),x(J,J.gzhead.time>>16&255),x(J,J.gzhead.time>>24&255),x(J,J.level===9?2:J.strategy>=uQ||J.level<2?4:0),x(J,J.gzhead.os&255),J.gzhead.extra&&J.gzhead.extra.length)x(J,J.gzhead.extra.length&255),x(J,J.gzhead.extra.length>>8&255);if(J.gzhead.hcrc)Q.adler=D(Q.adler,J.pending_buf,J.pending,0);J.gzindex=0,J.status=BJ}if(J.status===BJ){if(J.gzhead.extra){let G=J.pending,q=(J.gzhead.extra.length&65535)-J.gzindex;while(J.pending+q>J.pending_buf_size){let U=J.pending_buf_size-J.pending;if(J.pending_buf.set(J.gzhead.extra.subarray(J.gzindex,J.gzindex+U),J.pending),J.pending=J.pending_buf_size,J.gzhead.hcrc&&J.pending>G)Q.adler=D(Q.adler,J.pending_buf,J.pending-G,G);if(J.gzindex+=U,u(Q),J.pending!==0)return J.last_flush=-1,I;G=0,q-=U}let z=new Uint8Array(J.gzhead.extra);if(J.pending_buf.set(z.subarray(J.gzindex,J.gzindex+q),J.pending),J.pending+=q,J.gzhead.hcrc&&J.pending>G)Q.adler=D(Q.adler,J.pending_buf,J.pending-G,G);J.gzindex=0}J.status=CJ}if(J.status===CJ){if(J.gzhead.name){let G=J.pending,q;do{if(J.pending===J.pending_buf_size){if(J.gzhead.hcrc&&J.pending>G)Q.adler=D(Q.adler,J.pending_buf,J.pending-G,G);if(u(Q),J.pending!==0)return J.last_flush=-1,I;G=0}if(J.gzindex<J.gzhead.name.length)q=J.gzhead.name.charCodeAt(J.gzindex++)&255;else q=0;x(J,q)}while(q!==0);if(J.gzhead.hcrc&&J.pending>G)Q.adler=D(Q.adler,J.pending_buf,J.pending-G,G);J.gzindex=0}J.status=$J}if(J.status===$J){if(J.gzhead.comment){let G=J.pending,q;do{if(J.pending===J.pending_buf_size){if(J.gzhead.hcrc&&J.pending>G)Q.adler=D(Q.adler,J.pending_buf,J.pending-G,G);if(u(Q),J.pending!==0)return J.last_flush=-1,I;G=0}if(J.gzindex<J.gzhead.comment.length)q=J.gzhead.comment.charCodeAt(J.gzindex++)&255;else q=0;x(J,q)}while(q!==0);if(J.gzhead.hcrc&&J.pending>G)Q.adler=D(Q.adler,J.pending_buf,J.pending-G,G)}J.status=LJ}if(J.status===LJ){if(J.gzhead.hcrc){if(J.pending+2>J.pending_buf_size){if(u(Q),J.pending!==0)return J.last_flush=-1,I}x(J,Q.adler&255),x(J,Q.adler>>8&255),Q.adler=0}if(J.status=jQ,u(Q),J.pending!==0)return J.last_flush=-1,I}if(Q.avail_in!==0||J.lookahead!==0||W!==s&&J.status!==$Q){let G=J.level===0?T0(J,W):J.strategy===uQ?a5(J,W):J.strategy===y5?n5(J,W):LQ[J.level].func(J,W);if(G===XQ||G===BQ)J.status=$Q;if(G===b||G===XQ){if(Q.avail_out===0)J.last_flush=-1;return I}if(G===PQ){if(W===M5)O5(J);else if(W!==bJ){if(HJ(J,0,0,!1),W===w5){if(a(J.head),J.lookahead===0)J.strstart=0,J.block_start=0,J.insert=0}}if(u(Q),Q.avail_out===0)return J.last_flush=-1,I}}if(W!==c)return I;if(J.wrap<=0)return fJ;if(J.wrap===2)x(J,Q.adler&255),x(J,Q.adler>>8&255),x(J,Q.adler>>16&255),x(J,Q.adler>>24&255),x(J,Q.total_in&255),x(J,Q.total_in>>8&255),x(J,Q.total_in>>16&255),x(J,Q.total_in>>24&255);else CQ(J,Q.adler>>>16),CQ(J,Q.adler&65535);if(u(Q),J.wrap>0)J.wrap=-J.wrap;return J.pending!==0?I:fJ},W8=(Q)=>{if(DQ(Q))return l;let W=Q.state.status;return Q.state=null,W===jQ?qQ(Q,A5):I},j8=(Q,W)=>{let J=W.length;if(DQ(Q))return l;let j=Q.state,G=j.wrap;if(G===2||G===1&&j.status!==FQ||j.lookahead)return l;if(G===1)Q.adler=wQ(Q.adler,W,J,0);if(j.wrap=0,J>=j.w_size){if(G===0)a(j.head),j.strstart=0,j.block_start=0,j.insert=0;let Y=new Uint8Array(j.w_size);Y.set(W.subarray(J-j.w_size,J),0),W=Y,J=j.w_size}let{avail_in:q,next_in:z,input:U}=Q;Q.avail_in=J,Q.next_in=0,Q.input=W,ZQ(j);while(j.lookahead>=v){let Y=j.strstart,X=j.lookahead-(v-1);do j.ins_h=QQ(j,j.ins_h,j.window[Y+v-1]),j.prev[Y&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=Y,Y++;while(--X);j.strstart=Y,j.lookahead=v-1,ZQ(j)}return j.strstart+=j.lookahead,j.block_start=j.strstart,j.insert=j.lookahead,j.lookahead=0,j.match_length=j.prev_length=v-1,j.match_available=0,Q.next_in=z,Q.input=U,Q.avail_in=q,j.wrap=G,I},q8=Q8,G8=E0,X8=D0,U8=y0,z8=s5,K8=J8,V8=W8,k8=j8,Y8="pako deflate (from Nodeca project)",vQ={deflateInit:q8,deflateInit2:G8,deflateReset:X8,deflateResetKeep:U8,deflateSetHeader:z8,deflate:K8,deflateEnd:V8,deflateSetDictionary:k8,deflateInfo:Y8},F8=(Q,W)=>{return Object.prototype.hasOwnProperty.call(Q,W)},Z8=function(Q){let W=Array.prototype.slice.call(arguments,1);while(W.length){let J=W.shift();if(!J)continue;if(typeof J!=="object")throw new TypeError(J+"must be non-object");for(let j in J)if(F8(J,j))Q[j]=J[j]}return Q},H8=(Q)=>{let W=0;for(let j=0,G=Q.length;j<G;j++)W+=Q[j].length;let J=new Uint8Array(W);for(let j=0,G=0,q=Q.length;j<q;j++){let z=Q[j];J.set(z,G),G+=z.length}return J},oQ={assign:Z8,flattenChunks:H8},I0=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(Q){I0=!1}var AQ=new Uint8Array(256);for(let Q=0;Q<256;Q++)AQ[Q]=Q>=252?6:Q>=248?5:Q>=240?4:Q>=224?3:Q>=192?2:1;AQ[254]=AQ[254]=1;var P8=(Q)=>{if(typeof TextEncoder==="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(Q);let W,J,j,G,q,z=Q.length,U=0;for(G=0;G<z;G++){if(J=Q.charCodeAt(G),(J&64512)===55296&&G+1<z){if(j=Q.charCodeAt(G+1),(j&64512)===56320)J=65536+(J-55296<<10)+(j-56320),G++}U+=J<128?1:J<2048?2:J<65536?3:4}W=new Uint8Array(U);for(q=0,G=0;q<U;G++){if(J=Q.charCodeAt(G),(J&64512)===55296&&G+1<z){if(j=Q.charCodeAt(G+1),(j&64512)===56320)J=65536+(J-55296<<10)+(j-56320),G++}if(J<128)W[q++]=J;else if(J<2048)W[q++]=192|J>>>6,W[q++]=128|J&63;else if(J<65536)W[q++]=224|J>>>12,W[q++]=128|J>>>6&63,W[q++]=128|J&63;else W[q++]=240|J>>>18,W[q++]=128|J>>>12&63,W[q++]=128|J>>>6&63,W[q++]=128|J&63}return W},B8=(Q,W)=>{if(W<65534){if(Q.subarray&&I0)return String.fromCharCode.apply(null,Q.length===W?Q:Q.subarray(0,W))}let J="";for(let j=0;j<W;j++)J+=String.fromCharCode(Q[j]);return J},C8=(Q,W)=>{let J=W||Q.length;if(typeof TextDecoder==="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(Q.subarray(0,W));let j,G,q=new Array(J*2);for(G=0,j=0;j<J;){let z=Q[j++];if(z<128){q[G++]=z;continue}let U=AQ[z];if(U>4){q[G++]=65533,j+=U-1;continue}z&=U===2?31:U===3?15:7;while(U>1&&j<J)z=z<<6|Q[j++]&63,U--;if(U>1){q[G++]=65533;continue}if(z<65536)q[G++]=z;else z-=65536,q[G++]=55296|z>>10&1023,q[G++]=56320|z&1023}return B8(q,G)},$8=(Q,W)=>{if(W=W||Q.length,W>Q.length)W=Q.length;let J=W-1;while(J>=0&&(Q[J]&192)===128)J--;if(J<0)return W;if(J===0)return W;return J+AQ[Q[J]]>W?J:W},SQ={string2buf:P8,buf2string:C8,utf8border:$8};function L8(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var b0=L8,f0=Object.prototype.toString,{Z_NO_FLUSH:N8,Z_SYNC_FLUSH:v8,Z_FULL_FLUSH:g8,Z_FINISH:R8,Z_OK:_Q,Z_STREAM_END:x8,Z_DEFAULT_COMPRESSION:O8,Z_DEFAULT_STRATEGY:M8,Z_DEFLATED:w8}=zQ;function EQ(Q){this.options=oQ.assign({level:O8,method:w8,chunkSize:16384,windowBits:15,memLevel:8,strategy:M8},Q||{});let W=this.options;if(W.raw&&W.windowBits>0)W.windowBits=-W.windowBits;else if(W.gzip&&W.windowBits>0&&W.windowBits<16)W.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b0,this.strm.avail_out=0;let J=vQ.deflateInit2(this.strm,W.level,W.method,W.windowBits,W.memLevel,W.strategy);if(J!==_Q)throw new Error(GQ[J]);if(W.header)vQ.deflateSetHeader(this.strm,W.header);if(W.dictionary){let j;if(typeof W.dictionary==="string")j=SQ.string2buf(W.dictionary);else if(f0.call(W.dictionary)==="[object ArrayBuffer]")j=new Uint8Array(W.dictionary);else j=W.dictionary;if(J=vQ.deflateSetDictionary(this.strm,j),J!==_Q)throw new Error(GQ[J]);this._dict_set=!0}}EQ.prototype.push=function(Q,W){let J=this.strm,j=this.options.chunkSize,G,q;if(this.ended)return!1;if(W===~~W)q=W;else q=W===!0?R8:N8;if(typeof Q==="string")J.input=SQ.string2buf(Q);else if(f0.call(Q)==="[object ArrayBuffer]")J.input=new Uint8Array(Q);else J.input=Q;J.next_in=0,J.avail_in=J.input.length;for(;;){if(J.avail_out===0)J.output=new Uint8Array(j),J.next_out=0,J.avail_out=j;if((q===v8||q===g8)&&J.avail_out<=6){this.onData(J.output.subarray(0,J.next_out)),J.avail_out=0;continue}if(G=vQ.deflate(J,q),G===x8){if(J.next_out>0)this.onData(J.output.subarray(0,J.next_out));return G=vQ.deflateEnd(this.strm),this.onEnd(G),this.ended=!0,G===_Q}if(J.avail_out===0){this.onData(J.output);continue}if(q>0&&J.next_out>0){this.onData(J.output.subarray(0,J.next_out)),J.avail_out=0;continue}if(J.avail_in===0)break}return!0};EQ.prototype.onData=function(Q){this.chunks.push(Q)};EQ.prototype.onEnd=function(Q){if(Q===_Q)this.result=oQ.flattenChunks(this.chunks);this.chunks=[],this.err=Q,this.msg=this.strm.msg};function MJ(Q,W){let J=new EQ(W);if(J.push(Q,!0),J.err)throw J.msg||GQ[J.err];return J.result}function A8(Q,W){return W=W||{},W.raw=!0,MJ(Q,W)}function S8(Q,W){return W=W||{},W.gzip=!0,MJ(Q,W)}var T8=EQ,y8=MJ,D8=A8,E8=S8,I8=zQ,b8={Deflate:T8,deflate:y8,deflateRaw:D8,gzip:E8,constants:I8},hQ=16209,f8=16191,u8=function Q(W,J){let j,G,q,z,U,Y,X,K,P,k,V,Z,M,$,C,O,L,F,R,y,H,A,g,B,N=W.state;j=W.next_in,g=W.input,G=j+(W.avail_in-5),q=W.next_out,B=W.output,z=q-(J-W.avail_out),U=q+(W.avail_out-257),Y=N.dmax,X=N.wsize,K=N.whave,P=N.wnext,k=N.window,V=N.hold,Z=N.bits,M=N.lencode,$=N.distcode,C=(1<<N.lenbits)-1,O=(1<<N.distbits)-1;Q:do{if(Z<15)V+=g[j++]<<Z,Z+=8,V+=g[j++]<<Z,Z+=8;L=M[V&C];J:for(;;){if(F=L>>>24,V>>>=F,Z-=F,F=L>>>16&255,F===0)B[q++]=L&65535;else if(F&16){if(R=L&65535,F&=15,F){if(Z<F)V+=g[j++]<<Z,Z+=8;R+=V&(1<<F)-1,V>>>=F,Z-=F}if(Z<15)V+=g[j++]<<Z,Z+=8,V+=g[j++]<<Z,Z+=8;L=$[V&O];W:for(;;){if(F=L>>>24,V>>>=F,Z-=F,F=L>>>16&255,F&16){if(y=L&65535,F&=15,Z<F){if(V+=g[j++]<<Z,Z+=8,Z<F)V+=g[j++]<<Z,Z+=8}if(y+=V&(1<<F)-1,y>Y){W.msg="invalid distance too far back",N.mode=hQ;break Q}if(V>>>=F,Z-=F,F=q-z,y>F){if(F=y-F,F>K){if(N.sane){W.msg="invalid distance too far back",N.mode=hQ;break Q}}if(H=0,A=k,P===0){if(H+=X-F,F<R){R-=F;do B[q++]=k[H++];while(--F);H=q-y,A=B}}else if(P<F){if(H+=X+P-F,F-=P,F<R){R-=F;do B[q++]=k[H++];while(--F);if(H=0,P<R){F=P,R-=F;do B[q++]=k[H++];while(--F);H=q-y,A=B}}}else if(H+=P-F,F<R){R-=F;do B[q++]=k[H++];while(--F);H=q-y,A=B}while(R>2)B[q++]=A[H++],B[q++]=A[H++],B[q++]=A[H++],R-=3;if(R){if(B[q++]=A[H++],R>1)B[q++]=A[H++]}}else{H=q-y;do B[q++]=B[H++],B[q++]=B[H++],B[q++]=B[H++],R-=3;while(R>2);if(R){if(B[q++]=B[H++],R>1)B[q++]=B[H++]}}}else if((F&64)===0){L=$[(L&65535)+(V&(1<<F)-1)];continue W}else{W.msg="invalid distance code",N.mode=hQ;break Q}break}}else if((F&64)===0){L=M[(L&65535)+(V&(1<<F)-1)];continue J}else if(F&32){N.mode=f8;break Q}else{W.msg="invalid literal/length code",N.mode=hQ;break Q}break}}while(j<G&&q<U);R=Z>>3,j-=R,Z-=R<<3,V&=(1<<Z)-1,W.next_in=j,W.next_out=q,W.avail_in=j<G?5+(G-j):5-(j-G),W.avail_out=q<U?257+(U-q):257-(q-U),N.hold=V,N.bits=Z;return},kQ=15,hJ=852,cJ=592,mJ=0,GJ=1,dJ=2,h8=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),c8=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),m8=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),d8=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),p8=(Q,W,J,j,G,q,z,U)=>{let Y=U.bits,X=0,K=0,P=0,k=0,V=0,Z=0,M=0,$=0,C=0,O=0,L,F,R,y,H,A=null,g,B=new Uint16Array(kQ+1),N=new Uint16Array(kQ+1),JQ=null,AJ,bQ,fQ;for(X=0;X<=kQ;X++)B[X]=0;for(K=0;K<j;K++)B[W[J+K]]++;V=Y;for(k=kQ;k>=1;k--)if(B[k]!==0)break;if(V>k)V=k;if(k===0)return G[q++]=20971520,G[q++]=20971520,U.bits=1,0;for(P=1;P<k;P++)if(B[P]!==0)break;if(V<P)V=P;$=1;for(X=1;X<=kQ;X++)if($<<=1,$-=B[X],$<0)return-1;if($>0&&(Q===mJ||k!==1))return-1;N[1]=0;for(X=1;X<kQ;X++)N[X+1]=N[X]+B[X];for(K=0;K<j;K++)if(W[J+K]!==0)z[N[W[J+K]]++]=K;if(Q===mJ)A=JQ=z,g=20;else if(Q===GJ)A=h8,JQ=c8,g=257;else A=m8,JQ=d8,g=0;if(O=0,K=0,X=P,H=q,Z=V,M=0,R=-1,C=1<<V,y=C-1,Q===GJ&&C>hJ||Q===dJ&&C>cJ)return 1;for(;;){if(AJ=X-M,z[K]+1<g)bQ=0,fQ=z[K];else if(z[K]>=g)bQ=JQ[z[K]-g],fQ=A[z[K]-g];else bQ=96,fQ=0;L=1<<X-M,F=1<<Z,P=F;do F-=L,G[H+(O>>M)+F]=AJ<<24|bQ<<16|fQ|0;while(F!==0);L=1<<X-1;while(O&L)L>>=1;if(L!==0)O&=L-1,O+=L;else O=0;if(K++,--B[X]===0){if(X===k)break;X=W[J+z[K]]}if(X>V&&(O&y)!==R){if(M===0)M=V;H+=P,Z=X-M,$=1<<Z;while(Z+M<k){if($-=B[Z+M],$<=0)break;Z++,$<<=1}if(C+=1<<Z,Q===GJ&&C>hJ||Q===dJ&&C>cJ)return 1;R=O&y,G[R]=V<<24|Z<<16|H-q|0}}if(O!==0)G[H+O]=X-M<<24|4194304|0;return U.bits=V,0},gQ=p8,l8=0,u0=1,h0=2,{Z_FINISH:pJ,Z_BLOCK:_8,Z_TREES:cQ,Z_OK:UQ,Z_STREAM_END:i8,Z_NEED_DICT:r8,Z_STREAM_ERROR:m,Z_DATA_ERROR:c0,Z_MEM_ERROR:m0,Z_BUF_ERROR:o8,Z_DEFLATED:lJ}=zQ,nQ=16180,_J=16181,iJ=16182,rJ=16183,oJ=16184,nJ=16185,aJ=16186,eJ=16187,tJ=16188,sJ=16189,iQ=16190,i=16191,XJ=16192,Q0=16193,UJ=16194,J0=16195,W0=16196,j0=16197,q0=16198,mQ=16199,dQ=16200,G0=16201,X0=16202,U0=16203,z0=16204,K0=16205,zJ=16206,V0=16207,k0=16208,S=16209,d0=16210,p0=16211,n8=852,a8=592,e8=15,t8=e8,Y0=(Q)=>{return(Q>>>24&255)+(Q>>>8&65280)+((Q&65280)<<8)+((Q&255)<<24)};function s8(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var KQ=(Q)=>{if(!Q)return 1;let W=Q.state;if(!W||W.strm!==Q||W.mode<nQ||W.mode>p0)return 1;return 0},l0=(Q)=>{if(KQ(Q))return m;let W=Q.state;if(Q.total_in=Q.total_out=W.total=0,Q.msg="",W.wrap)Q.adler=W.wrap&1;return W.mode=nQ,W.last=0,W.havedict=0,W.flags=-1,W.dmax=32768,W.head=null,W.hold=0,W.bits=0,W.lencode=W.lendyn=new Int32Array(n8),W.distcode=W.distdyn=new Int32Array(a8),W.sane=1,W.back=-1,UQ},_0=(Q)=>{if(KQ(Q))return m;let W=Q.state;return W.wsize=0,W.whave=0,W.wnext=0,l0(Q)},i0=(Q,W)=>{let J;if(KQ(Q))return m;let j=Q.state;if(W<0)J=0,W=-W;else if(J=(W>>4)+5,W<48)W&=15;if(W&&(W<8||W>15))return m;if(j.window!==null&&j.wbits!==W)j.window=null;return j.wrap=J,j.wbits=W,_0(Q)},r0=(Q,W)=>{if(!Q)return m;let J=new s8;Q.state=J,J.strm=Q,J.window=null,J.mode=nQ;let j=i0(Q,W);if(j!==UQ)Q.state=null;return j},Q1=(Q)=>{return r0(Q,t8)},F0=!0,KJ,VJ,J1=(Q)=>{if(F0){KJ=new Int32Array(512),VJ=new Int32Array(32);let W=0;while(W<144)Q.lens[W++]=8;while(W<256)Q.lens[W++]=9;while(W<280)Q.lens[W++]=7;while(W<288)Q.lens[W++]=8;gQ(u0,Q.lens,0,288,KJ,0,Q.work,{bits:9}),W=0;while(W<32)Q.lens[W++]=5;gQ(h0,Q.lens,0,32,VJ,0,Q.work,{bits:5}),F0=!1}Q.lencode=KJ,Q.lenbits=9,Q.distcode=VJ,Q.distbits=5},o0=(Q,W,J,j)=>{let G,q=Q.state;if(q.window===null)q.wsize=1<<q.wbits,q.wnext=0,q.whave=0,q.window=new Uint8Array(q.wsize);if(j>=q.wsize)q.window.set(W.subarray(J-q.wsize,J),0),q.wnext=0,q.whave=q.wsize;else{if(G=q.wsize-q.wnext,G>j)G=j;if(q.window.set(W.subarray(J-j,J-j+G),q.wnext),j-=G,j)q.window.set(W.subarray(J-j,J),0),q.wnext=j,q.whave=q.wsize;else{if(q.wnext+=G,q.wnext===q.wsize)q.wnext=0;if(q.whave<q.wsize)q.whave+=G}}return 0},W1=(Q,W)=>{let J,j,G,q,z,U,Y,X,K,P,k,V,Z,M,$=0,C,O,L,F,R,y,H,A,g=new Uint8Array(4),B,N,JQ=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(KQ(Q)||!Q.output||!Q.input&&Q.avail_in!==0)return m;if(J=Q.state,J.mode===i)J.mode=XJ;z=Q.next_out,G=Q.output,Y=Q.avail_out,q=Q.next_in,j=Q.input,U=Q.avail_in,X=J.hold,K=J.bits,P=U,k=Y,A=UQ;Q:for(;;)switch(J.mode){case nQ:if(J.wrap===0){J.mode=XJ;break}while(K<16){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.wrap&2&&X===35615){if(J.wbits===0)J.wbits=15;J.check=0,g[0]=X&255,g[1]=X>>>8&255,J.check=D(J.check,g,2,0),X=0,K=0,J.mode=_J;break}if(J.head)J.head.done=!1;if(!(J.wrap&1)||(((X&255)<<8)+(X>>8))%31){Q.msg="incorrect header check",J.mode=S;break}if((X&15)!==lJ){Q.msg="unknown compression method",J.mode=S;break}if(X>>>=4,K-=4,H=(X&15)+8,J.wbits===0)J.wbits=H;if(H>15||H>J.wbits){Q.msg="invalid window size",J.mode=S;break}J.dmax=1<<J.wbits,J.flags=0,Q.adler=J.check=1,J.mode=X&512?sJ:i,X=0,K=0;break;case _J:while(K<16){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.flags=X,(J.flags&255)!==lJ){Q.msg="unknown compression method",J.mode=S;break}if(J.flags&57344){Q.msg="unknown header flags set",J.mode=S;break}if(J.head)J.head.text=X>>8&1;if(J.flags&512&&J.wrap&4)g[0]=X&255,g[1]=X>>>8&255,J.check=D(J.check,g,2,0);X=0,K=0,J.mode=iJ;case iJ:while(K<32){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.head)J.head.time=X;if(J.flags&512&&J.wrap&4)g[0]=X&255,g[1]=X>>>8&255,g[2]=X>>>16&255,g[3]=X>>>24&255,J.check=D(J.check,g,4,0);X=0,K=0,J.mode=rJ;case rJ:while(K<16){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.head)J.head.xflags=X&255,J.head.os=X>>8;if(J.flags&512&&J.wrap&4)g[0]=X&255,g[1]=X>>>8&255,J.check=D(J.check,g,2,0);X=0,K=0,J.mode=oJ;case oJ:if(J.flags&1024){while(K<16){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.length=X,J.head)J.head.extra_len=X;if(J.flags&512&&J.wrap&4)g[0]=X&255,g[1]=X>>>8&255,J.check=D(J.check,g,2,0);X=0,K=0}else if(J.head)J.head.extra=null;J.mode=nJ;case nJ:if(J.flags&1024){if(V=J.length,V>U)V=U;if(V){if(J.head){if(H=J.head.extra_len-J.length,!J.head.extra)J.head.extra=new Uint8Array(J.head.extra_len);J.head.extra.set(j.subarray(q,q+V),H)}if(J.flags&512&&J.wrap&4)J.check=D(J.check,j,V,q);U-=V,q+=V,J.length-=V}if(J.length)break Q}J.length=0,J.mode=aJ;case aJ:if(J.flags&2048){if(U===0)break Q;V=0;do if(H=j[q+V++],J.head&&H&&J.length<65536)J.head.name+=String.fromCharCode(H);while(H&&V<U);if(J.flags&512&&J.wrap&4)J.check=D(J.check,j,V,q);if(U-=V,q+=V,H)break Q}else if(J.head)J.head.name=null;J.length=0,J.mode=eJ;case eJ:if(J.flags&4096){if(U===0)break Q;V=0;do if(H=j[q+V++],J.head&&H&&J.length<65536)J.head.comment+=String.fromCharCode(H);while(H&&V<U);if(J.flags&512&&J.wrap&4)J.check=D(J.check,j,V,q);if(U-=V,q+=V,H)break Q}else if(J.head)J.head.comment=null;J.mode=tJ;case tJ:if(J.flags&512){while(K<16){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.wrap&4&&X!==(J.check&65535)){Q.msg="header crc mismatch",J.mode=S;break}X=0,K=0}if(J.head)J.head.hcrc=J.flags>>9&1,J.head.done=!0;Q.adler=J.check=0,J.mode=i;break;case sJ:while(K<32){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}Q.adler=J.check=Y0(X),X=0,K=0,J.mode=iQ;case iQ:if(J.havedict===0)return Q.next_out=z,Q.avail_out=Y,Q.next_in=q,Q.avail_in=U,J.hold=X,J.bits=K,r8;Q.adler=J.check=1,J.mode=i;case i:if(W===_8||W===cQ)break Q;case XJ:if(J.last){X>>>=K&7,K-=K&7,J.mode=zJ;break}while(K<3){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}switch(J.last=X&1,X>>>=1,K-=1,X&3){case 0:J.mode=Q0;break;case 1:if(J1(J),J.mode=mQ,W===cQ){X>>>=2,K-=2;break Q}break;case 2:J.mode=W0;break;case 3:Q.msg="invalid block type",J.mode=S}X>>>=2,K-=2;break;case Q0:X>>>=K&7,K-=K&7;while(K<32){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if((X&65535)!==(X>>>16^65535)){Q.msg="invalid stored block lengths",J.mode=S;break}if(J.length=X&65535,X=0,K=0,J.mode=UJ,W===cQ)break Q;case UJ:J.mode=J0;case J0:if(V=J.length,V){if(V>U)V=U;if(V>Y)V=Y;if(V===0)break Q;G.set(j.subarray(q,q+V),z),U-=V,q+=V,Y-=V,z+=V,J.length-=V;break}J.mode=i;break;case W0:while(K<14){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.nlen=(X&31)+257,X>>>=5,K-=5,J.ndist=(X&31)+1,X>>>=5,K-=5,J.ncode=(X&15)+4,X>>>=4,K-=4,J.nlen>286||J.ndist>30){Q.msg="too many length or distance symbols",J.mode=S;break}J.have=0,J.mode=j0;case j0:while(J.have<J.ncode){while(K<3){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}J.lens[JQ[J.have++]]=X&7,X>>>=3,K-=3}while(J.have<19)J.lens[JQ[J.have++]]=0;if(J.lencode=J.lendyn,J.lenbits=7,B={bits:J.lenbits},A=gQ(l8,J.lens,0,19,J.lencode,0,J.work,B),J.lenbits=B.bits,A){Q.msg="invalid code lengths set",J.mode=S;break}J.have=0,J.mode=q0;case q0:while(J.have<J.nlen+J.ndist){for(;;){if($=J.lencode[X&(1<<J.lenbits)-1],C=$>>>24,O=$>>>16&255,L=$&65535,C<=K)break;if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(L<16)X>>>=C,K-=C,J.lens[J.have++]=L;else{if(L===16){N=C+2;while(K<N){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(X>>>=C,K-=C,J.have===0){Q.msg="invalid bit length repeat",J.mode=S;break}H=J.lens[J.have-1],V=3+(X&3),X>>>=2,K-=2}else if(L===17){N=C+3;while(K<N){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}X>>>=C,K-=C,H=0,V=3+(X&7),X>>>=3,K-=3}else{N=C+7;while(K<N){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}X>>>=C,K-=C,H=0,V=11+(X&127),X>>>=7,K-=7}if(J.have+V>J.nlen+J.ndist){Q.msg="invalid bit length repeat",J.mode=S;break}while(V--)J.lens[J.have++]=H}}if(J.mode===S)break;if(J.lens[256]===0){Q.msg="invalid code -- missing end-of-block",J.mode=S;break}if(J.lenbits=9,B={bits:J.lenbits},A=gQ(u0,J.lens,0,J.nlen,J.lencode,0,J.work,B),J.lenbits=B.bits,A){Q.msg="invalid literal/lengths set",J.mode=S;break}if(J.distbits=6,J.distcode=J.distdyn,B={bits:J.distbits},A=gQ(h0,J.lens,J.nlen,J.ndist,J.distcode,0,J.work,B),J.distbits=B.bits,A){Q.msg="invalid distances set",J.mode=S;break}if(J.mode=mQ,W===cQ)break Q;case mQ:J.mode=dQ;case dQ:if(U>=6&&Y>=258){if(Q.next_out=z,Q.avail_out=Y,Q.next_in=q,Q.avail_in=U,J.hold=X,J.bits=K,u8(Q,k),z=Q.next_out,G=Q.output,Y=Q.avail_out,q=Q.next_in,j=Q.input,U=Q.avail_in,X=J.hold,K=J.bits,J.mode===i)J.back=-1;break}J.back=0;for(;;){if($=J.lencode[X&(1<<J.lenbits)-1],C=$>>>24,O=$>>>16&255,L=$&65535,C<=K)break;if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(O&&(O&240)===0){F=C,R=O,y=L;for(;;){if($=J.lencode[y+((X&(1<<F+R)-1)>>F)],C=$>>>24,O=$>>>16&255,L=$&65535,F+C<=K)break;if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}X>>>=F,K-=F,J.back+=F}if(X>>>=C,K-=C,J.back+=C,J.length=L,O===0){J.mode=K0;break}if(O&32){J.back=-1,J.mode=i;break}if(O&64){Q.msg="invalid literal/length code",J.mode=S;break}J.extra=O&15,J.mode=G0;case G0:if(J.extra){N=J.extra;while(K<N){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}J.length+=X&(1<<J.extra)-1,X>>>=J.extra,K-=J.extra,J.back+=J.extra}J.was=J.length,J.mode=X0;case X0:for(;;){if($=J.distcode[X&(1<<J.distbits)-1],C=$>>>24,O=$>>>16&255,L=$&65535,C<=K)break;if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if((O&240)===0){F=C,R=O,y=L;for(;;){if($=J.distcode[y+((X&(1<<F+R)-1)>>F)],C=$>>>24,O=$>>>16&255,L=$&65535,F+C<=K)break;if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}X>>>=F,K-=F,J.back+=F}if(X>>>=C,K-=C,J.back+=C,O&64){Q.msg="invalid distance code",J.mode=S;break}J.offset=L,J.extra=O&15,J.mode=U0;case U0:if(J.extra){N=J.extra;while(K<N){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}J.offset+=X&(1<<J.extra)-1,X>>>=J.extra,K-=J.extra,J.back+=J.extra}if(J.offset>J.dmax){Q.msg="invalid distance too far back",J.mode=S;break}J.mode=z0;case z0:if(Y===0)break Q;if(V=k-Y,J.offset>V){if(V=J.offset-V,V>J.whave){if(J.sane){Q.msg="invalid distance too far back",J.mode=S;break}}if(V>J.wnext)V-=J.wnext,Z=J.wsize-V;else Z=J.wnext-V;if(V>J.length)V=J.length;M=J.window}else M=G,Z=z-J.offset,V=J.length;if(V>Y)V=Y;Y-=V,J.length-=V;do G[z++]=M[Z++];while(--V);if(J.length===0)J.mode=dQ;break;case K0:if(Y===0)break Q;G[z++]=J.length,Y--,J.mode=dQ;break;case zJ:if(J.wrap){while(K<32){if(U===0)break Q;U--,X|=j[q++]<<K,K+=8}if(k-=Y,Q.total_out+=k,J.total+=k,J.wrap&4&&k)Q.adler=J.check=J.flags?D(J.check,G,k,z-k):wQ(J.check,G,k,z-k);if(k=Y,J.wrap&4&&(J.flags?X:Y0(X))!==J.check){Q.msg="incorrect data check",J.mode=S;break}X=0,K=0}J.mode=V0;case V0:if(J.wrap&&J.flags){while(K<32){if(U===0)break Q;U--,X+=j[q++]<<K,K+=8}if(J.wrap&4&&X!==(J.total&4294967295)){Q.msg="incorrect length check",J.mode=S;break}X=0,K=0}J.mode=k0;case k0:A=i8;break Q;case S:A=c0;break Q;case d0:return m0;case p0:default:return m}if(Q.next_out=z,Q.avail_out=Y,Q.next_in=q,Q.avail_in=U,J.hold=X,J.bits=K,J.wsize||k!==Q.avail_out&&J.mode<S&&(J.mode<zJ||W!==pJ)){if(o0(Q,Q.output,Q.next_out,k-Q.avail_out));}if(P-=Q.avail_in,k-=Q.avail_out,Q.total_in+=P,Q.total_out+=k,J.total+=k,J.wrap&4&&k)Q.adler=J.check=J.flags?D(J.check,G,k,Q.next_out-k):wQ(J.check,G,k,Q.next_out-k);if(Q.data_type=J.bits+(J.last?64:0)+(J.mode===i?128:0)+(J.mode===mQ||J.mode===UJ?256:0),(P===0&&k===0||W===pJ)&&A===UQ)A=o8;return A},j1=(Q)=>{if(KQ(Q))return m;let W=Q.state;if(W.window)W.window=null;return Q.state=null,UQ},q1=(Q,W)=>{if(KQ(Q))return m;let J=Q.state;if((J.wrap&2)===0)return m;return J.head=W,W.done=!1,UQ},G1=(Q,W)=>{let J=W.length,j,G,q;if(KQ(Q))return m;if(j=Q.state,j.wrap!==0&&j.mode!==iQ)return m;if(j.mode===iQ){if(G=1,G=wQ(G,W,J,0),G!==j.check)return c0}if(q=o0(Q,W,J,J),q)return j.mode=d0,m0;return j.havedict=1,UQ},X1=_0,U1=i0,z1=l0,K1=Q1,V1=r0,k1=W1,Y1=j1,F1=q1,Z1=G1,H1="pako inflate (from Nodeca project)",o={inflateReset:X1,inflateReset2:U1,inflateResetKeep:z1,inflateInit:K1,inflateInit2:V1,inflate:k1,inflateEnd:Y1,inflateGetHeader:F1,inflateSetDictionary:Z1,inflateInfo:H1};function P1(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var B1=P1,n0=Object.prototype.toString,{Z_NO_FLUSH:C1,Z_FINISH:$1,Z_OK:TQ,Z_STREAM_END:kJ,Z_NEED_DICT:YJ,Z_STREAM_ERROR:L1,Z_DATA_ERROR:Z0,Z_MEM_ERROR:N1}=zQ;function IQ(Q){this.options=oQ.assign({chunkSize:65536,windowBits:15,to:""},Q||{});let W=this.options;if(W.raw&&W.windowBits>=0&&W.windowBits<16){if(W.windowBits=-W.windowBits,W.windowBits===0)W.windowBits=-15}if(W.windowBits>=0&&W.windowBits<16&&!(Q&&Q.windowBits))W.windowBits+=32;if(W.windowBits>15&&W.windowBits<48){if((W.windowBits&15)===0)W.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b0,this.strm.avail_out=0;let J=o.inflateInit2(this.strm,W.windowBits);if(J!==TQ)throw new Error(GQ[J]);if(this.header=new B1,o.inflateGetHeader(this.strm,this.header),W.dictionary){if(typeof W.dictionary==="string")W.dictionary=SQ.string2buf(W.dictionary);else if(n0.call(W.dictionary)==="[object ArrayBuffer]")W.dictionary=new Uint8Array(W.dictionary);if(W.raw){if(J=o.inflateSetDictionary(this.strm,W.dictionary),J!==TQ)throw new Error(GQ[J])}}}IQ.prototype.push=function(Q,W){let J=this.strm,j=this.options.chunkSize,G=this.options.dictionary,q,z,U;if(this.ended)return!1;if(W===~~W)z=W;else z=W===!0?$1:C1;if(n0.call(Q)==="[object ArrayBuffer]")J.input=new Uint8Array(Q);else J.input=Q;J.next_in=0,J.avail_in=J.input.length;for(;;){if(J.avail_out===0)J.output=new Uint8Array(j),J.next_out=0,J.avail_out=j;if(q=o.inflate(J,z),q===YJ&&G){if(q=o.inflateSetDictionary(J,G),q===TQ)q=o.inflate(J,z);else if(q===Z0)q=YJ}while(J.avail_in>0&&q===kJ&&J.state.wrap>0&&Q[J.next_in]!==0)o.inflateReset(J),q=o.inflate(J,z);switch(q){case L1:case Z0:case YJ:case N1:return this.onEnd(q),this.ended=!0,!1}if(U=J.avail_out,J.next_out){if(J.avail_out===0||q===kJ)if(this.options.to==="string"){let Y=SQ.utf8border(J.output,J.next_out),X=J.next_out-Y,K=SQ.buf2string(J.output,Y);if(J.next_out=X,J.avail_out=j-X,X)J.output.set(J.output.subarray(Y,Y+X),0);this.onData(K)}else this.onData(J.output.length===J.next_out?J.output:J.output.subarray(0,J.next_out))}if(q===TQ&&U===0)continue;if(q===kJ)return q=o.inflateEnd(this.strm),this.onEnd(q),this.ended=!0,!0;if(J.avail_in===0)break}return!0};IQ.prototype.onData=function(Q){this.chunks.push(Q)};IQ.prototype.onEnd=function(Q){if(Q===TQ)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=oQ.flattenChunks(this.chunks);this.chunks=[],this.err=Q,this.msg=this.strm.msg};function wJ(Q,W){let J=new IQ(W);if(J.push(Q),J.err)throw J.msg||GQ[J.err];return J.result}function v1(Q,W){return W=W||{},W.raw=!0,wJ(Q,W)}var g1=IQ,R1=wJ,x1=v1,O1=wJ,M1=zQ,w1={Inflate:g1,inflate:R1,inflateRaw:x1,ungzip:O1,constants:M1},{Deflate:A1,deflate:S1,deflateRaw:T1,gzip:y1}=b8,{Inflate:D1,inflate:E1,inflateRaw:I1,ungzip:b1}=w1,f1=A1,u1=S1,h1=T1,c1=y1,m1=D1,d1=E1,p1=I1,l1=b1,_1=zQ,aQ={Deflate:f1,deflate:u1,deflateRaw:h1,gzip:c1,Inflate:m1,inflate:d1,inflateRaw:p1,ungzip:l1,constants:_1};class w{static version="4.1.0";static logger=new eQ;icons=new Map;name="failed-to-find-vyi-name";formatVersion=1;constructor(Q){if(w.logger.registerType("Vyi-module","#ff6600"),Q)this.parse(Q)}parse(Q){if(!Q)return this;try{let W;if(typeof Q==="string")try{W=JSON.parse(Q)}catch(J){if(!Q.includes(".vyr")&&!Q.includes(".vyi")){if(W=Q,!W)throw new Error("Non vyi data found from binary string")}else try{W=JSON.parse(Q)}catch(j){if(typeof window==="undefined")W=this.readFileAndGetVYI(Q);else throw new Error("Invalid string input - not valid JSON or file path")}}else if(Q instanceof w)W=Q.export();else if(Q instanceof Object&&!Array.isArray(Q)&&!(Q instanceof ArrayBuffer||Q instanceof Uint8Array))W=Q;else if(Q instanceof ArrayBuffer||Q instanceof Uint8Array)W=this.handleBinaryData(Q);else throw new Error("Error processing: Invalid input type provided.");if(!W||(!W.v||!W.i)&&!W.icons)throw new Error("Non vyi data found.");this.processVyiData(W)}catch(W){w.logger.prefix("Vyi-module").error(\`\${W.message}\`)}return this}readFile(Q){try{let J=new TextEncoder().encode(Q),j=aQ.inflate(J,{to:"string"});return JSON.parse(j)}catch(W){return console.error("File reading failed:",W),null}}readFileAndGetVYI(Q){let J=(()=>({})).readFileSync(Q);return this.handleBinaryData(J)}async fetchAndParseJSON(Q){try{return await(await fetch(Q)).json()}catch(W){throw new Error(\`Failed to fetch or parse JSON from URL: \${W}\`)}}handleBinaryData(Q){let W=Q instanceof ArrayBuffer?new Uint8Array(Q):Q;try{let J=aQ.inflate(W,{to:"string"});if(!J)return null;return JSON.parse(J)}catch(J){try{let j=new TextDecoder().decode(W);if(!j)return null;return JSON.parse(j)}catch(j){return console.error("Decoding failed:",j),null}}}processVyiData(Q){this.icons.clear();let W=Q.i||Q.icons;if(this.formatVersion=Q.v??"format not found",Array.isArray(W))W.forEach((J)=>{if(!Array.isArray(J)&&typeof J==="object"){let j=this.convertOldIconData(J);this.addIcon(j)}else this.addIcon(J)});else w.logger.prefix("Vyi-module").error("Invalid .vyi file! Cannot parse icons.")}convertOldIconData(Q){let W=Array.isArray(Q.frames)?Q.frames.map((j)=>[j.data,j.delay]):[],J=Array.isArray(Q.states)?Q.states.map((j)=>{let G=Array.isArray(j.frames)?j.frames.map((q)=>[q.data,q.delay]):[];return[j.name,j.data,j.delay||100,G]}):[];return[Q.name||"",Q.w||32,Q.h||32,Q.delay||100,Q.data||"",W,J]}addIcon(Q){if(!Q){w.logger.prefix("Vyi-module").error("No icon data passed!");return}if(!(Q instanceof T)&&!Array.isArray(Q)){w.logger.prefix("Vyi-module").error("Invalid icon data type passed!");return}let W=Q instanceof T?Q:new T(Q);return this.icons.set(W.id,W),W.setVyi(this),W}removeIcon(Q){if(!Q)return;if(Q instanceof T){if(this.icons.delete(Q.id))Q.removeVyi()}}removeIconByName(Q){let W=this.getIcon(Q);if(W)this.removeIcon(W)}removeIconById(Q){let W=this.getIconById(Q);if(W)this.removeIcon(W)}getIconNames(){return this.getIcons().map((W)=>W.name)}getIcon(Q){if(typeof Q==="string"){let W=this.getIcons();for(let J=W.length-1;J>=0;J--){let j=W[J];if(j.getName()===Q)return j}}else w.logger.prefix("Vyi-module").error("Invalid name type used!")}getIconCount(){return this.icons.size}getIconById(Q){if(!Q)return;return this.icons.get(Q)||this.getIcons().find((J)=>J.states.has(Q))?.getStateById(Q)}getIcons(){return Array.from(this.icons.values())}rename(Q){if(typeof Q==="string")this.name=Q;else w.logger.prefix("Vyi-module").error("Invalid name type used!")}getName(){return this.name}export(Q){let W={v:this.formatVersion,i:this.getIcons().map((J)=>J.export())};if(Q){let J=new TextEncoder().encode(JSON.stringify(W));return aQ.deflate(J)}return W}}self.onmessage=function(Q){let{id:W,type:J,data:j}=Q.data;try{if(J==="parse"){let q=new w(j).export();self.postMessage({id:W,success:!0,data:q})}}catch(G){let q=G instanceof Error?G.message:"Unknown error";console.error("Worker error:",G),self.postMessage({id:W,success:!1,error:q})}};
|
|
9519
|
-
`;
|
|
9520
|
-
var WORKER_BLOB = new Blob([WORKER_CODE], { type: "application/javascript" });
|
|
9521
|
-
var WORKER_SCRIPT_URL = URL.createObjectURL(WORKER_BLOB);
|
|
9522
9489
|
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9490
|
+
// node_modules/chalk/source/index.js
|
|
9491
|
+
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
9492
|
+
var GENERATOR = Symbol("GENERATOR");
|
|
9493
|
+
var STYLER = Symbol("STYLER");
|
|
9494
|
+
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
9495
|
+
var levelMapping = [
|
|
9496
|
+
"ansi",
|
|
9497
|
+
"ansi",
|
|
9498
|
+
"ansi256",
|
|
9499
|
+
"ansi16m"
|
|
9500
|
+
];
|
|
9501
|
+
var styles2 = Object.create(null);
|
|
9502
|
+
var applyOptions = (object, options = {}) => {
|
|
9503
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
9504
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
9534
9505
|
}
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9506
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
9507
|
+
object.level = options.level === undefined ? colorLevel : options.level;
|
|
9508
|
+
};
|
|
9509
|
+
var chalkFactory = (options) => {
|
|
9510
|
+
const chalk = (...strings2) => strings2.join(" ");
|
|
9511
|
+
applyOptions(chalk, options);
|
|
9512
|
+
Object.setPrototypeOf(chalk, createChalk.prototype);
|
|
9513
|
+
return chalk;
|
|
9514
|
+
};
|
|
9515
|
+
function createChalk(options) {
|
|
9516
|
+
return chalkFactory(options);
|
|
9517
|
+
}
|
|
9518
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
9519
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
9520
|
+
styles2[styleName] = {
|
|
9521
|
+
get() {
|
|
9522
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
9523
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
9524
|
+
return builder;
|
|
9538
9525
|
}
|
|
9539
|
-
|
|
9526
|
+
};
|
|
9527
|
+
}
|
|
9528
|
+
styles2.visible = {
|
|
9529
|
+
get() {
|
|
9530
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
9531
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
9532
|
+
return builder;
|
|
9540
9533
|
}
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9534
|
+
};
|
|
9535
|
+
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
9536
|
+
if (model === "rgb") {
|
|
9537
|
+
if (level === "ansi16m") {
|
|
9538
|
+
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
9545
9539
|
}
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
for (let i = 0;i < this.maxWorkers; i++) {
|
|
9549
|
-
const worker = this.createWorker();
|
|
9550
|
-
this.workers.push(worker);
|
|
9551
|
-
this.availableWorkers.push(worker);
|
|
9540
|
+
if (level === "ansi256") {
|
|
9541
|
+
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
9552
9542
|
}
|
|
9543
|
+
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
9553
9544
|
}
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
worker.onmessage = (event) => {
|
|
9557
|
-
const { id, success, data, error } = event.data;
|
|
9558
|
-
const pending = this.pendingMessages.get(id);
|
|
9559
|
-
if (pending) {
|
|
9560
|
-
this.pendingMessages.delete(id);
|
|
9561
|
-
if (success) {
|
|
9562
|
-
pending.resolve(data);
|
|
9563
|
-
} else {
|
|
9564
|
-
pending.reject(new Error(error));
|
|
9565
|
-
}
|
|
9566
|
-
}
|
|
9567
|
-
};
|
|
9568
|
-
worker.onerror = (error) => {
|
|
9569
|
-
console.error("Worker error:", error);
|
|
9570
|
-
for (const [id, pending] of this.pendingMessages) {
|
|
9571
|
-
pending.reject(new Error(`Worker error: ${error.message}`));
|
|
9572
|
-
}
|
|
9573
|
-
this.pendingMessages.clear();
|
|
9574
|
-
};
|
|
9575
|
-
return worker;
|
|
9545
|
+
if (model === "hex") {
|
|
9546
|
+
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
9576
9547
|
}
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9548
|
+
return ansi_styles_default[type][model](...arguments_);
|
|
9549
|
+
};
|
|
9550
|
+
var usedModels = ["rgb", "hex", "ansi256"];
|
|
9551
|
+
for (const model of usedModels) {
|
|
9552
|
+
styles2[model] = {
|
|
9553
|
+
get() {
|
|
9554
|
+
const { level } = this;
|
|
9555
|
+
return function(...arguments_) {
|
|
9556
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
9557
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
9558
|
+
};
|
|
9580
9559
|
}
|
|
9581
|
-
|
|
9582
|
-
|
|
9560
|
+
};
|
|
9561
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
9562
|
+
styles2[bgModel] = {
|
|
9563
|
+
get() {
|
|
9564
|
+
const { level } = this;
|
|
9565
|
+
return function(...arguments_) {
|
|
9566
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
9567
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
9568
|
+
};
|
|
9583
9569
|
}
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
|
|
9570
|
+
};
|
|
9571
|
+
}
|
|
9572
|
+
var proto = Object.defineProperties(() => {
|
|
9573
|
+
}, {
|
|
9574
|
+
...styles2,
|
|
9575
|
+
level: {
|
|
9576
|
+
enumerable: true,
|
|
9577
|
+
get() {
|
|
9578
|
+
return this[GENERATOR].level;
|
|
9579
|
+
},
|
|
9580
|
+
set(level) {
|
|
9581
|
+
this[GENERATOR].level = level;
|
|
9594
9582
|
}
|
|
9595
9583
|
}
|
|
9596
|
-
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
}, 30000);
|
|
9607
|
-
});
|
|
9584
|
+
});
|
|
9585
|
+
var createStyler = (open2, close, parent) => {
|
|
9586
|
+
let openAll;
|
|
9587
|
+
let closeAll;
|
|
9588
|
+
if (parent === undefined) {
|
|
9589
|
+
openAll = open2;
|
|
9590
|
+
closeAll = close;
|
|
9591
|
+
} else {
|
|
9592
|
+
openAll = parent.openAll + open2;
|
|
9593
|
+
closeAll = close + parent.closeAll;
|
|
9608
9594
|
}
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9595
|
+
return {
|
|
9596
|
+
open: open2,
|
|
9597
|
+
close,
|
|
9598
|
+
openAll,
|
|
9599
|
+
closeAll,
|
|
9600
|
+
parent
|
|
9601
|
+
};
|
|
9602
|
+
};
|
|
9603
|
+
var createBuilder = (self, _styler, _isEmpty) => {
|
|
9604
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
9605
|
+
Object.setPrototypeOf(builder, proto);
|
|
9606
|
+
builder[GENERATOR] = self;
|
|
9607
|
+
builder[STYLER] = _styler;
|
|
9608
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
9609
|
+
return builder;
|
|
9610
|
+
};
|
|
9611
|
+
var applyStyle = (self, string) => {
|
|
9612
|
+
if (self.level <= 0 || !string) {
|
|
9613
|
+
return self[IS_EMPTY] ? "" : string;
|
|
9614
|
+
}
|
|
9615
|
+
let styler = self[STYLER];
|
|
9616
|
+
if (styler === undefined) {
|
|
9617
|
+
return string;
|
|
9618
|
+
}
|
|
9619
|
+
const { openAll, closeAll } = styler;
|
|
9620
|
+
if (string.includes("\x1B")) {
|
|
9621
|
+
while (styler !== undefined) {
|
|
9622
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
9623
|
+
styler = styler.parent;
|
|
9617
9624
|
}
|
|
9618
|
-
this.pendingMessages.clear();
|
|
9619
9625
|
}
|
|
9620
|
-
|
|
9626
|
+
const lfIndex = string.indexOf(`
|
|
9627
|
+
`);
|
|
9628
|
+
if (lfIndex !== -1) {
|
|
9629
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
9630
|
+
}
|
|
9631
|
+
return openAll + string + closeAll;
|
|
9632
|
+
};
|
|
9633
|
+
Object.defineProperties(createChalk.prototype, styles2);
|
|
9634
|
+
var chalk = createChalk();
|
|
9635
|
+
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
9636
|
+
var source_default = chalk;
|
|
9621
9637
|
|
|
9622
9638
|
// src/cli/app-bundler.ts
|
|
9623
|
-
import { promises as fs, existsSync } from "fs";
|
|
9624
|
-
import { join as join3, dirname as dirname3, extname as extname2 } from "path";
|
|
9625
9639
|
var Bun2 = globalThis.Bun;
|
|
9640
|
+
|
|
9641
|
+
// src/cli/theme.ts
|
|
9642
|
+
var theme = {
|
|
9643
|
+
brand: source_default.hex("#10B981"),
|
|
9644
|
+
brandBold: source_default.bold.hex("#10B981"),
|
|
9645
|
+
brandLight: source_default.hex("#34D399"),
|
|
9646
|
+
brandMuted: source_default.hex("#059669"),
|
|
9647
|
+
accent: source_default.bold.hex("#2DD4BF"),
|
|
9648
|
+
success: source_default.bold.hex("#10B981"),
|
|
9649
|
+
successIcon: source_default.bold.hex("#34D399"),
|
|
9650
|
+
warning: source_default.bold.hex("#FBBF24"),
|
|
9651
|
+
warningMuted: source_default.hex("#FCD34D"),
|
|
9652
|
+
error: source_default.bold.hex("#F43F5E"),
|
|
9653
|
+
errorText: source_default.hex("#FB7185"),
|
|
9654
|
+
info: source_default.hex("#38BDF8"),
|
|
9655
|
+
infoBold: source_default.bold.hex("#38BDF8"),
|
|
9656
|
+
alert: source_default.bold.hex("#FBBF24"),
|
|
9657
|
+
title: source_default.bold.white,
|
|
9658
|
+
text: source_default.hex("#F1F5F9"),
|
|
9659
|
+
secondary: source_default.hex("#94A3B8"),
|
|
9660
|
+
muted: source_default.hex("#64748B"),
|
|
9661
|
+
highlight: source_default.bold.hex("#F8FAFC"),
|
|
9662
|
+
url: source_default.bold.hex("#38BDF8").underline,
|
|
9663
|
+
bracket: source_default.hex("#64748B"),
|
|
9664
|
+
divider: source_default.hex("#334155"),
|
|
9665
|
+
bullet: source_default.hex("#10B981")("\u203A"),
|
|
9666
|
+
stepNumber: source_default.bold.hex("#10B981"),
|
|
9667
|
+
white: source_default.white,
|
|
9668
|
+
whiteBold: source_default.white.bold,
|
|
9669
|
+
dim: source_default.hex("#94A3B8"),
|
|
9670
|
+
gray: source_default.hex("#94A3B8")
|
|
9671
|
+
};
|
|
9672
|
+
|
|
9673
|
+
// src/cli/app-bundler.ts
|
|
9626
9674
|
function detectArchitecture(pSrcDir) {
|
|
9627
9675
|
const hasClientEntry = existsSync(join3(pSrcDir, "client", "index.ts"));
|
|
9628
9676
|
const hasServerEntry = existsSync(join3(pSrcDir, "server", "index.ts"));
|
|
@@ -9715,6 +9763,7 @@ async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
|
|
|
9715
9763
|
const startStamp = Date.now();
|
|
9716
9764
|
const clientResult = await Bun2.build({
|
|
9717
9765
|
entrypoints: [join3(srcDir, "index.ts")],
|
|
9766
|
+
root: pProjectRoot,
|
|
9718
9767
|
naming: {
|
|
9719
9768
|
entry: "index.[ext]",
|
|
9720
9769
|
chunk: "[name]-[hash].[ext]",
|
|
@@ -9728,7 +9777,21 @@ async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
|
|
|
9728
9777
|
identifiers: shouldObfuscate,
|
|
9729
9778
|
syntax: true,
|
|
9730
9779
|
whitespace: true
|
|
9731
|
-
} : false
|
|
9780
|
+
} : false,
|
|
9781
|
+
plugins: [
|
|
9782
|
+
{
|
|
9783
|
+
name: "kit-project-resolver",
|
|
9784
|
+
setup(build) {
|
|
9785
|
+
build.onResolve({ filter: /^resource\.json$/ }, () => {
|
|
9786
|
+
const resourcePath = join3(pProjectRoot, "resource.json");
|
|
9787
|
+
if (existsSync(resourcePath)) {
|
|
9788
|
+
return { path: resourcePath };
|
|
9789
|
+
}
|
|
9790
|
+
return;
|
|
9791
|
+
});
|
|
9792
|
+
}
|
|
9793
|
+
}
|
|
9794
|
+
]
|
|
9732
9795
|
});
|
|
9733
9796
|
if (!clientResult.success) {
|
|
9734
9797
|
console.error(clientResult.logs);
|
|
@@ -9745,7 +9808,7 @@ async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
|
|
|
9745
9808
|
}
|
|
9746
9809
|
const elapsed = Date.now() - startStamp;
|
|
9747
9810
|
if (isVerbose) {
|
|
9748
|
-
console.log(
|
|
9811
|
+
console.log(theme.info(`[Kit CLI] Singleplayer Client Build took: ${elapsed}ms`));
|
|
9749
9812
|
}
|
|
9750
9813
|
return { architecture: "single", clientBuildTime: elapsed, success: true };
|
|
9751
9814
|
}
|
|
@@ -9758,6 +9821,7 @@ async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
|
|
|
9758
9821
|
const clientStart = Date.now();
|
|
9759
9822
|
const clientResult = await Bun2.build({
|
|
9760
9823
|
entrypoints: [clientEntry],
|
|
9824
|
+
root: pProjectRoot,
|
|
9761
9825
|
naming: {
|
|
9762
9826
|
entry: "index.[ext]",
|
|
9763
9827
|
chunk: "[name]-[hash].[ext]",
|
|
@@ -9771,7 +9835,21 @@ async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
|
|
|
9771
9835
|
identifiers: shouldObfuscate,
|
|
9772
9836
|
syntax: true,
|
|
9773
9837
|
whitespace: true
|
|
9774
|
-
} : false
|
|
9838
|
+
} : false,
|
|
9839
|
+
plugins: [
|
|
9840
|
+
{
|
|
9841
|
+
name: "kit-project-resolver",
|
|
9842
|
+
setup(build) {
|
|
9843
|
+
build.onResolve({ filter: /^resource\.json$/ }, () => {
|
|
9844
|
+
const resourcePath = join3(pProjectRoot, "resource.json");
|
|
9845
|
+
if (existsSync(resourcePath)) {
|
|
9846
|
+
return { path: resourcePath };
|
|
9847
|
+
}
|
|
9848
|
+
return;
|
|
9849
|
+
});
|
|
9850
|
+
}
|
|
9851
|
+
}
|
|
9852
|
+
]
|
|
9775
9853
|
});
|
|
9776
9854
|
if (!clientResult.success) {
|
|
9777
9855
|
console.error(clientResult.logs);
|
|
@@ -9789,6 +9867,7 @@ async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
|
|
|
9789
9867
|
const serverStart = Date.now();
|
|
9790
9868
|
const serverResult = await Bun2.build({
|
|
9791
9869
|
entrypoints: [serverEntry],
|
|
9870
|
+
root: pProjectRoot,
|
|
9792
9871
|
naming: {
|
|
9793
9872
|
entry: "server.[ext]",
|
|
9794
9873
|
chunk: "[name]-[hash].[ext]",
|
|
@@ -9820,10 +9899,10 @@ async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
|
|
|
9820
9899
|
}
|
|
9821
9900
|
if (isVerbose) {
|
|
9822
9901
|
if (clientElapsed) {
|
|
9823
|
-
console.log(
|
|
9902
|
+
console.log(theme.info(`[Kit CLI] Multiplayer Client Build took: ${clientElapsed}ms`));
|
|
9824
9903
|
}
|
|
9825
9904
|
if (serverElapsed) {
|
|
9826
|
-
console.log(
|
|
9905
|
+
console.log(theme.info(`[Kit CLI] Multiplayer Server Build took: ${serverElapsed}ms`));
|
|
9827
9906
|
}
|
|
9828
9907
|
}
|
|
9829
9908
|
return {
|
|
@@ -9835,16 +9914,21 @@ async function bundleApp(pProjectRoot, pOutDir, pOptions = {}) {
|
|
|
9835
9914
|
}
|
|
9836
9915
|
return { architecture: "none", success: true };
|
|
9837
9916
|
} catch (pError) {
|
|
9838
|
-
console.error(
|
|
9917
|
+
console.error(theme.error(`[Kit CLI Build Error] ${pError}`));
|
|
9918
|
+
if (pError?.logs) {
|
|
9919
|
+
console.error(pError.logs);
|
|
9920
|
+
} else if (pError?.errors) {
|
|
9921
|
+
console.error(pError.errors);
|
|
9922
|
+
}
|
|
9839
9923
|
return { architecture, success: false };
|
|
9840
9924
|
}
|
|
9841
9925
|
}
|
|
9842
9926
|
|
|
9843
9927
|
// src/cli/resource-builder.ts
|
|
9844
9928
|
var log = console.log;
|
|
9845
|
-
var info =
|
|
9846
|
-
var error =
|
|
9847
|
-
var alert =
|
|
9929
|
+
var info = theme.info;
|
|
9930
|
+
var error = theme.error;
|
|
9931
|
+
var alert = theme.alert;
|
|
9848
9932
|
var RESOURCE_TYPES = ["interface", "icon", "map", "sound", "macros"];
|
|
9849
9933
|
var VALID_EXTENSIONS = ["vyint", "vyi", "vym", "vymac", "mp3", "aac", "wav", "m4a", "ogg", "flac"];
|
|
9850
9934
|
var resourceJSON = initializeResourceJSON();
|
|
@@ -10133,10 +10217,12 @@ async function clearResourceTypeDirectories(pBaseDirectory) {
|
|
|
10133
10217
|
try {
|
|
10134
10218
|
const directoryExists = await fs2.stat(pBaseDirectory).then((stat4) => stat4.isDirectory()).catch(() => false);
|
|
10135
10219
|
if (directoryExists) {
|
|
10136
|
-
await fs2.rm(pBaseDirectory, { recursive: true });
|
|
10220
|
+
await fs2.rm(pBaseDirectory, { recursive: true, force: true });
|
|
10137
10221
|
}
|
|
10138
10222
|
} catch (pError) {
|
|
10139
|
-
|
|
10223
|
+
if (pError?.code !== "ENOENT") {
|
|
10224
|
+
log(`${error(`[Error]`)} clearing resource directory: ${pError}`);
|
|
10225
|
+
}
|
|
10140
10226
|
}
|
|
10141
10227
|
}
|
|
10142
10228
|
async function copyFile(pSource, pDestinationDir, pNewName) {
|
|
@@ -10194,9 +10280,9 @@ async function runWatch() {
|
|
|
10194
10280
|
if (shouldBundleApp && existsSync2(srcDir) && srcDir !== resourceInDirectory) {
|
|
10195
10281
|
pathsToWatch.push(srcDir);
|
|
10196
10282
|
}
|
|
10197
|
-
const displayPaths = pathsToWatch.map((p) =>
|
|
10198
|
-
console.log(
|
|
10199
|
-
Watching for changes in: ${displayPaths}`)
|
|
10283
|
+
const displayPaths = pathsToWatch.map((p) => theme.highlight(relative3(projectRootDirectory, p) || p)).join(", ");
|
|
10284
|
+
console.log(`
|
|
10285
|
+
${theme.brandBold("Watching for changes in:")} ${displayPaths}`);
|
|
10200
10286
|
let debounceTimer = null;
|
|
10201
10287
|
let isRebuilding = false;
|
|
10202
10288
|
let queuedChange = null;
|
|
@@ -10210,8 +10296,8 @@ Watching for changes in: ${displayPaths}`));
|
|
|
10210
10296
|
}
|
|
10211
10297
|
isRebuilding = true;
|
|
10212
10298
|
try {
|
|
10213
|
-
console.log(
|
|
10214
|
-
File changed: ${pFilename}
|
|
10299
|
+
console.log(`
|
|
10300
|
+
${theme.accent("\u203A")} ${theme.title("File changed:")} ${theme.highlight(pFilename)} ${theme.secondary("(rebuilding...)")}`);
|
|
10215
10301
|
await runBuild();
|
|
10216
10302
|
} finally {
|
|
10217
10303
|
isRebuilding = false;
|
|
@@ -11398,7 +11484,7 @@ import os2 from "os";
|
|
|
11398
11484
|
// package.json
|
|
11399
11485
|
var package_default = {
|
|
11400
11486
|
name: "@evitcastudio/kit",
|
|
11401
|
-
version: "3.3.
|
|
11487
|
+
version: "3.3.2",
|
|
11402
11488
|
author: "doubleactii 56242467+doubleactii@users.noreply.github.com (https://evitcastudio.com)",
|
|
11403
11489
|
main: "./lib/index.js",
|
|
11404
11490
|
types: "./lib/index.d.ts",
|
|
@@ -11485,6 +11571,8 @@ function getGitUser() {
|
|
|
11485
11571
|
}
|
|
11486
11572
|
}
|
|
11487
11573
|
function checkBun() {
|
|
11574
|
+
if (typeof Bun !== "undefined")
|
|
11575
|
+
return true;
|
|
11488
11576
|
const result = spawnSync("bun", ["--version"], { stdio: "ignore", shell: true });
|
|
11489
11577
|
return !result.error && result.status === 0;
|
|
11490
11578
|
}
|
|
@@ -11528,16 +11616,16 @@ function copyTemplate(pSrc, pDest, pProjectName, pVersion, pAuthor) {
|
|
|
11528
11616
|
}
|
|
11529
11617
|
}
|
|
11530
11618
|
async function processInit(pOptions) {
|
|
11531
|
-
Wt2(
|
|
11619
|
+
Wt2(theme.brand(`Kit CLI v${package_default.version}`));
|
|
11532
11620
|
if (!checkBun()) {
|
|
11533
11621
|
Vt2(`Kit requires the Bun runtime to build and run projects.
|
|
11534
|
-
You can download it manually at ${
|
|
11622
|
+
You can download it manually at ${theme.brand("https://bun.sh/")}`, "Bun Not Found");
|
|
11535
11623
|
const install = await Rt({
|
|
11536
11624
|
message: "Would you like to install Bun automatically now?",
|
|
11537
11625
|
initialValue: true
|
|
11538
11626
|
});
|
|
11539
11627
|
if (Ct(install) || !install) {
|
|
11540
|
-
Nt(`Please install Bun manually to use Kit: ${
|
|
11628
|
+
Nt(`Please install Bun manually to use Kit: ${theme.brand("https://bun.sh/")}
|
|
11541
11629
|
Note: Kit projects cannot build or run without Bun.`);
|
|
11542
11630
|
process.exit(1);
|
|
11543
11631
|
}
|
|
@@ -11546,7 +11634,7 @@ Note: Kit projects cannot build or run without Bun.`);
|
|
|
11546
11634
|
const success = installBun();
|
|
11547
11635
|
if (!success) {
|
|
11548
11636
|
sInstall.stop(source_default.red("Automatic installation failed."));
|
|
11549
|
-
Vt2(`Please install Bun manually: ${
|
|
11637
|
+
Vt2(`Please install Bun manually: ${theme.brand("https://bun.sh/")}`, "Manual Installation Required");
|
|
11550
11638
|
process.exit(1);
|
|
11551
11639
|
}
|
|
11552
11640
|
sInstall.stop();
|
|
@@ -11605,7 +11693,7 @@ Note: Kit projects cannot build or run without Bun.`);
|
|
|
11605
11693
|
if (fs3.existsSync(projectDir)) {
|
|
11606
11694
|
if (isInteractive) {
|
|
11607
11695
|
const overwrite = await Rt({
|
|
11608
|
-
message: `Directory ${
|
|
11696
|
+
message: `Directory ${theme.brand(projectName)} already exists. Overwrite?`,
|
|
11609
11697
|
initialValue: false
|
|
11610
11698
|
});
|
|
11611
11699
|
if (Ct(overwrite) || !overwrite) {
|
|
@@ -11619,7 +11707,7 @@ Error: Destination directory '${projectName}' already exists. Use --force (-f) t
|
|
|
11619
11707
|
}
|
|
11620
11708
|
}
|
|
11621
11709
|
const s = be();
|
|
11622
|
-
s.start(`Scaffolding ${
|
|
11710
|
+
s.start(`Scaffolding ${theme.brand(projectName)}...`);
|
|
11623
11711
|
try {
|
|
11624
11712
|
const projectPath = path.join(process.cwd(), projectName);
|
|
11625
11713
|
if (fs3.existsSync(projectPath)) {
|
|
@@ -11656,24 +11744,24 @@ Error: Destination directory '${projectName}' already exists. Use --force (-f) t
|
|
|
11656
11744
|
installSpinner.start("Installing project dependencies with Bun...");
|
|
11657
11745
|
const installResult = spawnSync("bun", ["install"], { cwd: projectPath, stdio: "ignore", shell: true });
|
|
11658
11746
|
if (installResult.status === 0) {
|
|
11659
|
-
installSpinner.stop(
|
|
11747
|
+
installSpinner.stop(theme.success("Dependencies installed successfully!"));
|
|
11660
11748
|
} else {
|
|
11661
|
-
installSpinner.stop(
|
|
11749
|
+
installSpinner.stop(theme.warning("Dependency installation finished with warnings."));
|
|
11662
11750
|
}
|
|
11663
11751
|
}
|
|
11664
|
-
console.log(`${
|
|
11665
|
-
console.log(`${
|
|
11666
|
-
console.log(`${
|
|
11752
|
+
console.log(`${theme.brand("\u2502")}`);
|
|
11753
|
+
console.log(`${theme.brand("\u2502")} ${theme.title("Next steps:")}`);
|
|
11754
|
+
console.log(`${theme.brand("\u2502")} ${theme.stepNumber("1.")} cd ${theme.brandBold(projectName)}`);
|
|
11667
11755
|
if (!shouldInstall) {
|
|
11668
|
-
console.log(`${
|
|
11669
|
-
console.log(`${
|
|
11756
|
+
console.log(`${theme.brand("\u2502")} ${theme.stepNumber("2.")} bun install`);
|
|
11757
|
+
console.log(`${theme.brand("\u2502")} ${theme.stepNumber("3.")} bun run build`);
|
|
11670
11758
|
} else {
|
|
11671
|
-
console.log(`${
|
|
11759
|
+
console.log(`${theme.brand("\u2502")} ${theme.stepNumber("2.")} bun run build`);
|
|
11672
11760
|
}
|
|
11673
|
-
console.log(`${
|
|
11674
|
-
Gt(
|
|
11761
|
+
console.log(`${theme.brand("\u2502")}`);
|
|
11762
|
+
Gt(theme.brandBold("Happy coding!"));
|
|
11675
11763
|
} catch (pError) {
|
|
11676
|
-
s.stop(
|
|
11764
|
+
s.stop(theme.error("Scaffolding failed."));
|
|
11677
11765
|
if (projectName) {
|
|
11678
11766
|
const projectPath = path.join(process.cwd(), projectName);
|
|
11679
11767
|
if (fs3.existsSync(projectPath)) {
|
|
@@ -11687,29 +11775,38 @@ Error: Destination directory '${projectName}' already exists. Use --force (-f) t
|
|
|
11687
11775
|
|
|
11688
11776
|
// src/cli/doctor.ts
|
|
11689
11777
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
11690
|
-
import { existsSync as existsSync3, readFileSync } from "fs";
|
|
11778
|
+
import { existsSync as existsSync3, readdirSync, readFileSync } from "fs";
|
|
11691
11779
|
import { join as join5 } from "path";
|
|
11692
11780
|
async function processDoctor(pOptions = {}) {
|
|
11693
11781
|
const isVerbose2 = Boolean(pOptions.verbose);
|
|
11694
11782
|
const results = [];
|
|
11695
11783
|
console.log(`
|
|
11696
|
-
${
|
|
11784
|
+
${theme.brandBold("Kit Doctor")} ${source_default.dim("-")} Environment & Project Health Check
|
|
11697
11785
|
`);
|
|
11698
|
-
|
|
11699
|
-
if (!bunCheck.error && bunCheck.status === 0) {
|
|
11786
|
+
if (typeof Bun !== "undefined") {
|
|
11700
11787
|
results.push({
|
|
11701
11788
|
category: "Runtime",
|
|
11702
11789
|
title: "Bun Runtime",
|
|
11703
11790
|
passed: true,
|
|
11704
|
-
details: `
|
|
11791
|
+
details: `v${Bun.version}`
|
|
11705
11792
|
});
|
|
11706
11793
|
} else {
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11794
|
+
const bunCheck = spawnSync2("bun", ["--version"], { encoding: "utf8", shell: true });
|
|
11795
|
+
if (!bunCheck.error && bunCheck.status === 0) {
|
|
11796
|
+
results.push({
|
|
11797
|
+
category: "Runtime",
|
|
11798
|
+
title: "Bun Runtime",
|
|
11799
|
+
passed: true,
|
|
11800
|
+
details: `v${bunCheck.stdout.trim()}`
|
|
11801
|
+
});
|
|
11802
|
+
} else {
|
|
11803
|
+
results.push({
|
|
11804
|
+
category: "Runtime",
|
|
11805
|
+
title: "Bun Runtime",
|
|
11806
|
+
passed: false,
|
|
11807
|
+
details: "Bun is not installed or not in PATH. Download at https://bun.sh/"
|
|
11808
|
+
});
|
|
11809
|
+
}
|
|
11713
11810
|
}
|
|
11714
11811
|
const gitCheck = spawnSync2("git", ["--version"], { encoding: "utf8", shell: true });
|
|
11715
11812
|
if (!gitCheck.error && gitCheck.status === 0) {
|
|
@@ -11734,28 +11831,44 @@ async function processDoctor(pOptions = {}) {
|
|
|
11734
11831
|
try {
|
|
11735
11832
|
const rawPkg = readFileSync(pkgPath, "utf8");
|
|
11736
11833
|
const pkg = JSON.parse(rawPkg);
|
|
11737
|
-
const
|
|
11834
|
+
const isKitCoreRepo = pkg.name === "@evitcastudio/kit";
|
|
11835
|
+
const kitVersionSpec = pkg.dependencies?.["@evitcastudio/kit"] || pkg.devDependencies?.["@evitcastudio/kit"];
|
|
11836
|
+
const hasKitDependency = Boolean(kitVersionSpec || isKitCoreRepo);
|
|
11738
11837
|
results.push({
|
|
11739
11838
|
category: "Project",
|
|
11740
11839
|
title: "package.json configuration",
|
|
11741
11840
|
passed: true,
|
|
11742
|
-
details:
|
|
11841
|
+
details: `${pkg.name || "unnamed"}${pkg.version ? ` v${pkg.version}` : ""}`
|
|
11743
11842
|
});
|
|
11843
|
+
let kitDependencyDetails = "Missing @evitcastudio/kit dependency in package.json";
|
|
11844
|
+
if (isKitCoreRepo) {
|
|
11845
|
+
kitDependencyDetails = "Core Framework Repository";
|
|
11846
|
+
} else if (kitVersionSpec) {
|
|
11847
|
+
kitDependencyDetails = `@evitcastudio/kit: ${kitVersionSpec}`;
|
|
11848
|
+
}
|
|
11744
11849
|
results.push({
|
|
11745
11850
|
category: "Project",
|
|
11746
11851
|
title: "Kit framework dependency",
|
|
11747
11852
|
passed: hasKitDependency,
|
|
11748
|
-
details:
|
|
11853
|
+
details: kitDependencyDetails
|
|
11749
11854
|
});
|
|
11750
|
-
const isKitCoreRepo = pkg.name === "@evitcastudio/kit";
|
|
11751
11855
|
if (!isKitCoreRepo) {
|
|
11752
11856
|
const resourcesDir = join5(cwd, "src", "resources");
|
|
11753
11857
|
const hasResources = existsSync3(resourcesDir);
|
|
11858
|
+
let assetDetails = "src/resources directory not found";
|
|
11859
|
+
if (hasResources) {
|
|
11860
|
+
try {
|
|
11861
|
+
const items = readdirSync(resourcesDir, { recursive: true });
|
|
11862
|
+
assetDetails = `Ready (${items.length} asset${items.length === 1 ? "" : "s"})`;
|
|
11863
|
+
} catch {
|
|
11864
|
+
assetDetails = "Asset directory present";
|
|
11865
|
+
}
|
|
11866
|
+
}
|
|
11754
11867
|
results.push({
|
|
11755
11868
|
category: "Project",
|
|
11756
11869
|
title: "Asset Directory (src/resources)",
|
|
11757
11870
|
passed: hasResources,
|
|
11758
|
-
details:
|
|
11871
|
+
details: assetDetails
|
|
11759
11872
|
});
|
|
11760
11873
|
}
|
|
11761
11874
|
const hasClientEntry = existsSync3(join5(cwd, "src", "client", "index.ts"));
|
|
@@ -11799,11 +11912,11 @@ async function processDoctor(pOptions = {}) {
|
|
|
11799
11912
|
const buildPipelinePassed = hasBuildScript || hasKitBuildScript;
|
|
11800
11913
|
let buildDetails = "No build pipeline configured";
|
|
11801
11914
|
if (hasKitBuildScript && hasBuildScript) {
|
|
11802
|
-
buildDetails =
|
|
11915
|
+
buildDetails = 'Native CLI build ("kit build") + bun-build.ts';
|
|
11803
11916
|
} else if (hasKitBuildScript) {
|
|
11804
|
-
buildDetails =
|
|
11917
|
+
buildDetails = 'Native CLI build ("kit build")';
|
|
11805
11918
|
} else if (hasBuildScript) {
|
|
11806
|
-
buildDetails = "Legacy bun-build.ts
|
|
11919
|
+
buildDetails = "Legacy build script (bun-build.ts)";
|
|
11807
11920
|
}
|
|
11808
11921
|
results.push({
|
|
11809
11922
|
category: "Project",
|
|
@@ -11821,11 +11934,12 @@ async function processDoctor(pOptions = {}) {
|
|
|
11821
11934
|
}
|
|
11822
11935
|
let allPassed = true;
|
|
11823
11936
|
for (const res of results) {
|
|
11824
|
-
const icon = res.passed ?
|
|
11825
|
-
const
|
|
11826
|
-
|
|
11827
|
-
|
|
11828
|
-
|
|
11937
|
+
const icon = res.passed ? theme.successIcon("\u2713") : theme.error("\u2717");
|
|
11938
|
+
const categoryBadge = `${theme.bracket("[")}${theme.brandBold(res.category)}${theme.bracket("]")}`;
|
|
11939
|
+
const titleText = res.passed ? theme.title(res.title) : theme.error(res.title);
|
|
11940
|
+
console.log(` ${icon} ${categoryBadge} ${titleText}`);
|
|
11941
|
+
if (res.details) {
|
|
11942
|
+
console.log(` ${theme.secondary(res.details)}`);
|
|
11829
11943
|
}
|
|
11830
11944
|
if (!res.passed) {
|
|
11831
11945
|
allPassed = false;
|
|
@@ -11834,10 +11948,10 @@ async function processDoctor(pOptions = {}) {
|
|
|
11834
11948
|
console.log(`
|
|
11835
11949
|
`);
|
|
11836
11950
|
if (allPassed) {
|
|
11837
|
-
console.log(` ${
|
|
11951
|
+
console.log(` ${theme.successIcon("\u2714")} ${theme.brandBold("All doctor diagnostics passed!")}
|
|
11838
11952
|
`);
|
|
11839
11953
|
} else {
|
|
11840
|
-
console.log(` ${
|
|
11954
|
+
console.log(` ${theme.warning("\u25B2 Some issues were detected. Check the items above.")}
|
|
11841
11955
|
`);
|
|
11842
11956
|
}
|
|
11843
11957
|
return allPassed;
|
|
@@ -11876,13 +11990,13 @@ export class ${pClassName} extends KitPlugin {
|
|
|
11876
11990
|
async function processCreate(pOptions) {
|
|
11877
11991
|
const { type, name, verbose } = pOptions;
|
|
11878
11992
|
if (!type || !name) {
|
|
11879
|
-
console.error(
|
|
11993
|
+
console.error(theme.error(`
|
|
11880
11994
|
Error: Both type and name are required. Usage: kit create <type> <name>`));
|
|
11881
11995
|
process.exit(1);
|
|
11882
11996
|
}
|
|
11883
11997
|
const normalizedType = type.toLowerCase();
|
|
11884
11998
|
if (normalizedType !== "plugin") {
|
|
11885
|
-
console.error(
|
|
11999
|
+
console.error(theme.error(`
|
|
11886
12000
|
Error: Unknown create type '${type}'. Supported types: 'plugin'`));
|
|
11887
12001
|
process.exit(1);
|
|
11888
12002
|
}
|
|
@@ -11894,21 +12008,21 @@ Error: Unknown create type '${type}'. Supported types: 'plugin'`));
|
|
|
11894
12008
|
await fs4.mkdir(pluginsDir, { recursive: true });
|
|
11895
12009
|
const fileExists = await fs4.stat(targetPath).then(() => true).catch(() => false);
|
|
11896
12010
|
if (fileExists) {
|
|
11897
|
-
console.error(
|
|
12011
|
+
console.error(theme.error(`
|
|
11898
12012
|
Error: File already exists at ${targetPath}`));
|
|
11899
12013
|
process.exit(1);
|
|
11900
12014
|
}
|
|
11901
12015
|
const sourceCode = generatePluginSource(className, className);
|
|
11902
12016
|
await fs4.writeFile(targetPath, sourceCode, "utf8");
|
|
11903
12017
|
console.log(`
|
|
11904
|
-
${
|
|
12018
|
+
${theme.successIcon("\u2713")} Created plugin ${theme.brandBold(className)} at ${theme.secondary(targetPath)}
|
|
11905
12019
|
`);
|
|
11906
12020
|
if (verbose) {
|
|
11907
|
-
console.log(
|
|
12021
|
+
console.log(theme.secondary(sourceCode));
|
|
11908
12022
|
}
|
|
11909
12023
|
} catch (pError) {
|
|
11910
12024
|
const message = pError instanceof Error ? pError.message : String(pError);
|
|
11911
|
-
console.error(
|
|
12025
|
+
console.error(theme.error(`
|
|
11912
12026
|
Error creating plugin: ${message}`));
|
|
11913
12027
|
process.exit(1);
|
|
11914
12028
|
}
|
|
@@ -11940,7 +12054,7 @@ async function processHost(pOptions = {}) {
|
|
|
11940
12054
|
const architecture = detectArchitecture(join7(cwd, "src"));
|
|
11941
12055
|
if (!existsSync4(distDir)) {
|
|
11942
12056
|
const message = `Target directory "${distDir}" does not exist. Run "kit build" or use "kit host -b" first.`;
|
|
11943
|
-
console.error(
|
|
12057
|
+
console.error(theme.error(`
|
|
11944
12058
|
[Kit Host] ${message}
|
|
11945
12059
|
`));
|
|
11946
12060
|
return { success: false, message };
|
|
@@ -11949,14 +12063,14 @@ async function processHost(pOptions = {}) {
|
|
|
11949
12063
|
const serverJsPath = join7(distDir, "server.js");
|
|
11950
12064
|
if (!existsSync4(serverJsPath)) {
|
|
11951
12065
|
const message = `Cannot host multiplayer project: "${serverJsPath}" was not found. Please compile the server first using "kit build".`;
|
|
11952
|
-
console.error(
|
|
12066
|
+
console.error(theme.error(`
|
|
11953
12067
|
[Kit Host] ${message}
|
|
11954
12068
|
`));
|
|
11955
12069
|
return { success: false, message };
|
|
11956
12070
|
}
|
|
11957
|
-
console.log(
|
|
11958
|
-
|
|
11959
|
-
`)
|
|
12071
|
+
console.log(`
|
|
12072
|
+
${theme.brandBold("Kit Multiplayer Server")} ${theme.muted("\u2500")} ${theme.secondary(distDir)}
|
|
12073
|
+
`);
|
|
11960
12074
|
let serverSettingsPort = port;
|
|
11961
12075
|
const settingsPath = join7(distDir, "settings.json");
|
|
11962
12076
|
if (existsSync4(settingsPath)) {
|
|
@@ -11973,7 +12087,15 @@ Starting Multiplayer Server from ${source_default.bold(distDir)}...
|
|
|
11973
12087
|
stderr: "inherit",
|
|
11974
12088
|
stdin: "inherit"
|
|
11975
12089
|
});
|
|
11976
|
-
console.log(
|
|
12090
|
+
console.log(` ${theme.successIcon("\u2713")} ${theme.title("Multiplayer server process spawned")} ${theme.secondary(`(configured port: ${serverSettingsPort})`)}`);
|
|
12091
|
+
console.log(` ${theme.title("Local:")} ${theme.url(`http://localhost:${serverSettingsPort}`)}`);
|
|
12092
|
+
const lanIp2 = getNetworkAddress();
|
|
12093
|
+
if (lanIp2 !== "localhost") {
|
|
12094
|
+
console.log(` ${theme.title("Network:")} ${theme.url(`http://${lanIp2}:${serverSettingsPort}`)}`);
|
|
12095
|
+
}
|
|
12096
|
+
console.log(theme.muted(`
|
|
12097
|
+
Press Ctrl+C to stop the server
|
|
12098
|
+
`));
|
|
11977
12099
|
process.on("SIGINT", () => {
|
|
11978
12100
|
proc.kill();
|
|
11979
12101
|
process.exit(0);
|
|
@@ -11988,7 +12110,7 @@ Starting Multiplayer Server from ${source_default.bold(distDir)}...
|
|
|
11988
12110
|
const indexPath = join7(distDir, "index.html");
|
|
11989
12111
|
if (!existsSync4(indexPath)) {
|
|
11990
12112
|
const message = `Missing entrypoint: "${indexPath}" was not found in dist. Run "kit build" or use "kit host -b" to compile.`;
|
|
11991
|
-
console.error(
|
|
12113
|
+
console.error(theme.error(`
|
|
11992
12114
|
[Kit Host] ${message}
|
|
11993
12115
|
`));
|
|
11994
12116
|
return { success: false, message };
|
|
@@ -12002,26 +12124,26 @@ Starting Multiplayer Server from ${source_default.bold(distDir)}...
|
|
|
12002
12124
|
const file = Bun.file(join7(distDir, target));
|
|
12003
12125
|
if (!await file.exists()) {
|
|
12004
12126
|
if (pOptions.verbose) {
|
|
12005
|
-
console.warn(
|
|
12127
|
+
console.warn(theme.warning(`[Kit Host] 404 Not Found: ${target}`));
|
|
12006
12128
|
}
|
|
12007
12129
|
return new Response("Not Found", { status: 404 });
|
|
12008
12130
|
}
|
|
12009
12131
|
return new Response(file);
|
|
12010
12132
|
}
|
|
12011
12133
|
});
|
|
12012
|
-
console.log(
|
|
12013
|
-
Kit Game Host Server
|
|
12014
|
-
`)
|
|
12015
|
-
console.log(` ${
|
|
12134
|
+
console.log(`
|
|
12135
|
+
${theme.brandBold("Kit Game Host Server")}
|
|
12136
|
+
`);
|
|
12137
|
+
console.log(` ${theme.title("Local:")} ${theme.url(`http://localhost:${server.port}`)}`);
|
|
12016
12138
|
if (lanIp !== "localhost") {
|
|
12017
|
-
console.log(` ${
|
|
12139
|
+
console.log(` ${theme.title("Network:")} ${theme.url(`http://${lanIp}:${server.port}`)}`);
|
|
12018
12140
|
}
|
|
12019
|
-
console.log(
|
|
12020
|
-
Serving files from: ${distDir}`));
|
|
12021
|
-
console.log(
|
|
12141
|
+
console.log(theme.secondary(`
|
|
12142
|
+
Serving files from: ${distDir}`));
|
|
12143
|
+
console.log(theme.muted(` Press Ctrl+C to stop the server
|
|
12022
12144
|
`));
|
|
12023
12145
|
process.on("SIGINT", () => {
|
|
12024
|
-
console.log(
|
|
12146
|
+
console.log(theme.warning(`
|
|
12025
12147
|
Shutting down host server...`));
|
|
12026
12148
|
server.stop();
|
|
12027
12149
|
process.exit(0);
|
|
@@ -12065,20 +12187,20 @@ var formatHelp = (pCmd) => {
|
|
|
12065
12187
|
const isRoot = pCmd === program2;
|
|
12066
12188
|
const desc = pCmd.description() || package_default["cli-description"];
|
|
12067
12189
|
let output = `
|
|
12068
|
-
${
|
|
12190
|
+
${theme.brandBold("Kit CLI")} ${theme.muted("\u2500")} ${theme.title(desc)}
|
|
12069
12191
|
`;
|
|
12070
|
-
output += ` ${
|
|
12192
|
+
output += ` ${theme.secondary("Version")} ${theme.brandBold(`v${package_default.version}`)}
|
|
12071
12193
|
|
|
12072
12194
|
`;
|
|
12073
|
-
const usage = pCmd.usage() || (isRoot ? `${
|
|
12074
|
-
output += ` ${
|
|
12195
|
+
const usage = pCmd.usage() || (isRoot ? `${theme.secondary("<command>")} ${theme.muted("[options]")}` : `${theme.muted("[options]")}`);
|
|
12196
|
+
output += ` ${theme.title("Usage:")} ${theme.brandBold("kit")} ${!isRoot ? theme.brand(pCmd.name() + " ") : ""}${usage}
|
|
12075
12197
|
|
|
12076
12198
|
`;
|
|
12077
12199
|
if (isRoot) {
|
|
12078
|
-
output += ` ${
|
|
12200
|
+
output += ` ${theme.title("Commands:")}
|
|
12079
12201
|
`;
|
|
12080
12202
|
pCmd.commands.filter((cmd) => cmd.name() !== "help").forEach((cmd) => {
|
|
12081
|
-
output += ` ${
|
|
12203
|
+
output += ` ${theme.brandBold(cmd.name().padEnd(14))} ${theme.secondary(cmd.description())}
|
|
12082
12204
|
`;
|
|
12083
12205
|
});
|
|
12084
12206
|
output += `
|
|
@@ -12092,10 +12214,10 @@ var formatHelp = (pCmd) => {
|
|
|
12092
12214
|
return true;
|
|
12093
12215
|
});
|
|
12094
12216
|
if (options.length > 0) {
|
|
12095
|
-
output += ` ${
|
|
12217
|
+
output += ` ${theme.title(isRoot ? "Options:" : "Command Options:")}
|
|
12096
12218
|
`;
|
|
12097
12219
|
options.forEach((opt) => {
|
|
12098
|
-
output += ` ${
|
|
12220
|
+
output += ` ${theme.warningMuted(opt.flags.padEnd(24))} ${theme.secondary(opt.description)}
|
|
12099
12221
|
`;
|
|
12100
12222
|
});
|
|
12101
12223
|
output += `
|
|
@@ -12108,10 +12230,10 @@ var formatHelp = (pCmd) => {
|
|
|
12108
12230
|
return true;
|
|
12109
12231
|
});
|
|
12110
12232
|
if (globalOptions.length > 0) {
|
|
12111
|
-
output += ` ${
|
|
12233
|
+
output += ` ${theme.title("Global Options:")}
|
|
12112
12234
|
`;
|
|
12113
12235
|
globalOptions.forEach((opt) => {
|
|
12114
|
-
output += ` ${
|
|
12236
|
+
output += ` ${theme.warningMuted(opt.flags.padEnd(24))} ${theme.secondary(opt.description)}
|
|
12115
12237
|
`;
|
|
12116
12238
|
});
|
|
12117
12239
|
output += `
|
|
@@ -12120,43 +12242,43 @@ var formatHelp = (pCmd) => {
|
|
|
12120
12242
|
}
|
|
12121
12243
|
const name = pCmd.name();
|
|
12122
12244
|
if (isRoot || name === "init" || name === "build" || name === "create" || name === "doctor") {
|
|
12123
|
-
output += ` ${
|
|
12245
|
+
output += ` ${theme.title("Examples:")}
|
|
12124
12246
|
`;
|
|
12125
12247
|
if (isRoot || name === "init") {
|
|
12126
|
-
output += ` ${
|
|
12248
|
+
output += ` ${theme.brand("kit init")}
|
|
12127
12249
|
`;
|
|
12128
|
-
output += ` ${
|
|
12250
|
+
output += ` ${theme.brand("kit init my-game --single --install")}
|
|
12129
12251
|
`;
|
|
12130
12252
|
}
|
|
12131
12253
|
if (isRoot || name === "build") {
|
|
12132
|
-
output += ` ${
|
|
12254
|
+
output += ` ${theme.brand("kit build --in ./src/resources --out ./dist")}
|
|
12133
12255
|
`;
|
|
12134
|
-
output += ` ${
|
|
12256
|
+
output += ` ${theme.brand("kit build --in ./src/resources --out ./dist --watch")}
|
|
12135
12257
|
`;
|
|
12136
12258
|
}
|
|
12137
12259
|
if (isRoot || name === "create") {
|
|
12138
|
-
output += ` ${
|
|
12260
|
+
output += ` ${theme.brand("kit create plugin Inventory")}
|
|
12139
12261
|
`;
|
|
12140
12262
|
}
|
|
12141
12263
|
if (isRoot || name === "doctor") {
|
|
12142
|
-
output += ` ${
|
|
12264
|
+
output += ` ${theme.brand("kit doctor")}
|
|
12143
12265
|
`;
|
|
12144
12266
|
}
|
|
12145
12267
|
if (isRoot || name === "host") {
|
|
12146
|
-
output += ` ${
|
|
12268
|
+
output += ` ${theme.brand("kit host")}
|
|
12147
12269
|
`;
|
|
12148
|
-
output += ` ${
|
|
12270
|
+
output += ` ${theme.brand("kit host -p 8080 -b")}
|
|
12149
12271
|
`;
|
|
12150
12272
|
}
|
|
12151
12273
|
if (isRoot) {
|
|
12152
|
-
output += ` ${
|
|
12274
|
+
output += ` ${theme.brand("kit build --help")}
|
|
12153
12275
|
`;
|
|
12154
12276
|
}
|
|
12155
12277
|
output += `
|
|
12156
12278
|
`;
|
|
12157
12279
|
}
|
|
12158
12280
|
if (isRoot) {
|
|
12159
|
-
output += ` ${
|
|
12281
|
+
output += ` ${theme.accent("Tip:")} ${theme.secondary("Use ")}${theme.brandBold("kit <command> --help")}${theme.secondary(" to view detailed options for any command.")}
|
|
12160
12282
|
`;
|
|
12161
12283
|
}
|
|
12162
12284
|
return output;
|