Buckets:
import { dotnet } from './_framework/dotnet.js';
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.js
var require_jszip_min = __commonJS({
"node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.js"(exports, module) {
!function(e) {
if ("object" == typeof exports && "undefined" != typeof module) module.exports = e();
else if ("function" == typeof define && define.amd) define([], e);
else {
("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).JSZip = e();
}
}(function() {
return function s(a, o, h2) {
function u(r, e2) {
if (!o[r]) {
if (!a[r]) {
var t = "function" == typeof __require && __require;
if (!e2 && t) return t(r, true);
if (l) return l(r, true);
var n = new Error("Cannot find module '" + r + "'");
throw n.code = "MODULE_NOT_FOUND", n;
}
var i = o[r] = { exports: {} };
a[r][0].call(i.exports, function(e3) {
var t2 = a[r][1][e3];
return u(t2 || e3);
}, i, i.exports, s, a, o, h2);
}
return o[r].exports;
}
for (var l = "function" == typeof __require && __require, e = 0; e < h2.length; e++) u(h2[e]);
return u;
}({ 1: [function(e, t, r) {
"use strict";
var d = e("./utils"), c = e("./support"), p = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
r.encode = function(e2) {
for (var t2, r2, n, i, s, a, o, h2 = [], u = 0, l = e2.length, f = l, c2 = "string" !== d.getTypeOf(e2); u < e2.length; ) f = l - u, n = c2 ? (t2 = e2[u++], r2 = u < l ? e2[u++] : 0, u < l ? e2[u++] : 0) : (t2 = e2.charCodeAt(u++), r2 = u < l ? e2.charCodeAt(u++) : 0, u < l ? e2.charCodeAt(u++) : 0), i = t2 >> 2, s = (3 & t2) << 4 | r2 >> 4, a = 1 < f ? (15 & r2) << 2 | n >> 6 : 64, o = 2 < f ? 63 & n : 64, h2.push(p.charAt(i) + p.charAt(s) + p.charAt(a) + p.charAt(o));
return h2.join("");
}, r.decode = function(e2) {
var t2, r2, n, i, s, a, o = 0, h2 = 0, u = "data:";
if (e2.substr(0, u.length) === u) throw new Error("Invalid base64 input, it looks like a data url.");
var l, f = 3 * (e2 = e2.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4;
if (e2.charAt(e2.length - 1) === p.charAt(64) && f--, e2.charAt(e2.length - 2) === p.charAt(64) && f--, f % 1 != 0) throw new Error("Invalid base64 input, bad content length.");
for (l = c.uint8array ? new Uint8Array(0 | f) : new Array(0 | f); o < e2.length; ) t2 = p.indexOf(e2.charAt(o++)) << 2 | (i = p.indexOf(e2.charAt(o++))) >> 4, r2 = (15 & i) << 4 | (s = p.indexOf(e2.charAt(o++))) >> 2, n = (3 & s) << 6 | (a = p.indexOf(e2.charAt(o++))), l[h2++] = t2, 64 !== s && (l[h2++] = r2), 64 !== a && (l[h2++] = n);
return l;
};
}, { "./support": 30, "./utils": 32 }], 2: [function(e, t, r) {
"use strict";
var n = e("./external"), i = e("./stream/DataWorker"), s = e("./stream/Crc32Probe"), a = e("./stream/DataLengthProbe");
function o(e2, t2, r2, n2, i2) {
this.compressedSize = e2, this.uncompressedSize = t2, this.crc32 = r2, this.compression = n2, this.compressedContent = i2;
}
o.prototype = { getContentWorker: function() {
var e2 = new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")), t2 = this;
return e2.on("end", function() {
if (this.streamInfo.data_length !== t2.uncompressedSize) throw new Error("Bug : uncompressed data size mismatch");
}), e2;
}, getCompressedWorker: function() {
return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression);
} }, o.createWorkerFrom = function(e2, t2, r2) {
return e2.pipe(new s()).pipe(new a("uncompressedSize")).pipe(t2.compressWorker(r2)).pipe(new a("compressedSize")).withStreamInfo("compression", t2);
}, t.exports = o;
}, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(e, t, r) {
"use strict";
var n = e("./stream/GenericWorker");
r.STORE = { magic: "\0\0", compressWorker: function() {
return new n("STORE compression");
}, uncompressWorker: function() {
return new n("STORE decompression");
} }, r.DEFLATE = e("./flate");
}, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(e, t, r) {
"use strict";
var n = e("./utils");
var o = function() {
for (var e2, t2 = [], r2 = 0; r2 < 256; r2++) {
e2 = r2;
for (var n2 = 0; n2 < 8; n2++) e2 = 1 & e2 ? 3988292384 ^ e2 >>> 1 : e2 >>> 1;
t2[r2] = e2;
}
return t2;
}();
t.exports = function(e2, t2) {
return void 0 !== e2 && e2.length ? "string" !== n.getTypeOf(e2) ? function(e3, t3, r2, n2) {
var i = o, s = n2 + r2;
e3 ^= -1;
for (var a = n2; a < s; a++) e3 = e3 >>> 8 ^ i[255 & (e3 ^ t3[a])];
return -1 ^ e3;
}(0 | t2, e2, e2.length, 0) : function(e3, t3, r2, n2) {
var i = o, s = n2 + r2;
e3 ^= -1;
for (var a = n2; a < s; a++) e3 = e3 >>> 8 ^ i[255 & (e3 ^ t3.charCodeAt(a))];
return -1 ^ e3;
}(0 | t2, e2, e2.length, 0) : 0;
};
}, { "./utils": 32 }], 5: [function(e, t, r) {
"use strict";
r.base64 = false, r.binary = false, r.dir = false, r.createFolders = true, r.date = null, r.compression = null, r.compressionOptions = null, r.comment = null, r.unixPermissions = null, r.dosPermissions = null;
}, {}], 6: [function(e, t, r) {
"use strict";
var n = null;
n = "undefined" != typeof Promise ? Promise : e("lie"), t.exports = { Promise: n };
}, { lie: 37 }], 7: [function(e, t, r) {
"use strict";
var n = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Uint32Array, i = e("pako"), s = e("./utils"), a = e("./stream/GenericWorker"), o = n ? "uint8array" : "array";
function h2(e2, t2) {
a.call(this, "FlateWorker/" + e2), this._pako = null, this._pakoAction = e2, this._pakoOptions = t2, this.meta = {};
}
r.magic = "\b\0", s.inherits(h2, a), h2.prototype.processChunk = function(e2) {
this.meta = e2.meta, null === this._pako && this._createPako(), this._pako.push(s.transformTo(o, e2.data), false);
}, h2.prototype.flush = function() {
a.prototype.flush.call(this), null === this._pako && this._createPako(), this._pako.push([], true);
}, h2.prototype.cleanUp = function() {
a.prototype.cleanUp.call(this), this._pako = null;
}, h2.prototype._createPako = function() {
this._pako = new i[this._pakoAction]({ raw: true, level: this._pakoOptions.level || -1 });
var t2 = this;
this._pako.onData = function(e2) {
t2.push({ data: e2, meta: t2.meta });
};
}, r.compressWorker = function(e2) {
return new h2("Deflate", e2);
}, r.uncompressWorker = function() {
return new h2("Inflate", {});
};
}, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(e, t, r) {
"use strict";
function A(e2, t2) {
var r2, n2 = "";
for (r2 = 0; r2 < t2; r2++) n2 += String.fromCharCode(255 & e2), e2 >>>= 8;
return n2;
}
function n(e2, t2, r2, n2, i2, s2) {
var a, o, h2 = e2.file, u = e2.compression, l = s2 !== O.utf8encode, f = I.transformTo("string", s2(h2.name)), c = I.transformTo("string", O.utf8encode(h2.name)), d = h2.comment, p = I.transformTo("string", s2(d)), m = I.transformTo("string", O.utf8encode(d)), _ = c.length !== h2.name.length, g = m.length !== d.length, b = "", v = "", y = "", w = h2.dir, k = h2.date, x = { crc32: 0, compressedSize: 0, uncompressedSize: 0 };
t2 && !r2 || (x.crc32 = e2.crc32, x.compressedSize = e2.compressedSize, x.uncompressedSize = e2.uncompressedSize);
var S = 0;
t2 && (S |= 8), l || !_ && !g || (S |= 2048);
var z = 0, C = 0;
w && (z |= 16), "UNIX" === i2 ? (C = 798, z |= function(e3, t3) {
var r3 = e3;
return e3 || (r3 = t3 ? 16893 : 33204), (65535 & r3) << 16;
}(h2.unixPermissions, w)) : (C = 20, z |= function(e3) {
return 63 & (e3 || 0);
}(h2.dosPermissions)), a = k.getUTCHours(), a <<= 6, a |= k.getUTCMinutes(), a <<= 5, a |= k.getUTCSeconds() / 2, o = k.getUTCFullYear() - 1980, o <<= 4, o |= k.getUTCMonth() + 1, o <<= 5, o |= k.getUTCDate(), _ && (v = A(1, 1) + A(B(f), 4) + c, b += "up" + A(v.length, 2) + v), g && (y = A(1, 1) + A(B(p), 4) + m, b += "uc" + A(y.length, 2) + y);
var E = "";
return E += "\n\0", E += A(S, 2), E += u.magic, E += A(a, 2), E += A(o, 2), E += A(x.crc32, 4), E += A(x.compressedSize, 4), E += A(x.uncompressedSize, 4), E += A(f.length, 2), E += A(b.length, 2), { fileRecord: R.LOCAL_FILE_HEADER + E + f + b, dirRecord: R.CENTRAL_FILE_HEADER + A(C, 2) + E + A(p.length, 2) + "\0\0\0\0" + A(z, 4) + A(n2, 4) + f + b + p };
}
var I = e("../utils"), i = e("../stream/GenericWorker"), O = e("../utf8"), B = e("../crc32"), R = e("../signature");
function s(e2, t2, r2, n2) {
i.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = t2, this.zipPlatform = r2, this.encodeFileName = n2, this.streamFiles = e2, this.accumulate = false, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = [];
}
I.inherits(s, i), s.prototype.push = function(e2) {
var t2 = e2.meta.percent || 0, r2 = this.entriesCount, n2 = this._sources.length;
this.accumulate ? this.contentBuffer.push(e2) : (this.bytesWritten += e2.data.length, i.prototype.push.call(this, { data: e2.data, meta: { currentFile: this.currentFile, percent: r2 ? (t2 + 100 * (r2 - n2 - 1)) / r2 : 100 } }));
}, s.prototype.openedSource = function(e2) {
this.currentSourceOffset = this.bytesWritten, this.currentFile = e2.file.name;
var t2 = this.streamFiles && !e2.file.dir;
if (t2) {
var r2 = n(e2, t2, false, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
this.push({ data: r2.fileRecord, meta: { percent: 0 } });
} else this.accumulate = true;
}, s.prototype.closedSource = function(e2) {
this.accumulate = false;
var t2 = this.streamFiles && !e2.file.dir, r2 = n(e2, t2, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
if (this.dirRecords.push(r2.dirRecord), t2) this.push({ data: function(e3) {
return R.DATA_DESCRIPTOR + A(e3.crc32, 4) + A(e3.compressedSize, 4) + A(e3.uncompressedSize, 4);
}(e2), meta: { percent: 100 } });
else for (this.push({ data: r2.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; ) this.push(this.contentBuffer.shift());
this.currentFile = null;
}, s.prototype.flush = function() {
for (var e2 = this.bytesWritten, t2 = 0; t2 < this.dirRecords.length; t2++) this.push({ data: this.dirRecords[t2], meta: { percent: 100 } });
var r2 = this.bytesWritten - e2, n2 = function(e3, t3, r3, n3, i2) {
var s2 = I.transformTo("string", i2(n3));
return R.CENTRAL_DIRECTORY_END + "\0\0\0\0" + A(e3, 2) + A(e3, 2) + A(t3, 4) + A(r3, 4) + A(s2.length, 2) + s2;
}(this.dirRecords.length, r2, e2, this.zipComment, this.encodeFileName);
this.push({ data: n2, meta: { percent: 100 } });
}, s.prototype.prepareNextSource = function() {
this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume();
}, s.prototype.registerPrevious = function(e2) {
this._sources.push(e2);
var t2 = this;
return e2.on("data", function(e3) {
t2.processChunk(e3);
}), e2.on("end", function() {
t2.closedSource(t2.previous.streamInfo), t2._sources.length ? t2.prepareNextSource() : t2.end();
}), e2.on("error", function(e3) {
t2.error(e3);
}), this;
}, s.prototype.resume = function() {
return !!i.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), true) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), true));
}, s.prototype.error = function(e2) {
var t2 = this._sources;
if (!i.prototype.error.call(this, e2)) return false;
for (var r2 = 0; r2 < t2.length; r2++) try {
t2[r2].error(e2);
} catch (e3) {
}
return true;
}, s.prototype.lock = function() {
i.prototype.lock.call(this);
for (var e2 = this._sources, t2 = 0; t2 < e2.length; t2++) e2[t2].lock();
}, t.exports = s;
}, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(e, t, r) {
"use strict";
var u = e("../compressions"), n = e("./ZipFileWorker");
r.generateWorker = function(e2, a, t2) {
var o = new n(a.streamFiles, t2, a.platform, a.encodeFileName), h2 = 0;
try {
e2.forEach(function(e3, t3) {
h2++;
var r2 = function(e4, t4) {
var r3 = e4 || t4, n3 = u[r3];
if (!n3) throw new Error(r3 + " is not a valid compression method !");
return n3;
}(t3.options.compression, a.compression), n2 = t3.options.compressionOptions || a.compressionOptions || {}, i = t3.dir, s = t3.date;
t3._compressWorker(r2, n2).withStreamInfo("file", { name: e3, dir: i, date: s, comment: t3.comment || "", unixPermissions: t3.unixPermissions, dosPermissions: t3.dosPermissions }).pipe(o);
}), o.entriesCount = h2;
} catch (e3) {
o.error(e3);
}
return o;
};
}, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function(e, t, r) {
"use strict";
function n() {
if (!(this instanceof n)) return new n();
if (arguments.length) throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
this.files = /* @__PURE__ */ Object.create(null), this.comment = null, this.root = "", this.clone = function() {
var e2 = new n();
for (var t2 in this) "function" != typeof this[t2] && (e2[t2] = this[t2]);
return e2;
};
}
(n.prototype = e("./object")).loadAsync = e("./load"), n.support = e("./support"), n.defaults = e("./defaults"), n.version = "3.10.1", n.loadAsync = function(e2, t2) {
return new n().loadAsync(e2, t2);
}, n.external = e("./external"), t.exports = n;
}, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(e, t, r) {
"use strict";
var u = e("./utils"), i = e("./external"), n = e("./utf8"), s = e("./zipEntries"), a = e("./stream/Crc32Probe"), l = e("./nodejsUtils");
function f(n2) {
return new i.Promise(function(e2, t2) {
var r2 = n2.decompressed.getContentWorker().pipe(new a());
r2.on("error", function(e3) {
t2(e3);
}).on("end", function() {
r2.streamInfo.crc32 !== n2.decompressed.crc32 ? t2(new Error("Corrupted zip : CRC32 mismatch")) : e2();
}).resume();
});
}
t.exports = function(e2, o) {
var h2 = this;
return o = u.extend(o || {}, { base64: false, checkCRC32: false, optimizedBinaryString: false, createFolders: false, decodeFileName: n.utf8decode }), l.isNode && l.isStream(e2) ? i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : u.prepareContent("the loaded zip file", e2, true, o.optimizedBinaryString, o.base64).then(function(e3) {
var t2 = new s(o);
return t2.load(e3), t2;
}).then(function(e3) {
var t2 = [i.Promise.resolve(e3)], r2 = e3.files;
if (o.checkCRC32) for (var n2 = 0; n2 < r2.length; n2++) t2.push(f(r2[n2]));
return i.Promise.all(t2);
}).then(function(e3) {
for (var t2 = e3.shift(), r2 = t2.files, n2 = 0; n2 < r2.length; n2++) {
var i2 = r2[n2], s2 = i2.fileNameStr, a2 = u.resolve(i2.fileNameStr);
h2.file(a2, i2.decompressed, { binary: true, optimizedBinaryString: true, date: i2.date, dir: i2.dir, comment: i2.fileCommentStr.length ? i2.fileCommentStr : null, unixPermissions: i2.unixPermissions, dosPermissions: i2.dosPermissions, createFolders: o.createFolders }), i2.dir || (h2.file(a2).unsafeOriginalName = s2);
}
return t2.zipComment.length && (h2.comment = t2.zipComment), h2;
});
};
}, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(e, t, r) {
"use strict";
var n = e("../utils"), i = e("../stream/GenericWorker");
function s(e2, t2) {
i.call(this, "Nodejs stream input adapter for " + e2), this._upstreamEnded = false, this._bindStream(t2);
}
n.inherits(s, i), s.prototype._bindStream = function(e2) {
var t2 = this;
(this._stream = e2).pause(), e2.on("data", function(e3) {
t2.push({ data: e3, meta: { percent: 0 } });
}).on("error", function(e3) {
t2.isPaused ? this.generatedError = e3 : t2.error(e3);
}).on("end", function() {
t2.isPaused ? t2._upstreamEnded = true : t2.end();
});
}, s.prototype.pause = function() {
return !!i.prototype.pause.call(this) && (this._stream.pause(), true);
}, s.prototype.resume = function() {
return !!i.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), true);
}, t.exports = s;
}, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function(e, t, r) {
"use strict";
var i = e("readable-stream").Readable;
function n(e2, t2, r2) {
i.call(this, t2), this._helper = e2;
var n2 = this;
e2.on("data", function(e3, t3) {
n2.push(e3) || n2._helper.pause(), r2 && r2(t3);
}).on("error", function(e3) {
n2.emit("error", e3);
}).on("end", function() {
n2.push(null);
});
}
e("../utils").inherits(n, i), n.prototype._read = function() {
this._helper.resume();
}, t.exports = n;
}, { "../utils": 32, "readable-stream": 16 }], 14: [function(e, t, r) {
"use strict";
t.exports = { isNode: "undefined" != typeof Buffer, newBufferFrom: function(e2, t2) {
if (Buffer.from && Buffer.from !== Uint8Array.from) return Buffer.from(e2, t2);
if ("number" == typeof e2) throw new Error('The "data" argument must not be a number');
return new Buffer(e2, t2);
}, allocBuffer: function(e2) {
if (Buffer.alloc) return Buffer.alloc(e2);
var t2 = new Buffer(e2);
return t2.fill(0), t2;
}, isBuffer: function(e2) {
return Buffer.isBuffer(e2);
}, isStream: function(e2) {
return e2 && "function" == typeof e2.on && "function" == typeof e2.pause && "function" == typeof e2.resume;
} };
}, {}], 15: [function(e, t, r) {
"use strict";
function s(e2, t2, r2) {
var n2, i2 = u.getTypeOf(t2), s2 = u.extend(r2 || {}, f);
s2.date = s2.date || /* @__PURE__ */ new Date(), null !== s2.compression && (s2.compression = s2.compression.toUpperCase()), "string" == typeof s2.unixPermissions && (s2.unixPermissions = parseInt(s2.unixPermissions, 8)), s2.unixPermissions && 16384 & s2.unixPermissions && (s2.dir = true), s2.dosPermissions && 16 & s2.dosPermissions && (s2.dir = true), s2.dir && (e2 = g(e2)), s2.createFolders && (n2 = _(e2)) && b.call(this, n2, true);
var a2 = "string" === i2 && false === s2.binary && false === s2.base64;
r2 && void 0 !== r2.binary || (s2.binary = !a2), (t2 instanceof c && 0 === t2.uncompressedSize || s2.dir || !t2 || 0 === t2.length) && (s2.base64 = false, s2.binary = true, t2 = "", s2.compression = "STORE", i2 = "string");
var o2 = null;
o2 = t2 instanceof c || t2 instanceof l ? t2 : p.isNode && p.isStream(t2) ? new m(e2, t2) : u.prepareContent(e2, t2, s2.binary, s2.optimizedBinaryString, s2.base64);
var h3 = new d(e2, o2, s2);
this.files[e2] = h3;
}
var i = e("./utf8"), u = e("./utils"), l = e("./stream/GenericWorker"), a = e("./stream/StreamHelper"), f = e("./defaults"), c = e("./compressedObject"), d = e("./zipObject"), o = e("./generate"), p = e("./nodejsUtils"), m = e("./nodejs/NodejsStreamInputAdapter"), _ = function(e2) {
"/" === e2.slice(-1) && (e2 = e2.substring(0, e2.length - 1));
var t2 = e2.lastIndexOf("/");
return 0 < t2 ? e2.substring(0, t2) : "";
}, g = function(e2) {
return "/" !== e2.slice(-1) && (e2 += "/"), e2;
}, b = function(e2, t2) {
return t2 = void 0 !== t2 ? t2 : f.createFolders, e2 = g(e2), this.files[e2] || s.call(this, e2, null, { dir: true, createFolders: t2 }), this.files[e2];
};
function h2(e2) {
return "[object RegExp]" === Object.prototype.toString.call(e2);
}
var n = { load: function() {
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
}, forEach: function(e2) {
var t2, r2, n2;
for (t2 in this.files) n2 = this.files[t2], (r2 = t2.slice(this.root.length, t2.length)) && t2.slice(0, this.root.length) === this.root && e2(r2, n2);
}, filter: function(r2) {
var n2 = [];
return this.forEach(function(e2, t2) {
r2(e2, t2) && n2.push(t2);
}), n2;
}, file: function(e2, t2, r2) {
if (1 !== arguments.length) return e2 = this.root + e2, s.call(this, e2, t2, r2), this;
if (h2(e2)) {
var n2 = e2;
return this.filter(function(e3, t3) {
return !t3.dir && n2.test(e3);
});
}
var i2 = this.files[this.root + e2];
return i2 && !i2.dir ? i2 : null;
}, folder: function(r2) {
if (!r2) return this;
if (h2(r2)) return this.filter(function(e3, t3) {
return t3.dir && r2.test(e3);
});
var e2 = this.root + r2, t2 = b.call(this, e2), n2 = this.clone();
return n2.root = t2.name, n2;
}, remove: function(r2) {
r2 = this.root + r2;
var e2 = this.files[r2];
if (e2 || ("/" !== r2.slice(-1) && (r2 += "/"), e2 = this.files[r2]), e2 && !e2.dir) delete this.files[r2];
else for (var t2 = this.filter(function(e3, t3) {
return t3.name.slice(0, r2.length) === r2;
}), n2 = 0; n2 < t2.length; n2++) delete this.files[t2[n2].name];
return this;
}, generate: function() {
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
}, generateInternalStream: function(e2) {
var t2, r2 = {};
try {
if ((r2 = u.extend(e2 || {}, { streamFiles: false, compression: "STORE", compressionOptions: null, type: "", platform: "DOS", comment: null, mimeType: "application/zip", encodeFileName: i.utf8encode })).type = r2.type.toLowerCase(), r2.compression = r2.compression.toUpperCase(), "binarystring" === r2.type && (r2.type = "string"), !r2.type) throw new Error("No output type specified.");
u.checkSupport(r2.type), "darwin" !== r2.platform && "freebsd" !== r2.platform && "linux" !== r2.platform && "sunos" !== r2.platform || (r2.platform = "UNIX"), "win32" === r2.platform && (r2.platform = "DOS");
var n2 = r2.comment || this.comment || "";
t2 = o.generateWorker(this, r2, n2);
} catch (e3) {
(t2 = new l("error")).error(e3);
}
return new a(t2, r2.type || "string", r2.mimeType);
}, generateAsync: function(e2, t2) {
return this.generateInternalStream(e2).accumulate(t2);
}, generateNodeStream: function(e2, t2) {
return (e2 = e2 || {}).type || (e2.type = "nodebuffer"), this.generateInternalStream(e2).toNodejsStream(t2);
} };
t.exports = n;
}, { "./compressedObject": 2, "./defaults": 5, "./generate": 9, "./nodejs/NodejsStreamInputAdapter": 12, "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31, "./utils": 32, "./zipObject": 35 }], 16: [function(e, t, r) {
"use strict";
t.exports = e("stream");
}, { stream: void 0 }], 17: [function(e, t, r) {
"use strict";
var n = e("./DataReader");
function i(e2) {
n.call(this, e2);
for (var t2 = 0; t2 < this.data.length; t2++) e2[t2] = 255 & e2[t2];
}
e("../utils").inherits(i, n), i.prototype.byteAt = function(e2) {
return this.data[this.zero + e2];
}, i.prototype.lastIndexOfSignature = function(e2) {
for (var t2 = e2.charCodeAt(0), r2 = e2.charCodeAt(1), n2 = e2.charCodeAt(2), i2 = e2.charCodeAt(3), s = this.length - 4; 0 <= s; --s) if (this.data[s] === t2 && this.data[s + 1] === r2 && this.data[s + 2] === n2 && this.data[s + 3] === i2) return s - this.zero;
return -1;
}, i.prototype.readAndCheckSignature = function(e2) {
var t2 = e2.charCodeAt(0), r2 = e2.charCodeAt(1), n2 = e2.charCodeAt(2), i2 = e2.charCodeAt(3), s = this.readData(4);
return t2 === s[0] && r2 === s[1] && n2 === s[2] && i2 === s[3];
}, i.prototype.readData = function(e2) {
if (this.checkOffset(e2), 0 === e2) return [];
var t2 = this.data.slice(this.zero + this.index, this.zero + this.index + e2);
return this.index += e2, t2;
}, t.exports = i;
}, { "../utils": 32, "./DataReader": 18 }], 18: [function(e, t, r) {
"use strict";
var n = e("../utils");
function i(e2) {
this.data = e2, this.length = e2.length, this.index = 0, this.zero = 0;
}
i.prototype = { checkOffset: function(e2) {
this.checkIndex(this.index + e2);
}, checkIndex: function(e2) {
if (this.length < this.zero + e2 || e2 < 0) throw new Error("End of data reached (data length = " + this.length + ", asked index = " + e2 + "). Corrupted zip ?");
}, setIndex: function(e2) {
this.checkIndex(e2), this.index = e2;
}, skip: function(e2) {
this.setIndex(this.index + e2);
}, byteAt: function() {
}, readInt: function(e2) {
var t2, r2 = 0;
for (this.checkOffset(e2), t2 = this.index + e2 - 1; t2 >= this.index; t2--) r2 = (r2 << 8) + this.byteAt(t2);
return this.index += e2, r2;
}, readString: function(e2) {
return n.transformTo("string", this.readData(e2));
}, readData: function() {
}, lastIndexOfSignature: function() {
}, readAndCheckSignature: function() {
}, readDate: function() {
var e2 = this.readInt(4);
return new Date(Date.UTC(1980 + (e2 >> 25 & 127), (e2 >> 21 & 15) - 1, e2 >> 16 & 31, e2 >> 11 & 31, e2 >> 5 & 63, (31 & e2) << 1));
} }, t.exports = i;
}, { "../utils": 32 }], 19: [function(e, t, r) {
"use strict";
var n = e("./Uint8ArrayReader");
function i(e2) {
n.call(this, e2);
}
e("../utils").inherits(i, n), i.prototype.readData = function(e2) {
this.checkOffset(e2);
var t2 = this.data.slice(this.zero + this.index, this.zero + this.index + e2);
return this.index += e2, t2;
}, t.exports = i;
}, { "../utils": 32, "./Uint8ArrayReader": 21 }], 20: [function(e, t, r) {
"use strict";
var n = e("./DataReader");
function i(e2) {
n.call(this, e2);
}
e("../utils").inherits(i, n), i.prototype.byteAt = function(e2) {
return this.data.charCodeAt(this.zero + e2);
}, i.prototype.lastIndexOfSignature = function(e2) {
return this.data.lastIndexOf(e2) - this.zero;
}, i.prototype.readAndCheckSignature = function(e2) {
return e2 === this.readData(4);
}, i.prototype.readData = function(e2) {
this.checkOffset(e2);
var t2 = this.data.slice(this.zero + this.index, this.zero + this.index + e2);
return this.index += e2, t2;
}, t.exports = i;
}, { "../utils": 32, "./DataReader": 18 }], 21: [function(e, t, r) {
"use strict";
var n = e("./ArrayReader");
function i(e2) {
n.call(this, e2);
}
e("../utils").inherits(i, n), i.prototype.readData = function(e2) {
if (this.checkOffset(e2), 0 === e2) return new Uint8Array(0);
var t2 = this.data.subarray(this.zero + this.index, this.zero + this.index + e2);
return this.index += e2, t2;
}, t.exports = i;
}, { "../utils": 32, "./ArrayReader": 17 }], 22: [function(e, t, r) {
"use strict";
var n = e("../utils"), i = e("../support"), s = e("./ArrayReader"), a = e("./StringReader"), o = e("./NodeBufferReader"), h2 = e("./Uint8ArrayReader");
t.exports = function(e2) {
var t2 = n.getTypeOf(e2);
return n.checkSupport(t2), "string" !== t2 || i.uint8array ? "nodebuffer" === t2 ? new o(e2) : i.uint8array ? new h2(n.transformTo("uint8array", e2)) : new s(n.transformTo("array", e2)) : new a(e2);
};
}, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function(e, t, r) {
"use strict";
r.LOCAL_FILE_HEADER = "PK", r.CENTRAL_FILE_HEADER = "PK", r.CENTRAL_DIRECTORY_END = "PK", r.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07", r.ZIP64_CENTRAL_DIRECTORY_END = "PK", r.DATA_DESCRIPTOR = "PK\x07\b";
}, {}], 24: [function(e, t, r) {
"use strict";
var n = e("./GenericWorker"), i = e("../utils");
function s(e2) {
n.call(this, "ConvertWorker to " + e2), this.destType = e2;
}
i.inherits(s, n), s.prototype.processChunk = function(e2) {
this.push({ data: i.transformTo(this.destType, e2.data), meta: e2.meta });
}, t.exports = s;
}, { "../utils": 32, "./GenericWorker": 28 }], 25: [function(e, t, r) {
"use strict";
var n = e("./GenericWorker"), i = e("../crc32");
function s() {
n.call(this, "Crc32Probe"), this.withStreamInfo("crc32", 0);
}
e("../utils").inherits(s, n), s.prototype.processChunk = function(e2) {
this.streamInfo.crc32 = i(e2.data, this.streamInfo.crc32 || 0), this.push(e2);
}, t.exports = s;
}, { "../crc32": 4, "../utils": 32, "./GenericWorker": 28 }], 26: [function(e, t, r) {
"use strict";
var n = e("../utils"), i = e("./GenericWorker");
function s(e2) {
i.call(this, "DataLengthProbe for " + e2), this.propName = e2, this.withStreamInfo(e2, 0);
}
n.inherits(s, i), s.prototype.processChunk = function(e2) {
if (e2) {
var t2 = this.streamInfo[this.propName] || 0;
this.streamInfo[this.propName] = t2 + e2.data.length;
}
i.prototype.processChunk.call(this, e2);
}, t.exports = s;
}, { "../utils": 32, "./GenericWorker": 28 }], 27: [function(e, t, r) {
"use strict";
var n = e("../utils"), i = e("./GenericWorker");
function s(e2) {
i.call(this, "DataWorker");
var t2 = this;
this.dataIsReady = false, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = false, e2.then(function(e3) {
t2.dataIsReady = true, t2.data = e3, t2.max = e3 && e3.length || 0, t2.type = n.getTypeOf(e3), t2.isPaused || t2._tickAndRepeat();
}, function(e3) {
t2.error(e3);
});
}
n.inherits(s, i), s.prototype.cleanUp = function() {
i.prototype.cleanUp.call(this), this.data = null;
}, s.prototype.resume = function() {
return !!i.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && (this._tickScheduled = true, n.delay(this._tickAndRepeat, [], this)), true);
}, s.prototype._tickAndRepeat = function() {
this._tickScheduled = false, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (n.delay(this._tickAndRepeat, [], this), this._tickScheduled = true));
}, s.prototype._tick = function() {
if (this.isPaused || this.isFinished) return false;
var e2 = null, t2 = Math.min(this.max, this.index + 16384);
if (this.index >= this.max) return this.end();
switch (this.type) {
case "string":
e2 = this.data.substring(this.index, t2);
break;
case "uint8array":
e2 = this.data.subarray(this.index, t2);
break;
case "array":
case "nodebuffer":
e2 = this.data.slice(this.index, t2);
}
return this.index = t2, this.push({ data: e2, meta: { percent: this.max ? this.index / this.max * 100 : 0 } });
}, t.exports = s;
}, { "../utils": 32, "./GenericWorker": 28 }], 28: [function(e, t, r) {
"use strict";
function n(e2) {
this.name = e2 || "default", this.streamInfo = {}, this.generatedError = null, this.extraStreamInfo = {}, this.isPaused = true, this.isFinished = false, this.isLocked = false, this._listeners = { data: [], end: [], error: [] }, this.previous = null;
}
n.prototype = { push: function(e2) {
this.emit("data", e2);
}, end: function() {
if (this.isFinished) return false;
this.flush();
try {
this.emit("end"), this.cleanUp(), this.isFinished = true;
} catch (e2) {
this.emit("error", e2);
}
return true;
}, error: function(e2) {
return !this.isFinished && (this.isPaused ? this.generatedError = e2 : (this.isFinished = true, this.emit("error", e2), this.previous && this.previous.error(e2), this.cleanUp()), true);
}, on: function(e2, t2) {
return this._listeners[e2].push(t2), this;
}, cleanUp: function() {
this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = [];
}, emit: function(e2, t2) {
if (this._listeners[e2]) for (var r2 = 0; r2 < this._listeners[e2].length; r2++) this._listeners[e2][r2].call(this, t2);
}, pipe: function(e2) {
return e2.registerPrevious(this);
}, registerPrevious: function(e2) {
if (this.isLocked) throw new Error("The stream '" + this + "' has already been used.");
this.streamInfo = e2.streamInfo, this.mergeStreamInfo(), this.previous = e2;
var t2 = this;
return e2.on("data", function(e3) {
t2.processChunk(e3);
}), e2.on("end", function() {
t2.end();
}), e2.on("error", function(e3) {
t2.error(e3);
}), this;
}, pause: function() {
return !this.isPaused && !this.isFinished && (this.isPaused = true, this.previous && this.previous.pause(), true);
}, resume: function() {
if (!this.isPaused || this.isFinished) return false;
var e2 = this.isPaused = false;
return this.generatedError && (this.error(this.generatedError), e2 = true), this.previous && this.previous.resume(), !e2;
}, flush: function() {
}, processChunk: function(e2) {
this.push(e2);
}, withStreamInfo: function(e2, t2) {
return this.extraStreamInfo[e2] = t2, this.mergeStreamInfo(), this;
}, mergeStreamInfo: function() {
for (var e2 in this.extraStreamInfo) Object.prototype.hasOwnProperty.call(this.extraStreamInfo, e2) && (this.streamInfo[e2] = this.extraStreamInfo[e2]);
}, lock: function() {
if (this.isLocked) throw new Error("The stream '" + this + "' has already been used.");
this.isLocked = true, this.previous && this.previous.lock();
}, toString: function() {
var e2 = "Worker " + this.name;
return this.previous ? this.previous + " -> " + e2 : e2;
} }, t.exports = n;
}, {}], 29: [function(e, t, r) {
"use strict";
var h2 = e("../utils"), i = e("./ConvertWorker"), s = e("./GenericWorker"), u = e("../base64"), n = e("../support"), a = e("../external"), o = null;
if (n.nodestream) try {
o = e("../nodejs/NodejsStreamOutputAdapter");
} catch (e2) {
}
function l(e2, o2) {
return new a.Promise(function(t2, r2) {
var n2 = [], i2 = e2._internalType, s2 = e2._outputType, a2 = e2._mimeType;
e2.on("data", function(e3, t3) {
n2.push(e3), o2 && o2(t3);
}).on("error", function(e3) {
n2 = [], r2(e3);
}).on("end", function() {
try {
var e3 = function(e4, t3, r3) {
switch (e4) {
case "blob":
return h2.newBlob(h2.transformTo("arraybuffer", t3), r3);
case "base64":
return u.encode(t3);
default:
return h2.transformTo(e4, t3);
}
}(s2, function(e4, t3) {
var r3, n3 = 0, i3 = null, s3 = 0;
for (r3 = 0; r3 < t3.length; r3++) s3 += t3[r3].length;
switch (e4) {
case "string":
return t3.join("");
case "array":
return Array.prototype.concat.apply([], t3);
case "uint8array":
for (i3 = new Uint8Array(s3), r3 = 0; r3 < t3.length; r3++) i3.set(t3[r3], n3), n3 += t3[r3].length;
return i3;
case "nodebuffer":
return Buffer.concat(t3);
default:
throw new Error("concat : unsupported type '" + e4 + "'");
}
}(i2, n2), a2);
t2(e3);
} catch (e4) {
r2(e4);
}
n2 = [];
}).resume();
});
}
function f(e2, t2, r2) {
var n2 = t2;
switch (t2) {
case "blob":
case "arraybuffer":
n2 = "uint8array";
break;
case "base64":
n2 = "string";
}
try {
this._internalType = n2, this._outputType = t2, this._mimeType = r2, h2.checkSupport(n2), this._worker = e2.pipe(new i(n2)), e2.lock();
} catch (e3) {
this._worker = new s("error"), this._worker.error(e3);
}
}
f.prototype = { accumulate: function(e2) {
return l(this, e2);
}, on: function(e2, t2) {
var r2 = this;
return "data" === e2 ? this._worker.on(e2, function(e3) {
t2.call(r2, e3.data, e3.meta);
}) : this._worker.on(e2, function() {
h2.delay(t2, arguments, r2);
}), this;
}, resume: function() {
return h2.delay(this._worker.resume, [], this._worker), this;
}, pause: function() {
return this._worker.pause(), this;
}, toNodejsStream: function(e2) {
if (h2.checkSupport("nodestream"), "nodebuffer" !== this._outputType) throw new Error(this._outputType + " is not supported by this method");
return new o(this, { objectMode: "nodebuffer" !== this._outputType }, e2);
} }, t.exports = f;
}, { "../base64": 1, "../external": 6, "../nodejs/NodejsStreamOutputAdapter": 13, "../support": 30, "../utils": 32, "./ConvertWorker": 24, "./GenericWorker": 28 }], 30: [function(e, t, r) {
"use strict";
if (r.base64 = true, r.array = true, r.string = true, r.arraybuffer = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array, r.nodebuffer = "undefined" != typeof Buffer, r.uint8array = "undefined" != typeof Uint8Array, "undefined" == typeof ArrayBuffer) r.blob = false;
else {
var n = new ArrayBuffer(0);
try {
r.blob = 0 === new Blob([n], { type: "application/zip" }).size;
} catch (e2) {
try {
var i = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
i.append(n), r.blob = 0 === i.getBlob("application/zip").size;
} catch (e3) {
r.blob = false;
}
}
}
try {
r.nodestream = !!e("readable-stream").Readable;
} catch (e2) {
r.nodestream = false;
}
}, { "readable-stream": 16 }], 31: [function(e, t, s) {
"use strict";
for (var o = e("./utils"), h2 = e("./support"), r = e("./nodejsUtils"), n = e("./stream/GenericWorker"), u = new Array(256), i = 0; i < 256; i++) u[i] = 252 <= i ? 6 : 248 <= i ? 5 : 240 <= i ? 4 : 224 <= i ? 3 : 192 <= i ? 2 : 1;
u[254] = u[254] = 1;
function a() {
n.call(this, "utf-8 decode"), this.leftOver = null;
}
function l() {
n.call(this, "utf-8 encode");
}
s.utf8encode = function(e2) {
return h2.nodebuffer ? r.newBufferFrom(e2, "utf-8") : function(e3) {
var t2, r2, n2, i2, s2, a2 = e3.length, o2 = 0;
for (i2 = 0; i2 < a2; i2++) 55296 == (64512 & (r2 = e3.charCodeAt(i2))) && i2 + 1 < a2 && 56320 == (64512 & (n2 = e3.charCodeAt(i2 + 1))) && (r2 = 65536 + (r2 - 55296 << 10) + (n2 - 56320), i2++), o2 += r2 < 128 ? 1 : r2 < 2048 ? 2 : r2 < 65536 ? 3 : 4;
for (t2 = h2.uint8array ? new Uint8Array(o2) : new Array(o2), i2 = s2 = 0; s2 < o2; i2++) 55296 == (64512 & (r2 = e3.charCodeAt(i2))) && i2 + 1 < a2 && 56320 == (64512 & (n2 = e3.charCodeAt(i2 + 1))) && (r2 = 65536 + (r2 - 55296 << 10) + (n2 - 56320), i2++), r2 < 128 ? t2[s2++] = r2 : (r2 < 2048 ? t2[s2++] = 192 | r2 >>> 6 : (r2 < 65536 ? t2[s2++] = 224 | r2 >>> 12 : (t2[s2++] = 240 | r2 >>> 18, t2[s2++] = 128 | r2 >>> 12 & 63), t2[s2++] = 128 | r2 >>> 6 & 63), t2[s2++] = 128 | 63 & r2);
return t2;
}(e2);
}, s.utf8decode = function(e2) {
return h2.nodebuffer ? o.transformTo("nodebuffer", e2).toString("utf-8") : function(e3) {
var t2, r2, n2, i2, s2 = e3.length, a2 = new Array(2 * s2);
for (t2 = r2 = 0; t2 < s2; ) if ((n2 = e3[t2++]) < 128) a2[r2++] = n2;
else if (4 < (i2 = u[n2])) a2[r2++] = 65533, t2 += i2 - 1;
else {
for (n2 &= 2 === i2 ? 31 : 3 === i2 ? 15 : 7; 1 < i2 && t2 < s2; ) n2 = n2 << 6 | 63 & e3[t2++], i2--;
1 < i2 ? a2[r2++] = 65533 : n2 < 65536 ? a2[r2++] = n2 : (n2 -= 65536, a2[r2++] = 55296 | n2 >> 10 & 1023, a2[r2++] = 56320 | 1023 & n2);
}
return a2.length !== r2 && (a2.subarray ? a2 = a2.subarray(0, r2) : a2.length = r2), o.applyFromCharCode(a2);
}(e2 = o.transformTo(h2.uint8array ? "uint8array" : "array", e2));
}, o.inherits(a, n), a.prototype.processChunk = function(e2) {
var t2 = o.transformTo(h2.uint8array ? "uint8array" : "array", e2.data);
if (this.leftOver && this.leftOver.length) {
if (h2.uint8array) {
var r2 = t2;
(t2 = new Uint8Array(r2.length + this.leftOver.length)).set(this.leftOver, 0), t2.set(r2, this.leftOver.length);
} else t2 = this.leftOver.concat(t2);
this.leftOver = null;
}
var n2 = function(e3, t3) {
var r3;
for ((t3 = t3 || e3.length) > e3.length && (t3 = e3.length), r3 = t3 - 1; 0 <= r3 && 128 == (192 & e3[r3]); ) r3--;
return r3 < 0 ? t3 : 0 === r3 ? t3 : r3 + u[e3[r3]] > t3 ? r3 : t3;
}(t2), i2 = t2;
n2 !== t2.length && (h2.uint8array ? (i2 = t2.subarray(0, n2), this.leftOver = t2.subarray(n2, t2.length)) : (i2 = t2.slice(0, n2), this.leftOver = t2.slice(n2, t2.length))), this.push({ data: s.utf8decode(i2), meta: e2.meta });
}, a.prototype.flush = function() {
this.leftOver && this.leftOver.length && (this.push({ data: s.utf8decode(this.leftOver), meta: {} }), this.leftOver = null);
}, s.Utf8DecodeWorker = a, o.inherits(l, n), l.prototype.processChunk = function(e2) {
this.push({ data: s.utf8encode(e2.data), meta: e2.meta });
}, s.Utf8EncodeWorker = l;
}, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function(e, t, a) {
"use strict";
var o = e("./support"), h2 = e("./base64"), r = e("./nodejsUtils"), u = e("./external");
function n(e2) {
return e2;
}
function l(e2, t2) {
for (var r2 = 0; r2 < e2.length; ++r2) t2[r2] = 255 & e2.charCodeAt(r2);
return t2;
}
e("setimmediate"), a.newBlob = function(t2, r2) {
a.checkSupport("blob");
try {
return new Blob([t2], { type: r2 });
} catch (e2) {
try {
var n2 = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
return n2.append(t2), n2.getBlob(r2);
} catch (e3) {
throw new Error("Bug : can't construct the Blob.");
}
}
};
var i = { stringifyByChunk: function(e2, t2, r2) {
var n2 = [], i2 = 0, s2 = e2.length;
if (s2 <= r2) return String.fromCharCode.apply(null, e2);
for (; i2 < s2; ) "array" === t2 || "nodebuffer" === t2 ? n2.push(String.fromCharCode.apply(null, e2.slice(i2, Math.min(i2 + r2, s2)))) : n2.push(String.fromCharCode.apply(null, e2.subarray(i2, Math.min(i2 + r2, s2)))), i2 += r2;
return n2.join("");
}, stringifyByChar: function(e2) {
for (var t2 = "", r2 = 0; r2 < e2.length; r2++) t2 += String.fromCharCode(e2[r2]);
return t2;
}, applyCanBeUsed: { uint8array: function() {
try {
return o.uint8array && 1 === String.fromCharCode.apply(null, new Uint8Array(1)).length;
} catch (e2) {
return false;
}
}(), nodebuffer: function() {
try {
return o.nodebuffer && 1 === String.fromCharCode.apply(null, r.allocBuffer(1)).length;
} catch (e2) {
return false;
}
}() } };
function s(e2) {
var t2 = 65536, r2 = a.getTypeOf(e2), n2 = true;
if ("uint8array" === r2 ? n2 = i.applyCanBeUsed.uint8array : "nodebuffer" === r2 && (n2 = i.applyCanBeUsed.nodebuffer), n2) for (; 1 < t2; ) try {
return i.stringifyByChunk(e2, r2, t2);
} catch (e3) {
t2 = Math.floor(t2 / 2);
}
return i.stringifyByChar(e2);
}
function f(e2, t2) {
for (var r2 = 0; r2 < e2.length; r2++) t2[r2] = e2[r2];
return t2;
}
a.applyFromCharCode = s;
var c = {};
c.string = { string: n, array: function(e2) {
return l(e2, new Array(e2.length));
}, arraybuffer: function(e2) {
return c.string.uint8array(e2).buffer;
}, uint8array: function(e2) {
return l(e2, new Uint8Array(e2.length));
}, nodebuffer: function(e2) {
return l(e2, r.allocBuffer(e2.length));
} }, c.array = { string: s, array: n, arraybuffer: function(e2) {
return new Uint8Array(e2).buffer;
}, uint8array: function(e2) {
return new Uint8Array(e2);
}, nodebuffer: function(e2) {
return r.newBufferFrom(e2);
} }, c.arraybuffer = { string: function(e2) {
return s(new Uint8Array(e2));
}, array: function(e2) {
return f(new Uint8Array(e2), new Array(e2.byteLength));
}, arraybuffer: n, uint8array: function(e2) {
return new Uint8Array(e2);
}, nodebuffer: function(e2) {
return r.newBufferFrom(new Uint8Array(e2));
} }, c.uint8array = { string: s, array: function(e2) {
return f(e2, new Array(e2.length));
}, arraybuffer: function(e2) {
return e2.buffer;
}, uint8array: n, nodebuffer: function(e2) {
return r.newBufferFrom(e2);
} }, c.nodebuffer = { string: s, array: function(e2) {
return f(e2, new Array(e2.length));
}, arraybuffer: function(e2) {
return c.nodebuffer.uint8array(e2).buffer;
}, uint8array: function(e2) {
return f(e2, new Uint8Array(e2.length));
}, nodebuffer: n }, a.transformTo = function(e2, t2) {
if (t2 = t2 || "", !e2) return t2;
a.checkSupport(e2);
var r2 = a.getTypeOf(t2);
return c[r2][e2](t2);
}, a.resolve = function(e2) {
for (var t2 = e2.split("/"), r2 = [], n2 = 0; n2 < t2.length; n2++) {
var i2 = t2[n2];
"." === i2 || "" === i2 && 0 !== n2 && n2 !== t2.length - 1 || (".." === i2 ? r2.pop() : r2.push(i2));
}
return r2.join("/");
}, a.getTypeOf = function(e2) {
return "string" == typeof e2 ? "string" : "[object Array]" === Object.prototype.toString.call(e2) ? "array" : o.nodebuffer && r.isBuffer(e2) ? "nodebuffer" : o.uint8array && e2 instanceof Uint8Array ? "uint8array" : o.arraybuffer && e2 instanceof ArrayBuffer ? "arraybuffer" : void 0;
}, a.checkSupport = function(e2) {
if (!o[e2.toLowerCase()]) throw new Error(e2 + " is not supported by this platform");
}, a.MAX_VALUE_16BITS = 65535, a.MAX_VALUE_32BITS = -1, a.pretty = function(e2) {
var t2, r2, n2 = "";
for (r2 = 0; r2 < (e2 || "").length; r2++) n2 += "\\x" + ((t2 = e2.charCodeAt(r2)) < 16 ? "0" : "") + t2.toString(16).toUpperCase();
return n2;
}, a.delay = function(e2, t2, r2) {
setImmediate(function() {
e2.apply(r2 || null, t2 || []);
});
}, a.inherits = function(e2, t2) {
function r2() {
}
r2.prototype = t2.prototype, e2.prototype = new r2();
}, a.extend = function() {
var e2, t2, r2 = {};
for (e2 = 0; e2 < arguments.length; e2++) for (t2 in arguments[e2]) Object.prototype.hasOwnProperty.call(arguments[e2], t2) && void 0 === r2[t2] && (r2[t2] = arguments[e2][t2]);
return r2;
}, a.prepareContent = function(r2, e2, n2, i2, s2) {
return u.Promise.resolve(e2).then(function(n3) {
return o.blob && (n3 instanceof Blob || -1 !== ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(n3))) && "undefined" != typeof FileReader ? new u.Promise(function(t2, r3) {
var e3 = new FileReader();
e3.onload = function(e4) {
t2(e4.target.result);
}, e3.onerror = function(e4) {
r3(e4.target.error);
}, e3.readAsArrayBuffer(n3);
}) : n3;
}).then(function(e3) {
var t2 = a.getTypeOf(e3);
return t2 ? ("arraybuffer" === t2 ? e3 = a.transformTo("uint8array", e3) : "string" === t2 && (s2 ? e3 = h2.decode(e3) : n2 && true !== i2 && (e3 = function(e4) {
return l(e4, o.uint8array ? new Uint8Array(e4.length) : new Array(e4.length));
}(e3))), e3) : u.Promise.reject(new Error("Can't read the data of '" + r2 + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
});
};
}, { "./base64": 1, "./external": 6, "./nodejsUtils": 14, "./support": 30, setimmediate: 54 }], 33: [function(e, t, r) {
"use strict";
var n = e("./reader/readerFor"), i = e("./utils"), s = e("./signature"), a = e("./zipEntry"), o = e("./support");
function h2(e2) {
this.files = [], this.loadOptions = e2;
}
h2.prototype = { checkSignature: function(e2) {
if (!this.reader.readAndCheckSignature(e2)) {
this.reader.index -= 4;
var t2 = this.reader.readString(4);
throw new Error("Corrupted zip or bug: unexpected signature (" + i.pretty(t2) + ", expected " + i.pretty(e2) + ")");
}
}, isSignature: function(e2, t2) {
var r2 = this.reader.index;
this.reader.setIndex(e2);
var n2 = this.reader.readString(4) === t2;
return this.reader.setIndex(r2), n2;
}, readBlockEndOfCentral: function() {
this.diskNumber = this.reader.readInt(2), this.diskWithCentralDirStart = this.reader.readInt(2), this.centralDirRecordsOnThisDisk = this.reader.readInt(2), this.centralDirRecords = this.reader.readInt(2), this.centralDirSize = this.reader.readInt(4), this.centralDirOffset = this.reader.readInt(4), this.zipCommentLength = this.reader.readInt(2);
var e2 = this.reader.readData(this.zipCommentLength), t2 = o.uint8array ? "uint8array" : "array", r2 = i.transformTo(t2, e2);
this.zipComment = this.loadOptions.decodeFileName(r2);
}, readBlockZip64EndOfCentral: function() {
this.zip64EndOfCentralSize = this.reader.readInt(8), this.reader.skip(4), this.diskNumber = this.reader.readInt(4), this.diskWithCentralDirStart = this.reader.readInt(4), this.centralDirRecordsOnThisDisk = this.reader.readInt(8), this.centralDirRecords = this.reader.readInt(8), this.centralDirSize = this.reader.readInt(8), this.centralDirOffset = this.reader.readInt(8), this.zip64ExtensibleData = {};
for (var e2, t2, r2, n2 = this.zip64EndOfCentralSize - 44; 0 < n2; ) e2 = this.reader.readInt(2), t2 = this.reader.readInt(4), r2 = this.reader.readData(t2), this.zip64ExtensibleData[e2] = { id: e2, length: t2, value: r2 };
}, readBlockZip64EndOfCentralLocator: function() {
if (this.diskWithZip64CentralDirStart = this.reader.readInt(4), this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8), this.disksCount = this.reader.readInt(4), 1 < this.disksCount) throw new Error("Multi-volumes zip are not supported");
}, readLocalFiles: function() {
var e2, t2;
for (e2 = 0; e2 < this.files.length; e2++) t2 = this.files[e2], this.reader.setIndex(t2.localHeaderOffset), this.checkSignature(s.LOCAL_FILE_HEADER), t2.readLocalPart(this.reader), t2.handleUTF8(), t2.processAttributes();
}, readCentralDir: function() {
var e2;
for (this.reader.setIndex(this.centralDirOffset); this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER); ) (e2 = new a({ zip64: this.zip64 }, this.loadOptions)).readCentralPart(this.reader), this.files.push(e2);
if (this.centralDirRecords !== this.files.length && 0 !== this.centralDirRecords && 0 === this.files.length) throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length);
}, readEndOfCentral: function() {
var e2 = this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);
if (e2 < 0) throw !this.isSignature(0, s.LOCAL_FILE_HEADER) ? new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html") : new Error("Corrupted zip: can't find end of central directory");
this.reader.setIndex(e2);
var t2 = e2;
if (this.checkSignature(s.CENTRAL_DIRECTORY_END), this.readBlockEndOfCentral(), this.diskNumber === i.MAX_VALUE_16BITS || this.diskWithCentralDirStart === i.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === i.MAX_VALUE_16BITS || this.centralDirRecords === i.MAX_VALUE_16BITS || this.centralDirSize === i.MAX_VALUE_32BITS || this.centralDirOffset === i.MAX_VALUE_32BITS) {
if (this.zip64 = true, (e2 = this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR)) < 0) throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");
if (this.reader.setIndex(e2), this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR), this.readBlockZip64EndOfCentralLocator(), !this.isSignature(this.relativeOffsetEndOfZip64CentralDir, s.ZIP64_CENTRAL_DIRECTORY_END) && (this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END), this.relativeOffsetEndOfZip64CentralDir < 0)) throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");
this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir), this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END), this.readBlockZip64EndOfCentral();
}
var r2 = this.centralDirOffset + this.centralDirSize;
this.zip64 && (r2 += 20, r2 += 12 + this.zip64EndOfCentralSize);
var n2 = t2 - r2;
if (0 < n2) this.isSignature(t2, s.CENTRAL_FILE_HEADER) || (this.reader.zero = n2);
else if (n2 < 0) throw new Error("Corrupted zip: missing " + Math.abs(n2) + " bytes.");
}, prepareReader: function(e2) {
this.reader = n(e2);
}, load: function(e2) {
this.prepareReader(e2), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles();
} }, t.exports = h2;
}, { "./reader/readerFor": 22, "./signature": 23, "./support": 30, "./utils": 32, "./zipEntry": 34 }], 34: [function(e, t, r) {
"use strict";
var n = e("./reader/readerFor"), s = e("./utils"), i = e("./compressedObject"), a = e("./crc32"), o = e("./utf8"), h2 = e("./compressions"), u = e("./support");
function l(e2, t2) {
this.options = e2, this.loadOptions = t2;
}
l.prototype = { isEncrypted: function() {
return 1 == (1 & this.bitFlag);
}, useUTF8: function() {
return 2048 == (2048 & this.bitFlag);
}, readLocalPart: function(e2) {
var t2, r2;
if (e2.skip(22), this.fileNameLength = e2.readInt(2), r2 = e2.readInt(2), this.fileName = e2.readData(this.fileNameLength), e2.skip(r2), -1 === this.compressedSize || -1 === this.uncompressedSize) throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");
if (null === (t2 = function(e3) {
for (var t3 in h2) if (Object.prototype.hasOwnProperty.call(h2, t3) && h2[t3].magic === e3) return h2[t3];
return null;
}(this.compressionMethod))) throw new Error("Corrupted zip : compression " + s.pretty(this.compressionMethod) + " unknown (inner file : " + s.transformTo("string", this.fileName) + ")");
this.decompressed = new i(this.compressedSize, this.uncompressedSize, this.crc32, t2, e2.readData(this.compressedSize));
}, readCentralPart: function(e2) {
this.versionMadeBy = e2.readInt(2), e2.skip(2), this.bitFlag = e2.readInt(2), this.compressionMethod = e2.readString(2), this.date = e2.readDate(), this.crc32 = e2.readInt(4), this.compressedSize = e2.readInt(4), this.uncompressedSize = e2.readInt(4);
var t2 = e2.readInt(2);
if (this.extraFieldsLength = e2.readInt(2), this.fileCommentLength = e2.readInt(2), this.diskNumberStart = e2.readInt(2), this.internalFileAttributes = e2.readInt(2), this.externalFileAttributes = e2.readInt(4), this.localHeaderOffset = e2.readInt(4), this.isEncrypted()) throw new Error("Encrypted zip are not supported");
e2.skip(t2), this.readExtraFields(e2), this.parseZIP64ExtraField(e2), this.fileComment = e2.readData(this.fileCommentLength);
}, processAttributes: function() {
this.unixPermissions = null, this.dosPermissions = null;
var e2 = this.versionMadeBy >> 8;
this.dir = !!(16 & this.externalFileAttributes), 0 == e2 && (this.dosPermissions = 63 & this.externalFileAttributes), 3 == e2 && (this.unixPermissions = this.externalFileAttributes >> 16 & 65535), this.dir || "/" !== this.fileNameStr.slice(-1) || (this.dir = true);
}, parseZIP64ExtraField: function() {
if (this.extraFields[1]) {
var e2 = n(this.extraFields[1].value);
this.uncompressedSize === s.MAX_VALUE_32BITS && (this.uncompressedSize = e2.readInt(8)), this.compressedSize === s.MAX_VALUE_32BITS && (this.compressedSize = e2.readInt(8)), this.localHeaderOffset === s.MAX_VALUE_32BITS && (this.localHeaderOffset = e2.readInt(8)), this.diskNumberStart === s.MAX_VALUE_32BITS && (this.diskNumberStart = e2.readInt(4));
}
}, readExtraFields: function(e2) {
var t2, r2, n2, i2 = e2.index + this.extraFieldsLength;
for (this.extraFields || (this.extraFields = {}); e2.index + 4 < i2; ) t2 = e2.readInt(2), r2 = e2.readInt(2), n2 = e2.readData(r2), this.extraFields[t2] = { id: t2, length: r2, value: n2 };
e2.setIndex(i2);
}, handleUTF8: function() {
var e2 = u.uint8array ? "uint8array" : "array";
if (this.useUTF8()) this.fileNameStr = o.utf8decode(this.fileName), this.fileCommentStr = o.utf8decode(this.fileComment);
else {
var t2 = this.findExtraFieldUnicodePath();
if (null !== t2) this.fileNameStr = t2;
else {
var r2 = s.transformTo(e2, this.fileName);
this.fileNameStr = this.loadOptions.decodeFileName(r2);
}
var n2 = this.findExtraFieldUnicodeComment();
if (null !== n2) this.fileCommentStr = n2;
else {
var i2 = s.transformTo(e2, this.fileComment);
this.fileCommentStr = this.loadOptions.decodeFileName(i2);
}
}
}, findExtraFieldUnicodePath: function() {
var e2 = this.extraFields[28789];
if (e2) {
var t2 = n(e2.value);
return 1 !== t2.readInt(1) ? null : a(this.fileName) !== t2.readInt(4) ? null : o.utf8decode(t2.readData(e2.length - 5));
}
return null;
}, findExtraFieldUnicodeComment: function() {
var e2 = this.extraFields[25461];
if (e2) {
var t2 = n(e2.value);
return 1 !== t2.readInt(1) ? null : a(this.fileComment) !== t2.readInt(4) ? null : o.utf8decode(t2.readData(e2.length - 5));
}
return null;
} }, t.exports = l;
}, { "./compressedObject": 2, "./compressions": 3, "./crc32": 4, "./reader/readerFor": 22, "./support": 30, "./utf8": 31, "./utils": 32 }], 35: [function(e, t, r) {
"use strict";
function n(e2, t2, r2) {
this.name = e2, this.dir = r2.dir, this.date = r2.date, this.comment = r2.comment, this.unixPermissions = r2.unixPermissions, this.dosPermissions = r2.dosPermissions, this._data = t2, this._dataBinary = r2.binary, this.options = { compression: r2.compression, compressionOptions: r2.compressionOptions };
}
var s = e("./stream/StreamHelper"), i = e("./stream/DataWorker"), a = e("./utf8"), o = e("./compressedObject"), h2 = e("./stream/GenericWorker");
n.prototype = { internalStream: function(e2) {
var t2 = null, r2 = "string";
try {
if (!e2) throw new Error("No output type specified.");
var n2 = "string" === (r2 = e2.toLowerCase()) || "text" === r2;
"binarystring" !== r2 && "text" !== r2 || (r2 = "string"), t2 = this._decompressWorker();
var i2 = !this._dataBinary;
i2 && !n2 && (t2 = t2.pipe(new a.Utf8EncodeWorker())), !i2 && n2 && (t2 = t2.pipe(new a.Utf8DecodeWorker()));
} catch (e3) {
(t2 = new h2("error")).error(e3);
}
return new s(t2, r2, "");
}, async: function(e2, t2) {
return this.internalStream(e2).accumulate(t2);
}, nodeStream: function(e2, t2) {
return this.internalStream(e2 || "nodebuffer").toNodejsStream(t2);
}, _compressWorker: function(e2, t2) {
if (this._data instanceof o && this._data.compression.magic === e2.magic) return this._data.getCompressedWorker();
var r2 = this._decompressWorker();
return this._dataBinary || (r2 = r2.pipe(new a.Utf8EncodeWorker())), o.createWorkerFrom(r2, e2, t2);
}, _decompressWorker: function() {
return this._data instanceof o ? this._data.getContentWorker() : this._data instanceof h2 ? this._data : new i(this._data);
} };
for (var u = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"], l = function() {
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
}, f = 0; f < u.length; f++) n.prototype[u[f]] = l;
t.exports = n;
}, { "./compressedObject": 2, "./stream/DataWorker": 27, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31 }], 36: [function(e, l, t) {
(function(t2) {
"use strict";
var r, n, e2 = t2.MutationObserver || t2.WebKitMutationObserver;
if (e2) {
var i = 0, s = new e2(u), a = t2.document.createTextNode("");
s.observe(a, { characterData: true }), r = function() {
a.data = i = ++i % 2;
};
} else if (t2.setImmediate || void 0 === t2.MessageChannel) r = "document" in t2 && "onreadystatechange" in t2.document.createElement("script") ? function() {
var e3 = t2.document.createElement("script");
e3.onreadystatechange = function() {
u(), e3.onreadystatechange = null, e3.parentNode.removeChild(e3), e3 = null;
}, t2.document.documentElement.appendChild(e3);
} : function() {
setTimeout(u, 0);
};
else {
var o = new t2.MessageChannel();
o.port1.onmessage = u, r = function() {
o.port2.postMessage(0);
};
}
var h2 = [];
function u() {
var e3, t3;
n = true;
for (var r2 = h2.length; r2; ) {
for (t3 = h2, h2 = [], e3 = -1; ++e3 < r2; ) t3[e3]();
r2 = h2.length;
}
n = false;
}
l.exports = function(e3) {
1 !== h2.push(e3) || n || r();
};
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {});
}, {}], 37: [function(e, t, r) {
"use strict";
var i = e("immediate");
function u() {
}
var l = {}, s = ["REJECTED"], a = ["FULFILLED"], n = ["PENDING"];
function o(e2) {
if ("function" != typeof e2) throw new TypeError("resolver must be a function");
this.state = n, this.queue = [], this.outcome = void 0, e2 !== u && d(this, e2);
}
function h2(e2, t2, r2) {
this.promise = e2, "function" == typeof t2 && (this.onFulfilled = t2, this.callFulfilled = this.otherCallFulfilled), "function" == typeof r2 && (this.onRejected = r2, this.callRejected = this.otherCallRejected);
}
function f(t2, r2, n2) {
i(function() {
var e2;
try {
e2 = r2(n2);
} catch (e3) {
return l.reject(t2, e3);
}
e2 === t2 ? l.reject(t2, new TypeError("Cannot resolve promise with itself")) : l.resolve(t2, e2);
});
}
function c(e2) {
var t2 = e2 && e2.then;
if (e2 && ("object" == typeof e2 || "function" == typeof e2) && "function" == typeof t2) return function() {
t2.apply(e2, arguments);
};
}
function d(t2, e2) {
var r2 = false;
function n2(e3) {
r2 || (r2 = true, l.reject(t2, e3));
}
function i2(e3) {
r2 || (r2 = true, l.resolve(t2, e3));
}
var s2 = p(function() {
e2(i2, n2);
});
"error" === s2.status && n2(s2.value);
}
function p(e2, t2) {
var r2 = {};
try {
r2.value = e2(t2), r2.status = "success";
} catch (e3) {
r2.status = "error", r2.value = e3;
}
return r2;
}
(t.exports = o).prototype.finally = function(t2) {
if ("function" != typeof t2) return this;
var r2 = this.constructor;
return this.then(function(e2) {
return r2.resolve(t2()).then(function() {
return e2;
});
}, function(e2) {
return r2.resolve(t2()).then(function() {
throw e2;
});
});
}, o.prototype.catch = function(e2) {
return this.then(null, e2);
}, o.prototype.then = function(e2, t2) {
if ("function" != typeof e2 && this.state === a || "function" != typeof t2 && this.state === s) return this;
var r2 = new this.constructor(u);
this.state !== n ? f(r2, this.state === a ? e2 : t2, this.outcome) : this.queue.push(new h2(r2, e2, t2));
return r2;
}, h2.prototype.callFulfilled = function(e2) {
l.resolve(this.promise, e2);
}, h2.prototype.otherCallFulfilled = function(e2) {
f(this.promise, this.onFulfilled, e2);
}, h2.prototype.callRejected = function(e2) {
l.reject(this.promise, e2);
}, h2.prototype.otherCallRejected = function(e2) {
f(this.promise, this.onRejected, e2);
}, l.resolve = function(e2, t2) {
var r2 = p(c, t2);
if ("error" === r2.status) return l.reject(e2, r2.value);
var n2 = r2.value;
if (n2) d(e2, n2);
else {
e2.state = a, e2.outcome = t2;
for (var i2 = -1, s2 = e2.queue.length; ++i2 < s2; ) e2.queue[i2].callFulfilled(t2);
}
return e2;
}, l.reject = function(e2, t2) {
e2.state = s, e2.outcome = t2;
for (var r2 = -1, n2 = e2.queue.length; ++r2 < n2; ) e2.queue[r2].callRejected(t2);
return e2;
}, o.resolve = function(e2) {
if (e2 instanceof this) return e2;
return l.resolve(new this(u), e2);
}, o.reject = function(e2) {
var t2 = new this(u);
return l.reject(t2, e2);
}, o.all = function(e2) {
var r2 = this;
if ("[object Array]" !== Object.prototype.toString.call(e2)) return this.reject(new TypeError("must be an array"));
var n2 = e2.length, i2 = false;
if (!n2) return this.resolve([]);
var s2 = new Array(n2), a2 = 0, t2 = -1, o2 = new this(u);
for (; ++t2 < n2; ) h3(e2[t2], t2);
return o2;
function h3(e3, t3) {
r2.resolve(e3).then(function(e4) {
s2[t3] = e4, ++a2 !== n2 || i2 || (i2 = true, l.resolve(o2, s2));
}, function(e4) {
i2 || (i2 = true, l.reject(o2, e4));
});
}
}, o.race = function(e2) {
var t2 = this;
if ("[object Array]" !== Object.prototype.toString.call(e2)) return this.reject(new TypeError("must be an array"));
var r2 = e2.length, n2 = false;
if (!r2) return this.resolve([]);
var i2 = -1, s2 = new this(u);
for (; ++i2 < r2; ) a2 = e2[i2], t2.resolve(a2).then(function(e3) {
n2 || (n2 = true, l.resolve(s2, e3));
}, function(e3) {
n2 || (n2 = true, l.reject(s2, e3));
});
var a2;
return s2;
};
}, { immediate: 36 }], 38: [function(e, t, r) {
"use strict";
var n = {};
(0, e("./lib/utils/common").assign)(n, e("./lib/deflate"), e("./lib/inflate"), e("./lib/zlib/constants")), t.exports = n;
}, { "./lib/deflate": 39, "./lib/inflate": 40, "./lib/utils/common": 41, "./lib/zlib/constants": 44 }], 39: [function(e, t, r) {
"use strict";
var a = e("./zlib/deflate"), o = e("./utils/common"), h2 = e("./utils/strings"), i = e("./zlib/messages"), s = e("./zlib/zstream"), u = Object.prototype.toString, l = 0, f = -1, c = 0, d = 8;
function p(e2) {
if (!(this instanceof p)) return new p(e2);
this.options = o.assign({ level: f, method: d, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: c, to: "" }, e2 || {});
var t2 = this.options;
t2.raw && 0 < t2.windowBits ? t2.windowBits = -t2.windowBits : t2.gzip && 0 < t2.windowBits && t2.windowBits < 16 && (t2.windowBits += 16), this.err = 0, this.msg = "", this.ended = false, this.chunks = [], this.strm = new s(), this.strm.avail_out = 0;
var r2 = a.deflateInit2(this.strm, t2.level, t2.method, t2.windowBits, t2.memLevel, t2.strategy);
if (r2 !== l) throw new Error(i[r2]);
if (t2.header && a.deflateSetHeader(this.strm, t2.header), t2.dictionary) {
var n2;
if (n2 = "string" == typeof t2.dictionary ? h2.string2buf(t2.dictionary) : "[object ArrayBuffer]" === u.call(t2.dictionary) ? new Uint8Array(t2.dictionary) : t2.dictionary, (r2 = a.deflateSetDictionary(this.strm, n2)) !== l) throw new Error(i[r2]);
this._dict_set = true;
}
}
function n(e2, t2) {
var r2 = new p(t2);
if (r2.push(e2, true), r2.err) throw r2.msg || i[r2.err];
return r2.result;
}
p.prototype.push = function(e2, t2) {
var r2, n2, i2 = this.strm, s2 = this.options.chunkSize;
if (this.ended) return false;
n2 = t2 === ~~t2 ? t2 : true === t2 ? 4 : 0, "string" == typeof e2 ? i2.input = h2.string2buf(e2) : "[object ArrayBuffer]" === u.call(e2) ? i2.input = new Uint8Array(e2) : i2.input = e2, i2.next_in = 0, i2.avail_in = i2.input.length;
do {
if (0 === i2.avail_out && (i2.output = new o.Buf8(s2), i2.next_out = 0, i2.avail_out = s2), 1 !== (r2 = a.deflate(i2, n2)) && r2 !== l) return this.onEnd(r2), !(this.ended = true);
0 !== i2.avail_out && (0 !== i2.avail_in || 4 !== n2 && 2 !== n2) || ("string" === this.options.to ? this.onData(h2.buf2binstring(o.shrinkBuf(i2.output, i2.next_out))) : this.onData(o.shrinkBuf(i2.output, i2.next_out)));
} while ((0 < i2.avail_in || 0 === i2.avail_out) && 1 !== r2);
return 4 === n2 ? (r2 = a.deflateEnd(this.strm), this.onEnd(r2), this.ended = true, r2 === l) : 2 !== n2 || (this.onEnd(l), !(i2.avail_out = 0));
}, p.prototype.onData = function(e2) {
this.chunks.push(e2);
}, p.prototype.onEnd = function(e2) {
e2 === l && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = e2, this.msg = this.strm.msg;
}, r.Deflate = p, r.deflate = n, r.deflateRaw = function(e2, t2) {
return (t2 = t2 || {}).raw = true, n(e2, t2);
}, r.gzip = function(e2, t2) {
return (t2 = t2 || {}).gzip = true, n(e2, t2);
};
}, { "./utils/common": 41, "./utils/strings": 42, "./zlib/deflate": 46, "./zlib/messages": 51, "./zlib/zstream": 53 }], 40: [function(e, t, r) {
"use strict";
var c = e("./zlib/inflate"), d = e("./utils/common"), p = e("./utils/strings"), m = e("./zlib/constants"), n = e("./zlib/messages"), i = e("./zlib/zstream"), s = e("./zlib/gzheader"), _ = Object.prototype.toString;
function a(e2) {
if (!(this instanceof a)) return new a(e2);
this.options = d.assign({ chunkSize: 16384, windowBits: 0, to: "" }, e2 || {});
var t2 = this.options;
t2.raw && 0 <= t2.windowBits && t2.windowBits < 16 && (t2.windowBits = -t2.windowBits, 0 === t2.windowBits && (t2.windowBits = -15)), !(0 <= t2.windowBits && t2.windowBits < 16) || e2 && e2.windowBits || (t2.windowBits += 32), 15 < t2.windowBits && t2.windowBits < 48 && 0 == (15 & t2.windowBits) && (t2.windowBits |= 15), this.err = 0, this.msg = "", this.ended = false, this.chunks = [], this.strm = new i(), this.strm.avail_out = 0;
var r2 = c.inflateInit2(this.strm, t2.windowBits);
if (r2 !== m.Z_OK) throw new Error(n[r2]);
this.header = new s(), c.inflateGetHeader(this.strm, this.header);
}
function o(e2, t2) {
var r2 = new a(t2);
if (r2.push(e2, true), r2.err) throw r2.msg || n[r2.err];
return r2.result;
}
a.prototype.push = function(e2, t2) {
var r2, n2, i2, s2, a2, o2, h2 = this.strm, u = this.options.chunkSize, l = this.options.dictionary, f = false;
if (this.ended) return false;
n2 = t2 === ~~t2 ? t2 : true === t2 ? m.Z_FINISH : m.Z_NO_FLUSH, "string" == typeof e2 ? h2.input = p.binstring2buf(e2) : "[object ArrayBuffer]" === _.call(e2) ? h2.input = new Uint8Array(e2) : h2.input = e2, h2.next_in = 0, h2.avail_in = h2.input.length;
do {
if (0 === h2.avail_out && (h2.output = new d.Buf8(u), h2.next_out = 0, h2.avail_out = u), (r2 = c.inflate(h2, m.Z_NO_FLUSH)) === m.Z_NEED_DICT && l && (o2 = "string" == typeof l ? p.string2buf(l) : "[object ArrayBuffer]" === _.call(l) ? new Uint8Array(l) : l, r2 = c.inflateSetDictionary(this.strm, o2)), r2 === m.Z_BUF_ERROR && true === f && (r2 = m.Z_OK, f = false), r2 !== m.Z_STREAM_END && r2 !== m.Z_OK) return this.onEnd(r2), !(this.ended = true);
h2.next_out && (0 !== h2.avail_out && r2 !== m.Z_STREAM_END && (0 !== h2.avail_in || n2 !== m.Z_FINISH && n2 !== m.Z_SYNC_FLUSH) || ("string" === this.options.to ? (i2 = p.utf8border(h2.output, h2.next_out), s2 = h2.next_out - i2, a2 = p.buf2string(h2.output, i2), h2.next_out = s2, h2.avail_out = u - s2, s2 && d.arraySet(h2.output, h2.output, i2, s2, 0), this.onData(a2)) : this.onData(d.shrinkBuf(h2.output, h2.next_out)))), 0 === h2.avail_in && 0 === h2.avail_out && (f = true);
} while ((0 < h2.avail_in || 0 === h2.avail_out) && r2 !== m.Z_STREAM_END);
return r2 === m.Z_STREAM_END && (n2 = m.Z_FINISH), n2 === m.Z_FINISH ? (r2 = c.inflateEnd(this.strm), this.onEnd(r2), this.ended = true, r2 === m.Z_OK) : n2 !== m.Z_SYNC_FLUSH || (this.onEnd(m.Z_OK), !(h2.avail_out = 0));
}, a.prototype.onData = function(e2) {
this.chunks.push(e2);
}, a.prototype.onEnd = function(e2) {
e2 === m.Z_OK && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = d.flattenChunks(this.chunks)), this.chunks = [], this.err = e2, this.msg = this.strm.msg;
}, r.Inflate = a, r.inflate = o, r.inflateRaw = function(e2, t2) {
return (t2 = t2 || {}).raw = true, o(e2, t2);
}, r.ungzip = o;
}, { "./utils/common": 41, "./utils/strings": 42, "./zlib/constants": 44, "./zlib/gzheader": 47, "./zlib/inflate": 49, "./zlib/messages": 51, "./zlib/zstream": 53 }], 41: [function(e, t, r) {
"use strict";
var n = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array;
r.assign = function(e2) {
for (var t2 = Array.prototype.slice.call(arguments, 1); t2.length; ) {
var r2 = t2.shift();
if (r2) {
if ("object" != typeof r2) throw new TypeError(r2 + "must be non-object");
for (var n2 in r2) r2.hasOwnProperty(n2) && (e2[n2] = r2[n2]);
}
}
return e2;
}, r.shrinkBuf = function(e2, t2) {
return e2.length === t2 ? e2 : e2.subarray ? e2.subarray(0, t2) : (e2.length = t2, e2);
};
var i = { arraySet: function(e2, t2, r2, n2, i2) {
if (t2.subarray && e2.subarray) e2.set(t2.subarray(r2, r2 + n2), i2);
else for (var s2 = 0; s2 < n2; s2++) e2[i2 + s2] = t2[r2 + s2];
}, flattenChunks: function(e2) {
var t2, r2, n2, i2, s2, a;
for (t2 = n2 = 0, r2 = e2.length; t2 < r2; t2++) n2 += e2[t2].length;
for (a = new Uint8Array(n2), t2 = i2 = 0, r2 = e2.length; t2 < r2; t2++) s2 = e2[t2], a.set(s2, i2), i2 += s2.length;
return a;
} }, s = { arraySet: function(e2, t2, r2, n2, i2) {
for (var s2 = 0; s2 < n2; s2++) e2[i2 + s2] = t2[r2 + s2];
}, flattenChunks: function(e2) {
return [].concat.apply([], e2);
} };
r.setTyped = function(e2) {
e2 ? (r.Buf8 = Uint8Array, r.Buf16 = Uint16Array, r.Buf32 = Int32Array, r.assign(r, i)) : (r.Buf8 = Array, r.Buf16 = Array, r.Buf32 = Array, r.assign(r, s));
}, r.setTyped(n);
}, {}], 42: [function(e, t, r) {
"use strict";
var h2 = e("./common"), i = true, s = true;
try {
String.fromCharCode.apply(null, [0]);
} catch (e2) {
i = false;
}
try {
String.fromCharCode.apply(null, new Uint8Array(1));
} catch (e2) {
s = false;
}
for (var u = new h2.Buf8(256), n = 0; n < 256; n++) u[n] = 252 <= n ? 6 : 248 <= n ? 5 : 240 <= n ? 4 : 224 <= n ? 3 : 192 <= n ? 2 : 1;
function l(e2, t2) {
if (t2 < 65537 && (e2.subarray && s || !e2.subarray && i)) return String.fromCharCode.apply(null, h2.shrinkBuf(e2, t2));
for (var r2 = "", n2 = 0; n2 < t2; n2++) r2 += String.fromCharCode(e2[n2]);
return r2;
}
u[254] = u[254] = 1, r.string2buf = function(e2) {
var t2, r2, n2, i2, s2, a = e2.length, o = 0;
for (i2 = 0; i2 < a; i2++) 55296 == (64512 & (r2 = e2.charCodeAt(i2))) && i2 + 1 < a && 56320 == (64512 & (n2 = e2.charCodeAt(i2 + 1))) && (r2 = 65536 + (r2 - 55296 << 10) + (n2 - 56320), i2++), o += r2 < 128 ? 1 : r2 < 2048 ? 2 : r2 < 65536 ? 3 : 4;
for (t2 = new h2.Buf8(o), i2 = s2 = 0; s2 < o; i2++) 55296 == (64512 & (r2 = e2.charCodeAt(i2))) && i2 + 1 < a && 56320 == (64512 & (n2 = e2.charCodeAt(i2 + 1))) && (r2 = 65536 + (r2 - 55296 << 10) + (n2 - 56320), i2++), r2 < 128 ? t2[s2++] = r2 : (r2 < 2048 ? t2[s2++] = 192 | r2 >>> 6 : (r2 < 65536 ? t2[s2++] = 224 | r2 >>> 12 : (t2[s2++] = 240 | r2 >>> 18, t2[s2++] = 128 | r2 >>> 12 & 63), t2[s2++] = 128 | r2 >>> 6 & 63), t2[s2++] = 128 | 63 & r2);
return t2;
}, r.buf2binstring = function(e2) {
return l(e2, e2.length);
}, r.binstring2buf = function(e2) {
for (var t2 = new h2.Buf8(e2.length), r2 = 0, n2 = t2.length; r2 < n2; r2++) t2[r2] = e2.charCodeAt(r2);
return t2;
}, r.buf2string = function(e2, t2) {
var r2, n2, i2, s2, a = t2 || e2.length, o = new Array(2 * a);
for (r2 = n2 = 0; r2 < a; ) if ((i2 = e2[r2++]) < 128) o[n2++] = i2;
else if (4 < (s2 = u[i2])) o[n2++] = 65533, r2 += s2 - 1;
else {
for (i2 &= 2 === s2 ? 31 : 3 === s2 ? 15 : 7; 1 < s2 && r2 < a; ) i2 = i2 << 6 | 63 & e2[r2++], s2--;
1 < s2 ? o[n2++] = 65533 : i2 < 65536 ? o[n2++] = i2 : (i2 -= 65536, o[n2++] = 55296 | i2 >> 10 & 1023, o[n2++] = 56320 | 1023 & i2);
}
return l(o, n2);
}, r.utf8border = function(e2, t2) {
var r2;
for ((t2 = t2 || e2.length) > e2.length && (t2 = e2.length), r2 = t2 - 1; 0 <= r2 && 128 == (192 & e2[r2]); ) r2--;
return r2 < 0 ? t2 : 0 === r2 ? t2 : r2 + u[e2[r2]] > t2 ? r2 : t2;
};
}, { "./common": 41 }], 43: [function(e, t, r) {
"use strict";
t.exports = function(e2, t2, r2, n) {
for (var i = 65535 & e2 | 0, s = e2 >>> 16 & 65535 | 0, a = 0; 0 !== r2; ) {
for (r2 -= a = 2e3 < r2 ? 2e3 : r2; s = s + (i = i + t2[n++] | 0) | 0, --a; ) ;
i %= 65521, s %= 65521;
}
return i | s << 16 | 0;
};
}, {}], 44: [function(e, t, r) {
"use strict";
t.exports = { 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_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 };
}, {}], 45: [function(e, t, r) {
"use strict";
var o = function() {
for (var e2, t2 = [], r2 = 0; r2 < 256; r2++) {
e2 = r2;
for (var n = 0; n < 8; n++) e2 = 1 & e2 ? 3988292384 ^ e2 >>> 1 : e2 >>> 1;
t2[r2] = e2;
}
return t2;
}();
t.exports = function(e2, t2, r2, n) {
var i = o, s = n + r2;
e2 ^= -1;
for (var a = n; a < s; a++) e2 = e2 >>> 8 ^ i[255 & (e2 ^ t2[a])];
return -1 ^ e2;
};
}, {}], 46: [function(e, t, r) {
"use strict";
var h2, c = e("../utils/common"), u = e("./trees"), d = e("./adler32"), p = e("./crc32"), n = e("./messages"), l = 0, f = 4, m = 0, _ = -2, g = -1, b = 4, i = 2, v = 8, y = 9, s = 286, a = 30, o = 19, w = 2 * s + 1, k = 15, x = 3, S = 258, z = S + x + 1, C = 42, E = 113, A = 1, I = 2, O = 3, B = 4;
function R(e2, t2) {
return e2.msg = n[t2], t2;
}
function T(e2) {
return (e2 << 1) - (4 < e2 ? 9 : 0);
}
function D(e2) {
for (var t2 = e2.length; 0 <= --t2; ) e2[t2] = 0;
}
function F(e2) {
var t2 = e2.state, r2 = t2.pending;
r2 > e2.avail_out && (r2 = e2.avail_out), 0 !== r2 && (c.arraySet(e2.output, t2.pending_buf, t2.pending_out, r2, e2.next_out), e2.next_out += r2, t2.pending_out += r2, e2.total_out += r2, e2.avail_out -= r2, t2.pending -= r2, 0 === t2.pending && (t2.pending_out = 0));
}
function N(e2, t2) {
u._tr_flush_block(e2, 0 <= e2.block_start ? e2.block_start : -1, e2.strstart - e2.block_start, t2), e2.block_start = e2.strstart, F(e2.strm);
}
function U(e2, t2) {
e2.pending_buf[e2.pending++] = t2;
}
function P(e2, t2) {
e2.pending_buf[e2.pending++] = t2 >>> 8 & 255, e2.pending_buf[e2.pending++] = 255 & t2;
}
function L(e2, t2) {
var r2, n2, i2 = e2.max_chain_length, s2 = e2.strstart, a2 = e2.prev_length, o2 = e2.nice_match, h3 = e2.strstart > e2.w_size - z ? e2.strstart - (e2.w_size - z) : 0, u2 = e2.window, l2 = e2.w_mask, f2 = e2.prev, c2 = e2.strstart + S, d2 = u2[s2 + a2 - 1], p2 = u2[s2 + a2];
e2.prev_length >= e2.good_match && (i2 >>= 2), o2 > e2.lookahead && (o2 = e2.lookahead);
do {
if (u2[(r2 = t2) + a2] === p2 && u2[r2 + a2 - 1] === d2 && u2[r2] === u2[s2] && u2[++r2] === u2[s2 + 1]) {
s2 += 2, r2++;
do {
} while (u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && s2 < c2);
if (n2 = S - (c2 - s2), s2 = c2 - S, a2 < n2) {
if (e2.match_start = t2, o2 <= (a2 = n2)) break;
d2 = u2[s2 + a2 - 1], p2 = u2[s2 + a2];
}
}
} while ((t2 = f2[t2 & l2]) > h3 && 0 != --i2);
return a2 <= e2.lookahead ? a2 : e2.lookahead;
}
function j(e2) {
var t2, r2, n2, i2, s2, a2, o2, h3, u2, l2, f2 = e2.w_size;
do {
if (i2 = e2.window_size - e2.lookahead - e2.strstart, e2.strstart >= f2 + (f2 - z)) {
for (c.arraySet(e2.window, e2.window, f2, f2, 0), e2.match_start -= f2, e2.strstart -= f2, e2.block_start -= f2, t2 = r2 = e2.hash_size; n2 = e2.head[--t2], e2.head[t2] = f2 <= n2 ? n2 - f2 : 0, --r2; ) ;
for (t2 = r2 = f2; n2 = e2.prev[--t2], e2.prev[t2] = f2 <= n2 ? n2 - f2 : 0, --r2; ) ;
i2 += f2;
}
if (0 === e2.strm.avail_in) break;
if (a2 = e2.strm, o2 = e2.window, h3 = e2.strstart + e2.lookahead, u2 = i2, l2 = void 0, l2 = a2.avail_in, u2 < l2 && (l2 = u2), r2 = 0 === l2 ? 0 : (a2.avail_in -= l2, c.arraySet(o2, a2.input, a2.next_in, l2, h3), 1 === a2.state.wrap ? a2.adler = d(a2.adler, o2, l2, h3) : 2 === a2.state.wrap && (a2.adler = p(a2.adler, o2, l2, h3)), a2.next_in += l2, a2.total_in += l2, l2), e2.lookahead += r2, e2.lookahead + e2.insert >= x) for (s2 = e2.strstart - e2.insert, e2.ins_h = e2.window[s2], e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[s2 + 1]) & e2.hash_mask; e2.insert && (e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[s2 + x - 1]) & e2.hash_mask, e2.prev[s2 & e2.w_mask] = e2.head[e2.ins_h], e2.head[e2.ins_h] = s2, s2++, e2.insert--, !(e2.lookahead + e2.insert < x)); ) ;
} while (e2.lookahead < z && 0 !== e2.strm.avail_in);
}
function Z(e2, t2) {
for (var r2, n2; ; ) {
if (e2.lookahead < z) {
if (j(e2), e2.lookahead < z && t2 === l) return A;
if (0 === e2.lookahead) break;
}
if (r2 = 0, e2.lookahead >= x && (e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[e2.strstart + x - 1]) & e2.hash_mask, r2 = e2.prev[e2.strstart & e2.w_mask] = e2.head[e2.ins_h], e2.head[e2.ins_h] = e2.strstart), 0 !== r2 && e2.strstart - r2 <= e2.w_size - z && (e2.match_length = L(e2, r2)), e2.match_length >= x) if (n2 = u._tr_tally(e2, e2.strstart - e2.match_start, e2.match_length - x), e2.lookahead -= e2.match_length, e2.match_length <= e2.max_lazy_match && e2.lookahead >= x) {
for (e2.match_length--; e2.strstart++, e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[e2.strstart + x - 1]) & e2.hash_mask, r2 = e2.prev[e2.strstart & e2.w_mask] = e2.head[e2.ins_h], e2.head[e2.ins_h] = e2.strstart, 0 != --e2.match_length; ) ;
e2.strstart++;
} else e2.strstart += e2.match_length, e2.match_length = 0, e2.ins_h = e2.window[e2.strstart], e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[e2.strstart + 1]) & e2.hash_mask;
else n2 = u._tr_tally(e2, 0, e2.window[e2.strstart]), e2.lookahead--, e2.strstart++;
if (n2 && (N(e2, false), 0 === e2.strm.avail_out)) return A;
}
return e2.insert = e2.strstart < x - 1 ? e2.strstart : x - 1, t2 === f ? (N(e2, true), 0 === e2.strm.avail_out ? O : B) : e2.last_lit && (N(e2, false), 0 === e2.strm.avail_out) ? A : I;
}
function W(e2, t2) {
for (var r2, n2, i2; ; ) {
if (e2.lookahead < z) {
if (j(e2), e2.lookahead < z && t2 === l) return A;
if (0 === e2.lookahead) break;
}
if (r2 = 0, e2.lookahead >= x && (e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[e2.strstart + x - 1]) & e2.hash_mask, r2 = e2.prev[e2.strstart & e2.w_mask] = e2.head[e2.ins_h], e2.head[e2.ins_h] = e2.strstart), e2.prev_length = e2.match_length, e2.prev_match = e2.match_start, e2.match_length = x - 1, 0 !== r2 && e2.prev_length < e2.max_lazy_match && e2.strstart - r2 <= e2.w_size - z && (e2.match_length = L(e2, r2), e2.match_length <= 5 && (1 === e2.strategy || e2.match_length === x && 4096 < e2.strstart - e2.match_start) && (e2.match_length = x - 1)), e2.prev_length >= x && e2.match_length <= e2.prev_length) {
for (i2 = e2.strstart + e2.lookahead - x, n2 = u._tr_tally(e2, e2.strstart - 1 - e2.prev_match, e2.prev_length - x), e2.lookahead -= e2.prev_length - 1, e2.prev_length -= 2; ++e2.strstart <= i2 && (e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[e2.strstart + x - 1]) & e2.hash_mask, r2 = e2.prev[e2.strstart & e2.w_mask] = e2.head[e2.ins_h], e2.head[e2.ins_h] = e2.strstart), 0 != --e2.prev_length; ) ;
if (e2.match_available = 0, e2.match_length = x - 1, e2.strstart++, n2 && (N(e2, false), 0 === e2.strm.avail_out)) return A;
} else if (e2.match_available) {
if ((n2 = u._tr_tally(e2, 0, e2.window[e2.strstart - 1])) && N(e2, false), e2.strstart++, e2.lookahead--, 0 === e2.strm.avail_out) return A;
} else e2.match_available = 1, e2.strstart++, e2.lookahead--;
}
return e2.match_available && (n2 = u._tr_tally(e2, 0, e2.window[e2.strstart - 1]), e2.match_available = 0), e2.insert = e2.strstart < x - 1 ? e2.strstart : x - 1, t2 === f ? (N(e2, true), 0 === e2.strm.avail_out ? O : B) : e2.last_lit && (N(e2, false), 0 === e2.strm.avail_out) ? A : I;
}
function M(e2, t2, r2, n2, i2) {
this.good_length = e2, this.max_lazy = t2, this.nice_length = r2, this.max_chain = n2, this.func = i2;
}
function H() {
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 = v, 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 c.Buf16(2 * w), this.dyn_dtree = new c.Buf16(2 * (2 * a + 1)), this.bl_tree = new c.Buf16(2 * (2 * o + 1)), D(this.dyn_ltree), D(this.dyn_dtree), D(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new c.Buf16(k + 1), this.heap = new c.Buf16(2 * s + 1), D(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new c.Buf16(2 * s + 1), D(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
}
function G(e2) {
var t2;
return e2 && e2.state ? (e2.total_in = e2.total_out = 0, e2.data_type = i, (t2 = e2.state).pending = 0, t2.pending_out = 0, t2.wrap < 0 && (t2.wrap = -t2.wrap), t2.status = t2.wrap ? C : E, e2.adler = 2 === t2.wrap ? 0 : 1, t2.last_flush = l, u._tr_init(t2), m) : R(e2, _);
}
function K(e2) {
var t2 = G(e2);
return t2 === m && function(e3) {
e3.window_size = 2 * e3.w_size, D(e3.head), e3.max_lazy_match = h2[e3.level].max_lazy, e3.good_match = h2[e3.level].good_length, e3.nice_match = h2[e3.level].nice_length, e3.max_chain_length = h2[e3.level].max_chain, e3.strstart = 0, e3.block_start = 0, e3.lookahead = 0, e3.insert = 0, e3.match_length = e3.prev_length = x - 1, e3.match_available = 0, e3.ins_h = 0;
}(e2.state), t2;
}
function Y(e2, t2, r2, n2, i2, s2) {
if (!e2) return _;
var a2 = 1;
if (t2 === g && (t2 = 6), n2 < 0 ? (a2 = 0, n2 = -n2) : 15 < n2 && (a2 = 2, n2 -= 16), i2 < 1 || y < i2 || r2 !== v || n2 < 8 || 15 < n2 || t2 < 0 || 9 < t2 || s2 < 0 || b < s2) return R(e2, _);
8 === n2 && (n2 = 9);
var o2 = new H();
return (e2.state = o2).strm = e2, o2.wrap = a2, o2.gzhead = null, o2.w_bits = n2, o2.w_size = 1 << o2.w_bits, o2.w_mask = o2.w_size - 1, o2.hash_bits = i2 + 7, o2.hash_size = 1 << o2.hash_bits, o2.hash_mask = o2.hash_size - 1, o2.hash_shift = ~~((o2.hash_bits + x - 1) / x), o2.window = new c.Buf8(2 * o2.w_size), o2.head = new c.Buf16(o2.hash_size), o2.prev = new c.Buf16(o2.w_size), o2.lit_bufsize = 1 << i2 + 6, o2.pending_buf_size = 4 * o2.lit_bufsize, o2.pending_buf = new c.Buf8(o2.pending_buf_size), o2.d_buf = 1 * o2.lit_bufsize, o2.l_buf = 3 * o2.lit_bufsize, o2.level = t2, o2.strategy = s2, o2.method = r2, K(e2);
}
h2 = [new M(0, 0, 0, 0, function(e2, t2) {
var r2 = 65535;
for (r2 > e2.pending_buf_size - 5 && (r2 = e2.pending_buf_size - 5); ; ) {
if (e2.lookahead <= 1) {
if (j(e2), 0 === e2.lookahead && t2 === l) return A;
if (0 === e2.lookahead) break;
}
e2.strstart += e2.lookahead, e2.lookahead = 0;
var n2 = e2.block_start + r2;
if ((0 === e2.strstart || e2.strstart >= n2) && (e2.lookahead = e2.strstart - n2, e2.strstart = n2, N(e2, false), 0 === e2.strm.avail_out)) return A;
if (e2.strstart - e2.block_start >= e2.w_size - z && (N(e2, false), 0 === e2.strm.avail_out)) return A;
}
return e2.insert = 0, t2 === f ? (N(e2, true), 0 === e2.strm.avail_out ? O : B) : (e2.strstart > e2.block_start && (N(e2, false), e2.strm.avail_out), A);
}), new M(4, 4, 8, 4, Z), new M(4, 5, 16, 8, Z), new M(4, 6, 32, 32, Z), new M(4, 4, 16, 16, W), new M(8, 16, 32, 32, W), new M(8, 16, 128, 128, W), new M(8, 32, 128, 256, W), new M(32, 128, 258, 1024, W), new M(32, 258, 258, 4096, W)], r.deflateInit = function(e2, t2) {
return Y(e2, t2, v, 15, 8, 0);
}, r.deflateInit2 = Y, r.deflateReset = K, r.deflateResetKeep = G, r.deflateSetHeader = function(e2, t2) {
return e2 && e2.state ? 2 !== e2.state.wrap ? _ : (e2.state.gzhead = t2, m) : _;
}, r.deflate = function(e2, t2) {
var r2, n2, i2, s2;
if (!e2 || !e2.state || 5 < t2 || t2 < 0) return e2 ? R(e2, _) : _;
if (n2 = e2.state, !e2.output || !e2.input && 0 !== e2.avail_in || 666 === n2.status && t2 !== f) return R(e2, 0 === e2.avail_out ? -5 : _);
if (n2.strm = e2, r2 = n2.last_flush, n2.last_flush = t2, n2.status === C) if (2 === n2.wrap) e2.adler = 0, U(n2, 31), U(n2, 139), U(n2, 8), n2.gzhead ? (U(n2, (n2.gzhead.text ? 1 : 0) + (n2.gzhead.hcrc ? 2 : 0) + (n2.gzhead.extra ? 4 : 0) + (n2.gzhead.name ? 8 : 0) + (n2.gzhead.comment ? 16 : 0)), U(n2, 255 & n2.gzhead.time), U(n2, n2.gzhead.time >> 8 & 255), U(n2, n2.gzhead.time >> 16 & 255), U(n2, n2.gzhead.time >> 24 & 255), U(n2, 9 === n2.level ? 2 : 2 <= n2.strategy || n2.level < 2 ? 4 : 0), U(n2, 255 & n2.gzhead.os), n2.gzhead.extra && n2.gzhead.extra.length && (U(n2, 255 & n2.gzhead.extra.length), U(n2, n2.gzhead.extra.length >> 8 & 255)), n2.gzhead.hcrc && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending, 0)), n2.gzindex = 0, n2.status = 69) : (U(n2, 0), U(n2, 0), U(n2, 0), U(n2, 0), U(n2, 0), U(n2, 9 === n2.level ? 2 : 2 <= n2.strategy || n2.level < 2 ? 4 : 0), U(n2, 3), n2.status = E);
else {
var a2 = v + (n2.w_bits - 8 << 4) << 8;
a2 |= (2 <= n2.strategy || n2.level < 2 ? 0 : n2.level < 6 ? 1 : 6 === n2.level ? 2 : 3) << 6, 0 !== n2.strstart && (a2 |= 32), a2 += 31 - a2 % 31, n2.status = E, P(n2, a2), 0 !== n2.strstart && (P(n2, e2.adler >>> 16), P(n2, 65535 & e2.adler)), e2.adler = 1;
}
if (69 === n2.status) if (n2.gzhead.extra) {
for (i2 = n2.pending; n2.gzindex < (65535 & n2.gzhead.extra.length) && (n2.pending !== n2.pending_buf_size || (n2.gzhead.hcrc && n2.pending > i2 && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending - i2, i2)), F(e2), i2 = n2.pending, n2.pending !== n2.pending_buf_size)); ) U(n2, 255 & n2.gzhead.extra[n2.gzindex]), n2.gzindex++;
n2.gzhead.hcrc && n2.pending > i2 && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending - i2, i2)), n2.gzindex === n2.gzhead.extra.length && (n2.gzindex = 0, n2.status = 73);
} else n2.status = 73;
if (73 === n2.status) if (n2.gzhead.name) {
i2 = n2.pending;
do {
if (n2.pending === n2.pending_buf_size && (n2.gzhead.hcrc && n2.pending > i2 && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending - i2, i2)), F(e2), i2 = n2.pending, n2.pending === n2.pending_buf_size)) {
s2 = 1;
break;
}
s2 = n2.gzindex < n2.gzhead.name.length ? 255 & n2.gzhead.name.charCodeAt(n2.gzindex++) : 0, U(n2, s2);
} while (0 !== s2);
n2.gzhead.hcrc && n2.pending > i2 && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending - i2, i2)), 0 === s2 && (n2.gzindex = 0, n2.status = 91);
} else n2.status = 91;
if (91 === n2.status) if (n2.gzhead.comment) {
i2 = n2.pending;
do {
if (n2.pending === n2.pending_buf_size && (n2.gzhead.hcrc && n2.pending > i2 && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending - i2, i2)), F(e2), i2 = n2.pending, n2.pending === n2.pending_buf_size)) {
s2 = 1;
break;
}
s2 = n2.gzindex < n2.gzhead.comment.length ? 255 & n2.gzhead.comment.charCodeAt(n2.gzindex++) : 0, U(n2, s2);
} while (0 !== s2);
n2.gzhead.hcrc && n2.pending > i2 && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending - i2, i2)), 0 === s2 && (n2.status = 103);
} else n2.status = 103;
if (103 === n2.status && (n2.gzhead.hcrc ? (n2.pending + 2 > n2.pending_buf_size && F(e2), n2.pending + 2 <= n2.pending_buf_size && (U(n2, 255 & e2.adler), U(n2, e2.adler >> 8 & 255), e2.adler = 0, n2.status = E)) : n2.status = E), 0 !== n2.pending) {
if (F(e2), 0 === e2.avail_out) return n2.last_flush = -1, m;
} else if (0 === e2.avail_in && T(t2) <= T(r2) && t2 !== f) return R(e2, -5);
if (666 === n2.status && 0 !== e2.avail_in) return R(e2, -5);
if (0 !== e2.avail_in || 0 !== n2.lookahead || t2 !== l && 666 !== n2.status) {
var o2 = 2 === n2.strategy ? function(e3, t3) {
for (var r3; ; ) {
if (0 === e3.lookahead && (j(e3), 0 === e3.lookahead)) {
if (t3 === l) return A;
break;
}
if (e3.match_length = 0, r3 = u._tr_tally(e3, 0, e3.window[e3.strstart]), e3.lookahead--, e3.strstart++, r3 && (N(e3, false), 0 === e3.strm.avail_out)) return A;
}
return e3.insert = 0, t3 === f ? (N(e3, true), 0 === e3.strm.avail_out ? O : B) : e3.last_lit && (N(e3, false), 0 === e3.strm.avail_out) ? A : I;
}(n2, t2) : 3 === n2.strategy ? function(e3, t3) {
for (var r3, n3, i3, s3, a3 = e3.window; ; ) {
if (e3.lookahead <= S) {
if (j(e3), e3.lookahead <= S && t3 === l) return A;
if (0 === e3.lookahead) break;
}
if (e3.match_length = 0, e3.lookahead >= x && 0 < e3.strstart && (n3 = a3[i3 = e3.strstart - 1]) === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3]) {
s3 = e3.strstart + S;
do {
} while (n3 === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3] && i3 < s3);
e3.match_length = S - (s3 - i3), e3.match_length > e3.lookahead && (e3.match_length = e3.lookahead);
}
if (e3.match_length >= x ? (r3 = u._tr_tally(e3, 1, e3.match_length - x), e3.lookahead -= e3.match_length, e3.strstart += e3.match_length, e3.match_length = 0) : (r3 = u._tr_tally(e3, 0, e3.window[e3.strstart]), e3.lookahead--, e3.strstart++), r3 && (N(e3, false), 0 === e3.strm.avail_out)) return A;
}
return e3.insert = 0, t3 === f ? (N(e3, true), 0 === e3.strm.avail_out ? O : B) : e3.last_lit && (N(e3, false), 0 === e3.strm.avail_out) ? A : I;
}(n2, t2) : h2[n2.level].func(n2, t2);
if (o2 !== O && o2 !== B || (n2.status = 666), o2 === A || o2 === O) return 0 === e2.avail_out && (n2.last_flush = -1), m;
if (o2 === I && (1 === t2 ? u._tr_align(n2) : 5 !== t2 && (u._tr_stored_block(n2, 0, 0, false), 3 === t2 && (D(n2.head), 0 === n2.lookahead && (n2.strstart = 0, n2.block_start = 0, n2.insert = 0))), F(e2), 0 === e2.avail_out)) return n2.last_flush = -1, m;
}
return t2 !== f ? m : n2.wrap <= 0 ? 1 : (2 === n2.wrap ? (U(n2, 255 & e2.adler), U(n2, e2.adler >> 8 & 255), U(n2, e2.adler >> 16 & 255), U(n2, e2.adler >> 24 & 255), U(n2, 255 & e2.total_in), U(n2, e2.total_in >> 8 & 255), U(n2, e2.total_in >> 16 & 255), U(n2, e2.total_in >> 24 & 255)) : (P(n2, e2.adler >>> 16), P(n2, 65535 & e2.adler)), F(e2), 0 < n2.wrap && (n2.wrap = -n2.wrap), 0 !== n2.pending ? m : 1);
}, r.deflateEnd = function(e2) {
var t2;
return e2 && e2.state ? (t2 = e2.state.status) !== C && 69 !== t2 && 73 !== t2 && 91 !== t2 && 103 !== t2 && t2 !== E && 666 !== t2 ? R(e2, _) : (e2.state = null, t2 === E ? R(e2, -3) : m) : _;
}, r.deflateSetDictionary = function(e2, t2) {
var r2, n2, i2, s2, a2, o2, h3, u2, l2 = t2.length;
if (!e2 || !e2.state) return _;
if (2 === (s2 = (r2 = e2.state).wrap) || 1 === s2 && r2.status !== C || r2.lookahead) return _;
for (1 === s2 && (e2.adler = d(e2.adler, t2, l2, 0)), r2.wrap = 0, l2 >= r2.w_size && (0 === s2 && (D(r2.head), r2.strstart = 0, r2.block_start = 0, r2.insert = 0), u2 = new c.Buf8(r2.w_size), c.arraySet(u2, t2, l2 - r2.w_size, r2.w_size, 0), t2 = u2, l2 = r2.w_size), a2 = e2.avail_in, o2 = e2.next_in, h3 = e2.input, e2.avail_in = l2, e2.next_in = 0, e2.input = t2, j(r2); r2.lookahead >= x; ) {
for (n2 = r2.strstart, i2 = r2.lookahead - (x - 1); r2.ins_h = (r2.ins_h << r2.hash_shift ^ r2.window[n2 + x - 1]) & r2.hash_mask, r2.prev[n2 & r2.w_mask] = r2.head[r2.ins_h], r2.head[r2.ins_h] = n2, n2++, --i2; ) ;
r2.strstart = n2, r2.lookahead = x - 1, j(r2);
}
return r2.strstart += r2.lookahead, r2.block_start = r2.strstart, r2.insert = r2.lookahead, r2.lookahead = 0, r2.match_length = r2.prev_length = x - 1, r2.match_available = 0, e2.next_in = o2, e2.input = h3, e2.avail_in = a2, r2.wrap = s2, m;
}, r.deflateInfo = "pako deflate (from Nodeca project)";
}, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./messages": 51, "./trees": 52 }], 47: [function(e, t, r) {
"use strict";
t.exports = function() {
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 = false;
};
}, {}], 48: [function(e, t, r) {
"use strict";
t.exports = function(e2, t2) {
var r2, n, i, s, a, o, h2, u, l, f, c, d, p, m, _, g, b, v, y, w, k, x, S, z, C;
r2 = e2.state, n = e2.next_in, z = e2.input, i = n + (e2.avail_in - 5), s = e2.next_out, C = e2.output, a = s - (t2 - e2.avail_out), o = s + (e2.avail_out - 257), h2 = r2.dmax, u = r2.wsize, l = r2.whave, f = r2.wnext, c = r2.window, d = r2.hold, p = r2.bits, m = r2.lencode, _ = r2.distcode, g = (1 << r2.lenbits) - 1, b = (1 << r2.distbits) - 1;
e: do {
p < 15 && (d += z[n++] << p, p += 8, d += z[n++] << p, p += 8), v = m[d & g];
t: for (; ; ) {
if (d >>>= y = v >>> 24, p -= y, 0 === (y = v >>> 16 & 255)) C[s++] = 65535 & v;
else {
if (!(16 & y)) {
if (0 == (64 & y)) {
v = m[(65535 & v) + (d & (1 << y) - 1)];
continue t;
}
if (32 & y) {
r2.mode = 12;
break e;
}
e2.msg = "invalid literal/length code", r2.mode = 30;
break e;
}
w = 65535 & v, (y &= 15) && (p < y && (d += z[n++] << p, p += 8), w += d & (1 << y) - 1, d >>>= y, p -= y), p < 15 && (d += z[n++] << p, p += 8, d += z[n++] << p, p += 8), v = _[d & b];
r: for (; ; ) {
if (d >>>= y = v >>> 24, p -= y, !(16 & (y = v >>> 16 & 255))) {
if (0 == (64 & y)) {
v = _[(65535 & v) + (d & (1 << y) - 1)];
continue r;
}
e2.msg = "invalid distance code", r2.mode = 30;
break e;
}
if (k = 65535 & v, p < (y &= 15) && (d += z[n++] << p, (p += 8) < y && (d += z[n++] << p, p += 8)), h2 < (k += d & (1 << y) - 1)) {
e2.msg = "invalid distance too far back", r2.mode = 30;
break e;
}
if (d >>>= y, p -= y, (y = s - a) < k) {
if (l < (y = k - y) && r2.sane) {
e2.msg = "invalid distance too far back", r2.mode = 30;
break e;
}
if (S = c, (x = 0) === f) {
if (x += u - y, y < w) {
for (w -= y; C[s++] = c[x++], --y; ) ;
x = s - k, S = C;
}
} else if (f < y) {
if (x += u + f - y, (y -= f) < w) {
for (w -= y; C[s++] = c[x++], --y; ) ;
if (x = 0, f < w) {
for (w -= y = f; C[s++] = c[x++], --y; ) ;
x = s - k, S = C;
}
}
} else if (x += f - y, y < w) {
for (w -= y; C[s++] = c[x++], --y; ) ;
x = s - k, S = C;
}
for (; 2 < w; ) C[s++] = S[x++], C[s++] = S[x++], C[s++] = S[x++], w -= 3;
w && (C[s++] = S[x++], 1 < w && (C[s++] = S[x++]));
} else {
for (x = s - k; C[s++] = C[x++], C[s++] = C[x++], C[s++] = C[x++], 2 < (w -= 3); ) ;
w && (C[s++] = C[x++], 1 < w && (C[s++] = C[x++]));
}
break;
}
}
break;
}
} while (n < i && s < o);
n -= w = p >> 3, d &= (1 << (p -= w << 3)) - 1, e2.next_in = n, e2.next_out = s, e2.avail_in = n < i ? i - n + 5 : 5 - (n - i), e2.avail_out = s < o ? o - s + 257 : 257 - (s - o), r2.hold = d, r2.bits = p;
};
}, {}], 49: [function(e, t, r) {
"use strict";
var I = e("../utils/common"), O = e("./adler32"), B = e("./crc32"), R = e("./inffast"), T = e("./inftrees"), D = 1, F = 2, N = 0, U = -2, P = 1, n = 852, i = 592;
function L(e2) {
return (e2 >>> 24 & 255) + (e2 >>> 8 & 65280) + ((65280 & e2) << 8) + ((255 & e2) << 24);
}
function s() {
this.mode = 0, this.last = false, this.wrap = 0, this.havedict = false, 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 I.Buf16(320), this.work = new I.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
}
function a(e2) {
var t2;
return e2 && e2.state ? (t2 = e2.state, e2.total_in = e2.total_out = t2.total = 0, e2.msg = "", t2.wrap && (e2.adler = 1 & t2.wrap), t2.mode = P, t2.last = 0, t2.havedict = 0, t2.dmax = 32768, t2.head = null, t2.hold = 0, t2.bits = 0, t2.lencode = t2.lendyn = new I.Buf32(n), t2.distcode = t2.distdyn = new I.Buf32(i), t2.sane = 1, t2.back = -1, N) : U;
}
function o(e2) {
var t2;
return e2 && e2.state ? ((t2 = e2.state).wsize = 0, t2.whave = 0, t2.wnext = 0, a(e2)) : U;
}
function h2(e2, t2) {
var r2, n2;
return e2 && e2.state ? (n2 = e2.state, t2 < 0 ? (r2 = 0, t2 = -t2) : (r2 = 1 + (t2 >> 4), t2 < 48 && (t2 &= 15)), t2 && (t2 < 8 || 15 < t2) ? U : (null !== n2.window && n2.wbits !== t2 && (n2.window = null), n2.wrap = r2, n2.wbits = t2, o(e2))) : U;
}
function u(e2, t2) {
var r2, n2;
return e2 ? (n2 = new s(), (e2.state = n2).window = null, (r2 = h2(e2, t2)) !== N && (e2.state = null), r2) : U;
}
var l, f, c = true;
function j(e2) {
if (c) {
var t2;
for (l = new I.Buf32(512), f = new I.Buf32(32), t2 = 0; t2 < 144; ) e2.lens[t2++] = 8;
for (; t2 < 256; ) e2.lens[t2++] = 9;
for (; t2 < 280; ) e2.lens[t2++] = 7;
for (; t2 < 288; ) e2.lens[t2++] = 8;
for (T(D, e2.lens, 0, 288, l, 0, e2.work, { bits: 9 }), t2 = 0; t2 < 32; ) e2.lens[t2++] = 5;
T(F, e2.lens, 0, 32, f, 0, e2.work, { bits: 5 }), c = false;
}
e2.lencode = l, e2.lenbits = 9, e2.distcode = f, e2.distbits = 5;
}
function Z(e2, t2, r2, n2) {
var i2, s2 = e2.state;
return null === s2.window && (s2.wsize = 1 << s2.wbits, s2.wnext = 0, s2.whave = 0, s2.window = new I.Buf8(s2.wsize)), n2 >= s2.wsize ? (I.arraySet(s2.window, t2, r2 - s2.wsize, s2.wsize, 0), s2.wnext = 0, s2.whave = s2.wsize) : (n2 < (i2 = s2.wsize - s2.wnext) && (i2 = n2), I.arraySet(s2.window, t2, r2 - n2, i2, s2.wnext), (n2 -= i2) ? (I.arraySet(s2.window, t2, r2 - n2, n2, 0), s2.wnext = n2, s2.whave = s2.wsize) : (s2.wnext += i2, s2.wnext === s2.wsize && (s2.wnext = 0), s2.whave < s2.wsize && (s2.whave += i2))), 0;
}
r.inflateReset = o, r.inflateReset2 = h2, r.inflateResetKeep = a, r.inflateInit = function(e2) {
return u(e2, 15);
}, r.inflateInit2 = u, r.inflate = function(e2, t2) {
var r2, n2, i2, s2, a2, o2, h3, u2, l2, f2, c2, d, p, m, _, g, b, v, y, w, k, x, S, z, C = 0, E = new I.Buf8(4), A = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
if (!e2 || !e2.state || !e2.output || !e2.input && 0 !== e2.avail_in) return U;
12 === (r2 = e2.state).mode && (r2.mode = 13), a2 = e2.next_out, i2 = e2.output, h3 = e2.avail_out, s2 = e2.next_in, n2 = e2.input, o2 = e2.avail_in, u2 = r2.hold, l2 = r2.bits, f2 = o2, c2 = h3, x = N;
e: for (; ; ) switch (r2.mode) {
case P:
if (0 === r2.wrap) {
r2.mode = 13;
break;
}
for (; l2 < 16; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
if (2 & r2.wrap && 35615 === u2) {
E[r2.check = 0] = 255 & u2, E[1] = u2 >>> 8 & 255, r2.check = B(r2.check, E, 2, 0), l2 = u2 = 0, r2.mode = 2;
break;
}
if (r2.flags = 0, r2.head && (r2.head.done = false), !(1 & r2.wrap) || (((255 & u2) << 8) + (u2 >> 8)) % 31) {
e2.msg = "incorrect header check", r2.mode = 30;
break;
}
if (8 != (15 & u2)) {
e2.msg = "unknown compression method", r2.mode = 30;
break;
}
if (l2 -= 4, k = 8 + (15 & (u2 >>>= 4)), 0 === r2.wbits) r2.wbits = k;
else if (k > r2.wbits) {
e2.msg = "invalid window size", r2.mode = 30;
break;
}
r2.dmax = 1 << k, e2.adler = r2.check = 1, r2.mode = 512 & u2 ? 10 : 12, l2 = u2 = 0;
break;
case 2:
for (; l2 < 16; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
if (r2.flags = u2, 8 != (255 & r2.flags)) {
e2.msg = "unknown compression method", r2.mode = 30;
break;
}
if (57344 & r2.flags) {
e2.msg = "unknown header flags set", r2.mode = 30;
break;
}
r2.head && (r2.head.text = u2 >> 8 & 1), 512 & r2.flags && (E[0] = 255 & u2, E[1] = u2 >>> 8 & 255, r2.check = B(r2.check, E, 2, 0)), l2 = u2 = 0, r2.mode = 3;
case 3:
for (; l2 < 32; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
r2.head && (r2.head.time = u2), 512 & r2.flags && (E[0] = 255 & u2, E[1] = u2 >>> 8 & 255, E[2] = u2 >>> 16 & 255, E[3] = u2 >>> 24 & 255, r2.check = B(r2.check, E, 4, 0)), l2 = u2 = 0, r2.mode = 4;
case 4:
for (; l2 < 16; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
r2.head && (r2.head.xflags = 255 & u2, r2.head.os = u2 >> 8), 512 & r2.flags && (E[0] = 255 & u2, E[1] = u2 >>> 8 & 255, r2.check = B(r2.check, E, 2, 0)), l2 = u2 = 0, r2.mode = 5;
case 5:
if (1024 & r2.flags) {
for (; l2 < 16; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
r2.length = u2, r2.head && (r2.head.extra_len = u2), 512 & r2.flags && (E[0] = 255 & u2, E[1] = u2 >>> 8 & 255, r2.check = B(r2.check, E, 2, 0)), l2 = u2 = 0;
} else r2.head && (r2.head.extra = null);
r2.mode = 6;
case 6:
if (1024 & r2.flags && (o2 < (d = r2.length) && (d = o2), d && (r2.head && (k = r2.head.extra_len - r2.length, r2.head.extra || (r2.head.extra = new Array(r2.head.extra_len)), I.arraySet(r2.head.extra, n2, s2, d, k)), 512 & r2.flags && (r2.check = B(r2.check, n2, d, s2)), o2 -= d, s2 += d, r2.length -= d), r2.length)) break e;
r2.length = 0, r2.mode = 7;
case 7:
if (2048 & r2.flags) {
if (0 === o2) break e;
for (d = 0; k = n2[s2 + d++], r2.head && k && r2.length < 65536 && (r2.head.name += String.fromCharCode(k)), k && d < o2; ) ;
if (512 & r2.flags && (r2.check = B(r2.check, n2, d, s2)), o2 -= d, s2 += d, k) break e;
} else r2.head && (r2.head.name = null);
r2.length = 0, r2.mode = 8;
case 8:
if (4096 & r2.flags) {
if (0 === o2) break e;
for (d = 0; k = n2[s2 + d++], r2.head && k && r2.length < 65536 && (r2.head.comment += String.fromCharCode(k)), k && d < o2; ) ;
if (512 & r2.flags && (r2.check = B(r2.check, n2, d, s2)), o2 -= d, s2 += d, k) break e;
} else r2.head && (r2.head.comment = null);
r2.mode = 9;
case 9:
if (512 & r2.flags) {
for (; l2 < 16; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
if (u2 !== (65535 & r2.check)) {
e2.msg = "header crc mismatch", r2.mode = 30;
break;
}
l2 = u2 = 0;
}
r2.head && (r2.head.hcrc = r2.flags >> 9 & 1, r2.head.done = true), e2.adler = r2.check = 0, r2.mode = 12;
break;
case 10:
for (; l2 < 32; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
e2.adler = r2.check = L(u2), l2 = u2 = 0, r2.mode = 11;
case 11:
if (0 === r2.havedict) return e2.next_out = a2, e2.avail_out = h3, e2.next_in = s2, e2.avail_in = o2, r2.hold = u2, r2.bits = l2, 2;
e2.adler = r2.check = 1, r2.mode = 12;
case 12:
if (5 === t2 || 6 === t2) break e;
case 13:
if (r2.last) {
u2 >>>= 7 & l2, l2 -= 7 & l2, r2.mode = 27;
break;
}
for (; l2 < 3; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
switch (r2.last = 1 & u2, l2 -= 1, 3 & (u2 >>>= 1)) {
case 0:
r2.mode = 14;
break;
case 1:
if (j(r2), r2.mode = 20, 6 !== t2) break;
u2 >>>= 2, l2 -= 2;
break e;
case 2:
r2.mode = 17;
break;
case 3:
e2.msg = "invalid block type", r2.mode = 30;
}
u2 >>>= 2, l2 -= 2;
break;
case 14:
for (u2 >>>= 7 & l2, l2 -= 7 & l2; l2 < 32; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
if ((65535 & u2) != (u2 >>> 16 ^ 65535)) {
e2.msg = "invalid stored block lengths", r2.mode = 30;
break;
}
if (r2.length = 65535 & u2, l2 = u2 = 0, r2.mode = 15, 6 === t2) break e;
case 15:
r2.mode = 16;
case 16:
if (d = r2.length) {
if (o2 < d && (d = o2), h3 < d && (d = h3), 0 === d) break e;
I.arraySet(i2, n2, s2, d, a2), o2 -= d, s2 += d, h3 -= d, a2 += d, r2.length -= d;
break;
}
r2.mode = 12;
break;
case 17:
for (; l2 < 14; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
if (r2.nlen = 257 + (31 & u2), u2 >>>= 5, l2 -= 5, r2.ndist = 1 + (31 & u2), u2 >>>= 5, l2 -= 5, r2.ncode = 4 + (15 & u2), u2 >>>= 4, l2 -= 4, 286 < r2.nlen || 30 < r2.ndist) {
e2.msg = "too many length or distance symbols", r2.mode = 30;
break;
}
r2.have = 0, r2.mode = 18;
case 18:
for (; r2.have < r2.ncode; ) {
for (; l2 < 3; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
r2.lens[A[r2.have++]] = 7 & u2, u2 >>>= 3, l2 -= 3;
}
for (; r2.have < 19; ) r2.lens[A[r2.have++]] = 0;
if (r2.lencode = r2.lendyn, r2.lenbits = 7, S = { bits: r2.lenbits }, x = T(0, r2.lens, 0, 19, r2.lencode, 0, r2.work, S), r2.lenbits = S.bits, x) {
e2.msg = "invalid code lengths set", r2.mode = 30;
break;
}
r2.have = 0, r2.mode = 19;
case 19:
for (; r2.have < r2.nlen + r2.ndist; ) {
for (; g = (C = r2.lencode[u2 & (1 << r2.lenbits) - 1]) >>> 16 & 255, b = 65535 & C, !((_ = C >>> 24) <= l2); ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
if (b < 16) u2 >>>= _, l2 -= _, r2.lens[r2.have++] = b;
else {
if (16 === b) {
for (z = _ + 2; l2 < z; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
if (u2 >>>= _, l2 -= _, 0 === r2.have) {
e2.msg = "invalid bit length repeat", r2.mode = 30;
break;
}
k = r2.lens[r2.have - 1], d = 3 + (3 & u2), u2 >>>= 2, l2 -= 2;
} else if (17 === b) {
for (z = _ + 3; l2 < z; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
l2 -= _, k = 0, d = 3 + (7 & (u2 >>>= _)), u2 >>>= 3, l2 -= 3;
} else {
for (z = _ + 7; l2 < z; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
l2 -= _, k = 0, d = 11 + (127 & (u2 >>>= _)), u2 >>>= 7, l2 -= 7;
}
if (r2.have + d > r2.nlen + r2.ndist) {
e2.msg = "invalid bit length repeat", r2.mode = 30;
break;
}
for (; d--; ) r2.lens[r2.have++] = k;
}
}
if (30 === r2.mode) break;
if (0 === r2.lens[256]) {
e2.msg = "invalid code -- missing end-of-block", r2.mode = 30;
break;
}
if (r2.lenbits = 9, S = { bits: r2.lenbits }, x = T(D, r2.lens, 0, r2.nlen, r2.lencode, 0, r2.work, S), r2.lenbits = S.bits, x) {
e2.msg = "invalid literal/lengths set", r2.mode = 30;
break;
}
if (r2.distbits = 6, r2.distcode = r2.distdyn, S = { bits: r2.distbits }, x = T(F, r2.lens, r2.nlen, r2.ndist, r2.distcode, 0, r2.work, S), r2.distbits = S.bits, x) {
e2.msg = "invalid distances set", r2.mode = 30;
break;
}
if (r2.mode = 20, 6 === t2) break e;
case 20:
r2.mode = 21;
case 21:
if (6 <= o2 && 258 <= h3) {
e2.next_out = a2, e2.avail_out = h3, e2.next_in = s2, e2.avail_in = o2, r2.hold = u2, r2.bits = l2, R(e2, c2), a2 = e2.next_out, i2 = e2.output, h3 = e2.avail_out, s2 = e2.next_in, n2 = e2.input, o2 = e2.avail_in, u2 = r2.hold, l2 = r2.bits, 12 === r2.mode && (r2.back = -1);
break;
}
for (r2.back = 0; g = (C = r2.lencode[u2 & (1 << r2.lenbits) - 1]) >>> 16 & 255, b = 65535 & C, !((_ = C >>> 24) <= l2); ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
if (g && 0 == (240 & g)) {
for (v = _, y = g, w = b; g = (C = r2.lencode[w + ((u2 & (1 << v + y) - 1) >> v)]) >>> 16 & 255, b = 65535 & C, !(v + (_ = C >>> 24) <= l2); ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
u2 >>>= v, l2 -= v, r2.back += v;
}
if (u2 >>>= _, l2 -= _, r2.back += _, r2.length = b, 0 === g) {
r2.mode = 26;
break;
}
if (32 & g) {
r2.back = -1, r2.mode = 12;
break;
}
if (64 & g) {
e2.msg = "invalid literal/length code", r2.mode = 30;
break;
}
r2.extra = 15 & g, r2.mode = 22;
case 22:
if (r2.extra) {
for (z = r2.extra; l2 < z; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
r2.length += u2 & (1 << r2.extra) - 1, u2 >>>= r2.extra, l2 -= r2.extra, r2.back += r2.extra;
}
r2.was = r2.length, r2.mode = 23;
case 23:
for (; g = (C = r2.distcode[u2 & (1 << r2.distbits) - 1]) >>> 16 & 255, b = 65535 & C, !((_ = C >>> 24) <= l2); ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
if (0 == (240 & g)) {
for (v = _, y = g, w = b; g = (C = r2.distcode[w + ((u2 & (1 << v + y) - 1) >> v)]) >>> 16 & 255, b = 65535 & C, !(v + (_ = C >>> 24) <= l2); ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
u2 >>>= v, l2 -= v, r2.back += v;
}
if (u2 >>>= _, l2 -= _, r2.back += _, 64 & g) {
e2.msg = "invalid distance code", r2.mode = 30;
break;
}
r2.offset = b, r2.extra = 15 & g, r2.mode = 24;
case 24:
if (r2.extra) {
for (z = r2.extra; l2 < z; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
r2.offset += u2 & (1 << r2.extra) - 1, u2 >>>= r2.extra, l2 -= r2.extra, r2.back += r2.extra;
}
if (r2.offset > r2.dmax) {
e2.msg = "invalid distance too far back", r2.mode = 30;
break;
}
r2.mode = 25;
case 25:
if (0 === h3) break e;
if (d = c2 - h3, r2.offset > d) {
if ((d = r2.offset - d) > r2.whave && r2.sane) {
e2.msg = "invalid distance too far back", r2.mode = 30;
break;
}
p = d > r2.wnext ? (d -= r2.wnext, r2.wsize - d) : r2.wnext - d, d > r2.length && (d = r2.length), m = r2.window;
} else m = i2, p = a2 - r2.offset, d = r2.length;
for (h3 < d && (d = h3), h3 -= d, r2.length -= d; i2[a2++] = m[p++], --d; ) ;
0 === r2.length && (r2.mode = 21);
break;
case 26:
if (0 === h3) break e;
i2[a2++] = r2.length, h3--, r2.mode = 21;
break;
case 27:
if (r2.wrap) {
for (; l2 < 32; ) {
if (0 === o2) break e;
o2--, u2 |= n2[s2++] << l2, l2 += 8;
}
if (c2 -= h3, e2.total_out += c2, r2.total += c2, c2 && (e2.adler = r2.check = r2.flags ? B(r2.check, i2, c2, a2 - c2) : O(r2.check, i2, c2, a2 - c2)), c2 = h3, (r2.flags ? u2 : L(u2)) !== r2.check) {
e2.msg = "incorrect data check", r2.mode = 30;
break;
}
l2 = u2 = 0;
}
r2.mode = 28;
case 28:
if (r2.wrap && r2.flags) {
for (; l2 < 32; ) {
if (0 === o2) break e;
o2--, u2 += n2[s2++] << l2, l2 += 8;
}
if (u2 !== (4294967295 & r2.total)) {
e2.msg = "incorrect length check", r2.mode = 30;
break;
}
l2 = u2 = 0;
}
r2.mode = 29;
case 29:
x = 1;
break e;
case 30:
x = -3;
break e;
case 31:
return -4;
case 32:
default:
return U;
}
return e2.next_out = a2, e2.avail_out = h3, e2.next_in = s2, e2.avail_in = o2, r2.hold = u2, r2.bits = l2, (r2.wsize || c2 !== e2.avail_out && r2.mode < 30 && (r2.mode < 27 || 4 !== t2)) && Z(e2, e2.output, e2.next_out, c2 - e2.avail_out) ? (r2.mode = 31, -4) : (f2 -= e2.avail_in, c2 -= e2.avail_out, e2.total_in += f2, e2.total_out += c2, r2.total += c2, r2.wrap && c2 && (e2.adler = r2.check = r2.flags ? B(r2.check, i2, c2, e2.next_out - c2) : O(r2.check, i2, c2, e2.next_out - c2)), e2.data_type = r2.bits + (r2.last ? 64 : 0) + (12 === r2.mode ? 128 : 0) + (20 === r2.mode || 15 === r2.mode ? 256 : 0), (0 == f2 && 0 === c2 || 4 === t2) && x === N && (x = -5), x);
}, r.inflateEnd = function(e2) {
if (!e2 || !e2.state) return U;
var t2 = e2.state;
return t2.window && (t2.window = null), e2.state = null, N;
}, r.inflateGetHeader = function(e2, t2) {
var r2;
return e2 && e2.state ? 0 == (2 & (r2 = e2.state).wrap) ? U : ((r2.head = t2).done = false, N) : U;
}, r.inflateSetDictionary = function(e2, t2) {
var r2, n2 = t2.length;
return e2 && e2.state ? 0 !== (r2 = e2.state).wrap && 11 !== r2.mode ? U : 11 === r2.mode && O(1, t2, n2, 0) !== r2.check ? -3 : Z(e2, t2, n2, n2) ? (r2.mode = 31, -4) : (r2.havedict = 1, N) : U;
}, r.inflateInfo = "pako inflate (from Nodeca project)";
}, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./inffast": 48, "./inftrees": 50 }], 50: [function(e, t, r) {
"use strict";
var D = e("../utils/common"), F = [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], N = [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], U = [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], P = [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];
t.exports = function(e2, t2, r2, n, i, s, a, o) {
var h2, u, l, f, c, d, p, m, _, g = o.bits, b = 0, v = 0, y = 0, w = 0, k = 0, x = 0, S = 0, z = 0, C = 0, E = 0, A = null, I = 0, O = new D.Buf16(16), B = new D.Buf16(16), R = null, T = 0;
for (b = 0; b <= 15; b++) O[b] = 0;
for (v = 0; v < n; v++) O[t2[r2 + v]]++;
for (k = g, w = 15; 1 <= w && 0 === O[w]; w--) ;
if (w < k && (k = w), 0 === w) return i[s++] = 20971520, i[s++] = 20971520, o.bits = 1, 0;
for (y = 1; y < w && 0 === O[y]; y++) ;
for (k < y && (k = y), b = z = 1; b <= 15; b++) if (z <<= 1, (z -= O[b]) < 0) return -1;
if (0 < z && (0 === e2 || 1 !== w)) return -1;
for (B[1] = 0, b = 1; b < 15; b++) B[b + 1] = B[b] + O[b];
for (v = 0; v < n; v++) 0 !== t2[r2 + v] && (a[B[t2[r2 + v]]++] = v);
if (d = 0 === e2 ? (A = R = a, 19) : 1 === e2 ? (A = F, I -= 257, R = N, T -= 257, 256) : (A = U, R = P, -1), b = y, c = s, S = v = E = 0, l = -1, f = (C = 1 << (x = k)) - 1, 1 === e2 && 852 < C || 2 === e2 && 592 < C) return 1;
for (; ; ) {
for (p = b - S, _ = a[v] < d ? (m = 0, a[v]) : a[v] > d ? (m = R[T + a[v]], A[I + a[v]]) : (m = 96, 0), h2 = 1 << b - S, y = u = 1 << x; i[c + (E >> S) + (u -= h2)] = p << 24 | m << 16 | _ | 0, 0 !== u; ) ;
for (h2 = 1 << b - 1; E & h2; ) h2 >>= 1;
if (0 !== h2 ? (E &= h2 - 1, E += h2) : E = 0, v++, 0 == --O[b]) {
if (b === w) break;
b = t2[r2 + a[v]];
}
if (k < b && (E & f) !== l) {
for (0 === S && (S = k), c += y, z = 1 << (x = b - S); x + S < w && !((z -= O[x + S]) <= 0); ) x++, z <<= 1;
if (C += 1 << x, 1 === e2 && 852 < C || 2 === e2 && 592 < C) return 1;
i[l = E & f] = k << 24 | x << 16 | c - s | 0;
}
}
return 0 !== E && (i[c + E] = b - S << 24 | 64 << 16 | 0), o.bits = k, 0;
};
}, { "../utils/common": 41 }], 51: [function(e, t, r) {
"use strict";
t.exports = { 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" };
}, {}], 52: [function(e, t, r) {
"use strict";
var i = e("../utils/common"), o = 0, h2 = 1;
function n(e2) {
for (var t2 = e2.length; 0 <= --t2; ) e2[t2] = 0;
}
var s = 0, a = 29, u = 256, l = u + 1 + a, f = 30, c = 19, _ = 2 * l + 1, g = 15, d = 16, p = 7, m = 256, b = 16, v = 17, y = 18, w = [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], k = [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], x = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], S = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], z = new Array(2 * (l + 2));
n(z);
var C = new Array(2 * f);
n(C);
var E = new Array(512);
n(E);
var A = new Array(256);
n(A);
var I = new Array(a);
n(I);
var O, B, R, T = new Array(f);
function D(e2, t2, r2, n2, i2) {
this.static_tree = e2, this.extra_bits = t2, this.extra_base = r2, this.elems = n2, this.max_length = i2, this.has_stree = e2 && e2.length;
}
function F(e2, t2) {
this.dyn_tree = e2, this.max_code = 0, this.stat_desc = t2;
}
function N(e2) {
return e2 < 256 ? E[e2] : E[256 + (e2 >>> 7)];
}
function U(e2, t2) {
e2.pending_buf[e2.pending++] = 255 & t2, e2.pending_buf[e2.pending++] = t2 >>> 8 & 255;
}
function P(e2, t2, r2) {
e2.bi_valid > d - r2 ? (e2.bi_buf |= t2 << e2.bi_valid & 65535, U(e2, e2.bi_buf), e2.bi_buf = t2 >> d - e2.bi_valid, e2.bi_valid += r2 - d) : (e2.bi_buf |= t2 << e2.bi_valid & 65535, e2.bi_valid += r2);
}
function L(e2, t2, r2) {
P(e2, r2[2 * t2], r2[2 * t2 + 1]);
}
function j(e2, t2) {
for (var r2 = 0; r2 |= 1 & e2, e2 >>>= 1, r2 <<= 1, 0 < --t2; ) ;
return r2 >>> 1;
}
function Z(e2, t2, r2) {
var n2, i2, s2 = new Array(g + 1), a2 = 0;
for (n2 = 1; n2 <= g; n2++) s2[n2] = a2 = a2 + r2[n2 - 1] << 1;
for (i2 = 0; i2 <= t2; i2++) {
var o2 = e2[2 * i2 + 1];
0 !== o2 && (e2[2 * i2] = j(s2[o2]++, o2));
}
}
function W(e2) {
var t2;
for (t2 = 0; t2 < l; t2++) e2.dyn_ltree[2 * t2] = 0;
for (t2 = 0; t2 < f; t2++) e2.dyn_dtree[2 * t2] = 0;
for (t2 = 0; t2 < c; t2++) e2.bl_tree[2 * t2] = 0;
e2.dyn_ltree[2 * m] = 1, e2.opt_len = e2.static_len = 0, e2.last_lit = e2.matches = 0;
}
function M(e2) {
8 < e2.bi_valid ? U(e2, e2.bi_buf) : 0 < e2.bi_valid && (e2.pending_buf[e2.pending++] = e2.bi_buf), e2.bi_buf = 0, e2.bi_valid = 0;
}
function H(e2, t2, r2, n2) {
var i2 = 2 * t2, s2 = 2 * r2;
return e2[i2] < e2[s2] || e2[i2] === e2[s2] && n2[t2] <= n2[r2];
}
function G(e2, t2, r2) {
for (var n2 = e2.heap[r2], i2 = r2 << 1; i2 <= e2.heap_len && (i2 < e2.heap_len && H(t2, e2.heap[i2 + 1], e2.heap[i2], e2.depth) && i2++, !H(t2, n2, e2.heap[i2], e2.depth)); ) e2.heap[r2] = e2.heap[i2], r2 = i2, i2 <<= 1;
e2.heap[r2] = n2;
}
function K(e2, t2, r2) {
var n2, i2, s2, a2, o2 = 0;
if (0 !== e2.last_lit) for (; n2 = e2.pending_buf[e2.d_buf + 2 * o2] << 8 | e2.pending_buf[e2.d_buf + 2 * o2 + 1], i2 = e2.pending_buf[e2.l_buf + o2], o2++, 0 === n2 ? L(e2, i2, t2) : (L(e2, (s2 = A[i2]) + u + 1, t2), 0 !== (a2 = w[s2]) && P(e2, i2 -= I[s2], a2), L(e2, s2 = N(--n2), r2), 0 !== (a2 = k[s2]) && P(e2, n2 -= T[s2], a2)), o2 < e2.last_lit; ) ;
L(e2, m, t2);
}
function Y(e2, t2) {
var r2, n2, i2, s2 = t2.dyn_tree, a2 = t2.stat_desc.static_tree, o2 = t2.stat_desc.has_stree, h3 = t2.stat_desc.elems, u2 = -1;
for (e2.heap_len = 0, e2.heap_max = _, r2 = 0; r2 < h3; r2++) 0 !== s2[2 * r2] ? (e2.heap[++e2.heap_len] = u2 = r2, e2.depth[r2] = 0) : s2[2 * r2 + 1] = 0;
for (; e2.heap_len < 2; ) s2[2 * (i2 = e2.heap[++e2.heap_len] = u2 < 2 ? ++u2 : 0)] = 1, e2.depth[i2] = 0, e2.opt_len--, o2 && (e2.static_len -= a2[2 * i2 + 1]);
for (t2.max_code = u2, r2 = e2.heap_len >> 1; 1 <= r2; r2--) G(e2, s2, r2);
for (i2 = h3; r2 = e2.heap[1], e2.heap[1] = e2.heap[e2.heap_len--], G(e2, s2, 1), n2 = e2.heap[1], e2.heap[--e2.heap_max] = r2, e2.heap[--e2.heap_max] = n2, s2[2 * i2] = s2[2 * r2] + s2[2 * n2], e2.depth[i2] = (e2.depth[r2] >= e2.depth[n2] ? e2.depth[r2] : e2.depth[n2]) + 1, s2[2 * r2 + 1] = s2[2 * n2 + 1] = i2, e2.heap[1] = i2++, G(e2, s2, 1), 2 <= e2.heap_len; ) ;
e2.heap[--e2.heap_max] = e2.heap[1], function(e3, t3) {
var r3, n3, i3, s3, a3, o3, h4 = t3.dyn_tree, u3 = t3.max_code, l2 = t3.stat_desc.static_tree, f2 = t3.stat_desc.has_stree, c2 = t3.stat_desc.extra_bits, d2 = t3.stat_desc.extra_base, p2 = t3.stat_desc.max_length, m2 = 0;
for (s3 = 0; s3 <= g; s3++) e3.bl_count[s3] = 0;
for (h4[2 * e3.heap[e3.heap_max] + 1] = 0, r3 = e3.heap_max + 1; r3 < _; r3++) p2 < (s3 = h4[2 * h4[2 * (n3 = e3.heap[r3]) + 1] + 1] + 1) && (s3 = p2, m2++), h4[2 * n3 + 1] = s3, u3 < n3 || (e3.bl_count[s3]++, a3 = 0, d2 <= n3 && (a3 = c2[n3 - d2]), o3 = h4[2 * n3], e3.opt_len += o3 * (s3 + a3), f2 && (e3.static_len += o3 * (l2[2 * n3 + 1] + a3)));
if (0 !== m2) {
do {
for (s3 = p2 - 1; 0 === e3.bl_count[s3]; ) s3--;
e3.bl_count[s3]--, e3.bl_count[s3 + 1] += 2, e3.bl_count[p2]--, m2 -= 2;
} while (0 < m2);
for (s3 = p2; 0 !== s3; s3--) for (n3 = e3.bl_count[s3]; 0 !== n3; ) u3 < (i3 = e3.heap[--r3]) || (h4[2 * i3 + 1] !== s3 && (e3.opt_len += (s3 - h4[2 * i3 + 1]) * h4[2 * i3], h4[2 * i3 + 1] = s3), n3--);
}
}(e2, t2), Z(s2, u2, e2.bl_count);
}
function X(e2, t2, r2) {
var n2, i2, s2 = -1, a2 = t2[1], o2 = 0, h3 = 7, u2 = 4;
for (0 === a2 && (h3 = 138, u2 = 3), t2[2 * (r2 + 1) + 1] = 65535, n2 = 0; n2 <= r2; n2++) i2 = a2, a2 = t2[2 * (n2 + 1) + 1], ++o2 < h3 && i2 === a2 || (o2 < u2 ? e2.bl_tree[2 * i2] += o2 : 0 !== i2 ? (i2 !== s2 && e2.bl_tree[2 * i2]++, e2.bl_tree[2 * b]++) : o2 <= 10 ? e2.bl_tree[2 * v]++ : e2.bl_tree[2 * y]++, s2 = i2, u2 = (o2 = 0) === a2 ? (h3 = 138, 3) : i2 === a2 ? (h3 = 6, 3) : (h3 = 7, 4));
}
function V(e2, t2, r2) {
var n2, i2, s2 = -1, a2 = t2[1], o2 = 0, h3 = 7, u2 = 4;
for (0 === a2 && (h3 = 138, u2 = 3), n2 = 0; n2 <= r2; n2++) if (i2 = a2, a2 = t2[2 * (n2 + 1) + 1], !(++o2 < h3 && i2 === a2)) {
if (o2 < u2) for (; L(e2, i2, e2.bl_tree), 0 != --o2; ) ;
else 0 !== i2 ? (i2 !== s2 && (L(e2, i2, e2.bl_tree), o2--), L(e2, b, e2.bl_tree), P(e2, o2 - 3, 2)) : o2 <= 10 ? (L(e2, v, e2.bl_tree), P(e2, o2 - 3, 3)) : (L(e2, y, e2.bl_tree), P(e2, o2 - 11, 7));
s2 = i2, u2 = (o2 = 0) === a2 ? (h3 = 138, 3) : i2 === a2 ? (h3 = 6, 3) : (h3 = 7, 4);
}
}
n(T);
var q = false;
function J(e2, t2, r2, n2) {
P(e2, (s << 1) + (n2 ? 1 : 0), 3), function(e3, t3, r3, n3) {
M(e3), n3 && (U(e3, r3), U(e3, ~r3)), i.arraySet(e3.pending_buf, e3.window, t3, r3, e3.pending), e3.pending += r3;
}(e2, t2, r2, true);
}
r._tr_init = function(e2) {
q || (function() {
var e3, t2, r2, n2, i2, s2 = new Array(g + 1);
for (n2 = r2 = 0; n2 < a - 1; n2++) for (I[n2] = r2, e3 = 0; e3 < 1 << w[n2]; e3++) A[r2++] = n2;
for (A[r2 - 1] = n2, n2 = i2 = 0; n2 < 16; n2++) for (T[n2] = i2, e3 = 0; e3 < 1 << k[n2]; e3++) E[i2++] = n2;
for (i2 >>= 7; n2 < f; n2++) for (T[n2] = i2 << 7, e3 = 0; e3 < 1 << k[n2] - 7; e3++) E[256 + i2++] = n2;
for (t2 = 0; t2 <= g; t2++) s2[t2] = 0;
for (e3 = 0; e3 <= 143; ) z[2 * e3 + 1] = 8, e3++, s2[8]++;
for (; e3 <= 255; ) z[2 * e3 + 1] = 9, e3++, s2[9]++;
for (; e3 <= 279; ) z[2 * e3 + 1] = 7, e3++, s2[7]++;
for (; e3 <= 287; ) z[2 * e3 + 1] = 8, e3++, s2[8]++;
for (Z(z, l + 1, s2), e3 = 0; e3 < f; e3++) C[2 * e3 + 1] = 5, C[2 * e3] = j(e3, 5);
O = new D(z, w, u + 1, l, g), B = new D(C, k, 0, f, g), R = new D(new Array(0), x, 0, c, p);
}(), q = true), e2.l_desc = new F(e2.dyn_ltree, O), e2.d_desc = new F(e2.dyn_dtree, B), e2.bl_desc = new F(e2.bl_tree, R), e2.bi_buf = 0, e2.bi_valid = 0, W(e2);
}, r._tr_stored_block = J, r._tr_flush_block = function(e2, t2, r2, n2) {
var i2, s2, a2 = 0;
0 < e2.level ? (2 === e2.strm.data_type && (e2.strm.data_type = function(e3) {
var t3, r3 = 4093624447;
for (t3 = 0; t3 <= 31; t3++, r3 >>>= 1) if (1 & r3 && 0 !== e3.dyn_ltree[2 * t3]) return o;
if (0 !== e3.dyn_ltree[18] || 0 !== e3.dyn_ltree[20] || 0 !== e3.dyn_ltree[26]) return h2;
for (t3 = 32; t3 < u; t3++) if (0 !== e3.dyn_ltree[2 * t3]) return h2;
return o;
}(e2)), Y(e2, e2.l_desc), Y(e2, e2.d_desc), a2 = function(e3) {
var t3;
for (X(e3, e3.dyn_ltree, e3.l_desc.max_code), X(e3, e3.dyn_dtree, e3.d_desc.max_code), Y(e3, e3.bl_desc), t3 = c - 1; 3 <= t3 && 0 === e3.bl_tree[2 * S[t3] + 1]; t3--) ;
return e3.opt_len += 3 * (t3 + 1) + 5 + 5 + 4, t3;
}(e2), i2 = e2.opt_len + 3 + 7 >>> 3, (s2 = e2.static_len + 3 + 7 >>> 3) <= i2 && (i2 = s2)) : i2 = s2 = r2 + 5, r2 + 4 <= i2 && -1 !== t2 ? J(e2, t2, r2, n2) : 4 === e2.strategy || s2 === i2 ? (P(e2, 2 + (n2 ? 1 : 0), 3), K(e2, z, C)) : (P(e2, 4 + (n2 ? 1 : 0), 3), function(e3, t3, r3, n3) {
var i3;
for (P(e3, t3 - 257, 5), P(e3, r3 - 1, 5), P(e3, n3 - 4, 4), i3 = 0; i3 < n3; i3++) P(e3, e3.bl_tree[2 * S[i3] + 1], 3);
V(e3, e3.dyn_ltree, t3 - 1), V(e3, e3.dyn_dtree, r3 - 1);
}(e2, e2.l_desc.max_code + 1, e2.d_desc.max_code + 1, a2 + 1), K(e2, e2.dyn_ltree, e2.dyn_dtree)), W(e2), n2 && M(e2);
}, r._tr_tally = function(e2, t2, r2) {
return e2.pending_buf[e2.d_buf + 2 * e2.last_lit] = t2 >>> 8 & 255, e2.pending_buf[e2.d_buf + 2 * e2.last_lit + 1] = 255 & t2, e2.pending_buf[e2.l_buf + e2.last_lit] = 255 & r2, e2.last_lit++, 0 === t2 ? e2.dyn_ltree[2 * r2]++ : (e2.matches++, t2--, e2.dyn_ltree[2 * (A[r2] + u + 1)]++, e2.dyn_dtree[2 * N(t2)]++), e2.last_lit === e2.lit_bufsize - 1;
}, r._tr_align = function(e2) {
P(e2, 2, 3), L(e2, m, z), function(e3) {
16 === e3.bi_valid ? (U(e3, e3.bi_buf), e3.bi_buf = 0, e3.bi_valid = 0) : 8 <= e3.bi_valid && (e3.pending_buf[e3.pending++] = 255 & e3.bi_buf, e3.bi_buf >>= 8, e3.bi_valid -= 8);
}(e2);
};
}, { "../utils/common": 41 }], 53: [function(e, t, r) {
"use strict";
t.exports = function() {
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;
};
}, {}], 54: [function(e, t, r) {
(function(e2) {
!function(r2, n) {
"use strict";
if (!r2.setImmediate) {
var i, s, t2, a, o = 1, h2 = {}, u = false, l = r2.document, e3 = Object.getPrototypeOf && Object.getPrototypeOf(r2);
e3 = e3 && e3.setTimeout ? e3 : r2, i = "[object process]" === {}.toString.call(r2.process) ? function(e4) {
process.nextTick(function() {
c(e4);
});
} : function() {
if (r2.postMessage && !r2.importScripts) {
var e4 = true, t3 = r2.onmessage;
return r2.onmessage = function() {
e4 = false;
}, r2.postMessage("", "*"), r2.onmessage = t3, e4;
}
}() ? (a = "setImmediate$" + Math.random() + "$", r2.addEventListener ? r2.addEventListener("message", d, false) : r2.attachEvent("onmessage", d), function(e4) {
r2.postMessage(a + e4, "*");
}) : r2.MessageChannel ? ((t2 = new MessageChannel()).port1.onmessage = function(e4) {
c(e4.data);
}, function(e4) {
t2.port2.postMessage(e4);
}) : l && "onreadystatechange" in l.createElement("script") ? (s = l.documentElement, function(e4) {
var t3 = l.createElement("script");
t3.onreadystatechange = function() {
c(e4), t3.onreadystatechange = null, s.removeChild(t3), t3 = null;
}, s.appendChild(t3);
}) : function(e4) {
setTimeout(c, 0, e4);
}, e3.setImmediate = function(e4) {
"function" != typeof e4 && (e4 = new Function("" + e4));
for (var t3 = new Array(arguments.length - 1), r3 = 0; r3 < t3.length; r3++) t3[r3] = arguments[r3 + 1];
var n2 = { callback: e4, args: t3 };
return h2[o] = n2, i(o), o++;
}, e3.clearImmediate = f;
}
function f(e4) {
delete h2[e4];
}
function c(e4) {
if (u) setTimeout(c, 0, e4);
else {
var t3 = h2[e4];
if (t3) {
u = true;
try {
!function(e5) {
var t4 = e5.callback, r3 = e5.args;
switch (r3.length) {
case 0:
t4();
break;
case 1:
t4(r3[0]);
break;
case 2:
t4(r3[0], r3[1]);
break;
case 3:
t4(r3[0], r3[1], r3[2]);
break;
default:
t4.apply(n, r3);
}
}(t3);
} finally {
f(e4), u = false;
}
}
}
}
function d(e4) {
e4.source === r2 && "string" == typeof e4.data && 0 === e4.data.indexOf(a) && c(+e4.data.slice(a.length));
}
}("undefined" == typeof self ? void 0 === e2 ? this : e2 : self);
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {});
}, {}] }, {}, [10])(10);
});
}
});
// node_modules/.pnpm/dreamland@0.0.21/node_modules/dreamland/dist/dev.js
var DLFEATURES = ["css", "jsxLiterals", "usestring", "stores"];
var DLVERSION = "0.0.21";
(function(exports) {
class DreamlandError extends Error {
constructor(message) {
super("[dreamland-js/dev] " + message);
this.name = "DreamlandDevError";
}
}
function log2(message) {
console.log("[dreamland-js/dev] " + message);
}
function panic(message) {
throw new DreamlandError("fatal: " + message);
}
function assert(condition, message) {
if (!condition) {
panic(message);
}
}
const [USE_COMPUTED, TARGET, PROXY, STEPS, LISTENERS, IF, STATEHOOK] = Array.from(Array(7), Symbol);
const cssBoundary = "dlcomponent";
const cssmap = {};
let scopeSupported;
function checkScopeSupported() {
if (scopeSupported) return true;
const style = document.createElement("style");
style.textContent = "@scope (.test) { :scope { color: red } }";
document.head.appendChild(style);
const testElement = document.createElement("div");
testElement.className = "test";
document.body.appendChild(testElement);
const computedColor = getComputedStyle(testElement).color;
document.head.removeChild(style);
document.body.removeChild(testElement);
scopeSupported = computedColor == "rgb(255, 0, 0)";
return scopeSupported;
}
const depth = 50;
function polyfill_scope(target) {
let boundary = `:not(${target}).${cssBoundary}`;
let g = (str, i) => `${str} *${i > depth ? "" : `:not(${g(str + " " + (i % 2 == 0 ? target : boundary), i + 1)})`}`;
return `:not(${g(boundary, 0)})`;
}
function genuid() {
return `${Array(4).fill(0).map(() => {
return Math.floor(Math.random() * 36).toString(36);
}).join("")}`;
}
const csstag = (scoped) => function css2(strings, ...values) {
let str = "";
for (let f of strings) {
str += f + (values.shift() || "");
}
return genCss("dl" + genuid(), str, scoped);
};
const css = csstag(false);
const scope = csstag(true);
function genCss(uid, str, scoped) {
let cached = cssmap[str];
if (cached) return cached;
cssmap[str] = uid;
const styleElement = document.createElement("style");
document.head.appendChild(styleElement);
let newstr = "";
let selfstr = "";
str += "\n";
for (; ; ) {
let [first, ...rest] = str.split("\n");
if (first.trim().endsWith("{")) break;
selfstr += first + "\n";
str = rest.join("\n");
if (!str) break;
}
styleElement.textContent = str;
if (scoped) {
if (!checkScopeSupported()) {
let scoped2 = polyfill_scope(`.${uid}`);
for (const rule of styleElement.sheet.cssRules) {
if (rule.selectorText?.startsWith(":"))
rule.selectorText = `.${uid}${rule.selectorText}`;
else rule.selectorText = `.${uid} ${rule.selectorText}${scoped2}`;
newstr += rule.cssText + "\n";
}
styleElement.textContent = `.${uid} {${selfstr}}
` + newstr;
return uid;
}
let extstr = "";
for (const rule of styleElement.sheet.cssRules) {
if (!rule.selectorText) {
extstr += rule.cssText;
} else if (rule.selectorText?.startsWith(":")) {
rule.selectorText = `.${uid}${rule.selectorText}`;
extstr += rule.cssText;
} else {
newstr += rule.cssText;
}
}
styleElement.textContent = `.${uid} {${selfstr}} @scope (.${uid}) to (:not(.${uid}).${cssBoundary} *) { ${newstr} } ${extstr}`;
} else {
for (const rule of styleElement.sheet.cssRules) {
rule.selectorText = `.${uid} ${rule.selectorText}`;
newstr += rule.cssText;
}
styleElement.textContent = `.${uid} {${selfstr}}
` + newstr;
}
return uid;
}
let doc = document;
const Fragment = Symbol();
let __use_trap = false;
Object.defineProperty(window, "use", {
get: () => {
__use_trap = true;
return (ptr, transform, ...rest) => {
if (ptr instanceof Array) return usestr(ptr, transform, ...rest);
assert(
isDLPtrInternal(ptr) || isDLPtr(ptr),
"a value was passed into use() that was not part of a stateful context"
);
__use_trap = false;
let newp = {
get value() {
return resolve(newp);
}
};
if (isDLPtr(ptr)) {
let cloned = [...ptr[USE_COMPUTED]];
if (transform) {
cloned.push(transform);
}
newp[PROXY] = ptr[PROXY];
newp[USE_COMPUTED] = cloned;
} else {
newp[PROXY] = ptr;
newp[USE_COMPUTED] = transform ? [transform] : [];
}
return newp;
};
}
});
const usestr = (strings, ...values) => {
__use_trap = false;
let state = $state({});
const flattened_template = [];
for (const i in strings) {
flattened_template.push(strings[i]);
if (values[i]) {
let prop = values[i];
if (isDLPtrInternal(prop)) prop = use(prop);
if (isDLPtr(prop)) {
const current_i = flattened_template.length;
let oldparsed;
handle2(use(prop), (val) => {
flattened_template[current_i] = String(val);
let parsed = flattened_template.join("");
if (parsed != oldparsed) state.string = parsed;
oldparsed = parsed;
});
} else {
flattened_template.push(String(prop));
}
}
}
state.string = flattened_template.join("");
return use(state.string);
};
let TRAPS = /* @__PURE__ */ new Map();
function $state(target) {
assert(isobj(target), "$state() requires an object");
target[LISTENERS] = [];
target[TARGET] = target;
let TOPRIMITIVE = Symbol.toPrimitive;
let proxy = new Proxy(target, {
get(target2, property, proxy2) {
if (__use_trap) {
let sym = Symbol();
let trap = new Proxy(
{
[TARGET]: target2,
[PROXY]: proxy2,
[STEPS]: [property],
[TOPRIMITIVE]: () => sym
},
{
get(target3, property2) {
if ([
TARGET,
PROXY,
STEPS,
USE_COMPUTED,
TOPRIMITIVE
].includes(property2))
return target3[property2];
property2 = TRAPS.get(property2) || property2;
target3[STEPS].push(property2);
return trap;
}
}
);
TRAPS.set(sym, trap);
return trap;
}
return Reflect.get(target2, property, proxy2);
},
set(target2, property, val) {
let trap = Reflect.set(target2, property, val);
for (let listener of target2[LISTENERS]) {
listener(target2, property, val);
}
if (target2[STATEHOOK])
target2[STATEHOOK](target2, property, target2[property]);
return trap;
}
});
return proxy;
}
let isobj = (o) => o instanceof Object;
let isfn = (o) => typeof o === "function";
function isStateful(obj) {
return isobj(obj) && LISTENERS in obj;
}
function isDLPtrInternal(arr) {
return isobj(arr) && STEPS in arr;
}
function isDLPtr(arr) {
return isobj(arr) && USE_COMPUTED in arr;
}
function $if2(condition, then, otherwise) {
otherwise ??= doc.createTextNode("");
if (!isDLPtr(condition)) return condition ? then : otherwise;
return { [IF]: condition, then, otherwise };
}
function resolve(exptr) {
let proxy = exptr[PROXY];
let steps = proxy[STEPS];
let computed = exptr[USE_COMPUTED];
let val = proxy[TARGET];
for (let step of steps) {
val = val[step];
if (!isobj(val)) break;
}
for (let transform of computed) {
val = transform(val);
}
return val;
}
function handle2(exptr, callback) {
assert(isDLPtr(exptr), "handle() requires a stateful object");
assert(isfn(callback), "handle() requires a callback function");
let ptr = exptr[PROXY], computed = exptr[USE_COMPUTED], step, resolvedSteps = [];
function update() {
let val = ptr[TARGET];
for (step of resolvedSteps) {
val = val[step];
if (!isobj(val)) break;
}
for (let transform of computed) {
val = transform(val);
}
callback(val);
}
let curry = (target, i) => function subscription(tgt, prop, val) {
if (prop === resolvedSteps[i] && target === tgt) {
update();
if (isobj(val)) {
let v = val[LISTENERS];
if (v && !v.includes(subscription)) {
v.push(curry(val[TARGET], i + 1));
}
}
}
};
for (let i in ptr[STEPS]) {
let step2 = ptr[STEPS][i];
if (isobj(step2) && step2[TARGET]) {
handle2(step2, (val) => {
resolvedSteps[i] = val;
update();
});
continue;
}
resolvedSteps[i] = step2;
}
let sub = curry(ptr[TARGET], 0);
ptr[TARGET][LISTENERS].push(sub);
sub(ptr[TARGET], resolvedSteps[0], ptr[TARGET][resolvedSteps[0]]);
}
function JSXAddFixedWrapper(ptr, cb, $if3) {
let before, appended, first, flag;
handle2(ptr, (val) => {
first = appended?.[0];
if (first) before = first.previousSibling || (flag = first.parentNode);
if (appended) appended.forEach((a) => a.remove());
appended = JSXAddChild(
$if3 ? val ? $if3.then : $if3.otherwise : val,
(el) => {
if (before) {
if (flag) {
before.prepend(el);
flag = null;
} else before.after(el);
before = el;
} else cb(el);
}
);
});
}
let curryset = (ptr) => (val) => {
let next = ptr[PROXY];
let steps = ptr[STEPS];
let i = 0;
for (; i < steps.length - 1; i++) {
next = next[steps[i]];
if (!isobj(next)) return;
}
next[steps[i]] = val;
};
function h2(type, props, ...children) {
if (type == Fragment) return children;
if (typeof type == "function") {
let newthis = $state(Object.create(type.prototype));
for (let name in props) {
let ptr = props[name];
if (name.startsWith("bind:")) {
assert(
isDLPtr(ptr),
"bind: requires a reference pointer from use"
);
let set = curryset(ptr[PROXY]);
let propname = name.substring(5);
if (propname == "this") {
set(newthis);
} else {
let isRecursive = false;
handle2(ptr, (value) => {
if (isRecursive) {
isRecursive = false;
return;
}
isRecursive = true;
newthis[propname] = value;
});
handle2(use(newthis[propname]), (value) => {
if (isRecursive) {
isRecursive = false;
return;
}
isRecursive = true;
set(value);
});
}
delete props[name];
}
}
Object.assign(newthis, props);
newthis.children = [];
for (let child of children) {
JSXAddChild(child, newthis.children.push.bind(newthis.children));
}
let elm2 = type.apply(newthis);
assert(
!(elm2 instanceof Array),
"Functional component cannot return a Fragment"
);
assert(elm2 instanceof Node, "Functional component must return a Node");
assert(
!("$" in elm2),
"Functional component cannot have another functional component at root level"
);
elm2.$ = newthis;
newthis.root = elm2;
let cl = elm2.classList;
let css2 = newthis.css;
let sanitizedName = type.name.replaceAll("$", "-");
if (css2) {
cl.add(genCss(`${sanitizedName}-${genuid()}`, css2, true));
}
cl.add(cssBoundary);
elm2.setAttribute("data-component", type.name);
if (typeof newthis.mount === "function") newthis.mount();
return elm2;
}
let xmlns = props?.xmlns;
let elm = xmlns ? doc.createElementNS(xmlns, type) : doc.createElement(type);
for (let child of children) {
let bappend = elm.append.bind(elm);
JSXAddChild(child, bappend);
}
if (!props) return elm;
let useProp = (name, callback) => {
if (!(name in props)) return;
let prop = props[name];
callback(prop);
delete props[name];
};
for (let name in props) {
let ptr = props[name];
if (name.startsWith("bind:")) {
assert(isDLPtr(ptr), "bind: requires a reference pointer from use");
let propname = name.substring(5);
let set = curryset(ptr[PROXY]);
if (propname == "this") {
set(elm);
} else if (propname == "value") {
handle2(ptr, (value) => elm.value = value);
elm.addEventListener("change", () => set(elm.value));
} else if (propname == "checked") {
handle2(ptr, (value) => elm.checked = value);
elm.addEventListener("click", () => set(elm.checked));
}
delete props[name];
}
if (name == "style" && isobj(ptr) && !isDLPtr(ptr)) {
for (let key in ptr) {
let prop = ptr[key];
if (isDLPtr(prop)) {
handle2(prop, (value) => elm.style[key] = value);
} else {
elm.style[key] = prop;
}
}
delete props[name];
}
}
useProp("class", (classlist) => {
assert(
typeof classlist === "string" || classlist instanceof Array,
"class must be a string or array"
);
if (typeof classlist === "string") {
elm.setAttribute("class", classlist);
return;
}
if (isDLPtr(classlist)) {
handle2(
classlist,
(classname) => elm.setAttribute("class", classname)
);
return;
}
for (let name of classlist) {
if (isDLPtr(name)) {
let oldvalue = null;
handle2(name, (value) => {
if (typeof oldvalue === "string") {
elm.classList.remove(oldvalue);
}
elm.classList.add(value);
oldvalue = value;
});
} else {
elm.classList.add(name);
}
}
});
for (let name in props) {
let prop = props[name];
if (isDLPtr(prop)) {
handle2(prop, (val) => {
JSXAddAttributes(elm, name, val);
});
} else {
JSXAddAttributes(elm, name, prop);
}
}
if (xmlns) elm.innerHTML = elm.innerHTML;
return elm;
}
function JSXAddChild(child, cb) {
let childchild, elms, node;
if (isDLPtr(child)) {
JSXAddFixedWrapper(child, cb);
} else if (isobj(child) && IF in child) {
JSXAddFixedWrapper(child[IF], cb, child);
} else if (child instanceof Node) {
cb(child);
return [child];
} else if (child instanceof Array) {
elms = [];
for (childchild of child) {
elms = elms.concat(JSXAddChild(childchild, cb));
}
if (!elms[0]) elms = JSXAddChild("", cb);
return elms;
} else {
if (child === null || child === void 0) child = "";
node = doc.createTextNode(child);
cb(node);
return [node];
}
}
function JSXAddAttributes(elm, name, prop) {
if (name.startsWith("on:")) {
assert(typeof prop === "function", "on: requires a function");
let names = name.substring(3);
for (let name2 of names.split("$")) {
elm.addEventListener(name2, (...args) => {
self.$el = elm;
prop(...args);
});
}
return;
}
elm.setAttribute(name, prop);
}
function html(strings, ...values) {
strings = [...strings];
let flattened = "";
let markers = {};
for (let i = 0; i < strings.length; i++) {
let string = strings[i];
let value = values[i];
let match = values[i] instanceof Function && /^ *\/>/.exec(strings[i + 1]);
if (/< *$/.test(string) && match) {
strings[i + 1] = strings[i + 1].substr(
match.index + match[0].length
);
}
flattened += string;
if (i < values.length) {
let dupe = Object.values(markers).findIndex((v) => v === value);
let marker;
if (dupe !== -1) {
marker = Object.keys(markers)[dupe];
} else {
marker = "h" + genuid();
markers[marker] = value;
}
flattened += marker;
if (match) {
flattened += `></${marker}>`;
}
}
}
let dom = new DOMParser().parseFromString(flattened, "text/html");
assert(
dom.body.children.length == 1,
"html builder needs exactly one child"
);
function wraph(elm) {
let nodename = elm.nodeName.toLowerCase();
if (nodename === "#text") return elm.textContent;
if (nodename in markers) nodename = markers[nodename];
let children = [...elm.childNodes].map(wraph);
for (let i = 0; i < children.length; i++) {
let text = children[i];
if (typeof text !== "string") continue;
for (const [marker, value] of Object.entries(markers)) {
if (!text) break;
if (!text.includes(marker)) continue;
let before;
[before, text] = text.split(marker);
children = [
...children.slice(0, i),
before,
value,
text,
...children.slice(i + 1)
];
i += 2;
}
}
let attributes = {};
if (!elm.attributes) return elm;
for (const attr of [...elm.attributes]) {
let val = attr.nodeValue;
if (val in markers) val = markers[val];
attributes[attr.name] = val;
}
return h2(nodename, attributes, children);
}
return wraph(dom.body.children[0]);
}
function $store2(target, { ident, backing, autosave }) {
let read, write;
if (typeof backing === "string") {
switch (backing) {
case "localstorage":
read = () => localStorage.getItem(ident);
write = (ident2, data) => {
localStorage.setItem(ident2, data);
};
break;
default:
assert("Unknown store type: " + backing);
}
} else {
({ read, write } = backing);
}
let save = () => {
console.info("[dreamland.js]: saving " + ident);
let serstack = {};
let vpointercount = 0;
let ser = (tgt) => {
let obj = {
stateful: isStateful(tgt),
values: {}
};
let i = vpointercount++;
serstack[i] = obj;
for (let key in tgt) {
let value = tgt[key];
if (isDLPtr(value)) continue;
switch (typeof value) {
case "string":
case "number":
case "boolean":
case "undefined":
obj.values[key] = JSON.stringify(value);
break;
case "object":
if (value instanceof Array) {
obj.values[key] = value.map((v) => {
if (typeof v === "object") {
return ser(v);
} else {
return JSON.stringify(v);
}
});
break;
} else {
assert(
value.__proto__ === Object.prototype,
"Only plain objects are supported"
);
obj.values[key] = ser(value);
}
break;
case "symbol":
case "function":
case "bigint":
assert("Unsupported type: " + typeof value);
break;
}
}
return i;
};
ser(target);
let string = JSON.stringify(serstack);
write(ident, string);
};
let autohook = (target2, prop, value) => {
if (isStateful(value)) value[TARGET][STATEHOOK] = autohook;
save();
};
let destack = JSON.parse(read(ident));
if (destack) {
let objcache = {};
let de = (i) => {
if (objcache[i]) return objcache[i];
let obj = destack[i];
let tgt = {};
for (let key in obj.values) {
let value = obj.values[key];
if (typeof value === "string") {
tgt[key] = JSON.parse(value);
} else {
if (value instanceof Array) {
tgt[key] = value.map((v) => {
if (typeof v === "string") {
return JSON.parse(v);
} else {
return de(v);
}
});
} else {
tgt[key] = de(value);
}
}
}
if (obj.stateful && autosave == "auto") tgt[STATEHOOK] = autohook;
let newobj = obj.stateful ? $state(tgt) : tgt;
objcache[i] = newobj;
return newobj;
};
target = de(0);
}
switch (autosave) {
case "beforeunload":
addEventListener("beforeunload", save);
break;
case "manual":
break;
case "auto":
target[STATEHOOK] = autohook;
break;
default:
assert("Unknown autosave type: " + autosave);
}
return $state(target);
}
log2("Version: " + DLVERSION);
console.warn(
"This is a DEVELOPER build of dreamland.js. It is not suitable for production use."
);
console.info("Enabled features:", DLFEATURES.join(", "));
exports.$if = $if2;
exports.$state = $state;
exports.$store = $store2;
exports.Fragment = Fragment;
exports.css = css;
exports.h = h2;
exports.handle = handle2;
exports.html = html;
exports.isDLPtr = isDLPtr;
exports.isStateful = isStateful;
exports.scope = scope;
exports.stateful = $state;
})(window);
// Logs.jsx
var olog = console.log;
var ring = [];
function Logs() {
this.css = `
overflow-y: scroll;
font-size: 0.9em;
max-height: 32em;
border: 0.7px solid var(--surface5);
border-radius: 0.7em;
padding: 1em;
background-color: var(--surface0);
font-family: var(--font-mono);
min-height: 16em;
`;
let ringsize = 200;
setInterval(() => {
for (let log2 of ring) {
this.root.append(h("span", { style: { color: log2[0] } }, log2[1]));
if (this.root.children.length > ringsize) {
this.root.children[0].remove();
}
}
ring = [];
this.root.scrollTop = this.root.scrollHeight;
}, 1500);
console.log = (...args) => {
log("var(--fg)", ...args);
};
console.warn = (...args) => {
log("var(--warning)", ...args);
};
console.error = (...args) => {
log("var(--error)", ...args);
};
console.info = (...args) => {
log("var(--info)", ...args);
};
console.debug = (...args) => {
log("var(--fg6)", ...args);
};
return /* @__PURE__ */ h("pre", null);
}
function log(color, ...args) {
olog(...args);
ring.push([color, `[${(/* @__PURE__ */ new Date()).toISOString()}] ` + args.join(" ") + "\n"]);
}
// FsExplorer.jsx
function FSExplorer() {
this.path = "/";
this.listing = [];
this.displayingFile = false;
this.filePath = "";
this.fileData = "";
this.fileHiddenButNotRemoved = false;
this.mount = async () => {
await window.initPromise;
this.fs = window.FS;
this.listing = this.fs.readdir(this.path);
};
this.css = `
width: 100%;
height: calc(100% - 6rem);
.item {
margin-block: 0.15rem;
gap: 0.5rem;
cursor: pointer;
}
.material-symbols-rounded {
font-size: 1.3rem;
}
pre {
display: inline;
}
#uploadcontainer {
position: sticky;
bottom: 0;
right: 0;
left: 0;
display: flex;
justify-content: flex-end;
// padding: 1rem;
pointer-events: none;
width: 100%;
button {
pointer-events: all;
}
}
.actions {
pointer-events: none;
opacity: 0;
transition: opacity 0.15s ease;
}
.item:hover .actions {
pointer-events: all;
opacity: 1;
transition: opacity 0.15s ease;
}
.item {
width: 100%;
border-radius: 0.6rem;
padding-inline: 0.5rem;
background: var(--bg);
transition: background 0.15s ease;
&:hover {
background: var(--surface0);
transition: background 0.15s ease;
}
&.selected {
background: var(--surface1);
transition: background 0.15s ease;
}
}
#path {
font-size: 1.5rem;
font-weight: 650;
font-family: var(--font-display);
margin-block: 0.5rem;
}
#listing {
width: 100%;
height: 100%;
overflow-y: auto;
}
.fileview {
animation: fadeinandmove 0.15s ease 0s 1;
&.hidden {
animation: fadeoutandmove 0.15s ease 0s 1;
}
textarea {
width: 100%;
min-height: 10rem;
background: var(--surface0);
border: none;
border-radius: 0.5rem;
resize: vertical;
padding: 0.5rem;
font-family: var(--font-mono);
color: var(--fg);
font-size: 1rem;
}
}
`;
return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("div", { id: "path" }, use(this.path, (path) => path == "/" ? "File Browser" : path)), /* @__PURE__ */ h("div", { id: "listing" }, use(this.listing, (r) => r.map((r2) => {
let mode = this.fs.stat(this.path + r2).mode;
if (this.fs.isDir(mode)) {
return /* @__PURE__ */ h("div", { class: "item flex vcenter space-between", role: "button", "on:click": () => {
if (r2 == ".") {
this.mount();
} else if (r2 == "..") {
if (this.path == "/") return;
this.path = this.path.split("/").toSpliced(-2, 1).join("/");
this.mount();
} else {
this.path += `${r2}/`;
this.mount();
}
} }, /* @__PURE__ */ h("div", { class: "title flex vcenter gap-sm" }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "folder"), /* @__PURE__ */ h("pre", null, r2, "/")));
} else {
return /* @__PURE__ */ h("div", { class: ["item", "flex", "vcenter", "space-between", use(this.filePath, (p) => this.path + r2 == p && "selected")], role: "button", "on:click": () => {
this.displayingFile = true;
this.filePath = this.path + r2;
try {
this.fileData = new TextDecoder().decode(this.fs.readFile(this.path + r2));
} catch {
}
} }, /* @__PURE__ */ h("div", { class: "title flex vcenter gap-sm" }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "description"), /* @__PURE__ */ h("pre", null, r2)), /* @__PURE__ */ h("div", { class: "actions flex vcenter gap-xs" }, /* @__PURE__ */ h("button", { title: "Download", class: "plain", "on:click": (e) => {
let data = this.fs.readFile(this.path + r2);
let el = /* @__PURE__ */ h("a", { href: URL.createObjectURL(new Blob([data])), download: r2 });
el.click();
e.stopPropagation();
} }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "download")), /* @__PURE__ */ h("button", { title: "Delete", class: "plain", "on:click": (e) => {
this.fs.unlink(this.path + r2);
this.mount();
this.fs.syncfs(false, () => {
});
e.stopPropagation();
} }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded", style: "color: var(--accent)" }, "delete"))));
}
}))), $if(use(this.displayingFile), /* @__PURE__ */ h("div", { class: ["fileview", use(this.fileHiddenButNotRemoved, (h2) => h2 && "hidden")] }, /* @__PURE__ */ h("div", { class: "flex space-between vcenter", style: "margin-block: 1rem;" }, /* @__PURE__ */ h("span", null, "File: ", /* @__PURE__ */ h("pre", null, use(this.filePath))), /* @__PURE__ */ h("span", { class: "flex vcenter gap-sm" }, /* @__PURE__ */ h("button", { class: "primary", "on:click": () => {
this.fs.writeFile(this.filePath, new TextEncoder().encode(this.fileData));
this.fs.syncfs(false, () => {
});
} }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "save"), " ", /* @__PURE__ */ h("span", { class: "label" }, "Save")), /* @__PURE__ */ h("button", { "on:click": () => {
this.fileHiddenButNotRemoved = true;
setTimeout(() => {
this.filePath = "";
this.fileData = "";
this.displayingFile = false;
this.fileHiddenButNotRemoved = false;
}, 150);
} }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "close"), " ", /* @__PURE__ */ h("span", { class: "label" }, "Close")))), /* @__PURE__ */ h("textarea", { "bind:value": use(this.fileData) }))), /* @__PURE__ */ h("div", { class: "flex vcenter", id: "uploadcontainer" }, /* @__PURE__ */ h("button", { class: "large primary", title: "Upload to this directory", "on:click": () => {
let input = h("input", { type: "file" });
input.addEventListener("change", () => {
let file = input.files[0];
let reader = new FileReader();
reader.onload = async () => {
let data = new Uint8Array(reader.result);
this.fs.writeFile(this.path + file.name, data);
this.mount();
};
reader.readAsArrayBuffer(file);
});
document.body.appendChild(input);
input.click();
input.remove();
this.fs.syncfs(false, () => {
});
} }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "upload"))));
}
// node_modules/.pnpm/fflate@0.8.2/node_modules/fflate/esm/browser.js
var ch2 = {};
var wk = function(c, id, msg, transfer, cb) {
var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([
c + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'
], { type: "text/javascript" }))));
w.onmessage = function(e) {
var d = e.data, ed = d.$e$;
if (ed) {
var err2 = new Error(ed[0]);
err2["code"] = ed[1];
err2.stack = ed[2];
cb(err2, null);
} else
cb(null, d);
};
w.postMessage(msg, transfer);
return w;
};
var u8 = Uint8Array;
var u16 = Uint16Array;
var i32 = Int32Array;
var fleb = new u8([
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,
/* unused */
0,
0,
/* impossible */
0
]);
var fdeb = new u8([
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,
/* unused */
0,
0
]);
var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
var freb = function(eb, start2) {
var b = new u16(31);
for (var i = 0; i < 31; ++i) {
b[i] = start2 += 1 << eb[i - 1];
}
var r = new i32(b[30]);
for (var i = 1; i < 30; ++i) {
for (var j = b[i]; j < b[i + 1]; ++j) {
r[j] = j - b[i] << 5 | i;
}
}
return { b, r };
};
var _a = freb(fleb, 2);
var fl = _a.b;
var revfl = _a.r;
fl[28] = 258, revfl[258] = 28;
var _b = freb(fdeb, 0);
var fd = _b.b;
var revfd = _b.r;
var rev = new u16(32768);
for (i = 0; i < 32768; ++i) {
x = (i & 43690) >> 1 | (i & 21845) << 1;
x = (x & 52428) >> 2 | (x & 13107) << 2;
x = (x & 61680) >> 4 | (x & 3855) << 4;
rev[i] = ((x & 65280) >> 8 | (x & 255) << 8) >> 1;
}
var x;
var i;
var hMap = function(cd, mb, r) {
var s = cd.length;
var i = 0;
var l = new u16(mb);
for (; i < s; ++i) {
if (cd[i])
++l[cd[i] - 1];
}
var le = new u16(mb);
for (i = 1; i < mb; ++i) {
le[i] = le[i - 1] + l[i - 1] << 1;
}
var co;
if (r) {
co = new u16(1 << mb);
var rvb = 15 - mb;
for (i = 0; i < s; ++i) {
if (cd[i]) {
var sv = i << 4 | cd[i];
var r_1 = mb - cd[i];
var v = le[cd[i] - 1]++ << r_1;
for (var m = v | (1 << r_1) - 1; v <= m; ++v) {
co[rev[v] >> rvb] = sv;
}
}
}
} else {
co = new u16(s);
for (i = 0; i < s; ++i) {
if (cd[i]) {
co[i] = rev[le[cd[i] - 1]++] >> 15 - cd[i];
}
}
}
return co;
};
var flt = new u8(288);
for (i = 0; i < 144; ++i)
flt[i] = 8;
var i;
for (i = 144; i < 256; ++i)
flt[i] = 9;
var i;
for (i = 256; i < 280; ++i)
flt[i] = 7;
var i;
for (i = 280; i < 288; ++i)
flt[i] = 8;
var i;
var fdt = new u8(32);
for (i = 0; i < 32; ++i)
fdt[i] = 5;
var i;
var flm = /* @__PURE__ */ hMap(flt, 9, 0);
var flrm = /* @__PURE__ */ hMap(flt, 9, 1);
var fdm = /* @__PURE__ */ hMap(fdt, 5, 0);
var fdrm = /* @__PURE__ */ hMap(fdt, 5, 1);
var max = function(a) {
var m = a[0];
for (var i = 1; i < a.length; ++i) {
if (a[i] > m)
m = a[i];
}
return m;
};
var bits = function(d, p, m) {
var o = p / 8 | 0;
return (d[o] | d[o + 1] << 8) >> (p & 7) & m;
};
var bits16 = function(d, p) {
var o = p / 8 | 0;
return (d[o] | d[o + 1] << 8 | d[o + 2] << 16) >> (p & 7);
};
var shft = function(p) {
return (p + 7) / 8 | 0;
};
var slc = function(v, s, e) {
if (s == null || s < 0)
s = 0;
if (e == null || e > v.length)
e = v.length;
return new u8(v.subarray(s, e));
};
var ec = [
"unexpected EOF",
"invalid block type",
"invalid length/literal",
"invalid distance",
"stream finished",
"no stream handler",
,
"no callback",
"invalid UTF-8 data",
"extra field too long",
"date not in range 1980-2099",
"filename too long",
"stream finishing",
"invalid zip data"
// determined by unknown compression method
];
var err = function(ind, msg, nt) {
var e = new Error(msg || ec[ind]);
e.code = ind;
if (Error.captureStackTrace)
Error.captureStackTrace(e, err);
if (!nt)
throw e;
return e;
};
var inflt = function(dat, st, buf, dict) {
var sl = dat.length, dl = dict ? dict.length : 0;
if (!sl || st.f && !st.l)
return buf || new u8(0);
var noBuf = !buf;
var resize = noBuf || st.i != 2;
var noSt = st.i;
if (noBuf)
buf = new u8(sl * 3);
var cbuf = function(l2) {
var bl = buf.length;
if (l2 > bl) {
var nbuf = new u8(Math.max(bl * 2, l2));
nbuf.set(buf);
buf = nbuf;
}
};
var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;
var tbts = sl * 8;
do {
if (!lm) {
final = bits(dat, pos, 1);
var type = bits(dat, pos + 1, 3);
pos += 3;
if (!type) {
var s = shft(pos) + 4, l = dat[s - 4] | dat[s - 3] << 8, t = s + l;
if (t > sl) {
if (noSt)
err(0);
break;
}
if (resize)
cbuf(bt + l);
buf.set(dat.subarray(s, t), bt);
st.b = bt += l, st.p = pos = t * 8, st.f = final;
continue;
} else if (type == 1)
lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
else if (type == 2) {
var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
var tl = hLit + bits(dat, pos + 5, 31) + 1;
pos += 14;
var ldt = new u8(tl);
var clt = new u8(19);
for (var i = 0; i < hcLen; ++i) {
clt[clim[i]] = bits(dat, pos + i * 3, 7);
}
pos += hcLen * 3;
var clb = max(clt), clbmsk = (1 << clb) - 1;
var clm = hMap(clt, clb, 1);
for (var i = 0; i < tl; ) {
var r = clm[bits(dat, pos, clbmsk)];
pos += r & 15;
var s = r >> 4;
if (s < 16) {
ldt[i++] = s;
} else {
var c = 0, n = 0;
if (s == 16)
n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];
else if (s == 17)
n = 3 + bits(dat, pos, 7), pos += 3;
else if (s == 18)
n = 11 + bits(dat, pos, 127), pos += 7;
while (n--)
ldt[i++] = c;
}
}
var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);
lbt = max(lt);
dbt = max(dt);
lm = hMap(lt, lbt, 1);
dm = hMap(dt, dbt, 1);
} else
err(1);
if (pos > tbts) {
if (noSt)
err(0);
break;
}
}
if (resize)
cbuf(bt + 131072);
var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
var lpos = pos;
for (; ; lpos = pos) {
var c = lm[bits16(dat, pos) & lms], sym = c >> 4;
pos += c & 15;
if (pos > tbts) {
if (noSt)
err(0);
break;
}
if (!c)
err(2);
if (sym < 256)
buf[bt++] = sym;
else if (sym == 256) {
lpos = pos, lm = null;
break;
} else {
var add = sym - 254;
if (sym > 264) {
var i = sym - 257, b = fleb[i];
add = bits(dat, pos, (1 << b) - 1) + fl[i];
pos += b;
}
var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;
if (!d)
err(3);
pos += d & 15;
var dt = fd[dsym];
if (dsym > 3) {
var b = fdeb[dsym];
dt += bits16(dat, pos) & (1 << b) - 1, pos += b;
}
if (pos > tbts) {
if (noSt)
err(0);
break;
}
if (resize)
cbuf(bt + 131072);
var end = bt + add;
if (bt < dt) {
var shift = dl - dt, dend = Math.min(dt, end);
if (shift + bt < 0)
err(3);
for (; bt < dend; ++bt)
buf[bt] = dict[shift + bt];
}
for (; bt < end; ++bt)
buf[bt] = buf[bt - dt];
}
}
st.l = lm, st.p = lpos, st.b = bt, st.f = final;
if (lm)
final = 1, st.m = lbt, st.d = dm, st.n = dbt;
} while (!final);
return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);
};
var wbits = function(d, p, v) {
v <<= p & 7;
var o = p / 8 | 0;
d[o] |= v;
d[o + 1] |= v >> 8;
};
var wbits16 = function(d, p, v) {
v <<= p & 7;
var o = p / 8 | 0;
d[o] |= v;
d[o + 1] |= v >> 8;
d[o + 2] |= v >> 16;
};
var hTree = function(d, mb) {
var t = [];
for (var i = 0; i < d.length; ++i) {
if (d[i])
t.push({ s: i, f: d[i] });
}
var s = t.length;
var t2 = t.slice();
if (!s)
return { t: et, l: 0 };
if (s == 1) {
var v = new u8(t[0].s + 1);
v[t[0].s] = 1;
return { t: v, l: 1 };
}
t.sort(function(a, b) {
return a.f - b.f;
});
t.push({ s: -1, f: 25001 });
var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;
t[0] = { s: -1, f: l.f + r.f, l, r };
while (i1 != s - 1) {
l = t[t[i0].f < t[i2].f ? i0++ : i2++];
r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];
t[i1++] = { s: -1, f: l.f + r.f, l, r };
}
var maxSym = t2[0].s;
for (var i = 1; i < s; ++i) {
if (t2[i].s > maxSym)
maxSym = t2[i].s;
}
var tr = new u16(maxSym + 1);
var mbt = ln(t[i1 - 1], tr, 0);
if (mbt > mb) {
var i = 0, dt = 0;
var lft = mbt - mb, cst = 1 << lft;
t2.sort(function(a, b) {
return tr[b.s] - tr[a.s] || a.f - b.f;
});
for (; i < s; ++i) {
var i2_1 = t2[i].s;
if (tr[i2_1] > mb) {
dt += cst - (1 << mbt - tr[i2_1]);
tr[i2_1] = mb;
} else
break;
}
dt >>= lft;
while (dt > 0) {
var i2_2 = t2[i].s;
if (tr[i2_2] < mb)
dt -= 1 << mb - tr[i2_2]++ - 1;
else
++i;
}
for (; i >= 0 && dt; --i) {
var i2_3 = t2[i].s;
if (tr[i2_3] == mb) {
--tr[i2_3];
++dt;
}
}
mbt = mb;
}
return { t: new u8(tr), l: mbt };
};
var ln = function(n, l, d) {
return n.s == -1 ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) : l[n.s] = d;
};
var lc = function(c) {
var s = c.length;
while (s && !c[--s])
;
var cl = new u16(++s);
var cli = 0, cln = c[0], cls = 1;
var w = function(v) {
cl[cli++] = v;
};
for (var i = 1; i <= s; ++i) {
if (c[i] == cln && i != s)
++cls;
else {
if (!cln && cls > 2) {
for (; cls > 138; cls -= 138)
w(32754);
if (cls > 2) {
w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);
cls = 0;
}
} else if (cls > 3) {
w(cln), --cls;
for (; cls > 6; cls -= 6)
w(8304);
if (cls > 2)
w(cls - 3 << 5 | 8208), cls = 0;
}
while (cls--)
w(cln);
cls = 1;
cln = c[i];
}
}
return { c: cl.subarray(0, cli), n: s };
};
var clen = function(cf, cl) {
var l = 0;
for (var i = 0; i < cl.length; ++i)
l += cf[i] * cl[i];
return l;
};
var wfblk = function(out, pos, dat) {
var s = dat.length;
var o = shft(pos + 2);
out[o] = s & 255;
out[o + 1] = s >> 8;
out[o + 2] = out[o] ^ 255;
out[o + 3] = out[o + 1] ^ 255;
for (var i = 0; i < s; ++i)
out[o + i + 4] = dat[i];
return (o + 4 + s) * 8;
};
var wblk = function(dat, out, final, syms, lf, df, eb, li, bs, bl, p) {
wbits(out, p++, final);
++lf[256];
var _a2 = hTree(lf, 15), dlt = _a2.t, mlb = _a2.l;
var _b2 = hTree(df, 15), ddt = _b2.t, mdb = _b2.l;
var _c = lc(dlt), lclt = _c.c, nlc = _c.n;
var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;
var lcfreq = new u16(19);
for (var i = 0; i < lclt.length; ++i)
++lcfreq[lclt[i] & 31];
for (var i = 0; i < lcdt.length; ++i)
++lcfreq[lcdt[i] & 31];
var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;
var nlcc = 19;
for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
;
var flen = bl + 5 << 3;
var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];
if (bs >= 0 && flen <= ftlen && flen <= dtlen)
return wfblk(out, p, dat.subarray(bs, bs + bl));
var lm, ll, dm, dl;
wbits(out, p, 1 + (dtlen < ftlen)), p += 2;
if (dtlen < ftlen) {
lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
var llm = hMap(lct, mlcb, 0);
wbits(out, p, nlc - 257);
wbits(out, p + 5, ndc - 1);
wbits(out, p + 10, nlcc - 4);
p += 14;
for (var i = 0; i < nlcc; ++i)
wbits(out, p + 3 * i, lct[clim[i]]);
p += 3 * nlcc;
var lcts = [lclt, lcdt];
for (var it = 0; it < 2; ++it) {
var clct = lcts[it];
for (var i = 0; i < clct.length; ++i) {
var len = clct[i] & 31;
wbits(out, p, llm[len]), p += lct[len];
if (len > 15)
wbits(out, p, clct[i] >> 5 & 127), p += clct[i] >> 12;
}
}
} else {
lm = flm, ll = flt, dm = fdm, dl = fdt;
}
for (var i = 0; i < li; ++i) {
var sym = syms[i];
if (sym > 255) {
var len = sym >> 18 & 31;
wbits16(out, p, lm[len + 257]), p += ll[len + 257];
if (len > 7)
wbits(out, p, sym >> 23 & 31), p += fleb[len];
var dst = sym & 31;
wbits16(out, p, dm[dst]), p += dl[dst];
if (dst > 3)
wbits16(out, p, sym >> 5 & 8191), p += fdeb[dst];
} else {
wbits16(out, p, lm[sym]), p += ll[sym];
}
}
wbits16(out, p, lm[256]);
return p + ll[256];
};
var deo = /* @__PURE__ */ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
var et = /* @__PURE__ */ new u8(0);
var dflt = function(dat, lvl, plvl, pre, post, st) {
var s = st.z || dat.length;
var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7e3)) + post);
var w = o.subarray(pre, o.length - post);
var lst = st.l;
var pos = (st.r || 0) & 7;
if (lvl) {
if (pos)
w[0] = st.r >> 3;
var opt = deo[lvl - 1];
var n = opt >> 13, c = opt & 8191;
var msk_1 = (1 << plvl) - 1;
var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);
var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
var hsh = function(i2) {
return (dat[i2] ^ dat[i2 + 1] << bs1_1 ^ dat[i2 + 2] << bs2_1) & msk_1;
};
var syms = new i32(25e3);
var lf = new u16(288), df = new u16(32);
var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0;
for (; i + 2 < s; ++i) {
var hv = hsh(i);
var imod = i & 32767, pimod = head[hv];
prev[imod] = pimod;
head[hv] = imod;
if (wi <= i) {
var rem = s - i;
if ((lc_1 > 7e3 || li > 24576) && (rem > 423 || !lst)) {
pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);
li = lc_1 = eb = 0, bs = i;
for (var j = 0; j < 286; ++j)
lf[j] = 0;
for (var j = 0; j < 30; ++j)
df[j] = 0;
}
var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;
if (rem > 2 && hv == hsh(i - dif)) {
var maxn = Math.min(n, rem) - 1;
var maxd = Math.min(32767, i);
var ml = Math.min(258, rem);
while (dif <= maxd && --ch_1 && imod != pimod) {
if (dat[i + l] == dat[i + l - dif]) {
var nl = 0;
for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)
;
if (nl > l) {
l = nl, d = dif;
if (nl > maxn)
break;
var mmd = Math.min(dif, nl - 2);
var md = 0;
for (var j = 0; j < mmd; ++j) {
var ti = i - dif + j & 32767;
var pti = prev[ti];
var cd = ti - pti & 32767;
if (cd > md)
md = cd, pimod = ti;
}
}
}
imod = pimod, pimod = prev[imod];
dif += imod - pimod & 32767;
}
}
if (d) {
syms[li++] = 268435456 | revfl[l] << 18 | revfd[d];
var lin = revfl[l] & 31, din = revfd[d] & 31;
eb += fleb[lin] + fdeb[din];
++lf[257 + lin];
++df[din];
wi = i + l;
++lc_1;
} else {
syms[li++] = dat[i];
++lf[dat[i]];
}
}
}
for (i = Math.max(i, wi); i < s; ++i) {
syms[li++] = dat[i];
++lf[dat[i]];
}
pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);
if (!lst) {
st.r = pos & 7 | w[pos / 8 | 0] << 3;
pos -= 7;
st.h = head, st.p = prev, st.i = i, st.w = wi;
}
} else {
for (var i = st.w || 0; i < s + lst; i += 65535) {
var e = i + 65535;
if (e >= s) {
w[pos / 8 | 0] = lst;
e = s;
}
pos = wfblk(w, pos + 1, dat.subarray(i, e));
}
st.i = s;
}
return slc(o, 0, pre + shft(pos) + post);
};
var crct = /* @__PURE__ */ function() {
var t = new Int32Array(256);
for (var i = 0; i < 256; ++i) {
var c = i, k = 9;
while (--k)
c = (c & 1 && -306674912) ^ c >>> 1;
t[i] = c;
}
return t;
}();
var crc = function() {
var c = -1;
return {
p: function(d) {
var cr = c;
for (var i = 0; i < d.length; ++i)
cr = crct[cr & 255 ^ d[i]] ^ cr >>> 8;
c = cr;
},
d: function() {
return ~c;
}
};
};
var dopt = function(dat, opt, pre, post, st) {
if (!st) {
st = { l: 1 };
if (opt.dictionary) {
var dict = opt.dictionary.subarray(-32768);
var newDat = new u8(dict.length + dat.length);
newDat.set(dict);
newDat.set(dat, dict.length);
dat = newDat;
st.w = dict.length;
}
}
return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre, post, st);
};
var mrg = function(a, b) {
var o = {};
for (var k in a)
o[k] = a[k];
for (var k in b)
o[k] = b[k];
return o;
};
var wcln = function(fn, fnStr, td2) {
var dt = fn();
var st = fn.toString();
var ks = st.slice(st.indexOf("[") + 1, st.lastIndexOf("]")).replace(/\s+/g, "").split(",");
for (var i = 0; i < dt.length; ++i) {
var v = dt[i], k = ks[i];
if (typeof v == "function") {
fnStr += ";" + k + "=";
var st_1 = v.toString();
if (v.prototype) {
if (st_1.indexOf("[native code]") != -1) {
var spInd = st_1.indexOf(" ", 8) + 1;
fnStr += st_1.slice(spInd, st_1.indexOf("(", spInd));
} else {
fnStr += st_1;
for (var t in v.prototype)
fnStr += ";" + k + ".prototype." + t + "=" + v.prototype[t].toString();
}
} else
fnStr += st_1;
} else
td2[k] = v;
}
return fnStr;
};
var ch = [];
var cbfs = function(v) {
var tl = [];
for (var k in v) {
if (v[k].buffer) {
tl.push((v[k] = new v[k].constructor(v[k])).buffer);
}
}
return tl;
};
var wrkr = function(fns, init2, id, cb) {
if (!ch[id]) {
var fnStr = "", td_1 = {}, m = fns.length - 1;
for (var i = 0; i < m; ++i)
fnStr = wcln(fns[i], fnStr, td_1);
ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 };
}
var td2 = mrg({}, ch[id].e);
return wk(ch[id].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + init2.toString() + "}", id, td2, cbfs(td2), cb);
};
var bInflt = function() {
return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt];
};
var bDflt = function() {
return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf];
};
var pbf = function(msg) {
return postMessage(msg, [msg.buffer]);
};
var gopt = function(o) {
return o && {
out: o.size && new u8(o.size),
dictionary: o.dictionary
};
};
var cbify = function(dat, opts, fns, init2, id, cb) {
var w = wrkr(fns, init2, id, function(err2, dat2) {
w.terminate();
cb(err2, dat2);
});
w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);
return function() {
w.terminate();
};
};
var b2 = function(d, b) {
return d[b] | d[b + 1] << 8;
};
var b4 = function(d, b) {
return (d[b] | d[b + 1] << 8 | d[b + 2] << 16 | d[b + 3] << 24) >>> 0;
};
var b8 = function(d, b) {
return b4(d, b) + b4(d, b + 4) * 4294967296;
};
var wbytes = function(d, b, v) {
for (; v; ++b)
d[b] = v, v >>>= 8;
};
function deflate(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != "function")
err(7);
return cbify(data, opts, [
bDflt
], function(ev) {
return pbf(deflateSync(ev.data[0], ev.data[1]));
}, 0, cb);
}
function deflateSync(data, opts) {
return dopt(data, opts || {}, 0, 0);
}
function inflate(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != "function")
err(7);
return cbify(data, opts, [
bInflt
], function(ev) {
return pbf(inflateSync(ev.data[0], gopt(ev.data[1])));
}, 1, cb);
}
function inflateSync(data, opts) {
return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);
}
var fltn = function(d, p, t, o) {
for (var k in d) {
var val = d[k], n = p + k, op = o;
if (Array.isArray(val))
op = mrg(o, val[1]), val = val[0];
if (val instanceof u8)
t[n] = [val, op];
else {
t[n += "/"] = [new u8(0), op];
fltn(val, n, t, o);
}
}
};
var te = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder();
var td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder();
var tds = 0;
try {
td.decode(et, { stream: true });
tds = 1;
} catch (e) {
}
var dutf8 = function(d) {
for (var r = "", i = 0; ; ) {
var c = d[i++];
var eb = (c > 127) + (c > 223) + (c > 239);
if (i + eb > d.length)
return { s: r, r: slc(d, i - 1) };
if (!eb)
r += String.fromCharCode(c);
else if (eb == 3) {
c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | d[i++] & 63) - 65536, r += String.fromCharCode(55296 | c >> 10, 56320 | c & 1023);
} else if (eb & 1)
r += String.fromCharCode((c & 31) << 6 | d[i++] & 63);
else
r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | d[i++] & 63);
}
};
function strToU8(str, latin1) {
if (latin1) {
var ar_1 = new u8(str.length);
for (var i = 0; i < str.length; ++i)
ar_1[i] = str.charCodeAt(i);
return ar_1;
}
if (te)
return te.encode(str);
var l = str.length;
var ar = new u8(str.length + (str.length >> 1));
var ai = 0;
var w = function(v) {
ar[ai++] = v;
};
for (var i = 0; i < l; ++i) {
if (ai + 5 > ar.length) {
var n = new u8(ai + 8 + (l - i << 1));
n.set(ar);
ar = n;
}
var c = str.charCodeAt(i);
if (c < 128 || latin1)
w(c);
else if (c < 2048)
w(192 | c >> 6), w(128 | c & 63);
else if (c > 55295 && c < 57344)
c = 65536 + (c & 1023 << 10) | str.charCodeAt(++i) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63);
else
w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63);
}
return slc(ar, 0, ai);
}
function strFromU8(dat, latin1) {
if (latin1) {
var r = "";
for (var i = 0; i < dat.length; i += 16384)
r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));
return r;
} else if (td) {
return td.decode(dat);
} else {
var _a2 = dutf8(dat), s = _a2.s, r = _a2.r;
if (r.length)
err(8);
return s;
}
}
var slzh = function(d, b) {
return b + 30 + b2(d, b + 26) + b2(d, b + 28);
};
var zh = function(d, b, z) {
var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);
var _a2 = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a2[0], su = _a2[1], off = _a2[2];
return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];
};
var z64e = function(d, b) {
for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))
;
return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];
};
var exfl = function(ex) {
var le = 0;
if (ex) {
for (var k in ex) {
var l = ex[k].length;
if (l > 65535)
err(9);
le += l + 4;
}
}
return le;
};
var wzh = function(d, b, f, fn, u, c, ce, co) {
var fl2 = fn.length, ex = f.extra, col = co && co.length;
var exl = exfl(ex);
wbytes(d, b, ce != null ? 33639248 : 67324752), b += 4;
if (ce != null)
d[b++] = 20, d[b++] = f.os;
d[b] = 20, b += 2;
d[b++] = f.flag << 1 | (c < 0 && 8), d[b++] = u && 8;
d[b++] = f.compression & 255, d[b++] = f.compression >> 8;
var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;
if (y < 0 || y > 119)
err(10);
wbytes(d, b, y << 25 | dt.getMonth() + 1 << 21 | dt.getDate() << 16 | dt.getHours() << 11 | dt.getMinutes() << 5 | dt.getSeconds() >> 1), b += 4;
if (c != -1) {
wbytes(d, b, f.crc);
wbytes(d, b + 4, c < 0 ? -c - 2 : c);
wbytes(d, b + 8, f.size);
}
wbytes(d, b + 12, fl2);
wbytes(d, b + 14, exl), b += 16;
if (ce != null) {
wbytes(d, b, col);
wbytes(d, b + 6, f.attrs);
wbytes(d, b + 10, ce), b += 14;
}
d.set(fn, b);
b += fl2;
if (exl) {
for (var k in ex) {
var exf = ex[k], l = exf.length;
wbytes(d, b, +k);
wbytes(d, b + 2, l);
d.set(exf, b + 4), b += 4 + l;
}
}
if (col)
d.set(co, b), b += col;
return b;
};
var wzf = function(o, b, c, d, e) {
wbytes(o, b, 101010256);
wbytes(o, b + 8, c);
wbytes(o, b + 10, c);
wbytes(o, b + 12, d);
wbytes(o, b + 16, e);
};
function zip(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != "function")
err(7);
var r = {};
fltn(data, "", r, opts);
var k = Object.keys(r);
var lft = k.length, o = 0, tot = 0;
var slft = lft, files2 = new Array(lft);
var term = [];
var tAll = function() {
for (var i2 = 0; i2 < term.length; ++i2)
term[i2]();
};
var cbd = function(a, b) {
mt(function() {
cb(a, b);
});
};
mt(function() {
cbd = cb;
});
var cbf = function() {
var out = new u8(tot + 22), oe = o, cdl = tot - o;
tot = 0;
for (var i2 = 0; i2 < slft; ++i2) {
var f = files2[i2];
try {
var l = f.c.length;
wzh(out, tot, f, f.f, f.u, l);
var badd = 30 + f.f.length + exfl(f.extra);
var loc = tot + badd;
out.set(f.c, loc);
wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;
} catch (e) {
return cbd(e, null);
}
}
wzf(out, o, files2.length, cdl, oe);
cbd(null, out);
};
if (!lft)
cbf();
var _loop_1 = function(i2) {
var fn = k[i2];
var _a2 = r[fn], file = _a2[0], p = _a2[1];
var c = crc(), size = file.length;
c.p(file);
var f = strToU8(fn), s = f.length;
var com = p.comment, m = com && strToU8(com), ms = m && m.length;
var exl = exfl(p.extra);
var compression = p.level == 0 ? 0 : 8;
var cbl = function(e, d) {
if (e) {
tAll();
cbd(e, null);
} else {
var l = d.length;
files2[i2] = mrg(p, {
size,
crc: c.d(),
c: d,
f,
m,
u: s != fn.length || m && com.length != ms,
compression
});
o += 30 + s + exl + l;
tot += 76 + 2 * (s + exl) + (ms || 0) + l;
if (!--lft)
cbf();
}
};
if (s > 65535)
cbl(err(11, 0, 1), null);
if (!compression)
cbl(null, file);
else if (size < 16e4) {
try {
cbl(null, deflateSync(file, p));
} catch (e) {
cbl(e, null);
}
} else
term.push(deflate(file, p, cbl));
};
for (var i = 0; i < slft; ++i) {
_loop_1(i);
}
return tAll;
}
var mt = typeof queueMicrotask == "function" ? queueMicrotask : typeof setTimeout == "function" ? setTimeout : function(fn) {
fn();
};
function unzip(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != "function")
err(7);
var term = [];
var tAll = function() {
for (var i2 = 0; i2 < term.length; ++i2)
term[i2]();
};
var files2 = {};
var cbd = function(a, b) {
mt(function() {
cb(a, b);
});
};
mt(function() {
cbd = cb;
});
var e = data.length - 22;
for (; b4(data, e) != 101010256; --e) {
if (!e || data.length - e > 65558) {
cbd(err(13, 0, 1), null);
return tAll;
}
}
;
var lft = b2(data, e + 8);
if (lft) {
var c = lft;
var o = b4(data, e + 16);
var z = o == 4294967295 || c == 65535;
if (z) {
var ze = b4(data, e - 12);
z = b4(data, ze) == 101075792;
if (z) {
c = lft = b4(data, ze + 32);
o = b4(data, ze + 48);
}
}
var fltr = opts && opts.filter;
var _loop_3 = function(i2) {
var _a2 = zh(data, o, z), c_1 = _a2[0], sc = _a2[1], su = _a2[2], fn = _a2[3], no = _a2[4], off = _a2[5], b = slzh(data, off);
o = no;
var cbl = function(e2, d) {
if (e2) {
tAll();
cbd(e2, null);
} else {
if (d)
files2[fn] = d;
if (!--lft)
cbd(null, files2);
}
};
if (!fltr || fltr({
name: fn,
size: sc,
originalSize: su,
compression: c_1
})) {
if (!c_1)
cbl(null, slc(data, b, b + sc));
else if (c_1 == 8) {
var infl = data.subarray(b, b + sc);
if (su < 524288 || sc > 0.8 * su) {
try {
cbl(null, inflateSync(infl, { out: new u8(su) }));
} catch (e2) {
cbl(e2, null);
}
} else
term.push(inflate(infl, { size: su }, cbl));
} else
cbl(err(14, "unknown compression type " + c_1, 1), null);
} else
cbl(null, null);
};
for (var i = 0; i < c; ++i) {
_loop_3(i);
}
} else
cbd(null, {});
return tAll;
}
// game.js
var version = "1.4.0.0";
var setModuleImports;
var getAssemblyExports;
var getConfig;
var initted = false;
async function init() {
if (initted) return;
({ setModuleImports, getAssemblyExports, getConfig } = await dotnet.withModuleConfig({
onConfigLoaded: (config) => {
config.disableIntegrityCheck = true;
}
}).withDiagnosticTracing(false).withApplicationArgumentsFromQuery().create());
if (!dotnet.instance.Module.FS.analyzePath("/libsdl").path) {
dotnet.instance.Module.FS.mkdir("/libsdl", 493);
dotnet.instance.Module.FS.mount(
dotnet.instance.Module.FS.filesystems.IDBFS,
{},
"/libsdl"
);
}
await new Promise((r) => dotnet.instance.Module.FS.syncfs(true, r));
console.debug("synced; exposing dotnet FS");
window.FS = dotnet.instance.Module.FS;
setModuleImports("main.js", {
setMainLoop: MainLoop,
stopMainLoop: () => dotnet.instance.Module.pauseMainLoop(),
syncFs: (cb) => dotnet.instance.Module.FS.syncfs(false, cb)
});
initted = true;
}
var ts = performance.now();
var fps;
var MainLoop = (cb) => {
dotnet.instance.Module.setMainLoop(() => {
let now = performance.now();
let dt = now - ts;
ts = now;
fps = 1e3 / dt;
cb();
});
};
async function start(canvas) {
console.info("Starting...");
if (!dotnet.instance.Module.FS.analyzePath("/Content").path) {
await new Promise((r) => loadData(dotnet.instance.Module, r));
console.info("Loaded assets into VFS");
}
if (window.assetblob) {
URL.revokeObjectURL(window.assetblob);
}
dotnet.instance.Module.canvas = canvas;
await dotnet.run();
let Exports = await getAssemblyExports("fna-wasm");
Exports.Program.StartGame();
}
async function downloadsave() {
await new Promise((r) => dotnet.instance.Module.FS.syncfs(false, r));
let tozip = {};
let saves = dotnet.instance.Module.FS.readdir("/libsdl/Celeste/Saves");
for (let save of saves) {
if (save === "." || save === "..") continue;
let savepath = `/libsdl/Celeste/Saves/${save}`;
let data = dotnet.instance.Module.FS.readFile(savepath);
tozip[save] = data;
}
const zipped = await new Promise((r, j) => zip(tozip, (e, data) => {
if (!e) {
r(data);
} else {
j(e);
}
}));
let blob = new Blob([zipped], { type: "application/zip" });
let url = URL.createObjectURL(blob);
let a = h("a", { href: url, download: "saves.zip" });
a.click();
a.remove();
}
async function unzipsave(file) {
let data = await file.arrayBuffer();
let unzipped = await new Promise((r, j) => unzip(new Uint8Array(data), (e, data2) => {
if (!e) {
r(data2);
} else {
j(e);
}
}));
let files2 = Object.entries(unzipped);
if (!dotnet.instance.Module.FS.analyzePath("/libsdl/Celeste").path) {
dotnet.instance.Module.FS.mkdir("/libsdl/Celeste", 493);
}
if (!dotnet.instance.Module.FS.analyzePath("/libsdl/Celeste/Saves").path) {
dotnet.instance.Module.FS.mkdir("/libsdl/Celeste/Saves", 493);
}
for (let [name, data2] of files2) {
dotnet.instance.Module.FS.writeFile(`/libsdl/Celeste/Saves/${name}`, data2);
}
await new Promise((r) => dotnet.instance.Module.FS.syncfs(false, r));
console.log("synced!");
}
async function uploadsave() {
let input = h("input", { type: "file" });
await new Promise((r) => {
input.onchange = async () => {
let file = input.files[0];
unzipsave(file);
r();
};
input.click();
input.remove();
});
}
// SaveManager.jsx
function SaveManager() {
this.css = `
flex-direction: column;
// justify-content: center;
align-items: center;
gap: 0.75rem;
width: 100%;
height: calc(100% - 3rem);
#dragarea {
display: flex;
gap: 0.25rem;
flex-direction: column;
align-items: center;
justify-content: center;
width: 95%;
height: auto;
aspect-ratio: 1.25 / 1;
border: 2px dashed var(--fg6);
border-radius: 0.6rem;
color: var(--fg6);
transition: 0.3s ease;
&.dragover {
color: var(--fg3);
border-color: var(--accent);
background-color: color-mix(in srgb, var(--accent) 5%, color-mix(in srgb, var(--surface2) 40%, transparent));
transition: 0.3s ease;
box-shadow: 0 0 28px 0 color-mix(in srgb, var(--accent) 20%, transparent);
}
h1 {
margin: 0;
margin-bottom: 1.25rem;
}
}
& > button {
width: 95%;
}
#head {
font-size: 1.5rem;
font-weight: 650;
font-family: var(--font-display);
margin-block: 0.5rem;
align-self: flex-start;
margin-left: 2.5%;
}
`;
return /* @__PURE__ */ h("div", { class: "flex" }, /* @__PURE__ */ h("span", { id: "head" }, "Save Manager"), /* @__PURE__ */ h(
"div",
{
id: "dragarea",
"bind:this": use(this.zone),
"on:dragover": (ev) => {
ev.preventDefault();
},
"on:dragenter": () => {
this.zone.classList.add("dragover");
},
"on:dragleave": () => {
this.zone.classList.remove("dragover");
},
"on:drop": async (ev) => {
ev.preventDefault();
let files2 = ev.dataTransfer.items ? ev.dataTransfer.items : ev.dataTransfer.files;
let file;
if (files2 > 1) {
alert("Please only drop one file at a time.");
return;
} else {
file = files2[0].getAsFile();
}
this.zone.classList.remove("dragover");
await unzipsave(file);
app.savesmenu.close();
}
},
/* @__PURE__ */ h("div", { class: "material-symbols-rounded", style: "font-size: 5rem;" }, "cloud_upload"),
/* @__PURE__ */ h("h1", null, "Drag and drop savefile"),
/* @__PURE__ */ h("div", null, /* @__PURE__ */ h("button", { id: "upload", "on:click": async () => {
await uploadsave();
app.savesmenu.close();
} }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "upload"), /* @__PURE__ */ h("span", { class: "label" }, "Upload from computer")))
), /* @__PURE__ */ h("button", { id: "dl", "on:click": async () => {
await downloadsave();
app.savesmenu.close();
} }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "cloud_download"), /* @__PURE__ */ h("span", { class: "label" }, "Download current save")));
}
// App.jsx
function App() {
this.css = `
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
margin: 0;
background-color: var(--bg);
color: var(--fg);
overflow-x: hidden;
.game {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
canvascontainer {
display: grid;
max-height: 85vh;
max-width: 100%;
aspect-ratio: 16 / 9;
border: 0.7px solid var(--surface5);
border-radius: 0.6rem;
overflow: hidden;
background-color: black;
&:not(:has(canvas[width])) {
min-width: min(100%, 960px);
min-height: min(100%, 540px);
}
& > * {
grid-area: 1 / 1;
}
& > div {
transition: 0.3s ease;
&.hidden {
opacity: 0;
pointer-events: none;
transition: 0.3s ease;
}
.material-symbols-rounded {
font-size: 3em;
}
h3 {
margin: 0.2rem;
font-weight: 570;
}
background-color: var(--surface1);
user-select: none;
text-align: center;
color: var(--fg6);
font-size: 1.5em;
font-weight: 550;
z-index: 5;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
}
canvas {
width: 100%;
display: block;
}
}
.pinned {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: auto;
}
.logs {
width: min(960px, 100%);
}
.top-bar {
padding-bottom: 1em;
border: none;
background-color: var(--surface0);
flex-direction: column;
align-items: center;
gap: 0.5em;
}
.expand { flex: 1 }
.content {
padding: 0 1em;
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
}
dialog:-internal-dialog-in-top-layer::backdrop {
background: color-mix(in srgb, black 35%, color-mix(in srgb, var(--bg), transparent 70%))!important;
}
dialog {
background: var(--bg);
color: var(--fg);
border: 0.1em solid var(--surface3);
border-radius: 0.6em;
opacity: 1;
scale: 1;
max-height: 75vh;
width: unset;
aspect-ratio: 1 / 1;
transition: opacity 0.25s, transform 0.25s;
transition-timing-function: ease;
&:not([open]) {
display: block;
pointer-events: none;
transform: scale(0.8);
opacity: 0;
scale: 0.9;
}
button {
float: right;
}
& > div {
width: 100%;
}
}
footer {
padding: 0.5em;
border-top: 0.1em solid var(--surface1);
background-color: var(--bg-sub);
font-size: 0.8em;
position: relative;
bottom: 0;
flex-direction: column;
align-items: center;
text-align: center;
}
@media screen and (min-width: 950px) {
footer {
flex-direction: row !important;
}
}
@media screen and (min-width: 700px) {
.top-bar {
flex-direction: row !important;
gap: 1.5em !important;
padding: 0 1.5em !important;
}
}
`;
this.loaded = false;
this.started = false;
this.allowPlay = false;
let updatePlay = () => {
this.allowPlay = this.loaded || !this.started;
};
handle(use(this.loaded), updatePlay);
handle(use(this.started), updatePlay);
window.initPromise = (async () => {
await init();
this.loaded = true;
log("var(--success)", "Loaded frontend!");
})();
this.fullscreen = false;
document.addEventListener("fullscreenchange", () => {
this.fullscreen = document.fullscreen;
});
setInterval(() => {
this.fps = fps;
}, 1e3);
const startgame = () => {
this.started = true;
start(this.canvas);
this.allowPlay = false;
};
return /* @__PURE__ */ h("main", { class: ["gap-md", use(store.theme)] }, /* @__PURE__ */ h("div", { class: "flex vcenter space-between top-bar" }, /* @__PURE__ */ h("span", { class: "flex vcenter gap left" }, /* @__PURE__ */ h(Logo, null), $if(
use(this.started),
/* @__PURE__ */ h("p", null, "FPS: ", use(this.fps, Math.floor))
)), /* @__PURE__ */ h("span", { class: "expand" }), /* @__PURE__ */ h("span", { class: "flex right vcenter", style: "gap: 0.85em;" }, /* @__PURE__ */ h("button", { "on:click": () => {
this.savesmenu.showModal();
}, title: "Manage save data" }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "save")), /* @__PURE__ */ h("button", { "on:click": () => {
this.fs.showModal();
}, title: "File Manager" }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "folder_open")), /* @__PURE__ */ h("button", { "on:click": () => {
if (store.theme === "light") {
store.theme = "dark";
} else {
store.theme = "light";
}
}, title: "Toggle Theme" }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, use(store.theme, (theme) => theme === "light" ? "dark_mode" : "light_mode"))), /* @__PURE__ */ h(
"button",
{
"on:click": () => {
if (this.canvas.requestFullscreen()) {
this.fullscreen = true;
}
},
title: "Enter Fullscreen"
},
/* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "fullscreen")
), /* @__PURE__ */ h(
"button",
{
class: [
use(this.allowPlay, (allowed) => !allowed ? "disabled" : "primary")
],
"on:click": startgame,
title: "Start Game"
},
/* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "play_arrow")
))), /* @__PURE__ */ h("div", { class: "content" }, navigator.userAgent.includes("Firefox") && /* @__PURE__ */ h(FuckMozilla, null) || "", /* @__PURE__ */ h("div", { class: "game" }, /* @__PURE__ */ h("canvascontainer", null, /* @__PURE__ */ h("div", { class: [use(this.started, (f) => f && "hidden")] }, /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "videogame_asset_off"), /* @__PURE__ */ h("br", null), /* @__PURE__ */ h("h3", null, "Game not running."))), /* @__PURE__ */ h(
"canvas",
{
id: "canvas",
"bind:this": use(this.canvas),
"on:contextmenu": (e) => e.preventDefault()
}
))), /* @__PURE__ */ h("dialog", { "bind:this": use(this.fs), id: "fs" }, /* @__PURE__ */ h("button", { "on:click": () => this.fs.close(), class: "plain" }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "close")), /* @__PURE__ */ h(FSExplorer, null)), /* @__PURE__ */ h("dialog", { "bind:this": use(this.savesmenu) }, /* @__PURE__ */ h("button", { "on:click": () => this.savesmenu.close(), class: "plain" }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "close")), /* @__PURE__ */ h(SaveManager, null)), /* @__PURE__ */ h("div", { class: "logs" }, /* @__PURE__ */ h("h2", null, "Log"), /* @__PURE__ */ h(Logs, null))), /* @__PURE__ */ h("footer", { class: "flex space-between gap-sm" }, /* @__PURE__ */ h("span", null, "Ported by ", /* @__PURE__ */ h("a", { href: "https://mercurywork.shop", target: "_blank" }, "Mercury Workshop")), /* @__PURE__ */ h("span", null, "All game assets and code belong to ", /* @__PURE__ */ h("a", { href: "https://exok.com/", target: "_blank" }, "Extremely OK Games, Ltd."), " All rights reserved."), /* @__PURE__ */ h("span", null, "Check out the project on ", /* @__PURE__ */ h("a", { href: "https://github.com/MercuryWorkshop/celeste-wasm" }, "GitHub!"))));
}
function FuckMozilla() {
this.css = `
width: min(960px, 100%);
background-color: var(--accent);
color: var(--fg);
padding: 1em;
padding-top: 0.5em;
margin-bottom: 1em;
border-radius: 0.6rem;
h1 {
display: flex;
align-items: center;
gap: 0.25em;
span {
font-size: 2.25rem;
}
}
`;
return /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("h1", null, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "warning"), "THIS MIGHT NOT WORK WELL ON FIREFOX!"), /* @__PURE__ */ h("p", null, "Chromium's WASM implementation is generally better, and it was what was tested on the most. It will probably still work (might not!) on Firefox but you should really be using a Chromium-based browser for this."), /* @__PURE__ */ h("button", { "on:click": () => this.root.remove() }, "Dismiss"));
}
function Logo() {
this.css = `
.logo {
image-rendering: pixelated;
-ms-interpolation-mode: nearest-neighbor;
width: 3.75rem;
height: 3.75rem;
margin: 0;
padding: 0;
}
h1 {
font-size: 2rem;
display: flex;
}
h1 subt {
font-size: 0.5em;
margin-left: 0.25em;
color: var(--fg6);
}
`;
return /* @__PURE__ */ h("span", { class: "flex vcenter" }, /* @__PURE__ */ h("img", { class: "logo", src: document.querySelector("link[rel=icon]").href }), /* @__PURE__ */ h("h1", null, "celeste-wasm", /* @__PURE__ */ h("subt", null, "v", version)));
}
// main.jsx
var import_jszip = __toESM(require_jszip_min());
var store = $store(
{
theme: window.matchMedia && window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark"
},
{ ident: "user-options", backing: "localstorage", autosave: "auto" }
);
if (window.SINGLEFILE) {
document.body.querySelector("#interstitial").remove();
}
var chunkify = function* (itr, size) {
let chunk = [];
for (const v of itr) {
chunk.push(v);
if (chunk.length === size) {
yield chunk;
chunk = [];
}
}
if (chunk.length) yield chunk;
};
var clamp = (l, v, h2) => {
return v < l ? l : v > h2 ? h2 : v;
};
function IntroSplash() {
this.css = `
position: absolute;
top: 0;
left: 0;
z-index: 9999999;
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
margin: 0;
background-color: var(--bg);
color: var(--fg);
display: flex;
justify-content: center;
align-items: center;
.mountain {
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
z-index: 0;
background-image: url(${mountainsrc.href});
background-size: cover;
background-position: center;
}
#opaque {
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 1;
background-color: var(--bg);
opacity: 0;
animation: fadeout 1.3s ease 0s 1;
}
#blur {
backdrop-filter: blur(24px);
background-color: color-mix(in srgb, var(--bg) 60%, transparent);
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 2;
}
.info {
z-index: 3;
border-radius: 1em;
background-color: color-mix(in srgb, var(--surface0) 80%, transparent);
backdrop-filter: blur(30px);
max-width: max(480px, 40%);
padding: 2em;
animation: fadeinandmove 1s ease 0s 1;
div {
margin-block: 1em;
}
}
button,
#bar {
animation: fadeinandmove 0.15s ease 0s 1;
width: 100%;
height: 0.5em;
background-color: var(--bg);
border-radius: 0.5em;
}
#progress {
transition: width 0.2s ease;
height: 0.5em;
background-color: var(--accent);
border-radius: 0.5em;
}
.inner {
margin-inline: 0.8rem;
}
.action {
padding: 1em;
}
@keyframes fadeout {
from { opacity: 1; scale: 1; }
to { opacity: 0; scale: 1.2; }
}
`;
let encbuf;
this.progress = 0;
this.downloading = false;
this.downloaded = false;
this.showprogress = true;
if (window.SINGLEFILE) {
this.downloaded = true;
this.downloading = true;
this.showprogress = false;
this.progress = 100;
encbuf = window.xorbuf;
window.xorbuf = null;
}
this.decrypted = !DRM;
this.decrypterror = "";
let download = async () => {
this.downloading = true;
this.progress = 0;
if (SPLIT) {
encbuf = new Uint8Array(SIZE);
await Promise.all([...chunkify(splits.entries(), Math.ceil(splits.length / 5))].map(async (chunk) => {
for (let [idx, file] of chunk) {
let data = await fetch(`_framework/data/${file}`);
let buf = new Uint8Array(await data.arrayBuffer());
encbuf.set(buf, idx * CHUNKSIZE);
this.progress += CHUNKSIZE / SIZE * 100;
}
}));
} else {
encbuf = new Uint8Array(SIZE);
let data = await fetch("_framework/data.data");
let cur = 0;
for await (const chunk of data.body) {
encbuf.set(chunk, cur);
cur += chunk.length;
this.progress = cur / SIZE * 100;
}
}
this.downloaded = true;
};
let decrypt = async () => {
let input = h("input", { type: "file" });
input.addEventListener("change", async () => {
if (input.files.length === 0) {
this.decrypterror = "No file selected";
return;
}
let file = input.files[0];
if (file.size !== 125540) {
this.decrypterror = "Invalid key file (or a different version of the game?)";
return;
}
let reader = new FileReader();
reader.onload = async () => {
let key = new Uint8Array(reader.result);
this.progress = 0;
for (let i = 0; i < encbuf.length; i += 4096) {
encbuf[i] ^= key[i % key.length];
if (i % (4096 * 200) == 0) {
this.progress = i / encbuf.length * 100;
await new Promise((r) => requestAnimationFrame(r));
}
}
this.decrypted = true;
};
reader.readAsArrayBuffer(file);
});
document.body.appendChild(input);
input.click();
input.remove();
};
let finish = async () => {
$el.classList.remove("primary");
$el.classList.add("disabled");
this.playlabel.innerText = "Initializing...";
window.assetblob = URL.createObjectURL(new Blob([encbuf]));
await init();
await new Promise((r) => loadData(dotnet.instance.Module, r));
console.info("Cached and loaded assets into VFS");
localStorage["vfs_populated"] = true;
await loadfrontend();
this.root.addEventListener("animationend", this.root.remove);
this.root.style.animation = "fadeout 0.5s ease";
};
return /* @__PURE__ */ h("main", { class: [use(store.theme)] }, /* @__PURE__ */ h("div", { class: "mountain" }), /* @__PURE__ */ h("div", { id: "opaque" }), /* @__PURE__ */ h("div", { id: "blur" }), /* @__PURE__ */ h("div", { class: "info" }, /* @__PURE__ */ h(Logo, null), /* @__PURE__ */ h("div", { class: "inner" }, /* @__PURE__ */ h("p", null, "This is a mostly-complete port of ", /* @__PURE__ */ h("a", { href: "https://store.steampowered.com/app/504230/Celeste/" }, "Celeste"), " to the browser using dotnet's ", /* @__PURE__ */ h("code", null, "wasmbrowser"), " template and ", /* @__PURE__ */ h("a", { href: "https://github.com/RedMike/FNA.WASM.Sample" }, "FNA.WASM.Sample"), "."), /* @__PURE__ */ h("p", null, "It needs around 1.6GB of memory and will probably not work on mobile devices."), /* @__PURE__ */ h("p", null, DRM && "You will need to own Celeste to play this. Make sure you have it downloaded and installed on your computer. " || "", "The game will autosave your progress, but the browser may wipe it after a while. Remember to periodically use the save icon at the top. ", /* @__PURE__ */ h("br", null), /* @__PURE__ */ h("br", null), !window.SINGLEFILE && " This will download around ~700MB of assets to your browser's local storage." || ""), $if(
use(this.downloading),
$if(use(this.showprogress), /* @__PURE__ */ h("div", null, /* @__PURE__ */ h("p", null, "Downloading... (", use(this.progress, (e) => {
return clamp(0, Math.round(e), 100);
}), "% done)"), /* @__PURE__ */ h("div", { id: "bar" }, /* @__PURE__ */ h("div", { id: "progress", style: {
width: use`${this.progress}%`
} })))),
/* @__PURE__ */ h("div", null, /* @__PURE__ */ h("button", { class: "action primary", "on:click": download }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "download"), /* @__PURE__ */ h("span", { class: "label" }, "Download Assets")))
), $if(
use(this.downloaded),
$if(
use(this.decrypted),
/* @__PURE__ */ h("button", { class: "action primary", "on:click": finish }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "stadia_controller"), /* @__PURE__ */ h("span", { "bind:this": use(this.playlabel), class: "label" }, "Play")),
/* @__PURE__ */ h("div", null, /* @__PURE__ */ h("p", null, "Downloaded assets. Now you need to decrypt them. Find the game files directory for your copy of Celeste and upload ", /* @__PURE__ */ h("code", null, "Content/Dialog/english.txt"), "."), /* @__PURE__ */ h("button", { class: "action primary", "on:click": decrypt }, /* @__PURE__ */ h("span", { class: "material-symbols-rounded" }, "encrypted"), /* @__PURE__ */ h("span", { class: "label" }, "Decrypt")), /* @__PURE__ */ h("p", null, use(this.decrypterror)))
)
))));
}
var app;
async function loadfrontend() {
app = h(App).$;
document.body.appendChild(app.root);
}
if (localStorage["vfs_populated"] !== "true") {
document.body.appendChild(h(IntroSplash));
} else {
loadfrontend();
}
export {
app,
store
};
/*! Bundled license information:
jszip/dist/jszip.min.js:
(*!
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/main/LICENSE
*)
*/
import { dotnet } from './_framework/dotnet.js';
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.js
var require_jszip_min = __commonJS({
"node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.js"(exports, module) {
!function(e) {
if ("object" == typeof exports && "undefined" != typeof module) module.exports = e();
else if ("function" == typeof define && define.amd) define([], e);
else {
("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).JSZip = e();
}
}(function() {
return function s(a, o, h2) {
function u(r, e2) {
if (!o[r]) {
if (!a[r]) {
var t = "function" == typeof __require && __require;
if (!e2 && t) return t(r, true);
if (l) return l(r, true);
var n = new Error("Cannot find module '" + r + "'");
throw n.code = "MODULE_NOT_FOUND", n;
}
var i = o[r] = { exports: {} };
a[r][0].call(i.exports, function(e3) {
var t2 = a[r][1][e3];
return u(t2 || e3);
}, i, i.exports, s, a, o, h2);
}
return o[r].exports;
}
for (var l = "function" == typeof __require && __require, e = 0; e < h2.length; e++) u(h2[e]);
return u;
}({ 1: [function(e, t, r) {
"use strict";
var d = e("./utils"), c = e("./support"), p = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
r.encode = function(e2) {
for (var t2, r2, n, i, s, a, o, h2 = [], u = 0, l = e2.length, f = l, c2 = "string" !== d.getTypeOf(e2); u < e2.length; ) f = l - u, n = c2 ? (t2 = e2[u++], r2 = u < l ? e2[u++] : 0, u < l ? e2[u++] : 0) : (t2 = e2.charCodeAt(u++), r2 = u < l ? e2.charCodeAt(u++) : 0, u < l ? e2.charCodeAt(u++) : 0), i = t2 >> 2, s = (3 & t2) << 4 | r2 >> 4, a = 1 < f ? (15 & r2) << 2 | n >> 6 : 64, o = 2 < f ? 63 & n : 64, h2.push(p.charAt(i) + p.charAt(s) + p.charAt(a) + p.charAt(o));
return h2.join("");
}, r.decode = function(e2) {
var t2, r2, n, i, s, a, o = 0, h2 = 0, u = "data:";
if (e2.substr(0, u.length) === u) throw new Error("Invalid base64 input, it looks like a data url.");
var l, f = 3 * (e2 = e2.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4;
if (e2.charAt(e2.length - 1) === p.charAt(64) && f--, e2.charAt(e2.length - 2) === p.charAt(64) && f--, f % 1 != 0) throw new Error("Invalid base64 input, bad content length.");
for (l = c.uint8array ? new Uint8Array(0 | f) : new Array(0 | f); o < e2.length; ) t2 = p.indexOf(e2.charAt(o++)) << 2 | (i = p.indexOf(e2.charAt(o++))) >> 4, r2 = (15 & i) << 4 | (s = p.indexOf(e2.charAt(o++))) >> 2, n = (3 & s) << 6 | (a = p.indexOf(e2.charAt(o++))), l[h2++] = t2, 64 !== s && (l[h2++] = r2), 64 !== a && (l[h2++] = n);
return l;
};
}, { "./support": 30, "./utils": 32 }], 2: [function(e, t, r) {
"use strict";
var n = e("./external"), i = e("./stream/DataWorker"), s = e("./stream/Crc32Probe"), a = e("./stream/DataLengthProbe");
function o(e2, t2, r2, n2, i2) {
this.compressedSize = e2, this.uncompressedSize = t2, this.crc32 = r2, this.compression = n2, this.compressedContent = i2;
}
o.prototype = { getContentWorker: function() {
var e2 = new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")), t2 = this;
return e2.on("end", function() {
if (this.streamInfo.data_length !== t2.uncompressedSize) throw new Error("Bug : uncompressed data size mismatch");
}), e2;
}, getCompressedWorker: function() {
return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression);
} }, o.createWorkerFrom = function(e2, t2, r2) {
return e2.pipe(new s()).pipe(new a("uncompressedSize")).pipe(t2.compressWorker(r2)).pipe(new a("compressedSize")).withStreamInfo("compression", t2);
}, t.exports = o;
}, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(e, t, r) {
"use strict";
var n = e("./stream/GenericWorker");
r.STORE = { magic: "\0\0", compressWorker: function() {
return new n("STORE compression");
}, uncompressWorker: function() {
return new n("STORE decompression");
Xet Storage Details
- Size:
- 236 kB
- Xet hash:
- 2fea931ddbee3301e34b516e48991aa7b37e22dc5544119481ad8b8e95d20a3d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.