import { dV as commonjsGlobal, bA as getDefaultExportFromCjs } from "./.pnpm.BW3P1y8f.js";
function commonjsRequire(path) {
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var exceljs_min = { exports: {} };
/*! ExcelJS 19-10-2023 */
var hasRequiredExceljs_min;
function requireExceljs_min() {
if (hasRequiredExceljs_min) return exceljs_min.exports;
hasRequiredExceljs_min = 1;
(function(module, exports$1) {
!(function(e) {
module.exports = e();
})((function() {
return (function e(t, r, n) {
function i(o2, a) {
if (!r[o2]) {
if (!t[o2]) {
var l = "function" == typeof commonjsRequire && commonjsRequire;
if (!a && l) return l(o2, true);
if (s) return s(o2, true);
var c = new Error("Cannot find module '" + o2 + "'");
throw c.code = "MODULE_NOT_FOUND", c;
}
var u = r[o2] = { exports: {} };
t[o2][0].call(u.exports, (function(e2) {
return i(t[o2][1][e2] || e2);
}), u, u.exports, e, t, r, n);
}
return r[o2].exports;
}
for (var s = "function" == typeof commonjsRequire && commonjsRequire, o = 0; o < n.length; o++) i(n[o]);
return i;
})({ 1: [function(e, t, r) {
const n = e("fs"), i = e("fast-csv"), s = e("dayjs/plugin/customParseFormat"), o = e("dayjs/plugin/utc"), a = e("dayjs").extend(s).extend(o), l = e("../utils/stream-buf"), { fs: { exists: c } } = e("../utils/utils"), u = { true: true, false: false, "#N/A": { error: "#N/A" }, "#REF!": { error: "#REF!" }, "#NAME?": { error: "#NAME?" }, "#DIV/0!": { error: "#DIV/0!" }, "#NULL!": { error: "#NULL!" }, "#VALUE!": { error: "#VALUE!" }, "#NUM!": { error: "#NUM!" } };
t.exports = class {
constructor(e2) {
this.workbook = e2, this.worksheet = null;
}
async readFile(e2, t2) {
if (t2 = t2 || {}, !await c(e2)) throw new Error("File not found: " + e2);
const r2 = n.createReadStream(e2), i2 = await this.read(r2, t2);
return r2.close(), i2;
}
read(e2, t2) {
return t2 = t2 || {}, new Promise((r2, n2) => {
const s2 = this.workbook.addWorksheet(t2.sheetName), o2 = t2.dateFormats || ["YYYY-MM-DD[T]HH:mm:ssZ", "YYYY-MM-DD[T]HH:mm:ss", "MM-DD-YYYY", "YYYY-MM-DD"], l2 = t2.map || function(e3) {
if ("" === e3) return null;
const t3 = Number(e3);
if (!Number.isNaN(t3) && t3 !== 1 / 0) return t3;
const r3 = o2.reduce((t4, r4) => {
if (t4) return t4;
const n4 = a(e3, r4, true);
return n4.isValid() ? n4 : null;
}, null);
if (r3) return new Date(r3.valueOf());
const n3 = u[e3];
return void 0 !== n3 ? n3 : e3;
}, c2 = i.parse(t2.parserOptions).on("data", (e3) => {
s2.addRow(e3.map(l2));
}).on("end", () => {
c2.emit("worksheet", s2);
});
c2.on("worksheet", r2).on("error", n2), e2.pipe(c2);
});
}
createInputStream() {
throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md");
}
write(e2, t2) {
return new Promise((r2, n2) => {
t2 = t2 || {};
const s2 = this.workbook.getWorksheet(t2.sheetName || t2.sheetId), o2 = i.format(t2.formatterOptions);
e2.on("finish", () => {
r2();
}), o2.on("error", n2), o2.pipe(e2);
const { dateFormat: l2, dateUTC: c2 } = t2, u2 = t2.map || ((e3) => {
if (e3) {
if (e3.text || e3.hyperlink) return e3.hyperlink || e3.text || "";
if (e3.formula || e3.result) return e3.result || "";
if (e3 instanceof Date) return l2 ? c2 ? a.utc(e3).format(l2) : a(e3).format(l2) : c2 ? a.utc(e3).format() : a(e3).format();
if (e3.error) return e3.error;
if ("object" == typeof e3) return JSON.stringify(e3);
}
return e3;
}), h = void 0 === t2.includeEmptyRows || t2.includeEmptyRows;
let f = 1;
s2 && s2.eachRow((e3, t3) => {
if (h) for (; f++ < t3 - 1; ) o2.write([]);
const { values: r3 } = e3;
r3.shift(), o2.write(r3.map(u2)), f = t3;
}), o2.end();
});
}
writeFile(e2, t2) {
const r2 = { encoding: (t2 = t2 || {}).encoding || "utf8" }, i2 = n.createWriteStream(e2, r2);
return this.write(i2, t2);
}
async writeBuffer(e2) {
const t2 = new l();
return await this.write(t2, e2), t2.read();
}
};
}, { "../utils/stream-buf": 24, "../utils/utils": 27, dayjs: 391, "dayjs/plugin/customParseFormat": 392, "dayjs/plugin/utc": 393, "fast-csv": 424, fs: 216 }], 2: [function(e, t, r) {
const n = e("../utils/col-cache");
class i {
constructor(e2, t2) {
let r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
if (this.worksheet = e2, t2) if ("string" == typeof t2) {
const e3 = n.decodeAddress(t2);
this.nativeCol = e3.col + r2, this.nativeColOff = 0, this.nativeRow = e3.row + r2, this.nativeRowOff = 0;
} else void 0 !== t2.nativeCol ? (this.nativeCol = t2.nativeCol || 0, this.nativeColOff = t2.nativeColOff || 0, this.nativeRow = t2.nativeRow || 0, this.nativeRowOff = t2.nativeRowOff || 0) : void 0 !== t2.col ? (this.col = t2.col + r2, this.row = t2.row + r2) : (this.nativeCol = 0, this.nativeColOff = 0, this.nativeRow = 0, this.nativeRowOff = 0);
else this.nativeCol = 0, this.nativeColOff = 0, this.nativeRow = 0, this.nativeRowOff = 0;
}
static asInstance(e2) {
return e2 instanceof i || null == e2 ? e2 : new i(e2);
}
get col() {
return this.nativeCol + Math.min(this.colWidth - 1, this.nativeColOff) / this.colWidth;
}
set col(e2) {
this.nativeCol = Math.floor(e2), this.nativeColOff = Math.floor((e2 - this.nativeCol) * this.colWidth);
}
get row() {
return this.nativeRow + Math.min(this.rowHeight - 1, this.nativeRowOff) / this.rowHeight;
}
set row(e2) {
this.nativeRow = Math.floor(e2), this.nativeRowOff = Math.floor((e2 - this.nativeRow) * this.rowHeight);
}
get colWidth() {
return this.worksheet && this.worksheet.getColumn(this.nativeCol + 1) && this.worksheet.getColumn(this.nativeCol + 1).isCustomWidth ? Math.floor(1e4 * this.worksheet.getColumn(this.nativeCol + 1).width) : 64e4;
}
get rowHeight() {
return this.worksheet && this.worksheet.getRow(this.nativeRow + 1) && this.worksheet.getRow(this.nativeRow + 1).height ? Math.floor(1e4 * this.worksheet.getRow(this.nativeRow + 1).height) : 18e4;
}
get model() {
return { nativeCol: this.nativeCol, nativeColOff: this.nativeColOff, nativeRow: this.nativeRow, nativeRowOff: this.nativeRowOff };
}
set model(e2) {
this.nativeCol = e2.nativeCol, this.nativeColOff = e2.nativeColOff, this.nativeRow = e2.nativeRow, this.nativeRowOff = e2.nativeRowOff;
}
}
t.exports = i;
}, { "../utils/col-cache": 19 }], 3: [function(e, t, r) {
const n = e("../utils/col-cache"), i = e("../utils/under-dash"), s = e("./enums"), { slideFormula: o } = e("../utils/shared-formula"), a = e("./note");
class l {
constructor(e2, t2, r2) {
if (!e2 || !t2) throw new Error("A Cell needs a Row");
this._row = e2, this._column = t2, n.validateAddress(r2), this._address = r2, this._value = c.create(l.Types.Null, this), this.style = this._mergeStyle(e2.style, t2.style, {}), this._mergeCount = 0;
}
get worksheet() {
return this._row.worksheet;
}
get workbook() {
return this._row.worksheet.workbook;
}
destroy() {
delete this.style, delete this._value, delete this._row, delete this._column, delete this._address;
}
get numFmt() {
return this.style.numFmt;
}
set numFmt(e2) {
this.style.numFmt = e2;
}
get font() {
return this.style.font;
}
set font(e2) {
this.style.font = e2;
}
get alignment() {
return this.style.alignment;
}
set alignment(e2) {
this.style.alignment = e2;
}
get border() {
return this.style.border;
}
set border(e2) {
this.style.border = e2;
}
get fill() {
return this.style.fill;
}
set fill(e2) {
this.style.fill = e2;
}
get protection() {
return this.style.protection;
}
set protection(e2) {
this.style.protection = e2;
}
_mergeStyle(e2, t2, r2) {
const n2 = e2 && e2.numFmt || t2 && t2.numFmt;
n2 && (r2.numFmt = n2);
const i2 = e2 && e2.font || t2 && t2.font;
i2 && (r2.font = i2);
const s2 = e2 && e2.alignment || t2 && t2.alignment;
s2 && (r2.alignment = s2);
const o2 = e2 && e2.border || t2 && t2.border;
o2 && (r2.border = o2);
const a2 = e2 && e2.fill || t2 && t2.fill;
a2 && (r2.fill = a2);
const l2 = e2 && e2.protection || t2 && t2.protection;
return l2 && (r2.protection = l2), r2;
}
get address() {
return this._address;
}
get row() {
return this._row.number;
}
get col() {
return this._column.number;
}
get $col$row() {
return `$${this._column.letter}$${this.row}`;
}
get type() {
return this._value.type;
}
get effectiveType() {
return this._value.effectiveType;
}
toCsvString() {
return this._value.toCsvString();
}
addMergeRef() {
this._mergeCount++;
}
releaseMergeRef() {
this._mergeCount--;
}
get isMerged() {
return this._mergeCount > 0 || this.type === l.Types.Merge;
}
merge(e2, t2) {
this._value.release(), this._value = c.create(l.Types.Merge, this, e2), t2 || (this.style = e2.style);
}
unmerge() {
this.type === l.Types.Merge && (this._value.release(), this._value = c.create(l.Types.Null, this), this.style = this._mergeStyle(this._row.style, this._column.style, {}));
}
isMergedTo(e2) {
return this._value.type === l.Types.Merge && this._value.isMergedTo(e2);
}
get master() {
return this.type === l.Types.Merge ? this._value.master : this;
}
get isHyperlink() {
return this._value.type === l.Types.Hyperlink;
}
get hyperlink() {
return this._value.hyperlink;
}
get value() {
return this._value.value;
}
set value(e2) {
this.type !== l.Types.Merge ? (this._value.release(), this._value = c.create(c.getType(e2), this, e2)) : this._value.master.value = e2;
}
get note() {
return this._comment && this._comment.note;
}
set note(e2) {
this._comment = new a(e2);
}
get text() {
return this._value.toString();
}
get html() {
return i.escapeHtml(this.text);
}
toString() {
return this.text;
}
_upgradeToHyperlink(e2) {
this.type === l.Types.String && (this._value = c.create(l.Types.Hyperlink, this, { text: this._value.value, hyperlink: e2 }));
}
get formula() {
return this._value.formula;
}
get result() {
return this._value.result;
}
get formulaType() {
return this._value.formulaType;
}
get fullAddress() {
const { worksheet: e2 } = this._row;
return { sheetName: e2.name, address: this.address, row: this.row, col: this.col };
}
get name() {
return this.names[0];
}
set name(e2) {
this.names = [e2];
}
get names() {
return this.workbook.definedNames.getNamesEx(this.fullAddress);
}
set names(e2) {
const { definedNames: t2 } = this.workbook;
t2.removeAllNames(this.fullAddress), e2.forEach((e3) => {
t2.addEx(this.fullAddress, e3);
});
}
addName(e2) {
this.workbook.definedNames.addEx(this.fullAddress, e2);
}
removeName(e2) {
this.workbook.definedNames.removeEx(this.fullAddress, e2);
}
removeAllNames() {
this.workbook.definedNames.removeAllNames(this.fullAddress);
}
get _dataValidations() {
return this.worksheet.dataValidations;
}
get dataValidation() {
return this._dataValidations.find(this.address);
}
set dataValidation(e2) {
this._dataValidations.add(this.address, e2);
}
get model() {
const { model: e2 } = this._value;
return e2.style = this.style, this._comment && (e2.comment = this._comment.model), e2;
}
set model(e2) {
if (this._value.release(), this._value = c.create(e2.type, this), this._value.model = e2, e2.comment) switch (e2.comment.type) {
case "note":
this._comment = a.fromModel(e2.comment);
}
e2.style ? this.style = e2.style : this.style = {};
}
}
l.Types = s.ValueType;
const c = { getType: (e2) => null == e2 ? l.Types.Null : e2 instanceof String || "string" == typeof e2 ? l.Types.String : "number" == typeof e2 ? l.Types.Number : "boolean" == typeof e2 ? l.Types.Boolean : e2 instanceof Date ? l.Types.Date : e2.text && e2.hyperlink ? l.Types.Hyperlink : e2.formula || e2.sharedFormula ? l.Types.Formula : e2.richText ? l.Types.RichText : e2.sharedString ? l.Types.SharedString : e2.error ? l.Types.Error : l.Types.JSON, types: [{ t: l.Types.Null, f: class {
constructor(e2) {
this.model = { address: e2.address, type: l.Types.Null };
}
get value() {
return null;
}
set value(e2) {
}
get type() {
return l.Types.Null;
}
get effectiveType() {
return l.Types.Null;
}
get address() {
return this.model.address;
}
set address(e2) {
this.model.address = e2;
}
toCsvString() {
return "";
}
release() {
}
toString() {
return "";
}
} }, { t: l.Types.Number, f: class {
constructor(e2, t2) {
this.model = { address: e2.address, type: l.Types.Number, value: t2 };
}
get value() {
return this.model.value;
}
set value(e2) {
this.model.value = e2;
}
get type() {
return l.Types.Number;
}
get effectiveType() {
return l.Types.Number;
}
get address() {
return this.model.address;
}
set address(e2) {
this.model.address = e2;
}
toCsvString() {
return this.model.value.toString();
}
release() {
}
toString() {
return this.model.value.toString();
}
} }, { t: l.Types.String, f: class {
constructor(e2, t2) {
this.model = { address: e2.address, type: l.Types.String, value: t2 };
}
get value() {
return this.model.value;
}
set value(e2) {
this.model.value = e2;
}
get type() {
return l.Types.String;
}
get effectiveType() {
return l.Types.String;
}
get address() {
return this.model.address;
}
set address(e2) {
this.model.address = e2;
}
toCsvString() {
return `"${this.model.value.replace(/"/g, '""')}"`;
}
release() {
}
toString() {
return this.model.value;
}
} }, { t: l.Types.Date, f: class {
constructor(e2, t2) {
this.model = { address: e2.address, type: l.Types.Date, value: t2 };
}
get value() {
return this.model.value;
}
set value(e2) {
this.model.value = e2;
}
get type() {
return l.Types.Date;
}
get effectiveType() {
return l.Types.Date;
}
get address() {
return this.model.address;
}
set address(e2) {
this.model.address = e2;
}
toCsvString() {
return this.model.value.toISOString();
}
release() {
}
toString() {
return this.model.value.toString();
}
} }, { t: l.Types.Hyperlink, f: class {
constructor(e2, t2) {
this.model = { address: e2.address, type: l.Types.Hyperlink, text: t2 ? t2.text : void 0, hyperlink: t2 ? t2.hyperlink : void 0 }, t2 && t2.tooltip && (this.model.tooltip = t2.tooltip);
}
get value() {
const e2 = { text: this.model.text, hyperlink: this.model.hyperlink };
return this.model.tooltip && (e2.tooltip = this.model.tooltip), e2;
}
set value(e2) {
this.model = { text: e2.text, hyperlink: e2.hyperlink }, e2.tooltip && (this.model.tooltip = e2.tooltip);
}
get text() {
return this.model.text;
}
set text(e2) {
this.model.text = e2;
}
get hyperlink() {
return this.model.hyperlink;
}
set hyperlink(e2) {
this.model.hyperlink = e2;
}
get type() {
return l.Types.Hyperlink;
}
get effectiveType() {
return l.Types.Hyperlink;
}
get address() {
return this.model.address;
}
set address(e2) {
this.model.address = e2;
}
toCsvString() {
return this.model.hyperlink;
}
release() {
}
toString() {
return this.model.text;
}
} }, { t: l.Types.Formula, f: class {
constructor(e2, t2) {
this.cell = e2, this.model = { address: e2.address, type: l.Types.Formula, shareType: t2 ? t2.shareType : void 0, ref: t2 ? t2.ref : void 0, formula: t2 ? t2.formula : void 0, sharedFormula: t2 ? t2.sharedFormula : void 0, result: t2 ? t2.result : void 0 };
}
_copyModel(e2) {
const t2 = {}, r2 = (r3) => {
const n2 = e2[r3];
n2 && (t2[r3] = n2);
};
return r2("formula"), r2("result"), r2("ref"), r2("shareType"), r2("sharedFormula"), t2;
}
get value() {
return this._copyModel(this.model);
}
set value(e2) {
this.model = this._copyModel(e2);
}
validate(e2) {
switch (c.getType(e2)) {
case l.Types.Null:
case l.Types.String:
case l.Types.Number:
case l.Types.Date:
break;
case l.Types.Hyperlink:
case l.Types.Formula:
default:
throw new Error("Cannot process that type of result value");
}
}
get dependencies() {
return { ranges: this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g), cells: this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g, "").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g) };
}
get formula() {
return this.model.formula || this._getTranslatedFormula();
}
set formula(e2) {
this.model.formula = e2;
}
get formulaType() {
return this.model.formula ? s.FormulaType.Master : this.model.sharedFormula ? s.FormulaType.Shared : s.FormulaType.None;
}
get result() {
return this.model.result;
}
set result(e2) {
this.model.result = e2;
}
get type() {
return l.Types.Formula;
}
get effectiveType() {
const e2 = this.model.result;
return null == e2 ? s.ValueType.Null : e2 instanceof String || "string" == typeof e2 ? s.ValueType.String : "number" == typeof e2 ? s.ValueType.Number : e2 instanceof Date ? s.ValueType.Date : e2.text && e2.hyperlink ? s.ValueType.Hyperlink : e2.formula ? s.ValueType.Formula : s.ValueType.Null;
}
get address() {
return this.model.address;
}
set address(e2) {
this.model.address = e2;
}
_getTranslatedFormula() {
if (!this._translatedFormula && this.model.sharedFormula) {
const { worksheet: e2 } = this.cell, t2 = e2.findCell(this.model.sharedFormula);
this._translatedFormula = t2 && o(t2.formula, t2.address, this.model.address);
}
return this._translatedFormula;
}
toCsvString() {
return "" + (this.model.result || "");
}
release() {
}
toString() {
return this.model.result ? this.model.result.toString() : "";
}
} }, { t: l.Types.Merge, f: class {
constructor(e2, t2) {
this.model = { address: e2.address, type: l.Types.Merge, master: t2 ? t2.address : void 0 }, this._master = t2, t2 && t2.addMergeRef();
}
get value() {
return this._master.value;
}
set value(e2) {
e2 instanceof l ? (this._master && this._master.releaseMergeRef(), e2.addMergeRef(), this._master = e2) : this._master.value = e2;
}
isMergedTo(e2) {
return e2 === this._master;
}
get master() {
return this._master;
}
get type() {
return l.Types.Merge;
}
get effectiveType() {
return this._master.effectiveType;
}
get address() {
return this.model.address;
}
set address(e2) {
this.model.address = e2;
}
toCsvString() {
return "";
}
release() {
this._master.releaseMergeRef();
}
toString() {
return this.value.toString();
}
} }, { t: l.Types.JSON, f: class {
constructor(e2, t2) {
this.model = { address: e2.address, type: l.Types.String, value: JSON.stringify(t2), rawValue: t2 };
}
get value() {
return this.model.rawValue;
}
set value(e2) {
this.model.rawValue = e2, this.model.value = JSON.stringify(e2);
}
get type() {
return l.Types.String;
}
get effectiveType() {
return l.Types.String;
}
get address() {
return this.model.address;
}
set address(e2) {
this.model.address = e2;
}
toCsvString() {
return this.model.value;
}
release() {
}
toString() {
return this.model.value;
}
} }, { t: l.Types.SharedString, f: class {
constructor(e2, t2) {
this.model = { address: e2.address, type: l.Types.SharedString, value: t2 };
}
get value() {
return this.model.value;
}
set value(e2) {
this.model.value = e2;
}
get type() {
return l.Types.SharedString;
}
get effectiveType() {
return l.Types.SharedString;
}
get address() {
return this.model.address;
}
set address(e2) {
this.model.address = e2;
}
toCsvString() {
return this.model.value.toString();
}
release() {
}
toString() {
return this.model.value.toString();
}
} }, { t: l.Types.RichText, f: class {
constructor(e2, t2) {
this.model = { address: e2.address, type: l.Types.String, value: t2 };
}
get value() {
return this.model.value;
}
set value(e2) {
this.model.value = e2;
}
toString() {
return this.model.value.richText.map((e2) => e2.text).join("");
}
get type() {
return l.Types.RichText;
}
get effectiveType() {
return l.Types.RichText;
}
get address() {
return this.model.address;
}
set address(e2) {
this.model.address = e2;
}
toCsvString() {
return `"${this.text.replace(/"/g, '""')}"`;
}
release() {
}
} }, { t: l.Types.Boolean, f: class {
constructor(e2, t2) {
this.model = { address: e2.address, type: l.Types.Boolean, value: t2 };
}
get value() {
return this.model.value;
}
set value(e2) {
this.model.value = e2;
}
get type() {
return l.Types.Boolean;
}
get effectiveType() {
return l.Types.Boolean;
}
get address() {
return this.model.address;
}
set address(e2) {
this.model.address = e2;
}
toCsvString() {
return this.model.value ? 1 : 0;
}
release() {
}
toString() {
return this.model.value.toString();
}
} }, { t: l.Types.Error, f: class {
constructor(e2, t2) {
this.model = { address: e2.address, type: l.Types.Error, value: t2 };
}
get value() {
return this.model.value;
}
set value(e2) {
this.model.value = e2;
}
get type() {
return l.Types.Error;
}
get effectiveType() {
return l.Types.Error;
}
get address() {
return this.model.address;
}
set address(e2) {
this.model.address = e2;
}
toCsvString() {
return this.toString();
}
release() {
}
toString() {
return this.model.value.error.toString();
}
} }].reduce((e2, t2) => (e2[t2.t] = t2.f, e2), []), create(e2, t2, r2) {
const n2 = this.types[e2];
if (!n2) throw new Error("Could not create Value of type " + e2);
return new n2(t2, r2);
} };
t.exports = l;
}, { "../utils/col-cache": 19, "../utils/shared-formula": 23, "../utils/under-dash": 26, "./enums": 7, "./note": 9 }], 4: [function(e, t, r) {
const n = e("../utils/under-dash"), i = e("./enums"), s = e("../utils/col-cache");
class o {
constructor(e2, t2, r2) {
this._worksheet = e2, this._number = t2, false !== r2 && (this.defn = r2);
}
get number() {
return this._number;
}
get worksheet() {
return this._worksheet;
}
get letter() {
return s.n2l(this._number);
}
get isCustomWidth() {
return void 0 !== this.width && 9 !== this.width;
}
get defn() {
return { header: this._header, key: this.key, width: this.width, style: this.style, hidden: this.hidden, outlineLevel: this.outlineLevel };
}
set defn(e2) {
e2 ? (this.key = e2.key, this.width = void 0 !== e2.width ? e2.width : 9, this.outlineLevel = e2.outlineLevel, e2.style ? this.style = e2.style : this.style = {}, this.header = e2.header, this._hidden = !!e2.hidden) : (delete this._header, delete this._key, delete this.width, this.style = {}, this.outlineLevel = 0);
}
get headers() {
return this._header && this._header instanceof Array ? this._header : [this._header];
}
get header() {
return this._header;
}
set header(e2) {
void 0 !== e2 ? (this._header = e2, this.headers.forEach((e3, t2) => {
this._worksheet.getCell(t2 + 1, this.number).value = e3;
})) : this._header = void 0;
}
get key() {
return this._key;
}
set key(e2) {
(this._key && this._worksheet.getColumnKey(this._key)) === this && this._worksheet.deleteColumnKey(this._key), this._key = e2, e2 && this._worksheet.setColumnKey(this._key, this);
}
get hidden() {
return !!this._hidden;
}
set hidden(e2) {
this._hidden = e2;
}
get outlineLevel() {
return this._outlineLevel || 0;
}
set outlineLevel(e2) {
this._outlineLevel = e2;
}
get collapsed() {
return !!(this._outlineLevel && this._outlineLevel >= this._worksheet.properties.outlineLevelCol);
}
toString() {
return JSON.stringify({ key: this.key, width: this.width, headers: this.headers.length ? this.headers : void 0 });
}
equivalentTo(e2) {
return this.width === e2.width && this.hidden === e2.hidden && this.outlineLevel === e2.outlineLevel && n.isEqual(this.style, e2.style);
}
get isDefault() {
if (this.isCustomWidth) return false;
if (this.hidden) return false;
if (this.outlineLevel) return false;
const e2 = this.style;
return !e2 || !(e2.font || e2.numFmt || e2.alignment || e2.border || e2.fill || e2.protection);
}
get headerCount() {
return this.headers.length;
}
eachCell(e2, t2) {
const r2 = this.number;
t2 || (t2 = e2, e2 = null), this._worksheet.eachRow(e2, (e3, n2) => {
t2(e3.getCell(r2), n2);
});
}
get values() {
const e2 = [];
return this.eachCell((t2, r2) => {
t2 && t2.type !== i.ValueType.Null && (e2[r2] = t2.value);
}), e2;
}
set values(e2) {
if (!e2) return;
const t2 = this.number;
let r2 = 0;
e2.hasOwnProperty("0") && (r2 = 1), e2.forEach((e3, n2) => {
this._worksheet.getCell(n2 + r2, t2).value = e3;
});
}
_applyStyle(e2, t2) {
return this.style[e2] = t2, this.eachCell((r2) => {
r2[e2] = t2;
}), t2;
}
get numFmt() {
return this.style.numFmt;
}
set numFmt(e2) {
this._applyStyle("numFmt", e2);
}
get font() {
return this.style.font;
}
set font(e2) {
this._applyStyle("font", e2);
}
get alignment() {
return this.style.alignment;
}
set alignment(e2) {
this._applyStyle("alignment", e2);
}
get protection() {
return this.style.protection;
}
set protection(e2) {
this._applyStyle("protection", e2);
}
get border() {
return this.style.border;
}
set border(e2) {
this._applyStyle("border", e2);
}
get fill() {
return this.style.fill;
}
set fill(e2) {
this._applyStyle("fill", e2);
}
static toModel(e2) {
const t2 = [];
let r2 = null;
return e2 && e2.forEach((e3, n2) => {
e3.isDefault ? r2 && (r2 = null) : r2 && e3.equivalentTo(r2) ? r2.max = n2 + 1 : (r2 = { min: n2 + 1, max: n2 + 1, width: void 0 !== e3.width ? e3.width : 9, style: e3.style, isCustomWidth: e3.isCustomWidth, hidden: e3.hidden, outlineLevel: e3.outlineLevel, collapsed: e3.collapsed }, t2.push(r2));
}), t2.length ? t2 : void 0;
}
static fromModel(e2, t2) {
const r2 = [];
let n2 = 1, i2 = 0;
for (t2 = (t2 = t2 || []).sort((function(e3, t3) {
return e3.min - t3.min;
})); i2 < t2.length; ) {
const s2 = t2[i2++];
for (; n2 < s2.min; ) r2.push(new o(e2, n2++));
for (; n2 <= s2.max; ) r2.push(new o(e2, n2++, s2));
}
return r2.length ? r2 : null;
}
}
t.exports = o;
}, { "../utils/col-cache": 19, "../utils/under-dash": 26, "./enums": 7 }], 5: [function(e, t, r) {
t.exports = class {
constructor(e2) {
this.model = e2 || {};
}
add(e2, t2) {
return this.model[e2] = t2;
}
find(e2) {
return this.model[e2];
}
remove(e2) {
this.model[e2] = void 0;
}
};
}, {}], 6: [function(e, t, r) {
const n = e("../utils/under-dash"), i = e("../utils/col-cache"), s = e("../utils/cell-matrix"), o = e("./range"), a = /[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;
t.exports = class {
constructor() {
this.matrixMap = {};
}
getMatrix(e2) {
return this.matrixMap[e2] || (this.matrixMap[e2] = new s());
}
add(e2, t2) {
const r2 = i.decodeEx(e2);
this.addEx(r2, t2);
}
addEx(e2, t2) {
const r2 = this.getMatrix(t2);
if (e2.top) for (let t3 = e2.left; t3 <= e2.right; t3++) for (let n2 = e2.top; n2 <= e2.bottom; n2++) {
const s2 = { sheetName: e2.sheetName, address: i.n2l(t3) + n2, row: n2, col: t3 };
r2.addCellEx(s2);
}
else r2.addCellEx(e2);
}
remove(e2, t2) {
const r2 = i.decodeEx(e2);
this.removeEx(r2, t2);
}
removeEx(e2, t2) {
this.getMatrix(t2).removeCellEx(e2);
}
removeAllNames(e2) {
n.each(this.matrixMap, (t2) => {
t2.removeCellEx(e2);
});
}
forEach(e2) {
n.each(this.matrixMap, (t2, r2) => {
t2.forEach((t3) => {
e2(r2, t3);
});
});
}
getNames(e2) {
return this.getNamesEx(i.decodeEx(e2));
}
getNamesEx(e2) {
return n.map(this.matrixMap, (t2, r2) => t2.findCellEx(e2) && r2).filter(Boolean);
}
_explore(e2, t2) {
t2.mark = false;
const { sheetName: r2 } = t2, n2 = new o(t2.row, t2.col, t2.row, t2.col, r2);
let i2, s2;
function a2(i3, s3) {
const o2 = e2.findCellAt(r2, i3, t2.col);
return !(!o2 || !o2.mark) && (n2[s3] = i3, o2.mark = false, true);
}
for (s2 = t2.row - 1; a2(s2, "top"); s2--) ;
for (s2 = t2.row + 1; a2(s2, "bottom"); s2++) ;
function l(t3, i3) {
const o2 = [];
for (s2 = n2.top; s2 <= n2.bottom; s2++) {
const n3 = e2.findCellAt(r2, s2, t3);
if (!n3 || !n3.mark) return false;
o2.push(n3);
}
n2[i3] = t3;
for (let e3 = 0; e3 < o2.length; e3++) o2[e3].mark = false;
return true;
}
for (i2 = t2.col - 1; l(i2, "left"); i2--) ;
for (i2 = t2.col + 1; l(i2, "right"); i2++) ;
return n2;
}
getRanges(e2, t2) {
if (!(t2 = t2 || this.matrixMap[e2])) return { name: e2, ranges: [] };
t2.forEach((e3) => {
e3.mark = true;
});
return { name: e2, ranges: t2.map((e3) => e3.mark && this._explore(t2, e3)).filter(Boolean).map((e3) => e3.$shortRange) };
}
normaliseMatrix(e2, t2) {
e2.forEachInSheet(t2, (e3, t3, r2) => {
e3 && (e3.row === t3 && e3.col === r2 || (e3.row = t3, e3.col = r2, e3.address = i.n2l(r2) + t3));
});
}
spliceRows(e2, t2, r2, i2) {
n.each(this.matrixMap, (n2) => {
n2.spliceRows(e2, t2, r2, i2), this.normaliseMatrix(n2, e2);
});
}
spliceColumns(e2, t2, r2, i2) {
n.each(this.matrixMap, (n2) => {
n2.spliceColumns(e2, t2, r2, i2), this.normaliseMatrix(n2, e2);
});
}
get model() {
return n.map(this.matrixMap, (e2, t2) => this.getRanges(t2, e2)).filter((e2) => e2.ranges.length);
}
set model(e2) {
const t2 = this.matrixMap = {};
e2.forEach((e3) => {
const r2 = t2[e3.name] = new s();
e3.ranges.forEach((e4) => {
a.test(e4.split("!").pop() || "") && r2.addCell(e4);
});
});
}
};
}, { "../utils/cell-matrix": 18, "../utils/col-cache": 19, "../utils/under-dash": 26, "./range": 10 }], 7: [function(e, t, r) {
t.exports = { ValueType: { Null: 0, Merge: 1, Number: 2, String: 3, Date: 4, Hyperlink: 5, Formula: 6, SharedString: 7, RichText: 8, Boolean: 9, Error: 10 }, FormulaType: { None: 0, Master: 1, Shared: 2 }, RelationshipType: { None: 0, OfficeDocument: 1, Worksheet: 2, CalcChain: 3, SharedStrings: 4, Styles: 5, Theme: 6, Hyperlink: 7 }, DocumentType: { Xlsx: 1 }, ReadingOrder: { LeftToRight: 1, RightToLeft: 2 }, ErrorValue: { NotApplicable: "#N/A", Ref: "#REF!", Name: "#NAME?", DivZero: "#DIV/0!", Null: "#NULL!", Value: "#VALUE!", Num: "#NUM!" } };
}, {}], 8: [function(e, t, r) {
const n = e("../utils/col-cache"), i = e("./anchor");
t.exports = class {
constructor(e2, t2) {
this.worksheet = e2, this.model = t2;
}
get model() {
switch (this.type) {
case "background":
return { type: this.type, imageId: this.imageId };
case "image":
return { type: this.type, imageId: this.imageId, hyperlinks: this.range.hyperlinks, range: { tl: this.range.tl.model, br: this.range.br && this.range.br.model, ext: this.range.ext, editAs: this.range.editAs } };
default:
throw new Error("Invalid Image Type");
}
}
set model(e2) {
let { type: t2, imageId: r2, range: s, hyperlinks: o } = e2;
if (this.type = t2, this.imageId = r2, "image" === t2) if ("string" == typeof s) {
const e3 = n.decode(s);
this.range = { tl: new i(this.worksheet, { col: e3.left, row: e3.top }, -1), br: new i(this.worksheet, { col: e3.right, row: e3.bottom }, 0), editAs: "oneCell" };
} else this.range = { tl: new i(this.worksheet, s.tl, 0), br: s.br && new i(this.worksheet, s.br, 0), ext: s.ext, editAs: s.editAs, hyperlinks: o || s.hyperlinks };
}
};
}, { "../utils/col-cache": 19, "./anchor": 2 }], 9: [function(e, t, r) {
const n = e("../utils/under-dash");
class i {
constructor(e2) {
this.note = e2;
}
get model() {
let e2 = null;
switch (typeof this.note) {
case "string":
e2 = { type: "note", note: { texts: [{ text: this.note }] } };
break;
default:
e2 = { type: "note", note: this.note };
}
return n.deepMerge({}, i.DEFAULT_CONFIGS, e2);
}
set model(e2) {
const { note: t2 } = e2, { texts: r2 } = t2;
1 === r2.length && 1 === Object.keys(r2[0]).length ? this.note = r2[0].text : this.note = t2;
}
static fromModel(e2) {
const t2 = new i();
return t2.model = e2, t2;
}
}
i.DEFAULT_CONFIGS = { note: { margins: { insetmode: "auto", inset: [0.13, 0.13, 0.25, 0.25] }, protection: { locked: "True", lockText: "True" }, editAs: "absolute" } }, t.exports = i;
}, { "../utils/under-dash": 26 }], 10: [function(e, t, r) {
const n = e("../utils/col-cache");
class i {
constructor() {
this.decode(arguments);
}
setTLBR(e2, t2, r2, i2, s) {
if (arguments.length < 4) {
const i3 = n.decodeAddress(e2), o = n.decodeAddress(t2);
this.model = { top: Math.min(i3.row, o.row), left: Math.min(i3.col, o.col), bottom: Math.max(i3.row, o.row), right: Math.max(i3.col, o.col), sheetName: r2 }, this.setTLBR(i3.row, i3.col, o.row, o.col, s);
} else this.model = { top: Math.min(e2, r2), left: Math.min(t2, i2), bottom: Math.max(e2, r2), right: Math.max(t2, i2), sheetName: s };
}
decode(e2) {
switch (e2.length) {
case 5:
this.setTLBR(e2[0], e2[1], e2[2], e2[3], e2[4]);
break;
case 4:
this.setTLBR(e2[0], e2[1], e2[2], e2[3]);
break;
case 3:
this.setTLBR(e2[0], e2[1], e2[2]);
break;
case 2:
this.setTLBR(e2[0], e2[1]);
break;
case 1: {
const t2 = e2[0];
if (t2 instanceof i) this.model = { top: t2.model.top, left: t2.model.left, bottom: t2.model.bottom, right: t2.model.right, sheetName: t2.sheetName };
else if (t2 instanceof Array) this.decode(t2);
else if (t2.top && t2.left && t2.bottom && t2.right) this.model = { top: t2.top, left: t2.left, bottom: t2.bottom, right: t2.right, sheetName: t2.sheetName };
else {
const e3 = n.decodeEx(t2);
e3.top ? this.model = { top: e3.top, left: e3.left, bottom: e3.bottom, right: e3.right, sheetName: e3.sheetName } : this.model = { top: e3.row, left: e3.col, bottom: e3.row, right: e3.col, sheetName: e3.sheetName };
}
break;
}
case 0:
this.model = { top: 0, left: 0, bottom: 0, right: 0 };
break;
default:
throw new Error("Invalid number of arguments to _getDimensions() - " + e2.length);
}
}
get top() {
return this.model.top || 1;
}
set top(e2) {
this.model.top = e2;
}
get left() {
return this.model.left || 1;
}
set left(e2) {
this.model.left = e2;
}
get bottom() {
return this.model.bottom || 1;
}
set bottom(e2) {
this.model.bottom = e2;
}
get right() {
return this.model.right || 1;
}
set right(e2) {
this.model.right = e2;
}
get sheetName() {
return this.model.sheetName;
}
set sheetName(e2) {
this.model.sheetName = e2;
}
get _serialisedSheetName() {
const { sheetName: e2 } = this.model;
return e2 ? /^[a-zA-Z0-9]*$/.test(e2) ? e2 + "!" : `'${e2}'!` : "";
}
expand(e2, t2, r2, n2) {
(!this.model.top || e2 < this.top) && (this.top = e2), (!this.model.left || t2 < this.left) && (this.left = t2), (!this.model.bottom || r2 > this.bottom) && (this.bottom = r2), (!this.model.right || n2 > this.right) && (this.right = n2);
}
expandRow(e2) {
if (e2) {
const { dimensions: t2, number: r2 } = e2;
t2 && this.expand(r2, t2.min, r2, t2.max);
}
}
expandToAddress(e2) {
const t2 = n.decodeEx(e2);
this.expand(t2.row, t2.col, t2.row, t2.col);
}
get tl() {
return n.n2l(this.left) + this.top;
}
get $t$l() {
return `$${n.n2l(this.left)}$${this.top}`;
}
get br() {
return n.n2l(this.right) + this.bottom;
}
get $b$r() {
return `$${n.n2l(this.right)}$${this.bottom}`;
}
get range() {
return `${this._serialisedSheetName + this.tl}:${this.br}`;
}
get $range() {
return `${this._serialisedSheetName + this.$t$l}:${this.$b$r}`;
}
get shortRange() {
return this.count > 1 ? this.range : this._serialisedSheetName + this.tl;
}
get $shortRange() {
return this.count > 1 ? this.$range : this._serialisedSheetName + this.$t$l;
}
get count() {
return (1 + this.bottom - this.top) * (1 + this.right - this.left);
}
toString() {
return this.range;
}
intersects(e2) {
return (!e2.sheetName || !this.sheetName || e2.sheetName === this.sheetName) && (!(e2.bottom < this.top) && (!(e2.top > this.bottom) && (!(e2.right < this.left) && !(e2.left > this.right))));
}
contains(e2) {
const t2 = n.decodeEx(e2);
return this.containsEx(t2);
}
containsEx(e2) {
return (!e2.sheetName || !this.sheetName || e2.sheetName === this.sheetName) && (e2.row >= this.top && e2.row <= this.bottom && e2.col >= this.left && e2.col <= this.right);
}
forEachAddress(e2) {
for (let t2 = this.left; t2 <= this.right; t2++) for (let r2 = this.top; r2 <= this.bottom; r2++) e2(n.encodeAddress(r2, t2), r2, t2);
}
}
t.exports = i;
}, { "../utils/col-cache": 19 }], 11: [function(e, t, r) {
const n = e("../utils/under-dash"), i = e("./enums"), s = e("../utils/col-cache"), o = e("./cell");
t.exports = class {
constructor(e2, t2) {
this._worksheet = e2, this._number = t2, this._cells = [], this.style = {}, this.outlineLevel = 0;
}
get number() {
return this._number;
}
get worksheet() {
return this._worksheet;
}
commit() {
this._worksheet._commitRow(this);
}
destroy() {
delete this._worksheet, delete this._cells, delete this.style;
}
findCell(e2) {
return this._cells[e2 - 1];
}
getCellEx(e2) {
let t2 = this._cells[e2.col - 1];
if (!t2) {
const r2 = this._worksheet.getColumn(e2.col);
t2 = new o(this, r2, e2.address), this._cells[e2.col - 1] = t2;
}
return t2;
}
getCell(e2) {
if ("string" == typeof e2) {
const t2 = this._worksheet.getColumnKey(e2);
e2 = t2 ? t2.number : s.l2n(e2);
}
return this._cells[e2 - 1] || this.getCellEx({ address: s.encodeAddress(this._number, e2), row: this._number, col: e2 });
}
splice(e2, t2) {
const r2 = e2 + t2;
for (var n2 = arguments.length, i2 = new Array(n2 > 2 ? n2 - 2 : 0), s2 = 2; s2 < n2; s2++) i2[s2 - 2] = arguments[s2];
const o2 = i2.length - t2, a = this._cells.length;
let l, c, u;
if (o2 < 0) for (l = e2 + i2.length; l <= a; l++) u = this._cells[l - 1], c = this._cells[l - o2 - 1], c ? (u = this.getCell(l), u.value = c.value, u.style = c.style, u._comment = c._comment) : u && (u.value = null, u.style = {}, u._comment = void 0);
else if (o2 > 0) for (l = a; l >= r2; l--) c = this._cells[l - 1], c ? (u = this.getCell(l + o2), u.value = c.value, u.style = c.style, u._comment = c._comment) : this._cells[l + o2 - 1] = void 0;
for (l = 0; l < i2.length; l++) u = this.getCell(e2 + l), u.value = i2[l], u.style = {}, u._comment = void 0;
}
eachCell(e2, t2) {
if (t2 || (t2 = e2, e2 = null), e2 && e2.includeEmpty) {
const e3 = this._cells.length;
for (let r2 = 1; r2 <= e3; r2++) t2(this.getCell(r2), r2);
} else this._cells.forEach((e3, r2) => {
e3 && e3.type !== i.ValueType.Null && t2(e3, r2 + 1);
});
}
addPageBreak(e2, t2) {
const r2 = this._worksheet, n2 = Math.max(0, e2 - 1) || 0, i2 = Math.max(0, t2 - 1) || 16838, s2 = { id: this._number, max: i2, man: 1 };
n2 && (s2.min = n2), r2.rowBreaks.push(s2);
}
get values() {
const e2 = [];
return this._cells.forEach((t2) => {
t2 && t2.type !== i.ValueType.Null && (e2[t2.col] = t2.value);
}), e2;
}
set values(e2) {
if (this._cells = [], e2) if (e2 instanceof Array) {
let t2 = 0;
e2.hasOwnProperty("0") && (t2 = 1), e2.forEach((e3, r2) => {
void 0 !== e3 && (this.getCellEx({ address: s.encodeAddress(this._number, r2 + t2), row: this._number, col: r2 + t2 }).value = e3);
});
} else this._worksheet.eachColumnKey((t2, r2) => {
void 0 !== e2[r2] && (this.getCellEx({ address: s.encodeAddress(this._number, t2.number), row: this._number, col: t2.number }).value = e2[r2]);
});
}
get hasValues() {
return n.some(this._cells, (e2) => e2 && e2.type !== i.ValueType.Null);
}
get cellCount() {
return this._cells.length;
}
get actualCellCount() {
let e2 = 0;
return this.eachCell(() => {
e2++;
}), e2;
}
get dimensions() {
let e2 = 0, t2 = 0;
return this._cells.forEach((r2) => {
r2 && r2.type !== i.ValueType.Null && ((!e2 || e2 > r2.col) && (e2 = r2.col), t2 < r2.col && (t2 = r2.col));
}), e2 > 0 ? { min: e2, max: t2 } : null;
}
_applyStyle(e2, t2) {
return this.style[e2] = t2, this._cells.forEach((r2) => {
r2 && (r2[e2] = t2);
}), t2;
}
get numFmt() {
return this.style.numFmt;
}
set numFmt(e2) {
this._applyStyle("numFmt", e2);
}
get font() {
return this.style.font;
}
set font(e2) {
this._applyStyle("font", e2);
}
get alignment() {
return this.style.alignment;
}
set alignment(e2) {
this._applyStyle("alignment", e2);
}
get protection() {
return this.style.protection;
}
set protection(e2) {
this._applyStyle("protection", e2);
}
get border() {
return this.style.border;
}
set border(e2) {
this._applyStyle("border", e2);
}
get fill() {
return this.style.fill;
}
set fill(e2) {
this._applyStyle("fill", e2);
}
get hidden() {
return !!this._hidden;
}
set hidden(e2) {
this._hidden = e2;
}
get outlineLevel() {
return this._outlineLevel || 0;
}
set outlineLevel(e2) {
this._outlineLevel = e2;
}
get collapsed() {
return !!(this._outlineLevel && this._outlineLevel >= this._worksheet.properties.outlineLevelRow);
}
get model() {
const e2 = [];
let t2 = 0, r2 = 0;
return this._cells.forEach((n2) => {
if (n2) {
const i2 = n2.model;
i2 && ((!t2 || t2 > n2.col) && (t2 = n2.col), r2 < n2.col && (r2 = n2.col), e2.push(i2));
}
}), this.height || e2.length ? { cells: e2, number: this.number, min: t2, max: r2, height: this.height, style: this.style, hidden: this.hidden, outlineLevel: this.outlineLevel, collapsed: this.collapsed } : null;
}
set model(e2) {
if (e2.number !== this._number) throw new Error("Invalid row number in model");
let t2;
this._cells = [], e2.cells.forEach((e3) => {
switch (e3.type) {
case o.Types.Merge:
break;
default: {
let r2;
if (e3.address) r2 = s.decodeAddress(e3.address);
else if (t2) {
const { row: e4 } = t2, n2 = t2.col + 1;
r2 = { row: e4, col: n2, address: s.encodeAddress(e4, n2), $col$row: `$${s.n2l(n2)}$${e4}` };
}
t2 = r2;
this.getCellEx(r2).model = e3;
break;
}
}
}), e2.height ? this.height = e2.height : delete this.height, this.hidden = e2.hidden, this.outlineLevel = e2.outlineLevel || 0, this.style = e2.style && JSON.parse(JSON.stringify(e2.style)) || {};
}
};
}, { "../utils/col-cache": 19, "../utils/under-dash": 26, "./cell": 3, "./enums": 7 }], 12: [function(e, t, r) {
const n = e("../utils/col-cache");
class i {
constructor(e2, t2, r2) {
this.table = e2, this.column = t2, this.index = r2;
}
_set(e2, t2) {
this.table.cacheState(), this.column[e2] = t2;
}
get name() {
return this.column.name;
}
set name(e2) {
this._set("name", e2);
}
get filterButton() {
return this.column.filterButton;
}
set filterButton(e2) {
this.column.filterButton = e2;
}
get style() {
return this.column.style;
}
set style(e2) {
this.column.style = e2;
}
get totalsRowLabel() {
return this.column.totalsRowLabel;
}
set totalsRowLabel(e2) {
this._set("totalsRowLabel", e2);
}
get totalsRowFunction() {
return this.column.totalsRowFunction;
}
set totalsRowFunction(e2) {
this._set("totalsRowFunction", e2);
}
get totalsRowResult() {
return this.column.totalsRowResult;
}
set totalsRowResult(e2) {
this._set("totalsRowResult", e2);
}
get totalsRowFormula() {
return this.column.totalsRowFormula;
}
set totalsRowFormula(e2) {
this._set("totalsRowFormula", e2);
}
}
t.exports = class {
constructor(e2, t2) {
this.worksheet = e2, t2 && (this.table = t2, this.validate(), this.store());
}
getFormula(e2) {
switch (e2.totalsRowFunction) {
case "none":
return null;
case "average":
return `SUBTOTAL(101,${this.table.name}[${e2.name}])`;
case "countNums":
return `SUBTOTAL(102,${this.table.name}[${e2.name}])`;
case "count":
return `SUBTOTAL(103,${this.table.name}[${e2.name}])`;
case "max":
return `SUBTOTAL(104,${this.table.name}[${e2.name}])`;
case "min":
return `SUBTOTAL(105,${this.table.name}[${e2.name}])`;
case "stdDev":
return `SUBTOTAL(106,${this.table.name}[${e2.name}])`;
case "var":
return `SUBTOTAL(107,${this.table.name}[${e2.name}])`;
case "sum":
return `SUBTOTAL(109,${this.table.name}[${e2.name}])`;
case "custom":
return e2.totalsRowFormula;
default:
throw new Error("Invalid Totals Row Function: " + e2.totalsRowFunction);
}
}
get width() {
return this.table.columns.length;
}
get height() {
return this.table.rows.length;
}
get filterHeight() {
return this.height + (this.table.headerRow ? 1 : 0);
}
get tableHeight() {
return this.filterHeight + (this.table.totalsRow ? 1 : 0);
}
validate() {
const { table: e2 } = this, t2 = (e3, t3, r3) => {
void 0 === e3[t3] && (e3[t3] = r3);
};
t2(e2, "headerRow", true), t2(e2, "totalsRow", false), t2(e2, "style", {}), t2(e2.style, "theme", "TableStyleMedium2"), t2(e2.style, "showFirstColumn", false), t2(e2.style, "showLastColumn", false), t2(e2.style, "showRowStripes", false), t2(e2.style, "showColumnStripes", false);
const r2 = (e3, t3) => {
if (!e3) throw new Error(t3);
};
r2(e2.ref, "Table must have ref"), r2(e2.columns, "Table must have column definitions"), r2(e2.rows, "Table must have row definitions"), e2.tl = n.decodeAddress(e2.ref);
const { row: i2, col: s } = e2.tl;
r2(i2 > 0, "Table must be on valid row"), r2(s > 0, "Table must be on valid col");
const { width: o, filterHeight: a, tableHeight: l } = this;
e2.autoFilterRef = n.encode(i2, s, i2 + a - 1, s + o - 1), e2.tableRef = n.encode(i2, s, i2 + l - 1, s + o - 1), e2.columns.forEach((e3, n2) => {
r2(e3.name, `Column ${n2} must have a name`), 0 === n2 ? t2(e3, "totalsRowLabel", "Total") : (t2(e3, "totalsRowFunction", "none"), e3.totalsRowFormula = this.getFormula(e3));
});
}
store() {
const e2 = (e3, t3) => {
t3 && Object.keys(t3).forEach((r3) => {
e3[r3] = t3[r3];
});
}, { worksheet: t2, table: r2 } = this, { row: n2, col: i2 } = r2.tl;
let s = 0;
if (r2.headerRow) {
const o = t2.getRow(n2 + s++);
r2.columns.forEach((t3, r3) => {
const { style: n3, name: s2 } = t3, a = o.getCell(i2 + r3);
a.value = s2, e2(a, n3);
});
}
if (r2.rows.forEach((o) => {
const a = t2.getRow(n2 + s++);
o.forEach((t3, n3) => {
const s2 = a.getCell(i2 + n3);
s2.value = t3, e2(s2, r2.columns[n3].style);
});
}), r2.totalsRow) {
const o = t2.getRow(n2 + s++);
r2.columns.forEach((t3, r3) => {
const n3 = o.getCell(i2 + r3);
if (0 === r3) n3.value = t3.totalsRowLabel;
else {
const e3 = this.getFormula(t3);
n3.value = e3 ? { formula: t3.totalsRowFormula, result: t3.totalsRowResult } : null;
}
e2(n3, t3.style);
});
}
}
load(e2) {
const { table: t2 } = this, { row: r2, col: n2 } = t2.tl;
let i2 = 0;
if (t2.headerRow) {
const s = e2.getRow(r2 + i2++);
t2.columns.forEach((e3, t3) => {
s.getCell(n2 + t3).value = e3.name;
});
}
if (t2.rows.forEach((t3) => {
const s = e2.getRow(r2 + i2++);
t3.forEach((e3, t4) => {
s.getCell(n2 + t4).value = e3;
});
}), t2.totalsRow) {
const s = e2.getRow(r2 + i2++);
t2.columns.forEach((e3, t3) => {
const r3 = s.getCell(n2 + t3);
if (0 === t3) r3.value = e3.totalsRowLabel;
else {
this.getFormula(e3) && (r3.value = { formula: e3.totalsRowFormula, result: e3.totalsRowResult });
}
});
}
}
get model() {
return this.table;
}
set model(e2) {
this.table = e2;
}
cacheState() {
this._cache || (this._cache = { ref: this.ref, width: this.width, tableHeight: this.tableHeight });
}
commit() {
if (!this._cache) return;
this.validate();
const e2 = n.decodeAddress(this._cache.ref);
if (this.ref !== this._cache.ref) for (let t2 = 0; t2 < this._cache.tableHeight; t2++) {
const r2 = this.worksheet.getRow(e2.row + t2);
for (let t3 = 0; t3 < this._cache.width; t3++) {
r2.getCell(e2.col + t3).value = null;
}
}
else {
for (let t2 = this.tableHeight; t2 < this._cache.tableHeight; t2++) {
const r2 = this.worksheet.getRow(e2.row + t2);
for (let t3 = 0; t3 < this._cache.width; t3++) {
r2.getCell(e2.col + t3).value = null;
}
}
for (let t2 = 0; t2 < this.tableHeight; t2++) {
const r2 = this.worksheet.getRow(e2.row + t2);
for (let t3 = this.width; t3 < this._cache.width; t3++) {
r2.getCell(e2.col + t3).value = null;
}
}
}
this.store();
}
addRow(e2, t2) {
this.cacheState(), void 0 === t2 ? this.table.rows.push(e2) : this.table.rows.splice(t2, 0, e2);
}
removeRows(e2) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
this.cacheState(), this.table.rows.splice(e2, t2);
}
getColumn(e2) {
const t2 = this.table.columns[e2];
return new i(this, t2, e2);
}
addColumn(e2, t2, r2) {
this.cacheState(), void 0 === r2 ? (this.table.columns.push(e2), this.table.rows.forEach((e3, r3) => {
e3.push(t2[r3]);
})) : (this.table.columns.splice(r2, 0, e2), this.table.rows.forEach((e3, n2) => {
e3.splice(r2, 0, t2[n2]);
}));
}
removeColumns(e2) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
this.cacheState(), this.table.columns.splice(e2, t2), this.table.rows.forEach((r2) => {
r2.splice(e2, t2);
});
}
_assign(e2, t2, r2) {
this.cacheState(), e2[t2] = r2;
}
get ref() {
return this.table.ref;
}
set ref(e2) {
this._assign(this.table, "ref", e2);
}
get name() {
return this.table.name;
}
set name(e2) {
this.table.name = e2;
}
get displayName() {
return this.table.displyName || this.table.name;
}
set displayNamename(e2) {
this.table.displayName = e2;
}
get headerRow() {
return this.table.headerRow;
}
set headerRow(e2) {
this._assign(this.table, "headerRow", e2);
}
get totalsRow() {
return this.table.totalsRow;
}
set totalsRow(e2) {
this._assign(this.table, "totalsRow", e2);
}
get theme() {
return this.table.style.name;
}
set theme(e2) {
this.table.style.name = e2;
}
get showFirstColumn() {
return this.table.style.showFirstColumn;
}
set showFirstColumn(e2) {
this.table.style.showFirstColumn = e2;
}
get showLastColumn() {
return this.table.style.showLastColumn;
}
set showLastColumn(e2) {
this.table.style.showLastColumn = e2;
}
get showRowStripes() {
return this.table.style.showRowStripes;
}
set showRowStripes(e2) {
this.table.style.showRowStripes = e2;
}
get showColumnStripes() {
return this.table.style.showColumnStripes;
}
set showColumnStripes(e2) {
this.table.style.showColumnStripes = e2;
}
};
}, { "../utils/col-cache": 19 }], 13: [function(e, t, r) {
const n = e("./worksheet"), i = e("./defined-names"), s = e("../xlsx/xlsx"), o = e("../csv/csv");
t.exports = class {
constructor() {
this.category = "", this.company = "", this.created = /* @__PURE__ */ new Date(), this.description = "", this.keywords = "", this.manager = "", this.modified = this.created, this.properties = {}, this.calcProperties = {}, this._worksheets = [], this.subject = "", this.title = "", this.views = [], this.media = [], this._definedNames = new i();
}
get xlsx() {
return this._xlsx || (this._xlsx = new s(this)), this._xlsx;
}
get csv() {
return this._csv || (this._csv = new o(this)), this._csv;
}
get nextId() {
for (let e2 = 1; e2 < this._worksheets.length; e2++) if (!this._worksheets[e2]) return e2;
return this._worksheets.length || 1;
}
addWorksheet(e2, t2) {
const r2 = this.nextId;
t2 && ("string" == typeof t2 ? (console.trace('tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { argb: "rbg value" } }'), t2 = { properties: { tabColor: { argb: t2 } } }) : (t2.argb || t2.theme || t2.indexed) && (console.trace("tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { ... } }"), t2 = { properties: { tabColor: t2 } }));
const i2 = this._worksheets.reduce((e3, t3) => (t3 && t3.orderNo) > e3 ? t3.orderNo : e3, 0), s2 = Object.assign({}, t2, { id: r2, name: e2, orderNo: i2 + 1, workbook: this }), o2 = new n(s2);
return this._worksheets[r2] = o2, o2;
}
removeWorksheetEx(e2) {
delete this._worksheets[e2.id];
}
removeWorksheet(e2) {
const t2 = this.getWorksheet(e2);
t2 && t2.destroy();
}
getWorksheet(e2) {
return void 0 === e2 ? this._worksheets.find(Boolean) : "number" == typeof e2 ? this._worksheets[e2] : "string" == typeof e2 ? this._worksheets.find((t2) => t2 && t2.name === e2) : void 0;
}
get worksheets() {
return this._worksheets.slice(1).sort((e2, t2) => e2.orderNo - t2.orderNo).filter(Boolean);
}
eachSheet(e2) {
this.worksheets.forEach((t2) => {
e2(t2, t2.id);
});
}
get definedNames() {
return this._definedNames;
}
clearThemes() {
this._themes = void 0;
}
addImage(e2) {
const t2 = this.media.length;
return this.media.push(Object.assign({}, e2, { type: "image" })), t2;
}
getImage(e2) {
return this.media[e2];
}
get model() {
return { creator: this.creator || "Unknown", lastModifiedBy: this.lastModifiedBy || "Unknown", lastPrinted: this.lastPrinted, created: this.created, modified: this.modified, properties: this.properties, worksheets: this.worksheets.map((e2) => e2.model), sheets: this.worksheets.map((e2) => e2.model).filter(Boolean), definedNames: this._definedNames.model, views: this.views, company: this.company, manager: this.manager, title: this.title, subject: this.subject, keywords: this.keywords, category: this.category, description: this.description, language: this.language, revision: this.revision, contentStatus: this.contentStatus, themes: this._themes, media: this.media, calcProperties: this.calcProperties };
}
set model(e2) {
this.creator = e2.creator, this.lastModifiedBy = e2.lastModifiedBy, this.lastPrinted = e2.lastPrinted, this.created = e2.created, this.modified = e2.modified, this.company = e2.company, this.manager = e2.manager, this.title = e2.title, this.subject = e2.subject, this.keywords = e2.keywords, this.category = e2.category, this.description = e2.description, this.language = e2.language, this.revision = e2.revision, this.contentStatus = e2.contentStatus, this.properties = e2.properties, this.calcProperties = e2.calcProperties, this._worksheets = [], e2.worksheets.forEach((t2) => {
const { id: r2, name: i2, state: s2 } = t2, o2 = e2.sheets && e2.sheets.findIndex((e3) => e3.id === r2);
(this._worksheets[r2] = new n({ id: r2, name: i2, orderNo: o2, state: s2, workbook: this })).model = t2;
}), this._definedNames.model = e2.definedNames, this.views = e2.views, this._themes = e2.themes, this.media = e2.media || [];
}
};
}, { "../csv/csv": 1, "../xlsx/xlsx": 144, "./defined-names": 6, "./worksheet": 14 }], 14: [function(e, t, r) {
const n = e("../utils/under-dash"), i = e("../utils/col-cache"), s = e("./range"), o = e("./row"), a = e("./column"), l = e("./enums"), c = e("./image"), u = e("./table"), h = e("./data-validations"), f = e("../utils/encryptor"), { copyStyle: d } = e("../utils/copy-style");
t.exports = class {
constructor(e2) {
e2 = e2 || {}, this._workbook = e2.workbook, this.id = e2.id, this.orderNo = e2.orderNo, this.name = e2.name, this.state = e2.state || "visible", this._rows = [], this._columns = null, this._keys = {}, this._merges = {}, this.rowBreaks = [], this.properties = Object.assign({}, { defaultRowHeight: 15, dyDescent: 55, outlineLevelCol: 0, outlineLevelRow: 0 }, e2.properties), this.pageSetup = Object.assign({}, { margins: { left: 0.7, right: 0.7, top: 0.75, bottom: 0.75, header: 0.3, footer: 0.3 }, orientation: "portrait", horizontalDpi: 4294967295, verticalDpi: 4294967295, fitToPage: !(!e2.pageSetup || !e2.pageSetup.fitToWidth && !e2.pageSetup.fitToHeight || e2.pageSetup.scale), pageOrder: "downThenOver", blackAndWhite: false, draft: false, cellComments: "None", errors: "displayed", scale: 100, fitToWidth: 1, fitToHeight: 1, paperSize: void 0, showRowColHeaders: false, showGridLines: false, firstPageNumber: void 0, horizontalCentered: false, verticalCentered: false, rowBreaks: null, colBreaks: null }, e2.pageSetup), this.headerFooter = Object.assign({}, { differentFirst: false, differentOddEven: false, oddHeader: null, oddFooter: null, evenHeader: null, evenFooter: null, firstHeader: null, firstFooter: null }, e2.headerFooter), this.dataValidations = new h(), this.views = e2.views || [], this.autoFilter = e2.autoFilter || null, this._media = [], this.sheetProtection = null, this.tables = {}, this.conditionalFormattings = [];
}
get name() {
return this._name;
}
set name(e2) {
if (void 0 === e2 && (e2 = "sheet" + this.id), this._name !== e2) {
if ("string" != typeof e2) throw new Error("The name has to be a string.");
if ("" === e2) throw new Error("The name can't be empty.");
if ("History" === e2) throw new Error('The name "History" is protected. Please use a different name.');
if (/[*?:/\\[\]]/.test(e2)) throw new Error(`Worksheet name ${e2} cannot include any of the following characters: * ? : \\ / [ ]`);
if (/(^')|('$)/.test(e2)) throw new Error("The first or last character of worksheet name cannot be a single quotation mark: " + e2);
if (e2 && e2.length > 31 && (console.warn(`Worksheet name ${e2} exceeds 31 chars. This will be truncated`), e2 = e2.substring(0, 31)), this._workbook._worksheets.find((t2) => t2 && t2.name.toLowerCase() === e2.toLowerCase())) throw new Error("Worksheet name already exists: " + e2);
this._name = e2;
}
}
get workbook() {
return this._workbook;
}
destroy() {
this._workbook.removeWorksheetEx(this);
}
get dimensions() {
const e2 = new s();
return this._rows.forEach((t2) => {
if (t2) {
const r2 = t2.dimensions;
r2 && e2.expand(t2.number, r2.min, t2.number, r2.max);
}
}), e2;
}
get columns() {
return this._columns;
}
set columns(e2) {
this._headerRowCount = e2.reduce((e3, t3) => {
const r3 = (t3.header ? 1 : t3.headers && t3.headers.length) || 0;
return Math.max(e3, r3);
}, 0);
let t2 = 1;
const r2 = this._columns = [];
e2.forEach((e3) => {
const n2 = new a(this, t2++, false);
r2.push(n2), n2.defn = e3;
});
}
getColumnKey(e2) {
return this._keys[e2];
}
setColumnKey(e2, t2) {
this._keys[e2] = t2;
}
deleteColumnKey(e2) {
delete this._keys[e2];
}
eachColumnKey(e2) {
n.each(this._keys, e2);
}
getColumn(e2) {
if ("string" == typeof e2) {
const t2 = this._keys[e2];
if (t2) return t2;
e2 = i.l2n(e2);
}
if (this._columns || (this._columns = []), e2 > this._columns.length) {
let t2 = this._columns.length + 1;
for (; t2 <= e2; ) this._columns.push(new a(this, t2++));
}
return this._columns[e2 - 1];
}
spliceColumns(e2, t2) {
const r2 = this._rows.length;
for (var n2 = arguments.length, i2 = new Array(n2 > 2 ? n2 - 2 : 0), s2 = 2; s2 < n2; s2++) i2[s2 - 2] = arguments[s2];
if (i2.length > 0) for (let n3 = 0; n3 < r2; n3++) {
const r3 = [e2, t2];
i2.forEach((e3) => {
r3.push(e3[n3] || null);
});
const s3 = this.getRow(n3 + 1);
s3.splice.apply(s3, r3);
}
else this._rows.forEach((r3) => {
r3 && r3.splice(e2, t2);
});
const o2 = i2.length - t2, a2 = e2 + t2, l2 = this._columns.length;
if (o2 < 0) for (let t3 = e2 + i2.length; t3 <= l2; t3++) this.getColumn(t3).defn = this.getColumn(t3 - o2).defn;
else if (o2 > 0) for (let e3 = l2; e3 >= a2; e3--) this.getColumn(e3 + o2).defn = this.getColumn(e3).defn;
for (let t3 = e2; t3 < e2 + i2.length; t3++) this.getColumn(t3).defn = null;
this.workbook.definedNames.spliceColumns(this.name, e2, t2, i2.length);
}
get lastColumn() {
return this.getColumn(this.columnCount);
}
get columnCount() {
let e2 = 0;
return this.eachRow((t2) => {
e2 = Math.max(e2, t2.cellCount);
}), e2;
}
get actualColumnCount() {
const e2 = [];
let t2 = 0;
return this.eachRow((r2) => {
r2.eachCell((r3) => {
let { col: n2 } = r3;
e2[n2] || (e2[n2] = true, t2++);
});
}), t2;
}
_commitRow() {
}
get _lastRowNumber() {
const e2 = this._rows;
let t2 = e2.length;
for (; t2 > 0 && void 0 === e2[t2 - 1]; ) t2--;
return t2;
}
get _nextRow() {
return this._lastRowNumber + 1;
}
get lastRow() {
if (this._rows.length) return this._rows[this._rows.length - 1];
}
findRow(e2) {
return this._rows[e2 - 1];
}
findRows(e2, t2) {
return this._rows.slice(e2 - 1, e2 - 1 + t2);
}
get rowCount() {
return this._lastRowNumber;
}
get actualRowCount() {
let e2 = 0;
return this.eachRow(() => {
e2++;
}), e2;
}
getRow(e2) {
let t2 = this._rows[e2 - 1];
return t2 || (t2 = this._rows[e2 - 1] = new o(this, e2)), t2;
}
getRows(e2, t2) {
if (t2 < 1) return;
const r2 = [];
for (let n2 = e2; n2 < e2 + t2; n2++) r2.push(this.getRow(n2));
return r2;
}
addRow(e2) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "n";
const r2 = this._nextRow, n2 = this.getRow(r2);
return n2.values = e2, this._setStyleOption(r2, "i" === t2[0] ? t2 : "n"), n2;
}
addRows(e2) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "n";
const r2 = [];
return e2.forEach((e3) => {
r2.push(this.addRow(e3, t2));
}), r2;
}
insertRow(e2, t2) {
let r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "n";
return this.spliceRows(e2, 0, t2), this._setStyleOption(e2, r2), this.getRow(e2);
}
insertRows(e2, t2) {
let r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "n";
if (this.spliceRows(e2, 0, ...t2), "n" !== r2) for (let n2 = 0; n2 < t2.length; n2++) "o" === r2[0] && void 0 !== this.findRow(t2.length + e2 + n2) ? this._copyStyle(t2.length + e2 + n2, e2 + n2, "+" === r2[1]) : "i" === r2[0] && void 0 !== this.findRow(e2 - 1) && this._copyStyle(e2 - 1, e2 + n2, "+" === r2[1]);
return this.getRows(e2, t2.length);
}
_setStyleOption(e2) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "n";
"o" === t2[0] && void 0 !== this.findRow(e2 + 1) ? this._copyStyle(e2 + 1, e2, "+" === t2[1]) : "i" === t2[0] && void 0 !== this.findRow(e2 - 1) && this._copyStyle(e2 - 1, e2, "+" === t2[1]);
}
_copyStyle(e2, t2) {
let r2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
const n2 = this.getRow(e2), i2 = this.getRow(t2);
i2.style = d(n2.style), n2.eachCell({ includeEmpty: r2 }, (e3, t3) => {
i2.getCell(t3).style = d(e3.style);
}), i2.height = n2.height;
}
duplicateRow(e2, t2) {
let r2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
const n2 = this._rows[e2 - 1], i2 = new Array(t2).fill(n2.values);
this.spliceRows(e2 + 1, r2 ? 0 : t2, ...i2);
for (let r3 = 0; r3 < t2; r3++) {
const t3 = this._rows[e2 + r3];
t3.style = n2.style, t3.height = n2.height, n2.eachCell({ includeEmpty: true }, (e3, r4) => {
t3.getCell(r4).style = e3.style;
});
}
}
spliceRows(e2, t2) {
const r2 = e2 + t2;
for (var n2 = arguments.length, i2 = new Array(n2 > 2 ? n2 - 2 : 0), s2 = 2; s2 < n2; s2++) i2[s2 - 2] = arguments[s2];
const o2 = i2.length, a2 = o2 - t2, l2 = this._rows.length;
let c2, u2;
if (a2 < 0) for (e2 === l2 && (this._rows[l2 - 1] = void 0), c2 = r2; c2 <= l2; c2++) if (u2 = this._rows[c2 - 1], u2) {
const e3 = this.getRow(c2 + a2);
e3.values = u2.values, e3.style = u2.style, e3.height = u2.height, u2.eachCell({ includeEmpty: true }, (t3, r3) => {
e3.getCell(r3).style = t3.style;
}), this._rows[c2 - 1] = void 0;
} else this._rows[c2 + a2 - 1] = void 0;
else if (a2 > 0) for (c2 = l2; c2 >= r2; c2--) if (u2 = this._rows[c2 - 1], u2) {
const e3 = this.getRow(c2 + a2);
e3.values = u2.values, e3.style = u2.style, e3.height = u2.height, u2.eachCell({ includeEmpty: true }, (t3, r3) => {
if (e3.getCell(r3).style = t3.style, "MergeValue" === t3._value.constructor.name) {
const e4 = this.getRow(t3._row._number + o2).getCell(r3), n3 = t3._value._master, i3 = this.getRow(n3._row._number + o2).getCell(n3._column._number);
e4.merge(i3);
}
});
} else this._rows[c2 + a2 - 1] = void 0;
for (c2 = 0; c2 < o2; c2++) {
const t3 = this.getRow(e2 + c2);
t3.style = {}, t3.values = i2[c2];
}
this.workbook.definedNames.spliceRows(this.name, e2, t2, o2);
}
eachRow(e2, t2) {
if (t2 || (t2 = e2, e2 = void 0), e2 && e2.includeEmpty) {
const e3 = this._rows.length;
for (let r2 = 1; r2 <= e3; r2++) t2(this.getRow(r2), r2);
} else this._rows.forEach((e3) => {
e3 && e3.hasValues && t2(e3, e3.number);
});
}
getSheetValues() {
const e2 = [];
return this._rows.forEach((t2) => {
t2 && (e2[t2.number] = t2.values);
}), e2;
}
findCell(e2, t2) {
const r2 = i.getAddress(e2, t2), n2 = this._rows[r2.row - 1];
return n2 ? n2.findCell(r2.col) : void 0;
}
getCell(e2, t2) {
const r2 = i.getAddress(e2, t2);
return this.getRow(r2.row).getCellEx(r2);
}
mergeCells() {
for (var e2 = arguments.length, t2 = new Array(e2), r2 = 0; r2 < e2; r2++) t2[r2] = arguments[r2];
const n2 = new s(t2);
this._mergeCellsInternal(n2);
}
mergeCellsWithoutStyle() {
for (var e2 = arguments.length, t2 = new Array(e2), r2 = 0; r2 < e2; r2++) t2[r2] = arguments[r2];
const n2 = new s(t2);
this._mergeCellsInternal(n2, true);
}
_mergeCellsInternal(e2, t2) {
n.each(this._merges, (t3) => {
if (t3.intersects(e2)) throw new Error("Cannot merge already merged cells");
});
const r2 = this.getCell(e2.top, e2.left);
for (let n2 = e2.top; n2 <= e2.bottom; n2++) for (let i2 = e2.left; i2 <= e2.right; i2++) (n2 > e2.top || i2 > e2.left) && this.getCell(n2, i2).merge(r2, t2);
this._merges[r2.address] = e2;
}
_unMergeMaster(e2) {
const t2 = this._merges[e2.address];
if (t2) {
for (let e3 = t2.top; e3 <= t2.bottom; e3++) for (let r2 = t2.left; r2 <= t2.right; r2++) this.getCell(e3, r2).unmerge();
delete this._merges[e2.address];
}
}
get hasMerges() {
return n.some(this._merges, Boolean);
}
unMergeCells() {
for (var e2 = arguments.length, t2 = new Array(e2), r2 = 0; r2 < e2; r2++) t2[r2] = arguments[r2];
const n2 = new s(t2);
for (let e3 = n2.top; e3 <= n2.bottom; e3++) for (let t3 = n2.left; t3 <= n2.right; t3++) {
const r3 = this.findCell(e3, t3);
r3 && (r3.type === l.ValueType.Merge ? this._unMergeMaster(r3.master) : this._merges[r3.address] && this._unMergeMaster(r3));
}
}
fillFormula(e2, t2, r2) {
let n2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "shared";
const s2 = i.decode(e2), { top: o2, left: a2, bottom: l2, right: c2 } = s2, u2 = c2 - a2 + 1, h2 = i.encodeAddress(o2, a2), f2 = "shared" === n2;
let d2;
d2 = "function" == typeof r2 ? r2 : Array.isArray(r2) ? Array.isArray(r2[0]) ? (e3, t3) => r2[e3 - o2][t3 - a2] : (e3, t3) => r2[(e3 - o2) * u2 + (t3 - a2)] : () => {
};
let p = true;
for (let r3 = o2; r3 <= l2; r3++) for (let i2 = a2; i2 <= c2; i2++) p ? (this.getCell(r3, i2).value = { shareType: n2, formula: t2, ref: e2, result: d2(r3, i2) }, p = false) : this.getCell(r3, i2).value = f2 ? { sharedFormula: h2, result: d2(r3, i2) } : d2(r3, i2);
}
addImage(e2, t2) {
const r2 = { type: "image", imageId: e2, range: t2 };
this._media.push(new c(this, r2));
}
getImages() {
return this._media.filter((e2) => "image" === e2.type);
}
addBackgroundImage(e2) {
const t2 = { type: "background", imageId: e2 };
this._media.push(new c(this, t2));
}
getBackgroundImageId() {
const e2 = this._media.find((e3) => "background" === e3.type);
return e2 && e2.imageId;
}
protect(e2, t2) {
return new Promise((r2) => {
this.sheetProtection = { sheet: true }, t2 && "spinCount" in t2 && (t2.spinCount = Number.isFinite(t2.spinCount) ? Math.round(Math.max(0, t2.spinCount)) : 1e5), e2 && (this.sheetProtection.algorithmName = "SHA-512", this.sheetProtection.saltValue = f.randomBytes(16).toString("base64"), this.sheetProtection.spinCount = t2 && "spinCount" in t2 ? t2.spinCount : 1e5, this.sheetProtection.hashValue = f.convertPasswordToHash(e2, "SHA512", this.sheetProtection.saltValue, this.sheetProtection.spinCount)), t2 && (this.sheetProtection = Object.assign(this.sheetProtection, t2), !e2 && "spinCount" in t2 && delete this.sheetProtection.spinCount), r2();
});
}
unprotect() {
this.sheetProtection = null;
}
addTable(e2) {
const t2 = new u(this, e2);
return this.tables[e2.name] = t2, t2;
}
getTable(e2) {
return this.tables[e2];
}
removeTable(e2) {
delete this.tables[e2];
}
getTables() {
return Object.values(this.tables);
}
addConditionalFormatting(e2) {
this.conditionalFormattings.push(e2);
}
removeConditionalFormatting(e2) {
"number" == typeof e2 ? this.conditionalFormattings.splice(e2, 1) : this.conditionalFormattings = e2 instanceof Function ? this.conditionalFormattings.filter(e2) : [];
}
get tabColor() {
return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"), this.properties.tabColor;
}
set tabColor(e2) {
console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"), this.properties.tabColor = e2;
}
get model() {
const e2 = { id: this.id, name: this.name, dataValidations: this.dataValidations.model, properties: this.properties, state: this.state, pageSetup: this.pageSetup, headerFooter: this.headerFooter, rowBreaks: this.rowBreaks, views: this.views, autoFilter: this.autoFilter, media: this._media.map((e3) => e3.model), sheetProtection: this.sheetProtection, tables: Object.values(this.tables).map((e3) => e3.model), conditionalFormattings: this.conditionalFormattings };
e2.cols = a.toModel(this.columns);
const t2 = e2.rows = [], r2 = e2.dimensions = new s();
return this._rows.forEach((e3) => {
const n2 = e3 && e3.model;
n2 && (r2.expand(n2.number, n2.min, n2.number, n2.max), t2.push(n2));
}), e2.merges = [], n.each(this._merges, (t3) => {
e2.merges.push(t3.range);
}), e2;
}
_parseRows(e2) {
this._rows = [], e2.rows.forEach((e3) => {
const t2 = new o(this, e3.number);
this._rows[t2.number - 1] = t2, t2.model = e3;
});
}
_parseMergeCells(e2) {
n.each(e2.mergeCells, (e3) => {
this.mergeCellsWithoutStyle(e3);
});
}
set model(e2) {
this.name = e2.name, this._columns = a.fromModel(this, e2.cols), this._parseRows(e2), this._parseMergeCells(e2), this.dataValidations = new h(e2.dataValidations), this.properties = e2.properties, this.pageSetup = e2.pageSetup, this.headerFooter = e2.headerFooter, this.views = e2.views, this.autoFilter = e2.autoFilter, this._media = e2.media.map((e3) => new c(this, e3)), this.sheetProtection = e2.sheetProtection, this.tables = e2.tables.reduce((e3, t2) => {
const r2 = new u();
return r2.model = t2, e3[t2.name] = r2, e3;
}, {}), this.conditionalFormattings = e2.conditionalFormattings;
}
};
}, { "../utils/col-cache": 19, "../utils/copy-style": 20, "../utils/encryptor": 21, "../utils/under-dash": 26, "./column": 4, "./data-validations": 5, "./enums": 7, "./image": 8, "./range": 10, "./row": 11, "./table": 12 }], 15: [function(e, t, r) {
e("core-js/modules/es.promise"), e("core-js/modules/es.promise.finally"), e("core-js/modules/es.object.assign"), e("core-js/modules/es.object.keys"), e("core-js/modules/es.object.values"), e("core-js/modules/es.symbol"), e("core-js/modules/es.symbol.async-iterator"), e("core-js/modules/es.array.iterator"), e("core-js/modules/es.array.includes"), e("core-js/modules/es.array.find-index"), e("core-js/modules/es.array.find"), e("core-js/modules/es.string.from-code-point"), e("core-js/modules/es.string.includes"), e("core-js/modules/es.number.is-nan"), e("regenerator-runtime/runtime");
const n = { Workbook: e("./doc/workbook") }, i = e("./doc/enums");
Object.keys(i).forEach((e2) => {
n[e2] = i[e2];
}), t.exports = n;
}, { "./doc/enums": 7, "./doc/workbook": 13, "core-js/modules/es.array.find": 359, "core-js/modules/es.array.find-index": 358, "core-js/modules/es.array.includes": 360, "core-js/modules/es.array.iterator": 361, "core-js/modules/es.number.is-nan": 363, "core-js/modules/es.object.assign": 364, "core-js/modules/es.object.keys": 366, "core-js/modules/es.object.values": 367, "core-js/modules/es.promise": 372, "core-js/modules/es.promise.finally": 371, "core-js/modules/es.string.from-code-point": 376, "core-js/modules/es.string.includes": 377, "core-js/modules/es.symbol": 381, "core-js/modules/es.symbol.async-iterator": 378, "regenerator-runtime/runtime": 492 }], 16: [function(e, t, r) {
const n = "undefined" == typeof TextDecoder ? null : new TextDecoder("utf-8");
r.bufferToString = function(e2) {
return "string" == typeof e2 ? e2 : n ? n.decode(e2) : e2.toString();
};
}, {}], 17: [function(e, t, r) {
const n = "undefined" == typeof TextEncoder ? null : new TextEncoder("utf-8"), { Buffer: i } = e("buffer");
r.stringToBuffer = function(e2) {
return "string" != typeof e2 ? e2 : n ? i.from(n.encode(e2).buffer) : i.from(e2);
};
}, { buffer: 220 }], 18: [function(e, t, r) {
const n = e("./under-dash"), i = e("./col-cache");
t.exports = class {
constructor(e2) {
this.template = e2, this.sheets = {};
}
addCell(e2) {
this.addCellEx(i.decodeEx(e2));
}
getCell(e2) {
return this.findCellEx(i.decodeEx(e2), true);
}
findCell(e2) {
return this.findCellEx(i.decodeEx(e2), false);
}
findCellAt(e2, t2, r2) {
const n2 = this.sheets[e2], i2 = n2 && n2[t2];
return i2 && i2[r2];
}
addCellEx(e2) {
if (e2.top) for (let t2 = e2.top; t2 <= e2.bottom; t2++) for (let r2 = e2.left; r2 <= e2.right; r2++) this.getCellAt(e2.sheetName, t2, r2);
else this.findCellEx(e2, true);
}
getCellEx(e2) {
return this.findCellEx(e2, true);
}
findCellEx(e2, t2) {
const r2 = this.findSheet(e2, t2), n2 = this.findSheetRow(r2, e2, t2);
return this.findRowCell(n2, e2, t2);
}
getCellAt(e2, t2, r2) {
const n2 = this.sheets[e2] || (this.sheets[e2] = []), s = n2[t2] || (n2[t2] = []);
return s[r2] || (s[r2] = { sheetName: e2, address: i.n2l(r2) + t2, row: t2, col: r2 });
}
removeCellEx(e2) {
const t2 = this.findSheet(e2);
if (!t2) return;
const r2 = this.findSheetRow(t2, e2);
r2 && delete r2[e2.col];
}
forEachInSheet(e2, t2) {
const r2 = this.sheets[e2];
r2 && r2.forEach((e3, r3) => {
e3 && e3.forEach((e4, n2) => {
e4 && t2(e4, r3, n2);
});
});
}
forEach(e2) {
n.each(this.sheets, (t2, r2) => {
this.forEachInSheet(r2, e2);
});
}
map(e2) {
const t2 = [];
return this.forEach((r2) => {
t2.push(e2(r2));
}), t2;
}
findSheet(e2, t2) {
const r2 = e2.sheetName;
return this.sheets[r2] ? this.sheets[r2] : t2 ? this.sheets[r2] = [] : void 0;
}
findSheetRow(e2, t2, r2) {
const { row: n2 } = t2;
return e2 && e2[n2] ? e2[n2] : r2 ? e2[n2] = [] : void 0;
}
findRowCell(e2, t2, r2) {
const { col: n2 } = t2;
return e2 && e2[n2] ? e2[n2] : r2 ? e2[n2] = this.template ? Object.assign(t2, JSON.parse(JSON.stringify(this.template))) : t2 : void 0;
}
spliceRows(e2, t2, r2, n2) {
const i2 = this.sheets[e2];
if (i2) {
const e3 = [];
for (let t3 = 0; t3 < n2; t3++) e3.push([]);
i2.splice(t2, r2, ...e3);
}
}
spliceColumns(e2, t2, r2, i2) {
const s = this.sheets[e2];
if (s) {
const e3 = [];
for (let t3 = 0; t3 < i2; t3++) e3.push(null);
n.each(s, (n2) => {
n2.splice(t2, r2, ...e3);
});
}
}
};
}, { "./col-cache": 19, "./under-dash": 26 }], 19: [function(e, t, r) {
const n = /^[A-Z]+\d+$/, i = { _dictionary: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"], _l2nFill: 0, _l2n: {}, _n2l: [], _level: (e2) => e2 <= 26 ? 1 : e2 <= 676 ? 2 : 3, _fill(e2) {
let t2, r2, n2, i2, s, o = 1;
if (e2 >= 4) throw new Error("Out of bounds. Excel supports columns from 1 to 16384");
if (this._l2nFill < 1 && e2 >= 1) {
for (; o <= 26; ) t2 = this._dictionary[o - 1], this._n2l[o] = t2, this._l2n[t2] = o, o++;
this._l2nFill = 1;
}
if (this._l2nFill < 2 && e2 >= 2) {
for (o = 27; o <= 702; ) r2 = o - 27, n2 = r2 % 26, i2 = Math.floor(r2 / 26), t2 = this._dictionary[i2] + this._dictionary[n2], this._n2l[o] = t2, this._l2n[t2] = o, o++;
this._l2nFill = 2;
}
if (this._l2nFill < 3 && e2 >= 3) {
for (o = 703; o <= 16384; ) r2 = o - 703, n2 = r2 % 26, i2 = Math.floor(r2 / 26) % 26, s = Math.floor(r2 / 676), t2 = this._dictionary[s] + this._dictionary[i2] + this._dictionary[n2], this._n2l[o] = t2, this._l2n[t2] = o, o++;
this._l2nFill = 3;
}
}, l2n(e2) {
if (this._l2n[e2] || this._fill(e2.length), !this._l2n[e2]) throw new Error("Out of bounds. Invalid column letter: " + e2);
return this._l2n[e2];
}, n2l(e2) {
if (e2 < 1 || e2 > 16384) throw new Error(e2 + " is out of bounds. Excel supports columns from 1 to 16384");
return this._n2l[e2] || this._fill(this._level(e2)), this._n2l[e2];
}, _hash: {}, validateAddress(e2) {
if (!n.test(e2)) throw new Error("Invalid Address: " + e2);
return true;
}, decodeAddress(e2) {
const t2 = e2.length < 5 && this._hash[e2];
if (t2) return t2;
let r2 = false, n2 = "", i2 = 0, s = false, o = "", a = 0;
for (let t3, l2 = 0; l2 < e2.length; l2++) if (t3 = e2.charCodeAt(l2), !s && t3 >= 65 && t3 <= 90) r2 = true, n2 += e2[l2], i2 = 26 * i2 + t3 - 64;
else if (t3 >= 48 && t3 <= 57) s = true, o += e2[l2], a = 10 * a + t3 - 48;
else if (s && r2 && 36 !== t3) break;
if (r2) {
if (i2 > 16384) throw new Error("Out of bounds. Invalid column letter: " + n2);
} else i2 = void 0;
s || (a = void 0);
const l = { address: e2 = n2 + o, col: i2, row: a, $col$row: `$${n2}$${o}` };
return i2 <= 100 && a <= 100 && (this._hash[e2] = l, this._hash[l.$col$row] = l), l;
}, getAddress(e2, t2) {
if (t2) {
const r2 = this.n2l(t2) + e2;
return this.decodeAddress(r2);
}
return this.decodeAddress(e2);
}, decode(e2) {
const t2 = e2.split(":");
if (2 === t2.length) {
const e3 = this.decodeAddress(t2[0]), r2 = this.decodeAddress(t2[1]), n2 = { top: Math.min(e3.row, r2.row), left: Math.min(e3.col, r2.col), bottom: Math.max(e3.row, r2.row), right: Math.max(e3.col, r2.col) };
return n2.tl = this.n2l(n2.left) + n2.top, n2.br = this.n2l(n2.right) + n2.bottom, n2.dimensions = `${n2.tl}:${n2.br}`, n2;
}
return this.decodeAddress(e2);
}, decodeEx(e2) {
const t2 = e2.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/), r2 = t2[1] || t2[2], n2 = t2[3], i2 = n2.split(":");
if (i2.length > 1) {
let e3 = this.decodeAddress(i2[0]), t3 = this.decodeAddress(i2[1]);
const n3 = Math.min(e3.row, t3.row), s2 = Math.min(e3.col, t3.col), o = Math.max(e3.row, t3.row), a = Math.max(e3.col, t3.col);
return e3 = this.n2l(s2) + n3, t3 = this.n2l(a) + o, { top: n3, left: s2, bottom: o, right: a, sheetName: r2, tl: { address: e3, col: s2, row: n3, $col$row: `$${this.n2l(s2)}$${n3}`, sheetName: r2 }, br: { address: t3, col: a, row: o, $col$row: `$${this.n2l(a)}$${o}`, sheetName: r2 }, dimensions: `${e3}:${t3}` };
}
if (n2.startsWith("#")) return r2 ? { sheetName: r2, error: n2 } : { error: n2 };
const s = this.decodeAddress(n2);
return r2 ? { sheetName: r2, ...s } : s;
}, encodeAddress: (e2, t2) => i.n2l(t2) + e2, encode() {
switch (arguments.length) {
case 2:
return i.encodeAddress(arguments[0], arguments[1]);
case 4:
return `${i.encodeAddress(arguments[0], arguments[1])}:${i.encodeAddress(arguments[2], arguments[3])}`;
default:
throw new Error("Can only encode with 2 or 4 arguments");
}
}, inRange(e2, t2) {
const [r2, n2, , i2, s] = e2, [o, a] = t2;
return o >= r2 && o <= i2 && a >= n2 && a <= s;
} };
t.exports = i;
}, {}], 20: [function(e, t, r) {
const n = (e2, t2) => ({ ...e2, ...t2.reduce((t3, r2) => (e2[r2] && (t3[r2] = { ...e2[r2] }), t3), {}) }), i = function(e2, t2, r2) {
let i2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : [];
e2[r2] && (t2[r2] = n(e2[r2], i2));
};
r.copyStyle = (e2) => {
if (!e2) return e2;
if (t2 = e2, 0 === Object.keys(t2).length) return {};
var t2;
const r2 = { ...e2 };
return i(e2, r2, "font", ["color"]), i(e2, r2, "alignment"), i(e2, r2, "protection"), e2.border && (i(e2, r2, "border"), i(e2.border, r2.border, "top", ["color"]), i(e2.border, r2.border, "left", ["color"]), i(e2.border, r2.border, "bottom", ["color"]), i(e2.border, r2.border, "right", ["color"]), i(e2.border, r2.border, "diagonal", ["color"])), e2.fill && (i(e2, r2, "fill", ["fgColor", "bgColor", "center"]), e2.fill.stops && (r2.fill.stops = e2.fill.stops.map((e3) => n(e3, ["color"])))), r2;
};
}, {}], 21: [function(e, t, r) {
(function(r2) {
(function() {
const n = e("crypto"), i = { hash(e2) {
const t2 = n.createHash(e2);
for (var i2 = arguments.length, s = new Array(i2 > 1 ? i2 - 1 : 0), o = 1; o < i2; o++) s[o - 1] = arguments[o];
return t2.update(r2.concat(s)), t2.digest();
}, convertPasswordToHash(e2, t2, i2, s) {
t2 = t2.toLowerCase();
if (n.getHashes().indexOf(t2) < 0) throw new Error(`Hash algorithm '${t2}' not supported!`);
const o = r2.from(e2, "utf16le");
let a = this.hash(t2, r2.from(i2, "base64"), o);
for (let e3 = 0; e3 < s; e3++) {
const n2 = r2.alloc(4);
n2.writeUInt32LE(e3, 0), a = this.hash(t2, a, n2);
}
return a.toString("base64");
}, randomBytes: (e2) => n.randomBytes(e2) };
t.exports = i;
}).call(this);
}).call(this, e("buffer").Buffer);
}, { buffer: 220, crypto: 390 }], 22: [function(e, t, r) {
const { SaxesParser: n } = e("saxes"), { PassThrough: i } = e("readable-stream"), { bufferToString: s } = e("./browser-buffer-decode");
t.exports = async function* (e2) {
e2.pipe && !e2[Symbol.asyncIterator] && (e2 = e2.pipe(new i()));
const t2 = new n();
let r2;
t2.on("error", (e3) => {
r2 = e3;
});
let o = [];
t2.on("opentag", (e3) => o.push({ eventType: "opentag", value: e3 })), t2.on("text", (e3) => o.push({ eventType: "text", value: e3 })), t2.on("closetag", (e3) => o.push({ eventType: "closetag", value: e3 }));
for await (const n2 of e2) {
if (t2.write(s(n2)), r2) throw r2;
yield o, o = [];
}
};
}, { "./browser-buffer-decode": 16, "readable-stream": 491, saxes: 496 }], 23: [function(e, t, r) {
const n = e("./col-cache"), i = /(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi, s = /^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;
t.exports = { slideFormula: function(e2, t2, r2) {
const o = n.decode(t2), a = n.decode(r2);
return e2.replace(i, (e3, t3, r3, i2, l) => {
if (l) return e3;
const c = s.exec(i2);
if (c) {
const r4 = c[1], i3 = c[2].toUpperCase(), s2 = c[3], l2 = c[4];
if (i3.length > 3 || 3 === i3.length && i3 > "XFD") return e3;
let u = n.l2n(i3), h = parseInt(l2, 10);
r4 || (u += a.col - o.col), s2 || (h += a.row - o.row);
return (t3 || "") + (r4 || "") + n.n2l(u) + (s2 || "") + h;
}
return e3;
});
} };
}, { "./col-cache": 19 }], 24: [function(e, t, r) {
(function(r2, n) {
(function() {
const i = e("readable-stream"), s = e("./utils"), o = e("./string-buf");
class a {
constructor(e2, t2) {
this._data = e2, this._encoding = t2;
}
get length() {
return this.toBuffer().length;
}
copy(e2, t2, r3, n2) {
return this.toBuffer().copy(e2, t2, r3, n2);
}
toBuffer() {
return this._buffer || (this._buffer = n.from(this._data, this._encoding)), this._buffer;
}
}
class l {
constructor(e2) {
this._data = e2;
}
get length() {
return this._data.length;
}
copy(e2, t2, r3, n2) {
return this._data._buf.copy(e2, t2, r3, n2);
}
toBuffer() {
return this._data.toBuffer();
}
}
class c {
constructor(e2) {
this._data = e2;
}
get length() {
return this._data.length;
}
copy(e2, t2, r3, n2) {
this._data.copy(e2, t2, r3, n2);
}
toBuffer() {
return this._data;
}
}
class u {
constructor(e2) {
this.size = e2, this.buffer = n.alloc(e2), this.iRead = 0, this.iWrite = 0;
}
toBuffer() {
if (0 === this.iRead && this.iWrite === this.size) return this.buffer;
const e2 = n.alloc(this.iWrite - this.iRead);
return this.buffer.copy(e2, 0, this.iRead, this.iWrite), e2;
}
get length() {
return this.iWrite - this.iRead;
}
get eod() {
return this.iRead === this.iWrite;
}
get full() {
return this.iWrite === this.size;
}
read(e2) {
let t2;
return 0 === e2 ? null : void 0 === e2 || e2 >= this.length ? (t2 = this.toBuffer(), this.iRead = this.iWrite, t2) : (t2 = n.alloc(e2), this.buffer.copy(t2, 0, this.iRead, e2), this.iRead += e2, t2);
}
write(e2, t2, r3) {
const n2 = Math.min(r3, this.size - this.iWrite);
return e2.copy(this.buffer, this.iWrite, t2, t2 + n2), this.iWrite += n2, n2;
}
}
const h = function(e2) {
e2 = e2 || {}, this.bufSize = e2.bufSize || 1048576, this.buffers = [], this.batch = e2.batch || false, this.corked = false, this.inPos = 0, this.outPos = 0, this.pipes = [], this.paused = false, this.encoding = null;
};
s.inherits(h, i.Duplex, { toBuffer() {
switch (this.buffers.length) {
case 0:
return null;
case 1:
return this.buffers[0].toBuffer();
default:
return n.concat(this.buffers.map((e2) => e2.toBuffer()));
}
}, _getWritableBuffer() {
if (this.buffers.length) {
const e3 = this.buffers[this.buffers.length - 1];
if (!e3.full) return e3;
}
const e2 = new u(this.bufSize);
return this.buffers.push(e2), e2;
}, async _pipe(e2) {
await Promise.all(this.pipes.map((function(t2) {
return new Promise((r3) => {
t2.write(e2.toBuffer(), () => {
r3();
});
});
})));
}, _writeToBuffers(e2) {
let t2 = 0;
const r3 = e2.length;
for (; t2 < r3; ) {
t2 += this._getWritableBuffer().write(e2, t2, r3 - t2);
}
}, async write(e2, t2, i2) {
let u2;
if (t2 instanceof Function && (i2 = t2, t2 = "utf8"), i2 = i2 || s.nop, e2 instanceof o) u2 = new l(e2);
else if (e2 instanceof n) u2 = new c(e2);
else {
if (!("string" == typeof e2 || e2 instanceof String || e2 instanceof ArrayBuffer)) throw new Error("Chunk must be one of type String, Buffer or StringBuf.");
u2 = new a(e2, t2);
}
if (this.pipes.length) if (this.batch) for (this._writeToBuffers(u2); !this.corked && this.buffers.length > 1; ) this._pipe(this.buffers.shift());
else this.corked ? (this._writeToBuffers(u2), r2.nextTick(i2)) : (await this._pipe(u2), i2());
else this.paused || this.emit("data", u2.toBuffer()), this._writeToBuffers(u2), this.emit("readable");
return true;
}, cork() {
this.corked = true;
}, _flush() {
if (this.pipes.length) for (; this.buffers.length; ) this._pipe(this.buffers.shift());
}, uncork() {
this.corked = false, this._flush();
}, end(e2, t2, r3) {
const n2 = (e3) => {
e3 ? r3(e3) : (this._flush(), this.pipes.forEach((e4) => {
e4.end();
}), this.emit("finish"));
};
e2 ? this.write(e2, t2, n2) : n2();
}, read(e2) {
let t2;
if (e2) {
for (t2 = []; e2 && this.buffers.length && !this.buffers[0].eod; ) {
const r3 = this.buffers[0], n2 = r3.read(e2);
e2 -= n2.length, t2.push(n2), r3.eod && r3.full && this.buffers.shift();
}
return n.concat(t2);
}
return t2 = this.buffers.map((e3) => e3.toBuffer()).filter(Boolean), this.buffers = [], n.concat(t2);
}, setEncoding(e2) {
this.encoding = e2;
}, pause() {
this.paused = true;
}, resume() {
this.paused = false;
}, isPaused() {
return !!this.paused;
}, pipe(e2) {
this.pipes.push(e2), !this.paused && this.buffers.length && this.end();
}, unpipe(e2) {
this.pipes = this.pipes.filter((t2) => t2 !== e2);
}, unshift() {
throw new Error("Not Implemented");
}, wrap() {
throw new Error("Not Implemented");
} }), t.exports = h;
}).call(this);
}).call(this, e("_process"), e("buffer").Buffer);
}, { "./string-buf": 25, "./utils": 27, _process: 467, buffer: 220, "readable-stream": 491 }], 25: [function(e, t, r) {
(function(e2) {
(function() {
t.exports = class {
constructor(t2) {
this._buf = e2.alloc(t2 && t2.size || 16384), this._encoding = t2 && t2.encoding || "utf8", this._inPos = 0, this._buffer = void 0;
}
get length() {
return this._inPos;
}
get capacity() {
return this._buf.length;
}
get buffer() {
return this._buf;
}
toBuffer() {
return this._buffer || (this._buffer = e2.alloc(this.length), this._buf.copy(this._buffer, 0, 0, this.length)), this._buffer;
}
reset(e3) {
e3 = e3 || 0, this._buffer = void 0, this._inPos = e3;
}
_grow(t2) {
let r2 = 2 * this._buf.length;
for (; r2 < t2; ) r2 *= 2;
const n = e2.alloc(r2);
this._buf.copy(n, 0), this._buf = n;
}
addText(e3) {
this._buffer = void 0;
let t2 = this._inPos + this._buf.write(e3, this._inPos, this._encoding);
for (; t2 >= this._buf.length - 4; ) this._grow(this._inPos + e3.length), t2 = this._inPos + this._buf.write(e3, this._inPos, this._encoding);
this._inPos = t2;
}
addStringBuf(e3) {
e3.length && (this._buffer = void 0, this.length + e3.length > this.capacity && this._grow(this.length + e3.length), e3._buf.copy(this._buf, this._inPos, 0, e3.length), this._inPos += e3.length);
}
};
}).call(this);
}).call(this, e("buffer").Buffer);
}, { buffer: 220 }], 26: [function(e, t, r) {
const { toString: n } = Object.prototype, i = /["&<>]/, s = { each: function(e2, t2) {
e2 && (Array.isArray(e2) ? e2.forEach(t2) : Object.keys(e2).forEach((r2) => {
t2(e2[r2], r2);
}));
}, some: function(e2, t2) {
return !!e2 && (Array.isArray(e2) ? e2.some(t2) : Object.keys(e2).some((r2) => t2(e2[r2], r2)));
}, every: function(e2, t2) {
return !e2 || (Array.isArray(e2) ? e2.every(t2) : Object.keys(e2).every((r2) => t2(e2[r2], r2)));
}, map: function(e2, t2) {
return e2 ? Array.isArray(e2) ? e2.map(t2) : Object.keys(e2).map((r2) => t2(e2[r2], r2)) : [];
}, keyBy: (e2, t2) => e2.reduce((e3, r2) => (e3[r2[t2]] = r2, e3), {}), isEqual: function(e2, t2) {
const r2 = typeof e2, n2 = typeof t2, i2 = Array.isArray(e2), o = Array.isArray(t2);
let a;
if (r2 !== n2) return false;
switch (typeof e2) {
case "object":
if (i2 || o) return !(!i2 || !o) && (e2.length === t2.length && e2.every((e3, r3) => {
const n3 = t2[r3];
return s.isEqual(e3, n3);
}));
if (null === e2 || null === t2) return e2 === t2;
if (a = Object.keys(e2), Object.keys(t2).length !== a.length) return false;
for (const e3 of a) if (!t2.hasOwnProperty(e3)) return false;
return s.every(e2, (e3, r3) => {
const n3 = t2[r3];
return s.isEqual(e3, n3);
});
default:
return e2 === t2;
}
}, escapeHtml(e2) {
const t2 = i.exec(e2);
if (!t2) return e2;
let r2 = "", n2 = "", s2 = 0, o = t2.index;
for (; o < e2.length; o++) {
switch (e2.charAt(o)) {
case '"':
n2 = """;
break;
case "&":
n2 = "&";
break;
case "'":
n2 = "'";
break;
case "<":
n2 = "<";
break;
case ">":
n2 = ">";
break;
default:
continue;
}
s2 !== o && (r2 += e2.substring(s2, o)), s2 = o + 1, r2 += n2;
}
return s2 !== o ? r2 + e2.substring(s2, o) : r2;
}, strcmp: (e2, t2) => e2 < t2 ? -1 : e2 > t2 ? 1 : 0, isUndefined: (e2) => "[object Undefined]" === n.call(e2), isObject: (e2) => "[object Object]" === n.call(e2), deepMerge() {
const e2 = arguments[0] || {}, { length: t2 } = arguments;
let r2, n2, i2;
function o(t3, o2) {
r2 = e2[o2], i2 = Array.isArray(t3), s.isObject(t3) || i2 ? (i2 ? (i2 = false, n2 = r2 && Array.isArray(r2) ? r2 : []) : n2 = r2 && s.isObject(r2) ? r2 : {}, e2[o2] = s.deepMerge(n2, t3)) : s.isUndefined(t3) || (e2[o2] = t3);
}
for (let e3 = 0; e3 < t2; e3++) s.each(arguments[e3], o);
return e2;
} };
t.exports = s;
}, {}], 27: [function(e, t, r) {
(function(r2, n) {
(function() {
const i = e("fs"), s = /[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/, o = { nop() {
}, promiseImmediate: (e2) => new Promise((t2) => {
r2.setImmediate ? n(() => {
t2(e2);
}) : setTimeout(() => {
t2(e2);
}, 1);
}), inherits: function(e2, t2, r3, n2) {
e2.super_ = t2, n2 || (n2 = r3, r3 = null), r3 && Object.keys(r3).forEach((t3) => {
Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(r3, t3));
});
const i2 = { constructor: { value: e2, enumerable: false, writable: false, configurable: true } };
n2 && Object.keys(n2).forEach((e3) => {
i2[e3] = Object.getOwnPropertyDescriptor(n2, e3);
}), e2.prototype = Object.create(t2.prototype, i2);
}, dateToExcel: (e2, t2) => 25569 + e2.getTime() / 864e5 - (t2 ? 1462 : 0), excelToDate(e2, t2) {
const r3 = Math.round(24 * (e2 - 25569 + (t2 ? 1462 : 0)) * 3600 * 1e3);
return new Date(r3);
}, parsePath(e2) {
const t2 = e2.lastIndexOf("/");
return { path: e2.substring(0, t2), name: e2.substring(t2 + 1) };
}, getRelsPath(e2) {
const t2 = o.parsePath(e2);
return `${t2.path}/_rels/${t2.name}.rels`;
}, xmlEncode(e2) {
const t2 = s.exec(e2);
if (!t2) return e2;
let r3 = "", n2 = "", i2 = 0, o2 = t2.index;
for (; o2 < e2.length; o2++) {
const t3 = e2.charCodeAt(o2);
switch (t3) {
case 34:
n2 = """;
break;
case 38:
n2 = "&";
break;
case 39:
n2 = "'";
break;
case 60:
n2 = "<";
break;
case 62:
n2 = ">";
break;
case 127:
n2 = "";
break;
default:
if (t3 <= 31 && (t3 <= 8 || t3 >= 11 && 13 !== t3)) {
n2 = "";
break;
}
continue;
}
i2 !== o2 && (r3 += e2.substring(i2, o2)), i2 = o2 + 1, n2 && (r3 += n2);
}
return i2 !== o2 ? r3 + e2.substring(i2, o2) : r3;
}, xmlDecode: (e2) => e2.replace(/&([a-z]*);/g, (e3) => {
switch (e3) {
case "<":
return "<";
case ">":
return ">";
case "&":
return "&";
case "'":
return "'";
case """:
return '"';
default:
return e3;
}
}), validInt(e2) {
const t2 = parseInt(e2, 10);
return Number.isNaN(t2) ? 0 : t2;
}, isDateFmt(e2) {
if (!e2) return false;
return null !== (e2 = (e2 = e2.replace(/\[[^\]]*]/g, "")).replace(/"[^"]*"/g, "")).match(/[ymdhMsb]+/);
}, fs: { exists: (e2) => new Promise((t2) => {
i.access(e2, i.constants.F_OK, (e3) => {
t2(!e3);
});
}) }, toIsoDateString: (e2) => e2.toIsoString().subsstr(0, 10), parseBoolean: (e2) => true === e2 || "true" === e2 || 1 === e2 || "1" === e2 };
t.exports = o;
}).call(this);
}).call(this, "undefined" != typeof commonjsGlobal ? commonjsGlobal : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, e("timers").setImmediate);
}, { fs: 216, timers: 523 }], 28: [function(e, t, r) {
const n = e("./under-dash"), i = e("./utils");
function s(e2, t2, r2) {
e2.push(` ${t2}="${i.xmlEncode(r2.toString())}"`);
}
function o(e2, t2) {
if (t2) {
const r2 = [];
n.each(t2, (e3, t3) => {
void 0 !== e3 && s(r2, t3, e3);
}), e2.push(r2.join(""));
}
}
class a {
constructor() {
this._xml = [], this._stack = [], this._rollbacks = [];
}
get tos() {
return this._stack.length ? this._stack[this._stack.length - 1] : void 0;
}
get cursor() {
return this._xml.length;
}
openXml(e2) {
const t2 = this._xml;
t2.push("\n");
}
openNode(e2, t2) {
const r2 = this.tos, n2 = this._xml;
r2 && this.open && n2.push(">"), this._stack.push(e2), n2.push("<"), n2.push(e2), o(n2, t2), this.leaf = true, this.open = true;
}
addAttribute(e2, t2) {
if (!this.open) throw new Error("Cannot write attributes to node if it is not open");
void 0 !== t2 && s(this._xml, e2, t2);
}
addAttributes(e2) {
if (!this.open) throw new Error("Cannot write attributes to node if it is not open");
o(this._xml, e2);
}
writeText(e2) {
const t2 = this._xml;
this.open && (t2.push(">"), this.open = false), this.leaf = false, t2.push(i.xmlEncode(e2.toString()));
}
writeXml(e2) {
this.open && (this._xml.push(">"), this.open = false), this.leaf = false, this._xml.push(e2);
}
closeNode() {
const e2 = this._stack.pop(), t2 = this._xml;
this.leaf ? t2.push("/>") : (t2.push(""), t2.push(e2), t2.push(">")), this.open = false, this.leaf = false;
}
leafNode(e2, t2, r2) {
this.openNode(e2, t2), void 0 !== r2 && this.writeText(r2), this.closeNode();
}
closeAll() {
for (; this._stack.length; ) this.closeNode();
}
addRollback() {
return this._rollbacks.push({ xml: this._xml.length, stack: this._stack.length, leaf: this.leaf, open: this.open }), this.cursor;
}
commit() {
this._rollbacks.pop();
}
rollback() {
const e2 = this._rollbacks.pop();
this._xml.length > e2.xml && this._xml.splice(e2.xml, this._xml.length - e2.xml), this._stack.length > e2.stack && this._stack.splice(e2.stack, this._stack.length - e2.stack), this.leaf = e2.leaf, this.open = e2.open;
}
get xml() {
return this.closeAll(), this._xml.join("");
}
}
a.StdDocAttributes = { version: "1.0", encoding: "UTF-8", standalone: "yes" }, t.exports = a;
}, { "./under-dash": 26, "./utils": 27 }], 29: [function(e, t, r) {
(function(r2) {
(function() {
const n = e("events"), i = e("jszip"), s = e("./stream-buf"), { stringToBuffer: o } = e("./browser-buffer-encode");
class a extends n.EventEmitter {
constructor(e2) {
super(), this.options = Object.assign({ type: "nodebuffer", compression: "DEFLATE" }, e2), this.zip = new i(), this.stream = new s();
}
append(e2, t2) {
t2.hasOwnProperty("base64") && t2.base64 ? this.zip.file(t2.name, e2, { base64: true }) : (r2.browser && "string" == typeof e2 && (e2 = o(e2)), this.zip.file(t2.name, e2));
}
async finalize() {
const e2 = await this.zip.generateAsync(this.options);
this.stream.end(e2), this.emit("finish");
}
read(e2) {
return this.stream.read(e2);
}
setEncoding(e2) {
return this.stream.setEncoding(e2);
}
pause() {
return this.stream.pause();
}
resume() {
return this.stream.resume();
}
isPaused() {
return this.stream.isPaused();
}
pipe(e2, t2) {
return this.stream.pipe(e2, t2);
}
unpipe(e2) {
return this.stream.unpipe(e2);
}
unshift(e2) {
return this.stream.unshift(e2);
}
wrap(e2) {
return this.stream.wrap(e2);
}
}
t.exports = { ZipWriter: a };
}).call(this);
}).call(this, e("_process"));
}, { "./browser-buffer-encode": 17, "./stream-buf": 24, _process: 467, events: 422, jszip: 441 }], 30: [function(e, t, r) {
t.exports = { 0: { f: "General" }, 1: { f: "0" }, 2: { f: "0.00" }, 3: { f: "#,##0" }, 4: { f: "#,##0.00" }, 9: { f: "0%" }, 10: { f: "0.00%" }, 11: { f: "0.00E+00" }, 12: { f: "# ?/?" }, 13: { f: "# ??/??" }, 14: { f: "mm-dd-yy" }, 15: { f: "d-mmm-yy" }, 16: { f: "d-mmm" }, 17: { f: "mmm-yy" }, 18: { f: "h:mm AM/PM" }, 19: { f: "h:mm:ss AM/PM" }, 20: { f: "h:mm" }, 21: { f: "h:mm:ss" }, 22: { f: 'm/d/yy "h":mm' }, 27: { "zh-tw": "[$-404]e/m/d", "zh-cn": 'yyyy"年"m"月"', "ja-jp": "[$-411]ge.m.d", "ko-kr": 'yyyy"年" mm"月" dd"日"' }, 28: { "zh-tw": '[$-404]e"年"m"月"d"日"', "zh-cn": 'm"月"d"日"', "ja-jp": '[$-411]ggge"年"m"月"d"日"', "ko-kr": "mm-dd" }, 29: { "zh-tw": '[$-404]e"年"m"月"d"日"', "zh-cn": 'm"月"d"日"', "ja-jp": '[$-411]ggge"年"m"月"d"日"', "ko-kr": "mm-dd" }, 30: { "zh-tw": "m/d/yy ", "zh-cn": "m-d-yy", "ja-jp": "m/d/yy", "ko-kr": "mm-dd-yy" }, 31: { "zh-tw": 'yyyy"年"m"月"d"日"', "zh-cn": 'yyyy"年"m"月"d"日"', "ja-jp": 'yyyy"年"m"月"d"日"', "ko-kr": 'yyyy"년" mm"월" dd"일"' }, 32: { "zh-tw": 'hh"時"mm"分"', "zh-cn": 'h"时"mm"分"', "ja-jp": 'h"時"mm"分"', "ko-kr": 'h"시" mm"분"' }, 33: { "zh-tw": 'hh"時"mm"分"ss"秒"', "zh-cn": 'h"时"mm"分"ss"秒"', "ja-jp": 'h"時"mm"分"ss"秒"', "ko-kr": 'h"시" mm"분" ss"초"' }, 34: { "zh-tw": '上午/下午 hh"時"mm"分"', "zh-cn": '上午/下午 h"时"mm"分"', "ja-jp": 'yyyy"年"m"月"', "ko-kr": "yyyy-mm-dd" }, 35: { "zh-tw": '上午/下午 hh"時"mm"分"ss"秒"', "zh-cn": '上午/下午 h"时"mm"分"ss"秒"', "ja-jp": 'm"月"d"日"', "ko-kr": "yyyy-mm-dd" }, 36: { "zh-tw": "[$-404]e/m/d", "zh-cn": 'yyyy"年"m"月"', "ja-jp": "[$-411]ge.m.d", "ko-kr": 'yyyy"年" mm"月" dd"日"' }, 37: { f: "#,##0 ;(#,##0)" }, 38: { f: "#,##0 ;[Red](#,##0)" }, 39: { f: "#,##0.00 ;(#,##0.00)" }, 40: { f: "#,##0.00 ;[Red](#,##0.00)" }, 45: { f: "mm:ss" }, 46: { f: "[h]:mm:ss" }, 47: { f: "mmss.0" }, 48: { f: "##0.0E+0" }, 49: { f: "@" }, 50: { "zh-tw": "[$-404]e/m/d", "zh-cn": 'yyyy"年"m"月"', "ja-jp": "[$-411]ge.m.d", "ko-kr": 'yyyy"年" mm"月" dd"日"' }, 51: { "zh-tw": '[$-404]e"年"m"月"d"日"', "zh-cn": 'm"月"d"日"', "ja-jp": '[$-411]ggge"年"m"月"d"日"', "ko-kr": "mm-dd" }, 52: { "zh-tw": '上午/下午 hh"時"mm"分"', "zh-cn": 'yyyy"年"m"月"', "ja-jp": 'yyyy"年"m"月"', "ko-kr": "yyyy-mm-dd" }, 53: { "zh-tw": '上午/下午 hh"時"mm"分"ss"秒"', "zh-cn": 'm"月"d"日"', "ja-jp": 'm"月"d"日"', "ko-kr": "yyyy-mm-dd" }, 54: { "zh-tw": '[$-404]e"年"m"月"d"日"', "zh-cn": 'm"月"d"日"', "ja-jp": '[$-411]ggge"年"m"月"d"日"', "ko-kr": "mm-dd" }, 55: { "zh-tw": '上午/下午 hh"時"mm"分"', "zh-cn": '上午/下午 h"时"mm"分"', "ja-jp": 'yyyy"年"m"月"', "ko-kr": "yyyy-mm-dd" }, 56: { "zh-tw": '上午/下午 hh"時"mm"分"ss"秒"', "zh-cn": '上午/下午 h"时"mm"分"ss"秒"', "ja-jp": 'm"月"d"日"', "ko-kr": "yyyy-mm-dd" }, 57: { "zh-tw": "[$-404]e/m/d", "zh-cn": 'yyyy"年"m"月"', "ja-jp": "[$-411]ge.m.d", "ko-kr": 'yyyy"年" mm"月" dd"日"' }, 58: { "zh-tw": '[$-404]e"年"m"月"d"日"', "zh-cn": 'm"月"d"日"', "ja-jp": '[$-411]ggge"年"m"月"d"日"', "ko-kr": "mm-dd" }, 59: { "th-th": "t0" }, 60: { "th-th": "t0.00" }, 61: { "th-th": "t#,##0" }, 62: { "th-th": "t#,##0.00" }, 67: { "th-th": "t0%" }, 68: { "th-th": "t0.00%" }, 69: { "th-th": "t# ?/?" }, 70: { "th-th": "t# ??/??" }, 81: { "th-th": "d/m/bb" } };
}, {}], 31: [function(e, t, r) {
t.exports = { OfficeDocument: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", Worksheet: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet", CalcChain: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain", SharedStrings: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings", Styles: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles", Theme: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme", Hyperlink: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", Image: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", CoreProperties: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties", ExtenderProperties: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", Comments: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments", VmlDrawing: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing", Table: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table" };
}, {}], 32: [function(e, t, r) {
const n = e("../../utils/parse-sax"), i = e("../../utils/xml-stream");
class s {
prepare() {
}
render() {
}
parseOpen(e2) {
}
parseText(e2) {
}
parseClose(e2) {
}
reconcile(e2, t2) {
}
reset() {
this.model = null, this.map && Object.values(this.map).forEach((e2) => {
e2 instanceof s ? e2.reset() : e2.xform && e2.xform.reset();
});
}
mergeModel(e2) {
this.model = Object.assign(this.model || {}, e2);
}
async parse(e2) {
for await (const t2 of e2) for (const { eventType: e3, value: r2 } of t2) if ("opentag" === e3) this.parseOpen(r2);
else if ("text" === e3) this.parseText(r2);
else if ("closetag" === e3 && !this.parseClose(r2.name)) return this.model;
return this.model;
}
async parseStream(e2) {
return this.parse(n(e2));
}
get xml() {
return this.toXml(this.model);
}
toXml(e2) {
const t2 = new i();
return this.render(t2, e2), t2.xml;
}
static toAttribute(e2, t2) {
let r2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
if (void 0 === e2) {
if (r2) return t2;
} else if (r2 || e2 !== t2) return e2.toString();
}
static toStringAttribute(e2, t2) {
let r2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
return s.toAttribute(e2, t2, r2);
}
static toStringValue(e2, t2) {
return void 0 === e2 ? t2 : e2;
}
static toBoolAttribute(e2, t2) {
let r2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
if (void 0 === e2) {
if (r2) return t2;
} else if (r2 || e2 !== t2) return e2 ? "1" : "0";
}
static toBoolValue(e2, t2) {
return void 0 === e2 ? t2 : "1" === e2;
}
static toIntAttribute(e2, t2) {
let r2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
return s.toAttribute(e2, t2, r2);
}
static toIntValue(e2, t2) {
return void 0 === e2 ? t2 : parseInt(e2, 10);
}
static toFloatAttribute(e2, t2) {
let r2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
return s.toAttribute(e2, t2, r2);
}
static toFloatValue(e2, t2) {
return void 0 === e2 ? t2 : parseFloat(e2);
}
}
t.exports = s;
}, { "../../utils/parse-sax": 22, "../../utils/xml-stream": 28 }], 33: [function(e, t, r) {
const n = e("../base-xform"), i = e("../../../utils/col-cache");
function s(e2) {
try {
return i.decodeEx(e2), true;
} catch (e3) {
return false;
}
}
function o(e2) {
const t2 = [];
let r2 = false, n2 = "";
return e2.split(",").forEach((e3) => {
if (!e3) return;
const i2 = (e3.match(/'/g) || []).length;
if (!i2) return void (r2 ? n2 += e3 + "," : s(e3) && t2.push(e3));
const o2 = i2 % 2 == 0;
!r2 && o2 && s(e3) ? t2.push(e3) : r2 && !o2 ? (r2 = false, s(n2 + e3) && t2.push(n2 + e3), n2 = "") : (r2 = true, n2 += e3 + ",");
}), t2;
}
t.exports = class extends n {
render(e2, t2) {
e2.openNode("definedName", { name: t2.name, localSheetId: t2.localSheetId }), e2.writeText(t2.ranges.join(",")), e2.closeNode();
}
parseOpen(e2) {
switch (e2.name) {
case "definedName":
return this._parsedName = e2.attributes.name, this._parsedLocalSheetId = e2.attributes.localSheetId, this._parsedText = [], true;
default:
return false;
}
}
parseText(e2) {
this._parsedText.push(e2);
}
parseClose() {
return this.model = { name: this._parsedName, ranges: o(this._parsedText.join("")) }, void 0 !== this._parsedLocalSheetId && (this.model.localSheetId = parseInt(this._parsedLocalSheetId, 10)), false;
}
};
}, { "../../../utils/col-cache": 19, "../base-xform": 32 }], 34: [function(e, t, r) {
const n = e("../../../utils/utils"), i = e("../base-xform");
t.exports = class extends i {
render(e2, t2) {
e2.leafNode("sheet", { sheetId: t2.id, name: t2.name, state: t2.state, "r:id": t2.rId });
}
parseOpen(e2) {
return "sheet" === e2.name && (this.model = { name: n.xmlDecode(e2.attributes.name), id: parseInt(e2.attributes.sheetId, 10), state: e2.attributes.state, rId: e2.attributes["r:id"] }, true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../../../utils/utils": 27, "../base-xform": 32 }], 35: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
render(e2, t2) {
e2.leafNode("calcPr", { calcId: 171027, fullCalcOnLoad: t2.fullCalcOnLoad ? 1 : void 0 });
}
parseOpen(e2) {
return "calcPr" === e2.name && (this.model = {}, true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 36: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
render(e2, t2) {
e2.leafNode("workbookPr", { date1904: t2.date1904 ? 1 : void 0, defaultThemeVersion: 164011, filterPrivacy: 1 });
}
parseOpen(e2) {
return "workbookPr" === e2.name && (this.model = { date1904: "1" === e2.attributes.date1904 }, true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 37: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
render(e2, t2) {
const r2 = { xWindow: t2.x || 0, yWindow: t2.y || 0, windowWidth: t2.width || 12e3, windowHeight: t2.height || 24e3, firstSheet: t2.firstSheet, activeTab: t2.activeTab };
t2.visibility && "visible" !== t2.visibility && (r2.visibility = t2.visibility), e2.leafNode("workbookView", r2);
}
parseOpen(e2) {
if ("workbookView" === e2.name) {
const t2 = this.model = {}, r2 = function(e3, r3, n3) {
const i = void 0 !== r3 ? t2[e3] = r3 : n3;
void 0 !== i && (t2[e3] = i);
}, n2 = function(e3, r3, n3) {
const i = void 0 !== r3 ? t2[e3] = parseInt(r3, 10) : n3;
void 0 !== i && (t2[e3] = i);
};
return n2("x", e2.attributes.xWindow, 0), n2("y", e2.attributes.yWindow, 0), n2("width", e2.attributes.windowWidth, 25e3), n2("height", e2.attributes.windowHeight, 1e4), r2("visibility", e2.attributes.visibility, "visible"), n2("activeTab", e2.attributes.activeTab, void 0), n2("firstSheet", e2.attributes.firstSheet, void 0), true;
}
return false;
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 38: [function(e, t, r) {
const n = e("../../../utils/under-dash"), i = e("../../../utils/col-cache"), s = e("../../../utils/xml-stream"), o = e("../base-xform"), a = e("../static-xform"), l = e("../list-xform"), c = e("./defined-name-xform"), u = e("./sheet-xform"), h = e("./workbook-view-xform"), f = e("./workbook-properties-xform"), d = e("./workbook-calc-properties-xform");
class p extends o {
constructor() {
super(), this.map = { fileVersion: p.STATIC_XFORMS.fileVersion, workbookPr: new f(), bookViews: new l({ tag: "bookViews", count: false, childXform: new h() }), sheets: new l({ tag: "sheets", count: false, childXform: new u() }), definedNames: new l({ tag: "definedNames", count: false, childXform: new c() }), calcPr: new d() };
}
prepare(e2) {
e2.sheets = e2.worksheets;
const t2 = [];
let r2 = 0;
e2.sheets.forEach((e3) => {
if (e3.pageSetup && e3.pageSetup.printArea && e3.pageSetup.printArea.split("&&").forEach((n2) => {
const i2 = n2.split(":"), s2 = { name: "_xlnm.Print_Area", ranges: [`'${e3.name}'!$${i2[0]}:$${i2[1]}`], localSheetId: r2 };
t2.push(s2);
}), e3.pageSetup && (e3.pageSetup.printTitlesRow || e3.pageSetup.printTitlesColumn)) {
const n2 = [];
if (e3.pageSetup.printTitlesColumn) {
const t3 = e3.pageSetup.printTitlesColumn.split(":");
n2.push(`'${e3.name}'!$${t3[0]}:$${t3[1]}`);
}
if (e3.pageSetup.printTitlesRow) {
const t3 = e3.pageSetup.printTitlesRow.split(":");
n2.push(`'${e3.name}'!$${t3[0]}:$${t3[1]}`);
}
const i2 = { name: "_xlnm.Print_Titles", ranges: n2, localSheetId: r2 };
t2.push(i2);
}
r2++;
}), t2.length && (e2.definedNames = e2.definedNames.concat(t2)), (e2.media || []).forEach((e3, t3) => {
e3.name = e3.type + (t3 + 1);
});
}
render(e2, t2) {
e2.openXml(s.StdDocAttributes), e2.openNode("workbook", p.WORKBOOK_ATTRIBUTES), this.map.fileVersion.render(e2), this.map.workbookPr.render(e2, t2.properties), this.map.bookViews.render(e2, t2.views), this.map.sheets.render(e2, t2.sheets), this.map.definedNames.render(e2, t2.definedNames), this.map.calcPr.render(e2, t2.calcProperties), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "workbook":
return true;
default:
return this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2), true;
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case "workbook":
return this.model = { sheets: this.map.sheets.model, properties: this.map.workbookPr.model || {}, views: this.map.bookViews.model, calcProperties: {} }, this.map.definedNames.model && (this.model.definedNames = this.map.definedNames.model), false;
default:
return true;
}
}
reconcile(e2) {
const t2 = (e2.workbookRels || []).reduce((e3, t3) => (e3[t3.Id] = t3, e3), {}), r2 = [];
let s2, o2 = 0;
(e2.sheets || []).forEach((n2) => {
const i2 = t2[n2.rId];
i2 && (s2 = e2.worksheetHash["xl/" + i2.Target.replace(/^(\s|\/xl\/)+/, "")], s2 && (s2.name = n2.name, s2.id = n2.id, s2.state = n2.state, r2[o2++] = s2));
});
const a2 = [];
n.each(e2.definedNames, (e3) => {
if ("_xlnm.Print_Area" === e3.name) {
if (s2 = r2[e3.localSheetId], s2) {
s2.pageSetup || (s2.pageSetup = {});
const t3 = i.decodeEx(e3.ranges[0]);
s2.pageSetup.printArea = s2.pageSetup.printArea ? `${s2.pageSetup.printArea}&&${t3.dimensions}` : t3.dimensions;
}
} else if ("_xlnm.Print_Titles" === e3.name) {
if (s2 = r2[e3.localSheetId], s2) {
s2.pageSetup || (s2.pageSetup = {});
const t3 = e3.ranges.join(","), r3 = /\$/g, n2 = /\$\d+:\$\d+/, i2 = t3.match(n2);
if (i2 && i2.length) {
const e4 = i2[0];
s2.pageSetup.printTitlesRow = e4.replace(r3, "");
}
const o3 = /\$[A-Z]+:\$[A-Z]+/, a3 = t3.match(o3);
if (a3 && a3.length) {
const e4 = a3[0];
s2.pageSetup.printTitlesColumn = e4.replace(r3, "");
}
}
} else a2.push(e3);
}), e2.definedNames = a2, e2.media.forEach((e3, t3) => {
e3.index = t3;
});
}
}
p.WORKBOOK_ATTRIBUTES = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships", "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", "mc:Ignorable": "x15", "xmlns:x15": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main" }, p.STATIC_XFORMS = { fileVersion: new a({ tag: "fileVersion", $: { appName: "xl", lastEdited: 5, lowestEdited: 5, rupBuild: 9303 } }) }, t.exports = p;
}, { "../../../utils/col-cache": 19, "../../../utils/under-dash": 26, "../../../utils/xml-stream": 28, "../base-xform": 32, "../list-xform": 71, "../static-xform": 120, "./defined-name-xform": 33, "./sheet-xform": 34, "./workbook-calc-properties-xform": 35, "./workbook-properties-xform": 36, "./workbook-view-xform": 37 }], 39: [function(e, t, r) {
const n = e("../strings/rich-text-xform"), i = e("../../../utils/utils"), s = e("../base-xform"), o = t.exports = function(e2) {
this.model = e2;
};
i.inherits(o, s, { get tag() {
return "r";
}, get richTextXform() {
return this._richTextXform || (this._richTextXform = new n()), this._richTextXform;
}, render(e2, t2) {
t2 = t2 || this.model, e2.openNode("comment", { ref: t2.ref, authorId: 0 }), e2.openNode("text"), t2 && t2.note && t2.note.texts && t2.note.texts.forEach((t3) => {
this.richTextXform.render(e2, t3);
}), e2.closeNode(), e2.closeNode();
}, parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "comment":
return this.model = { type: "note", note: { texts: [] }, ...e2.attributes }, true;
case "r":
return this.parser = this.richTextXform, this.parser.parseOpen(e2), true;
default:
return false;
}
}, parseText(e2) {
this.parser && this.parser.parseText(e2);
}, parseClose(e2) {
switch (e2) {
case "comment":
return false;
case "r":
return this.model.note.texts.push(this.parser.model), this.parser = void 0, true;
default:
return this.parser && this.parser.parseClose(e2), true;
}
} });
}, { "../../../utils/utils": 27, "../base-xform": 32, "../strings/rich-text-xform": 122 }], 40: [function(e, t, r) {
const n = e("../../../utils/xml-stream"), i = e("../../../utils/utils"), s = e("../base-xform"), o = e("./comment-xform"), a = t.exports = function() {
this.map = { comment: new o() };
};
i.inherits(a, s, { COMMENTS_ATTRIBUTES: { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" } }, { render(e2, t2) {
t2 = t2 || this.model, e2.openXml(n.StdDocAttributes), e2.openNode("comments", a.COMMENTS_ATTRIBUTES), e2.openNode("authors"), e2.leafNode("author", null, "Author"), e2.closeNode(), e2.openNode("commentList"), t2.comments.forEach((t3) => {
this.map.comment.render(e2, t3);
}), e2.closeNode(), e2.closeNode();
}, parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "commentList":
return this.model = { comments: [] }, true;
case "comment":
return this.parser = this.map.comment, this.parser.parseOpen(e2), true;
default:
return false;
}
}, parseText(e2) {
this.parser && this.parser.parseText(e2);
}, parseClose(e2) {
switch (e2) {
case "commentList":
return false;
case "comment":
return this.model.comments.push(this.parser.model), this.parser = void 0, true;
default:
return this.parser && this.parser.parseClose(e2), true;
}
} });
}, { "../../../utils/utils": 27, "../../../utils/xml-stream": 28, "../base-xform": 32, "./comment-xform": 39 }], 41: [function(e, t, r) {
const n = e("../../base-xform");
t.exports = class extends n {
constructor(e2) {
super(), this._model = e2;
}
get tag() {
return this._model && this._model.tag;
}
render(e2, t2, r2) {
(t2 === r2[2] || "x:SizeWithCells" === this.tag && t2 === r2[1]) && e2.leafNode(this.tag);
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.model = {}, this.model[this.tag] = true, true;
default:
return false;
}
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../../base-xform": 32 }], 42: [function(e, t, r) {
const n = e("../../base-xform");
t.exports = class extends n {
constructor(e2) {
super(), this._model = e2;
}
get tag() {
return this._model && this._model.tag;
}
render(e2, t2) {
e2.leafNode(this.tag, null, t2);
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.text = "", true;
default:
return false;
}
}
parseText(e2) {
this.text = e2;
}
parseClose() {
return false;
}
};
}, { "../../base-xform": 32 }], 43: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "x:Anchor";
}
getAnchorRect(e2) {
const t2 = Math.floor(e2.left), r2 = Math.floor(68 * (e2.left - t2)), n2 = Math.floor(e2.top), i = Math.floor(18 * (e2.top - n2)), s = Math.floor(e2.right), o = Math.floor(68 * (e2.right - s)), a = Math.floor(e2.bottom);
return [t2, r2, n2, i, s, o, a, Math.floor(18 * (e2.bottom - a))];
}
getDefaultRect(e2) {
const t2 = e2.col, r2 = Math.max(e2.row - 2, 0);
return [t2, 6, r2, 14, t2 + 2, 2, r2 + 4, 16];
}
render(e2, t2) {
const r2 = t2.anchor ? this.getAnchorRect(t2.anchor) : this.getDefaultRect(t2.refAddress);
e2.leafNode("x:Anchor", null, r2.join(", "));
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.text = "", true;
default:
return false;
}
}
parseText(e2) {
this.text = e2;
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 44: [function(e, t, r) {
const n = e("../base-xform"), i = e("./vml-anchor-xform"), s = e("./style/vml-protection-xform"), o = e("./style/vml-position-xform"), a = ["twoCells", "oneCells", "absolute"];
t.exports = class extends n {
constructor() {
super(), this.map = { "x:Anchor": new i(), "x:Locked": new s({ tag: "x:Locked" }), "x:LockText": new s({ tag: "x:LockText" }), "x:SizeWithCells": new o({ tag: "x:SizeWithCells" }), "x:MoveWithCells": new o({ tag: "x:MoveWithCells" }) };
}
get tag() {
return "x:ClientData";
}
render(e2, t2) {
const { protection: r2, editAs: n2 } = t2.note;
e2.openNode(this.tag, { ObjectType: "Note" }), this.map["x:MoveWithCells"].render(e2, n2, a), this.map["x:SizeWithCells"].render(e2, n2, a), this.map["x:Anchor"].render(e2, t2), this.map["x:Locked"].render(e2, r2.locked), e2.leafNode("x:AutoFill", null, "False"), this.map["x:LockText"].render(e2, r2.lockText), e2.leafNode("x:Row", null, t2.refAddress.row - 1), e2.leafNode("x:Column", null, t2.refAddress.col - 1), e2.closeNode();
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
this.reset(), this.model = { anchor: [], protection: {}, editAs: "" };
break;
default:
this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2);
}
return true;
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case this.tag:
return this.normalizeModel(), false;
default:
return true;
}
}
normalizeModel() {
const e2 = Object.assign({}, this.map["x:MoveWithCells"].model, this.map["x:SizeWithCells"].model), t2 = Object.keys(e2).length;
this.model.editAs = a[t2], this.model.anchor = this.map["x:Anchor"].text, this.model.protection.locked = this.map["x:Locked"].text, this.model.protection.lockText = this.map["x:LockText"].text;
}
};
}, { "../base-xform": 32, "./style/vml-position-xform": 41, "./style/vml-protection-xform": 42, "./vml-anchor-xform": 43 }], 45: [function(e, t, r) {
const n = e("../../../utils/xml-stream"), i = e("../base-xform"), s = e("./vml-shape-xform");
class o extends i {
constructor() {
super(), this.map = { "v:shape": new s() };
}
get tag() {
return "xml";
}
render(e2, t2) {
e2.openXml(n.StdDocAttributes), e2.openNode(this.tag, o.DRAWING_ATTRIBUTES), e2.openNode("o:shapelayout", { "v:ext": "edit" }), e2.leafNode("o:idmap", { "v:ext": "edit", data: 1 }), e2.closeNode(), e2.openNode("v:shapetype", { id: "_x0000_t202", coordsize: "21600,21600", "o:spt": 202, path: "m,l,21600r21600,l21600,xe" }), e2.leafNode("v:stroke", { joinstyle: "miter" }), e2.leafNode("v:path", { gradientshapeok: "t", "o:connecttype": "rect" }), e2.closeNode(), t2.comments.forEach((t3, r2) => {
this.map["v:shape"].render(e2, t3, r2);
}), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.tag:
this.reset(), this.model = { comments: [] };
break;
default:
this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2);
}
return true;
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.model.comments.push(this.parser.model), this.parser = void 0), true;
switch (e2) {
case this.tag:
return false;
default:
return true;
}
}
reconcile(e2, t2) {
e2.anchors.forEach((e3) => {
e3.br ? this.map["xdr:twoCellAnchor"].reconcile(e3, t2) : this.map["xdr:oneCellAnchor"].reconcile(e3, t2);
});
}
}
o.DRAWING_ATTRIBUTES = { "xmlns:v": "urn:schemas-microsoft-com:vml", "xmlns:o": "urn:schemas-microsoft-com:office:office", "xmlns:x": "urn:schemas-microsoft-com:office:excel" }, t.exports = o;
}, { "../../../utils/xml-stream": 28, "../base-xform": 32, "./vml-shape-xform": 46 }], 46: [function(e, t, r) {
const n = e("../base-xform"), i = e("./vml-textbox-xform"), s = e("./vml-client-data-xform");
class o extends n {
constructor() {
super(), this.map = { "v:textbox": new i(), "x:ClientData": new s() };
}
get tag() {
return "v:shape";
}
render(e2, t2, r2) {
e2.openNode("v:shape", o.V_SHAPE_ATTRIBUTES(t2, r2)), e2.leafNode("v:fill", { color2: "infoBackground [80]" }), e2.leafNode("v:shadow", { color: "none [81]", obscured: "t" }), e2.leafNode("v:path", { "o:connecttype": "none" }), this.map["v:textbox"].render(e2, t2), this.map["x:ClientData"].render(e2, t2), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.tag:
this.reset(), this.model = { margins: { insetmode: e2.attributes["o:insetmode"] }, anchor: "", editAs: "", protection: {} };
break;
default:
this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2);
}
return true;
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case this.tag:
return this.model.margins.inset = this.map["v:textbox"].model && this.map["v:textbox"].model.inset, this.model.protection = this.map["x:ClientData"].model && this.map["x:ClientData"].model.protection, this.model.anchor = this.map["x:ClientData"].model && this.map["x:ClientData"].model.anchor, this.model.editAs = this.map["x:ClientData"].model && this.map["x:ClientData"].model.editAs, false;
default:
return true;
}
}
}
o.V_SHAPE_ATTRIBUTES = (e2, t2) => ({ id: "_x0000_s" + (1025 + t2), type: "#_x0000_t202", style: "position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden", fillcolor: "infoBackground [80]", strokecolor: "none [81]", "o:insetmode": e2.note.margins && e2.note.margins.insetmode }), t.exports = o;
}, { "../base-xform": 32, "./vml-client-data-xform": 44, "./vml-textbox-xform": 47 }], 47: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "v:textbox";
}
conversionUnit(e2, t2, r2) {
return `${parseFloat(e2) * t2.toFixed(2)}${r2}`;
}
reverseConversionUnit(e2) {
return (e2 || "").split(",").map((e3) => Number(parseFloat(this.conversionUnit(parseFloat(e3), 0.1, "")).toFixed(2)));
}
render(e2, t2) {
const r2 = { style: "mso-direction-alt:auto" };
if (t2 && t2.note) {
let { inset: e3 } = t2.note && t2.note.margins;
Array.isArray(e3) && (e3 = e3.map((e4) => this.conversionUnit(e4, 10, "mm")).join(",")), e3 && (r2.inset = e3);
}
e2.openNode("v:textbox", r2), e2.leafNode("div", { style: "text-align:left" }), e2.closeNode();
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.model = { inset: this.reverseConversionUnit(e2.attributes.inset) }, true;
default:
return true;
}
}
parseText() {
}
parseClose(e2) {
switch (e2) {
case this.tag:
return false;
default:
return true;
}
}
};
}, { "../base-xform": 32 }], 48: [function(e, t, r) {
const n = e("./base-xform");
t.exports = class extends n {
createNewModel(e2) {
return {};
}
parseOpen(e2) {
return this.parser = this.parser || this.map[e2.name], this.parser ? (this.parser.parseOpen(e2), true) : e2.name === this.tag && (this.model = this.createNewModel(e2), true);
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
onParserClose(e2, t2) {
this.model[e2] = t2.model;
}
parseClose(e2) {
return this.parser ? (this.parser.parseClose(e2) || (this.onParserClose(e2, this.parser), this.parser = void 0), true) : e2 !== this.tag;
}
};
}, { "./base-xform": 32 }], 49: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
render(e2, t2) {
e2.openNode("HeadingPairs"), e2.openNode("vt:vector", { size: 2, baseType: "variant" }), e2.openNode("vt:variant"), e2.leafNode("vt:lpstr", void 0, "Worksheets"), e2.closeNode(), e2.openNode("vt:variant"), e2.leafNode("vt:i4", void 0, t2.length), e2.closeNode(), e2.closeNode(), e2.closeNode();
}
parseOpen(e2) {
return "HeadingPairs" === e2.name;
}
parseText() {
}
parseClose(e2) {
return "HeadingPairs" !== e2;
}
};
}, { "../base-xform": 32 }], 50: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
render(e2, t2) {
e2.openNode("TitlesOfParts"), e2.openNode("vt:vector", { size: t2.length, baseType: "lpstr" }), t2.forEach((t3) => {
e2.leafNode("vt:lpstr", void 0, t3.name);
}), e2.closeNode(), e2.closeNode();
}
parseOpen(e2) {
return "TitlesOfParts" === e2.name;
}
parseText() {
}
parseClose(e2) {
return "TitlesOfParts" !== e2;
}
};
}, { "../base-xform": 32 }], 51: [function(e, t, r) {
const n = e("../../../utils/xml-stream"), i = e("../base-xform"), s = e("../simple/string-xform"), o = e("./app-heading-pairs-xform"), a = e("./app-titles-of-parts-xform");
class l extends i {
constructor() {
super(), this.map = { Company: new s({ tag: "Company" }), Manager: new s({ tag: "Manager" }), HeadingPairs: new o(), TitleOfParts: new a() };
}
render(e2, t2) {
e2.openXml(n.StdDocAttributes), e2.openNode("Properties", l.PROPERTY_ATTRIBUTES), e2.leafNode("Application", void 0, "Microsoft Excel"), e2.leafNode("DocSecurity", void 0, "0"), e2.leafNode("ScaleCrop", void 0, "false"), this.map.HeadingPairs.render(e2, t2.worksheets), this.map.TitleOfParts.render(e2, t2.worksheets), this.map.Company.render(e2, t2.company || ""), this.map.Manager.render(e2, t2.manager), e2.leafNode("LinksUpToDate", void 0, "false"), e2.leafNode("SharedDoc", void 0, "false"), e2.leafNode("HyperlinksChanged", void 0, "false"), e2.leafNode("AppVersion", void 0, "16.0300"), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "Properties":
return true;
default:
return this.parser = this.map[e2.name], !!this.parser && (this.parser.parseOpen(e2), true);
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case "Properties":
return this.model = { worksheets: this.map.TitleOfParts.model, company: this.map.Company.model, manager: this.map.Manager.model }, false;
default:
return true;
}
}
}
l.DateFormat = function(e2) {
return e2.toISOString().replace(/[.]\d{3,6}/, "");
}, l.DateAttrs = { "xsi:type": "dcterms:W3CDTF" }, l.PROPERTY_ATTRIBUTES = { xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", "xmlns:vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes" }, t.exports = l;
}, { "../../../utils/xml-stream": 28, "../base-xform": 32, "../simple/string-xform": 119, "./app-heading-pairs-xform": 49, "./app-titles-of-parts-xform": 50 }], 52: [function(e, t, r) {
const n = e("../../../utils/xml-stream"), i = e("../base-xform");
class s extends i {
render(e2, t2) {
e2.openXml(n.StdDocAttributes), e2.openNode("Types", s.PROPERTY_ATTRIBUTES);
const r2 = {};
(t2.media || []).forEach((t3) => {
if ("image" === t3.type) {
const n2 = t3.extension;
r2[n2] || (r2[n2] = true, e2.leafNode("Default", { Extension: n2, ContentType: "image/" + n2 }));
}
}), e2.leafNode("Default", { Extension: "rels", ContentType: "application/vnd.openxmlformats-package.relationships+xml" }), e2.leafNode("Default", { Extension: "xml", ContentType: "application/xml" }), e2.leafNode("Override", { PartName: "/xl/workbook.xml", ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" }), t2.worksheets.forEach((t3) => {
const r3 = `/xl/worksheets/sheet${t3.id}.xml`;
e2.leafNode("Override", { PartName: r3, ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" });
}), e2.leafNode("Override", { PartName: "/xl/theme/theme1.xml", ContentType: "application/vnd.openxmlformats-officedocument.theme+xml" }), e2.leafNode("Override", { PartName: "/xl/styles.xml", ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" });
t2.sharedStrings && t2.sharedStrings.count && e2.leafNode("Override", { PartName: "/xl/sharedStrings.xml", ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" }), t2.tables && t2.tables.forEach((t3) => {
e2.leafNode("Override", { PartName: "/xl/tables/" + t3.target, ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml" });
}), t2.drawings && t2.drawings.forEach((t3) => {
e2.leafNode("Override", { PartName: `/xl/drawings/${t3.name}.xml`, ContentType: "application/vnd.openxmlformats-officedocument.drawing+xml" });
}), t2.commentRefs && (e2.leafNode("Default", { Extension: "vml", ContentType: "application/vnd.openxmlformats-officedocument.vmlDrawing" }), t2.commentRefs.forEach((t3) => {
let { commentName: r3 } = t3;
e2.leafNode("Override", { PartName: `/xl/${r3}.xml`, ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml" });
})), e2.leafNode("Override", { PartName: "/docProps/core.xml", ContentType: "application/vnd.openxmlformats-package.core-properties+xml" }), e2.leafNode("Override", { PartName: "/docProps/app.xml", ContentType: "application/vnd.openxmlformats-officedocument.extended-properties+xml" }), e2.closeNode();
}
parseOpen() {
return false;
}
parseText() {
}
parseClose() {
return false;
}
}
s.PROPERTY_ATTRIBUTES = { xmlns: "http://schemas.openxmlformats.org/package/2006/content-types" }, t.exports = s;
}, { "../../../utils/xml-stream": 28, "../base-xform": 32 }], 53: [function(e, t, r) {
const n = e("../../../utils/xml-stream"), i = e("../base-xform"), s = e("../simple/date-xform"), o = e("../simple/string-xform"), a = e("../simple/integer-xform");
class l extends i {
constructor() {
super(), this.map = { "dc:creator": new o({ tag: "dc:creator" }), "dc:title": new o({ tag: "dc:title" }), "dc:subject": new o({ tag: "dc:subject" }), "dc:description": new o({ tag: "dc:description" }), "dc:identifier": new o({ tag: "dc:identifier" }), "dc:language": new o({ tag: "dc:language" }), "cp:keywords": new o({ tag: "cp:keywords" }), "cp:category": new o({ tag: "cp:category" }), "cp:lastModifiedBy": new o({ tag: "cp:lastModifiedBy" }), "cp:lastPrinted": new s({ tag: "cp:lastPrinted", format: l.DateFormat }), "cp:revision": new a({ tag: "cp:revision" }), "cp:version": new o({ tag: "cp:version" }), "cp:contentStatus": new o({ tag: "cp:contentStatus" }), "cp:contentType": new o({ tag: "cp:contentType" }), "dcterms:created": new s({ tag: "dcterms:created", attrs: l.DateAttrs, format: l.DateFormat }), "dcterms:modified": new s({ tag: "dcterms:modified", attrs: l.DateAttrs, format: l.DateFormat }) };
}
render(e2, t2) {
e2.openXml(n.StdDocAttributes), e2.openNode("cp:coreProperties", l.CORE_PROPERTY_ATTRIBUTES), this.map["dc:creator"].render(e2, t2.creator), this.map["dc:title"].render(e2, t2.title), this.map["dc:subject"].render(e2, t2.subject), this.map["dc:description"].render(e2, t2.description), this.map["dc:identifier"].render(e2, t2.identifier), this.map["dc:language"].render(e2, t2.language), this.map["cp:keywords"].render(e2, t2.keywords), this.map["cp:category"].render(e2, t2.category), this.map["cp:lastModifiedBy"].render(e2, t2.lastModifiedBy), this.map["cp:lastPrinted"].render(e2, t2.lastPrinted), this.map["cp:revision"].render(e2, t2.revision), this.map["cp:version"].render(e2, t2.version), this.map["cp:contentStatus"].render(e2, t2.contentStatus), this.map["cp:contentType"].render(e2, t2.contentType), this.map["dcterms:created"].render(e2, t2.created), this.map["dcterms:modified"].render(e2, t2.modified), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "cp:coreProperties":
case "coreProperties":
return true;
default:
if (this.parser = this.map[e2.name], this.parser) return this.parser.parseOpen(e2), true;
throw new Error("Unexpected xml node in parseOpen: " + JSON.stringify(e2));
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case "cp:coreProperties":
case "coreProperties":
return this.model = { creator: this.map["dc:creator"].model, title: this.map["dc:title"].model, subject: this.map["dc:subject"].model, description: this.map["dc:description"].model, identifier: this.map["dc:identifier"].model, language: this.map["dc:language"].model, keywords: this.map["cp:keywords"].model, category: this.map["cp:category"].model, lastModifiedBy: this.map["cp:lastModifiedBy"].model, lastPrinted: this.map["cp:lastPrinted"].model, revision: this.map["cp:revision"].model, contentStatus: this.map["cp:contentStatus"].model, contentType: this.map["cp:contentType"].model, created: this.map["dcterms:created"].model, modified: this.map["dcterms:modified"].model }, false;
default:
throw new Error("Unexpected xml node in parseClose: " + e2);
}
}
}
l.DateFormat = function(e2) {
return e2.toISOString().replace(/[.]\d{3}/, "");
}, l.DateAttrs = { "xsi:type": "dcterms:W3CDTF" }, l.CORE_PROPERTY_ATTRIBUTES = { "xmlns:cp": "http://schemas.openxmlformats.org/package/2006/metadata/core-properties", "xmlns:dc": "http://purl.org/dc/elements/1.1/", "xmlns:dcterms": "http://purl.org/dc/terms/", "xmlns:dcmitype": "http://purl.org/dc/dcmitype/", "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance" }, t.exports = l;
}, { "../../../utils/xml-stream": 28, "../base-xform": 32, "../simple/date-xform": 117, "../simple/integer-xform": 118, "../simple/string-xform": 119 }], 54: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
render(e2, t2) {
e2.leafNode("Relationship", t2);
}
parseOpen(e2) {
switch (e2.name) {
case "Relationship":
return this.model = e2.attributes, true;
default:
return false;
}
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 55: [function(e, t, r) {
const n = e("../../../utils/xml-stream"), i = e("../base-xform"), s = e("./relationship-xform");
class o extends i {
constructor() {
super(), this.map = { Relationship: new s() };
}
render(e2, t2) {
t2 = t2 || this._values, e2.openXml(n.StdDocAttributes), e2.openNode("Relationships", o.RELATIONSHIPS_ATTRIBUTES), t2.forEach((t3) => {
this.map.Relationship.render(e2, t3);
}), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "Relationships":
return this.model = [], true;
default:
if (this.parser = this.map[e2.name], this.parser) return this.parser.parseOpen(e2), true;
throw new Error("Unexpected xml node in parseOpen: " + JSON.stringify(e2));
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.model.push(this.parser.model), this.parser = void 0), true;
switch (e2) {
case "Relationships":
return false;
default:
throw new Error("Unexpected xml node in parseClose: " + e2);
}
}
}
o.RELATIONSHIPS_ATTRIBUTES = { xmlns: "http://schemas.openxmlformats.org/package/2006/relationships" }, t.exports = o;
}, { "../../../utils/xml-stream": 28, "../base-xform": 32, "./relationship-xform": 54 }], 56: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.tag:
this.reset(), this.model = { range: { editAs: e2.attributes.editAs || "oneCell" } };
break;
default:
this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2);
}
return true;
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
reconcilePicture(e2, t2) {
if (e2 && e2.rId) {
const r2 = t2.rels[e2.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);
if (r2) {
const e3 = r2[1], n2 = t2.mediaIndex[e3];
return t2.media[n2];
}
}
}
};
}, { "../base-xform": 32 }], 57: [function(e, t, r) {
const n = e("../base-xform"), i = e("./blip-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { "a:blip": new i() };
}
get tag() {
return "xdr:blipFill";
}
render(e2, t2) {
e2.openNode(this.tag), this.map["a:blip"].render(e2, t2), e2.openNode("a:stretch"), e2.leafNode("a:fillRect"), e2.closeNode(), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.tag:
this.reset();
break;
default:
this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2);
}
return true;
}
parseText() {
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case this.tag:
return this.model = this.map["a:blip"].model, false;
default:
return true;
}
}
};
}, { "../base-xform": 32, "./blip-xform": 58 }], 58: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "a:blip";
}
render(e2, t2) {
e2.leafNode(this.tag, { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships", "r:embed": t2.rId, cstate: "print" });
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.model = { rId: e2.attributes["r:embed"] }, true;
default:
return true;
}
}
parseText() {
}
parseClose(e2) {
switch (e2) {
case this.tag:
return false;
default:
return true;
}
}
};
}, { "../base-xform": 32 }], 59: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "xdr:cNvPicPr";
}
render(e2) {
e2.openNode(this.tag), e2.leafNode("a:picLocks", { noChangeAspect: "1" }), e2.closeNode();
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
default:
return true;
}
}
parseText() {
}
parseClose(e2) {
switch (e2) {
case this.tag:
return false;
default:
return true;
}
}
};
}, { "../base-xform": 32 }], 60: [function(e, t, r) {
const n = e("../base-xform"), i = e("./hlink-click-xform"), s = e("./ext-lst-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { "a:hlinkClick": new i(), "a:extLst": new s() };
}
get tag() {
return "xdr:cNvPr";
}
render(e2, t2) {
e2.openNode(this.tag, { id: t2.index, name: "Picture " + t2.index }), this.map["a:hlinkClick"].render(e2, t2), this.map["a:extLst"].render(e2, t2), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.tag:
this.reset();
break;
default:
this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2);
}
return true;
}
parseText() {
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case this.tag:
return this.model = this.map["a:hlinkClick"].model, false;
default:
return true;
}
}
};
}, { "../base-xform": 32, "./ext-lst-xform": 63, "./hlink-click-xform": 65 }], 61: [function(e, t, r) {
const n = e("../base-xform"), i = e("../simple/integer-xform");
t.exports = class extends n {
constructor(e2) {
super(), this.tag = e2.tag, this.map = { "xdr:col": new i({ tag: "xdr:col", zero: true }), "xdr:colOff": new i({ tag: "xdr:colOff", zero: true }), "xdr:row": new i({ tag: "xdr:row", zero: true }), "xdr:rowOff": new i({ tag: "xdr:rowOff", zero: true }) };
}
render(e2, t2) {
e2.openNode(this.tag), this.map["xdr:col"].render(e2, t2.nativeCol), this.map["xdr:colOff"].render(e2, t2.nativeColOff), this.map["xdr:row"].render(e2, t2.nativeRow), this.map["xdr:rowOff"].render(e2, t2.nativeRowOff), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.tag:
this.reset();
break;
default:
this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2);
}
return true;
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case this.tag:
return this.model = { nativeCol: this.map["xdr:col"].model, nativeColOff: this.map["xdr:colOff"].model, nativeRow: this.map["xdr:row"].model, nativeRowOff: this.map["xdr:rowOff"].model }, false;
default:
return true;
}
}
};
}, { "../base-xform": 32, "../simple/integer-xform": 118 }], 62: [function(e, t, r) {
const n = e("../../../utils/col-cache"), i = e("../../../utils/xml-stream"), s = e("../base-xform"), o = e("./two-cell-anchor-xform"), a = e("./one-cell-anchor-xform");
class l extends s {
constructor() {
super(), this.map = { "xdr:twoCellAnchor": new o(), "xdr:oneCellAnchor": new a() };
}
prepare(e2) {
e2.anchors.forEach((e3, t2) => {
e3.anchorType = (function(e4) {
return ("string" == typeof e4.range ? n.decode(e4.range) : e4.range).br ? "xdr:twoCellAnchor" : "xdr:oneCellAnchor";
})(e3);
this.map[e3.anchorType].prepare(e3, { index: t2 });
});
}
get tag() {
return "xdr:wsDr";
}
render(e2, t2) {
e2.openXml(i.StdDocAttributes), e2.openNode(this.tag, l.DRAWING_ATTRIBUTES), t2.anchors.forEach((t3) => {
this.map[t3.anchorType].render(e2, t3);
}), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.tag:
this.reset(), this.model = { anchors: [] };
break;
default:
this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2);
}
return true;
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.model.anchors.push(this.parser.model), this.parser = void 0), true;
switch (e2) {
case this.tag:
return false;
default:
return true;
}
}
reconcile(e2, t2) {
e2.anchors.forEach((e3) => {
e3.br ? this.map["xdr:twoCellAnchor"].reconcile(e3, t2) : this.map["xdr:oneCellAnchor"].reconcile(e3, t2);
});
}
}
l.DRAWING_ATTRIBUTES = { "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing", "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main" }, t.exports = l;
}, { "../../../utils/col-cache": 19, "../../../utils/xml-stream": 28, "../base-xform": 32, "./one-cell-anchor-xform": 67, "./two-cell-anchor-xform": 70 }], 63: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "a:extLst";
}
render(e2) {
e2.openNode(this.tag), e2.openNode("a:ext", { uri: "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}" }), e2.leafNode("a16:creationId", { "xmlns:a16": "http://schemas.microsoft.com/office/drawing/2014/main", id: "{00000000-0008-0000-0000-000002000000}" }), e2.closeNode(), e2.closeNode();
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
default:
return true;
}
}
parseText() {
}
parseClose(e2) {
switch (e2) {
case this.tag:
return false;
default:
return true;
}
}
};
}, { "../base-xform": 32 }], 64: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
constructor(e2) {
super(), this.tag = e2.tag, this.map = {};
}
render(e2, t2) {
e2.openNode(this.tag);
const r2 = Math.floor(9525 * t2.width), n2 = Math.floor(9525 * t2.height);
e2.addAttribute("cx", r2), e2.addAttribute("cy", n2), e2.closeNode();
}
parseOpen(e2) {
return e2.name === this.tag && (this.model = { width: parseInt(e2.attributes.cx || "0", 10) / 9525, height: parseInt(e2.attributes.cy || "0", 10) / 9525 }, true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 65: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "a:hlinkClick";
}
render(e2, t2) {
t2.hyperlinks && t2.hyperlinks.rId && e2.leafNode(this.tag, { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships", "r:id": t2.hyperlinks.rId, tooltip: t2.hyperlinks.tooltip });
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.model = { hyperlinks: { rId: e2.attributes["r:id"], tooltip: e2.attributes.tooltip } }, true;
default:
return true;
}
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 66: [function(e, t, r) {
const n = e("../base-xform"), i = e("./c-nv-pr-xform"), s = e("./c-nv-pic-pr-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { "xdr:cNvPr": new i(), "xdr:cNvPicPr": new s() };
}
get tag() {
return "xdr:nvPicPr";
}
render(e2, t2) {
e2.openNode(this.tag), this.map["xdr:cNvPr"].render(e2, t2), this.map["xdr:cNvPicPr"].render(e2, t2), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.tag:
this.reset();
break;
default:
this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2);
}
return true;
}
parseText() {
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case this.tag:
return this.model = this.map["xdr:cNvPr"].model, false;
default:
return true;
}
}
};
}, { "../base-xform": 32, "./c-nv-pic-pr-xform": 59, "./c-nv-pr-xform": 60 }], 67: [function(e, t, r) {
const n = e("./base-cell-anchor-xform"), i = e("../static-xform"), s = e("./cell-position-xform"), o = e("./ext-xform"), a = e("./pic-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { "xdr:from": new s({ tag: "xdr:from" }), "xdr:ext": new o({ tag: "xdr:ext" }), "xdr:pic": new a(), "xdr:clientData": new i({ tag: "xdr:clientData" }) };
}
get tag() {
return "xdr:oneCellAnchor";
}
prepare(e2, t2) {
this.map["xdr:pic"].prepare(e2.picture, t2);
}
render(e2, t2) {
e2.openNode(this.tag, { editAs: t2.range.editAs || "oneCell" }), this.map["xdr:from"].render(e2, t2.range.tl), this.map["xdr:ext"].render(e2, t2.range.ext), this.map["xdr:pic"].render(e2, t2.picture), this.map["xdr:clientData"].render(e2, {}), e2.closeNode();
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case this.tag:
return this.model.range.tl = this.map["xdr:from"].model, this.model.range.ext = this.map["xdr:ext"].model, this.model.picture = this.map["xdr:pic"].model, false;
default:
return true;
}
}
reconcile(e2, t2) {
e2.medium = this.reconcilePicture(e2.picture, t2);
}
};
}, { "../static-xform": 120, "./base-cell-anchor-xform": 56, "./cell-position-xform": 61, "./ext-xform": 64, "./pic-xform": 68 }], 68: [function(e, t, r) {
const n = e("../base-xform"), i = e("../static-xform"), s = e("./blip-fill-xform"), o = e("./nv-pic-pr-xform"), a = e("./sp-pr");
t.exports = class extends n {
constructor() {
super(), this.map = { "xdr:nvPicPr": new o(), "xdr:blipFill": new s(), "xdr:spPr": new i(a) };
}
get tag() {
return "xdr:pic";
}
prepare(e2, t2) {
e2.index = t2.index + 1;
}
render(e2, t2) {
e2.openNode(this.tag), this.map["xdr:nvPicPr"].render(e2, t2), this.map["xdr:blipFill"].render(e2, t2), this.map["xdr:spPr"].render(e2, t2), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.tag:
this.reset();
break;
default:
this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2);
}
return true;
}
parseText() {
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.mergeModel(this.parser.model), this.parser = void 0), true;
switch (e2) {
case this.tag:
return false;
default:
return true;
}
}
};
}, { "../base-xform": 32, "../static-xform": 120, "./blip-fill-xform": 57, "./nv-pic-pr-xform": 66, "./sp-pr": 69 }], 69: [function(e, t, r) {
t.exports = { tag: "xdr:spPr", c: [{ tag: "a:xfrm", c: [{ tag: "a:off", $: { x: "0", y: "0" } }, { tag: "a:ext", $: { cx: "0", cy: "0" } }] }, { tag: "a:prstGeom", $: { prst: "rect" }, c: [{ tag: "a:avLst" }] }] };
}, {}], 70: [function(e, t, r) {
const n = e("./base-cell-anchor-xform"), i = e("../static-xform"), s = e("./cell-position-xform"), o = e("./pic-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { "xdr:from": new s({ tag: "xdr:from" }), "xdr:to": new s({ tag: "xdr:to" }), "xdr:pic": new o(), "xdr:clientData": new i({ tag: "xdr:clientData" }) };
}
get tag() {
return "xdr:twoCellAnchor";
}
prepare(e2, t2) {
this.map["xdr:pic"].prepare(e2.picture, t2);
}
render(e2, t2) {
e2.openNode(this.tag, { editAs: t2.range.editAs || "oneCell" }), this.map["xdr:from"].render(e2, t2.range.tl), this.map["xdr:to"].render(e2, t2.range.br), this.map["xdr:pic"].render(e2, t2.picture), this.map["xdr:clientData"].render(e2, {}), e2.closeNode();
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case this.tag:
return this.model.range.tl = this.map["xdr:from"].model, this.model.range.br = this.map["xdr:to"].model, this.model.picture = this.map["xdr:pic"].model, false;
default:
return true;
}
}
reconcile(e2, t2) {
e2.medium = this.reconcilePicture(e2.picture, t2);
}
};
}, { "../static-xform": 120, "./base-cell-anchor-xform": 56, "./cell-position-xform": 61, "./pic-xform": 68 }], 71: [function(e, t, r) {
const n = e("./base-xform");
t.exports = class extends n {
constructor(e2) {
super(), this.tag = e2.tag, this.always = !!e2.always, this.count = e2.count, this.empty = e2.empty, this.$count = e2.$count || "count", this.$ = e2.$, this.childXform = e2.childXform, this.maxItems = e2.maxItems;
}
prepare(e2, t2) {
const { childXform: r2 } = this;
e2 && e2.forEach((e3, n2) => {
t2.index = n2, r2.prepare(e3, t2);
});
}
render(e2, t2) {
if (this.always || t2 && t2.length) {
e2.openNode(this.tag, this.$), this.count && e2.addAttribute(this.$count, t2 && t2.length || 0);
const { childXform: r2 } = this;
(t2 || []).forEach((t3, n2) => {
r2.render(e2, t3, n2);
}), e2.closeNode();
} else this.empty && e2.leafNode(this.tag);
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.tag:
return this.model = [], true;
default:
return !!this.childXform.parseOpen(e2) && (this.parser = this.childXform, true);
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) {
if (!this.parser.parseClose(e2) && (this.model.push(this.parser.model), this.parser = void 0, this.maxItems && this.model.length > this.maxItems)) throw new Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);
return true;
}
return false;
}
reconcile(e2, t2) {
if (e2) {
const { childXform: r2 } = this;
e2.forEach((e3) => {
r2.reconcile(e3, t2);
});
}
}
};
}, { "./base-xform": 32 }], 72: [function(e, t, r) {
const n = e("../../../utils/col-cache"), i = e("../base-xform");
t.exports = class extends i {
get tag() {
return "autoFilter";
}
render(e2, t2) {
if (t2) if ("string" == typeof t2) e2.leafNode("autoFilter", { ref: t2 });
else {
const r2 = function(e3) {
return "string" == typeof e3 ? e3 : n.getAddress(e3.row, e3.column).address;
}, i2 = r2(t2.from), s = r2(t2.to);
i2 && s && e2.leafNode("autoFilter", { ref: `${i2}:${s}` });
}
}
parseOpen(e2) {
"autoFilter" === e2.name && (this.model = e2.attributes.ref);
}
};
}, { "../../../utils/col-cache": 19, "../base-xform": 32 }], 73: [function(e, t, r) {
const n = e("../../../utils/utils"), i = e("../base-xform"), s = e("../../../doc/range"), o = e("../../../doc/enums"), a = e("../strings/rich-text-xform");
function l(e2) {
if (null == e2) return o.ValueType.Null;
if (e2 instanceof String || "string" == typeof e2) return o.ValueType.String;
if ("number" == typeof e2) return o.ValueType.Number;
if ("boolean" == typeof e2) return o.ValueType.Boolean;
if (e2 instanceof Date) return o.ValueType.Date;
if (e2.text && e2.hyperlink) return o.ValueType.Hyperlink;
if (e2.formula) return o.ValueType.Formula;
if (e2.error) return o.ValueType.Error;
throw new Error("I could not understand type of value");
}
t.exports = class extends i {
constructor() {
super(), this.richTextXForm = new a();
}
get tag() {
return "c";
}
prepare(e2, t2) {
const r2 = t2.styles.addStyleModel(e2.style || {}, (function(e3) {
switch (e3.type) {
case o.ValueType.Formula:
return l(e3.result);
default:
return e3.type;
}
})(e2));
switch (r2 && (e2.styleId = r2), e2.comment && t2.comments.push({ ...e2.comment, ref: e2.address }), e2.type) {
case o.ValueType.String:
case o.ValueType.RichText:
t2.sharedStrings && (e2.ssId = t2.sharedStrings.add(e2.value));
break;
case o.ValueType.Date:
t2.date1904 && (e2.date1904 = true);
break;
case o.ValueType.Hyperlink:
t2.sharedStrings && void 0 !== e2.text && null !== e2.text && (e2.ssId = t2.sharedStrings.add(e2.text)), t2.hyperlinks.push({ address: e2.address, target: e2.hyperlink, tooltip: e2.tooltip });
break;
case o.ValueType.Merge:
t2.merges.add(e2);
break;
case o.ValueType.Formula:
if (t2.date1904 && (e2.date1904 = true), "shared" === e2.shareType && (e2.si = t2.siFormulae++), e2.formula) t2.formulae[e2.address] = e2;
else if (e2.sharedFormula) {
const r3 = t2.formulae[e2.sharedFormula];
if (!r3) throw new Error("Shared Formula master must exist above and or left of clone for cell " + e2.address);
void 0 === r3.si ? (r3.shareType = "shared", r3.si = t2.siFormulae++, r3.range = new s(r3.address, e2.address)) : r3.range && r3.range.expandToAddress(e2.address), e2.si = r3.si;
}
}
}
renderFormula(e2, t2) {
let r2 = null;
switch (t2.shareType) {
case "shared":
r2 = { t: "shared", ref: t2.ref || t2.range.range, si: t2.si };
break;
case "array":
r2 = { t: "array", ref: t2.ref };
break;
default:
void 0 !== t2.si && (r2 = { t: "shared", si: t2.si });
}
switch (l(t2.result)) {
case o.ValueType.Null:
e2.leafNode("f", r2, t2.formula);
break;
case o.ValueType.String:
e2.addAttribute("t", "str"), e2.leafNode("f", r2, t2.formula), e2.leafNode("v", null, t2.result);
break;
case o.ValueType.Number:
e2.leafNode("f", r2, t2.formula), e2.leafNode("v", null, t2.result);
break;
case o.ValueType.Boolean:
e2.addAttribute("t", "b"), e2.leafNode("f", r2, t2.formula), e2.leafNode("v", null, t2.result ? 1 : 0);
break;
case o.ValueType.Error:
e2.addAttribute("t", "e"), e2.leafNode("f", r2, t2.formula), e2.leafNode("v", null, t2.result.error);
break;
case o.ValueType.Date:
e2.leafNode("f", r2, t2.formula), e2.leafNode("v", null, n.dateToExcel(t2.result, t2.date1904));
break;
default:
throw new Error("I could not understand type of value");
}
}
render(e2, t2) {
if (t2.type !== o.ValueType.Null || t2.styleId) {
switch (e2.openNode("c"), e2.addAttribute("r", t2.address), t2.styleId && e2.addAttribute("s", t2.styleId), t2.type) {
case o.ValueType.Null:
break;
case o.ValueType.Number:
e2.leafNode("v", null, t2.value);
break;
case o.ValueType.Boolean:
e2.addAttribute("t", "b"), e2.leafNode("v", null, t2.value ? "1" : "0");
break;
case o.ValueType.Error:
e2.addAttribute("t", "e"), e2.leafNode("v", null, t2.value.error);
break;
case o.ValueType.String:
case o.ValueType.RichText:
void 0 !== t2.ssId ? (e2.addAttribute("t", "s"), e2.leafNode("v", null, t2.ssId)) : t2.value && t2.value.richText ? (e2.addAttribute("t", "inlineStr"), e2.openNode("is"), t2.value.richText.forEach((t3) => {
this.richTextXForm.render(e2, t3);
}), e2.closeNode("is")) : (e2.addAttribute("t", "str"), e2.leafNode("v", null, t2.value));
break;
case o.ValueType.Date:
e2.leafNode("v", null, n.dateToExcel(t2.value, t2.date1904));
break;
case o.ValueType.Hyperlink:
void 0 !== t2.ssId ? (e2.addAttribute("t", "s"), e2.leafNode("v", null, t2.ssId)) : (e2.addAttribute("t", "str"), e2.leafNode("v", null, t2.text));
break;
case o.ValueType.Formula:
this.renderFormula(e2, t2);
break;
case o.ValueType.Merge:
}
e2.closeNode();
}
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "c":
return this.model = { address: e2.attributes.r }, this.t = e2.attributes.t, e2.attributes.s && (this.model.styleId = parseInt(e2.attributes.s, 10)), true;
case "f":
return this.currentNode = "f", this.model.si = e2.attributes.si, this.model.shareType = e2.attributes.t, this.model.ref = e2.attributes.ref, true;
case "v":
return this.currentNode = "v", true;
case "t":
return this.currentNode = "t", true;
case "r":
return this.parser = this.richTextXForm, this.parser.parseOpen(e2), true;
default:
return false;
}
}
parseText(e2) {
if (this.parser) this.parser.parseText(e2);
else switch (this.currentNode) {
case "f":
this.model.formula = this.model.formula ? this.model.formula + e2 : e2;
break;
case "v":
case "t":
this.model.value && this.model.value.richText ? this.model.value.richText.text = this.model.value.richText.text ? this.model.value.richText.text + e2 : e2 : this.model.value = this.model.value ? this.model.value + e2 : e2;
}
}
parseClose(e2) {
switch (e2) {
case "c": {
const { model: e3 } = this;
if (e3.formula || e3.shareType) e3.type = o.ValueType.Formula, e3.value && ("str" === this.t ? e3.result = n.xmlDecode(e3.value) : "b" === this.t ? e3.result = 0 !== parseInt(e3.value, 10) : "e" === this.t ? e3.result = { error: e3.value } : e3.result = parseFloat(e3.value), e3.value = void 0);
else if (void 0 !== e3.value) switch (this.t) {
case "s":
e3.type = o.ValueType.String, e3.value = parseInt(e3.value, 10);
break;
case "str":
e3.type = o.ValueType.String, e3.value = n.xmlDecode(e3.value);
break;
case "inlineStr":
e3.type = o.ValueType.String;
break;
case "b":
e3.type = o.ValueType.Boolean, e3.value = 0 !== parseInt(e3.value, 10);
break;
case "e":
e3.type = o.ValueType.Error, e3.value = { error: e3.value };
break;
default:
e3.type = o.ValueType.Number, e3.value = parseFloat(e3.value);
}
else e3.styleId ? e3.type = o.ValueType.Null : e3.type = o.ValueType.Merge;
return false;
}
case "f":
case "v":
case "is":
return this.currentNode = void 0, true;
case "t":
return this.parser ? (this.parser.parseClose(e2), true) : (this.currentNode = void 0, true);
case "r":
return this.model.value = this.model.value || {}, this.model.value.richText = this.model.value.richText || [], this.model.value.richText.push(this.parser.model), this.parser = void 0, this.currentNode = void 0, true;
default:
return !!this.parser && (this.parser.parseClose(e2), true);
}
}
reconcile(e2, t2) {
const r2 = e2.styleId && t2.styles && t2.styles.getStyleModel(e2.styleId);
switch (r2 && (e2.style = r2), void 0 !== e2.styleId && (e2.styleId = void 0), e2.type) {
case o.ValueType.String:
"number" == typeof e2.value && t2.sharedStrings && (e2.value = t2.sharedStrings.getString(e2.value)), e2.value.richText && (e2.type = o.ValueType.RichText);
break;
case o.ValueType.Number:
r2 && n.isDateFmt(r2.numFmt) && (e2.type = o.ValueType.Date, e2.value = n.excelToDate(e2.value, t2.date1904));
break;
case o.ValueType.Formula:
void 0 !== e2.result && r2 && n.isDateFmt(r2.numFmt) && (e2.result = n.excelToDate(e2.result, t2.date1904)), "shared" === e2.shareType && (e2.ref ? t2.formulae[e2.si] = e2.address : (e2.sharedFormula = t2.formulae[e2.si], delete e2.shareType), delete e2.si);
}
const i2 = t2.hyperlinkMap[e2.address];
i2 && (e2.type === o.ValueType.Formula ? (e2.text = e2.result, e2.result = void 0) : (e2.text = e2.value, e2.value = void 0), e2.type = o.ValueType.Hyperlink, e2.hyperlink = i2);
const s2 = t2.commentsMap && t2.commentsMap[e2.address];
s2 && (e2.comment = s2);
}
};
}, { "../../../doc/enums": 7, "../../../doc/range": 10, "../../../utils/utils": 27, "../base-xform": 32, "../strings/rich-text-xform": 122 }], 74: [function(e, t, r) {
const n = e("../../base-xform");
t.exports = class extends n {
get tag() {
return "x14:cfIcon";
}
render(e2, t2) {
e2.leafNode(this.tag, { iconSet: t2.iconSet, iconId: t2.iconId });
}
parseOpen(e2) {
let { attributes: t2 } = e2;
this.model = { iconSet: t2.iconSet, iconId: n.toIntValue(t2.iconId) };
}
parseClose(e2) {
return e2 !== this.tag;
}
};
}, { "../../base-xform": 32 }], 75: [function(e, t, r) {
const { v4: n } = e("uuid"), i = e("../../base-xform"), s = e("../../composite-xform"), o = e("./databar-ext-xform"), a = e("./icon-set-ext-xform"), l = { "3Triangles": true, "3Stars": true, "5Boxes": true };
class c extends s {
constructor() {
super(), this.map = { "x14:dataBar": this.databarXform = new o(), "x14:iconSet": this.iconSetXform = new a() };
}
get tag() {
return "x14:cfRule";
}
static isExt(e2) {
return "dataBar" === e2.type ? o.isExt(e2) : !("iconSet" !== e2.type || !e2.custom && !l[e2.iconSet]);
}
prepare(e2) {
c.isExt(e2) && (e2.x14Id = `{${n()}}`.toUpperCase());
}
render(e2, t2) {
if (c.isExt(t2)) switch (t2.type) {
case "dataBar":
this.renderDataBar(e2, t2);
break;
case "iconSet":
this.renderIconSet(e2, t2);
}
}
renderDataBar(e2, t2) {
e2.openNode(this.tag, { type: "dataBar", id: t2.x14Id }), this.databarXform.render(e2, t2), e2.closeNode();
}
renderIconSet(e2, t2) {
e2.openNode(this.tag, { type: "iconSet", priority: t2.priority, id: t2.x14Id || `{${n()}}` }), this.iconSetXform.render(e2, t2), e2.closeNode();
}
createNewModel(e2) {
let { attributes: t2 } = e2;
return { type: t2.type, x14Id: t2.id, priority: i.toIntValue(t2.priority) };
}
onParserClose(e2, t2) {
Object.assign(this.model, t2.model);
}
}
t.exports = c;
}, { "../../base-xform": 32, "../../composite-xform": 48, "./databar-ext-xform": 79, "./icon-set-ext-xform": 81, uuid: 528 }], 76: [function(e, t, r) {
const n = e("../../composite-xform"), i = e("./f-ext-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { "xm:f": this.fExtXform = new i() };
}
get tag() {
return "x14:cfvo";
}
render(e2, t2) {
e2.openNode(this.tag, { type: t2.type }), void 0 !== t2.value && this.fExtXform.render(e2, t2.value), e2.closeNode();
}
createNewModel(e2) {
return { type: e2.attributes.type };
}
onParserClose(e2, t2) {
switch (e2) {
case "xm:f":
this.model.value = t2.model ? parseFloat(t2.model) : 0;
}
}
};
}, { "../../composite-xform": 48, "./f-ext-xform": 80 }], 77: [function(e, t, r) {
const n = e("../../composite-xform"), i = e("./sqref-ext-xform"), s = e("./cf-rule-ext-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { "xm:sqref": this.sqRef = new i(), "x14:cfRule": this.cfRule = new s() };
}
get tag() {
return "x14:conditionalFormatting";
}
prepare(e2, t2) {
e2.rules.forEach((e3) => {
this.cfRule.prepare(e3, t2);
});
}
render(e2, t2) {
t2.rules.some(s.isExt) && (e2.openNode(this.tag, { "xmlns:xm": "http://schemas.microsoft.com/office/excel/2006/main" }), t2.rules.filter(s.isExt).forEach((t3) => this.cfRule.render(e2, t3)), this.sqRef.render(e2, t2.ref), e2.closeNode());
}
createNewModel() {
return { rules: [] };
}
onParserClose(e2, t2) {
switch (e2) {
case "xm:sqref":
this.model.ref = t2.model;
break;
case "x14:cfRule":
this.model.rules.push(t2.model);
}
}
};
}, { "../../composite-xform": 48, "./cf-rule-ext-xform": 75, "./sqref-ext-xform": 82 }], 78: [function(e, t, r) {
const n = e("../../composite-xform"), i = e("./cf-rule-ext-xform"), s = e("./conditional-formatting-ext-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { "x14:conditionalFormatting": this.cfXform = new s() };
}
get tag() {
return "x14:conditionalFormattings";
}
hasContent(e2) {
return void 0 === e2.hasExtContent && (e2.hasExtContent = e2.some((e3) => e3.rules.some(i.isExt))), e2.hasExtContent;
}
prepare(e2, t2) {
e2.forEach((e3) => {
this.cfXform.prepare(e3, t2);
});
}
render(e2, t2) {
this.hasContent(t2) && (e2.openNode(this.tag), t2.forEach((t3) => this.cfXform.render(e2, t3)), e2.closeNode());
}
createNewModel() {
return [];
}
onParserClose(e2, t2) {
this.model.push(t2.model);
}
};
}, { "../../composite-xform": 48, "./cf-rule-ext-xform": 75, "./conditional-formatting-ext-xform": 77 }], 79: [function(e, t, r) {
const n = e("../../base-xform"), i = e("../../composite-xform"), s = e("../../style/color-xform"), o = e("./cfvo-ext-xform");
t.exports = class extends i {
constructor() {
super(), this.map = { "x14:cfvo": this.cfvoXform = new o(), "x14:borderColor": this.borderColorXform = new s("x14:borderColor"), "x14:negativeBorderColor": this.negativeBorderColorXform = new s("x14:negativeBorderColor"), "x14:negativeFillColor": this.negativeFillColorXform = new s("x14:negativeFillColor"), "x14:axisColor": this.axisColorXform = new s("x14:axisColor") };
}
static isExt(e2) {
return !e2.gradient;
}
get tag() {
return "x14:dataBar";
}
render(e2, t2) {
e2.openNode(this.tag, { minLength: n.toIntAttribute(t2.minLength, 0, true), maxLength: n.toIntAttribute(t2.maxLength, 100, true), border: n.toBoolAttribute(t2.border, false), gradient: n.toBoolAttribute(t2.gradient, true), negativeBarColorSameAsPositive: n.toBoolAttribute(t2.negativeBarColorSameAsPositive, true), negativeBarBorderColorSameAsPositive: n.toBoolAttribute(t2.negativeBarBorderColorSameAsPositive, true), axisPosition: n.toAttribute(t2.axisPosition, "auto"), direction: n.toAttribute(t2.direction, "leftToRight") }), t2.cfvo.forEach((t3) => {
this.cfvoXform.render(e2, t3);
}), this.borderColorXform.render(e2, t2.borderColor), this.negativeBorderColorXform.render(e2, t2.negativeBorderColor), this.negativeFillColorXform.render(e2, t2.negativeFillColor), this.axisColorXform.render(e2, t2.axisColor), e2.closeNode();
}
createNewModel(e2) {
let { attributes: t2 } = e2;
return { cfvo: [], minLength: n.toIntValue(t2.minLength, 0), maxLength: n.toIntValue(t2.maxLength, 100), border: n.toBoolValue(t2.border, false), gradient: n.toBoolValue(t2.gradient, true), negativeBarColorSameAsPositive: n.toBoolValue(t2.negativeBarColorSameAsPositive, true), negativeBarBorderColorSameAsPositive: n.toBoolValue(t2.negativeBarBorderColorSameAsPositive, true), axisPosition: n.toStringValue(t2.axisPosition, "auto"), direction: n.toStringValue(t2.direction, "leftToRight") };
}
onParserClose(e2, t2) {
const [, r2] = e2.split(":");
switch (r2) {
case "cfvo":
this.model.cfvo.push(t2.model);
break;
default:
this.model[r2] = t2.model;
}
}
};
}, { "../../base-xform": 32, "../../composite-xform": 48, "../../style/color-xform": 128, "./cfvo-ext-xform": 76 }], 80: [function(e, t, r) {
const n = e("../../base-xform");
t.exports = class extends n {
get tag() {
return "xm:f";
}
render(e2, t2) {
e2.leafNode(this.tag, null, t2);
}
parseOpen() {
this.model = "";
}
parseText(e2) {
this.model += e2;
}
parseClose(e2) {
return e2 !== this.tag;
}
};
}, { "../../base-xform": 32 }], 81: [function(e, t, r) {
const n = e("../../base-xform"), i = e("../../composite-xform"), s = e("./cfvo-ext-xform"), o = e("./cf-icon-ext-xform");
t.exports = class extends i {
constructor() {
super(), this.map = { "x14:cfvo": this.cfvoXform = new s(), "x14:cfIcon": this.cfIconXform = new o() };
}
get tag() {
return "x14:iconSet";
}
render(e2, t2) {
e2.openNode(this.tag, { iconSet: n.toStringAttribute(t2.iconSet), reverse: n.toBoolAttribute(t2.reverse, false), showValue: n.toBoolAttribute(t2.showValue, true), custom: n.toBoolAttribute(t2.icons, false) }), t2.cfvo.forEach((t3) => {
this.cfvoXform.render(e2, t3);
}), t2.icons && t2.icons.forEach((t3, r2) => {
t3.iconId = r2, this.cfIconXform.render(e2, t3);
}), e2.closeNode();
}
createNewModel(e2) {
let { attributes: t2 } = e2;
return { cfvo: [], iconSet: n.toStringValue(t2.iconSet, "3TrafficLights"), reverse: n.toBoolValue(t2.reverse, false), showValue: n.toBoolValue(t2.showValue, true) };
}
onParserClose(e2, t2) {
const [, r2] = e2.split(":");
switch (r2) {
case "cfvo":
this.model.cfvo.push(t2.model);
break;
case "cfIcon":
this.model.icons || (this.model.icons = []), this.model.icons.push(t2.model);
break;
default:
this.model[r2] = t2.model;
}
}
};
}, { "../../base-xform": 32, "../../composite-xform": 48, "./cf-icon-ext-xform": 74, "./cfvo-ext-xform": 76 }], 82: [function(e, t, r) {
const n = e("../../base-xform");
t.exports = class extends n {
get tag() {
return "xm:sqref";
}
render(e2, t2) {
e2.leafNode(this.tag, null, t2);
}
parseOpen() {
this.model = "";
}
parseText(e2) {
this.model += e2;
}
parseClose(e2) {
return e2 !== this.tag;
}
};
}, { "../../base-xform": 32 }], 83: [function(e, t, r) {
const n = e("../../base-xform"), i = e("../../composite-xform"), s = e("../../../../doc/range"), o = e("./databar-xform"), a = e("./ext-lst-ref-xform"), l = e("./formula-xform"), c = e("./color-scale-xform"), u = e("./icon-set-xform"), h = { "3Triangles": true, "3Stars": true, "5Boxes": true }, f = (e2) => {
const { type: t2, operator: r2 } = e2;
switch (t2) {
case "containsText":
case "containsBlanks":
case "notContainsBlanks":
case "containsErrors":
case "notContainsErrors":
return { type: "containsText", operator: t2 };
default:
return { type: t2, operator: r2 };
}
};
class d extends i {
constructor() {
super(), this.map = { dataBar: this.databarXform = new o(), extLst: this.extLstRefXform = new a(), formula: this.formulaXform = new l(), colorScale: this.colorScaleXform = new c(), iconSet: this.iconSetXform = new u() };
}
get tag() {
return "cfRule";
}
static isPrimitive(e2) {
return "iconSet" !== e2.type || !e2.custom && !h[e2.iconSet];
}
render(e2, t2) {
switch (t2.type) {
case "expression":
this.renderExpression(e2, t2);
break;
case "cellIs":
this.renderCellIs(e2, t2);
break;
case "top10":
this.renderTop10(e2, t2);
break;
case "aboveAverage":
this.renderAboveAverage(e2, t2);
break;
case "dataBar":
this.renderDataBar(e2, t2);
break;
case "colorScale":
this.renderColorScale(e2, t2);
break;
case "iconSet":
this.renderIconSet(e2, t2);
break;
case "containsText":
this.renderText(e2, t2);
break;
case "timePeriod":
this.renderTimePeriod(e2, t2);
}
}
renderExpression(e2, t2) {
e2.openNode(this.tag, { type: "expression", dxfId: t2.dxfId, priority: t2.priority }), this.formulaXform.render(e2, t2.formulae[0]), e2.closeNode();
}
renderCellIs(e2, t2) {
e2.openNode(this.tag, { type: "cellIs", dxfId: t2.dxfId, priority: t2.priority, operator: t2.operator }), t2.formulae.forEach((t3) => {
this.formulaXform.render(e2, t3);
}), e2.closeNode();
}
renderTop10(e2, t2) {
e2.leafNode(this.tag, { type: "top10", dxfId: t2.dxfId, priority: t2.priority, percent: n.toBoolAttribute(t2.percent, false), bottom: n.toBoolAttribute(t2.bottom, false), rank: n.toIntValue(t2.rank, 10, true) });
}
renderAboveAverage(e2, t2) {
e2.leafNode(this.tag, { type: "aboveAverage", dxfId: t2.dxfId, priority: t2.priority, aboveAverage: n.toBoolAttribute(t2.aboveAverage, true) });
}
renderDataBar(e2, t2) {
e2.openNode(this.tag, { type: "dataBar", priority: t2.priority }), this.databarXform.render(e2, t2), this.extLstRefXform.render(e2, t2), e2.closeNode();
}
renderColorScale(e2, t2) {
e2.openNode(this.tag, { type: "colorScale", priority: t2.priority }), this.colorScaleXform.render(e2, t2), e2.closeNode();
}
renderIconSet(e2, t2) {
d.isPrimitive(t2) && (e2.openNode(this.tag, { type: "iconSet", priority: t2.priority }), this.iconSetXform.render(e2, t2), e2.closeNode());
}
renderText(e2, t2) {
e2.openNode(this.tag, { type: t2.operator, dxfId: t2.dxfId, priority: t2.priority, operator: n.toStringAttribute(t2.operator, "containsText") });
const r2 = ((e3) => {
if (e3.formulae && e3.formulae[0]) return e3.formulae[0];
const t3 = new s(e3.ref), { tl: r3 } = t3;
switch (e3.operator) {
case "containsText":
return `NOT(ISERROR(SEARCH("${e3.text}",${r3})))`;
case "containsBlanks":
return `LEN(TRIM(${r3}))=0`;
case "notContainsBlanks":
return `LEN(TRIM(${r3}))>0`;
case "containsErrors":
return `ISERROR(${r3})`;
case "notContainsErrors":
return `NOT(ISERROR(${r3}))`;
default:
return;
}
})(t2);
r2 && this.formulaXform.render(e2, r2), e2.closeNode();
}
renderTimePeriod(e2, t2) {
e2.openNode(this.tag, { type: "timePeriod", dxfId: t2.dxfId, priority: t2.priority, timePeriod: t2.timePeriod });
const r2 = ((e3) => {
if (e3.formulae && e3.formulae[0]) return e3.formulae[0];
const t3 = new s(e3.ref), { tl: r3 } = t3;
switch (e3.timePeriod) {
case "thisWeek":
return `AND(TODAY()-ROUNDDOWN(${r3},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${r3},0)-TODAY()<=7-WEEKDAY(TODAY()))`;
case "lastWeek":
return `AND(TODAY()-ROUNDDOWN(${r3},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${r3},0)<(WEEKDAY(TODAY())+7))`;
case "nextWeek":
return `AND(ROUNDDOWN(${r3},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${r3},0)-TODAY()<(15-WEEKDAY(TODAY())))`;
case "yesterday":
return `FLOOR(${r3},1)=TODAY()-1`;
case "today":
return `FLOOR(${r3},1)=TODAY()`;
case "tomorrow":
return `FLOOR(${r3},1)=TODAY()+1`;
case "last7Days":
return `AND(TODAY()-FLOOR(${r3},1)<=6,FLOOR(${r3},1)<=TODAY())`;
case "lastMonth":
return `AND(MONTH(${r3})=MONTH(EDATE(TODAY(),0-1)),YEAR(${r3})=YEAR(EDATE(TODAY(),0-1)))`;
case "thisMonth":
return `AND(MONTH(${r3})=MONTH(TODAY()),YEAR(${r3})=YEAR(TODAY()))`;
case "nextMonth":
return `AND(MONTH(${r3})=MONTH(EDATE(TODAY(),0+1)),YEAR(${r3})=YEAR(EDATE(TODAY(),0+1)))`;
default:
return;
}
})(t2);
r2 && this.formulaXform.render(e2, r2), e2.closeNode();
}
createNewModel(e2) {
let { attributes: t2 } = e2;
return { ...f(t2), dxfId: n.toIntValue(t2.dxfId), priority: n.toIntValue(t2.priority), timePeriod: t2.timePeriod, percent: n.toBoolValue(t2.percent), bottom: n.toBoolValue(t2.bottom), rank: n.toIntValue(t2.rank), aboveAverage: n.toBoolValue(t2.aboveAverage) };
}
onParserClose(e2, t2) {
switch (e2) {
case "dataBar":
case "extLst":
case "colorScale":
case "iconSet":
Object.assign(this.model, t2.model);
break;
case "formula":
this.model.formulae = this.model.formulae || [], this.model.formulae.push(t2.model);
}
}
}
t.exports = d;
}, { "../../../../doc/range": 10, "../../base-xform": 32, "../../composite-xform": 48, "./color-scale-xform": 85, "./databar-xform": 88, "./ext-lst-ref-xform": 89, "./formula-xform": 90, "./icon-set-xform": 91 }], 84: [function(e, t, r) {
const n = e("../../base-xform");
t.exports = class extends n {
get tag() {
return "cfvo";
}
render(e2, t2) {
e2.leafNode(this.tag, { type: t2.type, val: t2.value });
}
parseOpen(e2) {
this.model = { type: e2.attributes.type, value: n.toFloatValue(e2.attributes.val) };
}
parseClose(e2) {
return e2 !== this.tag;
}
};
}, { "../../base-xform": 32 }], 85: [function(e, t, r) {
const n = e("../../composite-xform"), i = e("../../style/color-xform"), s = e("./cfvo-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { cfvo: this.cfvoXform = new s(), color: this.colorXform = new i() };
}
get tag() {
return "colorScale";
}
render(e2, t2) {
e2.openNode(this.tag), t2.cfvo.forEach((t3) => {
this.cfvoXform.render(e2, t3);
}), t2.color.forEach((t3) => {
this.colorXform.render(e2, t3);
}), e2.closeNode();
}
createNewModel(e2) {
return { cfvo: [], color: [] };
}
onParserClose(e2, t2) {
this.model[e2].push(t2.model);
}
};
}, { "../../composite-xform": 48, "../../style/color-xform": 128, "./cfvo-xform": 84 }], 86: [function(e, t, r) {
const n = e("../../composite-xform"), i = e("./cf-rule-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { cfRule: new i() };
}
get tag() {
return "conditionalFormatting";
}
render(e2, t2) {
t2.rules.some(i.isPrimitive) && (e2.openNode(this.tag, { sqref: t2.ref }), t2.rules.forEach((r2) => {
i.isPrimitive(r2) && (r2.ref = t2.ref, this.map.cfRule.render(e2, r2));
}), e2.closeNode());
}
createNewModel(e2) {
let { attributes: t2 } = e2;
return { ref: t2.sqref, rules: [] };
}
onParserClose(e2, t2) {
this.model.rules.push(t2.model);
}
};
}, { "../../composite-xform": 48, "./cf-rule-xform": 83 }], 87: [function(e, t, r) {
const n = e("../../base-xform"), i = e("./conditional-formatting-xform");
t.exports = class extends n {
constructor() {
super(), this.cfXform = new i();
}
get tag() {
return "conditionalFormatting";
}
reset() {
this.model = [];
}
prepare(e2, t2) {
let r2 = e2.reduce((e3, t3) => Math.max(e3, ...t3.rules.map((e4) => e4.priority || 0)), 1);
e2.forEach((e3) => {
e3.rules.forEach((e4) => {
e4.priority || (e4.priority = r2++), e4.style && (e4.dxfId = t2.styles.addDxfStyle(e4.style));
});
});
}
render(e2, t2) {
t2.forEach((t3) => {
this.cfXform.render(e2, t3);
});
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "conditionalFormatting":
return this.parser = this.cfXform, this.parser.parseOpen(e2), true;
default:
return false;
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
return !!this.parser && (!!this.parser.parseClose(e2) || (this.model.push(this.parser.model), this.parser = void 0, false));
}
reconcile(e2, t2) {
e2.forEach((e3) => {
e3.rules.forEach((e4) => {
void 0 !== e4.dxfId && (e4.style = t2.styles.getDxfStyle(e4.dxfId), delete e4.dxfId);
});
});
}
};
}, { "../../base-xform": 32, "./conditional-formatting-xform": 86 }], 88: [function(e, t, r) {
const n = e("../../composite-xform"), i = e("../../style/color-xform"), s = e("./cfvo-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { cfvo: this.cfvoXform = new s(), color: this.colorXform = new i() };
}
get tag() {
return "dataBar";
}
render(e2, t2) {
e2.openNode(this.tag), t2.cfvo.forEach((t3) => {
this.cfvoXform.render(e2, t3);
}), this.colorXform.render(e2, t2.color), e2.closeNode();
}
createNewModel() {
return { cfvo: [] };
}
onParserClose(e2, t2) {
switch (e2) {
case "cfvo":
this.model.cfvo.push(t2.model);
break;
case "color":
this.model.color = t2.model;
}
}
};
}, { "../../composite-xform": 48, "../../style/color-xform": 128, "./cfvo-xform": 84 }], 89: [function(e, t, r) {
const n = e("../../base-xform"), i = e("../../composite-xform");
class s extends n {
get tag() {
return "x14:id";
}
render(e2, t2) {
e2.leafNode(this.tag, null, t2);
}
parseOpen() {
this.model = "";
}
parseText(e2) {
this.model += e2;
}
parseClose(e2) {
return e2 !== this.tag;
}
}
class o extends i {
constructor() {
super(), this.map = { "x14:id": this.idXform = new s() };
}
get tag() {
return "ext";
}
render(e2, t2) {
e2.openNode(this.tag, { uri: "{B025F937-C7B1-47D3-B67F-A62EFF666E3E}", "xmlns:x14": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" }), this.idXform.render(e2, t2.x14Id), e2.closeNode();
}
createNewModel() {
return {};
}
onParserClose(e2, t2) {
this.model.x14Id = t2.model;
}
}
t.exports = class extends i {
constructor() {
super(), this.map = { ext: new o() };
}
get tag() {
return "extLst";
}
render(e2, t2) {
e2.openNode(this.tag), this.map.ext.render(e2, t2), e2.closeNode();
}
createNewModel() {
return {};
}
onParserClose(e2, t2) {
Object.assign(this.model, t2.model);
}
};
}, { "../../base-xform": 32, "../../composite-xform": 48 }], 90: [function(e, t, r) {
const n = e("../../base-xform");
t.exports = class extends n {
get tag() {
return "formula";
}
render(e2, t2) {
e2.leafNode(this.tag, null, t2);
}
parseOpen() {
this.model = "";
}
parseText(e2) {
this.model += e2;
}
parseClose(e2) {
return e2 !== this.tag;
}
};
}, { "../../base-xform": 32 }], 91: [function(e, t, r) {
const n = e("../../base-xform"), i = e("../../composite-xform"), s = e("./cfvo-xform");
t.exports = class extends i {
constructor() {
super(), this.map = { cfvo: this.cfvoXform = new s() };
}
get tag() {
return "iconSet";
}
render(e2, t2) {
e2.openNode(this.tag, { iconSet: n.toStringAttribute(t2.iconSet, "3TrafficLights"), reverse: n.toBoolAttribute(t2.reverse, false), showValue: n.toBoolAttribute(t2.showValue, true) }), t2.cfvo.forEach((t3) => {
this.cfvoXform.render(e2, t3);
}), e2.closeNode();
}
createNewModel(e2) {
let { attributes: t2 } = e2;
return { iconSet: n.toStringValue(t2.iconSet, "3TrafficLights"), reverse: n.toBoolValue(t2.reverse), showValue: n.toBoolValue(t2.showValue), cfvo: [] };
}
onParserClose(e2, t2) {
this.model[e2].push(t2.model);
}
};
}, { "../../base-xform": 32, "../../composite-xform": 48, "./cfvo-xform": 84 }], 92: [function(e, t, r) {
const n = e("../../../utils/utils"), i = e("../base-xform");
t.exports = class extends i {
get tag() {
return "col";
}
prepare(e2, t2) {
const r2 = t2.styles.addStyleModel(e2.style || {});
r2 && (e2.styleId = r2);
}
render(e2, t2) {
e2.openNode("col"), e2.addAttribute("min", t2.min), e2.addAttribute("max", t2.max), t2.width && e2.addAttribute("width", t2.width), t2.styleId && e2.addAttribute("style", t2.styleId), t2.hidden && e2.addAttribute("hidden", "1"), t2.bestFit && e2.addAttribute("bestFit", "1"), t2.outlineLevel && e2.addAttribute("outlineLevel", t2.outlineLevel), t2.collapsed && e2.addAttribute("collapsed", "1"), e2.addAttribute("customWidth", "1"), e2.closeNode();
}
parseOpen(e2) {
if ("col" === e2.name) {
const t2 = this.model = { min: parseInt(e2.attributes.min || "0", 10), max: parseInt(e2.attributes.max || "0", 10), width: void 0 === e2.attributes.width ? void 0 : parseFloat(e2.attributes.width || "0") };
return e2.attributes.style && (t2.styleId = parseInt(e2.attributes.style, 10)), n.parseBoolean(e2.attributes.hidden) && (t2.hidden = true), n.parseBoolean(e2.attributes.bestFit) && (t2.bestFit = true), e2.attributes.outlineLevel && (t2.outlineLevel = parseInt(e2.attributes.outlineLevel, 10)), n.parseBoolean(e2.attributes.collapsed) && (t2.collapsed = true), true;
}
return false;
}
parseText() {
}
parseClose() {
return false;
}
reconcile(e2, t2) {
e2.styleId && (e2.style = t2.styles.getStyleModel(e2.styleId));
}
};
}, { "../../../utils/utils": 27, "../base-xform": 32 }], 93: [function(e, t, r) {
const n = e("../../../utils/under-dash"), i = e("../../../utils/utils"), s = e("../../../utils/col-cache"), o = e("../base-xform"), a = e("../../../doc/range");
function l(e2, t2, r2, n2) {
const i2 = t2[r2];
void 0 !== i2 ? e2[r2] = i2 : void 0 !== n2 && (e2[r2] = n2);
}
function c(e2, t2, r2, n2) {
const s2 = t2[r2];
void 0 !== s2 ? e2[r2] = i.parseBoolean(s2) : void 0 !== n2;
}
t.exports = class extends o {
get tag() {
return "dataValidations";
}
render(e2, t2) {
const r2 = (function(e3) {
const t3 = n.map(e3, (e4, t4) => ({ address: t4, dataValidation: e4, marked: false })).sort((e4, t4) => n.strcmp(e4.address, t4.address)), r3 = n.keyBy(t3, "address"), i2 = (t4, r4, i3) => {
for (let o2 = 0; o2 < r4; o2++) {
const r5 = s.encodeAddress(t4.row + o2, i3);
if (!e3[r5] || !n.isEqual(e3[t4.address], e3[r5])) return false;
}
return true;
};
return t3.map((t4) => {
if (!t4.marked) {
const o2 = s.decodeEx(t4.address);
if (o2.dimensions) return r3[o2.dimensions].marked = true, { ...t4.dataValidation, sqref: t4.address };
let a2 = 1, l2 = s.encodeAddress(o2.row + a2, o2.col);
for (; e3[l2] && n.isEqual(t4.dataValidation, e3[l2]); ) a2++, l2 = s.encodeAddress(o2.row + a2, o2.col);
let c2 = 1;
for (; i2(o2, a2, o2.col + c2); ) c2++;
for (let e4 = 0; e4 < a2; e4++) for (let t5 = 0; t5 < c2; t5++) l2 = s.encodeAddress(o2.row + e4, o2.col + t5), r3[l2].marked = true;
if (a2 > 1 || c2 > 1) {
const e4 = o2.row + (a2 - 1), r4 = o2.col + (c2 - 1);
return { ...t4.dataValidation, sqref: `${t4.address}:${s.encodeAddress(e4, r4)}` };
}
return { ...t4.dataValidation, sqref: t4.address };
}
return null;
}).filter(Boolean);
})(t2);
r2.length && (e2.openNode("dataValidations", { count: r2.length }), r2.forEach((t3) => {
e2.openNode("dataValidation"), "any" !== t3.type && (e2.addAttribute("type", t3.type), t3.operator && "list" !== t3.type && "between" !== t3.operator && e2.addAttribute("operator", t3.operator), t3.allowBlank && e2.addAttribute("allowBlank", "1")), t3.showInputMessage && e2.addAttribute("showInputMessage", "1"), t3.promptTitle && e2.addAttribute("promptTitle", t3.promptTitle), t3.prompt && e2.addAttribute("prompt", t3.prompt), t3.showErrorMessage && e2.addAttribute("showErrorMessage", "1"), t3.errorStyle && e2.addAttribute("errorStyle", t3.errorStyle), t3.errorTitle && e2.addAttribute("errorTitle", t3.errorTitle), t3.error && e2.addAttribute("error", t3.error), e2.addAttribute("sqref", t3.sqref), (t3.formulae || []).forEach((r3, n2) => {
e2.openNode("formula" + (n2 + 1)), "date" === t3.type ? e2.writeText(i.dateToExcel(new Date(r3))) : e2.writeText(r3), e2.closeNode();
}), e2.closeNode();
}), e2.closeNode());
}
parseOpen(e2) {
switch (e2.name) {
case "dataValidations":
return this.model = {}, true;
case "dataValidation": {
this._address = e2.attributes.sqref;
const t2 = { type: e2.attributes.type || "any", formulae: [] };
switch (e2.attributes.type && c(t2, e2.attributes, "allowBlank"), c(t2, e2.attributes, "showInputMessage"), c(t2, e2.attributes, "showErrorMessage"), t2.type) {
case "any":
case "list":
case "custom":
break;
default:
l(t2, e2.attributes, "operator", "between");
}
return l(t2, e2.attributes, "promptTitle"), l(t2, e2.attributes, "prompt"), l(t2, e2.attributes, "errorStyle"), l(t2, e2.attributes, "errorTitle"), l(t2, e2.attributes, "error"), this._dataValidation = t2, true;
}
case "formula1":
case "formula2":
return this._formula = [], true;
default:
return false;
}
}
parseText(e2) {
this._formula && this._formula.push(e2);
}
parseClose(e2) {
switch (e2) {
case "dataValidations":
return false;
case "dataValidation":
this._dataValidation.formulae && this._dataValidation.formulae.length || (delete this._dataValidation.formulae, delete this._dataValidation.operator);
return (this._address.split(/\s+/g) || []).forEach((e3) => {
if (e3.includes(":")) {
new a(e3).forEachAddress((e4) => {
this.model[e4] = this._dataValidation;
});
} else this.model[e3] = this._dataValidation;
}), true;
case "formula1":
case "formula2": {
let e3 = this._formula.join("");
switch (this._dataValidation.type) {
case "whole":
case "textLength":
e3 = parseInt(e3, 10);
break;
case "decimal":
e3 = parseFloat(e3);
break;
case "date":
e3 = i.excelToDate(parseFloat(e3));
}
return this._dataValidation.formulae.push(e3), this._formula = void 0, true;
}
default:
return true;
}
}
};
}, { "../../../doc/range": 10, "../../../utils/col-cache": 19, "../../../utils/under-dash": 26, "../../../utils/utils": 27, "../base-xform": 32 }], 94: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "dimension";
}
render(e2, t2) {
t2 && e2.leafNode("dimension", { ref: t2 });
}
parseOpen(e2) {
return "dimension" === e2.name && (this.model = e2.attributes.ref, true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 95: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "drawing";
}
render(e2, t2) {
t2 && e2.leafNode(this.tag, { "r:id": t2.rId });
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.model = { rId: e2.attributes["r:id"] }, true;
default:
return false;
}
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 96: [function(e, t, r) {
const n = e("../composite-xform"), i = e("./cf-ext/conditional-formattings-ext-xform");
class s extends n {
constructor() {
super(), this.map = { "x14:conditionalFormattings": this.conditionalFormattings = new i() };
}
get tag() {
return "ext";
}
hasContent(e2) {
return this.conditionalFormattings.hasContent(e2.conditionalFormattings);
}
prepare(e2, t2) {
this.conditionalFormattings.prepare(e2.conditionalFormattings, t2);
}
render(e2, t2) {
e2.openNode("ext", { uri: "{78C0D931-6437-407d-A8EE-F0AAD7539E65}", "xmlns:x14": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" }), this.conditionalFormattings.render(e2, t2.conditionalFormattings), e2.closeNode();
}
createNewModel() {
return {};
}
onParserClose(e2, t2) {
this.model[e2] = t2.model;
}
}
t.exports = class extends n {
constructor() {
super(), this.map = { ext: this.ext = new s() };
}
get tag() {
return "extLst";
}
prepare(e2, t2) {
this.ext.prepare(e2, t2);
}
hasContent(e2) {
return this.ext.hasContent(e2);
}
render(e2, t2) {
this.hasContent(t2) && (e2.openNode("extLst"), this.ext.render(e2, t2), e2.closeNode());
}
createNewModel() {
return {};
}
onParserClose(e2, t2) {
Object.assign(this.model, t2.model);
}
};
}, { "../composite-xform": 48, "./cf-ext/conditional-formattings-ext-xform": 78 }], 97: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "headerFooter";
}
render(e2, t2) {
if (t2) {
e2.addRollback();
let r2 = false;
e2.openNode("headerFooter"), t2.differentFirst && (e2.addAttribute("differentFirst", "1"), r2 = true), t2.differentOddEven && (e2.addAttribute("differentOddEven", "1"), r2 = true), t2.oddHeader && "string" == typeof t2.oddHeader && (e2.leafNode("oddHeader", null, t2.oddHeader), r2 = true), t2.oddFooter && "string" == typeof t2.oddFooter && (e2.leafNode("oddFooter", null, t2.oddFooter), r2 = true), t2.evenHeader && "string" == typeof t2.evenHeader && (e2.leafNode("evenHeader", null, t2.evenHeader), r2 = true), t2.evenFooter && "string" == typeof t2.evenFooter && (e2.leafNode("evenFooter", null, t2.evenFooter), r2 = true), t2.firstHeader && "string" == typeof t2.firstHeader && (e2.leafNode("firstHeader", null, t2.firstHeader), r2 = true), t2.firstFooter && "string" == typeof t2.firstFooter && (e2.leafNode("firstFooter", null, t2.firstFooter), r2 = true), r2 ? (e2.closeNode(), e2.commit()) : e2.rollback();
}
}
parseOpen(e2) {
switch (e2.name) {
case "headerFooter":
return this.model = {}, e2.attributes.differentFirst && (this.model.differentFirst = 1 === parseInt(e2.attributes.differentFirst, 0)), e2.attributes.differentOddEven && (this.model.differentOddEven = 1 === parseInt(e2.attributes.differentOddEven, 0)), true;
case "oddHeader":
return this.currentNode = "oddHeader", true;
case "oddFooter":
return this.currentNode = "oddFooter", true;
case "evenHeader":
return this.currentNode = "evenHeader", true;
case "evenFooter":
return this.currentNode = "evenFooter", true;
case "firstHeader":
return this.currentNode = "firstHeader", true;
case "firstFooter":
return this.currentNode = "firstFooter", true;
default:
return false;
}
}
parseText(e2) {
switch (this.currentNode) {
case "oddHeader":
this.model.oddHeader = e2;
break;
case "oddFooter":
this.model.oddFooter = e2;
break;
case "evenHeader":
this.model.evenHeader = e2;
break;
case "evenFooter":
this.model.evenFooter = e2;
break;
case "firstHeader":
this.model.firstHeader = e2;
break;
case "firstFooter":
this.model.firstFooter = e2;
}
}
parseClose() {
switch (this.currentNode) {
case "oddHeader":
case "oddFooter":
case "evenHeader":
case "evenFooter":
case "firstHeader":
case "firstFooter":
return this.currentNode = void 0, true;
default:
return false;
}
}
};
}, { "../base-xform": 32 }], 98: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "hyperlink";
}
render(e2, t2) {
this.isInternalLink(t2) ? e2.leafNode("hyperlink", { ref: t2.address, "r:id": t2.rId, tooltip: t2.tooltip, location: t2.target }) : e2.leafNode("hyperlink", { ref: t2.address, "r:id": t2.rId, tooltip: t2.tooltip });
}
parseOpen(e2) {
return "hyperlink" === e2.name && (this.model = { address: e2.attributes.ref, rId: e2.attributes["r:id"], tooltip: e2.attributes.tooltip }, e2.attributes.location && (this.model.target = e2.attributes.location), true);
}
parseText() {
}
parseClose() {
return false;
}
isInternalLink(e2) {
return e2.target && /^[^!]+![a-zA-Z]+[\d]+$/.test(e2.target);
}
};
}, { "../base-xform": 32 }], 99: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "mergeCell";
}
render(e2, t2) {
e2.leafNode("mergeCell", { ref: t2 });
}
parseOpen(e2) {
return "mergeCell" === e2.name && (this.model = e2.attributes.ref, true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 100: [function(e, t, r) {
const n = e("../../../utils/under-dash"), i = e("../../../doc/range"), s = e("../../../utils/col-cache"), o = e("../../../doc/enums");
t.exports = class {
constructor() {
this.merges = {};
}
add(e2) {
if (this.merges[e2.master]) this.merges[e2.master].expandToAddress(e2.address);
else {
const t2 = `${e2.master}:${e2.address}`;
this.merges[e2.master] = new i(t2);
}
}
get mergeCells() {
return n.map(this.merges, (e2) => e2.range);
}
reconcile(e2, t2) {
n.each(e2, (e3) => {
const r2 = s.decode(e3);
for (let e4 = r2.top; e4 <= r2.bottom; e4++) {
const n2 = t2[e4 - 1];
for (let t3 = r2.left; t3 <= r2.right; t3++) {
const i2 = n2.cells[t3 - 1];
i2 ? i2.type === o.ValueType.Merge && (i2.master = r2.tl) : n2.cells[t3] = { type: o.ValueType.Null, address: s.encodeAddress(e4, t3) };
}
}
});
}
getMasterAddress(e2) {
const t2 = this.hash[e2];
return t2 && t2.tl;
}
};
}, { "../../../doc/enums": 7, "../../../doc/range": 10, "../../../utils/col-cache": 19, "../../../utils/under-dash": 26 }], 101: [function(e, t, r) {
const n = e("../base-xform"), i = (e2) => void 0 !== e2;
t.exports = class extends n {
get tag() {
return "outlinePr";
}
render(e2, t2) {
return !(!t2 || !i(t2.summaryBelow) && !i(t2.summaryRight)) && (e2.leafNode(this.tag, { summaryBelow: i(t2.summaryBelow) ? Number(t2.summaryBelow) : void 0, summaryRight: i(t2.summaryRight) ? Number(t2.summaryRight) : void 0 }), true);
}
parseOpen(e2) {
return e2.name === this.tag && (this.model = { summaryBelow: i(e2.attributes.summaryBelow) ? Boolean(Number(e2.attributes.summaryBelow)) : void 0, summaryRight: i(e2.attributes.summaryRight) ? Boolean(Number(e2.attributes.summaryRight)) : void 0 }, true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 102: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "brk";
}
render(e2, t2) {
e2.leafNode("brk", t2);
}
parseOpen(e2) {
return "brk" === e2.name && (this.model = e2.attributes.ref, true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 103: [function(e, t, r) {
const n = e("../../../utils/under-dash"), i = e("../base-xform");
t.exports = class extends i {
get tag() {
return "pageMargins";
}
render(e2, t2) {
if (t2) {
const r2 = { left: t2.left, right: t2.right, top: t2.top, bottom: t2.bottom, header: t2.header, footer: t2.footer };
n.some(r2, (e3) => void 0 !== e3) && e2.leafNode(this.tag, r2);
}
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.model = { left: parseFloat(e2.attributes.left || 0.7), right: parseFloat(e2.attributes.right || 0.7), top: parseFloat(e2.attributes.top || 0.75), bottom: parseFloat(e2.attributes.bottom || 0.75), header: parseFloat(e2.attributes.header || 0.3), footer: parseFloat(e2.attributes.footer || 0.3) }, true;
default:
return false;
}
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../../../utils/under-dash": 26, "../base-xform": 32 }], 104: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "pageSetUpPr";
}
render(e2, t2) {
return !(!t2 || !t2.fitToPage) && (e2.leafNode(this.tag, { fitToPage: t2.fitToPage ? "1" : void 0 }), true);
}
parseOpen(e2) {
return e2.name === this.tag && (this.model = { fitToPage: "1" === e2.attributes.fitToPage }, true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 105: [function(e, t, r) {
const n = e("../../../utils/under-dash"), i = e("../base-xform");
function s(e2) {
return e2 ? "1" : void 0;
}
function o(e2) {
switch (e2) {
case "overThenDown":
return e2;
default:
return;
}
}
function a(e2) {
switch (e2) {
case "atEnd":
case "asDisplyed":
return e2;
default:
return;
}
}
function l(e2) {
switch (e2) {
case "dash":
case "blank":
case "NA":
return e2;
default:
return;
}
}
t.exports = class extends i {
get tag() {
return "pageSetup";
}
render(e2, t2) {
if (t2) {
const r2 = { paperSize: t2.paperSize, orientation: t2.orientation, horizontalDpi: t2.horizontalDpi, verticalDpi: t2.verticalDpi, pageOrder: o(t2.pageOrder), blackAndWhite: s(t2.blackAndWhite), draft: s(t2.draft), cellComments: a(t2.cellComments), errors: l(t2.errors), scale: t2.scale, fitToWidth: t2.fitToWidth, fitToHeight: t2.fitToHeight, firstPageNumber: t2.firstPageNumber, useFirstPageNumber: s(t2.firstPageNumber), usePrinterDefaults: s(t2.usePrinterDefaults), copies: t2.copies };
n.some(r2, (e3) => void 0 !== e3) && e2.leafNode(this.tag, r2);
}
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.model = { paperSize: (t2 = e2.attributes.paperSize, void 0 !== t2 ? parseInt(t2, 10) : void 0), orientation: e2.attributes.orientation || "portrait", horizontalDpi: parseInt(e2.attributes.horizontalDpi || "4294967295", 10), verticalDpi: parseInt(e2.attributes.verticalDpi || "4294967295", 10), pageOrder: e2.attributes.pageOrder || "downThenOver", blackAndWhite: "1" === e2.attributes.blackAndWhite, draft: "1" === e2.attributes.draft, cellComments: e2.attributes.cellComments || "None", errors: e2.attributes.errors || "displayed", scale: parseInt(e2.attributes.scale || "100", 10), fitToWidth: parseInt(e2.attributes.fitToWidth || "1", 10), fitToHeight: parseInt(e2.attributes.fitToHeight || "1", 10), firstPageNumber: parseInt(e2.attributes.firstPageNumber || "1", 10), useFirstPageNumber: "1" === e2.attributes.useFirstPageNumber, usePrinterDefaults: "1" === e2.attributes.usePrinterDefaults, copies: parseInt(e2.attributes.copies || "1", 10) }, true;
default:
return false;
}
var t2;
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../../../utils/under-dash": 26, "../base-xform": 32 }], 106: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "picture";
}
render(e2, t2) {
t2 && e2.leafNode(this.tag, { "r:id": t2.rId });
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.model = { rId: e2.attributes["r:id"] }, true;
default:
return false;
}
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 107: [function(e, t, r) {
const n = e("../../../utils/under-dash"), i = e("../base-xform");
function s(e2) {
return e2 ? "1" : void 0;
}
t.exports = class extends i {
get tag() {
return "printOptions";
}
render(e2, t2) {
if (t2) {
const r2 = { headings: s(t2.showRowColHeaders), gridLines: s(t2.showGridLines), horizontalCentered: s(t2.horizontalCentered), verticalCentered: s(t2.verticalCentered) };
n.some(r2, (e3) => void 0 !== e3) && e2.leafNode(this.tag, r2);
}
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.model = { showRowColHeaders: "1" === e2.attributes.headings, showGridLines: "1" === e2.attributes.gridLines, horizontalCentered: "1" === e2.attributes.horizontalCentered, verticalCentered: "1" === e2.attributes.verticalCentered }, true;
default:
return false;
}
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../../../utils/under-dash": 26, "../base-xform": 32 }], 108: [function(e, t, r) {
const n = e("./page-breaks-xform"), i = e("../list-xform");
t.exports = class extends i {
constructor() {
super({ tag: "rowBreaks", count: true, childXform: new n() });
}
render(e2, t2) {
if (t2 && t2.length) {
e2.openNode(this.tag, this.$), this.count && (e2.addAttribute(this.$count, t2.length), e2.addAttribute("manualBreakCount", t2.length));
const { childXform: r2 } = this;
t2.forEach((t3) => {
r2.render(e2, t3);
}), e2.closeNode();
} else this.empty && e2.leafNode(this.tag);
}
};
}, { "../list-xform": 71, "./page-breaks-xform": 102 }], 109: [function(e, t, r) {
const n = e("../base-xform"), i = e("../../../utils/utils"), s = e("./cell-xform");
t.exports = class extends n {
constructor(e2) {
super(), this.maxItems = e2 && e2.maxItems, this.map = { c: new s() };
}
get tag() {
return "row";
}
prepare(e2, t2) {
const r2 = t2.styles.addStyleModel(e2.style);
r2 && (e2.styleId = r2);
const n2 = this.map.c;
e2.cells.forEach((e3) => {
n2.prepare(e3, t2);
});
}
render(e2, t2, r2) {
e2.openNode("row"), e2.addAttribute("r", t2.number), t2.height && (e2.addAttribute("ht", t2.height), e2.addAttribute("customHeight", "1")), t2.hidden && e2.addAttribute("hidden", "1"), t2.min > 0 && t2.max > 0 && t2.min <= t2.max && e2.addAttribute("spans", `${t2.min}:${t2.max}`), t2.styleId && (e2.addAttribute("s", t2.styleId), e2.addAttribute("customFormat", "1")), e2.addAttribute("x14ac:dyDescent", "0.25"), t2.outlineLevel && e2.addAttribute("outlineLevel", t2.outlineLevel), t2.collapsed && e2.addAttribute("collapsed", "1");
const n2 = this.map.c;
t2.cells.forEach((t3) => {
n2.render(e2, t3, r2);
}), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
if ("row" === e2.name) {
this.numRowsSeen += 1;
const t2 = e2.attributes.spans ? e2.attributes.spans.split(":").map((e3) => parseInt(e3, 10)) : [void 0, void 0], r2 = this.model = { number: parseInt(e2.attributes.r, 10), min: t2[0], max: t2[1], cells: [] };
return e2.attributes.s && (r2.styleId = parseInt(e2.attributes.s, 10)), i.parseBoolean(e2.attributes.hidden) && (r2.hidden = true), i.parseBoolean(e2.attributes.bestFit) && (r2.bestFit = true), e2.attributes.ht && (r2.height = parseFloat(e2.attributes.ht)), e2.attributes.outlineLevel && (r2.outlineLevel = parseInt(e2.attributes.outlineLevel, 10)), i.parseBoolean(e2.attributes.collapsed) && (r2.collapsed = true), true;
}
return this.parser = this.map[e2.name], !!this.parser && (this.parser.parseOpen(e2), true);
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) {
if (!this.parser.parseClose(e2)) {
if (this.model.cells.push(this.parser.model), this.maxItems && this.model.cells.length > this.maxItems) throw new Error(`Max column count (${this.maxItems}) exceeded`);
this.parser = void 0;
}
return true;
}
return false;
}
reconcile(e2, t2) {
e2.style = e2.styleId ? t2.styles.getStyleModel(e2.styleId) : {}, void 0 !== e2.styleId && (e2.styleId = void 0);
const r2 = this.map.c;
e2.cells.forEach((e3) => {
r2.reconcile(e3, t2);
});
}
};
}, { "../../../utils/utils": 27, "../base-xform": 32, "./cell-xform": 73 }], 110: [function(e, t, r) {
const n = e("../../../utils/under-dash"), i = e("../base-xform");
t.exports = class extends i {
get tag() {
return "sheetFormatPr";
}
render(e2, t2) {
if (t2) {
const r2 = { defaultRowHeight: t2.defaultRowHeight, outlineLevelRow: t2.outlineLevelRow, outlineLevelCol: t2.outlineLevelCol, "x14ac:dyDescent": t2.dyDescent };
t2.defaultColWidth && (r2.defaultColWidth = t2.defaultColWidth), t2.defaultRowHeight && 15 === t2.defaultRowHeight || (r2.customHeight = "1"), n.some(r2, (e3) => void 0 !== e3) && e2.leafNode("sheetFormatPr", r2);
}
}
parseOpen(e2) {
return "sheetFormatPr" === e2.name && (this.model = { defaultRowHeight: parseFloat(e2.attributes.defaultRowHeight || "0"), dyDescent: parseFloat(e2.attributes["x14ac:dyDescent"] || "0"), outlineLevelRow: parseInt(e2.attributes.outlineLevelRow || "0", 10), outlineLevelCol: parseInt(e2.attributes.outlineLevelCol || "0", 10) }, e2.attributes.defaultColWidth && (this.model.defaultColWidth = parseFloat(e2.attributes.defaultColWidth)), true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../../../utils/under-dash": 26, "../base-xform": 32 }], 111: [function(e, t, r) {
const n = e("../base-xform"), i = e("../style/color-xform"), s = e("./page-setup-properties-xform"), o = e("./outline-properties-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { tabColor: new i("tabColor"), pageSetUpPr: new s(), outlinePr: new o() };
}
get tag() {
return "sheetPr";
}
render(e2, t2) {
if (t2) {
e2.addRollback(), e2.openNode("sheetPr");
let r2 = false;
r2 = this.map.tabColor.render(e2, t2.tabColor) || r2, r2 = this.map.pageSetUpPr.render(e2, t2.pageSetup) || r2, r2 = this.map.outlinePr.render(e2, t2.outlineProperties) || r2, r2 ? (e2.closeNode(), e2.commit()) : e2.rollback();
}
}
parseOpen(e2) {
return this.parser ? (this.parser.parseOpen(e2), true) : e2.name === this.tag ? (this.reset(), true) : !!this.map[e2.name] && (this.parser = this.map[e2.name], this.parser.parseOpen(e2), true);
}
parseText(e2) {
return !!this.parser && (this.parser.parseText(e2), true);
}
parseClose(e2) {
return this.parser ? (this.parser.parseClose(e2) || (this.parser = void 0), true) : (this.map.tabColor.model || this.map.pageSetUpPr.model || this.map.outlinePr.model ? (this.model = {}, this.map.tabColor.model && (this.model.tabColor = this.map.tabColor.model), this.map.pageSetUpPr.model && (this.model.pageSetup = this.map.pageSetUpPr.model), this.map.outlinePr.model && (this.model.outlineProperties = this.map.outlinePr.model)) : this.model = null, false);
}
};
}, { "../base-xform": 32, "../style/color-xform": 128, "./outline-properties-xform": 101, "./page-setup-properties-xform": 104 }], 112: [function(e, t, r) {
const n = e("../../../utils/under-dash"), i = e("../base-xform");
function s(e2, t2) {
return e2 ? t2 : void 0;
}
function o(e2, t2) {
return e2 === t2 || void 0;
}
t.exports = class extends i {
get tag() {
return "sheetProtection";
}
render(e2, t2) {
if (t2) {
const r2 = { sheet: s(t2.sheet, "1"), selectLockedCells: false === t2.selectLockedCells ? "1" : void 0, selectUnlockedCells: false === t2.selectUnlockedCells ? "1" : void 0, formatCells: s(t2.formatCells, "0"), formatColumns: s(t2.formatColumns, "0"), formatRows: s(t2.formatRows, "0"), insertColumns: s(t2.insertColumns, "0"), insertRows: s(t2.insertRows, "0"), insertHyperlinks: s(t2.insertHyperlinks, "0"), deleteColumns: s(t2.deleteColumns, "0"), deleteRows: s(t2.deleteRows, "0"), sort: s(t2.sort, "0"), autoFilter: s(t2.autoFilter, "0"), pivotTables: s(t2.pivotTables, "0") };
t2.sheet && (r2.algorithmName = t2.algorithmName, r2.hashValue = t2.hashValue, r2.saltValue = t2.saltValue, r2.spinCount = t2.spinCount, r2.objects = s(false === t2.objects, "1"), r2.scenarios = s(false === t2.scenarios, "1")), n.some(r2, (e3) => void 0 !== e3) && e2.leafNode(this.tag, r2);
}
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.model = { sheet: o(e2.attributes.sheet, "1"), objects: "1" !== e2.attributes.objects && void 0, scenarios: "1" !== e2.attributes.scenarios && void 0, selectLockedCells: "1" !== e2.attributes.selectLockedCells && void 0, selectUnlockedCells: "1" !== e2.attributes.selectUnlockedCells && void 0, formatCells: o(e2.attributes.formatCells, "0"), formatColumns: o(e2.attributes.formatColumns, "0"), formatRows: o(e2.attributes.formatRows, "0"), insertColumns: o(e2.attributes.insertColumns, "0"), insertRows: o(e2.attributes.insertRows, "0"), insertHyperlinks: o(e2.attributes.insertHyperlinks, "0"), deleteColumns: o(e2.attributes.deleteColumns, "0"), deleteRows: o(e2.attributes.deleteRows, "0"), sort: o(e2.attributes.sort, "0"), autoFilter: o(e2.attributes.autoFilter, "0"), pivotTables: o(e2.attributes.pivotTables, "0") }, e2.attributes.algorithmName && (this.model.algorithmName = e2.attributes.algorithmName, this.model.hashValue = e2.attributes.hashValue, this.model.saltValue = e2.attributes.saltValue, this.model.spinCount = parseInt(e2.attributes.spinCount, 10)), true;
default:
return false;
}
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../../../utils/under-dash": 26, "../base-xform": 32 }], 113: [function(e, t, r) {
const n = e("../../../utils/col-cache"), i = e("../base-xform"), s = { frozen: "frozen", frozenSplit: "frozen", split: "split" };
t.exports = class extends i {
get tag() {
return "sheetView";
}
prepare(e2) {
switch (e2.state) {
case "frozen":
case "split":
break;
default:
e2.state = "normal";
}
}
render(e2, t2) {
e2.openNode("sheetView", { workbookViewId: t2.workbookViewId || 0 });
const r2 = function(t3, r3, n2) {
n2 && e2.addAttribute(t3, r3);
};
let i2, s2, o, a;
switch (r2("rightToLeft", "1", true === t2.rightToLeft), r2("tabSelected", "1", t2.tabSelected), r2("showRuler", "0", false === t2.showRuler), r2("showRowColHeaders", "0", false === t2.showRowColHeaders), r2("showGridLines", "0", false === t2.showGridLines), r2("zoomScale", t2.zoomScale, t2.zoomScale), r2("zoomScaleNormal", t2.zoomScaleNormal, t2.zoomScaleNormal), r2("view", t2.style, t2.style), t2.state) {
case "frozen":
s2 = t2.xSplit || 0, o = t2.ySplit || 0, i2 = t2.topLeftCell || n.getAddress(o + 1, s2 + 1).address, a = (t2.xSplit && t2.ySplit ? "bottomRight" : t2.xSplit && "topRight") || "bottomLeft", e2.leafNode("pane", { xSplit: t2.xSplit || void 0, ySplit: t2.ySplit || void 0, topLeftCell: i2, activePane: a, state: "frozen" }), e2.leafNode("selection", { pane: a, activeCell: t2.activeCell, sqref: t2.activeCell });
break;
case "split":
"topLeft" === t2.activePane && (t2.activePane = void 0), e2.leafNode("pane", { xSplit: t2.xSplit || void 0, ySplit: t2.ySplit || void 0, topLeftCell: t2.topLeftCell, activePane: t2.activePane }), e2.leafNode("selection", { pane: t2.activePane, activeCell: t2.activeCell, sqref: t2.activeCell });
break;
case "normal":
t2.activeCell && e2.leafNode("selection", { activeCell: t2.activeCell, sqref: t2.activeCell });
}
e2.closeNode();
}
parseOpen(e2) {
switch (e2.name) {
case "sheetView":
return this.sheetView = { workbookViewId: parseInt(e2.attributes.workbookViewId, 10), rightToLeft: "1" === e2.attributes.rightToLeft, tabSelected: "1" === e2.attributes.tabSelected, showRuler: !("0" === e2.attributes.showRuler), showRowColHeaders: !("0" === e2.attributes.showRowColHeaders), showGridLines: !("0" === e2.attributes.showGridLines), zoomScale: parseInt(e2.attributes.zoomScale || "100", 10), zoomScaleNormal: parseInt(e2.attributes.zoomScaleNormal || "100", 10), style: e2.attributes.view }, this.pane = void 0, this.selections = {}, true;
case "pane":
return this.pane = { xSplit: parseInt(e2.attributes.xSplit || "0", 10), ySplit: parseInt(e2.attributes.ySplit || "0", 10), topLeftCell: e2.attributes.topLeftCell, activePane: e2.attributes.activePane || "topLeft", state: e2.attributes.state }, true;
case "selection": {
const t2 = e2.attributes.pane || "topLeft";
return this.selections[t2] = { pane: t2, activeCell: e2.attributes.activeCell }, true;
}
default:
return false;
}
}
parseText() {
}
parseClose(e2) {
let t2, r2;
switch (e2) {
case "sheetView":
return this.sheetView && this.pane ? (t2 = this.model = { workbookViewId: this.sheetView.workbookViewId, rightToLeft: this.sheetView.rightToLeft, state: s[this.pane.state] || "split", xSplit: this.pane.xSplit, ySplit: this.pane.ySplit, topLeftCell: this.pane.topLeftCell, showRuler: this.sheetView.showRuler, showRowColHeaders: this.sheetView.showRowColHeaders, showGridLines: this.sheetView.showGridLines, zoomScale: this.sheetView.zoomScale, zoomScaleNormal: this.sheetView.zoomScaleNormal }, "split" === this.model.state && (t2.activePane = this.pane.activePane), r2 = this.selections[this.pane.activePane], r2 && r2.activeCell && (t2.activeCell = r2.activeCell), this.sheetView.style && (t2.style = this.sheetView.style)) : (t2 = this.model = { workbookViewId: this.sheetView.workbookViewId, rightToLeft: this.sheetView.rightToLeft, state: "normal", showRuler: this.sheetView.showRuler, showRowColHeaders: this.sheetView.showRowColHeaders, showGridLines: this.sheetView.showGridLines, zoomScale: this.sheetView.zoomScale, zoomScaleNormal: this.sheetView.zoomScaleNormal }, r2 = this.selections.topLeft, r2 && r2.activeCell && (t2.activeCell = r2.activeCell), this.sheetView.style && (t2.style = this.sheetView.style)), false;
default:
return true;
}
}
reconcile() {
}
};
}, { "../../../utils/col-cache": 19, "../base-xform": 32 }], 114: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "tablePart";
}
render(e2, t2) {
t2 && e2.leafNode(this.tag, { "r:id": t2.rId });
}
parseOpen(e2) {
switch (e2.name) {
case this.tag:
return this.model = { rId: e2.attributes["r:id"] }, true;
default:
return false;
}
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 115: [function(e, t, r) {
const n = e("../../../utils/under-dash"), i = e("../../../utils/col-cache"), s = e("../../../utils/xml-stream"), o = e("../../rel-type"), a = e("./merges"), l = e("../base-xform"), c = e("../list-xform"), u = e("./row-xform"), h = e("./col-xform"), f = e("./dimension-xform"), d = e("./hyperlink-xform"), p = e("./merge-cell-xform"), m = e("./data-validations-xform"), b = e("./sheet-properties-xform"), g = e("./sheet-format-properties-xform"), y = e("./sheet-view-xform"), v = e("./sheet-protection-xform"), w = e("./page-margins-xform"), _ = e("./page-setup-xform"), x = e("./print-options-xform"), k = e("./auto-filter-xform"), S = e("./picture-xform"), M = e("./drawing-xform"), C = e("./table-part-xform"), T = e("./row-breaks-xform"), E = e("./header-footer-xform"), A = e("./cf/conditional-formattings-xform"), R = e("./ext-lst-xform"), O = (e2, t2) => {
if (!t2 || !t2.length) return e2;
if (!e2 || !e2.length) return t2;
const r2 = {}, n2 = {};
return e2.forEach((e3) => {
r2[e3.ref] = e3, e3.rules.forEach((e4) => {
const { x14Id: t3 } = e4;
t3 && (n2[t3] = e4);
});
}), t2.forEach((t3) => {
t3.rules.forEach((i2) => {
const s2 = n2[i2.x14Id];
s2 ? ((e3, t4) => {
Object.keys(t4).forEach((r3) => {
const n3 = e3[r3], i3 = t4[r3];
void 0 === n3 && void 0 !== i3 && (e3[r3] = i3);
});
})(s2, i2) : r2[t3.ref] ? r2[t3.ref].rules.push(i2) : e2.push({ ref: t3.ref, rules: [i2] });
});
}), e2;
};
class j extends l {
constructor(e2) {
super();
const { maxRows: t2, maxCols: r2, ignoreNodes: n2 } = e2 || {};
this.ignoreNodes = n2 || [], this.map = { sheetPr: new b(), dimension: new f(), sheetViews: new c({ tag: "sheetViews", count: false, childXform: new y() }), sheetFormatPr: new g(), cols: new c({ tag: "cols", count: false, childXform: new h() }), sheetData: new c({ tag: "sheetData", count: false, empty: true, childXform: new u({ maxItems: r2 }), maxItems: t2 }), autoFilter: new k(), mergeCells: new c({ tag: "mergeCells", count: true, childXform: new p() }), rowBreaks: new T(), hyperlinks: new c({ tag: "hyperlinks", count: false, childXform: new d() }), pageMargins: new w(), dataValidations: new m(), pageSetup: new _(), headerFooter: new E(), printOptions: new x(), picture: new S(), drawing: new M(), sheetProtection: new v(), tableParts: new c({ tag: "tableParts", count: true, childXform: new C() }), conditionalFormatting: new A(), extLst: new R() };
}
prepare(e2, t2) {
t2.merges = new a(), e2.hyperlinks = t2.hyperlinks = [], e2.comments = t2.comments = [], t2.formulae = {}, t2.siFormulae = 0, this.map.cols.prepare(e2.cols, t2), this.map.sheetData.prepare(e2.rows, t2), this.map.conditionalFormatting.prepare(e2.conditionalFormattings, t2), e2.mergeCells = t2.merges.mergeCells;
const r2 = e2.rels = [];
function n2(e3) {
return "rId" + (e3.length + 1);
}
if (e2.hyperlinks.forEach((e3) => {
const t3 = n2(r2);
e3.rId = t3, r2.push({ Id: t3, Type: o.Hyperlink, Target: e3.target, TargetMode: "External" });
}), e2.comments.length > 0) {
const s3 = { Id: n2(r2), Type: o.Comments, Target: `../comments${e2.id}.xml` };
r2.push(s3);
const a2 = { Id: n2(r2), Type: o.VmlDrawing, Target: `../drawings/vmlDrawing${e2.id}.vml` };
r2.push(a2), e2.comments.forEach((e3) => {
e3.refAddress = i.decodeAddress(e3.ref);
}), t2.commentRefs.push({ commentName: "comments" + e2.id, vmlDrawing: "vmlDrawing" + e2.id });
}
const s2 = [];
let l2;
e2.media.forEach((i2) => {
if ("background" === i2.type) {
const s3 = n2(r2);
l2 = t2.media[i2.imageId], r2.push({ Id: s3, Type: o.Image, Target: `../media/${l2.name}.${l2.extension}` }), e2.background = { rId: s3 }, e2.image = t2.media[i2.imageId];
} else if ("image" === i2.type) {
let { drawing: a2 } = e2;
l2 = t2.media[i2.imageId], a2 || (a2 = e2.drawing = { rId: n2(r2), name: "drawing" + ++t2.drawingsCount, anchors: [], rels: [] }, t2.drawings.push(a2), r2.push({ Id: a2.rId, Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing", Target: `../drawings/${a2.name}.xml` }));
let c2 = this.preImageId === i2.imageId ? s2[i2.imageId] : s2[a2.rels.length];
c2 || (c2 = n2(a2.rels), s2[a2.rels.length] = c2, a2.rels.push({ Id: c2, Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", Target: `../media/${l2.name}.${l2.extension}` }));
const u2 = { picture: { rId: c2 }, range: i2.range };
if (i2.hyperlinks && i2.hyperlinks.hyperlink) {
const e3 = n2(a2.rels);
s2[a2.rels.length] = e3, u2.picture.hyperlinks = { tooltip: i2.hyperlinks.tooltip, rId: e3 }, a2.rels.push({ Id: e3, Type: o.Hyperlink, Target: i2.hyperlinks.hyperlink, TargetMode: "External" });
}
this.preImageId = i2.imageId, a2.anchors.push(u2);
}
}), e2.tables.forEach((e3) => {
const i2 = n2(r2);
e3.rId = i2, r2.push({ Id: i2, Type: o.Table, Target: "../tables/" + e3.target }), e3.columns.forEach((e4) => {
const { style: r3 } = e4;
r3 && (e4.dxfId = t2.styles.addDxfStyle(r3));
});
}), this.map.extLst.prepare(e2, t2);
}
render(e2, t2) {
e2.openXml(s.StdDocAttributes), e2.openNode("worksheet", j.WORKSHEET_ATTRIBUTES);
const r2 = t2.properties ? { defaultRowHeight: t2.properties.defaultRowHeight, dyDescent: t2.properties.dyDescent, outlineLevelCol: t2.properties.outlineLevelCol, outlineLevelRow: t2.properties.outlineLevelRow } : void 0;
t2.properties && t2.properties.defaultColWidth && (r2.defaultColWidth = t2.properties.defaultColWidth);
const n2 = { outlineProperties: t2.properties && t2.properties.outlineProperties, tabColor: t2.properties && t2.properties.tabColor, pageSetup: t2.pageSetup && t2.pageSetup.fitToPage ? { fitToPage: t2.pageSetup.fitToPage } : void 0 }, i2 = t2.pageSetup && t2.pageSetup.margins, a2 = { showRowColHeaders: t2.pageSetup && t2.pageSetup.showRowColHeaders, showGridLines: t2.pageSetup && t2.pageSetup.showGridLines, horizontalCentered: t2.pageSetup && t2.pageSetup.horizontalCentered, verticalCentered: t2.pageSetup && t2.pageSetup.verticalCentered }, l2 = t2.sheetProtection;
this.map.sheetPr.render(e2, n2), this.map.dimension.render(e2, t2.dimensions), this.map.sheetViews.render(e2, t2.views), this.map.sheetFormatPr.render(e2, r2), this.map.cols.render(e2, t2.cols), this.map.sheetData.render(e2, t2.rows), this.map.sheetProtection.render(e2, l2), this.map.autoFilter.render(e2, t2.autoFilter), this.map.mergeCells.render(e2, t2.mergeCells), this.map.conditionalFormatting.render(e2, t2.conditionalFormattings), this.map.dataValidations.render(e2, t2.dataValidations), this.map.hyperlinks.render(e2, t2.hyperlinks), this.map.printOptions.render(e2, a2), this.map.pageMargins.render(e2, i2), this.map.pageSetup.render(e2, t2.pageSetup), this.map.headerFooter.render(e2, t2.headerFooter), this.map.rowBreaks.render(e2, t2.rowBreaks), this.map.drawing.render(e2, t2.drawing), this.map.picture.render(e2, t2.background), this.map.tableParts.render(e2, t2.tables), this.map.extLst.render(e2, t2), t2.rels && t2.rels.forEach((t3) => {
t3.Type === o.VmlDrawing && e2.leafNode("legacyDrawing", { "r:id": t3.Id });
}), e2.closeNode();
}
parseOpen(e2) {
return this.parser ? (this.parser.parseOpen(e2), true) : "worksheet" === e2.name ? (n.each(this.map, (e3) => {
e3.reset();
}), true) : (this.map[e2.name] && !this.ignoreNodes.includes(e2.name) && (this.parser = this.map[e2.name], this.parser.parseOpen(e2)), true);
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case "worksheet": {
const e3 = this.map.sheetFormatPr.model || {};
this.map.sheetPr.model && this.map.sheetPr.model.tabColor && (e3.tabColor = this.map.sheetPr.model.tabColor), this.map.sheetPr.model && this.map.sheetPr.model.outlineProperties && (e3.outlineProperties = this.map.sheetPr.model.outlineProperties);
const t2 = { fitToPage: this.map.sheetPr.model && this.map.sheetPr.model.pageSetup && this.map.sheetPr.model.pageSetup.fitToPage || false, margins: this.map.pageMargins.model }, r2 = Object.assign(t2, this.map.pageSetup.model, this.map.printOptions.model), n2 = O(this.map.conditionalFormatting.model, this.map.extLst.model && this.map.extLst.model["x14:conditionalFormattings"]);
return this.model = { dimensions: this.map.dimension.model, cols: this.map.cols.model, rows: this.map.sheetData.model, mergeCells: this.map.mergeCells.model, hyperlinks: this.map.hyperlinks.model, dataValidations: this.map.dataValidations.model, properties: e3, views: this.map.sheetViews.model, pageSetup: r2, headerFooter: this.map.headerFooter.model, background: this.map.picture.model, drawing: this.map.drawing.model, tables: this.map.tableParts.model, conditionalFormattings: n2 }, this.map.autoFilter.model && (this.model.autoFilter = this.map.autoFilter.model), this.map.sheetProtection.model && (this.model.sheetProtection = this.map.sheetProtection.model), false;
}
default:
return true;
}
}
reconcile(e2, t2) {
const r2 = (e2.relationships || []).reduce((r3, n3) => {
if (r3[n3.Id] = n3, n3.Type === o.Comments && (e2.comments = t2.comments[n3.Target].comments), n3.Type === o.VmlDrawing && e2.comments && e2.comments.length) {
const r4 = t2.vmlDrawings[n3.Target].comments;
e2.comments.forEach((e3, t3) => {
e3.note = Object.assign({}, e3.note, r4[t3]);
});
}
return r3;
}, {});
if (t2.commentsMap = (e2.comments || []).reduce((e3, t3) => (t3.ref && (e3[t3.ref] = t3), e3), {}), t2.hyperlinkMap = (e2.hyperlinks || []).reduce((e3, t3) => (t3.rId && (e3[t3.address] = r2[t3.rId].Target), e3), {}), t2.formulae = {}, e2.rows = e2.rows && e2.rows.filter(Boolean) || [], e2.rows.forEach((e3) => {
e3.cells = e3.cells && e3.cells.filter(Boolean) || [];
}), this.map.cols.reconcile(e2.cols, t2), this.map.sheetData.reconcile(e2.rows, t2), this.map.conditionalFormatting.reconcile(e2.conditionalFormattings, t2), e2.media = [], e2.drawing) {
const n3 = r2[e2.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);
if (n3) {
const r3 = n3[1];
t2.drawings[r3].anchors.forEach((t3) => {
if (t3.medium) {
const r4 = { type: "image", imageId: t3.medium.index, range: t3.range, hyperlinks: t3.picture.hyperlinks };
e2.media.push(r4);
}
});
}
}
const n2 = e2.background && r2[e2.background.rId];
if (n2) {
const r3 = n2.Target.split("/media/")[1], i2 = t2.mediaIndex && t2.mediaIndex[r3];
void 0 !== i2 && e2.media.push({ type: "background", imageId: i2 });
}
e2.tables = (e2.tables || []).map((e3) => {
const n3 = r2[e3.rId];
return t2.tables[n3.Target];
}), delete e2.relationships, delete e2.hyperlinks, delete e2.comments;
}
}
j.WORKSHEET_ATTRIBUTES = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships", "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", "mc:Ignorable": "x14ac", "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" }, t.exports = j;
}, { "../../../utils/col-cache": 19, "../../../utils/under-dash": 26, "../../../utils/xml-stream": 28, "../../rel-type": 31, "../base-xform": 32, "../list-xform": 71, "./auto-filter-xform": 72, "./cf/conditional-formattings-xform": 87, "./col-xform": 92, "./data-validations-xform": 93, "./dimension-xform": 94, "./drawing-xform": 95, "./ext-lst-xform": 96, "./header-footer-xform": 97, "./hyperlink-xform": 98, "./merge-cell-xform": 99, "./merges": 100, "./page-margins-xform": 103, "./page-setup-xform": 105, "./picture-xform": 106, "./print-options-xform": 107, "./row-breaks-xform": 108, "./row-xform": 109, "./sheet-format-properties-xform": 110, "./sheet-properties-xform": 111, "./sheet-protection-xform": 112, "./sheet-view-xform": 113, "./table-part-xform": 114 }], 116: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
constructor(e2) {
super(), this.tag = e2.tag, this.attr = e2.attr;
}
render(e2, t2) {
t2 && (e2.openNode(this.tag), e2.closeNode());
}
parseOpen(e2) {
e2.name === this.tag && (this.model = true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 117: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
constructor(e2) {
super(), this.tag = e2.tag, this.attr = e2.attr, this.attrs = e2.attrs, this._format = e2.format || function(e3) {
try {
return Number.isNaN(e3.getTime()) ? "" : e3.toISOString();
} catch (e4) {
return "";
}
}, this._parse = e2.parse || function(e3) {
return new Date(e3);
};
}
render(e2, t2) {
t2 && (e2.openNode(this.tag), this.attrs && e2.addAttributes(this.attrs), this.attr ? e2.addAttribute(this.attr, this._format(t2)) : e2.writeText(this._format(t2)), e2.closeNode());
}
parseOpen(e2) {
e2.name === this.tag && (this.attr ? this.model = this._parse(e2.attributes[this.attr]) : this.text = []);
}
parseText(e2) {
this.attr || this.text.push(e2);
}
parseClose() {
return this.attr || (this.model = this._parse(this.text.join(""))), false;
}
};
}, { "../base-xform": 32 }], 118: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
constructor(e2) {
super(), this.tag = e2.tag, this.attr = e2.attr, this.attrs = e2.attrs, this.zero = e2.zero;
}
render(e2, t2) {
(t2 || this.zero) && (e2.openNode(this.tag), this.attrs && e2.addAttributes(this.attrs), this.attr ? e2.addAttribute(this.attr, t2) : e2.writeText(t2), e2.closeNode());
}
parseOpen(e2) {
return e2.name === this.tag && (this.attr ? this.model = parseInt(e2.attributes[this.attr], 10) : this.text = [], true);
}
parseText(e2) {
this.attr || this.text.push(e2);
}
parseClose() {
return this.attr || (this.model = parseInt(this.text.join("") || 0, 10)), false;
}
};
}, { "../base-xform": 32 }], 119: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
constructor(e2) {
super(), this.tag = e2.tag, this.attr = e2.attr, this.attrs = e2.attrs;
}
render(e2, t2) {
void 0 !== t2 && (e2.openNode(this.tag), this.attrs && e2.addAttributes(this.attrs), this.attr ? e2.addAttribute(this.attr, t2) : e2.writeText(t2), e2.closeNode());
}
parseOpen(e2) {
e2.name === this.tag && (this.attr ? this.model = e2.attributes[this.attr] : this.text = []);
}
parseText(e2) {
this.attr || this.text.push(e2);
}
parseClose() {
return this.attr || (this.model = this.text.join("")), false;
}
};
}, { "../base-xform": 32 }], 120: [function(e, t, r) {
const n = e("./base-xform"), i = e("../../utils/xml-stream");
t.exports = class extends n {
constructor(e2) {
super(), this._model = e2;
}
render(e2) {
if (!this._xml) {
const e3 = new i();
!(function e4(t2, r2) {
t2.openNode(r2.tag, r2.$), r2.c && r2.c.forEach((r3) => {
e4(t2, r3);
}), r2.t && t2.writeText(r2.t), t2.closeNode();
})(e3, this._model), this._xml = e3.xml;
}
e2.writeXml(this._xml);
}
parseOpen() {
return true;
}
parseText() {
}
parseClose(e2) {
switch (e2) {
case this._model.tag:
return false;
default:
return true;
}
}
};
}, { "../../utils/xml-stream": 28, "./base-xform": 32 }], 121: [function(e, t, r) {
const n = e("./text-xform"), i = e("./rich-text-xform"), s = e("../base-xform");
t.exports = class extends s {
constructor() {
super(), this.map = { r: new i(), t: new n() };
}
get tag() {
return "rPh";
}
render(e2, t2) {
if (e2.openNode(this.tag, { sb: t2.sb || 0, eb: t2.eb || 0 }), t2 && t2.hasOwnProperty("richText") && t2.richText) {
const { r: r2 } = this.map;
t2.richText.forEach((t3) => {
r2.render(e2, t3);
});
} else t2 && this.map.t.render(e2, t2.text);
e2.closeNode();
}
parseOpen(e2) {
const { name: t2 } = e2;
return this.parser ? (this.parser.parseOpen(e2), true) : t2 === this.tag ? (this.model = { sb: parseInt(e2.attributes.sb, 10), eb: parseInt(e2.attributes.eb, 10) }, true) : (this.parser = this.map[t2], !!this.parser && (this.parser.parseOpen(e2), true));
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) {
if (!this.parser.parseClose(e2)) {
switch (e2) {
case "r": {
let e3 = this.model.richText;
e3 || (e3 = this.model.richText = []), e3.push(this.parser.model);
break;
}
case "t":
this.model.text = this.parser.model;
}
this.parser = void 0;
}
return true;
}
switch (e2) {
case this.tag:
return false;
default:
return true;
}
}
};
}, { "../base-xform": 32, "./rich-text-xform": 122, "./text-xform": 125 }], 122: [function(e, t, r) {
const n = e("./text-xform"), i = e("../style/font-xform"), s = e("../base-xform");
class o extends s {
constructor(e2) {
super(), this.model = e2;
}
get tag() {
return "r";
}
get textXform() {
return this._textXform || (this._textXform = new n());
}
get fontXform() {
return this._fontXform || (this._fontXform = new i(o.FONT_OPTIONS));
}
render(e2, t2) {
t2 = t2 || this.model, e2.openNode("r"), t2.font && this.fontXform.render(e2, t2.font), this.textXform.render(e2, t2.text), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "r":
return this.model = {}, true;
case "t":
return this.parser = this.textXform, this.parser.parseOpen(e2), true;
case "rPr":
return this.parser = this.fontXform, this.parser.parseOpen(e2), true;
default:
return false;
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
switch (e2) {
case "r":
return false;
case "t":
return this.model.text = this.parser.model, this.parser = void 0, true;
case "rPr":
return this.model.font = this.parser.model, this.parser = void 0, true;
default:
return this.parser && this.parser.parseClose(e2), true;
}
}
}
o.FONT_OPTIONS = { tagName: "rPr", fontNameTag: "rFont" }, t.exports = o;
}, { "../base-xform": 32, "../style/font-xform": 131, "./text-xform": 125 }], 123: [function(e, t, r) {
const n = e("./text-xform"), i = e("./rich-text-xform"), s = e("./phonetic-text-xform"), o = e("../base-xform");
t.exports = class extends o {
constructor(e2) {
super(), this.model = e2, this.map = { r: new i(), t: new n(), rPh: new s() };
}
get tag() {
return "si";
}
render(e2, t2) {
e2.openNode(this.tag), t2 && t2.hasOwnProperty("richText") && t2.richText ? t2.richText.length ? t2.richText.forEach((t3) => {
this.map.r.render(e2, t3);
}) : this.map.t.render(e2, "") : null != t2 && this.map.t.render(e2, t2), e2.closeNode();
}
parseOpen(e2) {
const { name: t2 } = e2;
return this.parser ? (this.parser.parseOpen(e2), true) : t2 === this.tag ? (this.model = {}, true) : (this.parser = this.map[t2], !!this.parser && (this.parser.parseOpen(e2), true));
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) {
if (!this.parser.parseClose(e2)) {
switch (e2) {
case "r": {
let e3 = this.model.richText;
e3 || (e3 = this.model.richText = []), e3.push(this.parser.model);
break;
}
case "t":
this.model = this.parser.model;
}
this.parser = void 0;
}
return true;
}
switch (e2) {
case this.tag:
return false;
default:
return true;
}
}
};
}, { "../base-xform": 32, "./phonetic-text-xform": 121, "./rich-text-xform": 122, "./text-xform": 125 }], 124: [function(e, t, r) {
const n = e("../../../utils/xml-stream"), i = e("../base-xform"), s = e("./shared-string-xform");
t.exports = class extends i {
constructor(e2) {
super(), this.model = e2 || { values: [], count: 0 }, this.hash = /* @__PURE__ */ Object.create(null), this.rich = /* @__PURE__ */ Object.create(null);
}
get sharedStringXform() {
return this._sharedStringXform || (this._sharedStringXform = new s());
}
get values() {
return this.model.values;
}
get uniqueCount() {
return this.model.values.length;
}
get count() {
return this.model.count;
}
getString(e2) {
return this.model.values[e2];
}
add(e2) {
return e2.richText ? this.addRichText(e2) : this.addText(e2);
}
addText(e2) {
let t2 = this.hash[e2];
return void 0 === t2 && (t2 = this.hash[e2] = this.model.values.length, this.model.values.push(e2)), this.model.count++, t2;
}
addRichText(e2) {
const t2 = this.sharedStringXform.toXml(e2);
let r2 = this.rich[t2];
return void 0 === r2 && (r2 = this.rich[t2] = this.model.values.length, this.model.values.push(e2)), this.model.count++, r2;
}
render(e2, t2) {
t2 = t2 || this._values, e2.openXml(n.StdDocAttributes), e2.openNode("sst", { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", count: t2.count, uniqueCount: t2.values.length });
const r2 = this.sharedStringXform;
t2.values.forEach((t3) => {
r2.render(e2, t3);
}), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "sst":
return true;
case "si":
return this.parser = this.sharedStringXform, this.parser.parseOpen(e2), true;
default:
throw new Error("Unexpected xml node in parseOpen: " + JSON.stringify(e2));
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.model.values.push(this.parser.model), this.model.count++, this.parser = void 0), true;
switch (e2) {
case "sst":
return false;
default:
throw new Error("Unexpected xml node in parseClose: " + e2);
}
}
};
}, { "../../../utils/xml-stream": 28, "../base-xform": 32, "./shared-string-xform": 123 }], 125: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "t";
}
render(e2, t2) {
e2.openNode("t"), /^\s|\n|\s$/.test(t2) && e2.addAttribute("xml:space", "preserve"), e2.writeText(t2), e2.closeNode();
}
get model() {
return this._text.join("").replace(/_x([0-9A-F]{4})_/g, (e2, t2) => String.fromCharCode(parseInt(t2, 16)));
}
parseOpen(e2) {
switch (e2.name) {
case "t":
return this._text = [], true;
default:
return false;
}
}
parseText(e2) {
this._text.push(e2);
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 126: [function(e, t, r) {
const n = e("../../../doc/enums"), i = e("../../../utils/utils"), s = e("../base-xform"), o = { horizontalValues: ["left", "center", "right", "fill", "centerContinuous", "distributed", "justify"].reduce((e2, t2) => (e2[t2] = true, e2), {}), horizontal(e2) {
return this.horizontalValues[e2] ? e2 : void 0;
}, verticalValues: ["top", "middle", "bottom", "distributed", "justify"].reduce((e2, t2) => (e2[t2] = true, e2), {}), vertical(e2) {
return "middle" === e2 ? "center" : this.verticalValues[e2] ? e2 : void 0;
}, wrapText: (e2) => !!e2 || void 0, shrinkToFit: (e2) => !!e2 || void 0, textRotation(e2) {
switch (e2) {
case "vertical":
return e2;
default:
return (e2 = i.validInt(e2)) >= -90 && e2 <= 90 ? e2 : void 0;
}
}, indent: (e2) => (e2 = i.validInt(e2), Math.max(0, e2)), readingOrder(e2) {
switch (e2) {
case "ltr":
return n.ReadingOrder.LeftToRight;
case "rtl":
return n.ReadingOrder.RightToLeft;
default:
return;
}
} }, a = { toXml(e2) {
if (e2 = o.textRotation(e2)) {
if ("vertical" === e2) return 255;
const t2 = Math.round(e2);
if (t2 >= 0 && t2 <= 90) return t2;
if (t2 < 0 && t2 >= -90) return 90 - t2;
}
}, toModel(e2) {
const t2 = i.validInt(e2);
if (void 0 !== t2) {
if (255 === t2) return "vertical";
if (t2 >= 0 && t2 <= 90) return t2;
if (t2 > 90 && t2 <= 180) return 90 - t2;
}
} };
t.exports = class extends s {
get tag() {
return "alignment";
}
render(e2, t2) {
e2.addRollback(), e2.openNode("alignment");
let r2 = false;
function n2(t3, n3) {
n3 && (e2.addAttribute(t3, n3), r2 = true);
}
n2("horizontal", o.horizontal(t2.horizontal)), n2("vertical", o.vertical(t2.vertical)), n2("wrapText", !!o.wrapText(t2.wrapText) && "1"), n2("shrinkToFit", !!o.shrinkToFit(t2.shrinkToFit) && "1"), n2("indent", o.indent(t2.indent)), n2("textRotation", a.toXml(t2.textRotation)), n2("readingOrder", o.readingOrder(t2.readingOrder)), e2.closeNode(), r2 ? e2.commit() : e2.rollback();
}
parseOpen(e2) {
const t2 = {};
let r2 = false;
function n2(e3, n3, i2) {
e3 && (t2[n3] = i2, r2 = true);
}
n2(e2.attributes.horizontal, "horizontal", e2.attributes.horizontal), n2(e2.attributes.vertical, "vertical", "center" === e2.attributes.vertical ? "middle" : e2.attributes.vertical), n2(e2.attributes.wrapText, "wrapText", i.parseBoolean(e2.attributes.wrapText)), n2(e2.attributes.shrinkToFit, "shrinkToFit", i.parseBoolean(e2.attributes.shrinkToFit)), n2(e2.attributes.indent, "indent", parseInt(e2.attributes.indent, 10)), n2(e2.attributes.textRotation, "textRotation", a.toModel(e2.attributes.textRotation)), n2(e2.attributes.readingOrder, "readingOrder", "2" === e2.attributes.readingOrder ? "rtl" : "ltr"), this.model = r2 ? t2 : null;
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../../../doc/enums": 7, "../../../utils/utils": 27, "../base-xform": 32 }], 127: [function(e, t, r) {
const n = e("../base-xform"), i = e("../../../utils/utils"), s = e("./color-xform");
class o extends n {
constructor(e2) {
super(), this.name = e2, this.map = { color: new s() };
}
get tag() {
return this.name;
}
render(e2, t2, r2) {
const n2 = t2 && t2.color || r2 || this.defaultColor;
e2.openNode(this.name), t2 && t2.style && (e2.addAttribute("style", t2.style), n2 && this.map.color.render(e2, n2)), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.name: {
const { style: t2 } = e2.attributes;
return this.model = t2 ? { style: t2 } : void 0, true;
}
case "color":
return this.parser = this.map.color, this.parser.parseOpen(e2), true;
default:
return false;
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
return this.parser ? (this.parser.parseClose(e2) || (this.parser = void 0), true) : (e2 === this.name && this.map.color.model && (this.model || (this.model = {}), this.model.color = this.map.color.model), false);
}
validStyle(e2) {
return o.validStyleValues[e2];
}
}
o.validStyleValues = ["thin", "dashed", "dotted", "dashDot", "hair", "dashDotDot", "slantDashDot", "mediumDashed", "mediumDashDotDot", "mediumDashDot", "medium", "double", "thick"].reduce((e2, t2) => (e2[t2] = true, e2), {});
t.exports = class extends n {
constructor() {
super(), this.map = { top: new o("top"), left: new o("left"), bottom: new o("bottom"), right: new o("right"), diagonal: new o("diagonal") };
}
render(e2, t2) {
const { color: r2 } = t2;
function n2(n3, i2) {
n3 && !n3.color && t2.color && (n3 = { ...n3, color: t2.color }), i2.render(e2, n3, r2);
}
e2.openNode("border"), t2.diagonal && t2.diagonal.style && (t2.diagonal.up && e2.addAttribute("diagonalUp", "1"), t2.diagonal.down && e2.addAttribute("diagonalDown", "1")), n2(t2.left, this.map.left), n2(t2.right, this.map.right), n2(t2.top, this.map.top), n2(t2.bottom, this.map.bottom), n2(t2.diagonal, this.map.diagonal), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "border":
return this.reset(), this.diagonalUp = i.parseBoolean(e2.attributes.diagonalUp), this.diagonalDown = i.parseBoolean(e2.attributes.diagonalDown), true;
default:
return this.parser = this.map[e2.name], !!this.parser && (this.parser.parseOpen(e2), true);
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
if ("border" === e2) {
const e3 = this.model = {}, t2 = function(t3, r2, n2) {
r2 && (n2 && Object.assign(r2, n2), e3[t3] = r2);
};
t2("left", this.map.left.model), t2("right", this.map.right.model), t2("top", this.map.top.model), t2("bottom", this.map.bottom.model), t2("diagonal", this.map.diagonal.model, { up: this.diagonalUp, down: this.diagonalDown });
}
return false;
}
};
}, { "../../../utils/utils": 27, "../base-xform": 32, "./color-xform": 128 }], 128: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
constructor(e2) {
super(), this.name = e2 || "color";
}
get tag() {
return this.name;
}
render(e2, t2) {
return !!t2 && (e2.openNode(this.name), t2.argb ? e2.addAttribute("rgb", t2.argb) : void 0 !== t2.theme ? (e2.addAttribute("theme", t2.theme), void 0 !== t2.tint && e2.addAttribute("tint", t2.tint)) : void 0 !== t2.indexed ? e2.addAttribute("indexed", t2.indexed) : e2.addAttribute("auto", "1"), e2.closeNode(), true);
}
parseOpen(e2) {
return e2.name === this.name && (e2.attributes.rgb ? this.model = { argb: e2.attributes.rgb } : e2.attributes.theme ? (this.model = { theme: parseInt(e2.attributes.theme, 10) }, e2.attributes.tint && (this.model.tint = parseFloat(e2.attributes.tint))) : e2.attributes.indexed ? this.model = { indexed: parseInt(e2.attributes.indexed, 10) } : this.model = void 0, true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 129: [function(e, t, r) {
const n = e("../base-xform"), i = e("./alignment-xform"), s = e("./border-xform"), o = e("./fill-xform"), a = e("./font-xform"), l = e("./numfmt-xform"), c = e("./protection-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { alignment: new i(), border: new s(), fill: new o(), font: new a(), numFmt: new l(), protection: new c() };
}
get tag() {
return "dxf";
}
render(e2, t2) {
if (e2.openNode(this.tag), t2.font && this.map.font.render(e2, t2.font), t2.numFmt && t2.numFmtId) {
const r2 = { id: t2.numFmtId, formatCode: t2.numFmt };
this.map.numFmt.render(e2, r2);
}
t2.fill && this.map.fill.render(e2, t2.fill), t2.alignment && this.map.alignment.render(e2, t2.alignment), t2.border && this.map.border.render(e2, t2.border), t2.protection && this.map.protection.render(e2, t2.protection), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.tag:
return this.reset(), true;
default:
return this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2), true;
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
return this.parser ? (this.parser.parseClose(e2) || (this.parser = void 0), true) : e2 !== this.tag || (this.model = { alignment: this.map.alignment.model, border: this.map.border.model, fill: this.map.fill.model, font: this.map.font.model, numFmt: this.map.numFmt.model, protection: this.map.protection.model }, false);
}
};
}, { "../base-xform": 32, "./alignment-xform": 126, "./border-xform": 127, "./fill-xform": 130, "./font-xform": 131, "./numfmt-xform": 132, "./protection-xform": 133 }], 130: [function(e, t, r) {
const n = e("../base-xform"), i = e("./color-xform");
class s extends n {
constructor() {
super(), this.map = { color: new i() };
}
get tag() {
return "stop";
}
render(e2, t2) {
e2.openNode("stop"), e2.addAttribute("position", t2.position), this.map.color.render(e2, t2.color), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "stop":
return this.model = { position: parseFloat(e2.attributes.position) }, true;
case "color":
return this.parser = this.map.color, this.parser.parseOpen(e2), true;
default:
return false;
}
}
parseText() {
}
parseClose(e2) {
return !!this.parser && (this.parser.parseClose(e2) || (this.model.color = this.parser.model, this.parser = void 0), true);
}
}
class o extends n {
constructor() {
super(), this.map = { fgColor: new i("fgColor"), bgColor: new i("bgColor") };
}
get name() {
return "pattern";
}
get tag() {
return "patternFill";
}
render(e2, t2) {
e2.openNode("patternFill"), e2.addAttribute("patternType", t2.pattern), t2.fgColor && this.map.fgColor.render(e2, t2.fgColor), t2.bgColor && this.map.bgColor.render(e2, t2.bgColor), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "patternFill":
return this.model = { type: "pattern", pattern: e2.attributes.patternType }, true;
default:
return this.parser = this.map[e2.name], !!this.parser && (this.parser.parseOpen(e2), true);
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
return !!this.parser && (this.parser.parseClose(e2) || (this.parser.model && (this.model[e2] = this.parser.model), this.parser = void 0), true);
}
}
class a extends n {
constructor() {
super(), this.map = { stop: new s() };
}
get name() {
return "gradient";
}
get tag() {
return "gradientFill";
}
render(e2, t2) {
switch (e2.openNode("gradientFill"), t2.gradient) {
case "angle":
e2.addAttribute("degree", t2.degree);
break;
case "path":
e2.addAttribute("type", "path"), t2.center.left && (e2.addAttribute("left", t2.center.left), void 0 === t2.center.right && e2.addAttribute("right", t2.center.left)), t2.center.right && e2.addAttribute("right", t2.center.right), t2.center.top && (e2.addAttribute("top", t2.center.top), void 0 === t2.center.bottom && e2.addAttribute("bottom", t2.center.top)), t2.center.bottom && e2.addAttribute("bottom", t2.center.bottom);
}
const r2 = this.map.stop;
t2.stops.forEach((t3) => {
r2.render(e2, t3);
}), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "gradientFill": {
const t2 = this.model = { stops: [] };
return e2.attributes.degree ? (t2.gradient = "angle", t2.degree = parseInt(e2.attributes.degree, 10)) : "path" === e2.attributes.type && (t2.gradient = "path", t2.center = { left: e2.attributes.left ? parseFloat(e2.attributes.left) : 0, top: e2.attributes.top ? parseFloat(e2.attributes.top) : 0 }, e2.attributes.right !== e2.attributes.left && (t2.center.right = e2.attributes.right ? parseFloat(e2.attributes.right) : 0), e2.attributes.bottom !== e2.attributes.top && (t2.center.bottom = e2.attributes.bottom ? parseFloat(e2.attributes.bottom) : 0)), true;
}
case "stop":
return this.parser = this.map.stop, this.parser.parseOpen(e2), true;
default:
return false;
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
return !!this.parser && (this.parser.parseClose(e2) || (this.model.stops.push(this.parser.model), this.parser = void 0), true);
}
}
class l extends n {
constructor() {
super(), this.map = { patternFill: new o(), gradientFill: new a() };
}
get tag() {
return "fill";
}
render(e2, t2) {
switch (e2.addRollback(), e2.openNode("fill"), t2.type) {
case "pattern":
this.map.patternFill.render(e2, t2);
break;
case "gradient":
this.map.gradientFill.render(e2, t2);
break;
default:
return void e2.rollback();
}
e2.closeNode(), e2.commit();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "fill":
return this.model = {}, true;
default:
return this.parser = this.map[e2.name], !!this.parser && (this.parser.parseOpen(e2), true);
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
return !!this.parser && (this.parser.parseClose(e2) || (this.model = this.parser.model, this.model.type = this.parser.name, this.parser = void 0), true);
}
validStyle(e2) {
return l.validPatternValues[e2];
}
}
l.validPatternValues = ["none", "solid", "darkVertical", "darkGray", "mediumGray", "lightGray", "gray125", "gray0625", "darkHorizontal", "darkVertical", "darkDown", "darkUp", "darkGrid", "darkTrellis", "lightHorizontal", "lightVertical", "lightDown", "lightUp", "lightGrid", "lightTrellis", "lightGrid"].reduce((e2, t2) => (e2[t2] = true, e2), {}), l.StopXform = s, l.PatternFillXform = o, l.GradientFillXform = a, t.exports = l;
}, { "../base-xform": 32, "./color-xform": 128 }], 131: [function(e, t, r) {
const n = e("./color-xform"), i = e("../simple/boolean-xform"), s = e("../simple/integer-xform"), o = e("../simple/string-xform"), a = e("./underline-xform"), l = e("../../../utils/under-dash"), c = e("../base-xform");
class u extends c {
constructor(e2) {
super(), this.options = e2 || u.OPTIONS, this.map = { b: { prop: "bold", xform: new i({ tag: "b", attr: "val" }) }, i: { prop: "italic", xform: new i({ tag: "i", attr: "val" }) }, u: { prop: "underline", xform: new a() }, charset: { prop: "charset", xform: new s({ tag: "charset", attr: "val" }) }, color: { prop: "color", xform: new n() }, condense: { prop: "condense", xform: new i({ tag: "condense", attr: "val" }) }, extend: { prop: "extend", xform: new i({ tag: "extend", attr: "val" }) }, family: { prop: "family", xform: new s({ tag: "family", attr: "val" }) }, outline: { prop: "outline", xform: new i({ tag: "outline", attr: "val" }) }, vertAlign: { prop: "vertAlign", xform: new o({ tag: "vertAlign", attr: "val" }) }, scheme: { prop: "scheme", xform: new o({ tag: "scheme", attr: "val" }) }, shadow: { prop: "shadow", xform: new i({ tag: "shadow", attr: "val" }) }, strike: { prop: "strike", xform: new i({ tag: "strike", attr: "val" }) }, sz: { prop: "size", xform: new s({ tag: "sz", attr: "val" }) } }, this.map[this.options.fontNameTag] = { prop: "name", xform: new o({ tag: this.options.fontNameTag, attr: "val" }) };
}
get tag() {
return this.options.tagName;
}
render(e2, t2) {
const { map: r2 } = this;
e2.openNode(this.options.tagName), l.each(this.map, (n2, i2) => {
r2[i2].xform.render(e2, t2[n2.prop]);
}), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
if (this.map[e2.name]) return this.parser = this.map[e2.name].xform, this.parser.parseOpen(e2);
switch (e2.name) {
case this.options.tagName:
return this.model = {}, true;
default:
return false;
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser && !this.parser.parseClose(e2)) {
const t2 = this.map[e2];
return this.parser.model && (this.model[t2.prop] = this.parser.model), this.parser = void 0, true;
}
switch (e2) {
case this.options.tagName:
return false;
default:
return true;
}
}
}
u.OPTIONS = { tagName: "font", fontNameTag: "name" }, t.exports = u;
}, { "../../../utils/under-dash": 26, "../base-xform": 32, "../simple/boolean-xform": 116, "../simple/integer-xform": 118, "../simple/string-xform": 119, "./color-xform": 128, "./underline-xform": 136 }], 132: [function(e, t, r) {
const n = e("../../../utils/under-dash"), i = e("../../defaultnumformats"), s = e("../base-xform");
const o = (function() {
const e2 = {};
return n.each(i, (t2, r2) => {
t2.f && (e2[t2.f] = parseInt(r2, 10));
}), e2;
})();
class a extends s {
constructor(e2, t2) {
super(), this.id = e2, this.formatCode = t2;
}
get tag() {
return "numFmt";
}
render(e2, t2) {
e2.leafNode("numFmt", { numFmtId: t2.id, formatCode: t2.formatCode });
}
parseOpen(e2) {
switch (e2.name) {
case "numFmt":
return this.model = { id: parseInt(e2.attributes.numFmtId, 10), formatCode: e2.attributes.formatCode.replace(/[\\](.)/g, "$1") }, true;
default:
return false;
}
}
parseText() {
}
parseClose() {
return false;
}
}
a.getDefaultFmtId = function(e2) {
return o[e2];
}, a.getDefaultFmtCode = function(e2) {
return i[e2] && i[e2].f;
}, t.exports = a;
}, { "../../../utils/under-dash": 26, "../../defaultnumformats": 30, "../base-xform": 32 }], 133: [function(e, t, r) {
const n = e("../base-xform"), i = { boolean: (e2, t2) => void 0 === e2 ? t2 : e2 };
t.exports = class extends n {
get tag() {
return "protection";
}
render(e2, t2) {
e2.addRollback(), e2.openNode("protection");
let r2 = false;
function n2(t3, n3) {
void 0 !== n3 && (e2.addAttribute(t3, n3), r2 = true);
}
n2("locked", i.boolean(t2.locked, true) ? void 0 : "0"), n2("hidden", i.boolean(t2.hidden, false) ? "1" : void 0), e2.closeNode(), r2 ? e2.commit() : e2.rollback();
}
parseOpen(e2) {
const t2 = { locked: !("0" === e2.attributes.locked), hidden: "1" === e2.attributes.hidden }, r2 = !t2.locked || t2.hidden;
this.model = r2 ? t2 : null;
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 134: [function(e, t, r) {
const n = e("../base-xform"), i = e("./alignment-xform"), s = e("./protection-xform");
t.exports = class extends n {
constructor(e2) {
super(), this.xfId = !(!e2 || !e2.xfId), this.map = { alignment: new i(), protection: new s() };
}
get tag() {
return "xf";
}
render(e2, t2) {
e2.openNode("xf", { numFmtId: t2.numFmtId || 0, fontId: t2.fontId || 0, fillId: t2.fillId || 0, borderId: t2.borderId || 0 }), this.xfId && e2.addAttribute("xfId", t2.xfId || 0), t2.numFmtId && e2.addAttribute("applyNumberFormat", "1"), t2.fontId && e2.addAttribute("applyFont", "1"), t2.fillId && e2.addAttribute("applyFill", "1"), t2.borderId && e2.addAttribute("applyBorder", "1"), t2.alignment && e2.addAttribute("applyAlignment", "1"), t2.protection && e2.addAttribute("applyProtection", "1"), t2.alignment && this.map.alignment.render(e2, t2.alignment), t2.protection && this.map.protection.render(e2, t2.protection), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "xf":
return this.model = { numFmtId: parseInt(e2.attributes.numFmtId, 10), fontId: parseInt(e2.attributes.fontId, 10), fillId: parseInt(e2.attributes.fillId, 10), borderId: parseInt(e2.attributes.borderId, 10) }, this.xfId && (this.model.xfId = parseInt(e2.attributes.xfId, 10)), true;
case "alignment":
return this.parser = this.map.alignment, this.parser.parseOpen(e2), true;
case "protection":
return this.parser = this.map.protection, this.parser.parseOpen(e2), true;
default:
return false;
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
return this.parser ? (this.parser.parseClose(e2) || (this.map.protection === this.parser ? this.model.protection = this.parser.model : this.model.alignment = this.parser.model, this.parser = void 0), true) : "xf" !== e2;
}
};
}, { "../base-xform": 32, "./alignment-xform": 126, "./protection-xform": 133 }], 135: [function(e, t, r) {
const n = e("../../../doc/enums"), i = e("../../../utils/xml-stream"), s = e("../base-xform"), o = e("../static-xform"), a = e("../list-xform"), l = e("./font-xform"), c = e("./fill-xform"), u = e("./border-xform"), h = e("./numfmt-xform"), f = e("./style-xform"), d = e("./dxf-xform");
class p extends s {
constructor(e2) {
super(), this.map = { numFmts: new a({ tag: "numFmts", count: true, childXform: new h() }), fonts: new a({ tag: "fonts", count: true, childXform: new l(), $: { "x14ac:knownFonts": 1 } }), fills: new a({ tag: "fills", count: true, childXform: new c() }), borders: new a({ tag: "borders", count: true, childXform: new u() }), cellStyleXfs: new a({ tag: "cellStyleXfs", count: true, childXform: new f() }), cellXfs: new a({ tag: "cellXfs", count: true, childXform: new f({ xfId: true }) }), dxfs: new a({ tag: "dxfs", always: true, count: true, childXform: new d() }), numFmt: new h(), font: new l(), fill: new c(), border: new u(), style: new f({ xfId: true }), cellStyles: p.STATIC_XFORMS.cellStyles, tableStyles: p.STATIC_XFORMS.tableStyles, extLst: p.STATIC_XFORMS.extLst }, e2 && this.init();
}
initIndex() {
this.index = { style: {}, numFmt: {}, numFmtNextId: 164, font: {}, border: {}, fill: {} };
}
init() {
this.model = { styles: [], numFmts: [], fonts: [], borders: [], fills: [], dxfs: [] }, this.initIndex(), this._addBorder({}), this._addStyle({ numFmtId: 0, fontId: 0, fillId: 0, borderId: 0, xfId: 0 }), this._addFill({ type: "pattern", pattern: "none" }), this._addFill({ type: "pattern", pattern: "gray125" }), this.weakMap = /* @__PURE__ */ new WeakMap();
}
render(e2, t2) {
t2 = t2 || this.model, e2.openXml(i.StdDocAttributes), e2.openNode("styleSheet", p.STYLESHEET_ATTRIBUTES), this.index ? (t2.numFmts && t2.numFmts.length && (e2.openNode("numFmts", { count: t2.numFmts.length }), t2.numFmts.forEach((t3) => {
e2.writeXml(t3);
}), e2.closeNode()), t2.fonts.length || this._addFont({ size: 11, color: { theme: 1 }, name: "Calibri", family: 2, scheme: "minor" }), e2.openNode("fonts", { count: t2.fonts.length, "x14ac:knownFonts": 1 }), t2.fonts.forEach((t3) => {
e2.writeXml(t3);
}), e2.closeNode(), e2.openNode("fills", { count: t2.fills.length }), t2.fills.forEach((t3) => {
e2.writeXml(t3);
}), e2.closeNode(), e2.openNode("borders", { count: t2.borders.length }), t2.borders.forEach((t3) => {
e2.writeXml(t3);
}), e2.closeNode(), this.map.cellStyleXfs.render(e2, [{ numFmtId: 0, fontId: 0, fillId: 0, borderId: 0, xfId: 0 }]), e2.openNode("cellXfs", { count: t2.styles.length }), t2.styles.forEach((t3) => {
e2.writeXml(t3);
}), e2.closeNode()) : (this.map.numFmts.render(e2, t2.numFmts), this.map.fonts.render(e2, t2.fonts), this.map.fills.render(e2, t2.fills), this.map.borders.render(e2, t2.borders), this.map.cellStyleXfs.render(e2, [{ numFmtId: 0, fontId: 0, fillId: 0, borderId: 0, xfId: 0 }]), this.map.cellXfs.render(e2, t2.styles)), p.STATIC_XFORMS.cellStyles.render(e2), this.map.dxfs.render(e2, t2.dxfs), p.STATIC_XFORMS.tableStyles.render(e2), p.STATIC_XFORMS.extLst.render(e2), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case "styleSheet":
return this.initIndex(), true;
default:
return this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2), true;
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case "styleSheet": {
this.model = {};
const e3 = (e4, t2) => {
t2.model && t2.model.length && (this.model[e4] = t2.model);
};
if (e3("numFmts", this.map.numFmts), e3("fonts", this.map.fonts), e3("fills", this.map.fills), e3("borders", this.map.borders), e3("styles", this.map.cellXfs), e3("dxfs", this.map.dxfs), this.index = { model: [], numFmt: [] }, this.model.numFmts) {
const e4 = this.index.numFmt;
this.model.numFmts.forEach((t2) => {
e4[t2.id] = t2.formatCode;
});
}
return false;
}
default:
return true;
}
}
addStyleModel(e2, t2) {
if (!e2) return 0;
if (this.model.fonts.length || this._addFont({ size: 11, color: { theme: 1 }, name: "Calibri", family: 2, scheme: "minor" }), this.weakMap && this.weakMap.has(e2)) return this.weakMap.get(e2);
const r2 = {};
if (t2 = t2 || n.ValueType.Number, e2.numFmt) r2.numFmtId = this._addNumFmtStr(e2.numFmt);
else switch (t2) {
case n.ValueType.Number:
r2.numFmtId = this._addNumFmtStr("General");
break;
case n.ValueType.Date:
r2.numFmtId = this._addNumFmtStr("mm-dd-yy");
}
e2.font && (r2.fontId = this._addFont(e2.font)), e2.border && (r2.borderId = this._addBorder(e2.border)), e2.fill && (r2.fillId = this._addFill(e2.fill)), e2.alignment && (r2.alignment = e2.alignment), e2.protection && (r2.protection = e2.protection);
const i2 = this._addStyle(r2);
return this.weakMap && this.weakMap.set(e2, i2), i2;
}
getStyleModel(e2) {
const t2 = this.model.styles[e2];
if (!t2) return null;
let r2 = this.index.model[e2];
if (r2) return r2;
if (r2 = this.index.model[e2] = {}, t2.numFmtId) {
const e3 = this.index.numFmt[t2.numFmtId] || h.getDefaultFmtCode(t2.numFmtId);
e3 && (r2.numFmt = e3);
}
function n2(e3, t3, n3) {
if (n3 || 0 === n3) {
const i2 = t3[n3];
i2 && (r2[e3] = i2);
}
}
return n2("font", this.model.fonts, t2.fontId), n2("border", this.model.borders, t2.borderId), n2("fill", this.model.fills, t2.fillId), t2.alignment && (r2.alignment = t2.alignment), t2.protection && (r2.protection = t2.protection), r2;
}
addDxfStyle(e2) {
return e2.numFmt && (e2.numFmtId = this._addNumFmtStr(e2.numFmt)), this.model.dxfs.push(e2), this.model.dxfs.length - 1;
}
getDxfStyle(e2) {
return this.model.dxfs[e2];
}
_addStyle(e2) {
const t2 = this.map.style.toXml(e2);
let r2 = this.index.style[t2];
return void 0 === r2 && (r2 = this.index.style[t2] = this.model.styles.length, this.model.styles.push(t2)), r2;
}
_addNumFmtStr(e2) {
let t2 = h.getDefaultFmtId(e2);
if (void 0 !== t2) return t2;
if (t2 = this.index.numFmt[e2], void 0 !== t2) return t2;
t2 = this.index.numFmt[e2] = 164 + this.model.numFmts.length;
const r2 = this.map.numFmt.toXml({ id: t2, formatCode: e2 });
return this.model.numFmts.push(r2), t2;
}
_addFont(e2) {
const t2 = this.map.font.toXml(e2);
let r2 = this.index.font[t2];
return void 0 === r2 && (r2 = this.index.font[t2] = this.model.fonts.length, this.model.fonts.push(t2)), r2;
}
_addBorder(e2) {
const t2 = this.map.border.toXml(e2);
let r2 = this.index.border[t2];
return void 0 === r2 && (r2 = this.index.border[t2] = this.model.borders.length, this.model.borders.push(t2)), r2;
}
_addFill(e2) {
const t2 = this.map.fill.toXml(e2);
let r2 = this.index.fill[t2];
return void 0 === r2 && (r2 = this.index.fill[t2] = this.model.fills.length, this.model.fills.push(t2)), r2;
}
}
p.STYLESHEET_ATTRIBUTES = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", "mc:Ignorable": "x14ac x16r2", "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac", "xmlns:x16r2": "http://schemas.microsoft.com/office/spreadsheetml/2015/02/main" }, p.STATIC_XFORMS = { cellStyles: new o({ tag: "cellStyles", $: { count: 1 }, c: [{ tag: "cellStyle", $: { name: "Normal", xfId: 0, builtinId: 0 } }] }), dxfs: new o({ tag: "dxfs", $: { count: 0 } }), tableStyles: new o({ tag: "tableStyles", $: { count: 0, defaultTableStyle: "TableStyleMedium2", defaultPivotStyle: "PivotStyleLight16" } }), extLst: new o({ tag: "extLst", c: [{ tag: "ext", $: { uri: "{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}", "xmlns:x14": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" }, c: [{ tag: "x14:slicerStyles", $: { defaultSlicerStyle: "SlicerStyleLight1" } }] }, { tag: "ext", $: { uri: "{9260A510-F301-46a8-8635-F512D64BE5F5}", "xmlns:x15": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main" }, c: [{ tag: "x15:timelineStyles", $: { defaultTimelineStyle: "TimeSlicerStyleLight1" } }] }] }) };
p.Mock = class extends p {
constructor() {
super(), this.model = { styles: [{ numFmtId: 0, fontId: 0, fillId: 0, borderId: 0, xfId: 0 }], numFmts: [], fonts: [{ size: 11, color: { theme: 1 }, name: "Calibri", family: 2, scheme: "minor" }], borders: [{}], fills: [{ type: "pattern", pattern: "none" }, { type: "pattern", pattern: "gray125" }] };
}
parseStream(e2) {
return e2.autodrain(), Promise.resolve();
}
addStyleModel(e2, t2) {
switch (t2) {
case n.ValueType.Date:
return this.dateStyleId;
default:
return 0;
}
}
get dateStyleId() {
if (!this._dateStyleId) {
const e2 = { numFmtId: h.getDefaultFmtId("mm-dd-yy") };
this._dateStyleId = this.model.styles.length, this.model.styles.push(e2);
}
return this._dateStyleId;
}
getStyleModel() {
return {};
}
}, t.exports = p;
}, { "../../../doc/enums": 7, "../../../utils/xml-stream": 28, "../base-xform": 32, "../list-xform": 71, "../static-xform": 120, "./border-xform": 127, "./dxf-xform": 129, "./fill-xform": 130, "./font-xform": 131, "./numfmt-xform": 132, "./style-xform": 134 }], 136: [function(e, t, r) {
const n = e("../base-xform");
class i extends n {
constructor(e2) {
super(), this.model = e2;
}
get tag() {
return "u";
}
render(e2, t2) {
if (true === (t2 = t2 || this.model)) e2.leafNode("u");
else {
const r2 = i.Attributes[t2];
r2 && e2.leafNode("u", r2);
}
}
parseOpen(e2) {
"u" === e2.name && (this.model = e2.attributes.val || true);
}
parseText() {
}
parseClose() {
return false;
}
}
i.Attributes = { single: {}, double: { val: "double" }, singleAccounting: { val: "singleAccounting" }, doubleAccounting: { val: "doubleAccounting" } }, t.exports = i;
}, { "../base-xform": 32 }], 137: [function(e, t, r) {
const n = e("../base-xform"), i = e("./filter-column-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { filterColumn: new i() };
}
get tag() {
return "autoFilter";
}
prepare(e2) {
e2.columns.forEach((e3, t2) => {
this.map.filterColumn.prepare(e3, { index: t2 });
});
}
render(e2, t2) {
return e2.openNode(this.tag, { ref: t2.autoFilterRef }), t2.columns.forEach((t3) => {
this.map.filterColumn.render(e2, t3);
}), e2.closeNode(), true;
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
switch (e2.name) {
case this.tag:
return this.model = { autoFilterRef: e2.attributes.ref, columns: [] }, true;
default:
if (this.parser = this.map[e2.name], this.parser) return this.parseOpen(e2), true;
throw new Error("Unexpected xml node in parseOpen: " + JSON.stringify(e2));
}
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.model.columns.push(this.parser.model), this.parser = void 0), true;
switch (e2) {
case this.tag:
return false;
default:
throw new Error("Unexpected xml node in parseClose: " + e2);
}
}
};
}, { "../base-xform": 32, "./filter-column-xform": 139 }], 138: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "customFilter";
}
render(e2, t2) {
e2.leafNode(this.tag, { val: t2.val, operator: t2.operator });
}
parseOpen(e2) {
return e2.name === this.tag && (this.model = { val: e2.attributes.val, operator: e2.attributes.operator }, true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 139: [function(e, t, r) {
const n = e("../base-xform"), i = e("../list-xform"), s = e("./custom-filter-xform"), o = e("./filter-xform");
t.exports = class extends n {
constructor() {
super(), this.map = { customFilters: new i({ tag: "customFilters", count: false, empty: true, childXform: new s() }), filters: new i({ tag: "filters", count: false, empty: true, childXform: new o() }) };
}
get tag() {
return "filterColumn";
}
prepare(e2, t2) {
e2.colId = t2.index.toString();
}
render(e2, t2) {
return t2.customFilters ? (e2.openNode(this.tag, { colId: t2.colId, hiddenButton: t2.filterButton ? "0" : "1" }), this.map.customFilters.render(e2, t2.customFilters), e2.closeNode(), true) : (e2.leafNode(this.tag, { colId: t2.colId, hiddenButton: t2.filterButton ? "0" : "1" }), true);
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
const { attributes: t2 } = e2;
switch (e2.name) {
case this.tag:
return this.model = { filterButton: "0" === t2.hiddenButton }, true;
default:
if (this.parser = this.map[e2.name], this.parser) return this.parseOpen(e2), true;
throw new Error("Unexpected xml node in parseOpen: " + JSON.stringify(e2));
}
}
parseText() {
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case this.tag:
return this.model.customFilters = this.map.customFilters.model, false;
default:
return true;
}
}
};
}, { "../base-xform": 32, "../list-xform": 71, "./custom-filter-xform": 138, "./filter-xform": 140 }], 140: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "filter";
}
render(e2, t2) {
e2.leafNode(this.tag, { val: t2.val });
}
parseOpen(e2) {
return e2.name === this.tag && (this.model = { val: e2.attributes.val }, true);
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 141: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "tableColumn";
}
prepare(e2, t2) {
e2.id = t2.index + 1;
}
render(e2, t2) {
return e2.leafNode(this.tag, { id: t2.id.toString(), name: t2.name, totalsRowLabel: t2.totalsRowLabel, totalsRowFunction: t2.totalsRowFunction, dxfId: t2.dxfId }), true;
}
parseOpen(e2) {
if (e2.name === this.tag) {
const { attributes: t2 } = e2;
return this.model = { name: t2.name, totalsRowLabel: t2.totalsRowLabel, totalsRowFunction: t2.totalsRowFunction, dxfId: t2.dxfId }, true;
}
return false;
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 142: [function(e, t, r) {
const n = e("../base-xform");
t.exports = class extends n {
get tag() {
return "tableStyleInfo";
}
render(e2, t2) {
return e2.leafNode(this.tag, { name: t2.theme ? t2.theme : void 0, showFirstColumn: t2.showFirstColumn ? "1" : "0", showLastColumn: t2.showLastColumn ? "1" : "0", showRowStripes: t2.showRowStripes ? "1" : "0", showColumnStripes: t2.showColumnStripes ? "1" : "0" }), true;
}
parseOpen(e2) {
if (e2.name === this.tag) {
const { attributes: t2 } = e2;
return this.model = { theme: t2.name ? t2.name : null, showFirstColumn: "1" === t2.showFirstColumn, showLastColumn: "1" === t2.showLastColumn, showRowStripes: "1" === t2.showRowStripes, showColumnStripes: "1" === t2.showColumnStripes }, true;
}
return false;
}
parseText() {
}
parseClose() {
return false;
}
};
}, { "../base-xform": 32 }], 143: [function(e, t, r) {
const n = e("../../../utils/xml-stream"), i = e("../base-xform"), s = e("../list-xform"), o = e("./auto-filter-xform"), a = e("./table-column-xform"), l = e("./table-style-info-xform");
class c extends i {
constructor() {
super(), this.map = { autoFilter: new o(), tableColumns: new s({ tag: "tableColumns", count: true, empty: true, childXform: new a() }), tableStyleInfo: new l() };
}
prepare(e2, t2) {
this.map.autoFilter.prepare(e2), this.map.tableColumns.prepare(e2.columns, t2);
}
get tag() {
return "table";
}
render(e2, t2) {
e2.openXml(n.StdDocAttributes), e2.openNode(this.tag, { ...c.TABLE_ATTRIBUTES, id: t2.id, name: t2.name, displayName: t2.displayName || t2.name, ref: t2.tableRef, totalsRowCount: t2.totalsRow ? "1" : void 0, totalsRowShown: t2.totalsRow ? void 0 : "1", headerRowCount: t2.headerRow ? "1" : "0" }), this.map.autoFilter.render(e2, t2), this.map.tableColumns.render(e2, t2.columns), this.map.tableStyleInfo.render(e2, t2.style), e2.closeNode();
}
parseOpen(e2) {
if (this.parser) return this.parser.parseOpen(e2), true;
const { name: t2, attributes: r2 } = e2;
switch (t2) {
case this.tag:
this.reset(), this.model = { name: r2.name, displayName: r2.displayName || r2.name, tableRef: r2.ref, totalsRow: "1" === r2.totalsRowCount, headerRow: "1" === r2.headerRowCount };
break;
default:
this.parser = this.map[e2.name], this.parser && this.parser.parseOpen(e2);
}
return true;
}
parseText(e2) {
this.parser && this.parser.parseText(e2);
}
parseClose(e2) {
if (this.parser) return this.parser.parseClose(e2) || (this.parser = void 0), true;
switch (e2) {
case this.tag:
return this.model.columns = this.map.tableColumns.model, this.map.autoFilter.model && (this.model.autoFilterRef = this.map.autoFilter.model.autoFilterRef, this.map.autoFilter.model.columns.forEach((e3, t2) => {
this.model.columns[t2].filterButton = e3.filterButton;
})), this.model.style = this.map.tableStyleInfo.model, false;
default:
return true;
}
}
reconcile(e2, t2) {
e2.columns.forEach((e3) => {
void 0 !== e3.dxfId && (e3.style = t2.styles.getDxfStyle(e3.dxfId));
});
}
}
c.TABLE_ATTRIBUTES = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main", "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006", "mc:Ignorable": "xr xr3", "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision", "xmlns:xr3": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision3" }, t.exports = c;
}, { "../../../utils/xml-stream": 28, "../base-xform": 32, "../list-xform": 71, "./auto-filter-xform": 137, "./table-column-xform": 141, "./table-style-info-xform": 142 }], 144: [function(e, t, r) {
(function(r2, n) {
(function() {
const i = e("fs"), s = e("jszip"), { PassThrough: o } = e("readable-stream"), a = e("../utils/zip-stream"), l = e("../utils/stream-buf"), c = e("../utils/utils"), u = e("../utils/xml-stream"), { bufferToString: h } = e("../utils/browser-buffer-decode"), f = e("./xform/style/styles-xform"), d = e("./xform/core/core-xform"), p = e("./xform/strings/shared-strings-xform"), m = e("./xform/core/relationships-xform"), b = e("./xform/core/content-types-xform"), g = e("./xform/core/app-xform"), y = e("./xform/book/workbook-xform"), v = e("./xform/sheet/worksheet-xform"), w = e("./xform/drawing/drawing-xform"), _ = e("./xform/table/table-xform"), x = e("./xform/comment/comments-xform"), k = e("./xform/comment/vml-notes-xform"), S = e("./xml/theme1");
class M {
constructor(e2) {
this.workbook = e2;
}
async readFile(e2, t2) {
if (!await c.fs.exists(e2)) throw new Error("File not found: " + e2);
const r3 = i.createReadStream(e2);
try {
const e3 = await this.read(r3, t2);
return r3.close(), e3;
} catch (e3) {
throw r3.close(), e3;
}
}
parseRels(e2) {
return new m().parseStream(e2);
}
parseWorkbook(e2) {
return new y().parseStream(e2);
}
parseSharedStrings(e2) {
return new p().parseStream(e2);
}
reconcile(e2, t2) {
const r3 = new y(), n2 = new v(t2), i2 = new w(), s2 = new _();
r3.reconcile(e2);
const o2 = { media: e2.media, mediaIndex: e2.mediaIndex };
Object.keys(e2.drawings).forEach((t3) => {
const r4 = e2.drawings[t3], n3 = e2.drawingRels[t3];
n3 && (o2.rels = n3.reduce((e3, t4) => (e3[t4.Id] = t4, e3), {}), (r4.anchors || []).forEach((e3) => {
const t4 = e3.picture && e3.picture.hyperlinks;
t4 && o2.rels[t4.rId] && (t4.hyperlink = o2.rels[t4.rId].Target, delete t4.rId);
}), i2.reconcile(r4, o2));
});
const a2 = { styles: e2.styles };
Object.values(e2.tables).forEach((e3) => {
s2.reconcile(e3, a2);
});
const l2 = { styles: e2.styles, sharedStrings: e2.sharedStrings, media: e2.media, mediaIndex: e2.mediaIndex, date1904: e2.properties && e2.properties.date1904, drawings: e2.drawings, comments: e2.comments, tables: e2.tables, vmlDrawings: e2.vmlDrawings };
e2.worksheets.forEach((t3) => {
t3.relationships = e2.worksheetRels[t3.sheetNo], n2.reconcile(t3, l2);
}), delete e2.worksheetHash, delete e2.worksheetRels, delete e2.globalRels, delete e2.sharedStrings, delete e2.workbookRels, delete e2.sheetDefs, delete e2.styles, delete e2.mediaIndex, delete e2.drawings, delete e2.drawingRels, delete e2.vmlDrawings;
}
async _processWorksheetEntry(e2, t2, r3, n2, i2) {
const s2 = new v(n2), o2 = await s2.parseStream(e2);
o2.sheetNo = r3, t2.worksheetHash[i2] = o2, t2.worksheets.push(o2);
}
async _processCommentEntry(e2, t2, r3) {
const n2 = new x(), i2 = await n2.parseStream(e2);
t2.comments[`../${r3}.xml`] = i2;
}
async _processTableEntry(e2, t2, r3) {
const n2 = new _(), i2 = await n2.parseStream(e2);
t2.tables[`../tables/${r3}.xml`] = i2;
}
async _processWorksheetRelsEntry(e2, t2, r3) {
const n2 = new m(), i2 = await n2.parseStream(e2);
t2.worksheetRels[r3] = i2;
}
async _processMediaEntry(e2, t2, r3) {
const n2 = r3.lastIndexOf(".");
if (n2 >= 1) {
const i2 = r3.substr(n2 + 1), s2 = r3.substr(0, n2);
await new Promise((n3, o2) => {
const a2 = new l();
a2.on("finish", () => {
t2.mediaIndex[r3] = t2.media.length, t2.mediaIndex[s2] = t2.media.length;
const e3 = { type: "image", name: s2, extension: i2, buffer: a2.toBuffer() };
t2.media.push(e3), n3();
}), e2.on("error", (e3) => {
o2(e3);
}), e2.pipe(a2);
});
}
}
async _processDrawingEntry(e2, t2, r3) {
const n2 = new w(), i2 = await n2.parseStream(e2);
t2.drawings[r3] = i2;
}
async _processDrawingRelsEntry(e2, t2, r3) {
const n2 = new m(), i2 = await n2.parseStream(e2);
t2.drawingRels[r3] = i2;
}
async _processVmlDrawingEntry(e2, t2, r3) {
const n2 = new k(), i2 = await n2.parseStream(e2);
t2.vmlDrawings[`../drawings/${r3}.vml`] = i2;
}
async _processThemeEntry(e2, t2, r3) {
await new Promise((n2, i2) => {
const s2 = new l();
e2.on("error", i2), s2.on("error", i2), s2.on("finish", () => {
t2.themes[r3] = s2.read().toString(), n2();
}), e2.pipe(s2);
});
}
createInputStream() {
throw new Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md");
}
async read(e2, t2) {
!e2[Symbol.asyncIterator] && e2.pipe && (e2 = e2.pipe(new o()));
const r3 = [];
for await (const t3 of e2) r3.push(t3);
return this.load(n.concat(r3), t2);
}
async load(e2, t2) {
let i2;
i2 = t2 && t2.base64 ? n.from(e2.toString(), "base64") : e2;
const a2 = { worksheets: [], worksheetHash: {}, worksheetRels: [], themes: {}, media: [], mediaIndex: {}, drawings: {}, drawingRels: {}, comments: {}, tables: {}, vmlDrawings: {} }, l2 = await s.loadAsync(i2);
for (const e3 of Object.values(l2.files)) if (!e3.dir) {
let n2, i3 = e3.name;
if ("/" === i3[0] && (i3 = i3.substr(1)), i3.match(/xl\/media\//) || i3.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/)) n2 = new o(), n2.write(await e3.async("nodebuffer"));
else {
let t3;
n2 = new o({ writableObjectMode: true, readableObjectMode: true }), t3 = r2.browser ? h(await e3.async("nodebuffer")) : await e3.async("string");
const i4 = 16384;
for (let e4 = 0; e4 < t3.length; e4 += i4) n2.write(t3.substring(e4, e4 + i4));
}
switch (n2.end(), i3) {
case "_rels/.rels":
a2.globalRels = await this.parseRels(n2);
break;
case "xl/workbook.xml": {
const e4 = await this.parseWorkbook(n2);
a2.sheets = e4.sheets, a2.definedNames = e4.definedNames, a2.views = e4.views, a2.properties = e4.properties, a2.calcProperties = e4.calcProperties;
break;
}
case "xl/_rels/workbook.xml.rels":
a2.workbookRels = await this.parseRels(n2);
break;
case "xl/sharedStrings.xml":
a2.sharedStrings = new p(), await a2.sharedStrings.parseStream(n2);
break;
case "xl/styles.xml":
a2.styles = new f(), await a2.styles.parseStream(n2);
break;
case "docProps/app.xml": {
const e4 = new g(), t3 = await e4.parseStream(n2);
a2.company = t3.company, a2.manager = t3.manager;
break;
}
case "docProps/core.xml": {
const e4 = new d(), t3 = await e4.parseStream(n2);
Object.assign(a2, t3);
break;
}
default: {
let e4 = i3.match(/xl\/worksheets\/sheet(\d+)[.]xml/);
if (e4) {
await this._processWorksheetEntry(n2, a2, e4[1], t2, i3);
break;
}
if (e4 = i3.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml.rels/), e4) {
await this._processWorksheetRelsEntry(n2, a2, e4[1]);
break;
}
if (e4 = i3.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/), e4) {
await this._processThemeEntry(n2, a2, e4[1]);
break;
}
if (e4 = i3.match(/xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/), e4) {
await this._processMediaEntry(n2, a2, e4[1]);
break;
}
if (e4 = i3.match(/xl\/drawings\/([a-zA-Z0-9]+)[.]xml/), e4) {
await this._processDrawingEntry(n2, a2, e4[1]);
break;
}
if (e4 = i3.match(/xl\/(comments\d+)[.]xml/), e4) {
await this._processCommentEntry(n2, a2, e4[1]);
break;
}
if (e4 = i3.match(/xl\/tables\/(table\d+)[.]xml/), e4) {
await this._processTableEntry(n2, a2, e4[1]);
break;
}
if (e4 = i3.match(/xl\/drawings\/_rels\/([a-zA-Z0-9]+)[.]xml[.]rels/), e4) {
await this._processDrawingRelsEntry(n2, a2, e4[1]);
break;
}
if (e4 = i3.match(/xl\/drawings\/(vmlDrawing\d+)[.]vml/), e4) {
await this._processVmlDrawingEntry(n2, a2, e4[1]);
break;
}
}
}
}
return this.reconcile(a2, t2), this.workbook.model = a2, this.workbook;
}
async addMedia(e2, t2) {
await Promise.all(t2.media.map(async (t3) => {
if ("image" === t3.type) {
const r3 = `xl/media/${t3.name}.${t3.extension}`;
if (t3.filename) {
const n2 = await (function(e3, t4) {
return new Promise((r4, n3) => {
i.readFile(e3, t4, (e4, t5) => {
e4 ? n3(e4) : r4(t5);
});
});
})(t3.filename);
return e2.append(n2, { name: r3 });
}
if (t3.buffer) return e2.append(t3.buffer, { name: r3 });
if (t3.base64) {
const n2 = t3.base64, i2 = n2.substring(n2.indexOf(",") + 1);
return e2.append(i2, { name: r3, base64: true });
}
}
throw new Error("Unsupported media");
}));
}
addDrawings(e2, t2) {
const r3 = new w(), n2 = new m();
t2.worksheets.forEach((t3) => {
const { drawing: i2 } = t3;
if (i2) {
r3.prepare(i2, {});
let t4 = r3.toXml(i2);
e2.append(t4, { name: `xl/drawings/${i2.name}.xml` }), t4 = n2.toXml(i2.rels), e2.append(t4, { name: `xl/drawings/_rels/${i2.name}.xml.rels` });
}
});
}
addTables(e2, t2) {
const r3 = new _();
t2.worksheets.forEach((t3) => {
const { tables: n2 } = t3;
n2.forEach((t4) => {
r3.prepare(t4, {});
const n3 = r3.toXml(t4);
e2.append(n3, { name: "xl/tables/" + t4.target });
});
});
}
async addContentTypes(e2, t2) {
const r3 = new b().toXml(t2);
e2.append(r3, { name: "[Content_Types].xml" });
}
async addApp(e2, t2) {
const r3 = new g().toXml(t2);
e2.append(r3, { name: "docProps/app.xml" });
}
async addCore(e2, t2) {
const r3 = new d();
e2.append(r3.toXml(t2), { name: "docProps/core.xml" });
}
async addThemes(e2, t2) {
const r3 = t2.themes || { theme1: S };
Object.keys(r3).forEach((t3) => {
const n2 = r3[t3], i2 = `xl/theme/${t3}.xml`;
e2.append(n2, { name: i2 });
});
}
async addOfficeRels(e2) {
const t2 = new m().toXml([{ Id: "rId1", Type: M.RelType.OfficeDocument, Target: "xl/workbook.xml" }, { Id: "rId2", Type: M.RelType.CoreProperties, Target: "docProps/core.xml" }, { Id: "rId3", Type: M.RelType.ExtenderProperties, Target: "docProps/app.xml" }]);
e2.append(t2, { name: "_rels/.rels" });
}
async addWorkbookRels(e2, t2) {
let r3 = 1;
const n2 = [{ Id: "rId" + r3++, Type: M.RelType.Styles, Target: "styles.xml" }, { Id: "rId" + r3++, Type: M.RelType.Theme, Target: "theme/theme1.xml" }];
t2.sharedStrings.count && n2.push({ Id: "rId" + r3++, Type: M.RelType.SharedStrings, Target: "sharedStrings.xml" }), t2.worksheets.forEach((e3) => {
e3.rId = "rId" + r3++, n2.push({ Id: e3.rId, Type: M.RelType.Worksheet, Target: `worksheets/sheet${e3.id}.xml` });
});
const i2 = new m().toXml(n2);
e2.append(i2, { name: "xl/_rels/workbook.xml.rels" });
}
async addSharedStrings(e2, t2) {
t2.sharedStrings && t2.sharedStrings.count && e2.append(t2.sharedStrings.xml, { name: "xl/sharedStrings.xml" });
}
async addStyles(e2, t2) {
const { xml: r3 } = t2.styles;
r3 && e2.append(r3, { name: "xl/styles.xml" });
}
async addWorkbook(e2, t2) {
const r3 = new y();
e2.append(r3.toXml(t2), { name: "xl/workbook.xml" });
}
async addWorksheets(e2, t2) {
const r3 = new v(), n2 = new m(), i2 = new x(), s2 = new k();
t2.worksheets.forEach((t3) => {
let o2 = new u();
r3.render(o2, t3), e2.append(o2.xml, { name: `xl/worksheets/sheet${t3.id}.xml` }), t3.rels && t3.rels.length && (o2 = new u(), n2.render(o2, t3.rels), e2.append(o2.xml, { name: `xl/worksheets/_rels/sheet${t3.id}.xml.rels` })), t3.comments.length > 0 && (o2 = new u(), i2.render(o2, t3), e2.append(o2.xml, { name: `xl/comments${t3.id}.xml` }), o2 = new u(), s2.render(o2, t3), e2.append(o2.xml, { name: `xl/drawings/vmlDrawing${t3.id}.vml` }));
});
}
_finalize(e2) {
return new Promise((t2, r3) => {
e2.on("finish", () => {
t2(this);
}), e2.on("error", r3), e2.finalize();
});
}
prepareModel(e2, t2) {
e2.creator = e2.creator || "ExcelJS", e2.lastModifiedBy = e2.lastModifiedBy || "ExcelJS", e2.created = e2.created || /* @__PURE__ */ new Date(), e2.modified = e2.modified || /* @__PURE__ */ new Date(), e2.useSharedStrings = void 0 === t2.useSharedStrings || t2.useSharedStrings, e2.useStyles = void 0 === t2.useStyles || t2.useStyles, e2.sharedStrings = new p(), e2.styles = e2.useStyles ? new f(true) : new f.Mock();
const r3 = new y(), n2 = new v();
r3.prepare(e2);
const i2 = { sharedStrings: e2.sharedStrings, styles: e2.styles, date1904: e2.properties.date1904, drawingsCount: 0, media: e2.media };
i2.drawings = e2.drawings = [], i2.commentRefs = e2.commentRefs = [];
let s2 = 0;
e2.tables = [], e2.worksheets.forEach((t3) => {
t3.tables.forEach((t4) => {
s2++, t4.target = `table${s2}.xml`, t4.id = s2, e2.tables.push(t4);
}), n2.prepare(t3, i2);
});
}
async write(e2, t2) {
t2 = t2 || {};
const { model: r3 } = this.workbook, n2 = new a.ZipWriter(t2.zip);
return n2.pipe(e2), this.prepareModel(r3, t2), await this.addContentTypes(n2, r3), await this.addOfficeRels(n2, r3), await this.addWorkbookRels(n2, r3), await this.addWorksheets(n2, r3), await this.addSharedStrings(n2, r3), await this.addDrawings(n2, r3), await this.addTables(n2, r3), await Promise.all([this.addThemes(n2, r3), this.addStyles(n2, r3)]), await this.addMedia(n2, r3), await Promise.all([this.addApp(n2, r3), this.addCore(n2, r3)]), await this.addWorkbook(n2, r3), this._finalize(n2);
}
writeFile(e2, t2) {
const r3 = i.createWriteStream(e2);
return new Promise((e3, n2) => {
r3.on("finish", () => {
e3();
}), r3.on("error", (e4) => {
n2(e4);
}), this.write(r3, t2).then(() => {
r3.end();
}).catch((e4) => {
n2(e4);
});
});
}
async writeBuffer(e2) {
const t2 = new l();
return await this.write(t2, e2), t2.read();
}
}
M.RelType = e("./rel-type"), t.exports = M;
}).call(this);
}).call(this, e("_process"), e("buffer").Buffer);
}, { "../utils/browser-buffer-decode": 16, "../utils/stream-buf": 24, "../utils/utils": 27, "../utils/xml-stream": 28, "../utils/zip-stream": 29, "./rel-type": 31, "./xform/book/workbook-xform": 38, "./xform/comment/comments-xform": 40, "./xform/comment/vml-notes-xform": 45, "./xform/core/app-xform": 51, "./xform/core/content-types-xform": 52, "./xform/core/core-xform": 53, "./xform/core/relationships-xform": 55, "./xform/drawing/drawing-xform": 62, "./xform/sheet/worksheet-xform": 115, "./xform/strings/shared-strings-xform": 124, "./xform/style/styles-xform": 135, "./xform/table/table-xform": 143, "./xml/theme1": 145, _process: 467, buffer: 220, fs: 216, jszip: 441, "readable-stream": 491 }], 145: [function(e, t, r) {
t.exports = '\n ';
}, {}], 146: [function(e, t, r) {
(function(t2) {
(function() {
Object.defineProperty(r, "__esModule", { value: true }), r.CsvFormatterStream = void 0;
const n = e("stream"), i = e("./formatter");
class s extends n.Transform {
constructor(e2) {
super({ writableObjectMode: e2.objectMode }), this.hasWrittenBOM = false, this.formatterOptions = e2, this.rowFormatter = new i.RowFormatter(e2), this.hasWrittenBOM = !e2.writeBOM;
}
transform(e2) {
return this.rowFormatter.rowTransform = e2, this;
}
_transform(e2, r2, n2) {
let i2 = false;
try {
this.hasWrittenBOM || (this.push(this.formatterOptions.BOM), this.hasWrittenBOM = true), this.rowFormatter.format(e2, (e3, r3) => e3 ? (i2 = true, n2(e3)) : (r3 && r3.forEach((e4) => {
this.push(t2.from(e4, "utf8"));
}), i2 = true, n2()));
} catch (e3) {
if (i2) throw e3;
n2(e3);
}
}
_flush(e2) {
this.rowFormatter.finish((r2, n2) => r2 ? e2(r2) : (n2 && n2.forEach((e3) => {
this.push(t2.from(e3, "utf8"));
}), e2()));
}
}
r.CsvFormatterStream = s;
}).call(this);
}).call(this, e("buffer").Buffer);
}, { "./formatter": 150, buffer: 220, stream: 505 }], 147: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.FormatterOptions = void 0;
r.FormatterOptions = class {
constructor() {
let e2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
var t2;
this.objectMode = true, this.delimiter = ",", this.rowDelimiter = "\n", this.quote = '"', this.escape = this.quote, this.quoteColumns = false, this.quoteHeaders = this.quoteColumns, this.headers = null, this.includeEndRowDelimiter = false, this.writeBOM = false, this.BOM = "\uFEFF", this.alwaysWriteHeaders = false, Object.assign(this, e2 || {}), void 0 === (null == e2 ? void 0 : e2.quoteHeaders) && (this.quoteHeaders = this.quoteColumns), true === (null == e2 ? void 0 : e2.quote) ? this.quote = '"' : false === (null == e2 ? void 0 : e2.quote) && (this.quote = ""), "string" != typeof (null == e2 ? void 0 : e2.escape) && (this.escape = this.quote), this.shouldWriteHeaders = !!this.headers && (null === (t2 = e2.writeHeaders) || void 0 === t2 || t2), this.headers = Array.isArray(this.headers) ? this.headers : null, this.escapedQuote = `${this.escape}${this.quote}`;
}
};
}, {}], 148: [function(e, t, r) {
var n = function(e2) {
return e2 && e2.__esModule ? e2 : { default: e2 };
};
Object.defineProperty(r, "__esModule", { value: true }), r.FieldFormatter = void 0;
const i = n(e("lodash.isboolean")), s = n(e("lodash.isnil")), o = n(e("lodash.escaperegexp"));
r.FieldFormatter = class {
constructor(e2) {
this._headers = null, this.formatterOptions = e2, null !== e2.headers && (this.headers = e2.headers), this.REPLACE_REGEXP = new RegExp(e2.quote, "g");
const t2 = `[${e2.delimiter}${o.default(e2.rowDelimiter)}|\r|
]`;
this.ESCAPE_REGEXP = new RegExp(t2);
}
set headers(e2) {
this._headers = e2;
}
shouldQuote(e2, t2) {
const r2 = t2 ? this.formatterOptions.quoteHeaders : this.formatterOptions.quoteColumns;
return i.default(r2) ? r2 : Array.isArray(r2) ? r2[e2] : null !== this._headers && r2[this._headers[e2]];
}
format(e2, t2, r2) {
const n2 = ("" + (s.default(e2) ? "" : e2)).replace(/\0/g, ""), { formatterOptions: i2 } = this;
if ("" !== i2.quote) {
if (-1 !== n2.indexOf(i2.quote)) return this.quoteField(n2.replace(this.REPLACE_REGEXP, i2.escapedQuote));
}
return -1 !== n2.search(this.ESCAPE_REGEXP) || this.shouldQuote(t2, r2) ? this.quoteField(n2) : n2;
}
quoteField(e2) {
const { quote: t2 } = this.formatterOptions;
return `${t2}${e2}${t2}`;
}
};
}, { "lodash.escaperegexp": 442, "lodash.isboolean": 444, "lodash.isnil": 447 }], 149: [function(e, t, r) {
var n = function(e2) {
return e2 && e2.__esModule ? e2 : { default: e2 };
};
Object.defineProperty(r, "__esModule", { value: true }), r.RowFormatter = void 0;
const i = n(e("lodash.isfunction")), s = n(e("lodash.isequal")), o = e("./FieldFormatter"), a = e("../types");
class l {
constructor(e2) {
this.rowCount = 0, this.formatterOptions = e2, this.fieldFormatter = new o.FieldFormatter(e2), this.headers = e2.headers, this.shouldWriteHeaders = e2.shouldWriteHeaders, this.hasWrittenHeaders = false, null !== this.headers && (this.fieldFormatter.headers = this.headers), e2.transform && (this.rowTransform = e2.transform);
}
static isRowHashArray(e2) {
return !!Array.isArray(e2) && (Array.isArray(e2[0]) && 2 === e2[0].length);
}
static isRowArray(e2) {
return Array.isArray(e2) && !this.isRowHashArray(e2);
}
static gatherHeaders(e2) {
return l.isRowHashArray(e2) ? e2.map((e3) => e3[0]) : Array.isArray(e2) ? e2 : Object.keys(e2);
}
static createTransform(e2) {
return a.isSyncTransform(e2) ? (t2, r2) => {
let n2 = null;
try {
n2 = e2(t2);
} catch (e3) {
return r2(e3);
}
return r2(null, n2);
} : (t2, r2) => {
e2(t2, r2);
};
}
set rowTransform(e2) {
if (!i.default(e2)) throw new TypeError("The transform should be a function");
this._rowTransform = l.createTransform(e2);
}
format(e2, t2) {
this.callTransformer(e2, (r2, n2) => {
if (r2) return t2(r2);
if (!e2) return t2(null);
const i2 = [];
if (n2) {
const { shouldFormatColumns: e3, headers: t3 } = this.checkHeaders(n2);
if (this.shouldWriteHeaders && t3 && !this.hasWrittenHeaders && (i2.push(this.formatColumns(t3, true)), this.hasWrittenHeaders = true), e3) {
const e4 = this.gatherColumns(n2);
i2.push(this.formatColumns(e4, false));
}
}
return t2(null, i2);
});
}
finish(e2) {
const t2 = [];
if (this.formatterOptions.alwaysWriteHeaders && 0 === this.rowCount) {
if (!this.headers) return e2(new Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));
t2.push(this.formatColumns(this.headers, true));
}
return this.formatterOptions.includeEndRowDelimiter && t2.push(this.formatterOptions.rowDelimiter), e2(null, t2);
}
checkHeaders(e2) {
if (this.headers) return { shouldFormatColumns: true, headers: this.headers };
const t2 = l.gatherHeaders(e2);
return this.headers = t2, this.fieldFormatter.headers = t2, this.shouldWriteHeaders ? { shouldFormatColumns: !s.default(t2, e2), headers: t2 } : { shouldFormatColumns: true, headers: null };
}
gatherColumns(e2) {
if (null === this.headers) throw new Error("Headers is currently null");
return Array.isArray(e2) ? l.isRowHashArray(e2) ? this.headers.map((t2, r2) => {
const n2 = e2[r2];
return n2 ? n2[1] : "";
}) : l.isRowArray(e2) && !this.shouldWriteHeaders ? e2 : this.headers.map((t2, r2) => e2[r2]) : this.headers.map((t2) => e2[t2]);
}
callTransformer(e2, t2) {
return this._rowTransform ? this._rowTransform(e2, t2) : t2(null, e2);
}
formatColumns(e2, t2) {
const r2 = e2.map((e3, r3) => this.fieldFormatter.format(e3, r3, t2)).join(this.formatterOptions.delimiter), { rowCount: n2 } = this;
return this.rowCount += 1, n2 ? [this.formatterOptions.rowDelimiter, r2].join("") : r2;
}
}
r.RowFormatter = l;
}, { "../types": 152, "./FieldFormatter": 148, "lodash.isequal": 445, "lodash.isfunction": 446 }], 150: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.FieldFormatter = r.RowFormatter = void 0;
var n = e("./RowFormatter");
Object.defineProperty(r, "RowFormatter", { enumerable: true, get: function() {
return n.RowFormatter;
} });
var i = e("./FieldFormatter");
Object.defineProperty(r, "FieldFormatter", { enumerable: true, get: function() {
return i.FieldFormatter;
} });
}, { "./FieldFormatter": 148, "./RowFormatter": 149 }], 151: [function(e, t, r) {
(function(t2) {
(function() {
var n = Object.create ? function(e2, t3, r2, n2) {
void 0 === n2 && (n2 = r2), Object.defineProperty(e2, n2, { enumerable: true, get: function() {
return t3[r2];
} });
} : function(e2, t3, r2, n2) {
void 0 === n2 && (n2 = r2), e2[n2] = t3[r2];
}, i = Object.create ? function(e2, t3) {
Object.defineProperty(e2, "default", { enumerable: true, value: t3 });
} : function(e2, t3) {
e2.default = t3;
}, s = function(e2) {
if (e2 && e2.__esModule) return e2;
var t3 = {};
if (null != e2) for (var r2 in e2) "default" !== r2 && Object.prototype.hasOwnProperty.call(e2, r2) && n(t3, e2, r2);
return i(t3, e2), t3;
}, o = function(e2, t3) {
for (var r2 in e2) "default" === r2 || Object.prototype.hasOwnProperty.call(t3, r2) || n(t3, e2, r2);
};
Object.defineProperty(r, "__esModule", { value: true }), r.writeToPath = r.writeToString = r.writeToBuffer = r.writeToStream = r.write = r.format = r.FormatterOptions = r.CsvFormatterStream = void 0;
const a = e("util"), l = e("stream"), c = s(e("fs")), u = e("./FormatterOptions"), h = e("./CsvFormatterStream");
o(e("./types"), r);
var f = e("./CsvFormatterStream");
Object.defineProperty(r, "CsvFormatterStream", { enumerable: true, get: function() {
return f.CsvFormatterStream;
} });
var d = e("./FormatterOptions");
Object.defineProperty(r, "FormatterOptions", { enumerable: true, get: function() {
return d.FormatterOptions;
} }), r.format = (e2) => new h.CsvFormatterStream(new u.FormatterOptions(e2)), r.write = (e2, t3) => {
const n2 = r.format(t3), i2 = a.promisify((e3, t4) => {
n2.write(e3, void 0, t4);
});
return e2.reduce((e3, t4) => e3.then(() => i2(t4)), Promise.resolve()).then(() => n2.end()).catch((e3) => {
n2.emit("error", e3);
}), n2;
}, r.writeToStream = (e2, t3, n2) => r.write(t3, n2).pipe(e2), r.writeToBuffer = function(e2) {
let n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
const i2 = [], s2 = new l.Writable({ write(e3, t3, r2) {
i2.push(e3), r2();
} });
return new Promise((o2, a2) => {
s2.on("error", a2).on("finish", () => o2(t2.concat(i2))), r.write(e2, n2).pipe(s2);
});
}, r.writeToString = (e2, t3) => r.writeToBuffer(e2, t3).then((e3) => e3.toString()), r.writeToPath = (e2, t3, n2) => {
const i2 = c.createWriteStream(e2, { encoding: "utf8" });
return r.write(t3, n2).pipe(i2);
};
}).call(this);
}).call(this, e("buffer").Buffer);
}, { "./CsvFormatterStream": 146, "./FormatterOptions": 147, "./types": 152, buffer: 220, fs: 216, stream: 505, util: 527 }], 152: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.isSyncTransform = void 0, r.isSyncTransform = (e2) => 1 === e2.length;
}, {}], 153: [function(e, t, r) {
(function(t2) {
(function() {
Object.defineProperty(r, "__esModule", { value: true }), r.CsvParserStream = void 0;
const n = e("string_decoder"), i = e("stream"), s = e("./transforms"), o = e("./parser");
class a extends i.Transform {
constructor(e2) {
super({ objectMode: e2.objectMode }), this.lines = "", this.rowCount = 0, this.parsedRowCount = 0, this.parsedLineCount = 0, this.endEmitted = false, this.headersEmitted = false, this.parserOptions = e2, this.parser = new o.Parser(e2), this.headerTransformer = new s.HeaderTransformer(e2), this.decoder = new n.StringDecoder(e2.encoding), this.rowTransformerValidator = new s.RowTransformerValidator();
}
get hasHitRowLimit() {
return this.parserOptions.limitRows && this.rowCount >= this.parserOptions.maxRows;
}
get shouldEmitRows() {
return this.parsedRowCount > this.parserOptions.skipRows;
}
get shouldSkipLine() {
return this.parsedLineCount <= this.parserOptions.skipLines;
}
transform(e2) {
return this.rowTransformerValidator.rowTransform = e2, this;
}
validate(e2) {
return this.rowTransformerValidator.rowValidator = e2, this;
}
emit(e2) {
if ("end" === e2) return this.endEmitted || (this.endEmitted = true, super.emit("end", this.rowCount)), false;
for (var t3 = arguments.length, r2 = new Array(t3 > 1 ? t3 - 1 : 0), n2 = 1; n2 < t3; n2++) r2[n2 - 1] = arguments[n2];
return super.emit(e2, ...r2);
}
_transform(e2, t3, r2) {
if (this.hasHitRowLimit) return r2();
const n2 = a.wrapDoneCallback(r2);
try {
const { lines: t4 } = this, r3 = t4 + this.decoder.write(e2), i2 = this.parse(r3, true);
return this.processRows(i2, n2);
} catch (e3) {
return n2(e3);
}
}
_flush(e2) {
const t3 = a.wrapDoneCallback(e2);
if (this.hasHitRowLimit) return t3();
try {
const e3 = this.lines + this.decoder.end(), r2 = this.parse(e3, false);
return this.processRows(r2, t3);
} catch (e3) {
return t3(e3);
}
}
parse(e2, t3) {
if (!e2) return [];
const { line: r2, rows: n2 } = this.parser.parse(e2, t3);
return this.lines = r2, n2;
}
processRows(e2, r2) {
const n2 = e2.length, i2 = (s2) => {
const o2 = (e3) => e3 ? r2(e3) : s2 % 100 != 0 ? i2(s2 + 1) : void t2(() => i2(s2 + 1));
if (this.checkAndEmitHeaders(), s2 >= n2 || this.hasHitRowLimit) return r2();
if (this.parsedLineCount += 1, this.shouldSkipLine) return o2();
const a2 = e2[s2];
this.rowCount += 1, this.parsedRowCount += 1;
const l = this.rowCount;
return this.transformRow(a2, (e3, t3) => {
if (e3) return this.rowCount -= 1, o2(e3);
if (!t3) return o2(new Error("expected transform result"));
if (t3.isValid) {
if (t3.row) return this.pushRow(t3.row, o2);
} else this.emit("data-invalid", t3.row, l, t3.reason);
return o2();
});
};
i2(0);
}
transformRow(e2, t3) {
try {
this.headerTransformer.transform(e2, (r2, n2) => r2 ? t3(r2) : n2 ? n2.isValid ? n2.row ? this.shouldEmitRows ? this.rowTransformerValidator.transformAndValidate(n2.row, t3) : this.skipRow(t3) : (this.rowCount -= 1, this.parsedRowCount -= 1, t3(null, { row: null, isValid: true })) : this.shouldEmitRows ? t3(null, { isValid: false, row: e2 }) : this.skipRow(t3) : t3(new Error("Expected result from header transform")));
} catch (e3) {
t3(e3);
}
}
checkAndEmitHeaders() {
!this.headersEmitted && this.headerTransformer.headers && (this.headersEmitted = true, this.emit("headers", this.headerTransformer.headers));
}
skipRow(e2) {
return this.rowCount -= 1, e2(null, { row: null, isValid: true });
}
pushRow(e2, t3) {
try {
this.parserOptions.objectMode ? this.push(e2) : this.push(JSON.stringify(e2)), t3();
} catch (e3) {
t3(e3);
}
}
static wrapDoneCallback(e2) {
let t3 = false;
return function(r2) {
if (r2) {
if (t3) throw r2;
return t3 = true, void e2(r2);
}
for (var n2 = arguments.length, i2 = new Array(n2 > 1 ? n2 - 1 : 0), s2 = 1; s2 < n2; s2++) i2[s2 - 1] = arguments[s2];
e2(...i2);
};
}
}
r.CsvParserStream = a;
}).call(this);
}).call(this, e("timers").setImmediate);
}, { "./parser": 165, "./transforms": 168, stream: 505, string_decoder: 218, timers: 523 }], 154: [function(e, t, r) {
var n = function(e2) {
return e2 && e2.__esModule ? e2 : { default: e2 };
};
Object.defineProperty(r, "__esModule", { value: true }), r.ParserOptions = void 0;
const i = n(e("lodash.escaperegexp")), s = n(e("lodash.isnil"));
r.ParserOptions = class {
constructor(e2) {
var t2;
if (this.objectMode = true, this.delimiter = ",", this.ignoreEmpty = false, this.quote = '"', this.escape = null, this.escapeChar = this.quote, this.comment = null, this.supportsComments = false, this.ltrim = false, this.rtrim = false, this.trim = false, this.headers = null, this.renameHeaders = false, this.strictColumnHandling = false, this.discardUnmappedColumns = false, this.carriageReturn = "\r", this.encoding = "utf8", this.limitRows = false, this.maxRows = 0, this.skipLines = 0, this.skipRows = 0, Object.assign(this, e2 || {}), this.delimiter.length > 1) throw new Error("delimiter option must be one character long");
this.escapedDelimiter = i.default(this.delimiter), this.escapeChar = null !== (t2 = this.escape) && void 0 !== t2 ? t2 : this.quote, this.supportsComments = !s.default(this.comment), this.NEXT_TOKEN_REGEXP = new RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`), this.maxRows > 0 && (this.limitRows = true);
}
};
}, { "lodash.escaperegexp": 442, "lodash.isnil": 447 }], 155: [function(e, t, r) {
var n = Object.create ? function(e2, t2, r2, n2) {
void 0 === n2 && (n2 = r2), Object.defineProperty(e2, n2, { enumerable: true, get: function() {
return t2[r2];
} });
} : function(e2, t2, r2, n2) {
void 0 === n2 && (n2 = r2), e2[n2] = t2[r2];
}, i = Object.create ? function(e2, t2) {
Object.defineProperty(e2, "default", { enumerable: true, value: t2 });
} : function(e2, t2) {
e2.default = t2;
}, s = function(e2) {
if (e2 && e2.__esModule) return e2;
var t2 = {};
if (null != e2) for (var r2 in e2) "default" !== r2 && Object.prototype.hasOwnProperty.call(e2, r2) && n(t2, e2, r2);
return i(t2, e2), t2;
}, o = function(e2, t2) {
for (var r2 in e2) "default" === r2 || Object.prototype.hasOwnProperty.call(t2, r2) || n(t2, e2, r2);
};
Object.defineProperty(r, "__esModule", { value: true }), r.parseString = r.parseFile = r.parseStream = r.parse = r.ParserOptions = r.CsvParserStream = void 0;
const a = s(e("fs")), l = e("stream"), c = e("./ParserOptions"), u = e("./CsvParserStream");
o(e("./types"), r);
var h = e("./CsvParserStream");
Object.defineProperty(r, "CsvParserStream", { enumerable: true, get: function() {
return h.CsvParserStream;
} });
var f = e("./ParserOptions");
Object.defineProperty(r, "ParserOptions", { enumerable: true, get: function() {
return f.ParserOptions;
} }), r.parse = (e2) => new u.CsvParserStream(new c.ParserOptions(e2)), r.parseStream = (e2, t2) => e2.pipe(new u.CsvParserStream(new c.ParserOptions(t2))), r.parseFile = function(e2) {
let t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return a.createReadStream(e2).pipe(new u.CsvParserStream(new c.ParserOptions(t2)));
}, r.parseString = (e2, t2) => {
const r2 = new l.Readable();
return r2.push(e2), r2.push(null), r2.pipe(new u.CsvParserStream(new c.ParserOptions(t2)));
};
}, { "./CsvParserStream": 153, "./ParserOptions": 154, "./types": 169, fs: 216, stream: 505 }], 156: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.Parser = void 0;
const n = e("./Scanner"), i = e("./RowParser"), s = e("./Token");
class o {
constructor(e2) {
this.parserOptions = e2, this.rowParser = new i.RowParser(this.parserOptions);
}
static removeBOM(e2) {
return e2 && 65279 === e2.charCodeAt(0) ? e2.slice(1) : e2;
}
parse(e2, t2) {
const r2 = new n.Scanner({ line: o.removeBOM(e2), parserOptions: this.parserOptions, hasMoreData: t2 });
return this.parserOptions.supportsComments ? this.parseWithComments(r2) : this.parseWithoutComments(r2);
}
parseWithoutComments(e2) {
const t2 = [];
let r2 = true;
for (; r2; ) r2 = this.parseRow(e2, t2);
return { line: e2.line, rows: t2 };
}
parseWithComments(e2) {
const { parserOptions: t2 } = this, r2 = [];
for (let n2 = e2.nextCharacterToken; null !== n2; n2 = e2.nextCharacterToken) if (s.Token.isTokenComment(n2, t2)) {
if (null === e2.advancePastLine()) return { line: e2.lineFromCursor, rows: r2 };
if (!e2.hasMoreCharacters) return { line: e2.lineFromCursor, rows: r2 };
e2.truncateToCursor();
} else if (!this.parseRow(e2, r2)) break;
return { line: e2.line, rows: r2 };
}
parseRow(e2, t2) {
if (!e2.nextNonSpaceToken) return false;
const r2 = this.rowParser.parse(e2);
return null !== r2 && (this.parserOptions.ignoreEmpty && i.RowParser.isEmptyRow(r2) || t2.push(r2), true);
}
}
r.Parser = o;
}, { "./RowParser": 157, "./Scanner": 158, "./Token": 159 }], 157: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.RowParser = void 0;
const n = e("./column"), i = e("./Token");
r.RowParser = class {
constructor(e2) {
this.parserOptions = e2, this.columnParser = new n.ColumnParser(e2);
}
static isEmptyRow(e2) {
return "" === e2.join("").replace(/\s+/g, "");
}
parse(e2) {
const { parserOptions: t2 } = this, { hasMoreData: r2 } = e2, n2 = e2, s = [];
let o = this.getStartToken(n2, s);
for (; o; ) {
if (i.Token.isTokenRowDelimiter(o)) return n2.advancePastToken(o), !n2.hasMoreCharacters && i.Token.isTokenCarriageReturn(o, t2) && r2 ? null : (n2.truncateToCursor(), s);
if (!this.shouldSkipColumnParse(n2, o, s)) {
const e3 = this.columnParser.parse(n2);
if (null === e3) return null;
s.push(e3);
}
o = n2.nextNonSpaceToken;
}
return r2 ? null : (n2.truncateToCursor(), s);
}
getStartToken(e2, t2) {
const r2 = e2.nextNonSpaceToken;
return null !== r2 && i.Token.isTokenDelimiter(r2, this.parserOptions) ? (t2.push(""), e2.nextNonSpaceToken) : r2;
}
shouldSkipColumnParse(e2, t2, r2) {
const { parserOptions: n2 } = this;
if (i.Token.isTokenDelimiter(t2, n2)) {
e2.advancePastToken(t2);
const s = e2.nextCharacterToken;
if (!e2.hasMoreCharacters || null !== s && i.Token.isTokenRowDelimiter(s)) return r2.push(""), true;
if (null !== s && i.Token.isTokenDelimiter(s, n2)) return r2.push(""), true;
}
return false;
}
};
}, { "./Token": 159, "./column": 164 }], 158: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.Scanner = void 0;
const n = e("./Token"), i = /((?:\r\n)|\n|\r)/;
r.Scanner = class {
constructor(e2) {
this.cursor = 0, this.line = e2.line, this.lineLength = this.line.length, this.parserOptions = e2.parserOptions, this.hasMoreData = e2.hasMoreData, this.cursor = e2.cursor || 0;
}
get hasMoreCharacters() {
return this.lineLength > this.cursor;
}
get nextNonSpaceToken() {
const { lineFromCursor: e2 } = this, t2 = this.parserOptions.NEXT_TOKEN_REGEXP;
if (-1 === e2.search(t2)) return null;
const r2 = t2.exec(e2);
if (null == r2) return null;
const i2 = r2[1], s = this.cursor + (r2.index || 0);
return new n.Token({ token: i2, startCursor: s, endCursor: s + i2.length - 1 });
}
get nextCharacterToken() {
const { cursor: e2, lineLength: t2 } = this;
return t2 <= e2 ? null : new n.Token({ token: this.line[e2], startCursor: e2, endCursor: e2 });
}
get lineFromCursor() {
return this.line.substr(this.cursor);
}
advancePastLine() {
const e2 = i.exec(this.lineFromCursor);
return e2 ? (this.cursor += (e2.index || 0) + e2[0].length, this) : this.hasMoreData ? null : (this.cursor = this.lineLength, this);
}
advanceTo(e2) {
return this.cursor = e2, this;
}
advanceToToken(e2) {
return this.cursor = e2.startCursor, this;
}
advancePastToken(e2) {
return this.cursor = e2.endCursor + 1, this;
}
truncateToCursor() {
return this.line = this.lineFromCursor, this.lineLength = this.line.length, this.cursor = 0, this;
}
};
}, { "./Token": 159 }], 159: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.Token = void 0;
r.Token = class {
constructor(e2) {
this.token = e2.token, this.startCursor = e2.startCursor, this.endCursor = e2.endCursor;
}
static isTokenRowDelimiter(e2) {
const t2 = e2.token;
return "\r" === t2 || "\n" === t2 || "\r\n" === t2;
}
static isTokenCarriageReturn(e2, t2) {
return e2.token === t2.carriageReturn;
}
static isTokenComment(e2, t2) {
return t2.supportsComments && !!e2 && e2.token === t2.comment;
}
static isTokenEscapeCharacter(e2, t2) {
return e2.token === t2.escapeChar;
}
static isTokenQuote(e2, t2) {
return e2.token === t2.quote;
}
static isTokenDelimiter(e2, t2) {
return e2.token === t2.delimiter;
}
};
}, {}], 160: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.ColumnFormatter = void 0;
r.ColumnFormatter = class {
constructor(e2) {
e2.trim ? this.format = (e3) => e3.trim() : e2.ltrim ? this.format = (e3) => e3.trimLeft() : e2.rtrim ? this.format = (e3) => e3.trimRight() : this.format = (e3) => e3;
}
};
}, {}], 161: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.ColumnParser = void 0;
const n = e("./NonQuotedColumnParser"), i = e("./QuotedColumnParser"), s = e("../Token");
r.ColumnParser = class {
constructor(e2) {
this.parserOptions = e2, this.quotedColumnParser = new i.QuotedColumnParser(e2), this.nonQuotedColumnParser = new n.NonQuotedColumnParser(e2);
}
parse(e2) {
const { nextNonSpaceToken: t2 } = e2;
return null !== t2 && s.Token.isTokenQuote(t2, this.parserOptions) ? (e2.advanceToToken(t2), this.quotedColumnParser.parse(e2)) : this.nonQuotedColumnParser.parse(e2);
}
};
}, { "../Token": 159, "./NonQuotedColumnParser": 162, "./QuotedColumnParser": 163 }], 162: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.NonQuotedColumnParser = void 0;
const n = e("./ColumnFormatter"), i = e("../Token");
r.NonQuotedColumnParser = class {
constructor(e2) {
this.parserOptions = e2, this.columnFormatter = new n.ColumnFormatter(e2);
}
parse(e2) {
if (!e2.hasMoreCharacters) return null;
const { parserOptions: t2 } = this, r2 = [];
let n2 = e2.nextCharacterToken;
for (; n2 && (!i.Token.isTokenDelimiter(n2, t2) && !i.Token.isTokenRowDelimiter(n2)); n2 = e2.nextCharacterToken) r2.push(n2.token), e2.advancePastToken(n2);
return this.columnFormatter.format(r2.join(""));
}
};
}, { "../Token": 159, "./ColumnFormatter": 160 }], 163: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.QuotedColumnParser = void 0;
const n = e("./ColumnFormatter"), i = e("../Token");
r.QuotedColumnParser = class {
constructor(e2) {
this.parserOptions = e2, this.columnFormatter = new n.ColumnFormatter(e2);
}
parse(e2) {
if (!e2.hasMoreCharacters) return null;
const t2 = e2.cursor, { foundClosingQuote: r2, col: n2 } = this.gatherDataBetweenQuotes(e2);
if (!r2) {
if (e2.advanceTo(t2), !e2.hasMoreData) throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote || ""}' in line: at '${e2.lineFromCursor.replace(/[\r\n]/g, "\\n'")}'`);
return null;
}
return this.checkForMalformedColumn(e2), n2;
}
gatherDataBetweenQuotes(e2) {
const { parserOptions: t2 } = this;
let r2 = false, n2 = false;
const s = [];
let o = e2.nextCharacterToken;
for (; !n2 && null !== o; o = e2.nextCharacterToken) {
const a = i.Token.isTokenQuote(o, t2);
if (!r2 && a) r2 = true;
else if (r2) if (i.Token.isTokenEscapeCharacter(o, t2)) {
e2.advancePastToken(o);
const r3 = e2.nextCharacterToken;
null !== r3 && (i.Token.isTokenQuote(r3, t2) || i.Token.isTokenEscapeCharacter(r3, t2)) ? (s.push(r3.token), o = r3) : a ? n2 = true : s.push(o.token);
} else a ? n2 = true : s.push(o.token);
e2.advancePastToken(o);
}
return { col: this.columnFormatter.format(s.join("")), foundClosingQuote: n2 };
}
checkForMalformedColumn(e2) {
const { parserOptions: t2 } = this, { nextNonSpaceToken: r2 } = e2;
if (r2) {
const n2 = i.Token.isTokenDelimiter(r2, t2), s = i.Token.isTokenRowDelimiter(r2);
if (!n2 && !s) {
const n3 = e2.lineFromCursor.substr(0, 10).replace(/[\r\n]/g, "\\n'");
throw new Error(`Parse Error: expected: '${t2.escapedDelimiter}' OR new line got: '${r2.token}'. at '${n3}`);
}
e2.advanceToToken(r2);
} else e2.hasMoreData || e2.advancePastLine();
}
};
}, { "../Token": 159, "./ColumnFormatter": 160 }], 164: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.ColumnFormatter = r.QuotedColumnParser = r.NonQuotedColumnParser = r.ColumnParser = void 0;
var n = e("./ColumnParser");
Object.defineProperty(r, "ColumnParser", { enumerable: true, get: function() {
return n.ColumnParser;
} });
var i = e("./NonQuotedColumnParser");
Object.defineProperty(r, "NonQuotedColumnParser", { enumerable: true, get: function() {
return i.NonQuotedColumnParser;
} });
var s = e("./QuotedColumnParser");
Object.defineProperty(r, "QuotedColumnParser", { enumerable: true, get: function() {
return s.QuotedColumnParser;
} });
var o = e("./ColumnFormatter");
Object.defineProperty(r, "ColumnFormatter", { enumerable: true, get: function() {
return o.ColumnFormatter;
} });
}, { "./ColumnFormatter": 160, "./ColumnParser": 161, "./NonQuotedColumnParser": 162, "./QuotedColumnParser": 163 }], 165: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.QuotedColumnParser = r.NonQuotedColumnParser = r.ColumnParser = r.Token = r.Scanner = r.RowParser = r.Parser = void 0;
var n = e("./Parser");
Object.defineProperty(r, "Parser", { enumerable: true, get: function() {
return n.Parser;
} });
var i = e("./RowParser");
Object.defineProperty(r, "RowParser", { enumerable: true, get: function() {
return i.RowParser;
} });
var s = e("./Scanner");
Object.defineProperty(r, "Scanner", { enumerable: true, get: function() {
return s.Scanner;
} });
var o = e("./Token");
Object.defineProperty(r, "Token", { enumerable: true, get: function() {
return o.Token;
} });
var a = e("./column");
Object.defineProperty(r, "ColumnParser", { enumerable: true, get: function() {
return a.ColumnParser;
} }), Object.defineProperty(r, "NonQuotedColumnParser", { enumerable: true, get: function() {
return a.NonQuotedColumnParser;
} }), Object.defineProperty(r, "QuotedColumnParser", { enumerable: true, get: function() {
return a.QuotedColumnParser;
} });
}, { "./Parser": 156, "./RowParser": 157, "./Scanner": 158, "./Token": 159, "./column": 164 }], 166: [function(e, t, r) {
var n = function(e2) {
return e2 && e2.__esModule ? e2 : { default: e2 };
};
Object.defineProperty(r, "__esModule", { value: true }), r.HeaderTransformer = void 0;
const i = n(e("lodash.isundefined")), s = n(e("lodash.isfunction")), o = n(e("lodash.uniq")), a = n(e("lodash.groupby"));
r.HeaderTransformer = class {
constructor(e2) {
this.headers = null, this.receivedHeaders = false, this.shouldUseFirstRow = false, this.processedFirstRow = false, this.headersLength = 0, this.parserOptions = e2, true === e2.headers ? this.shouldUseFirstRow = true : Array.isArray(e2.headers) ? this.setHeaders(e2.headers) : s.default(e2.headers) && (this.headersTransform = e2.headers);
}
transform(e2, t2) {
return this.shouldMapRow(e2) ? t2(null, this.processRow(e2)) : t2(null, { row: null, isValid: true });
}
shouldMapRow(e2) {
const { parserOptions: t2 } = this;
if (!this.headersTransform && t2.renameHeaders && !this.processedFirstRow) {
if (!this.receivedHeaders) throw new Error("Error renaming headers: new headers must be provided in an array");
return this.processedFirstRow = true, false;
}
if (!this.receivedHeaders && Array.isArray(e2)) {
if (this.headersTransform) this.setHeaders(this.headersTransform(e2));
else {
if (!this.shouldUseFirstRow) return true;
this.setHeaders(e2);
}
return false;
}
return true;
}
processRow(e2) {
if (!this.headers) return { row: e2, isValid: true };
const { parserOptions: t2 } = this;
if (!t2.discardUnmappedColumns && e2.length > this.headersLength) {
if (!t2.strictColumnHandling) throw new Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e2.length}`);
return { row: e2, isValid: false, reason: `Column header mismatch expected: ${this.headersLength} columns got: ${e2.length}` };
}
return t2.strictColumnHandling && e2.length < this.headersLength ? { row: e2, isValid: false, reason: `Column header mismatch expected: ${this.headersLength} columns got: ${e2.length}` } : { row: this.mapHeaders(e2), isValid: true };
}
mapHeaders(e2) {
const t2 = {}, { headers: r2, headersLength: n2 } = this;
for (let s2 = 0; s2 < n2; s2 += 1) {
const n3 = r2[s2];
if (!i.default(n3)) {
const r3 = e2[s2];
i.default(r3) ? t2[n3] = "" : t2[n3] = r3;
}
}
return t2;
}
setHeaders(e2) {
var t2;
const r2 = e2.filter((e3) => !!e3);
if (o.default(r2).length !== r2.length) {
const e3 = a.default(r2), t3 = Object.keys(e3).filter((t4) => e3[t4].length > 1);
throw new Error("Duplicate headers found " + JSON.stringify(t3));
}
this.headers = e2, this.receivedHeaders = true, this.headersLength = (null === (t2 = this.headers) || void 0 === t2 ? void 0 : t2.length) || 0;
}
};
}, { "lodash.groupby": 443, "lodash.isfunction": 446, "lodash.isundefined": 448, "lodash.uniq": 449 }], 167: [function(e, t, r) {
var n = function(e2) {
return e2 && e2.__esModule ? e2 : { default: e2 };
};
Object.defineProperty(r, "__esModule", { value: true }), r.RowTransformerValidator = void 0;
const i = n(e("lodash.isfunction")), s = e("../types");
class o {
constructor() {
this._rowTransform = null, this._rowValidator = null;
}
static createTransform(e2) {
return s.isSyncTransform(e2) ? (t2, r2) => {
let n2 = null;
try {
n2 = e2(t2);
} catch (e3) {
return r2(e3);
}
return r2(null, n2);
} : e2;
}
static createValidator(e2) {
return s.isSyncValidate(e2) ? (t2, r2) => {
r2(null, { row: t2, isValid: e2(t2) });
} : (t2, r2) => {
e2(t2, (e3, n2, i2) => e3 ? r2(e3) : r2(null, n2 ? { row: t2, isValid: n2, reason: i2 } : { row: t2, isValid: false, reason: i2 }));
};
}
set rowTransform(e2) {
if (!i.default(e2)) throw new TypeError("The transform should be a function");
this._rowTransform = o.createTransform(e2);
}
set rowValidator(e2) {
if (!i.default(e2)) throw new TypeError("The validate should be a function");
this._rowValidator = o.createValidator(e2);
}
transformAndValidate(e2, t2) {
return this.callTransformer(e2, (e3, r2) => e3 ? t2(e3) : r2 ? this.callValidator(r2, (e4, n2) => e4 ? t2(e4) : n2 && !n2.isValid ? t2(null, { row: r2, isValid: false, reason: n2.reason }) : t2(null, { row: r2, isValid: true })) : t2(null, { row: null, isValid: true }));
}
callTransformer(e2, t2) {
return this._rowTransform ? this._rowTransform(e2, t2) : t2(null, e2);
}
callValidator(e2, t2) {
return this._rowValidator ? this._rowValidator(e2, t2) : t2(null, { row: e2, isValid: true });
}
}
r.RowTransformerValidator = o;
}, { "../types": 169, "lodash.isfunction": 446 }], 168: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.HeaderTransformer = r.RowTransformerValidator = void 0;
var n = e("./RowTransformerValidator");
Object.defineProperty(r, "RowTransformerValidator", { enumerable: true, get: function() {
return n.RowTransformerValidator;
} });
var i = e("./HeaderTransformer");
Object.defineProperty(r, "HeaderTransformer", { enumerable: true, get: function() {
return i.HeaderTransformer;
} });
}, { "./HeaderTransformer": 166, "./RowTransformerValidator": 167 }], 169: [function(e, t, r) {
Object.defineProperty(r, "__esModule", { value: true }), r.isSyncValidate = r.isSyncTransform = void 0, r.isSyncTransform = (e2) => 1 === e2.length, r.isSyncValidate = (e2) => 1 === e2.length;
}, {}], 170: [function(e, t, r) {
const n = r;
n.bignum = e("bn.js"), n.define = e("./asn1/api").define, n.base = e("./asn1/base"), n.constants = e("./asn1/constants"), n.decoders = e("./asn1/decoders"), n.encoders = e("./asn1/encoders");
}, { "./asn1/api": 171, "./asn1/base": 173, "./asn1/constants": 177, "./asn1/decoders": 179, "./asn1/encoders": 182, "bn.js": 184 }], 171: [function(e, t, r) {
const n = e("./encoders"), i = e("./decoders"), s = e("inherits");
function o(e2, t2) {
this.name = e2, this.body = t2, this.decoders = {}, this.encoders = {};
}
r.define = function(e2, t2) {
return new o(e2, t2);
}, o.prototype._createNamed = function(e2) {
const t2 = this.name;
function r2(e3) {
this._initNamed(e3, t2);
}
return s(r2, e2), r2.prototype._initNamed = function(t3, r3) {
e2.call(this, t3, r3);
}, new r2(this);
}, o.prototype._getDecoder = function(e2) {
return e2 = e2 || "der", this.decoders.hasOwnProperty(e2) || (this.decoders[e2] = this._createNamed(i[e2])), this.decoders[e2];
}, o.prototype.decode = function(e2, t2, r2) {
return this._getDecoder(t2).decode(e2, r2);
}, o.prototype._getEncoder = function(e2) {
return e2 = e2 || "der", this.encoders.hasOwnProperty(e2) || (this.encoders[e2] = this._createNamed(n[e2])), this.encoders[e2];
}, o.prototype.encode = function(e2, t2, r2) {
return this._getEncoder(t2).encode(e2, r2);
};
}, { "./decoders": 179, "./encoders": 182, inherits: 440 }], 172: [function(e, t, r) {
const n = e("inherits"), i = e("../base/reporter").Reporter, s = e("safer-buffer").Buffer;
function o(e2, t2) {
i.call(this, t2), s.isBuffer(e2) ? (this.base = e2, this.offset = 0, this.length = e2.length) : this.error("Input not Buffer");
}
function a(e2, t2) {
if (Array.isArray(e2)) this.length = 0, this.value = e2.map((function(e3) {
return a.isEncoderBuffer(e3) || (e3 = new a(e3, t2)), this.length += e3.length, e3;
}), this);
else if ("number" == typeof e2) {
if (!(0 <= e2 && e2 <= 255)) return t2.error("non-byte EncoderBuffer value");
this.value = e2, this.length = 1;
} else if ("string" == typeof e2) this.value = e2, this.length = s.byteLength(e2);
else {
if (!s.isBuffer(e2)) return t2.error("Unsupported type: " + typeof e2);
this.value = e2, this.length = e2.length;
}
}
n(o, i), r.DecoderBuffer = o, o.isDecoderBuffer = function(e2) {
if (e2 instanceof o) return true;
return "object" == typeof e2 && s.isBuffer(e2.base) && "DecoderBuffer" === e2.constructor.name && "number" == typeof e2.offset && "number" == typeof e2.length && "function" == typeof e2.save && "function" == typeof e2.restore && "function" == typeof e2.isEmpty && "function" == typeof e2.readUInt8 && "function" == typeof e2.skip && "function" == typeof e2.raw;
}, o.prototype.save = function() {
return { offset: this.offset, reporter: i.prototype.save.call(this) };
}, o.prototype.restore = function(e2) {
const t2 = new o(this.base);
return t2.offset = e2.offset, t2.length = this.offset, this.offset = e2.offset, i.prototype.restore.call(this, e2.reporter), t2;
}, o.prototype.isEmpty = function() {
return this.offset === this.length;
}, o.prototype.readUInt8 = function(e2) {
return this.offset + 1 <= this.length ? this.base.readUInt8(this.offset++, true) : this.error(e2 || "DecoderBuffer overrun");
}, o.prototype.skip = function(e2, t2) {
if (!(this.offset + e2 <= this.length)) return this.error(t2 || "DecoderBuffer overrun");
const r2 = new o(this.base);
return r2._reporterState = this._reporterState, r2.offset = this.offset, r2.length = this.offset + e2, this.offset += e2, r2;
}, o.prototype.raw = function(e2) {
return this.base.slice(e2 ? e2.offset : this.offset, this.length);
}, r.EncoderBuffer = a, a.isEncoderBuffer = function(e2) {
if (e2 instanceof a) return true;
return "object" == typeof e2 && "EncoderBuffer" === e2.constructor.name && "number" == typeof e2.length && "function" == typeof e2.join;
}, a.prototype.join = function(e2, t2) {
return e2 || (e2 = s.alloc(this.length)), t2 || (t2 = 0), 0 === this.length || (Array.isArray(this.value) ? this.value.forEach((function(r2) {
r2.join(e2, t2), t2 += r2.length;
})) : ("number" == typeof this.value ? e2[t2] = this.value : "string" == typeof this.value ? e2.write(this.value, t2) : s.isBuffer(this.value) && this.value.copy(e2, t2), t2 += this.length)), e2;
};
}, { "../base/reporter": 175, inherits: 440, "safer-buffer": 495 }], 173: [function(e, t, r) {
const n = r;
n.Reporter = e("./reporter").Reporter, n.DecoderBuffer = e("./buffer").DecoderBuffer, n.EncoderBuffer = e("./buffer").EncoderBuffer, n.Node = e("./node");
}, { "./buffer": 172, "./node": 174, "./reporter": 175 }], 174: [function(e, t, r) {
const n = e("../base/reporter").Reporter, i = e("../base/buffer").EncoderBuffer, s = e("../base/buffer").DecoderBuffer, o = e("minimalistic-assert"), a = ["seq", "seqof", "set", "setof", "objid", "bool", "gentime", "utctime", "null_", "enum", "int", "objDesc", "bitstr", "bmpstr", "charstr", "genstr", "graphstr", "ia5str", "iso646str", "numstr", "octstr", "printstr", "t61str", "unistr", "utf8str", "videostr"], l = ["key", "obj", "use", "optional", "explicit", "implicit", "def", "choice", "any", "contains"].concat(a);
function c(e2, t2, r2) {
const n2 = {};
this._baseState = n2, n2.name = r2, n2.enc = e2, n2.parent = t2 || null, n2.children = null, n2.tag = null, n2.args = null, n2.reverseArgs = null, n2.choice = null, n2.optional = false, n2.any = false, n2.obj = false, n2.use = null, n2.useDecoder = null, n2.key = null, n2.default = null, n2.explicit = null, n2.implicit = null, n2.contains = null, n2.parent || (n2.children = [], this._wrap());
}
t.exports = c;
const u = ["enc", "parent", "children", "tag", "args", "reverseArgs", "choice", "optional", "any", "obj", "use", "alteredUse", "key", "default", "explicit", "implicit", "contains"];
c.prototype.clone = function() {
const e2 = this._baseState, t2 = {};
u.forEach((function(r3) {
t2[r3] = e2[r3];
}));
const r2 = new this.constructor(t2.parent);
return r2._baseState = t2, r2;
}, c.prototype._wrap = function() {
const e2 = this._baseState;
l.forEach((function(t2) {
this[t2] = function() {
const r2 = new this.constructor(this);
return e2.children.push(r2), r2[t2].apply(r2, arguments);
};
}), this);
}, c.prototype._init = function(e2) {
const t2 = this._baseState;
o(null === t2.parent), e2.call(this), t2.children = t2.children.filter((function(e3) {
return e3._baseState.parent === this;
}), this), o.equal(t2.children.length, 1, "Root node can have only one child");
}, c.prototype._useArgs = function(e2) {
const t2 = this._baseState, r2 = e2.filter((function(e3) {
return e3 instanceof this.constructor;
}), this);
e2 = e2.filter((function(e3) {
return !(e3 instanceof this.constructor);
}), this), 0 !== r2.length && (o(null === t2.children), t2.children = r2, r2.forEach((function(e3) {
e3._baseState.parent = this;
}), this)), 0 !== e2.length && (o(null === t2.args), t2.args = e2, t2.reverseArgs = e2.map((function(e3) {
if ("object" != typeof e3 || e3.constructor !== Object) return e3;
const t3 = {};
return Object.keys(e3).forEach((function(r3) {
r3 == (0 | r3) && (r3 |= 0);
const n2 = e3[r3];
t3[n2] = r3;
})), t3;
})));
}, ["_peekTag", "_decodeTag", "_use", "_decodeStr", "_decodeObjid", "_decodeTime", "_decodeNull", "_decodeInt", "_decodeBool", "_decodeList", "_encodeComposite", "_encodeStr", "_encodeObjid", "_encodeTime", "_encodeNull", "_encodeInt", "_encodeBool"].forEach((function(e2) {
c.prototype[e2] = function() {
const t2 = this._baseState;
throw new Error(e2 + " not implemented for encoding: " + t2.enc);
};
})), a.forEach((function(e2) {
c.prototype[e2] = function() {
const t2 = this._baseState, r2 = Array.prototype.slice.call(arguments);
return o(null === t2.tag), t2.tag = e2, this._useArgs(r2), this;
};
})), c.prototype.use = function(e2) {
o(e2);
const t2 = this._baseState;
return o(null === t2.use), t2.use = e2, this;
}, c.prototype.optional = function() {
return this._baseState.optional = true, this;
}, c.prototype.def = function(e2) {
const t2 = this._baseState;
return o(null === t2.default), t2.default = e2, t2.optional = true, this;
}, c.prototype.explicit = function(e2) {
const t2 = this._baseState;
return o(null === t2.explicit && null === t2.implicit), t2.explicit = e2, this;
}, c.prototype.implicit = function(e2) {
const t2 = this._baseState;
return o(null === t2.explicit && null === t2.implicit), t2.implicit = e2, this;
}, c.prototype.obj = function() {
const e2 = this._baseState, t2 = Array.prototype.slice.call(arguments);
return e2.obj = true, 0 !== t2.length && this._useArgs(t2), this;
}, c.prototype.key = function(e2) {
const t2 = this._baseState;
return o(null === t2.key), t2.key = e2, this;
}, c.prototype.any = function() {
return this._baseState.any = true, this;
}, c.prototype.choice = function(e2) {
const t2 = this._baseState;
return o(null === t2.choice), t2.choice = e2, this._useArgs(Object.keys(e2).map((function(t3) {
return e2[t3];
}))), this;
}, c.prototype.contains = function(e2) {
const t2 = this._baseState;
return o(null === t2.use), t2.contains = e2, this;
}, c.prototype._decode = function(e2, t2) {
const r2 = this._baseState;
if (null === r2.parent) return e2.wrapResult(r2.children[0]._decode(e2, t2));
let n2, i2 = r2.default, o2 = true, a2 = null;
if (null !== r2.key && (a2 = e2.enterKey(r2.key)), r2.optional) {
let n3 = null;
if (null !== r2.explicit ? n3 = r2.explicit : null !== r2.implicit ? n3 = r2.implicit : null !== r2.tag && (n3 = r2.tag), null !== n3 || r2.any) {
if (o2 = this._peekTag(e2, n3, r2.any), e2.isError(o2)) return o2;
} else {
const n4 = e2.save();
try {
null === r2.choice ? this._decodeGeneric(r2.tag, e2, t2) : this._decodeChoice(e2, t2), o2 = true;
} catch (e3) {
o2 = false;
}
e2.restore(n4);
}
}
if (r2.obj && o2 && (n2 = e2.enterObject()), o2) {
if (null !== r2.explicit) {
const t3 = this._decodeTag(e2, r2.explicit);
if (e2.isError(t3)) return t3;
e2 = t3;
}
const n3 = e2.offset;
if (null === r2.use && null === r2.choice) {
let t3;
r2.any && (t3 = e2.save());
const n4 = this._decodeTag(e2, null !== r2.implicit ? r2.implicit : r2.tag, r2.any);
if (e2.isError(n4)) return n4;
r2.any ? i2 = e2.raw(t3) : e2 = n4;
}
if (t2 && t2.track && null !== r2.tag && t2.track(e2.path(), n3, e2.length, "tagged"), t2 && t2.track && null !== r2.tag && t2.track(e2.path(), e2.offset, e2.length, "content"), r2.any || (i2 = null === r2.choice ? this._decodeGeneric(r2.tag, e2, t2) : this._decodeChoice(e2, t2)), e2.isError(i2)) return i2;
if (r2.any || null !== r2.choice || null === r2.children || r2.children.forEach((function(r3) {
r3._decode(e2, t2);
})), r2.contains && ("octstr" === r2.tag || "bitstr" === r2.tag)) {
const n4 = new s(i2);
i2 = this._getUse(r2.contains, e2._reporterState.obj)._decode(n4, t2);
}
}
return r2.obj && o2 && (i2 = e2.leaveObject(n2)), null === r2.key || null === i2 && true !== o2 ? null !== a2 && e2.exitKey(a2) : e2.leaveKey(a2, r2.key, i2), i2;
}, c.prototype._decodeGeneric = function(e2, t2, r2) {
const n2 = this._baseState;
return "seq" === e2 || "set" === e2 ? null : "seqof" === e2 || "setof" === e2 ? this._decodeList(t2, e2, n2.args[0], r2) : /str$/.test(e2) ? this._decodeStr(t2, e2, r2) : "objid" === e2 && n2.args ? this._decodeObjid(t2, n2.args[0], n2.args[1], r2) : "objid" === e2 ? this._decodeObjid(t2, null, null, r2) : "gentime" === e2 || "utctime" === e2 ? this._decodeTime(t2, e2, r2) : "null_" === e2 ? this._decodeNull(t2, r2) : "bool" === e2 ? this._decodeBool(t2, r2) : "objDesc" === e2 ? this._decodeStr(t2, e2, r2) : "int" === e2 || "enum" === e2 ? this._decodeInt(t2, n2.args && n2.args[0], r2) : null !== n2.use ? this._getUse(n2.use, t2._reporterState.obj)._decode(t2, r2) : t2.error("unknown tag: " + e2);
}, c.prototype._getUse = function(e2, t2) {
const r2 = this._baseState;
return r2.useDecoder = this._use(e2, t2), o(null === r2.useDecoder._baseState.parent), r2.useDecoder = r2.useDecoder._baseState.children[0], r2.implicit !== r2.useDecoder._baseState.implicit && (r2.useDecoder = r2.useDecoder.clone(), r2.useDecoder._baseState.implicit = r2.implicit), r2.useDecoder;
}, c.prototype._decodeChoice = function(e2, t2) {
const r2 = this._baseState;
let n2 = null, i2 = false;
return Object.keys(r2.choice).some((function(s2) {
const o2 = e2.save(), a2 = r2.choice[s2];
try {
const r3 = a2._decode(e2, t2);
if (e2.isError(r3)) return false;
n2 = { type: s2, value: r3 }, i2 = true;
} catch (t3) {
return e2.restore(o2), false;
}
return true;
}), this), i2 ? n2 : e2.error("Choice not matched");
}, c.prototype._createEncoderBuffer = function(e2) {
return new i(e2, this.reporter);
}, c.prototype._encode = function(e2, t2, r2) {
const n2 = this._baseState;
if (null !== n2.default && n2.default === e2) return;
const i2 = this._encodeValue(e2, t2, r2);
return void 0 === i2 || this._skipDefault(i2, t2, r2) ? void 0 : i2;
}, c.prototype._encodeValue = function(e2, t2, r2) {
const i2 = this._baseState;
if (null === i2.parent) return i2.children[0]._encode(e2, t2 || new n());
let s2 = null;
if (this.reporter = t2, i2.optional && void 0 === e2) {
if (null === i2.default) return;
e2 = i2.default;
}
let o2 = null, a2 = false;
if (i2.any) s2 = this._createEncoderBuffer(e2);
else if (i2.choice) s2 = this._encodeChoice(e2, t2);
else if (i2.contains) o2 = this._getUse(i2.contains, r2)._encode(e2, t2), a2 = true;
else if (i2.children) o2 = i2.children.map((function(r3) {
if ("null_" === r3._baseState.tag) return r3._encode(null, t2, e2);
if (null === r3._baseState.key) return t2.error("Child should have a key");
const n2 = t2.enterKey(r3._baseState.key);
if ("object" != typeof e2) return t2.error("Child expected, but input is not object");
const i3 = r3._encode(e2[r3._baseState.key], t2, e2);
return t2.leaveKey(n2), i3;
}), this).filter((function(e3) {
return e3;
})), o2 = this._createEncoderBuffer(o2);
else if ("seqof" === i2.tag || "setof" === i2.tag) {
if (!i2.args || 1 !== i2.args.length) return t2.error("Too many args for : " + i2.tag);
if (!Array.isArray(e2)) return t2.error("seqof/setof, but data is not Array");
const r3 = this.clone();
r3._baseState.implicit = null, o2 = this._createEncoderBuffer(e2.map((function(r4) {
const n2 = this._baseState;
return this._getUse(n2.args[0], e2)._encode(r4, t2);
}), r3));
} else null !== i2.use ? s2 = this._getUse(i2.use, r2)._encode(e2, t2) : (o2 = this._encodePrimitive(i2.tag, e2), a2 = true);
if (!i2.any && null === i2.choice) {
const e3 = null !== i2.implicit ? i2.implicit : i2.tag, r3 = null === i2.implicit ? "universal" : "context";
null === e3 ? null === i2.use && t2.error("Tag could be omitted only for .use()") : null === i2.use && (s2 = this._encodeComposite(e3, a2, r3, o2));
}
return null !== i2.explicit && (s2 = this._encodeComposite(i2.explicit, false, "context", s2)), s2;
}, c.prototype._encodeChoice = function(e2, t2) {
const r2 = this._baseState, n2 = r2.choice[e2.type];
return n2 || o(false, e2.type + " not found in " + JSON.stringify(Object.keys(r2.choice))), n2._encode(e2.value, t2);
}, c.prototype._encodePrimitive = function(e2, t2) {
const r2 = this._baseState;
if (/str$/.test(e2)) return this._encodeStr(t2, e2);
if ("objid" === e2 && r2.args) return this._encodeObjid(t2, r2.reverseArgs[0], r2.args[1]);
if ("objid" === e2) return this._encodeObjid(t2, null, null);
if ("gentime" === e2 || "utctime" === e2) return this._encodeTime(t2, e2);
if ("null_" === e2) return this._encodeNull();
if ("int" === e2 || "enum" === e2) return this._encodeInt(t2, r2.args && r2.reverseArgs[0]);
if ("bool" === e2) return this._encodeBool(t2);
if ("objDesc" === e2) return this._encodeStr(t2, e2);
throw new Error("Unsupported tag: " + e2);
}, c.prototype._isNumstr = function(e2) {
return /^[0-9 ]*$/.test(e2);
}, c.prototype._isPrintstr = function(e2) {
return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(e2);
};
}, { "../base/buffer": 172, "../base/reporter": 175, "minimalistic-assert": 453 }], 175: [function(e, t, r) {
const n = e("inherits");
function i(e2) {
this._reporterState = { obj: null, path: [], options: e2 || {}, errors: [] };
}
function s(e2, t2) {
this.path = e2, this.rethrow(t2);
}
r.Reporter = i, i.prototype.isError = function(e2) {
return e2 instanceof s;
}, i.prototype.save = function() {
const e2 = this._reporterState;
return { obj: e2.obj, pathLen: e2.path.length };
}, i.prototype.restore = function(e2) {
const t2 = this._reporterState;
t2.obj = e2.obj, t2.path = t2.path.slice(0, e2.pathLen);
}, i.prototype.enterKey = function(e2) {
return this._reporterState.path.push(e2);
}, i.prototype.exitKey = function(e2) {
const t2 = this._reporterState;
t2.path = t2.path.slice(0, e2 - 1);
}, i.prototype.leaveKey = function(e2, t2, r2) {
const n2 = this._reporterState;
this.exitKey(e2), null !== n2.obj && (n2.obj[t2] = r2);
}, i.prototype.path = function() {
return this._reporterState.path.join("/");
}, i.prototype.enterObject = function() {
const e2 = this._reporterState, t2 = e2.obj;
return e2.obj = {}, t2;
}, i.prototype.leaveObject = function(e2) {
const t2 = this._reporterState, r2 = t2.obj;
return t2.obj = e2, r2;
}, i.prototype.error = function(e2) {
let t2;
const r2 = this._reporterState, n2 = e2 instanceof s;
if (t2 = n2 ? e2 : new s(r2.path.map((function(e3) {
return "[" + JSON.stringify(e3) + "]";
})).join(""), e2.message || e2, e2.stack), !r2.options.partial) throw t2;
return n2 || r2.errors.push(t2), t2;
}, i.prototype.wrapResult = function(e2) {
const t2 = this._reporterState;
return t2.options.partial ? { result: this.isError(e2) ? null : e2, errors: t2.errors } : e2;
}, n(s, Error), s.prototype.rethrow = function(e2) {
if (this.message = e2 + " at: " + (this.path || "(shallow)"), Error.captureStackTrace && Error.captureStackTrace(this, s), !this.stack) try {
throw new Error(this.message);
} catch (e3) {
this.stack = e3.stack;
}
return this;
};
}, { inherits: 440 }], 176: [function(e, t, r) {
function n(e2) {
const t2 = {};
return Object.keys(e2).forEach((function(r2) {
(0 | r2) == r2 && (r2 |= 0);
const n2 = e2[r2];
t2[n2] = r2;
})), t2;
}
r.tagClass = { 0: "universal", 1: "application", 2: "context", 3: "private" }, r.tagClassByName = n(r.tagClass), r.tag = { 0: "end", 1: "bool", 2: "int", 3: "bitstr", 4: "octstr", 5: "null_", 6: "objid", 7: "objDesc", 8: "external", 9: "real", 10: "enum", 11: "embed", 12: "utf8str", 13: "relativeOid", 16: "seq", 17: "set", 18: "numstr", 19: "printstr", 20: "t61str", 21: "videostr", 22: "ia5str", 23: "utctime", 24: "gentime", 25: "graphstr", 26: "iso646str", 27: "genstr", 28: "unistr", 29: "charstr", 30: "bmpstr" }, r.tagByName = n(r.tag);
}, {}], 177: [function(e, t, r) {
const n = r;
n._reverse = function(e2) {
const t2 = {};
return Object.keys(e2).forEach((function(r2) {
(0 | r2) == r2 && (r2 |= 0);
const n2 = e2[r2];
t2[n2] = r2;
})), t2;
}, n.der = e("./der");
}, { "./der": 176 }], 178: [function(e, t, r) {
const n = e("inherits"), i = e("bn.js"), s = e("../base/buffer").DecoderBuffer, o = e("../base/node"), a = e("../constants/der");
function l(e2) {
this.enc = "der", this.name = e2.name, this.entity = e2, this.tree = new c(), this.tree._init(e2.body);
}
function c(e2) {
o.call(this, "der", e2);
}
function u(e2, t2) {
let r2 = e2.readUInt8(t2);
if (e2.isError(r2)) return r2;
const n2 = a.tagClass[r2 >> 6], i2 = 0 == (32 & r2);
if (31 == (31 & r2)) {
let n3 = r2;
for (r2 = 0; 128 == (128 & n3); ) {
if (n3 = e2.readUInt8(t2), e2.isError(n3)) return n3;
r2 <<= 7, r2 |= 127 & n3;
}
} else r2 &= 31;
return { cls: n2, primitive: i2, tag: r2, tagStr: a.tag[r2] };
}
function h(e2, t2, r2) {
let n2 = e2.readUInt8(r2);
if (e2.isError(n2)) return n2;
if (!t2 && 128 === n2) return null;
if (0 == (128 & n2)) return n2;
const i2 = 127 & n2;
if (i2 > 4) return e2.error("length octect is too long");
n2 = 0;
for (let t3 = 0; t3 < i2; t3++) {
n2 <<= 8;
const t4 = e2.readUInt8(r2);
if (e2.isError(t4)) return t4;
n2 |= t4;
}
return n2;
}
t.exports = l, l.prototype.decode = function(e2, t2) {
return s.isDecoderBuffer(e2) || (e2 = new s(e2, t2)), this.tree._decode(e2, t2);
}, n(c, o), c.prototype._peekTag = function(e2, t2, r2) {
if (e2.isEmpty()) return false;
const n2 = e2.save(), i2 = u(e2, 'Failed to peek tag: "' + t2 + '"');
return e2.isError(i2) ? i2 : (e2.restore(n2), i2.tag === t2 || i2.tagStr === t2 || i2.tagStr + "of" === t2 || r2);
}, c.prototype._decodeTag = function(e2, t2, r2) {
const n2 = u(e2, 'Failed to decode tag of "' + t2 + '"');
if (e2.isError(n2)) return n2;
let i2 = h(e2, n2.primitive, 'Failed to get length of "' + t2 + '"');
if (e2.isError(i2)) return i2;
if (!r2 && n2.tag !== t2 && n2.tagStr !== t2 && n2.tagStr + "of" !== t2) return e2.error('Failed to match tag: "' + t2 + '"');
if (n2.primitive || null !== i2) return e2.skip(i2, 'Failed to match body of: "' + t2 + '"');
const s2 = e2.save(), o2 = this._skipUntilEnd(e2, 'Failed to skip indefinite length body: "' + this.tag + '"');
return e2.isError(o2) ? o2 : (i2 = e2.offset - s2.offset, e2.restore(s2), e2.skip(i2, 'Failed to match body of: "' + t2 + '"'));
}, c.prototype._skipUntilEnd = function(e2, t2) {
for (; ; ) {
const r2 = u(e2, t2);
if (e2.isError(r2)) return r2;
const n2 = h(e2, r2.primitive, t2);
if (e2.isError(n2)) return n2;
let i2;
if (i2 = r2.primitive || null !== n2 ? e2.skip(n2) : this._skipUntilEnd(e2, t2), e2.isError(i2)) return i2;
if ("end" === r2.tagStr) break;
}
}, c.prototype._decodeList = function(e2, t2, r2, n2) {
const i2 = [];
for (; !e2.isEmpty(); ) {
const t3 = this._peekTag(e2, "end");
if (e2.isError(t3)) return t3;
const s2 = r2.decode(e2, "der", n2);
if (e2.isError(s2) && t3) break;
i2.push(s2);
}
return i2;
}, c.prototype._decodeStr = function(e2, t2) {
if ("bitstr" === t2) {
const t3 = e2.readUInt8();
return e2.isError(t3) ? t3 : { unused: t3, data: e2.raw() };
}
if ("bmpstr" === t2) {
const t3 = e2.raw();
if (t3.length % 2 == 1) return e2.error("Decoding of string type: bmpstr length mismatch");
let r2 = "";
for (let e3 = 0; e3 < t3.length / 2; e3++) r2 += String.fromCharCode(t3.readUInt16BE(2 * e3));
return r2;
}
if ("numstr" === t2) {
const t3 = e2.raw().toString("ascii");
return this._isNumstr(t3) ? t3 : e2.error("Decoding of string type: numstr unsupported characters");
}
if ("octstr" === t2) return e2.raw();
if ("objDesc" === t2) return e2.raw();
if ("printstr" === t2) {
const t3 = e2.raw().toString("ascii");
return this._isPrintstr(t3) ? t3 : e2.error("Decoding of string type: printstr unsupported characters");
}
return /str$/.test(t2) ? e2.raw().toString() : e2.error("Decoding of string type: " + t2 + " unsupported");
}, c.prototype._decodeObjid = function(e2, t2, r2) {
let n2;
const i2 = [];
let s2 = 0, o2 = 0;
for (; !e2.isEmpty(); ) o2 = e2.readUInt8(), s2 <<= 7, s2 |= 127 & o2, 0 == (128 & o2) && (i2.push(s2), s2 = 0);
128 & o2 && i2.push(s2);
const a2 = i2[0] / 40 | 0, l2 = i2[0] % 40;
if (n2 = r2 ? i2 : [a2, l2].concat(i2.slice(1)), t2) {
let e3 = t2[n2.join(" ")];
void 0 === e3 && (e3 = t2[n2.join(".")]), void 0 !== e3 && (n2 = e3);
}
return n2;
}, c.prototype._decodeTime = function(e2, t2) {
const r2 = e2.raw().toString();
let n2, i2, s2, o2, a2, l2;
if ("gentime" === t2) n2 = 0 | r2.slice(0, 4), i2 = 0 | r2.slice(4, 6), s2 = 0 | r2.slice(6, 8), o2 = 0 | r2.slice(8, 10), a2 = 0 | r2.slice(10, 12), l2 = 0 | r2.slice(12, 14);
else {
if ("utctime" !== t2) return e2.error("Decoding " + t2 + " time is not supported yet");
n2 = 0 | r2.slice(0, 2), i2 = 0 | r2.slice(2, 4), s2 = 0 | r2.slice(4, 6), o2 = 0 | r2.slice(6, 8), a2 = 0 | r2.slice(8, 10), l2 = 0 | r2.slice(10, 12), n2 = n2 < 70 ? 2e3 + n2 : 1900 + n2;
}
return Date.UTC(n2, i2 - 1, s2, o2, a2, l2, 0);
}, c.prototype._decodeNull = function() {
return null;
}, c.prototype._decodeBool = function(e2) {
const t2 = e2.readUInt8();
return e2.isError(t2) ? t2 : 0 !== t2;
}, c.prototype._decodeInt = function(e2, t2) {
const r2 = e2.raw();
let n2 = new i(r2);
return t2 && (n2 = t2[n2.toString(10)] || n2), n2;
}, c.prototype._use = function(e2, t2) {
return "function" == typeof e2 && (e2 = e2(t2)), e2._getDecoder("der").tree;
};
}, { "../base/buffer": 172, "../base/node": 174, "../constants/der": 176, "bn.js": 184, inherits: 440 }], 179: [function(e, t, r) {
const n = r;
n.der = e("./der"), n.pem = e("./pem");
}, { "./der": 178, "./pem": 180 }], 180: [function(e, t, r) {
const n = e("inherits"), i = e("safer-buffer").Buffer, s = e("./der");
function o(e2) {
s.call(this, e2), this.enc = "pem";
}
n(o, s), t.exports = o, o.prototype.decode = function(e2, t2) {
const r2 = e2.toString().split(/[\r\n]+/g), n2 = t2.label.toUpperCase(), o2 = /^-----(BEGIN|END) ([^-]+)-----$/;
let a = -1, l = -1;
for (let e3 = 0; e3 < r2.length; e3++) {
const t3 = r2[e3].match(o2);
if (null !== t3 && t3[2] === n2) {
if (-1 !== a) {
if ("END" !== t3[1]) break;
l = e3;
break;
}
if ("BEGIN" !== t3[1]) break;
a = e3;
}
}
if (-1 === a || -1 === l) throw new Error("PEM section not found for: " + n2);
const c = r2.slice(a + 1, l).join("");
c.replace(/[^a-z0-9+/=]+/gi, "");
const u = i.from(c, "base64");
return s.prototype.decode.call(this, u, t2);
};
}, { "./der": 178, inherits: 440, "safer-buffer": 495 }], 181: [function(e, t, r) {
const n = e("inherits"), i = e("safer-buffer").Buffer, s = e("../base/node"), o = e("../constants/der");
function a(e2) {
this.enc = "der", this.name = e2.name, this.entity = e2, this.tree = new l(), this.tree._init(e2.body);
}
function l(e2) {
s.call(this, "der", e2);
}
function c(e2) {
return e2 < 10 ? "0" + e2 : e2;
}
t.exports = a, a.prototype.encode = function(e2, t2) {
return this.tree._encode(e2, t2).join();
}, n(l, s), l.prototype._encodeComposite = function(e2, t2, r2, n2) {
const s2 = (function(e3, t3, r3, n3) {
let i2;
"seqof" === e3 ? e3 = "seq" : "setof" === e3 && (e3 = "set");
if (o.tagByName.hasOwnProperty(e3)) i2 = o.tagByName[e3];
else {
if ("number" != typeof e3 || (0 | e3) !== e3) return n3.error("Unknown tag: " + e3);
i2 = e3;
}
if (i2 >= 31) return n3.error("Multi-octet tag encoding unsupported");
t3 || (i2 |= 32);
return i2 |= o.tagClassByName[r3 || "universal"] << 6, i2;
})(e2, t2, r2, this.reporter);
if (n2.length < 128) {
const e3 = i.alloc(2);
return e3[0] = s2, e3[1] = n2.length, this._createEncoderBuffer([e3, n2]);
}
let a2 = 1;
for (let e3 = n2.length; e3 >= 256; e3 >>= 8) a2++;
const l2 = i.alloc(2 + a2);
l2[0] = s2, l2[1] = 128 | a2;
for (let e3 = 1 + a2, t3 = n2.length; t3 > 0; e3--, t3 >>= 8) l2[e3] = 255 & t3;
return this._createEncoderBuffer([l2, n2]);
}, l.prototype._encodeStr = function(e2, t2) {
if ("bitstr" === t2) return this._createEncoderBuffer([0 | e2.unused, e2.data]);
if ("bmpstr" === t2) {
const t3 = i.alloc(2 * e2.length);
for (let r2 = 0; r2 < e2.length; r2++) t3.writeUInt16BE(e2.charCodeAt(r2), 2 * r2);
return this._createEncoderBuffer(t3);
}
return "numstr" === t2 ? this._isNumstr(e2) ? this._createEncoderBuffer(e2) : this.reporter.error("Encoding of string type: numstr supports only digits and space") : "printstr" === t2 ? this._isPrintstr(e2) ? this._createEncoderBuffer(e2) : this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark") : /str$/.test(t2) || "objDesc" === t2 ? this._createEncoderBuffer(e2) : this.reporter.error("Encoding of string type: " + t2 + " unsupported");
}, l.prototype._encodeObjid = function(e2, t2, r2) {
if ("string" == typeof e2) {
if (!t2) return this.reporter.error("string objid given, but no values map found");
if (!t2.hasOwnProperty(e2)) return this.reporter.error("objid not found in values map");
e2 = t2[e2].split(/[\s.]+/g);
for (let t3 = 0; t3 < e2.length; t3++) e2[t3] |= 0;
} else if (Array.isArray(e2)) {
e2 = e2.slice();
for (let t3 = 0; t3 < e2.length; t3++) e2[t3] |= 0;
}
if (!Array.isArray(e2)) return this.reporter.error("objid() should be either array or string, got: " + JSON.stringify(e2));
if (!r2) {
if (e2[1] >= 40) return this.reporter.error("Second objid identifier OOB");
e2.splice(0, 2, 40 * e2[0] + e2[1]);
}
let n2 = 0;
for (let t3 = 0; t3 < e2.length; t3++) {
let r3 = e2[t3];
for (n2++; r3 >= 128; r3 >>= 7) n2++;
}
const s2 = i.alloc(n2);
let o2 = s2.length - 1;
for (let t3 = e2.length - 1; t3 >= 0; t3--) {
let r3 = e2[t3];
for (s2[o2--] = 127 & r3; (r3 >>= 7) > 0; ) s2[o2--] = 128 | 127 & r3;
}
return this._createEncoderBuffer(s2);
}, l.prototype._encodeTime = function(e2, t2) {
let r2;
const n2 = new Date(e2);
return "gentime" === t2 ? r2 = [c(n2.getUTCFullYear()), c(n2.getUTCMonth() + 1), c(n2.getUTCDate()), c(n2.getUTCHours()), c(n2.getUTCMinutes()), c(n2.getUTCSeconds()), "Z"].join("") : "utctime" === t2 ? r2 = [c(n2.getUTCFullYear() % 100), c(n2.getUTCMonth() + 1), c(n2.getUTCDate()), c(n2.getUTCHours()), c(n2.getUTCMinutes()), c(n2.getUTCSeconds()), "Z"].join("") : this.reporter.error("Encoding " + t2 + " time is not supported yet"), this._encodeStr(r2, "octstr");
}, l.prototype._encodeNull = function() {
return this._createEncoderBuffer("");
}, l.prototype._encodeInt = function(e2, t2) {
if ("string" == typeof e2) {
if (!t2) return this.reporter.error("String int or enum given, but no values map");
if (!t2.hasOwnProperty(e2)) return this.reporter.error("Values map doesn't contain: " + JSON.stringify(e2));
e2 = t2[e2];
}
if ("number" != typeof e2 && !i.isBuffer(e2)) {
const t3 = e2.toArray();
!e2.sign && 128 & t3[0] && t3.unshift(0), e2 = i.from(t3);
}
if (i.isBuffer(e2)) {
let t3 = e2.length;
0 === e2.length && t3++;
const r3 = i.alloc(t3);
return e2.copy(r3), 0 === e2.length && (r3[0] = 0), this._createEncoderBuffer(r3);
}
if (e2 < 128) return this._createEncoderBuffer(e2);
if (e2 < 256) return this._createEncoderBuffer([0, e2]);
let r2 = 1;
for (let t3 = e2; t3 >= 256; t3 >>= 8) r2++;
const n2 = new Array(r2);
for (let t3 = n2.length - 1; t3 >= 0; t3--) n2[t3] = 255 & e2, e2 >>= 8;
return 128 & n2[0] && n2.unshift(0), this._createEncoderBuffer(i.from(n2));
}, l.prototype._encodeBool = function(e2) {
return this._createEncoderBuffer(e2 ? 255 : 0);
}, l.prototype._use = function(e2, t2) {
return "function" == typeof e2 && (e2 = e2(t2)), e2._getEncoder("der").tree;
}, l.prototype._skipDefault = function(e2, t2, r2) {
const n2 = this._baseState;
let i2;
if (null === n2.default) return false;
const s2 = e2.join();
if (void 0 === n2.defaultBuffer && (n2.defaultBuffer = this._encodeValue(n2.default, t2, r2).join()), s2.length !== n2.defaultBuffer.length) return false;
for (i2 = 0; i2 < s2.length; i2++) if (s2[i2] !== n2.defaultBuffer[i2]) return false;
return true;
};
}, { "../base/node": 174, "../constants/der": 176, inherits: 440, "safer-buffer": 495 }], 182: [function(e, t, r) {
const n = r;
n.der = e("./der"), n.pem = e("./pem");
}, { "./der": 181, "./pem": 183 }], 183: [function(e, t, r) {
const n = e("inherits"), i = e("./der");
function s(e2) {
i.call(this, e2), this.enc = "pem";
}
n(s, i), t.exports = s, s.prototype.encode = function(e2, t2) {
const r2 = i.prototype.encode.call(this, e2).toString("base64"), n2 = ["-----BEGIN " + t2.label + "-----"];
for (let e3 = 0; e3 < r2.length; e3 += 64) n2.push(r2.slice(e3, e3 + 64));
return n2.push("-----END " + t2.label + "-----"), n2.join("\n");
};
}, { "./der": 181, inherits: 440 }], 184: [function(e, t, r) {
!(function(t2, r2) {
function n(e2, t3) {
if (!e2) throw new Error(t3 || "Assertion failed");
}
function i(e2, t3) {
e2.super_ = t3;
var r3 = function() {
};
r3.prototype = t3.prototype, e2.prototype = new r3(), e2.prototype.constructor = e2;
}
function s(e2, t3, r3) {
if (s.isBN(e2)) return e2;
this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== e2 && ("le" !== t3 && "be" !== t3 || (r3 = t3, t3 = 10), this._init(e2 || 0, t3 || 10, r3 || "be"));
}
var o;
"object" == typeof t2 ? t2.exports = s : (void 0).BN = s, s.BN = s, s.wordSize = 26;
try {
o = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : e("buffer").Buffer;
} catch (e2) {
}
function a(e2, t3) {
var r3 = e2.charCodeAt(t3);
return r3 >= 65 && r3 <= 70 ? r3 - 55 : r3 >= 97 && r3 <= 102 ? r3 - 87 : r3 - 48 & 15;
}
function l(e2, t3, r3) {
var n2 = a(e2, r3);
return r3 - 1 >= t3 && (n2 |= a(e2, r3 - 1) << 4), n2;
}
function c(e2, t3, r3, n2) {
for (var i2 = 0, s2 = Math.min(e2.length, r3), o2 = t3; o2 < s2; o2++) {
var a2 = e2.charCodeAt(o2) - 48;
i2 *= n2, i2 += a2 >= 49 ? a2 - 49 + 10 : a2 >= 17 ? a2 - 17 + 10 : a2;
}
return i2;
}
s.isBN = function(e2) {
return e2 instanceof s || null !== e2 && "object" == typeof e2 && e2.constructor.wordSize === s.wordSize && Array.isArray(e2.words);
}, s.max = function(e2, t3) {
return e2.cmp(t3) > 0 ? e2 : t3;
}, s.min = function(e2, t3) {
return e2.cmp(t3) < 0 ? e2 : t3;
}, s.prototype._init = function(e2, t3, r3) {
if ("number" == typeof e2) return this._initNumber(e2, t3, r3);
if ("object" == typeof e2) return this._initArray(e2, t3, r3);
"hex" === t3 && (t3 = 16), n(t3 === (0 | t3) && t3 >= 2 && t3 <= 36);
var i2 = 0;
"-" === (e2 = e2.toString().replace(/\s+/g, ""))[0] && (i2++, this.negative = 1), i2 < e2.length && (16 === t3 ? this._parseHex(e2, i2, r3) : (this._parseBase(e2, t3, i2), "le" === r3 && this._initArray(this.toArray(), t3, r3)));
}, s.prototype._initNumber = function(e2, t3, r3) {
e2 < 0 && (this.negative = 1, e2 = -e2), e2 < 67108864 ? (this.words = [67108863 & e2], this.length = 1) : e2 < 4503599627370496 ? (this.words = [67108863 & e2, e2 / 67108864 & 67108863], this.length = 2) : (n(e2 < 9007199254740992), this.words = [67108863 & e2, e2 / 67108864 & 67108863, 1], this.length = 3), "le" === r3 && this._initArray(this.toArray(), t3, r3);
}, s.prototype._initArray = function(e2, t3, r3) {
if (n("number" == typeof e2.length), e2.length <= 0) return this.words = [0], this.length = 1, this;
this.length = Math.ceil(e2.length / 3), this.words = new Array(this.length);
for (var i2 = 0; i2 < this.length; i2++) this.words[i2] = 0;
var s2, o2, a2 = 0;
if ("be" === r3) for (i2 = e2.length - 1, s2 = 0; i2 >= 0; i2 -= 3) o2 = e2[i2] | e2[i2 - 1] << 8 | e2[i2 - 2] << 16, this.words[s2] |= o2 << a2 & 67108863, this.words[s2 + 1] = o2 >>> 26 - a2 & 67108863, (a2 += 24) >= 26 && (a2 -= 26, s2++);
else if ("le" === r3) for (i2 = 0, s2 = 0; i2 < e2.length; i2 += 3) o2 = e2[i2] | e2[i2 + 1] << 8 | e2[i2 + 2] << 16, this.words[s2] |= o2 << a2 & 67108863, this.words[s2 + 1] = o2 >>> 26 - a2 & 67108863, (a2 += 24) >= 26 && (a2 -= 26, s2++);
return this.strip();
}, s.prototype._parseHex = function(e2, t3, r3) {
this.length = Math.ceil((e2.length - t3) / 6), this.words = new Array(this.length);
for (var n2 = 0; n2 < this.length; n2++) this.words[n2] = 0;
var i2, s2 = 0, o2 = 0;
if ("be" === r3) for (n2 = e2.length - 1; n2 >= t3; n2 -= 2) i2 = l(e2, t3, n2) << s2, this.words[o2] |= 67108863 & i2, s2 >= 18 ? (s2 -= 18, o2 += 1, this.words[o2] |= i2 >>> 26) : s2 += 8;
else for (n2 = (e2.length - t3) % 2 == 0 ? t3 + 1 : t3; n2 < e2.length; n2 += 2) i2 = l(e2, t3, n2) << s2, this.words[o2] |= 67108863 & i2, s2 >= 18 ? (s2 -= 18, o2 += 1, this.words[o2] |= i2 >>> 26) : s2 += 8;
this.strip();
}, s.prototype._parseBase = function(e2, t3, r3) {
this.words = [0], this.length = 1;
for (var n2 = 0, i2 = 1; i2 <= 67108863; i2 *= t3) n2++;
n2--, i2 = i2 / t3 | 0;
for (var s2 = e2.length - r3, o2 = s2 % n2, a2 = Math.min(s2, s2 - o2) + r3, l2 = 0, u2 = r3; u2 < a2; u2 += n2) l2 = c(e2, u2, u2 + n2, t3), this.imuln(i2), this.words[0] + l2 < 67108864 ? this.words[0] += l2 : this._iaddn(l2);
if (0 !== o2) {
var h2 = 1;
for (l2 = c(e2, u2, e2.length, t3), u2 = 0; u2 < o2; u2++) h2 *= t3;
this.imuln(h2), this.words[0] + l2 < 67108864 ? this.words[0] += l2 : this._iaddn(l2);
}
this.strip();
}, s.prototype.copy = function(e2) {
e2.words = new Array(this.length);
for (var t3 = 0; t3 < this.length; t3++) e2.words[t3] = this.words[t3];
e2.length = this.length, e2.negative = this.negative, e2.red = this.red;
}, s.prototype.clone = function() {
var e2 = new s(null);
return this.copy(e2), e2;
}, s.prototype._expand = function(e2) {
for (; this.length < e2; ) this.words[this.length++] = 0;
return this;
}, s.prototype.strip = function() {
for (; this.length > 1 && 0 === this.words[this.length - 1]; ) this.length--;
return this._normSign();
}, s.prototype._normSign = function() {
return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this;
}, s.prototype.inspect = function() {
return (this.red ? "";
};
var u = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"], h = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], f = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176];
function d(e2, t3, r3) {
r3.negative = t3.negative ^ e2.negative;
var n2 = e2.length + t3.length | 0;
r3.length = n2, n2 = n2 - 1 | 0;
var i2 = 0 | e2.words[0], s2 = 0 | t3.words[0], o2 = i2 * s2, a2 = 67108863 & o2, l2 = o2 / 67108864 | 0;
r3.words[0] = a2;
for (var c2 = 1; c2 < n2; c2++) {
for (var u2 = l2 >>> 26, h2 = 67108863 & l2, f2 = Math.min(c2, t3.length - 1), d2 = Math.max(0, c2 - e2.length + 1); d2 <= f2; d2++) {
var p2 = c2 - d2 | 0;
u2 += (o2 = (i2 = 0 | e2.words[p2]) * (s2 = 0 | t3.words[d2]) + h2) / 67108864 | 0, h2 = 67108863 & o2;
}
r3.words[c2] = 0 | h2, l2 = 0 | u2;
}
return 0 !== l2 ? r3.words[c2] = 0 | l2 : r3.length--, r3.strip();
}
s.prototype.toString = function(e2, t3) {
var r3;
if (t3 = 0 | t3 || 1, 16 === (e2 = e2 || 10) || "hex" === e2) {
r3 = "";
for (var i2 = 0, s2 = 0, o2 = 0; o2 < this.length; o2++) {
var a2 = this.words[o2], l2 = (16777215 & (a2 << i2 | s2)).toString(16);
r3 = 0 !== (s2 = a2 >>> 24 - i2 & 16777215) || o2 !== this.length - 1 ? u[6 - l2.length] + l2 + r3 : l2 + r3, (i2 += 2) >= 26 && (i2 -= 26, o2--);
}
for (0 !== s2 && (r3 = s2.toString(16) + r3); r3.length % t3 != 0; ) r3 = "0" + r3;
return 0 !== this.negative && (r3 = "-" + r3), r3;
}
if (e2 === (0 | e2) && e2 >= 2 && e2 <= 36) {
var c2 = h[e2], d2 = f[e2];
r3 = "";
var p2 = this.clone();
for (p2.negative = 0; !p2.isZero(); ) {
var m2 = p2.modn(d2).toString(e2);
r3 = (p2 = p2.idivn(d2)).isZero() ? m2 + r3 : u[c2 - m2.length] + m2 + r3;
}
for (this.isZero() && (r3 = "0" + r3); r3.length % t3 != 0; ) r3 = "0" + r3;
return 0 !== this.negative && (r3 = "-" + r3), r3;
}
n(false, "Base should be between 2 and 36");
}, s.prototype.toNumber = function() {
var e2 = this.words[0];
return 2 === this.length ? e2 += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? e2 += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && n(false, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -e2 : e2;
}, s.prototype.toJSON = function() {
return this.toString(16);
}, s.prototype.toBuffer = function(e2, t3) {
return n(void 0 !== o), this.toArrayLike(o, e2, t3);
}, s.prototype.toArray = function(e2, t3) {
return this.toArrayLike(Array, e2, t3);
}, s.prototype.toArrayLike = function(e2, t3, r3) {
var i2 = this.byteLength(), s2 = r3 || Math.max(1, i2);
n(i2 <= s2, "byte array longer than desired length"), n(s2 > 0, "Requested array length <= 0"), this.strip();
var o2, a2, l2 = "le" === t3, c2 = new e2(s2), u2 = this.clone();
if (l2) {
for (a2 = 0; !u2.isZero(); a2++) o2 = u2.andln(255), u2.iushrn(8), c2[a2] = o2;
for (; a2 < s2; a2++) c2[a2] = 0;
} else {
for (a2 = 0; a2 < s2 - i2; a2++) c2[a2] = 0;
for (a2 = 0; !u2.isZero(); a2++) o2 = u2.andln(255), u2.iushrn(8), c2[s2 - a2 - 1] = o2;
}
return c2;
}, Math.clz32 ? s.prototype._countBits = function(e2) {
return 32 - Math.clz32(e2);
} : s.prototype._countBits = function(e2) {
var t3 = e2, r3 = 0;
return t3 >= 4096 && (r3 += 13, t3 >>>= 13), t3 >= 64 && (r3 += 7, t3 >>>= 7), t3 >= 8 && (r3 += 4, t3 >>>= 4), t3 >= 2 && (r3 += 2, t3 >>>= 2), r3 + t3;
}, s.prototype._zeroBits = function(e2) {
if (0 === e2) return 26;
var t3 = e2, r3 = 0;
return 0 == (8191 & t3) && (r3 += 13, t3 >>>= 13), 0 == (127 & t3) && (r3 += 7, t3 >>>= 7), 0 == (15 & t3) && (r3 += 4, t3 >>>= 4), 0 == (3 & t3) && (r3 += 2, t3 >>>= 2), 0 == (1 & t3) && r3++, r3;
}, s.prototype.bitLength = function() {
var e2 = this.words[this.length - 1], t3 = this._countBits(e2);
return 26 * (this.length - 1) + t3;
}, s.prototype.zeroBits = function() {
if (this.isZero()) return 0;
for (var e2 = 0, t3 = 0; t3 < this.length; t3++) {
var r3 = this._zeroBits(this.words[t3]);
if (e2 += r3, 26 !== r3) break;
}
return e2;
}, s.prototype.byteLength = function() {
return Math.ceil(this.bitLength() / 8);
}, s.prototype.toTwos = function(e2) {
return 0 !== this.negative ? this.abs().inotn(e2).iaddn(1) : this.clone();
}, s.prototype.fromTwos = function(e2) {
return this.testn(e2 - 1) ? this.notn(e2).iaddn(1).ineg() : this.clone();
}, s.prototype.isNeg = function() {
return 0 !== this.negative;
}, s.prototype.neg = function() {
return this.clone().ineg();
}, s.prototype.ineg = function() {
return this.isZero() || (this.negative ^= 1), this;
}, s.prototype.iuor = function(e2) {
for (; this.length < e2.length; ) this.words[this.length++] = 0;
for (var t3 = 0; t3 < e2.length; t3++) this.words[t3] = this.words[t3] | e2.words[t3];
return this.strip();
}, s.prototype.ior = function(e2) {
return n(0 == (this.negative | e2.negative)), this.iuor(e2);
}, s.prototype.or = function(e2) {
return this.length > e2.length ? this.clone().ior(e2) : e2.clone().ior(this);
}, s.prototype.uor = function(e2) {
return this.length > e2.length ? this.clone().iuor(e2) : e2.clone().iuor(this);
}, s.prototype.iuand = function(e2) {
var t3;
t3 = this.length > e2.length ? e2 : this;
for (var r3 = 0; r3 < t3.length; r3++) this.words[r3] = this.words[r3] & e2.words[r3];
return this.length = t3.length, this.strip();
}, s.prototype.iand = function(e2) {
return n(0 == (this.negative | e2.negative)), this.iuand(e2);
}, s.prototype.and = function(e2) {
return this.length > e2.length ? this.clone().iand(e2) : e2.clone().iand(this);
}, s.prototype.uand = function(e2) {
return this.length > e2.length ? this.clone().iuand(e2) : e2.clone().iuand(this);
}, s.prototype.iuxor = function(e2) {
var t3, r3;
this.length > e2.length ? (t3 = this, r3 = e2) : (t3 = e2, r3 = this);
for (var n2 = 0; n2 < r3.length; n2++) this.words[n2] = t3.words[n2] ^ r3.words[n2];
if (this !== t3) for (; n2 < t3.length; n2++) this.words[n2] = t3.words[n2];
return this.length = t3.length, this.strip();
}, s.prototype.ixor = function(e2) {
return n(0 == (this.negative | e2.negative)), this.iuxor(e2);
}, s.prototype.xor = function(e2) {
return this.length > e2.length ? this.clone().ixor(e2) : e2.clone().ixor(this);
}, s.prototype.uxor = function(e2) {
return this.length > e2.length ? this.clone().iuxor(e2) : e2.clone().iuxor(this);
}, s.prototype.inotn = function(e2) {
n("number" == typeof e2 && e2 >= 0);
var t3 = 0 | Math.ceil(e2 / 26), r3 = e2 % 26;
this._expand(t3), r3 > 0 && t3--;
for (var i2 = 0; i2 < t3; i2++) this.words[i2] = 67108863 & ~this.words[i2];
return r3 > 0 && (this.words[i2] = ~this.words[i2] & 67108863 >> 26 - r3), this.strip();
}, s.prototype.notn = function(e2) {
return this.clone().inotn(e2);
}, s.prototype.setn = function(e2, t3) {
n("number" == typeof e2 && e2 >= 0);
var r3 = e2 / 26 | 0, i2 = e2 % 26;
return this._expand(r3 + 1), this.words[r3] = t3 ? this.words[r3] | 1 << i2 : this.words[r3] & ~(1 << i2), this.strip();
}, s.prototype.iadd = function(e2) {
var t3, r3, n2;
if (0 !== this.negative && 0 === e2.negative) return this.negative = 0, t3 = this.isub(e2), this.negative ^= 1, this._normSign();
if (0 === this.negative && 0 !== e2.negative) return e2.negative = 0, t3 = this.isub(e2), e2.negative = 1, t3._normSign();
this.length > e2.length ? (r3 = this, n2 = e2) : (r3 = e2, n2 = this);
for (var i2 = 0, s2 = 0; s2 < n2.length; s2++) t3 = (0 | r3.words[s2]) + (0 | n2.words[s2]) + i2, this.words[s2] = 67108863 & t3, i2 = t3 >>> 26;
for (; 0 !== i2 && s2 < r3.length; s2++) t3 = (0 | r3.words[s2]) + i2, this.words[s2] = 67108863 & t3, i2 = t3 >>> 26;
if (this.length = r3.length, 0 !== i2) this.words[this.length] = i2, this.length++;
else if (r3 !== this) for (; s2 < r3.length; s2++) this.words[s2] = r3.words[s2];
return this;
}, s.prototype.add = function(e2) {
var t3;
return 0 !== e2.negative && 0 === this.negative ? (e2.negative = 0, t3 = this.sub(e2), e2.negative ^= 1, t3) : 0 === e2.negative && 0 !== this.negative ? (this.negative = 0, t3 = e2.sub(this), this.negative = 1, t3) : this.length > e2.length ? this.clone().iadd(e2) : e2.clone().iadd(this);
}, s.prototype.isub = function(e2) {
if (0 !== e2.negative) {
e2.negative = 0;
var t3 = this.iadd(e2);
return e2.negative = 1, t3._normSign();
}
if (0 !== this.negative) return this.negative = 0, this.iadd(e2), this.negative = 1, this._normSign();
var r3, n2, i2 = this.cmp(e2);
if (0 === i2) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
i2 > 0 ? (r3 = this, n2 = e2) : (r3 = e2, n2 = this);
for (var s2 = 0, o2 = 0; o2 < n2.length; o2++) s2 = (t3 = (0 | r3.words[o2]) - (0 | n2.words[o2]) + s2) >> 26, this.words[o2] = 67108863 & t3;
for (; 0 !== s2 && o2 < r3.length; o2++) s2 = (t3 = (0 | r3.words[o2]) + s2) >> 26, this.words[o2] = 67108863 & t3;
if (0 === s2 && o2 < r3.length && r3 !== this) for (; o2 < r3.length; o2++) this.words[o2] = r3.words[o2];
return this.length = Math.max(this.length, o2), r3 !== this && (this.negative = 1), this.strip();
}, s.prototype.sub = function(e2) {
return this.clone().isub(e2);
};
var p = function(e2, t3, r3) {
var n2, i2, s2, o2 = e2.words, a2 = t3.words, l2 = r3.words, c2 = 0, u2 = 0 | o2[0], h2 = 8191 & u2, f2 = u2 >>> 13, d2 = 0 | o2[1], p2 = 8191 & d2, m2 = d2 >>> 13, b2 = 0 | o2[2], g2 = 8191 & b2, y2 = b2 >>> 13, v2 = 0 | o2[3], w2 = 8191 & v2, _2 = v2 >>> 13, x2 = 0 | o2[4], k2 = 8191 & x2, S2 = x2 >>> 13, M = 0 | o2[5], C = 8191 & M, T = M >>> 13, E = 0 | o2[6], A = 8191 & E, R = E >>> 13, O = 0 | o2[7], j = 8191 & O, I = O >>> 13, N = 0 | o2[8], P = 8191 & N, B = N >>> 13, D = 0 | o2[9], F = 8191 & D, L = D >>> 13, z = 0 | a2[0], U = 8191 & z, $ = z >>> 13, H = 0 | a2[1], V = 8191 & H, q = H >>> 13, W = 0 | a2[2], X = 8191 & W, K = W >>> 13, Y = 0 | a2[3], Z = 8191 & Y, G = Y >>> 13, J = 0 | a2[4], Q = 8191 & J, ee = J >>> 13, te = 0 | a2[5], re = 8191 & te, ne = te >>> 13, ie = 0 | a2[6], se = 8191 & ie, oe = ie >>> 13, ae = 0 | a2[7], le = 8191 & ae, ce = ae >>> 13, ue = 0 | a2[8], he = 8191 & ue, fe = ue >>> 13, de = 0 | a2[9], pe = 8191 & de, me = de >>> 13;
r3.negative = e2.negative ^ t3.negative, r3.length = 19;
var be = (c2 + (n2 = Math.imul(h2, U)) | 0) + ((8191 & (i2 = (i2 = Math.imul(h2, $)) + Math.imul(f2, U) | 0)) << 13) | 0;
c2 = ((s2 = Math.imul(f2, $)) + (i2 >>> 13) | 0) + (be >>> 26) | 0, be &= 67108863, n2 = Math.imul(p2, U), i2 = (i2 = Math.imul(p2, $)) + Math.imul(m2, U) | 0, s2 = Math.imul(m2, $);
var ge = (c2 + (n2 = n2 + Math.imul(h2, V) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, q) | 0) + Math.imul(f2, V) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, q) | 0) + (i2 >>> 13) | 0) + (ge >>> 26) | 0, ge &= 67108863, n2 = Math.imul(g2, U), i2 = (i2 = Math.imul(g2, $)) + Math.imul(y2, U) | 0, s2 = Math.imul(y2, $), n2 = n2 + Math.imul(p2, V) | 0, i2 = (i2 = i2 + Math.imul(p2, q) | 0) + Math.imul(m2, V) | 0, s2 = s2 + Math.imul(m2, q) | 0;
var ye = (c2 + (n2 = n2 + Math.imul(h2, X) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, K) | 0) + Math.imul(f2, X) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, K) | 0) + (i2 >>> 13) | 0) + (ye >>> 26) | 0, ye &= 67108863, n2 = Math.imul(w2, U), i2 = (i2 = Math.imul(w2, $)) + Math.imul(_2, U) | 0, s2 = Math.imul(_2, $), n2 = n2 + Math.imul(g2, V) | 0, i2 = (i2 = i2 + Math.imul(g2, q) | 0) + Math.imul(y2, V) | 0, s2 = s2 + Math.imul(y2, q) | 0, n2 = n2 + Math.imul(p2, X) | 0, i2 = (i2 = i2 + Math.imul(p2, K) | 0) + Math.imul(m2, X) | 0, s2 = s2 + Math.imul(m2, K) | 0;
var ve = (c2 + (n2 = n2 + Math.imul(h2, Z) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, G) | 0) + Math.imul(f2, Z) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, G) | 0) + (i2 >>> 13) | 0) + (ve >>> 26) | 0, ve &= 67108863, n2 = Math.imul(k2, U), i2 = (i2 = Math.imul(k2, $)) + Math.imul(S2, U) | 0, s2 = Math.imul(S2, $), n2 = n2 + Math.imul(w2, V) | 0, i2 = (i2 = i2 + Math.imul(w2, q) | 0) + Math.imul(_2, V) | 0, s2 = s2 + Math.imul(_2, q) | 0, n2 = n2 + Math.imul(g2, X) | 0, i2 = (i2 = i2 + Math.imul(g2, K) | 0) + Math.imul(y2, X) | 0, s2 = s2 + Math.imul(y2, K) | 0, n2 = n2 + Math.imul(p2, Z) | 0, i2 = (i2 = i2 + Math.imul(p2, G) | 0) + Math.imul(m2, Z) | 0, s2 = s2 + Math.imul(m2, G) | 0;
var we = (c2 + (n2 = n2 + Math.imul(h2, Q) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, ee) | 0) + Math.imul(f2, Q) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, ee) | 0) + (i2 >>> 13) | 0) + (we >>> 26) | 0, we &= 67108863, n2 = Math.imul(C, U), i2 = (i2 = Math.imul(C, $)) + Math.imul(T, U) | 0, s2 = Math.imul(T, $), n2 = n2 + Math.imul(k2, V) | 0, i2 = (i2 = i2 + Math.imul(k2, q) | 0) + Math.imul(S2, V) | 0, s2 = s2 + Math.imul(S2, q) | 0, n2 = n2 + Math.imul(w2, X) | 0, i2 = (i2 = i2 + Math.imul(w2, K) | 0) + Math.imul(_2, X) | 0, s2 = s2 + Math.imul(_2, K) | 0, n2 = n2 + Math.imul(g2, Z) | 0, i2 = (i2 = i2 + Math.imul(g2, G) | 0) + Math.imul(y2, Z) | 0, s2 = s2 + Math.imul(y2, G) | 0, n2 = n2 + Math.imul(p2, Q) | 0, i2 = (i2 = i2 + Math.imul(p2, ee) | 0) + Math.imul(m2, Q) | 0, s2 = s2 + Math.imul(m2, ee) | 0;
var _e = (c2 + (n2 = n2 + Math.imul(h2, re) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, ne) | 0) + Math.imul(f2, re) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, ne) | 0) + (i2 >>> 13) | 0) + (_e >>> 26) | 0, _e &= 67108863, n2 = Math.imul(A, U), i2 = (i2 = Math.imul(A, $)) + Math.imul(R, U) | 0, s2 = Math.imul(R, $), n2 = n2 + Math.imul(C, V) | 0, i2 = (i2 = i2 + Math.imul(C, q) | 0) + Math.imul(T, V) | 0, s2 = s2 + Math.imul(T, q) | 0, n2 = n2 + Math.imul(k2, X) | 0, i2 = (i2 = i2 + Math.imul(k2, K) | 0) + Math.imul(S2, X) | 0, s2 = s2 + Math.imul(S2, K) | 0, n2 = n2 + Math.imul(w2, Z) | 0, i2 = (i2 = i2 + Math.imul(w2, G) | 0) + Math.imul(_2, Z) | 0, s2 = s2 + Math.imul(_2, G) | 0, n2 = n2 + Math.imul(g2, Q) | 0, i2 = (i2 = i2 + Math.imul(g2, ee) | 0) + Math.imul(y2, Q) | 0, s2 = s2 + Math.imul(y2, ee) | 0, n2 = n2 + Math.imul(p2, re) | 0, i2 = (i2 = i2 + Math.imul(p2, ne) | 0) + Math.imul(m2, re) | 0, s2 = s2 + Math.imul(m2, ne) | 0;
var xe = (c2 + (n2 = n2 + Math.imul(h2, se) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, oe) | 0) + Math.imul(f2, se) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, oe) | 0) + (i2 >>> 13) | 0) + (xe >>> 26) | 0, xe &= 67108863, n2 = Math.imul(j, U), i2 = (i2 = Math.imul(j, $)) + Math.imul(I, U) | 0, s2 = Math.imul(I, $), n2 = n2 + Math.imul(A, V) | 0, i2 = (i2 = i2 + Math.imul(A, q) | 0) + Math.imul(R, V) | 0, s2 = s2 + Math.imul(R, q) | 0, n2 = n2 + Math.imul(C, X) | 0, i2 = (i2 = i2 + Math.imul(C, K) | 0) + Math.imul(T, X) | 0, s2 = s2 + Math.imul(T, K) | 0, n2 = n2 + Math.imul(k2, Z) | 0, i2 = (i2 = i2 + Math.imul(k2, G) | 0) + Math.imul(S2, Z) | 0, s2 = s2 + Math.imul(S2, G) | 0, n2 = n2 + Math.imul(w2, Q) | 0, i2 = (i2 = i2 + Math.imul(w2, ee) | 0) + Math.imul(_2, Q) | 0, s2 = s2 + Math.imul(_2, ee) | 0, n2 = n2 + Math.imul(g2, re) | 0, i2 = (i2 = i2 + Math.imul(g2, ne) | 0) + Math.imul(y2, re) | 0, s2 = s2 + Math.imul(y2, ne) | 0, n2 = n2 + Math.imul(p2, se) | 0, i2 = (i2 = i2 + Math.imul(p2, oe) | 0) + Math.imul(m2, se) | 0, s2 = s2 + Math.imul(m2, oe) | 0;
var ke = (c2 + (n2 = n2 + Math.imul(h2, le) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, ce) | 0) + Math.imul(f2, le) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, ce) | 0) + (i2 >>> 13) | 0) + (ke >>> 26) | 0, ke &= 67108863, n2 = Math.imul(P, U), i2 = (i2 = Math.imul(P, $)) + Math.imul(B, U) | 0, s2 = Math.imul(B, $), n2 = n2 + Math.imul(j, V) | 0, i2 = (i2 = i2 + Math.imul(j, q) | 0) + Math.imul(I, V) | 0, s2 = s2 + Math.imul(I, q) | 0, n2 = n2 + Math.imul(A, X) | 0, i2 = (i2 = i2 + Math.imul(A, K) | 0) + Math.imul(R, X) | 0, s2 = s2 + Math.imul(R, K) | 0, n2 = n2 + Math.imul(C, Z) | 0, i2 = (i2 = i2 + Math.imul(C, G) | 0) + Math.imul(T, Z) | 0, s2 = s2 + Math.imul(T, G) | 0, n2 = n2 + Math.imul(k2, Q) | 0, i2 = (i2 = i2 + Math.imul(k2, ee) | 0) + Math.imul(S2, Q) | 0, s2 = s2 + Math.imul(S2, ee) | 0, n2 = n2 + Math.imul(w2, re) | 0, i2 = (i2 = i2 + Math.imul(w2, ne) | 0) + Math.imul(_2, re) | 0, s2 = s2 + Math.imul(_2, ne) | 0, n2 = n2 + Math.imul(g2, se) | 0, i2 = (i2 = i2 + Math.imul(g2, oe) | 0) + Math.imul(y2, se) | 0, s2 = s2 + Math.imul(y2, oe) | 0, n2 = n2 + Math.imul(p2, le) | 0, i2 = (i2 = i2 + Math.imul(p2, ce) | 0) + Math.imul(m2, le) | 0, s2 = s2 + Math.imul(m2, ce) | 0;
var Se = (c2 + (n2 = n2 + Math.imul(h2, he) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, fe) | 0) + Math.imul(f2, he) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, fe) | 0) + (i2 >>> 13) | 0) + (Se >>> 26) | 0, Se &= 67108863, n2 = Math.imul(F, U), i2 = (i2 = Math.imul(F, $)) + Math.imul(L, U) | 0, s2 = Math.imul(L, $), n2 = n2 + Math.imul(P, V) | 0, i2 = (i2 = i2 + Math.imul(P, q) | 0) + Math.imul(B, V) | 0, s2 = s2 + Math.imul(B, q) | 0, n2 = n2 + Math.imul(j, X) | 0, i2 = (i2 = i2 + Math.imul(j, K) | 0) + Math.imul(I, X) | 0, s2 = s2 + Math.imul(I, K) | 0, n2 = n2 + Math.imul(A, Z) | 0, i2 = (i2 = i2 + Math.imul(A, G) | 0) + Math.imul(R, Z) | 0, s2 = s2 + Math.imul(R, G) | 0, n2 = n2 + Math.imul(C, Q) | 0, i2 = (i2 = i2 + Math.imul(C, ee) | 0) + Math.imul(T, Q) | 0, s2 = s2 + Math.imul(T, ee) | 0, n2 = n2 + Math.imul(k2, re) | 0, i2 = (i2 = i2 + Math.imul(k2, ne) | 0) + Math.imul(S2, re) | 0, s2 = s2 + Math.imul(S2, ne) | 0, n2 = n2 + Math.imul(w2, se) | 0, i2 = (i2 = i2 + Math.imul(w2, oe) | 0) + Math.imul(_2, se) | 0, s2 = s2 + Math.imul(_2, oe) | 0, n2 = n2 + Math.imul(g2, le) | 0, i2 = (i2 = i2 + Math.imul(g2, ce) | 0) + Math.imul(y2, le) | 0, s2 = s2 + Math.imul(y2, ce) | 0, n2 = n2 + Math.imul(p2, he) | 0, i2 = (i2 = i2 + Math.imul(p2, fe) | 0) + Math.imul(m2, he) | 0, s2 = s2 + Math.imul(m2, fe) | 0;
var Me = (c2 + (n2 = n2 + Math.imul(h2, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, me) | 0) + Math.imul(f2, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, me) | 0) + (i2 >>> 13) | 0) + (Me >>> 26) | 0, Me &= 67108863, n2 = Math.imul(F, V), i2 = (i2 = Math.imul(F, q)) + Math.imul(L, V) | 0, s2 = Math.imul(L, q), n2 = n2 + Math.imul(P, X) | 0, i2 = (i2 = i2 + Math.imul(P, K) | 0) + Math.imul(B, X) | 0, s2 = s2 + Math.imul(B, K) | 0, n2 = n2 + Math.imul(j, Z) | 0, i2 = (i2 = i2 + Math.imul(j, G) | 0) + Math.imul(I, Z) | 0, s2 = s2 + Math.imul(I, G) | 0, n2 = n2 + Math.imul(A, Q) | 0, i2 = (i2 = i2 + Math.imul(A, ee) | 0) + Math.imul(R, Q) | 0, s2 = s2 + Math.imul(R, ee) | 0, n2 = n2 + Math.imul(C, re) | 0, i2 = (i2 = i2 + Math.imul(C, ne) | 0) + Math.imul(T, re) | 0, s2 = s2 + Math.imul(T, ne) | 0, n2 = n2 + Math.imul(k2, se) | 0, i2 = (i2 = i2 + Math.imul(k2, oe) | 0) + Math.imul(S2, se) | 0, s2 = s2 + Math.imul(S2, oe) | 0, n2 = n2 + Math.imul(w2, le) | 0, i2 = (i2 = i2 + Math.imul(w2, ce) | 0) + Math.imul(_2, le) | 0, s2 = s2 + Math.imul(_2, ce) | 0, n2 = n2 + Math.imul(g2, he) | 0, i2 = (i2 = i2 + Math.imul(g2, fe) | 0) + Math.imul(y2, he) | 0, s2 = s2 + Math.imul(y2, fe) | 0;
var Ce = (c2 + (n2 = n2 + Math.imul(p2, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(p2, me) | 0) + Math.imul(m2, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(m2, me) | 0) + (i2 >>> 13) | 0) + (Ce >>> 26) | 0, Ce &= 67108863, n2 = Math.imul(F, X), i2 = (i2 = Math.imul(F, K)) + Math.imul(L, X) | 0, s2 = Math.imul(L, K), n2 = n2 + Math.imul(P, Z) | 0, i2 = (i2 = i2 + Math.imul(P, G) | 0) + Math.imul(B, Z) | 0, s2 = s2 + Math.imul(B, G) | 0, n2 = n2 + Math.imul(j, Q) | 0, i2 = (i2 = i2 + Math.imul(j, ee) | 0) + Math.imul(I, Q) | 0, s2 = s2 + Math.imul(I, ee) | 0, n2 = n2 + Math.imul(A, re) | 0, i2 = (i2 = i2 + Math.imul(A, ne) | 0) + Math.imul(R, re) | 0, s2 = s2 + Math.imul(R, ne) | 0, n2 = n2 + Math.imul(C, se) | 0, i2 = (i2 = i2 + Math.imul(C, oe) | 0) + Math.imul(T, se) | 0, s2 = s2 + Math.imul(T, oe) | 0, n2 = n2 + Math.imul(k2, le) | 0, i2 = (i2 = i2 + Math.imul(k2, ce) | 0) + Math.imul(S2, le) | 0, s2 = s2 + Math.imul(S2, ce) | 0, n2 = n2 + Math.imul(w2, he) | 0, i2 = (i2 = i2 + Math.imul(w2, fe) | 0) + Math.imul(_2, he) | 0, s2 = s2 + Math.imul(_2, fe) | 0;
var Te = (c2 + (n2 = n2 + Math.imul(g2, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(g2, me) | 0) + Math.imul(y2, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(y2, me) | 0) + (i2 >>> 13) | 0) + (Te >>> 26) | 0, Te &= 67108863, n2 = Math.imul(F, Z), i2 = (i2 = Math.imul(F, G)) + Math.imul(L, Z) | 0, s2 = Math.imul(L, G), n2 = n2 + Math.imul(P, Q) | 0, i2 = (i2 = i2 + Math.imul(P, ee) | 0) + Math.imul(B, Q) | 0, s2 = s2 + Math.imul(B, ee) | 0, n2 = n2 + Math.imul(j, re) | 0, i2 = (i2 = i2 + Math.imul(j, ne) | 0) + Math.imul(I, re) | 0, s2 = s2 + Math.imul(I, ne) | 0, n2 = n2 + Math.imul(A, se) | 0, i2 = (i2 = i2 + Math.imul(A, oe) | 0) + Math.imul(R, se) | 0, s2 = s2 + Math.imul(R, oe) | 0, n2 = n2 + Math.imul(C, le) | 0, i2 = (i2 = i2 + Math.imul(C, ce) | 0) + Math.imul(T, le) | 0, s2 = s2 + Math.imul(T, ce) | 0, n2 = n2 + Math.imul(k2, he) | 0, i2 = (i2 = i2 + Math.imul(k2, fe) | 0) + Math.imul(S2, he) | 0, s2 = s2 + Math.imul(S2, fe) | 0;
var Ee = (c2 + (n2 = n2 + Math.imul(w2, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(w2, me) | 0) + Math.imul(_2, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(_2, me) | 0) + (i2 >>> 13) | 0) + (Ee >>> 26) | 0, Ee &= 67108863, n2 = Math.imul(F, Q), i2 = (i2 = Math.imul(F, ee)) + Math.imul(L, Q) | 0, s2 = Math.imul(L, ee), n2 = n2 + Math.imul(P, re) | 0, i2 = (i2 = i2 + Math.imul(P, ne) | 0) + Math.imul(B, re) | 0, s2 = s2 + Math.imul(B, ne) | 0, n2 = n2 + Math.imul(j, se) | 0, i2 = (i2 = i2 + Math.imul(j, oe) | 0) + Math.imul(I, se) | 0, s2 = s2 + Math.imul(I, oe) | 0, n2 = n2 + Math.imul(A, le) | 0, i2 = (i2 = i2 + Math.imul(A, ce) | 0) + Math.imul(R, le) | 0, s2 = s2 + Math.imul(R, ce) | 0, n2 = n2 + Math.imul(C, he) | 0, i2 = (i2 = i2 + Math.imul(C, fe) | 0) + Math.imul(T, he) | 0, s2 = s2 + Math.imul(T, fe) | 0;
var Ae = (c2 + (n2 = n2 + Math.imul(k2, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(k2, me) | 0) + Math.imul(S2, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(S2, me) | 0) + (i2 >>> 13) | 0) + (Ae >>> 26) | 0, Ae &= 67108863, n2 = Math.imul(F, re), i2 = (i2 = Math.imul(F, ne)) + Math.imul(L, re) | 0, s2 = Math.imul(L, ne), n2 = n2 + Math.imul(P, se) | 0, i2 = (i2 = i2 + Math.imul(P, oe) | 0) + Math.imul(B, se) | 0, s2 = s2 + Math.imul(B, oe) | 0, n2 = n2 + Math.imul(j, le) | 0, i2 = (i2 = i2 + Math.imul(j, ce) | 0) + Math.imul(I, le) | 0, s2 = s2 + Math.imul(I, ce) | 0, n2 = n2 + Math.imul(A, he) | 0, i2 = (i2 = i2 + Math.imul(A, fe) | 0) + Math.imul(R, he) | 0, s2 = s2 + Math.imul(R, fe) | 0;
var Re = (c2 + (n2 = n2 + Math.imul(C, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(C, me) | 0) + Math.imul(T, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(T, me) | 0) + (i2 >>> 13) | 0) + (Re >>> 26) | 0, Re &= 67108863, n2 = Math.imul(F, se), i2 = (i2 = Math.imul(F, oe)) + Math.imul(L, se) | 0, s2 = Math.imul(L, oe), n2 = n2 + Math.imul(P, le) | 0, i2 = (i2 = i2 + Math.imul(P, ce) | 0) + Math.imul(B, le) | 0, s2 = s2 + Math.imul(B, ce) | 0, n2 = n2 + Math.imul(j, he) | 0, i2 = (i2 = i2 + Math.imul(j, fe) | 0) + Math.imul(I, he) | 0, s2 = s2 + Math.imul(I, fe) | 0;
var Oe = (c2 + (n2 = n2 + Math.imul(A, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(A, me) | 0) + Math.imul(R, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(R, me) | 0) + (i2 >>> 13) | 0) + (Oe >>> 26) | 0, Oe &= 67108863, n2 = Math.imul(F, le), i2 = (i2 = Math.imul(F, ce)) + Math.imul(L, le) | 0, s2 = Math.imul(L, ce), n2 = n2 + Math.imul(P, he) | 0, i2 = (i2 = i2 + Math.imul(P, fe) | 0) + Math.imul(B, he) | 0, s2 = s2 + Math.imul(B, fe) | 0;
var je = (c2 + (n2 = n2 + Math.imul(j, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(j, me) | 0) + Math.imul(I, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(I, me) | 0) + (i2 >>> 13) | 0) + (je >>> 26) | 0, je &= 67108863, n2 = Math.imul(F, he), i2 = (i2 = Math.imul(F, fe)) + Math.imul(L, he) | 0, s2 = Math.imul(L, fe);
var Ie = (c2 + (n2 = n2 + Math.imul(P, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(P, me) | 0) + Math.imul(B, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(B, me) | 0) + (i2 >>> 13) | 0) + (Ie >>> 26) | 0, Ie &= 67108863;
var Ne = (c2 + (n2 = Math.imul(F, pe)) | 0) + ((8191 & (i2 = (i2 = Math.imul(F, me)) + Math.imul(L, pe) | 0)) << 13) | 0;
return c2 = ((s2 = Math.imul(L, me)) + (i2 >>> 13) | 0) + (Ne >>> 26) | 0, Ne &= 67108863, l2[0] = be, l2[1] = ge, l2[2] = ye, l2[3] = ve, l2[4] = we, l2[5] = _e, l2[6] = xe, l2[7] = ke, l2[8] = Se, l2[9] = Me, l2[10] = Ce, l2[11] = Te, l2[12] = Ee, l2[13] = Ae, l2[14] = Re, l2[15] = Oe, l2[16] = je, l2[17] = Ie, l2[18] = Ne, 0 !== c2 && (l2[19] = c2, r3.length++), r3;
};
function m(e2, t3, r3) {
return new b().mulp(e2, t3, r3);
}
function b(e2, t3) {
this.x = e2, this.y = t3;
}
Math.imul || (p = d), s.prototype.mulTo = function(e2, t3) {
var r3 = this.length + e2.length;
return 10 === this.length && 10 === e2.length ? p(this, e2, t3) : r3 < 63 ? d(this, e2, t3) : r3 < 1024 ? (function(e3, t4, r4) {
r4.negative = t4.negative ^ e3.negative, r4.length = e3.length + t4.length;
for (var n2 = 0, i2 = 0, s2 = 0; s2 < r4.length - 1; s2++) {
var o2 = i2;
i2 = 0;
for (var a2 = 67108863 & n2, l2 = Math.min(s2, t4.length - 1), c2 = Math.max(0, s2 - e3.length + 1); c2 <= l2; c2++) {
var u2 = s2 - c2, h2 = (0 | e3.words[u2]) * (0 | t4.words[c2]), f2 = 67108863 & h2;
a2 = 67108863 & (f2 = f2 + a2 | 0), i2 += (o2 = (o2 = o2 + (h2 / 67108864 | 0) | 0) + (f2 >>> 26) | 0) >>> 26, o2 &= 67108863;
}
r4.words[s2] = a2, n2 = o2, o2 = i2;
}
return 0 !== n2 ? r4.words[s2] = n2 : r4.length--, r4.strip();
})(this, e2, t3) : m(this, e2, t3);
}, b.prototype.makeRBT = function(e2) {
for (var t3 = new Array(e2), r3 = s.prototype._countBits(e2) - 1, n2 = 0; n2 < e2; n2++) t3[n2] = this.revBin(n2, r3, e2);
return t3;
}, b.prototype.revBin = function(e2, t3, r3) {
if (0 === e2 || e2 === r3 - 1) return e2;
for (var n2 = 0, i2 = 0; i2 < t3; i2++) n2 |= (1 & e2) << t3 - i2 - 1, e2 >>= 1;
return n2;
}, b.prototype.permute = function(e2, t3, r3, n2, i2, s2) {
for (var o2 = 0; o2 < s2; o2++) n2[o2] = t3[e2[o2]], i2[o2] = r3[e2[o2]];
}, b.prototype.transform = function(e2, t3, r3, n2, i2, s2) {
this.permute(s2, e2, t3, r3, n2, i2);
for (var o2 = 1; o2 < i2; o2 <<= 1) for (var a2 = o2 << 1, l2 = Math.cos(2 * Math.PI / a2), c2 = Math.sin(2 * Math.PI / a2), u2 = 0; u2 < i2; u2 += a2) for (var h2 = l2, f2 = c2, d2 = 0; d2 < o2; d2++) {
var p2 = r3[u2 + d2], m2 = n2[u2 + d2], b2 = r3[u2 + d2 + o2], g2 = n2[u2 + d2 + o2], y2 = h2 * b2 - f2 * g2;
g2 = h2 * g2 + f2 * b2, b2 = y2, r3[u2 + d2] = p2 + b2, n2[u2 + d2] = m2 + g2, r3[u2 + d2 + o2] = p2 - b2, n2[u2 + d2 + o2] = m2 - g2, d2 !== a2 && (y2 = l2 * h2 - c2 * f2, f2 = l2 * f2 + c2 * h2, h2 = y2);
}
}, b.prototype.guessLen13b = function(e2, t3) {
var r3 = 1 | Math.max(t3, e2), n2 = 1 & r3, i2 = 0;
for (r3 = r3 / 2 | 0; r3; r3 >>>= 1) i2++;
return 1 << i2 + 1 + n2;
}, b.prototype.conjugate = function(e2, t3, r3) {
if (!(r3 <= 1)) for (var n2 = 0; n2 < r3 / 2; n2++) {
var i2 = e2[n2];
e2[n2] = e2[r3 - n2 - 1], e2[r3 - n2 - 1] = i2, i2 = t3[n2], t3[n2] = -t3[r3 - n2 - 1], t3[r3 - n2 - 1] = -i2;
}
}, b.prototype.normalize13b = function(e2, t3) {
for (var r3 = 0, n2 = 0; n2 < t3 / 2; n2++) {
var i2 = 8192 * Math.round(e2[2 * n2 + 1] / t3) + Math.round(e2[2 * n2] / t3) + r3;
e2[n2] = 67108863 & i2, r3 = i2 < 67108864 ? 0 : i2 / 67108864 | 0;
}
return e2;
}, b.prototype.convert13b = function(e2, t3, r3, i2) {
for (var s2 = 0, o2 = 0; o2 < t3; o2++) s2 += 0 | e2[o2], r3[2 * o2] = 8191 & s2, s2 >>>= 13, r3[2 * o2 + 1] = 8191 & s2, s2 >>>= 13;
for (o2 = 2 * t3; o2 < i2; ++o2) r3[o2] = 0;
n(0 === s2), n(0 == (-8192 & s2));
}, b.prototype.stub = function(e2) {
for (var t3 = new Array(e2), r3 = 0; r3 < e2; r3++) t3[r3] = 0;
return t3;
}, b.prototype.mulp = function(e2, t3, r3) {
var n2 = 2 * this.guessLen13b(e2.length, t3.length), i2 = this.makeRBT(n2), s2 = this.stub(n2), o2 = new Array(n2), a2 = new Array(n2), l2 = new Array(n2), c2 = new Array(n2), u2 = new Array(n2), h2 = new Array(n2), f2 = r3.words;
f2.length = n2, this.convert13b(e2.words, e2.length, o2, n2), this.convert13b(t3.words, t3.length, c2, n2), this.transform(o2, s2, a2, l2, n2, i2), this.transform(c2, s2, u2, h2, n2, i2);
for (var d2 = 0; d2 < n2; d2++) {
var p2 = a2[d2] * u2[d2] - l2[d2] * h2[d2];
l2[d2] = a2[d2] * h2[d2] + l2[d2] * u2[d2], a2[d2] = p2;
}
return this.conjugate(a2, l2, n2), this.transform(a2, l2, f2, s2, n2, i2), this.conjugate(f2, s2, n2), this.normalize13b(f2, n2), r3.negative = e2.negative ^ t3.negative, r3.length = e2.length + t3.length, r3.strip();
}, s.prototype.mul = function(e2) {
var t3 = new s(null);
return t3.words = new Array(this.length + e2.length), this.mulTo(e2, t3);
}, s.prototype.mulf = function(e2) {
var t3 = new s(null);
return t3.words = new Array(this.length + e2.length), m(this, e2, t3);
}, s.prototype.imul = function(e2) {
return this.clone().mulTo(e2, this);
}, s.prototype.imuln = function(e2) {
n("number" == typeof e2), n(e2 < 67108864);
for (var t3 = 0, r3 = 0; r3 < this.length; r3++) {
var i2 = (0 | this.words[r3]) * e2, s2 = (67108863 & i2) + (67108863 & t3);
t3 >>= 26, t3 += i2 / 67108864 | 0, t3 += s2 >>> 26, this.words[r3] = 67108863 & s2;
}
return 0 !== t3 && (this.words[r3] = t3, this.length++), this;
}, s.prototype.muln = function(e2) {
return this.clone().imuln(e2);
}, s.prototype.sqr = function() {
return this.mul(this);
}, s.prototype.isqr = function() {
return this.imul(this.clone());
}, s.prototype.pow = function(e2) {
var t3 = (function(e3) {
for (var t4 = new Array(e3.bitLength()), r4 = 0; r4 < t4.length; r4++) {
var n3 = r4 / 26 | 0, i3 = r4 % 26;
t4[r4] = (e3.words[n3] & 1 << i3) >>> i3;
}
return t4;
})(e2);
if (0 === t3.length) return new s(1);
for (var r3 = this, n2 = 0; n2 < t3.length && 0 === t3[n2]; n2++, r3 = r3.sqr()) ;
if (++n2 < t3.length) for (var i2 = r3.sqr(); n2 < t3.length; n2++, i2 = i2.sqr()) 0 !== t3[n2] && (r3 = r3.mul(i2));
return r3;
}, s.prototype.iushln = function(e2) {
n("number" == typeof e2 && e2 >= 0);
var t3, r3 = e2 % 26, i2 = (e2 - r3) / 26, s2 = 67108863 >>> 26 - r3 << 26 - r3;
if (0 !== r3) {
var o2 = 0;
for (t3 = 0; t3 < this.length; t3++) {
var a2 = this.words[t3] & s2, l2 = (0 | this.words[t3]) - a2 << r3;
this.words[t3] = l2 | o2, o2 = a2 >>> 26 - r3;
}
o2 && (this.words[t3] = o2, this.length++);
}
if (0 !== i2) {
for (t3 = this.length - 1; t3 >= 0; t3--) this.words[t3 + i2] = this.words[t3];
for (t3 = 0; t3 < i2; t3++) this.words[t3] = 0;
this.length += i2;
}
return this.strip();
}, s.prototype.ishln = function(e2) {
return n(0 === this.negative), this.iushln(e2);
}, s.prototype.iushrn = function(e2, t3, r3) {
var i2;
n("number" == typeof e2 && e2 >= 0), i2 = t3 ? (t3 - t3 % 26) / 26 : 0;
var s2 = e2 % 26, o2 = Math.min((e2 - s2) / 26, this.length), a2 = 67108863 ^ 67108863 >>> s2 << s2, l2 = r3;
if (i2 -= o2, i2 = Math.max(0, i2), l2) {
for (var c2 = 0; c2 < o2; c2++) l2.words[c2] = this.words[c2];
l2.length = o2;
}
if (0 === o2) ;
else if (this.length > o2) for (this.length -= o2, c2 = 0; c2 < this.length; c2++) this.words[c2] = this.words[c2 + o2];
else this.words[0] = 0, this.length = 1;
var u2 = 0;
for (c2 = this.length - 1; c2 >= 0 && (0 !== u2 || c2 >= i2); c2--) {
var h2 = 0 | this.words[c2];
this.words[c2] = u2 << 26 - s2 | h2 >>> s2, u2 = h2 & a2;
}
return l2 && 0 !== u2 && (l2.words[l2.length++] = u2), 0 === this.length && (this.words[0] = 0, this.length = 1), this.strip();
}, s.prototype.ishrn = function(e2, t3, r3) {
return n(0 === this.negative), this.iushrn(e2, t3, r3);
}, s.prototype.shln = function(e2) {
return this.clone().ishln(e2);
}, s.prototype.ushln = function(e2) {
return this.clone().iushln(e2);
}, s.prototype.shrn = function(e2) {
return this.clone().ishrn(e2);
}, s.prototype.ushrn = function(e2) {
return this.clone().iushrn(e2);
}, s.prototype.testn = function(e2) {
n("number" == typeof e2 && e2 >= 0);
var t3 = e2 % 26, r3 = (e2 - t3) / 26, i2 = 1 << t3;
return !(this.length <= r3) && !!(this.words[r3] & i2);
}, s.prototype.imaskn = function(e2) {
n("number" == typeof e2 && e2 >= 0);
var t3 = e2 % 26, r3 = (e2 - t3) / 26;
if (n(0 === this.negative, "imaskn works only with positive numbers"), this.length <= r3) return this;
if (0 !== t3 && r3++, this.length = Math.min(r3, this.length), 0 !== t3) {
var i2 = 67108863 ^ 67108863 >>> t3 << t3;
this.words[this.length - 1] &= i2;
}
return this.strip();
}, s.prototype.maskn = function(e2) {
return this.clone().imaskn(e2);
}, s.prototype.iaddn = function(e2) {
return n("number" == typeof e2), n(e2 < 67108864), e2 < 0 ? this.isubn(-e2) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) < e2 ? (this.words[0] = e2 - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(e2), this.negative = 1, this) : this._iaddn(e2);
}, s.prototype._iaddn = function(e2) {
this.words[0] += e2;
for (var t3 = 0; t3 < this.length && this.words[t3] >= 67108864; t3++) this.words[t3] -= 67108864, t3 === this.length - 1 ? this.words[t3 + 1] = 1 : this.words[t3 + 1]++;
return this.length = Math.max(this.length, t3 + 1), this;
}, s.prototype.isubn = function(e2) {
if (n("number" == typeof e2), n(e2 < 67108864), e2 < 0) return this.iaddn(-e2);
if (0 !== this.negative) return this.negative = 0, this.iaddn(e2), this.negative = 1, this;
if (this.words[0] -= e2, 1 === this.length && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1;
else for (var t3 = 0; t3 < this.length && this.words[t3] < 0; t3++) this.words[t3] += 67108864, this.words[t3 + 1] -= 1;
return this.strip();
}, s.prototype.addn = function(e2) {
return this.clone().iaddn(e2);
}, s.prototype.subn = function(e2) {
return this.clone().isubn(e2);
}, s.prototype.iabs = function() {
return this.negative = 0, this;
}, s.prototype.abs = function() {
return this.clone().iabs();
}, s.prototype._ishlnsubmul = function(e2, t3, r3) {
var i2, s2, o2 = e2.length + r3;
this._expand(o2);
var a2 = 0;
for (i2 = 0; i2 < e2.length; i2++) {
s2 = (0 | this.words[i2 + r3]) + a2;
var l2 = (0 | e2.words[i2]) * t3;
a2 = ((s2 -= 67108863 & l2) >> 26) - (l2 / 67108864 | 0), this.words[i2 + r3] = 67108863 & s2;
}
for (; i2 < this.length - r3; i2++) a2 = (s2 = (0 | this.words[i2 + r3]) + a2) >> 26, this.words[i2 + r3] = 67108863 & s2;
if (0 === a2) return this.strip();
for (n(-1 === a2), a2 = 0, i2 = 0; i2 < this.length; i2++) a2 = (s2 = -(0 | this.words[i2]) + a2) >> 26, this.words[i2] = 67108863 & s2;
return this.negative = 1, this.strip();
}, s.prototype._wordDiv = function(e2, t3) {
var r3 = (this.length, e2.length), n2 = this.clone(), i2 = e2, o2 = 0 | i2.words[i2.length - 1];
0 !== (r3 = 26 - this._countBits(o2)) && (i2 = i2.ushln(r3), n2.iushln(r3), o2 = 0 | i2.words[i2.length - 1]);
var a2, l2 = n2.length - i2.length;
if ("mod" !== t3) {
(a2 = new s(null)).length = l2 + 1, a2.words = new Array(a2.length);
for (var c2 = 0; c2 < a2.length; c2++) a2.words[c2] = 0;
}
var u2 = n2.clone()._ishlnsubmul(i2, 1, l2);
0 === u2.negative && (n2 = u2, a2 && (a2.words[l2] = 1));
for (var h2 = l2 - 1; h2 >= 0; h2--) {
var f2 = 67108864 * (0 | n2.words[i2.length + h2]) + (0 | n2.words[i2.length + h2 - 1]);
for (f2 = Math.min(f2 / o2 | 0, 67108863), n2._ishlnsubmul(i2, f2, h2); 0 !== n2.negative; ) f2--, n2.negative = 0, n2._ishlnsubmul(i2, 1, h2), n2.isZero() || (n2.negative ^= 1);
a2 && (a2.words[h2] = f2);
}
return a2 && a2.strip(), n2.strip(), "div" !== t3 && 0 !== r3 && n2.iushrn(r3), { div: a2 || null, mod: n2 };
}, s.prototype.divmod = function(e2, t3, r3) {
return n(!e2.isZero()), this.isZero() ? { div: new s(0), mod: new s(0) } : 0 !== this.negative && 0 === e2.negative ? (a2 = this.neg().divmod(e2, t3), "mod" !== t3 && (i2 = a2.div.neg()), "div" !== t3 && (o2 = a2.mod.neg(), r3 && 0 !== o2.negative && o2.iadd(e2)), { div: i2, mod: o2 }) : 0 === this.negative && 0 !== e2.negative ? (a2 = this.divmod(e2.neg(), t3), "mod" !== t3 && (i2 = a2.div.neg()), { div: i2, mod: a2.mod }) : 0 != (this.negative & e2.negative) ? (a2 = this.neg().divmod(e2.neg(), t3), "div" !== t3 && (o2 = a2.mod.neg(), r3 && 0 !== o2.negative && o2.isub(e2)), { div: a2.div, mod: o2 }) : e2.length > this.length || this.cmp(e2) < 0 ? { div: new s(0), mod: this } : 1 === e2.length ? "div" === t3 ? { div: this.divn(e2.words[0]), mod: null } : "mod" === t3 ? { div: null, mod: new s(this.modn(e2.words[0])) } : { div: this.divn(e2.words[0]), mod: new s(this.modn(e2.words[0])) } : this._wordDiv(e2, t3);
var i2, o2, a2;
}, s.prototype.div = function(e2) {
return this.divmod(e2, "div", false).div;
}, s.prototype.mod = function(e2) {
return this.divmod(e2, "mod", false).mod;
}, s.prototype.umod = function(e2) {
return this.divmod(e2, "mod", true).mod;
}, s.prototype.divRound = function(e2) {
var t3 = this.divmod(e2);
if (t3.mod.isZero()) return t3.div;
var r3 = 0 !== t3.div.negative ? t3.mod.isub(e2) : t3.mod, n2 = e2.ushrn(1), i2 = e2.andln(1), s2 = r3.cmp(n2);
return s2 < 0 || 1 === i2 && 0 === s2 ? t3.div : 0 !== t3.div.negative ? t3.div.isubn(1) : t3.div.iaddn(1);
}, s.prototype.modn = function(e2) {
n(e2 <= 67108863);
for (var t3 = (1 << 26) % e2, r3 = 0, i2 = this.length - 1; i2 >= 0; i2--) r3 = (t3 * r3 + (0 | this.words[i2])) % e2;
return r3;
}, s.prototype.idivn = function(e2) {
n(e2 <= 67108863);
for (var t3 = 0, r3 = this.length - 1; r3 >= 0; r3--) {
var i2 = (0 | this.words[r3]) + 67108864 * t3;
this.words[r3] = i2 / e2 | 0, t3 = i2 % e2;
}
return this.strip();
}, s.prototype.divn = function(e2) {
return this.clone().idivn(e2);
}, s.prototype.egcd = function(e2) {
n(0 === e2.negative), n(!e2.isZero());
var t3 = this, r3 = e2.clone();
t3 = 0 !== t3.negative ? t3.umod(e2) : t3.clone();
for (var i2 = new s(1), o2 = new s(0), a2 = new s(0), l2 = new s(1), c2 = 0; t3.isEven() && r3.isEven(); ) t3.iushrn(1), r3.iushrn(1), ++c2;
for (var u2 = r3.clone(), h2 = t3.clone(); !t3.isZero(); ) {
for (var f2 = 0, d2 = 1; 0 == (t3.words[0] & d2) && f2 < 26; ++f2, d2 <<= 1) ;
if (f2 > 0) for (t3.iushrn(f2); f2-- > 0; ) (i2.isOdd() || o2.isOdd()) && (i2.iadd(u2), o2.isub(h2)), i2.iushrn(1), o2.iushrn(1);
for (var p2 = 0, m2 = 1; 0 == (r3.words[0] & m2) && p2 < 26; ++p2, m2 <<= 1) ;
if (p2 > 0) for (r3.iushrn(p2); p2-- > 0; ) (a2.isOdd() || l2.isOdd()) && (a2.iadd(u2), l2.isub(h2)), a2.iushrn(1), l2.iushrn(1);
t3.cmp(r3) >= 0 ? (t3.isub(r3), i2.isub(a2), o2.isub(l2)) : (r3.isub(t3), a2.isub(i2), l2.isub(o2));
}
return { a: a2, b: l2, gcd: r3.iushln(c2) };
}, s.prototype._invmp = function(e2) {
n(0 === e2.negative), n(!e2.isZero());
var t3 = this, r3 = e2.clone();
t3 = 0 !== t3.negative ? t3.umod(e2) : t3.clone();
for (var i2, o2 = new s(1), a2 = new s(0), l2 = r3.clone(); t3.cmpn(1) > 0 && r3.cmpn(1) > 0; ) {
for (var c2 = 0, u2 = 1; 0 == (t3.words[0] & u2) && c2 < 26; ++c2, u2 <<= 1) ;
if (c2 > 0) for (t3.iushrn(c2); c2-- > 0; ) o2.isOdd() && o2.iadd(l2), o2.iushrn(1);
for (var h2 = 0, f2 = 1; 0 == (r3.words[0] & f2) && h2 < 26; ++h2, f2 <<= 1) ;
if (h2 > 0) for (r3.iushrn(h2); h2-- > 0; ) a2.isOdd() && a2.iadd(l2), a2.iushrn(1);
t3.cmp(r3) >= 0 ? (t3.isub(r3), o2.isub(a2)) : (r3.isub(t3), a2.isub(o2));
}
return (i2 = 0 === t3.cmpn(1) ? o2 : a2).cmpn(0) < 0 && i2.iadd(e2), i2;
}, s.prototype.gcd = function(e2) {
if (this.isZero()) return e2.abs();
if (e2.isZero()) return this.abs();
var t3 = this.clone(), r3 = e2.clone();
t3.negative = 0, r3.negative = 0;
for (var n2 = 0; t3.isEven() && r3.isEven(); n2++) t3.iushrn(1), r3.iushrn(1);
for (; ; ) {
for (; t3.isEven(); ) t3.iushrn(1);
for (; r3.isEven(); ) r3.iushrn(1);
var i2 = t3.cmp(r3);
if (i2 < 0) {
var s2 = t3;
t3 = r3, r3 = s2;
} else if (0 === i2 || 0 === r3.cmpn(1)) break;
t3.isub(r3);
}
return r3.iushln(n2);
}, s.prototype.invm = function(e2) {
return this.egcd(e2).a.umod(e2);
}, s.prototype.isEven = function() {
return 0 == (1 & this.words[0]);
}, s.prototype.isOdd = function() {
return 1 == (1 & this.words[0]);
}, s.prototype.andln = function(e2) {
return this.words[0] & e2;
}, s.prototype.bincn = function(e2) {
n("number" == typeof e2);
var t3 = e2 % 26, r3 = (e2 - t3) / 26, i2 = 1 << t3;
if (this.length <= r3) return this._expand(r3 + 1), this.words[r3] |= i2, this;
for (var s2 = i2, o2 = r3; 0 !== s2 && o2 < this.length; o2++) {
var a2 = 0 | this.words[o2];
s2 = (a2 += s2) >>> 26, a2 &= 67108863, this.words[o2] = a2;
}
return 0 !== s2 && (this.words[o2] = s2, this.length++), this;
}, s.prototype.isZero = function() {
return 1 === this.length && 0 === this.words[0];
}, s.prototype.cmpn = function(e2) {
var t3, r3 = e2 < 0;
if (0 !== this.negative && !r3) return -1;
if (0 === this.negative && r3) return 1;
if (this.strip(), this.length > 1) t3 = 1;
else {
r3 && (e2 = -e2), n(e2 <= 67108863, "Number is too big");
var i2 = 0 | this.words[0];
t3 = i2 === e2 ? 0 : i2 < e2 ? -1 : 1;
}
return 0 !== this.negative ? 0 | -t3 : t3;
}, s.prototype.cmp = function(e2) {
if (0 !== this.negative && 0 === e2.negative) return -1;
if (0 === this.negative && 0 !== e2.negative) return 1;
var t3 = this.ucmp(e2);
return 0 !== this.negative ? 0 | -t3 : t3;
}, s.prototype.ucmp = function(e2) {
if (this.length > e2.length) return 1;
if (this.length < e2.length) return -1;
for (var t3 = 0, r3 = this.length - 1; r3 >= 0; r3--) {
var n2 = 0 | this.words[r3], i2 = 0 | e2.words[r3];
if (n2 !== i2) {
n2 < i2 ? t3 = -1 : n2 > i2 && (t3 = 1);
break;
}
}
return t3;
}, s.prototype.gtn = function(e2) {
return 1 === this.cmpn(e2);
}, s.prototype.gt = function(e2) {
return 1 === this.cmp(e2);
}, s.prototype.gten = function(e2) {
return this.cmpn(e2) >= 0;
}, s.prototype.gte = function(e2) {
return this.cmp(e2) >= 0;
}, s.prototype.ltn = function(e2) {
return -1 === this.cmpn(e2);
}, s.prototype.lt = function(e2) {
return -1 === this.cmp(e2);
}, s.prototype.lten = function(e2) {
return this.cmpn(e2) <= 0;
}, s.prototype.lte = function(e2) {
return this.cmp(e2) <= 0;
}, s.prototype.eqn = function(e2) {
return 0 === this.cmpn(e2);
}, s.prototype.eq = function(e2) {
return 0 === this.cmp(e2);
}, s.red = function(e2) {
return new k(e2);
}, s.prototype.toRed = function(e2) {
return n(!this.red, "Already a number in reduction context"), n(0 === this.negative, "red works only with positives"), e2.convertTo(this)._forceRed(e2);
}, s.prototype.fromRed = function() {
return n(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this);
}, s.prototype._forceRed = function(e2) {
return this.red = e2, this;
}, s.prototype.forceRed = function(e2) {
return n(!this.red, "Already a number in reduction context"), this._forceRed(e2);
}, s.prototype.redAdd = function(e2) {
return n(this.red, "redAdd works only with red numbers"), this.red.add(this, e2);
}, s.prototype.redIAdd = function(e2) {
return n(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, e2);
}, s.prototype.redSub = function(e2) {
return n(this.red, "redSub works only with red numbers"), this.red.sub(this, e2);
}, s.prototype.redISub = function(e2) {
return n(this.red, "redISub works only with red numbers"), this.red.isub(this, e2);
}, s.prototype.redShl = function(e2) {
return n(this.red, "redShl works only with red numbers"), this.red.shl(this, e2);
}, s.prototype.redMul = function(e2) {
return n(this.red, "redMul works only with red numbers"), this.red._verify2(this, e2), this.red.mul(this, e2);
}, s.prototype.redIMul = function(e2) {
return n(this.red, "redMul works only with red numbers"), this.red._verify2(this, e2), this.red.imul(this, e2);
}, s.prototype.redSqr = function() {
return n(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this);
}, s.prototype.redISqr = function() {
return n(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this);
}, s.prototype.redSqrt = function() {
return n(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this);
}, s.prototype.redInvm = function() {
return n(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this);
}, s.prototype.redNeg = function() {
return n(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this);
}, s.prototype.redPow = function(e2) {
return n(this.red && !e2.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, e2);
};
var g = { k256: null, p224: null, p192: null, p25519: null };
function y(e2, t3) {
this.name = e2, this.p = new s(t3, 16), this.n = this.p.bitLength(), this.k = new s(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();
}
function v() {
y.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
}
function w() {
y.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
}
function _() {
y.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
}
function x() {
y.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
}
function k(e2) {
if ("string" == typeof e2) {
var t3 = s._prime(e2);
this.m = t3.p, this.prime = t3;
} else n(e2.gtn(1), "modulus must be greater than 1"), this.m = e2, this.prime = null;
}
function S(e2) {
k.call(this, e2), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new s(1).iushln(this.shift), this.r2 = this.imod(this.r.sqr()), this.rinv = this.r._invmp(this.m), this.minv = this.rinv.mul(this.r).isubn(1).div(this.m), this.minv = this.minv.umod(this.r), this.minv = this.r.sub(this.minv);
}
y.prototype._tmp = function() {
var e2 = new s(null);
return e2.words = new Array(Math.ceil(this.n / 13)), e2;
}, y.prototype.ireduce = function(e2) {
var t3, r3 = e2;
do {
this.split(r3, this.tmp), t3 = (r3 = (r3 = this.imulK(r3)).iadd(this.tmp)).bitLength();
} while (t3 > this.n);
var n2 = t3 < this.n ? -1 : r3.ucmp(this.p);
return 0 === n2 ? (r3.words[0] = 0, r3.length = 1) : n2 > 0 ? r3.isub(this.p) : void 0 !== r3.strip ? r3.strip() : r3._strip(), r3;
}, y.prototype.split = function(e2, t3) {
e2.iushrn(this.n, 0, t3);
}, y.prototype.imulK = function(e2) {
return e2.imul(this.k);
}, i(v, y), v.prototype.split = function(e2, t3) {
for (var r3 = Math.min(e2.length, 9), n2 = 0; n2 < r3; n2++) t3.words[n2] = e2.words[n2];
if (t3.length = r3, e2.length <= 9) return e2.words[0] = 0, void (e2.length = 1);
var i2 = e2.words[9];
for (t3.words[t3.length++] = 4194303 & i2, n2 = 10; n2 < e2.length; n2++) {
var s2 = 0 | e2.words[n2];
e2.words[n2 - 10] = (4194303 & s2) << 4 | i2 >>> 22, i2 = s2;
}
i2 >>>= 22, e2.words[n2 - 10] = i2, 0 === i2 && e2.length > 10 ? e2.length -= 10 : e2.length -= 9;
}, v.prototype.imulK = function(e2) {
e2.words[e2.length] = 0, e2.words[e2.length + 1] = 0, e2.length += 2;
for (var t3 = 0, r3 = 0; r3 < e2.length; r3++) {
var n2 = 0 | e2.words[r3];
t3 += 977 * n2, e2.words[r3] = 67108863 & t3, t3 = 64 * n2 + (t3 / 67108864 | 0);
}
return 0 === e2.words[e2.length - 1] && (e2.length--, 0 === e2.words[e2.length - 1] && e2.length--), e2;
}, i(w, y), i(_, y), i(x, y), x.prototype.imulK = function(e2) {
for (var t3 = 0, r3 = 0; r3 < e2.length; r3++) {
var n2 = 19 * (0 | e2.words[r3]) + t3, i2 = 67108863 & n2;
n2 >>>= 26, e2.words[r3] = i2, t3 = n2;
}
return 0 !== t3 && (e2.words[e2.length++] = t3), e2;
}, s._prime = function(e2) {
if (g[e2]) return g[e2];
var t3;
if ("k256" === e2) t3 = new v();
else if ("p224" === e2) t3 = new w();
else if ("p192" === e2) t3 = new _();
else {
if ("p25519" !== e2) throw new Error("Unknown prime " + e2);
t3 = new x();
}
return g[e2] = t3, t3;
}, k.prototype._verify1 = function(e2) {
n(0 === e2.negative, "red works only with positives"), n(e2.red, "red works only with red numbers");
}, k.prototype._verify2 = function(e2, t3) {
n(0 == (e2.negative | t3.negative), "red works only with positives"), n(e2.red && e2.red === t3.red, "red works only with red numbers");
}, k.prototype.imod = function(e2) {
return this.prime ? this.prime.ireduce(e2)._forceRed(this) : e2.umod(this.m)._forceRed(this);
}, k.prototype.neg = function(e2) {
return e2.isZero() ? e2.clone() : this.m.sub(e2)._forceRed(this);
}, k.prototype.add = function(e2, t3) {
this._verify2(e2, t3);
var r3 = e2.add(t3);
return r3.cmp(this.m) >= 0 && r3.isub(this.m), r3._forceRed(this);
}, k.prototype.iadd = function(e2, t3) {
this._verify2(e2, t3);
var r3 = e2.iadd(t3);
return r3.cmp(this.m) >= 0 && r3.isub(this.m), r3;
}, k.prototype.sub = function(e2, t3) {
this._verify2(e2, t3);
var r3 = e2.sub(t3);
return r3.cmpn(0) < 0 && r3.iadd(this.m), r3._forceRed(this);
}, k.prototype.isub = function(e2, t3) {
this._verify2(e2, t3);
var r3 = e2.isub(t3);
return r3.cmpn(0) < 0 && r3.iadd(this.m), r3;
}, k.prototype.shl = function(e2, t3) {
return this._verify1(e2), this.imod(e2.ushln(t3));
}, k.prototype.imul = function(e2, t3) {
return this._verify2(e2, t3), this.imod(e2.imul(t3));
}, k.prototype.mul = function(e2, t3) {
return this._verify2(e2, t3), this.imod(e2.mul(t3));
}, k.prototype.isqr = function(e2) {
return this.imul(e2, e2.clone());
}, k.prototype.sqr = function(e2) {
return this.mul(e2, e2);
}, k.prototype.sqrt = function(e2) {
if (e2.isZero()) return e2.clone();
var t3 = this.m.andln(3);
if (n(t3 % 2 == 1), 3 === t3) {
var r3 = this.m.add(new s(1)).iushrn(2);
return this.pow(e2, r3);
}
for (var i2 = this.m.subn(1), o2 = 0; !i2.isZero() && 0 === i2.andln(1); ) o2++, i2.iushrn(1);
n(!i2.isZero());
var a2 = new s(1).toRed(this), l2 = a2.redNeg(), c2 = this.m.subn(1).iushrn(1), u2 = this.m.bitLength();
for (u2 = new s(2 * u2 * u2).toRed(this); 0 !== this.pow(u2, c2).cmp(l2); ) u2.redIAdd(l2);
for (var h2 = this.pow(u2, i2), f2 = this.pow(e2, i2.addn(1).iushrn(1)), d2 = this.pow(e2, i2), p2 = o2; 0 !== d2.cmp(a2); ) {
for (var m2 = d2, b2 = 0; 0 !== m2.cmp(a2); b2++) m2 = m2.redSqr();
n(b2 < p2);
var g2 = this.pow(h2, new s(1).iushln(p2 - b2 - 1));
f2 = f2.redMul(g2), h2 = g2.redSqr(), d2 = d2.redMul(h2), p2 = b2;
}
return f2;
}, k.prototype.invm = function(e2) {
var t3 = e2._invmp(this.m);
return 0 !== t3.negative ? (t3.negative = 0, this.imod(t3).redNeg()) : this.imod(t3);
}, k.prototype.pow = function(e2, t3) {
if (t3.isZero()) return new s(1).toRed(this);
if (0 === t3.cmpn(1)) return e2.clone();
var r3 = new Array(16);
r3[0] = new s(1).toRed(this), r3[1] = e2;
for (var n2 = 2; n2 < r3.length; n2++) r3[n2] = this.mul(r3[n2 - 1], e2);
var i2 = r3[0], o2 = 0, a2 = 0, l2 = t3.bitLength() % 26;
for (0 === l2 && (l2 = 26), n2 = t3.length - 1; n2 >= 0; n2--) {
for (var c2 = t3.words[n2], u2 = l2 - 1; u2 >= 0; u2--) {
var h2 = c2 >> u2 & 1;
i2 !== r3[0] && (i2 = this.sqr(i2)), 0 !== h2 || 0 !== o2 ? (o2 <<= 1, o2 |= h2, (4 === ++a2 || 0 === n2 && 0 === u2) && (i2 = this.mul(i2, r3[o2]), a2 = 0, o2 = 0)) : a2 = 0;
}
l2 = 26;
}
return i2;
}, k.prototype.convertTo = function(e2) {
var t3 = e2.umod(this.m);
return t3 === e2 ? t3.clone() : t3;
}, k.prototype.convertFrom = function(e2) {
var t3 = e2.clone();
return t3.red = null, t3;
}, s.mont = function(e2) {
return new S(e2);
}, i(S, k), S.prototype.convertTo = function(e2) {
return this.imod(e2.ushln(this.shift));
}, S.prototype.convertFrom = function(e2) {
var t3 = this.imod(e2.mul(this.rinv));
return t3.red = null, t3;
}, S.prototype.imul = function(e2, t3) {
if (e2.isZero() || t3.isZero()) return e2.words[0] = 0, e2.length = 1, e2;
var r3 = e2.imul(t3), n2 = r3.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), i2 = r3.isub(n2).iushrn(this.shift), s2 = i2;
return i2.cmp(this.m) >= 0 ? s2 = i2.isub(this.m) : i2.cmpn(0) < 0 && (s2 = i2.iadd(this.m)), s2._forceRed(this);
}, S.prototype.mul = function(e2, t3) {
if (e2.isZero() || t3.isZero()) return new s(0)._forceRed(this);
var r3 = e2.mul(t3), n2 = r3.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), i2 = r3.isub(n2).iushrn(this.shift), o2 = i2;
return i2.cmp(this.m) >= 0 ? o2 = i2.isub(this.m) : i2.cmpn(0) < 0 && (o2 = i2.iadd(this.m)), o2._forceRed(this);
}, S.prototype.invm = function(e2) {
return this.imod(e2._invmp(this.m).mul(this.r2))._forceRed(this);
};
})(void 0 === t || t);
}, { buffer: 188 }], 185: [function(e, t, r) {
r.byteLength = function(e2) {
var t2 = c(e2), r2 = t2[0], n2 = t2[1];
return 3 * (r2 + n2) / 4 - n2;
}, r.toByteArray = function(e2) {
var t2, r2, n2 = c(e2), o2 = n2[0], a2 = n2[1], l2 = new s((function(e3, t3, r3) {
return 3 * (t3 + r3) / 4 - r3;
})(0, o2, a2)), u2 = 0, h = a2 > 0 ? o2 - 4 : o2;
for (r2 = 0; r2 < h; r2 += 4) t2 = i[e2.charCodeAt(r2)] << 18 | i[e2.charCodeAt(r2 + 1)] << 12 | i[e2.charCodeAt(r2 + 2)] << 6 | i[e2.charCodeAt(r2 + 3)], l2[u2++] = t2 >> 16 & 255, l2[u2++] = t2 >> 8 & 255, l2[u2++] = 255 & t2;
2 === a2 && (t2 = i[e2.charCodeAt(r2)] << 2 | i[e2.charCodeAt(r2 + 1)] >> 4, l2[u2++] = 255 & t2);
1 === a2 && (t2 = i[e2.charCodeAt(r2)] << 10 | i[e2.charCodeAt(r2 + 1)] << 4 | i[e2.charCodeAt(r2 + 2)] >> 2, l2[u2++] = t2 >> 8 & 255, l2[u2++] = 255 & t2);
return l2;
}, r.fromByteArray = function(e2) {
for (var t2, r2 = e2.length, i2 = r2 % 3, s2 = [], o2 = 0, a2 = r2 - i2; o2 < a2; o2 += 16383) s2.push(u(e2, o2, o2 + 16383 > a2 ? a2 : o2 + 16383));
1 === i2 ? (t2 = e2[r2 - 1], s2.push(n[t2 >> 2] + n[t2 << 4 & 63] + "==")) : 2 === i2 && (t2 = (e2[r2 - 2] << 8) + e2[r2 - 1], s2.push(n[t2 >> 10] + n[t2 >> 4 & 63] + n[t2 << 2 & 63] + "="));
return s2.join("");
};
for (var n = [], i = [], s = "undefined" != typeof Uint8Array ? Uint8Array : Array, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a = 0, l = o.length; a < l; ++a) n[a] = o[a], i[o.charCodeAt(a)] = a;
function c(e2) {
var t2 = e2.length;
if (t2 % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
var r2 = e2.indexOf("=");
return -1 === r2 && (r2 = t2), [r2, r2 === t2 ? 0 : 4 - r2 % 4];
}
function u(e2, t2, r2) {
for (var i2, s2, o2 = [], a2 = t2; a2 < r2; a2 += 3) i2 = (e2[a2] << 16 & 16711680) + (e2[a2 + 1] << 8 & 65280) + (255 & e2[a2 + 2]), o2.push(n[(s2 = i2) >> 18 & 63] + n[s2 >> 12 & 63] + n[s2 >> 6 & 63] + n[63 & s2]);
return o2.join("");
}
i["-".charCodeAt(0)] = 62, i["_".charCodeAt(0)] = 63;
}, {}], 186: [function(e, t, r) {
!(function(t2, r2) {
function n(e2, t3) {
if (!e2) throw new Error(t3 || "Assertion failed");
}
function i(e2, t3) {
e2.super_ = t3;
var r3 = function() {
};
r3.prototype = t3.prototype, e2.prototype = new r3(), e2.prototype.constructor = e2;
}
function s(e2, t3, r3) {
if (s.isBN(e2)) return e2;
this.negative = 0, this.words = null, this.length = 0, this.red = null, null !== e2 && ("le" !== t3 && "be" !== t3 || (r3 = t3, t3 = 10), this._init(e2 || 0, t3 || 10, r3 || "be"));
}
var o;
"object" == typeof t2 ? t2.exports = s : (void 0).BN = s, s.BN = s, s.wordSize = 26;
try {
o = "undefined" != typeof window && void 0 !== window.Buffer ? window.Buffer : e("buffer").Buffer;
} catch (e2) {
}
function a(e2, t3) {
var r3 = e2.charCodeAt(t3);
return r3 >= 48 && r3 <= 57 ? r3 - 48 : r3 >= 65 && r3 <= 70 ? r3 - 55 : r3 >= 97 && r3 <= 102 ? r3 - 87 : void n(false, "Invalid character in " + e2);
}
function l(e2, t3, r3) {
var n2 = a(e2, r3);
return r3 - 1 >= t3 && (n2 |= a(e2, r3 - 1) << 4), n2;
}
function c(e2, t3, r3, i2) {
for (var s2 = 0, o2 = 0, a2 = Math.min(e2.length, r3), l2 = t3; l2 < a2; l2++) {
var c2 = e2.charCodeAt(l2) - 48;
s2 *= i2, o2 = c2 >= 49 ? c2 - 49 + 10 : c2 >= 17 ? c2 - 17 + 10 : c2, n(c2 >= 0 && o2 < i2, "Invalid character"), s2 += o2;
}
return s2;
}
function u(e2, t3) {
e2.words = t3.words, e2.length = t3.length, e2.negative = t3.negative, e2.red = t3.red;
}
if (s.isBN = function(e2) {
return e2 instanceof s || null !== e2 && "object" == typeof e2 && e2.constructor.wordSize === s.wordSize && Array.isArray(e2.words);
}, s.max = function(e2, t3) {
return e2.cmp(t3) > 0 ? e2 : t3;
}, s.min = function(e2, t3) {
return e2.cmp(t3) < 0 ? e2 : t3;
}, s.prototype._init = function(e2, t3, r3) {
if ("number" == typeof e2) return this._initNumber(e2, t3, r3);
if ("object" == typeof e2) return this._initArray(e2, t3, r3);
"hex" === t3 && (t3 = 16), n(t3 === (0 | t3) && t3 >= 2 && t3 <= 36);
var i2 = 0;
"-" === (e2 = e2.toString().replace(/\s+/g, ""))[0] && (i2++, this.negative = 1), i2 < e2.length && (16 === t3 ? this._parseHex(e2, i2, r3) : (this._parseBase(e2, t3, i2), "le" === r3 && this._initArray(this.toArray(), t3, r3)));
}, s.prototype._initNumber = function(e2, t3, r3) {
e2 < 0 && (this.negative = 1, e2 = -e2), e2 < 67108864 ? (this.words = [67108863 & e2], this.length = 1) : e2 < 4503599627370496 ? (this.words = [67108863 & e2, e2 / 67108864 & 67108863], this.length = 2) : (n(e2 < 9007199254740992), this.words = [67108863 & e2, e2 / 67108864 & 67108863, 1], this.length = 3), "le" === r3 && this._initArray(this.toArray(), t3, r3);
}, s.prototype._initArray = function(e2, t3, r3) {
if (n("number" == typeof e2.length), e2.length <= 0) return this.words = [0], this.length = 1, this;
this.length = Math.ceil(e2.length / 3), this.words = new Array(this.length);
for (var i2 = 0; i2 < this.length; i2++) this.words[i2] = 0;
var s2, o2, a2 = 0;
if ("be" === r3) for (i2 = e2.length - 1, s2 = 0; i2 >= 0; i2 -= 3) o2 = e2[i2] | e2[i2 - 1] << 8 | e2[i2 - 2] << 16, this.words[s2] |= o2 << a2 & 67108863, this.words[s2 + 1] = o2 >>> 26 - a2 & 67108863, (a2 += 24) >= 26 && (a2 -= 26, s2++);
else if ("le" === r3) for (i2 = 0, s2 = 0; i2 < e2.length; i2 += 3) o2 = e2[i2] | e2[i2 + 1] << 8 | e2[i2 + 2] << 16, this.words[s2] |= o2 << a2 & 67108863, this.words[s2 + 1] = o2 >>> 26 - a2 & 67108863, (a2 += 24) >= 26 && (a2 -= 26, s2++);
return this._strip();
}, s.prototype._parseHex = function(e2, t3, r3) {
this.length = Math.ceil((e2.length - t3) / 6), this.words = new Array(this.length);
for (var n2 = 0; n2 < this.length; n2++) this.words[n2] = 0;
var i2, s2 = 0, o2 = 0;
if ("be" === r3) for (n2 = e2.length - 1; n2 >= t3; n2 -= 2) i2 = l(e2, t3, n2) << s2, this.words[o2] |= 67108863 & i2, s2 >= 18 ? (s2 -= 18, o2 += 1, this.words[o2] |= i2 >>> 26) : s2 += 8;
else for (n2 = (e2.length - t3) % 2 == 0 ? t3 + 1 : t3; n2 < e2.length; n2 += 2) i2 = l(e2, t3, n2) << s2, this.words[o2] |= 67108863 & i2, s2 >= 18 ? (s2 -= 18, o2 += 1, this.words[o2] |= i2 >>> 26) : s2 += 8;
this._strip();
}, s.prototype._parseBase = function(e2, t3, r3) {
this.words = [0], this.length = 1;
for (var n2 = 0, i2 = 1; i2 <= 67108863; i2 *= t3) n2++;
n2--, i2 = i2 / t3 | 0;
for (var s2 = e2.length - r3, o2 = s2 % n2, a2 = Math.min(s2, s2 - o2) + r3, l2 = 0, u2 = r3; u2 < a2; u2 += n2) l2 = c(e2, u2, u2 + n2, t3), this.imuln(i2), this.words[0] + l2 < 67108864 ? this.words[0] += l2 : this._iaddn(l2);
if (0 !== o2) {
var h2 = 1;
for (l2 = c(e2, u2, e2.length, t3), u2 = 0; u2 < o2; u2++) h2 *= t3;
this.imuln(h2), this.words[0] + l2 < 67108864 ? this.words[0] += l2 : this._iaddn(l2);
}
this._strip();
}, s.prototype.copy = function(e2) {
e2.words = new Array(this.length);
for (var t3 = 0; t3 < this.length; t3++) e2.words[t3] = this.words[t3];
e2.length = this.length, e2.negative = this.negative, e2.red = this.red;
}, s.prototype._move = function(e2) {
u(e2, this);
}, s.prototype.clone = function() {
var e2 = new s(null);
return this.copy(e2), e2;
}, s.prototype._expand = function(e2) {
for (; this.length < e2; ) this.words[this.length++] = 0;
return this;
}, s.prototype._strip = function() {
for (; this.length > 1 && 0 === this.words[this.length - 1]; ) this.length--;
return this._normSign();
}, s.prototype._normSign = function() {
return 1 === this.length && 0 === this.words[0] && (this.negative = 0), this;
}, "undefined" != typeof Symbol && "function" == typeof Symbol.for) try {
s.prototype[Symbol.for("nodejs.util.inspect.custom")] = h;
} catch (e2) {
s.prototype.inspect = h;
}
else s.prototype.inspect = h;
function h() {
return (this.red ? "";
}
var f = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"], d = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], p = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176];
s.prototype.toString = function(e2, t3) {
var r3;
if (t3 = 0 | t3 || 1, 16 === (e2 = e2 || 10) || "hex" === e2) {
r3 = "";
for (var i2 = 0, s2 = 0, o2 = 0; o2 < this.length; o2++) {
var a2 = this.words[o2], l2 = (16777215 & (a2 << i2 | s2)).toString(16);
s2 = a2 >>> 24 - i2 & 16777215, (i2 += 2) >= 26 && (i2 -= 26, o2--), r3 = 0 !== s2 || o2 !== this.length - 1 ? f[6 - l2.length] + l2 + r3 : l2 + r3;
}
for (0 !== s2 && (r3 = s2.toString(16) + r3); r3.length % t3 != 0; ) r3 = "0" + r3;
return 0 !== this.negative && (r3 = "-" + r3), r3;
}
if (e2 === (0 | e2) && e2 >= 2 && e2 <= 36) {
var c2 = d[e2], u2 = p[e2];
r3 = "";
var h2 = this.clone();
for (h2.negative = 0; !h2.isZero(); ) {
var m2 = h2.modrn(u2).toString(e2);
r3 = (h2 = h2.idivn(u2)).isZero() ? m2 + r3 : f[c2 - m2.length] + m2 + r3;
}
for (this.isZero() && (r3 = "0" + r3); r3.length % t3 != 0; ) r3 = "0" + r3;
return 0 !== this.negative && (r3 = "-" + r3), r3;
}
n(false, "Base should be between 2 and 36");
}, s.prototype.toNumber = function() {
var e2 = this.words[0];
return 2 === this.length ? e2 += 67108864 * this.words[1] : 3 === this.length && 1 === this.words[2] ? e2 += 4503599627370496 + 67108864 * this.words[1] : this.length > 2 && n(false, "Number can only safely store up to 53 bits"), 0 !== this.negative ? -e2 : e2;
}, s.prototype.toJSON = function() {
return this.toString(16, 2);
}, o && (s.prototype.toBuffer = function(e2, t3) {
return this.toArrayLike(o, e2, t3);
}), s.prototype.toArray = function(e2, t3) {
return this.toArrayLike(Array, e2, t3);
};
function m(e2, t3, r3) {
r3.negative = t3.negative ^ e2.negative;
var n2 = e2.length + t3.length | 0;
r3.length = n2, n2 = n2 - 1 | 0;
var i2 = 0 | e2.words[0], s2 = 0 | t3.words[0], o2 = i2 * s2, a2 = 67108863 & o2, l2 = o2 / 67108864 | 0;
r3.words[0] = a2;
for (var c2 = 1; c2 < n2; c2++) {
for (var u2 = l2 >>> 26, h2 = 67108863 & l2, f2 = Math.min(c2, t3.length - 1), d2 = Math.max(0, c2 - e2.length + 1); d2 <= f2; d2++) {
var p2 = c2 - d2 | 0;
u2 += (o2 = (i2 = 0 | e2.words[p2]) * (s2 = 0 | t3.words[d2]) + h2) / 67108864 | 0, h2 = 67108863 & o2;
}
r3.words[c2] = 0 | h2, l2 = 0 | u2;
}
return 0 !== l2 ? r3.words[c2] = 0 | l2 : r3.length--, r3._strip();
}
s.prototype.toArrayLike = function(e2, t3, r3) {
this._strip();
var i2 = this.byteLength(), s2 = r3 || Math.max(1, i2);
n(i2 <= s2, "byte array longer than desired length"), n(s2 > 0, "Requested array length <= 0");
var o2 = (function(e3, t4) {
return e3.allocUnsafe ? e3.allocUnsafe(t4) : new e3(t4);
})(e2, s2);
return this["_toArrayLike" + ("le" === t3 ? "LE" : "BE")](o2, i2), o2;
}, s.prototype._toArrayLikeLE = function(e2, t3) {
for (var r3 = 0, n2 = 0, i2 = 0, s2 = 0; i2 < this.length; i2++) {
var o2 = this.words[i2] << s2 | n2;
e2[r3++] = 255 & o2, r3 < e2.length && (e2[r3++] = o2 >> 8 & 255), r3 < e2.length && (e2[r3++] = o2 >> 16 & 255), 6 === s2 ? (r3 < e2.length && (e2[r3++] = o2 >> 24 & 255), n2 = 0, s2 = 0) : (n2 = o2 >>> 24, s2 += 2);
}
if (r3 < e2.length) for (e2[r3++] = n2; r3 < e2.length; ) e2[r3++] = 0;
}, s.prototype._toArrayLikeBE = function(e2, t3) {
for (var r3 = e2.length - 1, n2 = 0, i2 = 0, s2 = 0; i2 < this.length; i2++) {
var o2 = this.words[i2] << s2 | n2;
e2[r3--] = 255 & o2, r3 >= 0 && (e2[r3--] = o2 >> 8 & 255), r3 >= 0 && (e2[r3--] = o2 >> 16 & 255), 6 === s2 ? (r3 >= 0 && (e2[r3--] = o2 >> 24 & 255), n2 = 0, s2 = 0) : (n2 = o2 >>> 24, s2 += 2);
}
if (r3 >= 0) for (e2[r3--] = n2; r3 >= 0; ) e2[r3--] = 0;
}, Math.clz32 ? s.prototype._countBits = function(e2) {
return 32 - Math.clz32(e2);
} : s.prototype._countBits = function(e2) {
var t3 = e2, r3 = 0;
return t3 >= 4096 && (r3 += 13, t3 >>>= 13), t3 >= 64 && (r3 += 7, t3 >>>= 7), t3 >= 8 && (r3 += 4, t3 >>>= 4), t3 >= 2 && (r3 += 2, t3 >>>= 2), r3 + t3;
}, s.prototype._zeroBits = function(e2) {
if (0 === e2) return 26;
var t3 = e2, r3 = 0;
return 0 == (8191 & t3) && (r3 += 13, t3 >>>= 13), 0 == (127 & t3) && (r3 += 7, t3 >>>= 7), 0 == (15 & t3) && (r3 += 4, t3 >>>= 4), 0 == (3 & t3) && (r3 += 2, t3 >>>= 2), 0 == (1 & t3) && r3++, r3;
}, s.prototype.bitLength = function() {
var e2 = this.words[this.length - 1], t3 = this._countBits(e2);
return 26 * (this.length - 1) + t3;
}, s.prototype.zeroBits = function() {
if (this.isZero()) return 0;
for (var e2 = 0, t3 = 0; t3 < this.length; t3++) {
var r3 = this._zeroBits(this.words[t3]);
if (e2 += r3, 26 !== r3) break;
}
return e2;
}, s.prototype.byteLength = function() {
return Math.ceil(this.bitLength() / 8);
}, s.prototype.toTwos = function(e2) {
return 0 !== this.negative ? this.abs().inotn(e2).iaddn(1) : this.clone();
}, s.prototype.fromTwos = function(e2) {
return this.testn(e2 - 1) ? this.notn(e2).iaddn(1).ineg() : this.clone();
}, s.prototype.isNeg = function() {
return 0 !== this.negative;
}, s.prototype.neg = function() {
return this.clone().ineg();
}, s.prototype.ineg = function() {
return this.isZero() || (this.negative ^= 1), this;
}, s.prototype.iuor = function(e2) {
for (; this.length < e2.length; ) this.words[this.length++] = 0;
for (var t3 = 0; t3 < e2.length; t3++) this.words[t3] = this.words[t3] | e2.words[t3];
return this._strip();
}, s.prototype.ior = function(e2) {
return n(0 == (this.negative | e2.negative)), this.iuor(e2);
}, s.prototype.or = function(e2) {
return this.length > e2.length ? this.clone().ior(e2) : e2.clone().ior(this);
}, s.prototype.uor = function(e2) {
return this.length > e2.length ? this.clone().iuor(e2) : e2.clone().iuor(this);
}, s.prototype.iuand = function(e2) {
var t3;
t3 = this.length > e2.length ? e2 : this;
for (var r3 = 0; r3 < t3.length; r3++) this.words[r3] = this.words[r3] & e2.words[r3];
return this.length = t3.length, this._strip();
}, s.prototype.iand = function(e2) {
return n(0 == (this.negative | e2.negative)), this.iuand(e2);
}, s.prototype.and = function(e2) {
return this.length > e2.length ? this.clone().iand(e2) : e2.clone().iand(this);
}, s.prototype.uand = function(e2) {
return this.length > e2.length ? this.clone().iuand(e2) : e2.clone().iuand(this);
}, s.prototype.iuxor = function(e2) {
var t3, r3;
this.length > e2.length ? (t3 = this, r3 = e2) : (t3 = e2, r3 = this);
for (var n2 = 0; n2 < r3.length; n2++) this.words[n2] = t3.words[n2] ^ r3.words[n2];
if (this !== t3) for (; n2 < t3.length; n2++) this.words[n2] = t3.words[n2];
return this.length = t3.length, this._strip();
}, s.prototype.ixor = function(e2) {
return n(0 == (this.negative | e2.negative)), this.iuxor(e2);
}, s.prototype.xor = function(e2) {
return this.length > e2.length ? this.clone().ixor(e2) : e2.clone().ixor(this);
}, s.prototype.uxor = function(e2) {
return this.length > e2.length ? this.clone().iuxor(e2) : e2.clone().iuxor(this);
}, s.prototype.inotn = function(e2) {
n("number" == typeof e2 && e2 >= 0);
var t3 = 0 | Math.ceil(e2 / 26), r3 = e2 % 26;
this._expand(t3), r3 > 0 && t3--;
for (var i2 = 0; i2 < t3; i2++) this.words[i2] = 67108863 & ~this.words[i2];
return r3 > 0 && (this.words[i2] = ~this.words[i2] & 67108863 >> 26 - r3), this._strip();
}, s.prototype.notn = function(e2) {
return this.clone().inotn(e2);
}, s.prototype.setn = function(e2, t3) {
n("number" == typeof e2 && e2 >= 0);
var r3 = e2 / 26 | 0, i2 = e2 % 26;
return this._expand(r3 + 1), this.words[r3] = t3 ? this.words[r3] | 1 << i2 : this.words[r3] & ~(1 << i2), this._strip();
}, s.prototype.iadd = function(e2) {
var t3, r3, n2;
if (0 !== this.negative && 0 === e2.negative) return this.negative = 0, t3 = this.isub(e2), this.negative ^= 1, this._normSign();
if (0 === this.negative && 0 !== e2.negative) return e2.negative = 0, t3 = this.isub(e2), e2.negative = 1, t3._normSign();
this.length > e2.length ? (r3 = this, n2 = e2) : (r3 = e2, n2 = this);
for (var i2 = 0, s2 = 0; s2 < n2.length; s2++) t3 = (0 | r3.words[s2]) + (0 | n2.words[s2]) + i2, this.words[s2] = 67108863 & t3, i2 = t3 >>> 26;
for (; 0 !== i2 && s2 < r3.length; s2++) t3 = (0 | r3.words[s2]) + i2, this.words[s2] = 67108863 & t3, i2 = t3 >>> 26;
if (this.length = r3.length, 0 !== i2) this.words[this.length] = i2, this.length++;
else if (r3 !== this) for (; s2 < r3.length; s2++) this.words[s2] = r3.words[s2];
return this;
}, s.prototype.add = function(e2) {
var t3;
return 0 !== e2.negative && 0 === this.negative ? (e2.negative = 0, t3 = this.sub(e2), e2.negative ^= 1, t3) : 0 === e2.negative && 0 !== this.negative ? (this.negative = 0, t3 = e2.sub(this), this.negative = 1, t3) : this.length > e2.length ? this.clone().iadd(e2) : e2.clone().iadd(this);
}, s.prototype.isub = function(e2) {
if (0 !== e2.negative) {
e2.negative = 0;
var t3 = this.iadd(e2);
return e2.negative = 1, t3._normSign();
}
if (0 !== this.negative) return this.negative = 0, this.iadd(e2), this.negative = 1, this._normSign();
var r3, n2, i2 = this.cmp(e2);
if (0 === i2) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
i2 > 0 ? (r3 = this, n2 = e2) : (r3 = e2, n2 = this);
for (var s2 = 0, o2 = 0; o2 < n2.length; o2++) s2 = (t3 = (0 | r3.words[o2]) - (0 | n2.words[o2]) + s2) >> 26, this.words[o2] = 67108863 & t3;
for (; 0 !== s2 && o2 < r3.length; o2++) s2 = (t3 = (0 | r3.words[o2]) + s2) >> 26, this.words[o2] = 67108863 & t3;
if (0 === s2 && o2 < r3.length && r3 !== this) for (; o2 < r3.length; o2++) this.words[o2] = r3.words[o2];
return this.length = Math.max(this.length, o2), r3 !== this && (this.negative = 1), this._strip();
}, s.prototype.sub = function(e2) {
return this.clone().isub(e2);
};
var b = function(e2, t3, r3) {
var n2, i2, s2, o2 = e2.words, a2 = t3.words, l2 = r3.words, c2 = 0, u2 = 0 | o2[0], h2 = 8191 & u2, f2 = u2 >>> 13, d2 = 0 | o2[1], p2 = 8191 & d2, m2 = d2 >>> 13, b2 = 0 | o2[2], g2 = 8191 & b2, y2 = b2 >>> 13, v = 0 | o2[3], w2 = 8191 & v, _2 = v >>> 13, x2 = 0 | o2[4], k2 = 8191 & x2, S2 = x2 >>> 13, M2 = 0 | o2[5], C2 = 8191 & M2, T2 = M2 >>> 13, E = 0 | o2[6], A = 8191 & E, R = E >>> 13, O = 0 | o2[7], j = 8191 & O, I = O >>> 13, N = 0 | o2[8], P = 8191 & N, B = N >>> 13, D = 0 | o2[9], F = 8191 & D, L = D >>> 13, z = 0 | a2[0], U = 8191 & z, $ = z >>> 13, H = 0 | a2[1], V = 8191 & H, q = H >>> 13, W = 0 | a2[2], X = 8191 & W, K = W >>> 13, Y = 0 | a2[3], Z = 8191 & Y, G = Y >>> 13, J = 0 | a2[4], Q = 8191 & J, ee = J >>> 13, te = 0 | a2[5], re = 8191 & te, ne = te >>> 13, ie = 0 | a2[6], se = 8191 & ie, oe = ie >>> 13, ae = 0 | a2[7], le = 8191 & ae, ce = ae >>> 13, ue = 0 | a2[8], he = 8191 & ue, fe = ue >>> 13, de = 0 | a2[9], pe = 8191 & de, me = de >>> 13;
r3.negative = e2.negative ^ t3.negative, r3.length = 19;
var be = (c2 + (n2 = Math.imul(h2, U)) | 0) + ((8191 & (i2 = (i2 = Math.imul(h2, $)) + Math.imul(f2, U) | 0)) << 13) | 0;
c2 = ((s2 = Math.imul(f2, $)) + (i2 >>> 13) | 0) + (be >>> 26) | 0, be &= 67108863, n2 = Math.imul(p2, U), i2 = (i2 = Math.imul(p2, $)) + Math.imul(m2, U) | 0, s2 = Math.imul(m2, $);
var ge = (c2 + (n2 = n2 + Math.imul(h2, V) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, q) | 0) + Math.imul(f2, V) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, q) | 0) + (i2 >>> 13) | 0) + (ge >>> 26) | 0, ge &= 67108863, n2 = Math.imul(g2, U), i2 = (i2 = Math.imul(g2, $)) + Math.imul(y2, U) | 0, s2 = Math.imul(y2, $), n2 = n2 + Math.imul(p2, V) | 0, i2 = (i2 = i2 + Math.imul(p2, q) | 0) + Math.imul(m2, V) | 0, s2 = s2 + Math.imul(m2, q) | 0;
var ye = (c2 + (n2 = n2 + Math.imul(h2, X) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, K) | 0) + Math.imul(f2, X) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, K) | 0) + (i2 >>> 13) | 0) + (ye >>> 26) | 0, ye &= 67108863, n2 = Math.imul(w2, U), i2 = (i2 = Math.imul(w2, $)) + Math.imul(_2, U) | 0, s2 = Math.imul(_2, $), n2 = n2 + Math.imul(g2, V) | 0, i2 = (i2 = i2 + Math.imul(g2, q) | 0) + Math.imul(y2, V) | 0, s2 = s2 + Math.imul(y2, q) | 0, n2 = n2 + Math.imul(p2, X) | 0, i2 = (i2 = i2 + Math.imul(p2, K) | 0) + Math.imul(m2, X) | 0, s2 = s2 + Math.imul(m2, K) | 0;
var ve = (c2 + (n2 = n2 + Math.imul(h2, Z) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, G) | 0) + Math.imul(f2, Z) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, G) | 0) + (i2 >>> 13) | 0) + (ve >>> 26) | 0, ve &= 67108863, n2 = Math.imul(k2, U), i2 = (i2 = Math.imul(k2, $)) + Math.imul(S2, U) | 0, s2 = Math.imul(S2, $), n2 = n2 + Math.imul(w2, V) | 0, i2 = (i2 = i2 + Math.imul(w2, q) | 0) + Math.imul(_2, V) | 0, s2 = s2 + Math.imul(_2, q) | 0, n2 = n2 + Math.imul(g2, X) | 0, i2 = (i2 = i2 + Math.imul(g2, K) | 0) + Math.imul(y2, X) | 0, s2 = s2 + Math.imul(y2, K) | 0, n2 = n2 + Math.imul(p2, Z) | 0, i2 = (i2 = i2 + Math.imul(p2, G) | 0) + Math.imul(m2, Z) | 0, s2 = s2 + Math.imul(m2, G) | 0;
var we = (c2 + (n2 = n2 + Math.imul(h2, Q) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, ee) | 0) + Math.imul(f2, Q) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, ee) | 0) + (i2 >>> 13) | 0) + (we >>> 26) | 0, we &= 67108863, n2 = Math.imul(C2, U), i2 = (i2 = Math.imul(C2, $)) + Math.imul(T2, U) | 0, s2 = Math.imul(T2, $), n2 = n2 + Math.imul(k2, V) | 0, i2 = (i2 = i2 + Math.imul(k2, q) | 0) + Math.imul(S2, V) | 0, s2 = s2 + Math.imul(S2, q) | 0, n2 = n2 + Math.imul(w2, X) | 0, i2 = (i2 = i2 + Math.imul(w2, K) | 0) + Math.imul(_2, X) | 0, s2 = s2 + Math.imul(_2, K) | 0, n2 = n2 + Math.imul(g2, Z) | 0, i2 = (i2 = i2 + Math.imul(g2, G) | 0) + Math.imul(y2, Z) | 0, s2 = s2 + Math.imul(y2, G) | 0, n2 = n2 + Math.imul(p2, Q) | 0, i2 = (i2 = i2 + Math.imul(p2, ee) | 0) + Math.imul(m2, Q) | 0, s2 = s2 + Math.imul(m2, ee) | 0;
var _e = (c2 + (n2 = n2 + Math.imul(h2, re) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, ne) | 0) + Math.imul(f2, re) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, ne) | 0) + (i2 >>> 13) | 0) + (_e >>> 26) | 0, _e &= 67108863, n2 = Math.imul(A, U), i2 = (i2 = Math.imul(A, $)) + Math.imul(R, U) | 0, s2 = Math.imul(R, $), n2 = n2 + Math.imul(C2, V) | 0, i2 = (i2 = i2 + Math.imul(C2, q) | 0) + Math.imul(T2, V) | 0, s2 = s2 + Math.imul(T2, q) | 0, n2 = n2 + Math.imul(k2, X) | 0, i2 = (i2 = i2 + Math.imul(k2, K) | 0) + Math.imul(S2, X) | 0, s2 = s2 + Math.imul(S2, K) | 0, n2 = n2 + Math.imul(w2, Z) | 0, i2 = (i2 = i2 + Math.imul(w2, G) | 0) + Math.imul(_2, Z) | 0, s2 = s2 + Math.imul(_2, G) | 0, n2 = n2 + Math.imul(g2, Q) | 0, i2 = (i2 = i2 + Math.imul(g2, ee) | 0) + Math.imul(y2, Q) | 0, s2 = s2 + Math.imul(y2, ee) | 0, n2 = n2 + Math.imul(p2, re) | 0, i2 = (i2 = i2 + Math.imul(p2, ne) | 0) + Math.imul(m2, re) | 0, s2 = s2 + Math.imul(m2, ne) | 0;
var xe = (c2 + (n2 = n2 + Math.imul(h2, se) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, oe) | 0) + Math.imul(f2, se) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, oe) | 0) + (i2 >>> 13) | 0) + (xe >>> 26) | 0, xe &= 67108863, n2 = Math.imul(j, U), i2 = (i2 = Math.imul(j, $)) + Math.imul(I, U) | 0, s2 = Math.imul(I, $), n2 = n2 + Math.imul(A, V) | 0, i2 = (i2 = i2 + Math.imul(A, q) | 0) + Math.imul(R, V) | 0, s2 = s2 + Math.imul(R, q) | 0, n2 = n2 + Math.imul(C2, X) | 0, i2 = (i2 = i2 + Math.imul(C2, K) | 0) + Math.imul(T2, X) | 0, s2 = s2 + Math.imul(T2, K) | 0, n2 = n2 + Math.imul(k2, Z) | 0, i2 = (i2 = i2 + Math.imul(k2, G) | 0) + Math.imul(S2, Z) | 0, s2 = s2 + Math.imul(S2, G) | 0, n2 = n2 + Math.imul(w2, Q) | 0, i2 = (i2 = i2 + Math.imul(w2, ee) | 0) + Math.imul(_2, Q) | 0, s2 = s2 + Math.imul(_2, ee) | 0, n2 = n2 + Math.imul(g2, re) | 0, i2 = (i2 = i2 + Math.imul(g2, ne) | 0) + Math.imul(y2, re) | 0, s2 = s2 + Math.imul(y2, ne) | 0, n2 = n2 + Math.imul(p2, se) | 0, i2 = (i2 = i2 + Math.imul(p2, oe) | 0) + Math.imul(m2, se) | 0, s2 = s2 + Math.imul(m2, oe) | 0;
var ke = (c2 + (n2 = n2 + Math.imul(h2, le) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, ce) | 0) + Math.imul(f2, le) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, ce) | 0) + (i2 >>> 13) | 0) + (ke >>> 26) | 0, ke &= 67108863, n2 = Math.imul(P, U), i2 = (i2 = Math.imul(P, $)) + Math.imul(B, U) | 0, s2 = Math.imul(B, $), n2 = n2 + Math.imul(j, V) | 0, i2 = (i2 = i2 + Math.imul(j, q) | 0) + Math.imul(I, V) | 0, s2 = s2 + Math.imul(I, q) | 0, n2 = n2 + Math.imul(A, X) | 0, i2 = (i2 = i2 + Math.imul(A, K) | 0) + Math.imul(R, X) | 0, s2 = s2 + Math.imul(R, K) | 0, n2 = n2 + Math.imul(C2, Z) | 0, i2 = (i2 = i2 + Math.imul(C2, G) | 0) + Math.imul(T2, Z) | 0, s2 = s2 + Math.imul(T2, G) | 0, n2 = n2 + Math.imul(k2, Q) | 0, i2 = (i2 = i2 + Math.imul(k2, ee) | 0) + Math.imul(S2, Q) | 0, s2 = s2 + Math.imul(S2, ee) | 0, n2 = n2 + Math.imul(w2, re) | 0, i2 = (i2 = i2 + Math.imul(w2, ne) | 0) + Math.imul(_2, re) | 0, s2 = s2 + Math.imul(_2, ne) | 0, n2 = n2 + Math.imul(g2, se) | 0, i2 = (i2 = i2 + Math.imul(g2, oe) | 0) + Math.imul(y2, se) | 0, s2 = s2 + Math.imul(y2, oe) | 0, n2 = n2 + Math.imul(p2, le) | 0, i2 = (i2 = i2 + Math.imul(p2, ce) | 0) + Math.imul(m2, le) | 0, s2 = s2 + Math.imul(m2, ce) | 0;
var Se = (c2 + (n2 = n2 + Math.imul(h2, he) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, fe) | 0) + Math.imul(f2, he) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, fe) | 0) + (i2 >>> 13) | 0) + (Se >>> 26) | 0, Se &= 67108863, n2 = Math.imul(F, U), i2 = (i2 = Math.imul(F, $)) + Math.imul(L, U) | 0, s2 = Math.imul(L, $), n2 = n2 + Math.imul(P, V) | 0, i2 = (i2 = i2 + Math.imul(P, q) | 0) + Math.imul(B, V) | 0, s2 = s2 + Math.imul(B, q) | 0, n2 = n2 + Math.imul(j, X) | 0, i2 = (i2 = i2 + Math.imul(j, K) | 0) + Math.imul(I, X) | 0, s2 = s2 + Math.imul(I, K) | 0, n2 = n2 + Math.imul(A, Z) | 0, i2 = (i2 = i2 + Math.imul(A, G) | 0) + Math.imul(R, Z) | 0, s2 = s2 + Math.imul(R, G) | 0, n2 = n2 + Math.imul(C2, Q) | 0, i2 = (i2 = i2 + Math.imul(C2, ee) | 0) + Math.imul(T2, Q) | 0, s2 = s2 + Math.imul(T2, ee) | 0, n2 = n2 + Math.imul(k2, re) | 0, i2 = (i2 = i2 + Math.imul(k2, ne) | 0) + Math.imul(S2, re) | 0, s2 = s2 + Math.imul(S2, ne) | 0, n2 = n2 + Math.imul(w2, se) | 0, i2 = (i2 = i2 + Math.imul(w2, oe) | 0) + Math.imul(_2, se) | 0, s2 = s2 + Math.imul(_2, oe) | 0, n2 = n2 + Math.imul(g2, le) | 0, i2 = (i2 = i2 + Math.imul(g2, ce) | 0) + Math.imul(y2, le) | 0, s2 = s2 + Math.imul(y2, ce) | 0, n2 = n2 + Math.imul(p2, he) | 0, i2 = (i2 = i2 + Math.imul(p2, fe) | 0) + Math.imul(m2, he) | 0, s2 = s2 + Math.imul(m2, fe) | 0;
var Me = (c2 + (n2 = n2 + Math.imul(h2, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(h2, me) | 0) + Math.imul(f2, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(f2, me) | 0) + (i2 >>> 13) | 0) + (Me >>> 26) | 0, Me &= 67108863, n2 = Math.imul(F, V), i2 = (i2 = Math.imul(F, q)) + Math.imul(L, V) | 0, s2 = Math.imul(L, q), n2 = n2 + Math.imul(P, X) | 0, i2 = (i2 = i2 + Math.imul(P, K) | 0) + Math.imul(B, X) | 0, s2 = s2 + Math.imul(B, K) | 0, n2 = n2 + Math.imul(j, Z) | 0, i2 = (i2 = i2 + Math.imul(j, G) | 0) + Math.imul(I, Z) | 0, s2 = s2 + Math.imul(I, G) | 0, n2 = n2 + Math.imul(A, Q) | 0, i2 = (i2 = i2 + Math.imul(A, ee) | 0) + Math.imul(R, Q) | 0, s2 = s2 + Math.imul(R, ee) | 0, n2 = n2 + Math.imul(C2, re) | 0, i2 = (i2 = i2 + Math.imul(C2, ne) | 0) + Math.imul(T2, re) | 0, s2 = s2 + Math.imul(T2, ne) | 0, n2 = n2 + Math.imul(k2, se) | 0, i2 = (i2 = i2 + Math.imul(k2, oe) | 0) + Math.imul(S2, se) | 0, s2 = s2 + Math.imul(S2, oe) | 0, n2 = n2 + Math.imul(w2, le) | 0, i2 = (i2 = i2 + Math.imul(w2, ce) | 0) + Math.imul(_2, le) | 0, s2 = s2 + Math.imul(_2, ce) | 0, n2 = n2 + Math.imul(g2, he) | 0, i2 = (i2 = i2 + Math.imul(g2, fe) | 0) + Math.imul(y2, he) | 0, s2 = s2 + Math.imul(y2, fe) | 0;
var Ce = (c2 + (n2 = n2 + Math.imul(p2, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(p2, me) | 0) + Math.imul(m2, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(m2, me) | 0) + (i2 >>> 13) | 0) + (Ce >>> 26) | 0, Ce &= 67108863, n2 = Math.imul(F, X), i2 = (i2 = Math.imul(F, K)) + Math.imul(L, X) | 0, s2 = Math.imul(L, K), n2 = n2 + Math.imul(P, Z) | 0, i2 = (i2 = i2 + Math.imul(P, G) | 0) + Math.imul(B, Z) | 0, s2 = s2 + Math.imul(B, G) | 0, n2 = n2 + Math.imul(j, Q) | 0, i2 = (i2 = i2 + Math.imul(j, ee) | 0) + Math.imul(I, Q) | 0, s2 = s2 + Math.imul(I, ee) | 0, n2 = n2 + Math.imul(A, re) | 0, i2 = (i2 = i2 + Math.imul(A, ne) | 0) + Math.imul(R, re) | 0, s2 = s2 + Math.imul(R, ne) | 0, n2 = n2 + Math.imul(C2, se) | 0, i2 = (i2 = i2 + Math.imul(C2, oe) | 0) + Math.imul(T2, se) | 0, s2 = s2 + Math.imul(T2, oe) | 0, n2 = n2 + Math.imul(k2, le) | 0, i2 = (i2 = i2 + Math.imul(k2, ce) | 0) + Math.imul(S2, le) | 0, s2 = s2 + Math.imul(S2, ce) | 0, n2 = n2 + Math.imul(w2, he) | 0, i2 = (i2 = i2 + Math.imul(w2, fe) | 0) + Math.imul(_2, he) | 0, s2 = s2 + Math.imul(_2, fe) | 0;
var Te = (c2 + (n2 = n2 + Math.imul(g2, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(g2, me) | 0) + Math.imul(y2, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(y2, me) | 0) + (i2 >>> 13) | 0) + (Te >>> 26) | 0, Te &= 67108863, n2 = Math.imul(F, Z), i2 = (i2 = Math.imul(F, G)) + Math.imul(L, Z) | 0, s2 = Math.imul(L, G), n2 = n2 + Math.imul(P, Q) | 0, i2 = (i2 = i2 + Math.imul(P, ee) | 0) + Math.imul(B, Q) | 0, s2 = s2 + Math.imul(B, ee) | 0, n2 = n2 + Math.imul(j, re) | 0, i2 = (i2 = i2 + Math.imul(j, ne) | 0) + Math.imul(I, re) | 0, s2 = s2 + Math.imul(I, ne) | 0, n2 = n2 + Math.imul(A, se) | 0, i2 = (i2 = i2 + Math.imul(A, oe) | 0) + Math.imul(R, se) | 0, s2 = s2 + Math.imul(R, oe) | 0, n2 = n2 + Math.imul(C2, le) | 0, i2 = (i2 = i2 + Math.imul(C2, ce) | 0) + Math.imul(T2, le) | 0, s2 = s2 + Math.imul(T2, ce) | 0, n2 = n2 + Math.imul(k2, he) | 0, i2 = (i2 = i2 + Math.imul(k2, fe) | 0) + Math.imul(S2, he) | 0, s2 = s2 + Math.imul(S2, fe) | 0;
var Ee = (c2 + (n2 = n2 + Math.imul(w2, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(w2, me) | 0) + Math.imul(_2, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(_2, me) | 0) + (i2 >>> 13) | 0) + (Ee >>> 26) | 0, Ee &= 67108863, n2 = Math.imul(F, Q), i2 = (i2 = Math.imul(F, ee)) + Math.imul(L, Q) | 0, s2 = Math.imul(L, ee), n2 = n2 + Math.imul(P, re) | 0, i2 = (i2 = i2 + Math.imul(P, ne) | 0) + Math.imul(B, re) | 0, s2 = s2 + Math.imul(B, ne) | 0, n2 = n2 + Math.imul(j, se) | 0, i2 = (i2 = i2 + Math.imul(j, oe) | 0) + Math.imul(I, se) | 0, s2 = s2 + Math.imul(I, oe) | 0, n2 = n2 + Math.imul(A, le) | 0, i2 = (i2 = i2 + Math.imul(A, ce) | 0) + Math.imul(R, le) | 0, s2 = s2 + Math.imul(R, ce) | 0, n2 = n2 + Math.imul(C2, he) | 0, i2 = (i2 = i2 + Math.imul(C2, fe) | 0) + Math.imul(T2, he) | 0, s2 = s2 + Math.imul(T2, fe) | 0;
var Ae = (c2 + (n2 = n2 + Math.imul(k2, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(k2, me) | 0) + Math.imul(S2, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(S2, me) | 0) + (i2 >>> 13) | 0) + (Ae >>> 26) | 0, Ae &= 67108863, n2 = Math.imul(F, re), i2 = (i2 = Math.imul(F, ne)) + Math.imul(L, re) | 0, s2 = Math.imul(L, ne), n2 = n2 + Math.imul(P, se) | 0, i2 = (i2 = i2 + Math.imul(P, oe) | 0) + Math.imul(B, se) | 0, s2 = s2 + Math.imul(B, oe) | 0, n2 = n2 + Math.imul(j, le) | 0, i2 = (i2 = i2 + Math.imul(j, ce) | 0) + Math.imul(I, le) | 0, s2 = s2 + Math.imul(I, ce) | 0, n2 = n2 + Math.imul(A, he) | 0, i2 = (i2 = i2 + Math.imul(A, fe) | 0) + Math.imul(R, he) | 0, s2 = s2 + Math.imul(R, fe) | 0;
var Re = (c2 + (n2 = n2 + Math.imul(C2, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(C2, me) | 0) + Math.imul(T2, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(T2, me) | 0) + (i2 >>> 13) | 0) + (Re >>> 26) | 0, Re &= 67108863, n2 = Math.imul(F, se), i2 = (i2 = Math.imul(F, oe)) + Math.imul(L, se) | 0, s2 = Math.imul(L, oe), n2 = n2 + Math.imul(P, le) | 0, i2 = (i2 = i2 + Math.imul(P, ce) | 0) + Math.imul(B, le) | 0, s2 = s2 + Math.imul(B, ce) | 0, n2 = n2 + Math.imul(j, he) | 0, i2 = (i2 = i2 + Math.imul(j, fe) | 0) + Math.imul(I, he) | 0, s2 = s2 + Math.imul(I, fe) | 0;
var Oe = (c2 + (n2 = n2 + Math.imul(A, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(A, me) | 0) + Math.imul(R, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(R, me) | 0) + (i2 >>> 13) | 0) + (Oe >>> 26) | 0, Oe &= 67108863, n2 = Math.imul(F, le), i2 = (i2 = Math.imul(F, ce)) + Math.imul(L, le) | 0, s2 = Math.imul(L, ce), n2 = n2 + Math.imul(P, he) | 0, i2 = (i2 = i2 + Math.imul(P, fe) | 0) + Math.imul(B, he) | 0, s2 = s2 + Math.imul(B, fe) | 0;
var je = (c2 + (n2 = n2 + Math.imul(j, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(j, me) | 0) + Math.imul(I, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(I, me) | 0) + (i2 >>> 13) | 0) + (je >>> 26) | 0, je &= 67108863, n2 = Math.imul(F, he), i2 = (i2 = Math.imul(F, fe)) + Math.imul(L, he) | 0, s2 = Math.imul(L, fe);
var Ie = (c2 + (n2 = n2 + Math.imul(P, pe) | 0) | 0) + ((8191 & (i2 = (i2 = i2 + Math.imul(P, me) | 0) + Math.imul(B, pe) | 0)) << 13) | 0;
c2 = ((s2 = s2 + Math.imul(B, me) | 0) + (i2 >>> 13) | 0) + (Ie >>> 26) | 0, Ie &= 67108863;
var Ne = (c2 + (n2 = Math.imul(F, pe)) | 0) + ((8191 & (i2 = (i2 = Math.imul(F, me)) + Math.imul(L, pe) | 0)) << 13) | 0;
return c2 = ((s2 = Math.imul(L, me)) + (i2 >>> 13) | 0) + (Ne >>> 26) | 0, Ne &= 67108863, l2[0] = be, l2[1] = ge, l2[2] = ye, l2[3] = ve, l2[4] = we, l2[5] = _e, l2[6] = xe, l2[7] = ke, l2[8] = Se, l2[9] = Me, l2[10] = Ce, l2[11] = Te, l2[12] = Ee, l2[13] = Ae, l2[14] = Re, l2[15] = Oe, l2[16] = je, l2[17] = Ie, l2[18] = Ne, 0 !== c2 && (l2[19] = c2, r3.length++), r3;
};
function g(e2, t3, r3) {
r3.negative = t3.negative ^ e2.negative, r3.length = e2.length + t3.length;
for (var n2 = 0, i2 = 0, s2 = 0; s2 < r3.length - 1; s2++) {
var o2 = i2;
i2 = 0;
for (var a2 = 67108863 & n2, l2 = Math.min(s2, t3.length - 1), c2 = Math.max(0, s2 - e2.length + 1); c2 <= l2; c2++) {
var u2 = s2 - c2, h2 = (0 | e2.words[u2]) * (0 | t3.words[c2]), f2 = 67108863 & h2;
a2 = 67108863 & (f2 = f2 + a2 | 0), i2 += (o2 = (o2 = o2 + (h2 / 67108864 | 0) | 0) + (f2 >>> 26) | 0) >>> 26, o2 &= 67108863;
}
r3.words[s2] = a2, n2 = o2, o2 = i2;
}
return 0 !== n2 ? r3.words[s2] = n2 : r3.length--, r3._strip();
}
function y(e2, t3, r3) {
return g(e2, t3, r3);
}
Math.imul || (b = m), s.prototype.mulTo = function(e2, t3) {
var r3 = this.length + e2.length;
return 10 === this.length && 10 === e2.length ? b(this, e2, t3) : r3 < 63 ? m(this, e2, t3) : r3 < 1024 ? g(this, e2, t3) : y(this, e2, t3);
}, s.prototype.mul = function(e2) {
var t3 = new s(null);
return t3.words = new Array(this.length + e2.length), this.mulTo(e2, t3);
}, s.prototype.mulf = function(e2) {
var t3 = new s(null);
return t3.words = new Array(this.length + e2.length), y(this, e2, t3);
}, s.prototype.imul = function(e2) {
return this.clone().mulTo(e2, this);
}, s.prototype.imuln = function(e2) {
var t3 = e2 < 0;
t3 && (e2 = -e2), n("number" == typeof e2), n(e2 < 67108864);
for (var r3 = 0, i2 = 0; i2 < this.length; i2++) {
var s2 = (0 | this.words[i2]) * e2, o2 = (67108863 & s2) + (67108863 & r3);
r3 >>= 26, r3 += s2 / 67108864 | 0, r3 += o2 >>> 26, this.words[i2] = 67108863 & o2;
}
return 0 !== r3 && (this.words[i2] = r3, this.length++), t3 ? this.ineg() : this;
}, s.prototype.muln = function(e2) {
return this.clone().imuln(e2);
}, s.prototype.sqr = function() {
return this.mul(this);
}, s.prototype.isqr = function() {
return this.imul(this.clone());
}, s.prototype.pow = function(e2) {
var t3 = (function(e3) {
for (var t4 = new Array(e3.bitLength()), r4 = 0; r4 < t4.length; r4++) {
var n3 = r4 / 26 | 0, i3 = r4 % 26;
t4[r4] = e3.words[n3] >>> i3 & 1;
}
return t4;
})(e2);
if (0 === t3.length) return new s(1);
for (var r3 = this, n2 = 0; n2 < t3.length && 0 === t3[n2]; n2++, r3 = r3.sqr()) ;
if (++n2 < t3.length) for (var i2 = r3.sqr(); n2 < t3.length; n2++, i2 = i2.sqr()) 0 !== t3[n2] && (r3 = r3.mul(i2));
return r3;
}, s.prototype.iushln = function(e2) {
n("number" == typeof e2 && e2 >= 0);
var t3, r3 = e2 % 26, i2 = (e2 - r3) / 26, s2 = 67108863 >>> 26 - r3 << 26 - r3;
if (0 !== r3) {
var o2 = 0;
for (t3 = 0; t3 < this.length; t3++) {
var a2 = this.words[t3] & s2, l2 = (0 | this.words[t3]) - a2 << r3;
this.words[t3] = l2 | o2, o2 = a2 >>> 26 - r3;
}
o2 && (this.words[t3] = o2, this.length++);
}
if (0 !== i2) {
for (t3 = this.length - 1; t3 >= 0; t3--) this.words[t3 + i2] = this.words[t3];
for (t3 = 0; t3 < i2; t3++) this.words[t3] = 0;
this.length += i2;
}
return this._strip();
}, s.prototype.ishln = function(e2) {
return n(0 === this.negative), this.iushln(e2);
}, s.prototype.iushrn = function(e2, t3, r3) {
var i2;
n("number" == typeof e2 && e2 >= 0), i2 = t3 ? (t3 - t3 % 26) / 26 : 0;
var s2 = e2 % 26, o2 = Math.min((e2 - s2) / 26, this.length), a2 = 67108863 ^ 67108863 >>> s2 << s2, l2 = r3;
if (i2 -= o2, i2 = Math.max(0, i2), l2) {
for (var c2 = 0; c2 < o2; c2++) l2.words[c2] = this.words[c2];
l2.length = o2;
}
if (0 === o2) ;
else if (this.length > o2) for (this.length -= o2, c2 = 0; c2 < this.length; c2++) this.words[c2] = this.words[c2 + o2];
else this.words[0] = 0, this.length = 1;
var u2 = 0;
for (c2 = this.length - 1; c2 >= 0 && (0 !== u2 || c2 >= i2); c2--) {
var h2 = 0 | this.words[c2];
this.words[c2] = u2 << 26 - s2 | h2 >>> s2, u2 = h2 & a2;
}
return l2 && 0 !== u2 && (l2.words[l2.length++] = u2), 0 === this.length && (this.words[0] = 0, this.length = 1), this._strip();
}, s.prototype.ishrn = function(e2, t3, r3) {
return n(0 === this.negative), this.iushrn(e2, t3, r3);
}, s.prototype.shln = function(e2) {
return this.clone().ishln(e2);
}, s.prototype.ushln = function(e2) {
return this.clone().iushln(e2);
}, s.prototype.shrn = function(e2) {
return this.clone().ishrn(e2);
}, s.prototype.ushrn = function(e2) {
return this.clone().iushrn(e2);
}, s.prototype.testn = function(e2) {
n("number" == typeof e2 && e2 >= 0);
var t3 = e2 % 26, r3 = (e2 - t3) / 26, i2 = 1 << t3;
return !(this.length <= r3) && !!(this.words[r3] & i2);
}, s.prototype.imaskn = function(e2) {
n("number" == typeof e2 && e2 >= 0);
var t3 = e2 % 26, r3 = (e2 - t3) / 26;
if (n(0 === this.negative, "imaskn works only with positive numbers"), this.length <= r3) return this;
if (0 !== t3 && r3++, this.length = Math.min(r3, this.length), 0 !== t3) {
var i2 = 67108863 ^ 67108863 >>> t3 << t3;
this.words[this.length - 1] &= i2;
}
return this._strip();
}, s.prototype.maskn = function(e2) {
return this.clone().imaskn(e2);
}, s.prototype.iaddn = function(e2) {
return n("number" == typeof e2), n(e2 < 67108864), e2 < 0 ? this.isubn(-e2) : 0 !== this.negative ? 1 === this.length && (0 | this.words[0]) <= e2 ? (this.words[0] = e2 - (0 | this.words[0]), this.negative = 0, this) : (this.negative = 0, this.isubn(e2), this.negative = 1, this) : this._iaddn(e2);
}, s.prototype._iaddn = function(e2) {
this.words[0] += e2;
for (var t3 = 0; t3 < this.length && this.words[t3] >= 67108864; t3++) this.words[t3] -= 67108864, t3 === this.length - 1 ? this.words[t3 + 1] = 1 : this.words[t3 + 1]++;
return this.length = Math.max(this.length, t3 + 1), this;
}, s.prototype.isubn = function(e2) {
if (n("number" == typeof e2), n(e2 < 67108864), e2 < 0) return this.iaddn(-e2);
if (0 !== this.negative) return this.negative = 0, this.iaddn(e2), this.negative = 1, this;
if (this.words[0] -= e2, 1 === this.length && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1;
else for (var t3 = 0; t3 < this.length && this.words[t3] < 0; t3++) this.words[t3] += 67108864, this.words[t3 + 1] -= 1;
return this._strip();
}, s.prototype.addn = function(e2) {
return this.clone().iaddn(e2);
}, s.prototype.subn = function(e2) {
return this.clone().isubn(e2);
}, s.prototype.iabs = function() {
return this.negative = 0, this;
}, s.prototype.abs = function() {
return this.clone().iabs();
}, s.prototype._ishlnsubmul = function(e2, t3, r3) {
var i2, s2, o2 = e2.length + r3;
this._expand(o2);
var a2 = 0;
for (i2 = 0; i2 < e2.length; i2++) {
s2 = (0 | this.words[i2 + r3]) + a2;
var l2 = (0 | e2.words[i2]) * t3;
a2 = ((s2 -= 67108863 & l2) >> 26) - (l2 / 67108864 | 0), this.words[i2 + r3] = 67108863 & s2;
}
for (; i2 < this.length - r3; i2++) a2 = (s2 = (0 | this.words[i2 + r3]) + a2) >> 26, this.words[i2 + r3] = 67108863 & s2;
if (0 === a2) return this._strip();
for (n(-1 === a2), a2 = 0, i2 = 0; i2 < this.length; i2++) a2 = (s2 = -(0 | this.words[i2]) + a2) >> 26, this.words[i2] = 67108863 & s2;
return this.negative = 1, this._strip();
}, s.prototype._wordDiv = function(e2, t3) {
var r3 = (this.length, e2.length), n2 = this.clone(), i2 = e2, o2 = 0 | i2.words[i2.length - 1];
0 !== (r3 = 26 - this._countBits(o2)) && (i2 = i2.ushln(r3), n2.iushln(r3), o2 = 0 | i2.words[i2.length - 1]);
var a2, l2 = n2.length - i2.length;
if ("mod" !== t3) {
(a2 = new s(null)).length = l2 + 1, a2.words = new Array(a2.length);
for (var c2 = 0; c2 < a2.length; c2++) a2.words[c2] = 0;
}
var u2 = n2.clone()._ishlnsubmul(i2, 1, l2);
0 === u2.negative && (n2 = u2, a2 && (a2.words[l2] = 1));
for (var h2 = l2 - 1; h2 >= 0; h2--) {
var f2 = 67108864 * (0 | n2.words[i2.length + h2]) + (0 | n2.words[i2.length + h2 - 1]);
for (f2 = Math.min(f2 / o2 | 0, 67108863), n2._ishlnsubmul(i2, f2, h2); 0 !== n2.negative; ) f2--, n2.negative = 0, n2._ishlnsubmul(i2, 1, h2), n2.isZero() || (n2.negative ^= 1);
a2 && (a2.words[h2] = f2);
}
return a2 && a2._strip(), n2._strip(), "div" !== t3 && 0 !== r3 && n2.iushrn(r3), { div: a2 || null, mod: n2 };
}, s.prototype.divmod = function(e2, t3, r3) {
return n(!e2.isZero()), this.isZero() ? { div: new s(0), mod: new s(0) } : 0 !== this.negative && 0 === e2.negative ? (a2 = this.neg().divmod(e2, t3), "mod" !== t3 && (i2 = a2.div.neg()), "div" !== t3 && (o2 = a2.mod.neg(), r3 && 0 !== o2.negative && o2.iadd(e2)), { div: i2, mod: o2 }) : 0 === this.negative && 0 !== e2.negative ? (a2 = this.divmod(e2.neg(), t3), "mod" !== t3 && (i2 = a2.div.neg()), { div: i2, mod: a2.mod }) : 0 != (this.negative & e2.negative) ? (a2 = this.neg().divmod(e2.neg(), t3), "div" !== t3 && (o2 = a2.mod.neg(), r3 && 0 !== o2.negative && o2.isub(e2)), { div: a2.div, mod: o2 }) : e2.length > this.length || this.cmp(e2) < 0 ? { div: new s(0), mod: this } : 1 === e2.length ? "div" === t3 ? { div: this.divn(e2.words[0]), mod: null } : "mod" === t3 ? { div: null, mod: new s(this.modrn(e2.words[0])) } : { div: this.divn(e2.words[0]), mod: new s(this.modrn(e2.words[0])) } : this._wordDiv(e2, t3);
var i2, o2, a2;
}, s.prototype.div = function(e2) {
return this.divmod(e2, "div", false).div;
}, s.prototype.mod = function(e2) {
return this.divmod(e2, "mod", false).mod;
}, s.prototype.umod = function(e2) {
return this.divmod(e2, "mod", true).mod;
}, s.prototype.divRound = function(e2) {
var t3 = this.divmod(e2);
if (t3.mod.isZero()) return t3.div;
var r3 = 0 !== t3.div.negative ? t3.mod.isub(e2) : t3.mod, n2 = e2.ushrn(1), i2 = e2.andln(1), s2 = r3.cmp(n2);
return s2 < 0 || 1 === i2 && 0 === s2 ? t3.div : 0 !== t3.div.negative ? t3.div.isubn(1) : t3.div.iaddn(1);
}, s.prototype.modrn = function(e2) {
var t3 = e2 < 0;
t3 && (e2 = -e2), n(e2 <= 67108863);
for (var r3 = (1 << 26) % e2, i2 = 0, s2 = this.length - 1; s2 >= 0; s2--) i2 = (r3 * i2 + (0 | this.words[s2])) % e2;
return t3 ? -i2 : i2;
}, s.prototype.modn = function(e2) {
return this.modrn(e2);
}, s.prototype.idivn = function(e2) {
var t3 = e2 < 0;
t3 && (e2 = -e2), n(e2 <= 67108863);
for (var r3 = 0, i2 = this.length - 1; i2 >= 0; i2--) {
var s2 = (0 | this.words[i2]) + 67108864 * r3;
this.words[i2] = s2 / e2 | 0, r3 = s2 % e2;
}
return this._strip(), t3 ? this.ineg() : this;
}, s.prototype.divn = function(e2) {
return this.clone().idivn(e2);
}, s.prototype.egcd = function(e2) {
n(0 === e2.negative), n(!e2.isZero());
var t3 = this, r3 = e2.clone();
t3 = 0 !== t3.negative ? t3.umod(e2) : t3.clone();
for (var i2 = new s(1), o2 = new s(0), a2 = new s(0), l2 = new s(1), c2 = 0; t3.isEven() && r3.isEven(); ) t3.iushrn(1), r3.iushrn(1), ++c2;
for (var u2 = r3.clone(), h2 = t3.clone(); !t3.isZero(); ) {
for (var f2 = 0, d2 = 1; 0 == (t3.words[0] & d2) && f2 < 26; ++f2, d2 <<= 1) ;
if (f2 > 0) for (t3.iushrn(f2); f2-- > 0; ) (i2.isOdd() || o2.isOdd()) && (i2.iadd(u2), o2.isub(h2)), i2.iushrn(1), o2.iushrn(1);
for (var p2 = 0, m2 = 1; 0 == (r3.words[0] & m2) && p2 < 26; ++p2, m2 <<= 1) ;
if (p2 > 0) for (r3.iushrn(p2); p2-- > 0; ) (a2.isOdd() || l2.isOdd()) && (a2.iadd(u2), l2.isub(h2)), a2.iushrn(1), l2.iushrn(1);
t3.cmp(r3) >= 0 ? (t3.isub(r3), i2.isub(a2), o2.isub(l2)) : (r3.isub(t3), a2.isub(i2), l2.isub(o2));
}
return { a: a2, b: l2, gcd: r3.iushln(c2) };
}, s.prototype._invmp = function(e2) {
n(0 === e2.negative), n(!e2.isZero());
var t3 = this, r3 = e2.clone();
t3 = 0 !== t3.negative ? t3.umod(e2) : t3.clone();
for (var i2, o2 = new s(1), a2 = new s(0), l2 = r3.clone(); t3.cmpn(1) > 0 && r3.cmpn(1) > 0; ) {
for (var c2 = 0, u2 = 1; 0 == (t3.words[0] & u2) && c2 < 26; ++c2, u2 <<= 1) ;
if (c2 > 0) for (t3.iushrn(c2); c2-- > 0; ) o2.isOdd() && o2.iadd(l2), o2.iushrn(1);
for (var h2 = 0, f2 = 1; 0 == (r3.words[0] & f2) && h2 < 26; ++h2, f2 <<= 1) ;
if (h2 > 0) for (r3.iushrn(h2); h2-- > 0; ) a2.isOdd() && a2.iadd(l2), a2.iushrn(1);
t3.cmp(r3) >= 0 ? (t3.isub(r3), o2.isub(a2)) : (r3.isub(t3), a2.isub(o2));
}
return (i2 = 0 === t3.cmpn(1) ? o2 : a2).cmpn(0) < 0 && i2.iadd(e2), i2;
}, s.prototype.gcd = function(e2) {
if (this.isZero()) return e2.abs();
if (e2.isZero()) return this.abs();
var t3 = this.clone(), r3 = e2.clone();
t3.negative = 0, r3.negative = 0;
for (var n2 = 0; t3.isEven() && r3.isEven(); n2++) t3.iushrn(1), r3.iushrn(1);
for (; ; ) {
for (; t3.isEven(); ) t3.iushrn(1);
for (; r3.isEven(); ) r3.iushrn(1);
var i2 = t3.cmp(r3);
if (i2 < 0) {
var s2 = t3;
t3 = r3, r3 = s2;
} else if (0 === i2 || 0 === r3.cmpn(1)) break;
t3.isub(r3);
}
return r3.iushln(n2);
}, s.prototype.invm = function(e2) {
return this.egcd(e2).a.umod(e2);
}, s.prototype.isEven = function() {
return 0 == (1 & this.words[0]);
}, s.prototype.isOdd = function() {
return 1 == (1 & this.words[0]);
}, s.prototype.andln = function(e2) {
return this.words[0] & e2;
}, s.prototype.bincn = function(e2) {
n("number" == typeof e2);
var t3 = e2 % 26, r3 = (e2 - t3) / 26, i2 = 1 << t3;
if (this.length <= r3) return this._expand(r3 + 1), this.words[r3] |= i2, this;
for (var s2 = i2, o2 = r3; 0 !== s2 && o2 < this.length; o2++) {
var a2 = 0 | this.words[o2];
s2 = (a2 += s2) >>> 26, a2 &= 67108863, this.words[o2] = a2;
}
return 0 !== s2 && (this.words[o2] = s2, this.length++), this;
}, s.prototype.isZero = function() {
return 1 === this.length && 0 === this.words[0];
}, s.prototype.cmpn = function(e2) {
var t3, r3 = e2 < 0;
if (0 !== this.negative && !r3) return -1;
if (0 === this.negative && r3) return 1;
if (this._strip(), this.length > 1) t3 = 1;
else {
r3 && (e2 = -e2), n(e2 <= 67108863, "Number is too big");
var i2 = 0 | this.words[0];
t3 = i2 === e2 ? 0 : i2 < e2 ? -1 : 1;
}
return 0 !== this.negative ? 0 | -t3 : t3;
}, s.prototype.cmp = function(e2) {
if (0 !== this.negative && 0 === e2.negative) return -1;
if (0 === this.negative && 0 !== e2.negative) return 1;
var t3 = this.ucmp(e2);
return 0 !== this.negative ? 0 | -t3 : t3;
}, s.prototype.ucmp = function(e2) {
if (this.length > e2.length) return 1;
if (this.length < e2.length) return -1;
for (var t3 = 0, r3 = this.length - 1; r3 >= 0; r3--) {
var n2 = 0 | this.words[r3], i2 = 0 | e2.words[r3];
if (n2 !== i2) {
n2 < i2 ? t3 = -1 : n2 > i2 && (t3 = 1);
break;
}
}
return t3;
}, s.prototype.gtn = function(e2) {
return 1 === this.cmpn(e2);
}, s.prototype.gt = function(e2) {
return 1 === this.cmp(e2);
}, s.prototype.gten = function(e2) {
return this.cmpn(e2) >= 0;
}, s.prototype.gte = function(e2) {
return this.cmp(e2) >= 0;
}, s.prototype.ltn = function(e2) {
return -1 === this.cmpn(e2);
}, s.prototype.lt = function(e2) {
return -1 === this.cmp(e2);
}, s.prototype.lten = function(e2) {
return this.cmpn(e2) <= 0;
}, s.prototype.lte = function(e2) {
return this.cmp(e2) <= 0;
}, s.prototype.eqn = function(e2) {
return 0 === this.cmpn(e2);
}, s.prototype.eq = function(e2) {
return 0 === this.cmp(e2);
}, s.red = function(e2) {
return new C(e2);
}, s.prototype.toRed = function(e2) {
return n(!this.red, "Already a number in reduction context"), n(0 === this.negative, "red works only with positives"), e2.convertTo(this)._forceRed(e2);
}, s.prototype.fromRed = function() {
return n(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this);
}, s.prototype._forceRed = function(e2) {
return this.red = e2, this;
}, s.prototype.forceRed = function(e2) {
return n(!this.red, "Already a number in reduction context"), this._forceRed(e2);
}, s.prototype.redAdd = function(e2) {
return n(this.red, "redAdd works only with red numbers"), this.red.add(this, e2);
}, s.prototype.redIAdd = function(e2) {
return n(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, e2);
}, s.prototype.redSub = function(e2) {
return n(this.red, "redSub works only with red numbers"), this.red.sub(this, e2);
}, s.prototype.redISub = function(e2) {
return n(this.red, "redISub works only with red numbers"), this.red.isub(this, e2);
}, s.prototype.redShl = function(e2) {
return n(this.red, "redShl works only with red numbers"), this.red.shl(this, e2);
}, s.prototype.redMul = function(e2) {
return n(this.red, "redMul works only with red numbers"), this.red._verify2(this, e2), this.red.mul(this, e2);
}, s.prototype.redIMul = function(e2) {
return n(this.red, "redMul works only with red numbers"), this.red._verify2(this, e2), this.red.imul(this, e2);
}, s.prototype.redSqr = function() {
return n(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this);
}, s.prototype.redISqr = function() {
return n(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this);
}, s.prototype.redSqrt = function() {
return n(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this);
}, s.prototype.redInvm = function() {
return n(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this);
}, s.prototype.redNeg = function() {
return n(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this);
}, s.prototype.redPow = function(e2) {
return n(this.red && !e2.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, e2);
};
var w = { k256: null, p224: null, p192: null, p25519: null };
function _(e2, t3) {
this.name = e2, this.p = new s(t3, 16), this.n = this.p.bitLength(), this.k = new s(1).iushln(this.n).isub(this.p), this.tmp = this._tmp();
}
function x() {
_.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
}
function k() {
_.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
}
function S() {
_.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
}
function M() {
_.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
}
function C(e2) {
if ("string" == typeof e2) {
var t3 = s._prime(e2);
this.m = t3.p, this.prime = t3;
} else n(e2.gtn(1), "modulus must be greater than 1"), this.m = e2, this.prime = null;
}
function T(e2) {
C.call(this, e2), this.shift = this.m.bitLength(), this.shift % 26 != 0 && (this.shift += 26 - this.shift % 26), this.r = new s(1).iushln(this.shift), this.r2 = this.imod(this.r.sqr()), this.rinv = this.r._invmp(this.m), this.minv = this.rinv.mul(this.r).isubn(1).div(this.m), this.minv = this.minv.umod(this.r), this.minv = this.r.sub(this.minv);
}
_.prototype._tmp = function() {
var e2 = new s(null);
return e2.words = new Array(Math.ceil(this.n / 13)), e2;
}, _.prototype.ireduce = function(e2) {
var t3, r3 = e2;
do {
this.split(r3, this.tmp), t3 = (r3 = (r3 = this.imulK(r3)).iadd(this.tmp)).bitLength();
} while (t3 > this.n);
var n2 = t3 < this.n ? -1 : r3.ucmp(this.p);
return 0 === n2 ? (r3.words[0] = 0, r3.length = 1) : n2 > 0 ? r3.isub(this.p) : void 0 !== r3.strip ? r3.strip() : r3._strip(), r3;
}, _.prototype.split = function(e2, t3) {
e2.iushrn(this.n, 0, t3);
}, _.prototype.imulK = function(e2) {
return e2.imul(this.k);
}, i(x, _), x.prototype.split = function(e2, t3) {
for (var r3 = Math.min(e2.length, 9), n2 = 0; n2 < r3; n2++) t3.words[n2] = e2.words[n2];
if (t3.length = r3, e2.length <= 9) return e2.words[0] = 0, void (e2.length = 1);
var i2 = e2.words[9];
for (t3.words[t3.length++] = 4194303 & i2, n2 = 10; n2 < e2.length; n2++) {
var s2 = 0 | e2.words[n2];
e2.words[n2 - 10] = (4194303 & s2) << 4 | i2 >>> 22, i2 = s2;
}
i2 >>>= 22, e2.words[n2 - 10] = i2, 0 === i2 && e2.length > 10 ? e2.length -= 10 : e2.length -= 9;
}, x.prototype.imulK = function(e2) {
e2.words[e2.length] = 0, e2.words[e2.length + 1] = 0, e2.length += 2;
for (var t3 = 0, r3 = 0; r3 < e2.length; r3++) {
var n2 = 0 | e2.words[r3];
t3 += 977 * n2, e2.words[r3] = 67108863 & t3, t3 = 64 * n2 + (t3 / 67108864 | 0);
}
return 0 === e2.words[e2.length - 1] && (e2.length--, 0 === e2.words[e2.length - 1] && e2.length--), e2;
}, i(k, _), i(S, _), i(M, _), M.prototype.imulK = function(e2) {
for (var t3 = 0, r3 = 0; r3 < e2.length; r3++) {
var n2 = 19 * (0 | e2.words[r3]) + t3, i2 = 67108863 & n2;
n2 >>>= 26, e2.words[r3] = i2, t3 = n2;
}
return 0 !== t3 && (e2.words[e2.length++] = t3), e2;
}, s._prime = function(e2) {
if (w[e2]) return w[e2];
var t3;
if ("k256" === e2) t3 = new x();
else if ("p224" === e2) t3 = new k();
else if ("p192" === e2) t3 = new S();
else {
if ("p25519" !== e2) throw new Error("Unknown prime " + e2);
t3 = new M();
}
return w[e2] = t3, t3;
}, C.prototype._verify1 = function(e2) {
n(0 === e2.negative, "red works only with positives"), n(e2.red, "red works only with red numbers");
}, C.prototype._verify2 = function(e2, t3) {
n(0 == (e2.negative | t3.negative), "red works only with positives"), n(e2.red && e2.red === t3.red, "red works only with red numbers");
}, C.prototype.imod = function(e2) {
return this.prime ? this.prime.ireduce(e2)._forceRed(this) : (u(e2, e2.umod(this.m)._forceRed(this)), e2);
}, C.prototype.neg = function(e2) {
return e2.isZero() ? e2.clone() : this.m.sub(e2)._forceRed(this);
}, C.prototype.add = function(e2, t3) {
this._verify2(e2, t3);
var r3 = e2.add(t3);
return r3.cmp(this.m) >= 0 && r3.isub(this.m), r3._forceRed(this);
}, C.prototype.iadd = function(e2, t3) {
this._verify2(e2, t3);
var r3 = e2.iadd(t3);
return r3.cmp(this.m) >= 0 && r3.isub(this.m), r3;
}, C.prototype.sub = function(e2, t3) {
this._verify2(e2, t3);
var r3 = e2.sub(t3);
return r3.cmpn(0) < 0 && r3.iadd(this.m), r3._forceRed(this);
}, C.prototype.isub = function(e2, t3) {
this._verify2(e2, t3);
var r3 = e2.isub(t3);
return r3.cmpn(0) < 0 && r3.iadd(this.m), r3;
}, C.prototype.shl = function(e2, t3) {
return this._verify1(e2), this.imod(e2.ushln(t3));
}, C.prototype.imul = function(e2, t3) {
return this._verify2(e2, t3), this.imod(e2.imul(t3));
}, C.prototype.mul = function(e2, t3) {
return this._verify2(e2, t3), this.imod(e2.mul(t3));
}, C.prototype.isqr = function(e2) {
return this.imul(e2, e2.clone());
}, C.prototype.sqr = function(e2) {
return this.mul(e2, e2);
}, C.prototype.sqrt = function(e2) {
if (e2.isZero()) return e2.clone();
var t3 = this.m.andln(3);
if (n(t3 % 2 == 1), 3 === t3) {
var r3 = this.m.add(new s(1)).iushrn(2);
return this.pow(e2, r3);
}
for (var i2 = this.m.subn(1), o2 = 0; !i2.isZero() && 0 === i2.andln(1); ) o2++, i2.iushrn(1);
n(!i2.isZero());
var a2 = new s(1).toRed(this), l2 = a2.redNeg(), c2 = this.m.subn(1).iushrn(1), u2 = this.m.bitLength();
for (u2 = new s(2 * u2 * u2).toRed(this); 0 !== this.pow(u2, c2).cmp(l2); ) u2.redIAdd(l2);
for (var h2 = this.pow(u2, i2), f2 = this.pow(e2, i2.addn(1).iushrn(1)), d2 = this.pow(e2, i2), p2 = o2; 0 !== d2.cmp(a2); ) {
for (var m2 = d2, b2 = 0; 0 !== m2.cmp(a2); b2++) m2 = m2.redSqr();
n(b2 < p2);
var g2 = this.pow(h2, new s(1).iushln(p2 - b2 - 1));
f2 = f2.redMul(g2), h2 = g2.redSqr(), d2 = d2.redMul(h2), p2 = b2;
}
return f2;
}, C.prototype.invm = function(e2) {
var t3 = e2._invmp(this.m);
return 0 !== t3.negative ? (t3.negative = 0, this.imod(t3).redNeg()) : this.imod(t3);
}, C.prototype.pow = function(e2, t3) {
if (t3.isZero()) return new s(1).toRed(this);
if (0 === t3.cmpn(1)) return e2.clone();
var r3 = new Array(16);
r3[0] = new s(1).toRed(this), r3[1] = e2;
for (var n2 = 2; n2 < r3.length; n2++) r3[n2] = this.mul(r3[n2 - 1], e2);
var i2 = r3[0], o2 = 0, a2 = 0, l2 = t3.bitLength() % 26;
for (0 === l2 && (l2 = 26), n2 = t3.length - 1; n2 >= 0; n2--) {
for (var c2 = t3.words[n2], u2 = l2 - 1; u2 >= 0; u2--) {
var h2 = c2 >> u2 & 1;
i2 !== r3[0] && (i2 = this.sqr(i2)), 0 !== h2 || 0 !== o2 ? (o2 <<= 1, o2 |= h2, (4 === ++a2 || 0 === n2 && 0 === u2) && (i2 = this.mul(i2, r3[o2]), a2 = 0, o2 = 0)) : a2 = 0;
}
l2 = 26;
}
return i2;
}, C.prototype.convertTo = function(e2) {
var t3 = e2.umod(this.m);
return t3 === e2 ? t3.clone() : t3;
}, C.prototype.convertFrom = function(e2) {
var t3 = e2.clone();
return t3.red = null, t3;
}, s.mont = function(e2) {
return new T(e2);
}, i(T, C), T.prototype.convertTo = function(e2) {
return this.imod(e2.ushln(this.shift));
}, T.prototype.convertFrom = function(e2) {
var t3 = this.imod(e2.mul(this.rinv));
return t3.red = null, t3;
}, T.prototype.imul = function(e2, t3) {
if (e2.isZero() || t3.isZero()) return e2.words[0] = 0, e2.length = 1, e2;
var r3 = e2.imul(t3), n2 = r3.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), i2 = r3.isub(n2).iushrn(this.shift), s2 = i2;
return i2.cmp(this.m) >= 0 ? s2 = i2.isub(this.m) : i2.cmpn(0) < 0 && (s2 = i2.iadd(this.m)), s2._forceRed(this);
}, T.prototype.mul = function(e2, t3) {
if (e2.isZero() || t3.isZero()) return new s(0)._forceRed(this);
var r3 = e2.mul(t3), n2 = r3.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), i2 = r3.isub(n2).iushrn(this.shift), o2 = i2;
return i2.cmp(this.m) >= 0 ? o2 = i2.isub(this.m) : i2.cmpn(0) < 0 && (o2 = i2.iadd(this.m)), o2._forceRed(this);
}, T.prototype.invm = function(e2) {
return this.imod(e2._invmp(this.m).mul(this.r2))._forceRed(this);
};
})(void 0 === t || t);
}, { buffer: 188 }], 187: [function(e, t, r) {
var n;
function i(e2) {
this.rand = e2;
}
if (t.exports = function(e2) {
return n || (n = new i(null)), n.generate(e2);
}, t.exports.Rand = i, i.prototype.generate = function(e2) {
return this._rand(e2);
}, i.prototype._rand = function(e2) {
if (this.rand.getBytes) return this.rand.getBytes(e2);
for (var t2 = new Uint8Array(e2), r2 = 0; r2 < t2.length; r2++) t2[r2] = this.rand.getByte();
return t2;
}, "object" == typeof self) self.crypto && self.crypto.getRandomValues ? i.prototype._rand = function(e2) {
var t2 = new Uint8Array(e2);
return self.crypto.getRandomValues(t2), t2;
} : self.msCrypto && self.msCrypto.getRandomValues ? i.prototype._rand = function(e2) {
var t2 = new Uint8Array(e2);
return self.msCrypto.getRandomValues(t2), t2;
} : "object" == typeof window && (i.prototype._rand = function() {
throw new Error("Not implemented yet");
});
else try {
var s = e("crypto");
if ("function" != typeof s.randomBytes) throw new Error("Not supported");
i.prototype._rand = function(e2) {
return s.randomBytes(e2);
};
} catch (e2) {
}
}, { crypto: 188 }], 188: [function(e, t, r) {
}, {}], 189: [function(e, t, r) {
var n = e("safe-buffer").Buffer;
function i(e2) {
n.isBuffer(e2) || (e2 = n.from(e2));
for (var t2 = e2.length / 4 | 0, r2 = new Array(t2), i2 = 0; i2 < t2; i2++) r2[i2] = e2.readUInt32BE(4 * i2);
return r2;
}
function s(e2) {
for (; 0 < e2.length; e2++) e2[0] = 0;
}
function o(e2, t2, r2, n2, i2) {
for (var s2, o2, a2, l2, c2 = r2[0], u = r2[1], h = r2[2], f = r2[3], d = e2[0] ^ t2[0], p = e2[1] ^ t2[1], m = e2[2] ^ t2[2], b = e2[3] ^ t2[3], g = 4, y = 1; y < i2; y++) s2 = c2[d >>> 24] ^ u[p >>> 16 & 255] ^ h[m >>> 8 & 255] ^ f[255 & b] ^ t2[g++], o2 = c2[p >>> 24] ^ u[m >>> 16 & 255] ^ h[b >>> 8 & 255] ^ f[255 & d] ^ t2[g++], a2 = c2[m >>> 24] ^ u[b >>> 16 & 255] ^ h[d >>> 8 & 255] ^ f[255 & p] ^ t2[g++], l2 = c2[b >>> 24] ^ u[d >>> 16 & 255] ^ h[p >>> 8 & 255] ^ f[255 & m] ^ t2[g++], d = s2, p = o2, m = a2, b = l2;
return s2 = (n2[d >>> 24] << 24 | n2[p >>> 16 & 255] << 16 | n2[m >>> 8 & 255] << 8 | n2[255 & b]) ^ t2[g++], o2 = (n2[p >>> 24] << 24 | n2[m >>> 16 & 255] << 16 | n2[b >>> 8 & 255] << 8 | n2[255 & d]) ^ t2[g++], a2 = (n2[m >>> 24] << 24 | n2[b >>> 16 & 255] << 16 | n2[d >>> 8 & 255] << 8 | n2[255 & p]) ^ t2[g++], l2 = (n2[b >>> 24] << 24 | n2[d >>> 16 & 255] << 16 | n2[p >>> 8 & 255] << 8 | n2[255 & m]) ^ t2[g++], [s2 >>>= 0, o2 >>>= 0, a2 >>>= 0, l2 >>>= 0];
}
var a = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], l = (function() {
for (var e2 = new Array(256), t2 = 0; t2 < 256; t2++) e2[t2] = t2 < 128 ? t2 << 1 : t2 << 1 ^ 283;
for (var r2 = [], n2 = [], i2 = [[], [], [], []], s2 = [[], [], [], []], o2 = 0, a2 = 0, l2 = 0; l2 < 256; ++l2) {
var c2 = a2 ^ a2 << 1 ^ a2 << 2 ^ a2 << 3 ^ a2 << 4;
c2 = c2 >>> 8 ^ 255 & c2 ^ 99, r2[o2] = c2, n2[c2] = o2;
var u = e2[o2], h = e2[u], f = e2[h], d = 257 * e2[c2] ^ 16843008 * c2;
i2[0][o2] = d << 24 | d >>> 8, i2[1][o2] = d << 16 | d >>> 16, i2[2][o2] = d << 8 | d >>> 24, i2[3][o2] = d, d = 16843009 * f ^ 65537 * h ^ 257 * u ^ 16843008 * o2, s2[0][c2] = d << 24 | d >>> 8, s2[1][c2] = d << 16 | d >>> 16, s2[2][c2] = d << 8 | d >>> 24, s2[3][c2] = d, 0 === o2 ? o2 = a2 = 1 : (o2 = u ^ e2[e2[e2[f ^ u]]], a2 ^= e2[e2[a2]]);
}
return { SBOX: r2, INV_SBOX: n2, SUB_MIX: i2, INV_SUB_MIX: s2 };
})();
function c(e2) {
this._key = i(e2), this._reset();
}
c.blockSize = 16, c.keySize = 32, c.prototype.blockSize = c.blockSize, c.prototype.keySize = c.keySize, c.prototype._reset = function() {
for (var e2 = this._key, t2 = e2.length, r2 = t2 + 6, n2 = 4 * (r2 + 1), i2 = [], s2 = 0; s2 < t2; s2++) i2[s2] = e2[s2];
for (s2 = t2; s2 < n2; s2++) {
var o2 = i2[s2 - 1];
s2 % t2 == 0 ? (o2 = o2 << 8 | o2 >>> 24, o2 = l.SBOX[o2 >>> 24] << 24 | l.SBOX[o2 >>> 16 & 255] << 16 | l.SBOX[o2 >>> 8 & 255] << 8 | l.SBOX[255 & o2], o2 ^= a[s2 / t2 | 0] << 24) : t2 > 6 && s2 % t2 == 4 && (o2 = l.SBOX[o2 >>> 24] << 24 | l.SBOX[o2 >>> 16 & 255] << 16 | l.SBOX[o2 >>> 8 & 255] << 8 | l.SBOX[255 & o2]), i2[s2] = i2[s2 - t2] ^ o2;
}
for (var c2 = [], u = 0; u < n2; u++) {
var h = n2 - u, f = i2[h - (u % 4 ? 0 : 4)];
c2[u] = u < 4 || h <= 4 ? f : l.INV_SUB_MIX[0][l.SBOX[f >>> 24]] ^ l.INV_SUB_MIX[1][l.SBOX[f >>> 16 & 255]] ^ l.INV_SUB_MIX[2][l.SBOX[f >>> 8 & 255]] ^ l.INV_SUB_MIX[3][l.SBOX[255 & f]];
}
this._nRounds = r2, this._keySchedule = i2, this._invKeySchedule = c2;
}, c.prototype.encryptBlockRaw = function(e2) {
return o(e2 = i(e2), this._keySchedule, l.SUB_MIX, l.SBOX, this._nRounds);
}, c.prototype.encryptBlock = function(e2) {
var t2 = this.encryptBlockRaw(e2), r2 = n.allocUnsafe(16);
return r2.writeUInt32BE(t2[0], 0), r2.writeUInt32BE(t2[1], 4), r2.writeUInt32BE(t2[2], 8), r2.writeUInt32BE(t2[3], 12), r2;
}, c.prototype.decryptBlock = function(e2) {
var t2 = (e2 = i(e2))[1];
e2[1] = e2[3], e2[3] = t2;
var r2 = o(e2, this._invKeySchedule, l.INV_SUB_MIX, l.INV_SBOX, this._nRounds), s2 = n.allocUnsafe(16);
return s2.writeUInt32BE(r2[0], 0), s2.writeUInt32BE(r2[3], 4), s2.writeUInt32BE(r2[2], 8), s2.writeUInt32BE(r2[1], 12), s2;
}, c.prototype.scrub = function() {
s(this._keySchedule), s(this._invKeySchedule), s(this._key);
}, t.exports.AES = c;
}, { "safe-buffer": 494 }], 190: [function(e, t, r) {
var n = e("./aes"), i = e("safe-buffer").Buffer, s = e("cipher-base"), o = e("inherits"), a = e("./ghash"), l = e("buffer-xor"), c = e("./incr32");
function u(e2, t2, r2, o2) {
s.call(this);
var l2 = i.alloc(4, 0);
this._cipher = new n.AES(t2);
var u2 = this._cipher.encryptBlock(l2);
this._ghash = new a(u2), r2 = (function(e3, t3, r3) {
if (12 === t3.length) return e3._finID = i.concat([t3, i.from([0, 0, 0, 1])]), i.concat([t3, i.from([0, 0, 0, 2])]);
var n2 = new a(r3), s2 = t3.length, o3 = s2 % 16;
n2.update(t3), o3 && (o3 = 16 - o3, n2.update(i.alloc(o3, 0))), n2.update(i.alloc(8, 0));
var l3 = 8 * s2, u3 = i.alloc(8);
u3.writeUIntBE(l3, 0, 8), n2.update(u3), e3._finID = n2.state;
var h = i.from(e3._finID);
return c(h), h;
})(this, r2, u2), this._prev = i.from(r2), this._cache = i.allocUnsafe(0), this._secCache = i.allocUnsafe(0), this._decrypt = o2, this._alen = 0, this._len = 0, this._mode = e2, this._authTag = null, this._called = false;
}
o(u, s), u.prototype._update = function(e2) {
if (!this._called && this._alen) {
var t2 = 16 - this._alen % 16;
t2 < 16 && (t2 = i.alloc(t2, 0), this._ghash.update(t2));
}
this._called = true;
var r2 = this._mode.encrypt(this, e2);
return this._decrypt ? this._ghash.update(e2) : this._ghash.update(r2), this._len += e2.length, r2;
}, u.prototype._final = function() {
if (this._decrypt && !this._authTag) throw new Error("Unsupported state or unable to authenticate data");
var e2 = l(this._ghash.final(8 * this._alen, 8 * this._len), this._cipher.encryptBlock(this._finID));
if (this._decrypt && (function(e3, t2) {
var r2 = 0;
e3.length !== t2.length && r2++;
for (var n2 = Math.min(e3.length, t2.length), i2 = 0; i2 < n2; ++i2) r2 += e3[i2] ^ t2[i2];
return r2;
})(e2, this._authTag)) throw new Error("Unsupported state or unable to authenticate data");
this._authTag = e2, this._cipher.scrub();
}, u.prototype.getAuthTag = function() {
if (this._decrypt || !i.isBuffer(this._authTag)) throw new Error("Attempting to get auth tag in unsupported state");
return this._authTag;
}, u.prototype.setAuthTag = function(e2) {
if (!this._decrypt) throw new Error("Attempting to set auth tag in unsupported state");
this._authTag = e2;
}, u.prototype.setAAD = function(e2) {
if (this._called) throw new Error("Attempting to set AAD in unsupported state");
this._ghash.update(e2), this._alen += e2.length;
}, t.exports = u;
}, { "./aes": 189, "./ghash": 194, "./incr32": 195, "buffer-xor": 219, "cipher-base": 221, inherits: 440, "safe-buffer": 494 }], 191: [function(e, t, r) {
var n = e("./encrypter"), i = e("./decrypter"), s = e("./modes/list.json");
r.createCipher = r.Cipher = n.createCipher, r.createCipheriv = r.Cipheriv = n.createCipheriv, r.createDecipher = r.Decipher = i.createDecipher, r.createDecipheriv = r.Decipheriv = i.createDecipheriv, r.listCiphers = r.getCiphers = function() {
return Object.keys(s);
};
}, { "./decrypter": 192, "./encrypter": 193, "./modes/list.json": 203 }], 192: [function(e, t, r) {
var n = e("./authCipher"), i = e("safe-buffer").Buffer, s = e("./modes"), o = e("./streamCipher"), a = e("cipher-base"), l = e("./aes"), c = e("evp_bytestokey");
function u(e2, t2, r2) {
a.call(this), this._cache = new h(), this._last = void 0, this._cipher = new l.AES(t2), this._prev = i.from(r2), this._mode = e2, this._autopadding = true;
}
function h() {
this.cache = i.allocUnsafe(0);
}
function f(e2, t2, r2) {
var a2 = s[e2.toLowerCase()];
if (!a2) throw new TypeError("invalid suite type");
if ("string" == typeof r2 && (r2 = i.from(r2)), "GCM" !== a2.mode && r2.length !== a2.iv) throw new TypeError("invalid iv length " + r2.length);
if ("string" == typeof t2 && (t2 = i.from(t2)), t2.length !== a2.key / 8) throw new TypeError("invalid key length " + t2.length);
return "stream" === a2.type ? new o(a2.module, t2, r2, true) : "auth" === a2.type ? new n(a2.module, t2, r2, true) : new u(a2.module, t2, r2);
}
e("inherits")(u, a), u.prototype._update = function(e2) {
var t2, r2;
this._cache.add(e2);
for (var n2 = []; t2 = this._cache.get(this._autopadding); ) r2 = this._mode.decrypt(this, t2), n2.push(r2);
return i.concat(n2);
}, u.prototype._final = function() {
var e2 = this._cache.flush();
if (this._autopadding) return (function(e3) {
var t2 = e3[15];
if (t2 < 1 || t2 > 16) throw new Error("unable to decrypt data");
var r2 = -1;
for (; ++r2 < t2; ) if (e3[r2 + (16 - t2)] !== t2) throw new Error("unable to decrypt data");
if (16 === t2) return;
return e3.slice(0, 16 - t2);
})(this._mode.decrypt(this, e2));
if (e2) throw new Error("data not multiple of block length");
}, u.prototype.setAutoPadding = function(e2) {
return this._autopadding = !!e2, this;
}, h.prototype.add = function(e2) {
this.cache = i.concat([this.cache, e2]);
}, h.prototype.get = function(e2) {
var t2;
if (e2) {
if (this.cache.length > 16) return t2 = this.cache.slice(0, 16), this.cache = this.cache.slice(16), t2;
} else if (this.cache.length >= 16) return t2 = this.cache.slice(0, 16), this.cache = this.cache.slice(16), t2;
return null;
}, h.prototype.flush = function() {
if (this.cache.length) return this.cache;
}, r.createDecipher = function(e2, t2) {
var r2 = s[e2.toLowerCase()];
if (!r2) throw new TypeError("invalid suite type");
var n2 = c(t2, false, r2.key, r2.iv);
return f(e2, n2.key, n2.iv);
}, r.createDecipheriv = f;
}, { "./aes": 189, "./authCipher": 190, "./modes": 202, "./streamCipher": 205, "cipher-base": 221, evp_bytestokey: 423, inherits: 440, "safe-buffer": 494 }], 193: [function(e, t, r) {
var n = e("./modes"), i = e("./authCipher"), s = e("safe-buffer").Buffer, o = e("./streamCipher"), a = e("cipher-base"), l = e("./aes"), c = e("evp_bytestokey");
function u(e2, t2, r2) {
a.call(this), this._cache = new f(), this._cipher = new l.AES(t2), this._prev = s.from(r2), this._mode = e2, this._autopadding = true;
}
e("inherits")(u, a), u.prototype._update = function(e2) {
var t2, r2;
this._cache.add(e2);
for (var n2 = []; t2 = this._cache.get(); ) r2 = this._mode.encrypt(this, t2), n2.push(r2);
return s.concat(n2);
};
var h = s.alloc(16, 16);
function f() {
this.cache = s.allocUnsafe(0);
}
function d(e2, t2, r2) {
var a2 = n[e2.toLowerCase()];
if (!a2) throw new TypeError("invalid suite type");
if ("string" == typeof t2 && (t2 = s.from(t2)), t2.length !== a2.key / 8) throw new TypeError("invalid key length " + t2.length);
if ("string" == typeof r2 && (r2 = s.from(r2)), "GCM" !== a2.mode && r2.length !== a2.iv) throw new TypeError("invalid iv length " + r2.length);
return "stream" === a2.type ? new o(a2.module, t2, r2) : "auth" === a2.type ? new i(a2.module, t2, r2) : new u(a2.module, t2, r2);
}
u.prototype._final = function() {
var e2 = this._cache.flush();
if (this._autopadding) return e2 = this._mode.encrypt(this, e2), this._cipher.scrub(), e2;
if (!e2.equals(h)) throw this._cipher.scrub(), new Error("data not multiple of block length");
}, u.prototype.setAutoPadding = function(e2) {
return this._autopadding = !!e2, this;
}, f.prototype.add = function(e2) {
this.cache = s.concat([this.cache, e2]);
}, f.prototype.get = function() {
if (this.cache.length > 15) {
var e2 = this.cache.slice(0, 16);
return this.cache = this.cache.slice(16), e2;
}
return null;
}, f.prototype.flush = function() {
for (var e2 = 16 - this.cache.length, t2 = s.allocUnsafe(e2), r2 = -1; ++r2 < e2; ) t2.writeUInt8(e2, r2);
return s.concat([this.cache, t2]);
}, r.createCipheriv = d, r.createCipher = function(e2, t2) {
var r2 = n[e2.toLowerCase()];
if (!r2) throw new TypeError("invalid suite type");
var i2 = c(t2, false, r2.key, r2.iv);
return d(e2, i2.key, i2.iv);
};
}, { "./aes": 189, "./authCipher": 190, "./modes": 202, "./streamCipher": 205, "cipher-base": 221, evp_bytestokey: 423, inherits: 440, "safe-buffer": 494 }], 194: [function(e, t, r) {
var n = e("safe-buffer").Buffer, i = n.alloc(16, 0);
function s(e2) {
var t2 = n.allocUnsafe(16);
return t2.writeUInt32BE(e2[0] >>> 0, 0), t2.writeUInt32BE(e2[1] >>> 0, 4), t2.writeUInt32BE(e2[2] >>> 0, 8), t2.writeUInt32BE(e2[3] >>> 0, 12), t2;
}
function o(e2) {
this.h = e2, this.state = n.alloc(16, 0), this.cache = n.allocUnsafe(0);
}
o.prototype.ghash = function(e2) {
for (var t2 = -1; ++t2 < e2.length; ) this.state[t2] ^= e2[t2];
this._multiply();
}, o.prototype._multiply = function() {
for (var e2, t2, r2, n2 = [(e2 = this.h).readUInt32BE(0), e2.readUInt32BE(4), e2.readUInt32BE(8), e2.readUInt32BE(12)], i2 = [0, 0, 0, 0], o2 = -1; ++o2 < 128; ) {
for (0 != (this.state[~~(o2 / 8)] & 1 << 7 - o2 % 8) && (i2[0] ^= n2[0], i2[1] ^= n2[1], i2[2] ^= n2[2], i2[3] ^= n2[3]), r2 = 0 != (1 & n2[3]), t2 = 3; t2 > 0; t2--) n2[t2] = n2[t2] >>> 1 | (1 & n2[t2 - 1]) << 31;
n2[0] = n2[0] >>> 1, r2 && (n2[0] = n2[0] ^ 225 << 24);
}
this.state = s(i2);
}, o.prototype.update = function(e2) {
var t2;
for (this.cache = n.concat([this.cache, e2]); this.cache.length >= 16; ) t2 = this.cache.slice(0, 16), this.cache = this.cache.slice(16), this.ghash(t2);
}, o.prototype.final = function(e2, t2) {
return this.cache.length && this.ghash(n.concat([this.cache, i], 16)), this.ghash(s([0, e2, 0, t2])), this.state;
}, t.exports = o;
}, { "safe-buffer": 494 }], 195: [function(e, t, r) {
t.exports = function(e2) {
for (var t2, r2 = e2.length; r2--; ) {
if (255 !== (t2 = e2.readUInt8(r2))) {
t2++, e2.writeUInt8(t2, r2);
break;
}
e2.writeUInt8(0, r2);
}
};
}, {}], 196: [function(e, t, r) {
var n = e("buffer-xor");
r.encrypt = function(e2, t2) {
var r2 = n(t2, e2._prev);
return e2._prev = e2._cipher.encryptBlock(r2), e2._prev;
}, r.decrypt = function(e2, t2) {
var r2 = e2._prev;
e2._prev = t2;
var i = e2._cipher.decryptBlock(t2);
return n(i, r2);
};
}, { "buffer-xor": 219 }], 197: [function(e, t, r) {
var n = e("safe-buffer").Buffer, i = e("buffer-xor");
function s(e2, t2, r2) {
var s2 = t2.length, o = i(t2, e2._cache);
return e2._cache = e2._cache.slice(s2), e2._prev = n.concat([e2._prev, r2 ? t2 : o]), o;
}
r.encrypt = function(e2, t2, r2) {
for (var i2, o = n.allocUnsafe(0); t2.length; ) {
if (0 === e2._cache.length && (e2._cache = e2._cipher.encryptBlock(e2._prev), e2._prev = n.allocUnsafe(0)), !(e2._cache.length <= t2.length)) {
o = n.concat([o, s(e2, t2, r2)]);
break;
}
i2 = e2._cache.length, o = n.concat([o, s(e2, t2.slice(0, i2), r2)]), t2 = t2.slice(i2);
}
return o;
};
}, { "buffer-xor": 219, "safe-buffer": 494 }], 198: [function(e, t, r) {
var n = e("safe-buffer").Buffer;
function i(e2, t2, r2) {
for (var n2, i2, o = -1, a = 0; ++o < 8; ) n2 = t2 & 1 << 7 - o ? 128 : 0, a += (128 & (i2 = e2._cipher.encryptBlock(e2._prev)[0] ^ n2)) >> o % 8, e2._prev = s(e2._prev, r2 ? n2 : i2);
return a;
}
function s(e2, t2) {
var r2 = e2.length, i2 = -1, s2 = n.allocUnsafe(e2.length);
for (e2 = n.concat([e2, n.from([t2])]); ++i2 < r2; ) s2[i2] = e2[i2] << 1 | e2[i2 + 1] >> 7;
return s2;
}
r.encrypt = function(e2, t2, r2) {
for (var s2 = t2.length, o = n.allocUnsafe(s2), a = -1; ++a < s2; ) o[a] = i(e2, t2[a], r2);
return o;
};
}, { "safe-buffer": 494 }], 199: [function(e, t, r) {
var n = e("safe-buffer").Buffer;
function i(e2, t2, r2) {
var i2 = e2._cipher.encryptBlock(e2._prev)[0] ^ t2;
return e2._prev = n.concat([e2._prev.slice(1), n.from([r2 ? t2 : i2])]), i2;
}
r.encrypt = function(e2, t2, r2) {
for (var s = t2.length, o = n.allocUnsafe(s), a = -1; ++a < s; ) o[a] = i(e2, t2[a], r2);
return o;
};
}, { "safe-buffer": 494 }], 200: [function(e, t, r) {
var n = e("buffer-xor"), i = e("safe-buffer").Buffer, s = e("../incr32");
function o(e2) {
var t2 = e2._cipher.encryptBlockRaw(e2._prev);
return s(e2._prev), t2;
}
r.encrypt = function(e2, t2) {
var r2 = Math.ceil(t2.length / 16), s2 = e2._cache.length;
e2._cache = i.concat([e2._cache, i.allocUnsafe(16 * r2)]);
for (var a = 0; a < r2; a++) {
var l = o(e2), c = s2 + 16 * a;
e2._cache.writeUInt32BE(l[0], c + 0), e2._cache.writeUInt32BE(l[1], c + 4), e2._cache.writeUInt32BE(l[2], c + 8), e2._cache.writeUInt32BE(l[3], c + 12);
}
var u = e2._cache.slice(0, t2.length);
return e2._cache = e2._cache.slice(t2.length), n(t2, u);
};
}, { "../incr32": 195, "buffer-xor": 219, "safe-buffer": 494 }], 201: [function(e, t, r) {
r.encrypt = function(e2, t2) {
return e2._cipher.encryptBlock(t2);
}, r.decrypt = function(e2, t2) {
return e2._cipher.decryptBlock(t2);
};
}, {}], 202: [function(e, t, r) {
var n = { ECB: e("./ecb"), CBC: e("./cbc"), CFB: e("./cfb"), CFB8: e("./cfb8"), CFB1: e("./cfb1"), OFB: e("./ofb"), CTR: e("./ctr"), GCM: e("./ctr") }, i = e("./list.json");
for (var s in i) i[s].module = n[i[s].mode];
t.exports = i;
}, { "./cbc": 196, "./cfb": 197, "./cfb1": 198, "./cfb8": 199, "./ctr": 200, "./ecb": 201, "./list.json": 203, "./ofb": 204 }], 203: [function(e, t, r) {
t.exports = { "aes-128-ecb": { cipher: "AES", key: 128, iv: 0, mode: "ECB", type: "block" }, "aes-192-ecb": { cipher: "AES", key: 192, iv: 0, mode: "ECB", type: "block" }, "aes-256-ecb": { cipher: "AES", key: 256, iv: 0, mode: "ECB", type: "block" }, "aes-128-cbc": { cipher: "AES", key: 128, iv: 16, mode: "CBC", type: "block" }, "aes-192-cbc": { cipher: "AES", key: 192, iv: 16, mode: "CBC", type: "block" }, "aes-256-cbc": { cipher: "AES", key: 256, iv: 16, mode: "CBC", type: "block" }, aes128: { cipher: "AES", key: 128, iv: 16, mode: "CBC", type: "block" }, aes192: { cipher: "AES", key: 192, iv: 16, mode: "CBC", type: "block" }, aes256: { cipher: "AES", key: 256, iv: 16, mode: "CBC", type: "block" }, "aes-128-cfb": { cipher: "AES", key: 128, iv: 16, mode: "CFB", type: "stream" }, "aes-192-cfb": { cipher: "AES", key: 192, iv: 16, mode: "CFB", type: "stream" }, "aes-256-cfb": { cipher: "AES", key: 256, iv: 16, mode: "CFB", type: "stream" }, "aes-128-cfb8": { cipher: "AES", key: 128, iv: 16, mode: "CFB8", type: "stream" }, "aes-192-cfb8": { cipher: "AES", key: 192, iv: 16, mode: "CFB8", type: "stream" }, "aes-256-cfb8": { cipher: "AES", key: 256, iv: 16, mode: "CFB8", type: "stream" }, "aes-128-cfb1": { cipher: "AES", key: 128, iv: 16, mode: "CFB1", type: "stream" }, "aes-192-cfb1": { cipher: "AES", key: 192, iv: 16, mode: "CFB1", type: "stream" }, "aes-256-cfb1": { cipher: "AES", key: 256, iv: 16, mode: "CFB1", type: "stream" }, "aes-128-ofb": { cipher: "AES", key: 128, iv: 16, mode: "OFB", type: "stream" }, "aes-192-ofb": { cipher: "AES", key: 192, iv: 16, mode: "OFB", type: "stream" }, "aes-256-ofb": { cipher: "AES", key: 256, iv: 16, mode: "OFB", type: "stream" }, "aes-128-ctr": { cipher: "AES", key: 128, iv: 16, mode: "CTR", type: "stream" }, "aes-192-ctr": { cipher: "AES", key: 192, iv: 16, mode: "CTR", type: "stream" }, "aes-256-ctr": { cipher: "AES", key: 256, iv: 16, mode: "CTR", type: "stream" }, "aes-128-gcm": { cipher: "AES", key: 128, iv: 12, mode: "GCM", type: "auth" }, "aes-192-gcm": { cipher: "AES", key: 192, iv: 12, mode: "GCM", type: "auth" }, "aes-256-gcm": { cipher: "AES", key: 256, iv: 12, mode: "GCM", type: "auth" } };
}, {}], 204: [function(e, t, r) {
(function(t2) {
(function() {
var n = e("buffer-xor");
function i(e2) {
return e2._prev = e2._cipher.encryptBlock(e2._prev), e2._prev;
}
r.encrypt = function(e2, r2) {
for (; e2._cache.length < r2.length; ) e2._cache = t2.concat([e2._cache, i(e2)]);
var s = e2._cache.slice(0, r2.length);
return e2._cache = e2._cache.slice(r2.length), n(r2, s);
};
}).call(this);
}).call(this, e("buffer").Buffer);
}, { buffer: 220, "buffer-xor": 219 }], 205: [function(e, t, r) {
var n = e("./aes"), i = e("safe-buffer").Buffer, s = e("cipher-base");
function o(e2, t2, r2, o2) {
s.call(this), this._cipher = new n.AES(t2), this._prev = i.from(r2), this._cache = i.allocUnsafe(0), this._secCache = i.allocUnsafe(0), this._decrypt = o2, this._mode = e2;
}
e("inherits")(o, s), o.prototype._update = function(e2) {
return this._mode.encrypt(this, e2, this._decrypt);
}, o.prototype._final = function() {
this._cipher.scrub();
}, t.exports = o;
}, { "./aes": 189, "cipher-base": 221, inherits: 440, "safe-buffer": 494 }], 206: [function(e, t, r) {
var n = e("browserify-des"), i = e("browserify-aes/browser"), s = e("browserify-aes/modes"), o = e("browserify-des/modes"), a = e("evp_bytestokey");
function l(e2, t2, r2) {
if (e2 = e2.toLowerCase(), s[e2]) return i.createCipheriv(e2, t2, r2);
if (o[e2]) return new n({ key: t2, iv: r2, mode: e2 });
throw new TypeError("invalid suite type");
}
function c(e2, t2, r2) {
if (e2 = e2.toLowerCase(), s[e2]) return i.createDecipheriv(e2, t2, r2);
if (o[e2]) return new n({ key: t2, iv: r2, mode: e2, decrypt: true });
throw new TypeError("invalid suite type");
}
r.createCipher = r.Cipher = function(e2, t2) {
var r2, n2;
if (e2 = e2.toLowerCase(), s[e2]) r2 = s[e2].key, n2 = s[e2].iv;
else {
if (!o[e2]) throw new TypeError("invalid suite type");
r2 = 8 * o[e2].key, n2 = o[e2].iv;
}
var i2 = a(t2, false, r2, n2);
return l(e2, i2.key, i2.iv);
}, r.createCipheriv = r.Cipheriv = l, r.createDecipher = r.Decipher = function(e2, t2) {
var r2, n2;
if (e2 = e2.toLowerCase(), s[e2]) r2 = s[e2].key, n2 = s[e2].iv;
else {
if (!o[e2]) throw new TypeError("invalid suite type");
r2 = 8 * o[e2].key, n2 = o[e2].iv;
}
var i2 = a(t2, false, r2, n2);
return c(e2, i2.key, i2.iv);
}, r.createDecipheriv = r.Decipheriv = c, r.listCiphers = r.getCiphers = function() {
return Object.keys(o).concat(i.getCiphers());
};
}, { "browserify-aes/browser": 191, "browserify-aes/modes": 202, "browserify-des": 207, "browserify-des/modes": 208, evp_bytestokey: 423 }], 207: [function(e, t, r) {
var n = e("cipher-base"), i = e("des.js"), s = e("inherits"), o = e("safe-buffer").Buffer, a = { "des-ede3-cbc": i.CBC.instantiate(i.EDE), "des-ede3": i.EDE, "des-ede-cbc": i.CBC.instantiate(i.EDE), "des-ede": i.EDE, "des-cbc": i.CBC.instantiate(i.DES), "des-ecb": i.DES };
function l(e2) {
n.call(this);
var t2, r2 = e2.mode.toLowerCase(), i2 = a[r2];
t2 = e2.decrypt ? "decrypt" : "encrypt";
var s2 = e2.key;
o.isBuffer(s2) || (s2 = o.from(s2)), "des-ede" !== r2 && "des-ede-cbc" !== r2 || (s2 = o.concat([s2, s2.slice(0, 8)]));
var l2 = e2.iv;
o.isBuffer(l2) || (l2 = o.from(l2)), this._des = i2.create({ key: s2, iv: l2, type: t2 });
}
a.des = a["des-cbc"], a.des3 = a["des-ede3-cbc"], t.exports = l, s(l, n), l.prototype._update = function(e2) {
return o.from(this._des.update(e2));
}, l.prototype._final = function() {
return o.from(this._des.final());
};
}, { "cipher-base": 221, "des.js": 394, inherits: 440, "safe-buffer": 494 }], 208: [function(e, t, r) {
r["des-ecb"] = { key: 8, iv: 0 }, r["des-cbc"] = r.des = { key: 8, iv: 8 }, r["des-ede3-cbc"] = r.des3 = { key: 24, iv: 8 }, r["des-ede3"] = { key: 24, iv: 0 }, r["des-ede-cbc"] = { key: 16, iv: 8 }, r["des-ede"] = { key: 16, iv: 0 };
}, {}], 209: [function(e, t, r) {
(function(r2) {
(function() {
var n = e("bn.js"), i = e("randombytes");
function s(e2) {
var t2, r3 = e2.modulus.byteLength();
do {
t2 = new n(i(r3));
} while (t2.cmp(e2.modulus) >= 0 || !t2.umod(e2.prime1) || !t2.umod(e2.prime2));
return t2;
}
function o(e2, t2) {
var i2 = (function(e3) {
var t3 = s(e3);
return { blinder: t3.toRed(n.mont(e3.modulus)).redPow(new n(e3.publicExponent)).fromRed(), unblinder: t3.invm(e3.modulus) };
})(t2), o2 = t2.modulus.byteLength(), a = new n(e2).mul(i2.blinder).umod(t2.modulus), l = a.toRed(n.mont(t2.prime1)), c = a.toRed(n.mont(t2.prime2)), u = t2.coefficient, h = t2.prime1, f = t2.prime2, d = l.redPow(t2.exponent1).fromRed(), p = c.redPow(t2.exponent2).fromRed(), m = d.isub(p).imul(u).umod(h).imul(f);
return p.iadd(m).imul(i2.unblinder).umod(t2.modulus).toArrayLike(r2, "be", o2);
}
o.getr = s, t.exports = o;
}).call(this);
}).call(this, e("buffer").Buffer);
}, { "bn.js": 186, buffer: 220, randombytes: 475 }], 210: [function(e, t, r) {
t.exports = e("./browser/algorithms.json");
}, { "./browser/algorithms.json": 211 }], 211: [function(e, t, r) {
t.exports = { sha224WithRSAEncryption: { sign: "rsa", hash: "sha224", id: "302d300d06096086480165030402040500041c" }, "RSA-SHA224": { sign: "ecdsa/rsa", hash: "sha224", id: "302d300d06096086480165030402040500041c" }, sha256WithRSAEncryption: { sign: "rsa", hash: "sha256", id: "3031300d060960864801650304020105000420" }, "RSA-SHA256": { sign: "ecdsa/rsa", hash: "sha256", id: "3031300d060960864801650304020105000420" }, sha384WithRSAEncryption: { sign: "rsa", hash: "sha384", id: "3041300d060960864801650304020205000430" }, "RSA-SHA384": { sign: "ecdsa/rsa", hash: "sha384", id: "3041300d060960864801650304020205000430" }, sha512WithRSAEncryption: { sign: "rsa", hash: "sha512", id: "3051300d060960864801650304020305000440" }, "RSA-SHA512": { sign: "ecdsa/rsa", hash: "sha512", id: "3051300d060960864801650304020305000440" }, "RSA-SHA1": { sign: "rsa", hash: "sha1", id: "3021300906052b0e03021a05000414" }, "ecdsa-with-SHA1": { sign: "ecdsa", hash: "sha1", id: "" }, sha256: { sign: "ecdsa", hash: "sha256", id: "" }, sha224: { sign: "ecdsa", hash: "sha224", id: "" }, sha384: { sign: "ecdsa", hash: "sha384", id: "" }, sha512: { sign: "ecdsa", hash: "sha512", id: "" }, "DSA-SHA": { sign: "dsa", hash: "sha1", id: "" }, "DSA-SHA1": { sign: "dsa", hash: "sha1", id: "" }, DSA: { sign: "dsa", hash: "sha1", id: "" }, "DSA-WITH-SHA224": { sign: "dsa", hash: "sha224", id: "" }, "DSA-SHA224": { sign: "dsa", hash: "sha224", id: "" }, "DSA-WITH-SHA256": { sign: "dsa", hash: "sha256", id: "" }, "DSA-SHA256": { sign: "dsa", hash: "sha256", id: "" }, "DSA-WITH-SHA384": { sign: "dsa", hash: "sha384", id: "" }, "DSA-SHA384": { sign: "dsa", hash: "sha384", id: "" }, "DSA-WITH-SHA512": { sign: "dsa", hash: "sha512", id: "" }, "DSA-SHA512": { sign: "dsa", hash: "sha512", id: "" }, "DSA-RIPEMD160": { sign: "dsa", hash: "rmd160", id: "" }, ripemd160WithRSA: { sign: "rsa", hash: "rmd160", id: "3021300906052b2403020105000414" }, "RSA-RIPEMD160": { sign: "rsa", hash: "rmd160", id: "3021300906052b2403020105000414" }, md5WithRSAEncryption: { sign: "rsa", hash: "md5", id: "3020300c06082a864886f70d020505000410" }, "RSA-MD5": { sign: "rsa", hash: "md5", id: "3020300c06082a864886f70d020505000410" } };
}, {}], 212: [function(e, t, r) {
t.exports = { "1.3.132.0.10": "secp256k1", "1.3.132.0.33": "p224", "1.2.840.10045.3.1.1": "p192", "1.2.840.10045.3.1.7": "p256", "1.3.132.0.34": "p384", "1.3.132.0.35": "p521" };
}, {}], 213: [function(e, t, r) {
var n = e("safe-buffer").Buffer, i = e("create-hash"), s = e("readable-stream"), o = e("inherits"), a = e("./sign"), l = e("./verify"), c = e("./algorithms.json");
function u(e2) {
s.Writable.call(this);
var t2 = c[e2];
if (!t2) throw new Error("Unknown message digest");
this._hashType = t2.hash, this._hash = i(t2.hash), this._tag = t2.id, this._signType = t2.sign;
}
function h(e2) {
s.Writable.call(this);
var t2 = c[e2];
if (!t2) throw new Error("Unknown message digest");
this._hash = i(t2.hash), this._tag = t2.id, this._signType = t2.sign;
}
function f(e2) {
return new u(e2);
}
function d(e2) {
return new h(e2);
}
Object.keys(c).forEach((function(e2) {
c[e2].id = n.from(c[e2].id, "hex"), c[e2.toLowerCase()] = c[e2];
})), o(u, s.Writable), u.prototype._write = function(e2, t2, r2) {
this._hash.update(e2), r2();
}, u.prototype.update = function(e2, t2) {
return "string" == typeof e2 && (e2 = n.from(e2, t2)), this._hash.update(e2), this;
}, u.prototype.sign = function(e2, t2) {
this.end();
var r2 = this._hash.digest(), n2 = a(r2, e2, this._hashType, this._signType, this._tag);
return t2 ? n2.toString(t2) : n2;
}, o(h, s.Writable), h.prototype._write = function(e2, t2, r2) {
this._hash.update(e2), r2();
}, h.prototype.update = function(e2, t2) {
return "string" == typeof e2 && (e2 = n.from(e2, t2)), this._hash.update(e2), this;
}, h.prototype.verify = function(e2, t2, r2) {
"string" == typeof t2 && (t2 = n.from(t2, r2)), this.end();
var i2 = this._hash.digest();
return l(t2, i2, e2, this._signType, this._tag);
}, t.exports = { Sign: f, Verify: d, createSign: f, createVerify: d };
}, { "./algorithms.json": 211, "./sign": 214, "./verify": 215, "create-hash": 386, inherits: 440, "readable-stream": 491, "safe-buffer": 494 }], 214: [function(e, t, r) {
var n = e("safe-buffer").Buffer, i = e("create-hmac"), s = e("browserify-rsa"), o = e("elliptic").ec, a = e("bn.js"), l = e("parse-asn1"), c = e("./curves.json");
function u(e2, t2, r2, s2) {
if ((e2 = n.from(e2.toArray())).length < t2.byteLength()) {
var o2 = n.alloc(t2.byteLength() - e2.length);
e2 = n.concat([o2, e2]);
}
var a2 = r2.length, l2 = (function(e3, t3) {
e3 = (e3 = h(e3, t3)).mod(t3);
var r3 = n.from(e3.toArray());
if (r3.length < t3.byteLength()) {
var i2 = n.alloc(t3.byteLength() - r3.length);
r3 = n.concat([i2, r3]);
}
return r3;
})(r2, t2), c2 = n.alloc(a2);
c2.fill(1);
var u2 = n.alloc(a2);
return u2 = i(s2, u2).update(c2).update(n.from([0])).update(e2).update(l2).digest(), c2 = i(s2, u2).update(c2).digest(), { k: u2 = i(s2, u2).update(c2).update(n.from([1])).update(e2).update(l2).digest(), v: c2 = i(s2, u2).update(c2).digest() };
}
function h(e2, t2) {
var r2 = new a(e2), n2 = (e2.length << 3) - t2.bitLength();
return n2 > 0 && r2.ishrn(n2), r2;
}
function f(e2, t2, r2) {
var s2, o2;
do {
for (s2 = n.alloc(0); 8 * s2.length < e2.bitLength(); ) t2.v = i(r2, t2.k).update(t2.v).digest(), s2 = n.concat([s2, t2.v]);
o2 = h(s2, e2), t2.k = i(r2, t2.k).update(t2.v).update(n.from([0])).digest(), t2.v = i(r2, t2.k).update(t2.v).digest();
} while (-1 !== o2.cmp(e2));
return o2;
}
function d(e2, t2, r2, n2) {
return e2.toRed(a.mont(r2)).redPow(t2).fromRed().mod(n2);
}
t.exports = function(e2, t2, r2, i2, p) {
var m = l(t2);
if (m.curve) {
if ("ecdsa" !== i2 && "ecdsa/rsa" !== i2) throw new Error("wrong private key type");
return (function(e3, t3) {
var r3 = c[t3.curve.join(".")];
if (!r3) throw new Error("unknown curve " + t3.curve.join("."));
var i3 = new o(r3).keyFromPrivate(t3.privateKey).sign(e3);
return n.from(i3.toDER());
})(e2, m);
}
if ("dsa" === m.type) {
if ("dsa" !== i2) throw new Error("wrong private key type");
return (function(e3, t3, r3) {
var i3, s2 = t3.params.priv_key, o2 = t3.params.p, l2 = t3.params.q, c2 = t3.params.g, p2 = new a(0), m2 = h(e3, l2).mod(l2), b2 = false, g2 = u(s2, l2, e3, r3);
for (; false === b2; ) i3 = f(l2, g2, r3), p2 = d(c2, i3, o2, l2), 0 === (b2 = i3.invm(l2).imul(m2.add(s2.mul(p2))).mod(l2)).cmpn(0) && (b2 = false, p2 = new a(0));
return (function(e4, t4) {
e4 = e4.toArray(), t4 = t4.toArray(), 128 & e4[0] && (e4 = [0].concat(e4));
128 & t4[0] && (t4 = [0].concat(t4));
var r4 = [48, e4.length + t4.length + 4, 2, e4.length];
return r4 = r4.concat(e4, [2, t4.length], t4), n.from(r4);
})(p2, b2);
})(e2, m, r2);
}
if ("rsa" !== i2 && "ecdsa/rsa" !== i2) throw new Error("wrong private key type");
e2 = n.concat([p, e2]);
for (var b = m.modulus.byteLength(), g = [0, 1]; e2.length + g.length + 1 < b; ) g.push(255);
g.push(0);
for (var y = -1; ++y < e2.length; ) g.push(e2[y]);
return s(g, m);
}, t.exports.getKey = u, t.exports.makeKey = f;
}, { "./curves.json": 212, "bn.js": 186, "browserify-rsa": 209, "create-hmac": 388, elliptic: 405, "parse-asn1": 459, "safe-buffer": 494 }], 215: [function(e, t, r) {
var n = e("safe-buffer").Buffer, i = e("bn.js"), s = e("elliptic").ec, o = e("parse-asn1"), a = e("./curves.json");
function l(e2, t2) {
if (e2.cmpn(0) <= 0) throw new Error("invalid sig");
if (e2.cmp(t2) >= t2) throw new Error("invalid sig");
}
t.exports = function(e2, t2, r2, c, u) {
var h = o(r2);
if ("ec" === h.type) {
if ("ecdsa" !== c && "ecdsa/rsa" !== c) throw new Error("wrong public key type");
return (function(e3, t3, r3) {
var n2 = a[r3.data.algorithm.curve.join(".")];
if (!n2) throw new Error("unknown curve " + r3.data.algorithm.curve.join("."));
var i2 = new s(n2), o2 = r3.data.subjectPrivateKey.data;
return i2.verify(t3, e3, o2);
})(e2, t2, h);
}
if ("dsa" === h.type) {
if ("dsa" !== c) throw new Error("wrong public key type");
return (function(e3, t3, r3) {
var n2 = r3.data.p, s2 = r3.data.q, a2 = r3.data.g, c2 = r3.data.pub_key, u2 = o.signature.decode(e3, "der"), h2 = u2.s, f2 = u2.r;
l(h2, s2), l(f2, s2);
var d2 = i.mont(n2), p2 = h2.invm(s2);
return 0 === a2.toRed(d2).redPow(new i(t3).mul(p2).mod(s2)).fromRed().mul(c2.toRed(d2).redPow(f2.mul(p2).mod(s2)).fromRed()).mod(n2).mod(s2).cmp(f2);
})(e2, t2, h);
}
if ("rsa" !== c && "ecdsa/rsa" !== c) throw new Error("wrong public key type");
t2 = n.concat([u, t2]);
for (var f = h.modulus.byteLength(), d = [1], p = 0; t2.length + d.length + 2 < f; ) d.push(255), p++;
d.push(0);
for (var m = -1; ++m < t2.length; ) d.push(t2[m]);
d = n.from(d);
var b = i.mont(h.modulus);
e2 = (e2 = new i(e2).toRed(b)).redPow(new i(h.publicExponent)), e2 = n.from(e2.fromRed().toArray());
var g = p < 8 ? 1 : 0;
for (f = Math.min(e2.length, d.length), e2.length !== d.length && (g = 1), m = -1; ++m < f; ) g |= e2[m] ^ d[m];
return 0 === g;
};
}, { "./curves.json": 212, "bn.js": 186, elliptic: 405, "parse-asn1": 459, "safe-buffer": 494 }], 216: [function(e, t, r) {
}, {}], 217: [function(e, t, r) {
var n = e("buffer"), i = n.Buffer;
function s(e2, t2) {
for (var r2 in e2) t2[r2] = e2[r2];
}
function o(e2, t2, r2) {
return i(e2, t2, r2);
}
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? t.exports = n : (s(n, r), r.Buffer = o), s(i, o), o.from = function(e2, t2, r2) {
if ("number" == typeof e2) throw new TypeError("Argument must not be a number");
return i(e2, t2, r2);
}, o.alloc = function(e2, t2, r2) {
if ("number" != typeof e2) throw new TypeError("Argument must be a number");
var n2 = i(e2);
return void 0 !== t2 ? "string" == typeof r2 ? n2.fill(t2, r2) : n2.fill(t2) : n2.fill(0), n2;
}, o.allocUnsafe = function(e2) {
if ("number" != typeof e2) throw new TypeError("Argument must be a number");
return i(e2);
}, o.allocUnsafeSlow = function(e2) {
if ("number" != typeof e2) throw new TypeError("Argument must be a number");
return n.SlowBuffer(e2);
};
}, { buffer: 220 }], 218: [function(e, t, r) {
var n = e("safe-buffer").Buffer, i = n.isEncoding || function(e2) {
switch ((e2 = "" + e2) && e2.toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
case "raw":
return true;
default:
return false;
}
};
function s(e2) {
var t2;
switch (this.encoding = (function(e3) {
var t3 = (function(e4) {
if (!e4) return "utf8";
for (var t4; ; ) switch (e4) {
case "utf8":
case "utf-8":
return "utf8";
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return "utf16le";
case "latin1":
case "binary":
return "latin1";
case "base64":
case "ascii":
case "hex":
return e4;
default:
if (t4) return;
e4 = ("" + e4).toLowerCase(), t4 = true;
}
})(e3);
if ("string" != typeof t3 && (n.isEncoding === i || !i(e3))) throw new Error("Unknown encoding: " + e3);
return t3 || e3;
})(e2), this.encoding) {
case "utf16le":
this.text = l, this.end = c, t2 = 4;
break;
case "utf8":
this.fillLast = a, t2 = 4;
break;
case "base64":
this.text = u, this.end = h, t2 = 3;
break;
default:
return this.write = f, void (this.end = d);
}
this.lastNeed = 0, this.lastTotal = 0, this.lastChar = n.allocUnsafe(t2);
}
function o(e2) {
return e2 <= 127 ? 0 : e2 >> 5 == 6 ? 2 : e2 >> 4 == 14 ? 3 : e2 >> 3 == 30 ? 4 : e2 >> 6 == 2 ? -1 : -2;
}
function a(e2) {
var t2 = this.lastTotal - this.lastNeed, r2 = (function(e3, t3, r3) {
if (128 != (192 & t3[0])) return e3.lastNeed = 0, "�";
if (e3.lastNeed > 1 && t3.length > 1) {
if (128 != (192 & t3[1])) return e3.lastNeed = 1, "�";
if (e3.lastNeed > 2 && t3.length > 2 && 128 != (192 & t3[2])) return e3.lastNeed = 2, "�";
}
})(this, e2);
return void 0 !== r2 ? r2 : this.lastNeed <= e2.length ? (e2.copy(this.lastChar, t2, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (e2.copy(this.lastChar, t2, 0, e2.length), void (this.lastNeed -= e2.length));
}
function l(e2, t2) {
if ((e2.length - t2) % 2 == 0) {
var r2 = e2.toString("utf16le", t2);
if (r2) {
var n2 = r2.charCodeAt(r2.length - 1);
if (n2 >= 55296 && n2 <= 56319) return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = e2[e2.length - 2], this.lastChar[1] = e2[e2.length - 1], r2.slice(0, -1);
}
return r2;
}
return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = e2[e2.length - 1], e2.toString("utf16le", t2, e2.length - 1);
}
function c(e2) {
var t2 = e2 && e2.length ? this.write(e2) : "";
if (this.lastNeed) {
var r2 = this.lastTotal - this.lastNeed;
return t2 + this.lastChar.toString("utf16le", 0, r2);
}
return t2;
}
function u(e2, t2) {
var r2 = (e2.length - t2) % 3;
return 0 === r2 ? e2.toString("base64", t2) : (this.lastNeed = 3 - r2, this.lastTotal = 3, 1 === r2 ? this.lastChar[0] = e2[e2.length - 1] : (this.lastChar[0] = e2[e2.length - 2], this.lastChar[1] = e2[e2.length - 1]), e2.toString("base64", t2, e2.length - r2));
}
function h(e2) {
var t2 = e2 && e2.length ? this.write(e2) : "";
return this.lastNeed ? t2 + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : t2;
}
function f(e2) {
return e2.toString(this.encoding);
}
function d(e2) {
return e2 && e2.length ? this.write(e2) : "";
}
r.StringDecoder = s, s.prototype.write = function(e2) {
if (0 === e2.length) return "";
var t2, r2;
if (this.lastNeed) {
if (void 0 === (t2 = this.fillLast(e2))) return "";
r2 = this.lastNeed, this.lastNeed = 0;
} else r2 = 0;
return r2 < e2.length ? t2 ? t2 + this.text(e2, r2) : this.text(e2, r2) : t2 || "";
}, s.prototype.end = function(e2) {
var t2 = e2 && e2.length ? this.write(e2) : "";
return this.lastNeed ? t2 + "�" : t2;
}, s.prototype.text = function(e2, t2) {
var r2 = (function(e3, t3, r3) {
var n3 = t3.length - 1;
if (n3 < r3) return 0;
var i2 = o(t3[n3]);
if (i2 >= 0) return i2 > 0 && (e3.lastNeed = i2 - 1), i2;
if (--n3 < r3 || -2 === i2) return 0;
if ((i2 = o(t3[n3])) >= 0) return i2 > 0 && (e3.lastNeed = i2 - 2), i2;
if (--n3 < r3 || -2 === i2) return 0;
if ((i2 = o(t3[n3])) >= 0) return i2 > 0 && (2 === i2 ? i2 = 0 : e3.lastNeed = i2 - 3), i2;
return 0;
})(this, e2, t2);
if (!this.lastNeed) return e2.toString("utf8", t2);
this.lastTotal = r2;
var n2 = e2.length - (r2 - this.lastNeed);
return e2.copy(this.lastChar, 0, n2), e2.toString("utf8", t2, n2);
}, s.prototype.fillLast = function(e2) {
if (this.lastNeed <= e2.length) return e2.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
e2.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, e2.length), this.lastNeed -= e2.length;
};
}, { "safe-buffer": 217 }], 219: [function(e, t, r) {
(function(e2) {
(function() {
t.exports = function(t2, r2) {
for (var n = Math.min(t2.length, r2.length), i = new e2(n), s = 0; s < n; ++s) i[s] = t2[s] ^ r2[s];
return i;
};
}).call(this);
}).call(this, e("buffer").Buffer);
}, { buffer: 220 }], 220: [function(e, t, r) {
(function(t2) {
(function() {
var t3 = e("base64-js"), n = e("ieee754");
r.Buffer = s, r.SlowBuffer = function(e2) {
+e2 != e2 && (e2 = 0);
return s.alloc(+e2);
}, r.INSPECT_MAX_BYTES = 50;
function i(e2) {
if (e2 > 2147483647) throw new RangeError('The value "' + e2 + '" is invalid for option "size"');
var t4 = new Uint8Array(e2);
return t4.__proto__ = s.prototype, t4;
}
function s(e2, t4, r2) {
if ("number" == typeof e2) {
if ("string" == typeof t4) throw new TypeError('The "string" argument must be of type string. Received type number');
return l(e2);
}
return o(e2, t4, r2);
}
function o(e2, t4, r2) {
if ("string" == typeof e2) return (function(e3, t5) {
"string" == typeof t5 && "" !== t5 || (t5 = "utf8");
if (!s.isEncoding(t5)) throw new TypeError("Unknown encoding: " + t5);
var r3 = 0 | h(e3, t5), n3 = i(r3), o3 = n3.write(e3, t5);
o3 !== r3 && (n3 = n3.slice(0, o3));
return n3;
})(e2, t4);
if (ArrayBuffer.isView(e2)) return c(e2);
if (null == e2) throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e2);
if (F(e2, ArrayBuffer) || e2 && F(e2.buffer, ArrayBuffer)) return (function(e3, t5, r3) {
if (t5 < 0 || e3.byteLength < t5) throw new RangeError('"offset" is outside of buffer bounds');
if (e3.byteLength < t5 + (r3 || 0)) throw new RangeError('"length" is outside of buffer bounds');
var n3;
n3 = void 0 === t5 && void 0 === r3 ? new Uint8Array(e3) : void 0 === r3 ? new Uint8Array(e3, t5) : new Uint8Array(e3, t5, r3);
return n3.__proto__ = s.prototype, n3;
})(e2, t4, r2);
if ("number" == typeof e2) throw new TypeError('The "value" argument must not be of type number. Received type number');
var n2 = e2.valueOf && e2.valueOf();
if (null != n2 && n2 !== e2) return s.from(n2, t4, r2);
var o2 = (function(e3) {
if (s.isBuffer(e3)) {
var t5 = 0 | u(e3.length), r3 = i(t5);
return 0 === r3.length || e3.copy(r3, 0, 0, t5), r3;
}
if (void 0 !== e3.length) return "number" != typeof e3.length || L(e3.length) ? i(0) : c(e3);
if ("Buffer" === e3.type && Array.isArray(e3.data)) return c(e3.data);
})(e2);
if (o2) return o2;
if ("undefined" != typeof Symbol && null != Symbol.toPrimitive && "function" == typeof e2[Symbol.toPrimitive]) return s.from(e2[Symbol.toPrimitive]("string"), t4, r2);
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e2);
}
function a(e2) {
if ("number" != typeof e2) throw new TypeError('"size" argument must be of type number');
if (e2 < 0) throw new RangeError('The value "' + e2 + '" is invalid for option "size"');
}
function l(e2) {
return a(e2), i(e2 < 0 ? 0 : 0 | u(e2));
}
function c(e2) {
for (var t4 = e2.length < 0 ? 0 : 0 | u(e2.length), r2 = i(t4), n2 = 0; n2 < t4; n2 += 1) r2[n2] = 255 & e2[n2];
return r2;
}
function u(e2) {
if (e2 >= 2147483647) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + 2147483647 .toString(16) + " bytes");
return 0 | e2;
}
function h(e2, t4) {
if (s.isBuffer(e2)) return e2.length;
if (ArrayBuffer.isView(e2) || F(e2, ArrayBuffer)) return e2.byteLength;
if ("string" != typeof e2) throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof e2);
var r2 = e2.length, n2 = arguments.length > 2 && true === arguments[2];
if (!n2 && 0 === r2) return 0;
for (var i2 = false; ; ) switch (t4) {
case "ascii":
case "latin1":
case "binary":
return r2;
case "utf8":
case "utf-8":
return P(e2).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return 2 * r2;
case "hex":
return r2 >>> 1;
case "base64":
return B(e2).length;
default:
if (i2) return n2 ? -1 : P(e2).length;
t4 = ("" + t4).toLowerCase(), i2 = true;
}
}
function f(e2, t4, r2) {
var n2 = false;
if ((void 0 === t4 || t4 < 0) && (t4 = 0), t4 > this.length) return "";
if ((void 0 === r2 || r2 > this.length) && (r2 = this.length), r2 <= 0) return "";
if ((r2 >>>= 0) <= (t4 >>>= 0)) return "";
for (e2 || (e2 = "utf8"); ; ) switch (e2) {
case "hex":
return C(this, t4, r2);
case "utf8":
case "utf-8":
return k(this, t4, r2);
case "ascii":
return S(this, t4, r2);
case "latin1":
case "binary":
return M(this, t4, r2);
case "base64":
return x(this, t4, r2);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return T(this, t4, r2);
default:
if (n2) throw new TypeError("Unknown encoding: " + e2);
e2 = (e2 + "").toLowerCase(), n2 = true;
}
}
function d(e2, t4, r2) {
var n2 = e2[t4];
e2[t4] = e2[r2], e2[r2] = n2;
}
function p(e2, t4, r2, n2, i2) {
if (0 === e2.length) return -1;
if ("string" == typeof r2 ? (n2 = r2, r2 = 0) : r2 > 2147483647 ? r2 = 2147483647 : r2 < -2147483648 && (r2 = -2147483648), L(r2 = +r2) && (r2 = i2 ? 0 : e2.length - 1), r2 < 0 && (r2 = e2.length + r2), r2 >= e2.length) {
if (i2) return -1;
r2 = e2.length - 1;
} else if (r2 < 0) {
if (!i2) return -1;
r2 = 0;
}
if ("string" == typeof t4 && (t4 = s.from(t4, n2)), s.isBuffer(t4)) return 0 === t4.length ? -1 : m(e2, t4, r2, n2, i2);
if ("number" == typeof t4) return t4 &= 255, "function" == typeof Uint8Array.prototype.indexOf ? i2 ? Uint8Array.prototype.indexOf.call(e2, t4, r2) : Uint8Array.prototype.lastIndexOf.call(e2, t4, r2) : m(e2, [t4], r2, n2, i2);
throw new TypeError("val must be string, number or Buffer");
}
function m(e2, t4, r2, n2, i2) {
var s2, o2 = 1, a2 = e2.length, l2 = t4.length;
if (void 0 !== n2 && ("ucs2" === (n2 = String(n2).toLowerCase()) || "ucs-2" === n2 || "utf16le" === n2 || "utf-16le" === n2)) {
if (e2.length < 2 || t4.length < 2) return -1;
o2 = 2, a2 /= 2, l2 /= 2, r2 /= 2;
}
function c2(e3, t5) {
return 1 === o2 ? e3[t5] : e3.readUInt16BE(t5 * o2);
}
if (i2) {
var u2 = -1;
for (s2 = r2; s2 < a2; s2++) if (c2(e2, s2) === c2(t4, -1 === u2 ? 0 : s2 - u2)) {
if (-1 === u2 && (u2 = s2), s2 - u2 + 1 === l2) return u2 * o2;
} else -1 !== u2 && (s2 -= s2 - u2), u2 = -1;
} else for (r2 + l2 > a2 && (r2 = a2 - l2), s2 = r2; s2 >= 0; s2--) {
for (var h2 = true, f2 = 0; f2 < l2; f2++) if (c2(e2, s2 + f2) !== c2(t4, f2)) {
h2 = false;
break;
}
if (h2) return s2;
}
return -1;
}
function b(e2, t4, r2, n2) {
r2 = Number(r2) || 0;
var i2 = e2.length - r2;
n2 ? (n2 = Number(n2)) > i2 && (n2 = i2) : n2 = i2;
var s2 = t4.length;
n2 > s2 / 2 && (n2 = s2 / 2);
for (var o2 = 0; o2 < n2; ++o2) {
var a2 = parseInt(t4.substr(2 * o2, 2), 16);
if (L(a2)) return o2;
e2[r2 + o2] = a2;
}
return o2;
}
function g(e2, t4, r2, n2) {
return D(P(t4, e2.length - r2), e2, r2, n2);
}
function y(e2, t4, r2, n2) {
return D((function(e3) {
for (var t5 = [], r3 = 0; r3 < e3.length; ++r3) t5.push(255 & e3.charCodeAt(r3));
return t5;
})(t4), e2, r2, n2);
}
function v(e2, t4, r2, n2) {
return y(e2, t4, r2, n2);
}
function w(e2, t4, r2, n2) {
return D(B(t4), e2, r2, n2);
}
function _(e2, t4, r2, n2) {
return D((function(e3, t5) {
for (var r3, n3, i2, s2 = [], o2 = 0; o2 < e3.length && !((t5 -= 2) < 0); ++o2) r3 = e3.charCodeAt(o2), n3 = r3 >> 8, i2 = r3 % 256, s2.push(i2), s2.push(n3);
return s2;
})(t4, e2.length - r2), e2, r2, n2);
}
function x(e2, r2, n2) {
return 0 === r2 && n2 === e2.length ? t3.fromByteArray(e2) : t3.fromByteArray(e2.slice(r2, n2));
}
function k(e2, t4, r2) {
r2 = Math.min(e2.length, r2);
for (var n2 = [], i2 = t4; i2 < r2; ) {
var s2, o2, a2, l2, c2 = e2[i2], u2 = null, h2 = c2 > 239 ? 4 : c2 > 223 ? 3 : c2 > 191 ? 2 : 1;
if (i2 + h2 <= r2) switch (h2) {
case 1:
c2 < 128 && (u2 = c2);
break;
case 2:
128 == (192 & (s2 = e2[i2 + 1])) && (l2 = (31 & c2) << 6 | 63 & s2) > 127 && (u2 = l2);
break;
case 3:
s2 = e2[i2 + 1], o2 = e2[i2 + 2], 128 == (192 & s2) && 128 == (192 & o2) && (l2 = (15 & c2) << 12 | (63 & s2) << 6 | 63 & o2) > 2047 && (l2 < 55296 || l2 > 57343) && (u2 = l2);
break;
case 4:
s2 = e2[i2 + 1], o2 = e2[i2 + 2], a2 = e2[i2 + 3], 128 == (192 & s2) && 128 == (192 & o2) && 128 == (192 & a2) && (l2 = (15 & c2) << 18 | (63 & s2) << 12 | (63 & o2) << 6 | 63 & a2) > 65535 && l2 < 1114112 && (u2 = l2);
}
null === u2 ? (u2 = 65533, h2 = 1) : u2 > 65535 && (u2 -= 65536, n2.push(u2 >>> 10 & 1023 | 55296), u2 = 56320 | 1023 & u2), n2.push(u2), i2 += h2;
}
return (function(e3) {
var t5 = e3.length;
if (t5 <= 4096) return String.fromCharCode.apply(String, e3);
var r3 = "", n3 = 0;
for (; n3 < t5; ) r3 += String.fromCharCode.apply(String, e3.slice(n3, n3 += 4096));
return r3;
})(n2);
}
r.kMaxLength = 2147483647, s.TYPED_ARRAY_SUPPORT = (function() {
try {
var e2 = new Uint8Array(1);
return e2.__proto__ = { __proto__: Uint8Array.prototype, foo: function() {
return 42;
} }, 42 === e2.foo();
} catch (e3) {
return false;
}
})(), s.TYPED_ARRAY_SUPPORT || "undefined" == typeof console || "function" != typeof console.error || console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."), Object.defineProperty(s.prototype, "parent", { enumerable: true, get: function() {
if (s.isBuffer(this)) return this.buffer;
} }), Object.defineProperty(s.prototype, "offset", { enumerable: true, get: function() {
if (s.isBuffer(this)) return this.byteOffset;
} }), "undefined" != typeof Symbol && null != Symbol.species && s[Symbol.species] === s && Object.defineProperty(s, Symbol.species, { value: null, configurable: true, enumerable: false, writable: false }), s.poolSize = 8192, s.from = function(e2, t4, r2) {
return o(e2, t4, r2);
}, s.prototype.__proto__ = Uint8Array.prototype, s.__proto__ = Uint8Array, s.alloc = function(e2, t4, r2) {
return (function(e3, t5, r3) {
return a(e3), e3 <= 0 ? i(e3) : void 0 !== t5 ? "string" == typeof r3 ? i(e3).fill(t5, r3) : i(e3).fill(t5) : i(e3);
})(e2, t4, r2);
}, s.allocUnsafe = function(e2) {
return l(e2);
}, s.allocUnsafeSlow = function(e2) {
return l(e2);
}, s.isBuffer = function(e2) {
return null != e2 && true === e2._isBuffer && e2 !== s.prototype;
}, s.compare = function(e2, t4) {
if (F(e2, Uint8Array) && (e2 = s.from(e2, e2.offset, e2.byteLength)), F(t4, Uint8Array) && (t4 = s.from(t4, t4.offset, t4.byteLength)), !s.isBuffer(e2) || !s.isBuffer(t4)) throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
if (e2 === t4) return 0;
for (var r2 = e2.length, n2 = t4.length, i2 = 0, o2 = Math.min(r2, n2); i2 < o2; ++i2) if (e2[i2] !== t4[i2]) {
r2 = e2[i2], n2 = t4[i2];
break;
}
return r2 < n2 ? -1 : n2 < r2 ? 1 : 0;
}, s.isEncoding = function(e2) {
switch (String(e2).toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "latin1":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return true;
default:
return false;
}
}, s.concat = function(e2, t4) {
if (!Array.isArray(e2)) throw new TypeError('"list" argument must be an Array of Buffers');
if (0 === e2.length) return s.alloc(0);
var r2;
if (void 0 === t4) for (t4 = 0, r2 = 0; r2 < e2.length; ++r2) t4 += e2[r2].length;
var n2 = s.allocUnsafe(t4), i2 = 0;
for (r2 = 0; r2 < e2.length; ++r2) {
var o2 = e2[r2];
if (F(o2, Uint8Array) && (o2 = s.from(o2)), !s.isBuffer(o2)) throw new TypeError('"list" argument must be an Array of Buffers');
o2.copy(n2, i2), i2 += o2.length;
}
return n2;
}, s.byteLength = h, s.prototype._isBuffer = true, s.prototype.swap16 = function() {
var e2 = this.length;
if (e2 % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
for (var t4 = 0; t4 < e2; t4 += 2) d(this, t4, t4 + 1);
return this;
}, s.prototype.swap32 = function() {
var e2 = this.length;
if (e2 % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
for (var t4 = 0; t4 < e2; t4 += 4) d(this, t4, t4 + 3), d(this, t4 + 1, t4 + 2);
return this;
}, s.prototype.swap64 = function() {
var e2 = this.length;
if (e2 % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
for (var t4 = 0; t4 < e2; t4 += 8) d(this, t4, t4 + 7), d(this, t4 + 1, t4 + 6), d(this, t4 + 2, t4 + 5), d(this, t4 + 3, t4 + 4);
return this;
}, s.prototype.toString = function() {
var e2 = this.length;
return 0 === e2 ? "" : 0 === arguments.length ? k(this, 0, e2) : f.apply(this, arguments);
}, s.prototype.toLocaleString = s.prototype.toString, s.prototype.equals = function(e2) {
if (!s.isBuffer(e2)) throw new TypeError("Argument must be a Buffer");
return this === e2 || 0 === s.compare(this, e2);
}, s.prototype.inspect = function() {
var e2 = "", t4 = r.INSPECT_MAX_BYTES;
return e2 = this.toString("hex", 0, t4).replace(/(.{2})/g, "$1 ").trim(), this.length > t4 && (e2 += " ... "), "";
}, s.prototype.compare = function(e2, t4, r2, n2, i2) {
if (F(e2, Uint8Array) && (e2 = s.from(e2, e2.offset, e2.byteLength)), !s.isBuffer(e2)) throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof e2);
if (void 0 === t4 && (t4 = 0), void 0 === r2 && (r2 = e2 ? e2.length : 0), void 0 === n2 && (n2 = 0), void 0 === i2 && (i2 = this.length), t4 < 0 || r2 > e2.length || n2 < 0 || i2 > this.length) throw new RangeError("out of range index");
if (n2 >= i2 && t4 >= r2) return 0;
if (n2 >= i2) return -1;
if (t4 >= r2) return 1;
if (this === e2) return 0;
for (var o2 = (i2 >>>= 0) - (n2 >>>= 0), a2 = (r2 >>>= 0) - (t4 >>>= 0), l2 = Math.min(o2, a2), c2 = this.slice(n2, i2), u2 = e2.slice(t4, r2), h2 = 0; h2 < l2; ++h2) if (c2[h2] !== u2[h2]) {
o2 = c2[h2], a2 = u2[h2];
break;
}
return o2 < a2 ? -1 : a2 < o2 ? 1 : 0;
}, s.prototype.includes = function(e2, t4, r2) {
return -1 !== this.indexOf(e2, t4, r2);
}, s.prototype.indexOf = function(e2, t4, r2) {
return p(this, e2, t4, r2, true);
}, s.prototype.lastIndexOf = function(e2, t4, r2) {
return p(this, e2, t4, r2, false);
}, s.prototype.write = function(e2, t4, r2, n2) {
if (void 0 === t4) n2 = "utf8", r2 = this.length, t4 = 0;
else if (void 0 === r2 && "string" == typeof t4) n2 = t4, r2 = this.length, t4 = 0;
else {
if (!isFinite(t4)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
t4 >>>= 0, isFinite(r2) ? (r2 >>>= 0, void 0 === n2 && (n2 = "utf8")) : (n2 = r2, r2 = void 0);
}
var i2 = this.length - t4;
if ((void 0 === r2 || r2 > i2) && (r2 = i2), e2.length > 0 && (r2 < 0 || t4 < 0) || t4 > this.length) throw new RangeError("Attempt to write outside buffer bounds");
n2 || (n2 = "utf8");
for (var s2 = false; ; ) switch (n2) {
case "hex":
return b(this, e2, t4, r2);
case "utf8":
case "utf-8":
return g(this, e2, t4, r2);
case "ascii":
return y(this, e2, t4, r2);
case "latin1":
case "binary":
return v(this, e2, t4, r2);
case "base64":
return w(this, e2, t4, r2);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return _(this, e2, t4, r2);
default:
if (s2) throw new TypeError("Unknown encoding: " + n2);
n2 = ("" + n2).toLowerCase(), s2 = true;
}
}, s.prototype.toJSON = function() {
return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
};
function S(e2, t4, r2) {
var n2 = "";
r2 = Math.min(e2.length, r2);
for (var i2 = t4; i2 < r2; ++i2) n2 += String.fromCharCode(127 & e2[i2]);
return n2;
}
function M(e2, t4, r2) {
var n2 = "";
r2 = Math.min(e2.length, r2);
for (var i2 = t4; i2 < r2; ++i2) n2 += String.fromCharCode(e2[i2]);
return n2;
}
function C(e2, t4, r2) {
var n2 = e2.length;
(!t4 || t4 < 0) && (t4 = 0), (!r2 || r2 < 0 || r2 > n2) && (r2 = n2);
for (var i2 = "", s2 = t4; s2 < r2; ++s2) i2 += N(e2[s2]);
return i2;
}
function T(e2, t4, r2) {
for (var n2 = e2.slice(t4, r2), i2 = "", s2 = 0; s2 < n2.length; s2 += 2) i2 += String.fromCharCode(n2[s2] + 256 * n2[s2 + 1]);
return i2;
}
function E(e2, t4, r2) {
if (e2 % 1 != 0 || e2 < 0) throw new RangeError("offset is not uint");
if (e2 + t4 > r2) throw new RangeError("Trying to access beyond buffer length");
}
function A(e2, t4, r2, n2, i2, o2) {
if (!s.isBuffer(e2)) throw new TypeError('"buffer" argument must be a Buffer instance');
if (t4 > i2 || t4 < o2) throw new RangeError('"value" argument is out of bounds');
if (r2 + n2 > e2.length) throw new RangeError("Index out of range");
}
function R(e2, t4, r2, n2, i2, s2) {
if (r2 + n2 > e2.length) throw new RangeError("Index out of range");
if (r2 < 0) throw new RangeError("Index out of range");
}
function O(e2, t4, r2, i2, s2) {
return t4 = +t4, r2 >>>= 0, s2 || R(e2, 0, r2, 4), n.write(e2, t4, r2, i2, 23, 4), r2 + 4;
}
function j(e2, t4, r2, i2, s2) {
return t4 = +t4, r2 >>>= 0, s2 || R(e2, 0, r2, 8), n.write(e2, t4, r2, i2, 52, 8), r2 + 8;
}
s.prototype.slice = function(e2, t4) {
var r2 = this.length;
(e2 = ~~e2) < 0 ? (e2 += r2) < 0 && (e2 = 0) : e2 > r2 && (e2 = r2), (t4 = void 0 === t4 ? r2 : ~~t4) < 0 ? (t4 += r2) < 0 && (t4 = 0) : t4 > r2 && (t4 = r2), t4 < e2 && (t4 = e2);
var n2 = this.subarray(e2, t4);
return n2.__proto__ = s.prototype, n2;
}, s.prototype.readUIntLE = function(e2, t4, r2) {
e2 >>>= 0, t4 >>>= 0, r2 || E(e2, t4, this.length);
for (var n2 = this[e2], i2 = 1, s2 = 0; ++s2 < t4 && (i2 *= 256); ) n2 += this[e2 + s2] * i2;
return n2;
}, s.prototype.readUIntBE = function(e2, t4, r2) {
e2 >>>= 0, t4 >>>= 0, r2 || E(e2, t4, this.length);
for (var n2 = this[e2 + --t4], i2 = 1; t4 > 0 && (i2 *= 256); ) n2 += this[e2 + --t4] * i2;
return n2;
}, s.prototype.readUInt8 = function(e2, t4) {
return e2 >>>= 0, t4 || E(e2, 1, this.length), this[e2];
}, s.prototype.readUInt16LE = function(e2, t4) {
return e2 >>>= 0, t4 || E(e2, 2, this.length), this[e2] | this[e2 + 1] << 8;
}, s.prototype.readUInt16BE = function(e2, t4) {
return e2 >>>= 0, t4 || E(e2, 2, this.length), this[e2] << 8 | this[e2 + 1];
}, s.prototype.readUInt32LE = function(e2, t4) {
return e2 >>>= 0, t4 || E(e2, 4, this.length), (this[e2] | this[e2 + 1] << 8 | this[e2 + 2] << 16) + 16777216 * this[e2 + 3];
}, s.prototype.readUInt32BE = function(e2, t4) {
return e2 >>>= 0, t4 || E(e2, 4, this.length), 16777216 * this[e2] + (this[e2 + 1] << 16 | this[e2 + 2] << 8 | this[e2 + 3]);
}, s.prototype.readIntLE = function(e2, t4, r2) {
e2 >>>= 0, t4 >>>= 0, r2 || E(e2, t4, this.length);
for (var n2 = this[e2], i2 = 1, s2 = 0; ++s2 < t4 && (i2 *= 256); ) n2 += this[e2 + s2] * i2;
return n2 >= (i2 *= 128) && (n2 -= Math.pow(2, 8 * t4)), n2;
}, s.prototype.readIntBE = function(e2, t4, r2) {
e2 >>>= 0, t4 >>>= 0, r2 || E(e2, t4, this.length);
for (var n2 = t4, i2 = 1, s2 = this[e2 + --n2]; n2 > 0 && (i2 *= 256); ) s2 += this[e2 + --n2] * i2;
return s2 >= (i2 *= 128) && (s2 -= Math.pow(2, 8 * t4)), s2;
}, s.prototype.readInt8 = function(e2, t4) {
return e2 >>>= 0, t4 || E(e2, 1, this.length), 128 & this[e2] ? -1 * (255 - this[e2] + 1) : this[e2];
}, s.prototype.readInt16LE = function(e2, t4) {
e2 >>>= 0, t4 || E(e2, 2, this.length);
var r2 = this[e2] | this[e2 + 1] << 8;
return 32768 & r2 ? 4294901760 | r2 : r2;
}, s.prototype.readInt16BE = function(e2, t4) {
e2 >>>= 0, t4 || E(e2, 2, this.length);
var r2 = this[e2 + 1] | this[e2] << 8;
return 32768 & r2 ? 4294901760 | r2 : r2;
}, s.prototype.readInt32LE = function(e2, t4) {
return e2 >>>= 0, t4 || E(e2, 4, this.length), this[e2] | this[e2 + 1] << 8 | this[e2 + 2] << 16 | this[e2 + 3] << 24;
}, s.prototype.readInt32BE = function(e2, t4) {
return e2 >>>= 0, t4 || E(e2, 4, this.length), this[e2] << 24 | this[e2 + 1] << 16 | this[e2 + 2] << 8 | this[e2 + 3];
}, s.prototype.readFloatLE = function(e2, t4) {
return e2 >>>= 0, t4 || E(e2, 4, this.length), n.read(this, e2, true, 23, 4);
}, s.prototype.readFloatBE = function(e2, t4) {
return e2 >>>= 0, t4 || E(e2, 4, this.length), n.read(this, e2, false, 23, 4);
}, s.prototype.readDoubleLE = function(e2, t4) {
return e2 >>>= 0, t4 || E(e2, 8, this.length), n.read(this, e2, true, 52, 8);
}, s.prototype.readDoubleBE = function(e2, t4) {
return e2 >>>= 0, t4 || E(e2, 8, this.length), n.read(this, e2, false, 52, 8);
}, s.prototype.writeUIntLE = function(e2, t4, r2, n2) {
(e2 = +e2, t4 >>>= 0, r2 >>>= 0, n2) || A(this, e2, t4, r2, Math.pow(2, 8 * r2) - 1, 0);
var i2 = 1, s2 = 0;
for (this[t4] = 255 & e2; ++s2 < r2 && (i2 *= 256); ) this[t4 + s2] = e2 / i2 & 255;
return t4 + r2;
}, s.prototype.writeUIntBE = function(e2, t4, r2, n2) {
(e2 = +e2, t4 >>>= 0, r2 >>>= 0, n2) || A(this, e2, t4, r2, Math.pow(2, 8 * r2) - 1, 0);
var i2 = r2 - 1, s2 = 1;
for (this[t4 + i2] = 255 & e2; --i2 >= 0 && (s2 *= 256); ) this[t4 + i2] = e2 / s2 & 255;
return t4 + r2;
}, s.prototype.writeUInt8 = function(e2, t4, r2) {
return e2 = +e2, t4 >>>= 0, r2 || A(this, e2, t4, 1, 255, 0), this[t4] = 255 & e2, t4 + 1;
}, s.prototype.writeUInt16LE = function(e2, t4, r2) {
return e2 = +e2, t4 >>>= 0, r2 || A(this, e2, t4, 2, 65535, 0), this[t4] = 255 & e2, this[t4 + 1] = e2 >>> 8, t4 + 2;
}, s.prototype.writeUInt16BE = function(e2, t4, r2) {
return e2 = +e2, t4 >>>= 0, r2 || A(this, e2, t4, 2, 65535, 0), this[t4] = e2 >>> 8, this[t4 + 1] = 255 & e2, t4 + 2;
}, s.prototype.writeUInt32LE = function(e2, t4, r2) {
return e2 = +e2, t4 >>>= 0, r2 || A(this, e2, t4, 4, 4294967295, 0), this[t4 + 3] = e2 >>> 24, this[t4 + 2] = e2 >>> 16, this[t4 + 1] = e2 >>> 8, this[t4] = 255 & e2, t4 + 4;
}, s.prototype.writeUInt32BE = function(e2, t4, r2) {
return e2 = +e2, t4 >>>= 0, r2 || A(this, e2, t4, 4, 4294967295, 0), this[t4] = e2 >>> 24, this[t4 + 1] = e2 >>> 16, this[t4 + 2] = e2 >>> 8, this[t4 + 3] = 255 & e2, t4 + 4;
}, s.prototype.writeIntLE = function(e2, t4, r2, n2) {
if (e2 = +e2, t4 >>>= 0, !n2) {
var i2 = Math.pow(2, 8 * r2 - 1);
A(this, e2, t4, r2, i2 - 1, -i2);
}
var s2 = 0, o2 = 1, a2 = 0;
for (this[t4] = 255 & e2; ++s2 < r2 && (o2 *= 256); ) e2 < 0 && 0 === a2 && 0 !== this[t4 + s2 - 1] && (a2 = 1), this[t4 + s2] = (e2 / o2 >> 0) - a2 & 255;
return t4 + r2;
}, s.prototype.writeIntBE = function(e2, t4, r2, n2) {
if (e2 = +e2, t4 >>>= 0, !n2) {
var i2 = Math.pow(2, 8 * r2 - 1);
A(this, e2, t4, r2, i2 - 1, -i2);
}
var s2 = r2 - 1, o2 = 1, a2 = 0;
for (this[t4 + s2] = 255 & e2; --s2 >= 0 && (o2 *= 256); ) e2 < 0 && 0 === a2 && 0 !== this[t4 + s2 + 1] && (a2 = 1), this[t4 + s2] = (e2 / o2 >> 0) - a2 & 255;
return t4 + r2;
}, s.prototype.writeInt8 = function(e2, t4, r2) {
return e2 = +e2, t4 >>>= 0, r2 || A(this, e2, t4, 1, 127, -128), e2 < 0 && (e2 = 255 + e2 + 1), this[t4] = 255 & e2, t4 + 1;
}, s.prototype.writeInt16LE = function(e2, t4, r2) {
return e2 = +e2, t4 >>>= 0, r2 || A(this, e2, t4, 2, 32767, -32768), this[t4] = 255 & e2, this[t4 + 1] = e2 >>> 8, t4 + 2;
}, s.prototype.writeInt16BE = function(e2, t4, r2) {
return e2 = +e2, t4 >>>= 0, r2 || A(this, e2, t4, 2, 32767, -32768), this[t4] = e2 >>> 8, this[t4 + 1] = 255 & e2, t4 + 2;
}, s.prototype.writeInt32LE = function(e2, t4, r2) {
return e2 = +e2, t4 >>>= 0, r2 || A(this, e2, t4, 4, 2147483647, -2147483648), this[t4] = 255 & e2, this[t4 + 1] = e2 >>> 8, this[t4 + 2] = e2 >>> 16, this[t4 + 3] = e2 >>> 24, t4 + 4;
}, s.prototype.writeInt32BE = function(e2, t4, r2) {
return e2 = +e2, t4 >>>= 0, r2 || A(this, e2, t4, 4, 2147483647, -2147483648), e2 < 0 && (e2 = 4294967295 + e2 + 1), this[t4] = e2 >>> 24, this[t4 + 1] = e2 >>> 16, this[t4 + 2] = e2 >>> 8, this[t4 + 3] = 255 & e2, t4 + 4;
}, s.prototype.writeFloatLE = function(e2, t4, r2) {
return O(this, e2, t4, true, r2);
}, s.prototype.writeFloatBE = function(e2, t4, r2) {
return O(this, e2, t4, false, r2);
}, s.prototype.writeDoubleLE = function(e2, t4, r2) {
return j(this, e2, t4, true, r2);
}, s.prototype.writeDoubleBE = function(e2, t4, r2) {
return j(this, e2, t4, false, r2);
}, s.prototype.copy = function(e2, t4, r2, n2) {
if (!s.isBuffer(e2)) throw new TypeError("argument should be a Buffer");
if (r2 || (r2 = 0), n2 || 0 === n2 || (n2 = this.length), t4 >= e2.length && (t4 = e2.length), t4 || (t4 = 0), n2 > 0 && n2 < r2 && (n2 = r2), n2 === r2) return 0;
if (0 === e2.length || 0 === this.length) return 0;
if (t4 < 0) throw new RangeError("targetStart out of bounds");
if (r2 < 0 || r2 >= this.length) throw new RangeError("Index out of range");
if (n2 < 0) throw new RangeError("sourceEnd out of bounds");
n2 > this.length && (n2 = this.length), e2.length - t4 < n2 - r2 && (n2 = e2.length - t4 + r2);
var i2 = n2 - r2;
if (this === e2 && "function" == typeof Uint8Array.prototype.copyWithin) this.copyWithin(t4, r2, n2);
else if (this === e2 && r2 < t4 && t4 < n2) for (var o2 = i2 - 1; o2 >= 0; --o2) e2[o2 + t4] = this[o2 + r2];
else Uint8Array.prototype.set.call(e2, this.subarray(r2, n2), t4);
return i2;
}, s.prototype.fill = function(e2, t4, r2, n2) {
if ("string" == typeof e2) {
if ("string" == typeof t4 ? (n2 = t4, t4 = 0, r2 = this.length) : "string" == typeof r2 && (n2 = r2, r2 = this.length), void 0 !== n2 && "string" != typeof n2) throw new TypeError("encoding must be a string");
if ("string" == typeof n2 && !s.isEncoding(n2)) throw new TypeError("Unknown encoding: " + n2);
if (1 === e2.length) {
var i2 = e2.charCodeAt(0);
("utf8" === n2 && i2 < 128 || "latin1" === n2) && (e2 = i2);
}
} else "number" == typeof e2 && (e2 &= 255);
if (t4 < 0 || this.length < t4 || this.length < r2) throw new RangeError("Out of range index");
if (r2 <= t4) return this;
var o2;
if (t4 >>>= 0, r2 = void 0 === r2 ? this.length : r2 >>> 0, e2 || (e2 = 0), "number" == typeof e2) for (o2 = t4; o2 < r2; ++o2) this[o2] = e2;
else {
var a2 = s.isBuffer(e2) ? e2 : s.from(e2, n2), l2 = a2.length;
if (0 === l2) throw new TypeError('The value "' + e2 + '" is invalid for argument "value"');
for (o2 = 0; o2 < r2 - t4; ++o2) this[o2 + t4] = a2[o2 % l2];
}
return this;
};
var I = /[^+/0-9A-Za-z-_]/g;
function N(e2) {
return e2 < 16 ? "0" + e2.toString(16) : e2.toString(16);
}
function P(e2, t4) {
var r2;
t4 = t4 || 1 / 0;
for (var n2 = e2.length, i2 = null, s2 = [], o2 = 0; o2 < n2; ++o2) {
if ((r2 = e2.charCodeAt(o2)) > 55295 && r2 < 57344) {
if (!i2) {
if (r2 > 56319) {
(t4 -= 3) > -1 && s2.push(239, 191, 189);
continue;
}
if (o2 + 1 === n2) {
(t4 -= 3) > -1 && s2.push(239, 191, 189);
continue;
}
i2 = r2;
continue;
}
if (r2 < 56320) {
(t4 -= 3) > -1 && s2.push(239, 191, 189), i2 = r2;
continue;
}
r2 = 65536 + (i2 - 55296 << 10 | r2 - 56320);
} else i2 && (t4 -= 3) > -1 && s2.push(239, 191, 189);
if (i2 = null, r2 < 128) {
if ((t4 -= 1) < 0) break;
s2.push(r2);
} else if (r2 < 2048) {
if ((t4 -= 2) < 0) break;
s2.push(r2 >> 6 | 192, 63 & r2 | 128);
} else if (r2 < 65536) {
if ((t4 -= 3) < 0) break;
s2.push(r2 >> 12 | 224, r2 >> 6 & 63 | 128, 63 & r2 | 128);
} else {
if (!(r2 < 1114112)) throw new Error("Invalid code point");
if ((t4 -= 4) < 0) break;
s2.push(r2 >> 18 | 240, r2 >> 12 & 63 | 128, r2 >> 6 & 63 | 128, 63 & r2 | 128);
}
}
return s2;
}
function B(e2) {
return t3.toByteArray((function(e3) {
if ((e3 = (e3 = e3.split("=")[0]).trim().replace(I, "")).length < 2) return "";
for (; e3.length % 4 != 0; ) e3 += "=";
return e3;
})(e2));
}
function D(e2, t4, r2, n2) {
for (var i2 = 0; i2 < n2 && !(i2 + r2 >= t4.length || i2 >= e2.length); ++i2) t4[i2 + r2] = e2[i2];
return i2;
}
function F(e2, t4) {
return e2 instanceof t4 || null != e2 && null != e2.constructor && null != e2.constructor.name && e2.constructor.name === t4.name;
}
function L(e2) {
return e2 != e2;
}
}).call(this);
}).call(this, e("buffer").Buffer);
}, { "base64-js": 185, buffer: 220, ieee754: 439 }], 221: [function(e, t, r) {
var n = e("safe-buffer").Buffer, i = e("stream").Transform, s = e("string_decoder").StringDecoder;
function o(e2) {
i.call(this), this.hashMode = "string" == typeof e2, this.hashMode ? this[e2] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null;
}
e("inherits")(o, i), o.prototype.update = function(e2, t2, r2) {
"string" == typeof e2 && (e2 = n.from(e2, t2));
var i2 = this._update(e2);
return this.hashMode ? this : (r2 && (i2 = this._toString(i2, r2)), i2);
}, o.prototype.setAutoPadding = function() {
}, o.prototype.getAuthTag = function() {
throw new Error("trying to get auth tag in unsupported state");
}, o.prototype.setAuthTag = function() {
throw new Error("trying to set auth tag in unsupported state");
}, o.prototype.setAAD = function() {
throw new Error("trying to set aad in unsupported state");
}, o.prototype._transform = function(e2, t2, r2) {
var n2;
try {
this.hashMode ? this._update(e2) : this.push(this._update(e2));
} catch (e3) {
n2 = e3;
} finally {
r2(n2);
}
}, o.prototype._flush = function(e2) {
var t2;
try {
this.push(this.__final());
} catch (e3) {
t2 = e3;
}
e2(t2);
}, o.prototype._finalOrDigest = function(e2) {
var t2 = this.__final() || n.alloc(0);
return e2 && (t2 = this._toString(t2, e2, true)), t2;
}, o.prototype._toString = function(e2, t2, r2) {
if (this._decoder || (this._decoder = new s(t2), this._encoding = t2), this._encoding !== t2) throw new Error("can't switch encodings");
var n2 = this._decoder.write(e2);
return r2 && (n2 += this._decoder.end()), n2;
}, t.exports = o;
}, { inherits: 440, "safe-buffer": 494, stream: 505, string_decoder: 218 }], 222: [function(e, t, r) {
var n = e("../internals/is-callable"), i = e("../internals/try-to-string"), s = TypeError;
t.exports = function(e2) {
if (n(e2)) return e2;
throw new s(i(e2) + " is not a function");
};
}, { "../internals/is-callable": 285, "../internals/try-to-string": 349 }], 223: [function(e, t, r) {
var n = e("../internals/is-constructor"), i = e("../internals/try-to-string"), s = TypeError;
t.exports = function(e2) {
if (n(e2)) return e2;
throw new s(i(e2) + " is not a constructor");
};
}, { "../internals/is-constructor": 286, "../internals/try-to-string": 349 }], 224: [function(e, t, r) {
var n = e("../internals/is-callable"), i = String, s = TypeError;
t.exports = function(e2) {
if ("object" == typeof e2 || n(e2)) return e2;
throw new s("Can't set " + i(e2) + " as a prototype");
};
}, { "../internals/is-callable": 285 }], 225: [function(e, t, r) {
var n = e("../internals/well-known-symbol"), i = e("../internals/object-create"), s = e("../internals/object-define-property").f, o = n("unscopables"), a = Array.prototype;
void 0 === a[o] && s(a, o, { configurable: true, value: i(null) }), t.exports = function(e2) {
a[o][e2] = true;
};
}, { "../internals/object-create": 306, "../internals/object-define-property": 308, "../internals/well-known-symbol": 357 }], 226: [function(e, t, r) {
var n = e("../internals/object-is-prototype-of"), i = TypeError;
t.exports = function(e2, t2) {
if (n(t2, e2)) return e2;
throw new i("Incorrect invocation");
};
}, { "../internals/object-is-prototype-of": 314 }], 227: [function(e, t, r) {
var n = e("../internals/is-object"), i = String, s = TypeError;
t.exports = function(e2) {
if (n(e2)) return e2;
throw new s(i(e2) + " is not an object");
};
}, { "../internals/is-object": 289 }], 228: [function(e, t, r) {
var n = e("../internals/to-indexed-object"), i = e("../internals/to-absolute-index"), s = e("../internals/length-of-array-like"), o = function(e2) {
return function(t2, r2, o2) {
var a, l = n(t2), c = s(l), u = i(o2, c);
if (e2 && r2 != r2) {
for (; c > u; ) if ((a = l[u++]) != a) return true;
} else for (; c > u; u++) if ((e2 || u in l) && l[u] === r2) return e2 || u || 0;
return !e2 && -1;
};
};
t.exports = { includes: o(true), indexOf: o(false) };
}, { "../internals/length-of-array-like": 299, "../internals/to-absolute-index": 340, "../internals/to-indexed-object": 341 }], 229: [function(e, t, r) {
var n = e("../internals/function-bind-context"), i = e("../internals/function-uncurry-this"), s = e("../internals/indexed-object"), o = e("../internals/to-object"), a = e("../internals/length-of-array-like"), l = e("../internals/array-species-create"), c = i([].push), u = function(e2) {
var t2 = 1 === e2, r2 = 2 === e2, i2 = 3 === e2, u2 = 4 === e2, h = 6 === e2, f = 7 === e2, d = 5 === e2 || h;
return function(p, m, b, g) {
for (var y, v, w = o(p), _ = s(w), x = n(m, b), k = a(_), S = 0, M = g || l, C = t2 ? M(p, k) : r2 || f ? M(p, 0) : void 0; k > S; S++) if ((d || S in _) && (v = x(y = _[S], S, w), e2)) if (t2) C[S] = v;
else if (v) switch (e2) {
case 3:
return true;
case 5:
return y;
case 6:
return S;
case 2:
c(C, y);
}
else switch (e2) {
case 4:
return false;
case 7:
c(C, y);
}
return h ? -1 : i2 || u2 ? u2 : C;
};
};
t.exports = { forEach: u(0), map: u(1), filter: u(2), some: u(3), every: u(4), find: u(5), findIndex: u(6), filterReject: u(7) };
}, { "../internals/array-species-create": 233, "../internals/function-bind-context": 262, "../internals/function-uncurry-this": 268, "../internals/indexed-object": 280, "../internals/length-of-array-like": 299, "../internals/to-object": 344 }], 230: [function(e, t, r) {
var n = e("../internals/to-absolute-index"), i = e("../internals/length-of-array-like"), s = e("../internals/create-property"), o = Array, a = Math.max;
t.exports = function(e2, t2, r2) {
for (var l = i(e2), c = n(t2, l), u = n(void 0 === r2 ? l : r2, l), h = o(a(u - c, 0)), f = 0; c < u; c++, f++) s(h, f, e2[c]);
return h.length = f, h;
};
}, { "../internals/create-property": 243, "../internals/length-of-array-like": 299, "../internals/to-absolute-index": 340 }], 231: [function(e, t, r) {
var n = e("../internals/function-uncurry-this");
t.exports = n([].slice);
}, { "../internals/function-uncurry-this": 268 }], 232: [function(e, t, r) {
var n = e("../internals/is-array"), i = e("../internals/is-constructor"), s = e("../internals/is-object"), o = e("../internals/well-known-symbol")("species"), a = Array;
t.exports = function(e2) {
var t2;
return n(e2) && (t2 = e2.constructor, (i(t2) && (t2 === a || n(t2.prototype)) || s(t2) && null === (t2 = t2[o])) && (t2 = void 0)), void 0 === t2 ? a : t2;
};
}, { "../internals/is-array": 284, "../internals/is-constructor": 286, "../internals/is-object": 289, "../internals/well-known-symbol": 357 }], 233: [function(e, t, r) {
var n = e("../internals/array-species-constructor");
t.exports = function(e2, t2) {
return new (n(e2))(0 === t2 ? 0 : t2);
};
}, { "../internals/array-species-constructor": 232 }], 234: [function(e, t, r) {
var n = e("../internals/well-known-symbol")("iterator"), i = false;
try {
var s = 0, o = { next: function() {
return { done: !!s++ };
}, return: function() {
i = true;
} };
o[n] = function() {
return this;
}, Array.from(o, (function() {
throw 2;
}));
} catch (e2) {
}
t.exports = function(e2, t2) {
try {
if (!t2 && !i) return false;
} catch (e3) {
return false;
}
var r2 = false;
try {
var s2 = {};
s2[n] = function() {
return { next: function() {
return { done: r2 = true };
} };
}, e2(s2);
} catch (e3) {
}
return r2;
};
}, { "../internals/well-known-symbol": 357 }], 235: [function(e, t, r) {
var n = e("../internals/function-uncurry-this"), i = n({}.toString), s = n("".slice);
t.exports = function(e2) {
return s(i(e2), 8, -1);
};
}, { "../internals/function-uncurry-this": 268 }], 236: [function(e, t, r) {
var n = e("../internals/to-string-tag-support"), i = e("../internals/is-callable"), s = e("../internals/classof-raw"), o = e("../internals/well-known-symbol")("toStringTag"), a = Object, l = "Arguments" === s(/* @__PURE__ */ (function() {
return arguments;
})());
t.exports = n ? s : function(e2) {
var t2, r2, n2;
return void 0 === e2 ? "Undefined" : null === e2 ? "Null" : "string" == typeof (r2 = (function(e3, t3) {
try {
return e3[t3];
} catch (e4) {
}
})(t2 = a(e2), o)) ? r2 : l ? s(t2) : "Object" === (n2 = s(t2)) && i(t2.callee) ? "Arguments" : n2;
};
}, { "../internals/classof-raw": 235, "../internals/is-callable": 285, "../internals/to-string-tag-support": 347, "../internals/well-known-symbol": 357 }], 237: [function(e, t, r) {
var n = e("../internals/has-own-property"), i = e("../internals/own-keys"), s = e("../internals/object-get-own-property-descriptor"), o = e("../internals/object-define-property");
t.exports = function(e2, t2, r2) {
for (var a = i(t2), l = o.f, c = s.f, u = 0; u < a.length; u++) {
var h = a[u];
n(e2, h) || r2 && n(r2, h) || l(e2, h, c(t2, h));
}
};
}, { "../internals/has-own-property": 275, "../internals/object-define-property": 308, "../internals/object-get-own-property-descriptor": 309, "../internals/own-keys": 321 }], 238: [function(e, t, r) {
var n = e("../internals/well-known-symbol")("match");
t.exports = function(e2) {
var t2 = /./;
try {
"/./"[e2](t2);
} catch (r2) {
try {
return t2[n] = false, "/./"[e2](t2);
} catch (e3) {
}
}
return false;
};
}, { "../internals/well-known-symbol": 357 }], 239: [function(e, t, r) {
var n = e("../internals/fails");
t.exports = !n((function() {
function e2() {
}
return e2.prototype.constructor = null, Object.getPrototypeOf(new e2()) !== e2.prototype;
}));
}, { "../internals/fails": 260 }], 240: [function(e, t, r) {
t.exports = function(e2, t2) {
return { value: e2, done: t2 };
};
}, {}], 241: [function(e, t, r) {
var n = e("../internals/descriptors"), i = e("../internals/object-define-property"), s = e("../internals/create-property-descriptor");
t.exports = n ? function(e2, t2, r2) {
return i.f(e2, t2, s(1, r2));
} : function(e2, t2, r2) {
return e2[t2] = r2, e2;
};
}, { "../internals/create-property-descriptor": 242, "../internals/descriptors": 247, "../internals/object-define-property": 308 }], 242: [function(e, t, r) {
t.exports = function(e2, t2) {
return { enumerable: !(1 & e2), configurable: !(2 & e2), writable: !(4 & e2), value: t2 };
};
}, {}], 243: [function(e, t, r) {
var n = e("../internals/to-property-key"), i = e("../internals/object-define-property"), s = e("../internals/create-property-descriptor");
t.exports = function(e2, t2, r2) {
var o = n(t2);
o in e2 ? i.f(e2, o, s(0, r2)) : e2[o] = r2;
};
}, { "../internals/create-property-descriptor": 242, "../internals/object-define-property": 308, "../internals/to-property-key": 346 }], 244: [function(e, t, r) {
var n = e("../internals/make-built-in"), i = e("../internals/object-define-property");
t.exports = function(e2, t2, r2) {
return r2.get && n(r2.get, t2, { getter: true }), r2.set && n(r2.set, t2, { setter: true }), i.f(e2, t2, r2);
};
}, { "../internals/make-built-in": 300, "../internals/object-define-property": 308 }], 245: [function(e, t, r) {
var n = e("../internals/is-callable"), i = e("../internals/object-define-property"), s = e("../internals/make-built-in"), o = e("../internals/define-global-property");
t.exports = function(e2, t2, r2, a) {
a || (a = {});
var l = a.enumerable, c = void 0 !== a.name ? a.name : t2;
if (n(r2) && s(r2, c, a), a.global) l ? e2[t2] = r2 : o(t2, r2);
else {
try {
a.unsafe ? e2[t2] && (l = true) : delete e2[t2];
} catch (e3) {
}
l ? e2[t2] = r2 : i.f(e2, t2, { value: r2, enumerable: false, configurable: !a.nonConfigurable, writable: !a.nonWritable });
}
return e2;
};
}, { "../internals/define-global-property": 246, "../internals/is-callable": 285, "../internals/make-built-in": 300, "../internals/object-define-property": 308 }], 246: [function(e, t, r) {
var n = e("../internals/global"), i = Object.defineProperty;
t.exports = function(e2, t2) {
try {
i(n, e2, { value: t2, configurable: true, writable: true });
} catch (r2) {
n[e2] = t2;
}
return t2;
};
}, { "../internals/global": 274 }], 247: [function(e, t, r) {
var n = e("../internals/fails");
t.exports = !n((function() {
return 7 !== Object.defineProperty({}, 1, { get: function() {
return 7;
} })[1];
}));
}, { "../internals/fails": 260 }], 248: [function(e, t, r) {
var n = "object" == typeof document && document.all, i = void 0 === n && void 0 !== n;
t.exports = { all: n, IS_HTMLDDA: i };
}, {}], 249: [function(e, t, r) {
var n = e("../internals/global"), i = e("../internals/is-object"), s = n.document, o = i(s) && i(s.createElement);
t.exports = function(e2) {
return o ? s.createElement(e2) : {};
};
}, { "../internals/global": 274, "../internals/is-object": 289 }], 250: [function(e, t, r) {
var n = e("../internals/engine-is-deno"), i = e("../internals/engine-is-node");
t.exports = !n && !i && "object" == typeof window && "object" == typeof document;
}, { "../internals/engine-is-deno": 251, "../internals/engine-is-node": 254 }], 251: [function(e, t, r) {
t.exports = "object" == typeof Deno && Deno && "object" == typeof Deno.version;
}, {}], 252: [function(e, t, r) {
var n = e("../internals/engine-user-agent");
t.exports = /ipad|iphone|ipod/i.test(n) && "undefined" != typeof Pebble;
}, { "../internals/engine-user-agent": 256 }], 253: [function(e, t, r) {
var n = e("../internals/engine-user-agent");
t.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(n);
}, { "../internals/engine-user-agent": 256 }], 254: [function(e, t, r) {
var n = e("../internals/global"), i = e("../internals/classof-raw");
t.exports = "process" === i(n.process);
}, { "../internals/classof-raw": 235, "../internals/global": 274 }], 255: [function(e, t, r) {
var n = e("../internals/engine-user-agent");
t.exports = /web0s(?!.*chrome)/i.test(n);
}, { "../internals/engine-user-agent": 256 }], 256: [function(e, t, r) {
t.exports = "undefined" != typeof navigator && String(navigator.userAgent) || "";
}, {}], 257: [function(e, t, r) {
var n, i, s = e("../internals/global"), o = e("../internals/engine-user-agent"), a = s.process, l = s.Deno, c = a && a.versions || l && l.version, u = c && c.v8;
u && (i = (n = u.split("."))[0] > 0 && n[0] < 4 ? 1 : +(n[0] + n[1])), !i && o && (!(n = o.match(/Edge\/(\d+)/)) || n[1] >= 74) && (n = o.match(/Chrome\/(\d+)/)) && (i = +n[1]), t.exports = i;
}, { "../internals/engine-user-agent": 256, "../internals/global": 274 }], 258: [function(e, t, r) {
t.exports = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"];
}, {}], 259: [function(e, t, r) {
var n = e("../internals/global"), i = e("../internals/object-get-own-property-descriptor").f, s = e("../internals/create-non-enumerable-property"), o = e("../internals/define-built-in"), a = e("../internals/define-global-property"), l = e("../internals/copy-constructor-properties"), c = e("../internals/is-forced");
t.exports = function(e2, t2) {
var r2, u, h, f, d, p = e2.target, m = e2.global, b = e2.stat;
if (r2 = m ? n : b ? n[p] || a(p, {}) : (n[p] || {}).prototype) for (u in t2) {
if (f = t2[u], h = e2.dontCallGetSet ? (d = i(r2, u)) && d.value : r2[u], !c(m ? u : p + (b ? "." : "#") + u, e2.forced) && void 0 !== h) {
if (typeof f == typeof h) continue;
l(f, h);
}
(e2.sham || h && h.sham) && s(f, "sham", true), o(r2, u, f, e2);
}
};
}, { "../internals/copy-constructor-properties": 237, "../internals/create-non-enumerable-property": 241, "../internals/define-built-in": 245, "../internals/define-global-property": 246, "../internals/global": 274, "../internals/is-forced": 287, "../internals/object-get-own-property-descriptor": 309 }], 260: [function(e, t, r) {
t.exports = function(e2) {
try {
return !!e2();
} catch (e3) {
return true;
}
};
}, {}], 261: [function(e, t, r) {
var n = e("../internals/function-bind-native"), i = Function.prototype, s = i.apply, o = i.call;
t.exports = "object" == typeof Reflect && Reflect.apply || (n ? o.bind(s) : function() {
return o.apply(s, arguments);
});
}, { "../internals/function-bind-native": 263 }], 262: [function(e, t, r) {
var n = e("../internals/function-uncurry-this-clause"), i = e("../internals/a-callable"), s = e("../internals/function-bind-native"), o = n(n.bind);
t.exports = function(e2, t2) {
return i(e2), void 0 === t2 ? e2 : s ? o(e2, t2) : function() {
return e2.apply(t2, arguments);
};
};
}, { "../internals/a-callable": 222, "../internals/function-bind-native": 263, "../internals/function-uncurry-this-clause": 267 }], 263: [function(e, t, r) {
var n = e("../internals/fails");
t.exports = !n((function() {
var e2 = (function() {
}).bind();
return "function" != typeof e2 || e2.hasOwnProperty("prototype");
}));
}, { "../internals/fails": 260 }], 264: [function(e, t, r) {
var n = e("../internals/function-bind-native"), i = Function.prototype.call;
t.exports = n ? i.bind(i) : function() {
return i.apply(i, arguments);
};
}, { "../internals/function-bind-native": 263 }], 265: [function(e, t, r) {
var n = e("../internals/descriptors"), i = e("../internals/has-own-property"), s = Function.prototype, o = n && Object.getOwnPropertyDescriptor, a = i(s, "name"), l = a && "something" === (function() {
}).name, c = a && (!n || n && o(s, "name").configurable);
t.exports = { EXISTS: a, PROPER: l, CONFIGURABLE: c };
}, { "../internals/descriptors": 247, "../internals/has-own-property": 275 }], 266: [function(e, t, r) {
var n = e("../internals/function-uncurry-this"), i = e("../internals/a-callable");
t.exports = function(e2, t2, r2) {
try {
return n(i(Object.getOwnPropertyDescriptor(e2, t2)[r2]));
} catch (e3) {
}
};
}, { "../internals/a-callable": 222, "../internals/function-uncurry-this": 268 }], 267: [function(e, t, r) {
var n = e("../internals/classof-raw"), i = e("../internals/function-uncurry-this");
t.exports = function(e2) {
if ("Function" === n(e2)) return i(e2);
};
}, { "../internals/classof-raw": 235, "../internals/function-uncurry-this": 268 }], 268: [function(e, t, r) {
var n = e("../internals/function-bind-native"), i = Function.prototype, s = i.call, o = n && i.bind.bind(s, s);
t.exports = n ? o : function(e2) {
return function() {
return s.apply(e2, arguments);
};
};
}, { "../internals/function-bind-native": 263 }], 269: [function(e, t, r) {
var n = e("../internals/global"), i = e("../internals/is-callable"), s = function(e2) {
return i(e2) ? e2 : void 0;
};
t.exports = function(e2, t2) {
return arguments.length < 2 ? s(n[e2]) : n[e2] && n[e2][t2];
};
}, { "../internals/global": 274, "../internals/is-callable": 285 }], 270: [function(e, t, r) {
var n = e("../internals/classof"), i = e("../internals/get-method"), s = e("../internals/is-null-or-undefined"), o = e("../internals/iterators"), a = e("../internals/well-known-symbol")("iterator");
t.exports = function(e2) {
if (!s(e2)) return i(e2, a) || i(e2, "@@iterator") || o[n(e2)];
};
}, { "../internals/classof": 236, "../internals/get-method": 273, "../internals/is-null-or-undefined": 288, "../internals/iterators": 298, "../internals/well-known-symbol": 357 }], 271: [function(e, t, r) {
var n = e("../internals/function-call"), i = e("../internals/a-callable"), s = e("../internals/an-object"), o = e("../internals/try-to-string"), a = e("../internals/get-iterator-method"), l = TypeError;
t.exports = function(e2, t2) {
var r2 = arguments.length < 2 ? a(e2) : t2;
if (i(r2)) return s(n(r2, e2));
throw new l(o(e2) + " is not iterable");
};
}, { "../internals/a-callable": 222, "../internals/an-object": 227, "../internals/function-call": 264, "../internals/get-iterator-method": 270, "../internals/try-to-string": 349 }], 272: [function(e, t, r) {
var n = e("../internals/function-uncurry-this"), i = e("../internals/is-array"), s = e("../internals/is-callable"), o = e("../internals/classof-raw"), a = e("../internals/to-string"), l = n([].push);
t.exports = function(e2) {
if (s(e2)) return e2;
if (i(e2)) {
for (var t2 = e2.length, r2 = [], n2 = 0; n2 < t2; n2++) {
var c = e2[n2];
"string" == typeof c ? l(r2, c) : "number" != typeof c && "Number" !== o(c) && "String" !== o(c) || l(r2, a(c));
}
var u = r2.length, h = true;
return function(e3, t3) {
if (h) return h = false, t3;
if (i(this)) return t3;
for (var n3 = 0; n3 < u; n3++) if (r2[n3] === e3) return t3;
};
}
};
}, { "../internals/classof-raw": 235, "../internals/function-uncurry-this": 268, "../internals/is-array": 284, "../internals/is-callable": 285, "../internals/to-string": 348 }], 273: [function(e, t, r) {
var n = e("../internals/a-callable"), i = e("../internals/is-null-or-undefined");
t.exports = function(e2, t2) {
var r2 = e2[t2];
return i(r2) ? void 0 : n(r2);
};
}, { "../internals/a-callable": 222, "../internals/is-null-or-undefined": 288 }], 274: [function(e, t, r) {
(function(e2) {
(function() {
var r2 = function(e3) {
return e3 && e3.Math === Math && e3;
};
t.exports = r2("object" == typeof globalThis && globalThis) || r2("object" == typeof window && window) || r2("object" == typeof self && self) || r2("object" == typeof e2 && e2) || /* @__PURE__ */ (function() {
return this;
})() || this || Function("return this")();
}).call(this);
}).call(this, "undefined" != typeof commonjsGlobal ? commonjsGlobal : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {});
}, {}], 275: [function(e, t, r) {
var n = e("../internals/function-uncurry-this"), i = e("../internals/to-object"), s = n({}.hasOwnProperty);
t.exports = Object.hasOwn || function(e2, t2) {
return s(i(e2), t2);
};
}, { "../internals/function-uncurry-this": 268, "../internals/to-object": 344 }], 276: [function(e, t, r) {
t.exports = {};
}, {}], 277: [function(e, t, r) {
t.exports = function(e2, t2) {
try {
1 === arguments.length ? console.error(e2) : console.error(e2, t2);
} catch (e3) {
}
};
}, {}], 278: [function(e, t, r) {
var n = e("../internals/get-built-in");
t.exports = n("document", "documentElement");
}, { "../internals/get-built-in": 269 }], 279: [function(e, t, r) {
var n = e("../internals/descriptors"), i = e("../internals/fails"), s = e("../internals/document-create-element");
t.exports = !n && !i((function() {
return 7 !== Object.defineProperty(s("div"), "a", { get: function() {
return 7;
} }).a;
}));
}, { "../internals/descriptors": 247, "../internals/document-create-element": 249, "../internals/fails": 260 }], 280: [function(e, t, r) {
var n = e("../internals/function-uncurry-this"), i = e("../internals/fails"), s = e("../internals/classof-raw"), o = Object, a = n("".split);
t.exports = i((function() {
return !o("z").propertyIsEnumerable(0);
})) ? function(e2) {
return "String" === s(e2) ? a(e2, "") : o(e2);
} : o;
}, { "../internals/classof-raw": 235, "../internals/fails": 260, "../internals/function-uncurry-this": 268 }], 281: [function(e, t, r) {
var n = e("../internals/function-uncurry-this"), i = e("../internals/is-callable"), s = e("../internals/shared-store"), o = n(Function.toString);
i(s.inspectSource) || (s.inspectSource = function(e2) {
return o(e2);
}), t.exports = s.inspectSource;
}, { "../internals/function-uncurry-this": 268, "../internals/is-callable": 285, "../internals/shared-store": 333 }], 282: [function(e, t, r) {
var n, i, s, o = e("../internals/weak-map-basic-detection"), a = e("../internals/global"), l = e("../internals/is-object"), c = e("../internals/create-non-enumerable-property"), u = e("../internals/has-own-property"), h = e("../internals/shared-store"), f = e("../internals/shared-key"), d = e("../internals/hidden-keys"), p = a.TypeError, m = a.WeakMap;
if (o || h.state) {
var b = h.state || (h.state = new m());
b.get = b.get, b.has = b.has, b.set = b.set, n = function(e2, t2) {
if (b.has(e2)) throw new p("Object already initialized");
return t2.facade = e2, b.set(e2, t2), t2;
}, i = function(e2) {
return b.get(e2) || {};
}, s = function(e2) {
return b.has(e2);
};
} else {
var g = f("state");
d[g] = true, n = function(e2, t2) {
if (u(e2, g)) throw new p("Object already initialized");
return t2.facade = e2, c(e2, g, t2), t2;
}, i = function(e2) {
return u(e2, g) ? e2[g] : {};
}, s = function(e2) {
return u(e2, g);
};
}
t.exports = { set: n, get: i, has: s, enforce: function(e2) {
return s(e2) ? i(e2) : n(e2, {});
}, getterFor: function(e2) {
return function(t2) {
var r2;
if (!l(t2) || (r2 = i(t2)).type !== e2) throw new p("Incompatible receiver, " + e2 + " required");
return r2;
};
} };
}, { "../internals/create-non-enumerable-property": 241, "../internals/global": 274, "../internals/has-own-property": 275, "../internals/hidden-keys": 276, "../internals/is-object": 289, "../internals/shared-key": 332, "../internals/shared-store": 333, "../internals/weak-map-basic-detection": 354 }], 283: [function(e, t, r) {
var n = e("../internals/well-known-symbol"), i = e("../internals/iterators"), s = n("iterator"), o = Array.prototype;
t.exports = function(e2) {
return void 0 !== e2 && (i.Array === e2 || o[s] === e2);
};
}, { "../internals/iterators": 298, "../internals/well-known-symbol": 357 }], 284: [function(e, t, r) {
var n = e("../internals/classof-raw");
t.exports = Array.isArray || function(e2) {
return "Array" === n(e2);
};
}, { "../internals/classof-raw": 235 }], 285: [function(e, t, r) {
var n = e("../internals/document-all"), i = n.all;
t.exports = n.IS_HTMLDDA ? function(e2) {
return "function" == typeof e2 || e2 === i;
} : function(e2) {
return "function" == typeof e2;
};
}, { "../internals/document-all": 248 }], 286: [function(e, t, r) {
var n = e("../internals/function-uncurry-this"), i = e("../internals/fails"), s = e("../internals/is-callable"), o = e("../internals/classof"), a = e("../internals/get-built-in"), l = e("../internals/inspect-source"), c = function() {
}, u = [], h = a("Reflect", "construct"), f = /^\s*(?:class|function)\b/, d = n(f.exec), p = !f.test(c), m = function(e2) {
if (!s(e2)) return false;
try {
return h(c, u, e2), true;
} catch (e3) {
return false;
}
}, b = function(e2) {
if (!s(e2)) return false;
switch (o(e2)) {
case "AsyncFunction":
case "GeneratorFunction":
case "AsyncGeneratorFunction":
return false;
}
try {
return p || !!d(f, l(e2));
} catch (e3) {
return true;
}
};
b.sham = true, t.exports = !h || i((function() {
var e2;
return m(m.call) || !m(Object) || !m((function() {
e2 = true;
})) || e2;
})) ? b : m;
}, { "../internals/classof": 236, "../internals/fails": 260, "../internals/function-uncurry-this": 268, "../internals/get-built-in": 269, "../internals/inspect-source": 281, "../internals/is-callable": 285 }], 287: [function(e, t, r) {
var n = e("../internals/fails"), i = e("../internals/is-callable"), s = /#|\.prototype\./, o = function(e2, t2) {
var r2 = l[a(e2)];
return r2 === u || r2 !== c && (i(t2) ? n(t2) : !!t2);
}, a = o.normalize = function(e2) {
return String(e2).replace(s, ".").toLowerCase();
}, l = o.data = {}, c = o.NATIVE = "N", u = o.POLYFILL = "P";
t.exports = o;
}, { "../internals/fails": 260, "../internals/is-callable": 285 }], 288: [function(e, t, r) {
t.exports = function(e2) {
return null == e2;
};
}, {}], 289: [function(e, t, r) {
var n = e("../internals/is-callable"), i = e("../internals/document-all"), s = i.all;
t.exports = i.IS_HTMLDDA ? function(e2) {
return "object" == typeof e2 ? null !== e2 : n(e2) || e2 === s;
} : function(e2) {
return "object" == typeof e2 ? null !== e2 : n(e2);
};
}, { "../internals/document-all": 248, "../internals/is-callable": 285 }], 290: [function(e, t, r) {
t.exports = false;
}, {}], 291: [function(e, t, r) {
var n = e("../internals/is-object"), i = e("../internals/classof-raw"), s = e("../internals/well-known-symbol")("match");
t.exports = function(e2) {
var t2;
return n(e2) && (void 0 !== (t2 = e2[s]) ? !!t2 : "RegExp" === i(e2));
};
}, { "../internals/classof-raw": 235, "../internals/is-object": 289, "../internals/well-known-symbol": 357 }], 292: [function(e, t, r) {
var n = e("../internals/get-built-in"), i = e("../internals/is-callable"), s = e("../internals/object-is-prototype-of"), o = e("../internals/use-symbol-as-uid"), a = Object;
t.exports = o ? function(e2) {
return "symbol" == typeof e2;
} : function(e2) {
var t2 = n("Symbol");
return i(t2) && s(t2.prototype, a(e2));
};
}, { "../internals/get-built-in": 269, "../internals/is-callable": 285, "../internals/object-is-prototype-of": 314, "../internals/use-symbol-as-uid": 351 }], 293: [function(e, t, r) {
var n = e("../internals/function-bind-context"), i = e("../internals/function-call"), s = e("../internals/an-object"), o = e("../internals/try-to-string"), a = e("../internals/is-array-iterator-method"), l = e("../internals/length-of-array-like"), c = e("../internals/object-is-prototype-of"), u = e("../internals/get-iterator"), h = e("../internals/get-iterator-method"), f = e("../internals/iterator-close"), d = TypeError, p = function(e2, t2) {
this.stopped = e2, this.result = t2;
}, m = p.prototype;
t.exports = function(e2, t2, r2) {
var b, g, y, v, w, _, x, k = r2 && r2.that, S = !(!r2 || !r2.AS_ENTRIES), M = !(!r2 || !r2.IS_RECORD), C = !(!r2 || !r2.IS_ITERATOR), T = !(!r2 || !r2.INTERRUPTED), E = n(t2, k), A = function(e3) {
return b && f(b, "normal", e3), new p(true, e3);
}, R = function(e3) {
return S ? (s(e3), T ? E(e3[0], e3[1], A) : E(e3[0], e3[1])) : T ? E(e3, A) : E(e3);
};
if (M) b = e2.iterator;
else if (C) b = e2;
else {
if (!(g = h(e2))) throw new d(o(e2) + " is not iterable");
if (a(g)) {
for (y = 0, v = l(e2); v > y; y++) if ((w = R(e2[y])) && c(m, w)) return w;
return new p(false);
}
b = u(e2, g);
}
for (_ = M ? e2.next : b.next; !(x = i(_, b)).done; ) {
try {
w = R(x.value);
} catch (e3) {
f(b, "throw", e3);
}
if ("object" == typeof w && w && c(m, w)) return w;
}
return new p(false);
};
}, { "../internals/an-object": 227, "../internals/function-bind-context": 262, "../internals/function-call": 264, "../internals/get-iterator": 271, "../internals/get-iterator-method": 270, "../internals/is-array-iterator-method": 283, "../internals/iterator-close": 294, "../internals/length-of-array-like": 299, "../internals/object-is-prototype-of": 314, "../internals/try-to-string": 349 }], 294: [function(e, t, r) {
var n = e("../internals/function-call"), i = e("../internals/an-object"), s = e("../internals/get-method");
t.exports = function(e2, t2, r2) {
var o, a;
i(e2);
try {
if (!(o = s(e2, "return"))) {
if ("throw" === t2) throw r2;
return r2;
}
o = n(o, e2);
} catch (e3) {
a = true, o = e3;
}
if ("throw" === t2) throw r2;
if (a) throw o;
return i(o), r2;
};
}, { "../internals/an-object": 227, "../internals/function-call": 264, "../internals/get-method": 273 }], 295: [function(e, t, r) {
var n = e("../internals/iterators-core").IteratorPrototype, i = e("../internals/object-create"), s = e("../internals/create-property-descriptor"), o = e("../internals/set-to-string-tag"), a = e("../internals/iterators"), l = function() {
return this;
};
t.exports = function(e2, t2, r2, c) {
var u = t2 + " Iterator";
return e2.prototype = i(n, { next: s(+!c, r2) }), o(e2, u, false, true), a[u] = l, e2;
};
}, { "../internals/create-property-descriptor": 242, "../internals/iterators": 298, "../internals/iterators-core": 297, "../internals/object-create": 306, "../internals/set-to-string-tag": 331 }], 296: [function(e, t, r) {
var n = e("../internals/export"), i = e("../internals/function-call"), s = e("../internals/is-pure"), o = e("../internals/function-name"), a = e("../internals/is-callable"), l = e("../internals/iterator-create-constructor"), c = e("../internals/object-get-prototype-of"), u = e("../internals/object-set-prototype-of"), h = e("../internals/set-to-string-tag"), f = e("../internals/create-non-enumerable-property"), d = e("../internals/define-built-in"), p = e("../internals/well-known-symbol"), m = e("../internals/iterators"), b = e("../internals/iterators-core"), g = o.PROPER, y = o.CONFIGURABLE, v = b.IteratorPrototype, w = b.BUGGY_SAFARI_ITERATORS, _ = p("iterator"), x = function() {
return this;
};
t.exports = function(e2, t2, r2, o2, p2, b2, k) {
l(r2, t2, o2);
var S, M, C, T = function(e3) {
if (e3 === p2 && j) return j;
if (!w && e3 && e3 in R) return R[e3];
switch (e3) {
case "keys":
case "values":
case "entries":
return function() {
return new r2(this, e3);
};
}
return function() {
return new r2(this);
};
}, E = t2 + " Iterator", A = false, R = e2.prototype, O = R[_] || R["@@iterator"] || p2 && R[p2], j = !w && O || T(p2), I = "Array" === t2 && R.entries || O;
if (I && (S = c(I.call(new e2()))) !== Object.prototype && S.next && (s || c(S) === v || (u ? u(S, v) : a(S[_]) || d(S, _, x)), h(S, E, true, true), s && (m[E] = x)), g && "values" === p2 && O && "values" !== O.name && (!s && y ? f(R, "name", "values") : (A = true, j = function() {
return i(O, this);
})), p2) if (M = { values: T("values"), keys: b2 ? j : T("keys"), entries: T("entries") }, k) for (C in M) (w || A || !(C in R)) && d(R, C, M[C]);
else n({ target: t2, proto: true, forced: w || A }, M);
return s && !k || R[_] === j || d(R, _, j, { name: p2 }), m[t2] = j, M;
};
}, { "../internals/create-non-enumerable-property": 241, "../internals/define-built-in": 245, "../internals/export": 259, "../internals/function-call": 264, "../internals/function-name": 265, "../internals/is-callable": 285, "../internals/is-pure": 290, "../internals/iterator-create-constructor": 295, "../internals/iterators": 298, "../internals/iterators-core": 297, "../internals/object-get-prototype-of": 313, "../internals/object-set-prototype-of": 318, "../internals/set-to-string-tag": 331, "../internals/well-known-symbol": 357 }], 297: [function(e, t, r) {
var n, i, s, o = e("../internals/fails"), a = e("../internals/is-callable"), l = e("../internals/is-object"), c = e("../internals/object-create"), u = e("../internals/object-get-prototype-of"), h = e("../internals/define-built-in"), f = e("../internals/well-known-symbol"), d = e("../internals/is-pure"), p = f("iterator"), m = false;
[].keys && ("next" in (s = [].keys()) ? (i = u(u(s))) !== Object.prototype && (n = i) : m = true), !l(n) || o((function() {
var e2 = {};
return n[p].call(e2) !== e2;
})) ? n = {} : d && (n = c(n)), a(n[p]) || h(n, p, (function() {
return this;
})), t.exports = { IteratorPrototype: n, BUGGY_SAFARI_ITERATORS: m };
}, { "../internals/define-built-in": 245, "../internals/fails": 260, "../internals/is-callable": 285, "../internals/is-object": 289, "../internals/is-pure": 290, "../internals/object-create": 306, "../internals/object-get-prototype-of": 313, "../internals/well-known-symbol": 357 }], 298: [function(e, t, r) {
arguments[4][276][0].apply(r, arguments);
}, { dup: 276 }], 299: [function(e, t, r) {
var n = e("../internals/to-length");
t.exports = function(e2) {
return n(e2.length);
};
}, { "../internals/to-length": 343 }], 300: [function(e, t, r) {
var n = e("../internals/function-uncurry-this"), i = e("../internals/fails"), s = e("../internals/is-callable"), o = e("../internals/has-own-property"), a = e("../internals/descriptors"), l = e("../internals/function-name").CONFIGURABLE, c = e("../internals/inspect-source"), u = e("../internals/internal-state"), h = u.enforce, f = u.get, d = String, p = Object.defineProperty, m = n("".slice), b = n("".replace), g = n([].join), y = a && !i((function() {
return 8 !== p((function() {
}), "length", { value: 8 }).length;
})), v = String(String).split("String"), w = t.exports = function(e2, t2, r2) {
"Symbol(" === m(d(t2), 0, 7) && (t2 = "[" + b(d(t2), /^Symbol\(([^)]*)\)/, "$1") + "]"), r2 && r2.getter && (t2 = "get " + t2), r2 && r2.setter && (t2 = "set " + t2), (!o(e2, "name") || l && e2.name !== t2) && (a ? p(e2, "name", { value: t2, configurable: true }) : e2.name = t2), y && r2 && o(r2, "arity") && e2.length !== r2.arity && p(e2, "length", { value: r2.arity });
try {
r2 && o(r2, "constructor") && r2.constructor ? a && p(e2, "prototype", { writable: false }) : e2.prototype && (e2.prototype = void 0);
} catch (e3) {
}
var n2 = h(e2);
return o(n2, "source") || (n2.source = g(v, "string" == typeof t2 ? t2 : "")), e2;
};
Function.prototype.toString = w((function() {
return s(this) && f(this).source || c(this);
}), "toString");
}, { "../internals/descriptors": 247, "../internals/fails": 260, "../internals/function-name": 265, "../internals/function-uncurry-this": 268, "../internals/has-own-property": 275, "../internals/inspect-source": 281, "../internals/internal-state": 282, "../internals/is-callable": 285 }], 301: [function(e, t, r) {
var n = Math.ceil, i = Math.floor;
t.exports = Math.trunc || function(e2) {
var t2 = +e2;
return (t2 > 0 ? i : n)(t2);
};
}, {}], 302: [function(e, t, r) {
var n, i, s, o, a, l = e("../internals/global"), c = e("../internals/function-bind-context"), u = e("../internals/object-get-own-property-descriptor").f, h = e("../internals/task").set, f = e("../internals/queue"), d = e("../internals/engine-is-ios"), p = e("../internals/engine-is-ios-pebble"), m = e("../internals/engine-is-webos-webkit"), b = e("../internals/engine-is-node"), g = l.MutationObserver || l.WebKitMutationObserver, y = l.document, v = l.process, w = l.Promise, _ = u(l, "queueMicrotask"), x = _ && _.value;
if (!x) {
var k = new f(), S = function() {
var e2, t2;
for (b && (e2 = v.domain) && e2.exit(); t2 = k.get(); ) try {
t2();
} catch (e3) {
throw k.head && n(), e3;
}
e2 && e2.enter();
};
d || b || m || !g || !y ? !p && w && w.resolve ? ((o = w.resolve(void 0)).constructor = w, a = c(o.then, o), n = function() {
a(S);
}) : b ? n = function() {
v.nextTick(S);
} : (h = c(h, l), n = function() {
h(S);
}) : (i = true, s = y.createTextNode(""), new g(S).observe(s, { characterData: true }), n = function() {
s.data = i = !i;
}), x = function(e2) {
k.head || n(), k.add(e2);
};
}
t.exports = x;
}, { "../internals/engine-is-ios": 253, "../internals/engine-is-ios-pebble": 252, "../internals/engine-is-node": 254, "../internals/engine-is-webos-webkit": 255, "../internals/function-bind-context": 262, "../internals/global": 274, "../internals/object-get-own-property-descriptor": 309, "../internals/queue": 328, "../internals/task": 339 }], 303: [function(e, t, r) {
var n = e("../internals/a-callable"), i = TypeError, s = function(e2) {
var t2, r2;
this.promise = new e2((function(e3, n2) {
if (void 0 !== t2 || void 0 !== r2) throw new i("Bad Promise constructor");
t2 = e3, r2 = n2;
})), this.resolve = n(t2), this.reject = n(r2);
};
t.exports.f = function(e2) {
return new s(e2);
};
}, { "../internals/a-callable": 222 }], 304: [function(e, t, r) {
var n = e("../internals/is-regexp"), i = TypeError;
t.exports = function(e2) {
if (n(e2)) throw new i("The method doesn't accept regular expressions");
return e2;
};
}, { "../internals/is-regexp": 291 }], 305: [function(e, t, r) {
var n = e("../internals/descriptors"), i = e("../internals/function-uncurry-this"), s = e("../internals/function-call"), o = e("../internals/fails"), a = e("../internals/object-keys"), l = e("../internals/object-get-own-property-symbols"), c = e("../internals/object-property-is-enumerable"), u = e("../internals/to-object"), h = e("../internals/indexed-object"), f = Object.assign, d = Object.defineProperty, p = i([].concat);
t.exports = !f || o((function() {
if (n && 1 !== f({ b: 1 }, f(d({}, "a", { enumerable: true, get: function() {
d(this, "b", { value: 3, enumerable: false });
} }), { b: 2 })).b) return true;
var e2 = {}, t2 = {}, r2 = Symbol("assign detection");
return e2[r2] = 7, "abcdefghijklmnopqrst".split("").forEach((function(e3) {
t2[e3] = e3;
})), 7 !== f({}, e2)[r2] || "abcdefghijklmnopqrst" !== a(f({}, t2)).join("");
})) ? function(e2, t2) {
for (var r2 = u(e2), i2 = arguments.length, o2 = 1, f2 = l.f, d2 = c.f; i2 > o2; ) for (var m, b = h(arguments[o2++]), g = f2 ? p(a(b), f2(b)) : a(b), y = g.length, v = 0; y > v; ) m = g[v++], n && !s(d2, b, m) || (r2[m] = b[m]);
return r2;
} : f;
}, { "../internals/descriptors": 247, "../internals/fails": 260, "../internals/function-call": 264, "../internals/function-uncurry-this": 268, "../internals/indexed-object": 280, "../internals/object-get-own-property-symbols": 312, "../internals/object-keys": 316, "../internals/object-property-is-enumerable": 317, "../internals/to-object": 344 }], 306: [function(e, t, r) {
var n, i = e("../internals/an-object"), s = e("../internals/object-define-properties"), o = e("../internals/enum-bug-keys"), a = e("../internals/hidden-keys"), l = e("../internals/html"), c = e("../internals/document-create-element"), u = e("../internals/shared-key"), h = u("IE_PROTO"), f = function() {
}, d = function(e2) {
return "